Selaa lähdekoodia

4.0.43 修改表格布局

liuyanpeng 2 vuotta sitten
vanhempi
sitoutus
3e25baad87

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "4.0.42",
+  "version": "4.0.43",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 40 - 4
src/common/CommonTable.vue

@@ -2,6 +2,7 @@
   <div class="tablePaganations">
     <a-config-provider :locale="locale">
       <a-table
+        id="commonTable"
         class="ant-table-striped"
         bordered
         size="small"
@@ -10,7 +11,7 @@
         :data-source="dataSource"
         :columns="columns"
         :row-key="(record) => record.id"
-        :scroll="scroll"
+        :scroll="{ y: yScroll }"
         :pagination="havePage ? pagination : false"
         :row-class-name="
           (_record, index) => (index % 2 === 1 ? 'table-striped' : null)
@@ -48,36 +49,47 @@ import {
   defineEmits,
   defineExpose,
   watch,
+  onMounted,
 } from 'vue';
+import { getTableScroll } from '../common/tableScroll.js';
 import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
 const locale = ref(zhCN);
+
 const props = defineProps({
+  // 表格数据
   dataSource: {
     type: Object,
     required: true,
   },
+  // 表头数据
   columns: {
     type: Object,
     required: true,
   },
+  // 是否可选择
   isSelect: {
     type: Boolean,
   },
+  // 表格loading
   isLoading: {
     type: Boolean,
   },
+  // 数据总数
   total: {
     type: Number,
     default: 0,
   },
+  // 是否分页
   havePage: {
     type: Boolean,
     default: true,
   },
-  scroll: {
-    type: Object,
-    default: () => ({ y: 400 }),
+  // 表格距底部高度
+  extraHeight: {
+    type: Number,
+    default: undefined,
   },
+  // 选择的key值
   selectedKeys: {
     type: Array,
     default: () => [],
@@ -100,6 +112,9 @@ const pagination = reactive({
   total: props.total,
 });
 
+const yScroll = ref(400); //默认滚动高度
+const extraHeight = ref(undefined); //表格距离底部值
+
 // 最后一次排序信息
 const lastSorter = reactive({ field: '', order: '' });
 
@@ -109,6 +124,26 @@ const state = reactive({
   selectedRowKeys: [],
 });
 
+onMounted(() => {
+  if (!props.havePage) {
+    extraHeight.value = 30;
+  } else {
+    extraHeight.value = props.extraHeight;
+  }
+  onResizeTable();
+  window.onresize = () => {
+    onResizeTable();
+  };
+});
+
+// 表格位置
+const onResizeTable = () => {
+  yScroll.value = getTableScroll({
+    extraHeight: extraHeight.value,
+    id: 'commonTable',
+  });
+};
+
 //点击页码事件
 const changePage = (current, size) => {
   pagination.current = current;
@@ -206,6 +241,7 @@ watch(
   props,
   newData => {
     pagination.total = newData.total;
+    extraHeight.value = newData.extraHeight;
   },
   { immediate: true, deep: true },
 );

+ 3 - 3
src/common/tableScroll.js

@@ -5,8 +5,8 @@
 */
 export const getTableScroll = ({ extraHeight, id }) => {
   if (typeof extraHeight == 'undefined') {
-    //  默认底部分页
-    extraHeight = 50;
+    //  默认底部分页高度
+    extraHeight = 60;
   }
   let tHeader = null;
   if (id) {
@@ -22,5 +22,5 @@ export const getTableScroll = ({ extraHeight, id }) => {
   }
   //窗体高度-表格内容顶部的高度-表格内容底部的高度
   let height = `calc(100vh - ${tHeaderBottom + extraHeight}px)`;
-  return { y: height };
+  return height;
 };

+ 1 - 2
src/identity/IdentityManager.vue

@@ -8,7 +8,6 @@
       class="commonTable"
       :have-page="false"
       :is-loading="isLoading"
-      :scroll-value="{ y: '70vh' }"
       :columns="identityColumns"
       :data-source="identityDatas"
     >
@@ -57,7 +56,7 @@ import { useRouter } from 'vue-router';
 import Common from '../common/Common.js';
 import { message, Modal } from 'ant-design-vue';
 import { ref, onMounted, createVNode } from 'vue';
-import CommonTable from '../print/CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
 import { DownOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import {
   tableColumns,

+ 8 - 5
src/print/PrintCard.vue

@@ -106,8 +106,8 @@
           :is-loading="isLoading"
           :is-select="isSelect"
           :data-source="dataSource"
-          @select-column="selectColumn"
-          @page-params="getPageParams"
+          @get-selected="selectColumn"
+          @get-pager="getPageParams"
         >
           <template #bodyCell="{ column, record }">
             <template v-if="column.key === 'imageUrl'">
@@ -180,7 +180,7 @@ import Common from '../common/Common';
 import CreateJPEG from '../common/X6';
 import { message } from 'ant-design-vue';
 import { base64toFile } from '../common/X6';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
 import { SqlApi, Notify } from 'pc-component-v3';
 import { getImageSrc } from '../common/image-src';
 import { ref, reactive, onMounted, watch } from 'vue';
@@ -313,8 +313,8 @@ const searchPrintInfo = () => {
   }
 };
 // 获取所选项的数据
-const selectColumn = rows => {
-  select.selectedRows = rows;
+const selectColumn = selected => {
+  select.selectedRows = selected.selectedRows;
   // console.log('onSelectChange', select.selectedRows);
 };
 // 展开打印框
@@ -595,4 +595,7 @@ const init = () => {
 .full-modal .ant-modal-body {
   flex: 1;
 }
+.ant-divider-horizontal{
+  margin: 4px 0;
+}
 </style>

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 1589 - 5
src/printer/PrinterConfiguration.vue


+ 5 - 27
src/workflow/ExecutionList.vue

@@ -61,14 +61,13 @@
             <button class="btn btn-info" @click="changeFilterData">查询</button>
           </div>
         </div>
-        <ul />
-        <div class="flex-content">
+        <div>
           <CommonTable
             ref="table"
             :columns="columns"
             :data-source="taskInstanceDtos"
             :total="pagination.total"
-            @get-page="getPageParams"
+            @get-pager="getPageParams"
           >
             <template #headerCell="{ column }">
               <template v-if="column.key == 'httpRequestType'">
@@ -148,8 +147,10 @@ import TaskInstanceResource from '../api/base/TaskInstanceResource.js';
 import TaskDefineResource from '../api/task/TaskDefineResource.js';
 import vSelect from 'vue-select';
 import 'vue-select/dist/vue-select.css';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
+
 export default {
+  
   components: {
     vSelect,
     CommonTable,
@@ -249,15 +250,6 @@ export default {
     var _self = this;
     _self.getAllTaskDefineDtos();
     _self.getDatas();
-    // $('.fixed-table').tableFixer({
-    //   left: 3,
-    //   head: true,
-    // });
-
-    // $('.fixed-table').colResizable({
-    //   resizeMode: 'overflow',
-    //   partialRefresh: true,
-    // });
   },
 
   methods: {
@@ -275,7 +267,6 @@ export default {
     },
     changeFilterData: function () {
       var _self = this;
-      // _self.getDatas();
       _self.$refs.table.backFirstPage();
     },
     getAllTaskDefineDtos: function () {
@@ -332,7 +323,6 @@ export default {
             );
           }
 
-          _self.fixedTableHeader();
         },
         errorData => {
           _self.loading = false;
@@ -340,18 +330,6 @@ export default {
         },
       );
     },
-    /**
-     * 冻结表头
-     */
-    fixedTableHeader: function () {
-      const _self = this;
-      _self.$nextTick(function () {
-        $('.fixed-table').tableFixer({
-          left: 3,
-          head: true,
-        });
-      });
-    },
   },
 };
 </script>

+ 2 - 2
src/workflow/TaskProcessManagement.vue

@@ -474,7 +474,7 @@
       :total="pagination.total"
       :columns="columns"
       :data-source="taskDefineDtos"
-      @get-page="getPageParams"
+      @get-pager="getPageParams"
     >
       <template #bodyCell="{ column, record }">
         <template v-if="column.key == 'taskType'">
@@ -580,7 +580,7 @@ import UserResource from '../api/base/UserResource.js';
 import GroupResource from '../api/base/GroupResource.js';
 import 'vue-select/dist/vue-select.css';
 import { Notify, Uuid } from 'pc-component-v3';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
 import { message } from 'ant-design-vue';
 import EditTableCell from './EditTableCell.vue';
 export default {

+ 2 - 2
src/workflow/WorkflowEdit.vue

@@ -45,7 +45,7 @@
         :data-source="workflowDatas"
         :total="pagination.total"
         :row-selection="rowSelection"
-        @get-page="getPageParams"
+        @get-pager="getPageParams"
       >
         <template #headerCell="{ column }">
           <template v-if="column.dataIndex == 'check'">
@@ -254,7 +254,7 @@ import vSelect from 'vue-select';
 import WorkflowEditResource from './WorkflowEditResource.js';
 import 'vue-select/dist/vue-select.css';
 import { Notify, Uuid } from 'pc-component-v3';
-import CommonTable from './CommonTable.vue';
+import CommonTable from '../common/CommonTable.vue';
 export default {
   components: {
     'v-select': vSelect,

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä