From 4a01193d97814228ebee0097598eeda963c897c9 Mon Sep 17 00:00:00 2001 From: blp <2962632571@qq.com> Date: Sat, 28 Jan 2023 18:12:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E7=89=A9?= =?UTF-8?q?=E8=81=94=E5=8D=A1-=E4=BB=AA=E8=A1=A8=E7=9B=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/menu.ts | 6 +- src/views/iot-card/Dashboard/index.vue | 323 ++++++++++++++++++++ src/views/iot-card/components/LineChart.vue | 136 +++++++++ 3 files changed, 464 insertions(+), 1 deletion(-) create mode 100644 src/views/iot-card/Dashboard/index.vue create mode 100644 src/views/iot-card/components/LineChart.vue diff --git a/src/router/menu.ts b/src/router/menu.ts index 27d4f961..54920884 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -116,9 +116,13 @@ export default [ }, // 物联卡 iot-card { - path: '/iot-card/home', + path: '/iot-card/Home', component: () => import('@/views/iot-card/Home/index.vue') }, + { + path: '/iot-card/Dashboard', + component: () => import('@/views/iot-card/Dashboard/index.vue') + }, // 北向输出 { path: '/northbound/DuerOS', diff --git a/src/views/iot-card/Dashboard/index.vue b/src/views/iot-card/Dashboard/index.vue new file mode 100644 index 00000000..93bc1cfa --- /dev/null +++ b/src/views/iot-card/Dashboard/index.vue @@ -0,0 +1,323 @@ + + + + + diff --git a/src/views/iot-card/components/LineChart.vue b/src/views/iot-card/components/LineChart.vue new file mode 100644 index 00000000..9d22543b --- /dev/null +++ b/src/views/iot-card/components/LineChart.vue @@ -0,0 +1,136 @@ + + + + + From e41f19ca6975dca61601527d7363d10a2cd2f3a2 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Sat, 28 Jan 2023 18:12:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=9D=83=E9=99=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/home.js | 8 - src/api/home.ts | 15 ++ src/api/system/permission.ts | 6 + src/router/menu.ts | 4 + src/utils/utils.ts | 5 +- src/views/home/components/InitHome/index.vue | 28 ++- src/views/home/index.vue | 43 +++- .../Permission/components/EditDialog.vue | 234 ++++++++++++++++++ .../Permission/components/StatusLabel.vue | 29 +++ src/views/system/Permission/index.vue | 197 +++++++++++++++ src/views/system/Role/Detail/index.vue | 1 - .../system/Role/components/AddDialog.vue | 30 +-- src/views/system/Role/index.vue | 25 +- 13 files changed, 570 insertions(+), 55 deletions(-) delete mode 100644 src/api/home.js create mode 100644 src/api/home.ts create mode 100644 src/api/system/permission.ts create mode 100644 src/views/system/Permission/components/EditDialog.vue create mode 100644 src/views/system/Permission/components/StatusLabel.vue create mode 100644 src/views/system/Permission/index.vue diff --git a/src/api/home.js b/src/api/home.js deleted file mode 100644 index ea3aa339..00000000 --- a/src/api/home.js +++ /dev/null @@ -1,8 +0,0 @@ -import server from '@/utils/request'; - -// 设备数量 -export const getDeviceCount_api = () => server.get(`/device/instance/_count`); -// 产品数量 -export const getProductCount_api = (data) => server.post(`/device-product/_count`, data); -// 查询产品列表 -export const getProductList_api = (data) => server.get(`/device/product/_query/no-paging?paging=false`, data); diff --git a/src/api/home.ts b/src/api/home.ts new file mode 100644 index 00000000..2164e2f5 --- /dev/null +++ b/src/api/home.ts @@ -0,0 +1,15 @@ +import server from '@/utils/request'; + +// 当前登录用户权限信息 +export const getMe_api = () => server.get(`/authorize/me`); +// 设置登录用户选择的页面 +export const setView_api = (data:object) => server.patch(`/user/settings/view/user`, data); +// 当前登录用户选择的页面 +export const getView_api = () => server.get(`/user/settings/view/user`); + +// 设备数量 +export const getDeviceCount_api = () => server.get(`/device/instance/_count`); +// 产品数量 +export const getProductCount_api = (data:object) => server.post(`/device-product/_count`, data); +// 查询产品列表 +export const getProductList_api = (data:object) => server.get(`/device/product/_query/no-paging?paging=false`, data); diff --git a/src/api/system/permission.ts b/src/api/system/permission.ts new file mode 100644 index 00000000..978e4b26 --- /dev/null +++ b/src/api/system/permission.ts @@ -0,0 +1,6 @@ +import server from '@/utils/request'; + +// 获取权限列表 +export const getPermission_api = (data:object) => server.post(`/permission/_query/`,data); +// 修改权限信息 +export const editPermission_api = (data:object) => server.patch(`/permission`,data); \ No newline at end of file diff --git a/src/router/menu.ts b/src/router/menu.ts index 27d4f961..dfb5de5c 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -109,6 +109,10 @@ export default [ path:'/system/Role/detail/:id', component: ()=>import('@/views/system/Role/Detail/index.vue') }, + { + path:'/system/Permission', + component: ()=>import('@/views/system/Permission/index.vue') + }, // 初始化 { path: '/init-home', diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 3e5df69b..30e21216 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -1,6 +1,7 @@ import moment from "moment"; import { LocalStore } from "./comm"; import { TOKEN_KEY } from "./variable"; +import {SystemConst} from './consts'; /** * 把数据下载成JSON @@ -52,4 +53,6 @@ export const downloadObject = (record: Record, fileName: string, fo document.body.appendChild(formElement); formElement.submit(); document.body.removeChild(formElement); -}; \ No newline at end of file +}; +// 是否不是community版本 +export const isNoCommunity = !(localStorage.getItem(SystemConst.VERSION_CODE) === 'community'); \ No newline at end of file diff --git a/src/views/home/components/InitHome/index.vue b/src/views/home/components/InitHome/index.vue index 57be6d23..888aae8a 100644 --- a/src/views/home/components/InitHome/index.vue +++ b/src/views/home/components/InitHome/index.vue @@ -7,37 +7,47 @@ - 确定 + 确定 diff --git a/src/views/system/Permission/components/StatusLabel.vue b/src/views/system/Permission/components/StatusLabel.vue new file mode 100644 index 00000000..7641fea2 --- /dev/null +++ b/src/views/system/Permission/components/StatusLabel.vue @@ -0,0 +1,29 @@ + + + + + diff --git a/src/views/system/Permission/index.vue b/src/views/system/Permission/index.vue new file mode 100644 index 00000000..ec763acd --- /dev/null +++ b/src/views/system/Permission/index.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/views/system/Role/Detail/index.vue b/src/views/system/Role/Detail/index.vue index 1c58b369..8a907baa 100644 --- a/src/views/system/Role/Detail/index.vue +++ b/src/views/system/Role/Detail/index.vue @@ -1,6 +1,5 @@ @@ -59,8 +59,8 @@ import { import AddDialog from './components/AddDialog.vue'; import { getRoleList_api, delRole_api } from '@/api/system/role'; import { message } from 'ant-design-vue'; - -const router = useRouter() +const addDialogRef = ref(); // 新增弹窗实例 +const router = useRouter(); // 筛选 const query = reactive({ columns: [ @@ -122,24 +122,21 @@ const table = reactive({ ], tableData: [], clickAdd: () => { - dialog.openAdd += 1; + addDialogRef.value.openDialog(true, {}) }, clickDel: (row: any) => { - delRole_api(row.id).then((resp:any)=>{ - if(resp.status === 200){ - tableRef.value?.reload() - message.success('操作成功!') + delRole_api(row.id).then((resp: any) => { + if (resp.status === 200) { + tableRef.value?.reload(); + message.success('操作成功!'); } - }) + }); }, clickEdit: (row: any) => { - router.push(`/system/Role/detail/${row.id}`) + router.push(`/system/Role/detail/${row.id}`); }, }); -// 弹窗相关 -const dialog = reactive({ - openAdd: 0, -}); + From 37c4e654ee77a4a87bd18c6194033bd4cddd9e35 Mon Sep 17 00:00:00 2001 From: xiongqian <2167232911@qq.com> Date: Sat, 28 Jan 2023 21:56:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E5=88=86=E7=B1=BB=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device/category.ts | 25 ++ src/components/AIcon/index.tsx | 3 +- src/router/menu.ts | 6 + .../Category/components/modifyModal/index.vue | 203 ++++++++++++++++ src/views/device/Category/index.vue | 221 ++++++++++++++++++ src/views/device/Category/typings.d.ts | 10 + src/views/init-home/index.vue | 11 +- 7 files changed, 474 insertions(+), 5 deletions(-) create mode 100644 src/api/device/category.ts create mode 100644 src/views/device/Category/components/modifyModal/index.vue create mode 100644 src/views/device/Category/index.vue create mode 100644 src/views/device/Category/typings.d.ts diff --git a/src/api/device/category.ts b/src/api/device/category.ts new file mode 100644 index 00000000..d18e3587 --- /dev/null +++ b/src/api/device/category.ts @@ -0,0 +1,25 @@ +// 产品分类 +import server from '@/utils/request' +import { CategoryItem } from '@/views/device/Category/typings' +/** + * 查询产品分类树形数据 + */ + +export const queryTree = (params?: Record) => server.post('/device/category/_tree', params) + +/** + * 保存树形数据 + */ + export const saveTree = (data: any) =>server.post('/device/category', data) + + + /** + * 根据Id修改 + */ + export const updateTree = (data: any, id:string) => server.put(`/device/category/${id}`, data) + + /** + * 根据Id删除数据 + */ + + export const deleteTree = (id:string) => server.remove(`/device/category/${id}`) \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index 02e6d8a2..a3b1554e 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -26,7 +26,8 @@ const iconKeys = [ 'ExportOutlined', 'SyncOutlined', 'ExclamationCircleOutlined', - 'UploadOutlined' + 'UploadOutlined', + 'PlusCircleOutlined' ] const Icon = (props: {type: string}) => { diff --git a/src/router/menu.ts b/src/router/menu.ts index 27d4f961..ac9429e6 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -128,4 +128,10 @@ export default [ path: '/northbound/AliCloud', component: () => import('@/views/northbound/AliCloud/index.vue') }, + + // 产品分类 + { + path: '/iot/device/Category', + component: () => import('@/views/device/Category/index.vue') + } ] \ No newline at end of file diff --git a/src/views/device/Category/components/modifyModal/index.vue b/src/views/device/Category/components/modifyModal/index.vue new file mode 100644 index 00000000..ea420fa9 --- /dev/null +++ b/src/views/device/Category/components/modifyModal/index.vue @@ -0,0 +1,203 @@ + + + + diff --git a/src/views/device/Category/index.vue b/src/views/device/Category/index.vue new file mode 100644 index 00000000..f97ba614 --- /dev/null +++ b/src/views/device/Category/index.vue @@ -0,0 +1,221 @@ + + + + diff --git a/src/views/device/Category/typings.d.ts b/src/views/device/Category/typings.d.ts new file mode 100644 index 00000000..36656078 --- /dev/null +++ b/src/views/device/Category/typings.d.ts @@ -0,0 +1,10 @@ +export type CategoryItem = { + id: string; + name: string; + level: number; + key: string; + parentId: string; + path: string; + sortIndex: number; + children?: Category[]; +}; diff --git a/src/views/init-home/index.vue b/src/views/init-home/index.vue index e0dc84b5..20585ac9 100644 --- a/src/views/init-home/index.vue +++ b/src/views/init-home/index.vue @@ -117,7 +117,7 @@