Merge remote-tracking branch 'origin/test'

This commit is contained in:
fan 2021-05-20 17:59:33 +08:00
commit eec1210b3f
64 changed files with 3487 additions and 311 deletions

View File

@ -86,3 +86,34 @@ 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({
url: `/api/userPermission/${id}/back`,
method: 'put'
});
}
/** 收回用户权限(专用)到用户权限中 */
export function putUserPermissionBackUser(id) {
return request({
url: `/api/userPermission/${id}/back/up`,
method: 'put'
});
}

View File

@ -75,3 +75,10 @@ export function createProjectPackage(projectCode, num) {
method: 'post'
});
}
/** 收回从该权限分发获取的用户权限 */
export function putDistributeBack(id) {
return request({
url: `/api/distribute/${id}/back`,
method: 'put'
});
}

View File

@ -43,6 +43,14 @@ export function saveUserSubscribe(data) {
});
}
/** 查询管理员和超管*/
export function getAdminAndSuperAdminList() {
return request({
url: `/api/user/adminAndSuperAdmin`,
method: 'get'
});
}
// 修改用户信息
export function updateUserInfo(data) {
return request({

View File

@ -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'
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
src/assets/baSiDi/dbup.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/assets/baSiDi/down.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
src/assets/baSiDi/left.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/assets/baSiDi/right.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/assets/baSiDi/up.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

@ -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) {

View File

@ -17,7 +17,7 @@
<template v-if="checkColumnIndex(rIndex, index)">
<el-col :key="index" :span="24/columnNum*field.columnNeed">
<template v-if="checkFieldType(field, 'text', name)">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-input
v-model="formModel[name]"
type="text"
@ -27,7 +27,7 @@
</el-form-item>
</template>
<template v-else-if="checkFieldType(field, 'date', name)">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-date-picker
v-model="formModel[name]"
type="date"
@ -37,7 +37,7 @@
</el-form-item>
</template>
<template v-else-if="checkFieldType(field, 'daterange', name)">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-date-picker
v-model="formModel[name]"
type="daterange"
@ -47,7 +47,7 @@
</el-form-item>
</template>
<template v-else-if="checkFieldType(field, 'time', name)">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-time-picker
v-model="formModel[name]"
type="time"
@ -57,7 +57,7 @@
</el-form-item>
</template>
<template v-else-if="checkFieldType(field, 'timerange', name)">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-time-picker
v-model="formModel[name]"
type="timerange"
@ -68,7 +68,7 @@
</el-form-item>
</template>
<template v-else-if="checkFieldType(field, 'datetime', name)">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-date-picker
v-model="formModel[name]"
type="datetime"
@ -78,7 +78,7 @@
</el-form-item>
</template>
<template v-else-if="checkFieldType(field, 'datetimerange', name)">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-date-picker
v-model="formModel[name]"
type="datetimerange"
@ -88,7 +88,7 @@
</el-form-item>
</template>
<template v-else-if="checkFieldType(field, 'select', name)">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-select
v-if="field.show !== false && !(field.noClearable)"
:ref="name"
@ -125,7 +125,7 @@
</el-form-item>
</template>
<template v-else-if="checkFieldType(field, 'complete')">
<el-form-item :prop="name" :label="field.label">
<el-form-item v-if="!field.hide" :prop="name" :label="field.label">
<el-autocomplete
v-if="field.show !== false"
v-model="formModel[name]"
@ -215,9 +215,9 @@ export default {
}
},
columnNum: {
type: Number,
type: Number,
default() {
return 4;
return 4;
}
}
},
@ -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;

View File

@ -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);

View File

@ -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>

View File

@ -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);
}
}
}

View File

@ -211,6 +211,29 @@ export function JobPaneData() {
},
],
},
{
name:"厅巡岗",
value:"txg",
text:"",
picurl:"",
controlList:[
//联控
{
name:"联控",
data:[],
},
//动作
{
name:"动作",
data:[],
},
//口呼
{
name:"口呼",
data:[],
},
],
},
{
name:"平台岗",
value:"ptg",

View File

@ -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);

File diff suppressed because it is too large Load Diff

View File

@ -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);
}
}

View File

