diff --git a/orion-ops-launch/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm b/orion-ops-launch/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm
index 5c2c0d13..04d8b756 100644
--- a/orion-ops-launch/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm
+++ b/orion-ops-launch/src/main/resources/templates/orion-vue-views-components-card-list.vue.vm
@@ -42,6 +42,22 @@
+
+
+
+
+
+ 修改
+
+
+
+
+ 删除
+
+
#foreach($field in ${table.fields})
-
+
#if(${vue.enums.containsKey(${field.propertyName})})
([]);
- const emits = defineEmits(['openAdd', 'openUpdate', 'openUpdateConfig']);
+ const emits = defineEmits(['openAdd', 'openUpdate']);
const formModel = reactive<${vue.featureEntity}QueryRequest>({
searchValue: undefined,
@@ -117,18 +133,26 @@
});
// 删除当前行
- const deleteRow = async (id: number) => {
- try {
- setLoading(true);
- // 调用删除接口
- await delete${vue.featureEntity}(id);
- Message.success('删除成功');
- // 重新加载数据
- await fetchCardData();
- } catch (e) {
- } finally {
- setLoading(false);
- }
+ const deleteRow = (id: number) => {
+ Modal.confirm({
+ title: '删除前确认?',
+ titleAlign: 'start',
+ content: '确定要删除这条记录吗?',
+ okText: '删除',
+ onOk: async () => {
+ try {
+ setLoading(true);
+ // 调用删除接口
+ await delete${vue.featureEntity}(id);
+ Message.success('删除成功');
+ // 重新加载数据
+ await fetchCardData();
+ } catch (e) {
+ } finally {
+ setLoading(false);
+ }
+ }
+ });
};
// 添加后回调
@@ -175,4 +199,5 @@
diff --git a/orion-ops-ui/src/components/card/list/index.vue b/orion-ops-ui/src/components/card/list/index.vue
index 1bdcd768..aa46deb9 100644
--- a/orion-ops-ui/src/components/card/list/index.vue
+++ b/orion-ops-ui/src/components/card/list/index.vue
@@ -114,73 +114,85 @@
:class="{
'disabled-col': item.disabled === true
}">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ false"
+ @click="emits('click',item, index)"
+ @dblclick="emits('dblclick',item, index)">
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- {{ field.label + (fieldConfig.showColon ? ' :' : '') }}
-
-
-
-
-
-
- {{ item[field.dataIndex] }}
-
-
-
- {{ item[field.dataIndex] }}
-
-
-
-
-
-
+
+
+
+ {{ item[field.dataIndex] }}
+
+
+
+ {{ item[field.dataIndex] }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
[]
},
cardHeight: Number,
+ cardClass: String,
+ contextMenu: {
+ type: Boolean,
+ default: () => true
+ },
filterCount: {
type: Number,
default: () => 0
diff --git a/orion-ops-ui/src/views/asset/host-key/components/host-key-card-list.vue b/orion-ops-ui/src/views/asset/host-key/components/host-key-card-list.vue
index 1b49f0cc..9d2a604c 100644
--- a/orion-ops-ui/src/views/asset/host-key/components/host-key-card-list.vue
+++ b/orion-ops-ui/src/views/asset/host-key/components/host-key-card-list.vue
@@ -25,6 +25,12 @@
+
+
+
+ 详情
+
@@ -42,6 +48,28 @@
+
+
+
+
+
+ 详情
+
+
+
+
+ 修改
+
+
+
+
+ 删除
+
+
@@ -58,31 +86,39 @@
import { resetObject } from '@/utils';
import fieldConfig from '../types/card.fields';
import { deleteHostKey, getHostKeyPage, HostKeyQueryRequest, HostKeyQueryResponse } from '@/api/asset/host-key';
- import { Message } from '@arco-design/web-vue';
+ import { Message, Modal } from '@arco-design/web-vue';
const { loading, setLoading } = useLoading();
const cardColLayout = useColLayout();
const pagination = usePagination();
const list = ref([]);
- const emits = defineEmits(['openAdd', 'openUpdate', 'openUpdateConfig']);
+ const emits = defineEmits(['openAdd', 'openUpdate', 'openView']);
const formModel = reactive({
searchValue: undefined,
});
// 删除当前行
- const deleteRow = async (id: number) => {
- try {
- setLoading(true);
- // 调用删除接口
- await deleteHostKey(id);
- Message.success('删除成功');
- // 重新加载数据
- await fetchCardData();
- } catch (e) {
- } finally {
- setLoading(false);
- }
+ const deleteRow = (id: number) => {
+ Modal.confirm({
+ title: '删除前确认?',
+ titleAlign: 'start',
+ content: '确定要删除这条记录吗?',
+ okText: '删除',
+ onOk: async () => {
+ try {
+ setLoading(true);
+ // 调用删除接口
+ await deleteHostKey(id);
+ Message.success('删除成功');
+ // 重新加载数据
+ await fetchCardData();
+ } catch (e) {
+ } finally {
+ setLoading(false);
+ }
+ }
+ });
};
// 添加后回调
@@ -129,4 +165,5 @@
diff --git a/orion-ops-ui/src/views/asset/host-key/components/host-key-table.vue b/orion-ops-ui/src/views/asset/host-key/components/host-key-table.vue
index eb05ab3a..d1b525a5 100644
--- a/orion-ops-ui/src/views/asset/host-key/components/host-key-table.vue
+++ b/orion-ops-ui/src/views/asset/host-key/components/host-key-table.vue
@@ -55,12 +55,12 @@
-
+
- 查看
+ 详情
drawer.openView(e)"
@openAdd="() => drawer.openAdd()"
@openUpdate="(e) => drawer.openUpdate(e)" />
drawer.openView(e)"
@openAdd="() => drawer.openAdd()"
@openUpdate="(e) => drawer.openUpdate(e)" />
diff --git a/orion-ops-ui/src/views/asset/host/components/host-card-list.vue b/orion-ops-ui/src/views/asset/host/components/host-card-list.vue
index ff34a98b..273df03c 100644
--- a/orion-ops-ui/src/views/asset/host/components/host-card-list.vue
+++ b/orion-ops-ui/src/views/asset/host/components/host-card-list.vue
@@ -12,8 +12,8 @@
:add-permission="['asset:host:create']"
@add="emits('openAdd')"
@reset="reset"
- @search="fetchListData"
- @page-change="fetchListData">
+ @search="fetchCardData"
+ @page-change="fetchCardData">
{{ record.name }}
@@ -70,6 +70,28 @@
+
+
+
+
+
+ 修改
+
+
+
+
+ 配置
+
+
+
+
+ 删除
+
+
{
- try {
- setLoading(true);
- // 调用删除接口
- await deleteHost(id);
- Message.success('删除成功');
- // 重新加载数据
- await fetchListData();
- } catch (e) {
- } finally {
- setLoading(false);
- }
+ const deleteRow = (id: number) => {
+ Modal.confirm({
+ title: '删除前确认?',
+ titleAlign: 'start',
+ content: '确定要删除这条记录吗?',
+ okText: '删除',
+ onOk: async () => {
+ try {
+ setLoading(true);
+ // 调用删除接口
+ await deleteHost(id);
+ Message.success('删除成功');
+ // 重新加载数据
+ await fetchCardData();
+ } catch (e) {
+ } finally {
+ setLoading(false);
+ }
+ }
+ });
};
// 添加后回调
const addedCallback = () => {
- fetchListData();
+ fetchCardData();
};
// 更新后回调
const updatedCallback = () => {
- fetchListData();
+ fetchCardData();
};
defineExpose({
@@ -186,11 +216,11 @@
// 重置条件
const reset = () => {
resetObject(formModel, ['extra']);
- fetchListData();
+ fetchCardData();
};
// 加载数据
- const doFetchListData = async (request: HostQueryRequest) => {
+ const doFetchCardData = async (request: HostQueryRequest) => {
try {
setLoading(true);
const { data } = await getHostPage(request);
@@ -205,10 +235,10 @@
};
// 切换页码
- const fetchListData = (page = 1, limit = pagination.pageSize, form = formModel) => {
- doFetchListData({ page, limit, ...form });
+ const fetchCardData = (page = 1, limit = pagination.pageSize, form = formModel) => {
+ doFetchCardData({ page, limit, ...form });
};
- fetchListData();
+ fetchCardData();