zhuliu 11 months ago
parent
commit
59040ac02f

+ 24 - 4
src/views/noveltySearch/components/details/components/searchRecords/searchRecords.vue

@@ -16,6 +16,7 @@
                   :maxHeight="tableHeight - 40"
                   :maxHeight="tableHeight - 40"
                   v-loading="loading"
                   v-loading="loading"
                   @selection-change="handleSelectionChange"
                   @selection-change="handleSelectionChange"
+                  @sort-change="sortChange"
               >
               >
                   <el-table-column type="selection" width="55" :reserve-selection="true" v-if="!choose">
                   <el-table-column type="selection" width="55" :reserve-selection="true" v-if="!choose">
   
   
@@ -31,28 +32,28 @@
                       
                       
                   </el-table-column>
                   </el-table-column>
                   <el-table-column prop="conditions" label="检索式"></el-table-column>
                   <el-table-column prop="conditions" label="检索式"></el-table-column>
-                  <el-table-column prop="dbType" label="检索数据库" width="140">
+                  <el-table-column prop="dbType" label="检索数据库" width="140" sortable="custom" :render-header=" $commonJS.renderHeaderMethods">
                       <template slot-scope="scope">
                       <template slot-scope="scope">
                       <div>
                       <div>
                         {{ dbType[scope.row.dbType] ||  scope.row.dbType}}
                         {{ dbType[scope.row.dbType] ||  scope.row.dbType}}
                       </div>
                       </div>
                       </template>
                       </template>
                   </el-table-column>
                   </el-table-column>
-                  <el-table-column prop="totalNum" label="检索数量" width="120">
+                  <el-table-column prop="totalNum" label="检索数量" width="120" sortable="custom" :render-header=" $commonJS.renderHeaderMethods">
                       <template slot-scope="scope">
                       <template slot-scope="scope">
                       <div>
                       <div>
                           {{ scope.row.totalNum || 0 }}件
                           {{ scope.row.totalNum || 0 }}件
                       </div>
                       </div>
                       </template>
                       </template>
                   </el-table-column>
                   </el-table-column>
-                  <el-table-column prop="searchPersonName" label="检索人" width="120">
+                  <el-table-column prop="searchPersonName" label="检索人" width="120"  :render-header=" $commonJS.renderHeaderMethods">
                       <template slot-scope="scope">
                       <template slot-scope="scope">
                       <div>
                       <div>
                           {{ scope.row.searchPersonName }}
                           {{ scope.row.searchPersonName }}
                       </div>
                       </div>
                       </template>
                       </template>
                   </el-table-column>
                   </el-table-column>
-                  <el-table-column prop="retrieveTime" label="检索时间" width="120">
+                  <el-table-column prop="retrieveTime" label="检索时间" width="120" sortable="custom" :render-header=" $commonJS.renderHeaderMethods">
                       <template slot-scope="scope">
                       <template slot-scope="scope">
                       <div>
                       <div>
                           {{ scope.row.retrieveTime }}
                           {{ scope.row.retrieveTime }}
@@ -183,6 +184,25 @@
         this.queryParams.current = 1
         this.queryParams.current = 1
         this.getList()
         this.getList()
       },
       },
+       //排序
+    sortChange({ column, prop, order }) {
+        
+      var orderType = {
+        ascending: 0,
+        descending: 1
+      }
+      if(order){
+        this.queryParams.orderDTO={
+            orderBy:prop,
+            orderType:orderType[order]
+        }
+      }else{
+        this.queryParams.orderDTO={}
+      }
+      
+      this.queryParams.current = 1
+      this.getList()
+    },
       add(){
       add(){
           this.$refs.addAndEditSearchRecords.open({})
           this.$refs.addAndEditSearchRecords.open({})
       },
       },