Kaynağa Gözat

修改分页问题

fubin 1 yıl önce
ebeveyn
işleme
67e1193bec

+ 5 - 2
src/components/main/main.vue

@@ -51,7 +51,7 @@
                         @click="exitFullscreen"></icon>
                 </Tooltip>
               </p>
-              <Select v-model="type" style="width:200px;margin-right: 10px" default-label="东科" @on-change="cpChange" >
+              <Select v-model="cpId" style="width:200px;margin-right: 10px" ref="selCp" default-label="东科" @on-change="cpChange" >
                 <Option v-for="item in joinedCpList" :value="item.cpId" :key="item.cpId">{{ item.cpName }}</Option>
               </Select>
             </header-bar>
@@ -124,7 +124,7 @@ export default {
   data() {
     let self = this
     return {
-      type:'',
+      cpId:null,
       logo,
       dk_logo,
       time: '',
@@ -555,6 +555,7 @@ export default {
         if(!item || item.length == 0){
           return;
         }
+
         await this.updateCompany(item[0]);
         // 点击切换公司
         this.changeCp(this.joinedCps).then(res => {
@@ -634,6 +635,8 @@ export default {
     // 监听 mousemove 和 mouseup 事件
     window.addEventListener('mousemove', this.drag);
     window.addEventListener('mouseup', this.stopDrag);
+    this.cpId = this.$store.state.user.cpId
+    console.log('fff',this.$refs.selCp,this.$store.state.user.cpId)
   },
 }
 </script>

+ 21 - 12
src/components/table/dk-table/dk-table.vue

@@ -1146,7 +1146,7 @@ export default {
         sums.push(total)
       }
       // 如果选择框开启
-      if(this.chooseFlag){
+      if (this.chooseFlag) {
         sums.push('')
       }
       let sumCell = null
@@ -1440,7 +1440,7 @@ export default {
         this.$Export({tableData: columns}, {
           ok: (val) => {
             this.handleExportAll(true); // 控制不允许再次点击导出
-            console.log('eee',this.exportCondition,JSON.stringify(val))
+            console.log('eee', this.exportCondition, JSON.stringify(val))
             let params = {...this.exportCondition}
             // console.log('ttt', Object.assign({'seq': '序号'}, val))
             // 增加序号
@@ -1721,6 +1721,9 @@ export default {
      */
     currentPageChange(val) {
       this.pageInfo.currentPage = val
+      if (!this.pageInfo.pageSize) {
+        this.pageInfo.pageSize = this.pageSize
+      }
       this.$emit('pageChange', this.pageInfo)
     },
     /**
@@ -1870,7 +1873,7 @@ export default {
         this.$refs[this.name].setCurrentRow(row);
         this.currentChangeEvent({row})
       }
-      this.$emit('select-change', {batchRows:this.batchRows, row, checked, allFlag})
+      this.$emit('select-change', {batchRows: this.batchRows, row, checked, allFlag})
     },
     /**
      * @desc   : 格点击事件
@@ -2103,10 +2106,10 @@ export default {
      * @author : 周兴
      * @date   : 2023/12/22 14:05
      */
-    getParent(obj){
-      if(obj.$parent && obj.$parent.$el.className === 'main-div'){
+    getParent(obj) {
+      if (obj.$parent && obj.$parent.$el.className === 'main-div') {
         return obj.$parent;
-      }else{
+      } else {
         return this.getParent(obj.$parent);
       }
     },
@@ -2208,7 +2211,7 @@ export default {
   z-index: 300;
   width: 25px;
   height: 28px;
-  background:  rgba(245, 250, 255, 1);
+  background: rgba(245, 250, 255, 1);
   justify-content: center;
   display: flex;
   align-items: center;
@@ -2250,12 +2253,13 @@ export default {
 
 
 /*table-header(无内容部分)背景色*/
-/deep/ .vxe-table--render-default.border--full .vxe-table--header-wrapper{
+/deep/ .vxe-table--render-default.border--full .vxe-table--header-wrapper {
   background: rgba(245, 250, 255, 1);
 }
+
 /*合计行(无内容部分)背景色*/
-/deep/ .vxe-table--render-default .vxe-table--footer-wrapper{
-  background: rgba(255 , 248, 225, 1);
+/deep/ .vxe-table--render-default .vxe-table--footer-wrapper {
+  background: rgba(255, 248, 225, 1);
   border: unset;
 }
 
@@ -2265,25 +2269,30 @@ export default {
   width: 10px;
   height: 10px;
 }
+
 /*滚动条的轨道*/
 .dk-table-scrollbar ::-webkit-scrollbar-track {
   /*background-color:  rgba(233, 240, 254, 1);*/
-  background-color:  #FFFFFF;
+  background-color: #FFFFFF;
   border: unset;
 }
+
 /*滚动条里面的小方块,能向上向下移动*/
 .dk-table-scrollbar ::-webkit-scrollbar-thumb {
   background-color: #bfbfbf;
   border-radius: 5px;
   border: 1px solid #F1F1F1;
-  box-shadow: inset 0 0 6px rgba(0,0,0,.3);
+  box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
 }
+
 .dk-table-scrollbar ::-webkit-scrollbar-thumb:hover {
   background-color: #A8A8A8;
 }
+
 .dk-table-scrollbar ::-webkit-scrollbar-thumb:active {
   background-color: #787878;
 }
+
 /*边角,即两个滚动条的交汇处*/
 .dk-table-scrollbar ::-webkit-scrollbar-corner {
   background-color: #FFFFFF;