|
@@ -10,7 +10,7 @@
|
|
|
<detailTop @goBack="goBack"></detailTop>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="info">
|
|
|
- <characterForm :ruleForm="ruleForm" :meunroles="meunroles" @submitForm="submitForm" @resetForm="resetForm"></characterForm>
|
|
|
+ <characterForm :ruleForm="ruleForm" :rolesList="rolesList" @submitForm="submitForm" @resetForm="resetForm"></characterForm>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -38,8 +38,13 @@ export default {
|
|
|
topTitle: '用户信息管理',
|
|
|
ruleForm: {
|
|
|
passwd: '123456',
|
|
|
+ roles: [],
|
|
|
},
|
|
|
- meunroles: [],
|
|
|
+ rolesList: [
|
|
|
+ {
|
|
|
+ name: '10',
|
|
|
+ },
|
|
|
+ ],
|
|
|
}),
|
|
|
created() {
|
|
|
this.searchInfo();
|
|
@@ -52,17 +57,24 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...character(['query', 'fetch', 'update', 'create']),
|
|
|
- ...menurole({ rolequery: 'query' }),
|
|
|
+ ...menurole({ rolequery: 'query', rolesFetch: 'fetch' }),
|
|
|
async searchInfo() {
|
|
|
if (this.id) {
|
|
|
const res = await this.fetch(this.id);
|
|
|
- this.$set(this, `ruleForm`, res.data);
|
|
|
+ if (`${res.errcode}` === '0') {
|
|
|
+ this.$set(this, `ruleForm`, res.data);
|
|
|
+ } else {
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
async searchRole() {
|
|
|
const res = await this.rolequery();
|
|
|
- this.$set(this, `meunroles`, res.data);
|
|
|
- console.log(res.data);
|
|
|
+ if (`${res.errcode}` === '0') {
|
|
|
+ this.$set(this, `rolesList`, res.data);
|
|
|
+ } else {
|
|
|
+ this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
+ }
|
|
|
},
|
|
|
// 提交
|
|
|
async submitForm({ data }) {
|