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 @@ - +