Kaynağa Gözat

订单查询列表页面,有下拉数据的显示展开按钮

lihongxiao 3 yıl önce
ebeveyn
işleme
06febac2ac
1 değiştirilmiş dosya ile 10 ekleme ve 3 silme
  1. 10 3
      src/views/Letter/Orderlist.vue

+ 10 - 3
src/views/Letter/Orderlist.vue

@@ -59,7 +59,7 @@
       </el-row>
     </el-form>
     <el-table size="small" :data="pageResult" height="590" border v-loading="loading" highlight-current-row stripe
-      @row-click="handleRowClick" ref="expandTable"
+      @row-click="handleRowClick" ref="expandTable"  :row-class-name="getRowClass"
       :header-cell-style="{ background: '#F2F7FC', fontWeight: '700', color: '#606266' }">
       <el-table-column type="expand">
         <template slot-scope="scope">
@@ -1110,6 +1110,11 @@ export default {
     },
   },
   methods: {
+    getRowClass(scope,rowIndex){
+        if(scope.row.insAreaCompanyList.length==0){  //判断当前行是否有子数据或者根据实际情况设置
+              return 'row-expand-cover'
+      }
+    },
      //联级选择器触发事件
      handleChange(val) {
       if (val.length !== 0) {
@@ -1712,12 +1717,14 @@ export default {
   }
 }
 </script>
-<style>
+<style scoped>
 .saomazhifucodeClass .el-dialog__body,
 .saomazhifucodeClass .el-dialog__header {
   padding: 0;
 }
-
+/deep/ .el-table .row-expand-cover .cell .el-table__expand-icon {
+  display: none;
+}
 .ORcodebody {
   width: 100%;
   height: auto;