Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
4cefb0cfbe
@ -86,6 +86,23 @@ export function getPermissionQuickly(mapId, count) {
|
||||
method: 'post'
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询从该用户权限流向的用户权限*/
|
||||
export function getPermissonList(id) {
|
||||
return request({
|
||||
url: `/api/userPermission/ups/fromThisUP?id=${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 收回从该用户权限流出的所有权限(权限分发及用户权限)*/
|
||||
export function putUserPermissionTakeBackAll(id) {
|
||||
return request({
|
||||
url: `/api/userPermission/${id}/takeBack/all`,
|
||||
method: 'put'
|
||||
});
|
||||
}
|
||||
|
||||
/** 收回用户权限到权限分发中 */
|
||||
export function putUserPermissionBackPackage(id) {
|
||||
return request({
|
||||
|
@ -57,4 +57,17 @@ export function bindUploadFile(data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取文件绑定的地图数据信息 */
|
||||
export function getFileBindMapData(fileId) {
|
||||
return request({
|
||||
url: `/api/file/binding/${fileId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 删除文件绑定信息 */
|
||||
export function deleteFileBindMapData(bindingId) {
|
||||
return request({
|
||||
url: `/api/file/binding/${bindingId}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
@ -356,6 +356,7 @@
|
||||
<template v-else-if="checkFieldType(item, 'uploadPicture')">
|
||||
<el-form-item v-show="item.show" :key="item.prop" :prop="item.prop" :label="item.label" :required="item.required">
|
||||
<el-upload
|
||||
ref="fileUpload"
|
||||
class="upload-demo"
|
||||
:action="item.action"
|
||||
:on-success="item.onSuccess"
|
||||
@ -428,6 +429,14 @@ export default {
|
||||
return field.type === type;
|
||||
}
|
||||
},
|
||||
clearFiles () {
|
||||
const files = this.$refs.fileUpload;
|
||||
if (files && files.length) {
|
||||
files.forEach(item => {
|
||||
item.clearFiles();
|
||||
});
|
||||
}
|
||||
},
|
||||
validateForm(callback) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
|
@ -350,6 +350,7 @@ export default {
|
||||
// 构建查询表单对象、显示的查询对象
|
||||
const queryObject = {};
|
||||
const model = {};
|
||||
// debugger;
|
||||
for (const item in this.queryForm.queryObject) {
|
||||
if (this.queryForm.queryObject.show === false) {
|
||||
continue;
|
||||
@ -357,7 +358,11 @@ export default {
|
||||
model[item] = this.formModel[item] || this.queryForm.queryObject[item].value;
|
||||
} else {
|
||||
queryObject[item] = this.queryForm.queryObject[item];
|
||||
model[item] = this.formModel[item] || this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]);
|
||||
if (this.queryForm.queryObject[item].hasOwnProperty('value')) {
|
||||
model[item] = this.queryForm.queryObject[item].value;
|
||||
} else {
|
||||
model[item] = this.formModel[item] || this.queryForm.queryObject[item].value || getDefaultValueByField(this.queryForm.queryObject[item]);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.queryObject = queryObject;
|
||||
|
@ -51,10 +51,10 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
let assetModelManager = new AssetModelManager(scene,controlManager);
|
||||
assetModelManager.lessonAssetsLoader(lessonData.assetList,lessonData.modelList).then((result) => {
|
||||
animateManager.initAnimation(assetModelManager);
|
||||
controlManager.init(animateManager.actions);
|
||||
controlManager.init(animateManager.actions,assetModelManager);
|
||||
|
||||
if(lessonData.lessonProgress[lessonIndex].action.length>0){
|
||||
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,assetModelManager.lessonTriggerList);
|
||||
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,true,assetModelManager.lessonTriggerList);
|
||||
}
|
||||
|
||||
startLesson();
|
||||
@ -66,19 +66,33 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
|
||||
|
||||
|
||||
this.actionModelControl = function(actionType,actionModel){
|
||||
console.log(actionType);
|
||||
console.log(actionModel);
|
||||
if(actionType == "remove"){
|
||||
|
||||
assetModelManager.otherModel.remove(actionModel);
|
||||
}else if(actionType == "changeIndex"){
|
||||
actionModel.visible = true;
|
||||
assetModelManager.otherModel.add(actionModel);
|
||||
}
|
||||
}
|
||||
|
||||
this.actionRemove = function(actionModel){
|
||||
assetModelManager.otherModel.remove(actionModel);
|
||||
|
||||
}
|
||||
|
||||
this.changeIndex = function(nowIndex){
|
||||
lessonIndex = nowIndex;
|
||||
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action);
|
||||
|
||||
|
||||
|
||||
if(lessonData.lessonProgress[lessonIndex].roleName == nowRole){
|
||||
controlManager.initRoleMode(true);
|
||||
controlManager.initControlMode(lessonIndex);
|
||||
controlManager.initRoleMode(true,nowRole);
|
||||
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,true);
|
||||
}else{
|
||||
controlManager.initRoleMode(false);
|
||||
controlManager.initRoleMode(false,nowRole);
|
||||
controlManager.changeIndexEvent(lessonData.lessonProgress[lessonIndex].action,false);
|
||||
}
|
||||
|
||||
}
|
||||
@ -89,6 +103,7 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
|
||||
this.initNowRole = function(role){
|
||||
nowRole = role;
|
||||
controlManager.initControlMode(lessonIndex);
|
||||
if(lessonData.lessonProgress[lessonIndex].roleName == nowRole){
|
||||
controlManager.initRoleMode(true);
|
||||
}else{
|
||||
@ -104,6 +119,9 @@ export function Lesson3dPlayer(dom,lessonData,lessonIndex) {
|
||||
if(controlManager.controlMode == "fps"){
|
||||
controlManager.updateFpsControl();
|
||||
}
|
||||
if(controlManager.controlMode == "non"){
|
||||
controlManager.updateOrbitControl();
|
||||
}
|
||||
animateManager.updateAnimation();
|
||||
requestAnimationFrame(animate);
|
||||
|
||||
|
@ -68,6 +68,7 @@ export function AssetModelManager(scene) {
|
||||
//场景中可触发事件模型
|
||||
this.lessonTriggerList = [];
|
||||
|
||||
|
||||
//加载课程资源
|
||||
this.lessonAssetsLoader = function(assetList,modelList){
|
||||
let initlist = [];
|
||||
@ -95,6 +96,7 @@ export function AssetModelManager(scene) {
|
||||
|
||||
initTriggerList();
|
||||
for(let i=0;i<modelList.length;i++){
|
||||
console.log(modelList[i]);
|
||||
let newModelTrigger = scope.loadAsset[modelList[i].modelId].mesh.clone(true);
|
||||
newModelTrigger.showType = "loadModel";
|
||||
newModelTrigger.label = modelList[i].label;
|
||||
@ -106,7 +108,9 @@ export function AssetModelManager(scene) {
|
||||
newModelTrigger.rotation.x = modelList[i].rot.x;
|
||||
newModelTrigger.rotation.y = modelList[i].rot.y;
|
||||
newModelTrigger.rotation.z = modelList[i].rot.z;
|
||||
scope.otherModel.add(newModelTrigger);
|
||||
if(modelList[i].visible == true){
|
||||
scope.otherModel.add(newModelTrigger);
|
||||
}
|
||||
scope.lessonTriggerList.push(newModelTrigger);
|
||||
}
|
||||
|
||||
@ -122,6 +126,9 @@ export function AssetModelManager(scene) {
|
||||
}
|
||||
|
||||
|
||||
this.addActionModel = function(actionModel){
|
||||
scope.otherModel.add(actionModel);
|
||||
}
|
||||
|
||||
// <el-option label="车站" value="standstation"></el-option>
|
||||
// <el-option label="停车场" value="stopstation"></el-option>
|
||||
|
@ -13,7 +13,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
this.controls = {};
|
||||
this.nowCamera = null;
|
||||
this.eventHitMode = false;
|
||||
|
||||
let nowRole = "";
|
||||
let roleMode = false;
|
||||
let eventBoxs = [];
|
||||
let raycasterBoxs = [];
|
||||
@ -49,7 +49,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
|
||||
let attachBox = new THREE.Mesh(
|
||||
new THREE.BoxGeometry(1, 5, 1),
|
||||
new THREE.MeshBasicMaterial({color: 0xff00000})//RED box
|
||||
new THREE.MeshBasicMaterial({color: 0xff00000,transparent: true,opacity: 0 })//RED box
|
||||
);
|
||||
let hitBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3());
|
||||
hitBox.setFromObject(attachBox);
|
||||
@ -62,7 +62,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
const SPHERE_RADIUS = 0.1;
|
||||
|
||||
const sphereGeometry = new THREE.SphereGeometry( SPHERE_RADIUS, 16, 16 );
|
||||
const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0x888855, roughness: 0.8, metalness: 0.5 } );
|
||||
const sphereMaterial = new THREE.MeshStandardMaterial( { color: 0x888855, roughness: 0.8, metalness: 0.5, } );
|
||||
|
||||
const spheres = [];
|
||||
let sphereIdx = 0;
|
||||
@ -78,15 +78,6 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
|
||||
}
|
||||
|
||||
scope.controlMode = lessonData.lessonProgress[lessonIndex].controlMode;
|
||||
// scope.controls = oribitControl;
|
||||
if(scope.controlMode == "free"){
|
||||
scope.nowCamera = orbitCamera;
|
||||
scope.controls.enabled = true;
|
||||
}else if(scope.controlMode == "fps"){
|
||||
scope.nowCamera = fpsCamera;
|
||||
scope.controls.enabled = false;
|
||||
}
|
||||
|
||||
let loaderObj = new THREE.OBJLoader();
|
||||
let pengzhuang;
|
||||
@ -111,25 +102,27 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
|
||||
}
|
||||
);
|
||||
this.initRoleMode = function(rMode){
|
||||
this.initRoleMode = function(rMode,role){
|
||||
roleMode = rMode;
|
||||
nowRole = role;
|
||||
console.log(roleMode);
|
||||
};
|
||||
|
||||
const worldOctree = new Octree();
|
||||
|
||||
const playerCollider = new Capsule( new THREE.Vector3( 0, 10, 0 ), new THREE.Vector3( 0, 11.9, 0 ), 1 );
|
||||
playerCollider.set(
|
||||
new THREE.Vector3(
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.x,
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.y,
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.z),
|
||||
new THREE.Vector3(
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.x,
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.y+1.5,
|
||||
lessonData.lessonProgress[lessonIndex].cameraPosition.z ), 1);
|
||||
attachBox.position.x = lessonData.lessonProgress[lessonIndex].cameraPosition.x;
|
||||
attachBox.position.y = lessonData.lessonProgress[lessonIndex].cameraPosition.y ;
|
||||
attachBox.position.z = lessonData.lessonProgress[lessonIndex].cameraPosition.z;
|
||||
// playerCollider.set(
|
||||
// new THREE.Vector3(
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.x,
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.y,
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.z),
|
||||
// new THREE.Vector3(
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.x,
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.y+1.5,
|
||||
// lessonData.lessonProgress[lessonIndex].cameraPosition.z ), 1);
|
||||
// attachBox.position.x = lessonData.lessonProgress[lessonIndex].cameraPosition.x;
|
||||
// attachBox.position.y = lessonData.lessonProgress[lessonIndex].cameraPosition.y ;
|
||||
// attachBox.position.z = lessonData.lessonProgress[lessonIndex].cameraPosition.z;
|
||||
|
||||
|
||||
|
||||
@ -145,6 +138,7 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
|
||||
this.updateOrbitControl = function(){
|
||||
oribitControl.update();
|
||||
render(orbitCamera);
|
||||
};
|
||||
|
||||
this.updateFpsControl = function(){
|
||||
@ -173,6 +167,8 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
|
||||
if(eventBoxs[i].action.actionMode == "jump"){
|
||||
jumpEvent("action",eventBoxs[i].action);
|
||||
actionEvent("remove",eventBoxs[i].action,eventBoxs[i].mesh);
|
||||
|
||||
}
|
||||
console.log("slice");
|
||||
eventBoxs.splice(i,1);
|
||||
@ -196,16 +192,14 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
// }
|
||||
}
|
||||
|
||||
render();
|
||||
render(fpsCamera);
|
||||
};
|
||||
|
||||
|
||||
|
||||
this.init = function(actions){
|
||||
// worldOctree.fromGraphNode( object.getObjectByName("Object173") );
|
||||
worldOctree.fromGraphNode( pengzhuang );
|
||||
actionList = actions;
|
||||
// scope.controlMode = lessonData.lessonProgress[lessonIndex].controlMode;
|
||||
}
|
||||
|
||||
this.updatePos = function(pos){
|
||||
@ -270,10 +264,6 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@ -458,17 +448,51 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
|
||||
}
|
||||
|
||||
function render(){
|
||||
|
||||
if(scope.nowCamera){
|
||||
renderer.render( scene, scope.nowCamera );
|
||||
}
|
||||
function render(camera){
|
||||
renderer.render( scene, camera );
|
||||
}
|
||||
window.onresize = function () {
|
||||
renderer.setSize(dom.offsetWidth,dom.offsetHeight);
|
||||
}
|
||||
|
||||
this.changeIndexEvent = function(actions,lessonTriggerList){
|
||||
this.initControlMode = function(nowLessonIndex){
|
||||
|
||||
scope.controlMode = lessonData.lessonProgress[nowLessonIndex].controlMode;
|
||||
if(lessonData.lessonProgress[nowLessonIndex].changeCamera == true){
|
||||
if(scope.controlMode == "free" || scope.controlMode == "non"){
|
||||
scope.nowCamera = orbitCamera;
|
||||
oribitControl.enabled = true;
|
||||
|
||||
orbitCamera.position.x = lessonData.lessonProgress[nowLessonIndex].cameraPosition.x;
|
||||
orbitCamera.position.y = lessonData.lessonProgress[nowLessonIndex].cameraPosition.y;
|
||||
orbitCamera.position.z = lessonData.lessonProgress[nowLessonIndex].cameraPosition.z;
|
||||
oribitControl.target = new THREE.Vector3(lessonData.lessonProgress[nowLessonIndex].cameraTarget.x,lessonData.lessonProgress[nowLessonIndex].cameraTarget.y,lessonData.lessonProgress[nowLessonIndex].cameraTarget.z);
|
||||
scope.updateOrbitControl();
|
||||
|
||||
if(scope.controlMode == "non"){
|
||||
oribitControl.enabled = false;
|
||||
}
|
||||
}else if(scope.controlMode == "fps"){
|
||||
scope.nowCamera = fpsCamera;
|
||||
oribitControl.enabled = false;
|
||||
playerCollider.set(
|
||||
new THREE.Vector3(
|
||||
lessonData.lessonProgress[nowLessonIndex].cameraPosition.x,
|
||||
lessonData.lessonProgress[nowLessonIndex].cameraPosition.y,
|
||||
lessonData.lessonProgress[nowLessonIndex].cameraPosition.z),
|
||||
new THREE.Vector3(
|
||||
lessonData.lessonProgress[nowLessonIndex].cameraPosition.x,
|
||||
lessonData.lessonProgress[nowLessonIndex].cameraPosition.y+1.5,
|
||||
lessonData.lessonProgress[nowLessonIndex].cameraPosition.z ), 1);
|
||||
attachBox.position.x = lessonData.lessonProgress[nowLessonIndex].cameraPosition.x;
|
||||
attachBox.position.y = lessonData.lessonProgress[nowLessonIndex].cameraPosition.y ;
|
||||
attachBox.position.z = lessonData.lessonProgress[nowLessonIndex].cameraPosition.z;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
this.changeIndexEvent = function(actions,rMode,lessonTriggerList){
|
||||
if(lessonTriggerList){
|
||||
eventTrigger = lessonTriggerList;
|
||||
scope.eventHitMode = true;
|
||||
@ -477,8 +501,9 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
// let newEventBoxs = [];
|
||||
// eventBoxs = newEventBoxs;
|
||||
raycasterBoxs = [];
|
||||
|
||||
if(actions.length>0){
|
||||
roleMode = rMode;
|
||||
console.log(roleMode);
|
||||
if(actions.length>0 && roleMode){
|
||||
for(let i=0;i<actions.length;i++){
|
||||
if(actions[i].actionType == "auto"){
|
||||
if(actions[i].actionMode == "play"){
|
||||
@ -499,11 +524,12 @@ export function ControlManager(dom,scene,lessonData,lessonIndex) {
|
||||
for(let j=0;j<eventTrigger.length;j++){
|
||||
if(eventTrigger[j].label == actions[i].actionModel){
|
||||
let eventTestBox = new THREE.Box3(new THREE.Vector3(), new THREE.Vector3());
|
||||
|
||||
eventTestBox.setFromObject(eventTrigger[j]);
|
||||
eventTestBox.mesh = eventTrigger[j];
|
||||
eventTestBox.action = actions[i];
|
||||
eventBoxs.push(eventTestBox);
|
||||
console.log("changeindex");
|
||||
actionEvent("changeIndex",eventBoxs[i].action,eventTestBox.mesh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -211,6 +211,29 @@ export function JobPaneData() {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"厅巡岗",
|
||||
value:"txg",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"平台岗",
|
||||
value:"ptg",
|
||||
|
@ -167,7 +167,16 @@ export function AssetModelManager(scene) {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.deleteAsset = function(selectModel){
|
||||
scope.otherModel.remove(selectModel);
|
||||
for(let i=0;i<scope.lessonTriggerList.length;i++){
|
||||
if(scope.lessonTriggerList[i].uuid == selectModel.uuid){
|
||||
scope.lessonTriggerList.splice(i,1);
|
||||
updateTriggerList(scope.lessonTriggerList);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// <el-option label="车站" value="standstation"></el-option>
|
||||
// <el-option label="停车场" value="stopstation"></el-option>
|
||||
@ -200,11 +209,12 @@ export function AssetModelManager(scene) {
|
||||
//动态加载资源
|
||||
this.lessonAssetsNewLoader = function(assetData,pos){
|
||||
let isLoaded = false;
|
||||
var rand = Math.floor(Math.random () * 900) + 100;
|
||||
if(scope.loadAsset[assetData.id]){
|
||||
let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true);
|
||||
newModelTrigger.modelId = assetData.id;
|
||||
newModelTrigger.showType = "loadModel";
|
||||
newModelTrigger.label = assetData.packageName;
|
||||
newModelTrigger.label = assetData.packageName +rand;
|
||||
newModelTrigger.position.copy(pos);
|
||||
scope.otherModel.add(newModelTrigger);
|
||||
scope.lessonTriggerList.push(newModelTrigger);
|
||||
@ -212,7 +222,7 @@ export function AssetModelManager(scene) {
|
||||
}else{
|
||||
scope.loadAsset[assetData.id] = {
|
||||
modelId:assetData.id,
|
||||
packageName:assetData.packageName,
|
||||
packageName:assetData.packageName +rand,
|
||||
url:assetData.url,
|
||||
mesh:"",
|
||||
assetType:'loadModel',
|
||||
@ -220,12 +230,16 @@ export function AssetModelManager(scene) {
|
||||
resourceType:"三维课程",
|
||||
};
|
||||
console.log("new");
|
||||
|
||||
fbxpromise(scope.loadAsset[assetData.id]).then(function(object){
|
||||
|
||||
console.log(scope.loadAsset[assetData.id].mesh);
|
||||
|
||||
let newModelTrigger = scope.loadAsset[assetData.id].mesh.clone(true);
|
||||
|
||||
newModelTrigger.showType = "loadModel";
|
||||
newModelTrigger.modelId = assetData.id;
|
||||
newModelTrigger.label = assetData.packageName;
|
||||
newModelTrigger.label = assetData.packageName+rand;
|
||||
newModelTrigger.position.copy(pos);
|
||||
scope.otherModel.add(newModelTrigger);
|
||||
scope.lessonTriggerList.push(newModelTrigger);
|
||||
|
1526
src/jlmap3d/lesson3dedit/controls/TransformControls.js
Normal file
1526
src/jlmap3d/lesson3dedit/controls/TransformControls.js
Normal file
File diff suppressed because it is too large
Load Diff
@ -12,12 +12,11 @@ import { SkeletonUtils } from '@/jlmap3d/main/utils/SkeletonUtils.js';
|
||||
|
||||
import { AssetModelManager } from '@/jlmap3d/lesson3dedit/assetmodelmanager/assetmodelmanager.js';
|
||||
|
||||
import { StationManagerControls } from '@/jlmap3d/jl3dstationmanager/controls/TransformControls';
|
||||
import { TransformControls } from '@/jlmap3d/lesson3dedit/controls/TransformControls';
|
||||
|
||||
//动画播放相关
|
||||
let clock = new THREE.Clock();
|
||||
let delta;
|
||||
|
||||
let scene;
|
||||
|
||||
export function Lesson3dEditor(dom,lessonData) {
|
||||
@ -88,7 +87,6 @@ export function Lesson3dEditor(dom,lessonData) {
|
||||
assetModelManager.lessonAssetsLoader();
|
||||
}
|
||||
|
||||
|
||||
animate();
|
||||
|
||||
|
||||
@ -137,4 +135,9 @@ export function Lesson3dEditor(dom,lessonData) {
|
||||
this.attachModel = function(selectModel){
|
||||
transcontrol.attach(selectModel);
|
||||
}
|
||||
|
||||
this.deleteModel = function(selectModel){
|
||||
transcontrol.detach();
|
||||
assetModelManager.deleteAsset(selectModel);
|
||||
}
|
||||
}
|
||||
|
@ -211,6 +211,29 @@ export function JobPaneData() {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"厅巡岗",
|
||||
value:"txg",
|
||||
text:"",
|
||||
picurl:"",
|
||||
controlList:[
|
||||
//联控
|
||||
{
|
||||
name:"联控",
|
||||
data:[],
|
||||
},
|
||||
//动作
|
||||
{
|
||||
name:"动作",
|
||||
data:[],
|
||||
},
|
||||
//口呼
|
||||
{
|
||||
name:"口呼",
|
||||
data:[],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name:"平台岗",
|
||||
value:"ptg",
|
||||
|
@ -1,6 +1,8 @@
|
||||
const systemGraphType = {
|
||||
Line: 'Line',
|
||||
Text: 'Text'
|
||||
Text: 'Text',
|
||||
Rect: 'Rect',
|
||||
Arrow: 'Arrow'
|
||||
};
|
||||
|
||||
export default systemGraphType;
|
||||
|
@ -2,6 +2,7 @@ import * as zrUtil from 'zrender/src/core/util';
|
||||
// import * as vector from 'zrender/src/core/vector';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import deviceType from './constant/deviceType';
|
||||
import systemGraphType from './constant/systemGraphType';
|
||||
import transitionDeviceStatus from './constant/stateTransition';
|
||||
// import shapefactory from './shape/factory';
|
||||
import Graphic from './shape';
|
||||
@ -40,7 +41,9 @@ class Painter {
|
||||
this.$zr.add(this.parentLevel);
|
||||
|
||||
// 添加子级图层
|
||||
zrUtil.each(Object.values(deviceType), (type) => {
|
||||
zrUtil.each([
|
||||
...Object.values(deviceType),
|
||||
...Object.values(systemGraphType)], (type) => {
|
||||
const level = new Group({ name: `__${type}__` });
|
||||
this.mapInstanceLevel[type] = level;
|
||||
this.parentLevel.add(level);
|
||||
|
@ -25,6 +25,10 @@ export function parser(data, skinCode, showConfig) {
|
||||
mapDevice[elem.code] = createDevice(systemGraphType.Text, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
zrUtil.each(data.rectList || [], elem => {
|
||||
mapDevice[elem.code] = createDevice(systemGraphType.Rect, elem, propConvert, showConfig);
|
||||
}, this);
|
||||
|
||||
}
|
||||
|
||||
return mapDevice;
|
||||
@ -55,6 +59,7 @@ export function updateMapData(state, model) {
|
||||
switch (model._type) {
|
||||
case systemGraphType.Line: updateForList(model, state, 'lineList'); break;
|
||||
case systemGraphType.Text: updateForList(model, state, 'textList'); break;
|
||||
case systemGraphType.Rect: updateForList(model, state, 'rectList'); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
71
src/jmapNew/shape/systemGraph/Arrow/index.js
Normal file
71
src/jmapNew/shape/systemGraph/Arrow/index.js
Normal file
@ -0,0 +1,71 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Polygon from 'zrender/src/graphic/shape/Polygon';
|
||||
|
||||
export default class Arrow extends Group {
|
||||
constructor(model, {style}) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.zlevel = model.zlevel;
|
||||
this.z = 0;
|
||||
this.model = model;
|
||||
// this.style = style;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
this.setShowMode();
|
||||
}
|
||||
|
||||
create() {
|
||||
const model = this.model;
|
||||
this.arrow = new Polygon({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
origin: [model.position.x, model.position.y],
|
||||
rotation: -Math.PI / 180 * Number(model.rotate),
|
||||
shape: {
|
||||
points: [
|
||||
[model.position.x, model.position.y],
|
||||
[model.position.x + model.triangleLength, model.position.y - model.triangleHeight / 2],
|
||||
[model.position.x + model.triangleLength, model.position.y - model.lineWidth / 2],
|
||||
[model.position.x + model.length, model.position.y - model.lineWidth / 2],
|
||||
[model.position.x + model.length, model.position.y + model.lineWidth / 2],
|
||||
[model.position.x + model.triangleLength, model.position.y + model.lineWidth / 2],
|
||||
[model.position.x + model.triangleLength, model.position.y + model.triangleHeight / 2]
|
||||
]
|
||||
},
|
||||
style: {
|
||||
fill: model.color
|
||||
}
|
||||
});
|
||||
this.add(this.arrow);
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
const showMode = this.model.showMode;
|
||||
const showConditions = this.model.showConditions;
|
||||
if (!showConditions || showConditions === '01' || showMode === showConditions) {
|
||||
this.arrow.show();
|
||||
} else {
|
||||
this.arrow.hide();
|
||||
}
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
if (!stationCode || this.model.stationCode === stationCode) {
|
||||
this.show();
|
||||
this.isShowShape = true;
|
||||
this.setState(this.model);
|
||||
} else {
|
||||
this.hide();
|
||||
this.isShowShape = false;
|
||||
}
|
||||
}
|
||||
getAnchorPoint() {
|
||||
const rect = this.arrow.getBoundingRect();
|
||||
return { x:rect.x, y:rect.y };
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import Polyline from 'zrender/src/graphic/shape/Polyline';
|
||||
import Circle from 'zrender/src/graphic/shape/Circle';
|
||||
|
||||
export default class Line2 extends Group {
|
||||
constructor(model, {style}) {
|
||||
@ -72,6 +73,28 @@ export default class Line2 extends Group {
|
||||
});
|
||||
this.add(this.segment);
|
||||
}
|
||||
|
||||
if (model.pointShow) {
|
||||
let cx = model.points[0].x;
|
||||
let cy = model.points[0].y;
|
||||
if (model.directionPoint == 'right') {
|
||||
cx = model.points[model.points.length - 1].x;
|
||||
cy = model.points[model.points.length - 1].y;
|
||||
}
|
||||
this.mapCircle = new Circle({
|
||||
zlevel: model.zlevel,
|
||||
z: model.z,
|
||||
shape: {
|
||||
cx: cx,
|
||||
cy: cy,
|
||||
r: model.radiusWidth
|
||||
},
|
||||
style: {
|
||||
fill: model.lineColor || this.style.lineColor
|
||||
}
|
||||
});
|
||||
this.add(this.mapCircle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
66
src/jmapNew/shape/systemGraph/Rect/index.js
Normal file
66
src/jmapNew/shape/systemGraph/Rect/index.js
Normal file
@ -0,0 +1,66 @@
|
||||
import Rect from 'zrender/src/graphic/shape/Rect';
|
||||
import Group from 'zrender/src/container/Group';
|
||||
import BoundingRect from 'zrender/src/core/BoundingRect';
|
||||
|
||||
export default class Rect2 extends Group {
|
||||
constructor(model, {style, lineCode}) {
|
||||
super();
|
||||
this._code = model.code;
|
||||
this._type = model._type;
|
||||
this.name = model.code;
|
||||
this.zlevel = model.zlevel;
|
||||
this.model = model;
|
||||
this.style = style;
|
||||
this.z = 6;
|
||||
this.lineCode = lineCode;
|
||||
this.isShowShape = true;
|
||||
this.create();
|
||||
this.setState(model);
|
||||
this.setShowMode();
|
||||
}
|
||||
|
||||
create() {
|
||||
var model = this.model;
|
||||
|
||||
this.rectModel = new Rect({
|
||||
zlevel: this.zlevel,
|
||||
z: this.z,
|
||||
shape: {
|
||||
x: model.position.x,
|
||||
y: model.position.y,
|
||||
width: model.width,
|
||||
height: model.height
|
||||
},
|
||||
style: {
|
||||
fill: model.fillColor,
|
||||
lineWidth: model.lineWidth,
|
||||
stroke: model.lineColor
|
||||
}
|
||||
});
|
||||
this.add(this.rectModel);
|
||||
}
|
||||
|
||||
setState(model) {
|
||||
if (!this.isShowShape) return;
|
||||
}
|
||||
getBoundingRect() {
|
||||
if (this.rectModel) {
|
||||
return this.rectModel.getBoundingRect().clone();
|
||||
} else {
|
||||
return new BoundingRect(this.model.position.x, this.model.position.y, 0, 0);
|
||||
}
|
||||
}
|
||||
// 设置显示模式
|
||||
setShowMode() {
|
||||
|
||||
}
|
||||
setShowStation(stationCode) {
|
||||
|
||||
}
|
||||
screenShow() {
|
||||
|
||||
}
|
||||
getAnchorPoint() {
|
||||
return this.model.position;
|
||||
}
|
||||
}
|
@ -2,10 +2,14 @@ import systemGraphType from '../../constant/systemGraphType';
|
||||
|
||||
import Line from './Line/index.js';
|
||||
import Text2 from './Text/index.js';
|
||||
import Rect2 from './Rect/index.js';
|
||||
import Arrow from './Arrow/index.js';
|
||||
|
||||
/** 图库*/
|
||||
const mapShape = {};
|
||||
mapShape[systemGraphType.Line] = Line;
|
||||
mapShape[systemGraphType.Text] = Text2;
|
||||
mapShape[systemGraphType.Rect] = Rect2;
|
||||
mapShape[systemGraphType.Arrow] = Arrow;
|
||||
|
||||
export default mapShape;
|
||||
|
@ -11,7 +11,7 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div>
|
||||
<el-form :inline="true" :model="form" class="demo-form-inline">
|
||||
<el-form v-if="selected" :inline="true" :model="form" class="demo-form-inline">
|
||||
<el-form-item label="设备类型:">
|
||||
<el-select v-model="form.deviceType" :disabled="true" style="width: 150px;">
|
||||
<el-option
|
||||
@ -55,6 +55,7 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||
import { getUploadFile } from '@/api/pdf';
|
||||
import { DrawingType } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'TrainMove',
|
||||
@ -64,6 +65,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
selected: null,
|
||||
selectedType: '',
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
tableData: [],
|
||||
@ -90,20 +92,33 @@ export default {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
title() {
|
||||
return '图纸检索';
|
||||
if (this.selectedType === 'normStudy') {
|
||||
return '规范学习';
|
||||
} else if (this.selectedType === 'clCaAn') {
|
||||
return '经典案例分析';
|
||||
} else if (this.selectedType === 'baDeTr') {
|
||||
return '基础设备培训';
|
||||
} else {
|
||||
return '图纸检索';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(selected) {
|
||||
doShow(selected, selectedType) {
|
||||
this.selectedType = selectedType;
|
||||
const params = { mapId: this.$route.query.mapId, fileType: DrawingType[selectedType] };
|
||||
this.selected = selected;
|
||||
this.form.deviceName = selected.name;
|
||||
this.form.deviceType = selected._type;
|
||||
const params = { mapId: this.$route.query.mapId, deviceType: selected._type.toUpperCase(), deviceId: selected.code };
|
||||
if (this.selected) {
|
||||
this.form.deviceName = selected.name;
|
||||
this.form.deviceType = selected._type;
|
||||
params.deviceType = selected._type.toUpperCase();
|
||||
params.deviceId = selected.code;
|
||||
}
|
||||
this.loading = true;
|
||||
getUploadFile(params).then(resp => {
|
||||
this.tableData = resp.data;
|
||||
this.loading = false;
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$message.error('图纸检索失败!');
|
||||
});
|
||||
|
@ -54,6 +54,10 @@ export default {
|
||||
{
|
||||
label: '图纸调用',
|
||||
handler: this.drawingCall
|
||||
},
|
||||
{
|
||||
label: '基础设备培训',
|
||||
handler: this.baDeTrCall
|
||||
}
|
||||
],
|
||||
Center: [
|
||||
@ -136,7 +140,10 @@ export default {
|
||||
}
|
||||
},
|
||||
drawingCall() {
|
||||
this.$refs.drawSelect.doShow(this.selected);
|
||||
this.$refs.drawSelect.doShow(this.selected, 'drawing');
|
||||
},
|
||||
baDeTrCall() {
|
||||
this.$refs.drawSelect.doShow(this.selected, 'baDeTr');
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
|
@ -26,7 +26,6 @@ import { mapGetters } from 'vuex';
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import PasswordBox from '@/jmapNew/theme/components/menus/childDialog/passwordInputBox';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
import DrawSelect from './dialog/drawSelect';
|
||||
@ -61,6 +60,10 @@ export default {
|
||||
{
|
||||
label: '图纸调用',
|
||||
handler: this.drawingCall
|
||||
},
|
||||
{
|
||||
label: '基础设备培训',
|
||||
handler: this.baDeTrCall
|
||||
}
|
||||
// {
|
||||
// label: '办理进路',
|
||||
@ -205,7 +208,10 @@ export default {
|
||||
}
|
||||
},
|
||||
drawingCall() {
|
||||
this.$refs.drawSelect.doShow(this.selected);
|
||||
this.$refs.drawSelect.doShow(this.selected, 'drawing');
|
||||
},
|
||||
baDeTrCall() {
|
||||
this.$refs.drawSelect.doShow(this.selected, 'baDeTr');
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
|
@ -45,6 +45,10 @@ export default {
|
||||
{
|
||||
label: '图纸调用',
|
||||
handler: this.drawingCall
|
||||
},
|
||||
{
|
||||
label: '基础设备培训',
|
||||
handler: this.baDeTrCall
|
||||
}
|
||||
],
|
||||
Center: [
|
||||
@ -101,7 +105,10 @@ export default {
|
||||
}
|
||||
},
|
||||
drawingCall() {
|
||||
this.$refs.drawSelect.doShow(this.selected);
|
||||
this.$refs.drawSelect.doShow(this.selected, 'drawing');
|
||||
},
|
||||
baDeTrCall() {
|
||||
this.$refs.drawSelect.doShow(this.selected, 'baDeTr');
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
|
@ -22,7 +22,6 @@ import SwitchHookLock from '@/jmapNew/theme/components/menus/dialog/switchHookLo
|
||||
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||
|
||||
export default {
|
||||
@ -55,6 +54,10 @@ export default {
|
||||
{
|
||||
label: '图纸调用',
|
||||
handler: this.drawingCall
|
||||
},
|
||||
{
|
||||
label: '基础设备培训',
|
||||
handler: this.baDeTrCall
|
||||
}
|
||||
],
|
||||
Center: [
|
||||
@ -156,7 +159,10 @@ export default {
|
||||
|
||||
},
|
||||
drawingCall() {
|
||||
this.$refs.drawSelect.doShow(this.selected);
|
||||
this.$refs.drawSelect.doShow(this.selected, 'drawing');
|
||||
},
|
||||
baDeTrCall() {
|
||||
this.$refs.drawSelect.doShow(this.selected, 'baDeTr');
|
||||
},
|
||||
doShow(point) {
|
||||
this.initMenu();
|
||||
|
@ -1,3 +1,12 @@
|
||||
/**
|
||||
* 图纸类型
|
||||
*/
|
||||
export const DrawingType = {
|
||||
drawing: 'DRAWING',
|
||||
baDeTr: 'BA_DE_TR',
|
||||
clCaAn: 'CL_CA_AN',
|
||||
normStudy: 'NORM_STUDY'
|
||||
};
|
||||
/**
|
||||
* 鼠标事件
|
||||
*/
|
||||
|
@ -515,6 +515,13 @@ const map = {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
rectList: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.rectList || [];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
trainWindowList: (state) => {
|
||||
if (state.map) {
|
||||
return state.map.trainWindowList;
|
||||
|
@ -2,11 +2,11 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
|
||||
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
|
||||
BASE_API = 'http://192.168.3.120:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
|
@ -176,7 +176,6 @@ export default {
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
|
||||
console.log(row);
|
||||
deleteAssetData(row.id).then(netdata => {
|
||||
this.tableData.splice(index, 1);
|
||||
console.log(netdata);
|
||||
|
@ -312,8 +312,12 @@
|
||||
value:"null",
|
||||
},
|
||||
{
|
||||
name:"跳转",
|
||||
name:"总是跳转",
|
||||
value:"jump",
|
||||
},
|
||||
{
|
||||
name:"条件跳转",
|
||||
value:"limitjump",
|
||||
}
|
||||
],
|
||||
}
|
||||
|
@ -273,7 +273,7 @@
|
||||
this.jl3d.attachModel(selectedModel);
|
||||
},
|
||||
deleteModel(selectedModel){
|
||||
|
||||
this.jl3d.deleteModel(selectedModel);
|
||||
},
|
||||
setupclick(){
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="explainpanediv" v-if="lessonData.lessonData.lessonProgress[lessonEditIndex]" @click="selectTool">
|
||||
<div class="explainpanetittle" >
|
||||
<!-- <div class="explainpanetittle" >
|
||||
{{lessonData.lessonData.lessonProgress[lessonEditIndex].explainPane.tittle}}
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="explainpanepic" :style="{'background-image': 'url('+localStatic+lessonData.lessonData.lessonProgress[lessonEditIndex].explainPane.picurl+')'}" >
|
||||
|
||||
</div>
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
<div class="nextbuttondiv"
|
||||
:style="{'background-image': 'url('+staticImg+'/lesson3d/nextbutton.png)'}"
|
||||
v-if="lessonData.lessonData.lessonProgress[lessonEditIndex].explainPane.explainPaneType=='jump'"></div>
|
||||
v-if="lessonData.lessonData.lessonProgress[lessonEditIndex].explainPane.explainPaneType=='jump' || (lessonData.lessonData.lessonProgress[lessonEditIndex].explainPane.explainPaneType == 'limitjump' && lessonData.lessonData.lessonProgress[lessonEditIndex].value == 'zbzz')"></div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
@ -83,7 +83,7 @@
|
||||
addjob(index){
|
||||
this.selectedJob.controlList[index].data.push({
|
||||
cname:this.generateUUID(),
|
||||
text:"123",
|
||||
text:"内容",
|
||||
explainRole:"角色",
|
||||
nextNode:"null",
|
||||
sceneId:this.lessonData.lessonData.lessonProgress[this.lessonEditIndex].id,
|
||||
@ -117,10 +117,9 @@
|
||||
position: absolute;
|
||||
// height: 500px;
|
||||
min-width: 100px;
|
||||
right:0;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
// border:solid 2px #000;
|
||||
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
@ -128,8 +127,8 @@
|
||||
position: absolute;
|
||||
width:100px;
|
||||
height:50px;
|
||||
right:0;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
border:solid 2px #000;
|
||||
background-color: #fff;
|
||||
}
|
||||
@ -138,8 +137,8 @@
|
||||
position: absolute;
|
||||
width:100px;
|
||||
height:450px;
|
||||
right:0;
|
||||
top:50px;
|
||||
left:0;
|
||||
bottom:50px;
|
||||
border:solid 2px #000;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
@ -159,8 +158,8 @@
|
||||
.jobtab{
|
||||
position: absolute;
|
||||
|
||||
right:100px;
|
||||
top:50px;
|
||||
left:100px;
|
||||
bottom:50px;
|
||||
width: 300px;
|
||||
height:450px;
|
||||
background-color: #fff;
|
||||
|
@ -131,8 +131,8 @@
|
||||
position: absolute;
|
||||
width: 240px;
|
||||
height: 80px;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
top:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
// background-color: #fff;
|
||||
@ -150,8 +150,8 @@
|
||||
|
||||
.toolbarguides{
|
||||
position: absolute;
|
||||
bottom: 80px;
|
||||
left:0;
|
||||
top: 80px;
|
||||
right:0;
|
||||
width:100px;
|
||||
height:350px;
|
||||
overflow-y: auto;
|
||||
|
@ -193,7 +193,7 @@
|
||||
for(let i=0;i<this.jobPaneData.dataList.length;i++){
|
||||
if(job == this.jobPaneData.dataList[i].name){
|
||||
this.nowRole = this.jobPaneData.dataList[i].value;
|
||||
console.log(this.nowRole);
|
||||
console.log(this.nowRole);
|
||||
this.jl3d.initNowRole(this.nowRole);
|
||||
}
|
||||
}
|
||||
@ -229,18 +229,15 @@
|
||||
if(type == "jump"){
|
||||
this.lessonPlayIndex = action.nextNode;
|
||||
}
|
||||
console.log(type);
|
||||
console.log(action);
|
||||
|
||||
this.jl3d.changeIndex(this.lessonPlayIndex);
|
||||
},
|
||||
actionEvent(type,action,mesh){
|
||||
if(type == "remove"){
|
||||
this.jl3d.actionRemove(mesh);
|
||||
}
|
||||
this.jl3d.actionModelControl(type,mesh);
|
||||
// this.jl3d.actionRemove(mesh);
|
||||
},
|
||||
updateTriggerList(newTriggerList){
|
||||
this.triggerList = newTriggerList;
|
||||
console.log(this.triggerList);
|
||||
},
|
||||
changeCameraPos(pos){
|
||||
this.jl3d.changeCameraPos(pos);
|
||||
|
@ -3,9 +3,9 @@
|
||||
v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex]"
|
||||
|
||||
:style="{'background-image': 'url('+lessonbg+')'}">
|
||||
<div class="explainpanetittle" >
|
||||
<!-- <div class="explainpanetittle" >
|
||||
{{lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.tittle}}
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="explainpanepic" :style="{'background-image': 'url('+localStatic+lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.picurl+')'}" >
|
||||
|
||||
</div>
|
||||
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<div class="nextbuttondiv"
|
||||
:style="{'background-image': 'url('+staticImg+'/lesson3d/nextbutton.png)'}"
|
||||
v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.explainPaneType=='jump' "
|
||||
v-if="lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.explainPaneType=='jump'|| (lessonData.lessonData.lessonProgress[lessonPlayIndex].explainPane.explainPaneType == 'limitjump' && lessonData.lessonData.lessonProgress[lessonPlayIndex].value == nowRole) "
|
||||
@click="explainJump"></div>
|
||||
</div>
|
||||
</template>
|
||||
@ -54,7 +54,7 @@
|
||||
// lesson3dSelect('toolproperty','explainpane');
|
||||
// },
|
||||
explainJump(){
|
||||
if(this.lessonData.lessonData.lessonProgress[this.lessonPlayIndex].explainPane.explainPaneType == "jump"){
|
||||
if(this.lessonData.lessonData.lessonProgress[this.lessonPlayIndex].explainPane.explainPaneType == "jump" || (this.lessonData.lessonData.lessonProgress[this.lessonPlayIndex].explainPane.explainPaneType == "limitjump")){
|
||||
this.$emit('jumpEvent','jump',this.lessonData.lessonData.lessonProgress[this.lessonPlayIndex].explainPane);
|
||||
}
|
||||
},
|
||||
@ -80,7 +80,7 @@
|
||||
.explainpanetittle{
|
||||
// height:15%;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.explainpanepic{
|
||||
@ -96,7 +96,7 @@
|
||||
position:relative;
|
||||
left:5%;
|
||||
width:90%;
|
||||
font-size: 14px;
|
||||
font-size: 20px;
|
||||
// height:20%;
|
||||
}
|
||||
|
||||
|
@ -116,8 +116,8 @@
|
||||
position: absolute;
|
||||
// height: 500px;
|
||||
min-width: 100px;
|
||||
right:0;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
// border:solid 2px #000;
|
||||
z-index:1;
|
||||
}
|
||||
@ -134,8 +134,8 @@
|
||||
position: absolute;
|
||||
width:100px;
|
||||
height:50px;
|
||||
right:0;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
border:solid 2px #000;
|
||||
text-align: center;
|
||||
// background-color: #fff;
|
||||
@ -148,8 +148,8 @@
|
||||
position: absolute;
|
||||
width:100px;
|
||||
height:450px;
|
||||
right:0;
|
||||
top:50px;
|
||||
left:0;
|
||||
bottom:50px;
|
||||
border:solid 2px #000;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
@ -175,8 +175,8 @@
|
||||
.jobtab{
|
||||
position: absolute;
|
||||
|
||||
right:100px;
|
||||
top:50px;
|
||||
left:100px;
|
||||
bottom:50px;
|
||||
width: 300px;
|
||||
height:450px;
|
||||
color:#fff;
|
||||
|
@ -5,7 +5,7 @@
|
||||
<el-tabs type="border-card"
|
||||
:style="{'background-image': 'url('+lessonbg+')'}">
|
||||
<el-tab-pane label="进程" style="overflow-y:auto;">
|
||||
<div id="tabdiv" class = "tabdiv">
|
||||
<div id="tabdiv1" class = "tabdiv1">
|
||||
<div class="processtext" v-for="(processItem,index) in processTexts">
|
||||
{{processItem.text}}
|
||||
</div>
|
||||
@ -16,7 +16,7 @@
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane label="日志" >
|
||||
<div id="tabdiv" class = "tabdiv">
|
||||
<div id="tabdiv2" class = "tabdiv2">
|
||||
<div class="logtext" v-for="(logItem,index) in logTexts">
|
||||
{{logItem.text}}
|
||||
</div>
|
||||
@ -52,13 +52,18 @@
|
||||
watch: {
|
||||
'lessonPlayIndex': {
|
||||
handler: function (newVal, oldVal) {
|
||||
|
||||
|
||||
if (newVal != oldVal) {
|
||||
this.logTexts.push(this.lessonData.lessonData.lessonProgress[oldVal].stepTipsData);
|
||||
this.processTexts.push(this.lessonData.lessonData.lessonProgress[oldVal].stepTipsData);
|
||||
this.nowProcessText = this.lessonData.lessonData.lessonProgress[newVal].stepTipsData.text;
|
||||
var div = document.getElementById('tabdiv');
|
||||
div.scrollTop = div.scrollHeight;
|
||||
var div1 = document.getElementById('tabdiv1');
|
||||
// div.scrollIntoView();
|
||||
div1.scrollTop = div1.scrollHeight;
|
||||
|
||||
var div2 = document.getElementById('tabdiv2');
|
||||
// div.scrollIntoView();
|
||||
div2.scrollTop = div2.scrollHeight;
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -83,38 +88,45 @@
|
||||
@import "src/styles/mixin.scss";
|
||||
.processlogdiv {
|
||||
position: absolute;
|
||||
width: 450px;
|
||||
height: 250px;
|
||||
width: 550px;
|
||||
height: 350px;
|
||||
right:0;
|
||||
bottom:0;
|
||||
border-radius:10px;
|
||||
z-index:1;
|
||||
}
|
||||
|
||||
.tabdiv{
|
||||
.tabdiv1{
|
||||
width:100%;
|
||||
height:175px;
|
||||
height:275px;
|
||||
position: relative;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.tabdiv2{
|
||||
width:100%;
|
||||
height:275px;
|
||||
position: relative;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.processtext{
|
||||
font-size: 16px;
|
||||
font-size: 20px;
|
||||
color:#00ff00;
|
||||
border:solid 2px #fff;
|
||||
margin-top: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.processtextnow{
|
||||
font-size: 16px;
|
||||
font-size: 20px;
|
||||
color:#ff0000;
|
||||
border:solid 2px #fff;
|
||||
margin-top: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.logtext{
|
||||
font-size: 16px;
|
||||
font-size: 20px;
|
||||
color:#00ff00;
|
||||
border:solid 2px #fff;
|
||||
margin-top: 5px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,10 +70,10 @@
|
||||
}
|
||||
.stepstipstittle{
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
font-size: 25px;
|
||||
}
|
||||
.stepstipstext{
|
||||
font-size: 16px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
</div>
|
||||
|
||||
<div class="toolbarbutton"
|
||||
:style="{'background-image': 'url('+localstatic+'/lesson3d/back.png)'}">
|
||||
:style="{'background-image': 'url('+localstatic+'/lesson3d/back.png)'}"
|
||||
@click="openBack">
|
||||
</div>
|
||||
|
||||
<div class="toolbarguides"
|
||||
@ -84,6 +85,9 @@
|
||||
this.showBag = false;
|
||||
}
|
||||
},
|
||||
openBack(){
|
||||
history.go(-1);
|
||||
},
|
||||
changeCameraPos(guide){
|
||||
this.$emit('changeCameraPos',guide.pos);
|
||||
},
|
||||
@ -179,8 +183,8 @@
|
||||
position: absolute;
|
||||
width: 240px;
|
||||
height: 80px;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
top:0;
|
||||
border-radius:10px;
|
||||
border:solid 2px #000;
|
||||
z-index:1;
|
||||
@ -198,8 +202,8 @@
|
||||
|
||||
.toolbarguides{
|
||||
position: absolute;
|
||||
bottom: 80px;
|
||||
left:0;
|
||||
top: 80px;
|
||||
right:0;
|
||||
width:100px;
|
||||
height:350px;
|
||||
overflow-y: auto;
|
||||
@ -222,8 +226,8 @@
|
||||
|
||||
.toolbarbag{
|
||||
position: absolute;
|
||||
bottom: 80px;
|
||||
left:0;
|
||||
top: 80px;
|
||||
right:0;
|
||||
width:240px;
|
||||
height:320px;
|
||||
overflow-y: auto;
|
||||
|
@ -4,6 +4,8 @@
|
||||
<div class="btn_hover" @click="menuClick">菜单</div>
|
||||
<el-button-group ref="button_group_box" class="button_group_box" :style="`margin-left:-${btnWidth}px`">
|
||||
<el-button v-if="jl3dmodelShow && !isContest && project !== 'bjd'" size="small" @click="jumpjlmap3dmodel">{{ jl3dmodel }}</el-button>
|
||||
<el-button v-if="$route.query.lineCode === '15'" size="small" @click="clCaAnCall">经典案例分析</el-button>
|
||||
<el-button v-if="$route.query.lineCode === '15'" size="small" @click="normStudy">规范学习</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<Jl3d-Device
|
||||
@ -13,19 +15,21 @@
|
||||
:panel-show="deviceShow"
|
||||
@closedevice3dview="jumpjlmap3dmodel"
|
||||
/>
|
||||
<draw-select ref="drawSelect" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Jl3dDevice from '@/views/jlmap3d/device/jl3ddevice';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { getPostByProjectCode } from '@/api/learn';
|
||||
import { ProjectCode } from '@/scripts/ProjectConfig';
|
||||
import DrawSelect from '@/jmapNew/theme/datie_01/menus/dialog/drawSelect';
|
||||
export default {
|
||||
name:'DemonMenu',
|
||||
components:{
|
||||
Jl3dDevice,
|
||||
DrawSelect
|
||||
},
|
||||
props:{
|
||||
isAllShow:{
|
||||
@ -140,6 +144,12 @@ export default {
|
||||
this.btnWidth = 0;
|
||||
}
|
||||
},
|
||||
clCaAnCall() {
|
||||
this.$refs.drawSelect.doShow(null, 'clCaAn');
|
||||
},
|
||||
normStudy() {
|
||||
this.$refs.drawSelect.doShow(null, 'normStudy');
|
||||
},
|
||||
jumpjlmap3dmodel() {
|
||||
if (this.deviceif == false) {
|
||||
this.deviceif = true;
|
||||
|
@ -8,7 +8,6 @@
|
||||
import MapCommon from './common/index';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { creatSubscribe, clearSubscribe, displayTopic, getTopic } from '@/utils/stomp';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { getSimulationMemberList, getAllSimulationUser } from '@/api/simulation';
|
||||
import { getMemberListCommon, getUserListCommon } from '@/api/rtSimulation';
|
||||
import parseStatus from '@/utils/parseStatus';
|
||||
@ -25,7 +24,6 @@ export default {
|
||||
stomp: null,
|
||||
currentMap: null,
|
||||
ierval: null,
|
||||
checkLine: null,
|
||||
mouseNum: 1,
|
||||
mouseNumTime: 0,
|
||||
mapBoxP: null,
|
||||
@ -80,7 +78,6 @@ export default {
|
||||
this.mode = this.$route.params.mode || '';
|
||||
this.currentMap = this.$refs.mapCommon;
|
||||
this.groupModel = this.$route.query.group;
|
||||
this.checkLoginLineTimer(); // 心跳发送
|
||||
this.checkMouseStatusTimer(); // 鼠标样式变化检测
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
@ -152,19 +149,6 @@ export default {
|
||||
clearInterval(this.ierval);
|
||||
this.ierval = null;
|
||||
}
|
||||
if (this.checkLine) {
|
||||
clearInterval(this.checkLine);
|
||||
this.checkLine = null;
|
||||
}
|
||||
},
|
||||
// 设置检查在线定时器
|
||||
checkLoginLineTimer() {
|
||||
if (this.checkLine) {
|
||||
clearTimeout(this.checkLine);
|
||||
}
|
||||
this.checkLine = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
},
|
||||
// 设置手标显示状态
|
||||
checkMouseStatusTimer() {
|
||||
|
@ -52,7 +52,6 @@
|
||||
<script>
|
||||
import { saveMap, getMapDetail, verifyMap, postBuildMapImport, getRouteNewList, getAutoReentryList } from '@/api/jmap/mapdraft';
|
||||
import { ViewMode, TrainingMode, getDeviceMenuByDeviceType, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
||||
import MapOperate from './mapoperate/index';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
@ -85,7 +84,6 @@ export default {
|
||||
autoSaveTask: null,
|
||||
selected: null,
|
||||
mapInfo: { name: this.$t('map.pleaseSelectMap') },
|
||||
timeDemon: null,
|
||||
oldDevice: null,
|
||||
draftShow: false,
|
||||
size: {
|
||||
@ -138,9 +136,6 @@ export default {
|
||||
mounted() {
|
||||
this.setWindowSize();
|
||||
this.loadInitPage();
|
||||
this.timeDemon = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
EventBus.$on('SELECTON', () => {
|
||||
this.selected = null;
|
||||
});
|
||||
@ -149,9 +144,6 @@ export default {
|
||||
EventBus.$off('SELECTON');
|
||||
this.clearAutoSave();
|
||||
this.$store.dispatch('map/mapClear');
|
||||
if (this.timeDemon) {
|
||||
clearTimeout(this.timeDemon);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickRightBtn() {
|
||||
|
@ -36,7 +36,6 @@
|
||||
<script>
|
||||
import { saveMap, verifyMap, getMapDetail, postBuildMapImport, getRouteNewList, getAutoReentryList } from '@/api/jmap/mapdraft';
|
||||
import { ViewMode, TrainingMode, getDeviceMenuByDeviceType, DeviceMenu } from '@/scripts/ConstDic';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import JlmapVisual from '@/views/newMap/jlmapNew/index';
|
||||
import MapOperate from './mapoperate/index';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
@ -59,7 +58,6 @@ export default {
|
||||
autoSaveTask: null,
|
||||
selected: null,
|
||||
mapInfo: { name: this.$t('map.pleaseSelectMap') },
|
||||
timeDemon: null,
|
||||
oldDevice: null,
|
||||
draftShow: false,
|
||||
size: {
|
||||
@ -112,9 +110,6 @@ export default {
|
||||
mounted() {
|
||||
this.setWindowSize();
|
||||
this.loadInitPage();
|
||||
this.timeDemon = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
EventBus.$on('SELECTON', () => {
|
||||
this.selected = null;
|
||||
});
|
||||
@ -123,9 +118,6 @@ export default {
|
||||
EventBus.$off('SELECTON');
|
||||
this.clearAutoSave();
|
||||
this.$store.dispatch('map/mapClear');
|
||||
if (this.timeDemon) {
|
||||
clearTimeout(this.timeDemon);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickRightBtn() {
|
||||
|
223
src/views/newMap/newMapdraftSystem/mapoperate/arrow.vue
Normal file
223
src/views/newMap/newMapdraftSystem/mapoperate/arrow.vue
Normal file
@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="card">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
||||
<operate-property
|
||||
ref="dataform"
|
||||
:form="form"
|
||||
:edit-model="editModel"
|
||||
:rules="rules"
|
||||
type="Arrow"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
<create-operate
|
||||
ref="createForm"
|
||||
:add-model="addModel"
|
||||
:create-form="form"
|
||||
:create-rules="rules"
|
||||
@create="create"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
import { mapGetters } from 'vuex';
|
||||
// import getModel from './models.js';
|
||||
import { getUID } from '@/jmapNew/utils/Uid';
|
||||
import OperateProperty from './components/operateProperty';
|
||||
import CreateOperate from './components/createOperate';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
|
||||
export default {
|
||||
name: 'StationStandDraft',
|
||||
components: {
|
||||
OperateProperty,
|
||||
CreateOperate
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
lazy: true,
|
||||
editModel: {
|
||||
_type: 'Arrow',
|
||||
code: '',
|
||||
lineWidth: 2,
|
||||
length: 15,
|
||||
rotate: 0,
|
||||
color: 'rgba(255, 255, 255, 1)',
|
||||
triangleLength: 10,
|
||||
triangleHeight: 6,
|
||||
position: {x:0, y:0}
|
||||
},
|
||||
addModel: {
|
||||
_type: 'Arrow',
|
||||
code: '',
|
||||
lineWidth: 2,
|
||||
length: 15,
|
||||
rotate: 0,
|
||||
color: 'rgba(255, 255, 255, 1)',
|
||||
triangleLength: 10,
|
||||
triangleHeight: 6,
|
||||
position: {x:0, y:0}
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLine'), trigger: 'blur' }
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: this.$t('rules.trainPositionX'), trigger: 'blur' }
|
||||
],
|
||||
'position.y': [
|
||||
{ required: true, message: this.$t('rules.trainPositionY'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'arrowList'
|
||||
]),
|
||||
showConditionsList() {
|
||||
const showConditionsList = ConstConfig.ConstSelect.showConditionsList;
|
||||
return Cookies.get('user_lang') == 'en'
|
||||
? showConditionsList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: showConditionsList.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
},
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: {
|
||||
draw: {
|
||||
name: this.activeName == 'first' ? this.$t('map.drawData') : '',
|
||||
item: [
|
||||
{ prop: 'code', label: '箭头编码', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.arrowList, deviceChange: this.deviceChange, isHidden:this.activeName == 'second' },
|
||||
{ prop: 'position', label: '坐标:', type: 'coordinate', width: '120px', children: [
|
||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
||||
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
||||
] },
|
||||
{ prop: 'length', label: '长度:', type: 'number', min:1, placeholder: 'px'},
|
||||
{ prop: 'lineWidth', label: this.$t('map.lineWidth'), type: 'number', min: 1, placeholder: 'px' },
|
||||
{ prop: 'triangleLength', label: '三角长度:', type: 'number', min: 1, placeholder: 'px'},
|
||||
{ prop: 'triangleHeight', label: '三角高度:', type: 'number', min: 1, placeholder: 'px'},
|
||||
{ prop: 'rotate', label: '旋转角度', type: 'number', max: 360, placeholder: '度' },
|
||||
{ prop: 'color', label: '颜色:', type: 'color' }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
return form;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
this.$refs.createForm && this.$refs.createForm.resetFields();
|
||||
if (selected && selected._type.toUpperCase() === 'Arrow'.toUpperCase()) {
|
||||
this.activeName = 'first';
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
});
|
||||
}
|
||||
},
|
||||
clear() {
|
||||
this.addModel = {
|
||||
_type: 'Arrow',
|
||||
code: '',
|
||||
lineWidth: 2,
|
||||
length: 15,
|
||||
color: 'rgba(255, 255, 255, 1)',
|
||||
triangleLength: 10,
|
||||
triangleHeight: 6,
|
||||
position: {x:0, y:0}
|
||||
};
|
||||
this.$refs.createForm && this.$refs.createForm.resetFields();
|
||||
},
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
create() {
|
||||
const model = deepAssign(this.addModel, {code: getUID('Arrow', this.arrowList)});
|
||||
this.$emit('updateMapModel', model);
|
||||
this.clear();
|
||||
},
|
||||
updateMapModel(data) {
|
||||
this.$emit('updateMapModel', data);
|
||||
},
|
||||
deleteObj() {
|
||||
this.$refs.dataform.deleteObj();
|
||||
},
|
||||
// 修改对象
|
||||
edit() {
|
||||
this.$refs.dataform.edit();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.card {
|
||||
height: 100%;
|
||||
}
|
||||
.coordinate {
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
line-height: 40px;
|
||||
padding: 0 12px 0 0;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
line-height: 28px;
|
||||
width: 120px;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
.point-section {
|
||||
/*float: left;*/
|
||||
position: absolute;
|
||||
left: 120px;
|
||||
width: calc(100% - 120px);
|
||||
}
|
||||
|
||||
.point-button {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
float: left;
|
||||
|
||||
/deep/ {
|
||||
.el-icon-plus,
|
||||
.el-icon-minus {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-input-number--mini {
|
||||
width: 110px;
|
||||
}
|
||||
</style>
|
@ -29,6 +29,8 @@
|
||||
<script>
|
||||
import LineDraft from './line';
|
||||
import TextDraft from './text';
|
||||
import RectDraft from './rect';
|
||||
import ArrowDraft from './arrow';
|
||||
// import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
@ -54,7 +56,9 @@ export default {
|
||||
lazy: true,
|
||||
tabList:[
|
||||
{label: this.$t('map.line'), name:'Line', menus:LineDraft},
|
||||
{label: this.$t('map.text'), name:'Text', menus:TextDraft}
|
||||
{label: this.$t('map.text'), name:'Text', menus:TextDraft},
|
||||
{label: '矩形', name:'Rect', menus: RectDraft},
|
||||
{label: '箭头', name:'Arrow', menus: ArrowDraft}
|
||||
],
|
||||
selectDevice:'',
|
||||
enabledTab: 'Line'
|
||||
|
@ -52,28 +52,28 @@ export default {
|
||||
lazy: true,
|
||||
LineTypeList: [],
|
||||
centralizedStationList: [],
|
||||
directionType: [
|
||||
{ name: '左端', code: 'left' },
|
||||
{ name: '右端', code: 'right' }
|
||||
],
|
||||
editModel: {
|
||||
code: '',
|
||||
type: '',
|
||||
width: 1,
|
||||
lineColor: '',
|
||||
showConditions: '01',
|
||||
points: [],
|
||||
stationCode: '',
|
||||
offsetX: 0,
|
||||
offsetY: 0
|
||||
pointShow: false,
|
||||
directionPoint: 'left',
|
||||
radiusWidth: 5
|
||||
},
|
||||
addModel: {
|
||||
type: '',
|
||||
width: 1,
|
||||
showConditions: '01',
|
||||
lineColor: 'rgba(255, 255, 255, 1)',
|
||||
points: [
|
||||
{ x: 0, y: 0 },
|
||||
{ x: 100, y: 100 }
|
||||
],
|
||||
offsetX: 0,
|
||||
offsetY: 0
|
||||
]
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
@ -113,13 +113,12 @@ export default {
|
||||
item: [
|
||||
{ prop: 'code', label: this.$t('map.lineCoding'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.lineList, deviceChange: this.deviceChange },
|
||||
{ prop: 'type', label: this.$t('map.lineType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.LineTypeList },
|
||||
{ prop: 'lineColor', label: this.$t('map.lineColor'), type: 'color' },
|
||||
{ prop: 'lineColor', label: this.$t('map.lineColor') + ':', type: 'color' },
|
||||
{ prop: 'pointShow', label: '端点显示:', type: 'checkbox' },
|
||||
{ prop: 'directionPoint', label: '端点方向:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.directionType, isHidden: this.isPointShow },
|
||||
{ prop: 'radiusWidth', label: '端点半径:', type: 'number', min: 0, width: '150px', isHidden: this.isPointShow },
|
||||
{ prop: 'width', label: this.$t('map.lineWidth'), type: 'number', min: 1, placeholder: 'px' },
|
||||
{ prop: 'showConditions', label: this.$t('map.showConditions'), type: 'radio', optionLabel: 'label', optionValue:'value', radioList: this.showConditionsList},
|
||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint },
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList },
|
||||
{ prop: 'offsetX', label: '右侧设备X偏移:', type: 'number', min: 0, isHidden: !this.isFoldLine },
|
||||
{ prop: 'offsetY', label: '右侧设备Y偏移:', type: 'number', min: 0, isHidden: !this.isFoldLine }
|
||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint }
|
||||
]
|
||||
},
|
||||
map: {
|
||||
@ -141,7 +140,6 @@ export default {
|
||||
{ prop: 'type', label: this.$t('map.lineType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.LineTypeList},
|
||||
{ prop: 'width', label: this.$t('map.lineWidth'), type: 'number', min:1, placeholder: 'px'},
|
||||
{ prop: 'lineColor', label: this.$t('map.lineColor'), type: 'color' },
|
||||
{ prop: 'showConditions', label: this.$t('map.showConditions'), type: 'radio', optionLabel: 'label', optionValue:'value', radioList: this.showConditionsList},
|
||||
{ prop: 'points', label: this.$t('map.linePoint'), type: 'points', width: '100px', hiddenSpan:true, addPoint: this.addPointAddModel, delPoint: this.delPointAddModel }
|
||||
]
|
||||
}
|
||||
@ -152,8 +150,8 @@ export default {
|
||||
isPointsShow() {
|
||||
return this.editModel.points.length > 0;
|
||||
},
|
||||
isFoldLine() {
|
||||
return this.editModel.type == '03';
|
||||
isPointShow() {
|
||||
return !this.editModel.pointShow;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -205,7 +203,6 @@ export default {
|
||||
code: getUID('Line', this.lineList),
|
||||
type: this.addModel.type,
|
||||
width: this.addModel.width,
|
||||
showConditions: this.addModel.showConditions,
|
||||
lineColor: this.addModel.lineColor,
|
||||
points: JSON.parse(pointArr)
|
||||
};
|
||||
|
267
src/views/newMap/newMapdraftSystem/mapoperate/rect.vue
Normal file
267
src/views/newMap/newMapdraftSystem/mapoperate/rect.vue
Normal file
@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" class="card">
|
||||
<el-tab-pane class="view-control" :label="$t('map.property')" name="first" :lazy="lazy">
|
||||
<operate-property
|
||||
ref="dataform"
|
||||
:form="form"
|
||||
:edit-model="editModel"
|
||||
:rules="rules"
|
||||
type="Line"
|
||||
@updateMapModel="updateMapModel"
|
||||
@clearDeviceSelect="clearDeviceSelect"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane class="view-control" :label="$t('map.newConstruction')" name="second" :lazy="lazy">
|
||||
<create-operate
|
||||
ref="createForm"
|
||||
:create-form="createForm"
|
||||
:add-model="addModel"
|
||||
:create-rules="rules"
|
||||
@create="create"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmapNew/utils/Uid';
|
||||
import OperateProperty from './components/operateProperty';
|
||||
import CreateOperate from './components/createOperate';
|
||||
import { deepAssign } from '@/utils/index';
|
||||
|
||||
export default {
|
||||
name: 'StationStandDraft',
|
||||
components: {
|
||||
OperateProperty,
|
||||
CreateOperate
|
||||
},
|
||||
props: {
|
||||
selected: {
|
||||
type: Object,
|
||||
default: function () {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: 'first',
|
||||
lazy: true,
|
||||
LineTypeList: [],
|
||||
directionType: [
|
||||
{ name: '左端', code: 'left' },
|
||||
{ name: '右端', code: 'right' }
|
||||
],
|
||||
editModel: {
|
||||
code: '',
|
||||
width: 40,
|
||||
height: 40,
|
||||
lineWidth: 2,
|
||||
lineColor: '',
|
||||
fillColor: '',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
},
|
||||
addModel: {
|
||||
width: 40,
|
||||
height: 40,
|
||||
lineWidth: 2,
|
||||
lineColor: 'rgba(255, 255, 255, 1)',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
code: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLine'), trigger: 'blur' }
|
||||
],
|
||||
width: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectLineWidth'), trigger: 'blur' }
|
||||
],
|
||||
height: [
|
||||
{ required: true, message: '请输入高度', trigger: 'blur' }
|
||||
],
|
||||
'position.x': [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterXCoordinate'), trigger: 'blur' }
|
||||
],
|
||||
'position.y': [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterYCoordinate'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('map', [
|
||||
'rectList'
|
||||
]),
|
||||
showConditionsList() {
|
||||
const showConditionsList = ConstConfig.ConstSelect.showConditionsList;
|
||||
return Cookies.get('user_lang') == 'en'
|
||||
? showConditionsList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: showConditionsList.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
},
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: {
|
||||
code: {
|
||||
name: '',
|
||||
item: []
|
||||
},
|
||||
draw: {
|
||||
name: this.$t('map.drawData'),
|
||||
item: [
|
||||
{ prop: 'code', label: this.$t('map.lineCoding'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.rectList, deviceChange: this.deviceChange },
|
||||
{ prop: 'lineColor', label: '边框颜色:', type: 'color' },
|
||||
{ prop: 'fillColor', label: '填充颜色:', type: 'color' },
|
||||
{ prop: 'width', label: '宽度:', type: 'number', min: 1, placeholder: 'px' },
|
||||
{ prop: 'height', label: '高度:', type: 'number', min: 1, placeholder: 'px' },
|
||||
{ prop: 'lineWidth', label: '边框宽度:', type: 'number', min:1, placeholder: 'px'},
|
||||
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
|
||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
|
||||
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
|
||||
] }
|
||||
]
|
||||
},
|
||||
map: {
|
||||
name: this.$t('map.mapData'),
|
||||
item: [
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
return form;
|
||||
},
|
||||
createForm() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items:{
|
||||
all:{
|
||||
name:'',
|
||||
item: [
|
||||
{ prop: 'width', label: '宽度:', type: 'number', min:1, placeholder: 'px'},
|
||||
{ prop: 'height', label: '高度:', type: 'number', min:1, placeholder: 'px'},
|
||||
{ prop: 'lineColor', label: this.$t('map.lineColor'), type: 'color' },
|
||||
{ prop: 'lineWidth', label: '边框宽度:', type: 'number', min:1, placeholder: 'px'},
|
||||
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
|
||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
|
||||
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
|
||||
] }
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
return form;
|
||||
},
|
||||
isPointShow() {
|
||||
return !this.editModel.pointShow;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$Dictionary.lineType().then(list => {
|
||||
this.LineTypeList = list;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
clearDeviceSelect() {
|
||||
this.$emit('deviceSelect', '');
|
||||
},
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
this.deviceSelect(this.$store.getters['map/getDeviceByCode'](code));
|
||||
},
|
||||
deviceSelect(selected) {
|
||||
if (selected && selected._type.toUpperCase() === 'Line'.toUpperCase()) {
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
this.$refs.dataform && this.$refs.dataform.resetFields();
|
||||
this.activeName = 'first';
|
||||
this.editModel = deepAssign(this.editModel, selected);
|
||||
}
|
||||
},
|
||||
create() {
|
||||
const model = {
|
||||
_type: 'Rect',
|
||||
code: getUID('Rect', this.rectList),
|
||||
width: this.addModel.width,
|
||||
height: this.addModel.height,
|
||||
lineColor: this.addModel.lineColor,
|
||||
lineWidth: this.addModel.lineWidth,
|
||||
position: {
|
||||
x: this.addModel.position.x,
|
||||
y: this.addModel.position.y
|
||||
}
|
||||
};
|
||||
this.$emit('updateMapModel', model);
|
||||
this.$refs.createForm.resetForm();
|
||||
},
|
||||
updateMapModel(data) {
|
||||
this.$emit('updateMapModel', data);
|
||||
},
|
||||
deleteObj() {
|
||||
this.$refs.dataform.deleteObj();
|
||||
},
|
||||
// 修改对象
|
||||
edit() {
|
||||
this.$refs.dataform.edit();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.card {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.coordinate {
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
line-height: 40px;
|
||||
padding: 0 12px 0 0;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
line-height: 28px;
|
||||
width: 120px;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
.point-section {
|
||||
/*float: left;*/
|
||||
position: absolute;
|
||||
left: 120px;
|
||||
width: calc(100% - 120px);
|
||||
}
|
||||
|
||||
.point-button {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
float: left;
|
||||
|
||||
/deep/ {
|
||||
.el-icon-plus,
|
||||
.el-icon-minus {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-input-number--mini {
|
||||
width: 110px;
|
||||
}
|
||||
</style>
|
@ -57,17 +57,14 @@ export default {
|
||||
content: '',
|
||||
font: '',
|
||||
fontColor: '',
|
||||
// showConditions: '01',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
},
|
||||
stationCode: ''
|
||||
}
|
||||
},
|
||||
addModel: {
|
||||
prepend: 'H',
|
||||
content: '',
|
||||
// showConditions: '01',
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0
|
||||
@ -127,8 +124,8 @@ export default {
|
||||
{ prop: 'position', label: this.$t('map.textPoints'), type: 'coordinate', width: '120px', children: [
|
||||
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
|
||||
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
|
||||
] },
|
||||
{ prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }
|
||||
] }
|
||||
// { prop: 'stationCode', label: this.$t('map.equipmentStation') + ':', type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.centralizedStationList }
|
||||
]
|
||||
},
|
||||
map: {
|
||||
|
@ -67,10 +67,10 @@ export default {
|
||||
title: '商品数量',
|
||||
prop: 'amount'
|
||||
},
|
||||
{
|
||||
title: '商品单价',
|
||||
prop: 'price'
|
||||
},
|
||||
// {
|
||||
// title: '商品单价',
|
||||
// prop: 'price'
|
||||
// },
|
||||
// {
|
||||
// title: this.$t('orderAuthor.mapProductName'),
|
||||
// prop: 'mapProductName'
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
<script>
|
||||
import { admin } from '@/router/index';
|
||||
import { listPackagePermission, restorePackagePermission, getPackageQrCode, setCommodityStatus, putDistributeBack } from '@/api/management/distribute';
|
||||
import { listPackagePermission, getPackageQrCode, setCommodityStatus } from '@/api/management/distribute';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import QrCode from '@/components/QrCode';
|
||||
import Qcode from './Qcode';
|
||||
@ -46,7 +46,7 @@ export default {
|
||||
},
|
||||
creatorId: {
|
||||
type: 'select',
|
||||
label: '创建者',
|
||||
label: '创建人员',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
@ -83,6 +83,10 @@ export default {
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '权限分发Id',
|
||||
prop: 'id'
|
||||
},
|
||||
{
|
||||
title: this.$t('orderAuthor.organizationOrEnterprise'),
|
||||
prop: 'organizationName'
|
||||
@ -181,19 +185,19 @@ export default {
|
||||
handleClick: this.handleBelongs,
|
||||
type: '',
|
||||
showControl: (row) => { return row.amount !== row.remains; }
|
||||
},
|
||||
{
|
||||
name: '权限回退',
|
||||
handleClick: this.handleRestore,
|
||||
type: 'danger',
|
||||
showControl: (row) => { return row.status == '1' && row.canRestore; }
|
||||
},
|
||||
{
|
||||
name: '回收分发权限',
|
||||
handleClick: this.handleRestoreUser,
|
||||
type: 'danger',
|
||||
showControl: (row) => { return row.status == '1' && row.canRestore && row.amount !== row.remains; }
|
||||
}
|
||||
// {
|
||||
// name: '权限回退',
|
||||
// handleClick: this.handleRestore,
|
||||
// type: 'danger',
|
||||
// showControl: (row) => { return row.status == '1' && row.canRestore; }
|
||||
// },
|
||||
// {
|
||||
// name: '回收分发权限',
|
||||
// handleClick: this.handleRestoreUser,
|
||||
// type: 'danger',
|
||||
// showControl: (row) => { return row.status == '1' && row.canRestore && row.amount !== row.remains; }
|
||||
// }
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -259,34 +263,34 @@ export default {
|
||||
this.$messageBox(this.$t('tip.getQRCodeFailure'));
|
||||
});
|
||||
},
|
||||
handleRestore(index, row) {
|
||||
this.$confirm('该分发权限是否回退到用户权限', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
restorePackagePermission(row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleRestoreUser(index, row) {
|
||||
this.$confirm('是否回收用户领取的权限', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
putDistributeBack(row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
// handleRestore(index, row) {
|
||||
// this.$confirm('该分发权限是否回退到用户权限', this.$t('global.tips'), {
|
||||
// confirmButtonText: this.$t('global.confirm'),
|
||||
// cancelButtonText: this.$t('global.cancel'),
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// restorePackagePermission(row.id).then(resp => {
|
||||
// this.reloadTable();
|
||||
// this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
|
||||
// });
|
||||
// }).catch(() => { });
|
||||
// },
|
||||
// handleRestoreUser(index, row) {
|
||||
// this.$confirm('是否回收用户领取的权限', this.$t('global.tips'), {
|
||||
// confirmButtonText: this.$t('global.confirm'),
|
||||
// cancelButtonText: this.$t('global.cancel'),
|
||||
// type: 'warning'
|
||||
// }).then(() => {
|
||||
// putDistributeBack(row.id).then(resp => {
|
||||
// this.reloadTable();
|
||||
// this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
|
||||
// }).catch(() => {
|
||||
// this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
|
||||
// });
|
||||
// }).catch(() => { });
|
||||
// },
|
||||
handlerPermission() {
|
||||
this.$refs.qcode.doShow();
|
||||
},
|
||||
|
@ -2,21 +2,26 @@
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<detail ref="detail" :permission-type-list="PermissionTypeList" />
|
||||
<belong ref="belong" :permission-type-list="PermissionTypeList" :effective-type-list="EffectiveTypeList" />
|
||||
<!-- <belong ref="belong" :permission-type-list="PermissionTypeList" :effective-type-list="EffectiveTypeList" /> -->
|
||||
<PermissionList ref="list" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPermision, setLessonPermisson, putUserPermissionBackPackage, putUserPermissionBackUser } from '@/api/management/author';
|
||||
// putUserPermissionBackUser
|
||||
import { listPermision, setLessonPermisson, putUserPermissionTakeBackAll } from '@/api/management/author';
|
||||
import Detail from './detail';
|
||||
import Belong from './belong';
|
||||
// import Belong from './belong';
|
||||
import PermissionList from './permissionList';
|
||||
// import localStore from 'storejs';
|
||||
import localStore from 'storejs';
|
||||
|
||||
export default {
|
||||
name: 'Author',
|
||||
components: {
|
||||
Detail,
|
||||
Belong
|
||||
// Belong,
|
||||
PermissionList
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -33,7 +38,8 @@ export default {
|
||||
queryObject: {
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: this.$t('permission.userName')
|
||||
label: this.$t('permission.userName'),
|
||||
value: this.$route.query.distributeId ? '' : (localStore.get(this.$route.path) || {}).userName
|
||||
},
|
||||
status: {
|
||||
type: 'select',
|
||||
@ -66,6 +72,10 @@ export default {
|
||||
indexShow: true,
|
||||
defaultSort:{prop:'sortOrder', order:''},
|
||||
columns: [
|
||||
{
|
||||
title: '用户权限Id',
|
||||
prop: 'id'
|
||||
},
|
||||
{
|
||||
title: this.$t('permission.userName'),
|
||||
prop: 'userName',
|
||||
@ -160,14 +170,14 @@ export default {
|
||||
return row.status === '1';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: this.$t('orderAuthor.transferAttribution'), // 转赠归属
|
||||
handleClick: this.handleBelongs,
|
||||
type: '',
|
||||
showControl: (row) => {
|
||||
return row.status === '1' && row.amount !== row.remains;
|
||||
}
|
||||
},
|
||||
// {
|
||||
// name: this.$t('orderAuthor.transferAttribution'), // 转赠归属
|
||||
// handleClick: this.handleBelongs,
|
||||
// type: '',
|
||||
// showControl: (row) => {
|
||||
// return row.status === '1' && row.amount !== row.remains;
|
||||
// }
|
||||
// },
|
||||
{
|
||||
name: this.$t('global.details'), // 详情
|
||||
handleClick: this.handleRoleVest,
|
||||
@ -175,17 +185,29 @@ export default {
|
||||
showControl: (row) => { return !row.permissionType; }
|
||||
},
|
||||
{
|
||||
name: '回收到权限集',
|
||||
handleClick: this.handleRestorePackage,
|
||||
type: 'danger',
|
||||
showControl: (row) => { return row.status === '1' && !row.canDistribute; }
|
||||
name: '权限流向',
|
||||
handleClick: this.handleRestoreList,
|
||||
type: '',
|
||||
showControl: (row) => { return row.status == '1' && row.amount !== row.remains; }
|
||||
},
|
||||
{
|
||||
name: '回收到用户',
|
||||
name: '一键回收',
|
||||
handleClick: this.handleRestoreUser,
|
||||
type: 'danger',
|
||||
showControl: (row) => { return row.status === '1' && !row.canDistribute; }
|
||||
showControl: (row) => { return row.status == '1' && row.amount !== row.remains; }
|
||||
}
|
||||
// {
|
||||
// name: '回收到权限集',
|
||||
// handleClick: this.handleRestorePackage,
|
||||
// type: 'danger',
|
||||
// showControl: (row) => { return row.status === '1' && !row.canDistribute; }
|
||||
// },
|
||||
// {
|
||||
// name: '回收到用户',
|
||||
// handleClick: this.handleRestoreUser,
|
||||
// type: 'danger',
|
||||
// showControl: (row) => { return row.status === '1' && !row.canDistribute; }
|
||||
// }
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -219,31 +241,20 @@ export default {
|
||||
formatterDate(row, porpInfo) {
|
||||
return row[porpInfo.property] ? row[porpInfo.property] : this.$t('global.perpetual');
|
||||
},
|
||||
handleRestorePackage(index, row) {
|
||||
this.$confirm('是否回收该用户权限到权限包中', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
putUserPermissionBackPackage(row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
handleRestoreList(index, row) {
|
||||
this.$refs.list.doShow(index, row);
|
||||
},
|
||||
handleRestoreUser(index, row) {
|
||||
this.$confirm('是否回收该用户权限到用户权限中', this.$t('global.tips'), {
|
||||
this.$confirm('是否回收所有分发出去的权限', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
putUserPermissionBackUser(row.id).then(resp => {
|
||||
putUserPermissionTakeBackAll(row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
|
||||
this.$message.success('权限回收成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
|
||||
this.$messageBox('权限回收失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
@ -272,7 +283,7 @@ export default {
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleBelongs(index, row) {
|
||||
this.$refs.belong.doShow(row.id);
|
||||
// this.$refs.belong.doShow(row.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
136
src/views/orderauthor/rules/permissionList.vue
Normal file
136
src/views/orderauthor/rules/permissionList.vue
Normal file
@ -0,0 +1,136 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="this.$t('orderAuthor.packingDetails')" :visible.sync="dialogShow" width="1000px" :before-close="close">
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPermissonList, putUserPermissionBackUser } from '@/api/management/author';
|
||||
|
||||
export default {
|
||||
name: 'Author',
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
id: '',
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: true,
|
||||
show: false,
|
||||
queryObject: {
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('permission.userName'),
|
||||
prop: 'userName'
|
||||
},
|
||||
{
|
||||
title: this.$t('permission.nickName'),
|
||||
prop: 'userName'
|
||||
},
|
||||
{
|
||||
title: '开始时间',
|
||||
prop: 'startTime',
|
||||
type: 'formatter',
|
||||
formatter: this.formatterDate
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
prop: 'endTime',
|
||||
type: 'formatter',
|
||||
formatter: this.formatterDate
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'formatter',
|
||||
formatter: this.formatterDate
|
||||
},
|
||||
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
buttons: [
|
||||
{
|
||||
name: '权限回收',
|
||||
handleClick: this.handleRestore,
|
||||
type: 'danger',
|
||||
showControl: (row) => {
|
||||
return row.status === '1';
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doShow(index, row) {
|
||||
console.log(row);
|
||||
this.id = row.id;
|
||||
this.dialogShow = true;
|
||||
this.reloadTable();
|
||||
},
|
||||
close() {
|
||||
this.id = '';
|
||||
this.dialogShow = false;
|
||||
},
|
||||
formatterDate(row, porpInfo) {
|
||||
return row[porpInfo.property] ? row[porpInfo.property] : this.$t('global.perpetual');
|
||||
},
|
||||
handleRestore(index, row) {
|
||||
this.$confirm('是否回收该用户的权限', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
putUserPermissionBackUser(row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success(this.$t('tip.recoveryPrivilegesSuccessful'));
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.recoveryPrivilegesFailed'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
queryFunction() {
|
||||
if (this.id) {
|
||||
return getPermissonList(this.id);
|
||||
}
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
turnback() {
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
width: 400px;
|
||||
text-align: center;
|
||||
margin: 20px auto;
|
||||
}
|
||||
</style>
|
@ -64,7 +64,6 @@ import MovePlaningTrain from '../components/menus/movePlaningTrain';
|
||||
import ModifyingStationIntervalTime from '../components/menus/modifyingStationIntervalTime';
|
||||
import ModifyingStationStopTime from '../components/menus/modifyingStationStopTime';
|
||||
import { deletePlanService } from '@/api/runplan';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
|
||||
export default {
|
||||
@ -92,7 +91,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
PlanParser: {},
|
||||
timeDemon: null,
|
||||
runPlanList: [],
|
||||
loadRunPlanId: '',
|
||||
loadRunPlanName: '',
|
||||
@ -114,9 +112,6 @@ export default {
|
||||
this.PlanParser = this.$theme.loadPlanParser(this.lineCode);
|
||||
},
|
||||
async mounted() {
|
||||
this.timeDemon = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
this.loadRunPlanName = this.$route.query.planName;
|
||||
if (this.$route.query.mapId) {
|
||||
// this.refreshRunPlanList(true);
|
||||
@ -124,9 +119,6 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.timeDemon) {
|
||||
clearTimeout(this.timeDemon);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dispatchDialog(dialogObj) {
|
||||
|
@ -50,7 +50,6 @@ import MovePlaningTrain from '../components/menus/movePlaningTrain';
|
||||
import ModifyingStationIntervalTime from '../components/menus/modifyingStationIntervalTime';
|
||||
import ModifyingStationStopTime from '../components/menus/modifyingStationStopTime';
|
||||
import { deletePlanService } from '@/api/runplan';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
|
||||
export default {
|
||||
@ -79,7 +78,6 @@ export default {
|
||||
planId: '',
|
||||
planTitle: '',
|
||||
PlanParser: {},
|
||||
timeDemon: null,
|
||||
runplanLoading: false
|
||||
};
|
||||
},
|
||||
@ -104,13 +102,9 @@ export default {
|
||||
if (this.mapId) {
|
||||
this.runplanLoading = true;
|
||||
await loadMapDataById(this.mapId, 'parse');
|
||||
this.timeDemon = setInterval(_ => checkLoginLine(), 5000 * 60);
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.timeDemon) {
|
||||
clearTimeout(this.timeDemon);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dispatchDialog(dialogObj) {
|
||||
|
@ -68,7 +68,6 @@ import ModifyingStationIntervalTime from '../components/menus/modifyingStationIn
|
||||
import ModifyingStationStopTime from '../components/menus/modifyingStationStopTime';
|
||||
import CreateEmptyPlan from './menus/createEmptyPlan';
|
||||
import { deletePlanService } from '@/api/runplan';
|
||||
import { checkLoginLine } from '@/api/login';
|
||||
import { loadMapDataById } from '@/utils/loaddata';
|
||||
import { getRpListByMapId } from '@/api/runplan';
|
||||
|
||||
@ -98,7 +97,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
PlanParser: {},
|
||||
timeDemon: null,
|
||||
runPlanList: [],
|
||||
loadRunPlanId: '',
|
||||
loadRunPlanName: '',
|
||||
@ -119,9 +117,6 @@ export default {
|
||||
this.PlanParser = this.$theme.loadPlanParser(this.lineCode);
|
||||
},
|
||||
async mounted() {
|
||||
this.timeDemon = setInterval(() => {
|
||||
checkLoginLine();
|
||||
}, 5000 * 60);
|
||||
// this.loadRunPlanName = this.$route.query.planName;
|
||||
if (this.$route.query.mapId) {
|
||||
this.refreshRunPlanList(true);
|
||||
@ -129,9 +124,6 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.timeDemon) {
|
||||
clearTimeout(this.timeDemon);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dispatchDialog(dialogObj) {
|
||||
|
@ -1,18 +1,55 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog v-dialogDrag :title="'['+fileName+'] 绑定地图数据'" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center class="uploadDialog">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column
|
||||
label="地图"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getMapName(scope.row.mapId) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="isSomeType"
|
||||
size="mini"
|
||||
@click="handleEdit(scope.row)"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDelete(scope.$index,scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row style="margin-top: 10px;">
|
||||
<el-col :span="12">
|
||||
<div>
|
||||
<span>绑定新地图:</span>
|
||||
<el-select v-model="mapId" size="mini" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in mapList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
:disabled="computedDisable(item)"
|
||||
/>
|
||||
</el-select>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-button size="mini" type="primary" :disabled="!mapId" style="margin-left: 10px;" @click="createNew">新建</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
<bind-map-info ref="bindMapInfo" :map-list="mapList" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getPublishMapList } from '@/api/jmap/map';
|
||||
import { getFileBindInfo } from '@/api/pdf';
|
||||
import { deleteFileBindMapData, getFileBindMapData, bindUploadFile } from '@/api/pdf';
|
||||
import BindMapInfo from './bindMapInfo';
|
||||
export default {
|
||||
name:'BindMap',
|
||||
@ -24,33 +61,17 @@ export default {
|
||||
mapList:[],
|
||||
fileId:'',
|
||||
fileName:'',
|
||||
fileType: '',
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
mapId:''
|
||||
}
|
||||
tableData: [],
|
||||
mapId: '',
|
||||
showTypeList: ['DRAWING', 'BA_DE_TR']
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'mapId', label: '选择线路:', type:'select', options: this.mapList, optionValue:'id', optionLabel:'name' }
|
||||
// change: true, onChange: this.handleMap
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
mapId: [
|
||||
{ required: true, message: ' 地图不能为空', trigger: 'blur'},
|
||||
{ required: true, message: ' 地图不能为空', trigger: 'change'}
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
isSomeType() {
|
||||
return this.showTypeList.includes(this.fileType);
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
const params = {
|
||||
@ -63,32 +84,59 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
doShow(data) {
|
||||
this.fileId = data.id;
|
||||
this.fileName = data.fileName;
|
||||
this.dialogVisible = true;
|
||||
this.mapId = '';
|
||||
getFileBindMapData(data.id).then(resp => {
|
||||
this.tableData = resp.data;
|
||||
this.fileId = data.id;
|
||||
this.fileType = data.fileType;
|
||||
this.fileName = data.fileName;
|
||||
this.dialogVisible = true;
|
||||
}).catch(error => {
|
||||
this.$message.error('获取绑定地图数据失败:' + error.message);
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
mapId: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (self.fileId) {
|
||||
getFileBindInfo(self.fileId, self.formModel.mapId).then((res) => {
|
||||
let data = null;
|
||||
if (res.data) {
|
||||
data = res.data;
|
||||
}
|
||||
this.$refs.bindMapInfo.doShow(self.formModel.mapId, self.fileId, data, self.fileName);
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
// self.$message.error(`上传PDF失败:${error.message}`);
|
||||
});
|
||||
}
|
||||
computedDisable(map) {
|
||||
const index = this.tableData.findIndex(item => map.id === item.mapId);
|
||||
return index >= 0;
|
||||
},
|
||||
getMapName(mapId) {
|
||||
const map = this.mapList.find(item => { return item.id === mapId; });
|
||||
return map.name;
|
||||
},
|
||||
handleEdit(row) {
|
||||
this.$refs.bindMapInfo.doShow(row.mapId, this.fileId, row, this.fileName,);
|
||||
},
|
||||
createNew() {
|
||||
if (this.isSomeType) {
|
||||
this.$refs.bindMapInfo.doShow(this.mapId, this.fileId, null, this.fileName);
|
||||
} else {
|
||||
const data = {
|
||||
fileId:this.fileId,
|
||||
mapId:this.mapId,
|
||||
deviceTypes:[],
|
||||
deviceIds:[]
|
||||
};
|
||||
bindUploadFile(data).then((res) => {
|
||||
this.$message.success('绑定成功');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
console.log(error);
|
||||
this.$message.error(`绑定失败:${error.message}`);
|
||||
});
|
||||
}
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
deleteFileBindMapData(row.id).then(resp => {
|
||||
this.tableData.splice(index, 1);
|
||||
}).catch(error => {
|
||||
this.$message.error('删除绑定数据失败:' + error.message);
|
||||
});
|
||||
},
|
||||
reloadTable() {
|
||||
|
@ -55,7 +55,7 @@
|
||||
>{{ $t('map.activate') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button style="margin-left: 190px;margin-top: 30px; " type="primary" size="medium" @click="create">创建</el-button>
|
||||
<el-button style="margin-left: 190px;margin-top: 30px; " type="primary" size="medium" @click="create">{{ typeName }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -81,6 +81,7 @@ export default {
|
||||
fileName:'',
|
||||
loadingMap:false,
|
||||
field:'',
|
||||
typeName: '',
|
||||
formModel:{
|
||||
fileId:'',
|
||||
mapId:'',
|
||||
@ -111,6 +112,9 @@ export default {
|
||||
if (data) {
|
||||
this.formModel.deviceTypes = data.deviceTypes;
|
||||
this.formModel.deviceIds = data.deviceIds || [];
|
||||
this.typeName = '编辑';
|
||||
} else {
|
||||
this.typeName = '创建';
|
||||
}
|
||||
this.fileName = fileName;
|
||||
this.formModel.mapId = mapId;
|
||||
|
@ -15,6 +15,7 @@ import { postUploadFile, putUploadFile } from '@/api/pdf';
|
||||
// import { dbReadData, dbAddData, dbUpdateData } from '@/utils/indexedDb';
|
||||
// uploadFile
|
||||
import { meansUrl } from '@/api/upload';
|
||||
import { DrawingType } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'TrainingDetailEdit',
|
||||
@ -30,13 +31,19 @@ export default {
|
||||
formModel: {
|
||||
upload: '',
|
||||
filePath: '',
|
||||
fileType: 'DRAWING',
|
||||
fileType: DrawingType.drawing,
|
||||
fileName:''
|
||||
},
|
||||
fileList: [],
|
||||
formData: '',
|
||||
id: '',
|
||||
message:''
|
||||
message:'',
|
||||
fileTypeList: [
|
||||
{label: '设备图纸', value: DrawingType.drawing},
|
||||
{label: '基础设备培训', value: DrawingType.baDeTr},
|
||||
{label: '经典案例分析', value: DrawingType.clCaAn},
|
||||
{label: '规范学习', value: DrawingType.normStudy}
|
||||
]
|
||||
// deviceTypeList: [
|
||||
// { label: '区段', value: 'sectionList', code: 'SECTION' },
|
||||
// { label: '道岔', value: 'switchList', code: 'SWITCH' },
|
||||
@ -60,6 +67,7 @@ export default {
|
||||
// { prop: 'deviceTypes', label: '选择设备类型:', type:'select', options: this.deviceTypeList, optionValue:'value', optionLabel:'label', change: true, onChange: this.handleDevice },
|
||||
// { prop: 'deviceIds', label: '选择设备:', type:'select', multiple: true, options: this.deviceCodesList, optionValue:'code', optionLabel:'name' },
|
||||
{ prop: 'fileName', label: '文件名:', type:'text', show:true, rightWidth:true, required:true },
|
||||
{ prop: 'fileType', label: '文件类型', type: 'select', options: this.fileTypeList, optionValue: 'value', optionLabel: 'label'},
|
||||
{ prop: 'upload', label: '上传:', type:'uploadPicture', fileList: this.fileList, show: this.type == 'ADD', action: this.action, onChange: this.onChange, onSuccess: this.onSuccess }
|
||||
]
|
||||
};
|
||||
@ -69,6 +77,9 @@ export default {
|
||||
const crules = {
|
||||
fileName: [
|
||||
{ required: true, message: '文件名不能为空', trigger: 'blur'}
|
||||
],
|
||||
fileType: [
|
||||
{ required: true, message: '文件类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
// upload: [
|
||||
// { required: true, message: '请上传文件', trigger: 'onChange' }
|
||||
@ -92,15 +103,20 @@ export default {
|
||||
this.formModel = {
|
||||
upload: '',
|
||||
fileName:data.fileName,
|
||||
fileType: data.fileType,
|
||||
filePath: data.filePath
|
||||
};
|
||||
} else {
|
||||
this.formModel = {
|
||||
upload: '',
|
||||
filePath: '',
|
||||
fileType: DrawingType.drawing,
|
||||
fileName:''
|
||||
};
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.dataform.clearFiles();
|
||||
});
|
||||
},
|
||||
// async handleMap(mapId) {
|
||||
// if (mapId) {
|
||||
@ -174,7 +190,7 @@ export default {
|
||||
create() {
|
||||
const self = this;
|
||||
const data = {
|
||||
fileType: 'DRAWING',
|
||||
fileType: this.formModel.fileType,
|
||||
filePath: this.formModel.filePath,
|
||||
fileName:this.formModel.fileName
|
||||
};
|
||||
@ -191,7 +207,7 @@ export default {
|
||||
const self = this;
|
||||
const data = {
|
||||
id: this.id,
|
||||
fileType: 'DRAWING',
|
||||
fileType: this.formModel.fileType,
|
||||
fileName:this.formModel.fileName,
|
||||
filePath: this.formModel.filePath
|
||||
};
|
||||
@ -208,6 +224,7 @@ export default {
|
||||
this.formModel = {
|
||||
upload: '',
|
||||
filePath: '',
|
||||
fileType: DrawingType.drawing,
|
||||
fileName:''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
|
@ -58,6 +58,11 @@
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="pdf名称" prop="fileName" />
|
||||
<el-table-column label="文件类型" prop="fileType">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ fileTypeMap[scope.row.fileType] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="路径" prop="filePath" />
|
||||
<el-table-column label="时间" prop="createTime" />
|
||||
<el-table-column label="操作" width="450">
|
||||
@ -74,7 +79,7 @@
|
||||
<Edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||
<Bind-Map ref="bindMap" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
</template>'
|
||||
|
||||
<script>
|
||||
// import { getPublishMapDetailById, getPublishMapVersionById } from '@/api/jmap/map';
|
||||
@ -99,7 +104,13 @@ export default {
|
||||
// },
|
||||
// mapList: [],
|
||||
// graphDataNew:null,
|
||||
deviceIdList:[]
|
||||
deviceIdList:[],
|
||||
fileTypeMap: {
|
||||
DRAWING: '设备图纸',
|
||||
BA_DE_TR: '基础设备培训',
|
||||
CL_CA_AN: '经典案例分析',
|
||||
NORM_STUDY: '规范学习'
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user