From 277eac69f2914230a9b7a59c492df1482c6e478b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E8=BF=90=E6=A8=A1?= <1724894114@qq.com> Date: Wed, 10 Jul 2024 23:25:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A1=A8=E6=A0=BC=E5=8F=B3?= =?UTF-8?q?=E4=B8=8B=E8=A7=92=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/scTable/index.vue | 14 ++++++++--- src/config/table.js | 25 ++++++++++++------- src/views/setting/company/index.vue | 5 +++- src/views/setting/company/see.vue | 2 +- src/views/setting/log/index.vue | 38 +++++++++++++++++++++++++---- 5 files changed, 64 insertions(+), 20 deletions(-) diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index b3204de..bfb86ae 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -262,12 +262,12 @@ async columnSettingSave(userColumn){ this.$refs.columnSetting.isSave = true try { - await config.columnSettingSave(this.tableName, userColumn,this.apiObj) + await config.columnSettingSave(this.tableName, userColumn,this.apiObj); + this.$message.success('保存成功') }catch(error){ this.$message.error('保存失败') this.$refs.columnSetting.isSave = false } - this.$message.success('保存成功') this.$refs.columnSetting.isSave = false }, //自定义列重置 @@ -330,8 +330,14 @@ }) return sums }, - configSizeChange(){ - this.$refs.scTable.doLayout() + async configSizeChange() { + try { + await config.columnSettingConfigSave(this.tableName, this.config, this.apiObj); + this.$message.success('保存成功') + } catch (error) { + this.$message.error('保存失败') + } + // this.$refs.scTable.doLayout() }, //插入行 unshiftRow unshiftRow(row){ diff --git a/src/config/table.js b/src/config/table.js index 2d80d4a..8ae6ffb 100644 --- a/src/config/table.js +++ b/src/config/table.js @@ -28,7 +28,7 @@ export default { * @tableName scTable组件的props->tableName * @column 用户配置好的列 */ - columnSettingSave: function (tableName, column,params) { + columnSettingSave: function (tableName, column ,params) { column.forEach((item,index)=>{ item.sort = index+1; }) @@ -51,19 +51,26 @@ export default { }) }, /** - * 获取自定义列 + * 保存表格列表配置 * @tableName scTable组件的props->tableName * @column 组件接受到的props->column */ - columnSettingGet: function (tableName, column) { + columnSettingConfigSave: function (tableName, config, params) { return new Promise((resolve) => { - //这里为了演示使用了session和setTimeout演示,开发时应用数据请求 - const userColumn = tool.session.get(tableName) - if(userColumn){ - resolve(userColumn) - }else{ - resolve(column) + if(!params.url || params.url==''){ + resolve(false) + return } + let data = { + table_config:config, + } + http.post(params.url, data).then(res=>{ + if(res.code == 200 && res.data.column){ + resolve(true) + }else{ + resolve(false) + } + }); }) }, /** diff --git a/src/views/setting/company/index.vue b/src/views/setting/company/index.vue index 1dab17c..e52f303 100644 --- a/src/views/setting/company/index.vue +++ b/src/views/setting/company/index.vue @@ -95,7 +95,10 @@ export default { }, selection: [], params: { - activation_date: '', + activation_date: { + operator:'in', + value:[] + }, id:'', active_status:'', } diff --git a/src/views/setting/company/see.vue b/src/views/setting/company/see.vue index b149df2..4cca31b 100644 --- a/src/views/setting/company/see.vue +++ b/src/views/setting/company/see.vue @@ -23,7 +23,7 @@ - +