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,21 +1,28 @@
|
||||
<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-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" @click="handleConfirm" :loading="loading">选 择</el-button>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
@ -50,19 +57,19 @@
|
||||
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' }
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图'
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -70,7 +77,7 @@
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
@ -87,10 +94,10 @@
|
||||
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 (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];
|
||||
}
|
||||
@ -109,10 +116,10 @@
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,24 +1,31 @@
|
||||
<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-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" @click="handleConfirm" :loading="loading">加 载</el-button>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'ReloadTodayPlan',
|
||||
data() {
|
||||
return {
|
||||
@ -53,19 +60,19 @@
|
||||
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' }
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '加载当天计划'
|
||||
return '加载当天计划';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -73,7 +80,7 @@
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
@ -90,10 +97,10 @@
|
||||
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 (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];
|
||||
}
|
||||
@ -108,45 +115,45 @@
|
||||
this.loading = true;
|
||||
generateUserRunPlanEveryDay(choose.id, this.$route.query.group).then(response => {
|
||||
this.loading = false;
|
||||
this.reloadTable()
|
||||
this.reloadTable();
|
||||
this.loadRunData();
|
||||
this.doClose();
|
||||
this.$message.success(`生成用户每日运行图成功`);
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.reloadTable()
|
||||
this.reloadTable();
|
||||
this.$messageBox(`生成用户每日运行图失败`);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
this.$messageBox(`请选择需要加载的运行图`);
|
||||
}
|
||||
}
|
||||
},
|
||||
loadRunData() {
|
||||
let skinStyle = this.$route.query.skinStyle;
|
||||
const skinStyle = this.$route.query.skinStyle;
|
||||
this.$store.dispatch('runPlan/clear');
|
||||
if (skinStyle) {
|
||||
getStationListBySkinStyle(skinStyle).then(response => {
|
||||
let stations = response.data;
|
||||
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(error => {
|
||||
}).catch(() => {
|
||||
this.$store.dispatch('runPlan/setPlanData', []);
|
||||
this.$messageBox(`获取运行图数据失败`);
|
||||
})
|
||||
})
|
||||
}).catch(error => {
|
||||
});
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(`获取车站列表失败`);
|
||||
});
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,21 +1,28 @@
|
||||
<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-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" @click="handleConfirm" :loading="loading">选 择</el-button>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
@ -50,19 +57,19 @@
|
||||
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' }
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图'
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -70,7 +77,7 @@
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
@ -87,10 +94,10 @@
|
||||
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 (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];
|
||||
}
|
||||
@ -109,10 +116,10 @@
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -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,21 +1,28 @@
|
||||
<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-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" @click="handleConfirm" :loading="loading">选 择</el-button>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'ChooseTemplatePlan',
|
||||
data() {
|
||||
return {
|
||||
@ -50,19 +57,19 @@
|
||||
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' }
|
||||
tagType: (row) => { return 'success'; }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '选择模板运行图'
|
||||
return '选择模板运行图';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -70,7 +77,7 @@
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
doShow() {
|
||||
this.loading = false;
|
||||
@ -88,8 +95,8 @@
|
||||
},
|
||||
convertField(fieldValue, enumList, converFormat) {
|
||||
if (converFormat && converFormat.length >= 2) {
|
||||
let value = converFormat[0];
|
||||
let label = converFormat[1];
|
||||
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];
|
||||
@ -109,10 +116,10 @@
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -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,28 +1,43 @@
|
||||
<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; ">
|
||||
<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 label="02" :id="upDown == '01' ? domIdChoose : ''">上行全线</el-radio>
|
||||
<el-radio :id="upDown == '01' ? domIdChoose : ''" label="02">上行全线</el-radio>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="8">
|
||||
<el-radio label="01" :id="upDown == '02' ? domIdChoose : ''">下行全线</el-radio>
|
||||
<el-radio :id="upDown == '02' ? domIdChoose : ''" label="01">下行全线</el-radio>
|
||||
</el-col>
|
||||
</el-radio-group>
|
||||
</el-row>
|
||||
</div>
|
||||
</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
|
||||
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">
|
||||
@ -34,16 +49,16 @@
|
||||
<el-button :id="domIdCancel" @click="cancel">取 消</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<notice-info ref="noticeInfo"></notice-info>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'StandDetainTrainAll',
|
||||
components: {
|
||||
NoticeInfo
|
||||
@ -55,12 +70,12 @@
|
||||
upDown: '01',
|
||||
tempData: [],
|
||||
disabled: true,
|
||||
operation: '',
|
||||
}
|
||||
operation: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'stationStandList',
|
||||
'stationStandList'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
@ -85,27 +100,27 @@
|
||||
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;
|
||||
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;
|
||||
@ -123,27 +138,27 @@
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
choose(upDown) {
|
||||
//重新设置扣车站台
|
||||
// 重新设置扣车站台
|
||||
this.loadTableData();
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.choose.operation,
|
||||
val: `${upDown}`,
|
||||
}
|
||||
val: `${upDown}`
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
commit() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
send: true,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.cancelDetainTrainAll.menu.operation,
|
||||
val: this.upDown,
|
||||
}
|
||||
val: this.upDown
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
@ -151,26 +166,26 @@
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.doClose();
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.Command.cancel.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.Command.cancel.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.doClose();
|
||||
}
|
||||
}).catch(error => {
|
||||
}).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,
|
||||
|
@ -1,31 +1,31 @@
|
||||
<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>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'StationStandMenu',
|
||||
components: {
|
||||
PopMenu,
|
||||
@ -35,7 +35,7 @@
|
||||
NoticeInfo,
|
||||
StandBackStrategy,
|
||||
StandStopTime,
|
||||
StandDetainTrainAll,
|
||||
StandDetainTrainAll
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
@ -51,55 +51,55 @@
|
||||
label: '扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: true, center: false },
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: true, center: false },
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '强制取消扣车',
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: true, center: false },
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: true, center: false },
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: false },
|
||||
auth: { station: true, center: false }
|
||||
},
|
||||
{
|
||||
label: '设置运行等级',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: false },
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '设置提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: false },
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '人工折返策略设置',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: false },
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '查询站台状态',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: false },
|
||||
auth: { station: true, center: false }
|
||||
}
|
||||
],
|
||||
central: [
|
||||
@ -107,67 +107,67 @@
|
||||
label: '扣车',
|
||||
handler: this.setDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.setDetainTrain,
|
||||
auth: { station: false, center: true },
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消扣车',
|
||||
handler: this.cancelDetainTrain,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrain,
|
||||
auth: { station: false, center: true },
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '强制取消扣车',
|
||||
handler: this.cancelDetainTrainForce,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainForce,
|
||||
auth: { station: false, center: false },
|
||||
auth: { station: false, center: false }
|
||||
},
|
||||
{
|
||||
label: '全线取消扣车',
|
||||
handler: this.cancelDetainTrainAll,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelDetainTrainAll,
|
||||
auth: { station: false, center: true },
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '跳停',
|
||||
handler: this.setJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.setJumpStop,
|
||||
auth: { station: false, center: true },
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '取消跳停',
|
||||
handler: this.cancelJumpStop,
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelJumpStop,
|
||||
auth: { station: true, center: true },
|
||||
auth: { station: true, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置停站时间',
|
||||
handler: this.setStopTime,
|
||||
disabledCallback: MenuDisabledState.StationStand.setStopTime,
|
||||
auth: { station: false, center: true },
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置运行等级',
|
||||
handler: this.setRunLevel,
|
||||
disabledCallback: MenuDisabledState.StationStand.setRunLevel,
|
||||
auth: { station: false, center: true },
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '设置提前发车',
|
||||
handler: this.earlyDeparture,
|
||||
disabledCallback: MenuDisabledState.StationStand.earlyDeparture,
|
||||
auth: { station: false, center: true },
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '人工折返策略设置',
|
||||
handler: this.setBackStrategy,
|
||||
disabledCallback: MenuDisabledState.StationStand.setBackStrategy,
|
||||
auth: { station: false, center: true },
|
||||
auth: { station: false, center: true }
|
||||
},
|
||||
{
|
||||
label: '查询站台状态',
|
||||
handler: this.detail,
|
||||
disabledCallback: MenuDisabledState.StationStand.detail,
|
||||
auth: { station: true, center: true },
|
||||
auth: { station: true, center: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -183,7 +183,7 @@
|
||||
disabledCallback: MenuDisabledState.StationStand.cancelStoppage
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('training', [
|
||||
@ -205,21 +205,21 @@
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
let self = this;
|
||||
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]
|
||||
this.menu = [...this.menu, ...this.menuForce];
|
||||
}
|
||||
|
||||
//故障模式菜单列表
|
||||
// 故障模式菜单列表
|
||||
if (this.operatemode === OperateMode.FAULT) {
|
||||
this.menu = this.menuForce
|
||||
this.menu = this.menuForce;
|
||||
}
|
||||
|
||||
this.menu = menuConvert(this.menu);
|
||||
@ -236,9 +236,9 @@
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
//设置故障
|
||||
// 设置故障
|
||||
setStoppage() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -252,13 +252,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
//取消故障
|
||||
// 取消故障
|
||||
cancelStoppage() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -272,13 +272,13 @@
|
||||
} else {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
//设置扣车
|
||||
// 设置扣车
|
||||
setDetainTrain() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
@ -291,11 +291,11 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
//取消扣车
|
||||
// 取消扣车
|
||||
cancelDetainTrain() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
@ -307,11 +307,11 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
//强制取消扣车
|
||||
// 强制取消扣车
|
||||
cancelDetainTrainForce() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
@ -323,11 +323,11 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
//全线取消扣车
|
||||
// 全线取消扣车
|
||||
cancelDetainTrainAll() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
@ -339,11 +339,11 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetainTrainAll.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
//设置跳停
|
||||
// 设置跳停
|
||||
setJumpStop() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
@ -355,11 +355,11 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
//取消跳停
|
||||
// 取消跳停
|
||||
cancelJumpStop() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
@ -371,11 +371,11 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standControl.doShow(operate, this.selected);
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
//设置停站时间
|
||||
// 设置停站时间
|
||||
setStopTime() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -392,13 +392,13 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standStopTime.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
//设置运行等级
|
||||
// 设置运行等级
|
||||
setRunLevel() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -415,34 +415,34 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standRunLevel.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
//设置提前发车
|
||||
// 设置提前发车
|
||||
earlyDeparture() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.earlyDeparture.menu.operation,
|
||||
}
|
||||
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 = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
type: MapDeviceType.StationStand.type,
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation,
|
||||
}
|
||||
operation: OperationEvent.StationStand.setBackStrategy.menu.operation
|
||||
};
|
||||
|
||||
this.$store.dispatch('training/next', operate).then(({ valid, response }) => {
|
||||
if (valid) {
|
||||
@ -453,13 +453,13 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standBackStrategy.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.$refs.noticeInfo.doShow(operate);
|
||||
})
|
||||
});
|
||||
},
|
||||
//查询站台状态
|
||||
// 查询站台状态
|
||||
detail() {
|
||||
let operate = {
|
||||
const operate = {
|
||||
start: true,
|
||||
send: true,
|
||||
code: this.selected.code,
|
||||
@ -476,10 +476,10 @@
|
||||
this.$store.dispatch('menuOperation/handleBreakFlag', { break: true });
|
||||
this.$refs.standDetail.doShow(operate, this.selected, tempDate);
|
||||
}
|
||||
}).catch(error => {
|
||||
}).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,6 +205,18 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -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,52 +1,52 @@
|
||||
<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>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave" v-loading="loading">确 定</el-button>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'AddBatch',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
skinStyle: '',
|
||||
skinStyle: ''
|
||||
},
|
||||
skinStyleList: [],
|
||||
isShow: false,
|
||||
}
|
||||
isShow: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'skinStyle', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList },
|
||||
{ prop: 'skinStyle', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList }
|
||||
]
|
||||
}
|
||||
return form
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
const crules = {
|
||||
skinStyle: [
|
||||
{ required: true, message: '请选择皮肤类型', trigger: 'change' },
|
||||
],
|
||||
}
|
||||
return crules
|
||||
{ required: true, message: '请选择皮肤类型', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '自动生成操作'
|
||||
return '自动生成操作';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -58,12 +58,12 @@
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data.map(item => {
|
||||
let params = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});
|
||||
})
|
||||
});
|
||||
},
|
||||
show(total) {
|
||||
if (total) {
|
||||
@ -71,10 +71,10 @@
|
||||
}
|
||||
|
||||
this.loading = false;
|
||||
this.dialogVisible = true
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.isShow) {
|
||||
this.$confirm('此操作将清空改皮肤下所有操作定义, 是否继续?', '提示', {
|
||||
@ -82,34 +82,34 @@
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
self.create()
|
||||
}).catch(() => { })
|
||||
self.create();
|
||||
}).catch(() => { });
|
||||
} else {
|
||||
self.create()
|
||||
self.create();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
create() {
|
||||
let self = this
|
||||
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.$message.success('批量生成操作定义成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable'); // 刷新列表
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('批量生成操作定义失败:' + error.message)
|
||||
})
|
||||
self.$message.error('批量生成操作定义失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
skinStyle: '',
|
||||
}
|
||||
skinStyle: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
this.isShow = false;
|
||||
this.dialogVisible = false
|
||||
}
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,20 +1,18 @@
|
||||
<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>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave" v-loading="loading">确 定</el-button>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'TrainingEdit',
|
||||
props: {
|
||||
type: {
|
||||
@ -34,18 +32,18 @@
|
||||
minDuration: '',
|
||||
maxDuration: '',
|
||||
trainingRemark: '',
|
||||
productTypes: [],
|
||||
productTypes: []
|
||||
},
|
||||
skinStyleList: [],
|
||||
trainingTypeList: [],
|
||||
trainingOperateTypeMap: {},
|
||||
placeholderList: [],
|
||||
}
|
||||
placeholderList: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'skinStyle', label: '皮肤类型', type: 'select', required: true, options: this.skinStyleList, disabled: !isAdd },
|
||||
@ -56,42 +54,42 @@
|
||||
{ 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: '选择占位符 ‘{}’ 不可删除,否则说明显示会有问题!' },
|
||||
{ prop: 'trainingRemark', label: '实训说明', type: 'textarea', required: true, tooltip: true, info: '选择占位符 ‘{}’ 不可删除,否则说明显示会有问题!' }
|
||||
]
|
||||
}
|
||||
return form
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
const crules = {
|
||||
trainingName: [
|
||||
{ required: true, message: '请输入实训名称', trigger: 'blur' },
|
||||
{ required: true, message: '请输入实训名称', trigger: 'blur' }
|
||||
],
|
||||
trainingType: [
|
||||
{ required: true, message: '请输入实训类型', trigger: 'change' },
|
||||
{ required: true, message: '请输入实训类型', trigger: 'change' }
|
||||
],
|
||||
operateType: [
|
||||
{ required: true, message: '请输入操作类型', trigger: 'change' }
|
||||
],
|
||||
skinStyle: [
|
||||
{ required: true, message: '请选择皮肤类型', trigger: 'change' },
|
||||
{ required: true, message: '请选择皮肤类型', trigger: 'change' }
|
||||
],
|
||||
minDuration: [
|
||||
{ required: true, message: '请输入最佳用时', trigger: 'blur' }
|
||||
],
|
||||
maxDuration: [
|
||||
{ required: true, message: '请输入最大用时', trigger: 'blur' },
|
||||
{ required: true, message: '请输入最大用时', trigger: 'blur' }
|
||||
],
|
||||
trainingRemark: [
|
||||
{ required: true, max: 500, message: '请输入实训说明', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
return crules
|
||||
{ required: true, max: 500, message: '请输入实训说明', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建操作规则'
|
||||
return '创建操作规则';
|
||||
} else {
|
||||
return '编辑操作规则'
|
||||
return '编辑操作规则';
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -104,90 +102,89 @@
|
||||
this.skinStyleList = [];
|
||||
getSkinStyleList().then(response => {
|
||||
this.skinStyleList = response.data.map(item => {
|
||||
let params = {}
|
||||
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 = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});
|
||||
})
|
||||
});
|
||||
// 获取实训操作类型
|
||||
this.trainingOperateTypeMap = {}
|
||||
this.trainingOperateTypeMap = {};
|
||||
this.$Dictionary.stationControl().then(list => {
|
||||
this.trainingOperateTypeMap['01'] = list.map(item => {
|
||||
let params = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //控制权实训
|
||||
}); // 控制权实训
|
||||
});
|
||||
this.$Dictionary.signalOperation().then(list => {
|
||||
this.trainingOperateTypeMap['02'] = list.map(item => {
|
||||
let params = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //信号机实训
|
||||
}); // 信号机实训
|
||||
});
|
||||
this.$Dictionary.switchOperation().then(list => {
|
||||
this.trainingOperateTypeMap['03'] = list.map(item => {
|
||||
let params = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //道岔实训
|
||||
}); // 道岔实训
|
||||
});
|
||||
this.$Dictionary.sectionOperation().then(list => {
|
||||
this.trainingOperateTypeMap['04'] = list.map(item => {
|
||||
let params = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //区段实训
|
||||
}); // 区段实训
|
||||
});
|
||||
this.$Dictionary.stationStandOperation().then(list => {
|
||||
this.trainingOperateTypeMap['05'] = list.map(item => {
|
||||
let params = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //站台实训
|
||||
}); // 站台实训
|
||||
});
|
||||
this.$Dictionary.trainPlanOperation().then(list => {
|
||||
this.trainingOperateTypeMap['06'] = list.map(item => {
|
||||
let params = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //行车计划实训
|
||||
}); // 行车计划实训
|
||||
});
|
||||
this.$Dictionary.trainOperation().then(list => {
|
||||
this.trainingOperateTypeMap['07'] = list.map(item => {
|
||||
let params = {}
|
||||
const params = {};
|
||||
params.label = item.name;
|
||||
params.value = item.code;
|
||||
return params;
|
||||
});; //列车实训
|
||||
}); // 列车实训
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
async show(data) {
|
||||
this.loading = false;
|
||||
this.dialogVisible = true
|
||||
this.dialogVisible = true;
|
||||
if (data && data.id) {
|
||||
// 获取操作占位列表
|
||||
let res = await getPlaceholderList({ trainingType: data.trainingType, skinStyle: data.skinStyle });
|
||||
const res = await getPlaceholderList({ trainingType: data.trainingType, skinStyle: data.skinStyle });
|
||||
this.placeholderList = res.data;
|
||||
this.formModel = {
|
||||
id: data.id,
|
||||
@ -198,13 +195,13 @@
|
||||
skinStyle: data.skinStyle,
|
||||
minDuration: data.minDuration,
|
||||
maxDuration: data.maxDuration,
|
||||
trainingRemark: this.repliceName(data.trainingRemark, this.placeholderList),
|
||||
trainingRemark: this.repliceName(data.trainingRemark, this.placeholderList)
|
||||
};
|
||||
}
|
||||
},
|
||||
repliceName(fieldValue, enumList) {
|
||||
if (enumList && enumList.length > 0) {
|
||||
for (let i = 0; enumList && i < enumList.length; i++) {
|
||||
for (let i = 0; i < enumList.length; i++) {
|
||||
if (fieldValue.includes(`{${enumList[i].id}}`)) {
|
||||
fieldValue = fieldValue.replace(`{${enumList[i].id}}`, `{${enumList[i].name}}`);
|
||||
}
|
||||
@ -216,71 +213,71 @@
|
||||
// 获取操作占位列表
|
||||
getPlaceholderList({ trainingType: val, skinStyle: '02' }).then(res => {
|
||||
this.placeholderList = res.data;
|
||||
})
|
||||
});
|
||||
},
|
||||
addTrainName(val) {
|
||||
this.formModel.trainingName = `${this.formModel.trainingName}{${val.name}}`
|
||||
this.formModel.trainingName = `${this.formModel.trainingName}{${val.name}}`;
|
||||
},
|
||||
addTrainRemark(val) {
|
||||
this.formModel.trainingRemark = `${this.formModel.trainingRemark}{${val.name}}`
|
||||
this.formModel.trainingRemark = `${this.formModel.trainingRemark}{${val.name}}`;
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create()
|
||||
self.create();
|
||||
} else {
|
||||
self.update()
|
||||
self.update();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
create() {
|
||||
let self = this
|
||||
const self = this;
|
||||
this.placeholderList.forEach(item => {
|
||||
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
||||
let name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
const 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}}`);
|
||||
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')
|
||||
self.$message.success('创建操作定义成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('创建操作定义失败:' + error.message)
|
||||
})
|
||||
self.$message.error('创建操作定义失败:' + error.message);
|
||||
});
|
||||
},
|
||||
update() {
|
||||
let self = this
|
||||
const self = this;
|
||||
this.placeholderList.forEach(item => {
|
||||
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
||||
let name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
||||
const 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}}`);
|
||||
const 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')
|
||||
self.$message.success('创建操作定义成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.loading = false;
|
||||
self.$message.error('创建操作定义失败:' + error.message)
|
||||
})
|
||||
self.$message.error('创建操作定义失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
@ -290,11 +287,11 @@
|
||||
skinStyle: '',
|
||||
minDuration: '',
|
||||
maxDuration: '',
|
||||
trainingRemark: '',
|
||||
}
|
||||
this.$refs.dataform.resetForm()
|
||||
this.dialogVisible = false
|
||||
}
|
||||
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,28 +1,32 @@
|
||||
<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>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'TrainingGeneration',
|
||||
components: {
|
||||
TrainingDraft,
|
||||
TrainingDraft
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -95,29 +99,29 @@
|
||||
title: '皮肤类型',
|
||||
prop: 'skinStyle',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) },
|
||||
tagType: (row) => { return '' }
|
||||
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' }
|
||||
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' }
|
||||
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' }
|
||||
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '最小用时',
|
||||
@ -147,16 +151,16 @@
|
||||
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', },
|
||||
{ text: '删除实训', btnCode: 'employee_insert', handler: this.delAutoMaticTrainging, type: 'danger' }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
async created() {
|
||||
await this.loadInitData();
|
||||
let json = localStore.get(this.$route.path);
|
||||
const json = localStore.get(this.$route.path);
|
||||
if (json && json.type) {
|
||||
this.typeChoose(json);
|
||||
}
|
||||
@ -172,16 +176,16 @@
|
||||
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;
|
||||
const list = res.data.list;
|
||||
if (list && list.length > 0) {
|
||||
this.prdTypeList = list.filter(elem => { return elem.prdType != '03'; });
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
// 获取实训类型
|
||||
this.trainingTypeList = [];
|
||||
@ -190,40 +194,40 @@
|
||||
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()
|
||||
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) => {
|
||||
let productList = response.data;
|
||||
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) {
|
||||
@ -243,14 +247,14 @@
|
||||
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++) {
|
||||
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];
|
||||
}
|
||||
@ -269,18 +273,18 @@
|
||||
demoDisplay(index, node) {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
||||
let query = { group: resp.data, trainingId: node.id, 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}`);
|
||||
})
|
||||
});
|
||||
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,6 +1,6 @@
|
||||
<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>
|
||||
<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>
|
||||
@ -9,9 +9,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicCodeExist, getData, update } from '@/api/management/dictionary'
|
||||
import { validateCharCode } from '@/utils/validate'
|
||||
export default {
|
||||
import { create, checkDicCodeExist, getData, update } from '@/api/management/dictionary';
|
||||
import { validateCharCode } from '@/utils/validate';
|
||||
export default {
|
||||
name: 'DictionaryEdit',
|
||||
props: {
|
||||
type: {
|
||||
@ -28,12 +28,12 @@
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '60px',
|
||||
items: [
|
||||
{ prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd },
|
||||
@ -41,13 +41,13 @@
|
||||
{
|
||||
prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
},
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false },
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false }
|
||||
]
|
||||
}
|
||||
return form
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
|
||||
@ -58,7 +58,7 @@
|
||||
remarks: [
|
||||
{ max: 50, message: '不能超过 50 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
if (this.type === 'ADD') {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
@ -66,75 +66,73 @@
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateCode, trigger: 'blur' }
|
||||
]
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return crules
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建目录'
|
||||
return '创建目录';
|
||||
} else {
|
||||
return '编辑目录'
|
||||
return '编辑目录';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateCode(rule, value, callback) {
|
||||
if (!validateCharCode(value)) {
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'))
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'));
|
||||
} else {
|
||||
checkDicCodeExist(value).then(response => {
|
||||
if (response.data) {
|
||||
return callback(new Error('编码已存在'))
|
||||
return callback(new Error('编码已存在'));
|
||||
} else {
|
||||
return callback()
|
||||
return callback();
|
||||
}
|
||||
}).catch(error => {
|
||||
return callback(new Error('服务异常'))
|
||||
})
|
||||
}).catch(() => {
|
||||
return callback(new Error('服务异常'));
|
||||
});
|
||||
}
|
||||
},
|
||||
show(id) {
|
||||
this.dialogVisible = true
|
||||
this.dialogVisible = true;
|
||||
if (id) {
|
||||
getData(id).then(response => {
|
||||
this.formModel = response.data
|
||||
this.$refs.dataform.resetForm()
|
||||
}).catch(error => {
|
||||
|
||||
})
|
||||
this.formModel = response.data;
|
||||
this.$refs.dataform.resetForm();
|
||||
});
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create()
|
||||
self.create();
|
||||
} else {
|
||||
self.update()
|
||||
self.update();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
create() {
|
||||
let self = this
|
||||
const self = this;
|
||||
create(this.formModel).then(response => {
|
||||
self.$message.success('创建字典目录成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
self.$message.success('创建字典目录成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('创建字典目录失败:' + error.message)
|
||||
})
|
||||
self.$message.error('创建字典目录失败:' + error.message);
|
||||
});
|
||||
},
|
||||
update() {
|
||||
let self = this
|
||||
const self = this;
|
||||
update(this.formModel).then(response => {
|
||||
self.$message.success('更新字典目录成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
self.$message.success('更新字典目录成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('更新字典目录失败:' + error.message)
|
||||
})
|
||||
self.$message.error('更新字典目录失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
@ -142,14 +140,14 @@
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
this.$refs.dataform.resetForm()
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
if (done) {
|
||||
done()
|
||||
done();
|
||||
} else {
|
||||
this.dialogVisible = false
|
||||
}
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,16 +1,15 @@
|
||||
<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>
|
||||
<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 {
|
||||
import { list, del } from '@/api/management/dictionary';
|
||||
import DictionaryEdit from '@/views/management/dictionary/edit';
|
||||
export default {
|
||||
name: 'Dictionary',
|
||||
components: {
|
||||
DictionaryEdit
|
||||
@ -60,8 +59,8 @@
|
||||
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' } }
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
|
||||
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
@ -84,31 +83,31 @@
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', handler: this.handleAdd },
|
||||
{ text: '新增', handler: this.handleAdd }
|
||||
// { text: '批量删除', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleViewDetail(index, row) {
|
||||
this.$router.push({ path: `/system/dictionary/detail`, query: { id: row.id } })
|
||||
this.$router.push({ path: `/system/dictionary/detail`, query: { id: row.id } });
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.show(row.id)
|
||||
this.$refs.edit.show(row.id);
|
||||
},
|
||||
|
||||
handleAdd() {
|
||||
this.$refs.create.show()
|
||||
this.$refs.create.show();
|
||||
},
|
||||
|
||||
handleBatchDelete() {
|
||||
@ -121,18 +120,18 @@
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
del(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
})
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,6 +1,6 @@
|
||||
<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>
|
||||
<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>
|
||||
@ -9,9 +9,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicDetailCodeExist, getData, update } from '@/api/management/dictionaryDetail'
|
||||
import { validateCharCode } from '@/utils/validate'
|
||||
export default {
|
||||
import { create, checkDicDetailCodeExist, getData, update } from '@/api/management/dictionaryDetail';
|
||||
import { validateCharCode } from '@/utils/validate';
|
||||
export default {
|
||||
name: 'DictionaryDetailEdit',
|
||||
props: {
|
||||
type: {
|
||||
@ -32,12 +32,12 @@
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
const isAdd = this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '60px',
|
||||
items: [
|
||||
{ prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd },
|
||||
@ -45,13 +45,13 @@
|
||||
{
|
||||
prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
},
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false },
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false }
|
||||
]
|
||||
}
|
||||
return form
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
|
||||
@ -62,7 +62,7 @@
|
||||
remarks: [
|
||||
{ max: 50, message: '不能超过 50 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
if (this.type === 'ADD') {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
@ -70,75 +70,73 @@
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' },
|
||||
{ validator: this.validateCode, trigger: 'blur' }
|
||||
]
|
||||
})
|
||||
});
|
||||
} else {
|
||||
return crules
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建明细'
|
||||
return '创建明细';
|
||||
} else {
|
||||
return '编辑明细'
|
||||
return '编辑明细';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateCode(rule, value, callback) {
|
||||
if (!validateCharCode(value)) {
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'))
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'));
|
||||
} else {
|
||||
checkDicDetailCodeExist(this.dicId, value).then(response => {
|
||||
if (response.data) {
|
||||
return callback(new Error('编码已存在'))
|
||||
return callback(new Error('编码已存在'));
|
||||
} else {
|
||||
return callback()
|
||||
return callback();
|
||||
}
|
||||
}).catch(error => {
|
||||
return callback(new Error('服务异常'))
|
||||
})
|
||||
}).catch(() => {
|
||||
return callback(new Error('服务异常'));
|
||||
});
|
||||
}
|
||||
},
|
||||
show(id) {
|
||||
this.dialogVisible = true
|
||||
this.dialogVisible = true;
|
||||
if (id) {
|
||||
getData(this.dicId, id).then(response => {
|
||||
this.formModel = response.data
|
||||
this.$refs.dataform.resetForm()
|
||||
}).catch(error => {
|
||||
|
||||
})
|
||||
this.formModel = response.data;
|
||||
this.$refs.dataform.resetForm();
|
||||
});
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.type === 'ADD') {
|
||||
self.create()
|
||||
self.create();
|
||||
} else {
|
||||
self.update()
|
||||
self.update();
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
create() {
|
||||
let self = this
|
||||
const self = this;
|
||||
create(this.dicId, this.formModel).then(response => {
|
||||
self.$message.success('创建字典目录成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
self.$message.success('创建字典目录成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('创建字典目录失败:' + error.message)
|
||||
})
|
||||
self.$message.error('创建字典目录失败:' + error.message);
|
||||
});
|
||||
},
|
||||
update() {
|
||||
let self = this
|
||||
const self = this;
|
||||
update(this.dicId, this.formModel).then(response => {
|
||||
self.$message.success('更新字典目录成功')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
self.$message.success('更新字典目录成功');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('更新字典目录失败:' + error.message)
|
||||
})
|
||||
self.$message.error('更新字典目录失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
@ -146,14 +144,14 @@
|
||||
name: '',
|
||||
status: '1',
|
||||
remarks: ''
|
||||
}
|
||||
this.$refs.dataform.resetForm()
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
if (done) {
|
||||
done()
|
||||
done();
|
||||
} else {
|
||||
this.dialogVisible = false
|
||||
}
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,25 +1,22 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
|
||||
<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 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>
|
||||
<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 {
|
||||
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
|
||||
@ -71,8 +68,8 @@
|
||||
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' } }
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
|
||||
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
|
||||
},
|
||||
{
|
||||
title: '说明',
|
||||
@ -91,18 +88,18 @@
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
},
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', btnCode: 'employee_insert', handler: this.handleAdd },
|
||||
{ text: '新增', btnCode: 'employee_insert', handler: this.handleAdd }
|
||||
// { text: '批量删除', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
|
||||
]
|
||||
},
|
||||
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
// computed: {
|
||||
@ -114,23 +111,21 @@
|
||||
created() {
|
||||
this.dicId = this.$route.query.id;
|
||||
getData(this.dicId).then(response => {
|
||||
this.dic = response.data
|
||||
}).catch(error => {
|
||||
|
||||
})
|
||||
this.dic = response.data;
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
return list(this.dicId, params)
|
||||
return list(this.dicId, params);
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.show(row.id)
|
||||
this.$refs.edit.show(row.id);
|
||||
},
|
||||
|
||||
handleAdd() {
|
||||
this.$refs.create.show()
|
||||
this.$refs.create.show();
|
||||
},
|
||||
|
||||
handleBatchDelete() {
|
||||
@ -139,23 +134,23 @@
|
||||
|
||||
handleDelete(index, row) {
|
||||
del(this.dicId, row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
this.queryList.reload();
|
||||
},
|
||||
|
||||
turnback() {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
|
@ -1,12 +1,11 @@
|
||||
<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 {
|
||||
import { getExistingSimulation, deleteExistingSimulation } from '@/api/simulation';
|
||||
export default {
|
||||
name: 'SimulationManage',
|
||||
components: {
|
||||
},
|
||||
@ -80,7 +79,7 @@
|
||||
title: '是否错误',
|
||||
prop: 'error',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.error, 'Whether') },
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.error, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
switch (row.error) {
|
||||
case true: return 'success';
|
||||
@ -96,7 +95,7 @@
|
||||
title: '是否暂停',
|
||||
prop: 'pause',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.pause, 'Whether') },
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.pause, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
switch (row.pause) {
|
||||
case true: return 'success';
|
||||
@ -108,7 +107,7 @@
|
||||
title: '是否按计划行车',
|
||||
prop: 'runAsPlan',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.runAsPlan, 'Whether') },
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.runAsPlan, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
switch (row.runAsPlan) {
|
||||
case true: return 'success';
|
||||
@ -120,21 +119,21 @@
|
||||
title: '皮肤编号',
|
||||
prop: 'skinCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.skinCode, this.$ConstSelect.skinCode, ['value', 'label'])},
|
||||
tagType: (row) => { return 'success' }
|
||||
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' }
|
||||
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) }
|
||||
columnValue: (row) => { return this.listJoiningTogether(row.sessionList); }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -144,14 +143,14 @@
|
||||
{
|
||||
name: '销毁',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger',
|
||||
},
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$Dictionary.productType().then(list => {
|
||||
@ -161,24 +160,13 @@
|
||||
});
|
||||
},
|
||||
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){
|
||||
if (sessionList.length>0) {
|
||||
sessionList.forEach((item) => {
|
||||
sessionId = sessionId+item+',';
|
||||
});
|
||||
sessionId = sessionId.substring(0,sessionId.length-1);
|
||||
sessionId = sessionId.substring(0, sessionId.length-1);
|
||||
}
|
||||
return sessionId;
|
||||
},
|
||||
@ -190,17 +178,17 @@
|
||||
}).then(() => {
|
||||
deleteExistingSimulation(row.group).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
});
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@ -1,19 +1,17 @@
|
||||
<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>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'UserControl',
|
||||
components: {
|
||||
DictionaryEdit,
|
||||
@ -68,8 +66,8 @@
|
||||
title: '角色',
|
||||
prop: 'roles',
|
||||
type: 'tagMore',
|
||||
columnValue: (row) => { return this.convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label']) },
|
||||
tagType: (row) => { return 'success' }
|
||||
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@ -78,41 +76,26 @@
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleUserEdit,
|
||||
handleClick: this.handleUserEdit
|
||||
},
|
||||
{
|
||||
name: '订阅地图',
|
||||
handleClick: this.handleMapCorrelation,
|
||||
type: 'danger',
|
||||
},
|
||||
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)
|
||||
this.$refs.edit.doShow(row);
|
||||
},
|
||||
|
||||
// 删除
|
||||
@ -130,17 +113,17 @@
|
||||
// this.reloadTable()
|
||||
// this.$messageBox('删除失败')
|
||||
// })
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
//关联地图
|
||||
// 关联地图
|
||||
handleMapCorrelation(index, row) {
|
||||
this.$refs.correlationMap.doShow(row);
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
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,34 +1,32 @@
|
||||
<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>
|
||||
<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"></add-training>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'UsersTrainingAdd',
|
||||
components: {
|
||||
AddTraining
|
||||
},
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
components: {
|
||||
AddTraining,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -39,46 +37,46 @@
|
||||
trainingName: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
duration: '',
|
||||
duration: ''
|
||||
},
|
||||
LessonList: [],
|
||||
UserList: [],
|
||||
UserLoading: false,
|
||||
}
|
||||
UserLoading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let form = {
|
||||
this.type === 'ADD';
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'lessonId', label: '课程名称', type: 'select', required: true, options: this.LessonList, },
|
||||
{ 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' },
|
||||
{ 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
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
const crules = {
|
||||
lessonId: [
|
||||
{ required: true, message: '请输入教学名称', trigger: 'change' },
|
||||
{ required: true, message: '请输入教学名称', trigger: 'change' }
|
||||
],
|
||||
trainingName: [
|
||||
{ required: true, message: '请选择实训', trigger: 'change' },
|
||||
{ required: true, message: '请选择实训', trigger: 'change' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: '请输入用户名称', trigger: 'change' },
|
||||
{ required: true, message: '请输入用户名称', trigger: 'change' }
|
||||
],
|
||||
duration: [
|
||||
{ required: true, message: '请输入时长', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
return crules
|
||||
{ required: true, message: '请输入时长', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '创建用户实训'
|
||||
return '创建用户实训';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -86,36 +84,36 @@
|
||||
},
|
||||
methods: {
|
||||
initLoadPage() {
|
||||
//加载发布课程列表
|
||||
// 加载发布课程列表
|
||||
this.LessonList.length = 0;
|
||||
this.UserList.length = 0;
|
||||
getPublishLessonList().then(response => {
|
||||
let data = response.data;
|
||||
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 查询用户 并显示
|
||||
let results = [];
|
||||
const results = [];
|
||||
if (queryString) {
|
||||
try {
|
||||
let params = {
|
||||
fuzzyParam: queryString,
|
||||
const params = {
|
||||
fuzzyParam: queryString
|
||||
};
|
||||
let res = await getDimUserList(params);
|
||||
let list = res.data;
|
||||
const res = await getDimUserList(params);
|
||||
const list = res.data;
|
||||
list.forEach(item => {
|
||||
let value = {
|
||||
const value = {
|
||||
id: item.id,
|
||||
value: `${item.nickname}(${item.name})${item.mobile}`
|
||||
}
|
||||
};
|
||||
results.push(value);
|
||||
})
|
||||
});
|
||||
cb(results);
|
||||
} catch (error) {
|
||||
console.error(error, '查询用户list');
|
||||
@ -136,11 +134,11 @@
|
||||
if (this.formModel.lessonId) {
|
||||
this.$refs.addTraining.show(this.formModel.lessonId);
|
||||
} else {
|
||||
this.$message.error('请先选择课程名称')
|
||||
this.$message.error('请先选择课程名称');
|
||||
}
|
||||
},
|
||||
show(data) {
|
||||
this.dialogVisible = true
|
||||
this.dialogVisible = true;
|
||||
// this.formModel = {
|
||||
// lessonId: '',
|
||||
// trainingId: '',
|
||||
@ -151,23 +149,23 @@
|
||||
// };
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.save()
|
||||
})
|
||||
self.save();
|
||||
});
|
||||
},
|
||||
save() {
|
||||
let self = this
|
||||
const self = this;
|
||||
if (this.formModel.userId) {
|
||||
addUserTraining(this.formModel).then(response => {
|
||||
self.$message.success('创建成功!')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
self.$message.success('创建成功!');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('创建失败!' + error.message)
|
||||
})
|
||||
self.$message.error('创建失败!' + error.message);
|
||||
});
|
||||
} else {
|
||||
self.$message.error('请选择用户')
|
||||
self.$message.error('请选择用户');
|
||||
}
|
||||
},
|
||||
handleClose(done) {
|
||||
@ -177,10 +175,10 @@
|
||||
trainingName: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
duration: '',
|
||||
}
|
||||
this.dialogVisible = false
|
||||
}
|
||||
duration: ''
|
||||
};
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,9 +1,15 @@
|
||||
<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 }">
|
||||
<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>
|
||||
@ -11,16 +17,16 @@
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave" :disabled="disabled">确 定</el-button>
|
||||
<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 {
|
||||
export default {
|
||||
name: 'AddTraining',
|
||||
props: {
|
||||
|
||||
@ -31,15 +37,15 @@
|
||||
title: '选择实训',
|
||||
treeData: [{
|
||||
children: [],
|
||||
name: '',
|
||||
name: ''
|
||||
}],
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
training: {},
|
||||
disabled: true,
|
||||
}
|
||||
disabled: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
@ -59,34 +65,34 @@
|
||||
}
|
||||
},
|
||||
async show(lessonId) {
|
||||
this.dialogVisibles = true
|
||||
this.dialogVisibles = true;
|
||||
try {
|
||||
let res = await getPublishLessonDetail({ id: lessonId });
|
||||
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.$emit('selectTrain', this.training);
|
||||
this.handleClose();
|
||||
},
|
||||
handleClose() {
|
||||
this.treeData = [{
|
||||
children: [],
|
||||
name: '',
|
||||
name: ''
|
||||
}];
|
||||
this.trainingId = '';
|
||||
this.training = {};
|
||||
this.dialogVisibles = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,6 +1,6 @@
|
||||
<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>
|
||||
<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>
|
||||
@ -9,16 +9,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { create, checkDicDetailCodeExist, getData } from '@/api/management/dictionaryDetail'
|
||||
import { putUserTraining } from '@/api/jmap/training';
|
||||
import { validateCharCode } from '@/utils/validate'
|
||||
export default {
|
||||
import { putUserTraining } from '@/api/jmap/training';
|
||||
export default {
|
||||
name: 'UsersTrainingEdit',
|
||||
props: {
|
||||
type: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -28,70 +26,70 @@
|
||||
lessonName: '',
|
||||
userName: '',
|
||||
trainingName: '',
|
||||
duration: '',
|
||||
duration: ''
|
||||
// trainingCount: '',
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let isAdd = this.type === 'ADD'
|
||||
let 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' },
|
||||
{ prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' }
|
||||
]
|
||||
}
|
||||
return form
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
let crules = {
|
||||
const crules = {
|
||||
duration: [
|
||||
{ required: true, message: '请输入时长', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
return crules
|
||||
{ required: true, message: '请输入时长', trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '编辑实训详情'
|
||||
return '编辑实训详情';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show(data) {
|
||||
this.dialogVisible = true
|
||||
this.dialogVisible = true;
|
||||
if (data && data.id) {
|
||||
this.formModel = {
|
||||
id: data.id,
|
||||
lessonName: data.lessonName,
|
||||
userName: data.userName,
|
||||
trainingName: data.trainingName,
|
||||
duration: data.duration,
|
||||
duration: data.duration
|
||||
// trainingCount: data.trainingCount
|
||||
};
|
||||
}
|
||||
},
|
||||
doSave() {
|
||||
let self = this
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
self.update()
|
||||
})
|
||||
self.update();
|
||||
});
|
||||
},
|
||||
update() {
|
||||
let self = this;
|
||||
let param = {
|
||||
const self = this;
|
||||
const param = {
|
||||
id: this.formModel.id,
|
||||
duration: this.formModel.duration,
|
||||
}
|
||||
duration: this.formModel.duration
|
||||
};
|
||||
putUserTraining(param).then(response => {
|
||||
self.$message.success('修改成功!')
|
||||
self.handleClose()
|
||||
self.$emit('reloadTable')
|
||||
self.$message.success('修改成功!');
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('修改失败!' + error.message)
|
||||
})
|
||||
self.$message.error('修改失败!' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
@ -99,10 +97,10 @@
|
||||
lessonName: '',
|
||||
userName: '',
|
||||
trainingName: '',
|
||||
duration: '',
|
||||
}
|
||||
this.dialogVisible = false
|
||||
}
|
||||
duration: ''
|
||||
};
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,22 +1,20 @@
|
||||
<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>
|
||||
<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 {
|
||||
import { getTrainingList, deleteUserTraining } from '@/api/jmap/training';
|
||||
import UsersTrainingEdit from './edit';
|
||||
import UsersTrainingAdd from './add';
|
||||
export default {
|
||||
name: 'UserTrainingEdit',
|
||||
components: {
|
||||
UsersTrainingEdit,
|
||||
UsersTrainingAdd,
|
||||
UsersTrainingAdd
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -61,8 +59,8 @@
|
||||
title: '实训用时',
|
||||
prop: 'duration',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.computation(row.duration) },
|
||||
tagType: (row) => { return 'success' }
|
||||
columnValue: (row) => { return this.computation(row.duration); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '实训名称',
|
||||
@ -76,23 +74,23 @@
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.edit,
|
||||
showControl: (row) => { return row.fake != '0' }
|
||||
showControl: (row) => { return row.fake != '0'; }
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger',
|
||||
showControl: (row) => { return row.fake != '0' }
|
||||
},
|
||||
showControl: (row) => { return row.fake != '0'; }
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '新增', handler: this.createTraining }
|
||||
],
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
@ -102,12 +100,12 @@
|
||||
|
||||
},
|
||||
createTraining() {
|
||||
this.$refs.add.show()
|
||||
this.$refs.add.show();
|
||||
},
|
||||
computation(fieldValue) {
|
||||
if (fieldValue) {
|
||||
let f = parseInt(fieldValue / 60);
|
||||
let s = fieldValue % 60;
|
||||
const f = parseInt(fieldValue / 60);
|
||||
const s = fieldValue % 60;
|
||||
if (f > 0) {
|
||||
return `${f}分${s}秒`;
|
||||
} else {
|
||||
@ -118,7 +116,7 @@
|
||||
|
||||
// 编辑
|
||||
edit(index, row) {
|
||||
this.$refs.edit.show(row)
|
||||
this.$refs.edit.show(row);
|
||||
},
|
||||
|
||||
// 删除
|
||||
@ -129,18 +127,18 @@
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteUserTraining(row.id).then(response => {
|
||||
this.$message.success('删除成功')
|
||||
this.reloadTable()
|
||||
}).catch(error => {
|
||||
this.reloadTable()
|
||||
this.$messageBox('删除失败')
|
||||
})
|
||||
})
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
reloadTable() {
|
||||
this.queryList.reload()
|
||||
}
|
||||
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,10 +1,10 @@
|
||||
<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>
|
||||
<data-form ref="dataform" :form="formOrder" :form-model="formOrderModel" />
|
||||
</div>
|
||||
<div v-else>
|
||||
<data-form ref="dataform" :form="form" :formModel="formModel"></data-form>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" />
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleClose">关 闭</el-button>
|
||||
@ -13,55 +13,49 @@
|
||||
</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',
|
||||
export default {
|
||||
name: 'AuthorDetail',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
source: '',
|
||||
userMobile: '',
|
||||
userName: '',
|
||||
userName: ''
|
||||
},
|
||||
formOrderModel: {
|
||||
source: '',
|
||||
order: '',
|
||||
order: ''
|
||||
},
|
||||
PermissionTypeList: [],
|
||||
orderType: '',
|
||||
order: '',
|
||||
}
|
||||
order: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let 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, },
|
||||
{ prop: 'source', label: '来源', type: 'text', disabled: true },
|
||||
{ prop: 'name', label: '分发用户', type: 'text', disabled: true },
|
||||
{ prop: 'mobile', label: '用户手机号', type: 'text', disabled: true }
|
||||
]
|
||||
}
|
||||
return form
|
||||
};
|
||||
return form;
|
||||
},
|
||||
formOrder() {
|
||||
let form = {
|
||||
const form = {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'source', label: '来源', type: 'text', disabled: true, },
|
||||
{ prop: 'order', label: '订单号', type: 'text', disabled: true, },
|
||||
{ prop: 'source', label: '来源', type: 'text', disabled: true },
|
||||
{ prop: 'order', label: '订单号', type: 'text', disabled: true }
|
||||
]
|
||||
}
|
||||
return form
|
||||
};
|
||||
return form;
|
||||
},
|
||||
title() {
|
||||
return '来源信息'
|
||||
return '来源信息';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -74,13 +68,13 @@
|
||||
this.formModel = {
|
||||
source: '权限分发',
|
||||
mobile: data.mobile,
|
||||
name: data.name,
|
||||
name: data.name
|
||||
};
|
||||
} else {
|
||||
this.orderType = true;
|
||||
this.formOrderModel = {
|
||||
source: '订单创建',
|
||||
order: data,
|
||||
order: data
|
||||
};
|
||||
}
|
||||
},
|
||||
@ -88,10 +82,10 @@
|
||||
this.formModel = {
|
||||
source: '',
|
||||
userMobile: '',
|
||||
userName: '',
|
||||
}
|
||||
this.dialogVisible = false
|
||||
}
|
||||
userName: ''
|
||||
};
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,12 +1,12 @@
|
||||
<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-step :title="title" icon="el-icon-edit-outline" />
|
||||
<el-step title="" icon="el-icon-upload" />
|
||||
</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 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">
|
||||
@ -19,13 +19,12 @@
|
||||
</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 {
|
||||
export default {
|
||||
name: 'DictionaryDetailEdit',
|
||||
mixins: [
|
||||
WindowResizeHandler
|
||||
@ -44,13 +43,13 @@
|
||||
type: '01',
|
||||
forever: true,
|
||||
lessonId: '',
|
||||
total: 0,
|
||||
}
|
||||
total: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
let form = {
|
||||
const form = {
|
||||
labelWidth: '140px',
|
||||
items: [
|
||||
{ prop: 'userId', label: '用户名称', type: 'select', required: false, options: this.UserList, remote: this.userRemote, loading: this.UserLoading },
|
||||
@ -60,12 +59,12 @@
|
||||
{ prop: 'total', label: '权限个数', type: 'number', required: false }
|
||||
]
|
||||
|
||||
}
|
||||
return form
|
||||
};
|
||||
return form;
|
||||
},
|
||||
|
||||
rules() {
|
||||
let baseRules = {
|
||||
const baseRules = {
|
||||
userId: [
|
||||
{ required: true, message: '请输入用户名称', trigger: 'blur' }
|
||||
],
|
||||
@ -85,15 +84,15 @@
|
||||
if (Number.isInteger(Number(value)) && Number(value) >= 0) {
|
||||
callback();
|
||||
} else {
|
||||
callback(new Error("请输入有效权限个数"));
|
||||
callback(new Error('请输入有效权限个数'));
|
||||
}
|
||||
},
|
||||
trigger: 'blur',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
//清空表单验证提示信息
|
||||
// 清空表单验证提示信息
|
||||
this.$nextTick(function () {
|
||||
this.$refs.dataform.clearValidate();
|
||||
});
|
||||
@ -108,37 +107,37 @@
|
||||
resizeHandler: function () {
|
||||
this.height = this._clientHeight - 130;
|
||||
},
|
||||
convertList(FromList, ToList, ChecktypeFunction) {
|
||||
convertList(FromList, ToList, checktypeFunction) {
|
||||
if (FromList) {
|
||||
ToList.length = 0;
|
||||
FromList.forEach(elem => {
|
||||
if (ChecktypeFunction(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;
|
||||
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 => {
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
|
||||
//清空表单验证提示信息
|
||||
// 清空表单验证提示信息
|
||||
this.$nextTick(function () {
|
||||
this.$refs.dataform.resetForm();
|
||||
});
|
||||
@ -152,8 +151,8 @@
|
||||
getUserInfoByNameOrMobile({ query: query }).then(response => {
|
||||
response.data.forEach(item => {
|
||||
this.UserList.push({ value: item.id, label: item.name });
|
||||
})
|
||||
}).catch(error => {
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox('远程查询错误');
|
||||
});
|
||||
}, 200);
|
||||
@ -162,13 +161,13 @@
|
||||
}
|
||||
},
|
||||
buildModel() {
|
||||
let model = {
|
||||
const model = {
|
||||
userId: this.formModel.userId,
|
||||
lessonId: this.formModel.lessonId,
|
||||
type: this.formModel.type,
|
||||
forever: this.formModel.forever,
|
||||
total: this.formModel.total,
|
||||
}
|
||||
total: this.formModel.total
|
||||
};
|
||||
return model;
|
||||
},
|
||||
create() {
|
||||
@ -177,16 +176,16 @@
|
||||
this.display = 2;
|
||||
this.turnback();
|
||||
this.$message.success('创建成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox("创建失败");
|
||||
}).catch(() => {
|
||||
this.$messageBox('创建失败');
|
||||
});
|
||||
});
|
||||
},
|
||||
turnback() {
|
||||
this.$router.go(-1)
|
||||
}
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
|
@ -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,21 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
|
||||
</QueryListPage>
|
||||
<select-role ref="selectRole" @reloadTable="reloadTable"></select-role>
|
||||
<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',
|
||||
export default {
|
||||
name: 'Author',
|
||||
components: {
|
||||
selectRole,
|
||||
selectRole
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -64,26 +63,26 @@
|
||||
title: '权限类型',
|
||||
prop: 'type',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.convertField(row.type, this.PermissionTypeList, ['value', 'label']) },
|
||||
tagType: (row) => { return '' }
|
||||
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '地图名称',
|
||||
prop: 'mapName',
|
||||
prop: 'mapName'
|
||||
},
|
||||
{
|
||||
title: '地图产品名称',
|
||||
prop: 'mapProductName',
|
||||
prop: 'mapProductName'
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
prop: 'lessonName',
|
||||
prop: 'lessonName'
|
||||
},
|
||||
{
|
||||
title: '公用/专用',
|
||||
prop: 'canDistribute',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList') },
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
|
||||
tagType: (row) => {
|
||||
switch (row.canDistribute) {
|
||||
case true: return 'success';
|
||||
@ -95,7 +94,7 @@
|
||||
title: '是否永久',
|
||||
prop: 'forever',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether') },
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
switch (row.forever) {
|
||||
case true: return 'success';
|
||||
@ -127,13 +126,13 @@
|
||||
{
|
||||
title: '权限归属人',
|
||||
prop: 'ownerName',
|
||||
isShow: () => { return this.$store.state.user.roles.indexOf(superAdmin) != -1; },
|
||||
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']) },
|
||||
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
@ -150,16 +149,16 @@
|
||||
{
|
||||
name: '设置归属人',
|
||||
handleClick: this.handleRoleVest,
|
||||
type: '',
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '打包权限', btnCode: 'employee_insert', handler: this.handlePermissionPack },
|
||||
{ text: '打包权限', btnCode: 'employee_insert', handler: this.handlePermissionPack }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@ -176,17 +175,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];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
handleRoleVest(index, row) {
|
||||
this.$refs.selectRole.doShow(row.id);
|
||||
},
|
||||
@ -197,7 +185,7 @@
|
||||
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;
|
||||
});
|
||||
});
|
||||
@ -206,7 +194,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;
|
||||
});
|
||||
});
|
||||
@ -220,13 +208,13 @@
|
||||
return listUserPermision(params);
|
||||
},
|
||||
handlePermissionPack() {
|
||||
this.$router.push({ path: `${UrlConfig.permission.permissionDraft}` })
|
||||
this.$router.push({ path: `${UrlConfig.permission.permissionDraft}` });
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
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