tangning преди 2 години
родител
ревизия
db6d84da38

+ 4 - 2
src/views/empower/AddCameraModal.vue

@@ -43,6 +43,7 @@
       const fileFlow = reactive({
         file: null,
         id: '',
+        key: '',
         type: 'down', //down-下载,equity-权益
       });
       const { createMessage, createConfirm, createSuccessModal } = useMessage();
@@ -92,6 +93,7 @@
       async function onDataReceive(data) {
         resetFields();
         fileFlow.id = data.id;
+        fileFlow.key = data.authorizeKey;
         updateSchema([
           {
             field: 'useType',
@@ -148,13 +150,13 @@
           createSuccessModal({
             title: t('layout.setting.operatingTitle'),
             content: h('div', {}, [
-              h('p', `安装Key:${res.authorizeKey}`),
+              h('p', `安装Key:${res.authorizeKey || fileFlow.key}`),
               h('p', `授权相机数量:${count.length}`),
             ]),
             okText: '复制授权Key',
             onOk: async () => {
               // 双击复制
-              copyTextToClipboard(res.authorizeKey);
+              copyTextToClipboard(res.authorizeKey || fileFlow.key);
               createMessage.success('复制成功');
             },
           });

+ 4 - 2
src/views/empower/AddInstallModal.vue

@@ -43,6 +43,7 @@
       const fileFlow = reactive({
         file: null,
         id: '',
+        key: '',
         type: 'down', //down-下载,equity-权益
       });
       const { createMessage, createConfirm, createSuccessModal } = useMessage();
@@ -81,6 +82,7 @@
       async function onDataReceive(data) {
         resetFields();
         fileFlow.id = data.id;
+        fileFlow.key = data.authorizeKey;
         updateSchema([
           {
             field: 'useType',
@@ -141,11 +143,11 @@
           resetFields();
           createSuccessModal({
             title: t('layout.setting.operatingTitle'),
-            content: `安装Key:${res.authorizeKey}`,
+            content: `安装Key:${res.authorizeKey || fileFlow.key}`,
             okText: '复制',
             onOk: async () => {
               // 双击复制
-              copyTextToClipboard(res.authorizeKey)
+              copyTextToClipboard(res.authorizeKey || fileFlow.key);
               createMessage.success('复制成功');
             },
           });

+ 1 - 1
src/views/empower/camera.vue

@@ -214,7 +214,7 @@
             },
           },
           {
-            field: 'machineCode',
+            field: 'authorizeKey',
             label: '安装授权Key',
             component: 'Input',
             colProps: {

+ 1 - 1
src/views/empower/install.vue

@@ -199,7 +199,7 @@
             },
           },
           {
-            field: 'machineCode',
+            field: 'authorizeKey',
             label: '安装授权Key',
             component: 'Input',
             colProps: {

+ 1 - 0
src/views/parameter/EditModal.vue

@@ -58,6 +58,7 @@
       async function onDataReceive(data) {
         resetFields();
         fileFlow.title = data.id ? '修改设备类型' : '新增设备类型';
+        console.log('data',data)
         setFieldsValue(data);
       }
       const handleSubmit = async () => {

+ 1 - 2
src/views/parameter/data.tsx

@@ -84,8 +84,7 @@ export const InvoiceSchemas: FormSchema[] = [
     field: 'id',
     component: 'Input',
     label: 'id',
-    ifShow: false,
-    required: true,
+    show: false,
     colProps: {
       span: 18,
     },