Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
This commit is contained in:
commit
5a2ff68b15
@ -59,9 +59,9 @@ export function putLessonOffLine(id) {
|
||||
/**
|
||||
* 获取地图产品下的课程列表
|
||||
*/
|
||||
export function getCommodityProductLesson(prdCode) {
|
||||
export function getCommodityProductLesson(prdId) {
|
||||
return request({
|
||||
url: `/api/lesson/${prdCode}/list`,
|
||||
url: `/api/lesson/${prdId}/list`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -69,16 +69,6 @@ export function getPermissionList(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仿真权限列表
|
||||
*/
|
||||
export function queryPermissionSimulation(data) {
|
||||
return request({
|
||||
url: `/api/userPermission/${data.mapId}/${data.prdCode}/simulation`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取大屏权限列表*/
|
||||
export function queryPermissionScreen() {
|
||||
return request({
|
||||
|
@ -9,9 +9,9 @@ export function getPublishMapTree(cityCode) {
|
||||
}
|
||||
|
||||
/** 获取产品详细内容*/
|
||||
export function getProductDetail(prdCode) {
|
||||
export function getProductDetail(prdId) {
|
||||
return request({
|
||||
url: `/api/mapPrd/${prdCode}`,
|
||||
url: `/api/mapPrd/${prdId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@ -72,9 +72,9 @@ export function getCommodityMapProduct(mapId) {
|
||||
/**
|
||||
* 获取地图下的产品详情
|
||||
*/
|
||||
export function getMapProductDetail(prdCode) {
|
||||
export function getMapProductDetail(prdId) {
|
||||
return request({
|
||||
url: `/api/mapPrd/${prdCode}`,
|
||||
url: `/api/mapPrd/${prdId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -69,9 +69,9 @@ export function runDiagramIsStart(group) {
|
||||
* 仿真系统CBTC
|
||||
* @param {*} mapId
|
||||
*/
|
||||
export function simulationNotify({ mapId, code }) {
|
||||
export function simulationNotify({ mapId, mapPrdId }) {
|
||||
return request({
|
||||
url: `/api/simulation/${mapId}/${code}`,
|
||||
url: `/api/simulation/${mapId}/${mapPrdId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -9,15 +9,6 @@ export function getTrainingSystemList(cityCode, params) {
|
||||
});
|
||||
}
|
||||
|
||||
export function querySystemByTypeAndPrdCode(params, prodCode) {
|
||||
/** 根据系统类型和地图产品code查询系统的内容(课程、章节、考试)*/
|
||||
return request({
|
||||
url: `/api/mapSystem/queryByTypeAndPrdCode/${prodCode}`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function getTrainingSystemListByMapId(mapId) {
|
||||
/** 根据mapId去获取其子系统 */
|
||||
return request({
|
||||
|
@ -107,4 +107,10 @@ deviceRender[deviceType.Alarm] = {
|
||||
z: 4
|
||||
};
|
||||
|
||||
deviceRender[deviceType.CheckBox] = {
|
||||
_type: deviceType.CheckBox,
|
||||
zlevel: 10,
|
||||
z: 0
|
||||
};
|
||||
|
||||
export default deviceRender;
|
||||
|
@ -12,7 +12,8 @@ const deviceType = {
|
||||
Key: 'Key',
|
||||
TeleTerminal: 'TeleTerminal',
|
||||
Clock: 'Clock',
|
||||
RotateTip: 'RotateTip'
|
||||
RotateTip: 'RotateTip',
|
||||
CheckBox: 'CheckBox'
|
||||
};
|
||||
|
||||
export default deviceType;
|
||||
|
@ -303,5 +303,25 @@ class IbpPan {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
renderCheckBox(model) {
|
||||
const type = model._type;
|
||||
const code = model.code;
|
||||
const oDevice = this.ibpDevice[code] || deviceFactory(type, model);
|
||||
const nDevice = deviceFactory(type, Object.assign(oDevice.model || {}, model));
|
||||
delete this.ibpDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
if (!model._dispose) {
|
||||
this.ibpDevice[code] = nDevice;
|
||||
this.$painter.add(nDevice);
|
||||
}
|
||||
}
|
||||
deleteCheckBox(code) {
|
||||
const oDevice = this.ibpDevice[code];
|
||||
if (oDevice) {
|
||||
delete this.ibpDevice[code];
|
||||
this.$painter.delete(oDevice);
|
||||
}
|
||||
}
|
||||
}
|
||||
export default IbpPan;
|
||||
|
@ -27,9 +27,14 @@ class MouseController extends Eventful {
|
||||
super();
|
||||
this.$ibp = ibp;
|
||||
this.$zr = ibp.getZr();
|
||||
this.isAllowDragging=ibp.isAllowDragging||false;
|
||||
this.isAllowDragging = ibp.isAllowDragging || false; // 是否在绘图中,仅绘图状态下可拖拽
|
||||
this.events = ibp.getEvents();
|
||||
this._dragging = false;
|
||||
this._dragging = false; // 是否在拖拽状态
|
||||
this.deviceList = [];
|
||||
this.rightClickPoint = {
|
||||
x: 0,
|
||||
y: 0
|
||||
}; // 右键点击坐标
|
||||
this.initHandler(this.$zr);
|
||||
}
|
||||
|
||||
@ -79,31 +84,25 @@ class MouseController extends Eventful {
|
||||
}
|
||||
|
||||
mousedown(e) {
|
||||
if (eventTool.notLeftMouse(e)) {
|
||||
return;
|
||||
}
|
||||
e.event.preventDefault();
|
||||
e.event.stopPropagation();
|
||||
const em = new EventModel(e);
|
||||
this.eventTarget = em.eventTarget;
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('pointer');
|
||||
}
|
||||
this._offsetX = e.offsetX;
|
||||
this._offsetY = e.offsetY;
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
this._dragging = true;
|
||||
if (e.which === 3) {
|
||||
this.handleMouseDownRight(e);
|
||||
} else if (e.which === 1) {
|
||||
this.handleMouseDownLeft(e);
|
||||
} else if (e.which === 2) {
|
||||
this.handleMouseDownWheel(e);
|
||||
}
|
||||
}
|
||||
|
||||
mousemove(e) {
|
||||
if (eventTool.notLeftMouse(e) ||
|
||||
!this._moveOnMouseMove ||
|
||||
!this._dragging || !this.isAllowDragging
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
const oldX = this._x;
|
||||
const oldY = this._y;
|
||||
|
||||
@ -112,32 +111,38 @@ class MouseController extends Eventful {
|
||||
|
||||
this._x = e.offsetX;
|
||||
this._y = e.offsetY;
|
||||
if (this._dragging) {
|
||||
if ((this.eventTarget && this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
return true;
|
||||
} else if (this.isAllowDragging && this.eventTarget) {
|
||||
this.eventTarget.grouper.drift(dx, dy, e);
|
||||
if (e.which === 3) {
|
||||
this.handleMouseMoveRight({x: e.offsetX, y: e.offsetY});
|
||||
} else if (e.which === 1) {
|
||||
this.handleMouseMoveLeft(e, dx, dy, oldX, oldY);
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
mouseup(e) {
|
||||
if (!eventTool.notLeftMouse(e)&&this.isAllowDragging && this.eventTarget) {
|
||||
if (eventTool.notLeftMouse(e) || !this.eventTarget ) {
|
||||
return;
|
||||
}
|
||||
if (this.deviceList.length) {
|
||||
this.deviceList.forEach(item => {
|
||||
item.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||
});
|
||||
this.deviceList = [];
|
||||
this.$ibp.deleteCheckBox('check_box');
|
||||
this.eventTarget = '';
|
||||
this._dragging = false;
|
||||
this.deviceList = [];
|
||||
return;
|
||||
}
|
||||
if (this.isAllowDragging) {
|
||||
this.eventTarget.setModel(e.offsetX - this._offsetX, e.offsetY - this._offsetY);
|
||||
this.eventTarget.dirty();
|
||||
}
|
||||
// debugger;
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||
// console.log('111-------');
|
||||
if (this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('default');
|
||||
}
|
||||
this.eventTarget = '';
|
||||
this._dragging = false;
|
||||
this.deviceList = [];
|
||||
}
|
||||
|
||||
contextmenu(e) {
|
||||
@ -191,6 +196,92 @@ class MouseController extends Eventful {
|
||||
|
||||
return newEm;
|
||||
}
|
||||
/** 处理鼠标右键按下事件 */
|
||||
handleMouseDownRight(e) {
|
||||
this.rightClickPoint.x = e.offsetX;
|
||||
this.rightClickPoint.y = e.offsetY;
|
||||
}
|
||||
/** 处理鼠标左键按下事件 */
|
||||
handleMouseDownLeft(e) {
|
||||
if (this.eventTarget && this.eventTarget._type === deviceType.Background) {
|
||||
this.eventTarget.setCursor('pointer');
|
||||
this.$ibp.deleteCheckBox('check_box');
|
||||
} else if (this.eventTarget && this.eventTarget._type === deviceType.CheckBox) {
|
||||
this.handleBoundingRect(this.eventTarget);
|
||||
} else {
|
||||
this.$ibp.deleteCheckBox('check_box');
|
||||
}
|
||||
}
|
||||
/** 处理滚轮按下事件 */
|
||||
handleMouseDownWheel(e) {
|
||||
this.deviceList = [];
|
||||
Object.values(this.$ibp.ibpDevice).forEach(item => {
|
||||
if (item.instance._type !== deviceType.Background) {
|
||||
this.deviceList.push(item.instance);
|
||||
}
|
||||
});
|
||||
}
|
||||
/** 处理右键拖动事件--- 改变选中区域大小 */
|
||||
handleMouseMoveRight(point2) {
|
||||
const point1 = this.rightClickPoint;
|
||||
const x = Math.min(point1.x, point2.x) + this.$ibp.$options.offsetX;
|
||||
const y = Math.min(point1.y, point2.y) + this.$ibp.$options.offsetY;
|
||||
const width = Math.abs(point1.x - point2.x);
|
||||
const height = Math.abs(point1.y - point2.y);
|
||||
this.$ibp.renderCheckBox({code: 'check_box', _type: 'CheckBox', point: {x: x, y: y}, width: width, height: height });
|
||||
}
|
||||
/** 处理左键拖动事件--- 图形移动 */
|
||||
handleMouseMoveLeft(e, dx, dy, oldX, oldY) {
|
||||
if (!this._moveOnMouseMove || !this._dragging || !this.isAllowDragging) {
|
||||
return;
|
||||
}
|
||||
if (this.deviceList.length) {
|
||||
this.deviceList.forEach(item => {
|
||||
item.grouper.drift(dx, dy, e);
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this._dragging) {
|
||||
if ((this.eventTarget && this.eventTarget._type === deviceType.Background) || !this.isAllowDragging) {
|
||||
this._preventDefaultMouseMove && eventTool.stop(e.event);
|
||||
this.trigger(this.events.__Pan, { dx, dy, oldX, oldY, newX: this._x, newY: this._y });
|
||||
return true;
|
||||
} else if (this.isAllowDragging && this.eventTarget) {
|
||||
this.eventTarget.grouper.drift(dx, dy, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
/** 通过包围盒筛选选中区域的元素 */
|
||||
handleBoundingRect(eventTarget) {
|
||||
this.deviceList = [];
|
||||
let boundingRect = eventTarget.grouper.getBoundingRect();
|
||||
boundingRect = this.createFakeBoundingRect(eventTarget, boundingRect);
|
||||
const deviceList = Object.values(this.$ibp.ibpDevice);
|
||||
const includeDeviceList = [];
|
||||
deviceList.forEach( item =>{
|
||||
if (item.instance._type !== deviceType.Background) {
|
||||
let deviceBoundingRect = item.instance.grouper.getBoundingRect();
|
||||
deviceBoundingRect = this.createFakeBoundingRect(item.instance, deviceBoundingRect);
|
||||
if (this.whetherInclude(boundingRect, deviceBoundingRect )) {
|
||||
includeDeviceList.push(item.instance);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.deviceList = includeDeviceList;
|
||||
}
|
||||
/** 创建假包围盒对象 */
|
||||
createFakeBoundingRect(instance, boundingRect) {
|
||||
return {
|
||||
x1: instance.model.point.x + boundingRect.x,
|
||||
y1: instance.model.point.y + boundingRect.y,
|
||||
x2: instance.model.point.x + boundingRect.width,
|
||||
y2: instance.model.point.y + boundingRect.height
|
||||
};
|
||||
}
|
||||
/** 判断元素包围盒是否在选中区域 */
|
||||
whetherInclude(boundingRect1, boundingRect2) {
|
||||
return boundingRect1.x1 <= boundingRect2.x1 && boundingRect1.y1 <= boundingRect2.y1 && boundingRect1.x2 >= boundingRect2.x2 && boundingRect1.y2 >= boundingRect2.y2;
|
||||
}
|
||||
}
|
||||
|
||||
export default MouseController;
|
||||
|
46
src/ibp/shape/checkBox.js
Normal file
46
src/ibp/shape/checkBox.js
Normal file
@ -0,0 +1,46 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
|
||||
export default class checkBox extends Group {
|
||||
constructor(device) {
|
||||
super();
|
||||
this.model = device.model;
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.grouper = new Group({
|
||||
id: model.code,
|
||||
position: [model.point.x, model.point.y]
|
||||
});
|
||||
this.box = new Rect({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
draggable: false,
|
||||
shape: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: this.model.width,
|
||||
height: this.model.height
|
||||
},
|
||||
style: {
|
||||
fill: 'rgb(135,206,250,0.2)'
|
||||
}
|
||||
});
|
||||
this.grouper.add(this.box);
|
||||
this.add(this.grouper);
|
||||
}
|
||||
setModel(dx, dy) {
|
||||
this.model.point.x += dx;
|
||||
this.model.point.y += dy;
|
||||
}
|
||||
setSize(width, height) {
|
||||
this.model.width = width;
|
||||
this.model.height = height;
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ import Key from './key';
|
||||
import TeleTerminal from './teleTerminal';
|
||||
import Clock from './clock';
|
||||
import RotateTip from './rotateTip';
|
||||
import CheckBox from './checkBox';
|
||||
|
||||
const ibpShape = {};
|
||||
ibpShape[deviceType.Arrow] = Arrow;
|
||||
@ -29,6 +30,7 @@ ibpShape[deviceType.Key] = Key;
|
||||
ibpShape[deviceType.TeleTerminal] = TeleTerminal;
|
||||
ibpShape[deviceType.Clock] = Clock;
|
||||
ibpShape[deviceType.RotateTip] = RotateTip;
|
||||
ibpShape[deviceType.CheckBox] = CheckBox;
|
||||
|
||||
function shapefactory(device, ibp) {
|
||||
const type = device.model._type;
|
||||
|
@ -8,6 +8,7 @@ export default class ibpLine extends Group {
|
||||
this._type = device.model._type;
|
||||
this._code = device.model.code;
|
||||
this.zlevel = device.model.zlevel;
|
||||
this.model.point = this.model.point1;
|
||||
this.z = device.model.z;
|
||||
this.create();
|
||||
}
|
||||
|
@ -189,6 +189,7 @@ export default {
|
||||
this.visible = true;
|
||||
const token = getToken() || getDesignToken();
|
||||
getInfo(token).then(response => {
|
||||
debugger;
|
||||
const user = response.data;
|
||||
this.userInfo = {
|
||||
name: user.name,
|
||||
|
@ -218,6 +218,7 @@ function handleOperation(state, models) {
|
||||
state.stepData.pop();
|
||||
}
|
||||
state.stepData.unshift(list);
|
||||
state.recoverStepData = [];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -143,7 +143,7 @@ export default {
|
||||
cityCode: row.cityCode,
|
||||
mapId: row.mapId,
|
||||
name: row.name,
|
||||
prdCode: row.prdCode
|
||||
prdId: row.prdId
|
||||
};
|
||||
adminPublishLesson(params, row.id).then(response => {
|
||||
this.loading = false;
|
||||
|
@ -13,8 +13,7 @@
|
||||
export default {
|
||||
name: 'ScriptOperate',
|
||||
props: {
|
||||
title:{type:String, required:true},
|
||||
type:{type:String, required:true}
|
||||
title:{type:String, required:true}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
@ -87,7 +87,7 @@ export default {
|
||||
endTime: '',
|
||||
date: ''
|
||||
},
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
mapId: '',
|
||||
numberMessage: '',
|
||||
PermissionType: '',
|
||||
@ -149,7 +149,7 @@ export default {
|
||||
changeSelectDate() {
|
||||
if (this.formModel.date) {
|
||||
this.isLoading = true;
|
||||
const data = {mapId:this.mapId, proCode:this.prdCode, startTime:this.formModel.date[0], endTime:this.formModel.date[1], type:this.PermissionType};
|
||||
const data = {mapId:this.mapId, prdId:this.prdId, startTime:this.formModel.date[0], endTime:this.formModel.date[1], type:this.PermissionType};
|
||||
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
|
||||
data.lessonId = this.formModel.lessonId;
|
||||
}
|
||||
@ -175,7 +175,7 @@ export default {
|
||||
if (data) {
|
||||
this.formModel.lessonId = data.id;
|
||||
this.formModel.lessonName = data.name;
|
||||
this.prdCode = data.prdCode;
|
||||
this.prdId = data.prdId;
|
||||
this.mapId = data.mapId;
|
||||
this.PermissionType = data.PermissionType;
|
||||
this.setTotalMax();
|
||||
|
@ -87,7 +87,7 @@ export default {
|
||||
endTime: '',
|
||||
date: ''
|
||||
},
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
mapId: '',
|
||||
numberMessage: '',
|
||||
PermissionType: '',
|
||||
@ -149,7 +149,7 @@ export default {
|
||||
changeSelectDate() {
|
||||
if (this.formModel.date) {
|
||||
this.isLoading = true;
|
||||
const data = {mapId:this.mapId, proCode:this.prdCode, startTime:`${this.formModel.date[0]} 00:00:00`, endTime:`${this.formModel.date[1]} 23:59:59`, type:this.PermissionType};
|
||||
const data = {mapId:this.mapId, prdId:this.prdId, startTime:`${this.formModel.date[0]} 00:00:00`, endTime:`${this.formModel.date[1]} 23:59:59`, type:this.PermissionType};
|
||||
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
|
||||
data.lessonId = this.formModel.lessonId;
|
||||
}
|
||||
@ -175,7 +175,7 @@ export default {
|
||||
if (data) {
|
||||
this.formModel.lessonId = data.id;
|
||||
this.formModel.lessonName = data.name;
|
||||
this.prdCode = data.prdCode;
|
||||
this.prdId = data.prdId;
|
||||
this.mapId = data.mapId;
|
||||
this.PermissionType = data.PermissionType;
|
||||
this.setTotalMax();
|
||||
@ -219,35 +219,6 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
// this.$refs.dataform.validateForm(() => {
|
||||
// const model = {
|
||||
// startTime: `${this.formModel.date[0]} 00:00:00`,
|
||||
// endTime: `${this.formModel.date[1]} 23:59:59`,
|
||||
// amount: this.formModel.total,
|
||||
// permissionType: this.PermissionType
|
||||
// };
|
||||
// if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
|
||||
// model['lessonId'] = this.formModel.lessonId;
|
||||
// model['mapId'] = this.mapId;
|
||||
// model['prdCode'] = this.prdCode;
|
||||
// } else if (this.PermissionType == PermissionType.SIMULATION) {
|
||||
// model['mapId'] = this.mapId;
|
||||
// model['prdCode'] = this.prdCode;
|
||||
// }
|
||||
// // 转增
|
||||
// permissionTurnAdd(model).then(response => {
|
||||
// const url = response.data;
|
||||
// this.$emit('QrCodeShow', {
|
||||
// url: url,
|
||||
// title: this.$t('global.transferQrcode')
|
||||
// });
|
||||
// this.dialogVisible = false;
|
||||
// this.$emit('initLoadPage');
|
||||
// this.handleClose();
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(this.$t('error.getTransferQrcodeFailed'));
|
||||
// });
|
||||
// });
|
||||
},
|
||||
close() {
|
||||
this.dialogVisible = false;
|
||||
|
@ -101,7 +101,7 @@ export default {
|
||||
};
|
||||
if (this.$route.query.permissionType != '04') {
|
||||
data['mapId'] = this.$route.query.mapId;
|
||||
data['prdCode'] = this.$route.query.prdCode;
|
||||
data['prdId'] = this.$route.query.prdId;
|
||||
data['lessonId'] = this.$route.query.lessonId;
|
||||
}
|
||||
getCommodityDetailByParams(data).then(response => {
|
||||
@ -127,7 +127,7 @@ export default {
|
||||
this.active = 0;
|
||||
const type = this.$route.query.permissionType;
|
||||
if (type === PermissionType.LESSON) {
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.query.subSystem}`, query: {lessonId: this.$route.query.lessonId, mapId: this.$route.query.mapId, prdCode: this.$route.query.prdCode}});
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.query.subSystem}`, query: {lessonId: this.$route.query.lessonId, mapId: this.$route.query.mapId, prdId: this.$route.query.prdId}});
|
||||
} else if (type === PermissionType.EXAM) {
|
||||
this.$router.replace({ path: `${UrlConfig.trainingPlatform.course}/${this.$route.query.subSystem}`});
|
||||
} else if (type === PermissionType.SCREEN) {
|
||||
|
@ -48,7 +48,7 @@ export default {
|
||||
loading: true,
|
||||
buttonLoading: false,
|
||||
currentLessonId: '',
|
||||
currentPrdCode: '',
|
||||
currentPrdId: '',
|
||||
productList: [],
|
||||
courseModel: {
|
||||
id: '',
|
||||
@ -57,7 +57,7 @@ export default {
|
||||
skinCode: '',
|
||||
remarks: '',
|
||||
prdType: '',
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
pmsList: []
|
||||
},
|
||||
jointShow: false,
|
||||
@ -108,11 +108,11 @@ export default {
|
||||
skinCode: resp.data.mapPrd.skinCode,
|
||||
remarks: resp.data.mapPrd.remarks,
|
||||
prdType: resp.data.mapPrd.prdType,
|
||||
prdCode: resp.data.mapPrd.code,
|
||||
prdId: resp.data.mapPrd.id,
|
||||
pmsList: resp.data.permissionList || [],
|
||||
PermissionType: PermissionType.SIMULATION
|
||||
};
|
||||
this.currentPrdCode = resp.data.mapPrd.code;
|
||||
this.currentPrdId = resp.data.mapPrd.id;
|
||||
if (resp.data.mapPrd.prdType === '03') {
|
||||
this.getJointTrainingList();
|
||||
}
|
||||
@ -121,7 +121,7 @@ export default {
|
||||
this.tryUser = 1;
|
||||
const paras = {
|
||||
mapId: this.mapId,
|
||||
prdCode: this.courseModel.prdCode,
|
||||
prdId: this.courseModel.prdId,
|
||||
permissionType: PermissionType.SIMULATION
|
||||
};
|
||||
|
||||
@ -166,7 +166,7 @@ export default {
|
||||
this.buttonLoading = true;
|
||||
const param = {
|
||||
mapId: Number(this.mapId),
|
||||
prdCode: this.courseModel.prdCode
|
||||
prdId: this.courseModel.prdId
|
||||
};
|
||||
const res = await postCreateRoom(param);
|
||||
if (res && res.code == 200) {
|
||||
@ -212,9 +212,9 @@ export default {
|
||||
},
|
||||
jumpScheduling() {
|
||||
this.buttonLoading = true;
|
||||
const data = { mapId: this.courseModel.mapId, code: this.currentPrdCode };
|
||||
const data = { mapId: this.courseModel.mapId, prdId: this.currentPrdId };
|
||||
schedulingNotify(data).then(resp => {
|
||||
const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser };
|
||||
const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdId, goodsId: this.goodsId, try: this.tryUser };
|
||||
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
@ -223,10 +223,10 @@ export default {
|
||||
});
|
||||
},
|
||||
jump() {
|
||||
const data = { mapId: this.courseModel.mapId, code: this.currentPrdCode };
|
||||
const data = { mapId: this.courseModel.mapId, mapPrdId: this.currentPrdId };
|
||||
this.buttonLoading = true;
|
||||
simulationNotify(data).then(resp => {
|
||||
const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser };
|
||||
const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdId, goodsId: this.goodsId, try: this.tryUser };
|
||||
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
}).catch(error => {
|
||||
@ -238,7 +238,7 @@ export default {
|
||||
this.buttonLoading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
|
||||
query: { permissionType: PermissionType.SIMULATION, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
|
||||
query: { permissionType: PermissionType.SIMULATION, prdId: this.courseModel.prdId, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
|
||||
});
|
||||
},
|
||||
transfer() {
|
||||
|
@ -396,7 +396,7 @@ export default {
|
||||
const resp = await getTrainingDetail(this.trainingId);
|
||||
if (resp && resp.code == 200) {
|
||||
const detail = resp.data;
|
||||
const rest = await getProductDetail(detail.prdCode);
|
||||
const rest = await getProductDetail(detail.prdId);
|
||||
if (rest && rest.code == 200) {
|
||||
const data = rest.data;
|
||||
await this.$store.dispatch('training/setPrdType', data.prdType);
|
||||
|
@ -388,7 +388,7 @@ export default {
|
||||
const resp = await getTrainingDetail(this.trainingId);
|
||||
if (resp && resp.code == 200) {
|
||||
const detail = resp.data;
|
||||
const rest = await getProductDetail(detail.prdCode);
|
||||
const rest = await getProductDetail(detail.prdId);
|
||||
if (rest && rest.code == 200) {
|
||||
const data = rest.data;
|
||||
await this.$store.dispatch('training/setPrdType', data.prdType);
|
||||
|
@ -130,7 +130,7 @@ export default {
|
||||
loadInitData() {
|
||||
const data = {
|
||||
mapId: this.$route.query.mapId,
|
||||
prdCode: this.$route.query.code,
|
||||
prdId: this.$route.query.code,
|
||||
permissionType: PermissionType.SIMULATION
|
||||
};
|
||||
getGoodsTryUse(data).then(res => {
|
||||
|
@ -122,7 +122,7 @@ export default {
|
||||
id: resp.data.id,
|
||||
name: resp.data.name,
|
||||
pmsList: resp.data.permissionList || [],
|
||||
prdCode: resp.data.prdCode,
|
||||
prdId: resp.data.prdId,
|
||||
mapId: resp.data.mapId,
|
||||
PermissionType: PermissionType.EXAM,
|
||||
treeList: resp.data.examDefinitionList
|
||||
@ -140,7 +140,7 @@ export default {
|
||||
this.loading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`,
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.courseModel.id, prdId: this.courseModel.prdId, mapId: this.courseModel.mapId, subSystem: this.$route.params.subSystem }
|
||||
});
|
||||
},
|
||||
checkCourse() {
|
||||
|
@ -183,7 +183,7 @@ export default {
|
||||
getPublishLessonDetail({ id: this.examDetails.lessonId }).then((res) => {
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.examDetails.lessonId}`,
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdCode: res.data.prdCode, mapId: res.data.mapId }
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.examDetails.lessonId, prdId: res.data.prdId, mapId: res.data.mapId }
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainCourseDetailsFailed'));
|
||||
|
@ -98,7 +98,7 @@ export default {
|
||||
},
|
||||
detail: {
|
||||
mapId: '',
|
||||
prdCode: ''
|
||||
prdId: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
@ -175,7 +175,7 @@ export default {
|
||||
loadTrainingList(data) {
|
||||
getLessonDetail({ id: data.lessonId }).then(resp => {
|
||||
this.detail.mapId = resp.data.mapId;
|
||||
this.detail.prdCode = resp.data.prdCode;
|
||||
this.detail.prdId = resp.data.prdId;
|
||||
this.chapterModel.lessonId = resp.data.id;
|
||||
this.chapterModel.lessonName = resp.data.name;
|
||||
if (data.type === 'Chapter') {
|
||||
|
@ -92,9 +92,9 @@ export default {
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.product'),
|
||||
prop: 'prdCode',
|
||||
prop: 'prdId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.prdId, this.prdTypeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
@ -147,7 +147,7 @@ export default {
|
||||
},
|
||||
async queryFunction(params) {
|
||||
params['mapId'] = this.detail.mapId;
|
||||
params['prdCode'] = this.detail.prdCode;
|
||||
params['prdId'] = this.detail.prdId;
|
||||
const res = await pageQueryTraining(params);
|
||||
this.trainings.forEach(ele => {
|
||||
res.data.list.forEach(item => {
|
||||
|
@ -20,13 +20,13 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.associatedProducts')" prop="prdCode">
|
||||
<el-select v-model="courseModel.prdCode" :placeholder="$t('rules.pleaseSelect')" :disabled="isEdit">
|
||||
<el-form-item :label="this.$t('lesson.associatedProducts')" prop="prdId">
|
||||
<el-select v-model="courseModel.prdId" :placeholder="$t('rules.pleaseSelect')" :disabled="isEdit">
|
||||
<el-option
|
||||
v-for="(item,index) in productList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -74,7 +74,7 @@ export default {
|
||||
mapIdList: [],
|
||||
courseModel: {
|
||||
id: '',
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
product: [],
|
||||
mapId: '',
|
||||
name: '',
|
||||
@ -94,7 +94,7 @@ export default {
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
|
||||
],
|
||||
prdCode: [
|
||||
prdId: [
|
||||
{ required: true, message: this.$t('rules.selectAssociatedProduct'), trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
@ -133,7 +133,7 @@ export default {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
const model = {
|
||||
prdCode: this.courseModel.prdCode,
|
||||
prdId: this.courseModel.prdId,
|
||||
name: this.courseModel.name,
|
||||
mapId: this.courseModel.mapId,
|
||||
remarks: this.courseModel.remarks
|
||||
@ -153,7 +153,7 @@ export default {
|
||||
if (valid) {
|
||||
const model = {
|
||||
id: this.courseModel.id,
|
||||
prdCode: this.courseModel.prdCode,
|
||||
prdId: this.courseModel.prdId,
|
||||
name: this.courseModel.name,
|
||||
mapId: this.courseModel.mapId,
|
||||
remarks: this.courseModel.remarks
|
||||
@ -174,7 +174,7 @@ export default {
|
||||
this.courseModel = {
|
||||
id: data.id,
|
||||
mapId: this.$route.query.mapId,
|
||||
prdCode: data.prdCode,
|
||||
prdId: data.prdId,
|
||||
name: data.name,
|
||||
remarks: data.remarks
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ export default {
|
||||
id: '',
|
||||
name: '',
|
||||
mapId: '',
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
cityCode: ''
|
||||
}
|
||||
};
|
||||
@ -68,7 +68,7 @@ export default {
|
||||
id: model.id,
|
||||
name: model.name,
|
||||
mapId: this.$route.params.mapId,
|
||||
prdCode: model.prdCode,
|
||||
prdId: model.prdId,
|
||||
cityCode: model.cityCode
|
||||
};
|
||||
this.dialogShow = true;
|
||||
|
@ -15,13 +15,13 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode">
|
||||
<el-select v-model="operateModel.prdCode" style="width: 300px" @change="prdChange">
|
||||
<el-form-item :label="this.$t('lesson.productType')" prop="prdId">
|
||||
<el-select v-model="operateModel.prdId" style="width: 300px" @change="prdChange">
|
||||
<el-option
|
||||
v-for="option in productList"
|
||||
:key="option.code"
|
||||
:key="option.id"
|
||||
:label="option.name"
|
||||
:value="option.code"
|
||||
:value="option.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -147,7 +147,7 @@ export default {
|
||||
name: '',
|
||||
type: '',
|
||||
mapId: this.$route.query.mapId,
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
operateType: [],
|
||||
maxDuration: 0,
|
||||
minDuration: 0,
|
||||
@ -167,7 +167,7 @@ export default {
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'change' }
|
||||
],
|
||||
prdCode: [
|
||||
prdId: [
|
||||
{ required: true, message: this.$t('rules.enterProductType'), trigger: 'change' }
|
||||
],
|
||||
type: [
|
||||
@ -212,7 +212,7 @@ export default {
|
||||
this.loading = false;
|
||||
},
|
||||
mapIdChoose(mapId) {
|
||||
this.operateModel.prdCode = '';
|
||||
this.operateModel.prdId = '';
|
||||
this.productList = [];
|
||||
if (mapId) {
|
||||
getCommodityMapProduct(mapId).then((response) => {
|
||||
@ -221,12 +221,12 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
async prdChange(prdCode) {
|
||||
async prdChange(prdId) {
|
||||
this.trainingTypeMap = {};
|
||||
this.operateModel.operateType = [];
|
||||
|
||||
const mapIdObj = this.mapIdList.find(elem => { return elem.id === this.operateModel.mapId; }) || {};
|
||||
const prdTypeObj = this.productList.find(elem => { return elem.code === prdCode; }) || {};
|
||||
const prdTypeObj = this.productList.find(elem => { return elem.id === prdId; }) || {};
|
||||
const res = await getOperateTrainingList({ mapId: mapIdObj.id, productType: prdTypeObj.prdType });
|
||||
if (res && res.code == 200) {
|
||||
this.trainingTypeLists = res.data;
|
||||
@ -280,7 +280,7 @@ export default {
|
||||
const data = {
|
||||
mapId: this.operateModel.mapId,
|
||||
name: this.operateModel.name,
|
||||
prdCode: this.operateModel.prdCode,
|
||||
prdId: this.operateModel.prdId,
|
||||
trainingType: this.operateModel.type,
|
||||
operateType: this.operateModel.operateType
|
||||
};
|
||||
@ -298,7 +298,7 @@ export default {
|
||||
const data = {
|
||||
mapId: this.operateModel.mapId,
|
||||
name: this.operateModel.name,
|
||||
prdCode: this.operateModel.prdCode,
|
||||
prdId: this.operateModel.prdId,
|
||||
trainingType: this.operateModel.type,
|
||||
operateType: this.operateModel.operateType,
|
||||
remarks: this.operateModel.remarks,
|
||||
@ -319,7 +319,7 @@ export default {
|
||||
const data = {
|
||||
mapId: this.operateModel.mapId,
|
||||
name: this.operateModel.name,
|
||||
prdCode: this.operateModel.prdCode,
|
||||
prdId: this.operateModel.prdId,
|
||||
trainingType: `${this.operateModel.type}`,
|
||||
operateType: `${this.operateModel.operateType.join(',')}`
|
||||
};
|
||||
@ -336,7 +336,7 @@ export default {
|
||||
const data = {
|
||||
name: this.operateModel.name,
|
||||
type: this.operateModel.type,
|
||||
prdCode: this.operateModel.prdCode,
|
||||
prdId: this.operateModel.prdId,
|
||||
mapId: this.operateModel.mapId,
|
||||
operateType: this.operateModel.operateType[0],
|
||||
minDuration: this.operateModel.minDuration,
|
||||
|
@ -44,7 +44,7 @@ export default {
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
queryObject: {
|
||||
prdCode: {
|
||||
prdId: {
|
||||
type: 'select',
|
||||
label: this.$t('lesson.product'),
|
||||
change: this.prdChoose,
|
||||
@ -91,9 +91,9 @@ export default {
|
||||
},
|
||||
{
|
||||
title: this.$t('lesson.product'),
|
||||
prop: 'prdCode',
|
||||
prop: 'prdId',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); },
|
||||
columnValue: (row) => { return this.$convertField(row.prdId, this.prdTypeList, ['code', 'name']); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
@ -155,13 +155,13 @@ export default {
|
||||
await this.loadInitData();
|
||||
const json = localStore.get(this.$route.path);
|
||||
json.type = '';
|
||||
json.prdCode = '';
|
||||
json.prdId = '';
|
||||
json.operateType = '';
|
||||
},
|
||||
methods: {
|
||||
async loadInitData() {
|
||||
this.mapIdList = [];
|
||||
this.queryForm.queryObject.prdCode.config.data = [];
|
||||
this.queryForm.queryObject.prdId.config.data = [];
|
||||
listPublishMap().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
@ -171,7 +171,7 @@ export default {
|
||||
productList.forEach(elem => {
|
||||
// 过滤综合演练产品
|
||||
if (elem.prdType != '03') {
|
||||
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
this.queryForm.queryObject.prdId.config.data.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ export default {
|
||||
permissionType: '',
|
||||
mapId: '',
|
||||
lessonId: '',
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
date: '',
|
||||
amount: 0,
|
||||
ownerId: '',
|
||||
@ -67,7 +67,7 @@ export default {
|
||||
items: [
|
||||
{ prop: 'permissionType', label: this.$t('permission.permissionType'), type: 'select', required: false, disabled: !this.isAdd, options: this.permissionTypeList, change: true, onChange: this.permissionTypeChange },
|
||||
{ prop: 'mapId', label: this.$t('permission.mapName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMap, options: this.publishMapList, change: true, onChange: this.mapChange },
|
||||
{ prop: 'prdCode', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
|
||||
{ prop: 'prdId', label: this.$t('permission.mapProductName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowMapProduct, options: this.mapProductList, change: true, onChange: this.mapProductChange },
|
||||
{ prop: 'lessonId', label: this.$t('permission.lessonName'), type: 'select', required: false, disabled: !this.isAdd, show: this.isShowLesson, options: this.filterPublisLessonList },
|
||||
{ prop: 'roleName', label: this.$t('permission.belonger'), type: 'complete', required: false, disabled: !this.isAdd && this.isAdministrator, show: this.isShowRole, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' },
|
||||
{ prop: 'date', label: this.$t('permission.selectDate'), type: 'daterange', required: false, viewFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss' },
|
||||
@ -85,7 +85,7 @@ export default {
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('rules.selectMapName'), trigger: 'change' }
|
||||
],
|
||||
prdCode: [
|
||||
prdId: [
|
||||
{ required: true, message: this.$t('rules.selectMapProductName'), trigger: 'change' }
|
||||
],
|
||||
lessonId: [
|
||||
@ -158,9 +158,9 @@ export default {
|
||||
}
|
||||
|
||||
var validator = {};
|
||||
validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
|
||||
validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdCode; };
|
||||
validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdCode; };
|
||||
validator[PermissionType.LESSON] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdId; };
|
||||
validator[PermissionType.EXAM] = () => { return this.formModel.lessonId && this.formModel.mapId && this.formModel.prdId; };
|
||||
validator[PermissionType.SIMULATION] = () => { return this.formModel.mapId && this.formModel.prdId; };
|
||||
validator[PermissionType.SCREEN] = () => { return true; };
|
||||
|
||||
if (endTime && startTime && this.formModel.permissionType && validator[this.formModel.permissionType]()) {
|
||||
@ -175,10 +175,10 @@ export default {
|
||||
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
|
||||
model['lessonId'] = this.formModel.lessonId;
|
||||
model['mapId'] = this.formModel.mapId;
|
||||
model['prdCode'] = this.formModel.prdCode;
|
||||
model['prdId'] = this.formModel.prdId;
|
||||
} else if (this.formModel.permissionType == PermissionType.SIMULATION) {
|
||||
model['mapId'] = this.formModel.mapId;
|
||||
model['prdCode'] = this.formModel.prdCode;
|
||||
model['prdId'] = this.formModel.prdId;
|
||||
}
|
||||
|
||||
getTotalRemains(model).then(response => {
|
||||
@ -200,23 +200,23 @@ export default {
|
||||
},
|
||||
permissionTypeChange() {
|
||||
this.formModel.mapId = '';
|
||||
this.formModel.prdCode = '';
|
||||
this.formModel.prdId = '';
|
||||
this.formModel.lessonId = '';
|
||||
},
|
||||
mapChange(mapId) {
|
||||
this.formModel.prdCode = '';
|
||||
this.formModel.prdId = '';
|
||||
this.formModel.lessonId = '';
|
||||
this.mapProductList = [];
|
||||
getCommodityMapProduct(mapId).then(rest => {
|
||||
const list = rest.data || [];
|
||||
this.mapProductList = list.map(elem => {
|
||||
return { value: elem.code, label: elem.name };
|
||||
return { value: elem.id, label: elem.name };
|
||||
});
|
||||
});
|
||||
},
|
||||
mapProductChange(prdCode) {
|
||||
mapProductChange(prdId) {
|
||||
this.formModel.lessonId = '';
|
||||
this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdCode == this.formModel.prdCode; });
|
||||
this.filterPublisLessonList = this.publisLessonList.filter(elem => { return elem.mapId == this.formModel.mapId && elem.prdId == this.formModel.prdId; });
|
||||
},
|
||||
// 搜索查询input
|
||||
async querySearchAsync(queryString, cb) {
|
||||
@ -256,7 +256,7 @@ export default {
|
||||
permissionType: model.permissionType,
|
||||
mapId: model.mapId,
|
||||
lessonId: model.lessonId,
|
||||
prdCode: model.prdCode,
|
||||
prdId: model.prdId,
|
||||
date: [model.startTime, model.endTime],
|
||||
amount: model.amount,
|
||||
ownerId: this.formModel.ownerId,
|
||||
@ -278,7 +278,7 @@ export default {
|
||||
permissionType: this.formModel.permissionType,
|
||||
mapId: this.isShowMap ? this.formModel.mapId : '',
|
||||
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
|
||||
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
|
||||
prdId: this.isShowMapProduct ? this.formModel.prdId : '',
|
||||
startTime: this.formModel.date[0],
|
||||
endTime: this.formModel.date[1],
|
||||
amount: this.formModel.amount,
|
||||
@ -291,7 +291,7 @@ export default {
|
||||
permissionType: this.formModel.permissionType,
|
||||
mapId: this.isShowMap ? this.formModel.mapId : '',
|
||||
lessonId: this.isShowLesson ? this.formModel.lessonId : '',
|
||||
prdCode: this.isShowMapProduct ? this.formModel.prdCode : '',
|
||||
prdId: this.isShowMapProduct ? this.formModel.prdId : '',
|
||||
startTime: this.formModel.date[0],
|
||||
endTime: this.formModel.date[1],
|
||||
amount: this.formModel.amount,
|
||||
|
@ -26,7 +26,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="mapProductCode" :label="$t('permission.mapProductName')" width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ computedName(mapProductList, scope.row.prdCode) }}
|
||||
{{ computedName(mapProductList, scope.row.prdId) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lessonId" :label="$t('permission.lessonName')">
|
||||
@ -171,7 +171,7 @@ export default {
|
||||
getPublishLessonList().then(response => {
|
||||
const list = response.data || [];
|
||||
this.PublisLessonList = list.map(elem => {
|
||||
return { value: elem.id, label: elem.name, mapId: elem.mapId, prdCode: elem.prdCode };
|
||||
return { value: elem.id, label: elem.name, mapId: elem.mapId, prdId: elem.prdId };
|
||||
});
|
||||
});
|
||||
},
|
||||
@ -194,7 +194,7 @@ export default {
|
||||
const index = this.ruleList.findIndex(elem => {
|
||||
return item.mapId == elem.mapId &&
|
||||
item.lessonId == elem.lessonId &&
|
||||
item.prdCode == elem.prdCode &&
|
||||
item.prdId == elem.prdId &&
|
||||
item.permissionType == elem.permissionType;
|
||||
});
|
||||
getCommodityMapProduct(item.mapId).then(rest => {
|
||||
|
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<map-select ref="map" @confirm="handleGenerateEveryDay" />
|
||||
<copy-plan ref="copyPlan" @confirm="handleCopyRunPlan" />
|
||||
</div>
|
||||
</template>
|
||||
@ -11,13 +10,11 @@ import { superAdmin } from '@/router';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { runPlanTemplateList, deleteRunPlanTemplate, generateCommonRunPlanEveryDay, postRunPlanTemplate } from '@/api/runplan';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import MapSelect from './mapSelect';
|
||||
import CopyPlan from './copyPlan.vue';
|
||||
|
||||
export default {
|
||||
name: 'RunPlanTemplate',
|
||||
components: {
|
||||
MapSelect,
|
||||
CopyPlan
|
||||
},
|
||||
data() {
|
||||
@ -132,16 +129,16 @@ export default {
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
// 选择皮肤关联的地图
|
||||
// 选择地图
|
||||
handleMapSelect(index, row) {
|
||||
this.$refs.map.doShow(row);
|
||||
this.handleGenerateEveryDay(row.id, row.mapId);
|
||||
},
|
||||
// 复制运行图
|
||||
handleCopyPlan(index, row) {
|
||||
this.$refs.copyPlan.doShow(row);
|
||||
},
|
||||
// 生成每日运行图
|
||||
handleGenerateEveryDay({planId, mapId}) {
|
||||
handleGenerateEveryDay(planId, mapId) {
|
||||
this.$confirm(this.$t('publish.wellGenerateEveryRunPlan'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
@ -149,7 +146,6 @@ export default {
|
||||
}).then(() => {
|
||||
generateCommonRunPlanEveryDay(planId, {mapId}).then(response => {
|
||||
this.reloadTable();
|
||||
this.$refs.map.doClose();
|
||||
this.$message.success(this.$t('publish.createCommonSuccess'));
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
|
@ -1,69 +0,0 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="show" width="30%" :before-close="doClose">
|
||||
<el-form ref="form" :model="formMdoel" :rules="rules" label-width="140px">
|
||||
<el-form-item :label="$t('publish.selectMap')" prop="mapId">
|
||||
<el-select v-model="formMdoel.mapId">
|
||||
<el-option
|
||||
v-for="item in mapList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleCofirm">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishMapListByLineCode } from '@/api/jmap/map';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
mapList: [],
|
||||
formMdoel: {
|
||||
planId: 0,
|
||||
mapId: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.$t('publish.selectMap');
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
mapId: [
|
||||
{ required: true, message: this.$t('rules.mapInput'), trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(row) {
|
||||
this.formMdoel.planId = row.id;
|
||||
this.formMdoel.mapId = '';
|
||||
this.show = true;
|
||||
getPublishMapListByLineCode(row.skinCode).then(resp => {
|
||||
this.mapList = resp.data;
|
||||
});
|
||||
},
|
||||
doClose(done) {
|
||||
this.show = false;
|
||||
},
|
||||
handleCofirm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$emit('confirm', this.formMdoel);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -16,13 +16,6 @@
|
||||
</template>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('map.productCode') + ':'"
|
||||
prop="code"
|
||||
:rules="node && node.data.type ==='Map' ? baseRules.code:{}"
|
||||
>
|
||||
<el-input v-model="addModel.code" :disabled="codeDisabled" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.productName') + ':'" prop="name" :rules="baseRules.name">
|
||||
<el-input v-model="addModel.name" />
|
||||
</el-form-item>
|
||||
@ -79,7 +72,6 @@ export default {
|
||||
skinCode: '',
|
||||
name: '',
|
||||
remarks: '',
|
||||
code: '',
|
||||
prdType: '01',
|
||||
trainTypes: []
|
||||
}
|
||||
@ -111,9 +103,6 @@ export default {
|
||||
},
|
||||
baseRules() {
|
||||
return {
|
||||
code: [
|
||||
{ required: true, message: this.$t('rules.productCodeEnter'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.productNameEnter'), trigger: 'change' }
|
||||
],
|
||||
@ -161,7 +150,6 @@ export default {
|
||||
this.addModel.name = response.data.name;
|
||||
this.addModel.remarks = response.data.remarks;
|
||||
this.addModel.prdType = response.data.prdType;
|
||||
this.addModel.code = response.data.code;
|
||||
this.addModel.skinCode = response.data.skinCode;
|
||||
this.addModel.trainTypes = this.initTrainTypes = response.data.trainTypes;
|
||||
this.addModel.id = response.data.id;
|
||||
@ -191,11 +179,8 @@ export default {
|
||||
name: this.addModel.name,
|
||||
remarks: this.addModel.remarks,
|
||||
prdType: this.addModel.prdType,
|
||||
code: this.addModel.code,
|
||||
trainTypes: this.isShowTrainTypes ? this.addModel.trainTypes : []
|
||||
};
|
||||
checkMapProductCodeExist({ code: this.addModel.code }).then(response => {
|
||||
if (!response.data) {
|
||||
createTrainingCategory(data).then(response => {
|
||||
this.initTrainTypes = this.addModel.trainTypes;
|
||||
this.$emit('refresh');
|
||||
@ -203,12 +188,6 @@ export default {
|
||||
}).catch((error) => {
|
||||
this.$message.error(`${this.$t('tip.productCreationFailed')}, ${error.message}`);
|
||||
});
|
||||
} else {
|
||||
this.$message(this.$t('tip.productCodeExists'));
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message(this.$t('tip.productCodeExists'));
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
@ -34,7 +34,7 @@ export default {
|
||||
formModel:{
|
||||
mapId:'',
|
||||
name: '',
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
type: '',
|
||||
id:null
|
||||
}
|
||||
@ -49,7 +49,7 @@ export default {
|
||||
items: [
|
||||
{ prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true, options: this.projectList},
|
||||
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList, change:true, onChange:this.changeMap},
|
||||
{ prop: 'prdCode', label: this.$t('systemGenerate.prdName'), type: 'select', required: true, options:this.productList},
|
||||
{ prop: 'prdId', label: this.$t('systemGenerate.prdName'), type: 'select', required: true, options:this.productList},
|
||||
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},
|
||||
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true, options: this.typeList}
|
||||
]
|
||||
@ -80,7 +80,7 @@ export default {
|
||||
type:[
|
||||
{ required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'}
|
||||
],
|
||||
prdCode:[
|
||||
prdId:[
|
||||
{ required: true, message: this.$t('systemGenerate.selectPrdName'), trigger: 'change'}
|
||||
]
|
||||
};
|
||||
@ -109,8 +109,8 @@ export default {
|
||||
changeMap(index) {
|
||||
this.productList = [];
|
||||
getCommodityMapProduct(index).then((response) => {
|
||||
this.productList = response.data.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
this.formModel.prdCode = '';
|
||||
this.productList = response.data.map(elem => { return { value: elem.id, label: elem.name }; });
|
||||
this.formModel.prdId = '';
|
||||
});
|
||||
},
|
||||
doShow(data) {
|
||||
|
@ -4,8 +4,8 @@
|
||||
<el-form-item :label="this.$t('lesson.trainingName')+':'" prop="name">
|
||||
<el-input v-model="operateModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('lesson.productType')" prop="prdCode">
|
||||
<el-select v-model="operateModel.prdCode" placeholder="" :disabled="true">
|
||||
<el-form-item :label="this.$t('lesson.productType')" prop="prdId">
|
||||
<el-select v-model="operateModel.prdId" placeholder="" :disabled="true">
|
||||
<el-option
|
||||
v-for="option in productTypesList"
|
||||
:key="option.code"
|
||||
@ -111,7 +111,7 @@ export default {
|
||||
id: '',
|
||||
name: '',
|
||||
type: '',
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
skinCode: '',
|
||||
operateType: '',
|
||||
maxDuration: 0,
|
||||
@ -179,7 +179,7 @@ export default {
|
||||
case 'TrainingType':
|
||||
if (node.parent) {
|
||||
this.operateModel.type = node.data.id;
|
||||
this.operateModel.prdCode = node.parent.data.id;
|
||||
this.operateModel.prdId = node.parent.data.id;
|
||||
this.operateModel.skinCode = node.parent.parent.data.id;
|
||||
this.productTypesList = [{
|
||||
code: node.parent.data.id,
|
||||
@ -199,7 +199,7 @@ export default {
|
||||
case 'Training':
|
||||
if (node.parent && node.parent.parent) {
|
||||
this.operateModel.type = node.parent.data.id;
|
||||
this.operateModel.prdCode = node.parent.parent.data.id;
|
||||
this.operateModel.prdId = node.parent.parent.data.id;
|
||||
this.operateModel.skinCode = node.parent.parent.parent.data.id;
|
||||
this.operationList = this.trainingOperateTypeMap[node.parent.data.id] || [];
|
||||
this.productTypesList = [{
|
||||
@ -246,7 +246,7 @@ export default {
|
||||
id: '',
|
||||
name: '',
|
||||
type: '',
|
||||
prdCode: '',
|
||||
prdId: '',
|
||||
skinCode: '',
|
||||
operateType: '',
|
||||
maxDuration: 0,
|
||||
@ -261,7 +261,7 @@ export default {
|
||||
const data = {
|
||||
name: this.operateModel.name,
|
||||
type: this.operateModel.type,
|
||||
prdCode: this.operateModel.prdCode,
|
||||
prdId: this.operateModel.prdId,
|
||||
skinCode: this.operateModel.skinCode,
|
||||
operateType: this.operateModel.operateType,
|
||||
minDuration: this.operateModel.minDuration,
|
||||
@ -285,7 +285,7 @@ export default {
|
||||
id: this.operateModel.id,
|
||||
name: this.operateModel.name,
|
||||
type: this.operateModel.type,
|
||||
prdCode: this.operateModel.prdCode,
|
||||
prdId: this.operateModel.prdId,
|
||||
skinCode: this.operateModel.skinCode,
|
||||
operateType: this.operateModel.operateType,
|
||||
minDuration: this.operateModel.minDuration,
|
||||
|
@ -94,7 +94,7 @@ export default {
|
||||
// 设置实训数据
|
||||
getTrainingDetail(this.trainingId).then(resp => {
|
||||
const detail = resp.data;
|
||||
getProductDetail(detail.prdCode).then(rest => {
|
||||
getProductDetail(detail.prdId).then(rest => {
|
||||
const data = rest.data;
|
||||
debugger;
|
||||
loadMapData(detail.skinCode).then(() => {
|
||||
|
@ -27,7 +27,7 @@ export default {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
mapId: '',
|
||||
mapPrdCode: '',
|
||||
mapPrdId: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
duration: ''
|
||||
@ -44,7 +44,7 @@ export default {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'mapId', label: this.$t('system.mapName'), type: 'select', required: true, options: this.LessonList, change: true, onChange: this.mapChange, placeholder: this.$t('rules.mapInput') },
|
||||
{ prop: 'mapPrdCode', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') },
|
||||
{ prop: 'mapPrdId', label: this.$t('system.productName'), type: 'select', required: true, options: this.mapPrdList, placeholder: this.$t('rules.productInput') },
|
||||
{ prop: 'userName', label: this.$t('system.userName'), type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: this.$t('system.pleaseInputNames') },
|
||||
{ prop: 'duration', label: this.$t('system.trainingUseTime'), type: 'text', rightWidth: true, required: true, message: 's' }
|
||||
]
|
||||
@ -59,7 +59,7 @@ export default {
|
||||
userName: [
|
||||
{ required: true, message: this.$t('rules.chooseUser'), trigger: 'change' }
|
||||
],
|
||||
mapPrdCode: [
|
||||
mapPrdId: [
|
||||
{ required: true, message: this.$t('rules.productInput'), trigger: 'change' }
|
||||
],
|
||||
duration: [
|
||||
@ -125,13 +125,13 @@ export default {
|
||||
},
|
||||
async mapChange(val) {
|
||||
this.mapPrdList = [];
|
||||
this.formModel.mapPrdCode = '';
|
||||
this.formModel.mapPrdId = '';
|
||||
try {
|
||||
const res = await getCommodityMapProduct(val);
|
||||
const data = res.data;
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
this.mapPrdList.push({ value: elem.code, label: elem.name });
|
||||
this.mapPrdList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
@ -151,7 +151,7 @@ export default {
|
||||
const self = this;
|
||||
const params = {
|
||||
mapId: this.formModel.mapId,
|
||||
mapPrdCode: this.formModel.mapPrdCode,
|
||||
mapPrdId: this.formModel.mapPrdId,
|
||||
userId: this.formModel.userId,
|
||||
duration: parseInt(this.formModel.duration)
|
||||
};
|
||||
@ -170,7 +170,7 @@ export default {
|
||||
handleClose(done) {
|
||||
this.formModel = {
|
||||
mapId: '',
|
||||
mapPrdCode: '',
|
||||
mapPrdId: '',
|
||||
userId: '',
|
||||
userName: '',
|
||||
duration: ''
|
||||
|
@ -109,7 +109,7 @@ export default {
|
||||
const data = response.data;
|
||||
if (data && data.length) {
|
||||
data.forEach(elem => {
|
||||
this.LessonList.push({ value: elem.prdCode, name: elem.name });
|
||||
this.LessonList.push({ value: elem.prdId, name: elem.name });
|
||||
});
|
||||
}
|
||||
},
|
||||
|
@ -104,7 +104,7 @@ export default {
|
||||
name: response.data.tree[0].name,
|
||||
pmsList: response.data.permissionList || [],
|
||||
treeList: response.data.tree,
|
||||
prdCode: this.$route.query.prdCode,
|
||||
prdId: this.$route.query.prdId,
|
||||
mapId: this.$route.query.mapId,
|
||||
PermissionType: PermissionType.LESSON
|
||||
};
|
||||
@ -159,7 +159,7 @@ export default {
|
||||
buy() {
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.trainingPlatform.pay}/${this.courseModel.id}`, query:
|
||||
{ permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdCode: this.$route.query.prdCode, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem }
|
||||
{ permissionType: PermissionType.LESSON, lessonId: this.courseModel.id, prdId: this.$route.query.prdId, mapId: this.$route.query.mapId, subSystem: this.$route.params.subSystem }
|
||||
});
|
||||
},
|
||||
nodeExpand(obj, node, ele) {
|
||||
|
@ -57,8 +57,8 @@ export default {
|
||||
}
|
||||
},
|
||||
goLesson(row) {
|
||||
localStore.set('teachDetail' + this.$route.params.subSystem, `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}?lessonId=${row.id}&mapId=${row.mapId}&prdCode=${row.prdCode}`);
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdCode: row.prdCode}});
|
||||
localStore.set('teachDetail' + this.$route.params.subSystem, `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}?lessonId=${row.id}&mapId=${row.mapId}&prdId=${row.prdId}`);
|
||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdId: row.prdId}});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -622,7 +622,7 @@ export default {
|
||||
|
||||
this.starting = res.data.state == '02';
|
||||
this.mapId = res.data.mapId;
|
||||
this.prodId = res.data.mapPrdCode;
|
||||
this.prodId = res.data.mapPrdId;
|
||||
this.roomInfo = {
|
||||
creatorId: res.data.creatorId,
|
||||
totalNum: Number(res.data.permissionNum) + Number(res.data.audiencePermissionNum),
|
||||
|
Loading…
Reference in New Issue
Block a user