Browse Source

数据看板样式调整

qymljy 1 year ago
parent
commit
824525cf32

+ 1 - 1
src/HDrpManagement/dataanalysis/modules/clue.vue

@@ -85,7 +85,7 @@
 
 <script>
 import quickDate from "@/HDrpManagement/dataanalysis/components/quickDate";
-import tableLayout from '@/components/table/index6'
+import tableLayout from '@/components/table/index9'
 export default {
   name: "clue",
   props:['param','isDep','dataid','isPerson'],

+ 1 - 1
src/HDrpManagement/dataanalysis/modules/customer.vue

@@ -98,7 +98,7 @@
 
 <script>
 import quickDate from "@/HDrpManagement/dataanalysis/components/quickDate";
-import tableLayout from '@/components/table/index6'
+import tableLayout from '@/components/table/index9'
 export default {
   name: "customer",
   props:['param','isDep','dataid','isPerson'],

+ 1 - 1
src/HDrpManagement/dataanalysis/modules/documents.vue

@@ -72,7 +72,7 @@
 
 <script>
 import quickDate from "@/HDrpManagement/dataanalysis/components/quickDate";
-import tableLayout from '@/components/table/index6'
+import tableLayout from '@/components/table/index9'
 export default {
   name: "documents",
   props:['param','isDep','dataid','isPerson'],

+ 1 - 1
src/HDrpManagement/dataanalysis/modules/project.vue

@@ -98,7 +98,7 @@
 
 <script>
 import quickDate from "@/HDrpManagement/dataanalysis/components/quickDate";
-import tableLayout from '@/components/table/index6'
+import tableLayout from '@/components/table/index9'
 export default {
   name: "project",
   props:['param','isDep','dataid','isPerson'],

+ 1 - 1
src/components/table/index6.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
-    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini"  :height="height ==''?data.length <= 4?'260px':data.length <= 20?'calc(100vh - 830px)':'calc(100vh - 830px)':height"  @row-click="rowClick"
+    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini"  :height="height ==''?data.length <= 4?'260px':data.length <= 20?'calc(100vh - 420px)':'calc(100vh - 420px)':height"  @row-click="rowClick"
               style="width:100%;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}" tooltip-effect="dark"
               :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" >
       <el-table-column

+ 73 - 0
src/components/table/index9.vue

@@ -0,0 +1,73 @@
+<template>
+  <div>
+    <!-- :header-cell-style="{background:'#EEEEEE',color:'#333'}" -->
+    <el-table ref="table" :row-class-name="tableClassName" highlight-current-row :data="data"  size="mini"  :height="height ==''?data.length <= 4?'260px':data.length <= 20?'calc(100vh - 830px)':'calc(100vh - 830px)':height"  @row-click="rowClick"
+              style="width:100%;" :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}" tooltip-effect="dark"
+              :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}" border @selection-change="selectionChange" >
+      <el-table-column
+          type="selection"
+          width="35" fixed v-if="checkbox">
+      </el-table-column>
+      <el-table-column  v-for="col in layout" :key="col.tablecolid" :prop="col.columnname" :label="col.title"  :width="col.width" :fixed="fixedName ? fixedName.indexOf(col.columnname)!= -1?'right':false : false">
+        <template :slot="headerOptions ? headerOptions.includes(col.columnname) ? 'header' : '' : ''" slot-scope="scope">
+          <slot name="header" :column="{data:scope.row,columnname:col.columnname}"></slot>
+        </template>
+        <template slot-scope="scope">
+          <div class="table-panel">
+            <!-- 自定义表格显示内容 -->
+            <slot v-if="custom" name="customcol" :column="{data:scope.row,columnname:col.columnname}"></slot>
+            <!-- 否则就是默认 -->
+            <span v-else>{{scope.row[col.columnname]}}</span>
+            <!-- 操作结构内容 -->
+            <slot v-if="col.columnname === 'operation'" name="opreation" :data="scope.row"></slot>
+          </div>
+        </template>
+      </el-table-column>
+    </el-table>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from "vuex"
+export default {
+  /*
+    layout:表结构数据;
+    data:表渲染数据;
+    custom:是否启用自定义结构;
+    opwidth:操作列宽度
+  */
+  props:['layout','data','custom','height','fixedName','width','checkbox','headerOptions'],
+  data () {
+    return {
+      list:[],
+      allArr:[],
+      loading:false
+    }
+  },
+  /*computed:{
+    ...mapGetters({
+      loading:'loading'
+    })
+  },*/
+  methods:{
+    rowClick (row) {
+      this.$emit('rowClick',row)
+    },
+    tableClassName ({row,rowIndex}) {
+      row.index = rowIndex
+    },
+    selectionChange(row){
+      this.allArr = row
+      this.$emit('selectionChange',row)
+    }
+  },
+  mounted () {
+  }
+}
+
+</script>
+<style>
+.el-tooltip__popper {
+  max-width: 90%;
+}
+</style>