From 30e858fa504b268b9b436afca0a1259cf6e8c488 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期二, 19 八月 2025 11:01:40 +0800
Subject: [PATCH] 优化

---
 admin/src/views/business/categoryDcaProblem.vue |   43 +++++++++++++++++++++++++++++++++----------
 1 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/admin/src/views/business/categoryDcaProblem.vue b/admin/src/views/business/categoryDcaProblem.vue
index 1149c72..fb32829 100644
--- a/admin/src/views/business/categoryDcaProblem.vue
+++ b/admin/src/views/business/categoryDcaProblem.vue
@@ -8,7 +8,7 @@
         </el-form-item>
         <section>
           <el-button type="primary" @click="search">鎼滅储</el-button>
-          <el-button type="primary" @click="refresh">鏄剧ず椤跺眰</el-button>
+          <el-button type="primary" @click="refresh">涓�绾т富棰�</el-button>
           <el-button @click="reset">閲嶇疆</el-button>
         </section>
       </el-form>
@@ -17,7 +17,7 @@
       <div
         style="width: 100%; height: 50px; background: rgba(242, 242, 242, 1); line-height: 50px; text-align: center; font-size: 14px;">
         DCA涓婚</div>
-      <div style="width: 100%; height: calc(100vh - 170px); overflow-y: scroll;">
+      <div style="width: 100%; height: calc(100vh - 130px); overflow-y: scroll;">
         <Tree :list="treeList" :alllist="treeList"  :defaultProps="{ name: 'name', status: 'fsStatus', children: 'childList', id: 'id' }"
           @callback="callback" />
       </div>
@@ -25,12 +25,14 @@
     <!-- 琛ㄦ牸鍜屽垎椤� -->
     <template v-slot:table-wrap>
       <ul class="toolbar"  v-if="containPermissions(['business:category:create', 'business:category:delete' ])" >
+        <li> <el-button type="primary" :loading="isWorking.export"  icon="el-icon-download"  @click="exportDcaExcel">瀵煎嚭鍏ㄩ儴</el-button></li>
         <li><el-button type="primary"
-                       @click="$refs.operaCategoryWindow.open('鏂板缓DCA涓婚鍜岃瀵熼」', null,categoryList ,4,searchForm.parentIdPath)" icon="el-icon-plus"
+                       @click="$refs.operaCategoryWindow.open('鏂板缓DCA涓婚鍜岃瀵熼」', null,categoryList ,4,searchForm.parentId)" icon="el-icon-plus"
                        v-permissions="['business:category:create']">鏂板缓</el-button></li>
+        <li> <el-button type="primary" :loading="importing"  icon="el-icon-plus" @click="$refs.OperaCategoryImportWindow.open('鎵归噺瀵煎叆涓婚瑙傚療椤�')">鍏ㄩ噺瀵煎叆</el-button></li>
         <li><el-button type="danger" @click="deleteByIdInBatch(true,getfindTreePage)" icon="el-icon-delete" v-permissions="['business:category:delete']">鎵归噺鍒犻櫎</el-button></li>
       </ul>
-      <el-table   v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange">
+      <el-table  :height="tableHeightNew" v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55"></el-table-column>
         <el-table-column prop="name" label="鍚嶇О" min-width="100px"></el-table-column>
         <el-table-column prop="parentName" label="鎵�灞炵埗绾�" min-width="150px"></el-table-column>
@@ -44,7 +46,7 @@
         <el-table-column prop="editorName" label="鎿嶄綔浜�" min-width="100px"></el-table-column>
         <el-table-column prop="editDate" label="鏈�鍚庢搷浣滄椂闂�" min-width="150px"></el-table-column>
         <el-table-column prop="remark" label="澶囨敞" min-width="100px"></el-table-column>
-        <el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="280">
+        <el-table-column fixed="right" v-if="containPermissions(['business:category:update', 'business:category:delete' ])" label="鎿嶄綔" min-width="120">
           <template slot-scope="{row}">
             <el-button type="text" icon="el-icon-edit" @click="$refs.operaCategoryWindow.open('缂栬緫DCA涓婚鍜岃瀵熼」', row, categoryList,row.type)"  v-permissions="['business:category:update']">缂栬緫</el-button>
             <el-button type="text" icon="el-icon-delete" @click="deleteById(row,true, getfindTreePage)" style="color: red"  v-permissions="['business:category:delete']">鍒犻櫎</el-button>
@@ -54,6 +56,7 @@
       <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination">
       </pagination>
       <OperaCategoryDcaProblemWindow ref="operaCategoryWindow" @success="handlePageChangeDo"/>
+      <OperaCategoryImportWindow ref="OperaCategoryImportWindow" @success="handlePageChangeDo" />
     </template>
   </TableLayout1>
 </template>
@@ -65,20 +68,22 @@
 import Pagination from '@/components/common/Pagination'
 import Tree from '@/components/common/Tree'
 import { treeList } from '@/api/business/category'
+import OperaCategoryImportWindow from '@/components/business/OperaCategoryImportWindow'
 export default {
-  name: 'categorySheType',
+  name: 'categoryDcaProblem',
   extends: BaseTable,
-  components: { TableLayout1, Pagination, Tree, OperaCategoryDcaProblemWindow },
+  components: { TableLayout1, Pagination, Tree, OperaCategoryDcaProblemWindow ,OperaCategoryImportWindow},
   data () {
     return {
       TreeList: [],
-      level: 1,
+      level: 0,
+      importing: false,
       // 鎼滅储
       searchForm: {
         name: '',
         keyword: '',
         type: 4,
-        parentId: '',
+        parentId: null,
         isRoot: 1,
         parentIdPath: null
       },
@@ -100,6 +105,24 @@
     this.getfindTreePage()
   },
   methods: {
+    exportDcaExcel () {
+      this.__checkApi()
+      this.$dialog.exportConfirm('纭瀵煎嚭鍚楋紵')
+        .then(() => {
+          this.isWorking.export = true
+          this.api.exportDcaExcel({})
+            .then(response => {
+              this.download(response)
+            })
+            .catch(e => {
+              this.$tip.apiFailed(e)
+            })
+            .finally(() => {
+              this.isWorking.export = false
+            })
+        })
+        .catch(() => {})
+    },
     handlePageChangeDo () {
       this.searchForm.isRoot = 1
       this.searchForm.level = 1
@@ -163,7 +186,7 @@
       this.searchForm.parentId = row.id
       this.searchForm.isRoot = null
       this.searchForm.parentIdPath = row.idPath
-      this.level= row.level
+      this.level = row.level
       if (row.level === 2) {
         this.searchForm.type = 6
       } else {

--
Gitblit v1.9.3