From da5b9bd790876c66b3b0a376fce3fde1ffaf2199 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Tue, 14 Feb 2023 17:52:59 +0800 Subject: [PATCH 1/6] =?UTF-8?q?update:=20=E9=83=A8=E9=97=A8=E7=AE=A1?= =?UTF-8?q?=E7=90=86over?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/department.ts | 15 +- .../components/AddDeviceOrProductDialog.vue | 12 +- .../components/EditDepartmentDialog.vue | 4 +- .../components/EditPermissionDialog.vue | 1 - .../system/Department/components/LeftTree.vue | 36 ++- .../Department/components/NextDialog.vue | 33 +++ src/views/system/Department/device/index.vue | 85 +++++-- src/views/system/Department/index.vue | 18 +- src/views/system/Department/product/index.vue | 78 +++--- .../user/components/AddBindUserDialog.vue | 165 +++++++++++++ src/views/system/Department/user/index.vue | 223 +++++++++++++++++- 11 files changed, 596 insertions(+), 74 deletions(-) create mode 100644 src/views/system/Department/components/NextDialog.vue create mode 100644 src/views/system/Department/user/components/AddBindUserDialog.vue diff --git a/src/api/system/department.ts b/src/api/system/department.ts index e61b4de0..565db91f 100644 --- a/src/api/system/department.ts +++ b/src/api/system/department.ts @@ -10,12 +10,14 @@ export const updateDepartment_api = (data: object) => server.patch(`/organizatio export const delDepartment_api = (id: string) => server.remove(`/organization/${id}`); +// 获取所属产品列表 +export const getDeviceProduct_api = (data: object) => server.get(`/device/product/_query/no-paging`, data); // 获取产品列表 export const getDeviceOrProductList_api = (data: object) => server.post(`/device-product/_query`, data); // 获取设备列表 export const getDeviceList_api = (data: object) => server.post(`/device/instance/_query`, data); // 根据产品的id获取产品的权限 -export const getPermission_api = (type:'device' | 'product',ids: object, id: string) => server.post(`/assets/bindings/${type}/org/${id}/_query`, ids); +export const getPermission_api = (type: 'device' | 'product', ids: object, id: string) => server.post(`/assets/bindings/${type}/org/${id}/_query`, ids); // 获取产品的权限字典 export const getPermissionDict_api = () => server.get(`/assets/bindings/product/permissions`); @@ -24,4 +26,13 @@ export const bindDeviceOrProductList_api = (type: 'device' | 'product', data: ob // 批量解绑 export const unBindDeviceOrProduct_api = (type: 'device' | 'product', data: object) => server.post(`/assets/unbind/${type}`, data); // 批量更新权限 -export const updatePermission_api = (type: 'device' | 'product', parentId: string, data: object) => server.put(`/assets/permission/${type}/org/${parentId}/_batch`, data); \ No newline at end of file +export const updatePermission_api = (type: 'device' | 'product', parentId: string, data: object) => server.put(`/assets/permission/${type}/org/${parentId}/_batch`, data); + + +// 用户相关 +// 获取绑定用户列表 +export const getBindUserList_api = (data: object) => server.post(`/user/_query`, data); +// 绑定用户 +export const bindUser_api = (parentId:string,data: object) => server.post(`/organization/${parentId}/users/_bind`, data); +// 解绑用户 +export const unBindUser_api = (parentId:string,data: object) => server.post(`/organization/${parentId}/users/_unbind`, data); diff --git a/src/views/system/Department/components/AddDeviceOrProductDialog.vue b/src/views/system/Department/components/AddDeviceOrProductDialog.vue index 512c387c..8f60be9a 100644 --- a/src/views/system/Department/components/AddDeviceOrProductDialog.vue +++ b/src/views/system/Department/components/AddDeviceOrProductDialog.vue @@ -28,7 +28,7 @@ - + { @@ -334,6 +334,14 @@ const table: any = { data.forEach((item) => { item.permissionList = permissionObj[item.id]; item.selectPermissions = ['read']; + + // 产品的状态进行转换处理 + if(props.assetType === 'product') { + item.state = { + value: item.state === 1 ? 'online': item.state === 0 ? 'offline': '', + text: item.state === 1 ? '正常': item.state === 0 ? '禁用': '' + } + } }); resolve({ diff --git a/src/views/system/Department/components/EditDepartmentDialog.vue b/src/views/system/Department/components/EditDepartmentDialog.vue index de11577a..0f8483af 100644 --- a/src/views/system/Department/components/EditDepartmentDialog.vue +++ b/src/views/system/Department/components/EditDepartmentDialog.vue @@ -117,8 +117,8 @@ const form = reactive({ form.loading = true; const api = form.data.id ? updateDepartment_api : addDepartment_api; api(form.data) - .then(() => { - emits('refresh'); + .then((resp:any) => { + emits('refresh',resp.result.id); dialog.changeVisible(false); }) .finally(() => (form.loading = false)); diff --git a/src/views/system/Department/components/EditPermissionDialog.vue b/src/views/system/Department/components/EditPermissionDialog.vue index 7e91284c..3a32b6a2 100644 --- a/src/views/system/Department/components/EditPermissionDialog.vue +++ b/src/views/system/Department/components/EditPermissionDialog.vue @@ -46,7 +46,6 @@ const dialog = { }, // 控制弹窗的打开与关闭 changeVisible: (ids: string[], permissionList: string[]) => { - console.log(ids, permissionList); form.permission = [...permissionList]; form.assetIdList = ids; options.value = setOptions(permissionList); diff --git a/src/views/system/Department/components/LeftTree.vue b/src/views/system/Department/components/LeftTree.vue index 8493f81c..6b59a391 100644 --- a/src/views/system/Department/components/LeftTree.vue +++ b/src/views/system/Department/components/LeftTree.vue @@ -10,7 +10,7 @@ - + 新增 @@ -84,19 +84,15 @@ import { } from '@ant-design/icons-vue'; import { message } from 'ant-design-vue'; +const save = useRoute().query.save; const emits = defineEmits(['change']); -const searchValue = ref('');// 搜索内容 +const searchValue = ref(''); // 搜索内容 const loading = ref(false); // 数据加载状态 const sourceTree = ref([]); // 源数据 const treeMap = new Map(); // 数据的map版本 const treeData = ref([]); // 展示的数据 const selectedKeys = ref([]); // 当前选中的项 -getTree(); -watch(selectedKeys, (n) => { - emits('change', n[0]); -}); - function getTree() { loading.value = true; const params = { @@ -119,7 +115,7 @@ function getTree() { .finally(() => { loading.value = false; }); -}; +} const search = debounce(() => { const key = searchValue.value; const treeArray = new Map(); @@ -167,14 +163,30 @@ function delDepartment(id: string) { getTree(); }); } - +function refresh(id: string) { + // @ts-ignore + window?.onSaveSuccess && window.onSaveSuccess('department', id); + window.close(); + getTree(); +} // 弹窗 const editDialogRef = ref(); // 新增弹窗实例 const openDialog = (row: any = {}) => { editDialogRef.value.openDialog(true, row); }; - +init(); +function init() { + getTree(); + watch(selectedKeys, (n) => { + emits('change', n[0]); + }); + if (save) { + nextTick(() => { + openDialog(); + }); + } +} diff --git a/src/views/system/Department/device/index.vue b/src/views/system/Department/device/index.vue index 021b0fa4..b4cdf49a 100644 --- a/src/views/system/Department/device/index.vue +++ b/src/views/system/Department/device/index.vue @@ -125,6 +125,7 @@
(); const query = { columns: [ @@ -186,6 +190,41 @@ const query = { type: 'string', }, }, + { + title: '所属产品', + dataIndex: 'productId$product-info', + key: 'productId$product-info', + ellipsis: true, + fixed: 'left', + search: { + type: 'select', + options: () => + new Promise((resolve) => { + const params = { + paging: false, + 'sorts[0].name': 'createTime', + 'sorts[0].order': 'desc', + }; + getDeviceProduct_api(params).then((resp: any) => { + const result = resp.result.map((item: any) => ({ + label: item.name, + value: item.id, + })); + resolve(result); + }); + }), + }, + }, + { + title: '注册时间', + dataIndex: 'registryTime', + key: 'registryTime', + ellipsis: true, + fixed: 'left', + search: { + type: 'date', + }, + }, { title: '状态', dataIndex: 'state', @@ -279,26 +318,30 @@ const table = { const { pageIndex, pageSize, total, data } = resp.result as resultType; const ids = data.map((item) => item.id); - getPermission_api('device',ids, parentId).then((perResp: any) => { - const permissionObj = {}; - perResp.result.forEach((item: any) => { - permissionObj[item.assetId] = item.grantedPermissions; - }); - data.forEach( - (item) => (item.permission = permissionObj[item.id]), - ); + getPermission_api('device', ids, parentId).then( + (perResp: any) => { + const permissionObj = {}; + perResp.result.forEach((item: any) => { + permissionObj[item.assetId] = + item.grantedPermissions; + }); + data.forEach( + (item) => + (item.permission = permissionObj[item.id]), + ); - resolve({ - code: 200, - result: { - data: data, - pageIndex, - pageSize, - total, - }, - status: 200, - }); - }); + resolve({ + code: 200, + result: { + data: data, + pageIndex, + pageSize, + total, + }, + status: 200, + }); + }, + ); }); }), // 整理参数并获取数据 @@ -393,6 +436,10 @@ const addDialogRef = ref(); const editDialogRef = ref(); table.init(); +nextTick(() => { + props.bindBool && table.clickAdd(); + emits('update:bindBool', false); +}); diff --git a/src/views/system/Department/user/index.vue b/src/views/system/Department/user/index.vue index 540ef6e1..c0a51ca9 100644 --- a/src/views/system/Department/user/index.vue +++ b/src/views/system/Department/user/index.vue @@ -1,13 +1,226 @@ - - \ No newline at end of file + From 91ae45d227493aee9039b0f005ef6f46aa2ef85f Mon Sep 17 00:00:00 2001 From: jackhoo_98 Date: Wed, 15 Feb 2023 13:34:56 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=E7=BD=91=E7=BB=9C=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=20=E5=8D=A1=E7=89=87/=E5=88=97=E8=A1=A8=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/link/type.ts | 16 + src/views/link/AccessConfig/index.vue | 10 +- src/views/link/Protocol/index.vue | 6 +- src/views/link/Type/Detail/index.vue | 9 + src/views/link/Type/data.ts | 0 src/views/link/Type/index.vue | 465 ++++++++++++++++++++++++ src/views/link/Type/type.d.ts | 0 src/views/media/Stream/Detail/index.vue | 2 +- src/views/media/Stream/index.vue | 10 +- 9 files changed, 503 insertions(+), 15 deletions(-) create mode 100644 src/api/link/type.ts create mode 100644 src/views/link/Type/Detail/index.vue create mode 100644 src/views/link/Type/data.ts create mode 100644 src/views/link/Type/index.vue create mode 100644 src/views/link/Type/type.d.ts diff --git a/src/api/link/type.ts b/src/api/link/type.ts new file mode 100644 index 00000000..bc3546b0 --- /dev/null +++ b/src/api/link/type.ts @@ -0,0 +1,16 @@ +import server from '@/utils/request'; + +export const queryNetworkConfig = (params: object) => + server.post(`/network/config/_query`, params); + +export const remove = (id: string) => server.remove(`/network/config/${id}`); + +export const shutdown = (data: object) => + server.post(`/network/config/${data}/_shutdown`); + +export const start = (data: object) => + server.post(`/network/config/${data}/_start`); + +export const supports = () => server.get(`/network/config/supports`); + +export const query = (data: Object) => server.post(`/network/config/_query`, data); diff --git a/src/views/link/AccessConfig/index.vue b/src/views/link/AccessConfig/index.vue index 699a994c..90cbaaa1 100644 --- a/src/views/link/AccessConfig/index.vue +++ b/src/views/link/AccessConfig/index.vue @@ -45,11 +45,9 @@

- {{ - slotProps.name - }} + {{ slotProps.name }}

{ min-height: 100px; .card-item-content-title-a { - // color: #000 !important; + color: #1890ff !important; font-weight: 700; - font-size: 18px; + font-size: 16px; overflow: hidden; //超出的文本隐藏 text-overflow: ellipsis; //溢出用省略号显示 white-space: nowrap; //溢出不换行 diff --git a/src/views/link/Protocol/index.vue b/src/views/link/Protocol/index.vue index 5b9b351b..3ae666c1 100644 --- a/src/views/link/Protocol/index.vue +++ b/src/views/link/Protocol/index.vue @@ -31,7 +31,7 @@ - - - diff --git a/src/views/device/DashBoard/components/Charts.vue b/src/views/device/DashBoard/components/Charts.vue new file mode 100644 index 00000000..9c5a4031 --- /dev/null +++ b/src/views/device/DashBoard/components/Charts.vue @@ -0,0 +1,43 @@ + + + + + diff --git a/src/views/device/DashBoard/components/LineChart.vue b/src/views/device/DashBoard/components/LineChart.vue deleted file mode 100644 index cb06576c..00000000 --- a/src/views/device/DashBoard/components/LineChart.vue +++ /dev/null @@ -1,99 +0,0 @@ - - - - - diff --git a/src/views/device/DashBoard/components/MessageChart.vue b/src/views/device/DashBoard/components/MessageChart.vue deleted file mode 100644 index c088d53d..00000000 --- a/src/views/device/DashBoard/components/MessageChart.vue +++ /dev/null @@ -1,112 +0,0 @@ - - - - - diff --git a/src/views/device/DashBoard/components/TopCard.vue b/src/views/device/DashBoard/components/TopCard.vue index 0d3c89d4..13c5fcac 100644 --- a/src/views/device/DashBoard/components/TopCard.vue +++ b/src/views/device/DashBoard/components/TopCard.vue @@ -72,7 +72,7 @@ const props = defineProps({ } .content-right { width: 0; - height: 100%; + height: 123px; display: flex; flex-grow: .7; align-items: flex-end; diff --git a/src/views/device/DashBoard/index.vue b/src/views/device/DashBoard/index.vue index b916fef9..e1a8a051 100644 --- a/src/views/device/DashBoard/index.vue +++ b/src/views/device/DashBoard/index.vue @@ -24,10 +24,12 @@ :footer="onlineFooter" :value="onlineToday" > - --> + + - @@ -55,7 +54,7 @@
- +
@@ -74,11 +73,9 @@ \ No newline at end of file diff --git a/src/views/rule-engine/Instance/index.vue b/src/views/rule-engine/Instance/index.vue new file mode 100644 index 00000000..d47885f7 --- /dev/null +++ b/src/views/rule-engine/Instance/index.vue @@ -0,0 +1,333 @@ + + + + \ No newline at end of file diff --git a/src/views/rule-engine/Instance/typings.d.ts b/src/views/rule-engine/Instance/typings.d.ts new file mode 100644 index 00000000..28689e67 --- /dev/null +++ b/src/views/rule-engine/Instance/typings.d.ts @@ -0,0 +1,15 @@ +type InstanceItem = { + createTime: number; + modelId: string; + modelMeta: string; + modelType: string; + modelVersion: number; + description?: string; + state: { + text: string; + value: string; + }; + } & { + id:string, + name:string + } \ No newline at end of file From ab45dabd7fae2fc1e44c90867096a2fded424f23 Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Wed, 15 Feb 2023 18:56:52 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=E5=8C=97=E5=90=91=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/northbound/alicloud.ts | 67 +++ src/api/northbound/dueros.ts | 65 ++- .../Instance/Detail/Running/Event/index.vue | 3 - src/views/device/Instance/index.vue | 2 +- src/views/northbound/AliCloud/Detail/doc.vue | 94 +++++ .../northbound/AliCloud/Detail/index.vue | 333 +++++++++++++++ src/views/northbound/AliCloud/index.vue | 305 +++++++++++++- .../DuerOS/Detail/command/EditTable.vue | 93 +++++ .../DuerOS/Detail/command/index.vue | 139 +++++++ src/views/northbound/DuerOS/Detail/doc.vue | 101 +++++ src/views/northbound/DuerOS/Detail/index.vue | 385 ++++++++++++++++++ src/views/northbound/DuerOS/Save/index.vue | 3 - src/views/northbound/DuerOS/index.vue | 328 +++++++++++---- 13 files changed, 1824 insertions(+), 94 deletions(-) create mode 100644 src/views/northbound/AliCloud/Detail/doc.vue create mode 100644 src/views/northbound/AliCloud/Detail/index.vue create mode 100644 src/views/northbound/DuerOS/Detail/command/EditTable.vue create mode 100644 src/views/northbound/DuerOS/Detail/command/index.vue create mode 100644 src/views/northbound/DuerOS/Detail/doc.vue create mode 100644 src/views/northbound/DuerOS/Detail/index.vue delete mode 100644 src/views/northbound/DuerOS/Save/index.vue diff --git a/src/api/northbound/alicloud.ts b/src/api/northbound/alicloud.ts index e69de29b..669899ef 100644 --- a/src/api/northbound/alicloud.ts +++ b/src/api/northbound/alicloud.ts @@ -0,0 +1,67 @@ +import server from '@/utils/request' + +/** + * 查询数据 + * @param data 分页搜索数据 + * @returns + */ +export const query = (data: Record) => server.post('/device/aliyun/bridge/_query', data) + +/** + * 查询产品列表 + * @param data + * @returns + */ +export const queryProductList = (data?: Record) => server.post('/device-product/_query/no-paging', data) + +/** + * 保存数据 + * @param data 阿里云 + * @returns + */ +export const savePatch = (data: Record) => server.patch(`/device/aliyun/bridge`, data) + +/** + * 根据阿里云ID获取阿里云详情 + * @param id 阿里云ID + * @returns 阿里云详情 + */ +export const detail = (id: string) => server.get(`/device/aliyun/bridge/${id}`) + +/** + * 删除阿里云 + * @param id 阿里云ID + * @returns + */ +export const _delete = (id: string) => server.remove(`/device/aliyun/bridge/${id}`) + +/** + * 启用阿里云 + * @param id 阿里云ID + * @param data + * @returns + */ +export const _deploy = (id: string) => server.post(`/device/aliyun/bridge/${id}/enable`) + +/** + * 禁用阿里云 + * @param id 阿里云ID + * @param data + * @returns + */ +export const _undeploy = (id: string) => server.post(`/device/aliyun/bridge/${id}/disable`) + +/** + * 获取服务地址的下拉列表 + * @param params + * @returns + */ +export const getRegionsList = (params?: Record) => server.get(`/device/aliyun/bridge/regions`, params) + +/** + * 产品映射中的阿里云产品下拉列表 + * @param data + * @returns + */ +export const getAliyunProductsList = (data?: Record) => server.post(`/device/aliyun/bridge/products/_query`, data) + diff --git a/src/api/northbound/dueros.ts b/src/api/northbound/dueros.ts index e3cb60cc..63562377 100644 --- a/src/api/northbound/dueros.ts +++ b/src/api/northbound/dueros.ts @@ -5,4 +5,67 @@ import server from '@/utils/request' * @param data 分页搜索数据 * @returns */ -export const query = (data: Record) => server.post('/dueros/product/_query', data) \ No newline at end of file +export const query = (data: Record) => server.post('/dueros/product/_query', data) + +/** + * 查询产品列表 + * @param id + * @returns + */ +export const queryProductList = (id?: string) => server.post('/device-product/_query/no-paging', { + paging: false, + terms: id ? [{ + column: 'id$dueros-product$not', + value: 1, + }, + { column: 'id', type: 'or', value: id } + ] : [{ + column: 'id$dueros-product$not', + value: 1, + }], + sorts: [{ name: 'createTime', order: 'desc' }], +}) + +/** + * 查询类型 + * @returns + */ +export const queryTypes = () => server.get('/dueros/product/types') + +/** + * 保存数据 + * @param data dueros + * @returns + */ +export const savePatch = (data: Record) => server.patch(`/dueros/product`, data) + +/** + * 根据duerosID获取dueros详情 + * @param id duerosID + * @returns dueros详情 + */ +export const detail = (id: string) => server.get(`/dueros/product/${id}`) + +/** + * 删除dueros + * @param id duerosID + * @returns + */ +export const _delete = (id: string) => server.remove(`/dueros/product/${id}`) + +/** + * 启用dueros + * @param id duerosID + * @param data + * @returns + */ +export const _deploy = (id: string) => server.post(`/dueros/product/${id}/_enable`) + +/** + * 禁用dueros + * @param id duerosID + * @param data + * @returns + */ +export const _undeploy = (id: string) => server.post(`/dueros/product/${id}/_disable`) + diff --git a/src/views/device/Instance/Detail/Running/Event/index.vue b/src/views/device/Instance/Detail/Running/Event/index.vue index 02459461..ec35af49 100644 --- a/src/views/device/Instance/Detail/Running/Event/index.vue +++ b/src/views/device/Instance/Detail/Running/Event/index.vue @@ -16,9 +16,6 @@ - - - + + \ No newline at end of file diff --git a/src/views/northbound/AliCloud/Detail/index.vue b/src/views/northbound/AliCloud/Detail/index.vue new file mode 100644 index 00000000..10b99894 --- /dev/null +++ b/src/views/northbound/AliCloud/Detail/index.vue @@ -0,0 +1,333 @@ + + + \ No newline at end of file diff --git a/src/views/northbound/AliCloud/index.vue b/src/views/northbound/AliCloud/index.vue index 36c762ec..3d4e8ccc 100644 --- a/src/views/northbound/AliCloud/index.vue +++ b/src/views/northbound/AliCloud/index.vue @@ -1,7 +1,306 @@ - \ No newline at end of file +const router = useRouter(); +const instanceRef = ref>({}); +const params = ref>({}); +const current = ref>({}); + +const statusMap = new Map(); +statusMap.set('enabled', 'success'); +statusMap.set('disabled', 'error'); + +const columns = [ + { + title: '名称', + dataIndex: 'name', + key: 'name', + }, + { + title: '网桥产品', + dataIndex: 'bridgeProductName', + key: 'bridgeProductName', + }, + { + title: '说明', + dataIndex: 'describe', + key: 'describe', + }, + { + title: '状态', + dataIndex: 'state', + key: 'state', + scopedSlots: true, + }, + { + title: '操作', + key: 'action', + fixed: 'right', + width: 250, + scopedSlots: true, + }, +]; + +/** + * 新增 + */ +const handleAdd = () => { + router.push('/iot/northbound/AliCloud/detail/:id'); +}; + +/** + * 查看 + */ +const handleView = (id: string) => { + router.push({ + path: '/iot/northbound/AliCloud/detail/' + id, + query: { + type: 'view' + } + }); +}; + +const getActions = ( + data: Partial>, + type: 'card' | 'table', +): ActionsType[] => { + if (!data) return []; + const actions = [ + { + key: 'view', + text: '查看', + tooltip: { + title: '查看', + }, + icon: 'EyeOutlined', + onClick: () => { + handleView(data.id); + }, + }, + { + key: 'edit', + text: '编辑', + tooltip: { + title: '编辑', + }, + icon: 'EditOutlined', + onClick: () => { + router.push({ + path: '/iot/northbound/AliCloud/detail/' + data.id, + query: { + type: 'edit' + } + }); + }, + }, + { + key: 'action', + text: data.state?.value !== 'disabled' ? '禁用' : '启用', + tooltip: { + title: data.state?.value !== 'disabled' ? '禁用' : '启用', + }, + icon: + data.state.value !== 'notActive' + ? 'StopOutlined' + : 'CheckCircleOutlined', + popConfirm: { + title: `确认${ + data.state.value !== 'disabled' ? '禁用' : '启用' + }?`, + onConfirm: async () => { + let response = undefined; + if (data.state.value !== 'disabled') { + response = await _undeploy(data.id); + } else { + response = await _deploy(data.id); + } + if (response && response.status === 200) { + message.success('操作成功!'); + instanceRef.value?.reload(); + } else { + message.error('操作失败!'); + } + }, + }, + }, + { + key: 'delete', + text: '删除', + disabled: data.state?.value !== 'disabled', + tooltip: { + title: + data.state.value !== 'disabled' + ? '请先禁用该数据,再删除。' + : '删除', + }, + popConfirm: { + title: '确认删除?', + onConfirm: async () => { + const resp = await _delete(data.id); + if (resp.status === 200) { + message.success('操作成功!'); + instanceRef.value?.reload(); + } else { + message.error('操作失败!'); + } + }, + }, + icon: 'DeleteOutlined', + }, + ]; + if (type === 'card') + return actions.filter((i: ActionsType) => i.key !== 'view'); + return actions; +}; + diff --git a/src/views/northbound/DuerOS/Detail/command/EditTable.vue b/src/views/northbound/DuerOS/Detail/command/EditTable.vue new file mode 100644 index 00000000..975d91fd --- /dev/null +++ b/src/views/northbound/DuerOS/Detail/command/EditTable.vue @@ -0,0 +1,93 @@ + + + \ No newline at end of file diff --git a/src/views/northbound/DuerOS/Detail/command/index.vue b/src/views/northbound/DuerOS/Detail/command/index.vue new file mode 100644 index 00000000..8a42b9b9 --- /dev/null +++ b/src/views/northbound/DuerOS/Detail/command/index.vue @@ -0,0 +1,139 @@ + + + \ No newline at end of file diff --git a/src/views/northbound/DuerOS/Detail/doc.vue b/src/views/northbound/DuerOS/Detail/doc.vue new file mode 100644 index 00000000..35bfcc33 --- /dev/null +++ b/src/views/northbound/DuerOS/Detail/doc.vue @@ -0,0 +1,101 @@ + + + + + \ No newline at end of file diff --git a/src/views/northbound/DuerOS/Detail/index.vue b/src/views/northbound/DuerOS/Detail/index.vue new file mode 100644 index 00000000..12db64a3 --- /dev/null +++ b/src/views/northbound/DuerOS/Detail/index.vue @@ -0,0 +1,385 @@ + + + \ No newline at end of file diff --git a/src/views/northbound/DuerOS/Save/index.vue b/src/views/northbound/DuerOS/Save/index.vue deleted file mode 100644 index 9573a57f..00000000 --- a/src/views/northbound/DuerOS/Save/index.vue +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/src/views/northbound/DuerOS/index.vue b/src/views/northbound/DuerOS/index.vue index dc06f008..c35da774 100644 --- a/src/views/northbound/DuerOS/index.vue +++ b/src/views/northbound/DuerOS/index.vue @@ -1,69 +1,141 @@