|
@@ -146,7 +146,6 @@
|
|
|
<el-button @click="toggleSelection([option[1], option[2]])">切换第二、第三行的选中状态</el-button>
|
|
|
<el-button @click="toggleSelection()">取消选择</el-button>
|
|
|
</div> -->
|
|
|
- <el-button @click="toggleSelection([tableData[1], tableData[0]])">切换第二、第三行的选中状态</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -222,14 +221,15 @@ export default {
|
|
|
parentId: [{ required: true, message: '请选择所属部门', trigger: 'change' },],
|
|
|
},
|
|
|
list:[],
|
|
|
+ times:0
|
|
|
}
|
|
|
},
|
|
|
created(){
|
|
|
|
|
|
},
|
|
|
|
|
|
- async mounted() {
|
|
|
- await this.getList()
|
|
|
+ mounted() {
|
|
|
+ this.getList()
|
|
|
this.getFunctionList()
|
|
|
console.log(this.fun)
|
|
|
// this.func=this.fun
|
|
@@ -251,7 +251,7 @@ export default {
|
|
|
// this.$refs.dataTable.clearSelection()
|
|
|
this.func = val
|
|
|
this.getList()
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
// func(val,oldval){
|
|
|
// if(val!=oldval){
|
|
@@ -261,20 +261,23 @@ export default {
|
|
|
// }
|
|
|
},
|
|
|
methods: {
|
|
|
- toggleSelection(rows) {
|
|
|
- console.log(rows)
|
|
|
- if (rows) {
|
|
|
- rows.forEach(row => {
|
|
|
- console.log(row)
|
|
|
- this.$refs.dataTable.toggleRowSelection(row);
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$refs.multipleTable.clearSelection();
|
|
|
- }
|
|
|
- },
|
|
|
- handleSelectionChange(val) {
|
|
|
- this.multipleSelection = val;
|
|
|
- },
|
|
|
+ // toggleSelection(rows) {
|
|
|
+ // console.log(rows)
|
|
|
+ // if (rows) {
|
|
|
+ // this.$nextTick(()=>{
|
|
|
+ // rows.forEach(row => {
|
|
|
+ // console.log(row)
|
|
|
+ // this.$refs.dataTable.toggleRowSelection(row);
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+
|
|
|
+ // } else {
|
|
|
+ // this.$refs.multipleTable.clearSelection();
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // handleSelectionChange(val) {
|
|
|
+ // this.multipleSelection = val;
|
|
|
+ // },
|
|
|
changeData(selection,row){
|
|
|
if (selection.length > 1) {
|
|
|
const del_row = selection.shift()
|
|
@@ -402,17 +405,23 @@ export default {
|
|
|
this.queryParams.current = val;
|
|
|
this.getList();
|
|
|
},
|
|
|
- async getList() {
|
|
|
+ getList() {
|
|
|
+ this.times+=1
|
|
|
this.loading = true
|
|
|
this.queryParams.functionId = this.func.fun.id
|
|
|
console.log(this.queryParams)
|
|
|
this.$api.getDataList(this.queryParams).then(response => {
|
|
|
this.tableData = response.data
|
|
|
+
|
|
|
+ this.$nextTick(()=>{
|
|
|
+ if(this.func.permission){
|
|
|
console.log(this.func)
|
|
|
- // rows.forEach(row => {
|
|
|
- // this.$refs.multipleTable.toggleRowSelection(row);
|
|
|
- // });
|
|
|
- this.toggleSelection([this.tableData[1]])
|
|
|
+ // this.toggleSelection([this.func.permission])
|
|
|
+ this.$refs.dataTable.toggleRowSelection(this.tableData.find(item=>{
|
|
|
+ return this.func.permission.id == item.id;
|
|
|
+ }),true)
|
|
|
+ }
|
|
|
+ })
|
|
|
console.log(response.data)
|
|
|
this.loading = false
|
|
|
}).catch(error => {
|