scorpio 2 yıl önce
ebeveyn
işleme
716b87ccb8
2 değiştirilmiş dosya ile 22 ekleme ve 16 silme
  1. 21 15
      src/layout/top.vue
  2. 1 1
      src/views/company/index.vue

+ 21 - 15
src/layout/top.vue

@@ -49,43 +49,44 @@
                 <el-icon size="25px">
                   <Search/>
                 </el-icon>
+                <span style='width: 40px' class='text-center'> {{filterTypeName}}</span>
                 <el-icon size="20px">
                   <CaretBottom/>
                 </el-icon>
               </div>
               <template #dropdown>
                 <el-dropdown-menu>
-                  <el-dropdown-item command='switch'>全部</el-dropdown-item>
-                  <el-dropdown-item command='switch1'>项目</el-dropdown-item>
-                  <el-dropdown-item command='switch2'>文档</el-dropdown-item>
-                  <el-dropdown-item command='switch3'>图片</el-dropdown-item>
+                  <el-dropdown-item command='全部'>全部</el-dropdown-item>
+                  <el-dropdown-item command='项目'>项目</el-dropdown-item>
+                  <el-dropdown-item command='文档'>文档</el-dropdown-item>
+                  <el-dropdown-item command='图片'>图片</el-dropdown-item>
                 </el-dropdown-menu>
               </template>
             </el-dropdown>
           </div>
-          <div class="full-width flex flex-center flex-col">
+          <div class="full-width flex flex-center">
             <el-input
                 clearable
                 v-model='params.keyword'
                 class='append'
                 placeholder="输入关键字搜索"
-                size='large'
                 @keydown="searchTotal"
             >
             </el-input>
+            <el-button type='primary' class='ml-20' @click='searchTotal'>搜 索</el-button>
           </div>
         </div>
-        <div class="flex flex-center mt-15">
-          <div v-if="isAll === 1" v-for="(item,index) in type" :key='item.key' class="flex flex-center tab">
+        <div  v-if="isAll === 1" class="flex flex-center mt-15">
+          <div  v-for="(item,index) in type" :key='item.key' class="flex flex-center tab">
             <el-badge :value='item.count' :hidden='item.count === 0'>
               <div :class="active === index ? 'tab-active' : ''" class="pointer"
-                   @click="change(index,item.key)">{{ item.value }}
+                   @click="change(index,item.key)">{{item.value }}
               </div>
             </el-badge>
           </div>
         </div>
         <el-empty v-if="data && data.length === 0" description='暂无数据'/>
-        <div v-else class="mt-10" v-for="sub in data" style="margin-left: 34px;">
+        <div v-else class="mt-10" v-for="sub in data" :key='sub.id' style="margin-left: 34px;">
           <span>{{ sub.title }}</span>
         </div>
         <div class="full-width mt-10 flex flex-justify-end">
@@ -140,7 +141,8 @@ export default {
       },
       data: [],
       total: '',
-      isAll: 0
+      isAll: 0,
+      filterTypeName: '全部'
     }
   },
   created () {
@@ -165,19 +167,23 @@ export default {
             this.$message.error(res.msg)
           }
         })
-      } else if (res === 'switch') {
+      } else if (res === '全部') {
+        this.filterTypeName = res
         this.params.searchType = 'all'
         this.isAll = 1
         this.searchTotal()
-      } else if (res === 'switch1') {
+      } else if (res === '项目') {
+        this.filterTypeName = res
         this.isAll = 0
         this.params.searchType = 'project'
         this.searchTotal()
-      } else if (res === 'switch2') {
+      } else if (res === '文件') {
+        this.filterTypeName = res
         this.isAll = 0
         this.params.searchType = 'file'
         this.searchTotal()
-      } else if (res === 'switch3') {
+      } else if (res === '图片') {
+        this.filterTypeName = res
         this.isAll = 0
         this.params.searchType = 'picture'
         this.searchTotal()

+ 1 - 1
src/views/company/index.vue

@@ -166,7 +166,7 @@ export default {
         confirmButtonText: '确定',
         cancelButtonText: '取消'
       }).then(({ value }) => {
-        this.$api.company.submint({ title: value }).then(res => {
+        this.$api.company.submint({ title: value, type: 2 }).then(res => {
           if (res.code === 200) {
             this.$message.success(res.msg)
             this.list()