diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index fb34ebd1..9f051caf 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -1,4 +1,5 @@ import server from '@/utils/request' +import { BASE_API_PATH } from '@/utils/variable' import { DeviceInstance } from '@/views/device/instance/typings' /** @@ -73,3 +74,28 @@ export const batchUndeployDevice = (data: string[]) => server.put(`/device-insta * @returns */ export const batchDeleteDevice = (data: string[]) => server.put(`/device-instance/batch/_delete`, data) + +/** + * 下载设备模板 + * @param productId 产品id + * @param type 文件类型 + * @returns + */ + export const deviceTemplateDownload = (productId: string, type: string) => `${BASE_API_PATH}/device-instance/${productId}/template.${type}` + + /** + * 设备导入 + * @param productId 产品id + * @param type 文件类型 + * @returns + */ + export const deviceImport = (productId: string, fileUrl: string, autoDeploy: boolean) => `${BASE_API_PATH}/device-instance/${productId}/import?fileUrl=${fileUrl}&autoDeploy=${autoDeploy}&:X_Access_Token=${LocalStore.get(TOKEN_KEY)}` + + /** + * 设备导出 + * @param productId 产品id + * @param type 文件类型 + * @returns + */ + export const deviceExport = (productId: string, type: string) => `${BASE_API_PATH}/device-instance${!!productId ? '/' + productId : ''}/export.${type}` + diff --git a/src/api/system/role.ts b/src/api/system/role.ts new file mode 100644 index 00000000..21eb73fd --- /dev/null +++ b/src/api/system/role.ts @@ -0,0 +1,16 @@ +import server from '@/utils/request'; + +// 获取角色列表 +export const getRoleList_api = (data: any): Promise => server.post(`/role/_query/`, data); +// 删除角色 +export const delRole_api = (id: string): Promise => server.remove(`/role/${id}`); +// 保存角色 +export const saveRole_api = (data: any): Promise => server.post(`/role`, data); +// 获取角色对应的权限树 +export const getPrimissTree_api = (id: string): Promise => server.get(`/menu/role/${id}/_grant/tree`); + + +// 获取用户列表 +export const getUserByRole_api = (data: any): Promise => server.post(`/user/_query/`, data); +// 将用户与该角色进行绑定 +export const bindUser_api = (roleId:string, data: string[]): Promise => server.post(`/role/${roleId}/users/_bind`, data); \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index bcc04f86..02e6d8a2 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -25,7 +25,8 @@ const iconKeys = [ 'ImportOutlined', 'ExportOutlined', 'SyncOutlined', - 'ExclamationCircleOutlined' + 'ExclamationCircleOutlined', + 'UploadOutlined' ] const Icon = (props: {type: string}) => { diff --git a/src/components/CardBox/index.vue b/src/components/CardBox/index.vue index 9c0ac3a3..b3449223 100644 --- a/src/components/CardBox/index.vue +++ b/src/components/CardBox/index.vue @@ -228,6 +228,10 @@ const handleClick = () => { transform: skewX(-45deg); } } + + :deep(.card-item-content-title) { + cursor: pointer; + } } .card-mask { diff --git a/src/components/FileFormat/index.vue b/src/components/FileFormat/index.vue new file mode 100644 index 00000000..dd63b90d --- /dev/null +++ b/src/components/FileFormat/index.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/src/components/JUpload/index.vue b/src/components/JUpload/index.vue new file mode 100644 index 00000000..c7f612de --- /dev/null +++ b/src/components/JUpload/index.vue @@ -0,0 +1,70 @@ + + + + + \ No newline at end of file diff --git a/src/components/NormalUpload/index.vue b/src/components/NormalUpload/index.vue new file mode 100644 index 00000000..6eb48c6d --- /dev/null +++ b/src/components/NormalUpload/index.vue @@ -0,0 +1,116 @@ + + + \ No newline at end of file diff --git a/src/components/Search/Search.vue b/src/components/Search/Search.vue index 1047e53b..fcad9502 100644 --- a/src/components/Search/Search.vue +++ b/src/components/Search/Search.vue @@ -57,7 +57,7 @@ - +