From 3619242076500edcfd395dced62961c896406b62 Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Mon, 5 Oct 2020 16:48:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20add=20document=20for=20AdvanceTable.vue?= =?UTF-8?q?;=20:bug:=20=E6=96=B0=E5=A2=9E=EF=BC=9A=E7=BB=99=20AdvanceTable?= =?UTF-8?q?.vue=20=E5=A2=9E=E5=8A=A0=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 11 +- .../table/advance/ActionColumns.vue | 15 +- src/components/table/advance/AdvanceTable.vue | 23 +-- src/components/table/advance/SearchArea.vue | 160 +++++++++++------- src/components/table/api/ApiTable.vue | 49 ++++++ src/mock/extend/index.js | 5 + src/mock/goods/index.js | 51 ++++++ src/mock/index.js | 3 +- src/pages/components/table/Api.vue | 152 +++++++++++++++++ src/pages/components/{ => table}/Table.vue | 118 +++++++------ src/pages/components/table/index.js | 2 + src/router/config.js | 4 +- src/services/api.js | 3 +- src/services/dataSource.js | 8 + src/services/index.js | 4 +- src/utils/request.js | 25 ++- yarn.lock | 5 + 17 files changed, 488 insertions(+), 150 deletions(-) create mode 100644 src/components/table/api/ApiTable.vue create mode 100644 src/mock/goods/index.js create mode 100644 src/pages/components/table/Api.vue rename src/pages/components/{ => table}/Table.vue (53%) create mode 100644 src/pages/components/table/index.js create mode 100644 src/services/dataSource.js diff --git a/package.json b/package.json index 3112105b..22b25645 100644 --- a/package.json +++ b/package.json @@ -22,15 +22,16 @@ "core-js": "^3.6.5", "date-fns": "^2.14.0", "enquire.js": "^2.1.6", + "highlight.js": "^10.2.1", "js-cookie": "^2.2.1", "mockjs": "^1.1.0", + "nprogress": "^0.2.0", "viser-vue": "^2.4.8", "vue": "^2.6.11", "vue-i18n": "^8.18.2", "vue-router": "^3.3.4", "vuedraggable": "^2.23.2", - "vuex": "^3.4.0", - "nprogress": "^0.2.0" + "vuex": "^3.4.0" }, "devDependencies": { "@ant-design/colors": "^4.0.1", @@ -39,7 +40,9 @@ "@vue/cli-service": "^4.4.0", "@vuepress/plugin-back-to-top": "^1.5.2", "babel-eslint": "^10.1.0", + "babel-plugin-transform-remove-console": "^6.9.4", "babel-polyfill": "^6.26.0", + "compression-webpack-plugin": "^2.0.0", "deepmerge": "^4.2.2", "eslint": "^6.7.2", "eslint-plugin-vue": "^6.2.2", @@ -51,9 +54,7 @@ "vue-template-compiler": "^2.6.11", "vuepress": "^1.5.2", "webpack-theme-color-replacer": "^1.3.12", - "whatwg-fetch": "^3.0.0", - "compression-webpack-plugin": "^2.0.0", - "babel-plugin-transform-remove-console": "^6.9.4" + "whatwg-fetch": "^3.0.0" }, "eslintConfig": { "root": true, diff --git a/src/components/table/advance/ActionColumns.vue b/src/components/table/advance/ActionColumns.vue index 667c3d8e..8e357c4b 100644 --- a/src/components/table/advance/ActionColumns.vue +++ b/src/components/table/advance/ActionColumns.vue @@ -1,6 +1,5 @@ @@ -28,7 +27,6 @@ - @@ -87,12 +85,14 @@ }, setSearch(col) { this.$set(col, 'searchAble', !col.searchAble) + console.log(col) if (!col.searchAble && col.search) { this.resetSearch(col) } }, resetSearch(col) { - col.search.value = col.dataType === 'boolean' ? false : undefined + // col.search.value = col.dataType === 'boolean' ? false : undefined + col.search.value = undefined col.search.backup = undefined }, resetColumns() { @@ -114,7 +114,8 @@ } else { this.$set(column, 'fixed', undefined) } - column.searchAble = back.searchAble + this.$set(column, 'searchAble', back.searchAble) + // column.searchAble = back.searchAble this.resetSearch(column) }) this.checkedCounts = counts diff --git a/src/components/table/advance/AdvanceTable.vue b/src/components/table/advance/AdvanceTable.vue index 1dd73a21..3f180d69 100644 --- a/src/components/table/advance/AdvanceTable.vue +++ b/src/components/table/advance/AdvanceTable.vue @@ -8,7 +8,7 @@