gemercheung преди 1 година
родител
ревизия
41727ad388
променени са 2 файла, в които са добавени 24 реда и са изтрити 5 реда
  1. 2 2
      src/views/map/addProjectModal.vue
  2. 22 3
      src/views/map/sceneModal.vue

+ 2 - 2
src/views/map/addProjectModal.vue

@@ -119,10 +119,10 @@
               }
             },
             params: {
-              page: 1,
+              pageNum: 1,
               // type: 1,
               searchKey: '',
-              limit: 5000,
+              pageSize: 5000,
             },
           },
           ifShow: ({ values }) => {

+ 22 - 3
src/views/map/sceneModal.vue

@@ -10,7 +10,7 @@
   >
     <BasicTable @register="registerTable" v-if="!isAdding">
       <template #toolbar>
-        <a-button type="primary" @click="isAdding = true">{{ t('layout.map.addScene') }}</a-button>
+        <a-button type="primary" @click="handleAddScene">{{ t('layout.map.addScene') }}</a-button>
       </template>
       <template #sceneSource="{ record }">
         <!-- <span v-if="Number(record.sceneSource) === 0">{{ t('routes.scenes.4dkk') }}</span>
@@ -52,7 +52,13 @@
       @register="registerEditTable"
       v-else
       rowKey="num"
-      :rowSelection="{ type: 'checkbox' }"
+      :rowSelection="{
+        type: 'checkbox',
+        getCheckboxProps: (record) => ({
+          disabled: isExistIds.includes(record.num),
+          key: record.num,
+        }),
+      }"
     >
       <template #sceneSource="{ record }">
         <span v-if="Number(record.sceneSource) === 3">{{ t('routes.scenes.4dkj') }}</span>
@@ -75,6 +81,7 @@
   import { BasicTable, useTable, BasicColumn, TableAction } from '/@/components/Table';
   import { useMessage } from '/@/hooks/web/useMessage';
   import { useLocaleStore } from '/@/store/modules/locale';
+
   // import { disableCache } from '@iconify/iconify';
   const localeStore = useLocaleStore();
   const { t } = useI18n();
@@ -94,6 +101,7 @@
       // const { createMessage } = useMessage();
       const projectId = ref('');
       const isAdding = ref(false);
+      const isExistIds = ref([]);
       const { createMessage } = useMessage();
       const isJA = computed(() => localeStore.getLocale === 'ja');
       const location = computed(() =>
@@ -156,7 +164,7 @@
           width: 150,
         },
       ];
-      const [registerTable, { reload }] = useTable({
+      const [registerTable, { reload, getDataSource }] = useTable({
         title: t('routes.dashboard.scenesList'),
         api: ListApi,
         columns: columns,
@@ -246,6 +254,15 @@
         console.log('record', link);
         window.open(link, '_blank');
       };
+      const handleAddScene = () => {
+        isAdding.value = true;
+        const list = getDataSource();
+        console.log('list', list);
+        if (list.length > 0) {
+          isExistIds.value = list.reduce((p, c) => p.concat(c['num']), []);
+          console.log('isExistIds', isExistIds.value);
+        }
+      };
 
       return {
         t,
@@ -260,6 +277,8 @@
         handleSceneDel,
         handlecloseFunc,
         handleSceneOpen,
+        handleAddScene,
+        isExistIds,
       };
     },
   });