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 01/15] =?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 4c61eaf918a0e896cdeef71a156f43f4ff6942da Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Thu, 16 Feb 2023 11:32:52 +0800 Subject: [PATCH 02/15] =?UTF-8?q?feat:=20=E7=94=A8=E6=88=B7=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/system/user.ts | 36 ++ .../system/Department/components/LeftTree.vue | 2 +- .../system/Role/components/AddDialog.vue | 16 +- .../system/User/components/EditUserDialog.vue | 425 ++++++++++++++++++ src/views/system/User/components/Progress.vue | 76 ++++ src/views/system/User/index.vue | 296 ++++++++++++ 6 files changed, 844 insertions(+), 7 deletions(-) create mode 100644 src/api/system/user.ts create mode 100644 src/views/system/User/components/EditUserDialog.vue create mode 100644 src/views/system/User/components/Progress.vue create mode 100644 src/views/system/User/index.vue diff --git a/src/api/system/user.ts b/src/api/system/user.ts new file mode 100644 index 00000000..68c690ac --- /dev/null +++ b/src/api/system/user.ts @@ -0,0 +1,36 @@ +import server from '@/utils/request'; + +// 获取用户类型 +export const getUserType_api = () => server.get(`/user/detail/types`); + +// 获取用户列表 +export const getUserList_api = (data: object) => server.post(`/user/detail/_query`, data); + +// 校验字段合法性 +export const validateField_api = (type: 'username' | 'password', name: string) => server.post(`/user/${type}/_validate`, name, { + headers: { + 'Content-Type': 'text/plain' + } +}) + +// 获取角色列表 +export const getRoleList_api = () => server.get(`/role/_query/no-paging?paging=false`); +// 获取组织列表 +export const getDepartmentList_api = () => server.get(`/organization/_all/tree?paging=false`); + +// 获取用户信息 +export const getUser_api = (id: string) => server.get(`/user/detail/${id}`); +// 添加用户 +export const addUser_api = (data: object) => server.post(`/user/detail/_create`, data); +// 更新用户 +export const updateUser_api = (data: any) => server.put(`/user/detail/${data.id}/_update`, data); +// 更新密码 +export const updatePassword_api = (data: { id: string, password: string }) => server.post(`/user/${data.id}/password/_reset`, data.password, { + headers: { + 'Content-Type': 'text/plain' + } +}); +// 修改用户状态 +export const changeUserStatus_api = (data: object) => server.patch(`/user`,data); +// 删除用户 +export const deleteUser_api = (id: string) => server.remove(`/user/${id}`); \ No newline at end of file diff --git a/src/views/system/Department/components/LeftTree.vue b/src/views/system/Department/components/LeftTree.vue index 6b59a391..df99f733 100644 --- a/src/views/system/Department/components/LeftTree.vue +++ b/src/views/system/Department/components/LeftTree.vue @@ -165,7 +165,7 @@ function delDepartment(id: string) { } function refresh(id: string) { // @ts-ignore - window?.onSaveSuccess && window.onSaveSuccess('department', id); + window?.onSaveSuccess && window.onSaveSuccess(id); window.close(); getTree(); } diff --git a/src/views/system/Role/components/AddDialog.vue b/src/views/system/Role/components/AddDialog.vue index fc8a68d9..16c3fc54 100644 --- a/src/views/system/Role/components/AddDialog.vue +++ b/src/views/system/Role/components/AddDialog.vue @@ -45,6 +45,7 @@ import { FormInstance, message } from 'ant-design-vue'; import { saveRole_api } from '@/api/system/role'; const router = useRouter(); +const route = useRoute(); // 弹窗相关 const dialog = reactive({ visible: false, @@ -56,12 +57,17 @@ const dialog = reactive({ if (resp.status === 200) { message.success('操作成功'); dialog.visible = false; - router.push(`/system/Role/detail/${resp.result.id}`); + + if (route.query.save) { + // @ts-ignore + window?.onSaveSuccess && window.onSaveSuccess(resp.result.id); + window.close(); + } else router.push(`/system/Role/detail/${resp.result.id}`); } }); }, // 控制弹窗的打开与关闭 - changeVisible: (status: boolean, defaultForm: object={}) => { + changeVisible: (status: boolean, defaultForm: object = {}) => { dialog.visible = status; form.data = { name: '', description: '', ...defaultForm }; }, @@ -76,12 +82,10 @@ const form = reactive({ }, }); - - // 将打开弹窗的操作暴露给父组件 defineExpose({ - openDialog: dialog.changeVisible -}) + openDialog: dialog.changeVisible, +}); diff --git a/src/views/system/User/components/EditUserDialog.vue b/src/views/system/User/components/EditUserDialog.vue new file mode 100644 index 00000000..aabc2898 --- /dev/null +++ b/src/views/system/User/components/EditUserDialog.vue @@ -0,0 +1,425 @@ + + + + + diff --git a/src/views/system/User/components/Progress.vue b/src/views/system/User/components/Progress.vue new file mode 100644 index 00000000..bc14ed05 --- /dev/null +++ b/src/views/system/User/components/Progress.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/src/views/system/User/index.vue b/src/views/system/User/index.vue new file mode 100644 index 00000000..63078f1c --- /dev/null +++ b/src/views/system/User/index.vue @@ -0,0 +1,296 @@ + + + + + From 7308148b69df359dffa70033b48f0345c4cbf263 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Thu, 16 Feb 2023 13:45:34 +0800 Subject: [PATCH 03/15] =?UTF-8?q?feat:=20=E8=A7=86=E9=A2=91=E4=B8=AD?= =?UTF-8?q?=E5=BF=83,=20=E4=BB=AA=E8=A1=A8=E7=9B=98=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/media/DashBoard/components/Card.vue | 79 ++++++++++++++-- src/views/media/DashBoard/index.vue | 90 ++++++++++++++----- src/views/media/DashBoard/typings.d.ts | 2 +- .../media/Home/components/BasicCountCard.vue | 4 +- 4 files changed, 142 insertions(+), 33 deletions(-) diff --git a/src/views/media/DashBoard/components/Card.vue b/src/views/media/DashBoard/components/Card.vue index 3ace789d..4c3c64bf 100644 --- a/src/views/media/DashBoard/components/Card.vue +++ b/src/views/media/DashBoard/components/Card.vue @@ -1,5 +1,5 @@ diff --git a/src/views/media/DashBoard/index.vue b/src/views/media/DashBoard/index.vue index e4190862..e9b1a75b 100644 --- a/src/views/media/DashBoard/index.vue +++ b/src/views/media/DashBoard/index.vue @@ -34,8 +34,12 @@ :value="aggPlayingTotal" /> - - + +
@@ -50,6 +54,7 @@ import dashboardApi from '@/api/media/dashboard'; import type { Footer } from '@/views/media/DashBoard/typings'; import encodeQuery from '@/utils/encodeQuery'; import { timestampFormat } from '@/utils/utils'; +import moment from 'moment'; // 设备 const deviceFooter = ref([]); @@ -114,10 +119,12 @@ const aggTotal = ref(0); const getAggData = () => { dashboardApi.agg().then((res) => { aggTotal.value = res.result.total; - aggFooter.value.push({ - title: '总时长', - value: timestampFormat(res.result.duration), - }); + aggFooter.value = [ + { + title: '总时长', + value: timestampFormat(res.result.duration), + }, + ]; }); }; getAggData(); @@ -128,10 +135,12 @@ const aggPlayingTotal = ref(0); const getAggPlayingData = () => { dashboardApi.aggPlaying().then((res) => { aggTotal.value = res.result.playingTotal; - aggPlayingFooter.value.push({ - title: '播放人数', - value: res.result.playerTotal, - }); + aggPlayingFooter.value = [ + { + title: '播放人数', + value: res.result.playerTotal, + }, + ]; }); }; getAggPlayingData(); @@ -140,24 +149,61 @@ getAggPlayingData(); * 获取播放数量(人次) */ const chartData = ref([]); -const getPlayCount = async () => { - const params = {}; - dashboardApi.getPlayCount(params).then((res) => { - let result: any = []; - res.result.forEach((item: any) => { - result = [...result, ...item.data]; +const getPlayCount = async (params: any) => { + let _time = '1h'; + let _limit = 12; + const dt = params.time.end - params.time.start; + const hour = 60 * 60 * 1000; + const day = hour * 24; + const month = day * 30; + const year = 365 * day; + if (dt <= day) { + _limit = Math.abs(Math.ceil(dt / hour)); + } else if (dt > day && dt < year) { + _limit = Math.abs(Math.ceil(dt / day)); + _time = '1d'; + } else if (dt >= year) { + _limit = Math.abs(Math.floor(dt / month)); + _time = '1M'; + } + dashboardApi + .getPlayCount([ + { + dashboard: 'media_stream', + object: 'play_count', + measurement: 'quantity', + dimension: 'agg', + group: 'playCount', + params: { + time: _time, + from: moment(Number(params.time.start)).format( + 'YYYY-MM-DD HH:mm:ss', + ), + to: moment(Number(params.time.end)).format( + 'YYYY-MM-DD HH:mm:ss', + ), + limit: _limit, + }, + }, + ]) + .then((res) => { + let result: any = []; + res.result.forEach((item: any) => { + result = [...result, ...item.data]; + }); + chartData.value = result.map((m: any) => ({ + x: m.timeString, + value: m.value, + })); }); - chartData.value = result.map((m: any) => ({ - x: m.timeString, - value: m.value, - })); - }); }; -getPlayCount(); diff --git a/src/views/media/DashBoard/typings.d.ts b/src/views/media/DashBoard/typings.d.ts index 67b6e20c..f344c699 100644 --- a/src/views/media/DashBoard/typings.d.ts +++ b/src/views/media/DashBoard/typings.d.ts @@ -11,6 +11,6 @@ export type AggPlaying = { export type Footer = { title: string; value: number | string; - status?: "default" | "error" | "success" | "warning" | "processing" + status?: "default" | "error" | "success" | "warning" | "processing" | "" } diff --git a/src/views/media/Home/components/BasicCountCard.vue b/src/views/media/Home/components/BasicCountCard.vue index 53cb6d36..203b9a14 100644 --- a/src/views/media/Home/components/BasicCountCard.vue +++ b/src/views/media/Home/components/BasicCountCard.vue @@ -36,10 +36,10 @@ onMounted(() => { }); const getData = () => { - homeApi.deviceCount().then((resp) => { + homeApi.deviceCount({}).then((resp) => { deviceCount.value = resp.result; }); - homeApi.channelCount().then((resp) => { + homeApi.channelCount({}).then((resp) => { channelCount.value = resp.result; }); }; From b2653adda5543949e27560f40c0d1011874e95b0 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Thu, 16 Feb 2023 14:03:46 +0800 Subject: [PATCH 04/15] =?UTF-8?q?update:=20=E4=BB=A3=E7=A0=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E6=94=AF=E6=8C=81=E8=84=9A=E6=9C=AC=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E8=BE=93=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MonacoEditor/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/MonacoEditor/index.vue b/src/components/MonacoEditor/index.vue index 9b8b725c..6762be92 100644 --- a/src/components/MonacoEditor/index.vue +++ b/src/components/MonacoEditor/index.vue @@ -13,7 +13,7 @@ import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'; import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'; self.MonacoEnvironment = { - getWorker(workerId, label) { + getWorker(_, label) { if (label === 'json') { return new jsonWorker(); } @@ -23,7 +23,7 @@ self.MonacoEnvironment = { if (label === 'html') { return new htmlWorker(); } - if (label === 'ts') { + if (['typescript', 'javascript'].includes(label)) { return new tsWorker(); } return new editorWorker(); @@ -33,6 +33,7 @@ self.MonacoEnvironment = { const props = defineProps({ modelValue: [String, Number], theme: { type: String, default: 'vs-dark' }, + language: { type: String, default: 'json' }, }); const emit = defineEmits(['update:modelValue']); @@ -42,10 +43,10 @@ const dom = ref(); let instance; onMounted(() => { - const jsonModel = monaco.editor.createModel(props.modelValue, 'json'); + const _model = monaco.editor.createModel(props.modelValue, props.language); instance = monaco.editor.create(dom.value, { - model: jsonModel, + model: _model, tabSize: 2, automaticLayout: true, scrollBeyondLastLine: false, From bf6c705eda5d30881a2ee2b954de3e123e6cc078 Mon Sep 17 00:00:00 2001 From: wangshuaiswim Date: Thu, 16 Feb 2023 14:31:44 +0800 Subject: [PATCH 05/15] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DPermissionButton?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PermissionButton/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/PermissionButton/index.vue b/src/components/PermissionButton/index.vue index ee9af547..57268e91 100644 --- a/src/components/PermissionButton/index.vue +++ b/src/components/PermissionButton/index.vue @@ -100,8 +100,8 @@ const isPermission = computed(() => { }) const _isPermission = computed(() => 'hasPermission' in props && isPermission.value - ? 'disabled' in buttonProps - ? buttonProps.disabled as boolean + ? 'disabled' in _buttonProps + ? _buttonProps.disabled as boolean : false : true ) From d7754789bf22227e59eeaae728da1c8a54f4c823 Mon Sep 17 00:00:00 2001 From: easy <1358086367@qq.com> Date: Thu, 16 Feb 2023 14:47:40 +0800 Subject: [PATCH 06/15] =?UTF-8?q?update:=20=E7=94=A8=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=B7=BB=E5=8A=A0=E6=8C=89=E9=92=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/User/components/EditUserDialog.vue | 32 ++++--- src/views/system/User/index.vue | 93 +++++++++++++++++-- 2 files changed, 102 insertions(+), 23 deletions(-) diff --git a/src/views/system/User/components/EditUserDialog.vue b/src/views/system/User/components/EditUserDialog.vue index aabc2898..52487cd8 100644 --- a/src/views/system/User/components/EditUserDialog.vue +++ b/src/views/system/User/components/EditUserDialog.vue @@ -110,11 +110,13 @@ placeholder="请选择角色" :options="form.roleOptions" > - + class="add-item" + > + + @@ -132,13 +134,13 @@ {{ name }} - + > + + @@ -186,7 +188,8 @@ + + diff --git a/src/views/rule-engine/DashBoard/components/Guide.vue b/src/views/rule-engine/DashBoard/components/Guide.vue new file mode 100644 index 00000000..c423d252 --- /dev/null +++ b/src/views/rule-engine/DashBoard/components/Guide.vue @@ -0,0 +1,60 @@ + + + + + diff --git a/src/views/rule-engine/DashBoard/components/NewAlarm.vue b/src/views/rule-engine/DashBoard/components/NewAlarm.vue new file mode 100644 index 00000000..6c7125d8 --- /dev/null +++ b/src/views/rule-engine/DashBoard/components/NewAlarm.vue @@ -0,0 +1,152 @@ + + + + \ No newline at end of file diff --git a/src/views/rule-engine/DashBoard/components/TimeSelect.vue b/src/views/rule-engine/DashBoard/components/TimeSelect.vue new file mode 100644 index 00000000..eaa86387 --- /dev/null +++ b/src/views/rule-engine/DashBoard/components/TimeSelect.vue @@ -0,0 +1,117 @@ + + + diff --git a/src/views/rule-engine/DashBoard/components/TopCard.vue b/src/views/rule-engine/DashBoard/components/TopCard.vue new file mode 100644 index 00000000..13c5fcac --- /dev/null +++ b/src/views/rule-engine/DashBoard/components/TopCard.vue @@ -0,0 +1,106 @@ + + + + + diff --git a/src/views/rule-engine/DashBoard/index.vue b/src/views/rule-engine/DashBoard/index.vue new file mode 100644 index 00000000..b07a1130 --- /dev/null +++ b/src/views/rule-engine/DashBoard/index.vue @@ -0,0 +1,547 @@ + + + + \ No newline at end of file diff --git a/src/views/rule-engine/DashBoard/typings.d.ts b/src/views/rule-engine/DashBoard/typings.d.ts new file mode 100644 index 00000000..87e0dde4 --- /dev/null +++ b/src/views/rule-engine/DashBoard/typings.d.ts @@ -0,0 +1,5 @@ +export type Footer = { + title: string; + value: number | string; + status?: "default" | "error" | "success" | "warning" | "processing" +} \ No newline at end of file diff --git a/vite.config.ts b/vite.config.ts index 9c86c17e..3fca4903 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -82,8 +82,8 @@ export default defineConfig(({ mode}) => { // target: 'http://192.168.33.22:8800', // target: 'http://192.168.32.244:8881', // target: 'http://47.112.135.104:5096', // opcua - // target: 'http://120.77.179.54:8844', // 120测试 - target: 'http://47.108.63.174:8845', // 测试 + target: 'http://120.77.179.54:8844', // 120测试 + // target: 'http://47.108.63.174:8845', // 测试 changeOrigin: true, rewrite: (path) => path.replace(/^\/api/, '') } From 693c9d3311d4348cef2ecc39ea27af983d546015 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Thu, 16 Feb 2023 16:13:23 +0800 Subject: [PATCH 09/15] =?UTF-8?q?feat:=20=E8=A7=86=E9=A2=91=E4=B8=AD?= =?UTF-8?q?=E5=BF=83-=E8=A7=86=E9=A2=91=E8=AE=BE=E5=A4=87=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/media/device.ts | 13 + src/components/AIcon/index.tsx | 5 +- src/views/media/Device/Save/index.vue | 7 + src/views/media/Device/index.vue | 334 ++++++++++++++++++++++++++ src/views/media/Device/typings.d.ts | 24 ++ 5 files changed, 382 insertions(+), 1 deletion(-) create mode 100644 src/api/media/device.ts create mode 100644 src/views/media/Device/Save/index.vue create mode 100644 src/views/media/Device/index.vue create mode 100644 src/views/media/Device/typings.d.ts diff --git a/src/api/media/device.ts b/src/api/media/device.ts new file mode 100644 index 00000000..d16d117e --- /dev/null +++ b/src/api/media/device.ts @@ -0,0 +1,13 @@ +import server from '@/utils/request' + +export default { + // 列表 + list: (data: any) => server.post(`/media/device/_query/`, data), + // 详情 + detail: (id: string): any => server.get(`/media/device/${id}`), + // 新增 + save: (data: any) => server.post(`/media/device/${data.channel}`, data), + // 修改 + update: (data: any) => server.put(`/media/device/${data.channel}/${data.id}`, data), + del: (id: string) => server.remove(`/media/device/${id}`), +} \ No newline at end of file diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx index 7a8a21b3..4ebea3b2 100644 --- a/src/components/AIcon/index.tsx +++ b/src/components/AIcon/index.tsx @@ -45,7 +45,10 @@ const iconKeys = [ 'InfoCircleOutlined', 'SearchOutlined', 'EllipsisOutlined', - 'ClockCircleOutlined' + 'ClockCircleOutlined', + 'PartitionOutlined', + 'ShareAltOutlined', + 'playCircleOutlined', ] const Icon = (props: {type: string}) => { diff --git a/src/views/media/Device/Save/index.vue b/src/views/media/Device/Save/index.vue new file mode 100644 index 00000000..e84d2a3b --- /dev/null +++ b/src/views/media/Device/Save/index.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/src/views/media/Device/index.vue b/src/views/media/Device/index.vue new file mode 100644 index 00000000..141caa50 --- /dev/null +++ b/src/views/media/Device/index.vue @@ -0,0 +1,334 @@ + + + + diff --git a/src/views/media/Device/typings.d.ts b/src/views/media/Device/typings.d.ts new file mode 100644 index 00000000..995964b8 --- /dev/null +++ b/src/views/media/Device/typings.d.ts @@ -0,0 +1,24 @@ +type BaseItem = { + id: string; + name: string; +}; +type State = { + value: string; + text: string; +}; + +export type DeviceItem = { + photoUrl?: string; + channelNumber: number; + createTime: number; + firmware: string; + gatewayId: string; + host: string; + manufacturer: string; + model: string; + port: number; + provider: string; + state: State; + streamMode: string; + transport: string; +} & BaseItem; From 24690e1cdb1e43728859da49b1b5823fad51355f Mon Sep 17 00:00:00 2001 From: wangshuaiswim Date: Thu, 16 Feb 2023 16:22:34 +0800 Subject: [PATCH 10/15] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8C=89=E9=92=AE=E9=87=8D=E5=A4=8D=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PermissionButton/index.vue | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/components/PermissionButton/index.vue b/src/components/PermissionButton/index.vue index 57268e91..cd95769d 100644 --- a/src/components/PermissionButton/index.vue +++ b/src/components/PermissionButton/index.vue @@ -4,14 +4,14 @@ - + - +