|
@@ -433,6 +433,8 @@ export default {
|
|
|
subTableName: "",
|
|
|
// 当前点击行的数据
|
|
|
currentRow: {},
|
|
|
+ // 操作列是否显示隐藏
|
|
|
+ isShowExcuteCol: false,
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -442,11 +444,31 @@ export default {
|
|
|
},
|
|
|
watch: {},
|
|
|
computed: {
|
|
|
- isShowExcuteCol() {
|
|
|
- return !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
|
|
|
- },
|
|
|
+ // isShowExcuteCol() {
|
|
|
+ // let res = false;
|
|
|
+ // if (!this.excuteBtnArr || !this.excuteBtnArr.length) {
|
|
|
+ // res = false;
|
|
|
+ // } else {
|
|
|
+ // res = !this.excuteBtnArr?.every((arr) => arr.children.length == 0);
|
|
|
+ // }
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // console.log(res);
|
|
|
+ // this.$refs.tableRef.doLayout();
|
|
|
+ // });
|
|
|
+ // return res;
|
|
|
+ // },
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 计算操作列的显示与隐藏
|
|
|
+ calcuteExcuteCol() {
|
|
|
+ if (!this.excuteBtnArr || !this.excuteBtnArr.length) {
|
|
|
+ this.isShowExcuteCol = false;
|
|
|
+ } else {
|
|
|
+ this.isShowExcuteCol = !this.excuteBtnArr?.every(
|
|
|
+ (arr) => arr.children.length == 0
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
// 获取row-key
|
|
|
getRowKey(row) {
|
|
|
return row[
|
|
@@ -471,6 +493,10 @@ export default {
|
|
|
});
|
|
|
// 获取操作列的按钮数据
|
|
|
this.excuteBtnArr = res.data.resultMap.button;
|
|
|
+ this.calcuteExcuteCol();
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.tableRef.doLayout();
|
|
|
+ });
|
|
|
this.queryParams.orderByColumn =
|
|
|
res.data.resultMap.querySql.orderByColumn;
|
|
|
this.sortOrder = JSON.parse(res.data.resultMap.querySql.sortOrder);
|