|
@@ -7,12 +7,10 @@
|
|
|
</el-row>
|
|
|
<el-dialog title="菜单信息管理" width="40%" :visible.sync="dialog" @closed="handleClose" :destroy-on-close="true">
|
|
|
<data-form :data="form" :fields="formfields" :rules="rules" @save="toSave">
|
|
|
- <template #custom="{item}">
|
|
|
- <template v-if="item.model == 'menus'">
|
|
|
- <el-checkbox-group v-model="menus">
|
|
|
- <el-checkbox v-for="(i, index) in menuList" :key="index" :label="i">{{ i.title }}</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
- </template>
|
|
|
+ <template #custom="{item, form}">
|
|
|
+ <el-checkbox-group v-model="form.menus">
|
|
|
+ <el-checkbox v-for="(i, index) in menuList" :key="index" :label="i.id">{{ i.title }}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
</template>
|
|
|
</data-form>
|
|
|
</el-dialog>
|
|
@@ -24,6 +22,8 @@ import dataTable from '@common/src/components/frame/filter-page-table.vue';
|
|
|
import dataForm from '@common/src/components/frame/form.vue';
|
|
|
import { iconmenu } from '@common/src/util/iconmenu';
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+const { mapActions: adminLogin } = createNamespacedHelpers('adminLogin');
|
|
|
+const { mapActions: menu } = createNamespacedHelpers('menu');
|
|
|
export default {
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -43,12 +43,24 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
fields: [
|
|
|
+ { label: '机构代码或邀请码', prop: 'code' },
|
|
|
{ label: '用户名', prop: 'name' },
|
|
|
+ { label: '联系电话', prop: 'phone' },
|
|
|
{ label: '机构名称', prop: 'deptname' },
|
|
|
],
|
|
|
list: [
|
|
|
{
|
|
|
- name: '年',
|
|
|
+ name: 'sadas',
|
|
|
+ menus: [
|
|
|
+ {
|
|
|
+ id: '1',
|
|
|
+ title: '菜单一',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: '2',
|
|
|
+ title: '菜单二',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
],
|
|
|
total: 0,
|
|
@@ -59,60 +71,49 @@ export default {
|
|
|
{ label: '机构名称', model: 'deptname' },
|
|
|
{ label: '权限', model: 'menus', custom: true },
|
|
|
],
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+ menus: [],
|
|
|
+ },
|
|
|
rules: {},
|
|
|
// 菜单列表
|
|
|
menuList: [
|
|
|
{
|
|
|
- icon: 'el-icon-s-home',
|
|
|
- index: 'menu',
|
|
|
- title: '菜单管理',
|
|
|
+ id: '1',
|
|
|
+ title: '菜单一',
|
|
|
},
|
|
|
{
|
|
|
- icon: 'el-icon-s-home',
|
|
|
- index: 'gly',
|
|
|
- title: '管理员管理',
|
|
|
+ id: '2',
|
|
|
+ title: '菜单二',
|
|
|
},
|
|
|
{
|
|
|
- icon: 'el-icon-s-home',
|
|
|
- index: 'jg',
|
|
|
- title: '机构管理员',
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'el-icon-s-home',
|
|
|
- index: 'yw',
|
|
|
- title: '业务管理员',
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'el-icon-s-home',
|
|
|
- index: 'qx',
|
|
|
- title: '权限管理',
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'el-icon-s-home',
|
|
|
- index: 'user',
|
|
|
- title: '用户管理',
|
|
|
+ id: '3',
|
|
|
+ title: '菜单三',
|
|
|
},
|
|
|
],
|
|
|
- menus: [],
|
|
|
};
|
|
|
},
|
|
|
async created() {
|
|
|
+ await this.searchOther();
|
|
|
await this.search();
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...adminLogin(['query']),
|
|
|
+ ...menu({ menuQuery: 'query' }),
|
|
|
// 查询列表
|
|
|
- search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
- console.log('列表');
|
|
|
+ async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
|
+ let res = await this.query({ skip, limit, ...info });
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ // this.$set(this, `list`, res.data);
|
|
|
+ // this.$set(this, `total`, res.total);
|
|
|
+ }
|
|
|
},
|
|
|
// 分配权限
|
|
|
toEdit({ data }) {
|
|
|
this.dialog = true;
|
|
|
- console.log('分配权限');
|
|
|
+ this.$set(this, 'form', { ...data, menus: data.menus.map(i => i.id) });
|
|
|
},
|
|
|
// 提交分配
|
|
|
toSave({ data }) {
|
|
|
- data.menus = this.menus;
|
|
|
console.log(data);
|
|
|
},
|
|
|
// 取消添加
|
|
@@ -121,6 +122,13 @@ export default {
|
|
|
this.dialog = false;
|
|
|
this.search();
|
|
|
},
|
|
|
+ // 查询其他信息
|
|
|
+ async searchOther() {
|
|
|
+ let res = await this.menuQuery();
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
+ // this.$set(this, `menuList`, res.data);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['user']),
|