|
@@ -7,6 +7,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<data-table
|
|
|
+ v-if="!loading"
|
|
|
:fields="fields"
|
|
|
:data="list"
|
|
|
:opera="opera"
|
|
@@ -18,11 +19,6 @@
|
|
|
@unfreeze="data => toStatus(data, '1')"
|
|
|
@toRoleMenu="toRoleMenu"
|
|
|
>
|
|
|
- <template #options="{item}">
|
|
|
- <template v-if="item.prop === 'type'">
|
|
|
- <el-option v-for="(i, index) in roleList" :key="`role-${index}`" :label="i.name" :value="i.type"></el-option>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
<template #custom="{item,row}">
|
|
|
<template v-if="item.prop === 'openid'">
|
|
|
<span :style="{ color: `${row[item.prop] ? '#67C23A' : '#F56C6C'}` }">{{ row[item.prop] ? '已绑定' : '未绑定' }}</span>
|
|
@@ -143,6 +139,7 @@ export default {
|
|
|
label: 'title',
|
|
|
},
|
|
|
selectUser: {},
|
|
|
+ loading: true,
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -156,10 +153,12 @@ export default {
|
|
|
// 查找角色
|
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
const res = await this.query({ skip, limit, ...info });
|
|
|
+ this.loading = true;
|
|
|
if (this.$checkRes(res)) {
|
|
|
this.$set(this, `list`, res.data);
|
|
|
this.$set(this, `total`, res.total);
|
|
|
}
|
|
|
+ this.loading = false;
|
|
|
},
|
|
|
//编辑角色
|
|
|
toEdit({ data }) {
|
|
@@ -178,6 +177,8 @@ export default {
|
|
|
}
|
|
|
if (this.$checkRes(res, `操作成功`, res.errmsg || '操作失败')) {
|
|
|
this.toClose();
|
|
|
+ // const index = this.list.findIndex(f => f._id === _id);
|
|
|
+ // if (index >= 0) this.$set(this.list, index, data);
|
|
|
this.search();
|
|
|
}
|
|
|
},
|