|
@@ -12,6 +12,7 @@
|
|
<data-table
|
|
<data-table
|
|
:fields="fields"
|
|
:fields="fields"
|
|
:opera="opera"
|
|
:opera="opera"
|
|
|
|
+ :vOpera="false"
|
|
:data="list"
|
|
:data="list"
|
|
@query="search"
|
|
@query="search"
|
|
:total="total"
|
|
:total="total"
|
|
@@ -38,8 +39,8 @@ import btn1 from '@/layout/btn-1.vue';
|
|
import search1 from './parts/search-1.vue';
|
|
import search1 from './parts/search-1.vue';
|
|
import form1 from './parts/form-1.vue';
|
|
import form1 from './parts/form-1.vue';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
-// const { mapActions } = createNamespacedHelpers('role');
|
|
|
|
-// const { mapActions: menu } = createNamespacedHelpers('menus');
|
|
|
|
|
|
+const { mapActions } = createNamespacedHelpers('role');
|
|
|
|
+const { mapActions: menu } = createNamespacedHelpers('menus');
|
|
// const { mapActions: sysdictdata } = createNamespacedHelpers('dictData');
|
|
// const { mapActions: sysdictdata } = createNamespacedHelpers('dictData');
|
|
export default {
|
|
export default {
|
|
name: 'index',
|
|
name: 'index',
|
|
@@ -53,11 +54,11 @@ export default {
|
|
{ label: '删除', method: 'del', confirm: true, type: 'danger' },
|
|
{ label: '删除', method: 'del', confirm: true, type: 'danger' },
|
|
],
|
|
],
|
|
fields: [
|
|
fields: [
|
|
- { label: '角色名称', prop: 'name' },
|
|
|
|
- { label: '角色代码', prop: 'code' },
|
|
|
|
|
|
+ { label: '角色名称', model: 'name' },
|
|
|
|
+ { label: '角色代码', model: 'code' },
|
|
{
|
|
{
|
|
label: '角色状态',
|
|
label: '角色状态',
|
|
- prop: 'status',
|
|
|
|
|
|
+ model: 'status',
|
|
format: (i) => (i === '0' ? '使用' : '停用'),
|
|
format: (i) => (i === '0' ? '使用' : '停用'),
|
|
},
|
|
},
|
|
],
|
|
],
|
|
@@ -82,17 +83,18 @@ export default {
|
|
await this.search();
|
|
await this.search();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- // ...menu({ menuQuery: 'query' }),
|
|
|
|
|
|
+ ...menu({ menuQuery: 'query' }),
|
|
// ...sysdictdata({ sQuery: 'query' }),
|
|
// ...sysdictdata({ sQuery: 'query' }),
|
|
- // ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
|
|
|
|
+ ...mapActions(['query', 'fetch', 'create', 'update', 'delete']),
|
|
// 查询
|
|
// 查询
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
async search({ skip = 0, limit = 10, ...info } = {}) {
|
|
const condition = _.cloneDeep(this.searchForm);
|
|
const condition = _.cloneDeep(this.searchForm);
|
|
- // let res = await this.query({ skip, limit, ...condition, ...info });
|
|
|
|
- // if (this.$checkRes(res)) {
|
|
|
|
- // this.$set(this, `list`, res.data);
|
|
|
|
- // this.$set(this, `total`, res.total);
|
|
|
|
- // }
|
|
|
|
|
|
+ let res = await this.query({ skip, limit, ...condition, ...info });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `list`, res.data);
|
|
|
|
+ this.$set(this, `total`, res.total);
|
|
|
|
+ }
|
|
|
|
+ console.log(this.list);
|
|
},
|
|
},
|
|
// 新增
|
|
// 新增
|
|
toAdd() {
|
|
toAdd() {
|
|
@@ -143,11 +145,11 @@ export default {
|
|
},
|
|
},
|
|
// 查询其他信息
|
|
// 查询其他信息
|
|
async searchOther() {
|
|
async searchOther() {
|
|
- // let res = await this.menuQuery({ status: '0' });
|
|
|
|
- // if (this.$checkRes(res)) {
|
|
|
|
- // let data = res.data;
|
|
|
|
- // this.$set(this, `menuList`, res.data);
|
|
|
|
- // }
|
|
|
|
|
|
+ let res = await this.menuQuery({ status: '0' });
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ let data = res.data;
|
|
|
|
+ this.$set(this, `menuList`, res.data);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|