Merge branch 'dev' of https://git.cloud.tencent.com/joylink/jl-nclient into dev
This commit is contained in:
commit
a9ec1672ae
@ -13,15 +13,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.bothCreate')" name="second">
|
<el-tab-pane class="view-control" :label="$t('map.bothCreate')" name="second">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight + 60 +'px' }">
|
<div class="flex_box">
|
||||||
<div class="flex_box">
|
<el-button type="primary" @click="create">一键生成区段</el-button>
|
||||||
<el-button type="primary" @click="create">一键生成区段</el-button>
|
</div>
|
||||||
<el-card v-if="questionList.length" class="box-card">
|
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
||||||
<div v-for="(item, index) in questionList" :key="index" class="text item">
|
<el-card v-if="questionList.length" class="box-card">
|
||||||
{{ item }}
|
<div v-for="(item, index) in questionList" :key="index" class="text item">
|
||||||
</div>
|
{{ item }}
|
||||||
</el-card>
|
</div>
|
||||||
</div>
|
</el-card>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.splitMerge')" name="three">
|
<el-tab-pane class="view-control" :label="$t('map.splitMerge')" name="three">
|
||||||
@ -42,8 +42,8 @@
|
|||||||
@click="hover('splitSection')"
|
@click="hover('splitSection')"
|
||||||
>{{ $t('map.activate') }}</el-button>
|
>{{ $t('map.activate') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('map.splitOffset')" prop="splitOffset">
|
<el-form-item label="拆分数量" prop="splitNumber">
|
||||||
<el-input-number v-model="addModel.splitOffset" :min="20" :max="addModel.splitOffsetMax" />px
|
<el-input-number v-model="addModel.splitNumber" :min="1" :max="addModel.splitOffsetMax" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
@ -91,7 +91,7 @@
|
|||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane class="view-control" :label="$t('map.logicBlock')" name="four">
|
<el-tab-pane class="view-control" :label="$t('map.logicBlock')" name="four">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: cardHeight +'px' }">
|
<el-scrollbar :style="{ height: cardHeight +'px' }">
|
||||||
<el-table :data="tableData" style="width: 80%; margin: 0 auto;">
|
<el-table :data="tableData" style="width: 80%; margin: 0 auto;">
|
||||||
<el-table-column :label="$t('map.sectionPolyline')" width="150">
|
<el-table-column :label="$t('map.sectionPolyline')" width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -209,7 +209,7 @@ export default {
|
|||||||
tableData: [],
|
tableData: [],
|
||||||
addModel: {
|
addModel: {
|
||||||
code: '',
|
code: '',
|
||||||
splitOffset: 0,
|
splitNumber: 2,
|
||||||
splitOffsetMax: 0
|
splitOffsetMax: 0
|
||||||
},
|
},
|
||||||
mergeModel: {
|
mergeModel: {
|
||||||
@ -223,9 +223,9 @@ export default {
|
|||||||
code: [
|
code: [
|
||||||
{ required: true, message: this.$t('rules.pleaseSelectSectionName'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.pleaseSelectSectionName'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
splitOffset: [
|
splitNumber: [
|
||||||
{ required: true, message: this.$t('rules.pleaseFillOffset'), trigger: 'blur' },
|
{ required: true, message: '请输入拆分数量', trigger: 'blur' },
|
||||||
{ type: 'number', message: this.$t('rules.pleaseFillValue'), min: '20' }
|
{ type: 'number', message: '请输入合理的拆分数量', min: '20' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
mergeRules: {
|
mergeRules: {
|
||||||
@ -534,8 +534,8 @@ export default {
|
|||||||
if (!this.fieldS) { // 判断是否激活选择站台
|
if (!this.fieldS) { // 判断是否激活选择站台
|
||||||
this.editModel.points = [];
|
this.editModel.points = [];
|
||||||
this.$refs.dataform.clearValidate();
|
this.$refs.dataform.clearValidate();
|
||||||
this.activeName = 'first';
|
|
||||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||||
|
this.activeName = 'first';
|
||||||
this.editModel.code = selected.code;
|
this.editModel.code = selected.code;
|
||||||
this.editModel.name = selected.name;
|
this.editModel.name = selected.name;
|
||||||
this.editModel.type = selected.type;
|
this.editModel.type = selected.type;
|
||||||
@ -607,14 +607,16 @@ export default {
|
|||||||
this.editModel.isCurve = selected.isCurve;
|
this.editModel.isCurve = selected.isCurve;
|
||||||
this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
|
this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
|
||||||
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
|
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
|
||||||
|
|
||||||
this.computedLogicSectionNumList(this.editModel.logicSectionNum);
|
this.computedLogicSectionNumList(this.editModel.logicSectionNum);
|
||||||
if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) {
|
if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) {
|
||||||
this.addModel.code = selected.code;
|
this.addModel.code = selected.code;
|
||||||
|
this.activeName = 'three';
|
||||||
} else if (this.field.toUpperCase() === 'leftSection'.toUpperCase()) {
|
} else if (this.field.toUpperCase() === 'leftSection'.toUpperCase()) {
|
||||||
this.mergeModel.lsectioncode = selected.code;
|
this.mergeModel.lsectioncode = selected.code;
|
||||||
|
this.activeName = 'three';
|
||||||
} else if (this.field.toUpperCase() === 'rightSection'.toUpperCase()) {
|
} else if (this.field.toUpperCase() === 'rightSection'.toUpperCase()) {
|
||||||
this.mergeModel.rsectioncode = selected.code;
|
this.mergeModel.rsectioncode = selected.code;
|
||||||
|
this.activeName = 'three';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.tableData = [];
|
this.tableData = [];
|
||||||
@ -742,13 +744,13 @@ export default {
|
|||||||
filterLinks(query, item) {
|
filterLinks(query, item) {
|
||||||
return item.pinyin.indexOf(query) > -1;
|
return item.pinyin.indexOf(query) > -1;
|
||||||
},
|
},
|
||||||
|
// 一键生成区段
|
||||||
create() {
|
create() {
|
||||||
const models = [];
|
const models = [];
|
||||||
const remove = [];
|
const remove = [];
|
||||||
this.linkList.forEach(link => {
|
this.linkList.forEach(link => {
|
||||||
let count = 0;
|
let count = 0;
|
||||||
this.sectionList.forEach(setction => {
|
this.sectionList.forEach(setction => {
|
||||||
console.log(setction);
|
|
||||||
count++;
|
count++;
|
||||||
if (setction.linkCode == link.code) {
|
if (setction.linkCode == link.code) {
|
||||||
count = 0;
|
count = 0;
|
||||||
@ -845,7 +847,11 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
_that.$emit('delMapModel', remove);
|
_that.$emit('delMapModel', remove);
|
||||||
_that.$emit('addOrUpdateMapModel', models);
|
if (models.length) {
|
||||||
|
_that.$emit('addOrUpdateMapModel', models);
|
||||||
|
} else {
|
||||||
|
_that.$message.info('所有link都有相关区段,所以未生成任何区段');
|
||||||
|
}
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
@ -853,82 +859,15 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// buildEditModel() {
|
// 修改区段属性
|
||||||
// const pointArr = JSON.stringify(this.editModel.points);
|
|
||||||
// const model = {
|
|
||||||
// _type: 'Section',
|
|
||||||
// code: this.editModel.code,
|
|
||||||
// name: this.editModel.name,
|
|
||||||
// type: this.editModel.type,
|
|
||||||
// relStandCode: this.editModel.relStandCode,
|
|
||||||
// leftStopPointOffset: Number(this.editModel.leftStopPointOffset),
|
|
||||||
// rightStopPointOffset: Number(this.editModel.rightStopPointOffset),
|
|
||||||
// axleShow: this.editModel.axleShow,
|
|
||||||
// namePosition: {
|
|
||||||
// x: this.editModel.namePosition.x,
|
|
||||||
// y: this.editModel.namePosition.y
|
|
||||||
// },
|
|
||||||
// kmRangeRight: this.editModel.kmRangeRight,
|
|
||||||
// kmRangeLeft: this.editModel.kmRangeLeft,
|
|
||||||
// region: this.editModel.region,
|
|
||||||
// isStandTrack: this.editModel.isStandTrack,
|
|
||||||
// standTrackName: this.editModel.standTrackName,
|
|
||||||
// standTrackNamePosition: {
|
|
||||||
// x: this.editModel.standTrackNamePosition.x,
|
|
||||||
// y: this.editModel.standTrackNamePosition.y
|
|
||||||
// },
|
|
||||||
// isReentryTrack: this.editModel.isReentryTrack, // 是否折返轨
|
|
||||||
// reentryTrackName: this.editModel.reentryTrackName,
|
|
||||||
// reentryTrackNamePosition: {
|
|
||||||
// x: this.editModel.reentryTrackNamePosition.x,
|
|
||||||
// y: this.editModel.reentryTrackNamePosition.y
|
|
||||||
// },
|
|
||||||
// isSegmentation: this.editModel.isSegmentation,
|
|
||||||
// segmentationPosition: {
|
|
||||||
// x: this.editModel.segmentationPosition.x,
|
|
||||||
// y: this.editModel.segmentationPosition.y
|
|
||||||
// },
|
|
||||||
// isTransferTrack: this.editModel.isTransferTrack, // 是否转换轨
|
|
||||||
// transferTrackName: this.editModel.transferTrackName,
|
|
||||||
// transferTrackNamePosition: {
|
|
||||||
// x: this.editModel.transferTrackNamePosition.x,
|
|
||||||
// y: this.editModel.transferTrackNamePosition.y
|
|
||||||
// },
|
|
||||||
// logicSectionNameSort: this.editModel.logicSectionNameSort,
|
|
||||||
// isSwitchSection: this.editModel.isSwitchSection,
|
|
||||||
// relSwitchCode: this.editModel.relSwitchCode,
|
|
||||||
// points: JSON.parse(pointArr),
|
|
||||||
// logicSectionNum: this.editModel.logicSectionNum,
|
|
||||||
// logicSectionShow: this.editModel.logicSectionShow,
|
|
||||||
// sepTypeLeft: this.editModel.sepTypeLeft,
|
|
||||||
// offsetLeft: this.editModel.offsetLeft,
|
|
||||||
// sepTypeRight: this.editModel.sepTypeRight,
|
|
||||||
// offsetRight: this.editModel.offsetRight,
|
|
||||||
// stationCode: this.editModel.stationCode,
|
|
||||||
// trainPosType: this.editModel.trainPosType,
|
|
||||||
// linkCode: this.editModel.linkCode,
|
|
||||||
// isCurve: this.editModel.isCurve,
|
|
||||||
// destinationCodeShow: false
|
|
||||||
// };
|
|
||||||
// if (model.isReentryTrack || this.editModel.isTransferTrack) {
|
|
||||||
// model.destinationCode = this.editModel.destinationCode; // 目的地码
|
|
||||||
// model.destinationCodePoint = { // 目的地吗坐标
|
|
||||||
// x: this.editModel.destinationCodePoint.x,
|
|
||||||
// y: this.editModel.destinationCodePoint.y
|
|
||||||
// };
|
|
||||||
// model.destinationCodeShow = this.editModel.destinationCodeShow;
|
|
||||||
// }
|
|
||||||
// return model;
|
|
||||||
// },
|
|
||||||
edit() {
|
edit() {
|
||||||
this.$refs['dataform'].validate((valid) => {
|
this.$refs['dataform'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const edits = [];
|
const edits = [];
|
||||||
const model = Object.assign({_type: 'Section'}, this.editModel);
|
const model = Object.assign({_type: 'Section'}, this.editModel);
|
||||||
model.points = JSON.stringify(model.points);
|
// model.points = JSON.parse(JSON.stringify(model.points));
|
||||||
model.leftStopPointOffset = Number(model.leftStopPointOffset);
|
model.leftStopPointOffset = Number(model.leftStopPointOffset);
|
||||||
model.rightStopPointOffset = Number(model.rightStopPointOffset);
|
model.rightStopPointOffset = Number(model.rightStopPointOffset);
|
||||||
// const model = this.buildEditModel();
|
|
||||||
this.sectionList.forEach(section => {
|
this.sectionList.forEach(section => {
|
||||||
if (section.parentCode == model.code) {
|
if (section.parentCode == model.code) {
|
||||||
section.logicSectionShow = model.logicSectionShow;
|
section.logicSectionShow = model.logicSectionShow;
|
||||||
@ -967,117 +906,72 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 拆分
|
// 拆分区段
|
||||||
split() {
|
split() {
|
||||||
this.$refs['oprt'].validate((valid) => {
|
this.$refs['oprt'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const selected = this.$store.getters['map/getDeviceByCode'](this.addModel.code);
|
const selected = this.$store.getters['map/getDeviceByCode'](this.addModel.code);
|
||||||
if (selected && selected._type === 'Section' && selected.type === '01') {
|
if (selected && selected._type === 'Section' && selected.type === '01') {
|
||||||
const triangle = new JTriangle(selected.points[0], selected.points[selected.points.length - 1]);
|
|
||||||
const remove = [];
|
const remove = [];
|
||||||
const models = [];
|
const models = [];
|
||||||
const uidL = selected.name + '_l';
|
const modelX = (selected.points[selected.points.length - 1].x - selected.points[0].x) / this.addModel.splitNumber;
|
||||||
const uidR = selected.name + '_r';
|
const modelY = (selected.points[selected.points.length - 1].y - selected.points[0].y) / this.addModel.splitNumber;
|
||||||
const modelL = {
|
for (let index = 1; index <= this.addModel.splitNumber; index++) {
|
||||||
_type: 'Section',
|
const model = {
|
||||||
code: getUID('Section'),
|
_type: 'Section',
|
||||||
name: uidL,
|
code: getUID('Section'),
|
||||||
type: '01',
|
name: `${selected.name}_${index}`,
|
||||||
parentCode: '',
|
type: '01',
|
||||||
axleShow: selected.axleShow,
|
parentCode: '',
|
||||||
isStandTrack: false,
|
axleShow: selected.axleShow,
|
||||||
kmRangeRight: '',
|
isStandTrack: false,
|
||||||
kmRangeLeft: '',
|
kmRangeRight: '',
|
||||||
region: '',
|
kmRangeLeft: '',
|
||||||
standTrackName: '',
|
region: '',
|
||||||
standTrackNamePosition: { x: 0, y: 0 },
|
standTrackName: '',
|
||||||
isReentryTrack: false,
|
standTrackNamePosition: { x: 0, y: 0 },
|
||||||
reentryTrackName: '',
|
isReentryTrack: false,
|
||||||
reentryTrackNamePosition: { x: 0, y: 0 },
|
reentryTrackName: '',
|
||||||
isTransferTrack: false,
|
reentryTrackNamePosition: { x: 0, y: 0 },
|
||||||
transferTrackName: '',
|
isTransferTrack: false,
|
||||||
transferTrackNamePosition: { x: 0, y: 0 },
|
transferTrackName: '',
|
||||||
isSwitchSection: false,
|
transferTrackNamePosition: { x: 0, y: 0 },
|
||||||
isSegmentation: false,
|
isSwitchSection: false,
|
||||||
segmentationPosition: { x: 0, y: 0 },
|
isSegmentation: false,
|
||||||
relSwitchCode: '',
|
segmentationPosition: { x: 0, y: 0 },
|
||||||
logicSectionNameSort: selected.logicSectionNameSort,
|
relSwitchCode: '',
|
||||||
logicSectionNum: selected.logicSectionNum,
|
logicSectionNameSort: selected.logicSectionNameSort,
|
||||||
logicSectionShow: selected.logicSectionShow,
|
logicSectionNum: selected.logicSectionNum,
|
||||||
sepTypeLeft: selected.sepTypeLeft,
|
logicSectionShow: selected.logicSectionShow,
|
||||||
offsetLeft: selected.offsetLeft,
|
sepTypeLeft: index == 0 ? selected.sepTypeLeft : '01', // 左侧分隔符类型 (起始左侧按原来区段类型走 其余 默认 01)
|
||||||
sepTypeRight: '01',
|
offsetLeft: selected.offsetLeft,
|
||||||
offsetRight: selected.offsetRight,
|
sepTypeRight: index == this.addModel.splitNumber ? selected.sepTypeRight : '01', // 右侧分隔符类型 (终点右侧按原来区段类型走 其余 默认 01)
|
||||||
linkCode: selected.linkCode,
|
offsetRight: selected.offsetRight,
|
||||||
trainPosType: selected.trainPosType,
|
linkCode: selected.linkCode,
|
||||||
isCurve: selected.isCurve,
|
trainPosType: selected.trainPosType,
|
||||||
points: [
|
isCurve: selected.isCurve,
|
||||||
{
|
points: [
|
||||||
x: selected.points[0].x,
|
{
|
||||||
y: selected.points[0].y
|
x: selected.points[0].x + ((index - 1) * modelX),
|
||||||
},
|
y: selected.points[0].y + ((index - 1) * modelY)
|
||||||
{
|
},
|
||||||
x: selected.points[0].x + triangle.getCos(this.addModel.splitOffset * 10000) / 10000,
|
{
|
||||||
y: selected.points[0].y + triangle.getSin(this.addModel.splitOffset * 10000) / 10000
|
x: selected.points[0].x + (index * modelX),
|
||||||
}
|
y: selected.points[0].y + (index * modelY)
|
||||||
],
|
}
|
||||||
namePosition: { x: 0, y: 0 }
|
],
|
||||||
};
|
namePosition: { x: 0, y: 0 }
|
||||||
const modelR = {
|
};
|
||||||
_type: 'Section',
|
models.push(model);
|
||||||
code: getUID('Section'),
|
}
|
||||||
name: uidR,
|
|
||||||
type: '01',
|
|
||||||
parentCode: '',
|
|
||||||
axleShow: selected.axleShow,
|
|
||||||
isStandTrack: false,
|
|
||||||
kmRangeRight: '',
|
|
||||||
kmRangeLeft: '',
|
|
||||||
region: '',
|
|
||||||
standTrackName: '',
|
|
||||||
standTrackNamePosition: { x: 0, y: 0 },
|
|
||||||
isReentryTrack: false,
|
|
||||||
reentryTrackName: '',
|
|
||||||
reentryTrackNamePosition: { x: 0, y: 0 },
|
|
||||||
isTransferTrack: false,
|
|
||||||
transferTrackName: '',
|
|
||||||
transferTrackNamePosition: { x: 0, y: 0 },
|
|
||||||
isSegmentation: false,
|
|
||||||
segmentationPosition: { x: 0, y: 0 },
|
|
||||||
isSwitchSection: false,
|
|
||||||
relSwitchCode: '',
|
|
||||||
logicSectionNameSort: selected.logicSectionNameSort,
|
|
||||||
logicSectionNum: selected.logicSectionNum,
|
|
||||||
logicSectionShow: selected.logicSectionShow,
|
|
||||||
sepTypeLeft: '01',
|
|
||||||
offsetLeft: selected.offsetLeft,
|
|
||||||
sepTypeRight: selected.sepTypeRight,
|
|
||||||
offsetRight: selected.offsetRight,
|
|
||||||
linkCode: selected.linkCode,
|
|
||||||
trainPosType: selected.trainPosType,
|
|
||||||
isCurve: selected.isCurve,
|
|
||||||
points: [
|
|
||||||
{
|
|
||||||
x: selected.points[0].x + triangle.getCos(this.addModel.splitOffset * 10000) / 10000,
|
|
||||||
y: selected.points[0].y + triangle.getSin(this.addModel.splitOffset * 10000) / 10000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
x: selected.points[selected.points.length - 1].x,
|
|
||||||
y: selected.points[selected.points.length - 1].y
|
|
||||||
}
|
|
||||||
],
|
|
||||||
namePosition: { x: 0, y: 0 }
|
|
||||||
};
|
|
||||||
|
|
||||||
remove.push(selected);
|
remove.push(selected);
|
||||||
models.push(modelL);
|
this.$emit('delMapModel', remove); // 删除原区段
|
||||||
models.push(modelR);
|
this.$emit('addOrUpdateMapModel', models); // 添加新增拆分区段
|
||||||
this.$emit('delMapModel', remove);
|
|
||||||
this.$emit('addOrUpdateMapModel', models);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 合并区段
|
||||||
merge() {
|
merge() {
|
||||||
this.$refs['oprt1'].validate((valid) => {
|
this.$refs['oprt1'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
@ -1189,6 +1083,7 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 一键删除道岔区段
|
||||||
removeSwitchSection() {
|
removeSwitchSection() {
|
||||||
const remove = [];
|
const remove = [];
|
||||||
if (this.sectionList && this.sectionList.length) {
|
if (this.sectionList && this.sectionList.length) {
|
||||||
@ -1203,6 +1098,7 @@ export default {
|
|||||||
this.$emit('delMapModel', remove);
|
this.$emit('delMapModel', remove);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 一键生成道岔区段
|
||||||
createSwitchSection() {
|
createSwitchSection() {
|
||||||
const models = [];
|
const models = [];
|
||||||
|
|
||||||
@ -1341,6 +1237,19 @@ export default {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.box-card {
|
||||||
|
width: calc(100% - 80px);
|
||||||
|
margin: 20px auto 0;
|
||||||
|
padding: 0 20px;
|
||||||
|
.text {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
padding: 18px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/deep/ {
|
/deep/ {
|
||||||
.card .el-transfer-panel__filter{
|
.card .el-transfer-panel__filter{
|
||||||
margin: 5px 15px;
|
margin: 5px 15px;
|
||||||
|
@ -43,7 +43,7 @@ export default {
|
|||||||
permissionType: '',
|
permissionType: '',
|
||||||
mapId: '',
|
mapId: '',
|
||||||
lessonId: '',
|
lessonId: '',
|
||||||
mapProductCode: '',
|
prdCode: '',
|
||||||
date: '',
|
date: '',
|
||||||
amount: 0,
|
amount: 0,
|
||||||
ownerId: '',
|
ownerId: '',
|
||||||
@ -68,7 +68,7 @@ export default {
|
|||||||
items: [
|
items: [
|
||||||
{ prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange },
|
{ prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange },
|
||||||
{ prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange },
|
{ prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange },
|
||||||
{ prop: 'mapProductCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
|
{ prop: 'prdCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
|
||||||
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
|
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
|
||||||
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
|
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
|
||||||
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
|
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
|
||||||
@ -86,7 +86,7 @@ export default {
|
|||||||
mapId: [
|
mapId: [
|
||||||
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
mapProductCode: [
|
prdCode: [
|
||||||
{ required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
lessonId: [
|
lessonId: [
|
||||||
@ -159,9 +159,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var validator = {};
|
var validator = {};
|
||||||
validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.mapProductCode; };
|
validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
|
||||||
validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.mapProductCode; };
|
validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
|
||||||
validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.mapProductCode; };
|
validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdCode; };
|
||||||
validator[PermissionType.SCREEN] = () => { return true; };
|
validator[PermissionType.SCREEN] = () => { return true; };
|
||||||
|
|
||||||
if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) {
|
if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) {
|
||||||
@ -176,10 +176,10 @@ export default {
|
|||||||
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
|
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
|
||||||
model['lessonId'] = this.formModel.lessonId;
|
model['lessonId'] = this.formModel.lessonId;
|
||||||
model['mapId'] = this.formModel.mapId;
|
model['mapId'] = this.formModel.mapId;
|
||||||
model['prdCode'] = this.formModel.mapProductCode;
|
model['prdCode'] = this.formModel.prdCode;
|
||||||
} else if (this.formModel.permissionType == PermissionType.SIMULATION) {
|
} else if (this.formModel.permissionType == PermissionType.SIMULATION) {
|
||||||
model['mapId'] = this.formModel.mapId;
|
model['mapId'] = this.formModel.mapId;
|
||||||
model['prdCode'] = this.formModel.mapProductCode;
|
model['prdCode'] = this.formModel.prdCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTotalRemains(model).then(response => {
|
getTotalRemains(model).then(response => {
|
||||||
@ -201,11 +201,11 @@ export default {
|
|||||||
},
|
},
|
||||||
permissionTypeChange() {
|
permissionTypeChange() {
|
||||||
this.formModel.mapId = '';
|
this.formModel.mapId = '';
|
||||||
this.formModel.mapProductCode = '';
|
this.formModel.prdCode = '';
|
||||||
this.formModel.lessonId = '';
|
this.formModel.lessonId = '';
|
||||||
},
|
},
|
||||||
mapChange(mapId) {
|
mapChange(mapId) {
|
||||||
this.formModel.mapProductCode = '';
|
this.formModel.prdCode = '';
|
||||||
this.formModel.lessonId = '';
|
this.formModel.lessonId = '';
|
||||||
this.mapProductList = [];
|
this.mapProductList = [];
|
||||||
getPublishMapInfo(mapId).then(resp => {
|
getPublishMapInfo(mapId).then(resp => {
|
||||||
@ -217,9 +217,9 @@ export default {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
mapProductChange(mapProductCode) {
|
mapProductChange(prdCode) {
|
||||||
this.formModel.lessonId = '';
|
this.formModel.lessonId = '';
|
||||||
this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdCode == this.formModel.mapProductCode; });
|
this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdCode == this.formModel.prdCode; });
|
||||||
},
|
},
|
||||||
// 搜索查询input
|
// 搜索查询input
|
||||||
async querySearchAsync(queryString, cb) {
|
async querySearchAsync(queryString, cb) {
|
||||||
@ -259,7 +259,7 @@ export default {
|
|||||||
permissionType: model.permissionType,
|
permissionType: model.permissionType,
|
||||||
mapId: model.mapId,
|
mapId: model.mapId,
|
||||||
lessonId: model.lessonId,
|
lessonId: model.lessonId,
|
||||||
mapProductCode: model.mapProductCode,
|
prdCode: model.prdCode,
|
||||||
date: [model.startTime, model.endTime],
|
date: [model.startTime, model.endTime],
|
||||||
amount: model.amount,
|
amount: model.amount,
|
||||||
ownerId: this.formModel.ownerId,
|
ownerId: this.formModel.ownerId,
|
||||||
@ -281,7 +281,7 @@ export default {
|
|||||||
permissionType: this.formModel.permissionType,
|
permissionType: this.formModel.permissionType,
|
||||||
mapId: this.isShowMap ? this.formModel.mapId : '',
|
mapId: this.isShowMap ? this.formModel.mapId : '',
|
||||||
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
|
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
|
||||||
mapProductCode: this.isShowMapProduct ? this.formModel.mapProductCode : '',
|
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
|
||||||
startTime: this.formModel.date[0],
|
startTime: this.formModel.date[0],
|
||||||
endTime: this.formModel.date[1],
|
endTime: this.formModel.date[1],
|
||||||
amount: this.formModel.amount,
|
amount: this.formModel.amount,
|
||||||
@ -294,7 +294,7 @@ export default {
|
|||||||
permissionType: this.formModel.permissionType,
|
permissionType: this.formModel.permissionType,
|
||||||
mapId: this.isShowMap ? this.formModel.mapId : '',
|
mapId: this.isShowMap ? this.formModel.mapId : '',
|
||||||
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
|
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
|
||||||
mapProductCode: this.isShowMapProduct ? this.formModel.mapProductCode : '',
|
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
|
||||||
startTime: this.formModel.date[0],
|
startTime: this.formModel.date[0],
|
||||||
endTime: this.formModel.date[1],
|
endTime: this.formModel.date[1],
|
||||||
amount: this.formModel.amount,
|
amount: this.formModel.amount,
|
||||||
|
@ -140,8 +140,8 @@ export default {
|
|||||||
this.$message.success('创建空运行图成功!');
|
this.$message.success('创建空运行图成功!');
|
||||||
this.jump(resp.data, this.newModel.name);
|
this.jump(resp.data, this.newModel.name);
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}).catch(() => {
|
}).catch((error) => {
|
||||||
this.$messageBox('创建空运行图失败');
|
this.$messageBox('创建运行图失败:' + error.message);
|
||||||
this.doClose();
|
this.doClose();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -155,8 +155,8 @@ export default {
|
|||||||
this.$message.success('创建运行图成功!');
|
this.$message.success('创建运行图成功!');
|
||||||
this.jump(resp.data, this.pullModel.name);
|
this.jump(resp.data, this.pullModel.name);
|
||||||
this.doClose();
|
this.doClose();
|
||||||
}).catch(() => {
|
}).catch((error) => {
|
||||||
this.$messageBox('创建运行图失败');
|
this.$messageBox('创建运行图失败:' + error.message);
|
||||||
this.doClose();
|
this.doClose();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user