From 4314fc52f25cc4a3edffa00e5ef912797b64e0d5 Mon Sep 17 00:00:00 2001
From: xlzy <1017866168@qq.com>
Date: Thu, 11 Feb 2021 18:56:22 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E8=A1=A8=E6=A0=BC?=
=?UTF-8?q?=E5=BF=AB=E6=8D=B7=E6=93=8D=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
_web/package.json | 1 +
_web/src/components/Table/columnSetting.vue | 81 ++++++++++++
_web/src/components/Table/index.js | 129 +++++++++++++++++++-
_web/src/components/Table/index.less | 54 ++++++++
_web/src/views/system/user/index.vue | 7 +-
5 files changed, 266 insertions(+), 6 deletions(-)
create mode 100644 _web/src/components/Table/columnSetting.vue
create mode 100644 _web/src/components/Table/index.less
diff --git a/_web/package.json b/_web/package.json
index 9f92061c..c2c21703 100644
--- a/_web/package.json
+++ b/_web/package.json
@@ -30,6 +30,7 @@
"nprogress": "^0.2.0",
"print-js": "^1.0.63",
"raphael": "^2.3.0",
+ "screenfull": "^5.1.0",
"viser-vue": "^2.4.6",
"vue": "^2.6.10",
"vue-clipboard2": "^0.2.1",
diff --git a/_web/src/components/Table/columnSetting.vue b/_web/src/components/Table/columnSetting.vue
new file mode 100644
index 00000000..a5b2e44c
--- /dev/null
+++ b/_web/src/components/Table/columnSetting.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
diff --git a/_web/src/components/Table/index.js b/_web/src/components/Table/index.js
index 0397f88c..2d4d7322 100644
--- a/_web/src/components/Table/index.js
+++ b/_web/src/components/Table/index.js
@@ -1,7 +1,14 @@
import T from 'ant-design-vue/es/table/Table'
import get from 'lodash.get'
+import screenfull from 'screenfull'
+import draggable from 'vuedraggable'
+import columnSetting from './columnSetting'
+import './index.less'
export default {
+ components: {
+ draggable, columnSetting
+ },
data () {
return {
needTotalList: [],
@@ -11,7 +18,15 @@ export default {
localLoading: false,
localDataSource: [],
- localPagination: Object.assign({}, this.pagination)
+ localPagination: Object.assign({}, this.pagination),
+ isFullscreen: false,
+ customSize: this.size,
+
+ // 列配置
+ indeterminate: true,
+ checkAll: false,
+ checkedList: [],
+ columnsSetting: []
}
},
props: Object.assign({}, T.props, {
@@ -74,6 +89,10 @@ export default {
pageURI: {
type: Boolean,
default: false
+ },
+ extraTool: {
+ type: Array,
+ default: () => ([])
}
}),
watch: {
@@ -116,6 +135,7 @@ export default {
// console.log('this.localPagination', this.localPagination)
this.needTotalList = this.initTotalList(this.columns)
this.loadData()
+ this.columnsSetting = this.columns
},
methods: {
/**
@@ -276,11 +296,109 @@ export default {
) */
+ },
+ columnChange(val) {
+ this.columnsSetting = val
+ },
+ renderHeader () {
+ let tools = [
+ {
+ icon: 'reload',
+ title: '刷新',
+ onClick: () => {
+ this.refresh()
+ }
+ },
+ {
+ icon: 'column-height',
+ title: '密度',
+ isDropdown: true,
+ menu: () => {
+ const onClick = ({ key }) => {
+ this.customSize = key
+ }
+ return (
+