From 89c152647a5affb293af5f002c0763370f1a361b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Fri, 24 Feb 2023 18:52:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=99=E5=8D=95=E6=8D=AE=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=A6=E5=8F=B3=E6=8B=96=E6=8B=BD=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jshERP-web/package.json | 16 ++++--- jshERP-web/src/assets/less/common.less | 16 +++++++ jshERP-web/src/mixins/JeecgListMixin.js | 42 +++++++++++++++++++ .../src/views/bill/AllocationOutList.vue | 1 + jshERP-web/src/views/bill/AssembleList.vue | 1 + jshERP-web/src/views/bill/DisassembleList.vue | 1 + jshERP-web/src/views/bill/OtherInList.vue | 1 + jshERP-web/src/views/bill/OtherOutList.vue | 1 + .../src/views/bill/PurchaseBackList.vue | 1 + jshERP-web/src/views/bill/PurchaseInList.vue | 1 + .../src/views/bill/PurchaseOrderList.vue | 1 + jshERP-web/src/views/bill/RetailBackList.vue | 1 + jshERP-web/src/views/bill/RetailOutList.vue | 1 + jshERP-web/src/views/bill/SaleBackList.vue | 1 + jshERP-web/src/views/bill/SaleOrderList.vue | 1 + jshERP-web/src/views/bill/SaleOutList.vue | 1 + .../src/views/financial/AdvanceInList.vue | 1 + jshERP-web/src/views/financial/GiroList.vue | 1 + jshERP-web/src/views/financial/ItemInList.vue | 1 + .../src/views/financial/ItemOutList.vue | 1 + .../src/views/financial/MoneyInList.vue | 1 + .../src/views/financial/MoneyOutList.vue | 1 + jshERP-web/yarn.lock | 5 +++ 23 files changed, 92 insertions(+), 6 deletions(-) diff --git a/jshERP-web/package.json b/jshERP-web/package.json index 11227e87cd..d2c6c0538e 100644 --- a/jshERP-web/package.json +++ b/jshERP-web/package.json @@ -16,18 +16,18 @@ "codemirror": "^5.46.0", "dayjs": "^1.8.0", "enquire.js": "^2.1.6", + "intro.js": "^4.2.2", + "jquery": "^1.12.4", "js-cookie": "^2.2.0", "lodash.get": "^4.4.2", "lodash.pick": "^4.4.0", "md5": "^2.2.1", "nprogress": "^0.2.0", - "xlsx": "^0.14.3", - "intro.js": "^4.2.2", - "jquery": "^1.12.4", "viser-vue": "^2.4.4", "vue": "^2.6.10", "vue-area-linkage": "^5.1.0", "vue-cropper": "^0.4.8", + "vue-draggable-resizable": "^2.3.0", "vue-i18n": "^8.7.0", "vue-loader": "^15.7.0", "vue-ls": "^3.2.0", @@ -36,7 +36,8 @@ "vue-router": "^3.0.1", "vue-splitpane": "^1.0.4", "vuedraggable": "^2.20.0", - "vuex": "^3.1.0" + "vuex": "^3.1.0", + "xlsx": "^0.14.3" }, "devDependencies": { "@babel/polyfill": "^7.2.5", @@ -88,9 +89,12 @@ "vue/no-use-v-if-with-v-for": 0, "vue/html-closing-bracket-newline": 0, "vue/no-parsing-error": 0, - "no-console": 0, + "no-console": 0, "no-tabs": 0, - "indent": [1, 4] + "indent": [ + 1, + 4 + ] } }, "postcss": { diff --git a/jshERP-web/src/assets/less/common.less b/jshERP-web/src/assets/less/common.less index 835e294851..01e542dcf8 100644 --- a/jshERP-web/src/assets/less/common.less +++ b/jshERP-web/src/assets/less/common.less @@ -66,4 +66,20 @@ .ant-modal-mask { background-color: rgba(0, 0, 0, 0.1) !important; +} +/* 拖拽 */ +.table-draggable-handle { + /* width: 10px !important; */ + height: 100% !important; + left: auto !important; + right: -5px; + cursor: col-resize; + touch-action: none; + border: none; + position: absolute; + transform: none !important; + bottom: 0; +} +.resize-table-th { + position: relative; } \ No newline at end of file diff --git a/jshERP-web/src/mixins/JeecgListMixin.js b/jshERP-web/src/mixins/JeecgListMixin.js index 2acb8f1b1f..e1633f2844 100644 --- a/jshERP-web/src/mixins/JeecgListMixin.js +++ b/jshERP-web/src/mixins/JeecgListMixin.js @@ -6,11 +6,15 @@ import { filterObj,getNowFormatStr } from '@/utils/util'; import { deleteAction, getAction, postAction, downFile, getFileAccessHttpUrl } from '@/api/manage' import Vue from 'vue' +import VueDraggableResizable from 'vue-draggable-resizable' import { ACCESS_TOKEN } from "@/store/mutation-types" import {mixinDevice} from '@/utils/mixin.js' export const JeecgListMixin = { mixins: [mixinDevice], + components: { + VueDraggableResizable + }, data(){ return { //token header @@ -393,6 +397,44 @@ export const JeecgListMixin = { this.scroll.y = document.documentElement.clientHeight-searchWrapperDomLen-operatorDomLen-basicLength } }, + //拖拽组件 + handleDrag(column){ + return { + header: { + cell: (h, props, children) => { + const { key, ...restProps } = props + const col = column.find((col) => { + const k = col.dataIndex || col.key + return k === key + }) + + if (!col || !col.width) { + return h('th', { ...restProps }, [...children]) + } + + const dragProps = { + key: col.dataIndex || col.key, + class: 'table-draggable-handle', + attrs: { + w: 10, + x: col.width, + z: 1, + axis: 'x', + draggable: true, + resizable: false, + }, + on: { + dragging: (x, y) => { + col.width = Math.max(x, 1) + }, + }, + } + const drag = h(VueDraggableResizable, { ...dragProps }) + return h('th', { ...restProps, class: 'resize-table-th' }, [...children, drag]) + }, + } + } + }, /** 表格增加合计行 */ tableAddTotalRow(columns, dataSource) { if(dataSource.length>0 && this.ipagination.pageSize%10===1) { diff --git a/jshERP-web/src/views/bill/AllocationOutList.vue b/jshERP-web/src/views/bill/AllocationOutList.vue index 3950a32f96..00fc962497 100644 --- a/jshERP-web/src/views/bill/AllocationOutList.vue +++ b/jshERP-web/src/views/bill/AllocationOutList.vue @@ -101,6 +101,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/AssembleList.vue b/jshERP-web/src/views/bill/AssembleList.vue index 45dabad8c7..831e9a0bba 100644 --- a/jshERP-web/src/views/bill/AssembleList.vue +++ b/jshERP-web/src/views/bill/AssembleList.vue @@ -101,6 +101,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/DisassembleList.vue b/jshERP-web/src/views/bill/DisassembleList.vue index ac331341fb..b82801601c 100644 --- a/jshERP-web/src/views/bill/DisassembleList.vue +++ b/jshERP-web/src/views/bill/DisassembleList.vue @@ -101,6 +101,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/OtherInList.vue b/jshERP-web/src/views/bill/OtherInList.vue index 87138c4c74..96ad99b108 100644 --- a/jshERP-web/src/views/bill/OtherInList.vue +++ b/jshERP-web/src/views/bill/OtherInList.vue @@ -115,6 +115,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/OtherOutList.vue b/jshERP-web/src/views/bill/OtherOutList.vue index 3e98b6ecc5..0d1752a0a9 100644 --- a/jshERP-web/src/views/bill/OtherOutList.vue +++ b/jshERP-web/src/views/bill/OtherOutList.vue @@ -115,6 +115,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/PurchaseBackList.vue b/jshERP-web/src/views/bill/PurchaseBackList.vue index 3f53377e53..e241e00e97 100644 --- a/jshERP-web/src/views/bill/PurchaseBackList.vue +++ b/jshERP-web/src/views/bill/PurchaseBackList.vue @@ -124,6 +124,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/PurchaseInList.vue b/jshERP-web/src/views/bill/PurchaseInList.vue index da1b3ef7fb..ada8c53ee9 100644 --- a/jshERP-web/src/views/bill/PurchaseInList.vue +++ b/jshERP-web/src/views/bill/PurchaseInList.vue @@ -134,6 +134,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/PurchaseOrderList.vue b/jshERP-web/src/views/bill/PurchaseOrderList.vue index b5437d2b54..3524a83201 100644 --- a/jshERP-web/src/views/bill/PurchaseOrderList.vue +++ b/jshERP-web/src/views/bill/PurchaseOrderList.vue @@ -104,6 +104,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/RetailBackList.vue b/jshERP-web/src/views/bill/RetailBackList.vue index 5518ec4b25..9db558196b 100644 --- a/jshERP-web/src/views/bill/RetailBackList.vue +++ b/jshERP-web/src/views/bill/RetailBackList.vue @@ -124,6 +124,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/RetailOutList.vue b/jshERP-web/src/views/bill/RetailOutList.vue index 9a254dd725..5f098fbd0c 100644 --- a/jshERP-web/src/views/bill/RetailOutList.vue +++ b/jshERP-web/src/views/bill/RetailOutList.vue @@ -119,6 +119,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/SaleBackList.vue b/jshERP-web/src/views/bill/SaleBackList.vue index 0fa4f8f27c..a649a2a01c 100644 --- a/jshERP-web/src/views/bill/SaleBackList.vue +++ b/jshERP-web/src/views/bill/SaleBackList.vue @@ -125,6 +125,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/SaleOrderList.vue b/jshERP-web/src/views/bill/SaleOrderList.vue index 84c065fb59..0a94d8a11a 100644 --- a/jshERP-web/src/views/bill/SaleOrderList.vue +++ b/jshERP-web/src/views/bill/SaleOrderList.vue @@ -105,6 +105,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/bill/SaleOutList.vue b/jshERP-web/src/views/bill/SaleOutList.vue index 326e58608c..46b344f027 100644 --- a/jshERP-web/src/views/bill/SaleOutList.vue +++ b/jshERP-web/src/views/bill/SaleOutList.vue @@ -135,6 +135,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/financial/AdvanceInList.vue b/jshERP-web/src/views/financial/AdvanceInList.vue index 2703227251..e02938af2c 100644 --- a/jshERP-web/src/views/financial/AdvanceInList.vue +++ b/jshERP-web/src/views/financial/AdvanceInList.vue @@ -106,6 +106,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/financial/GiroList.vue b/jshERP-web/src/views/financial/GiroList.vue index 4103365ca7..e0c15f4680 100644 --- a/jshERP-web/src/views/financial/GiroList.vue +++ b/jshERP-web/src/views/financial/GiroList.vue @@ -106,6 +106,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/financial/ItemInList.vue b/jshERP-web/src/views/financial/ItemInList.vue index b251a5fda3..a62024b35b 100644 --- a/jshERP-web/src/views/financial/ItemInList.vue +++ b/jshERP-web/src/views/financial/ItemInList.vue @@ -115,6 +115,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/financial/ItemOutList.vue b/jshERP-web/src/views/financial/ItemOutList.vue index 704fcdb252..e84e48b778 100644 --- a/jshERP-web/src/views/financial/ItemOutList.vue +++ b/jshERP-web/src/views/financial/ItemOutList.vue @@ -115,6 +115,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/financial/MoneyInList.vue b/jshERP-web/src/views/financial/MoneyInList.vue index c22a967793..30152a9849 100644 --- a/jshERP-web/src/views/financial/MoneyInList.vue +++ b/jshERP-web/src/views/financial/MoneyInList.vue @@ -121,6 +121,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/src/views/financial/MoneyOutList.vue b/jshERP-web/src/views/financial/MoneyOutList.vue index 37fa94816e..47f56e8dcb 100644 --- a/jshERP-web/src/views/financial/MoneyOutList.vue +++ b/jshERP-web/src/views/financial/MoneyOutList.vue @@ -121,6 +121,7 @@ rowKey="id" :columns="columns" :dataSource="dataSource" + :components="handleDrag(columns)" :pagination="ipagination" :scroll="scroll" :loading="loading" diff --git a/jshERP-web/yarn.lock b/jshERP-web/yarn.lock index 271d9f9abd..a6bffa9f20 100644 --- a/jshERP-web/yarn.lock +++ b/jshERP-web/yarn.lock @@ -11163,6 +11163,11 @@ vue-cropper@^0.4.8: resolved "https://registry.npmjs.org/vue-cropper/-/vue-cropper-0.4.9.tgz#fe650f32516ecf29014bbd4a9079191c8dc5a5ae" integrity sha512-Uf1i/sCh+ZqSM9hb2YTGRENzJFH+mvDuv8N2brGLjK7UBuF7XDP7zbis8g/dcqZiMojAcBDtObFCn4ERFbRMxQ== +vue-draggable-resizable@^2.3.0: + version "2.3.0" + resolved "https://registry.npmmirror.com/vue-draggable-resizable/-/vue-draggable-resizable-2.3.0.tgz#94c433ca748bc1a4d0959ba1c5c0e1c3536cee5b" + integrity sha512-77CLRj1TPwB30pwsjOf3pkd1UzYanCdKXbqhILJ0Oo5QQl50lvBfyQCXxMFzwWwTc3sbBbQH3FfWSV+BkoSElA== + vue-eslint-parser@^2.0.3: version "2.0.3" resolved "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz#c268c96c6d94cfe3d938a5f7593959b0ca3360d1"