线路数据设置归属项目管理项目数据通过接口查询

This commit is contained in:
fan 2023-04-27 09:23:21 +08:00
parent f2039927db
commit a373d21deb
2 changed files with 11 additions and 10 deletions

View File

@ -32,7 +32,7 @@
<script>
import { setMapProject } from '@/api/jmap/map';
import { ProjectList } from '@/scripts/ProjectConfig';
import { getBackProjectConfigList } from '@/api/projectConfig';
export default {
name: 'SetMapProject',
data() {
@ -54,6 +54,15 @@ export default {
options: []
};
},
mounted() {
getBackProjectConfigList().then(resp => {
if (resp.data && resp.data.length > 0) {
this.options = resp.data;
}
}).catch(error => {
console.log(error);
});
},
methods: {
doShow(row) {
this.dialogVisible = true;
@ -62,10 +71,6 @@ export default {
this.formModel.cityCode = row.cityCode;
this.formModel.project = row.project;
this.formModel.projectCode = row.project ? row.projectCode : '';
this.options = [];
ProjectList.forEach(item => {
this.options.push({label: item.label, value: item.value.toUpperCase()});
});
},
doSave() {
this.$refs['form'].validate((valid) => {

View File

@ -90,11 +90,7 @@ export default {
getBackProjectConfigList().then(resp => {
if (resp.data && resp.data.length > 0) {
resp.data.forEach(each=>{
if (each.label == '') {
this.projectMap[each.value] = {label:'默认', value:'DEFAULT'};
} else {
this.projectMap[each.value] = each;
}
this.projectMap[each.value] = each;
});
this.queryForm.queryObject.project.config.data = Object.values(this.projectMap);
}