Merge branch 'master' of https://git.qcloud.com/joylink/jl-nclient
This commit is contained in:
commit
01b871fa77
@ -165,8 +165,8 @@ export default {
|
||||
},
|
||||
beforeQuery: {
|
||||
type: Function,
|
||||
default() {
|
||||
return () => {};
|
||||
default(val) {
|
||||
return val;
|
||||
}
|
||||
},
|
||||
canQuery: {
|
||||
@ -447,12 +447,12 @@ export default {
|
||||
}
|
||||
// 对所有的数据进行trim操作
|
||||
for (const item in resultData) {
|
||||
if (resultData[item].trim) {
|
||||
if (resultData[item] && resultData[item].trim) {
|
||||
resultData[item] = resultData[item].trim();
|
||||
}
|
||||
}
|
||||
// 查询前数据处理
|
||||
resultData = this.beforeQuery ? this.beforeQuery(resultData) : resultData;
|
||||
resultData = this.beforeQuery(resultData);
|
||||
return resultData;
|
||||
},
|
||||
query() {
|
||||
|
@ -44,6 +44,17 @@
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
/>
|
||||
<el-table-column
|
||||
v-else-if="checkColumnTyep(column, 'basicText')"
|
||||
:key="index"
|
||||
:label="column.title"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span class="hideOutContent">{{ column.columnValue(scope.row, scope.$index) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-else-if="checkColumnTyep(column, 'tag')"
|
||||
:key="index"
|
||||
|
@ -406,20 +406,6 @@ class SkinStyle extends defaultStyle {
|
||||
this[deviceType.Train] = {
|
||||
trainBody: {
|
||||
trainBodyLineWidth: 0.1, // 车身line宽
|
||||
trainBodyOnMouseOver: {
|
||||
train: true,
|
||||
textTrainNumber: false,
|
||||
textTrainServer: false,
|
||||
textTrainTarget: false,
|
||||
textTrainTargetNumber: false
|
||||
}, // 车身鼠标悬浮事件
|
||||
trainBodyOnMouseOut: {
|
||||
train: true,
|
||||
textTrainNumber: false,
|
||||
textTrainServer: false,
|
||||
textTrainTarget: false,
|
||||
textTrainTargetNumber: false
|
||||
}, // 车身鼠标移出事件
|
||||
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
specialTrainType: [], // 特殊列车类型需设置显示格式
|
||||
lrPadding: 4, // 两边间隔
|
||||
|
@ -368,20 +368,6 @@ class SkinStyle extends defaultStyle {
|
||||
this[deviceType.Train] = {
|
||||
trainBody: {
|
||||
trainBodyLineWidth: 1, // 车身line宽
|
||||
trainBodyOnMouseOver: {
|
||||
train: true,
|
||||
textTrainNumber: false,
|
||||
textTrainServer: false,
|
||||
textTrainTarget: false,
|
||||
textTrainTargetNumber: false
|
||||
}, // 车身鼠标悬浮事件
|
||||
trainBodyOnMouseOut: {
|
||||
train: true,
|
||||
textTrainNumber: false,
|
||||
textTrainServer: false,
|
||||
textTrainTarget: false,
|
||||
textTrainTargetNumber: false
|
||||
}, // 车身鼠标移出事件
|
||||
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
specialTrainType: [], // 特殊列车类型需设置显示格式
|
||||
lrPadding: 4, // 两边间隔
|
||||
@ -440,12 +426,11 @@ class SkinStyle extends defaultStyle {
|
||||
},
|
||||
trainStatusStyle: {
|
||||
defaultDestinationColor: '#FFFFFF', // 默认目的地状态显示颜色
|
||||
destinationStatusSetText: 'trainTarget', // 目的地状态设置的对应哪个text的颜色
|
||||
destinationStatusSetText: 'trainWindowBorder', // 目的地状态设置的对应哪个颜色
|
||||
destinationStatus: [
|
||||
{status: '01', showColor: '#FFFFFF'},
|
||||
{status: '02', showColor: '#00FF00'},
|
||||
{status: '03', showColor: '#A0522D'},
|
||||
{status: '04', showColor: '#FFFF00'}
|
||||
{status: '03', showColor: '#A0522D'}
|
||||
], // 目的地状态 01准点 02早点 03晚点 04头码车
|
||||
serverNoType: [
|
||||
{type: '01', showColor: '#FFFFFF'},
|
||||
@ -494,13 +479,13 @@ class SkinStyle extends defaultStyle {
|
||||
runModeStatus: [
|
||||
{
|
||||
status: '01',
|
||||
trainLColor: '#FFFFFF',
|
||||
trainRColor: '#FFFFFF'
|
||||
trainLColor: '#00FF00',
|
||||
trainRColor: '#00FF00'
|
||||
},
|
||||
{
|
||||
status: '02',
|
||||
trainLColor: '#00FF00',
|
||||
trainRColor: '#00FF00'
|
||||
trainLColor: '#FF8000',
|
||||
trainRColor: '#FF8000'
|
||||
},
|
||||
{
|
||||
status: '03',
|
||||
|
@ -365,20 +365,6 @@ class SkinStyle extends defaultStyle {
|
||||
this[deviceType.Train] = {
|
||||
trainBody: {
|
||||
trainBodyLineWidth: 1, // 车身line宽
|
||||
trainBodyOnMouseOver: {
|
||||
train: true,
|
||||
textTrainNumber: false,
|
||||
textTrainServer: false,
|
||||
textTrainTarget: false,
|
||||
textTrainTargetNumber: false
|
||||
}, // 车身鼠标悬浮事件
|
||||
trainBodyOnMouseOut: {
|
||||
train: true,
|
||||
textTrainNumber: false,
|
||||
textTrainServer: false,
|
||||
textTrainTarget: false,
|
||||
textTrainTargetNumber: false
|
||||
}, // 车身鼠标移出事件
|
||||
changeTrainWidth: false, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
specialTrainType: [], // 特殊列车类型需设置显示格式
|
||||
lrPadding: 4, // 两边间隔
|
||||
|
@ -314,20 +314,6 @@ class SkinStyle extends defaultStyle {
|
||||
this[deviceType.Train] = {
|
||||
trainBody: {
|
||||
trainBodyLineWidth: 0, // 车身line宽
|
||||
trainBodyOnMouseOver: {
|
||||
train: true,
|
||||
textTrainNumber: false,
|
||||
textTrainServer: false,
|
||||
textTrainTarget: false,
|
||||
textTrainTargetNumber: false
|
||||
}, // 车身鼠标悬浮事件
|
||||
trainBodyOnMouseOut: {
|
||||
train: true,
|
||||
textTrainNumber: false,
|
||||
textTrainServer: false,
|
||||
textTrainTarget: false,
|
||||
textTrainTargetNumber: false
|
||||
}, // 车身鼠标移出事件
|
||||
changeTrainWidth: true, // 是否根据车身上车组号、服务号、车次号、目的地码显示情况改变列车长度
|
||||
specialTrainType: [
|
||||
{
|
||||
|
@ -402,6 +402,11 @@ class Jlmap {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 设置地图位置
|
||||
setPosition(payload) {
|
||||
this.$options && this.$options.update(payload);
|
||||
}
|
||||
}
|
||||
|
||||
export default Jlmap;
|
||||
|
@ -24,7 +24,7 @@ class EMouse extends Group {
|
||||
style: {
|
||||
x: this.device.model.point.x + 50,
|
||||
y: this.device.model.point.y + 25,
|
||||
text: `列车类型: 计划车\n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.trackName : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`,
|
||||
text: `列车类型: 计划车\n表\0\0\0\0号: ${this.device.model.serviceNumber}\n车\0次\0号: ${this.device.model.tripNumber}\n目的地号: ${this.device.model.targetCode ? this.device.model.targetCode : ''}\n车\0组\0号: ${this.device.model.groupNumber}\n早\0晚\0点: ${destinationText}\n运行方向: ${this.device.model.directionType == '02' ? '上行' : '下行'}\n乘务组号: \n起点站名: \n终点站名: \n占用轨道: ${this.device.model.sectionModel ? this.device.model.sectionModel.name : ''}\n所在车站: \n车地通信: 正常\n运行等级: 4\n扣车状态: ${this.device.model.runControlStatus == '01' ? '正常' : this.device.model.runControlStatus == '03' ? '跳停' : '扣车'}\n停稳状态: ${this.device.model.runStatus == '02' ? '未停稳' : '停稳'}\n阻塞状态: 无\n列车速度: ${this.device.model.speed || 0} km/h\n列车移动授权距离: ${this.device.model.maLen || 0} m`,
|
||||
textFill: '#000',
|
||||
textAlign: 'letf',
|
||||
textFont: 10 + 'px consolas',
|
||||
|
@ -39,18 +39,8 @@ export default class TrainBody extends Group {
|
||||
this.trainBodyBox = new TrainBodyBox({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: style.Train.common.trainWidth,
|
||||
height: style.Train.common.trainHeight
|
||||
},
|
||||
style: {
|
||||
lineWidth: style.Train.trainBody.trainBodyLineWidth,
|
||||
stroke: style.trainSidelineColor,
|
||||
fill: style.Train.trainBody.trainBodyFillColor
|
||||
},
|
||||
cursor: 'pointer'
|
||||
point: model.point,
|
||||
style: style
|
||||
});
|
||||
|
||||
const beginX = (model.point.x + style.Train.trainBody.lrPadding);
|
||||
@ -220,6 +210,9 @@ export default class TrainBody extends Group {
|
||||
isShow ? this.textA.show() : this.textA.hide();
|
||||
}
|
||||
}
|
||||
setBodyBoxShape(key, color) {
|
||||
this.trainBodyBox && this.trainBodyBox.setColor(key, color);
|
||||
}
|
||||
formatChangePosition(model, style) {
|
||||
if (style.Train.trainBody.trainNameFormat) {
|
||||
const arr = style.Train.trainBody.trainNameFormat.split(':');
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
export default class Train extends Group {
|
||||
export default class TrainBodyBox extends Group {
|
||||
constructor(model) {
|
||||
super();
|
||||
this.model = model;
|
||||
@ -9,16 +9,23 @@ export default class Train extends Group {
|
||||
}
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.train = new Rect({
|
||||
this.trainBodyBox = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: model.shape,
|
||||
style: model.style,
|
||||
cursor: model.cursor,
|
||||
onmouseover: model.onmouseover,
|
||||
onmouseout: model.onmouseout
|
||||
shape: {
|
||||
x: model.point.x,
|
||||
y: model.point.y,
|
||||
width: model.style.Train.common.trainWidth,
|
||||
height: model.style.Train.common.trainHeight
|
||||
},
|
||||
style: {
|
||||
lineWidth: model.style.Train.trainBody.trainBodyLineWidth,
|
||||
stroke: model.style.trainSidelineColor,
|
||||
fill: model.style.Train.trainBody.trainBodyFillColor
|
||||
},
|
||||
cursor: 'pointer'
|
||||
});
|
||||
this.add(this.train);
|
||||
this.add(this.trainBodyBox);
|
||||
}
|
||||
setColor(key, color) {
|
||||
this.train.setStyle(key, color);
|
||||
|
@ -58,9 +58,4 @@ export default class TrainHead extends Group {
|
||||
setArrowShow(isShow) {
|
||||
isShow ? this.arrow.show() : this.arrow.hide();
|
||||
}
|
||||
setInvisible(invisible) {
|
||||
this.eachChild((child) => {
|
||||
child.attr('invisible', invisible);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -107,10 +107,6 @@ export default class Train extends Group {
|
||||
|
||||
// 获取设备提示坐标
|
||||
getShapeTipPoint() {
|
||||
return {
|
||||
x: (this.train.shape.x),
|
||||
y: (this.train.shape.y)
|
||||
};
|
||||
}
|
||||
|
||||
// 恢复颜色状态
|
||||
@ -152,6 +148,9 @@ export default class Train extends Group {
|
||||
case 'trainServer':
|
||||
this.trainB && this.trainB.setTextTrainServerColor(item.showColor);
|
||||
break;
|
||||
case 'trainWindowBorder':
|
||||
this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor);
|
||||
break;
|
||||
default:
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(item.showColor);
|
||||
}
|
||||
@ -166,6 +165,9 @@ export default class Train extends Group {
|
||||
case 'trainServer':
|
||||
this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
case 'trainWindowBorder':
|
||||
this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
break;
|
||||
default:
|
||||
this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor);
|
||||
}
|
||||
|
@ -563,7 +563,6 @@ export function trainMenuFiltration(menuObj) {
|
||||
export function mouseCancelState(selected) {
|
||||
const device = Vue.prototype.$jlmap.getDeviceByCode(selected.code);
|
||||
const instance = (device || {}).instance;
|
||||
debugger;
|
||||
if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) {
|
||||
device['down'] = false;
|
||||
instance.mouseEvent.mouseout(Vue.prototype.$jlmap.$zr.curEvent);
|
||||
|
@ -1,119 +1,126 @@
|
||||
<template>
|
||||
<el-dialog :title="title" class="beijing-01__schedule choose-plan-template" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" @click="handleConfirm" :loading="loading">选 择</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
class="beijing-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">选 择</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin'
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinStyleList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return 'success' }
|
||||
}
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinStyleList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinStyle'] = this.$store.getters['map/skinStyle'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinStyle'] = this.$store.getters['map/skinStyle'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (enumList && converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,153 +1,160 @@
|
||||
<template>
|
||||
<el-dialog :title="title" class="beijing-01__schedule reload-today-plan" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" @click="handleConfirm" :loading="loading">加 载</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
:title="title"
|
||||
class="beijing-01__schedule reload-today-plan"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">加 载</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPublishMap } from '@/api/jmap/mapdraft';
|
||||
import { runPlanTemplateList, deleteRunPlanTemplate, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { getStationListBySkinStyle } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin'
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { listPublishMap } from '@/api/jmap/mapdraft';
|
||||
import { runPlanTemplateList, deleteRunPlanTemplate, generateUserRunPlanEveryDay } from '@/api/runplan';
|
||||
import { getStationListBySkinStyle } from '@/api/runplan';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinStyleList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return 'success' }
|
||||
}
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinStyleList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '加载当天计划'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinStyle'] = this.$store.getters['map/skinStyle'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生成每日运行图
|
||||
handleConfirm() {
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable()
|
||||
this.loadRunData();
|
||||
this.doClose();
|
||||
this.$message.success(`生成用户每日运行图成功`);
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.reloadTable()
|
||||
this.$messageBox(`生成用户每日运行图失败`);
|
||||
})
|
||||
} else {
|
||||
this.$messageBox(`请选择需要加载的运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadRunData() {
|
||||
let skinStyle = this.$route.query.skinStyle;
|
||||
this.$store.dispatch('runPlan/clear');
|
||||
if (skinStyle) {
|
||||
getStationListBySkinStyle(skinStyle).then(response => {
|
||||
let stations = response.data;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
|
||||
this.$store.dispatch('runPlan/setStations', stations).then(() => {
|
||||
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
}).catch(error => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(`获取运行图数据失败`);
|
||||
})
|
||||
})
|
||||
}).catch(error => {
|
||||
this.$messageBox(`获取车站列表失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '加载当天计划';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinStyle'] = this.$store.getters['map/skinStyle'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (enumList && converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生成每日运行图
|
||||
handleConfirm() {
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose && choose.id) {
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
this.doClose();
|
||||
this.$message.success(`生成用户每日运行图成功`);
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.$messageBox(`生成用户每日运行图失败`);
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(`请选择需要加载的运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadRunData() {
|
||||
const skinStyle = this.$route.query.skinStyle;
|
||||
this.$store.dispatch('runPlan/clear');
|
||||
if (skinStyle) {
|
||||
getStationListBySkinStyle(skinStyle).then(response => {
|
||||
const stations = response.data;
|
||||
this.PlanConvert = this.$theme.loadPlanConvert(skinStyle);
|
||||
this.$store.dispatch('runPlan/setStations', stations).then(() => {
|
||||
getEveryDayRunPlanData(this.$route.query.group).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(`获取运行图数据失败`);
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取车站列表失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,119 +1,126 @@
|
||||
<template>
|
||||
<el-dialog :title="title" class="beijing-01__schedule choose-plan-template" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" @click="handleConfirm" :loading="loading">选 择</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
v-dialogDrag
|
||||
class="beijing-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">选 择</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin'
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinStyleList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return 'success' }
|
||||
}
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinStyleList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinStyle'] = this.$store.getters['map/skinStyle'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinStyle'] = this.$store.getters['map/skinStyle'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (enumList && converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -59,7 +59,7 @@ export default {
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
@ -96,7 +96,7 @@ export default {
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
if (enumList && converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
|
@ -1,119 +1,126 @@
|
||||
<template>
|
||||
<el-dialog :title="title" class="beijing-01__schedule choose-plan-template" :visible.sync="dialogShow" width="80%"
|
||||
:before-close="doClose" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" @click="handleConfirm" :loading="loading">选 择</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
:title="title"
|
||||
class="beijing-01__schedule choose-plan-template"
|
||||
:visible.sync="dialogShow"
|
||||
v-dialogDrag
|
||||
width="80%"
|
||||
:before-close="doClose"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<QueryListPage ref="pageRules" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<el-row type="flex" justify="center" class="button-group">
|
||||
<el-button type="primary" :loading="loading" @click="handleConfirm">选 择</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin'
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { runPlanTemplateList } from '@/api/runplan';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinStyleList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return 'success' }
|
||||
}
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
skinStyleList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
reset: true,
|
||||
labelWidth: '100px',
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '运行图名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
radioShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '运行图名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinStyle'] = this.$store.getters['map/skinStyle'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
this.dialogShow = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
},
|
||||
queryFunction(params) {
|
||||
if (this.$store.state.map && this.$store.state.map.map) {
|
||||
params['skinStyle'] = this.$store.getters['map/skinStyle'];
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
const choose = this.$refs.pageRules.currentChoose();
|
||||
if (choose) {
|
||||
this.$emit('chooseConfirm', choose);
|
||||
} else {
|
||||
this.$messageBox(`请选择模板运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
</style>
|
||||
</style>
|
||||
|
@ -53,7 +53,7 @@
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return 'success' }
|
||||
}
|
||||
@ -89,17 +89,6 @@
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生成每日运行图
|
||||
handleConfirm() {
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
|
@ -1,176 +1,191 @@
|
||||
<template>
|
||||
<el-dialog class="fuzhou-01__systerm stand-detain-train-all" :title="title" :visible.sync="show" width="340px"
|
||||
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
|
||||
<div style="padding: 10px 20px; border: 1px double lightgray; ">
|
||||
<span class="base-label">范围</span>
|
||||
<el-row>
|
||||
<el-radio-group v-model="upDown" @change="choose">
|
||||
<el-col :span="10">
|
||||
<el-radio label="02" :id="upDown == '01' ? domIdChoose : ''">上行全线</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="8">
|
||||
<el-radio label="01" :id="upDown == '02' ? domIdChoose : ''">下行全线</el-radio>
|
||||
</el-col>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="fuzhou-01__systerm stand-detain-train-all"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="340px"
|
||||
:before-close="doClose"
|
||||
:z-index="2000"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-radio-group style="padding: 10px 20px; border: 1px double lightgray; ">
|
||||
<span class="base-label">范围</span>
|
||||
<el-row>
|
||||
<el-radio-group v-model="upDown" @change="choose">
|
||||
<el-col :span="10">
|
||||
<el-radio :id="upDown == '01' ? domIdChoose : ''" label="02">上行全线</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="8">
|
||||
<el-radio :id="upDown == '02' ? domIdChoose : ''" label="01">下行全线</el-radio>
|
||||
</el-col>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</el-radio-group>
|
||||
|
||||
<div class="table">
|
||||
<span>扣车站台列表(中心设置)</span>
|
||||
<el-table ref="tempData" :data="tempData" border style="width: 100%" size="mini" empty-text="所有站台都无扣车状态!"
|
||||
height="160" highlight-current-row>
|
||||
<el-table-column prop="stationName" label="车站名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="standName" :width="140" label="扣车站台">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
</el-dialog>
|
||||
<div class="table">
|
||||
<span>扣车站台列表(中心设置)</span>
|
||||
<el-table
|
||||
ref="tempData"
|
||||
:data="tempData"
|
||||
border
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
empty-text="所有站台都无扣车状态!"
|
||||
height="160"
|
||||
highlight-current-row
|
||||
>
|
||||
<el-table-column prop="stationName" label="车站名称" />
|
||||
<el-table-column prop="standName" :width="140" label="扣车站台" />
|
||||
</el-table>
|
||||
</div>
|
||||
<el-row justify="center" class="button-group">
|
||||
<el-col :span="10" :offset="2">
|
||||
<el-button :id="domIdConfirm" type="primary" :loading="loading" :disabled="disabled" @click="commit">确定
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="4">
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
|
||||
export default {
|
||||
name: 'StandDetainTrainAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
upDown: '01',
|
||||
tempData: [],
|
||||
disabled: true,
|
||||
operation: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList',
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.menu.operation) {
|
||||
return '全线取消扣车';
|
||||
} else {
|
||||
return '全线取消跳停';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
loadTableData() {
|
||||
this.tempData = [];
|
||||
this.stationStandList.forEach(elem => {
|
||||
/** status 01: 未扣车*/
|
||||
let stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).state;
|
||||
let station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {}).model;
|
||||
if (station && stand && stand.holdStatus != '01' && Number(elem.direction) == Number(this.upDown)) {
|
||||
this.tempData.push({ stationName: station.name, standName: elem.name });
|
||||
}
|
||||
});
|
||||
export default {
|
||||
name: 'StandDetainTrainAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
upDown: '01',
|
||||
tempData: [],
|
||||
disabled: true,
|
||||
operation: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
domIdCancel() {
|
||||
return this.dialogShow ? OperationEvent.Command.cancel.menu.domId : '';
|
||||
},
|
||||
domIdChoose() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.choose.domId : '';
|
||||
},
|
||||
domIdConfirm() {
|
||||
return this.dialogShow ? OperationEvent.StationStand.cancelDetainTrainAll.menu.domId : '';
|
||||
},
|
||||
title() {
|
||||
if (this.operation == OperationEvent.StationStand.cancelDetainTrainAll.menu.operation) {
|
||||
return '全线取消扣车';
|
||||
} else {
|
||||
return '全线取消跳停';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.$store.dispatch('training/tipReload');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
loadTableData() {
|
||||
this.tempData = [];
|
||||
this.stationStandList.forEach(elem => {
|
||||
/** status 01: 未扣车*/
|
||||
const stand = (this.$store.getters['map/getDeviceByCode'](elem.code) || {}).status;
|
||||
const station = (this.$store.getters['map/getDeviceByCode'](elem.stationCode) || {});
|
||||
if (station && stand && stand.holdStatus != '01' && Number(elem.direction) == Number(this.upDown)) {
|
||||
this.tempData.push({ stationName: station.name, standName: elem.name });
|
||||
}
|
||||
});
|
||||
|
||||
//如果存在未扣车的情况,才可以做此操作
|
||||
if (this.tempData.length > 0) {
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
//不是断点激活的菜单应该将状态初始化
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.upDown = selected.direction;
|
||||
this.loadTableData();
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
choose(upDown) {
|
||||
//重新设置扣车站台
|
||||
this.loadTableData();
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
|
||||
val: `${upDown}`,
|
||||
}
|
||||
// 如果存在未扣车的情况,才可以做此操作
|
||||
if (this.tempData.length > 0) {
|
||||
this.disabled = false;
|
||||
}
|
||||
},
|
||||
doShow(operate, selected) {
|
||||
// 不是断点激活的菜单应该将状态初始化
|
||||
if (!this.dialogShow) {
|
||||
this.loading = false;
|
||||
this.upDown = selected.direction;
|
||||
this.loadTableData();
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.dialogShow = true;
|
||||
this.$nextTick(function () {
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
choose(upDown) {
|
||||
// 重新设置扣车站台
|
||||
this.loadTableData();
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
|
||||
val: `${upDown}`
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
|
||||
val: this.upDown,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
|
||||
val: this.upDown
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
this.loading = false;
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.doClose();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -52,7 +52,8 @@
|
||||
import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic';
|
||||
import { getPublishTrainList } from '@/api/jmap/map';
|
||||
import ConfirmTrain from './childDialog/confirmTrain';
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo'
|
||||
import NoticeInfo from './childDialog/childDialog/noticeInfo';
|
||||
import Vue from 'vue';
|
||||
|
||||
export default {
|
||||
name: 'TrainControl',
|
||||
@ -217,8 +218,7 @@
|
||||
if (!this.dialogShow) {
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
|
||||
let model = (selected || {}).state;
|
||||
let model = Vue.prototype.$jlmap.mapDevice[selected.code];
|
||||
this.formModel = {
|
||||
groupNumber: model.groupNumber,
|
||||
tripNumber: model.tripNumber,
|
||||
@ -421,4 +421,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
@ -1,485 +1,485 @@
|
||||
<template>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu"></pop-menu>
|
||||
<stand-control ref="standControl"></stand-control>
|
||||
<stand-detail ref="standDetail"></stand-detail>
|
||||
<stand-run-level ref="standRunLevel"></stand-run-level>
|
||||
<stand-stop-time ref="standStopTime"></stand-stop-time>
|
||||
<stand-detain-train-all ref="standDetainTrainAll"></stand-detain-train-all>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<stand-back-strategy ref="standBackStrategy"></stand-back-strategy>
|
||||
</div>
|
||||
<div>
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<stand-control ref="standControl" />
|
||||
<stand-detail ref="standDetail" />
|
||||
<stand-run-level ref="standRunLevel" />
|
||||
<stand-stop-time ref="standStopTime" />
|
||||
<stand-detain-train-all ref="standDetainTrainAll" />
|
||||
<notice-info ref="noticeInfo" />
|
||||
<stand-back-strategy ref="standBackStrategy" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import StandControl from './dialog/standControl';
|
||||
import StandBackStrategy from './dialog/standBackStrategy';
|
||||
import StandDetail from './dialog/standDetail';
|
||||
import StandRunLevel from './dialog/standRunLevel';
|
||||
import StandStopTime from './dialog/standStopTime';
|
||||
import StandDetainTrainAll from './dialog/standDetainTrainAll';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { TrainingMode, OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import StandControl from './dialog/standControl';
|
||||
import StandBackStrategy from './dialog/standBackStrategy';
|
||||
import StandDetail from './dialog/standDetail';
|
||||
import StandRunLevel from './dialog/standRunLevel';
|
||||
import StandStopTime from './dialog/standStopTime';
|
||||
import StandDetainTrainAll from './dialog/standDetainTrainAll';
|
||||
import NoticeInfo from './dialog/childDialog/childDialog/noticeInfo';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { MapDeviceType, OperationEvent, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { MenuDisabledState, menuConvert, menuFiltration } from './utils/menuItemStatus';
|
||||
|
||||
export default {
|
||||
name: 'StationStandMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StandControl,
|
||||
StandDetail,
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll,
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: '扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: false },
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: false },
|
||||
},
|
||||
{
|
||||
label: '强制取消扣车',
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: true, center: false },
|
||||
},
|
||||
{
|
||||
label: '跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: false },
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: false },
|
||||
},
|
||||
{
|
||||
label: '设置运行等级',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: false },
|
||||
},
|
||||
{
|
||||
label: '设置提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: false },
|
||||
},
|
||||
{
|
||||
label: '人工折返策略设置',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: false },
|
||||
},
|
||||
{
|
||||
label: '查询站台状态',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: false },
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: '扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: '强制取消扣车',
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: false, center: false },
|
||||
},
|
||||
{
|
||||
label: '全线取消扣车',
|
||||
handler: this.cancelDetainTrainAll,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: '跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true },
|
||||
},
|
||||
{
|
||||
label: '设置停站时间',
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: '设置运行等级',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: '设置提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: '人工折返策略设置',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: true },
|
||||
},
|
||||
{
|
||||
label: '查询站台状态',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true },
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
}
|
||||
},
|
||||
initMenu() {
|
||||
//编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce]
|
||||
}
|
||||
export default {
|
||||
name: 'StationStandMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
StandControl,
|
||||
StandDetail,
|
||||
StandRunLevel,
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
menu: [],
|
||||
menuNormal: {
|
||||
local: [
|
||||
{
|
||||
label: '扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '强制取消扣车',
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '设置运行等级',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '设置提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '人工折返策略设置',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '查询站台状态',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
{
|
||||
label: '扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '强制取消扣车',
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '全线取消扣车',
|
||||
handler: this.cancelDetainTrainAll,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置停站时间',
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置运行等级',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '人工折返策略设置',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '查询站台状态',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
menuForce: [
|
||||
{
|
||||
label: '设置故障',
|
||||
handler: this.setStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStoppage
|
||||
},
|
||||
{
|
||||
label: '取消故障',
|
||||
handler: this.cancelStoppage,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
'mode',
|
||||
'operatemode'
|
||||
]),
|
||||
...mapGetters('menuOperation', [
|
||||
'buttonOperation'
|
||||
])
|
||||
},
|
||||
watch: {
|
||||
'$store.state.menuOperation.menuCount': function (val) {
|
||||
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.StationStand) && !this.buttonOperation) {
|
||||
this.doShow(this.$store.state.menuOperation.menuPosition);
|
||||
} else {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
const self = this;
|
||||
window.onclick = function (e) {
|
||||
self.doClose();
|
||||
};
|
||||
},
|
||||
initMenu() {
|
||||
// 编辑模式菜单列表
|
||||
this.menu = menuFiltration(this.menuNormal);
|
||||
if (this.operatemode === OperateMode.ADMIN) {
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
|
||||
//故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce
|
||||
}
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
//设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//设置扣车
|
||||
setDetainTrain() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
this.menu = menuConvert(this.menu);
|
||||
},
|
||||
doShow(point) {
|
||||
this.clickEvent();
|
||||
this.initMenu();
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.stoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelStoppage.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setDetainTrain.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
},
|
||||
//取消扣车
|
||||
cancelDetainTrain() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
},
|
||||
//强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
},
|
||||
//全线取消扣车
|
||||
cancelDetainTrainAll() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
},
|
||||
//设置跳停
|
||||
setJumpStop() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
},
|
||||
//取消跳停
|
||||
cancelJumpStop() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
},
|
||||
//设置停站时间
|
||||
setStopTime() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//设置运行等级
|
||||
setRunLevel() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//设置提前发车
|
||||
earlyDeparture() {
|
||||
let operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
},
|
||||
//设置折返策略
|
||||
setBackStrategy() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrain.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainForce.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 全线取消扣车
|
||||
cancelDetainTrainAll() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.cancelJumpStop.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置停站时间
|
||||
setStopTime() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setStopTime.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置运行等级
|
||||
setRunLevel() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.setRunLevel.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 设置提前发车
|
||||
earlyDeparture() {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置折返策略
|
||||
setBackStrategy() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
},
|
||||
//查询站台状态
|
||||
detail() {
|
||||
let operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
},
|
||||
// 查询站台状态
|
||||
detail() {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
label: MapDeviceType.StationStand.label,
|
||||
operation: OperationEvent.StationStand.detail.menu.operation
|
||||
};
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
let tempDate = null;
|
||||
if (response) {
|
||||
tempDate = response.data;
|
||||
}
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -50,7 +50,7 @@
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return 'success' }
|
||||
}
|
||||
@ -86,17 +86,6 @@
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleConfirm() {
|
||||
this.doClose();
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
|
@ -53,7 +53,7 @@
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return 'success' }
|
||||
}
|
||||
@ -89,17 +89,6 @@
|
||||
}
|
||||
return runPlanTemplateList(params);
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 生成每日运行图
|
||||
handleConfirm() {
|
||||
if (this.$refs && this.$refs.pageRules) {
|
||||
|
39
src/main.js
39
src/main.js
@ -22,9 +22,6 @@ import '@/scripts/GlobalPlugin';
|
||||
import '@/directives';
|
||||
import messages from '@/i18n/index';
|
||||
|
||||
// window.THREE = require('@/jlmap3d/main/three.min.js');
|
||||
// window.zlib = require('@/jlmap3d/main/inflate.min.js');
|
||||
|
||||
Vue.use(ElementUI);
|
||||
Vue.use(VueI18n);
|
||||
|
||||
@ -68,3 +65,39 @@ Vue.prototype.$messageBox = function(msge) {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Vue.prototype.$convertField = function(fieldValue, enumList, converFormat, isList = false) {
|
||||
const arr = [];
|
||||
if (enumList && converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
if (isList) {
|
||||
enumList.forEach((element, i) => {
|
||||
fieldValue.forEach((v, j) => {
|
||||
if ('' + fieldValue[j] === '' + enumList[i][value]) {
|
||||
arr.push(enumList[i][label]);
|
||||
}
|
||||
});
|
||||
});
|
||||
} else {
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isList ? arr: '';
|
||||
};
|
||||
|
||||
Vue.prototype.$convertList = function(FromList, ToList, checktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (checktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
@ -548,7 +548,7 @@ export const asyncRouter = [
|
||||
component: resolve => require(['@/views/screenMonitor/index'], resolve),
|
||||
name: '大屏系统',
|
||||
meta: {
|
||||
roles: [admin, userScreen]
|
||||
roles: [admin, userScreen, user]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin } from '@/router';
|
||||
import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin } from '@/router';
|
||||
import { PermissionType } from '@/utils/PermissionType';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
|
||||
@ -63,6 +63,9 @@ function convertRouterRoles({ roles, permissionType }) {
|
||||
*/
|
||||
function filterAsyncRouter(asyncRouter, roles, parentsRoles) {
|
||||
return asyncRouter.filter(route => {
|
||||
if (route.name === '大屏系统' && roles.indexOf(admin)===-1 && roles.indexOf(userScreen) ===-1){
|
||||
route.hidden = true;
|
||||
}
|
||||
if (hasPermission(roles, route, parentsRoles)) {
|
||||
if (route.children && route.children.length) {
|
||||
route.children = filterAsyncRouter(route.children, roles, route.meta ? route.meta.roles : undefined);
|
||||
|
@ -29,7 +29,7 @@
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:disabled="item.role != 'Dispatcher'"
|
||||
:disabled="checkDisabled(item.role)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -104,7 +104,7 @@ export default {
|
||||
title: '皮肤类型',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
@ -205,7 +205,19 @@ export default {
|
||||
roleDoClose() {
|
||||
this.$refs['ruleForm'].resetFields();
|
||||
this.roleShow = false;
|
||||
}
|
||||
},
|
||||
|
||||
checkDisabled(role) {
|
||||
if(this.$route.query.prdType == '01'){
|
||||
return role != 'Attendant';
|
||||
} else if (this.$route.query.prdType == '02'){
|
||||
return role != 'Dispatcher';
|
||||
}else if (this.$route.query.prdType == '04'){
|
||||
return role !== 'Driver';
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -82,6 +82,7 @@ import { checkLoginLine } from '@/api/login';
|
||||
import { loadMapData } from '@/utils/loaddata';
|
||||
// import { handleToken } from '@/utils/auth';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import Vue from 'vue';
|
||||
|
||||
// 三维
|
||||
import ThreeTest from '@/views/jlmap3d/index';
|
||||
@ -445,6 +446,10 @@ export default {
|
||||
const res = await loadQuest(row.id, this.group);
|
||||
if (res && res.code == 200) {
|
||||
this.questId = parseInt(row.id);
|
||||
if(res.data && res.data.mapLocation) {
|
||||
let mapLocation={"offsetX":res.data.mapLocation.x,"offsetY":res.data.mapLocation.y,"scaleRate":res.data.mapLocation.scale};
|
||||
Vue.prototype.$jlmap.setPosition(mapLocation)
|
||||
}
|
||||
}
|
||||
|
||||
if (this.$refs.menuDemon) {
|
||||
|
@ -19,7 +19,6 @@
|
||||
</el-button-group>
|
||||
</div>
|
||||
<set-time ref="setTime" @ConfirmSelectBeginTime="start" />
|
||||
<tip-quest-detail v-show="questId" ref="questTip" :quest-id="questId" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -27,7 +26,6 @@
|
||||
<script>
|
||||
// import ChartView from './demon/chartView';
|
||||
import SetTime from './demon/setTime';
|
||||
import TipQuestDetail from './tipQuestDetail';
|
||||
import { Notification } from 'element-ui';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { runDiagramStart, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
|
||||
@ -43,7 +41,6 @@ export default {
|
||||
components: {
|
||||
// ChartView,
|
||||
SetTime,
|
||||
TipQuestDetail
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="80px" class="actionInfo" label-position="right" style="margin-top:15px">
|
||||
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="80px" class="actionInfo" label-position="right">
|
||||
<el-form-item label="动作类型" class="conditionVO" prop="action.type">
|
||||
<el-select v-model="modalData.action.type " placeholder="请选择动作类型" @change="changeType" class="inputStyle">
|
||||
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
|
||||
|
82
src/views/display/scriptRecord/roleConditionScript.vue
Normal file
82
src/views/display/scriptRecord/roleConditionScript.vue
Normal file
@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="角色管理" name="first">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="任务目标" name="second">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<target-condition ref="targetCondition" :group="group"></target-condition>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="任务剧本" name="third">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<task-script ref="taskScript" :group="group"></task-script>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import RoleSection from './roleSection';
|
||||
import TargetCondition from './targetCondition';
|
||||
import TaskScript from './taskScript';
|
||||
|
||||
import {getQuestRecord} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'roleConditionScript',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
components: {
|
||||
TargetCondition,
|
||||
TaskScript,
|
||||
RoleSection,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName:"first",
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
methods: {
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
getQuestRecord(group).then(response =>{
|
||||
let deviceConditionList=response.data.questTargetVO.deviceConditionVOList;
|
||||
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
|
||||
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
|
||||
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
|
||||
// if(response.data.mapLocation)
|
||||
// {
|
||||
// let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
|
||||
// this.mapLocation=mapLocation;
|
||||
// }
|
||||
});
|
||||
},
|
||||
getBehaviorList(row){
|
||||
this.$emit('getBehaviorList',row.id);
|
||||
this.$store.dispatch('scriptRecord/updateMemberName',row.name);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.tab-pane{
|
||||
height:360px;
|
||||
}
|
||||
</style>
|
@ -73,10 +73,6 @@
|
||||
this.loading=false;
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.memberList=this.$store.state.scriptRecord.memberList;
|
||||
this.loading=false;
|
||||
},
|
||||
methods:{
|
||||
getDeviceInfo(){
|
||||
let params = { role:this.memberVO.role};
|
||||
|
@ -48,18 +48,6 @@
|
||||
components:{
|
||||
DeviceCondition
|
||||
},
|
||||
mounted(){
|
||||
let data=this.$store.state.scriptRecord.deviceConditionList;
|
||||
if(data!=undefined)
|
||||
{
|
||||
var newData=JSON.parse(JSON.stringify(data).replace(/\"code\"/g,'"isAdded":true,"code"'));
|
||||
this.deviceConditionList=newData;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.deviceConditionList=[];
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
addQuestAction(){
|
||||
if(this.isAdding)
|
||||
|
@ -42,10 +42,6 @@
|
||||
},
|
||||
mounted(){
|
||||
this.rowDrop();
|
||||
let script=this.$store.state.scriptRecord.script;
|
||||
let memeberList=this.$store.state.scriptRecord.memberList;
|
||||
this.taskScriptList=memeberList;
|
||||
this.setScriptList(memeberList,script);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -1,203 +0,0 @@
|
||||
<template>
|
||||
<div v-drag class="reminder-drag">
|
||||
<div ref="drapBox" class="reminder-box">
|
||||
<div class="tip-title">
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<p v-if="isShrink" style="color: #fff;">
|
||||
<span>{{ formModel.name }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div ref="dragBody" class="tip-body-box">
|
||||
<div class="tip-body">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<p class="list-item">
|
||||
<span class="list-label">任务描述:</span>
|
||||
<span class="list-elem">{{ formModel.description }}</span>
|
||||
</p>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="drag-right" />
|
||||
<div class="drag-left" />
|
||||
<div class="drag-bottom" />
|
||||
<div class="drag-top" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getQuestById } from '@/api/quest';
|
||||
|
||||
export default {
|
||||
name: 'TipQuestDetail',
|
||||
props: {
|
||||
questId: {
|
||||
type: Number,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShrink: true,
|
||||
formModel: {
|
||||
name: '',
|
||||
description: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
'questId': function (val) {
|
||||
this.loadInitData(val);
|
||||
}
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
loadInitData(questId) {
|
||||
if (questId) {
|
||||
getQuestById(questId).then(resp => {
|
||||
this.formModel = resp.data;
|
||||
}).catch(() => {
|
||||
this.$messageBox('获取任务信息失败');
|
||||
});
|
||||
}
|
||||
},
|
||||
shrink() {
|
||||
const height = this.$refs.dragBody.offsetHeight + 40;
|
||||
const top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
||||
.tip-body-box {
|
||||
position: relative;
|
||||
height: 260px;
|
||||
}
|
||||
|
||||
.reminder-box {
|
||||
position: absolute;
|
||||
float: left;
|
||||
left: 15x;
|
||||
bottom: 15px;
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
overflow: hidden;
|
||||
z-index: 10;
|
||||
font-size: 18px;
|
||||
|
||||
.tip-title {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row-reverse;
|
||||
background-color: #409EFF;
|
||||
border-radius: 5px 5px 0 0;
|
||||
justify-content: space-between;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.drag-right,
|
||||
.drag-left {
|
||||
width: 10px;
|
||||
cursor: e-resize;
|
||||
background-color: yellow;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.drag-left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.drag-bottom {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
cursor: s-resize;
|
||||
background-color: yellow;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.drag-top {
|
||||
position: absolute;
|
||||
top: -45px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
cursor: s-resize;
|
||||
background-color: yellow;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.tip-body {
|
||||
height: 366px;
|
||||
padding: 10px;
|
||||
|
||||
.list-label {
|
||||
width: 90px;
|
||||
}
|
||||
}
|
||||
|
||||
.tip-foot {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
background-color: #fff;
|
||||
padding: 10px 0 10px 10px;
|
||||
|
||||
.foot-detail {
|
||||
height: 100%;
|
||||
float: right;
|
||||
margin-top: 9px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.foot-submit {
|
||||
float: right;
|
||||
margin-top: 9px;
|
||||
padding-right: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
background-color: #f3f3f3;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/deep/ {
|
||||
.el-tree-node__content {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #d6e5f7;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -11,31 +11,7 @@
|
||||
<div class="tip-body-box" ref="dragBody">
|
||||
<div class="tip-body">
|
||||
<template v-if="displayType=='role'">
|
||||
<template>
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="角色管理" name="first">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="任务目标" name="second">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<target-condition ref="targetCondition" :group="group"></target-condition>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="任务剧本" name="third">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<task-script ref="taskScript" :group="group"></task-script>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
|
||||
</template>
|
||||
<template v-if="displayType=='behavior'">
|
||||
<div class="tab-pane-big">
|
||||
@ -63,15 +39,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
import RoleSection from './scriptRecord/roleSection';
|
||||
import GetBehavior from './scriptRecord/getBehavior';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import TargetCondition from './scriptRecord/targetCondition';
|
||||
import TaskScript from './scriptRecord/taskScript';
|
||||
import RoleConditionScript from './scriptRecord/roleConditionScript';
|
||||
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData,getQuestRecord} from '@/api/simulation';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
|
||||
import {updateMapLocation} from '@/api/quest';
|
||||
|
||||
export default {
|
||||
@ -83,11 +56,9 @@
|
||||
},
|
||||
},
|
||||
components: {
|
||||
RoleSection,
|
||||
GetBehavior,
|
||||
GetAction,
|
||||
TargetCondition,
|
||||
TaskScript
|
||||
RoleConditionScript,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -96,7 +67,6 @@
|
||||
memberId:null,
|
||||
behaviorId:null,
|
||||
displayType:"role",
|
||||
activeName:"first",
|
||||
mapLocation:{},
|
||||
// isSaveStage: true,
|
||||
}
|
||||
@ -111,25 +81,9 @@
|
||||
created() {
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData(this.$route.query);
|
||||
this.shrink();
|
||||
},
|
||||
methods: {
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
let that=this;
|
||||
getQuestRecord(group).then(response =>{
|
||||
let deviceConditionList=response.data.questTargetVO.deviceConditionVOList;
|
||||
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
|
||||
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
|
||||
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
|
||||
// if(response.data.mapLocation)
|
||||
// {
|
||||
// let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
|
||||
// this.mapLocation=mapLocation;
|
||||
// }
|
||||
});
|
||||
},
|
||||
jump(obj) {
|
||||
},
|
||||
shrink() {
|
||||
@ -145,11 +99,6 @@
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
getBehaviorList(row){
|
||||
this.displayType="behavior";
|
||||
this.memberId=row.id;
|
||||
this.$store.dispatch('scriptRecord/updateMemberName',row.name);
|
||||
},
|
||||
backToMember(){
|
||||
this.displayType="role";
|
||||
},
|
||||
@ -190,6 +139,10 @@
|
||||
})
|
||||
}).catch(error => { })
|
||||
},
|
||||
getBehaviorList(id){
|
||||
this.displayType="behavior";
|
||||
this.memberId=id;
|
||||
},
|
||||
backToTop(){
|
||||
var div = this.$refs['elScrollbar'].$refs['wrap'];
|
||||
div.scrollTop=0;
|
||||
@ -200,7 +153,6 @@
|
||||
},
|
||||
saveMaplocation()
|
||||
{
|
||||
debugger;
|
||||
// this.$parent.$parent.$refs['mapCanvas'].$refs['mapCommon'].$refs['jlmapVisual'].$jlmap.$options
|
||||
// let dataZoom = this.$store.state.map.dataZoom;
|
||||
// let scriptId=this.$route.query.scriptId;
|
||||
@ -221,9 +173,6 @@
|
||||
position: relative;
|
||||
// height: 540px;
|
||||
}
|
||||
.tab-pane{
|
||||
height:360px;
|
||||
}
|
||||
.tab-pane-big{
|
||||
height:420px;
|
||||
}
|
||||
|
@ -81,28 +81,28 @@ export default {
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '产品',
|
||||
prop: 'prdCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.prdCode, this.prdTypeList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '实训类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.type, this.trainingTypeList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.type, this.trainingTypeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '操作类型',
|
||||
prop: 'operateType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
|
@ -59,7 +59,7 @@
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name'])
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name'])
|
||||
},
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
@ -112,17 +112,6 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 确定创建
|
||||
handleConfirmCreate(data) {
|
||||
createQuest(data).then(resp => {
|
||||
|
@ -50,7 +50,7 @@
|
||||
title: '皮肤类型',
|
||||
prop: 'parameter',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.parameter, this.skinStyleList, ['code', 'name']) },
|
||||
columnValue: (row) => { return this.$convertField(row.parameter, this.skinStyleList, ['code', 'name']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
@ -61,7 +61,7 @@
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.taskStatusList, ['code', 'name']) },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.taskStatusList, ['code', 'name']) },
|
||||
tagType: (row) => { if (row.status != '03') { return 'warning' } else { return 'success' } }
|
||||
},
|
||||
{
|
||||
@ -115,17 +115,6 @@
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
|
@ -1,115 +1,115 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="25%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave" v-loading="loading">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="25%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addTrainingRulesList } from '@/api/management/operation';
|
||||
import { OperationList } from '@/scripts/OperationConfig';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
import { addTrainingRulesList } from '@/api/management/operation';
|
||||
import { OperationList } from '@/scripts/OperationConfig';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
name: 'AddBatch',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
skinStyle: '',
|
||||
},
|
||||
skinStyleList: [],
|
||||
isShow: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'skinStyle', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList },
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
skinStyle: [
|
||||
{ required: true, message: '请选择皮肤类型', trigger: 'change' },
|
||||
],
|
||||
}
|
||||
return crules
|
||||
},
|
||||
title() {
|
||||
return '自动生成操作'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 获取皮肤列表
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});
|
||||
})
|
||||
},
|
||||
show(total) {
|
||||
if (total) {
|
||||
this.isShow = true;
|
||||
}
|
||||
export default {
|
||||
name: 'AddBatch',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
skinStyle: ''
|
||||
},
|
||||
skinStyleList: [],
|
||||
isShow: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'skinStyle', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
skinStyle: [
|
||||
{ required: true, message: '请选择皮肤类型', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '自动生成操作';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 获取皮肤列表
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});
|
||||
});
|
||||
},
|
||||
show(total) {
|
||||
if (total) {
|
||||
this.isShow = true;
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.isShow) {
|
||||
this.$confirm('此操作将清空改皮肤下所有操作定义, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
self.create()
|
||||
}).catch(() => { })
|
||||
} else {
|
||||
self.create()
|
||||
}
|
||||
})
|
||||
},
|
||||
create() {
|
||||
let self = this
|
||||
this.loading = true;
|
||||
addTrainingRulesList(this.formModel.skinStyle, OperationList[this.formModel.skinStyle].list).then(response => {
|
||||
self.loading = false;
|
||||
self.$message.success('批量生成操作定义成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable'); // 刷新列表
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('批量生成操作定义失败:' + error.message)
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
skinStyle: '',
|
||||
}
|
||||
this.$refs.dataform.resetForm();
|
||||
this.isShow = false;
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.loading = false;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.isShow) {
|
||||
this.$confirm('此操作将清空改皮肤下所有操作定义, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
self.create();
|
||||
}).catch(() => { });
|
||||
} else {
|
||||
self.create();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
const self = this;
|
||||
this.loading = true;
|
||||
addTrainingRulesList(this.formModel.skinStyle, OperationList[this.formModel.skinStyle].list).then(response => {
|
||||
self.loading = false;
|
||||
self.$message.success('批量生成操作定义成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable'); // 刷新列表
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('批量生成操作定义失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
skinStyle: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
this.isShow = false;
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,300 +1,297 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave" v-loading="loading">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicCodeExist, getData, update } from '@/api/management/dictionary'
|
||||
import { postTrainingRulesData, putTrainingRulesData, getPlaceholderList } from '@/api/management/operation';
|
||||
import { validateCharCode } from '@/utils/validate'
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
import { postTrainingRulesData, putTrainingRulesData, getPlaceholderList } from '@/api/management/operation';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
|
||||
export default {
|
||||
name: 'TrainingEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
trainingName: '',
|
||||
trainingType: '',
|
||||
operateType: '',
|
||||
skinStyle: '',
|
||||
minDuration: '',
|
||||
maxDuration: '',
|
||||
trainingRemark: '',
|
||||
productTypes: [],
|
||||
},
|
||||
skinStyleList: [],
|
||||
trainingTypeList: [],
|
||||
trainingOperateTypeMap: {},
|
||||
placeholderList: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'skinStyle', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList, disabled: !isAdd },
|
||||
{ prop: 'trainingType', label: '实训类型', type: 'select', required: true, options: this.trainingTypeList, disabled: !isAdd, change: true, onChange: this.changeList },
|
||||
{ prop: 'operateType', label: '操作类型', type: 'select', required: true, options: this.trainingOperateTypeMap[this.formModel.trainingType], disabled: !isAdd },
|
||||
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainName },
|
||||
{ prop: 'trainingName', label: '实训名称', type: 'text', required: true, rightWidth: true, tooltip: true, info: '选择占位符 ‘{}’ 不可删除,否则名称显示会有问题!' },
|
||||
{ prop: 'minDuration', label: '最佳用时', type: 'text', required: true },
|
||||
{ prop: 'maxDuration', label: '最大用时', type: 'text', required: true },
|
||||
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainRemark },
|
||||
{ prop: 'trainingRemark', label: '实训说明', type: 'textarea', required: true, tooltip: true, info: '选择占位符 ‘{}’ 不可删除,否则说明显示会有问题!' },
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
trainingName: [
|
||||
{ required: true, message: '请输入实训名称', trigger: 'blur' },
|
||||
],
|
||||
trainingType: [
|
||||
{ required: true, message: '请输入实训类型', trigger: 'change' },
|
||||
],
|
||||
operateType: [
|
||||
{ required: true, message: '请输入操作类型', trigger: 'change' }
|
||||
],
|
||||
skinStyle: [
|
||||
{ required: true, message: '请选择皮肤类型', trigger: 'change' },
|
||||
],
|
||||
minDuration: [
|
||||
{ required: true, message: '请输入最佳用时', trigger: 'blur' }
|
||||
],
|
||||
maxDuration: [
|
||||
{ required: true, message: '请输入最大用时', trigger: 'blur' },
|
||||
],
|
||||
trainingRemark: [
|
||||
{ required: true, max: 500, message: '请输入实训说明', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
return crules
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建操作规则'
|
||||
} else {
|
||||
return '编辑操作规则'
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 获取皮肤列表
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});
|
||||
})
|
||||
export default {
|
||||
name: 'TrainingEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
trainingName: '',
|
||||
trainingType: '',
|
||||
operateType: '',
|
||||
skinStyle: '',
|
||||
minDuration: '',
|
||||
maxDuration: '',
|
||||
trainingRemark: '',
|
||||
productTypes: []
|
||||
},
|
||||
skinStyleList: [],
|
||||
trainingTypeList: [],
|
||||
trainingOperateTypeMap: {},
|
||||
placeholderList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'skinStyle', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList, disabled: !isAdd },
|
||||
{ prop: 'trainingType', label: '实训类型', type: 'select', required: true, options: this.trainingTypeList, disabled: !isAdd, change: true, onChange: this.changeList },
|
||||
{ prop: 'operateType', label: '操作类型', type: 'select', required: true, options: this.trainingOperateTypeMap[this.formModel.trainingType], disabled: !isAdd },
|
||||
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainName },
|
||||
{ prop: 'trainingName', label: '实训名称', type: 'text', required: true, rightWidth: true, tooltip: true, info: '选择占位符 ‘{}’ 不可删除,否则名称显示会有问题!' },
|
||||
{ prop: 'minDuration', label: '最佳用时', type: 'text', required: true },
|
||||
{ prop: 'maxDuration', label: '最大用时', type: 'text', required: true },
|
||||
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainRemark },
|
||||
{ prop: 'trainingRemark', label: '实训说明', type: 'textarea', required: true, tooltip: true, info: '选择占位符 ‘{}’ 不可删除,否则说明显示会有问题!' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
trainingName: [
|
||||
{ required: true, message: '请输入实训名称', trigger: 'blur' }
|
||||
],
|
||||
trainingType: [
|
||||
{ required: true, message: '请输入实训类型', trigger: 'change' }
|
||||
],
|
||||
operateType: [
|
||||
{ required: true, message: '请输入操作类型', trigger: 'change' }
|
||||
],
|
||||
skinStyle: [
|
||||
{ required: true, message: '请选择皮肤类型', trigger: 'change' }
|
||||
],
|
||||
minDuration: [
|
||||
{ required: true, message: '请输入最佳用时', trigger: 'blur' }
|
||||
],
|
||||
maxDuration: [
|
||||
{ required: true, message: '请输入最大用时', trigger: 'blur' }
|
||||
],
|
||||
trainingRemark: [
|
||||
{ required: true, max: 500, message: '请输入实训说明', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建操作规则';
|
||||
} else {
|
||||
return '编辑操作规则';
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 获取皮肤列表
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});
|
||||
});
|
||||
|
||||
// 获取实训类型
|
||||
this.trainingTypeList = [];
|
||||
this.$Dictionary.trainingType().then(list => {
|
||||
this.trainingTypeList = list.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});
|
||||
})
|
||||
// 获取实训操作类型
|
||||
this.trainingOperateTypeMap = {}
|
||||
this.$Dictionary.stationControl().then(list => {
|
||||
this.trainingOperateTypeMap['01'] = list.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //控制权实训
|
||||
});
|
||||
this.$Dictionary.signalOperation().then(list => {
|
||||
this.trainingOperateTypeMap['02'] = list.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //信号机实训
|
||||
});
|
||||
this.$Dictionary.switchOperation().then(list => {
|
||||
this.trainingOperateTypeMap['03'] = list.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //道岔实训
|
||||
});
|
||||
this.$Dictionary.sectionOperation().then(list => {
|
||||
this.trainingOperateTypeMap['04'] = list.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //区段实训
|
||||
});
|
||||
this.$Dictionary.stationStandOperation().then(list => {
|
||||
this.trainingOperateTypeMap['05'] = list.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //站台实训
|
||||
});
|
||||
this.$Dictionary.trainPlanOperation().then(list => {
|
||||
this.trainingOperateTypeMap['06'] = list.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //行车计划实训
|
||||
});
|
||||
this.$Dictionary.trainOperation().then(list => {
|
||||
this.trainingOperateTypeMap['07'] = list.map(item => {
|
||||
let params = {}
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //列车实训
|
||||
});
|
||||
// 获取实训类型
|
||||
this.trainingTypeList = [];
|
||||
this.$Dictionary.trainingType().then(list => {
|
||||
this.trainingTypeList = list.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});
|
||||
});
|
||||
// 获取实训操作类型
|
||||
this.trainingOperateTypeMap = {};
|
||||
this.$Dictionary.stationControl().then(list => {
|
||||
this.trainingOperateTypeMap['01'] = list.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
}); // 控制权实训
|
||||
});
|
||||
this.$Dictionary.signalOperation().then(list => {
|
||||
this.trainingOperateTypeMap['02'] = list.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
}); // 信号机实训
|
||||
});
|
||||
this.$Dictionary.switchOperation().then(list => {
|
||||
this.trainingOperateTypeMap['03'] = list.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
}); // 道岔实训
|
||||
});
|
||||
this.$Dictionary.sectionOperation().then(list => {
|
||||
this.trainingOperateTypeMap['04'] = list.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
}); // 区段实训
|
||||
});
|
||||
this.$Dictionary.stationStandOperation().then(list => {
|
||||
this.trainingOperateTypeMap['05'] = list.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
}); // 站台实训
|
||||
});
|
||||
this.$Dictionary.trainPlanOperation().then(list => {
|
||||
this.trainingOperateTypeMap['06'] = list.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
}); // 行车计划实训
|
||||
});
|
||||
this.$Dictionary.trainOperation().then(list => {
|
||||
this.trainingOperateTypeMap['07'] = list.map(item => {
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
}); // 列车实训
|
||||
});
|
||||
|
||||
},
|
||||
async show(data) {
|
||||
this.loading = false;
|
||||
this.dialogVisible = true;
|
||||
if (data && data.id) {
|
||||
// 获取操作占位列表
|
||||
const res = await getPlaceholderList({ trainingType: data.trainingType, skinStyle: data.skinStyle });
|
||||
this.placeholderList = res.data;
|
||||
this.formModel = {
|
||||
id: data.id,
|
||||
trainingName: this.repliceName(data.trainingName, this.placeholderList),
|
||||
trainingType: data.trainingType,
|
||||
operateType: data.operateType,
|
||||
productTypes: data.productTypes,
|
||||
skinStyle: data.skinStyle,
|
||||
minDuration: data.minDuration,
|
||||
maxDuration: data.maxDuration,
|
||||
trainingRemark: this.repliceName(data.trainingRemark, this.placeholderList)
|
||||
};
|
||||
}
|
||||
},
|
||||
repliceName(fieldValue, enumList) {
|
||||
if (enumList && enumList.length > 0) {
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if (fieldValue.includes(`{${enumList[i].id}}`)) {
|
||||
fieldValue = fieldValue.replace(`{${enumList[i].id}}`, `{${enumList[i].name}}`);
|
||||
}
|
||||
}
|
||||
return fieldValue;
|
||||
}
|
||||
},
|
||||
changeList(val) {
|
||||
// 获取操作占位列表
|
||||
getPlaceholderList({ trainingType: val, skinStyle: '02' }).then(res => {
|
||||
this.placeholderList = res.data;
|
||||
});
|
||||
},
|
||||
addTrainName(val) {
|
||||
this.formModel.trainingName = `${this.formModel.trainingName}{${val.name}}`;
|
||||
},
|
||||
addTrainRemark(val) {
|
||||
this.formModel.trainingRemark = `${this.formModel.trainingRemark}{${val.name}}`;
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create();
|
||||
} else {
|
||||
self.update();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
const self = this;
|
||||
this.placeholderList.forEach(item => {
|
||||
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
||||
const name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
this.formModel.trainingName = name;
|
||||
}
|
||||
if (this.formModel.trainingRemark.includes(`{${item.name}}`)) {
|
||||
const remark = this.formModel.trainingRemark.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
this.formModel.trainingRemark = remark;
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async show(data) {
|
||||
this.loading = false;
|
||||
this.dialogVisible = true
|
||||
if (data && data.id) {
|
||||
// 获取操作占位列表
|
||||
let res = await getPlaceholderList({ trainingType: data.trainingType, skinStyle: data.skinStyle });
|
||||
this.placeholderList = res.data;
|
||||
this.formModel = {
|
||||
id: data.id,
|
||||
trainingName: this.repliceName(data.trainingName, this.placeholderList),
|
||||
trainingType: data.trainingType,
|
||||
operateType: data.operateType,
|
||||
productTypes: data.productTypes,
|
||||
skinStyle: data.skinStyle,
|
||||
minDuration: data.minDuration,
|
||||
maxDuration: data.maxDuration,
|
||||
trainingRemark: this.repliceName(data.trainingRemark, this.placeholderList),
|
||||
};
|
||||
}
|
||||
},
|
||||
repliceName(fieldValue, enumList) {
|
||||
if (enumList && enumList.length > 0) {
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if (fieldValue.includes(`{${enumList[i].id}}`)) {
|
||||
fieldValue = fieldValue.replace(`{${enumList[i].id}}`, `{${enumList[i].name}}`);
|
||||
}
|
||||
}
|
||||
return fieldValue;
|
||||
}
|
||||
},
|
||||
changeList(val) {
|
||||
// 获取操作占位列表
|
||||
getPlaceholderList({ trainingType: val, skinStyle: '02' }).then(res => {
|
||||
this.placeholderList = res.data;
|
||||
})
|
||||
},
|
||||
addTrainName(val) {
|
||||
this.formModel.trainingName = `${this.formModel.trainingName}{${val.name}}`
|
||||
},
|
||||
addTrainRemark(val) {
|
||||
this.formModel.trainingRemark = `${this.formModel.trainingRemark}{${val.name}}`
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create()
|
||||
} else {
|
||||
self.update()
|
||||
}
|
||||
})
|
||||
},
|
||||
create() {
|
||||
let self = this
|
||||
this.placeholderList.forEach(item => {
|
||||
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
||||
let name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
this.formModel.trainingName = name;
|
||||
}
|
||||
if (this.formModel.trainingRemark.includes(`{${item.name}}`)) {
|
||||
let remark = this.formModel.trainingRemark.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
this.formModel.trainingRemark = remark;
|
||||
}
|
||||
})
|
||||
this.loading = true;
|
||||
postTrainingRulesData(this.formModel).then(response => {
|
||||
self.loading = false;
|
||||
self.$message.success('创建操作定义成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('创建操作定义失败:' + error.message);
|
||||
});
|
||||
},
|
||||
update() {
|
||||
const self = this;
|
||||
this.placeholderList.forEach(item => {
|
||||
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
||||
const name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
this.formModel.trainingName = name;
|
||||
}
|
||||
if (this.formModel.trainingRemark.includes(`{${item.name}}`)) {
|
||||
const remark = this.formModel.trainingRemark.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
this.formModel.trainingRemark = remark;
|
||||
}
|
||||
});
|
||||
|
||||
this.loading = true;
|
||||
postTrainingRulesData(this.formModel).then(response => {
|
||||
self.loading = false;
|
||||
self.$message.success('创建操作定义成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('创建操作定义失败:' + error.message)
|
||||
})
|
||||
},
|
||||
update() {
|
||||
let self = this
|
||||
this.placeholderList.forEach(item => {
|
||||
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
||||
let name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
this.formModel.trainingName = name;
|
||||
}
|
||||
if (this.formModel.trainingRemark.includes(`{${item.name}}`)) {
|
||||
let remark = this.formModel.trainingRemark.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
this.formModel.trainingRemark = remark;
|
||||
}
|
||||
})
|
||||
|
||||
this.loading = true;
|
||||
putTrainingRulesData(this.formModel).then(response => {
|
||||
self.loading = false;
|
||||
self.$message.success('创建操作定义成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('创建操作定义失败:' + error.message)
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
trainingName: '',
|
||||
trainingType: '',
|
||||
operateType: '',
|
||||
skinStyle: '',
|
||||
minDuration: '',
|
||||
maxDuration: '',
|
||||
trainingRemark: '',
|
||||
}
|
||||
this.$refs.dataform.resetForm()
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.loading = true;
|
||||
putTrainingRulesData(this.formModel).then(response => {
|
||||
self.loading = false;
|
||||
self.$message.success('创建操作定义成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('创建操作定义失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
trainingName: '',
|
||||
trainingType: '',
|
||||
operateType: '',
|
||||
skinStyle: '',
|
||||
minDuration: '',
|
||||
maxDuration: '',
|
||||
trainingRemark: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -61,7 +61,7 @@
|
||||
title: '设备类型',
|
||||
prop: 'deviceType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.deviceType, this.deviceList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.deviceType, this.deviceList, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
@ -136,18 +136,6 @@
|
||||
queryFunction(params) {
|
||||
return getOperateStepDataList(this.dicId, params)
|
||||
},
|
||||
// 转义
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.show(row)
|
||||
},
|
||||
|
@ -72,21 +72,21 @@
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) },
|
||||
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
title: '实训类型',
|
||||
prop: 'trainingType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.trainingType, this.trainingTypeList, ['code', 'name']) },
|
||||
columnValue: (row) => { return this.$convertField(row.trainingType, this.trainingTypeList, ['code', 'name']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
title: '操作类型',
|
||||
prop: 'operateType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.operateType, this.trainingOperateTypeMap[row.trainingType], ['code', 'name']) },
|
||||
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.trainingType], ['code', 'name']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
@ -205,17 +205,6 @@
|
||||
return fieldValue;
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
// 选择实训类型下的操作类型 暂时不用
|
||||
typeChoose(form) {
|
||||
this.queryForm.queryObject.operateType.config.data = [];
|
||||
|
@ -1,286 +1,290 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<training-draft ref="draftTrain" :skinStyleList="skinStyleList" :trainingTypeList="trainingTypeList"
|
||||
:trainingOperateTypeMap="trainingOperateTypeMap" @refresh="reloadTable"></training-draft>
|
||||
</div>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<training-draft
|
||||
ref="draftTrain"
|
||||
:skin-style-list="skinStyleList"
|
||||
:training-type-list="trainingTypeList"
|
||||
:training-operate-type-map="trainingOperateTypeMap"
|
||||
@refresh="reloadTable"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPublishMap, putMapProductOnLine, putMapProductOffLine } from '@/api/jmap/mapdraft';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { pageQueryTraining } from '@/api/jmap/training';
|
||||
import { trainingNotify } from '@/api/simulation';
|
||||
import { getCommodityMapProduct, getProductList } from '@/api/management/mapprd';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import TrainingDraft from './draft';
|
||||
import localStore from 'storejs';
|
||||
// import { listPublishMap, putMapProductOnLine, putMapProductOffLine } from '@/api/jmap/mapdraft';
|
||||
// import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { pageQueryTraining } from '@/api/jmap/training';
|
||||
import { trainingNotify } from '@/api/simulation';
|
||||
import { getCommodityMapProduct, getProductList } from '@/api/management/mapprd';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import { getSkinStyleList } from '@/api/management/mapskin';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import TrainingDraft from './draft';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'TrainingGeneration',
|
||||
components: {
|
||||
TrainingDraft,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
skinStyleList: [],
|
||||
trainingTypeList: [],
|
||||
prdTypeList: [],
|
||||
trainingOperateTypeMap: {},
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
initLoadCallback: this.loadInitQueryList,
|
||||
queryObject: {
|
||||
skinStyle: {
|
||||
type: 'select',
|
||||
label: '皮肤类型',
|
||||
change: this.skinStyleChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
prdCode: {
|
||||
type: 'select',
|
||||
label: '产品',
|
||||
change: this.prdChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: '实训类型',
|
||||
change: this.typeChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
operateType: {
|
||||
type: 'select',
|
||||
label: '操作类型',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
generateType: {
|
||||
type: 'select',
|
||||
label: '自动/人工',
|
||||
config: {
|
||||
data: [{ value: '02', label: '人工' }, { value: '01', label: '自动' }]
|
||||
}
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '实训名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: pageQueryTraining,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '实训名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
title: '产品',
|
||||
prop: 'prdCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.prdCode, this.prdTypeList, ['code', 'name']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
title: '实训类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.type, this.trainingTypeList, ['code', 'name']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
title: '操作类型',
|
||||
prop: 'operateType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
title: '最小用时',
|
||||
prop: 'minDuration'
|
||||
},
|
||||
{
|
||||
title: '最大用时',
|
||||
prop: 'maxDuration'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '演示',
|
||||
handleClick: this.demoDisplay,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '生成实训', btnCode: 'employee_insert', handler: this.autoMaticTrainging },
|
||||
{ text: '修改实训', btnCode: 'employee_insert', handler: this.editTrainingByType, type: 'warning' },
|
||||
{ text: '删除实训', btnCode: 'employee_insert', handler: this.delAutoMaticTrainging, type: 'danger', },
|
||||
]
|
||||
},
|
||||
export default {
|
||||
name: 'TrainingGeneration',
|
||||
components: {
|
||||
TrainingDraft
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
skinStyleList: [],
|
||||
trainingTypeList: [],
|
||||
prdTypeList: [],
|
||||
trainingOperateTypeMap: {},
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
initLoadCallback: this.loadInitQueryList,
|
||||
queryObject: {
|
||||
skinStyle: {
|
||||
type: 'select',
|
||||
label: '皮肤类型',
|
||||
change: this.skinStyleChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
prdCode: {
|
||||
type: 'select',
|
||||
label: '产品',
|
||||
change: this.prdChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: '实训类型',
|
||||
change: this.typeChoose,
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
operateType: {
|
||||
type: 'select',
|
||||
label: '操作类型',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
generateType: {
|
||||
type: 'select',
|
||||
label: '自动/人工',
|
||||
config: {
|
||||
data: [{ value: '02', label: '人工' }, { value: '01', label: '自动' }]
|
||||
}
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '实训名称'
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: pageQueryTraining,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '实训名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '产品',
|
||||
prop: 'prdCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '实训类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.type, this.trainingTypeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '操作类型',
|
||||
prop: 'operateType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '最小用时',
|
||||
prop: 'minDuration'
|
||||
},
|
||||
{
|
||||
title: '最大用时',
|
||||
prop: 'maxDuration'
|
||||
},
|
||||
{
|
||||
title: '描述',
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '演示',
|
||||
handleClick: this.demoDisplay,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '生成实训', btnCode: 'employee_insert', handler: this.autoMaticTrainging },
|
||||
{ text: '修改实训', btnCode: 'employee_insert', handler: this.editTrainingByType, type: 'warning' },
|
||||
{ text: '删除实训', btnCode: 'employee_insert', handler: this.delAutoMaticTrainging, type: 'danger' }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
await this.loadInitData();
|
||||
let json = localStore.get(this.$route.path);
|
||||
if (json && json.type) {
|
||||
this.typeChoose(json);
|
||||
}
|
||||
if (json && json.prdCode) {
|
||||
this.skinStyleChoose(json);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
this.queryForm.queryObject.skinStyle.config.data = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
response.data.forEach(elem => {
|
||||
this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name });
|
||||
})
|
||||
})
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
async created() {
|
||||
await this.loadInitData();
|
||||
const json = localStore.get(this.$route.path);
|
||||
if (json && json.type) {
|
||||
this.typeChoose(json);
|
||||
}
|
||||
if (json && json.prdCode) {
|
||||
this.skinStyleChoose(json);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async loadInitData() {
|
||||
this.skinStyleList = [];
|
||||
this.queryForm.queryObject.skinStyle.config.data = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
response.data.forEach(elem => {
|
||||
this.queryForm.queryObject.skinStyle.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
});
|
||||
|
||||
this.prdTypeList = [];
|
||||
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
|
||||
let list = res.data.list;
|
||||
if (list && list.length > 0) {
|
||||
this.prdTypeList = list.filter(elem => { return elem.prdType != '03'; });
|
||||
}
|
||||
})
|
||||
this.prdTypeList = [];
|
||||
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
|
||||
const list = res.data.list;
|
||||
if (list && list.length > 0) {
|
||||
this.prdTypeList = list.filter(elem => { return elem.prdType != '03'; });
|
||||
}
|
||||
});
|
||||
|
||||
// 获取实训类型
|
||||
this.trainingTypeList = [];
|
||||
this.$Dictionary.trainingType().then(list => {
|
||||
this.trainingTypeList = list;
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
})
|
||||
// 获取实训类型
|
||||
this.trainingTypeList = [];
|
||||
this.$Dictionary.trainingType().then(list => {
|
||||
this.trainingTypeList = list;
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
});
|
||||
|
||||
this.trainingOperateTypeMap = {}
|
||||
let list01 = await this.$Dictionary.stationControl();
|
||||
this.trainingOperateTypeMap['01'] = list01; //控制权实训
|
||||
let list02 = await this.$Dictionary.signalOperation();
|
||||
this.trainingOperateTypeMap['02'] = list02; //信号机实训
|
||||
let list03 = await this.$Dictionary.switchOperation();
|
||||
this.trainingOperateTypeMap['03'] = list03; //道岔实训
|
||||
let list04 = await this.$Dictionary.sectionOperation();
|
||||
this.trainingOperateTypeMap['04'] = list04; //区段实训
|
||||
let list05 = await this.$Dictionary.stationStandOperation();
|
||||
this.trainingOperateTypeMap['05'] = list05; //站台实训
|
||||
let list06 = await this.$Dictionary.trainPlanOperation();
|
||||
this.trainingOperateTypeMap['06'] = list06; //行车计划实训
|
||||
let list07 = await this.$Dictionary.trainOperation();
|
||||
this.trainingOperateTypeMap['07'] = list07; //列车实训
|
||||
let list08 = await this.$Dictionary.limitOperation();
|
||||
this.trainingOperateTypeMap['08'] = list08; //限速实训
|
||||
this.reloadTable()
|
||||
},
|
||||
loadInitQueryList(form) {
|
||||
if (form && form.skinStyle) {
|
||||
getCommodityMapProduct(form.skinStyle).then((response) => {
|
||||
let productList = response.data;
|
||||
if (productList && productList.length > 0) {
|
||||
productList.forEach(elem => {
|
||||
//过滤综合演练产品
|
||||
if (elem.prdType != '03') {
|
||||
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
skinStyleChoose(form) {
|
||||
this.queryForm.queryObject.prdCode.config.data = [];
|
||||
form.type = '';
|
||||
form.prdCode = '';
|
||||
form.operateType = '';
|
||||
this.loadInitQueryList(form);
|
||||
},
|
||||
prdChoose(form) {
|
||||
form.type = '';
|
||||
form.operateType = '';
|
||||
},
|
||||
typeChoose(form) {
|
||||
this.queryForm.queryObject.operateType.config.data = [];
|
||||
form.operateType = '';
|
||||
if (form && form.type) {
|
||||
this.trainingOperateTypeMap[form.type].forEach(elem => {
|
||||
this.queryForm.queryObject.operateType.config.data.push({ value: elem.code, label: elem.name });
|
||||
})
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
autoMaticTrainging() {
|
||||
this.$refs.draftTrain.show({ event: '01', title: '自动生成实训' });
|
||||
},
|
||||
editTrainingByType() {
|
||||
this.$refs.draftTrain.show({ event: '02', title: '按类别修改实训' });
|
||||
},
|
||||
delAutoMaticTrainging() {
|
||||
this.$refs.draftTrain.show({ event: '03', title: '删除自动生成实训' });
|
||||
},
|
||||
demoDisplay(index, node) {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
||||
let query = { group: resp.data, trainingId: node.id, lessonId: 0 };
|
||||
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
|
||||
this.trainingOperateTypeMap = {};
|
||||
const list01 = await this.$Dictionary.stationControl();
|
||||
this.trainingOperateTypeMap['01'] = list01; // 控制权实训
|
||||
const list02 = await this.$Dictionary.signalOperation();
|
||||
this.trainingOperateTypeMap['02'] = list02; // 信号机实训
|
||||
const list03 = await this.$Dictionary.switchOperation();
|
||||
this.trainingOperateTypeMap['03'] = list03; // 道岔实训
|
||||
const list04 = await this.$Dictionary.sectionOperation();
|
||||
this.trainingOperateTypeMap['04'] = list04; // 区段实训
|
||||
const list05 = await this.$Dictionary.stationStandOperation();
|
||||
this.trainingOperateTypeMap['05'] = list05; // 站台实训
|
||||
const list06 = await this.$Dictionary.trainPlanOperation();
|
||||
this.trainingOperateTypeMap['06'] = list06; // 行车计划实训
|
||||
const list07 = await this.$Dictionary.trainOperation();
|
||||
this.trainingOperateTypeMap['07'] = list07; // 列车实训
|
||||
const list08 = await this.$Dictionary.limitOperation();
|
||||
this.trainingOperateTypeMap['08'] = list08; // 限速实训
|
||||
this.reloadTable();
|
||||
},
|
||||
loadInitQueryList(form) {
|
||||
if (form && form.skinStyle) {
|
||||
getCommodityMapProduct(form.skinStyle).then((response) => {
|
||||
const productList = response.data;
|
||||
if (productList && productList.length > 0) {
|
||||
productList.forEach(elem => {
|
||||
// 过滤综合演练产品
|
||||
if (elem.prdType != '03') {
|
||||
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
skinStyleChoose(form) {
|
||||
this.queryForm.queryObject.prdCode.config.data = [];
|
||||
form.type = '';
|
||||
form.prdCode = '';
|
||||
form.operateType = '';
|
||||
this.loadInitQueryList(form);
|
||||
},
|
||||
prdChoose(form) {
|
||||
form.type = '';
|
||||
form.operateType = '';
|
||||
},
|
||||
typeChoose(form) {
|
||||
this.queryForm.queryObject.operateType.config.data = [];
|
||||
form.operateType = '';
|
||||
if (form && form.type) {
|
||||
this.trainingOperateTypeMap[form.type].forEach(elem => {
|
||||
this.queryForm.queryObject.operateType.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
const value = converFormat[0];
|
||||
const label = converFormat[1];
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
autoMaticTrainging() {
|
||||
this.$refs.draftTrain.show({ event: '01', title: '自动生成实训' });
|
||||
},
|
||||
editTrainingByType() {
|
||||
this.$refs.draftTrain.show({ event: '02', title: '按类别修改实训' });
|
||||
},
|
||||
delAutoMaticTrainging() {
|
||||
this.$refs.draftTrain.show({ event: '03', title: '删除自动生成实训' });
|
||||
},
|
||||
demoDisplay(index, node) {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
||||
const query = { group: resp.data, trainingId: node.id, lessonId: 0 };
|
||||
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
|
||||
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建仿真失败: ${error.message}`);
|
||||
})
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建仿真失败: ${error.message}`);
|
||||
});
|
||||
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,155 +1,153 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicCodeExist, getData, update } from '@/api/management/dictionary'
|
||||
import { validateCharCode } from '@/utils/validate'
|
||||
export default {
|
||||
name: 'DictionaryEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
labelWidth: '60px',
|
||||
items: [
|
||||
{ prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd },
|
||||
{ prop: 'name', label: '名称', type: 'text', required: true },
|
||||
{
|
||||
prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
},
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false },
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
{ max: 50, message: '不能超过 50 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
if (this.type === 'ADD') {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateCode, trigger: 'blur' }
|
||||
]
|
||||
})
|
||||
} else {
|
||||
return crules
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建目录'
|
||||
} else {
|
||||
return '编辑目录'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateCode(rule, value, callback) {
|
||||
if (!validateCharCode(value)) {
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'))
|
||||
} else {
|
||||
checkDicCodeExist(value).then(response => {
|
||||
if (response.data) {
|
||||
return callback(new Error('编码已存在'))
|
||||
} else {
|
||||
return callback()
|
||||
}
|
||||
}).catch(error => {
|
||||
return callback(new Error('服务异常'))
|
||||
})
|
||||
}
|
||||
},
|
||||
show(id) {
|
||||
this.dialogVisible = true
|
||||
if (id) {
|
||||
getData(id).then(response => {
|
||||
this.formModel = response.data
|
||||
this.$refs.dataform.resetForm()
|
||||
}).catch(error => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create()
|
||||
} else {
|
||||
self.update()
|
||||
}
|
||||
})
|
||||
},
|
||||
create() {
|
||||
let self = this
|
||||
create(this.formModel).then(response => {
|
||||
self.$message.success('创建字典目录成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
}).catch(error => {
|
||||
self.$message.error('创建字典目录失败:' + error.message)
|
||||
})
|
||||
},
|
||||
update() {
|
||||
let self = this
|
||||
update(this.formModel).then(response => {
|
||||
self.$message.success('更新字典目录成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
}).catch(error => {
|
||||
self.$message.error('更新字典目录失败:' + error.message)
|
||||
})
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
this.$refs.dataform.resetForm()
|
||||
if (done) {
|
||||
done()
|
||||
} else {
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
import { create, checkDicCodeExist, getData, update } from '@/api/management/dictionary';
|
||||
import { validateCharCode } from '@/utils/validate';
|
||||
export default {
|
||||
name: 'DictionaryEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '60px',
|
||||
items: [
|
||||
{ prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd },
|
||||
{ prop: 'name', label: '名称', type: 'text', required: true },
|
||||
{
|
||||
prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
},
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
{ max: 50, message: '不能超过 50 个字符', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
if (this.type === 'ADD') {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateCode, trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
} else {
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建目录';
|
||||
} else {
|
||||
return '编辑目录';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateCode(rule, value, callback) {
|
||||
if (!validateCharCode(value)) {
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'));
|
||||
} else {
|
||||
checkDicCodeExist(value).then(response => {
|
||||
if (response.data) {
|
||||
return callback(new Error('编码已存在'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
}).catch(() => {
|
||||
return callback(new Error('服务异常'));
|
||||
});
|
||||
}
|
||||
},
|
||||
show(id) {
|
||||
this.dialogVisible = true;
|
||||
if (id) {
|
||||
getData(id).then(response => {
|
||||
this.formModel = response.data;
|
||||
this.$refs.dataform.resetForm();
|
||||
});
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create();
|
||||
} else {
|
||||
self.update();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
const self = this;
|
||||
create(this.formModel).then(response => {
|
||||
self.$message.success('创建字典目录成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('创建字典目录失败:' + error.message);
|
||||
});
|
||||
},
|
||||
update() {
|
||||
const self = this;
|
||||
update(this.formModel).then(response => {
|
||||
self.$message.success('更新字典目录成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('更新字典目录失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
if (done) {
|
||||
done();
|
||||
} else {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,138 +1,137 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable"></dictionary-edit>
|
||||
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable"></dictionary-edit>
|
||||
</div>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable" />
|
||||
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list, create, del } from '@/api/management/dictionary'
|
||||
import DictionaryEdit from '@/views/management/dictionary/edit'
|
||||
export default {
|
||||
name: 'Dictionary',
|
||||
components: {
|
||||
DictionaryEdit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
code: {
|
||||
type: 'text',
|
||||
label: '编码'
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名称'
|
||||
},
|
||||
status: {
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
config: {
|
||||
data: this.$ConstSelect.Status
|
||||
}
|
||||
}
|
||||
}
|
||||
import { list, del } from '@/api/management/dictionary';
|
||||
import DictionaryEdit from '@/views/management/dictionary/edit';
|
||||
export default {
|
||||
name: 'Dictionary',
|
||||
components: {
|
||||
DictionaryEdit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
code: {
|
||||
type: 'text',
|
||||
label: '编码'
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名称'
|
||||
},
|
||||
status: {
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
config: {
|
||||
data: this.$ConstSelect.Status
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: list,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '编码',
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status') },
|
||||
tagType: (row) => { if (row.status === '0') { return 'danger' } else { return 'success' } }
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '字典明细',
|
||||
handleClick: this.handleViewDetail
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleEdit
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', handler: this.handleAdd },
|
||||
// { text: '批量删除', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
|
||||
]
|
||||
},
|
||||
},
|
||||
queryList: {
|
||||
query: list,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '编码',
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
|
||||
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '字典明细',
|
||||
handleClick: this.handleViewDetail
|
||||
},
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleEdit
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', handler: this.handleAdd }
|
||||
// { text: '批量删除', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleViewDetail(index, row) {
|
||||
this.$router.push({ path: `/system/dictionary/detail`, query: { id: row.id } })
|
||||
},
|
||||
methods: {
|
||||
handleViewDetail(index, row) {
|
||||
this.$router.push({ path: `/system/dictionary/detail`, query: { id: row.id } });
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.show(row.id)
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.show(row.id);
|
||||
},
|
||||
|
||||
handleAdd() {
|
||||
this.$refs.create.show()
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.create.show();
|
||||
},
|
||||
|
||||
handleBatchDelete() {
|
||||
},
|
||||
handleBatchDelete() {
|
||||
},
|
||||
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
del(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
del(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,159 +1,157 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicDetailCodeExist, getData, update } from '@/api/management/dictionaryDetail'
|
||||
import { validateCharCode } from '@/utils/validate'
|
||||
export default {
|
||||
name: 'DictionaryDetailEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
dicId: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
labelWidth: '60px',
|
||||
items: [
|
||||
{ prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd },
|
||||
{ prop: 'name', label: '名称', type: 'text', required: true },
|
||||
{
|
||||
prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
},
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false },
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
{ max: 50, message: '不能超过 50 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
if (this.type === 'ADD') {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateCode, trigger: 'blur' }
|
||||
]
|
||||
})
|
||||
} else {
|
||||
return crules
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建明细'
|
||||
} else {
|
||||
return '编辑明细'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateCode(rule, value, callback) {
|
||||
if (!validateCharCode(value)) {
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'))
|
||||
} else {
|
||||
checkDicDetailCodeExist(this.dicId, value).then(response => {
|
||||
if (response.data) {
|
||||
return callback(new Error('编码已存在'))
|
||||
} else {
|
||||
return callback()
|
||||
}
|
||||
}).catch(error => {
|
||||
return callback(new Error('服务异常'))
|
||||
})
|
||||
}
|
||||
},
|
||||
show(id) {
|
||||
this.dialogVisible = true
|
||||
if (id) {
|
||||
getData(this.dicId, id).then(response => {
|
||||
this.formModel = response.data
|
||||
this.$refs.dataform.resetForm()
|
||||
}).catch(error => {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create()
|
||||
} else {
|
||||
self.update()
|
||||
}
|
||||
})
|
||||
},
|
||||
create() {
|
||||
let self = this
|
||||
create(this.dicId, this.formModel).then(response => {
|
||||
self.$message.success('创建字典目录成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
}).catch(error => {
|
||||
self.$message.error('创建字典目录失败:' + error.message)
|
||||
})
|
||||
},
|
||||
update() {
|
||||
let self = this
|
||||
update(this.dicId, this.formModel).then(response => {
|
||||
self.$message.success('更新字典目录成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
}).catch(error => {
|
||||
self.$message.error('更新字典目录失败:' + error.message)
|
||||
})
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
this.$refs.dataform.resetForm()
|
||||
if (done) {
|
||||
done()
|
||||
} else {
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
import { create, checkDicDetailCodeExist, getData, update } from '@/api/management/dictionaryDetail';
|
||||
import { validateCharCode } from '@/utils/validate';
|
||||
export default {
|
||||
name: 'DictionaryDetailEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
dicId: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '60px',
|
||||
items: [
|
||||
{ prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd },
|
||||
{ prop: 'name', label: '名称', type: 'text', required: true },
|
||||
{
|
||||
prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
},
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
{ max: 50, message: '不能超过 50 个字符', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
if (this.type === 'ADD') {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateCode, trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
} else {
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建明细';
|
||||
} else {
|
||||
return '编辑明细';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateCode(rule, value, callback) {
|
||||
if (!validateCharCode(value)) {
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'));
|
||||
} else {
|
||||
checkDicDetailCodeExist(this.dicId, value).then(response => {
|
||||
if (response.data) {
|
||||
return callback(new Error('编码已存在'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
}).catch(() => {
|
||||
return callback(new Error('服务异常'));
|
||||
});
|
||||
}
|
||||
},
|
||||
show(id) {
|
||||
this.dialogVisible = true;
|
||||
if (id) {
|
||||
getData(this.dicId, id).then(response => {
|
||||
this.formModel = response.data;
|
||||
this.$refs.dataform.resetForm();
|
||||
});
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create();
|
||||
} else {
|
||||
self.update();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
const self = this;
|
||||
create(this.dicId, this.formModel).then(response => {
|
||||
self.$message.success('创建字典目录成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('创建字典目录失败:' + error.message);
|
||||
});
|
||||
},
|
||||
update() {
|
||||
const self = this;
|
||||
update(this.dicId, this.formModel).then(response => {
|
||||
self.$message.success('更新字典目录成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('更新字典目录失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
code: '',
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
if (done) {
|
||||
done();
|
||||
} else {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,161 +1,156 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="turnback">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<dictionary-detail-edit ref="create" type="ADD" :dicId="dicId" @reloadTable="reloadTable">
|
||||
</dictionary-detail-edit>
|
||||
<dictionary-detail-edit ref="edit" type="EDIT" :dicId="dicId" @reloadTable="reloadTable">
|
||||
</dictionary-detail-edit>
|
||||
<div>
|
||||
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="turnback">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<dictionary-detail-edit ref="create" type="ADD" :dic-id="dicId" @reloadTable="reloadTable" />
|
||||
<dictionary-detail-edit ref="edit" type="EDIT" :dic-id="dicId" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list, create, del } from '@/api/management/dictionaryDetail'
|
||||
import { getData } from '@/api/management/dictionary'
|
||||
import DictionaryDetailEdit from '@/views/management/dictionaryDetail/edit'
|
||||
export default {
|
||||
name: 'DictionaryDetail',
|
||||
components: {
|
||||
DictionaryDetailEdit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dicId: '',
|
||||
dic: {},
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
code: {
|
||||
type: 'text',
|
||||
label: '编码'
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名称'
|
||||
},
|
||||
status: {
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
config: {
|
||||
data: this.$ConstSelect.Status
|
||||
}
|
||||
}
|
||||
}
|
||||
import { list, del } from '@/api/management/dictionaryDetail';
|
||||
import { getData } from '@/api/management/dictionary';
|
||||
import DictionaryDetailEdit from '@/views/management/dictionaryDetail/edit';
|
||||
export default {
|
||||
name: 'DictionaryDetail',
|
||||
components: {
|
||||
DictionaryDetailEdit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dicId: '',
|
||||
dic: {},
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
code: {
|
||||
type: 'text',
|
||||
label: '编码'
|
||||
},
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名称'
|
||||
},
|
||||
status: {
|
||||
type: 'select',
|
||||
label: '状态',
|
||||
config: {
|
||||
data: this.$ConstSelect.Status
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '编码',
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status') },
|
||||
tagType: (row) => { if (row.status === '0') { return 'danger' } else { return 'success' } }
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleEdit
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', btnCode: 'employee_insert', handler: this.handleAdd },
|
||||
// { text: '批量删除', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
|
||||
]
|
||||
},
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '编码',
|
||||
prop: 'code'
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
|
||||
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleEdit
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', btnCode: 'employee_insert', handler: this.handleAdd }
|
||||
// { text: '批量删除', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
|
||||
// computed: {
|
||||
// turnbackBarTitle() {
|
||||
// return this.dic.name + '(' + this.dic.code + ')'
|
||||
// }
|
||||
// },
|
||||
// computed: {
|
||||
// turnbackBarTitle() {
|
||||
// return this.dic.name + '(' + this.dic.code + ')'
|
||||
// }
|
||||
// },
|
||||
|
||||
created() {
|
||||
this.dicId = this.$route.query.id;
|
||||
getData(this.dicId).then(response => {
|
||||
this.dic = response.data
|
||||
}).catch(error => {
|
||||
created() {
|
||||
this.dicId = this.$route.query.id;
|
||||
getData(this.dicId).then(response => {
|
||||
this.dic = response.data;
|
||||
});
|
||||
},
|
||||
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
return list(this.dicId, params);
|
||||
},
|
||||
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
return list(this.dicId, params)
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.show(row.id);
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.show(row.id)
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.create.show();
|
||||
},
|
||||
|
||||
handleAdd() {
|
||||
this.$refs.create.show()
|
||||
},
|
||||
handleBatchDelete() {
|
||||
|
||||
handleBatchDelete() {
|
||||
},
|
||||
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
del(this.dicId, row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
},
|
||||
|
||||
handleDelete(index, row) {
|
||||
del(this.dicId, row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
},
|
||||
|
||||
turnback() {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
turnback() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
@ -163,4 +158,4 @@
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -1,206 +1,194 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getExistingSimulation,deleteExistingSimulation } from '@/api/simulation';
|
||||
export default {
|
||||
name: 'SimulationManage',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
examResultList: [],
|
||||
LessonList: [],
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
group: {
|
||||
type: 'text',
|
||||
label: '仿真Group'
|
||||
},
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: '用户名'
|
||||
},
|
||||
mobile: {
|
||||
type: 'text',
|
||||
label: '手机号'
|
||||
},
|
||||
skinCode: {
|
||||
type: 'select',
|
||||
label: '皮肤编号',
|
||||
config: {
|
||||
data: this.$ConstSelect.skinCode
|
||||
}
|
||||
},
|
||||
prdType: {
|
||||
type: 'select',
|
||||
label: '产品类型',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: '仿真类型',
|
||||
config: {
|
||||
data: this.$ConstSelect.SimulationType
|
||||
}
|
||||
}
|
||||
}
|
||||
import { getExistingSimulation, deleteExistingSimulation } from '@/api/simulation';
|
||||
export default {
|
||||
name: 'SimulationManage',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
examResultList: [],
|
||||
LessonList: [],
|
||||
mapList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
group: {
|
||||
type: 'text',
|
||||
label: '仿真Group'
|
||||
},
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: '用户名'
|
||||
},
|
||||
mobile: {
|
||||
type: 'text',
|
||||
label: '手机号'
|
||||
},
|
||||
skinCode: {
|
||||
type: 'select',
|
||||
label: '皮肤编号',
|
||||
config: {
|
||||
data: this.$ConstSelect.skinCode
|
||||
}
|
||||
},
|
||||
prdType: {
|
||||
type: 'select',
|
||||
label: '产品类型',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
type: {
|
||||
type: 'select',
|
||||
label: '仿真类型',
|
||||
config: {
|
||||
data: this.$ConstSelect.SimulationType
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: getExistingSimulation,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '用户名称',
|
||||
prop: 'creator.name'
|
||||
},
|
||||
{
|
||||
title: '用户电话',
|
||||
prop: 'creator.mobile'
|
||||
},
|
||||
{
|
||||
title: 'Group',
|
||||
prop: 'group'
|
||||
},
|
||||
{
|
||||
title: '是否错误',
|
||||
prop: 'error',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.error, 'Whether') },
|
||||
tagType: (row) => {
|
||||
switch (row.error) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '产品',
|
||||
prop: 'mapPrdVO.name'
|
||||
},
|
||||
{
|
||||
title: '是否暂停',
|
||||
prop: 'pause',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.pause, 'Whether') },
|
||||
tagType: (row) => {
|
||||
switch (row.pause) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '是否按计划行车',
|
||||
prop: 'runAsPlan',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.runAsPlan, 'Whether') },
|
||||
tagType: (row) => {
|
||||
switch (row.runAsPlan) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '皮肤编号',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinCode, this.$ConstSelect.skinCode, ['value', 'label'])},
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
title: '仿真类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.type, this.$ConstSelect.SimulationType, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
title: '仿真成员ID',
|
||||
prop: 'sessionList',
|
||||
type: 'basicText',
|
||||
columnValue: (row) => { return this.listJoiningTogether(row.sessionList) }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
// width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '销毁',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger',
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
},
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$Dictionary.productType().then(list => {
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.prdType.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
listJoiningTogether(sessionList) {
|
||||
let sessionId = '';
|
||||
if(sessionList.length>0){
|
||||
sessionList.forEach((item) => {
|
||||
sessionId = sessionId+item+',';
|
||||
});
|
||||
sessionId = sessionId.substring(0,sessionId.length-1);
|
||||
}
|
||||
return sessionId;
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除此用户仿真数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteExistingSimulation(row.group).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
})
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: getExistingSimulation,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '用户名称',
|
||||
prop: 'creator.name'
|
||||
},
|
||||
{
|
||||
title: '用户电话',
|
||||
prop: 'creator.mobile'
|
||||
},
|
||||
{
|
||||
title: 'Group',
|
||||
prop: 'group'
|
||||
},
|
||||
{
|
||||
title: '是否错误',
|
||||
prop: 'error',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.error, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
switch (row.error) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '产品',
|
||||
prop: 'mapPrdVO.name'
|
||||
},
|
||||
{
|
||||
title: '是否暂停',
|
||||
prop: 'pause',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.pause, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
switch (row.pause) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '是否按计划行车',
|
||||
prop: 'runAsPlan',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.runAsPlan, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
switch (row.runAsPlan) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '皮肤编号',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.skinCode, this.$ConstSelect.skinCode, ['value', 'label']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '仿真类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.type, this.$ConstSelect.SimulationType, ['value', 'label']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '仿真成员ID',
|
||||
prop: 'sessionList',
|
||||
type: 'basicText',
|
||||
columnValue: (row) => { return this.listJoiningTogether(row.sessionList); }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
// width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '销毁',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$Dictionary.productType().then(list => {
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.prdType.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
listJoiningTogether(sessionList) {
|
||||
let sessionId = '';
|
||||
if (sessionList.length>0) {
|
||||
sessionList.forEach((item) => {
|
||||
sessionId = sessionId+item+',';
|
||||
});
|
||||
sessionId = sessionId.substring(0, sessionId.length-1);
|
||||
}
|
||||
return sessionId;
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除此用户仿真数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteExistingSimulation(row.group).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
});
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -1,146 +1,129 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<dictionary-edit ref="edit" @reloadTable="reloadTable"></dictionary-edit>
|
||||
<correlation-map ref="correlationMap"></correlation-map>
|
||||
</div>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<dictionary-edit ref="edit" @reloadTable="reloadTable" />
|
||||
<correlation-map ref="correlationMap" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserList } from '@/api/management/user';
|
||||
import localStore from 'storejs';
|
||||
import DictionaryEdit from './edit'
|
||||
import CorrelationMap from './correlationMap';
|
||||
import { getUserList } from '@/api/management/user';
|
||||
import DictionaryEdit from './edit';
|
||||
import CorrelationMap from './correlationMap';
|
||||
|
||||
export default {
|
||||
name: 'UserControl',
|
||||
components: {
|
||||
DictionaryEdit,
|
||||
CorrelationMap
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名称'
|
||||
},
|
||||
roles: {
|
||||
type: 'select',
|
||||
label: '角色',
|
||||
config: {
|
||||
data: this.$ConstSelect.roleList
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'UserControl',
|
||||
components: {
|
||||
DictionaryEdit,
|
||||
CorrelationMap
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: '名称'
|
||||
},
|
||||
roles: {
|
||||
type: 'select',
|
||||
label: '角色',
|
||||
config: {
|
||||
data: this.$ConstSelect.roleList
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: getUserList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '昵称',
|
||||
prop: 'nickname'
|
||||
},
|
||||
{
|
||||
title: '电话',
|
||||
prop: 'mobile'
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
prop: 'email'
|
||||
},
|
||||
{
|
||||
title: '角色',
|
||||
prop: 'roles',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleUserEdit,
|
||||
},
|
||||
{
|
||||
name: '订阅地图',
|
||||
handleClick: this.handleMapCorrelation,
|
||||
type: 'danger',
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
let arr = [];
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
enumList.forEach((element, i) => {
|
||||
fieldValue.forEach((v, j) => {
|
||||
if ('' + fieldValue[j] === '' + enumList[i][value]) {
|
||||
arr.push(enumList[i][label])
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
// 编辑
|
||||
handleUserEdit(index, row) {
|
||||
this.$refs.edit.doShow(row)
|
||||
},
|
||||
},
|
||||
queryList: {
|
||||
query: getUserList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '昵称',
|
||||
prop: 'nickname'
|
||||
},
|
||||
{
|
||||
title: '电话',
|
||||
prop: 'mobile'
|
||||
},
|
||||
{
|
||||
title: '邮箱',
|
||||
prop: 'email'
|
||||
},
|
||||
{
|
||||
title: '角色',
|
||||
prop: 'roles',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleUserEdit
|
||||
},
|
||||
{
|
||||
name: '订阅地图',
|
||||
handleClick: this.handleMapCorrelation,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 编辑
|
||||
handleUserEdit(index, row) {
|
||||
this.$refs.edit.doShow(row);
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleUserDelete(index, row) {
|
||||
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// delPublishMap(row.id).then(response => {
|
||||
// this.$message.success('删除成功')
|
||||
// this.reloadTable()
|
||||
// localStore.remove('mapId')
|
||||
// }).catch(error => {
|
||||
// this.reloadTable()
|
||||
// this.$messageBox('删除失败')
|
||||
// })
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
handleUserDelete(index, row) {
|
||||
this.$confirm('此操作将删除该类型, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// delPublishMap(row.id).then(response => {
|
||||
// this.$message.success('删除成功')
|
||||
// this.reloadTable()
|
||||
// localStore.remove('mapId')
|
||||
// }).catch(error => {
|
||||
// this.reloadTable()
|
||||
// this.$messageBox('删除失败')
|
||||
// })
|
||||
});
|
||||
},
|
||||
|
||||
//关联地图
|
||||
handleMapCorrelation(index, row) {
|
||||
this.$refs.correlationMap.doShow(row);
|
||||
},
|
||||
// 关联地图
|
||||
handleMapCorrelation(index, row) {
|
||||
this.$refs.correlationMap.doShow(row);
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -57,7 +57,7 @@
|
||||
title: '考试结果',
|
||||
prop: 'result',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.result, this.$ConstSelect.examResultList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.result, this.$ConstSelect.examResultList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.result) {
|
||||
case '01': return 'warning';
|
||||
@ -108,17 +108,6 @@
|
||||
loadInitData() {
|
||||
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 编辑
|
||||
edit(index, row) {
|
||||
|
@ -129,17 +129,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 编辑
|
||||
edit(index, row) {
|
||||
|
@ -1,186 +1,184 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<add-training ref="addTraining" @selectTrain="selectTrain"></add-training>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<add-training ref="addTraining" @selectTrain="selectTrain" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicDetailCodeExist, getData } from '@/api/management/dictionaryDetail'
|
||||
import { addUserTraining } from '@/api/jmap/training';
|
||||
import { validateCharCode } from '@/utils/validate';
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import { getDimUserList } from '@/api/management/user';
|
||||
import AddTraining from './addTraining';
|
||||
import { addUserTraining } from '@/api/jmap/training';
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import { getDimUserList } from '@/api/management/user';
|
||||
import AddTraining from './addTraining';
|
||||
|
||||
export default {
|
||||
name: 'UsersTrainingAdd',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
components: {
|
||||
AddTraining,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
lessonId: '',
|
||||
trainingId: '',
|
||||
trainingName: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
duration: '',
|
||||
},
|
||||
LessonList: [],
|
||||
UserList: [],
|
||||
UserLoading: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'lessonId', label: '课程名称', type: 'select', required: true, options: this.LessonList, },
|
||||
{ prop: 'trainingName', label: '实训名称', type: 'text', required: true, rightWidth: true, disabled: true, buttontip: '选择实训', buttonClick: this.buttonClick, placeholder: '请选择实训' },
|
||||
{ prop: 'userName', label: '用户名称', type: 'complete', required: false, placeholder: '', querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
|
||||
{ prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' },
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
lessonId: [
|
||||
{ required: true, message: '请输入教学名称', trigger: 'change' },
|
||||
],
|
||||
trainingName: [
|
||||
{ required: true, message: '请选择实训', trigger: 'change' },
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: '请输入用户名称', trigger: 'change' },
|
||||
],
|
||||
duration: [
|
||||
{ required: true, message: '请输入时长', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
return crules
|
||||
},
|
||||
title() {
|
||||
return '创建用户实训'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initLoadPage();
|
||||
},
|
||||
methods: {
|
||||
initLoadPage() {
|
||||
//加载发布课程列表
|
||||
this.LessonList.length = 0;
|
||||
this.UserList.length = 0;
|
||||
getPublishLessonList().then(response => {
|
||||
let data = response.data;
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
this.LessonList.push({ value: elem.id, label: elem.name });
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
// 搜索查询input
|
||||
async querySearchAsync(queryString, cb) {
|
||||
// 根据queryString 查询用户 并显示
|
||||
let results = [];
|
||||
if (queryString) {
|
||||
try {
|
||||
let params = {
|
||||
fuzzyParam: queryString,
|
||||
};
|
||||
let res = await getDimUserList(params);
|
||||
let list = res.data;
|
||||
list.forEach(item => {
|
||||
let value = {
|
||||
id: item.id,
|
||||
value: `${item.nickname}(${item.name})${item.mobile}`
|
||||
}
|
||||
results.push(value);
|
||||
})
|
||||
cb(results);
|
||||
} catch (error) {
|
||||
console.error(error, '查询用户list');
|
||||
cb(results);
|
||||
}
|
||||
} else {
|
||||
cb(results);
|
||||
}
|
||||
},
|
||||
prdSelect(item) {
|
||||
this.formModel.userId = item.id;
|
||||
},
|
||||
selectTrain(data) {
|
||||
this.formModel.trainingId = data.id;
|
||||
this.formModel.trainingName = data.name;
|
||||
},
|
||||
buttonClick() {
|
||||
if (this.formModel.lessonId) {
|
||||
this.$refs.addTraining.show(this.formModel.lessonId);
|
||||
} else {
|
||||
this.$message.error('请先选择课程名称')
|
||||
}
|
||||
},
|
||||
show(data) {
|
||||
this.dialogVisible = true
|
||||
// this.formModel = {
|
||||
// lessonId: '',
|
||||
// trainingId: '',
|
||||
// trainingName: '',
|
||||
// userId: '',
|
||||
// userName: '',
|
||||
// duration: '',
|
||||
// };
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.save()
|
||||
})
|
||||
},
|
||||
save() {
|
||||
let self = this
|
||||
if (this.formModel.userId) {
|
||||
addUserTraining(this.formModel).then(response => {
|
||||
self.$message.success('创建成功!')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
}).catch(error => {
|
||||
self.$message.error('创建失败!' + error.message)
|
||||
})
|
||||
} else {
|
||||
self.$message.error('请选择用户')
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
lessonId: '',
|
||||
trainingId: '',
|
||||
trainingName: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
duration: '',
|
||||
}
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
export default {
|
||||
name: 'UsersTrainingAdd',
|
||||
components: {
|
||||
AddTraining
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
lessonId: '',
|
||||
trainingId: '',
|
||||
trainingName: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
duration: ''
|
||||
},
|
||||
LessonList: [],
|
||||
UserList: [],
|
||||
UserLoading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'lessonId', label: '课程名称', type: 'select', required: true, options: this.LessonList },
|
||||
{ prop: 'trainingName', label: '实训名称', type: 'text', required: true, rightWidth: true, disabled: true, buttontip: '选择实训', buttonClick: this.buttonClick, placeholder: '请选择实训' },
|
||||
{ prop: 'userName', label: '用户名称', type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
|
||||
{ prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
lessonId: [
|
||||
{ required: true, message: '请输入教学名称', trigger: 'change' }
|
||||
],
|
||||
trainingName: [
|
||||
{ required: true, message: '请选择实训', trigger: 'change' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: '请输入用户名称', trigger: 'change' }
|
||||
],
|
||||
duration: [
|
||||
{ required: true, message: '请输入时长', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '创建用户实训';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initLoadPage();
|
||||
},
|
||||
methods: {
|
||||
initLoadPage() {
|
||||
// 加载发布课程列表
|
||||
this.LessonList.length = 0;
|
||||
this.UserList.length = 0;
|
||||
getPublishLessonList().then(response => {
|
||||
const data = response.data;
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
this.LessonList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 搜索查询input
|
||||
async querySearchAsync(queryString, cb) {
|
||||
// 根据queryString 查询用户 并显示
|
||||
const results = [];
|
||||
if (queryString) {
|
||||
try {
|
||||
const params = {
|
||||
fuzzyParam: queryString
|
||||
};
|
||||
const res = await getDimUserList(params);
|
||||
const list = res.data;
|
||||
list.forEach(item => {
|
||||
const value = {
|
||||
id: item.id,
|
||||
value: `${item.nickname}(${item.name})${item.mobile}`
|
||||
};
|
||||
results.push(value);
|
||||
});
|
||||
cb(results);
|
||||
} catch (error) {
|
||||
console.error(error, '查询用户list');
|
||||
cb(results);
|
||||
}
|
||||
} else {
|
||||
cb(results);
|
||||
}
|
||||
},
|
||||
prdSelect(item) {
|
||||
this.formModel.userId = item.id;
|
||||
},
|
||||
selectTrain(data) {
|
||||
this.formModel.trainingId = data.id;
|
||||
this.formModel.trainingName = data.name;
|
||||
},
|
||||
buttonClick() {
|
||||
if (this.formModel.lessonId) {
|
||||
this.$refs.addTraining.show(this.formModel.lessonId);
|
||||
} else {
|
||||
this.$message.error('请先选择课程名称');
|
||||
}
|
||||
},
|
||||
show(data) {
|
||||
this.dialogVisible = true;
|
||||
// this.formModel = {
|
||||
// lessonId: '',
|
||||
// trainingId: '',
|
||||
// trainingName: '',
|
||||
// userId: '',
|
||||
// userName: '',
|
||||
// duration: '',
|
||||
// };
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.save();
|
||||
});
|
||||
},
|
||||
save() {
|
||||
const self = this;
|
||||
if (this.formModel.userId) {
|
||||
addUserTraining(this.formModel).then(response => {
|
||||
self.$message.success('创建成功!');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('创建失败!' + error.message);
|
||||
});
|
||||
} else {
|
||||
self.$message.error('请选择用户');
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
lessonId: '',
|
||||
trainingId: '',
|
||||
trainingName: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
duration: ''
|
||||
};
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,92 +1,98 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisibles" width="30%" :before-close="handleClose" center>
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{ height: '280px', width:'100%' }">
|
||||
<el-tree ref="tree" :data="treeData" :props="defaultProps" highlight-current @node-click="clickEvent"
|
||||
:span=22>
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<span class="el-icon-tickets">
|
||||
<span> {{ node.label }}</span>
|
||||
</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave" :disabled="disabled">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisibles" width="30%" :before-close="handleClose" center>
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: '280px', width:'100%' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeData"
|
||||
:props="defaultProps"
|
||||
highlight-current
|
||||
:span="22"
|
||||
@node-click="clickEvent"
|
||||
>
|
||||
<span slot-scope="{ node }" class="custom-tree-node">
|
||||
<span class="el-icon-tickets">
|
||||
<span> {{ node.label }}</span>
|
||||
</span>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" :disabled="disabled" @click="doSave">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishLessonDetail } from '@/api/jmap/lesson';
|
||||
import { getPublishLessonDetail } from '@/api/jmap/lesson';
|
||||
|
||||
export default {
|
||||
name: 'AddTraining',
|
||||
props: {
|
||||
export default {
|
||||
name: 'AddTraining',
|
||||
props: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisibles: false,
|
||||
title: '选择实训',
|
||||
treeData: [{
|
||||
children: [],
|
||||
name: '',
|
||||
}],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
training: {},
|
||||
disabled: true,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisibles: false,
|
||||
title: '选择实训',
|
||||
treeData: [{
|
||||
children: [],
|
||||
name: ''
|
||||
}],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
training: {},
|
||||
disabled: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
clickEvent(data) {
|
||||
if (data.trainingSelect) {
|
||||
this.training = {
|
||||
name: data.name,
|
||||
id: data.id
|
||||
};
|
||||
this.disabled = false;
|
||||
} else {
|
||||
this.disabled = true;
|
||||
}
|
||||
},
|
||||
async show(lessonId) {
|
||||
this.dialogVisibles = true
|
||||
try {
|
||||
let res = await getPublishLessonDetail({ id: lessonId });
|
||||
this.treeData[0].children = res.data.chapters;
|
||||
this.treeData[0].name = res.data.name;
|
||||
this.treeData[0].children.forEach(ele => {
|
||||
ele.children = ele.trainingVos;
|
||||
ele.children.forEach(item => {
|
||||
item.trainingSelect = true;
|
||||
})
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
this.$emit('selectTrain', this.training)
|
||||
this.handleClose();
|
||||
},
|
||||
handleClose() {
|
||||
this.treeData = [{
|
||||
children: [],
|
||||
name: '',
|
||||
}];
|
||||
this.trainingId = '';
|
||||
this.training = {};
|
||||
this.dialogVisibles = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
clickEvent(data) {
|
||||
if (data.trainingSelect) {
|
||||
this.training = {
|
||||
name: data.name,
|
||||
id: data.id
|
||||
};
|
||||
this.disabled = false;
|
||||
} else {
|
||||
this.disabled = true;
|
||||
}
|
||||
},
|
||||
async show(lessonId) {
|
||||
this.dialogVisibles = true;
|
||||
try {
|
||||
const res = await getPublishLessonDetail({ id: lessonId });
|
||||
this.treeData[0].children = res.data.chapters;
|
||||
this.treeData[0].name = res.data.name;
|
||||
this.treeData[0].children.forEach(ele => {
|
||||
ele.children = ele.trainingVos;
|
||||
ele.children.forEach(item => {
|
||||
item.trainingSelect = true;
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
this.$emit('selectTrain', this.training);
|
||||
this.handleClose();
|
||||
},
|
||||
handleClose() {
|
||||
this.treeData = [{
|
||||
children: [],
|
||||
name: ''
|
||||
}];
|
||||
this.trainingId = '';
|
||||
this.training = {};
|
||||
this.dialogVisibles = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,108 +1,106 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicDetailCodeExist, getData } from '@/api/management/dictionaryDetail'
|
||||
import { putUserTraining } from '@/api/jmap/training';
|
||||
import { validateCharCode } from '@/utils/validate'
|
||||
export default {
|
||||
name: 'UsersTrainingEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
id: '',
|
||||
lessonName: '',
|
||||
userName: '',
|
||||
trainingName: '',
|
||||
duration: '',
|
||||
// trainingCount: '',
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'lessonName', label: '教学名称', type: 'text', required: false, disabled: true },
|
||||
{ prop: 'trainingName', label: '实训名称', type: 'text', required: true, disabled: true },
|
||||
{ prop: 'userName', label: '用户名称', type: 'text', required: true, disabled: true },
|
||||
{ prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' },
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
duration: [
|
||||
{ required: true, message: '请输入时长', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
return crules
|
||||
},
|
||||
title() {
|
||||
return '编辑实训详情'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show(data) {
|
||||
this.dialogVisible = true
|
||||
if (data && data.id) {
|
||||
this.formModel = {
|
||||
id: data.id,
|
||||
lessonName: data.lessonName,
|
||||
userName: data.userName,
|
||||
trainingName: data.trainingName,
|
||||
duration: data.duration,
|
||||
// trainingCount: data.trainingCount
|
||||
};
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.update()
|
||||
})
|
||||
},
|
||||
update() {
|
||||
let self = this;
|
||||
let param = {
|
||||
id: this.formModel.id,
|
||||
duration: this.formModel.duration,
|
||||
}
|
||||
putUserTraining(param).then(response => {
|
||||
self.$message.success('修改成功!')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
}).catch(error => {
|
||||
self.$message.error('修改失败!' + error.message)
|
||||
})
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
id: '',
|
||||
lessonName: '',
|
||||
userName: '',
|
||||
trainingName: '',
|
||||
duration: '',
|
||||
}
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
import { putUserTraining } from '@/api/jmap/training';
|
||||
export default {
|
||||
name: 'UsersTrainingEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
id: '',
|
||||
lessonName: '',
|
||||
userName: '',
|
||||
trainingName: '',
|
||||
duration: ''
|
||||
// trainingCount: '',
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'lessonName', label: '教学名称', type: 'text', required: false, disabled: true },
|
||||
{ prop: 'trainingName', label: '实训名称', type: 'text', required: true, disabled: true },
|
||||
{ prop: 'userName', label: '用户名称', type: 'text', required: true, disabled: true },
|
||||
{ prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
duration: [
|
||||
{ required: true, message: '请输入时长', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '编辑实训详情';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show(data) {
|
||||
this.dialogVisible = true;
|
||||
if (data && data.id) {
|
||||
this.formModel = {
|
||||
id: data.id,
|
||||
lessonName: data.lessonName,
|
||||
userName: data.userName,
|
||||
trainingName: data.trainingName,
|
||||
duration: data.duration
|
||||
// trainingCount: data.trainingCount
|
||||
};
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.update();
|
||||
});
|
||||
},
|
||||
update() {
|
||||
const self = this;
|
||||
const param = {
|
||||
id: this.formModel.id,
|
||||
duration: this.formModel.duration
|
||||
};
|
||||
putUserTraining(param).then(response => {
|
||||
self.$message.success('修改成功!');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('修改失败!' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
id: '',
|
||||
lessonName: '',
|
||||
userName: '',
|
||||
trainingName: '',
|
||||
duration: ''
|
||||
};
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,146 +1,144 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<users-training-edit ref="edit" type="EDIT" @reloadTable="reloadTable"></users-training-edit>
|
||||
<users-training-add ref="add" type="ADD" @reloadTable="reloadTable"></users-training-add>
|
||||
</div>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<users-training-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||
<users-training-add ref="add" type="ADD" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTrainingList, deleteUserTraining } from '@/api/jmap/training';
|
||||
import localStore from 'storejs';
|
||||
import UsersTrainingEdit from './edit';
|
||||
import UsersTrainingAdd from './add'
|
||||
export default {
|
||||
name: 'UserTrainingEdit',
|
||||
components: {
|
||||
UsersTrainingEdit,
|
||||
UsersTrainingAdd,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
examResultList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
trainingName: {
|
||||
type: 'text',
|
||||
label: '实训名称'
|
||||
},
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: '用户名'
|
||||
}
|
||||
}
|
||||
import { getTrainingList, deleteUserTraining } from '@/api/jmap/training';
|
||||
import UsersTrainingEdit from './edit';
|
||||
import UsersTrainingAdd from './add';
|
||||
export default {
|
||||
name: 'UserTrainingEdit',
|
||||
components: {
|
||||
UsersTrainingEdit,
|
||||
UsersTrainingAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
examResultList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
trainingName: {
|
||||
type: 'text',
|
||||
label: '实训名称'
|
||||
},
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: '用户名'
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: getTrainingList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '用户名称',
|
||||
prop: 'userName'
|
||||
},
|
||||
{
|
||||
title: '用户手机号',
|
||||
prop: 'userMobile'
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
prop: 'lessonName'
|
||||
},
|
||||
{
|
||||
title: '实训用时',
|
||||
prop: 'duration',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.computation(row.duration) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
title: '实训名称',
|
||||
prop: 'trainingName'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.edit,
|
||||
showControl: (row) => { return row.fake != '0' }
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger',
|
||||
showControl: (row) => { return row.fake != '0' }
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', handler: this.createTraining }
|
||||
],
|
||||
},
|
||||
currentModel: {}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
},
|
||||
queryList: {
|
||||
query: getTrainingList,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '用户名称',
|
||||
prop: 'userName'
|
||||
},
|
||||
{
|
||||
title: '用户手机号',
|
||||
prop: 'userMobile'
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
prop: 'lessonName'
|
||||
},
|
||||
{
|
||||
title: '实训用时',
|
||||
prop: 'duration',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.computation(row.duration); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '实训名称',
|
||||
prop: 'trainingName'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.edit,
|
||||
showControl: (row) => { return row.fake != '0'; }
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger',
|
||||
showControl: (row) => { return row.fake != '0'; }
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', handler: this.createTraining }
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
|
||||
},
|
||||
createTraining() {
|
||||
this.$refs.add.show()
|
||||
},
|
||||
computation(fieldValue) {
|
||||
if (fieldValue) {
|
||||
let f = parseInt(fieldValue / 60);
|
||||
let s = fieldValue % 60;
|
||||
if (f > 0) {
|
||||
return `${f}分${s}秒`;
|
||||
} else {
|
||||
return `${s}秒`;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
createTraining() {
|
||||
this.$refs.add.show();
|
||||
},
|
||||
computation(fieldValue) {
|
||||
if (fieldValue) {
|
||||
const f = parseInt(fieldValue / 60);
|
||||
const s = fieldValue % 60;
|
||||
if (f > 0) {
|
||||
return `${f}分${s}秒`;
|
||||
} else {
|
||||
return `${s}秒`;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 编辑
|
||||
edit(index, row) {
|
||||
this.$refs.edit.show(row)
|
||||
},
|
||||
// 编辑
|
||||
edit(index, row) {
|
||||
this.$refs.edit.show(row);
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除此考试结果, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteUserTraining(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除此考试结果, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteUserTraining(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -52,7 +52,7 @@
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) },
|
||||
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
@ -114,19 +114,6 @@
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
},
|
||||
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 添加
|
||||
handleAdd() {
|
||||
this.$router.push({ path: `${UrlConfig.map.productDraft}/add/0` });
|
||||
|
@ -152,16 +152,6 @@
|
||||
resizeHandler: function () {
|
||||
this.height = this._clientHeight - 130;
|
||||
},
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
initLoadPage() {
|
||||
//加载发布课程列表
|
||||
this.display = 1;
|
||||
|
@ -115,17 +115,6 @@
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleAdd() {
|
||||
this.$router.push(`${UrlConfig.map.skinStyleDraft}/add/null`);
|
||||
},
|
||||
|
@ -1,97 +1,91 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<div v-if="orderType">
|
||||
<data-form ref="dataform" :form="formOrder" :formModel="formOrderModel"></data-form>
|
||||
</div>
|
||||
<div v-else>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel"></data-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleClose">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<div v-if="orderType">
|
||||
<data-form ref="dataform" :form="formOrder" :form-model="formOrderModel" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" />
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleClose">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicDetailCodeExist, getData } from '@/api/management/dictionaryDetail'
|
||||
import { postSimulationStats } from '@/api/jmap/training';
|
||||
import { validateCharCode } from '@/utils/validate';
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import { getUserList } from '@/api/management/user';
|
||||
|
||||
export default {
|
||||
name: 'authorDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
source: '',
|
||||
userMobile: '',
|
||||
userName: '',
|
||||
},
|
||||
formOrderModel: {
|
||||
source: '',
|
||||
order: '',
|
||||
},
|
||||
PermissionTypeList: [],
|
||||
orderType: '',
|
||||
order: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'source', label: '来源', type: 'text', disabled: true, },
|
||||
{ prop: 'name', label: '分发用户', type: 'text', disabled: true, },
|
||||
{ prop: 'mobile', label: '用户手机号', type: 'text', disabled: true, },
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
formOrder() {
|
||||
let form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'source', label: '来源', type: 'text', disabled: true, },
|
||||
{ prop: 'order', label: '订单号', type: 'text', disabled: true, },
|
||||
]
|
||||
}
|
||||
return form
|
||||
},
|
||||
title() {
|
||||
return '来源信息'
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
show(data) {
|
||||
this.dialogVisible = true;
|
||||
if (typeof data == 'object') {
|
||||
this.orderType = false;
|
||||
this.formModel = {
|
||||
source: '权限分发',
|
||||
mobile: data.mobile,
|
||||
name: data.name,
|
||||
};
|
||||
} else {
|
||||
this.orderType = true;
|
||||
this.formOrderModel = {
|
||||
source: '订单创建',
|
||||
order: data,
|
||||
};
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
source: '',
|
||||
userMobile: '',
|
||||
userName: '',
|
||||
}
|
||||
this.dialogVisible = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
export default {
|
||||
name: 'AuthorDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
source: '',
|
||||
userMobile: '',
|
||||
userName: ''
|
||||
},
|
||||
formOrderModel: {
|
||||
source: '',
|
||||
order: ''
|
||||
},
|
||||
PermissionTypeList: [],
|
||||
orderType: '',
|
||||
order: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'source', label: '来源', type: 'text', disabled: true },
|
||||
{ prop: 'name', label: '分发用户', type: 'text', disabled: true },
|
||||
{ prop: 'mobile', label: '用户手机号', type: 'text', disabled: true }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
formOrder() {
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'source', label: '来源', type: 'text', disabled: true },
|
||||
{ prop: 'order', label: '订单号', type: 'text', disabled: true }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
title() {
|
||||
return '来源信息';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
show(data) {
|
||||
this.dialogVisible = true;
|
||||
if (typeof data == 'object') {
|
||||
this.orderType = false;
|
||||
this.formModel = {
|
||||
source: '权限分发',
|
||||
mobile: data.mobile,
|
||||
name: data.name
|
||||
};
|
||||
} else {
|
||||
this.orderType = true;
|
||||
this.formOrderModel = {
|
||||
source: '订单创建',
|
||||
order: data
|
||||
};
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
source: '',
|
||||
userMobile: '',
|
||||
userName: ''
|
||||
};
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -1,192 +1,191 @@
|
||||
<template>
|
||||
<div class="card-box">
|
||||
<el-steps class="steps" :active="display">
|
||||
<el-step :title="title" icon="el-icon-edit-outline"></el-step>
|
||||
<el-step title="" icon="el-icon-upload"></el-step>
|
||||
</el-steps>
|
||||
<el-card class="forms">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" :style="{height:height -120 + 'px'}" style="padding-top: 40px">
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="create">创建</el-button>
|
||||
<el-button type="primary" @click="turnback">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<div class="card-box">
|
||||
<el-steps class="steps" :active="display">
|
||||
<el-step :title="title" icon="el-icon-edit-outline" />
|
||||
<el-step title="" icon="el-icon-upload" />
|
||||
</el-steps>
|
||||
<el-card class="forms">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height:height -120 + 'px'}" style="padding-top: 40px">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
</el-scrollbar>
|
||||
</el-card>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="create">创建</el-button>
|
||||
<el-button type="primary" @click="turnback">返回</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import { getUserInfoByNameOrMobile } from '@/api/management/user';
|
||||
import { createLessonPermisson } from '@/api/management/author';
|
||||
import { validateCharCode } from '@/utils/validate';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import { getPublishLessonList } from '@/api/jmap/lesson';
|
||||
import { getUserInfoByNameOrMobile } from '@/api/management/user';
|
||||
import { createLessonPermisson } from '@/api/management/author';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
|
||||
export default {
|
||||
name: 'DictionaryDetailEdit',
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
title: '添加用户权限',
|
||||
height: '',
|
||||
display: 1,
|
||||
LessonList: [],
|
||||
UserList: [],
|
||||
PermissionTypeList: [],
|
||||
UserLoading: false,
|
||||
formModel: {
|
||||
userId: '',
|
||||
type: '01',
|
||||
forever: true,
|
||||
lessonId: '',
|
||||
total: 0,
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let form = {
|
||||
labelWidth: '140px',
|
||||
items: [
|
||||
{ prop: 'userId', label: '用户名称', type: 'select', required: false, options: this.UserList, remote: this.userRemote, loading: this.UserLoading },
|
||||
{ prop: 'lessonId', label: '课程名称', type: 'select', required: false, options: this.LessonList },
|
||||
{ prop: 'type', label: '权限类型', type: 'select', required: false, options: this.PermissionTypeList },
|
||||
{ prop: 'forever', label: '是否永久', type: 'radio', required: false, disabled: true, options: this.$ConstSelect.Whether },
|
||||
{ prop: 'total', label: '权限个数', type: 'number', required: false }
|
||||
]
|
||||
export default {
|
||||
name: 'DictionaryDetailEdit',
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
title: '添加用户权限',
|
||||
height: '',
|
||||
display: 1,
|
||||
LessonList: [],
|
||||
UserList: [],
|
||||
PermissionTypeList: [],
|
||||
UserLoading: false,
|
||||
formModel: {
|
||||
userId: '',
|
||||
type: '01',
|
||||
forever: true,
|
||||
lessonId: '',
|
||||
total: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '140px',
|
||||
items: [
|
||||
{ prop: 'userId', label: '用户名称', type: 'select', required: false, options: this.UserList, remote: this.userRemote, loading: this.UserLoading },
|
||||
{ prop: 'lessonId', label: '课程名称', type: 'select', required: false, options: this.LessonList },
|
||||
{ prop: 'type', label: '权限类型', type: 'select', required: false, options: this.PermissionTypeList },
|
||||
{ prop: 'forever', label: '是否永久', type: 'radio', required: false, disabled: true, options: this.$ConstSelect.Whether },
|
||||
{ prop: 'total', label: '权限个数', type: 'number', required: false }
|
||||
]
|
||||
|
||||
}
|
||||
return form
|
||||
},
|
||||
};
|
||||
return form;
|
||||
},
|
||||
|
||||
rules() {
|
||||
let baseRules = {
|
||||
userId: [
|
||||
{ required: true, message: '请输入用户名称', trigger: 'blur' }
|
||||
],
|
||||
lessonId: [
|
||||
{ required: true, message: '请选择课程', trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择权限类型', trigger: 'change' }
|
||||
],
|
||||
forever: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
],
|
||||
total: [
|
||||
{ required: true, message: '请输入购买的权限个数', trigger: 'change' },
|
||||
{
|
||||
validator(rule, value, callback) {
|
||||
if (Number.isInteger(Number(value)) && Number(value) >= 0) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入有效权限个数"));
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
}
|
||||
]
|
||||
}
|
||||
rules() {
|
||||
const baseRules = {
|
||||
userId: [
|
||||
{ required: true, message: '请输入用户名称', trigger: 'blur' }
|
||||
],
|
||||
lessonId: [
|
||||
{ required: true, message: '请选择课程', trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '请选择权限类型', trigger: 'change' }
|
||||
],
|
||||
forever: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
],
|
||||
total: [
|
||||
{ required: true, message: '请输入购买的权限个数', trigger: 'change' },
|
||||
{
|
||||
validator(rule, value, callback) {
|
||||
if (Number.isInteger(Number(value)) && Number(value) >= 0) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error('请输入有效权限个数'));
|
||||
}
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
//清空表单验证提示信息
|
||||
this.$nextTick(function () {
|
||||
this.$refs.dataform.clearValidate();
|
||||
});
|
||||
// 清空表单验证提示信息
|
||||
this.$nextTick(function () {
|
||||
this.$refs.dataform.clearValidate();
|
||||
});
|
||||
|
||||
return baseRules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initLoadPage();
|
||||
},
|
||||
methods: {
|
||||
resizeHandler: function () {
|
||||
this.height = this._clientHeight - 130;
|
||||
},
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
initLoadPage() {
|
||||
//加载发布课程列表
|
||||
this.display = 1;
|
||||
this.LessonList.length = 0;
|
||||
getPublishLessonList().then(response => {
|
||||
let data = response.data;
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
this.LessonList.push({ value: elem.id, label: elem.name });
|
||||
})
|
||||
}
|
||||
});
|
||||
return baseRules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initLoadPage();
|
||||
},
|
||||
methods: {
|
||||
resizeHandler: function () {
|
||||
this.height = this._clientHeight - 130;
|
||||
},
|
||||
convertList(FromList, ToList, checktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (checktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
initLoadPage() {
|
||||
// 加载发布课程列表
|
||||
this.display = 1;
|
||||
this.LessonList.length = 0;
|
||||
getPublishLessonList().then(response => {
|
||||
const data = response.data;
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
this.LessonList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//转换权限类型
|
||||
this.$Dictionary.permissionType().then(list => {
|
||||
this.convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
// 转换权限类型
|
||||
this.$Dictionary.permissionType().then(list => {
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
//清空表单验证提示信息
|
||||
this.$nextTick(function () {
|
||||
this.$refs.dataform.resetForm();
|
||||
});
|
||||
},
|
||||
userRemote(query) {
|
||||
if (query !== '') {
|
||||
this.loading = true;
|
||||
this.UserList.length = 0;
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
getUserInfoByNameOrMobile({ query: query }).then(response => {
|
||||
response.data.forEach(item => {
|
||||
this.UserList.push({ value: item.id, label: item.name });
|
||||
})
|
||||
}).catch(error => {
|
||||
this.$messageBox('远程查询错误');
|
||||
});
|
||||
}, 200);
|
||||
} else {
|
||||
this.UserList.length = 0;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
let model = {
|
||||
userId: this.formModel.userId,
|
||||
lessonId: this.formModel.lessonId,
|
||||
type: this.formModel.type,
|
||||
forever: this.formModel.forever,
|
||||
total: this.formModel.total,
|
||||
}
|
||||
return model;
|
||||
},
|
||||
create() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
createLessonPermisson(this.buildModel()).then(response => {
|
||||
this.display = 2;
|
||||
this.turnback();
|
||||
this.$message.success('创建成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox("创建失败");
|
||||
});
|
||||
});
|
||||
},
|
||||
turnback() {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
}
|
||||
}
|
||||
// 清空表单验证提示信息
|
||||
this.$nextTick(function () {
|
||||
this.$refs.dataform.resetForm();
|
||||
});
|
||||
},
|
||||
userRemote(query) {
|
||||
if (query !== '') {
|
||||
this.loading = true;
|
||||
this.UserList.length = 0;
|
||||
setTimeout(() => {
|
||||
this.loading = false;
|
||||
getUserInfoByNameOrMobile({ query: query }).then(response => {
|
||||
response.data.forEach(item => {
|
||||
this.UserList.push({ value: item.id, label: item.name });
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox('远程查询错误');
|
||||
});
|
||||
}, 200);
|
||||
} else {
|
||||
this.UserList.length = 0;
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
const model = {
|
||||
userId: this.formModel.userId,
|
||||
lessonId: this.formModel.lessonId,
|
||||
type: this.formModel.type,
|
||||
forever: this.formModel.forever,
|
||||
total: this.formModel.total
|
||||
};
|
||||
return model;
|
||||
},
|
||||
create() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
createLessonPermisson(this.buildModel()).then(response => {
|
||||
this.display = 2;
|
||||
this.turnback();
|
||||
this.$message.success('创建成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('创建失败');
|
||||
});
|
||||
});
|
||||
},
|
||||
turnback() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@ -231,4 +230,4 @@
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -76,7 +76,7 @@
|
||||
title: '权限类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.type, this.PermissionTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
@ -128,7 +128,7 @@
|
||||
title: '课程权限状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
@ -183,30 +183,9 @@
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loadInitData() {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.convertList(list, this.EffectiveTypeList, elem => {
|
||||
this.$convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@ -214,7 +193,7 @@
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.convertList(list, this.PermissionTypeList, elem => {
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
@ -190,16 +190,6 @@
|
||||
resizeHandler: function () {
|
||||
this.height = this._clientHeight - 170;
|
||||
},
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async initLoadPage() {
|
||||
// 加载字典数据
|
||||
// 加载地图,产品,课程
|
||||
@ -218,7 +208,7 @@
|
||||
}
|
||||
// 产品类型
|
||||
this.$Dictionary.productType().then(list => {
|
||||
this.convertList(list, this.productTypeList, elem => {
|
||||
this.$convertList(list, this.productTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@ -226,7 +216,7 @@
|
||||
// 时间类型
|
||||
this.TimeStyleDict = {};
|
||||
this.$Dictionary.timeStyleType().then(list => {
|
||||
this.convertList(list, this.TimeStyleList, elem => {
|
||||
this.$convertList(list, this.TimeStyleList, elem => {
|
||||
return true;
|
||||
});
|
||||
list.forEach(elem => {
|
||||
|
@ -64,7 +64,7 @@
|
||||
title: '产品类型',
|
||||
prop: 'productType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.productType, this.productTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
@ -87,7 +87,7 @@
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
@ -149,19 +149,9 @@
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async loadInitData() {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.convertList(list, this.EffectiveTypeList, elem => {
|
||||
this.$convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@ -170,7 +160,7 @@
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.productType.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.convertList(list, this.productTypeList, elem => {
|
||||
this.$convertList(list, this.productTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@ -184,17 +174,6 @@
|
||||
console.error(error, '获取发布地图');
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
this.$router.push({ path: `${UrlConfig.orderauthor.commodityDraft}/edit/${row.id}` });
|
||||
},
|
||||
|
@ -78,7 +78,7 @@
|
||||
title: '产品类型',
|
||||
prop: 'productType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.productType, this.productTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
@ -101,7 +101,7 @@
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
@ -148,19 +148,9 @@
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
async loadInitData() {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.convertList(list, this.EffectiveTypeList, elem => {
|
||||
this.$convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@ -169,7 +159,7 @@
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.productType.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.convertList(list, this.productTypeList, elem => {
|
||||
this.$convertList(list, this.productTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@ -184,19 +174,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
handleAdd(index, row) {
|
||||
this.$emit('selectGoods', row);
|
||||
this.doClose();
|
||||
|
@ -280,16 +280,6 @@
|
||||
resizeHandler: function () {
|
||||
this.height = this._clientHeight - 170;
|
||||
},
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
buttonClick() {
|
||||
this.$refs.addGoods.doShow();
|
||||
},
|
||||
@ -328,31 +318,31 @@
|
||||
})
|
||||
|
||||
this.$Dictionary.permissionType().then(list => {
|
||||
this.convertList(list, this.PermissionTypeList, elem => {
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
this.$Dictionary.orderType().then(list => {
|
||||
this.convertList(list, this.OrderTypeList, elem => {
|
||||
this.$convertList(list, this.OrderTypeList, elem => {
|
||||
return elem.code !== '01' //过滤个人
|
||||
});
|
||||
});
|
||||
|
||||
this.$Dictionary.payStatus().then(list => {
|
||||
this.convertList(list, this.PayStatusTypeList, elem => {
|
||||
this.$convertList(list, this.PayStatusTypeList, elem => {
|
||||
return elem.code !== '03' //过滤取消状态
|
||||
});
|
||||
});
|
||||
|
||||
this.$Dictionary.payType().then(list => {
|
||||
this.convertList(list, this.PayTypeList, elem => {
|
||||
this.$convertList(list, this.PayTypeList, elem => {
|
||||
return true
|
||||
});
|
||||
});
|
||||
|
||||
this.$Dictionary.bizType().then(list => {
|
||||
this.convertList(list, this.BizTypeList, elem => {
|
||||
this.$convertList(list, this.BizTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
@ -86,7 +86,7 @@
|
||||
title: '权限类型',
|
||||
prop: 'permissionType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
@ -120,7 +120,7 @@
|
||||
title: '支付方式',
|
||||
prop: 'payWays',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.payWays, this.PayTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.payWays, this.PayTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
@ -131,7 +131,7 @@
|
||||
title: '订单类型',
|
||||
prop: 'orderType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.orderType, this.OrderTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.orderType, this.OrderTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
@ -142,14 +142,14 @@
|
||||
title: '业务类型',
|
||||
prop: 'bizType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.bizType, this.BizTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.bizType, this.BizTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
prop: 'payStatus',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.payStatus, this.PayStatusList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.payStatus, this.PayStatusList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.payStatus) {
|
||||
case '01': return 'danger';
|
||||
@ -199,27 +199,6 @@
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loadInitData() {
|
||||
this.queryForm.queryObject.organizationId.config.data.length = 0;
|
||||
getOrganizationList().then(response => {
|
||||
@ -234,32 +213,32 @@
|
||||
})
|
||||
|
||||
this.$Dictionary.bizType().then(list => {
|
||||
this.convertList(list, this.BizTypeList, elem => {
|
||||
this.$convertList(list, this.BizTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
this.$Dictionary.orderType().then(list => {
|
||||
this.convertList(list, this.OrderTypeList, elem => {
|
||||
this.$convertList(list, this.OrderTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
})
|
||||
|
||||
this.$Dictionary.payType().then(list => {
|
||||
this.convertList(list, this.PayTypeList, elem => {
|
||||
this.$convertList(list, this.PayTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
})
|
||||
|
||||
this.$Dictionary.payStatus().then(list => {
|
||||
this.convertList(list, this.PayStatusList, elem => {
|
||||
this.$convertList(list, this.PayStatusList, elem => {
|
||||
return true;
|
||||
});
|
||||
})
|
||||
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.convertList(list, this.EffectiveTypeList, elem => {
|
||||
this.$convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
})
|
||||
@ -268,7 +247,7 @@
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.convertList(list, this.PermissionTypeList, elem => {
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
})
|
||||
|
@ -74,7 +74,7 @@
|
||||
title: '权限类型',
|
||||
prop: 'permissionType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
@ -118,7 +118,7 @@
|
||||
title: '课程权限状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
@ -134,30 +134,9 @@
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loadInitData() {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.convertList(list, this.EffectiveTypeList, elem => {
|
||||
this.$convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@ -165,7 +144,7 @@
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.convertList(list, this.PermissionTypeList, elem => {
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
@ -84,7 +84,7 @@
|
||||
title: '权限类型',
|
||||
prop: 'permissionType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
@ -171,17 +171,6 @@
|
||||
this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList;
|
||||
},
|
||||
methods: {
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
formatterDate(row, porpInfo) {
|
||||
return String(row[porpInfo.property] || '').split(' ')[0];
|
||||
},
|
||||
|
@ -87,7 +87,7 @@
|
||||
title: '权限类型',
|
||||
prop: 'permissionType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
@ -131,7 +131,7 @@
|
||||
title: '权限状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
@ -183,33 +183,12 @@
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loadInitData() {
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name });
|
||||
})
|
||||
this.convertList(list, this.EffectiveTypeList, elem => {
|
||||
this.$convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
@ -217,7 +196,7 @@
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.convertList(list, this.PermissionTypeList, elem => {
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
this.PermissionTypeList.push({ value: undefined, label: '权限包' });
|
||||
|
@ -1,232 +1,220 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<select-role ref="selectRole" @reloadTable="reloadTable"></select-role>
|
||||
</div>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList"/>
|
||||
<select-role ref="selectRole" @reloadTable="reloadTable"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUserPermision } from '@/api/management/author';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { superAdmin } from '@/router';
|
||||
import selectRole from './selectRole/list';
|
||||
import { listUserPermision } from '@/api/management/author';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { superAdmin } from '@/router';
|
||||
import selectRole from './selectRole/list';
|
||||
|
||||
export default {
|
||||
name: 'author',
|
||||
components: {
|
||||
selectRole,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
param: '',
|
||||
WhetherTypeList: [],
|
||||
EffectiveTypeList: [],
|
||||
PermissionTypeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
'type': {
|
||||
type: 'select',
|
||||
label: '权限类型',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'status': {
|
||||
type: 'select',
|
||||
label: '权限状态',
|
||||
value: '1',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'canDistribute': {
|
||||
type: 'select',
|
||||
label: '公用/专用',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '权限类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.type, this.PermissionTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return '' }
|
||||
},
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName',
|
||||
},
|
||||
{
|
||||
title: '地图产品名称',
|
||||
prop: 'mapProductName',
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
prop: 'lessonName',
|
||||
},
|
||||
{
|
||||
title: '公用/专用',
|
||||
prop: 'canDistribute',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList') },
|
||||
tagType: (row) => {
|
||||
switch (row.canDistribute) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '是否永久',
|
||||
prop: 'forever',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether') },
|
||||
tagType: (row) => {
|
||||
switch (row.forever) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '权限总数',
|
||||
prop: 'amount'
|
||||
},
|
||||
{
|
||||
title: '剩余权限数量',
|
||||
prop: 'remains'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
prop: 'startTime',
|
||||
type: 'formatter',
|
||||
formatter: this.formatterDate
|
||||
export default {
|
||||
name: 'Author',
|
||||
components: {
|
||||
selectRole
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
param: '',
|
||||
WhetherTypeList: [],
|
||||
EffectiveTypeList: [],
|
||||
PermissionTypeList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
'type': {
|
||||
type: 'select',
|
||||
label: '权限类型',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'status': {
|
||||
type: 'select',
|
||||
label: '权限状态',
|
||||
value: '1',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'canDistribute': {
|
||||
type: 'select',
|
||||
label: '公用/专用',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '权限类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName'
|
||||
},
|
||||
{
|
||||
title: '地图产品名称',
|
||||
prop: 'mapProductName'
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
prop: 'lessonName'
|
||||
},
|
||||
{
|
||||
title: '公用/专用',
|
||||
prop: 'canDistribute',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
|
||||
tagType: (row) => {
|
||||
switch (row.canDistribute) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '是否永久',
|
||||
prop: 'forever',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
switch (row.forever) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '权限总数',
|
||||
prop: 'amount'
|
||||
},
|
||||
{
|
||||
title: '剩余权限数量',
|
||||
prop: 'remains'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
prop: 'startTime',
|
||||
type: 'formatter',
|
||||
formatter: this.formatterDate
|
||||
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
prop: 'endTime',
|
||||
type: 'formatter',
|
||||
formatter: this.formatterDate
|
||||
},
|
||||
{
|
||||
title: '权限归属人',
|
||||
prop: 'ownerName',
|
||||
isShow: () => { return this.$store.state.user.roles.indexOf(superAdmin) != -1; },
|
||||
},
|
||||
{
|
||||
title: '权限状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
default: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '200',
|
||||
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
||||
buttons: [
|
||||
{
|
||||
name: '设置归属人',
|
||||
handleClick: this.handleRoleVest,
|
||||
type: '',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '打包权限', btnCode: 'employee_insert', handler: this.handlePermissionPack },
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
prop: 'endTime',
|
||||
type: 'formatter',
|
||||
formatter: this.formatterDate
|
||||
},
|
||||
{
|
||||
title: '权限归属人',
|
||||
prop: 'ownerName',
|
||||
isShow: () => { return this.$store.state.user.roles.indexOf(superAdmin) != -1; }
|
||||
},
|
||||
{
|
||||
title: '权限状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
default: return 'danger';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
width: '200',
|
||||
hide: () => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
|
||||
buttons: [
|
||||
{
|
||||
name: '设置归属人',
|
||||
handleClick: this.handleRoleVest,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '打包权限', btnCode: 'employee_insert', handler: this.handlePermissionPack }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleRoleVest(index, row) {
|
||||
this.$refs.selectRole.doShow(row.id);
|
||||
},
|
||||
loadInitData() {
|
||||
this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList;
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(elem)) {
|
||||
ToList.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
handleRoleVest(index, row) {
|
||||
this.$refs.selectRole.doShow(row.id);
|
||||
},
|
||||
loadInitData() {
|
||||
this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList;
|
||||
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.$convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
this.$Dictionary.permissionType().then(list => {
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
},
|
||||
formatterDate(row, porpInfo) {
|
||||
if (row.hasOwnProperty(porpInfo.property)) {
|
||||
}
|
||||
return row[porpInfo.property];
|
||||
},
|
||||
queryFunction(params) {
|
||||
return listUserPermision(params);
|
||||
},
|
||||
handlePermissionPack() {
|
||||
this.$router.push({ path: `${UrlConfig.permission.permissionDraft}` })
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
this.$Dictionary.permissionType().then(list => {
|
||||
list.forEach(elem => {
|
||||
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
|
||||
});
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
},
|
||||
formatterDate(row, porpInfo) {
|
||||
if (row.hasOwnProperty(porpInfo.property)) {
|
||||
}
|
||||
return row[porpInfo.property];
|
||||
},
|
||||
queryFunction(params) {
|
||||
return listUserPermision(params);
|
||||
},
|
||||
handlePermissionPack() {
|
||||
this.$router.push({ path: `${UrlConfig.permission.permissionDraft}` });
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -82,21 +82,6 @@
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
let arr = [];
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
enumList.forEach((element, i) => {
|
||||
fieldValue.forEach((v, j) => {
|
||||
if ('' + fieldValue[j] === '' + enumList[i][value]) {
|
||||
arr.push(enumList[i][label])
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
return arr;
|
||||
},
|
||||
|
||||
selectRole(index, row) {
|
||||
this.$confirm(`是否确定设置"${row.name}"为权限所属人`, '提示', {
|
||||
|
@ -74,7 +74,7 @@ export default {
|
||||
prop: 'lessonId',
|
||||
type: 'tag',
|
||||
show: !this.$route.query.lessonId,
|
||||
columnValue: (row) => { return this.convertField(row.lessonId, this.OrganizationList, ['id', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.lessonId, this.OrganizationList, ['id', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
@ -122,7 +122,7 @@ export default {
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
@ -214,7 +214,7 @@ export default {
|
||||
});
|
||||
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.convertList(list, this.EffectiveTypeList, elem => {
|
||||
this.$convertList(list, this.EffectiveTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
@ -46,7 +46,7 @@ export default {
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
@ -57,7 +57,7 @@ export default {
|
||||
title: '产品类型',
|
||||
prop: 'prdType',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.prdType, this.prdTypeList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.prdType, this.prdTypeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
// {
|
||||
|
@ -50,7 +50,7 @@ export default {
|
||||
title: '所属城市',
|
||||
prop: 'cityCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.cityCode, this.cityList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
|
@ -51,14 +51,14 @@ export default {
|
||||
title: '所属城市',
|
||||
prop: 'cityCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.cityCode, this.cityList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ export default {
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ export default {
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
|
@ -50,7 +50,7 @@ export default {
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
|
@ -45,7 +45,7 @@ export default {
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => {
|
||||
return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']);
|
||||
},
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
|
@ -54,7 +54,7 @@
|
||||
title: '状态',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
@ -97,17 +97,6 @@
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
if ('' + fieldValue === '' + enumList[i][value]) {
|
||||
return enumList[i][label];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
loadInitData() {
|
||||
this.EffectiveTypeList = [];
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
|
Loading…
Reference in New Issue
Block a user