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', + }, +];