From 90c0598af73f776bb2ad4899c3d2db575a7b71e4 Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Mon, 9 Dec 2019 15:35:57 +0800
Subject: [PATCH 1/8] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2=E4=BB=A3?=
=?UTF-8?q?=E7=A0=81=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/store/index.js | 4 ++-
src/store/modules/order.js | 28 ++++++++++++++++++++
src/views/orderauthor/order/addGoods.vue | 33 +++++++++++++++++++-----
src/views/orderauthor/order/draft.vue | 5 ++++
4 files changed, 62 insertions(+), 8 deletions(-)
create mode 100644 src/store/modules/order.js
diff --git a/src/store/index.js b/src/store/index.js
index 4dec2dc70..6feaf3b5f 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -14,6 +14,7 @@ import runPlan from './modules/runplan';
import socket from './modules/socket';
import scriptRecord from './modules/scriptRecord';
import ibp from './modules/ibp';
+import order from './modules/order';
import getters from './getters';
@@ -34,7 +35,8 @@ const store = new Vuex.Store({
runPlan,
socket,
scriptRecord,
- ibp
+ ibp,
+ order
},
getters
});
diff --git a/src/store/modules/order.js b/src/store/modules/order.js
new file mode 100644
index 000000000..b85a0ddf6
--- /dev/null
+++ b/src/store/modules/order.js
@@ -0,0 +1,28 @@
+/**
+ * 实训状态数据
+ */
+const order = {
+ namespaced: true,
+ state: {
+ orderList: [] // 选中的商品列表,
+ },
+ getters: {
+ orderList: (state)=>{
+ return state.orderList;
+ }
+ },
+ mutations: {
+ setOrderList: (state, orderList) => {
+ state.orderList = orderList;
+ }
+ },
+ actions: {
+ /**
+ * 设置选中的商品列表
+ */
+ setOrderList: ({ commit }, orderList) => {
+ commit('setOrderList', orderList);
+ }
+ }
+};
+export default order;
diff --git a/src/views/orderauthor/order/addGoods.vue b/src/views/orderauthor/order/addGoods.vue
index 3a50fff64..2338682c5 100644
--- a/src/views/orderauthor/order/addGoods.vue
+++ b/src/views/orderauthor/order/addGoods.vue
@@ -122,19 +122,38 @@ export default {
name: this.$t('global.append'),
handleClick: this.handlePut,
type: '',
- showControl: (row) => { return !row.isPut; }
+ showControl: (row) => {
+ const orderList = this.$store.state.order.orderList;
+ if (orderList.length > 0) {
+ const order = orderList.find(item=>{ return item.goodsId == row.id; });
+ if (order) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return !row.isPut;
+ }
+ }
},
{
name: this.$t('global.delete'),
handleClick: this.handlePop,
type: 'warning',
- showControl: (row) => { return row.isPut; }
+ showControl: (row) => {
+ const orderList = this.$store.state.order.orderList;
+ if (orderList.length > 0) {
+ const order = orderList.find(item=>{ return item.goodsId == row.id; });
+ if (order) {
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return row.isPut;
+ }
+ }
}
- // {
- // name: this.$t('orderAuthor.select'),
- // type: 'primary',
- // handleClick: this.handleAdd
- // }
]
}
],
diff --git a/src/views/orderauthor/order/draft.vue b/src/views/orderauthor/order/draft.vue
index f943bf7eb..76969a3d4 100644
--- a/src/views/orderauthor/order/draft.vue
+++ b/src/views/orderauthor/order/draft.vue
@@ -318,12 +318,15 @@ export default {
'goodsPrice':row.price
};
this.formModel.detailCreateVOList.push(data);
+ this.$store.dispatch('order/setOrderList', this.formModel.detailCreateVOList);
},
removeGoods(data) {
this.formModel.detailCreateVOList = this.formModel.detailCreateVOList.filter(({ goodsId }) => goodsId !== data.goodsId);
+ this.$store.dispatch('order/setOrderList', this.formModel.detailCreateVOList);
},
deleteGoods(index, row) {
this.formModel.detailCreateVOList = this.formModel.detailCreateVOList.filter(({ goodsId }) => goodsId !== row.id);
+ this.$store.dispatch('order/setOrderList', this.formModel.detailCreateVOList);
},
initLoadPage() {
// 加载字典数据
@@ -519,6 +522,7 @@ export default {
this.loading = true;
createOrder(this.buildModel()).then(response => {
this.turnback();
+ this.$store.dispatch('order/setOrderList', []);
this.loading = false;
this.$message.success(this.$t('tip.creatingSuccessful'));
}).catch(() => {
@@ -542,6 +546,7 @@ export default {
});
},
turnback() {
+ this.$store.dispatch('order/setOrderList', []);
this.$router.go(-1);
}
}
From b7fd5b7475000d6ceb1e6d2f3827ebe94e5441bd Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Mon, 9 Dec 2019 16:52:01 +0800
Subject: [PATCH 2/8] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=E4=BB=A3=E7=A0=81=E8=B0=83?=
=?UTF-8?q?=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/management/goods.js | 7 ++
src/views/orderauthor/order/detail.vue | 108 +++++++++----------------
src/views/orderauthor/order/list.vue | 23 +++---
3 files changed, 57 insertions(+), 81 deletions(-)
diff --git a/src/api/management/goods.js b/src/api/management/goods.js
index 245f16864..ae1a9ff6a 100644
--- a/src/api/management/goods.js
+++ b/src/api/management/goods.js
@@ -148,3 +148,10 @@ export function postCreatePackage(data) {
data: data
});
}
+// 获取订单对应的商品列表
+export function getGoodsListByOrderId(id) {
+ return request({
+ url: `/api/order/${id}`,
+ method: 'get'
+ });
+}
diff --git a/src/views/orderauthor/order/detail.vue b/src/views/orderauthor/order/detail.vue
index 33413e6fe..3d6b83434 100644
--- a/src/views/orderauthor/order/detail.vue
+++ b/src/views/orderauthor/order/detail.vue
@@ -1,89 +1,61 @@
-
-
-
-
-
+
+
+
+
+
+ {{ scope.row.forever?'是':'否' }}
+
+
+
+
+
+
+
+
+ {{ scope.row.forever?'/':scope.row.monthAmount }}
+
+
+
diff --git a/src/views/newMap/newMapdraft/mapoperate/switch.vue b/src/views/newMap/newMapdraft/mapoperate/switch.vue
index f3b0e4eb3..7012a1381 100644
--- a/src/views/newMap/newMapdraft/mapoperate/switch.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/switch.vue
@@ -479,53 +479,55 @@ export default {
const models = [];
const switchList = [...this.switchList, ...list];
if (list && list.length && sectionLists && sectionLists.length) {
- const sectionList = [];
- const addSectionList = [];
+ const sectionList = []; const addSectionList = []; const switchSectionList = [];
list.forEach(elem => {
const sectionb = this.findSectionData(sectionLists, elem.sectionBCode);
const sectiona = this.findSectionData(sectionLists, elem.sectionACode);
const sectionc = this.findSectionData(sectionLists, elem.sectionCCode);
const parentSectionModel = this.$store.getters['map/getDeviceByCode'](sectiona.parentCode);
if (!parentSectionModel) { // 找不到父元素删除
- let uid;
- if (!elem['uid']) {
- uid = getUID('T', [...this.sectionList, ...addSectionList]);
- elem['uid'] = uid;
+ if (switchSectionList.indexOf(elem.code) == -1) {
+ let uid;
+ if (!elem['uid']) {
+ uid = getUID('T', [...this.sectionList, ...addSectionList]);
+ elem['uid'] = uid;
+ }
+ addSectionList.push({ code: elem.uid });
+ sectiona.parentCode = elem['uid'];
+ sectionb.parentCode = elem['uid'];
+ sectionc.parentCode = elem['uid'];
+ elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode];
+ sectionList.push(elem);
+ switchList.forEach(ele => {
+ const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
+ const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
+ const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
+ if (sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
+ ele['uid'] = uid;
+ elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
+ sectiona1.parentCode = uid;
+ sectionb1.parentCode = uid;
+ sectionc1.parentCode = uid;
+ switchSectionList.push(ele.code);
+ sectionList.forEach((item, index) => {
+ if (item.code == ele.code) {
+ sectionList.splice(index, 1);
+ }
+ });
+ }
+ // if (sectiona1.points[sectiona1.points.length - 1].x == sectiona.points[0].x && sectiona1.points[sectiona1.points.length - 1].y == sectiona.points[0].y) {
+ // elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
+ // sectiona1.parentCode = uid;
+ // sectionb1.parentCode = uid;
+ // sectionc1.parentCode = uid;
+ // sectionList.forEach((item, index) => {
+ // if (item.code == elem.code) {
+ // sectionList.splice(index, 1);
+ // }
+ // });
+ // }
+ });
}
- addSectionList.push({ code: elem.uid });
- sectiona.parentCode = elem['uid'];
- sectionb.parentCode = elem['uid'];
- sectionc.parentCode = elem['uid'];
- elem['relevanceSectionList'] = elem['relevanceSectionList'] || [elem.sectionACode, elem.sectionBCode, elem.sectionCCode];
- sectionList.push(elem);
- switchList.forEach(ele => {
- const sectiona1 = this.findSectionData(sectionLists, ele.sectionACode);
- const sectionc1 = this.findSectionData(sectionLists, ele.sectionCCode);
- const sectionb1 = this.findSectionData(sectionLists, ele.sectionBCode);
- if (sectionb1.points[sectionb1.points.length - 1].x == sectionb.points[0].x && sectionb1.points[sectionb1.points.length - 1].y == sectionb.points[0].y) {
- ele['uid'] = uid;
- elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
- sectiona1.parentCode = uid;
- sectionb1.parentCode = uid;
- sectionc1.parentCode = uid;
- sectionList.forEach((item, index) => {
- if (item.code == elem.code) {
- sectionList.splice(index, 1);
- }
- });
- }
- if (sectiona1.points[sectiona1.points.length - 1].x == sectiona.points[0].x && sectiona1.points[sectiona1.points.length - 1].y == sectiona.points[0].y) {
- elem['relevanceSectionList'] = [elem.sectionACode, elem.sectionBCode, elem.sectionCCode, ele.sectionACode, ele.sectionBCode, ele.sectionCCode];
- sectiona1.parentCode = uid;
- sectionb1.parentCode = uid;
- sectionc1.parentCode = uid;
- sectionList.forEach((item, index) => {
- if (item.code == elem.code) {
- sectionList.splice(index, 1);
- }
- });
- }
- });
} else {
parentSectionModel.relevanceSectionList.push(elem.sectionACode);
parentSectionModel.relevanceSectionList.push(elem.sectionBCode);
From 6d26e8e21735cc6132bffc0d26e3b99325b20538 Mon Sep 17 00:00:00 2001
From: joylink_cuiweidong <364937672@qq.com>
Date: Mon, 9 Dec 2019 18:54:11 +0800
Subject: [PATCH 6/8] =?UTF-8?q?=E8=BF=9B=E8=B7=AF=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=98=AF=E5=90=A6=E5=85=88=E9=94=81=E9=97=AD=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/QueryListPage/DataForm.vue | 2 +-
src/i18n/langs/en/map.js | 3 ++-
src/i18n/langs/zh/map.js | 3 ++-
.../newMapdraft/dataRelation/routeoperate/route.vue | 8 ++++++++
src/views/orderauthor/order/draft.vue | 5 +----
5 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/components/QueryListPage/DataForm.vue b/src/components/QueryListPage/DataForm.vue
index 0eb2f62b0..c23734a1b 100644
--- a/src/components/QueryListPage/DataForm.vue
+++ b/src/components/QueryListPage/DataForm.vue
@@ -236,7 +236,7 @@
{{ item.buttontip }}
-
+
diff --git a/src/i18n/langs/en/map.js b/src/i18n/langs/en/map.js
index f0abebd82..dd758a724 100644
--- a/src/i18n/langs/en/map.js
+++ b/src/i18n/langs/en/map.js
@@ -559,5 +559,6 @@ export default {
createModel: 'Create model:',
startingPoint: 'Starting point:',
endingPoint: 'Ending point:',
- frontSectionMode:'Extend Mode'
+ frontSectionMode:'Extend Mode',
+ lockFirst:'Lock First'
};
diff --git a/src/i18n/langs/zh/map.js b/src/i18n/langs/zh/map.js
index 871aa39eb..6fc52415f 100644
--- a/src/i18n/langs/zh/map.js
+++ b/src/i18n/langs/zh/map.js
@@ -553,5 +553,6 @@ export default {
createModel: '创建方式:',
startingPoint: '起点:',
endingPoint: '终点:',
- frontSectionMode:'延伸方式'
+ frontSectionMode:'延伸方式',
+ lockFirst:'是否先锁闭'
};
diff --git a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue
index 5e581e6e8..1d7ad78cd 100644
--- a/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue
+++ b/src/views/newMap/newMapdraft/dataRelation/routeoperate/route.vue
@@ -22,6 +22,13 @@
{{ $t('map.deny') }}
+
+
+
+ {{ $t('map.are') }}
+ {{ $t('map.deny') }}
+
+
s
@@ -315,6 +322,7 @@ export default {
stationCode: '', // 所属站台
arc: false, // 是否自动追踪/联锁自动触发
flt: false, // 是否车队/联锁自动进路
+ lockFirst:false, // 是否先锁闭——办理过程直接先锁闭区段
delayReleaseTime: '', // 延时解锁时间
turnBack: false, // 是否折返进路
startSignalCode: '', // 始端信号机
diff --git a/src/views/orderauthor/order/draft.vue b/src/views/orderauthor/order/draft.vue
index 89d988278..622ed9cfe 100644
--- a/src/views/orderauthor/order/draft.vue
+++ b/src/views/orderauthor/order/draft.vue
@@ -57,14 +57,10 @@ export default {
errorIntTip:'数量必须为整数',
formModel: {
organizationId: '',
- goodsId: '',
- goodsName: '',
orderType: '02',
contractNo: '',
forever: false,
totalPrice: 0,
- price: 0,
- amount: 0,
monthAmount: 0,
bizType: '01',
payWays: '01',
@@ -161,6 +157,7 @@ export default {
buttontip: this.$t('orderAuthor.selectGoods'),
buttonClick: this.buttonClick,
type:'table',
+ style:'width:80%',
tableList:[
{prop:'goodsName', label:this.$t('orderAuthor.commodityName') },
{prop:'goodsAmount', label:this.$t('orderAuthor.goodsAmount'), isEdit:true, min:0,
From ae36dc35426de5c830955cc7eaf74766ade70b5e Mon Sep 17 00:00:00 2001
From: zyy <1787816799@qq.com>
Date: Tue, 10 Dec 2019 09:25:13 +0800
Subject: [PATCH 7/8] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=8C=BA=E6=AE=B5?=
=?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../newMap/newMapdraft/mapoperate/section.vue | 168 +++++++++++-------
1 file changed, 105 insertions(+), 63 deletions(-)
diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue
index 47c502cc4..d82d57cfd 100644
--- a/src/views/newMap/newMapdraft/mapoperate/section.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/section.vue
@@ -14,9 +14,9 @@
-
+
-
+
{{ item.label }}
@@ -322,12 +322,7 @@ export default {
length: 0,
leftSectionCode: '',
rightSectionCode: '',
- modelList: [
- {
- sectionName: '',
- length: ''
- }
- ]
+ modelList: []
},
createRules: {
'startPoint.x': [
@@ -654,7 +649,6 @@ export default {
const obj = this;
if (!this.fieldS) { // 判断是否激活选择站台
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
- console.log(selected.relevanceSectionList);
if (this.field === 'leftSection') {
if (selected.type === '01' || selected.type === '03') {
this.editModel.leftSectionCode = selected.code;
@@ -748,16 +742,20 @@ export default {
this.logicSectionNums.splice(index, 1);
},
addModelList() {
-
+ const param = {
+ sectionName: 'T',
+ length: ''
+ };
+ this.createModel.modelList.push(param);
},
- // 创建区段
- create() {
- const uid = getUID('T', this.sectionList);
- const uname = 'T' + (Number(this.sectionList.length) + 1);
- const model = {
+ handleDelete(index, row) { // 删除创建表格元素
+ this.createModel.modelList.splice(index, 1);
+ },
+ createModelParam(uid, name) {
+ return {
_type: 'Section',
code: uid,
- name: uname,
+ name: name,
type: '01',
axleShow: false,
isStandTrack: false,
@@ -773,8 +771,8 @@ export default {
isSegmentation: false,
segmentationPosition: { x: 0, y: 0 },
relSwitchCode: '',
- rightSectionCode:'',
- leftSectionCode:'',
+ rightSectionCode: '',
+ leftSectionCode: '',
kmRangeRight: '',
kmRangeLeft: '',
region: '',
@@ -795,67 +793,111 @@ export default {
trainWindowCode: '',
destinationCodePoint: { x: 0, y: 0 },
isCurve: false,
- relevanceSectionList: []
+ relevanceSectionList: [],
+ points: []
};
- if (this.createModel.type == '01') {
- model.points = [
- { x: this.createModel.startPoint.x, y: this.createModel.startPoint.y },
- { x: this.createModel.startPoint.x + this.createModel.length, y: this.createModel.startPoint.y }
- ];
- this.$emit('updateMapModel', model);
- } else if (this.createModel.type == '02') {
- if (!(this.createModel.leftSectionCode && this.createModel.rightSectionCode)) {
- return false;
- }
- const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);
- const endModel = this.$store.getters['map/getDeviceByCode'](this.createModel.rightSectionCode);
-
- const start_x = startModel.points[startModel.points.length - 1].x;
- const end_x = endModel.points[0].x;
- const start_y = startModel.points[startModel.points.length - 1].y;
- const end_y = endModel.points[0].y;
- if (this.createModel.leftSectionCode == this.createModel.rightSectionCode) {
- this.$messageBox('左关联区段不能和右关联区段相同');
- return;
- }
- if (start_x == end_x && start_y == end_y) {
- this.$messageBox('左关联区段终点不能和右关联区段起点相同');
- return;
- }
- model.points = [
- { x: start_x, y: start_y },
- { x: end_x, y: end_y }
- ];
+ },
+ // 创建区段
+ create() {
+ if (this.createModel.type == '04') {
const models = [];
- const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
- const rightSection = this.getSectionByCode(this.createModel.rightSectionCode);
- model.leftSectionCode = this.createModel.leftSectionCode;
- leftSection.rightSectionCode = model.code;
- rightSection.leftSectionCode = model.code;
- model.rightSectionCode = this.createModel.rightSectionCode;
- models.push(model);
- models.push(leftSection);
- models.push(rightSection);
- this.$emit('updateMapModel', models);
- } else if (this.createModel.type == '03') {
- if (this.createModel.leftSectionCode) {
+ let flag = true;
+ let leftPointX = 0; let rightPointX = 0;
+ this.createModel.modelList.forEach((item, index) => {
+ if (item.length && item.sectionName) {
+ const uid = getUID('T', [...this.sectionList, ...models]);
+ const startModel = this.getSectionByCode(this.createModel.leftSectionCode);
+ rightPointX += item.length;
+ if (index != 0) {
+ leftPointX += this.createModel.modelList[index - 1].length;
+ }
+ const param = this.createModelParam(uid, item.sectionName);
+ param.points = [
+ { x: startModel.points[startModel.points.length - 1].x + leftPointX, y: startModel.points[startModel.points.length - 1].y },
+ { x: startModel.points[startModel.points.length - 1].x + rightPointX, y: startModel.points[startModel.points.length - 1].y }
+ ];
+ if (index == 0) {
+ param.leftSectionCode = this.createModel.leftSectionCode;
+ startModel.rightSectionCode = param.code;
+ models.push(startModel);
+ } else {
+ param.leftSectionCode = models[index - 1].code;
+ models[index - 1].rightSectionCode = param.code;
+ }
+
+ models.push(param);
+ } else {
+ flag = false;
+ this.$message('表格内容必须填写,请检查后再重新创建!');
+ }
+ });
+ if (flag) {
+ this.$emit('updateMapModel', models);
+ this.createModel.modelList = [];
+ }
+ } else {
+ const uid = getUID('T', this.sectionList);
+ const uname = 'T' + (Number(this.sectionList.length) + 1);
+ const model = this.createModelParam(uid, uname);
+ if (this.createModel.type == '01') {
+ model.points = [
+ { x: this.createModel.startPoint.x, y: this.createModel.startPoint.y },
+ { x: this.createModel.startPoint.x + this.createModel.length, y: this.createModel.startPoint.y }
+ ];
+ this.$emit('updateMapModel', model);
+ } else if (this.createModel.type == '02') {
+ if (!(this.createModel.leftSectionCode && this.createModel.rightSectionCode)) {
+ return false;
+ }
const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);
+ const endModel = this.$store.getters['map/getDeviceByCode'](this.createModel.rightSectionCode);
+
const start_x = startModel.points[startModel.points.length - 1].x;
+ const end_x = endModel.points[0].x;
const start_y = startModel.points[startModel.points.length - 1].y;
+ const end_y = endModel.points[0].y;
+ if (this.createModel.leftSectionCode == this.createModel.rightSectionCode) {
+ this.$messageBox('左关联区段不能和右关联区段相同');
+ return;
+ }
+ if (start_x == end_x && start_y == end_y) {
+ this.$messageBox('左关联区段终点不能和右关联区段起点相同');
+ return;
+ }
model.points = [
{ x: start_x, y: start_y },
- { x: start_x + this.createModel.length, y: start_y }
+ { x: end_x, y: end_y }
];
const models = [];
- model.leftSectionCode = this.createModel.leftSectionCode;
const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
+ const rightSection = this.getSectionByCode(this.createModel.rightSectionCode);
+ model.leftSectionCode = this.createModel.leftSectionCode;
leftSection.rightSectionCode = model.code;
+ rightSection.leftSectionCode = model.code;
+ model.rightSectionCode = this.createModel.rightSectionCode;
models.push(model);
models.push(leftSection);
+ models.push(rightSection);
this.$emit('updateMapModel', models);
+ } else if (this.createModel.type == '03') {
+ if (this.createModel.leftSectionCode) {
+ const startModel = this.$store.getters['map/getDeviceByCode'](this.createModel.leftSectionCode);
+ const start_x = startModel.points[startModel.points.length - 1].x;
+ const start_y = startModel.points[startModel.points.length - 1].y;
+ model.points = [
+ { x: start_x, y: start_y },
+ { x: start_x + this.createModel.length, y: start_y }
+ ];
+ const models = [];
+ model.leftSectionCode = this.createModel.leftSectionCode;
+ const leftSection = this.getSectionByCode(this.createModel.leftSectionCode);
+ leftSection.rightSectionCode = model.code;
+ models.push(model);
+ models.push(leftSection);
+ this.$emit('updateMapModel', models);
+ }
}
}
-
},
// 修改区段属性
edit() {
From 18ebc91da2dd14c8087573d004eac371df3c2f67 Mon Sep 17 00:00:00 2001
From: zyy <1787816799@qq.com>
Date: Tue, 10 Dec 2019 10:12:46 +0800
Subject: [PATCH 8/8] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=89=B9=E9=87=8F?=
=?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=8C=BA=E6=AE=B5=20=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/newMap/newMapdraft/mapoperate/section.vue | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/views/newMap/newMapdraft/mapoperate/section.vue b/src/views/newMap/newMapdraft/mapoperate/section.vue
index d82d57cfd..a15fc38a5 100644
--- a/src/views/newMap/newMapdraft/mapoperate/section.vue
+++ b/src/views/newMap/newMapdraft/mapoperate/section.vue
@@ -803,15 +803,16 @@ export default {
const models = [];
let flag = true;
let leftPointX = 0; let rightPointX = 0;
+ const startModel = this.getSectionByCode(this.createModel.leftSectionCode);
this.createModel.modelList.forEach((item, index) => {
if (item.length && item.sectionName) {
+ let param = {};
const uid = getUID('T', [...this.sectionList, ...models]);
- const startModel = this.getSectionByCode(this.createModel.leftSectionCode);
rightPointX += item.length;
if (index != 0) {
leftPointX += this.createModel.modelList[index - 1].length;
}
- const param = this.createModelParam(uid, item.sectionName);
+ param = this.createModelParam(uid, item.sectionName);
param.points = [
{ x: startModel.points[startModel.points.length - 1].x + leftPointX, y: startModel.points[startModel.points.length - 1].y },
{ x: startModel.points[startModel.points.length - 1].x + rightPointX, y: startModel.points[startModel.points.length - 1].y }
@@ -819,7 +820,6 @@ export default {
if (index == 0) {
param.leftSectionCode = this.createModel.leftSectionCode;
startModel.rightSectionCode = param.code;
- models.push(startModel);
} else {
param.leftSectionCode = models[index - 1].code;
models[index - 1].rightSectionCode = param.code;
@@ -832,6 +832,7 @@ export default {
}
});
if (flag) {
+ models.push(startModel);
this.$emit('updateMapModel', models);
this.createModel.modelList = [];
}