发布地图管理编辑信息添加数据版本

This commit is contained in:
fan 2020-11-25 10:28:47 +08:00
parent 31c0a1f466
commit dad52de123
2 changed files with 25 additions and 3 deletions

View File

@ -250,4 +250,10 @@ export function getPassengerHistoryList(group) {
method: 'get'
});
}
/** 查询地图数据版本list */
export function getVersionList(mapId) {
return request({
url: `/api/map/${mapId}/dataVersions`,
method: 'get'
});
}

View File

@ -11,6 +11,7 @@
</template>
<script>
import { getVersionList } from '@/api/jmap/map';
export default {
name: 'PublishMapDraft',
props: {
@ -20,11 +21,13 @@ export default {
dialogVisible: false,
cityList: [],
lineCodeList: [],
versionList: [],
formModel: {
mapId: '',
cityCode: '',
name: '',
lineCode: ''
lineCode: '',
version: ''
}
};
},
@ -35,7 +38,8 @@ export default {
items: [
{ prop: 'name', label: this.$t('publish.mapName'), type: 'text', required: true },
{ prop: 'cityCode', label: this.$t('publish.city'), type: 'select', required: true, options: this.cityList },
{ prop: 'lineCode', label: '线路类型', type: 'select', required: true, options: this.lineCodeList }
{ prop: 'lineCode', label: '线路类型', type: 'select', required: true, options: this.lineCodeList },
{ prop: 'version', label: '数据版本', type: 'select', required: true, options: this.versionList}
]
};
return form;
@ -51,6 +55,9 @@ export default {
],
lineCode: [
{ required: true, message: '请选择线路类型', trigger: 'change' }
],
version: [
{ required: true, message: '请选择数据版本', trigger: 'change'}
]
};
return crules;
@ -64,7 +71,16 @@ export default {
this.cityList = cityList;
this.lineCodeList = lineCodeList;
this.formModel.cityCode = row.cityCode;
this.formModel.version = row.version + '';
this.dialogVisible = true;
this.versionList = [];
getVersionList(row.id).then(resp => {
(resp.data || []).forEach(item => {
this.versionList.push({label: item, value: item});
});
}).catch(error => {
this.$message.error('获取数据版本列表失败!');
});
},
doCreate() {
const self = this;