From f951cb98276177cc401f9bd68178470b7cddc165 Mon Sep 17 00:00:00 2001
From: wang-liang0615 <dhuwl0615@163.com>
Date: Thu, 12 Oct 2023 14:03:34 +0800
Subject: [PATCH] =?UTF-8?q?pref:=E6=89=B9=E9=87=8F=E4=B8=8A=E4=BC=A0&?=
 =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86=E5=B0=8F=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 cmdb-ui/src/modules/acl/views/resources.vue          |  2 +-
 cmdb-ui/src/modules/cmdb/router/index.js             | 12 ++++++------
 cmdb-ui/src/modules/cmdb/views/batch/index.vue       |  2 +-
 .../cmdb/views/batch/modules/UploadFileForm.vue      |  7 +++++++
 4 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/cmdb-ui/src/modules/acl/views/resources.vue b/cmdb-ui/src/modules/acl/views/resources.vue
index f0bf29d..6ac723c 100644
--- a/cmdb-ui/src/modules/acl/views/resources.vue
+++ b/cmdb-ui/src/modules/acl/views/resources.vue
@@ -99,7 +99,7 @@
             align="center"
             show-overflow>
             <template #default="{ row }">
-              <span v-show="row.isGroup">
+              <span v-show="isGroup">
                 <a @click="handleDisplayMember(row)">成员</a>
                 <a-divider type="vertical" />
                 <a @click="handleGroupEdit(row)">编辑</a>
diff --git a/cmdb-ui/src/modules/cmdb/router/index.js b/cmdb-ui/src/modules/cmdb/router/index.js
index 0d88938..7a768da 100644
--- a/cmdb-ui/src/modules/cmdb/router/index.js
+++ b/cmdb-ui/src/modules/cmdb/router/index.js
@@ -61,18 +61,18 @@ const genCmdbRoutes = async () => {
         name: 'cmdb_disabled2',
         meta: { title: '配置', disabled: true, },
       },
-      {
-        path: '/cmdb/batch',
-        component: () => import('../views/batch'),
-        name: 'cmdb_batch',
-        meta: { 'title': '批量导入', icon: 'ops-cmdb-batch', selectedIcon: 'ops-cmdb-batch-selected', keepAlive: false }
-      },
       {
         path: '/cmdb/preference',
         component: () => import('../views/preference/index'),
         name: 'cmdb_preference',
         meta: { title: '我的订阅', icon: 'ops-cmdb-preference', selectedIcon: 'ops-cmdb-preference-selected', keepAlive: false }
       },
+      {
+        path: '/cmdb/batch',
+        component: () => import('../views/batch'),
+        name: 'cmdb_batch',
+        meta: { 'title': '批量导入', icon: 'ops-cmdb-batch', selectedIcon: 'ops-cmdb-batch-selected', keepAlive: false }
+      },
       {
         path: '/cmdb/ci_types',
         name: 'ci_type',
diff --git a/cmdb-ui/src/modules/cmdb/views/batch/index.vue b/cmdb-ui/src/modules/cmdb/views/batch/index.vue
index 8f708d6..1a4010f 100644
--- a/cmdb-ui/src/modules/cmdb/views/batch/index.vue
+++ b/cmdb-ui/src/modules/cmdb/views/batch/index.vue
@@ -5,7 +5,7 @@
     </div>
     <a-row>
       <a-col :span="12">
-        <upload-file-form ref="uploadFileForm" @uploadDone="uploadDone"></upload-file-form>
+        <upload-file-form :ciType="ciType" ref="uploadFileForm" @uploadDone="uploadDone"></upload-file-form>
       </a-col>
       <a-col :span="24" v-if="ciType && uploadData.length">
         <CiUploadTable :ciTypeAttrs="ciTypeAttrs" ref="ciUploadTable" :uploadData="uploadData"></CiUploadTable>
diff --git a/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadFileForm.vue b/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadFileForm.vue
index 1898ce0..1599a3b 100644
--- a/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadFileForm.vue
+++ b/cmdb-ui/src/modules/cmdb/views/batch/modules/UploadFileForm.vue
@@ -7,6 +7,7 @@
       accept=".xls,.xlsx"
       :showUploadList="false"
       :fileList="fileList"
+      :disabled="!ciType"
     >
       <img :style="{ width: '80px', height: '80px' }" src="@/assets/file_upload.png" />
       <p class="ant-upload-text">点击或拖拽文件至此上传!</p>
@@ -24,6 +25,12 @@ import { processFile } from '@/modules/cmdb/api/batch'
 
 export default {
   name: 'UploadFileForm',
+  props: {
+    ciType: {
+      type: Number,
+      default: 0,
+    }
+  },
   data() {
     return {
       ciItemNum: 0,