字典接口
This commit is contained in:
12
common/api/dictionary.js
Normal file
12
common/api/dictionary.js
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import request from '../js/request';
|
||||||
|
import config from '../js/config';
|
||||||
|
|
||||||
|
export function queryDictData(dictType) {
|
||||||
|
return request({
|
||||||
|
url: '/dict/queryDictData',
|
||||||
|
method: 'post',
|
||||||
|
data: {
|
||||||
|
dictType,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -18,5 +18,8 @@ export function getProjectList (params) {
|
|||||||
url: '/project/queryProject',
|
url: '/project/queryProject',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params,
|
data: params,
|
||||||
|
header: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ export default (options = {}) => {
|
|||||||
...options.data,
|
...options.data,
|
||||||
},
|
},
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json;charset=UTF-8',
|
// 'Content-Type': 'application/json;charset=UTF-8',
|
||||||
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||||
Authorization: '12',
|
Authorization: '12',
|
||||||
...options.header,
|
...options.header,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import ZhuanZhi from "./comp/indexZhuanZhi.vue";
|
|||||||
import YouKe from "./comp/indexYouKe.vue";
|
import YouKe from "./comp/indexYouKe.vue";
|
||||||
import list from '../../common/js/list'
|
import list from '../../common/js/list'
|
||||||
import { getProjectList } from '../../common/api/project'
|
import { getProjectList } from '../../common/api/project'
|
||||||
|
import { queryDictData } from '../../common/api/dictionary'
|
||||||
export default {
|
export default {
|
||||||
mixins: [list],
|
mixins: [list],
|
||||||
components: {
|
components: {
|
||||||
@@ -177,6 +178,7 @@ export default {
|
|||||||
console.log(this.store);
|
console.log(this.store);
|
||||||
}
|
}
|
||||||
this.getProjectList()
|
this.getProjectList()
|
||||||
|
this.queryDictData()
|
||||||
},
|
},
|
||||||
getProjectList() {
|
getProjectList() {
|
||||||
getProjectList({
|
getProjectList({
|
||||||
@@ -194,7 +196,20 @@ export default {
|
|||||||
}
|
}
|
||||||
})]
|
})]
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
queryDictData() {
|
||||||
|
queryDictData('projectType').then(res => {
|
||||||
|
this.projectType = [{
|
||||||
|
text: '全部类型',
|
||||||
|
value: ''
|
||||||
|
}, ...res.data.map(item => {
|
||||||
|
return {
|
||||||
|
text: item.anotherName,
|
||||||
|
value: item.id
|
||||||
|
}
|
||||||
|
})]
|
||||||
|
})
|
||||||
|
},
|
||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.init()
|
this.init()
|
||||||
|
|||||||
Reference in New Issue
Block a user