Commit 89674a18 by caoyanzhi

update: 接口联调

parent fade0c9d
......@@ -20,8 +20,10 @@
<script>
import fetch from '@/api/dictionary';
import userApi from '@/api';
const { saveDict, dictDetail } = fetch;
const { getUserInfo } = userApi;
export default {
name: 'CreateDictionary',
data() {
......@@ -33,7 +35,9 @@ export default {
dictKey: '',
dictDesc: '',
dictContent: '',
dictId: ''
dictId: '',
optUserId: '',
optUserName: ''
},
dictRule: {
dictName: [ { required: true, message: '请输入字典名称', trigger: 'blur' } ],
......@@ -50,9 +54,16 @@ export default {
} else {
this.bread.push({ name: '新建字典' });;
}
this.getUserInfo();
this.$emit('updateBread', this.bread);
},
methods: {
getUserInfo() {
getUserInfo().then(res => {
const { id, realName } = res.result;
Object.assign(this.dictData, { optUserId: id, optUserName: realName });
});
},
// 编辑字典时获取字典数据
getDictDetail(dictId) {
dictDetail({ dictId }).then(res => {
......@@ -64,8 +75,8 @@ export default {
onSave() {
this.$refs.dictData.validate(vali => {
if (!vali) return;
const { dictName, dictKey, dictDesc, dictContent, dictId } = this.dictData;
const params = { dictName, dictKey, dictDesc, dictContent };
const { dictName, dictKey, dictDesc, dictContent, dictId, optUserId, optUserName } = this.dictData;
const params = { dictName, dictKey, dictDesc, dictContent, optUserId, optUserName };
this.loading = true;
if (dictId) {
Object.assign(params, { dictId });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment