|
@@ -10,14 +10,28 @@
|
|
|
cache-key="systemOrgUserTable"
|
|
cache-key="systemOrgUserTable"
|
|
|
:needPage="false"
|
|
:needPage="false"
|
|
|
>
|
|
>
|
|
|
- <template v-for="(item, i) in powerList" v-slot:[item]="{ row }">
|
|
|
|
|
|
|
+ <template v-for="(item, i) in powerArr" v-slot:[item.name]="{ row }">
|
|
|
<el-checkbox
|
|
<el-checkbox
|
|
|
:key="i"
|
|
:key="i"
|
|
|
- v-model="row[item]"
|
|
|
|
|
|
|
+ v-model="row[item.name]"
|
|
|
true-label="1"
|
|
true-label="1"
|
|
|
false-label="0"
|
|
false-label="0"
|
|
|
></el-checkbox>
|
|
></el-checkbox>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template
|
|
|
|
|
+ v-for="(item, i) in powerArr"
|
|
|
|
|
+ v-slot:[item.label]="{ column, $index }"
|
|
|
|
|
+ >
|
|
|
|
|
+ <span :key="i"
|
|
|
|
|
+ >{{ column.label }}
|
|
|
|
|
+ <el-checkbox
|
|
|
|
|
+ true-label="1"
|
|
|
|
|
+ false-label="0"
|
|
|
|
|
+ v-model="checkedAll[item.name]"
|
|
|
|
|
+ @change="allChange(item.name)"
|
|
|
|
|
+ ></el-checkbox>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
<template v-slot:toolbar>
|
|
<template v-slot:toolbar>
|
|
|
<el-button
|
|
<el-button
|
|
|
size="small"
|
|
size="small"
|
|
@@ -89,8 +103,8 @@ export default {
|
|
|
isAdd: {
|
|
isAdd: {
|
|
|
default: true
|
|
default: true
|
|
|
},
|
|
},
|
|
|
- height:{
|
|
|
|
|
- default:'calc(70vh - 339px)'
|
|
|
|
|
|
|
+ height: {
|
|
|
|
|
+ default: 'calc(70vh - 339px)'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -98,13 +112,27 @@ export default {
|
|
|
return {
|
|
return {
|
|
|
// 表格列配置
|
|
// 表格列配置
|
|
|
|
|
|
|
|
- tableList: []
|
|
|
|
|
|
|
+ tableList: [],
|
|
|
|
|
+ checkedAll: {
|
|
|
|
|
+ visible:'0',
|
|
|
|
|
+ browse: '0',
|
|
|
|
|
+ check: '0',
|
|
|
|
|
+ revise: '0',
|
|
|
|
|
+ del: '0',
|
|
|
|
|
+ copy: '0',
|
|
|
|
|
+ shear: '0',
|
|
|
|
|
+ checkEnter: '0',
|
|
|
|
|
+ checkOut: '0',
|
|
|
|
|
+ archive: '0',
|
|
|
|
|
+ cancelArchive: '0',
|
|
|
|
|
+ abolish: '0',
|
|
|
|
|
+ download: '0',
|
|
|
|
|
+ print: '0'
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+
|
|
|
computed: {
|
|
computed: {
|
|
|
- powerList() {
|
|
|
|
|
- return this.powerArr.map((item) => item.name);
|
|
|
|
|
- },
|
|
|
|
|
columns() {
|
|
columns() {
|
|
|
return [
|
|
return [
|
|
|
{
|
|
{
|
|
@@ -119,7 +147,7 @@ export default {
|
|
|
|
|
|
|
|
{
|
|
{
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
- prop: 'deptName',
|
|
|
|
|
|
|
+ prop: 'groupName',
|
|
|
label: '部门',
|
|
label: '部门',
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110
|
|
minWidth: 110
|
|
@@ -138,7 +166,8 @@ export default {
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
label: item.label,
|
|
label: item.label,
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
- width: 80
|
|
|
|
|
|
|
+ width: 100,
|
|
|
|
|
+ headerSlot: item.label
|
|
|
};
|
|
};
|
|
|
}),
|
|
}),
|
|
|
{
|
|
{
|
|
@@ -153,7 +182,13 @@ export default {
|
|
|
];
|
|
];
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ mounted() {
|
|
|
|
|
+ this.powerArr.forEach(item=>{
|
|
|
|
|
+ this.checkedAll[item.name]='0'
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
openEdit() {
|
|
openEdit() {
|
|
|
this.$refs.addRef.open(this.tableList.map((item) => item.id));
|
|
this.$refs.addRef.open(this.tableList.map((item) => item.id));
|
|
@@ -164,11 +199,17 @@ export default {
|
|
|
getTableList() {
|
|
getTableList() {
|
|
|
return JSON.parse(JSON.stringify(this.tableList));
|
|
return JSON.parse(JSON.stringify(this.tableList));
|
|
|
},
|
|
},
|
|
|
|
|
+ allChange(key) {
|
|
|
|
|
+ this.tableList.forEach((item,index)=>{
|
|
|
|
|
+ this.$set(this.tableList[index],key,this.checkedAll[key])
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
success(data) {
|
|
success(data) {
|
|
|
data.forEach((item) => {
|
|
data.forEach((item) => {
|
|
|
- this.powerList.forEach((key) => {
|
|
|
|
|
- if (!item[key]) {
|
|
|
|
|
- item[key] = key == 'visible' ? '1' : '0';
|
|
|
|
|
|
|
+ this.powerArr.forEach((key) => {
|
|
|
|
|
+ if (!item[key.name]) {
|
|
|
|
|
+ item[key.name] = key.name == 'visible' ? '1' : '0';
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|