自动信号接口修改

This commit is contained in:
joylink_cuiweidong 2019-12-10 18:01:52 +08:00
parent f6e0221b88
commit 98c7e1105f
3 changed files with 55 additions and 12 deletions

View File

@ -231,7 +231,7 @@ export function updateRouting(data) {
});
}
// 创建自动信号
// 创建自动信号 old旧数据
export function postAutoSignal(data) {
return request({
url: `/api/mapBuild/autoSignal`,
@ -240,7 +240,7 @@ export function postAutoSignal(data) {
});
}
// 删除自动信号
// 删除自动信号 old旧数据
export function delAutoSignal(autoSignalId) {
return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`,
@ -248,7 +248,7 @@ export function delAutoSignal(autoSignalId) {
});
}
// 删除自动信号
// 分页获取自动信号列表 old旧数据
export function getAutoSignalList(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/autoSignal`,
@ -257,7 +257,7 @@ export function getAutoSignalList(mapId, params) {
});
}
// 获取自动信号
// 获取自动信号详情 old旧数据
export function getAutoSignalDetail(autoSignalId) {
return request({
url: `/api/mapBuild/autoSignal/${autoSignalId}`,
@ -265,7 +265,7 @@ export function getAutoSignalDetail(autoSignalId) {
});
}
// 更新自动信号
// 更新自动信号 old旧数据
export function putAutoSignal(data) {
return request({
url: `/api/mapBuild/autoSignal/${data.autoSignalId}`,
@ -274,6 +274,49 @@ export function putAutoSignal(data) {
});
}
// 分页获取自动信号列表 new新数据
export function getAutoSignalListNew(mapId, params) {
return request({
url: `/api/mapBuild/${mapId}/autoSignalNew`,
method: 'get',
params
});
}
// 删除自动信号 new新数据
export function delAutoSignalNew(autoSignalId) {
return request({
url: `/api/mapBuild/autoSignalNew/${autoSignalId}`,
method: 'delete'
});
}
// 获取自动信号详情 new新数据
export function getAutoSignalDetailNew(autoSignalId) {
return request({
url: `/api/mapBuild/autoSignalNew/${autoSignalId}`,
method: 'get'
});
}
// 创建自动信号 new新数据
export function postAutoSignalNew(data) {
return request({
url: `/api/mapBuild/autoSignalNew`,
method: 'post',
data: data
});
}
// 更新自动信号 new新数据
export function putAutoSignalNew(data) {
return request({
url: `/api/mapBuild/autoSignalNew/${data.autoSignalId}`,
method: 'put',
data: data
});
}
export function getListByCityCode(cityCode) {
return request({
url: `/api/mapBuild/${cityCode}/list`,

View File

@ -14,7 +14,7 @@
<script>
import { mapGetters } from 'vuex';
import { listMap } from '@/api/jmap/mapdraft';
import { getAutoSignalList, delAutoSignal, getAutoSignalDetail } from '@/api/jmap/mapdraft';
import { getAutoSignalListNew, delAutoSignalNew, getAutoSignalDetailNew } from '@/api/jmap/mapdraft';
export default {
name: 'RouteDetail',
@ -138,7 +138,7 @@ export default {
},
queryFunction(params) {
if (this.mapInfo && this.mapInfo.id) {
return getAutoSignalList(this.mapInfo.id, params);
return getAutoSignalListNew(this.mapInfo.id, params);
}
},
acquireMapList() {
@ -162,7 +162,7 @@ export default {
return data;
},
editObj(index, row) {
getAutoSignalDetail(row.id).then(response => {
getAutoSignalDetailNew(row.id).then(response => {
const data = response.data;
this.$emit('autoMaticoSelected', data);
this.doClose();
@ -171,7 +171,7 @@ export default {
deleteObj(index, row) {
if (this.mapInfo && this.mapInfo.id && row) {
//
delAutoSignal(row.id).then(response => {
delAutoSignalNew(row.id).then(response => {
this.$message.success(this.$t('map.successfullyDelete'));
this.reloadTable();
}).catch(() => {

View File

@ -71,7 +71,7 @@
<script>
import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid';
import { postAutoSignal, putAutoSignal } from '@/api/jmap/mapdraft';
import { postAutoSignalNew, putAutoSignalNew } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic';
import { formatName } from '@/utils/runPlan';
@ -176,7 +176,7 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
postAutoSignal(this.buildModel(getUID('autoSingle'))).then(resp => {
postAutoSignalNew(this.buildModel(getUID('autoSingle'))).then(resp => {
this.$message.success(this.$t('map.automaticSignalSuccessful'));
this.loading = false;
this.clear();
@ -191,7 +191,7 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
this.loading = true;
putAutoSignal(this.buildModel()).then(resp => {
putAutoSignalNew(this.buildModel()).then(resp => {
this.$message.success(this.$t('map.automaticSignalUpdateSucceeded'));
this.loading = false;
this.clear();