diff --git a/src/components/scTable/index.vue b/src/components/scTable/index.vue index cb54798..ca9b2be 100644 --- a/src/components/scTable/index.vue +++ b/src/components/scTable/index.vue @@ -285,12 +285,14 @@ this.$refs.columnSetting.isSave = false }, //自定义列重置 - async columnSettingBack(){ + async columnSettingBack(userColumn){ this.$refs.columnSetting.isSave = true try { - const column = await config.columnSettingReset(this.tableName, this.column) - this.userColumn = column - this.$refs.columnSetting.usercolumn = JSON.parse(JSON.stringify(this.userColumn||[])) + const column = await config.columnSettingReset(this.tableName, userColumn,this.apiObj) + if(column){ + this.userColumn = column + this.$refs.columnSetting.usercolumn = JSON.parse(JSON.stringify(this.userColumn||[])) + } }catch(error){ this.$message.error('重置失败') this.$refs.columnSetting.isSave = false diff --git a/src/config/table.js b/src/config/table.js index 8ae6ffb..940b393 100644 --- a/src/config/table.js +++ b/src/config/table.js @@ -1,5 +1,5 @@ //数据表格配置 -import tool from '@/utils/tool' +// import tool from '@/utils/tool' import http from "@/utils/request"; export default { @@ -39,7 +39,9 @@ export default { } let data = { column_config:column, - save_column:true + save_column:true, + page:1, + pageSize:this.pageSize } http.post(params.url, data).then(res=>{ if(res.code == 200 && res.data.column){ @@ -63,6 +65,8 @@ export default { } let data = { table_config:config, + page:1, + pageSize:this.pageSize } http.post(params.url, data).then(res=>{ if(res.code == 200 && res.data.column){ @@ -78,13 +82,36 @@ export default { * @tableName scTable组件的props->tableName * @column 组件接受到的props->column */ - columnSettingReset: function (tableName, column) { - return new Promise((resolve) => { - //这里为了演示使用了session和setTimeout演示,开发时应用数据请求 - setTimeout(()=>{ - tool.session.remove(tableName) - resolve(column) - },1000) + columnSettingReset: function (tableName, column ,params) { + column.forEach((item,index)=>{ + item.sort = index+1; }) + return new Promise((resolve) => { + if(!params.url || params.url==''){ + resolve(false) + return + } + let data = { + column_config:column, + save_column:false, + page:1, + pageSize:this.pageSize + } + http.post(params.url, data).then(res=>{ + if(res.code == 200 && res.data.columnConfig){ + resolve(res.data.columnConfig) + }else{ + resolve(false) + } + }); + }) + + // return new Promise((resolve) => { + // //这里为了演示使用了session和setTimeout演示,开发时应用数据请求 + // setTimeout(()=>{ + // tool.session.remove(tableName) + // resolve(column) + // },1000) + // }) } } diff --git a/src/views/docsManager/moveFile.vue b/src/views/docsManager/moveFile.vue index ea800bf..a6b2991 100644 --- a/src/views/docsManager/moveFile.vue +++ b/src/views/docsManager/moveFile.vue @@ -11,12 +11,11 @@ :props="defaultProps" node-key="id" :expand-on-click-node="false" - default-expand-all @node-click="getNodes" > @@ -131,8 +130,14 @@ export default { } } .treeMain{ - padding: 5px; + padding: 5px 0; border-radius: 4px; border: 1px solid rgba(0,0,0,0.12); + .treeName{ + display: flex;align-items: center; + .el-icon{ + margin-right: 8px; + } + } }