Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
# Conflicts: # src/utils/baseUrl.js
This commit is contained in:
commit
eb9c9d8ee3
@ -183,6 +183,7 @@
|
|||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
multiple
|
multiple
|
||||||
|
@change="((val)=>{deviceChange(val, item)})"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="option in item.options"
|
v-for="option in item.options"
|
||||||
|
@ -159,7 +159,7 @@ export default {
|
|||||||
const deviceList = [];
|
const deviceList = [];
|
||||||
|
|
||||||
// 信号机
|
// 信号机
|
||||||
let nameShow = this.nameLevels.indexOf(1) !== -1;
|
let nameShow = this.nameLevels.includes(1);
|
||||||
const signalList = this.$store.getters['map/signalList'];
|
const signalList = this.$store.getters['map/signalList'];
|
||||||
if (signalList && signalList.length > 0) {
|
if (signalList && signalList.length > 0) {
|
||||||
signalList.forEach(elem => {
|
signalList.forEach(elem => {
|
||||||
@ -168,11 +168,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 按钮名称
|
// 按钮名称
|
||||||
nameShow = this.nameLevels.indexOf(3) !== -1;
|
nameShow = this.nameLevels.includes(3);
|
||||||
|
|
||||||
// 道岔
|
// 道岔
|
||||||
nameShow = this.nameLevels.indexOf(7) !== -1; // 道岔名称
|
nameShow = this.nameLevels.includes(7); // 道岔名称
|
||||||
const switchSectionNameShow = this.nameLevels.indexOf(9) !== -1; // 道岔轨名称
|
const switchSectionNameShow = this.nameLevels.includes(9); // 道岔轨名称
|
||||||
const switchList = this.$store.getters['map/switchList'];
|
const switchList = this.$store.getters['map/switchList'];
|
||||||
if (switchList && switchList.length > 0) {
|
if (switchList && switchList.length > 0) {
|
||||||
switchList.forEach(elem => {
|
switchList.forEach(elem => {
|
||||||
@ -181,7 +181,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 控制模式
|
// 控制模式
|
||||||
const indicatorShow = this.nameLevels.indexOf(8) !== -1;
|
const indicatorShow = this.nameLevels.includes(8);
|
||||||
const control = this.$store.getters['map/stationControlList'];
|
const control = this.$store.getters['map/stationControlList'];
|
||||||
if (control && control.length > 0) {
|
if (control && control.length > 0) {
|
||||||
control.forEach(elem => {
|
control.forEach(elem => {
|
||||||
@ -204,28 +204,28 @@ export default {
|
|||||||
nameShow = false;
|
nameShow = false;
|
||||||
} else if (elem.type === '01') {
|
} else if (elem.type === '01') {
|
||||||
// 计轴区段名称
|
// 计轴区段名称
|
||||||
nameShow = this.nameLevels.indexOf(11) !== -1;
|
nameShow = this.nameLevels.includes(11);
|
||||||
} else if (elem.type === '02') {
|
} else if (elem.type === '02') {
|
||||||
// 轨道轨名称
|
// 轨道轨名称
|
||||||
nameShow = this.nameLevels.indexOf(5) !== -1;
|
nameShow = this.nameLevels.includes(5);
|
||||||
} else if (elem.type === '04') {
|
} else if (elem.type === '04') {
|
||||||
// 道岔区段名称
|
// 道岔区段名称
|
||||||
nameShow = this.nameLevels.indexOf(9) !== -1;
|
nameShow = this.nameLevels.includes(9);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 站台轨名称
|
// 站台轨名称
|
||||||
if (elem.standTrack) {
|
if (elem.standTrack) {
|
||||||
standTrackNameShow = this.nameLevels.indexOf(2) !== -1;
|
standTrackNameShow = this.nameLevels.includes(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 折返轨名称
|
// 折返轨名称
|
||||||
if (elem.reentryTrack) {
|
if (elem.reentryTrack) {
|
||||||
reentryTrackNameShow = this.nameLevels.indexOf(4) !== -1;
|
reentryTrackNameShow = this.nameLevels.includes(4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转换轨名称
|
// 转换轨名称
|
||||||
if (elem.transferTrack) {
|
if (elem.transferTrack) {
|
||||||
transferTrackNameShow = this.nameLevels.indexOf(6) !== -1;
|
transferTrackNameShow = this.nameLevels.includes(6);
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
deviceList.push(Object.assign(this.$jlmap.getDeviceByCode(elem.code), { nameShow, standTrackNameShow, reentryTrackNameShow, transferTrackNameShow }));
|
||||||
@ -233,7 +233,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 停车点
|
// 停车点
|
||||||
const destCodeShow = this.nameLevels.indexOf(10) !== -1;
|
const destCodeShow = this.nameLevels.includes(10);
|
||||||
const stopPointList = this.$store.getters['map/stopPointList'];
|
const stopPointList = this.$store.getters['map/stopPointList'];
|
||||||
if (stopPointList && stopPointList.length > 0) {
|
if (stopPointList && stopPointList.length > 0) {
|
||||||
stopPointList.forEach(elem => {
|
stopPointList.forEach(elem => {
|
||||||
@ -242,7 +242,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 车站
|
// 车站
|
||||||
const kmPostShow = this.nameLevels.indexOf(12) !== -1;
|
const kmPostShow = this.nameLevels.includes(12);
|
||||||
const stationList = this.$store.getters['map/stationList'];
|
const stationList = this.$store.getters['map/stationList'];
|
||||||
if (stationList && stationList.length > 0) {
|
if (stationList && stationList.length > 0) {
|
||||||
stationList.forEach(elem => {
|
stationList.forEach(elem => {
|
||||||
|
@ -13,22 +13,23 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="el-dialog__body">
|
<div class="el-dialog__body">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-form ref="form" :model="formModel" :rules="rules">
|
<el-form ref="form" :model="formModel" :rules="rules" label-width="80px">
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item prop="groupNumber1" label="主动车:">
|
<el-form-item prop="groupNumber" label="主动车:">
|
||||||
<el-select v-model="formModel.groupNumber1" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
|
<el-input v-model="formModel.groupNumber" size="small" style="width: 165px;height: 32px;line-height: 32px;" disabled />
|
||||||
|
<!-- <el-select v-model="formModel.groupNumber" size="small" style="width: 165px;height: 32px;line-height: 32px;" placeholder="请选择">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in selectedList"
|
v-for="item in selectedList"
|
||||||
:key="item.code"
|
:key="item.code"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.code"
|
:value="item.code"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select> -->
|
||||||
<el-button
|
<!-- <el-button
|
||||||
:type="field == 'selectedCode1' ? 'danger' : 'primary'"
|
:type="field == 'selectedCode1' ? 'danger' : 'primary'"
|
||||||
size="small"
|
size="small"
|
||||||
@click="hover('selectedCode1')"
|
@click="hover('selectedCode1')"
|
||||||
>激活</el-button>
|
>激活</el-button> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
@ -87,14 +88,14 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
operation: '',
|
operation: '',
|
||||||
formModel: {
|
formModel: {
|
||||||
groupNumber1: '',
|
groupNumber: '',
|
||||||
groupNumber2: ''
|
groupNumber2: ''
|
||||||
},
|
},
|
||||||
groupNumber: '',
|
groupNumber: '',
|
||||||
field: '',
|
field: '',
|
||||||
rules: {
|
rules: {
|
||||||
faultType: [
|
groupNumber2: [
|
||||||
{ required: true, message: '请选择故障类型', trigger: 'change'}
|
{ required: true, message: '请选择被动车', trigger: 'change'}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -154,6 +155,7 @@ export default {
|
|||||||
this.cmdType = operate.cmdType;
|
this.cmdType = operate.cmdType;
|
||||||
}
|
}
|
||||||
if (selected._type) {
|
if (selected._type) {
|
||||||
|
this.formModel.groupNumber = selected.groupNumber;
|
||||||
this.dialogShow = true;
|
this.dialogShow = true;
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
this.$store.dispatch('training/emitTipFresh');
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
@ -181,7 +183,7 @@ export default {
|
|||||||
operation: menuOperate.Common.setLink.operation,
|
operation: menuOperate.Common.setLink.operation,
|
||||||
cmdType: menuOperate.Common.setLink.cmdType,
|
cmdType: menuOperate.Common.setLink.cmdType,
|
||||||
param: {
|
param: {
|
||||||
groupNumber1: this.formModel.groupNumber1,
|
groupNumber: this.formModel.groupNumber,
|
||||||
groupNumber2: this.formModel.groupNumber2
|
groupNumber2: this.formModel.groupNumber2
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -196,12 +198,12 @@ export default {
|
|||||||
this.doClose();
|
this.doClose();
|
||||||
} else {
|
} else {
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$messageBox('设置或取消故障操作失败!');
|
this.$messageBox('设置连挂失败!');
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.doClose();
|
this.doClose();
|
||||||
this.$messageBox(error.message || '设置或取消故障操作失败!');
|
this.$messageBox(error.message || '设置连挂失败!');
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -219,10 +221,11 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
deviceSelect(em) {
|
deviceSelect(em) {
|
||||||
if (this.field == 'selectedCode1' && em._type == 'Train') {
|
// if (this.field == 'selectedCode1' && em._type == 'Train') {
|
||||||
this.formModel.groupNumber1 = em.code;
|
// this.formModel.groupNumber1 = em.code;
|
||||||
this.field = '';
|
// this.field = '';
|
||||||
} else if (this.field == 'selectedCode2' && em._type == 'Train') {
|
// } else
|
||||||
|
if (this.field == 'selectedCode2' && em._type == 'Train') {
|
||||||
this.formModel.groupNumber2 = em.code;
|
this.formModel.groupNumber2 = em.code;
|
||||||
this.field = '';
|
this.field = '';
|
||||||
}
|
}
|
||||||
|
@ -20,9 +20,9 @@
|
|||||||
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px;" width="150px" />
|
<el-table-column :id="domIdChoose" prop="name" label="进路" style="margin-left:30px;" width="150px" />
|
||||||
<el-table-column prop="settable" label="状态" style="margin-left:30px;" width="100px">
|
<el-table-column prop="settable" label="状态" style="margin-left:30px;" width="100px">
|
||||||
<!--<template slot-scope="scope">-->
|
<!--<template slot-scope="scope">-->
|
||||||
<!--<span>{{ scope.row.settable == 1? '允许选排':'不能选排' }}</span>-->
|
<!--<span>{{ scope.row.settable == 1? '允许选排':'不能选排' }}</span>-->
|
||||||
<span>允许选排</span>
|
|
||||||
<!--</template>-->
|
<!--</template>-->
|
||||||
|
<span>允许选排</span>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column style="margin-left:30px;" />
|
<el-table-column style="margin-left:30px;" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -408,6 +408,7 @@ export const MainBodyNoShow = ['heb', 'designheb', 'jyd', 'designjyd', 'tky', 'd
|
|||||||
export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目
|
export const GenerateRouteProjectList = ['jsxt', 'refereeJsxt'];// 需要在公共路由中生成登录页面的项目
|
||||||
export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd']; // 登录页样式
|
export const ProjectLoginStyleList = ['jsxt', 'refereeJsxt', 'gzb', 'designgzb', 'xty', 'designxty', 'xadt', 'designxadt', 'tky', 'designtky', 'jyd', 'designjyd', 'bxkc', 'designbxkc', 'crsc', 'designcrsc', 'hls', 'designhls', 'drts', 'hyd', 'designhyd', 'nty', 'designnty', 'bjd', 'designbjd']; // 登录页样式
|
||||||
export const NoQrcodeList = ['heb', 'designheb'];
|
export const NoQrcodeList = ['heb', 'designheb'];
|
||||||
|
export const NoSimulationQrCodeList = ['heb', 'bjd'];
|
||||||
export const goOtherPlatformMenu = { // 导航栏快速切换平台
|
export const goOtherPlatformMenu = { // 导航栏快速切换平台
|
||||||
login: '/design/login',
|
login: '/design/login',
|
||||||
design: '/login',
|
design: '/login',
|
||||||
|
@ -662,7 +662,7 @@ export default {
|
|||||||
getSummaries(param) {
|
getSummaries(param) {
|
||||||
const { columns, data } = param;
|
const { columns, data } = param;
|
||||||
const sums = [];
|
const sums = [];
|
||||||
columns.forEach((column, index) => {
|
columns && columns.forEach((column, index) => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
sums[index] = '总分值';
|
sums[index] = '总分值';
|
||||||
return;
|
return;
|
||||||
@ -674,8 +674,10 @@ export default {
|
|||||||
values.push(item.id);
|
values.push(item.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
console.log(this.commandEvaluationRuleVOs);
|
||||||
sums[index] = values.reduce((prev, curr) => {
|
sums[index] = values.reduce((prev, curr) => {
|
||||||
const value = Number(this.commandEvaluationRuleVOs[curr].score);
|
let value = 0;
|
||||||
|
if (this.commandEvaluationRuleVOs[curr]) { value = Number(this.commandEvaluationRuleVOs[curr].score || 0); }
|
||||||
if (!isNaN(value)) {
|
if (!isNaN(value)) {
|
||||||
return prev + value;
|
return prev + value;
|
||||||
} else {
|
} else {
|
||||||
|
@ -673,7 +673,7 @@ export default {
|
|||||||
// this.$message.success('创建会话成功!');
|
// this.$message.success('创建会话成功!');
|
||||||
this.createLoading = false;
|
this.createLoading = false;
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建仿真失败!');
|
this.$message.error(error.code == '3005' ? '创建会话失败:仿真会话成员忙线中!' : '创建会话失败:' + error.message);
|
||||||
this.createLoading = false;
|
this.createLoading = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
@ -691,6 +691,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 语音录制开始
|
// 语音录制开始
|
||||||
startRecording() {
|
startRecording() {
|
||||||
|
this.audioPlay = true;
|
||||||
const that = this;
|
const that = this;
|
||||||
if (!this.recordSending) {
|
if (!this.recordSending) {
|
||||||
if (!this.recordSending && !this.recorders && !this.microphone) {
|
if (!this.recordSending && !this.recorders && !this.microphone) {
|
||||||
@ -709,11 +710,13 @@ export default {
|
|||||||
});
|
});
|
||||||
that.recorders.startRecording();
|
that.recorders.startRecording();
|
||||||
that.recordSending = true;
|
that.recordSending = true;
|
||||||
|
that.audioPlay = false;
|
||||||
that.inter = setInterval(() => {
|
that.inter = setInterval(() => {
|
||||||
if (that.seconds < 60) {
|
if (that.seconds < 60) {
|
||||||
that.seconds++;
|
that.seconds++;
|
||||||
} else {
|
} else {
|
||||||
clearInterval(that.inter);
|
clearInterval(that.inter);
|
||||||
|
that.stopRecording();
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
@ -769,6 +772,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 停止录制 发送语音
|
// 停止录制 发送语音
|
||||||
stopRecording() {
|
stopRecording() {
|
||||||
|
this.audioPlay = true;
|
||||||
const that = this;
|
const that = this;
|
||||||
this.recorders.stopRecording(function(blobURL) {
|
this.recorders.stopRecording(function(blobURL) {
|
||||||
clearInterval(that.inter);
|
clearInterval(that.inter);
|
||||||
@ -779,10 +783,12 @@ export default {
|
|||||||
sendSimulationConversition(that.group, that.conversitionId, fd)
|
sendSimulationConversition(that.group, that.conversitionId, fd)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
that.textContent = '';
|
that.textContent = '';
|
||||||
|
that.audioPlay = false;
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
that.$message.error('语音发送失败: ' + error.message);
|
that.$message.error('语音发送失败: ' + error.message);
|
||||||
|
that.audioPlay = false;
|
||||||
});
|
});
|
||||||
if (that.microphone) {
|
if (that.microphone) {
|
||||||
that.microphone.stop();
|
that.microphone.stop();
|
||||||
|
@ -222,10 +222,10 @@ export const operateEnum = {
|
|||||||
Train_Link: {
|
Train_Link: {
|
||||||
isList:true,
|
isList:true,
|
||||||
params:[
|
params:[
|
||||||
{
|
// {
|
||||||
code:'groupNumber1',
|
// code:'groupNumber1',
|
||||||
name:'主动车'
|
// name:'主动车'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
code:'groupNumber2',
|
code:'groupNumber2',
|
||||||
name:'被动车'
|
name:'被动车'
|
||||||
|
@ -7,22 +7,21 @@
|
|||||||
<div class="btn_hover" @click="menuClick">菜单</div>
|
<div class="btn_hover" @click="menuClick">菜单</div>
|
||||||
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
|
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
|
||||||
<!-- 设备视图 -->
|
<!-- 设备视图 -->
|
||||||
<el-button v-if="isShow3dmodel && isShowScheduling" size="small" @click="jumpjlmap3dmodel">{{ $t('display.demon.deviceView') }}</el-button>
|
<el-button v-if="(isShow3dmodel && isShowScheduling)&&project !== 'bjd'" size="small" @click="jumpjlmap3dmodel">{{ $t('display.demon.deviceView') }}</el-button>
|
||||||
<!-- 三维视图 / 司机视角 -->
|
<!-- 三维视图 / 司机视角 -->
|
||||||
<el-button v-if="isShowScheduling || isDriver" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
|
<el-button v-if="(isShowScheduling || isDriver)&&project !== 'bjd'" size="small" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
|
||||||
<!-- cctv视图 -->
|
<!-- cctv视图 -->
|
||||||
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
|
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dpassflow">{{ $t('display.demon.passengerflow') }}</el-button>
|
||||||
<el-button v-if="isShowScheduling || isStationSupervisor" size="small" @click="jumpjl3dfaultdevice">{{ $t('display.demon.maintainer') }}</el-button>
|
<el-button v-if="(isShowScheduling || isStationSupervisor)&&project !== 'bjd'" size="small" @click="jumpjl3dfaultdevice">{{ $t('display.demon.maintainer') }}</el-button>
|
||||||
<!-- <el-button v-if="isAdmin" size="small" @click="otherVrView">VR第三人称视角</el-button> -->
|
<!-- <el-button v-if="isAdmin" size="small" @click="otherVrView">VR第三人称视角</el-button> -->
|
||||||
<el-button v-if="isAdmin && !noQrcodeList.includes(project) && $route.query.type !== 'ILW'" type="primary" size="small" @click="generateQrCode">生成二维码</el-button>
|
<el-button v-if="qrCodeShow" type="primary" size="small" @click="generateQrCode">生成二维码</el-button>
|
||||||
<el-button v-if="isAdmin && $route.query.type !== 'ILW'" size="small" @click="memberManage">成员管理</el-button>
|
<el-button v-if="memberManageShow" size="small" @click="memberManage">成员管理</el-button>
|
||||||
<el-button v-if="(isAdmin && isProject) || $route.query.type === 'ILW'" size="small" @click="handleEquipment">设备管理</el-button>
|
<el-button v-if="deviceManageShow" size="small" @click="handleEquipment">设备管理</el-button>
|
||||||
<el-button v-if="isDeviceLogin" size="small" @click="handleTeach">教学系统</el-button>
|
<el-button v-if="teachSystemShow" size="small" @click="handleTeach">教学系统</el-button>
|
||||||
<el-button v-if="isDeviceLogin || $route.query.type === 'IM'" size="small" @click="handleExam">考试系统</el-button>
|
<el-button v-if="examSystemShow" size="small" @click="handleExam">考试系统</el-button>
|
||||||
<template v-if="project === 'bjd'">
|
<template v-if="project === 'bjd'">
|
||||||
<el-button v-if="running && !dataError" size="small" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
|
<el-button v-if="running" size="small" @click="viewRunPlan">{{ $t('joinTraining.runGraphPreview') }}</el-button>
|
||||||
<el-button v-if="!running && !dataError" size="small" type="warning" @click="loadRunPlan">{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- 运行图加载 -->
|
<el-button v-if="!running" size="small" type="warning" @click="loadRunPlan">{{ $t('joinTraining.runGraphLoading') }}</el-button><!-- 运行图加载 -->
|
||||||
<el-button v-if="isAdmin && !dataError" size="small" :type="faultMode ? '' : 'primary' " @click="changeOperateMode()">{{ faultMode?' 切换到普通模式':'切换到故障模式' }}</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
@ -60,10 +59,9 @@ import { exitFullscreen } from '@/utils/screen';
|
|||||||
import { getSimulationQrcode } from '@/api/jointSimulation';
|
import { getSimulationQrcode } from '@/api/jointSimulation';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
|
import { refereeExitSimulation, quitCurrentRace, startPracticalCompetition, submitPracticalCompetition } from '@/api/competition';
|
||||||
import { NoQrcodeList } from '@/scripts/ProjectConfig';
|
import { NoSimulationQrCodeList } from '@/scripts/ProjectConfig';
|
||||||
import { getPublishLessonListByMapId } from '@/api/jmap/lesson';
|
import { getPublishLessonListByMapId } from '@/api/jmap/lesson';
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
import { OperateMode } from '@/scripts/ConstDic';
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'MenuDemonJoint',
|
name: 'MenuDemonJoint',
|
||||||
@ -119,12 +117,11 @@ export default {
|
|||||||
chatShow: true,
|
chatShow: true,
|
||||||
jsStart: true,
|
jsStart: true,
|
||||||
isGoback: false,
|
isGoback: false,
|
||||||
noQrcodeList: NoQrcodeList,
|
noSimulationQrCodeList: NoSimulationQrCodeList,
|
||||||
isShow3dmodel :false,
|
isShow3dmodel :false,
|
||||||
jl3dname: this.$t('display.demon.threeDimensionalView'),
|
jl3dname: this.$t('display.demon.threeDimensionalView'),
|
||||||
hoverBtn: false,
|
hoverBtn: false,
|
||||||
btnWidth: 0,
|
btnWidth: 0
|
||||||
faultMode: false
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -155,7 +152,7 @@ export default {
|
|||||||
if ((this.isShow3dmodel && this.isShowScheduling) ||
|
if ((this.isShow3dmodel && this.isShowScheduling) ||
|
||||||
(this.isShowScheduling || this.isDriver) ||
|
(this.isShowScheduling || this.isDriver) ||
|
||||||
(this.isShowScheduling || this.isStationSupervisor) ||
|
(this.isShowScheduling || this.isStationSupervisor) ||
|
||||||
(this.isAdmin && !this.noQrcodeList.includes(this.project)) ||
|
(this.isAdmin && !this.noSimulationQrCodeList.includes(this.project)) ||
|
||||||
(this.isAdmin) || (this.isAdmin && this.isProject) || this.isDeviceLogin || this.$route.query.type === 'IM') {
|
(this.isAdmin) || (this.isAdmin && this.isProject) || this.isDeviceLogin || this.$route.query.type === 'IM') {
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
@ -165,6 +162,23 @@ export default {
|
|||||||
const typeList = ['LW', 'CW'];
|
const typeList = ['LW', 'CW'];
|
||||||
return typeList.includes(this.$route.query.type);
|
return typeList.includes(this.$route.query.type);
|
||||||
},
|
},
|
||||||
|
examSystemShow() {
|
||||||
|
const typeList = ['LW', 'CW', 'IM'];
|
||||||
|
return typeList.includes(this.$route.query.type);
|
||||||
|
},
|
||||||
|
teachSystemShow() {
|
||||||
|
const typeList = ['LW', 'CW'];
|
||||||
|
return typeList.includes(this.$route.query.type);
|
||||||
|
},
|
||||||
|
memberManageShow() {
|
||||||
|
return this.isAdmin && this.$route.query.type !== 'ILW' && this.project !== 'bjd';
|
||||||
|
},
|
||||||
|
deviceManageShow() {
|
||||||
|
return (this.isAdmin && this.isProject && this.project !== 'bjd') || this.$route.query.type === 'ILW';
|
||||||
|
},
|
||||||
|
qrCodeShow() {
|
||||||
|
return this.isAdmin && !this.noSimulationQrCodeList.includes(this.project) && this.$route.query.type !== 'ILW';
|
||||||
|
},
|
||||||
isDisable() {
|
isDisable() {
|
||||||
return this.$store.state.training.started;
|
return this.$store.state.training.started;
|
||||||
},
|
},
|
||||||
@ -503,14 +517,6 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeOperateMode() {
|
|
||||||
this.faultMode = !this.faultMode;
|
|
||||||
let mode = OperateMode.NORMAL;
|
|
||||||
if (this.faultMode) {
|
|
||||||
mode = OperateMode.FAULT;
|
|
||||||
}
|
|
||||||
this.$store.dispatch('training/changeOperateMode', { mode: mode });
|
|
||||||
},
|
|
||||||
loadRunPlan() {
|
loadRunPlan() {
|
||||||
this.$emit('runPlanLoadShow');
|
this.$emit('runPlanLoadShow');
|
||||||
},
|
},
|
||||||
|
@ -158,8 +158,8 @@ export default {
|
|||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{ text: '地图排序', handler: this.mapSort },
|
{ text: '地图排序', handler: this.mapSort },
|
||||||
{ text: '导出', handler: this.localExport, show: () => { return this.$store.state.user.roles.indexOf(superAdmin) > 0; }},
|
{ text: '导出', handler: this.localExport, show: () => { return this.$store.state.user.roles.includes(superAdmin); }},
|
||||||
{ text: '导入', handler: this.localImport, fileType: 'file', show: () => { return this.$store.state.user.roles.indexOf(superAdmin) > 0; }}
|
{ text: '导入', handler: this.localImport, fileType: 'file', show: () => { return this.$store.state.user.roles.includes(superAdmin); }}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ export default {
|
|||||||
type: 'button',
|
type: 'button',
|
||||||
title: this.$t('global.operate'),
|
title: this.$t('global.operate'),
|
||||||
width: '450',
|
width: '450',
|
||||||
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
hide: () => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: this.$t('global.preview'),
|
name: this.$t('global.preview'),
|
||||||
|
@ -66,7 +66,7 @@ export default {
|
|||||||
type: 'button',
|
type: 'button',
|
||||||
title: this.$t('global.operate'),
|
title: this.$t('global.operate'),
|
||||||
width: '250',
|
width: '250',
|
||||||
hide: (row) => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
hide: (row) => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: this.$t('global.preview'),
|
name: this.$t('global.preview'),
|
||||||
|
@ -66,7 +66,7 @@ export default {
|
|||||||
type: 'button',
|
type: 'button',
|
||||||
title: this.$t('global.operate'),
|
title: this.$t('global.operate'),
|
||||||
width: '550',
|
width: '550',
|
||||||
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
hide: () => { return !this.$store.state.user.roles.includes(superAdmin); },
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: this.$t('publish.generateRunPlan'),
|
name: this.$t('publish.generateRunPlan'),
|
||||||
|
@ -80,7 +80,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
return data.label.indexOf(value) !== -1;
|
return data.label.includes(value);
|
||||||
},
|
},
|
||||||
changeRole(member) {
|
changeRole(member) {
|
||||||
if (member) {
|
if (member) {
|
||||||
|
@ -249,7 +249,7 @@ export default {
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
covertButtonname() {
|
covertButtonname() {
|
||||||
if (this.$store.getters.roles.indexOf(admin) >= 0 || this.$store.getters.roles.indexOf(superAdmin) >= 0) {
|
if (this.$store.getters.roles.includes(admin) || this.$store.getters.roles.includes(superAdmin)) {
|
||||||
return this.$t('scriptRecord.publish');
|
return this.$t('scriptRecord.publish');
|
||||||
} else {
|
} else {
|
||||||
return this.$t('scriptRecord.applyPublish');
|
return this.$t('scriptRecord.applyPublish');
|
||||||
|
@ -32,7 +32,6 @@ export default {
|
|||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
formModel: {
|
formModel: {
|
||||||
fromCode: '',
|
fromCode: '',
|
||||||
fromName: '',
|
|
||||||
targetIds: '',
|
targetIds: '',
|
||||||
deviceType: []
|
deviceType: []
|
||||||
},
|
},
|
||||||
@ -44,8 +43,8 @@ export default {
|
|||||||
const form = {
|
const form = {
|
||||||
labelWidth: '100px',
|
labelWidth: '100px',
|
||||||
items: [
|
items: [
|
||||||
{ prop: 'fromName', label: '源线路', type: 'text', disabled: true },
|
{ prop: 'fromCode', label: '源线路', type: 'select', options: this.originList, change:true, onChange:this.originChange},
|
||||||
{ prop: 'targetIds', label:'拷贝线路', type: 'select', options: this.targetList, multiple: true },
|
{ prop: 'targetIds', label:'拷贝线路', type: 'select', options: this.targetList, multiple: true, deviceChange: this.targetChange },
|
||||||
{ prop: 'deviceType', label: '操作对象', type: 'select', options: this.deviceTypeList, multiple: true }
|
{ prop: 'deviceType', label: '操作对象', type: 'select', options: this.deviceTypeList, multiple: true }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@ -53,7 +52,7 @@ export default {
|
|||||||
},
|
},
|
||||||
rules() {
|
rules() {
|
||||||
return {
|
return {
|
||||||
fromName: [
|
fromCode: [
|
||||||
{ required: true, message: '请选择拷贝源线路', trigger: 'blur' }
|
{ required: true, message: '请选择拷贝源线路', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
targetIds: [
|
targetIds: [
|
||||||
@ -63,19 +62,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doShow(lineCode) {
|
doShow() {
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
if (lineCode) {
|
this.targetList = [];
|
||||||
this.targetList = [];
|
this.originList = [];
|
||||||
this.taskStatusList.forEach(item => {
|
this.taskStatusList.forEach(item => {
|
||||||
if (item.value != lineCode) {
|
this.targetList.push(item);
|
||||||
this.targetList.push(item);
|
this.originList.push(item);
|
||||||
} else {
|
});
|
||||||
this.formModel.fromCode = item.value;
|
|
||||||
this.formModel.fromName = item.label;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
doSave() {
|
doSave() {
|
||||||
this.$refs.dataform.validateForm(() => {
|
this.$refs.dataform.validateForm(() => {
|
||||||
@ -93,6 +87,28 @@ export default {
|
|||||||
handleClose() {
|
handleClose() {
|
||||||
this.$refs.dataform.resetForm();
|
this.$refs.dataform.resetForm();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
|
},
|
||||||
|
originChange(fromCode) {
|
||||||
|
this.formModel.fromCode = fromCode;
|
||||||
|
this.formModel.targetIds = '';
|
||||||
|
this.targetList = this.targetList.map(each=>{
|
||||||
|
if (each.value == fromCode) {
|
||||||
|
each.disabled = true;
|
||||||
|
} else {
|
||||||
|
each.disabled = false;
|
||||||
|
}
|
||||||
|
return each;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
targetChange(targetIds) {
|
||||||
|
this.originList = this.originList.map(each=>{
|
||||||
|
if (targetIds.includes(each.value)) {
|
||||||
|
each.disabled = true;
|
||||||
|
} else {
|
||||||
|
each.disabled = false;
|
||||||
|
}
|
||||||
|
return each;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -126,9 +126,7 @@ export default {
|
|||||||
{ text: this.$t('global.add'), handler: this.handleAdd },
|
{ text: this.$t('global.add'), handler: this.handleAdd },
|
||||||
{ text: '复刻', handler: this.handleCopyAll }
|
{ text: '复刻', handler: this.handleCopyAll }
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
|
|
||||||
currentModel: {}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
@ -201,8 +199,8 @@ export default {
|
|||||||
cancelButtonText: this.$t('global.cancel'),
|
cancelButtonText: this.$t('global.cancel'),
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const param = row;
|
// const param = row;
|
||||||
createCommand(param).then(response => {
|
createCommand(row).then(response => {
|
||||||
this.$message.success('复制指令成功!');
|
this.$message.success('复制指令成功!');
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
@ -212,13 +210,12 @@ export default {
|
|||||||
},
|
},
|
||||||
// 复制线路到其他线路 操作
|
// 复制线路到其他线路 操作
|
||||||
handleCopyAll() {
|
handleCopyAll() {
|
||||||
this.$refs.copyParam.doShow(this.lineCode);
|
this.$refs.copyParam.doShow();
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
},
|
},
|
||||||
convertField(list, status) {
|
convertField(list, status) {
|
||||||
console.log(list, typeof list, status);
|
|
||||||
if (list && list.length > 0) { return list.find(each=>{ return status == each.value; }).label; }
|
if (list && list.length > 0) { return list.find(each=>{ return status == each.value; }).label; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,9 +59,6 @@
|
|||||||
import { getRealLineConfigList, putRealLineConfig } from '@/api/management/mapline';
|
import { getRealLineConfigList, putRealLineConfig } from '@/api/management/mapline';
|
||||||
export default {
|
export default {
|
||||||
name: 'Config',
|
name: 'Config',
|
||||||
components: {
|
|
||||||
// EditConfig
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -146,21 +143,21 @@ export default {
|
|||||||
let rangeStart = 0;
|
let rangeStart = 0;
|
||||||
let rangeEnd = 0;
|
let rangeEnd = 0;
|
||||||
let options = [];
|
let options = [];
|
||||||
if (this.booleanList.indexOf(key) >= 0) {
|
if (this.booleanList.includes(key)) {
|
||||||
type = 'boolean';
|
type = 'boolean';
|
||||||
} else if (this.selectList.indexOf(key) >= 0) {
|
} else if (this.selectList.includes(key)) {
|
||||||
type = 'select';
|
type = 'select';
|
||||||
options = this.optionsMap[key];
|
options = this.optionsMap[key];
|
||||||
} else if (this.numberList.indexOf(key) >= 0) {
|
} else if (this.numberList.includes(key)) {
|
||||||
type = 'number';
|
type = 'number';
|
||||||
} else if (this.rangeList.indexOf(key) >= 0) {
|
} else if (this.rangeList.includes(key)) {
|
||||||
type = 'range';
|
type = 'range';
|
||||||
if (res.data[key]) {
|
if (res.data[key]) {
|
||||||
const ranges = res.data[key].split('-');
|
const ranges = res.data[key].split('-');
|
||||||
rangeStart = ranges[0];
|
rangeStart = ranges[0];
|
||||||
rangeEnd = ranges[1];
|
rangeEnd = ranges[1];
|
||||||
}
|
}
|
||||||
} else if (this.speedList.indexOf(key) >= 0) {
|
} else if (this.speedList.includes(key)) {
|
||||||
type = 'speed';
|
type = 'speed';
|
||||||
} else {
|
} else {
|
||||||
type = 'input';
|
type = 'input';
|
||||||
@ -195,13 +192,6 @@ export default {
|
|||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addModel() {
|
|
||||||
this.$refs.addConfig.show();
|
|
||||||
},
|
|
||||||
editModel(item, index) {
|
|
||||||
this.$refs.editConfig.show(item);
|
|
||||||
this.index = index;
|
|
||||||
},
|
|
||||||
save() {
|
save() {
|
||||||
const param = {};
|
const param = {};
|
||||||
this.generalData.forEach(item => {
|
this.generalData.forEach(item => {
|
||||||
|
@ -12,12 +12,6 @@
|
|||||||
import { addSkinCode, updateSkinCode } from '@/api/management/mapline';
|
import { addSkinCode, updateSkinCode } from '@/api/management/mapline';
|
||||||
export default {
|
export default {
|
||||||
name: 'DictionaryEdit',
|
name: 'DictionaryEdit',
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
@ -27,20 +21,21 @@ export default {
|
|||||||
name: '',
|
name: '',
|
||||||
origin: { x: 0, y: 0 },
|
origin: { x: 0, y: 0 },
|
||||||
scaling: 1
|
scaling: 1
|
||||||
}
|
},
|
||||||
|
isAdd:false,
|
||||||
|
title:''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
form() {
|
form() {
|
||||||
const isAdd = this.type === 'ADD';
|
|
||||||
const form = {
|
const form = {
|
||||||
labelWidth: '100px',
|
labelWidth: '100px',
|
||||||
items: [
|
items: [
|
||||||
{ prop: 'code', label: this.$t('system.code'), type: 'text', disabled: !isAdd },
|
{ prop: 'code', label: this.$t('system.code'), type: 'text', disabled: !this.isAdd },
|
||||||
{ prop: 'name', label: this.$t('system.name'), type: 'text' },
|
{ prop: 'name', label: this.$t('system.name'), type: 'text' },
|
||||||
{ prop: 'origin', label: '坐标:', type: 'coordinate', children: [
|
{ prop: 'origin', label: '坐标:', type: 'coordinate', children: [
|
||||||
{ prop: 'origin.x', firstLevel: 'origin', secondLevel: 'x', label: 'x', type: 'number', labelWidth: '20px'},
|
{ prop: 'origin.x', firstLevel: 'origin', secondLevel: 'x', label: 'x', type: 'number', labelWidth: '30px'},
|
||||||
{ prop: 'origin.y', firstLevel: 'origin', secondLevel: 'y', label: 'y', type: 'number', labelWidth: '20px'}
|
{ prop: 'origin.y', firstLevel: 'origin', secondLevel: 'y', label: 'y', type: 'number', labelWidth: '30px'}
|
||||||
] },
|
] },
|
||||||
{ prop: 'scaling', label: '缩放比例:', type: 'number', min: 0.4, max: 8, step: 0.2 }
|
{ prop: 'scaling', label: '缩放比例:', type: 'number', min: 0.4, max: 8, step: 0.2 }
|
||||||
]
|
]
|
||||||
@ -49,6 +44,9 @@ export default {
|
|||||||
},
|
},
|
||||||
rules() {
|
rules() {
|
||||||
const crules = {
|
const crules = {
|
||||||
|
code: [
|
||||||
|
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' }
|
||||||
|
],
|
||||||
name: [
|
name: [
|
||||||
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' }
|
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
@ -65,27 +63,11 @@ export default {
|
|||||||
{ required: true, message: '请输入缩放比例', trigger: 'blur' }
|
{ required: true, message: '请输入缩放比例', trigger: 'blur' }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
if (this.type === 'ADD') {
|
return crules;
|
||||||
return Object.assign(crules, {
|
|
||||||
code: [
|
|
||||||
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' }
|
|
||||||
]
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return crules;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
title() {
|
|
||||||
if (this.type === 'ADD') {
|
|
||||||
return this.$t('system.createDirectory');
|
|
||||||
} else {
|
|
||||||
return this.$t('system.editDictionary');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
show(row) {
|
show(row) {
|
||||||
this.dialogVisible = true;
|
|
||||||
if (row && row.id) {
|
if (row && row.id) {
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
id: row.id,
|
id: row.id,
|
||||||
@ -94,12 +76,18 @@ export default {
|
|||||||
origin: row.origin,
|
origin: row.origin,
|
||||||
scaling: row.scaling
|
scaling: row.scaling
|
||||||
};
|
};
|
||||||
|
this.isAdd = false;
|
||||||
|
this.title = this.$t('system.editDictionary');
|
||||||
|
} else {
|
||||||
|
this.isAdd = true;
|
||||||
|
this.title = this.$t('system.createDirectory');
|
||||||
}
|
}
|
||||||
|
this.dialogVisible = true;
|
||||||
},
|
},
|
||||||
doSave() {
|
doSave() {
|
||||||
const self = this;
|
const self = this;
|
||||||
this.$refs.dataform.validateForm(() => {
|
this.$refs.dataform.validateForm(() => {
|
||||||
if (self.type === 'ADD') {
|
if (this.isAdd === 'ADD') {
|
||||||
self.create();
|
self.create();
|
||||||
} else {
|
} else {
|
||||||
self.update();
|
self.update();
|
||||||
|
@ -1,119 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false" :z-index="3000">
|
|
||||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
|
||||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'DictionaryEdit',
|
|
||||||
props: {
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialogVisible: false,
|
|
||||||
formModel: {
|
|
||||||
configKey: '',
|
|
||||||
configValue: '',
|
|
||||||
boolean: false
|
|
||||||
// description: ''
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
form() {
|
|
||||||
const form = {
|
|
||||||
labelWidth: '100px',
|
|
||||||
items: [
|
|
||||||
{ prop: 'configKey', label: 'key:', type: 'text' }
|
|
||||||
// { prop: 'description', label: '描述:', type: 'text' }
|
|
||||||
]
|
|
||||||
};
|
|
||||||
return form;
|
|
||||||
},
|
|
||||||
rules() {
|
|
||||||
const rules = {
|
|
||||||
configKey: [
|
|
||||||
{ required: true, message: '请输入key值', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
configValue: [
|
|
||||||
{ required: true, message: '请输入value值', trigger: 'blur' }
|
|
||||||
]
|
|
||||||
// remarks: [
|
|
||||||
// { required: true, message: '请输入描述', trigger: 'blur' }
|
|
||||||
// ]
|
|
||||||
};
|
|
||||||
return rules;
|
|
||||||
},
|
|
||||||
title() {
|
|
||||||
if (this.type === 'ADD') {
|
|
||||||
return '添加配置项';
|
|
||||||
} else {
|
|
||||||
return '修改配置项';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
show(row) {
|
|
||||||
this.dialogVisible = true;
|
|
||||||
if (row && row.configKey) {
|
|
||||||
this.formModel = {
|
|
||||||
configKey: row.configKey,
|
|
||||||
configValue: JSON.parse(row.configValue),
|
|
||||||
boolean: row.boolean
|
|
||||||
// description: row.description
|
|
||||||
};
|
|
||||||
}
|
|
||||||
},
|
|
||||||
doSave() {
|
|
||||||
const self = this;
|
|
||||||
this.$refs.dataform.validateForm(() => {
|
|
||||||
if (self.type === 'ADD') {
|
|
||||||
self.create();
|
|
||||||
} else {
|
|
||||||
self.update();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
buildModel(data) {
|
|
||||||
return {
|
|
||||||
configKey: data.configKey,
|
|
||||||
configValue: data.boolean ? JSON.stringify(data.configValue) : data.configValue,
|
|
||||||
boolean: data.boolean
|
|
||||||
};
|
|
||||||
},
|
|
||||||
create() {
|
|
||||||
this.$emit('create', this.buildModel(this.formModel));
|
|
||||||
this.handleClose();
|
|
||||||
},
|
|
||||||
update() {
|
|
||||||
this.$emit('update', this.buildModel(this.formModel));
|
|
||||||
this.handleClose();
|
|
||||||
},
|
|
||||||
handleClose(done) {
|
|
||||||
this.formModel = {
|
|
||||||
configKey: '',
|
|
||||||
configValue: ''
|
|
||||||
// description: ''
|
|
||||||
};
|
|
||||||
this.$refs.dataform.resetForm();
|
|
||||||
if (done) {
|
|
||||||
done();
|
|
||||||
} else {
|
|
||||||
this.dialogVisible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
|
||||||
|
|
||||||
</style>
|
|
@ -1,8 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||||
<edit ref="create" type="ADD" @reloadTable="reloadTable" />
|
<edit ref="edit" @reloadTable="reloadTable" />
|
||||||
<edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
|
||||||
<config ref="config" @reloadTable="reloadTable" />
|
<config ref="config" @reloadTable="reloadTable" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -106,7 +105,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 新增指令
|
// 新增指令
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.$refs.create.show();
|
this.$refs.edit.show();
|
||||||
|
// this.$refs.create.show();
|
||||||
},
|
},
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
|
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
|
||||||
|
@ -178,7 +178,7 @@ export default {
|
|||||||
},
|
},
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.name.indexOf(value) !== -1;
|
return data.name.includes(value);
|
||||||
},
|
},
|
||||||
buy() {
|
buy() {
|
||||||
// this.disabled = true;
|
// this.disabled = true;
|
||||||
|
@ -95,7 +95,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.name.indexOf(value) !== -1;
|
return data.name.includes(value);
|
||||||
},
|
},
|
||||||
showContextMenu(e, obj, node, vueElem) {
|
showContextMenu(e, obj, node, vueElem) {
|
||||||
if (obj) {
|
if (obj) {
|
||||||
|
Loading…
Reference in New Issue
Block a user