瀏覽代碼

feat(api): new saving 3

gemercheung 3 年之前
父節點
當前提交
3384856e14
共有 2 個文件被更改,包括 15 次插入14 次删除
  1. 6 6
      src/views/corporation/index.vue
  2. 9 8
      src/views/devices/EditModal.vue

+ 6 - 6
src/views/corporation/index.vue

@@ -63,11 +63,11 @@
       <template #action="{ record }">
         <TableAction
           :actions="[
-            {
-              // icon: 'ri:money-cny-circle-fill',
-              label: t('routes.corporation.recharge'),
-              onClick: handleOpenModal.bind(null, 'charge', record),
-            },
+            // {
+            //   // icon: 'ri:money-cny-circle-fill',
+            //   label: t('routes.corporation.recharge'),
+            //   onClick: handleOpenModal.bind(null, 'charge', record),
+            // },
             {
               // icon: 'icon-park-outline:devices',
               label: t('routes.corporation.device'),
@@ -248,7 +248,7 @@
           totalField: 'totalCount',
         },
         actionColumn: {
-          width: isJA.value ? 280 : 160,
+          width: isJA.value ? 200 : 120,
           title: t('common.operation'),
           dataIndex: 'action',
           slots: { customRender: 'action' },

+ 9 - 8
src/views/devices/EditModal.vue

@@ -41,7 +41,7 @@
       const { createMessage } = useMessage();
       const schemas: FormSchema[] = [
         {
-          field: 'id',
+          field: 'cameraId',
           component: 'Input',
           label: 'id',
           show: false,
@@ -125,7 +125,9 @@
           component: 'Input',
           required: true,
           label: t('routes.devices.address'),
-          disabled: true,
+          componentProps: {
+            disabled: true,
+          },
           colProps: {
             span: 24,
           },
@@ -234,6 +236,7 @@
         console.log('Data Received', data);
         setFieldsValue({
           ...data,
+          cameraId: Number(data.id),
           cameraType: Number(data.cameraType),
         });
       }
@@ -244,12 +247,10 @@
           console.log('values', values);
           if (values) {
             const res = await editCameraApi(values);
-            if (res.code) {
-              createMessage.error(res.error || t('common.optFail'));
-            } else {
-              emit('update');
-              closeModal();
-            }
+            emit('update');
+            console.log('res', res);
+            createMessage.success(t('common.optSuccess'));
+            closeModal();
           }
         } catch (error) {
           console.log('not passing', error);