Merge branch 'master' of https://git.qcloud.com/joylink/jl-nclient
# Conflicts: # src/main.js
This commit is contained in:
commit
b15a7feb23
@ -5,7 +5,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<title></title>
|
||||
<script src="/static/inflate.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -6,6 +6,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.png">
|
||||
<title><%= webpackConfig.name %></title>
|
||||
<script src="/static/inflate.min.js"></script>
|
||||
<script src="/static/three.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
|
@ -2,46 +2,54 @@ import request from '@/utils/request';
|
||||
|
||||
/** 分页查找仿真任务*/
|
||||
export function getQuestPageList(params) {
|
||||
return request({
|
||||
url: `/api/quest/paging`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
return request({
|
||||
url: `/api/quest/paging`,
|
||||
method: 'get',
|
||||
params: params
|
||||
});
|
||||
}
|
||||
/** 创建任务 */
|
||||
export function createQuest(data) {
|
||||
return request({
|
||||
url: `/api/quest`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/quest`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 根据任务id删除任务 */
|
||||
export function deleteQuest(id) {
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
/** 根据id查询任务基础信息 */
|
||||
export function getQuestById(id) {
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
/** 根据id查询任务基础信息 */
|
||||
export function getQuestByIdList(id) {
|
||||
return request({
|
||||
url: `/api/quest/${id}/detail`,
|
||||
method: 'get'
|
||||
});
|
||||
return request({
|
||||
url: `/api/quest/${id}/detail`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
/** 更新任务基本信息 */
|
||||
export function updateQuest(id, data) {
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
return request({
|
||||
url: `/api/quest/${id}`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
/** 更新任务地图定位信息 */
|
||||
export function updateMapLocation(id, data) {
|
||||
return request({
|
||||
url: `/api/quest/${id}/mapLocation`,
|
||||
method: 'put',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -367,4 +367,21 @@ export function getSimulationInfo(group) {
|
||||
url: `/api/simulation/${group}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/** 获取可用的设备指令*/
|
||||
export function getAvailableDeviceCommand() {
|
||||
return request({
|
||||
url: `/api/simulation/deviceCommand/available`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/** 保存/修改任务剧本*/
|
||||
export function saveTaskScript(group,data) {
|
||||
return request({
|
||||
url: `/api/simulation/${group}/questRecord/script`,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
@ -1,10 +1,4 @@
|
||||
export function SetRender(dom) {
|
||||
console.log(dom.clientWidth);
|
||||
console.log(dom.clientHeight);
|
||||
console.log(dom.innerWidth);
|
||||
console.log(dom.innerHeight);
|
||||
console.log(dom.offsetWidth);
|
||||
console.log(dom.offsetHeight);
|
||||
var renderer = new THREE.WebGLRenderer({antialias: true});
|
||||
renderer.setSize(dom.offsetWidth, dom.offsetHeight);
|
||||
//renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
|
@ -22,8 +22,8 @@ import '@/scripts/GlobalPlugin';
|
||||
import '@/directives';
|
||||
import messages from '@/i18n/index';
|
||||
|
||||
window.THREE = require('@/jlmap3d/main/three.min.js');
|
||||
window.zlib = require('@/jlmap3d/main/inflate.min.js');
|
||||
// window.THREE = require('@/jlmap3d/main/three.min.js');
|
||||
// window.zlib = require('@/jlmap3d/main/inflate.min.js');
|
||||
|
||||
Vue.use(ElementUI);
|
||||
Vue.use(VueI18n);
|
||||
|
@ -370,10 +370,18 @@ export const asyncRouter = [
|
||||
meta: {
|
||||
title: '课程编辑'
|
||||
}
|
||||
},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/script',
|
||||
component: Layout,
|
||||
meta: {
|
||||
roles: [admin, user]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'manage/scriptmanage',
|
||||
name: '剧本管理',
|
||||
path: 'scriptmanage',
|
||||
component: resolve => require(['@/views/lesson/scriptmanage/list'], resolve),
|
||||
meta: {
|
||||
title: '剧本管理'
|
||||
|
@ -1,7 +1,7 @@
|
||||
export default {
|
||||
ConstSelect: {
|
||||
// 剧本录制模块枚举
|
||||
deviceType: [
|
||||
{label: 'Link', value: 'Link'},
|
||||
{label: '进路', value: 'Route'},
|
||||
{label: '区段', value: 'Section'},
|
||||
{label: '信号机', value: 'Signal'},
|
||||
@ -10,6 +10,17 @@ export default {
|
||||
{label: '控制模式', value: 'StationControl'},
|
||||
{label: '道岔', value: 'Switch'},
|
||||
{label: '列车', value: 'Train'},
|
||||
],
|
||||
// 行为触发条件类型
|
||||
triggerType:[
|
||||
{label: '对话', value: 'Conversation'},
|
||||
{label: '设备', value: 'DeviceCondition'},
|
||||
{label: '无', value: 'None'},
|
||||
],
|
||||
// 动作类型
|
||||
actionType:[
|
||||
{label: '对话', value: 'Conversation'},
|
||||
{label: '指令', value: 'Command'},
|
||||
]
|
||||
}
|
||||
};
|
@ -12,6 +12,7 @@ import trainingList from './modules/trainingList';
|
||||
import exam from './modules/exam';
|
||||
import runPlan from './modules/runplan';
|
||||
import socket from './modules/socket';
|
||||
import scriptRecord from './modules/scriptRecord';
|
||||
|
||||
import getters from './getters';
|
||||
|
||||
@ -30,7 +31,8 @@ const store = new Vuex.Store({
|
||||
trainingList,
|
||||
exam,
|
||||
runPlan,
|
||||
socket
|
||||
socket,
|
||||
scriptRecord
|
||||
},
|
||||
getters
|
||||
});
|
||||
|
81
src/store/modules/scriptRecord.js
Normal file
81
src/store/modules/scriptRecord.js
Normal file
@ -0,0 +1,81 @@
|
||||
/**
|
||||
* 实训状态数据
|
||||
*/
|
||||
const scriptRecord = {
|
||||
namespaced: true,
|
||||
state: {
|
||||
deviceConditionList: [], //任务目标列表
|
||||
memberList:[], //角色列表,
|
||||
script:[], //剧本列表,
|
||||
memberName:"", //角色名称,
|
||||
behaviorName:"", //动作名称
|
||||
},
|
||||
getters: {
|
||||
deviceConditionList: (state) => {
|
||||
return state.deviceConditionList;
|
||||
},
|
||||
memberList:(state)=>{
|
||||
return state.memberList;
|
||||
},
|
||||
script:(state)=>{
|
||||
return state.script;
|
||||
},
|
||||
memberName:(state)=>{
|
||||
return state.memberName;
|
||||
},
|
||||
behaviorName:(state)=>{
|
||||
return state.behaviorName;
|
||||
},
|
||||
},
|
||||
mutations: {
|
||||
setDeviceCondition: (state, deviceConditionList) => {
|
||||
state.deviceConditionList = deviceConditionList;
|
||||
},
|
||||
setMemberList: (state, memberList) => {
|
||||
state.memberList = memberList;
|
||||
},
|
||||
setScript:(state, script) => {
|
||||
state.script = script;
|
||||
},
|
||||
setMemberName:(state, memberName) => {
|
||||
state.memberName = memberName;
|
||||
},
|
||||
setBehaviorName:(state, behaviorName) => {
|
||||
state.behaviorName = behaviorName;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
/**
|
||||
* 设置任务目标列表
|
||||
*/
|
||||
updateDeviceCondition: ({ commit }, deviceConditionList) => {
|
||||
commit('setDeviceCondition', deviceConditionList);
|
||||
},
|
||||
/**
|
||||
* 设置角色列表
|
||||
*/
|
||||
updateMemberList: ({ commit }, memberList) => {
|
||||
commit('setMemberList', memberList);
|
||||
},
|
||||
/**
|
||||
* 设置剧本列表
|
||||
*/
|
||||
updateScript: ({ commit }, script) => {
|
||||
commit('setScript', script);
|
||||
},
|
||||
/**
|
||||
* 设置角色名称
|
||||
*/
|
||||
updateMemberName:({ commit }, memberName) => {
|
||||
commit('setMemberName', memberName);
|
||||
},
|
||||
/**
|
||||
* 设置动作名称
|
||||
*/
|
||||
updateBehaviorName:({ commit }, behaviorName) => {
|
||||
commit('setBehaviorName', behaviorName);
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
export default scriptRecord;
|
@ -1,30 +1,45 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="addAction">
|
||||
<i class="el-icon-back" @click="backToMember"></i>
|
||||
<span>添加动作</span>
|
||||
</div>
|
||||
<el-form :model="action" ref="action" :rules="rules" label-width="80px" class="actionInfo" label-position="right" style="margin-top:15px">
|
||||
<el-form-item label="动作类型" class="conditionVO" prop="type">
|
||||
<el-select v-model="action.type " placeholder="请选择动作类型">
|
||||
<el-form :model="modalData" ref="modalData" :rules="rules" label-width="80px" class="actionInfo" label-position="right" style="margin-top:15px">
|
||||
<el-form-item label="动作类型" class="conditionVO" prop="action.type">
|
||||
<el-select v-model="modalData.action.type " placeholder="请选择动作类型" @change="changeType" class="inputStyle">
|
||||
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成时间" class="conditionVO">
|
||||
<el-input-number v-model="action.time " class="inputStyle" :min="0"></el-input-number>
|
||||
<el-input-number v-model="modalData.action.time " class="inputStyle" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="回复消息" class="conditionVO" prop="reply">
|
||||
<el-input v-model="action.reply" class="inputStyle"></el-input>
|
||||
<el-form-item label="回复消息" class="conditionVO" prop="action.reply" v-if="isConversitionAdd">
|
||||
<el-input v-model="modalData.action.reply" type="textarea" class="textareaStyle" rows="3"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备指令" class="conditionVO" prop="action.deviceCommand" v-if="isCommandAdd">
|
||||
<el-select v-model="modalData.action.deviceCommand " placeholder="请选择设备指令" @change="changeCommand" class="inputStyle">
|
||||
<el-option v-for="deviceCommand in deviceCommandList" :key="deviceCommand.deviceCommand" :label="deviceCommand.label" :value="deviceCommand.deviceCommand"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始站台" class="conditionVO" v-if="isJinLu" prop="param.startStation">
|
||||
<el-select v-model="modalData.param.startStation " placeholder="请选择起始站台" class="inputStyle">
|
||||
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="终点站台" class="conditionVO" v-if="isJinLu" prop="param.endStation">
|
||||
<el-select v-model="modalData.param.endStation " placeholder="请选择终点站台" class="inputStyle">
|
||||
<el-option v-for="station in stationList" :key="station.code" :label="station.name" :value="station.code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <command-Form :commandParam="form" :commandParamModal="formModel" :rules="commandRules"></command-Form> -->
|
||||
<!-- <div id="commandParam"></div> -->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addQuestAction('action')">添加动作</el-button>
|
||||
<el-button type="primary" @click="addQuestAction('modalData')">{{buttonName}}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import {postMemberBehaviorAction} from '@/api/simulation';
|
||||
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
|
||||
// import CommandForm from "./commandForm";
|
||||
import {postMemberBehaviorAction,getAvailableDeviceCommand,getDeviceCodeByDeviceType} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'addAction',
|
||||
props: {
|
||||
@ -39,28 +54,69 @@
|
||||
behaviorId:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
buttonName:{
|
||||
type:String,
|
||||
required: true
|
||||
},
|
||||
operateType:{
|
||||
type:String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
// components:{
|
||||
// CommandForm,
|
||||
// },
|
||||
data() {
|
||||
return {
|
||||
action:{
|
||||
reply:"",
|
||||
time:0,
|
||||
type:"Conversation"
|
||||
modalData:{
|
||||
action:{
|
||||
reply:"",
|
||||
time:0,
|
||||
type:"Conversation",
|
||||
deviceCommand:null,
|
||||
commandParamList:[]
|
||||
},
|
||||
param:{
|
||||
startStation:"",
|
||||
endStation:"",
|
||||
},
|
||||
},
|
||||
actionTypeList:[
|
||||
{"label":"对话","value":"Conversation"}
|
||||
],
|
||||
actionTypeList:DeviceTypeDic.ConstSelect.actionType,
|
||||
isConversitionAdd:true,
|
||||
isCommandAdd:false,
|
||||
deviceCommandList:[],
|
||||
stationList:[],
|
||||
rules:{
|
||||
reply: [
|
||||
action:{
|
||||
reply: [
|
||||
{ required: true, message: '请输入回复消息', trigger: 'blur' }
|
||||
],
|
||||
type:[
|
||||
{ required: true, message: '请选择角色类型', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
],
|
||||
type:[
|
||||
{ required: true, message: '请选择角色类型', trigger: 'change' }
|
||||
],
|
||||
deviceCommand:[
|
||||
{ required: true, message: '请选择设备指令', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
param:{
|
||||
startStation:[
|
||||
{ required: true, message: '请选择起始站台', trigger: 'change' }
|
||||
],
|
||||
endStation:[
|
||||
{ required: true, message: '请选择终点站台', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
},
|
||||
commandRules:{},
|
||||
formModel:{},
|
||||
form:{},
|
||||
isJinLu:false,
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.initData();
|
||||
},
|
||||
methods:{
|
||||
addQuestAction(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
@ -68,13 +124,44 @@
|
||||
let group=this.$props.group;
|
||||
let memberId=this.$props.memberId;
|
||||
let behaviorId=this.$props.behaviorId;
|
||||
let data=this.action;
|
||||
if(this.modalData.action.deviceCommand==null){
|
||||
delete this.modalData.action.deviceCommand;
|
||||
}
|
||||
if(this.modalData.action.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{this.modalData.action.commandParamList=[this.modalData.param.startStation,this.modalData.param.endStation];}
|
||||
let data=this.modalData.action;
|
||||
let obj=this;
|
||||
postMemberBehaviorAction(group,memberId,behaviorId,data).then(response=>{
|
||||
this.$message.success('添加动作成功');
|
||||
this.$emit('addActionSuccess');
|
||||
delete this.modalData.action.id;
|
||||
obj.modalData.action.type="Conversation";
|
||||
obj.modalData.action.time=0;
|
||||
obj.modalData.action.reply="";
|
||||
obj.modalData.param.startStation="";
|
||||
obj.isConversitionAdd=true;
|
||||
obj.isCommandAdd=false;
|
||||
obj.isJinLu=false;
|
||||
obj.modalData.action.deviceCommand=null;
|
||||
this.modalData.param.endStation="";
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
this.$message.success('添加动作成功');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$emit('modifyButtonName');
|
||||
this.$message.success('修改动作成功');
|
||||
}
|
||||
this.$emit('create');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`添加动作失败: ${error.message}`);
|
||||
})
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
this.$messageBox(`添加动作失败: ${error.message}`);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$messageBox(`修改动作失败: ${error.message}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log('error submit!!');
|
||||
@ -82,8 +169,90 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
backToMember:function(){
|
||||
this.$emit('backToBehavior');
|
||||
initData(){
|
||||
getAvailableDeviceCommand().then(response=>{
|
||||
this.deviceCommandList=response.data;
|
||||
});
|
||||
let params = {deviceType:"StationStand"};
|
||||
let group=this.$props.group;
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
let resultData=response.data;
|
||||
resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));
|
||||
this.stationList=resultData;
|
||||
})
|
||||
},
|
||||
changeCommand(index){
|
||||
switch(index)
|
||||
{
|
||||
case "Train_Manual_Route_Blocking_Drive":{
|
||||
this.isJinLu=true;
|
||||
this.initData();
|
||||
// this.form={
|
||||
// labelWidth:'100px',
|
||||
// items: [
|
||||
// { prop: 'startStation', label: '起始车站', type: 'select', required: false, change: true },
|
||||
// ]
|
||||
// };
|
||||
// this.formModel={
|
||||
// startStation:"",
|
||||
// };
|
||||
// const cfConstructor = Vue.component(CommandForm);
|
||||
// const instance = new cfConstructor({}).$mount('#commandParam');
|
||||
// instance.$mount('#commandParam');
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
this.isJinLu=false;
|
||||
this.initData();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
changeType(index){
|
||||
switch(index)
|
||||
{
|
||||
case "Conversation":{
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
break;
|
||||
}
|
||||
case "Command":{
|
||||
this.isConversitionAdd=false;
|
||||
this.isCommandAdd=true;
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
doShow(data){
|
||||
if(data)
|
||||
{
|
||||
this.initData();
|
||||
this.modalData.action.id=data.id;
|
||||
this.modalData.action.type=data.type;
|
||||
this.modalData.action.time=data.time;
|
||||
if(data.type=="Conversation")
|
||||
{
|
||||
this.isConversitionAdd=true;
|
||||
this.isCommandAdd=false;
|
||||
this.modalData.action.reply=data.reply;
|
||||
}
|
||||
else if(data.type=="Command")
|
||||
{
|
||||
this.isConversitionAdd=false;
|
||||
this.isCommandAdd=true;
|
||||
this.modalData.action.reply="";
|
||||
this.modalData.action.deviceCommand=data.deviceCommand;
|
||||
if(this.modalData.action.deviceCommand=="Train_Manual_Route_Blocking_Drive")
|
||||
{
|
||||
this.isJinLu=true;
|
||||
this.modalData.param.startStation=data.commandParamList[0];
|
||||
this.modalData.param.endStation=data.commandParamList[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -102,7 +271,10 @@
|
||||
width:98%;
|
||||
}
|
||||
.inputStyle{
|
||||
width:150px;
|
||||
width:300px;
|
||||
height:30px;
|
||||
}
|
||||
.textareaStyle{
|
||||
width:300px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,31 +1,30 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="addBehavior">
|
||||
<i class="el-icon-back" @click="backToMember"></i>
|
||||
<span>添加行为</span>
|
||||
</div>
|
||||
<el-form :model="behavior" ref="behavior" :rules="rules" label-width="80px" class="roleAction" label-position="right" style="margin-top:15px">
|
||||
<el-form-item label="主动触发">
|
||||
<el-form :model="behavior" ref="behavior" :rules="rules" label-width="80px" class="roleAction" label-position="right">
|
||||
<el-form-item label="是否主动">
|
||||
<el-switch v-model="behavior.auto"></el-switch>
|
||||
</el-form-item>
|
||||
<!-- @change="resetForm('behavior') -->
|
||||
<el-form-item label="前置行为" class="conditionVO" v-if="behavior.auto">
|
||||
<el-select v-model="behavior.memberId" placeholder="请选择角色" @change="changeMember">
|
||||
<el-option v-for="member in memberList" :key="member.id" :label="member.name" :value="member.id"></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="behavior.preBehaviorId" placeholder="请选择前置行为">
|
||||
<el-option v-for="preBehavior in preBehaviorList" :key="preBehavior.id" :label="preBehavior.id" :value="preBehavior.id"></el-option>
|
||||
<el-form-item label="目标角色" class="conditionVO" prop="targetMemberId">
|
||||
<el-select v-model="behavior.targetMemberId" placeholder="请选择目标角色" class="inputStyle">
|
||||
<el-option v-for="targetMember in targetMemberList" :key="targetMember.id" :label="targetMember.name" :value="targetMember.id" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="内容" class="conditionVO" prop="content" v-if="!behavior.auto">
|
||||
<el-input v-model="behavior.content" class="inputStyle"></el-input>
|
||||
<el-form-item label="描述" class="conditionVO" prop="description">
|
||||
<el-input type="textarea" v-model="behavior.description" class="textareaStyle" rows="3"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字" class="conditionVO" prop="keyWord" v-if="!behavior.auto">
|
||||
<el-input v-model="behavior.keyWord" class="inputStyle"></el-input>
|
||||
<el-form-item label="触发条件" class="conditionVO" prop="conditionVO.triggerType">
|
||||
<el-select v-model="behavior.conditionVO.triggerType" placeholder="请选择触发条件" @change="triggerTypeChange" class="inputStyle">
|
||||
<el-option v-for="trigCondition in trigConditionList" :key="trigCondition.value" :label="trigCondition.label" :value="trigCondition.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="重点内容" class="conditionVO" v-if="!behavior.auto">
|
||||
<el-tag :key="index" v-for="(tag,index) in behavior.importantList" closable :disable-transitions="false" @close="handleClose(tag)">
|
||||
<el-form-item label="内容" class="conditionVO" prop="conditionVO.content" v-if="isConversationShow">
|
||||
<el-input v-model="behavior.conditionVO.content" class="inputStyle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字" class="conditionVO" prop="conditionVO.keyWord" v-if="isConversationShow">
|
||||
<el-input v-model="behavior.conditionVO.keyWord" class="inputStyle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="重点内容" class="conditionVO" v-if="isConversationShow">
|
||||
<el-tag :key="index" v-for="(tag,index) in behavior.conditionVO.importantList" closable :disable-transitions="false" @close="handleClose(tag)">
|
||||
{{tag}}
|
||||
</el-tag>
|
||||
<el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small"
|
||||
@ -34,22 +33,19 @@
|
||||
></el-input>
|
||||
<el-button v-else class="button-new-tag" size="small" @click="showInput">添加</el-button>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="顺序" class="conditionVO">
|
||||
<el-input-number v-model="behavior.order" class="inputStyle" :min="1"></el-input-number>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="目标角色" class="conditionVO">
|
||||
<el-select v-model="behavior.targetMemberId" placeholder="请选择目标角色">
|
||||
<el-option v-for="targetMember in targetMemberList" :key="targetMember.id" :label="targetMember.name" :value="targetMember.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addQuestBehavior('behavior')">添加行为</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div v-if="isDeviceShow">
|
||||
<device-condition ref="deviceCondition" :group="group" :title="conditionTitle" :ConditionVOList="behavior.conditionVO.deviceConditionList" :isAdding="isAdding" @changeAdding="changeAdding"></device-condition>
|
||||
</div>
|
||||
<div style="margin-top:20px;margin-left:80px;">
|
||||
<el-button type="primary" @click="addQuestBehavior">{{buttonName}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
|
||||
import DeviceCondition from './deviceCondition';
|
||||
import {getMembersByGroup,postMemberBehavior} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'addBehavior',
|
||||
@ -61,27 +57,62 @@
|
||||
memberId:{
|
||||
type:String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
title:{
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
operateType:{
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
buttonName:{
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
components:{
|
||||
DeviceCondition
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inputVisible: false,
|
||||
inputValue: '',
|
||||
conditionTitle:"设备条件",
|
||||
targetMemberList:[],
|
||||
preBehaviorList:[],
|
||||
memberList:[],
|
||||
deviceConditionList:[],
|
||||
trigConditionList:DeviceTypeDic.ConstSelect.triggerType,
|
||||
isConversationShow:false,
|
||||
isDeviceShow:false,
|
||||
isAdding:false,
|
||||
behavior:{
|
||||
order:1,
|
||||
importantList:[],
|
||||
auto:false,
|
||||
targetMemberId:null,
|
||||
description:"",
|
||||
conditionVO:{
|
||||
importantList:[],
|
||||
content:"",
|
||||
keyWord:"",
|
||||
triggerType:"None",
|
||||
deviceConditionList:[],
|
||||
},
|
||||
id:null,
|
||||
},
|
||||
rules:{
|
||||
content: [
|
||||
{ required: true, message: '请输入内容', trigger: 'blur' }
|
||||
targetMemberId:[
|
||||
{ required: true, message: '请选择目标角色', trigger: 'change' }
|
||||
],
|
||||
keyWord:[
|
||||
{ required: true, message: '请输入关键字', trigger: 'blur' }
|
||||
]
|
||||
description:[
|
||||
{ required: true, message: '请输入描述', trigger: 'blur' }
|
||||
],
|
||||
conditionVO:{
|
||||
content: [
|
||||
{ required: true, message: '请输入内容', trigger: 'blur' }
|
||||
],
|
||||
keyWord:[
|
||||
{ required: true, message: '请输入关键字', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -91,59 +122,86 @@
|
||||
methods:{
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
getMembersByGroup(group).then(response=>{
|
||||
this.targetMemberList=response.data;
|
||||
if(response.data.length>0)
|
||||
{
|
||||
this.behavior.targetMemberId=response.data[0].id;
|
||||
}
|
||||
});
|
||||
let memberId=this.$props.memberId;
|
||||
getMembersByGroup(group).then(response=>{
|
||||
let datalist=response.data;
|
||||
this.memberList=datalist;
|
||||
if(datalist.length>0)
|
||||
{
|
||||
// this.behavior.memberId=datalist[0].id;
|
||||
this.preBehaviorList=datalist[0].behaviorVOList;
|
||||
// if(datalist[0].behaviorVOList.length>0)
|
||||
// {this.behavior.preBehaviorId=datalist[0].behaviorVOList[0].id}
|
||||
}
|
||||
this.targetMemberList=datalist;
|
||||
});
|
||||
},
|
||||
showInput() {
|
||||
this.inputVisible = true;
|
||||
this.$nextTick(_ => {
|
||||
this.$refs.saveTagInput.$refs.input.focus();
|
||||
this.$refs.saveTagInput.$refs.input.focus();
|
||||
});
|
||||
},
|
||||
handleClose(tag) {
|
||||
this.behavior.importantList.splice(this.behavior.importantList.indexOf(tag), 1);
|
||||
this.behavior.conditionVO.importantList.splice(this.behavior.conditionVO.importantList.indexOf(tag), 1);
|
||||
},
|
||||
handleInputConfirm() {
|
||||
let inputValue = this.inputValue;
|
||||
if (inputValue) {
|
||||
this.behavior.importantList.push(inputValue);
|
||||
this.behavior.conditionVO.importantList.push(inputValue);
|
||||
}
|
||||
this.inputVisible = false;
|
||||
this.inputValue = '';
|
||||
},
|
||||
// resetForm(formName){
|
||||
// this.$refs[formName].resetFields();
|
||||
// },
|
||||
addQuestBehavior(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
addQuestBehavior(){
|
||||
this.$refs["behavior"].validate((valid) => {
|
||||
if (valid) {
|
||||
let group=this.$props.group;
|
||||
let memberId=this.$props.memberId;
|
||||
let behavior={"conditionVO":this.behavior};
|
||||
if(this.behavior.conditionVO.triggerType=="DeviceCondition")
|
||||
{
|
||||
if(this.isAdding)
|
||||
{
|
||||
this.behavior.conditionVO.deviceConditionList.pop();
|
||||
this.$refs.deviceCondition.resetDisabled();
|
||||
}
|
||||
if(this.behavior.conditionVO.deviceConditionList.length<=0)
|
||||
{
|
||||
this.$messageBox(`请添加设备条件`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(this.behavior.conditionVO.triggerType=="None")
|
||||
{
|
||||
this.behavior.conditionVO={};
|
||||
this.behavior.conditionVO.triggerType="None";
|
||||
}
|
||||
if(memberId)
|
||||
{
|
||||
let behavior=this.behavior;
|
||||
postMemberBehavior(group,memberId,behavior).then(response=>{
|
||||
this.$message.success('添加行为成功');
|
||||
this.$emit('addBehaviorSuccess');
|
||||
this.behavior.auto=false;
|
||||
this.behavior.description="";
|
||||
this.behavior.conditionVO.triggerType="None";
|
||||
this.behavior.conditionVO.importantList=[];
|
||||
this.behavior.targetMemberId=null;
|
||||
this.behavior.conditionVO.content="";
|
||||
this.behavior.conditionVO.keyWord="";
|
||||
this.behavior.id=null;
|
||||
this.isConversationShow=false;
|
||||
this.isDeviceShow=false;
|
||||
this.behavior.conditionVO.deviceConditionList=[];
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
this.$message.success('添加行为成功');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$emit('modifyButtonName');
|
||||
this.$message.success('修改行为成功');
|
||||
}
|
||||
this.$emit('create');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`添加行为失败: ${error.message}`);
|
||||
if(this.$props.operateType=="add")
|
||||
{
|
||||
this.$messageBox(`添加行为失败: ${error.message}`);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$messageBox(`修改行为失败: ${error.message}`);
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
@ -152,21 +210,74 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
backToMember(){
|
||||
this.$emit('backToMember');
|
||||
},
|
||||
changeMember(index){
|
||||
let datalist=this.memberList;
|
||||
this.behavior.preBehaviorId="";
|
||||
for(let i=0;i<datalist.length;i++)
|
||||
doShow(data){
|
||||
if(data)
|
||||
{
|
||||
if(datalist[i].id==index)
|
||||
this.behavior.auto=data.auto;
|
||||
this.behavior.targetMemberId=data.targetMemberId;
|
||||
this.behavior.description=data.description;
|
||||
this.behavior.id=data.id;
|
||||
this.behavior.conditionVO.triggerType=data.conditionVO.triggerType;
|
||||
switch(data.conditionVO.triggerType)
|
||||
{
|
||||
this.preBehaviorList=datalist[i].behaviorVOList;
|
||||
// if(datalist[i].behaviorVOList.length>0)
|
||||
// {this.behavior.preBehaviorId=datalist[i].behaviorVOList[0].id}
|
||||
case "None":{
|
||||
this.isConversationShow=false;
|
||||
this.isDeviceShow=false;
|
||||
break;
|
||||
}
|
||||
case "Conversation":{
|
||||
this.isConversationShow=true;
|
||||
this.isDeviceShow=false;
|
||||
this.behavior.conditionVO.importantList=data.conditionVO.importantList;
|
||||
this.behavior.conditionVO.content=data.conditionVO.content;
|
||||
this.behavior.conditionVO.keyWord=data.conditionVO.keyWord;
|
||||
break;
|
||||
}
|
||||
case 'DeviceCondition':{
|
||||
this.isConversationShow=false;
|
||||
this.isDeviceShow=true;
|
||||
// this.$refs.deviceCondition.resetDisabled();
|
||||
var newData=JSON.parse(JSON.stringify(data.conditionVO.deviceConditionList).replace(/\"code\"/g,'"isAdded":true,"code"'));
|
||||
this.behavior.conditionVO.deviceConditionList=newData;
|
||||
this.resetDisabled();
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
resetDisabled(){
|
||||
// debugger;
|
||||
if(this.$refs['deviceCondition'])
|
||||
{
|
||||
this.$refs['deviceCondition'].resetDisabled();
|
||||
}
|
||||
},
|
||||
triggerTypeChange(data){
|
||||
switch(data){
|
||||
case "Conversation":{
|
||||
this.isConversationShow=true;
|
||||
this.isDeviceShow=false;
|
||||
break;
|
||||
}
|
||||
case "DeviceCondition":{
|
||||
this.isConversationShow=false;
|
||||
this.isDeviceShow=true;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
this.isConversationShow=false;
|
||||
this.isDeviceShow=false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.$refs['behavior'].clearValidate();
|
||||
},
|
||||
changeAdding(data)
|
||||
{
|
||||
this.isAdding=data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -174,8 +285,11 @@
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.inputStyle{
|
||||
width:150px;
|
||||
height:30px;
|
||||
width:300px;
|
||||
height:20px;
|
||||
}
|
||||
.textareaStyle{
|
||||
width:300px;
|
||||
}
|
||||
.button-new-tag {
|
||||
margin-left: 10px;
|
||||
@ -192,9 +306,4 @@
|
||||
.el-tag + .el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
.addBehavior{
|
||||
margin-top: 20px;
|
||||
margin-left: 10px;
|
||||
font-size: 15px;
|
||||
}
|
||||
</style>
|
172
src/views/display/scriptRecord/deviceCondition.vue
Normal file
172
src/views/display/scriptRecord/deviceCondition.vue
Normal file
@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form label-width="80px">
|
||||
<el-form-item :label="title">
|
||||
<el-button type="primary" size="small" @click="addDeviceCondition" :disabled="isdisabled">添加</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="ConditionVOList" border style="margin-top:10px;margin-left:10px;width:901px">
|
||||
<el-table-column label="设备类型" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.isAdded">{{scope.row.deviceType}}</div>
|
||||
<el-select v-else v-model="scope.row.deviceType" placeholder="请选择" @change="changeDeviceType($event,scope.row)">
|
||||
<el-option v-for="deviceType in deviceTypeList" :key="deviceType.value" :label="deviceType.label" :value="deviceType.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备编号" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.isAdded">{{scope.row.code}}</div>
|
||||
<el-select v-else v-model="scope.row.code" placeholder="请选择">
|
||||
<el-option v-for="deviceCode in deviceCodeList" :key="deviceCode.code" :label="deviceCode.name" :value="deviceCode.code"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设备条件" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.isAdded">{{scope.row.condition}}</div>
|
||||
<el-select v-else v-model="scope.row.condition" placeholder="请选择">
|
||||
<el-option v-for="deviceCondition in deviceCondList" :key="deviceCondition.condition" :label="deviceCondition.label" :value="deviceCondition.condition"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数设备类型" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.isAdded">{{scope.row.paramDeviceType}}</div>
|
||||
<el-select v-else v-model="scope.row.paramDeviceType" placeholder="请选择" @change="changeParamDeviceType">
|
||||
<el-option v-for="deviceType in deviceTypeList" :key="deviceType.value" :label="deviceType.label" :value="deviceType.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="参数设备编号" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div v-if="scope.row.isAdded">{{scope.row.paramCode}}</div>
|
||||
<el-select v-else v-model="scope.row.paramCode" placeholder="请选择">
|
||||
<el-option v-for="paramDeviceCode in paramDeviceCodeList" :key="paramDeviceCode.code" :label="paramDeviceCode.name" :value="paramDeviceCode.code"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-row v-if="scope.row.isAdded">
|
||||
<el-button type="primary" size="mini" @click="deleteOperate(scope.$index)">删除</el-button>
|
||||
</el-row>
|
||||
<el-row v-else>
|
||||
<el-button type="primary" size="mini" @click="determineOperate(scope.row)">确定</el-button>
|
||||
<el-button type="primary" size="mini" @click="cancleOperate">取消</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
|
||||
import Vue from 'vue';
|
||||
import {getDeviceCodeByDeviceType,getDeviceCoditionByDeviceType} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'deviceCondition',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
ConditionVOList:{
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
isAdding:{
|
||||
type: Boolean,
|
||||
required: true
|
||||
},
|
||||
title:{
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.isdisabled=false;
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
deviceTypeList:DeviceTypeDic.ConstSelect.deviceType,
|
||||
deviceCodeList:[],
|
||||
deviceCondList:[],
|
||||
paramDeviceCodeList:[],
|
||||
isdisabled:false,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
changeDeviceType(index,row){
|
||||
let params = {deviceType:index};
|
||||
let group=this.$props.group;
|
||||
row.code="";
|
||||
row.condition="";
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
let resultData=response.data;
|
||||
if(index=="Train")
|
||||
{resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));}
|
||||
this.deviceCodeList=resultData;
|
||||
})
|
||||
getDeviceCoditionByDeviceType(params).then(response =>{
|
||||
this.deviceCondList=response.data;
|
||||
});
|
||||
},
|
||||
changeParamDeviceType(index){
|
||||
let params = {deviceType:index};
|
||||
let group=this.$props.group;
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
let resultData=response.data;
|
||||
if(index=="Train")
|
||||
{resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));}
|
||||
this.paramDeviceCodeList=resultData;
|
||||
})
|
||||
},
|
||||
deleteOperate(data){
|
||||
this.$props.ConditionVOList.splice(data,1);
|
||||
},
|
||||
determineOperate(data){
|
||||
if(data.deviceType=="")
|
||||
{
|
||||
this.$messageBox(`请选择设备类型`);
|
||||
return;
|
||||
}
|
||||
if(data.code=="")
|
||||
{
|
||||
this.$messageBox(`请选择设备编号`);
|
||||
return;
|
||||
}
|
||||
if(data.condition=="")
|
||||
{
|
||||
this.$messageBox(`请选择设备条件`);
|
||||
return;
|
||||
}
|
||||
this.$props.ConditionVOList[this.$props.ConditionVOList.length-1].isAdded=true;
|
||||
this.isdisabled=false;
|
||||
this.$emit("changeAdding",false);
|
||||
},
|
||||
cancleOperate(){
|
||||
this.isdisabled=false;
|
||||
this.$props.ConditionVOList.pop();
|
||||
this.$emit("changeAdding",false);
|
||||
},
|
||||
addDeviceCondition(){
|
||||
this.isdisabled=true;
|
||||
let deviceCondition={
|
||||
deviceType:"",
|
||||
code:"",
|
||||
condition:"",
|
||||
paramCode:"",
|
||||
paramDeviceType:null,
|
||||
isAdded:false,
|
||||
};
|
||||
this.$emit("changeAdding",true);
|
||||
this.$props.ConditionVOList.push(deviceCondition);
|
||||
},
|
||||
resetDisabled(){
|
||||
this.isdisabled=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -2,19 +2,22 @@
|
||||
<div>
|
||||
<div class="actionList">
|
||||
<i class="el-icon-back" @click="backToMember"></i>
|
||||
<span>动作列表</span>
|
||||
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span>
|
||||
</div>
|
||||
<add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
|
||||
<el-table
|
||||
:data="actionList" border class="actionListTable" lazy="true">
|
||||
<el-table-column prop="reply" label="回复消息" width="150">
|
||||
v-loading="loading"
|
||||
:data="actionList" border class="actionListTable">
|
||||
<el-table-column prop="reply" label="回复消息" width="200">
|
||||
</el-table-column>
|
||||
<el-table-column prop="time" label="完成时间" width="100">
|
||||
<el-table-column prop="time" label="完成时间" width="200">
|
||||
</el-table-column>
|
||||
<el-table-column prop="type" label="动作类型" width="150">
|
||||
<el-table-column prop="type" label="动作类型" width="200">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<el-button type="primary" size="mini" @click="modifyAction(scope.row)">修改</el-button>
|
||||
<el-button type="primary" size="mini" @click="deleteAction(scope.row)">删除</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
@ -24,9 +27,10 @@
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import AddAction from './addAction';
|
||||
import {getMembersByGroup,deleteMemberBehaviorAction} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'addAction',
|
||||
name: 'getAction',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
@ -44,10 +48,20 @@
|
||||
data() {
|
||||
return {
|
||||
actionList:[],
|
||||
loading:true,
|
||||
behaviorName:"",
|
||||
memberName:"",
|
||||
operateType:"add",
|
||||
buttonName:"添加动作",
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddAction,
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData(this.$route.query);
|
||||
this.memberName=this.$store.state.scriptRecord.memberName;
|
||||
this.behaviorName=this.$store.state.scriptRecord.behaviorName;
|
||||
},
|
||||
methods:{
|
||||
loadInitData(obj) {
|
||||
@ -66,6 +80,7 @@
|
||||
if(behaviorList[i].id==behaviorId)
|
||||
{
|
||||
this.actionList=behaviorList[i].actionVOList;
|
||||
this.loading=false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -83,14 +98,27 @@
|
||||
let actionId=row.id;
|
||||
deleteMemberBehaviorAction(group,memberId,behaviorId,actionId).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success('删除任务角色行为动作成功');
|
||||
this.$message.success('删除行为动作成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`删除任务角色行为动作失败: ${error.message}`);
|
||||
this.$messageBox(`删除行为动作失败: ${error.message}`);
|
||||
});
|
||||
},
|
||||
reloadTable(){
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
create(){
|
||||
this.reloadTable();
|
||||
},
|
||||
modifyAction(row){
|
||||
this.$emit('backToTop');
|
||||
this.operateType="modify";
|
||||
this.buttonName="修改动作"
|
||||
this.$refs.addBehavior.doShow(row);
|
||||
},
|
||||
modifyButtonName(){
|
||||
this.buttonName="添加动作",
|
||||
this.operateType="add"
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -100,11 +128,14 @@
|
||||
margin-top: 20px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
width:502px;
|
||||
width:802px;
|
||||
}
|
||||
.actionList{
|
||||
margin-top: 20px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.titleStyle{
|
||||
margin-left:10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,48 +1,41 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="behaviorList">
|
||||
<i class="el-icon-back" @click="backToMember"></i>
|
||||
<span>行为列表</span>
|
||||
<i class="el-icon-back" @click="backToMember" style="cursor:pointer;"></i>
|
||||
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">行为信息</span></span>
|
||||
</div>
|
||||
<add-behavior ref="addBehavior" :title="title" :group="group" :memberId="memberId" @create="handleCreate" :operateType="operateType" :buttonName="buttonName" @modifyButtonName="modifyButtonName"></add-behavior>
|
||||
<div class="behaviorList">行为列表</div>
|
||||
<el-table
|
||||
:data="behaviorList" border class="behaviorListTable" lazy="true">
|
||||
<el-table-column label="内容" width="100">
|
||||
v-loading="loading"
|
||||
:data="behaviorList" border class="behaviorListTable">
|
||||
<el-table-column label="是否主动触发" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.conditionVO.content}}</div>
|
||||
<div>{{scope.row.auto?"是":"否"}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="关键字" width="100">
|
||||
<el-table-column label="目标角色" width="200">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.conditionVO.keyWord}}</div>
|
||||
<div>{{scope.row.targetMemberId}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="前置行为" width="100">
|
||||
<el-table-column label="描述" width="200">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.conditionVO.preBehaviorId}}</div>
|
||||
<div>{{scope.row.description}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="顺序" width="100">
|
||||
<el-table-column label="触发条件" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.conditionVO.order}}</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="重点内容" width="100">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.conditionVO.importantList.join(",")}}</div>
|
||||
<div>{{scope.row.conditionVO.triggerType==null?"无":scope.row.conditionVO.triggerType}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="主动触发" width="100">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.conditionVO.auto?"是":"否"}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="160">
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<el-button type="primary" size="mini" @click="getActions(scope.row)">查看</el-button>
|
||||
<el-button type="primary" size="mini" @click="modifyActions(scope.row)">修改</el-button>
|
||||
<el-button type="primary" size="mini" @click="deleteBehavior(scope.row)">删除</el-button>
|
||||
</el-row>
|
||||
<el-row style="margin-top:10px"><el-button type="primary" size="mini" @click="addAction(scope.row)">添加动作</el-button></el-row>
|
||||
<el-row style="margin-top:10px"><el-button type="primary" size="mini" @click="getActions(scope.row)">动作操作</el-button></el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -51,6 +44,7 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import {getMembersByGroup,deleteMemberBehavior} from '@/api/simulation';
|
||||
import AddBehavior from './addBehavior';
|
||||
export default {
|
||||
name: 'behaviorList',
|
||||
props: {
|
||||
@ -63,12 +57,21 @@
|
||||
required: true
|
||||
}
|
||||
},
|
||||
components:{
|
||||
AddBehavior
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
behaviorList:[],
|
||||
memberName:"",
|
||||
loading:true,
|
||||
title:"",
|
||||
operateType:"add",
|
||||
buttonName:"添加行为",
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.memberName=this.$store.state.scriptRecord.memberName;
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
methods:{
|
||||
@ -82,6 +85,7 @@
|
||||
if(datalist[i].id==memberId)
|
||||
{
|
||||
this.behaviorList=datalist[i].behaviorVOList;
|
||||
this.loading=false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -104,32 +108,40 @@
|
||||
backToMember(){
|
||||
this.$emit('backToMember');
|
||||
},
|
||||
addAction(row)
|
||||
{
|
||||
this.$emit('addAction',row.id);
|
||||
modifyButtonName(){
|
||||
this.buttonName="添加行为",
|
||||
this.operateType="add"
|
||||
},
|
||||
modifyActions(row){
|
||||
this.$emit('backToTop');
|
||||
this.operateType="modify";
|
||||
this.buttonName="修改行为"
|
||||
this.$refs.addBehavior.doShow(row);
|
||||
},
|
||||
getActions(row){
|
||||
this.$emit('getActions',row.id);
|
||||
}
|
||||
this.$emit('getActions',row);
|
||||
},
|
||||
handleCreate(){
|
||||
this.reloadTable();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.memberList{
|
||||
width:94%;
|
||||
margin-top:20px;
|
||||
margin-left:3%;
|
||||
}
|
||||
.behaviorListTable{
|
||||
margin-top: 20px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
width:661px;
|
||||
width:901px;
|
||||
}
|
||||
.behaviorList{
|
||||
margin-top: 20px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
margin-bottom:20px;
|
||||
}
|
||||
.titleStyle{
|
||||
margin-left:10px;
|
||||
}
|
||||
</style>
|
@ -1,7 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button type="primary" @click="openDialog">添加角色</el-button>
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible" :modalAppendToBody="false" :appendToBody="true" width="400px">
|
||||
<el-form :model="memberVO" ref="memberVO" :rules="rules" label-width="80px" class="roleAction" label-position="left">
|
||||
<el-form-item label="角色名称" class="conditionVO" prop="name">
|
||||
<el-input v-model="memberVO.name" class="inputStyle"></el-input>
|
||||
@ -11,8 +9,8 @@
|
||||
<el-option v-for="rolerType in roleTypeList" :key="rolerType.label" :label="rolerType.label" :value="rolerType.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编码" class="conditionVO" prop="deviceCode">
|
||||
<el-select v-model="memberVO.deviceCode" placeholder="请选择设备编码">
|
||||
<el-form-item label="设备编码" class="conditionVO">
|
||||
<el-select v-model="memberVO.deviceCode" clearable placeholder="请选择设备编码">
|
||||
<!-- groupNumber -->
|
||||
<el-option v-for="deviceCode in deviceCodeList" :key="deviceCode.code" :label="deviceCode.name" :value="deviceCode.code"></el-option>
|
||||
</el-select>
|
||||
@ -21,32 +19,27 @@
|
||||
<el-button type="primary" @click="addQuestMember('memberVO')">添加</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<div class="roleList">角色信息</div>
|
||||
<div class="roleList">角色列表</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="memberList" border class="memberList">
|
||||
<el-table-column prop="name" label="角色名称" width="250">
|
||||
<el-table-column prop="name" label="角色名称" width="350">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="250">
|
||||
<el-table-column label="操作" width="350">
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<el-button type="primary" size="mini" @click="getMembers(scope.row)">查看</el-button>
|
||||
<el-button type="primary" size="mini" @click="getMembers(scope.row)">行为操作</el-button>
|
||||
<el-button type="primary" size="mini" @click="deleteMember(scope.$index,scope.row)">删除</el-button>
|
||||
</el-row>
|
||||
<el-row style="margin-top:10px"><el-button type="primary" size="mini" @click="addBehavior(scope.row)">添加行为</el-button></el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- <el-table-column prop="role" label="角色类型" width="100">
|
||||
</el-table-column>
|
||||
<el-table-column prop="deviceCode" label="设备编码" width="100">
|
||||
</el-table-column> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import {getDevicesByRole,getMembersByGroup,postQuestMember,deleteQuestMember} from '@/api/simulation';
|
||||
import {getQuestRecord,getDevicesByRole,postQuestMember,deleteQuestMember} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'roleSection',
|
||||
props: {
|
||||
@ -59,49 +52,37 @@
|
||||
return {
|
||||
deviceCodeList:[],
|
||||
memberList:[],
|
||||
loading:true,
|
||||
memberVO:
|
||||
{
|
||||
role:"Admin",
|
||||
deviceCode:'',
|
||||
},
|
||||
roleTypeList:ConstConfig.ConstSelect.roleType,
|
||||
dialogFormVisible:false,
|
||||
title:"添加角色",
|
||||
rules:{
|
||||
name:[
|
||||
{ required: true, message: '请输入角色名称', trigger: 'blur' }
|
||||
],
|
||||
deviceCode: [
|
||||
{ required: true, message: '请选择设备编码', trigger: 'change' }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData(this.$route.query);
|
||||
watch: {
|
||||
'$store.state.scriptRecord.memberList': function (val, old){
|
||||
this.memberList=val;
|
||||
this.loading=false;
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.memberList=this.$store.state.scriptRecord.memberList;
|
||||
this.loading=false;
|
||||
},
|
||||
methods:{
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
getMembersByGroup(group).then(response=>{
|
||||
this.memberList=response.data;
|
||||
});
|
||||
|
||||
},
|
||||
openDialog(){
|
||||
this.dialogFormVisible=true;
|
||||
// this.condition.deviceType="Link";
|
||||
this.getDeviceInfo();
|
||||
},
|
||||
getDeviceInfo(){
|
||||
let params = { role:this.memberVO.role};
|
||||
let group=this.$props.group;
|
||||
getDevicesByRole(group,params).then(response => {
|
||||
this.deviceCodeList=response.data;
|
||||
if(response.data.length>0)
|
||||
{
|
||||
this.memberVO.deviceCode=response.data[0].code;
|
||||
}
|
||||
});
|
||||
},
|
||||
addQuestMember(formName){
|
||||
@ -111,10 +92,11 @@
|
||||
let group=this.group;
|
||||
postQuestMember(group,data).then(resp => {
|
||||
this.reloadTable();
|
||||
this.dialogFormVisible=false;
|
||||
// this.dialogFormVisible=false;
|
||||
this.memberVO.role="Admin";
|
||||
this.memberVO.deviceCode="";
|
||||
this.memberVO.name="";
|
||||
this.deviceCodeList=[];
|
||||
this.$message.success('添加任务角色成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`添加任务角色失败: ${error.message}`);
|
||||
@ -135,16 +117,13 @@
|
||||
if(index=="Driver")
|
||||
{resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));}
|
||||
this.deviceCodeList=resultData;
|
||||
if(response.data.length>0)
|
||||
{
|
||||
this.memberVO.deviceCode=response.data[0].code;
|
||||
}
|
||||
});
|
||||
},
|
||||
reloadTable(){
|
||||
let group=this.group;
|
||||
getMembersByGroup(group).then(response=>{
|
||||
this.memberList=response.data;
|
||||
getQuestRecord(group).then(response=>{
|
||||
this.memberList=response.data.memberVOList;
|
||||
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
|
||||
});
|
||||
},
|
||||
deleteMember(index,row){
|
||||
@ -156,25 +135,17 @@
|
||||
this.$messageBox(`删除任务角色失败: ${error.message}`);
|
||||
});
|
||||
},
|
||||
addBehavior(row){
|
||||
this.$emit('addBehavior',row.id);
|
||||
},
|
||||
getMembers(row){
|
||||
this.$emit('getBehaviorList',row.id);
|
||||
this.$emit('getBehaviorList',row);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.addRole{
|
||||
margin-top: 5px;
|
||||
margin-left: 10px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.roleAction{
|
||||
margin-top:10px;
|
||||
margin-left: 40px;
|
||||
margin-left:10px;
|
||||
}
|
||||
.roleList{
|
||||
margin-top: 20px;
|
||||
@ -183,7 +154,7 @@
|
||||
}
|
||||
.memberList{
|
||||
// width:94%;
|
||||
width:501px;
|
||||
width:701px;
|
||||
margin-top:20px;
|
||||
margin-left:5px;
|
||||
}
|
||||
|
@ -1,243 +1,109 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-button type="primary" @click="openDialog">添加目标条件</el-button>
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible" :modalAppendToBody="false" :appendToBody="true" width="400px">
|
||||
<el-form :model="conditionInfo" ref="condition" :rules="rules" label-width="110px" label-position="right">
|
||||
<el-form-item label="设备类型" class="conditionVO">
|
||||
<el-select v-model="conditionInfo.deviceType" placeholder="请选择设备类型" @change="changeDeviceType">
|
||||
<el-option v-for="deviceType in deviceTypeList" :key="deviceType.value" :label="deviceType.label" :value="deviceType.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备编号" class="conditionVO" prop="code">
|
||||
<el-select v-model="conditionInfo.code" placeholder="请选择设备编号">
|
||||
<el-option v-for="deviceCode in deviceCodeList" :key="deviceCode.code" :label="deviceCode.name" :value="deviceCode.code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备条件" prop="condition">
|
||||
<!-- multiple -->
|
||||
<el-select v-model="conditionInfo.condition" placeholder="请选择设备条件">
|
||||
<el-option v-for="deviceCondition in deviceConditionList" :key="deviceCondition.condition" :label="deviceCondition.label" :value="deviceCondition.condition"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数设备类型" prop="paramDeviceType">
|
||||
<!-- multiple -->
|
||||
<el-select v-model="conditionInfo.paramDeviceType" placeholder="请选择参数设备类型" @change="changeParamDeviceType">
|
||||
<el-option v-for="deviceType in deviceTypeList" :key="deviceType.value" :label="deviceType.label" :value="deviceType.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="参数设备编号" class="conditionVO">
|
||||
<el-select v-model="conditionInfo.paramCode" placeholder="请选择参数设备编号">
|
||||
<el-option v-for="paramDeviceCode in paramDeviceCodeList" :key="paramDeviceCode.code" :label="paramDeviceCode.name" :value="paramDeviceCode.code"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addQuestAction('condition')">添加目标条件</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<div>
|
||||
<div class="ConditionList">目标条件信息</div>
|
||||
<el-table
|
||||
:data="ConditionList" border class="ConditionListTable" lazy="true">
|
||||
<el-table-column prop="deviceType" label="设备类型" width="100">
|
||||
</el-table-column>
|
||||
<el-table-column prop="code" label="设备编号" width="100">
|
||||
</el-table-column>
|
||||
<el-table-column prop="condition" label="设备条件" width="100">
|
||||
</el-table-column>
|
||||
<el-table-column prop="paramDeviceType" label="参数设备类型" width="100">
|
||||
</el-table-column>
|
||||
<el-table-column prop="paramCode" label="参数设备编号" width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<el-button type="primary" size="mini" @click="modifyCondition(scope.row)">修改</el-button>
|
||||
<el-button type="primary" size="mini" @click="deleteCondition(scope.row)">删除</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
<el-form label-width="80px" label-position="right" style="margin-top:15px">
|
||||
<device-condition ref="deviceCondition" :group="group" :title="conditionTitle" :ConditionVOList="deviceConditionList" :isAdding="isAdding" @changeAdding="changeAdding"></device-condition>
|
||||
<el-form-item class="ConditionButton">
|
||||
<el-button type="primary" @click="addQuestAction()">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
|
||||
import Vue from 'vue';
|
||||
import {getDeviceCodeByDeviceType,getDeviceCoditionByDeviceType,postTargetConditionAction,deleteTargetConditionAction,getQuestRecord} from '@/api/simulation';
|
||||
import DeviceCondition from './deviceCondition';
|
||||
import {postTargetConditionAction} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'addCondition',
|
||||
name: 'targetCondition',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.loadTabledata();
|
||||
},
|
||||
},
|
||||
watch:{
|
||||
'deviceTypeList'(newName,oldName){
|
||||
debugger;
|
||||
// '$store.state.menuOperation.selected': function (val) {
|
||||
// if(this.fieldS!=""&&val!=null)
|
||||
// {
|
||||
// debugger;
|
||||
// }
|
||||
// }
|
||||
'$store.state.scriptRecord.deviceConditionList': function (val, old){
|
||||
if(val!=undefined)
|
||||
{
|
||||
var newData=JSON.parse(JSON.stringify(val).replace(/\"code\"/g,'"isAdded":true,"code"'));
|
||||
this.deviceConditionList=newData;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.deviceConditionList=[];
|
||||
}
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
deviceConditionList:[],
|
||||
conditionTitle:"目标条件",
|
||||
isAdding:false,
|
||||
// fieldS:"",
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
conditionInfo:{
|
||||
deviceType:"Link",
|
||||
condition:"",
|
||||
code :"",
|
||||
paramDeviceType:"",
|
||||
paramCode:"",
|
||||
},
|
||||
title:"添加目标条件",
|
||||
dialogType:"add",
|
||||
deviceTypeList:DeviceTypeDic.ConstSelect.deviceType,
|
||||
deviceCodeList:[],
|
||||
deviceConditionList:[],
|
||||
ConditionList:[],
|
||||
paramDeviceCodeList:[],
|
||||
dialogFormVisible: false,
|
||||
isshow:false,
|
||||
isshow1:true,
|
||||
rules:{
|
||||
code: [
|
||||
{ required: true, message: '请选择设备编号', trigger: 'change' }
|
||||
],
|
||||
condition:[
|
||||
{ required: true, message: '请选择设备条件', trigger: 'change' }
|
||||
],
|
||||
}
|
||||
components:{
|
||||
DeviceCondition
|
||||
},
|
||||
mounted(){
|
||||
let data=this.$store.state.scriptRecord.deviceConditionList;
|
||||
if(data!=undefined)
|
||||
{
|
||||
var newData=JSON.parse(JSON.stringify(data).replace(/\"code\"/g,'"isAdded":true,"code"'));
|
||||
this.deviceConditionList=newData;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.deviceConditionList=[];
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
changeDeviceType(index){
|
||||
let params = {deviceType:index};
|
||||
let group=this.$props.group;
|
||||
this.conditionInfo.code="";
|
||||
this.conditionInfo.condition="";
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
this.deviceCodeList=response.data;
|
||||
})
|
||||
getDeviceCoditionByDeviceType(params).then(response =>{
|
||||
this.deviceConditionList=response.data;
|
||||
});
|
||||
},
|
||||
changeParamDeviceType(index){
|
||||
let params = {deviceType:index};
|
||||
let group=this.$props.group;
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
this.paramDeviceCodeList=response.data;
|
||||
})
|
||||
},
|
||||
openDialog(){
|
||||
this.title="添加目标条件";
|
||||
this.dialogType="add";
|
||||
this.conditionInfo.deviceType="Link";
|
||||
this.conditionInfo.paramDeviceType="";
|
||||
this.getDeviceInfo("","","");
|
||||
this.dialogFormVisible=true;
|
||||
},
|
||||
loadTabledata(){
|
||||
let group=this.$props.group;
|
||||
getQuestRecord(group).then(response =>{
|
||||
this.ConditionList=response.data.targetConditionVOList;
|
||||
});
|
||||
},
|
||||
getDeviceInfo(condition,code,paramCode){
|
||||
let group=this.$props.group;
|
||||
let params = {deviceType:this.conditionInfo.deviceType};
|
||||
getDeviceCodeByDeviceType(group,params).then(response =>{
|
||||
this.deviceCodeList=response.data;
|
||||
// this.conditionInfo.code=code;
|
||||
})
|
||||
getDeviceCoditionByDeviceType(params).then(response =>{
|
||||
this.deviceConditionList=response.data;
|
||||
// this.conditionInfo.condition=condition;
|
||||
});
|
||||
if(this.conditionInfo.paramDeviceType!="")
|
||||
addQuestAction(){
|
||||
if(this.isAdding)
|
||||
{
|
||||
let paramDevice = {deviceType:this.conditionInfo.paramDeviceType};
|
||||
getDeviceCodeByDeviceType(group,paramDevice).then(response =>{
|
||||
this.paramDeviceCodeList=response.data;
|
||||
// this.condition.paramCode=paramCode;
|
||||
});
|
||||
this.deviceConditionList.pop();
|
||||
this.$refs.deviceCondition.resetDisabled();
|
||||
}
|
||||
if(this.deviceConditionList.length<=0)
|
||||
{
|
||||
this.$messageBox(`请添加设备条件`);
|
||||
return;
|
||||
}
|
||||
// this.conditionInfo.paramCode="";
|
||||
},
|
||||
addQuestAction(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let group=this.$props.group;
|
||||
let data=this.conditionInfo;
|
||||
if(data.paramDeviceType=="")
|
||||
{data.paramDeviceType=null;}
|
||||
postTargetConditionAction(group,data).then(response=>{
|
||||
if(this.dialogType=="add")
|
||||
{this.$message.success('添加任务目标条件成功');}
|
||||
else
|
||||
{this.$message.success('修改任务目标条件成功');}
|
||||
this.loadTabledata();
|
||||
this.dialogFormVisible=false;
|
||||
this.conditionInfo.condition="";
|
||||
this.conditionInfo.code="";
|
||||
// this.condition.deviceType="Link";
|
||||
}).catch(error => {
|
||||
if(this.dialogType=="add")
|
||||
{ this.$messageBox(`添加任务目标条件失败: ${error.message}`);}
|
||||
else
|
||||
{ this.$messageBox(`修改任务目标条件失败: ${error.message}`);}
|
||||
})
|
||||
}
|
||||
else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteCondition(row){
|
||||
let group=this.$props.group;
|
||||
deleteTargetConditionAction(group,row.id).then(resp => {
|
||||
this.$message.success('删除任务目标条件成功');
|
||||
this.loadTabledata();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`删除任务目标条件失败: ${error.message}`);
|
||||
let data={deviceConditionVOList:this.deviceConditionList};
|
||||
let that=this;
|
||||
postTargetConditionAction (group,data).then(responese => {
|
||||
this.$message.success('保存目标条件成功');
|
||||
this.$store.dispatch('scriptRecord/updateDeviceCondition', that.deviceConditionList);
|
||||
// this.$emit('create');
|
||||
}).catch((err) => {
|
||||
this.$messageBox(`保存目标条件失败: ${error.message}`);
|
||||
});
|
||||
},
|
||||
modifyCondition(row){
|
||||
this.title="修改目标条件";
|
||||
this.dialogType="modify";
|
||||
this.conditionInfo.deviceType=row.deviceType;
|
||||
this.conditionInfo.paramDeviceType=row.paramDeviceType;
|
||||
this.getDeviceInfo(row.condition,row.code,row.paramCode);
|
||||
this.conditionInfo.id=row.id;
|
||||
this.dialogFormVisible=true;
|
||||
}
|
||||
changeAdding(data)
|
||||
{
|
||||
this.isAdding=data;
|
||||
},
|
||||
// hover(field) {
|
||||
// if (field == 'relStandCode') {
|
||||
// this.fieldS = field === this.fieldS ? '' : field;
|
||||
// // this.$emit('fieldSelect', this.fieldS);
|
||||
// } else {
|
||||
// this.field = field === this.field ? '' : field;
|
||||
// }
|
||||
// },
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.addCondition{
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.ConditionList{
|
||||
margin-top: 20px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.inputStyle{
|
||||
width:150px;
|
||||
height:30px;
|
||||
}
|
||||
.ConditionListTable{
|
||||
margin-top: 20px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
width:651px;
|
||||
.ConditionButton{
|
||||
margin-top:20px;
|
||||
margin-left:0px;
|
||||
}
|
||||
</style>
|
||||
|
199
src/views/display/scriptRecord/taskScript.vue
Normal file
199
src/views/display/scriptRecord/taskScript.vue
Normal file
@ -0,0 +1,199 @@
|
||||
<template>
|
||||
<el-form :model="taskScript" ref="taskScript" :rules="rules" label-width="80px" label-position="right">
|
||||
<el-form-item label="角色行为" class="conditionVO" prop="behavior">
|
||||
<el-select v-model="taskScript.memberId" placeholder="请选择剧本角色" @change="changeMember">
|
||||
<el-option v-for="taskScriptMember in taskScriptList" :key="taskScriptMember.id" :label="taskScriptMember.name" :value="taskScriptMember.id"></el-option>
|
||||
</el-select>
|
||||
<el-select v-model="taskScript.behavior" placeholder="请选择角色行为" @change="changeBehavior">
|
||||
<el-option v-for="behavior in behaviorList" :key="behavior.id" :label="behavior.description" :value="behavior.id"></el-option>
|
||||
</el-select>
|
||||
<el-button type="primary" size="small" @click="addTaskScript">添加</el-button>
|
||||
</el-form-item>
|
||||
<el-table
|
||||
:data="data.scriptBehaviorList" border class="scriptBehaviorList">
|
||||
<el-table-column label="剧本角色" width="200" prop="memberName">
|
||||
</el-table-column>
|
||||
<el-table-column label="角色行为" width="200" prop="behaviorName">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<el-button type="primary" size="mini" @click="deleteOperate(scope.$index)">删除</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="addTaskScriptList" style="margin-top:30px;">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import Sortable from 'sortablejs';
|
||||
import {saveTaskScript,getQuestRecord} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'taskScript',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.rowDrop();
|
||||
let script=this.$store.state.scriptRecord.script;
|
||||
let memeberList=this.$store.state.scriptRecord.memberList;
|
||||
this.taskScriptList=memeberList;
|
||||
this.setScriptList(memeberList,script);
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
taskScript:{
|
||||
index:"",
|
||||
memberId:"",
|
||||
behavior:"",
|
||||
},
|
||||
taskScriptMembername:"",
|
||||
behaviorName:"",
|
||||
taskScriptList:[],
|
||||
behaviorList:[],
|
||||
data:{
|
||||
scriptBehaviorList:[],
|
||||
},
|
||||
rules:{
|
||||
behavior:[
|
||||
{ required: true, message: '请选择角色行为', trigger: 'change' }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.scriptRecord.memberList': function (val, old){
|
||||
this.taskScriptList=val;
|
||||
},
|
||||
'$store.state.scriptRecord.script': function (val, old){
|
||||
let script=val;
|
||||
let memeberList=this.taskScriptList;
|
||||
this.setScriptList(memeberList,script);
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
setScriptList(memeberList,script){
|
||||
if(script.behaviorIdList!=undefined)
|
||||
{
|
||||
let behaviorIdList=script.behaviorIdList;
|
||||
let scriptBehaviorList=[];
|
||||
for(var i=0;i<behaviorIdList.length;i++)
|
||||
{
|
||||
let behaviorId=behaviorIdList[i];
|
||||
let scriptBehavior={};
|
||||
for(var j=0;j<memeberList.length;j++)
|
||||
{
|
||||
let behaviorVOList=memeberList[j].behaviorVOList;
|
||||
for(var k=0;k<behaviorVOList.length;k++)
|
||||
{
|
||||
if(behaviorVOList[k].id==behaviorId)
|
||||
{
|
||||
scriptBehavior.memberId=memeberList[j].id;
|
||||
scriptBehavior.memberName=memeberList[j].name;
|
||||
scriptBehavior.behavior=behaviorId;
|
||||
scriptBehavior.behaviorName=behaviorVOList[k].description;
|
||||
scriptBehaviorList.push(scriptBehavior);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.data.scriptBehaviorList=scriptBehaviorList;
|
||||
}
|
||||
},
|
||||
rowDrop(){
|
||||
const that = this;
|
||||
const tbody = document.querySelector('.scriptBehaviorList .el-table__body-wrapper tbody');
|
||||
if (tbody) {
|
||||
Sortable.create(tbody, {
|
||||
onEnd({newIndex, oldIndex}) {
|
||||
that.data.scriptBehaviorList.splice(newIndex, 0, that.data.scriptBehaviorList.splice(oldIndex, 1)[0]);
|
||||
var newArray = that.data.scriptBehaviorList.slice(0);
|
||||
that.data.scriptBehaviorList = [];
|
||||
that.$nextTick(function () {
|
||||
that.data.scriptBehaviorList = newArray;
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
changeMember(index)
|
||||
{
|
||||
this.taskScript.behavior="";
|
||||
let taskScriptList=this.taskScriptList;
|
||||
for(let i=0;i<taskScriptList.length;i++)
|
||||
{
|
||||
if(taskScriptList[i].id==index)
|
||||
{
|
||||
this.taskScriptMembername=taskScriptList[i].name;
|
||||
this.behaviorList=taskScriptList[i].behaviorVOList;
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
changeBehavior(index){
|
||||
let obj = this.behaviorList.find((item)=>{
|
||||
return item.id === index;
|
||||
});
|
||||
this.behaviorName=obj.description;
|
||||
},
|
||||
addTaskScript(){
|
||||
this.$refs['taskScript'].validate((valid) => {
|
||||
if (valid) {
|
||||
let scriptBehavior={
|
||||
memberId:this.taskScript.memberId,
|
||||
behavior:this.taskScript.behavior,
|
||||
memberName:this.taskScriptMembername,
|
||||
behaviorName:this.behaviorName,
|
||||
};
|
||||
this.data.scriptBehaviorList.push(scriptBehavior);
|
||||
this.behaviorList=[];
|
||||
this.taskScript.behavior="";
|
||||
this.taskScript.memberId="";
|
||||
}
|
||||
else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteOperate(data){
|
||||
this.data.scriptBehaviorList.splice(data,1);
|
||||
},
|
||||
addTaskScriptList(){
|
||||
if(this.data.scriptBehaviorList.length<=0)
|
||||
{
|
||||
this.$messageBox(`请添加角色行为`);
|
||||
return;
|
||||
}
|
||||
let behaviorIdList=[];
|
||||
for(let i=0;i<this.data.scriptBehaviorList.length;i++)
|
||||
{
|
||||
behaviorIdList.push(this.data.scriptBehaviorList[i].behavior);
|
||||
}
|
||||
let group=this.$props.group;
|
||||
let that=this;
|
||||
saveTaskScript(group,behaviorIdList).then(response=>{
|
||||
this.$message.success('保存任务剧本成功');
|
||||
this.$store.dispatch('scriptRecord/updateScript', {"behaviorIdList":behaviorIdList});
|
||||
}).catch(error => {
|
||||
this.$messageBox(`保存任务剧本失败: ${error.message}`);
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.scriptBehaviorList{
|
||||
margin-top:30px;
|
||||
margin-left:10px;
|
||||
width:601px
|
||||
}
|
||||
</style>
|
@ -10,80 +10,69 @@
|
||||
</div>
|
||||
<div class="tip-body-box" ref="dragBody">
|
||||
<div class="tip-body">
|
||||
<!-- <el-scrollbar wrapClass="scrollbar-wrapper"> -->
|
||||
<template v-if="isRoleSectionDisplay">
|
||||
<template v-if="displayType=='role'">
|
||||
<template>
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane label="用户角色" name="first">
|
||||
<el-tab-pane label="角色管理" name="first">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<role-section ref="roleSection" :group="group" @addBehavior="addBehavior" @getBehaviorList="getBehaviorList"></role-section>
|
||||
<role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="目标条件" name="second">
|
||||
<el-tab-pane label="任务目标" name="second">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<target-condition ref="targetCondition" :group="group"></target-condition>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="任务剧本" name="third">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<task-script ref="taskScript" :group="group"></task-script>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="isBehaviorSectionDisplay">
|
||||
<template v-if="displayType=='behavior'">
|
||||
<div class="tab-pane-big">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<add-behavior ref="addBehavior" :group="group" :memberId="memberId" @addBehaviorSuccess="addBehaviorSuccess" @backToMember="backToMember"></add-behavior>
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar">
|
||||
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions" @backToTop="backToTop"></get-behavior>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="isBehaviorListDisplay">
|
||||
<template v-if="displayType=='action'">
|
||||
<div class="tab-pane-big">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @addAction="addAction" @getActions="getActions"></get-behavior>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="isActionAddDisplay">
|
||||
<div class="tab-pane-big">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<add-action ref="addAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @addActionSuccess="addActionSuccess" @backToBehavior="backToBehavior"></add-action>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="isActionListDisplay">
|
||||
<div class="tab-pane-big">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior"></get-action>
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
|
||||
<get-action ref="getAction" :group="group" :memberId="memberId" :behaviorId="behaviorId" @backToBehavior="backToBehavior" @backToTop="backToActionTop"></get-action>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
<el-button-group class="button-group">
|
||||
<el-button type="primary" @click="saveMaplocation">更新定位</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">保存背景</el-button>
|
||||
<el-button type="success" @click="saveScenesData">保存数据</el-button>
|
||||
<!-- <el-button type="danger" @click="dumpScenesData">重置剧本</el-button> -->
|
||||
</el-button-group>
|
||||
<!-- </el-scrollbar> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import RoleSection from './scriptRecord/roleSection';
|
||||
import AddBehavior from './scriptRecord/addBehavior';
|
||||
import GetBehavior from './scriptRecord/getBehavior';
|
||||
import AddAction from './scriptRecord/addAction';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import TargetCondition from './scriptRecord/targetCondition';
|
||||
|
||||
|
||||
|
||||
import TaskScript from './scriptRecord/taskScript';
|
||||
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
import {getMembersByGroup,postMemberBehavior,saveScriptScenes, saveScriptData, dumpScriptData} from '@/api/simulation';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData,getQuestRecord} from '@/api/simulation';
|
||||
import {updateMapLocation} from '@/api/quest';
|
||||
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
@ -95,11 +84,10 @@
|
||||
},
|
||||
components: {
|
||||
RoleSection,
|
||||
AddBehavior,
|
||||
GetBehavior,
|
||||
AddAction,
|
||||
GetAction,
|
||||
TargetCondition
|
||||
TargetCondition,
|
||||
TaskScript
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -107,25 +95,40 @@
|
||||
isShrink: false,
|
||||
memberId:null,
|
||||
behaviorId:null,
|
||||
isRoleSectionDisplay:true,
|
||||
isBehaviorSectionDisplay:false,
|
||||
isBehaviorListDisplay:false,
|
||||
isActionAddDisplay:false,
|
||||
isActionListDisplay:false,
|
||||
displayType:"role",
|
||||
activeName:"first",
|
||||
mapLocation:{},
|
||||
// isSaveStage: true,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
// debugger;
|
||||
//
|
||||
// this.$parent.$parent.$refs['mapCanvas'].$refs['mapCommon'].$refs['jlmapVisual'].$jlmap.setOptions({type: 'zoom', scale:this.mapLocation.scale});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
created() {
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
computed:{
|
||||
this.shrink();
|
||||
},
|
||||
methods: {
|
||||
loadInitData(obj) {
|
||||
this.shrink();
|
||||
let group=obj.group;
|
||||
let that=this;
|
||||
getQuestRecord(group).then(response =>{
|
||||
let deviceConditionList=response.data.questTargetVO.deviceConditionVOList;
|
||||
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
|
||||
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
|
||||
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
|
||||
// if(response.data.mapLocation)
|
||||
// {
|
||||
// let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
|
||||
// this.mapLocation=mapLocation;
|
||||
// }
|
||||
});
|
||||
},
|
||||
jump(obj) {
|
||||
},
|
||||
@ -142,65 +145,21 @@
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
addBehavior(id){
|
||||
this.isBehaviorSectionDisplay=true;
|
||||
this.isRoleSectionDisplay=false;
|
||||
this.isBehaviorListDisplay=false;
|
||||
this.isActionAddDisplay=false;
|
||||
this.isActionListDisplay=false;
|
||||
this.memberId=id;
|
||||
},
|
||||
getBehaviorList(id){
|
||||
this.isRoleSectionDisplay=false;
|
||||
this.isBehaviorListDisplay=true;
|
||||
this.isBehaviorSectionDisplay=false;
|
||||
this.isActionAddDisplay=false;
|
||||
this.isActionListDisplay=false;
|
||||
this.memberId=id;
|
||||
},
|
||||
addBehaviorSuccess(){
|
||||
this.isRoleSectionDisplay=true;
|
||||
this.isBehaviorListDisplay=false;
|
||||
this.isBehaviorSectionDisplay=false;
|
||||
this.isActionAddDisplay=false;
|
||||
this.isActionListDisplay=false;
|
||||
getBehaviorList(row){
|
||||
this.displayType="behavior";
|
||||
this.memberId=row.id;
|
||||
this.$store.dispatch('scriptRecord/updateMemberName',row.name);
|
||||
},
|
||||
backToMember(){
|
||||
this.isRoleSectionDisplay=true;
|
||||
this.isBehaviorListDisplay=false;
|
||||
this.isBehaviorSectionDisplay=false;
|
||||
this.isActionAddDisplay=false;
|
||||
this.isActionListDisplay=false;
|
||||
this.displayType="role";
|
||||
},
|
||||
backToBehavior(){
|
||||
this.isRoleSectionDisplay=false;
|
||||
this.isBehaviorListDisplay=true;
|
||||
this.isBehaviorSectionDisplay=false;
|
||||
this.isActionAddDisplay=false;
|
||||
this.isActionListDisplay=false;
|
||||
this.displayType="behavior";
|
||||
},
|
||||
addActionSuccess(){
|
||||
this.isRoleSectionDisplay=false;
|
||||
this.isBehaviorListDisplay=true;
|
||||
this.isBehaviorSectionDisplay=false;
|
||||
this.isActionAddDisplay=false;
|
||||
this.isActionListDisplay=false;
|
||||
},
|
||||
addAction(id){
|
||||
this.isRoleSectionDisplay=false;
|
||||
this.isBehaviorListDisplay=false;
|
||||
this.isBehaviorSectionDisplay=false;
|
||||
this.isActionAddDisplay=true;
|
||||
this.isActionListDisplay=false;
|
||||
this.behaviorId=id;
|
||||
},
|
||||
getActions(id){
|
||||
this.isRoleSectionDisplay=false;
|
||||
this.isBehaviorListDisplay=false;
|
||||
this.isBehaviorSectionDisplay=false;
|
||||
this.isActionAddDisplay=false;
|
||||
this.isActionListDisplay=true;
|
||||
this.behaviorId=id;
|
||||
getActions(row){
|
||||
this.displayType="action";
|
||||
this.behaviorId=row.id;
|
||||
this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
},
|
||||
saveScenesStage() {
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
@ -231,6 +190,27 @@
|
||||
})
|
||||
}).catch(error => { })
|
||||
},
|
||||
backToTop(){
|
||||
var div = this.$refs['elScrollbar'].$refs['wrap'];
|
||||
div.scrollTop=0;
|
||||
},
|
||||
backToActionTop(){
|
||||
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
|
||||
div.scrollTop=0;
|
||||
},
|
||||
saveMaplocation()
|
||||
{
|
||||
debugger;
|
||||
// this.$parent.$parent.$refs['mapCanvas'].$refs['mapCommon'].$refs['jlmapVisual'].$jlmap.$options
|
||||
// let dataZoom = this.$store.state.map.dataZoom;
|
||||
// let scriptId=this.$route.query.scriptId;
|
||||
// let data={scale:dataZoom.scaleRate,x:dataZoom.offsetX,y:dataZoom.offsetY};
|
||||
// updateMapLocation(scriptId,data).then(response=>{
|
||||
// this.$message.success('更新定位成功');
|
||||
// }).catch(error => {
|
||||
// this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -247,13 +227,16 @@
|
||||
.tab-pane-big{
|
||||
height:420px;
|
||||
}
|
||||
.breadColor{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.reminder-box {
|
||||
position: absolute;
|
||||
float: left;
|
||||
left: 15px;
|
||||
bottom: 15px;
|
||||
width: 695px;
|
||||
width: 995px;
|
||||
height: 540px;
|
||||
background-color: #fff;
|
||||
border-radius: 5px;
|
||||
|
@ -26,7 +26,7 @@
|
||||
@node-contextmenu="showContextMenu"
|
||||
@node-click="clickEvent"
|
||||
>
|
||||
<span slot-scope="{ node, data }" class="custom-tree-node">
|
||||
<span slot-scope="{ node }" class="custom-tree-node">
|
||||
<span
|
||||
v-if="node.data.type === 'lesson'"
|
||||
:class="node.data.valid? 'el-icon-sold-out':'el-icon-goods'"
|
||||
@ -50,7 +50,7 @@
|
||||
</el-card>
|
||||
</template>
|
||||
<script>
|
||||
import { getCourseLessonTree, getCourseLessonDetail } from '@/api/management/exam';
|
||||
import { getCourseLessonTree } from '@/api/management/exam';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import FilterCity from '@/views/components/filterCity';
|
||||
|
@ -16,7 +16,7 @@
|
||||
<el-form-item label="是否通过:" prop="detail">
|
||||
<span v-if="resultModel.result === '01'" style="color:darkgray">未计算</span>
|
||||
<span v-else-if="resultModel.result === '02'" style="color:green">通过</span>
|
||||
<span v-else="resultModel.result === '03'" style="color:red">未通过</span>
|
||||
<span v-else-if="resultModel.result === '03'" style="color:red">未通过</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="考试用时:" prop="detail">
|
||||
<span>{{ Math.ceil(resultModel.usedTime/60) + ' 分钟' }}</span>
|
||||
|
@ -66,7 +66,6 @@ export function mmiimage() {
|
||||
this.m10['shiwei'] = '/static/jl3d/mmi/m10-shiwei.png';
|
||||
this.m10['querenxinhao'] = '/static/jl3d/mmi/m10-querenxinhao.png';
|
||||
this.m10['none'] = '/static/jl3d/mmi/none.png';
|
||||
console.log(scope);
|
||||
|
||||
this.c1 = [];
|
||||
this.c1['qianyin'] = '/static/jl3d/mmi/c1-qianyin.png';
|
||||
|
@ -19,7 +19,6 @@
|
||||
import { scriptRecordNotify } from '@/api/simulation';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import CreateScript from './create';
|
||||
import { debuglog } from 'util';
|
||||
|
||||
export default {
|
||||
name: 'ScriptManage',
|
||||
|
971
static/three.min.js
vendored
Normal file
971
static/three.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user