Prechádzať zdrojové kódy

代码提交:
1028知识分享

sunruiqi 2 rokov pred
rodič
commit
19b739fcd5

+ 21 - 1
src/views/modules/knowledgeShare/InfoList.vue

@@ -22,6 +22,11 @@
           <el-button v-if="hasPermission('knowledgeShare:info:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.typeTable && $refs.typeTable.getCheckboxRecords().length === 0" plain>删除</el-button>
         </template>
       </vxe-toolbar>
+
+      <el-tabs v-model="typeId" type="card" @tab-click="handleClick">
+        <el-tab-pane :key="index" v-for="(item,index) in typeList" :label="item.klgsType" :name="item.klgsType" :value="item.id"></el-tab-pane>
+      </el-tabs>
+
       <div style="height: calc(100% - 50px)">
         <vxe-table
           border="inner"
@@ -78,12 +83,15 @@
 
 <script>
   import KnowledgeShareInfoService from '@/api/sys/KnowledgeShareInfoService'
+  import KnowledgeShareTypeService from '@/api/sys/KnowledgeShareTypeService'
   import InfoForm from './InfoForm'
   import UserSelect from '@/components/userSelect'
   import UserService from '@/api/sys/UserService'
   export default {
     data () {
       return {
+        typeList: [],
+        typeId: '1',
         searchForm: {
           title: '',
           createBy: ''
@@ -101,10 +109,15 @@
       }
     },
     knowledgeShareInfoService: null,
+    knowledgeShareTypeService: null,
     userService: null,
     created () {
       this.knowledgeShareInfoService = new KnowledgeShareInfoService()
+      this.knowledgeShareTypeService = new KnowledgeShareTypeService()
       this.userService = new UserService()
+      this.knowledgeShareTypeService.list().then(({data}) => {
+        this.typeList = data.records
+      })
     },
     components: {
       InfoForm,
@@ -138,6 +151,7 @@
           'current': this.tablePage.currentPage,
           'size': this.tablePage.pageSize,
           'orders': this.tablePage.orders,
+          'typeId': this.typeId,
           ...this.searchForm
         }).then(({data}) => {
           this.dataList = data.records
@@ -177,7 +191,13 @@
         this.userService.is().then(({data}) => {
           this.isAdmin = data
         })
-      }
+      },
+      handleClick (tab) {
+        const val = tab.$attrs.value
+        console.log('aaaaaaaaa', val)
+        this.typeId = val
+        this.refreshList()
+      },
     }
   }
 </script>