字典接口
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',
|
||||
method: 'post',
|
||||
data: params,
|
||||
header: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ export default (options = {}) => {
|
||||
...options.data,
|
||||
},
|
||||
header: {
|
||||
'Content-Type': 'application/json;charset=UTF-8',
|
||||
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
// 'Content-Type': 'application/json;charset=UTF-8',
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
Authorization: '12',
|
||||
...options.header,
|
||||
},
|
||||
|
||||
@@ -28,6 +28,7 @@ import ZhuanZhi from "./comp/indexZhuanZhi.vue";
|
||||
import YouKe from "./comp/indexYouKe.vue";
|
||||
import list from '../../common/js/list'
|
||||
import { getProjectList } from '../../common/api/project'
|
||||
import { queryDictData } from '../../common/api/dictionary'
|
||||
export default {
|
||||
mixins: [list],
|
||||
components: {
|
||||
@@ -177,6 +178,7 @@ export default {
|
||||
console.log(this.store);
|
||||
}
|
||||
this.getProjectList()
|
||||
this.queryDictData()
|
||||
},
|
||||
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) {
|
||||
this.init()
|
||||
|
||||
Reference in New Issue
Block a user