|
@@ -17,8 +17,8 @@
|
|
|
@refresh-change="refreshChange"
|
|
|
@on-load="onLoad"
|
|
|
:table-loading="loading"
|
|
|
- @saveColumn="saveColumn"
|
|
|
- @resetColumn="resetColumn"
|
|
|
+ @resetColumn="resetColumnTwo('crud', 'option', 'optionBack', 293)"
|
|
|
+ @saveColumn="saveColumnTwo('crud', 'option', 'optionBack', 293)"
|
|
|
@selection-change="selectionChange"
|
|
|
:cell-style="cellStyle"
|
|
|
@search-criteria-switch="searchCriteriaSwitch"
|
|
@@ -76,7 +76,8 @@ export default {
|
|
|
pageSize: 10,
|
|
|
currentPage: 1
|
|
|
},
|
|
|
- option: {
|
|
|
+ option: {},
|
|
|
+ optionBack: {
|
|
|
searchShow: true,
|
|
|
searchMenuSpan: 6,
|
|
|
align: "center",
|
|
@@ -266,6 +267,29 @@ export default {
|
|
|
this.onLoad(this.page, this.search);
|
|
|
this.isShow = true;
|
|
|
},
|
|
|
+ //自定义列保存
|
|
|
+ async saveColumnTwo(ref, option, optionBack, code) {
|
|
|
+ /**
|
|
|
+ * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
|
|
|
+ * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
|
|
|
+ * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
|
|
|
+ */
|
|
|
+ const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //自定义列重置
|
|
|
+ async resetColumnTwo(ref, option, optionBack, code) {
|
|
|
+ this[option] = this[optionBack];
|
|
|
+ const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
|
|
|
+ if (inSave) {
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ this.$refs[ref].$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
// 更改表格颜色
|
|
|
headerClassName(tab){
|
|
|
//颜色间隔
|