@ -211,6 +211,29 @@ export function JobPaneData() {
},
],
},
{
name:"厅巡岗",
value:"txg",
text:"",
picurl:"",
controlList:[
//联控
{
name:"联控",
data:[],
},
//动作
{
name:"动作",
data:[],
},
//口呼
{
name:"口呼",
data:[],
},
],
},
{
name:"平台岗",
value:"ptg",

View File

@ -1,6 +1,8 @@
const systemGraphType = {
Line: 'Line',
Text: 'Text'
Text: 'Text',
Rect: 'Rect',
Arrow: 'Arrow'
};
export default systemGraphType;

View File

@ -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);

View File

@ -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;
}
}
}

View 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 };
}
}

View File

@ -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);
}
}
}

View 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;
}
}

View File

@ -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;

View File

@ -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('图纸检索失败!');
});

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -9,26 +9,35 @@
:z-index="2000"
>
<div class="trainOverView">
<div class="trainViewList">
<div v-if="trainViewList.length>0" class="trainViewList">
<div v-for="(eachTrainView,index) in trainViewList" :key="index" class="eachTrainView">
<div class="eachTrainViewIn">
<!-- <div class="eachTrainViewInL" /> -->
<div class="eachTrainViewInRhom" />
<!-- <div class="eachTrainViewInR" /> -->
<!-- -->
<div class="eachTrainTrunkS">{{ 'W'+eachTrainView+'0' }}</div>
<div class="eachTrainTrunkD" @click="toTrainTrunkDetail(index)">
<img :src="trainTrunkDown" class="trainTrunkDown">
</div>
<div class="eachTrainTrunkE">{{ 'W'+eachTrainView+'6' }}</div>
</div>
</div>
</div>
</div>
<train-trunk-detail ref="trainTrunkDetail" :train-view-list="trainViewList" />
</el-dialog>
</template>
<script>
import trainTrunkDown from '@/assets/baSiDi/up.png';
import TrainTrunkDetail from './trainTrunkDetail.vue';
export default {
name:'Tra',
components:{
TrainTrunkDetail
},
data() {
return {
dialogShow: false,
trainViewList:[]
trainViewList:[],
trainTrunkDown:trainTrunkDown
};
},
computed: {
@ -42,7 +51,6 @@ export default {
watch:{
'$store.state.map.activeTrainListChange': function (val) {
if (val) {
debugger;
this.activeTrainList = this.$store.state.map.activeTrainList;
}
}
@ -51,7 +59,6 @@ export default {
doShow() {
this.dialogShow = true;
this.$nextTick(function () {
debugger;
this.trainViewList = this.$store.state.map.activeTrainList;
});
},
@ -59,6 +66,9 @@ export default {
// this.loading = false;
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
toTrainTrunkDetail(index) {
this.$refs.trainTrunkDetail.doShow(index);
}
}
};
@ -103,14 +113,52 @@ export default {
.eachTrainViewIn{
height: 60px;
border-bottom: 1px #484848 solid;
overflow: hidden;
position: relative;
}
/* .eachTrainViewInL{}
.eachTrainViewInR{} */
.eachTrainViewInRhow{
.eachTrainViewInRhom{
width: 224px;
height: 60px;
border: 1px #dedede solid;
transform: skew(20deg, 0deg);
border-left: 1px #828282 solid;
transform: skew(-30deg, 0deg);
-webkit-transform-origin: bottom center;
transform-origin: bottom center;
border-bottom: 1px #828282 solid;
overflow: hidden;
}
.eachTrainViewInRhom:before{
content: '';
transform: skew(50deg, 0deg);
transform-origin: bottom center;
position:absolute;
width:100%;
height: 100%;
border-top: 1px #828282 solid;
border-right: 1px #828282 solid;
}
.eachTrainTrunkS{
position: absolute;
font-size: 18px;
color: #5E5E5E;
left: 30px;
top: 20px;
}
.eachTrainTrunkD{
position: absolute;
left: 99px;
top: 16px;
cursor: pointer;
}
.trainTrunkDown{
width: 25px;
transform-origin: center center;
transform: rotate(180deg);
}
.eachTrainTrunkE{
position: absolute;
font-size: 18px;
color: #5E5E5E;
right: 30px;
top: 20px;
}
</style>

View File

@ -0,0 +1,344 @@
<template>
<el-dialog
class="haerbin-01__systerm"
:width="'1000px'"
:modal="false"
:close-on-click-modal="false"
:title="title"
:visible.sync="show"
:before-close="doClose"
>
<!-- :fullscreen="true" -->
<div class="trainTrunkView">
<div class="trainTrunkViewT">
<img :src="trainTrunkUp" class="trainTrunkUp" @click="doClose">
<div class="trainTrunkTtext">
<div class="trainTrunkTtextIn">OBCU</div>
<div class="trainTrunkTtextIn">Overview</div>
</div>
</div>
<div class="trainTrunkViewM">
<div class="trainTrunkViewMT">
<div class="eachTrunkViewInRhom" />
<div class="trainTrunkViewMTL">
<div class="trainTrunkViewMTL1">
<div class="trainTrunkViewMTLEach">ATP</div>
<div class="trainTrunkViewMTLEach">ATO</div>
</div>
<div class="trainTrunkViewMTL2">
<div class="trainTrunkViewMTL2L" />
<div class="trainTrunkViewMTL2R">
<div class="trainTrunkViewLine">
<div class="trainTrunkViewDot" style="top: -3px;left: -3px;" />
<div class="trainTrunkViewDot" style="top: -3px;left: 103px;" />
</div>
</div>
</div>
<div class="trainTrunkViewMTL3">
<div class="trainTrunkViewMTLEach">ITF</div>
<div class="trainTrunkViewMTLEach">HMI</div>
<div class="trainTrunkViewMTLEach">TMS</div>
</div>
</div>
<div class="trainTrunkViewMTR">
<div class="trainTrunkViewMTR1">
<div class="trainTrunkViewMTLEach">ATO</div>
<div class="trainTrunkViewMTLEach">ATP</div>
</div>
<div class="trainTrunkViewMTR2">
<div class="trainTrunkViewMTR2L">
<div class="trainTrunkViewLine">
<div class="trainTrunkViewDot" style="top: -3px;left: -3px;" />
<div class="trainTrunkViewDot" style="top: -3px;left: 103px;" />
</div>
</div>
<div class="trainTrunkViewMTR2R" />
</div>
<div class="trainTrunkViewMTR3">
<div class="trainTrunkViewMTLEach">TMS</div>
<div class="trainTrunkViewMTLEach">HMI</div>
<div class="trainTrunkViewMTLEach">ITF</div>
</div>
</div>
</div>
<div class="trainTrunkViewMB">
<div class="trainTrunkViewMBL">{{ 'W'+trainCode+'0' }}</div>
<div class="trainTrunkViewMBR">{{ 'W'+trainCode+'6' }}</div>
</div>
</div>
<div class="trainTrunkViewB">
<div v-if="prev" class="trainTrunkViewBL">
<img :src="trainTrunkUp" class="trainTrunkLeft" @click="doPrev">
<div class="trainTrunkViewBLIn">
<div class="trainTrunkViewBLInRhom" />
<div class="trainTrunkViewBLInL">{{ 'W'+prev+'0' }}</div>
<div class="trainTrunkViewBLInR">{{ 'W'+prev+'6' }}</div>
</div>
</div>
<div v-if="next" class="trainTrunkViewBB">
<div class="trainTrunkViewBRIn">
<div class="trainTrunkViewBLInRhom" />
<div class="trainTrunkViewBLInL">{{ 'W'+next+'0' }}</div>
<div class="trainTrunkViewBLInR">{{ 'W'+next+'6' }}</div>
</div>
<img :src="trainTrunkUp" class="trainTrunkRight" @click="doNext">
</div>
</div>
</div>
</el-dialog>
</template>
<script>
import trainTrunkUp from '@/assets/baSiDi/up.png';
export default {
name:'TrainTrunkDetail',
props:{
trainViewList:{
type:Array,
required:true
}
},
data() {
return {
dialogShow: false,
trainCode:'',
prev:'',
next:'',
index:0,
trainTrunkUp:trainTrunkUp
};
},
computed: {
show() {
return this.dialogShow && !this.$store.state.menuOperation.break;
},
title() {
return '列车详览';
}
},
methods:{
doShow(index) {
this.index = index;
this.dialogShow = true;
this.init();
},
init() {
this.trainCode = this.trainViewList[this.index];
this.prev = '';
if (this.index > 0) {
this.prev = this.trainViewList[this.index - 1];
}
this.next = '';
if ((this.index + 1) < this.trainViewList.length) {
this.next = this.trainViewList[this.index + 1];
}
},
doClose() {
this.dialogShow = false;
this.$store.dispatch('training/emitTipFresh');
},
doPrev() {
this.index--;
this.init();
},
doNext() {
this.index++;
this.init();
}
}
};
</script>
<style lang="scss" scoped>
.trainTrunkView{
width: 100%;
background: #000;
display: inline-block;
padding: 20px 30px;
}
.trainTrunkUp{
width: 60px;
margin-left: 433px;
display: inline-block;
cursor: pointer;
}
.trainTrunkTtext{
display: inline-block;
vertical-align: top;
margin-left: 0px;
color: #fff;
font-size: 26px;
}
.trainTrunkTtextIn{margin-bottom:5px;letter-spacing: 2px;}
.trainTrunkViewMT{
width: 800px;
height: 210px;
margin-left: 58px;
margin-top: 25px;
position: relative;
}
.eachTrunkViewInRhom{
width: 800px;
height: 210px;
border-left: 1px #828282 solid;
transform: skew(-30deg, 0deg);
-webkit-transform-origin: bottom center;
transform-origin: bottom center;
border-bottom: 1px #828282 solid;
overflow: hidden;
}
.eachTrunkViewInRhom:before{
content: '';
transform: skew(50deg, 0deg);
transform-origin: bottom center;
position:absolute;
width:100%;
height: 100%;
border-top: 1px #828282 solid;
border-right: 1px #828282 solid;
}
.trainTrunkViewMTL{
position: absolute;
left: 0;
top: 0;
width: 400px;
height: 100%;
border-right: 1px #fff dashed;
font-size:0;
}
.trainTrunkViewMTR{
position: absolute;
right: 0;
top: 0;
width: 400px;
height: 100%;
font-size: 0;
}
.trainTrunkViewMTL1{margin-left: 177px;margin-top: 28px;font-size: 0;}
.trainTrunkViewMTR1{margin-left: 34px;margin-top: 28px;font-size: 0;}
.trainTrunkViewMTL2{height: 59px;margin-left:100px;display: inline-block;}
.trainTrunkViewMTL2L{
width: 117px;
border-left: 1px #fff solid;
height: 34px;
margin-top: 25px;
border-top: 1px #fff solid;
display: inline-block;
}
.trainTrunkViewMTR2R{width: 106px;border-top: 1px #fff solid;display: inline-block;margin-top: 25px;border-right: 1px #fff solid;height: 34px;}
.trainTrunkViewMTR2{height: 59px;margin-left:75px;display: inline-block;}
.trainTrunkViewMTR2L{
width: 108px;
height: 59px;
border-left: 1px #fff solid;
display: inline-block;
vertical-align: top;
border-right: 1px #fff solid;
}
.trainTrunkViewMTL2R{
width: 108px;
height: 59px;
border-left: 1px #fff solid;
display: inline-block;
vertical-align: top;
border-right: 1px #fff solid;
}
.trainTrunkViewMTL3{margin-left: 65px;font-size: 0;}
.trainTrunkViewMTR3{margin-left: 34px;font-size: 0;}
.trainTrunkViewMTLEach{
padding: 10px 0px;
width:80px;
text-align:center;
font-size: 24px;
color: #5F5F5F;
border: 1px #5F5F5F solid;
display: inline-block;
letter-spacing: 4px;
margin-right: 30px;
cursor: pointer;
}
.trainTrunkViewDot{
position:absolute;
width: 6px;
height: 6px;
border-radius: 5px;
background: #fff;
}
.trainTrunkViewLine{
width: 107px;
height: 33px;
border-top: 1px #fff solid;
margin-top: 25px;
position: relative;
}
.trainTrunkViewMB{padding: 20px 123px;}
.trainTrunkViewMBL{font-size: 40px;color: #fff;display:inline-block;margin-left: 75px;letter-spacing: 5px;}
.trainTrunkViewMBR{font-size: 40px;color: #fff;display:inline-block;float:right;margin-right:75px;letter-spacing: 5px;}
.trainTrunkViewBL{display: inline-block;}
.trainTrunkLeft{
width: 60px;
transform-origin: center center;
transform: rotate(-90deg);
cursor: pointer;
}
.trainTrunkViewB{margin-top: 20px;}
.trainTrunkViewBB{display: inline-block;float: right;}
.trainTrunkRight{
width: 60px;
transform-origin: center center;
transform: rotate(90deg);
cursor: pointer;
}
.trainTrunkViewBLIn,.trainTrunkViewBRIn{
width: 220px;
height: 50px;
display: inline-block;
vertical-align: top;
position: relative;
}
.trainTrunkViewBLIn{margin-left: 20px;}
.trainTrunkViewBRIn{margin-right: 20px;}
.trainTrunkViewBLInRhom{
width: 100%;
height: 100%;
border-left: 1px #828282 solid;
transform: skew(-30deg, 0deg);
-webkit-transform-origin: bottom center;
transform-origin: bottom center;
border-bottom: 1px #828282 solid;
overflow: hidden;
}
.trainTrunkViewBLInRhom:before{
content: '';
transform: skew(50deg, 0deg);
transform-origin: bottom center;
position:absolute;
width:100%;
height: 100%;
border-top: 1px #828282 solid;
border-right: 1px #828282 solid;
}
.trainTrunkViewBLInL{
position: absolute;
width: 110px;
height: 100%;
left: 0;
top: 0;
border-right: 1px #fff dashed;
font-size: 20px;
color: #fff;
padding-top: 16px;
letter-spacing: 2px;
padding-left:27px;
}
.trainTrunkViewBLInR{
position: absolute;
width: 110px;
height: 100%;
right: 0;
top: 0;
font-size: 20px;
color: #fff;
padding-top: 16px;
letter-spacing: 2px;
padding-left: 10px;
}
</style>

View File

@ -1,3 +1,12 @@
/**
* 图纸类型
*/
export const DrawingType = {
drawing: 'DRAWING',
baDeTr: 'BA_DE_TR',
clCaAn: 'CL_CA_AN',
normStudy: 'NORM_STUDY'
};
/**
* 鼠标事件
*/

View File

@ -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;

View File

@ -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'; // 杜康

View File

@ -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);

View File

@ -312,8 +312,12 @@
value:"null",
},
{
name:"跳转",
name:"总是跳转",
value:"jump",
},
{
name:"条件跳转",
value:"limitjump",
}
],
}

View File

@ -273,7 +273,7 @@
this.jl3d.attachModel(selectedModel);
},
deleteModel(selectedModel){
this.jl3d.deleteModel(selectedModel);
},
setupclick(){

View File

@ -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>

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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%;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -70,10 +70,10 @@
}
.stepstipstittle{
text-align: center;
font-size: 20px;
font-size: 25px;
}
.stepstipstext{
font-size: 16px;
font-size: 20px;
}

View File

@ -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;

View File

@ -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;

View 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>

View File

@ -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'

View File

@ -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)
};

View 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>

View File

@ -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: {

View File

@ -43,30 +43,42 @@ export default {
selectCheckShow: false,
indexShow: true,
columns: [
// {
// title: this.$t('orderAuthor.organizationOrEnterprise'),
// prop: 'organizationName'
// },
// {
// title: this.$t('orderAuthor.userName'),
// prop: 'userName'
// },
// {
// title: this.$t('orderAuthor.userMobile'),
// prop: 'userMobile'
// },
// {
// title: this.$t('orderAuthor.mapName'),
// prop: 'mapName'
// },
{
title: this.$t('orderAuthor.organizationOrEnterprise'),
prop: 'organizationName'
title: '商品名称',
prop: 'permissionName'
},
{
title: this.$t('orderAuthor.userName'),
prop: 'userName'
},
{
title: this.$t('orderAuthor.userMobile'),
prop: 'userMobile'
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName'
},
{
title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName'
title: '商品数量',
prop: 'amount'
},
// {
// title: '',
// prop: 'price'
// },
// {
// title: this.$t('orderAuthor.mapProductName'),
// prop: 'mapProductName'
// },
// {
// title: this.$t('orderAuthor.courseName'),
// prop: 'lessonName'
// },
{
title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType',

View File

@ -9,12 +9,14 @@
<script>
import { admin } from '@/router/index';
import { listPackagePermission, restorePackagePermission, getPackageQrCode, setCommodityStatus } 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';
import ProjectPackage from './projectPackage';
import { getPublishMapListOnline } from '@/api/jmap/map';
import { getOrganizationList } from '@/api/management/organization';
// import { getPublishMapListOnline } from '@/api/jmap/map';
import { getAdminAndSuperAdminList } from '@/api/management/user';
export default {
name: 'Author',
@ -32,16 +34,30 @@ export default {
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
labelWidth: '100px',
reset: false,
queryObject: {
mapId: {
organizationId: {
type: 'select',
label: this.$t('orderAuthor.mapName'),
label: '组织机构',
config: {
data: []
}
},
creatorId: {
type: 'select',
label: '创建人员',
config: {
data: []
}
},
// mapId: {
// type: 'select',
// label: this.$t('orderAuthor.mapName'),
// config: {
// data: []
// }
// },
canDistribute: {
type: 'select',
label: this.$t('orderAuthor.publicOrPrivate'),
@ -67,6 +83,10 @@ export default {
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '权限分发Id',
prop: 'id'
},
{
title: this.$t('orderAuthor.organizationOrEnterprise'),
prop: 'organizationName'
@ -165,13 +185,19 @@ export default {
handleClick: this.handleBelongs,
type: '',
showControl: (row) => { return row.amount !== row.remains; }
},
{
name: this.$t('orderAuthor.recovery'),
handleClick: this.handleRestore,
type: 'danger',
showControl: (row) => { return row.status == '1' && row.canRestore; }
}
// {
// 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; }
// }
]
}
],
@ -196,11 +222,22 @@ export default {
return true;
});
});
getPublishMapListOnline().then(resp => {
getOrganizationList().then(resp => {
resp.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({value: elem.id, label: elem.name});
this.queryForm.queryObject.organizationId.config.data.push({ value: '' + elem.id, label: elem.name });
});
});
getAdminAndSuperAdminList().then(resp => {
console.log(resp, '====');
resp.data.forEach(elem => {
this.queryForm.queryObject.creatorId.config.data.push({ value: '' + elem.id, label: elem.name });
});
});
// getPublishMapListOnline().then(resp => {
// resp.data.forEach(elem => {
// this.queryForm.queryObject.mapId.config.data.push({value: elem.id, label: elem.name});
// });
// });
},
formatterDate(row, porpInfo) {
return row[porpInfo.property] ? row[porpInfo.property] : this.$t('global.perpetual');
@ -226,20 +263,34 @@ export default {
this.$messageBox(this.$t('tip.getQRCodeFailure'));
});
},
handleRestore(index, row) {
this.$confirm(this.$t('tip.recoveryPrivilegeTip'), 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(() => { });
},
// 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();
},

View File

@ -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 } 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 {
@ -34,9 +39,7 @@ export default {
userName: {
type: 'text',
label: this.$t('permission.userName'),
config: {
data: []
}
value: this.$route.query.distributeId ? '' : (localStore.get(this.$route.path) || {}).userName
},
status: {
type: 'select',
@ -58,9 +61,8 @@ export default {
distributeId: {
type: 'text',
label: this.$t('permission.distributeId'),
config: {
data: []
}
value: this.$route.query.distributeId || ''
// hide: true
}
}
},
@ -70,6 +72,10 @@ export default {
indexShow: true,
defaultSort:{prop:'sortOrder', order:''},
columns: [
{
title: '用户权限Id',
prop: 'id'
},
{
title: this.$t('permission.userName'),
prop: 'userName',
@ -157,27 +163,51 @@ export default {
width: '300',
buttons: [
{
name: this.$t('orderAuthor.setupFailure'),
name: this.$t('orderAuthor.setupFailure'), //
handleClick: this.handleEfficacy,
type: 'warning',
showControl: (row) => {
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'),
name: this.$t('global.details'), //
handleClick: this.handleRoleVest,
type: '',
showControl: (row) => { return !row.permissionType; }
},
{
name: '权限流向',
handleClick: this.handleRestoreList,
type: '',
showControl: (row) => { return row.status == '1' && row.amount !== row.remains; }
},
{
name: '一键回收',
handleClick: this.handleRestoreUser,
type: 'danger',
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; }
// }
]
}
],
@ -211,7 +241,25 @@ export default {
formatterDate(row, porpInfo) {
return row[porpInfo.property] ? row[porpInfo.property] : this.$t('global.perpetual');
},
handleRestoreList(index, row) {
this.$refs.list.doShow(index, row);
},
handleRestoreUser(index, row) {
this.$confirm('是否回收所有分发出去的权限', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
putUserPermissionTakeBackAll(row.id).then(resp => {
this.reloadTable();
this.$message.success('权限回收成功');
}).catch(() => {
this.$messageBox('权限回收失败');
});
}).catch(() => { });
},
queryFunction(params) {
// params.distributeId = this.$route.query.distributeId;
return listPermision(params);
},
reloadTable() {
@ -235,7 +283,7 @@ export default {
}).catch(() => { });
},
handleBelongs(index, row) {
this.$refs.belong.doShow(row.id);
// this.$refs.belong.doShow(row.id);
}
}
};

View 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>

View File

@ -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() {

View File

@ -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;

View File

@ -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();

View File

@ -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.