From 809515e73e6339a869d402496198d13d68db5879 Mon Sep 17 00:00:00 2001 From: xiongqian <2167232911@qq.com> Date: Tue, 31 Jan 2023 09:52:00 +0800 Subject: [PATCH 01/15] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E6=96=B0=E5=A2=9E=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/regular.ts | 8 ++- src/views/device/Product/Save/index.vue | 95 ++++++++++++++++++++----- 2 files changed, 84 insertions(+), 19 deletions(-) diff --git a/src/utils/regular.ts b/src/utils/regular.ts index 9d88336f..7e7fa9cc 100644 --- a/src/utils/regular.ts +++ b/src/utils/regular.ts @@ -1,4 +1,10 @@ // 用于校验 url export const urlReg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/; -export const isUrl = (path: string): boolean => urlReg.test(path) \ No newline at end of file +export const isUrl = (path: string): boolean => urlReg.test(path) + +// 用于校验只允许输入英文或者数字或者-或者_ + +export const inputReg = /^[a-zA-Z0-9_\-]+$/ + +export const isInput = (value: string) => inputReg.test(value) \ No newline at end of file diff --git a/src/views/device/Product/Save/index.vue b/src/views/device/Product/Save/index.vue index 1c928ba6..5958a65c 100644 --- a/src/views/device/Product/Save/index.vue +++ b/src/views/device/Product/Save/index.vue @@ -13,7 +13,7 @@ width="650px" >
- + @@ -83,7 +83,7 @@ - + - + - + + - + - + @@ -193,12 +197,15 @@ + + \ No newline at end of file From bd6a101afed86f2c59600bd11fd0035e653eb18f Mon Sep 17 00:00:00 2001 From: blp <2962632571@qq.com> Date: Tue, 31 Jan 2023 14:14:21 +0800 Subject: [PATCH 03/15] =?UTF-8?q?feat:=20=E7=89=A9=E8=81=94=E5=8D=A1?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E3=80=81=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot-card/cardManagement.ts | 20 +- src/views/iot-card/CardManagement/Save.vue | 246 ++++++++++++++++++++ src/views/iot-card/CardManagement/index.vue | 48 +++- src/views/iot-card/data.ts | 76 ++++++ 4 files changed, 385 insertions(+), 5 deletions(-) create mode 100644 src/views/iot-card/CardManagement/Save.vue create mode 100644 src/views/iot-card/data.ts diff --git a/src/api/iot-card/cardManagement.ts b/src/api/iot-card/cardManagement.ts index 51a77294..34aee292 100644 --- a/src/api/iot-card/cardManagement.ts +++ b/src/api/iot-card/cardManagement.ts @@ -97,4 +97,22 @@ export const _import = (configId: any, params: any) => server.get(`/network/card * @param format 类型 xlsx、csv * @param params */ -export const _export = (format: string, data: any) => server.post(`/network/card/download.${format}/_query`, data, 'blob'); \ No newline at end of file +export const _export = (format: string, data: any) => server.post(`/network/card/download.${format}/_query`, data, 'blob'); + +/** + * 验证iccid + * @param id + */ +export const validateId = (id: string) => server.get(`/network/card/id/_validate?id=${id}`); + +/** + * 新增物联卡 + * @param data + */ +export const add = (data: any) => server.patch(`/network/card`, data); + +/** + * 编辑物联卡 + * @param data + */ +export const edit = (data: any) => server.put(`/network/card/${data.id}`, data); \ No newline at end of file diff --git a/src/views/iot-card/CardManagement/Save.vue b/src/views/iot-card/CardManagement/Save.vue new file mode 100644 index 00000000..9e62a69f --- /dev/null +++ b/src/views/iot-card/CardManagement/Save.vue @@ -0,0 +1,246 @@ + + + diff --git a/src/views/iot-card/CardManagement/index.vue b/src/views/iot-card/CardManagement/index.vue index 3cf85c36..3b5a1809 100644 --- a/src/views/iot-card/CardManagement/index.vue +++ b/src/views/iot-card/CardManagement/index.vue @@ -151,11 +151,18 @@ {{ slotProps.totalFlow }} - M 使用流量 + + M 使用流量
-
{{ slotProps.totalFlow - slotProps.usedFlow }} %
+
+ {{ + slotProps.totalFlow - slotProps.usedFlow + }} + % +
总共 {{ slotProps.totalFlow }} M
@@ -163,7 +170,9 @@
@@ -307,6 +316,13 @@ :cardId="cardId" @change="bindDevice" /> + +
@@ -333,6 +349,7 @@ import { getImage } from '@/utils/comm'; import BindDevice from './BindDevice.vue'; import Import from './Import.vue'; import Export from './Export.vue'; +import Save from './Save.vue'; const cardManageRef = ref>({}); const params = ref>({}); @@ -344,6 +361,7 @@ const exportVisible = ref(false); const importVisible = ref(false); const cardId = ref(); const current = ref>({}); +const saveType = ref(''); const columns = [ { @@ -504,6 +522,11 @@ const getActions = ( title: '编辑', }, icon: 'EditOutlined', + onClick: () => { + visible.value = true; + current.value = data; + saveType.value = 'edit'; + }, }, { key: 'view', @@ -651,10 +674,27 @@ const handleView = (id: string) => { /** * 新增 */ -const handleAdd = () => {}; +const handleAdd = () => { + visible.value = true; + current.value = {}; + saveType.value = 'add'; +}; + +/** + * 新增、编辑关闭弹窗 + * @param val 加载表格 + */ +const saveChange = (val: any) => { + visible.value = false; + current.value = {}; + if (val) { + cardManageRef.value?.reload(); + } +}; /** * 绑定设备关闭窗口 + * @param val */ const bindDevice = (val: boolean) => { bindDeviceVisible.value = false; diff --git a/src/views/iot-card/data.ts b/src/views/iot-card/data.ts new file mode 100644 index 00000000..cf9a9fc3 --- /dev/null +++ b/src/views/iot-card/data.ts @@ -0,0 +1,76 @@ +import { getImage } from '@/utils/comm'; + +// 平台类型 +export const PlatformTypeList = [ + { + label: '移动OneLink', + value: 'OneLinkPB', + imgUrl: getImage('/iot-card/onelink.png'), + }, + { + label: '电信Ctwing', + value: 'CtwingCmp', + imgUrl: getImage('/iot-card/ctwingcmp.png'), + }, + { + label: '联通Unicom', + value: 'UnicomCmp', + imgUrl: getImage('/iot-card/unicom.png'), + }, +]; + +//运营商 +export const OperatorList = [ + { + label: '移动', + value: '移动', + }, + { + label: '电信', + value: '电信', + }, + { + label: '联通', + value: '联通', + }, +]; + +// 类型 +export const TypeList = [ + { + label: '年卡', + value: 'year', + }, + { + label: '季卡', + value: 'season', + }, + { + label: '月卡', + value: 'month', + }, + { + label: '其他', + value: 'other', + }, +]; + +// 支付方式 +export const PaymentMethod = [ + { + label: '支付宝手机网站支付', + value: 'ALIPAY_WAP', + }, + { + label: '支付宝网页及时到账支付', + value: 'ALIPAY_WEB', + }, + { + label: '微信公众号支付', + value: 'WEIXIN_JSAPI', + }, + { + label: '微信扫码支付', + value: 'WEIXIN_NATIVE', + }, +]; From 4ea899f874b30fd7e59c064cd61e98ec963f0369 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Tue, 31 Jan 2023 14:24:54 +0800 Subject: [PATCH 04/15] =?UTF-8?q?fix:=20=E9=80=9A=E7=9F=A5=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=96=B0=E5=A2=9E=E7=BC=96=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/notice/Config/Detail/index.vue | 47 +++++++++++++++--------- src/views/notice/Template/index.vue | 4 +- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/src/views/notice/Config/Detail/index.vue b/src/views/notice/Config/Detail/index.vue index 700c6d89..abfc22a5 100644 --- a/src/views/notice/Config/Detail/index.vue +++ b/src/views/notice/Config/Detail/index.vue @@ -311,31 +311,42 @@ const msgType = ref([ // 表单数据 const formData = ref({ configuration: { - appKey: '', - appSecret: '', + host: '', + port: 25, + ssl: false, + sender: '', + username: '', + password: '', }, description: '', name: '', - provider: 'dingTalkMessage', - type: 'dingTalk', + provider: 'embedded', + type: 'email', }); // 根据通知方式展示对应的字段 watch( () => formData.value.type, (val) => { - // formData.value.configuration = Object.values(CONFIG_FIELD_MAP[val])[0]; msgType.value = MSG_TYPE[val]; formData.value.provider = msgType.value[0].value; + + formData.value.configuration = + CONFIG_FIELD_MAP[val][formData.value.provider]; + + clearValid(); }, ); -computed(() => - Object.assign( - formData.value.configuration, - CONFIG_FIELD_MAP[formData.value.type][formData.value.provider], - ), +watch( + () => formData.value.provider, + (val) => { + formData.value.configuration = + CONFIG_FIELD_MAP[formData.value.type][val]; + + clearValid(); + }, ); // 验证规则 @@ -405,15 +416,15 @@ const { resetFields, validate, validateInfos, clearValidate } = useForm( formData.value, formRules.value, ); -watch( - () => formData.value.type, - () => { + +const clearValid = () => { + setTimeout(() => { clearValidate(); - }, - { deep: true }, -); + }, 200); +}; const getDetail = async () => { + if (route.params.id === ':id') return; const res = await configApi.detail(route.params.id as string); // console.log('res: ', res); formData.value = res.result; @@ -441,10 +452,12 @@ const handleSubmit = () => { message.success('保存成功'); router.back(); } - btnLoading.value = false; }) .catch((err) => { console.log('err: ', err); + }) + .finally(() => { + btnLoading.value = false; }); }; diff --git a/src/views/notice/Template/index.vue b/src/views/notice/Template/index.vue index 7af08260..87c20444 100644 --- a/src/views/notice/Template/index.vue +++ b/src/views/notice/Template/index.vue @@ -256,7 +256,7 @@ const getMethodTxt = (type: string) => { * 新增 */ const handleAdd = () => { - router.push(`/notice/Config/detail/:id`); + router.push(`/notice/Template/detail/:id`); }; /** @@ -323,7 +323,7 @@ const getActions = ( onClick: () => { // visible.value = true; // current.value = data; - router.push(`/notice/Config/detail/${data.id}`); + router.push(`/notice/Template/detail/${data.id}`); }, }, { From f381453bceacff6fe59ef4017697ae76c007758a Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 31 Jan 2023 15:38:04 +0800 Subject: [PATCH 05/15] =?UTF-8?q?feat:=20=E6=A0=87=E7=AD=BE=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=92=8C=E5=85=B3=E7=B3=BB=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../images/device/{ => instance}/button.png | Bin src/api/device/instance.ts | 47 +++++++ src/components/Table/index.tsx | 4 +- .../Detail/Info/components/Config/index.vue | 40 ++++-- .../Detail/Info/components/Relation/Save.vue | 125 ++++++++++++++++++ .../Detail/Info/components/Relation/index.vue | 10 ++ .../Detail/Info/components/Tags/Save.vue | 117 ++++++++++++++++ .../Detail/Info/components/Tags/index.vue | 35 ++++- src/views/device/Instance/Detail/index.vue | 77 ++++++++++- src/views/device/Instance/index.vue | 28 ++-- 10 files changed, 456 insertions(+), 27 deletions(-) rename public/images/device/{ => instance}/button.png (100%) create mode 100644 src/views/device/Instance/Detail/Info/components/Relation/Save.vue create mode 100644 src/views/device/Instance/Detail/Info/components/Tags/Save.vue diff --git a/public/images/device/button.png b/public/images/device/instance/button.png similarity index 100% rename from public/images/device/button.png rename to public/images/device/instance/button.png diff --git a/src/api/device/instance.ts b/src/api/device/instance.ts index b1d01908..ceb17116 100644 --- a/src/api/device/instance.ts +++ b/src/api/device/instance.ts @@ -120,3 +120,50 @@ export const update = (data: Partial) => data.id ? server.patch( * @returns */ export const getConfigMetadata = (id: string) => server.get(`/device-instance/${id}/config-metadata`) + +/** + * 断开连接 + * @param id 设备id + * @returns + */ +export const _disconnect = (id: string) => server.post(`/device-instance/${id}/disconnect`) + +/** + * 查询用户列表 + * @returns + */ +export const queryUserListNoPaging = () => server.post(`/user/_query/no-paging`, { + paging: false, + sorts: [{name: 'name', order: "asc"}] +}) + +/** + * 保存设备关系 + * @param id 设备id + * @param data + * @returns + */ +export const saveRelations = (id: string, data: Record) => server.patch(`/device/instance/${id}/relations`, data) + +/** + * 修改标签 + * @param id 设备id + * @param data + * @returns + */ +export const saveTags = (id: string, data: Record) => server.patch(`/device/instance/${id}/tag`, data) + +/** + * 删除标签 + * @param deviceId 设备id + * @param id 标签id + * @returns + */ +export const delTags = (deviceId: string, id: string) => server.remove(`/device/instance/${deviceId}/tag/${id}`) + +/** + * 恢复默认配置 + * @param deviceId 设备id + * @returns + */ +export const configurationReset = (deviceId: string) => server.put(`/device-instance/${deviceId}/configuration/_reset`) \ No newline at end of file diff --git a/src/components/Table/index.tsx b/src/components/Table/index.tsx index 1a37be86..fb778495 100644 --- a/src/components/Table/index.tsx +++ b/src/components/Table/index.tsx @@ -333,7 +333,7 @@ const JTable = defineComponent({ total={total.value} showQuickJumper={false} showSizeChanger={true} - current={pageIndex.value} + current={pageIndex.value + 1} pageSize={pageSize.value} pageSizeOptions={['12', '24', '48', '60', '100']} showTotal={(num) => { @@ -345,7 +345,7 @@ const JTable = defineComponent({ handleSearch({ ...props.params, pageSize: size, - pageIndex: pageSize.value === size ? page : 0 + pageIndex: pageSize.value === size ? (page ? page - 1 : 0) : 0 }) }} /> diff --git a/src/views/device/Instance/Detail/Info/components/Config/index.vue b/src/views/device/Instance/Detail/Info/components/Config/index.vue index f22eabaa..4d7b0d78 100644 --- a/src/views/device/Instance/Detail/Info/components/Config/index.vue +++ b/src/views/device/Instance/Detail/Info/components/Config/index.vue @@ -4,8 +4,12 @@
配置
编辑 - 应用配置 - 恢复默认 + + 应用配置 + + + 恢复默认 + @@ -28,7 +32,8 @@ \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Info/components/Relation/Save.vue b/src/views/device/Instance/Detail/Info/components/Relation/Save.vue new file mode 100644 index 00000000..bf7db937 --- /dev/null +++ b/src/views/device/Instance/Detail/Info/components/Relation/Save.vue @@ -0,0 +1,125 @@ + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Info/components/Relation/index.vue b/src/views/device/Instance/Detail/Info/components/Relation/index.vue index 2fa91436..293fddd2 100644 --- a/src/views/device/Instance/Detail/Info/components/Relation/index.vue +++ b/src/views/device/Instance/Detail/Info/components/Relation/index.vue @@ -7,17 +7,27 @@ {{ item?.related ? (item?.related || []).map(i => i.name).join(',') : '' }} + diff --git a/src/views/device/Instance/Detail/Info/components/Tags/Save.vue b/src/views/device/Instance/Detail/Info/components/Tags/Save.vue new file mode 100644 index 00000000..dafe416a --- /dev/null +++ b/src/views/device/Instance/Detail/Info/components/Tags/Save.vue @@ -0,0 +1,117 @@ + + + \ No newline at end of file diff --git a/src/views/device/Instance/Detail/Info/components/Tags/index.vue b/src/views/device/Instance/Detail/Info/components/Tags/index.vue index b672f699..f197d60f 100644 --- a/src/views/device/Instance/Detail/Info/components/Tags/index.vue +++ b/src/views/device/Instance/Detail/Info/components/Tags/index.vue @@ -1,3 +1,34 @@ \ No newline at end of file +
+ + + {{ item?.value }} + + +
+ + + diff --git a/src/views/device/Instance/Detail/index.vue b/src/views/device/Instance/Detail/index.vue index b4c055b5..d9f2f0e5 100644 --- a/src/views/device/Instance/Detail/index.vue +++ b/src/views/device/Instance/Detail/index.vue @@ -1,7 +1,40 @@ @@ -9,9 +42,18 @@ import { useInstanceStore } from '@/store/instance'; import Info from './Info/index.vue'; import Metadata from '../../components/Metadata/index.vue'; +import { _deploy, _disconnect } from '@/api/device/instance' +import { message } from 'ant-design-vue'; +import { getImage } from '@/utils/comm'; + const route = useRoute(); const instanceStore = useInstanceStore() +const statusMap = new Map(); +statusMap.set('online', 'processing'); +statusMap.set('offline', 'error'); +statusMap.set('notActive', 'warning'); + const list = [ { key: 'Info', @@ -46,4 +88,35 @@ const onBack = () => { const onTabChange = (e: string) => { instanceStore.tabActiveKey = e } + +const handleAction = async () => { + if(instanceStore.current.id){ + const resp = await _deploy(instanceStore.current.id) + if(resp.status === 200){ + message.success('操作成功!') + instanceStore.refresh(instanceStore.current.id) + } + } +} + +const handleDisconnect = async () => { + if(instanceStore.current.id){ + const resp = await _disconnect(instanceStore.current.id) + if(resp.status === 200){ + message.success('操作成功!') + instanceStore.refresh(instanceStore.current.id) + } + } +} + +const handleRefresh = async () => { + if(instanceStore.current.id){ + await instanceStore.refresh(instanceStore.current.id) + message.success('操作成功') + } +} + +const jumpProduct = () => { + message.warn('暂未开发') +} \ No newline at end of file diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue index fb842bec..52fd4ef4 100644 --- a/src/views/device/Instance/index.vue +++ b/src/views/device/Instance/index.vue @@ -101,8 +101,8 @@ :actions="getActions(slotProps, 'card')" v-bind="slotProps" :active="_selectedRowKeys.includes(slotProps.id)" - :status="slotProps.state.value" - :statusText="slotProps.state.text" + :status="slotProps.state?.value" + :statusText="slotProps.state?.text" :statusNames="{ online: 'success', offline: 'error', @@ -126,7 +126,7 @@
设备类型
-
{{ slotProps.deviceType.text }}
+
{{ slotProps.deviceType?.text }}
产品名称
@@ -151,7 +151,7 @@ /> @@ -166,7 +166,7 @@ /> @@ -176,8 +176,8 @@ + diff --git a/src/views/iot-card/CardManagement/index.vue b/src/views/iot-card/CardManagement/index.vue index 3b5a1809..1ac18f80 100644 --- a/src/views/iot-card/CardManagement/index.vue +++ b/src/views/iot-card/CardManagement/index.vue @@ -351,6 +351,8 @@ import Import from './Import.vue'; import Export from './Export.vue'; import Save from './Save.vue'; +const router = useRouter(); + const cardManageRef = ref>({}); const params = ref>({}); const _selectedRowKeys = ref([]); @@ -535,6 +537,14 @@ const getActions = ( title: '查看', }, icon: 'EyeOutlined', + onClick: () => { + router.push({ + path: '/iot-card/CardManagement/Detail', + query: { + id: data.id, + }, + }); + }, }, { key: 'bindDevice', From 88ecf733df1e241a37f0093f21e7d0083d6efb83 Mon Sep 17 00:00:00 2001 From: blp <2962632571@qq.com> Date: Tue, 31 Jan 2023 16:14:04 +0800 Subject: [PATCH 08/15] =?UTF-8?q?feat:=20=E5=85=85=E5=80=BC=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/router/menu.ts | 4 ++++ src/views/iot-card/Recharge/index.vue | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 src/views/iot-card/Recharge/index.vue diff --git a/src/router/menu.ts b/src/router/menu.ts index f7cddb58..4f044c8a 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -149,6 +149,10 @@ export default [ path: '/iot-card/CardManagement/Detail', component: () => import('@/views/iot-card/CardManagement/Detail/index.vue') }, + { + path: '/iot-card/Recharge', + component: () => import('@/views/iot-card/Recharge/index.vue') + }, // 北向输出 { path: '/northbound/DuerOS', diff --git a/src/views/iot-card/Recharge/index.vue b/src/views/iot-card/Recharge/index.vue new file mode 100644 index 00000000..4f1bbbc0 --- /dev/null +++ b/src/views/iot-card/Recharge/index.vue @@ -0,0 +1,8 @@ + + + + + + From ea4552a2b8965b90e9af247d4de9fea8bd89d539 Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Tue, 31 Jan 2023 16:48:01 +0800 Subject: [PATCH 09/15] =?UTF-8?q?fix:=20=E9=92=89=E9=92=89=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=B6=88=E6=81=AF=E7=B1=BB=E5=9E=8B=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/notice/Template/Detail/index.vue | 80 ++++++++++++++-------- 1 file changed, 53 insertions(+), 27 deletions(-) diff --git a/src/views/notice/Template/Detail/index.vue b/src/views/notice/Template/Detail/index.vue index ed323dff..93415894 100644 --- a/src/views/notice/Template/Detail/index.vue +++ b/src/views/notice/Template/Detail/index.vue @@ -120,15 +120,15 @@ ] " > - + /> - + @@ -456,7 +475,7 @@ From 3f8aba0a8c500403ead7fb3fe45430ca59a698ff Mon Sep 17 00:00:00 2001 From: 100011797 <2642441182@qq.com> Date: Tue, 31 Jan 2023 16:51:48 +0800 Subject: [PATCH 10/15] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E5=8D=A1=E7=89=87=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/CardBox/index.vue | 7 +++++++ src/router/menu.ts | 4 ++++ src/views/device/Instance/index.vue | 1 + src/views/northbound/DuerOS/Save/index.vue | 3 +++ src/views/northbound/DuerOS/index.vue | 2 +- 5 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/views/northbound/DuerOS/Save/index.vue diff --git a/src/components/CardBox/index.vue b/src/components/CardBox/index.vue index cb958ce7..0915064a 100644 --- a/src/components/CardBox/index.vue +++ b/src/components/CardBox/index.vue @@ -231,6 +231,13 @@ const handleClick = () => { :deep(.card-item-content-title) { cursor: pointer; + font-size: 16px; + font-weight: 700; + color: @primary-color; + width: calc(100% - 100px); + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; } :deep(.card-item-heard-name) { diff --git a/src/router/menu.ts b/src/router/menu.ts index 234bcabf..22aaecec 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -150,6 +150,10 @@ export default [ path: '/northbound/DuerOS', component: () => import('@/views/northbound/DuerOS/index.vue') }, + { + path: '/northbound/DuerOS/detail/:id', + component: () => import('@/views/northbound/DuerOS/Save/index.vue') + }, { path: '/northbound/AliCloud', component: () => import('@/views/northbound/AliCloud/index.vue') diff --git a/src/views/device/Instance/index.vue b/src/views/device/Instance/index.vue index 52fd4ef4..11656160 100644 --- a/src/views/device/Instance/index.vue +++ b/src/views/device/Instance/index.vue @@ -1,4 +1,5 @@ \ No newline at end of file diff --git a/src/views/northbound/DuerOS/index.vue b/src/views/northbound/DuerOS/index.vue index f8ab376f..520d60bd 100644 --- a/src/views/northbound/DuerOS/index.vue +++ b/src/views/northbound/DuerOS/index.vue @@ -148,7 +148,7 @@ const getActions = (data: Partial>): ActionsType[] => { } const add = () => { - message.warn('123') + // router.push(`/northbound/DuerOS/detail/:id`) } \ No newline at end of file From c4ae0a6dddd4ea8c99baa1a3f729e493de347cdc Mon Sep 17 00:00:00 2001 From: JiangQiming <291854119@qq.com> Date: Tue, 31 Jan 2023 17:16:19 +0800 Subject: [PATCH 11/15] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8=E7=B2=98=E8=B4=B4=E6=97=B6=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/MonacoEditor/index.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/MonacoEditor/index.vue b/src/components/MonacoEditor/index.vue index 4ec0f91d..9b8b725c 100644 --- a/src/components/MonacoEditor/index.vue +++ b/src/components/MonacoEditor/index.vue @@ -50,6 +50,7 @@ onMounted(() => { automaticLayout: true, scrollBeyondLastLine: false, theme: props.theme, // 主题色: vs(默认高亮), vs-dark(黑色), hc-black(高亮黑色) + formatOnPaste: true, }); instance.onDidChangeModelContent(() => { From d48d504b302b737e84cd3824cfbf599988bb199e Mon Sep 17 00:00:00 2001 From: xiongqian <2167232911@qq.com> Date: Tue, 31 Jan 2023 17:25:51 +0800 Subject: [PATCH 12/15] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BA=A7=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/device/product.ts | 2 +- src/views/device/Product/Save/index.vue | 258 +++++++++++++++--------- src/views/device/Product/index.vue | 25 ++- 3 files changed, 188 insertions(+), 97 deletions(-) diff --git a/src/api/device/product.ts b/src/api/device/product.ts index 6ae11030..9d29476b 100644 --- a/src/api/device/product.ts +++ b/src/api/device/product.ts @@ -108,7 +108,7 @@ export const deleteProduct = (id: string) => server.patch(`/device-product/${id} * 检测产品Id唯一性 * @param id 产品ID */ - export const queryProductId = (id: string) => server.post(`/device-product/${id}/exists`) + export const queryProductId = (id: string) => server.get(`/device-product/${id}/exists`) /** * 保存产品 * @param data 产品信息 diff --git a/src/views/device/Product/Save/index.vue b/src/views/device/Product/Save/index.vue index 5958a65c..d7605411 100644 --- a/src/views/device/Product/Save/index.vue +++ b/src/views/device/Product/Save/index.vue @@ -11,12 +11,21 @@ cancelText="取消" v-bind="layout" width="650px" + :confirmLoading="loading" >
- + - + + + + @@ -89,15 +98,16 @@ - @@ -111,79 +121,69 @@ - + - - - + + - - - - - +
+ + + +
+ +
+
+ + + {{ item.label }} + + +
+ + +
+
+ +
+
+
+ +
+
+
+ (false); const treeList = ref[]>([]); -const visible = ref(false); -const logoLoading = ref(false); +const visible = ref(false); +const logoLoading = ref(false); +const formRef = ref(); +const disabled = ref(false); const useForm = Form.useForm; const _selectedRowKeys = ref([]); const photoValue = ref('/images/device-product.png'); @@ -236,14 +245,17 @@ const deviceList = ref([ { label: '直连设备', value: 'device', + logo: getImage('/device-type-1.png'), }, { label: '网关子设备', value: 'childrenDevice', + logo: getImage('/device-type-2.png'), }, { label: '网关设备', value: 'gateway', + logo: getImage('/device/device-type-3.png'), }, ]); @@ -254,7 +266,7 @@ const form = reactive({ classifiedName: '', deviceType: '', describe: '', - photoUrl: '', + photoUrl: getImage('/device/instance/device-card.png'), }); /** * 校验id @@ -265,12 +277,13 @@ const validateInput = async (_rule: Rule, value: string) => { return Promise.reject('请输入英文或者数字或者-或者_'); } else { const res = await queryProductId(value); - if (res.status === 200) { - if (res.result) { - return Promise.reject('该ID已存在'); - } + if (res.status === 200 && res.result) { + return Promise.reject('ID重复'); + } else { + return Promise.resolve(); } } + } else { return Promise.resolve(); } }; @@ -278,25 +291,27 @@ const validateInput = async (_rule: Rule, value: string) => { * 校验是否选择设备类型 */ const validateDeviceType = async (_rule: Rule, value: string) => { - if (photoValue.value.length === 0) { - return Promise.resolve('请选择设备类型'); + if (!value) { + return Promise.reject('请选择设备类型'); + } else { + return Promise.resolve(); } }; const rules = reactive({ - id: [ - { message: '请输入名称', validator: validateInput, trigger: 'change' }, - ], + id: [{ validator: validateInput, trigger: 'blur' }], name: [{ required: true, message: '请输入名称', trigger: 'blur' }], deviceType: [ { required: true, - message: '请选择设备类型', - trigger: 'blur', validator: validateDeviceType, + trigger: 'blur', }, ], }); +const valueChange = (value: string, label: string) => { + form.classifiedName = label[0]; +}; /** * 查询产品分类 */ @@ -312,14 +327,33 @@ const queryProductTree = async () => { watch( () => props.isAdd, () => { - queryProductTree(); + // queryProductTree(); }, { immediate: true, deep: true }, ); /** * 显示弹窗 */ -const show = () => { +const show = (data: any) => { + console.log(props.isAdd, '11111'); + if (props.isAdd === 2) { + // form.name = data.name; + // form.classifiedId = data.classifiedId; + // form.classifiedName = data.classifiedName; + // form.photoUrl = data.photoUrl || photoValue.value; + // form.deviceType = data.deviceType.value; + // form.describe = form.describe; + // form.id = data.id; + // disabled.value = true; + } else { + // form.name = ''; + // form.classifiedId = ''; + // form.classifiedName = ''; + // form.photoUrl = photoValue.value; + // form.deviceType = ''; + // form.describe = ''; + // form.id = ''; + } visible.value = true; }; @@ -329,11 +363,18 @@ const show = () => { const close = () => { visible.value = false; }; +const { resetFields, validate, validateInfos, clearValidate } = useForm( + form, + rules, +); /** - * 卡片点击事件 + * 提交表单数据 */ -const handleClick = (dt: any) => { - _selectedRowKeys.value = dt; +const submitData = () => { + formRef.value + .validate() + .then(async () => {}) + .catch((err: any) => {}); }; /** * 文件上传之前 @@ -367,7 +408,7 @@ const handleChange = (info: any) => { /** * 初始化 */ -queryProductTree(); +// queryProductTree(); defineExpose({ show: show, }); @@ -375,7 +416,7 @@ defineExpose({ diff --git a/src/views/device/Product/index.vue b/src/views/device/Product/index.vue index c5d6d505..e71205cd 100644 --- a/src/views/device/Product/index.vue +++ b/src/views/device/Product/index.vue @@ -107,7 +107,7 @@ - + @@ -140,6 +140,8 @@ import Save from './Save/index.vue'; /** * 表格数据 */ +const isAdd = ref(0); +const title = ref(''); const statusMap = new Map(); statusMap.set(1, 'success'); statusMap.set(0, 'error'); @@ -187,6 +189,7 @@ const columns = [ ]; const _selectedRowKeys = ref([]); +const currentForm = ref({}); const onSelectChange = (keys: string[]) => { _selectedRowKeys.value = [...keys]; @@ -205,11 +208,14 @@ const handleClick = (dt: any) => { } }; -const getActions = (data: Partial>): ActionsType[] => { +const getActions = ( + data: Partial>, + type: 'card' | 'table', +): ActionsType[] => { if (!data) { return []; } - return [ + const actions = [ { key: 'view', text: '查看', @@ -217,6 +223,7 @@ const getActions = (data: Partial>): ActionsType[] => { title: '查看', }, icon: 'EyeOutlined', + onClick: () => {}, }, { key: 'edit', @@ -226,6 +233,13 @@ const getActions = (data: Partial>): ActionsType[] => { }, icon: 'EditOutlined', + onClick: () => { + title.value = '编辑'; + isAdd.value = 2; + nextTick(() => { + saveRef.value.show(data); + }); + }, }, { key: 'download', @@ -283,10 +297,13 @@ const getActions = (data: Partial>): ActionsType[] => { icon: 'DeleteOutlined', }, ]; + return actions; }; const add = () => { - saveRef.value.show(); + isAdd.value = 1; + title.value = '新增'; + saveRef.value.show(currentForm.value); }; // 筛选 From 8e2e0de679520cf8fa27163bb827c2d51aa2d224 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 31 Jan 2023 17:50:47 +0800 Subject: [PATCH 13/15] =?UTF-8?q?update:=201.=E4=BC=98=E5=8C=96=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E8=B7=AF=E7=94=B1,=E5=A4=84=E7=90=86=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=EF=BC=9B=E4=BC=98?= =?UTF-8?q?=E5=8C=96layout=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/BasicLayoutPage.vue | 3 +- .../Layout/components/Header/index.tsx | 2 +- .../components/SiderMenu/SiderMenu.less | 4 + src/main.ts | 4 +- src/router/index.ts | 6 +- src/router/menu.ts | 2 +- src/store/menu.ts | 7 +- src/utils/menu.ts | 157 +++++++++++++++--- src/views/home/index.vue | 125 +++++++------- 9 files changed, 220 insertions(+), 90 deletions(-) diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index 054f54ad..ebc3adc4 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -21,6 +21,7 @@ import { ProLayout } from '@/components/Layout' import DefaultSetting from '../../../config/config' import { useMenuStore } from '@/store/menu' +import { clearMenuItem } from 'components/Layout/utils' type StateType = { collapsed: boolean @@ -39,7 +40,7 @@ const layoutConf = reactive({ siderWidth: DefaultSetting.layout.siderWidth, logo: DefaultSetting.layout.logo, title: DefaultSetting.layout.title, - menuData: menu.menus, + menuData: clearMenuItem(menu.siderMenus), }); const state = reactive({ diff --git a/src/components/Layout/components/Header/index.tsx b/src/components/Layout/components/Header/index.tsx index c4bfc014..a804a3a2 100644 --- a/src/components/Layout/components/Header/index.tsx +++ b/src/components/Layout/components/Header/index.tsx @@ -32,7 +32,7 @@ export const HeaderView = defineComponent({ height: `${headerHeight.value}px`, lineHeight: `${headerHeight.value}px`, width: `100%`, - + background: 'transparent' }} /> { menuData.forEach(r => { router.addRoute('base', r) }) - router.addRoute('base',{ - path: '/:pathMatch(.*)*', + path: '/:pathMatch(.*)', + name: 'error', component: () => NotFindPage }) - console.log(to) + next({ ...to, replace: true }) }) }).catch(() => { diff --git a/src/router/menu.ts b/src/router/menu.ts index 056aa40d..7e97e255 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -18,7 +18,7 @@ export default [ // path: '/initsetting', // component: () => import('@/view/Login/initSet.vue') // } - + { path: '/*', redirect: '/'}, // start: 测试用, 可删除 { path: '/login', diff --git a/src/store/menu.ts b/src/store/menu.ts index 70e1ced9..7d1a675e 100644 --- a/src/store/menu.ts +++ b/src/store/menu.ts @@ -1,12 +1,14 @@ import { defineStore } from "pinia"; import { queryOwnThree } from '@/api/system/menu' import { filterAsnycRouter } from '@/utils/menu' +import { cloneDeep } from 'lodash-es' export const useMenuStore = defineStore({ id: 'menu', state: () => ({ menus: {}, menuData: [], + siderMenus: [], menusKey: [] }), getters: { @@ -52,7 +54,8 @@ export const useMenuStore = defineStore({ ]; const resp = await queryOwnThree({ paging: false, terms: params }) if (resp.success) { - const menus = filterAsnycRouter(resp.result) + const silderMenus = filterAsnycRouter(cloneDeep(resp.result)) + const menus = filterAsnycRouter(cloneDeep(resp.result)) menus.push({ path: '/', redirect: menus[0]?.path, @@ -61,6 +64,8 @@ export const useMenuStore = defineStore({ } }) this.menuData = menus + this.siderMenus = silderMenus + console.log('silderMenus', silderMenus) res(menus) } }) diff --git a/src/utils/menu.ts b/src/utils/menu.ts index e860b162..2907f1c2 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -1,11 +1,99 @@ const pagesComponent = import.meta.glob('../views/**/*.vue', { eager: true }); import { BlankLayoutPage, BasicLayoutPage } from 'components/Layout' -type ExtraRouteItem = { - code: string - name: string - url?: string -} +/** + * 权限信息 + */ +export type PermissionInfo = { + permission: string; + actions: string[]; +}; + +/** + * 按钮信息 + */ +export type MenuButtonInfo = { + id: string; + name: string; + permissions: PermissionInfo; + createTime: number; + describe?: string; + options: Record; +}; + + +export type MenuItem = { + id: string; + /** + * 名称 + */ + name: string; + /** + * 编码 + */ + code: string; + /** + * 所属应用 + */ + application: string; + /** + * 描述 + */ + describe: string; + /** + * url,路由 + */ + url: string; + /** + * 图标 + */ + icon: string; + /** + * 状态, 0为禁用,1为启用 + */ + status: number; + /** + * 绑定权限信息 + */ + permissions: PermissionInfo[]; + /** + * 按钮定义信息 + */ + buttons: MenuButtonInfo[]; + /** + * 其他配置信息 + */ + options: Record; + /** + * 父级ID + */ + parentId: string; + /** + * 树结构路径 + */ + path: string; + /** + * 排序序号 + */ + sortIndex: number; + /** + * 树层级 + */ + level: number; + createTime: number; + redirect?: string; + children?: MenuItem[]; + accessSupport?: { text: string; value: string }; + appId?: string; //应用id + isShow?: boolean; + meta?: { + title?: string + icon?: string + [key: string]: any + }, + component?: any +}; + // 额外子级路由 const extraRouteObj = { 'media/Cascade': { @@ -59,51 +147,82 @@ const extraRouteObj = { const resolveComponent = (name: any) => { - // TODO 暂时用system进行测试 const importPage = pagesComponent[`../views/${name}/index.vue`]; if (!importPage) { console.warn(`Unknown page ${name}. Is it located under Pages with a .vue extension?`) } //@ts-ignore - return !!importPage ? importPage.default : BlankLayoutPage + return !!importPage ? importPage.default : undefined } -const findChildrenRoute = (code: string, url: string): ExtraRouteItem[] => { +const findChildrenRoute = (code: string, url: string): MenuItem[] => { if (extraRouteObj[code]) { - return extraRouteObj[code].children.map((route: ExtraRouteItem) => { + return extraRouteObj[code].children.map((route: MenuItem) => { return { url: `${url}/${route.code}`, code: route.code, - name: route.name + name: route.name, + isShow: false } }) } return [] } +const findDetailRouteItem = (code: string, url: string): Partial | null => { + const detailComponent = resolveComponent(`${code}/Detail`) + if (detailComponent) { + return { + url: `${url}/Detail/:id`, + component: detailComponent, + name: '详情信息', + isShow: false + } + } + return null +} + +const findDetailRoutes = (routes: any[]): any[] => { + const newRoutes: any[] = [] + routes.forEach((route: any) => { + newRoutes.push(route) + const detail = findDetailRouteItem(route.code, route.url) + if (detail) { + newRoutes.push(detail) + } + }) + return newRoutes +} + export function filterAsnycRouter(asyncRouterMap: any, parentCode = '', level = 1) { + return asyncRouterMap.map((route: any) => { - console.log(route.name, route) + route.path = `${route.url}` route.meta = { icon: route.icon, - title: route.name + title: route.name, + hideInMenu: route.isShow === false } // 查看是否有隐藏子路由 const extraChildren = findChildrenRoute(route.code, route.url) route.children = route.children && route.children.length ? [...route.children, ...extraChildren] : extraChildren - - // TODO 查看是否具有详情页 - // route.children = [...route.children, ] + route.children = findDetailRoutes(route.children) if (route.children && route.children.length) { - route.component = () => level === 1 ? BasicLayoutPage : BlankLayoutPage + // TODO 查看是否具有详情页 route.children = filterAsnycRouter(route.children, `${parentCode}/${route.code}`, level + 1) - route.redirect = route.children[0].url + const showChildren = route.children.some((r: any) => !r.meta.hideInMenu) + if (showChildren) { + route.component = () => level === 1 ? BasicLayoutPage : BlankLayoutPage + route.redirect = route.children[0].url + } else { + route.component = resolveComponent(route.code) || BlankLayoutPage; + } } else { - route.component = resolveComponent(route.code); + route.component = resolveComponent(route.code) || BlankLayoutPage; } - + delete route.name return route }) } \ No newline at end of file diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 1327a1eb..d438a522 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -1,79 +1,80 @@ - - From 16c320802e0ff1f9e9f6b707ec483cbd0db6bc26 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Tue, 31 Jan 2023 18:00:00 +0800 Subject: [PATCH 14/15] =?UTF-8?q?update:=201.=E5=88=A0=E9=99=A4=E5=A4=9A?= =?UTF-8?q?=E4=BD=99=E9=9D=99=E6=80=81=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/menu.ts | 117 +-------------------------------------------- 1 file changed, 1 insertion(+), 116 deletions(-) diff --git a/src/router/menu.ts b/src/router/menu.ts index 7e97e255..2a043f4f 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -1,23 +1,6 @@ export const LoginPath = '/login' export default [ - // { - // path: '/', - // redirect: LoginPath - // }, - // { - // path: '/init', - // component: () => import('@/view/InitPage.vue') - // }, - // { - // path: LoginPath, - // name: 'login', - // component: () => import('@/view/Login/index.vue') - // }, - // { - // path: '/initsetting', - // component: () => import('@/view/Login/initSet.vue') - // } { path: '/*', redirect: '/'}, // start: 测试用, 可删除 { @@ -32,10 +15,6 @@ export default [ path: '/account/center/bind', component: () => import('@/views/account/Center/bind/index.vue') }, - // { - // path: '/iot/home', - // component: () => import('@/views/home/index.vue') - // }, { path: '/table', component: () => import('@/views/demo/table/index.vue') @@ -48,107 +27,13 @@ export default [ path: '/search', component: () => import('@/views/demo/Search.vue') }, - // { - // path: '/notice/Config', - // component: () => import('@/views/notice/Config/index.vue') - // }, - // { - // path: '/notice/Config/detail/:id', - // component: () => import('@/views/notice/Config/Detail/index.vue') - // }, - // { - // path: '/notice/Template', - // component: () => import('@/views/notice/Template/index.vue') - // }, - // { - // path: '/notice/Template/detail/:id', - // component: () => import('@/views/notice/Template/Detail/index.vue') - // }, + // end: 测试用, 可删除 - // 设备管理 - // { - // path: '/device/Instance', - // component: () => import('@/views/device/Instance/index.vue') - // }, - // link 运维管理 - // { - // path: '/link/log', - // component: () => import('@/views/link/Log/index.vue') - // }, - // { - // path: '/link/certificate', - // component: () => import('@/views/link/Certificate/index.vue') - // }, - // { - // path: '/link/certificate/detail/add', - // component: () => import('@/views/link/Certificate/Detail/index.vue') - // }, - // { - // path: '/link/accessConfig', - // component: () => import('@/views/link/AccessConfig/index.vue') - // }, - // { - // path: '/link/accessConfig/detail/add', - // component: () => import('@/views/link/AccessConfig/Detail/index.vue') - // }, - // system 系统管理 - // { - // path:'/system/Basis', - // component: ()=>import('@/views/system/Basis/index.vue') - // }, - // { - // path:'/system/api', - // component: ()=>import('@/views/system/apiPage/index.vue') - // }, - // { - // path:'/system/Role', - // component: ()=>import('@/views/system/Role/index.vue') - // }, - // { - // 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', component: () => import('@/views/init-home/index.vue') }, - // 物联卡 iot-card - // { - // 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: '/iot-card/CardManagement', - // component: () => import('@/views/iot-card/CardManagement/index.vue') - // }, - // 北向输出 - // { - // path: '/northbound/DuerOS', - // component: () => import('@/views/northbound/DuerOS/index.vue') - // }, - // { - // path: '/northbound/AliCloud', - // component: () => import('@/views/northbound/AliCloud/index.vue') - // }, - // 产品分类 - // { - // path: '/iot/device/Category', - // component: () => import('@/views/device/Category/index.vue') - // } , - // 产品 - // { - // path: '/iot/device/Product', - // component: () => import('@/views/device/Product/index.vue') - // } ] \ No newline at end of file From 4dd78fbd638b9f9bbd6741eadf359087b142d755 Mon Sep 17 00:00:00 2001 From: blp <2962632571@qq.com> Date: Tue, 31 Jan 2023 18:09:23 +0800 Subject: [PATCH 15/15] =?UTF-8?q?feat:=20=E5=85=85=E5=80=BC=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=88=97=E8=A1=A8=E3=80=81=E5=85=85=E5=80=BC=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=EF=BC=8C=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot-card/cardManagement.ts | 14 +- .../iot-card/CardManagement/BindDevice.vue | 1 + src/views/iot-card/Recharge/Save.vue | 191 ++++++++++++++++++ src/views/iot-card/Recharge/index.vue | 168 ++++++++++++++- 4 files changed, 370 insertions(+), 4 deletions(-) create mode 100644 src/views/iot-card/Recharge/Save.vue diff --git a/src/api/iot-card/cardManagement.ts b/src/api/iot-card/cardManagement.ts index 768aba60..0a4f53d5 100644 --- a/src/api/iot-card/cardManagement.ts +++ b/src/api/iot-card/cardManagement.ts @@ -121,4 +121,16 @@ export const edit = (data: any) => server.put(`/network/card/${data.id}`, data); * 根据id查看详情 * @param id */ -export const queryDetail = (id: any) => server.get(`/network/card/${id}`); \ No newline at end of file +export const queryDetail = (id: any) => server.get(`/network/card/${id}`); + +/** + * 查询物联卡充值缴费日志 + * @param data + */ +export const queryRechargeList = (data: any) => server.post(`/network/card/recharge/_log`, data) + +/** + * 充值 + * @param data + */ +export const recharge = (data: any) => server.post(`/network/card/_recharge`, data) \ No newline at end of file diff --git a/src/views/iot-card/CardManagement/BindDevice.vue b/src/views/iot-card/CardManagement/BindDevice.vue index cdf48031..acdba8df 100644 --- a/src/views/iot-card/CardManagement/BindDevice.vue +++ b/src/views/iot-card/CardManagement/BindDevice.vue @@ -19,6 +19,7 @@ ref="bindDeviceRef" :columns="columns" :request="queryUnbounded" + model="TABLE" :defaultParams="{ sorts: [{ name: 'createTime', order: 'desc' }], }" diff --git a/src/views/iot-card/Recharge/Save.vue b/src/views/iot-card/Recharge/Save.vue new file mode 100644 index 00000000..4199d358 --- /dev/null +++ b/src/views/iot-card/Recharge/Save.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/src/views/iot-card/Recharge/index.vue b/src/views/iot-card/Recharge/index.vue index 4f1bbbc0..27fdab16 100644 --- a/src/views/iot-card/Recharge/index.vue +++ b/src/views/iot-card/Recharge/index.vue @@ -1,8 +1,170 @@ - + + +