Merge branch 'master' of https://git.qcloud.com/joylink/jl-nclient
This commit is contained in:
commit
be0b7f7a2f
@ -352,7 +352,7 @@ export const asyncRouter = [
|
|||||||
path: '/script',
|
path: '/script',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
meta: {
|
meta: {
|
||||||
roles: [admin, user]
|
roles: [admin, lessonCreater]
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
|
import DeviceTypeDic from '@/scripts/DeviceTypeDic';
|
||||||
import DeviceCondition from './deviceCondition';
|
import DeviceCondition from './deviceCondition';
|
||||||
import {getMembersByGroup,postMemberBehavior} from '@/api/simulation';
|
import {getQuestRecord,postMemberBehavior} from '@/api/simulation';
|
||||||
export default {
|
export default {
|
||||||
name: 'addBehavior',
|
name: 'addBehavior',
|
||||||
props: {
|
props: {
|
||||||
@ -123,8 +123,8 @@
|
|||||||
loadInitData(obj) {
|
loadInitData(obj) {
|
||||||
let group=obj.group;
|
let group=obj.group;
|
||||||
let memberId=this.$props.memberId;
|
let memberId=this.$props.memberId;
|
||||||
getMembersByGroup(group).then(response=>{
|
getQuestRecord(group).then(response=>{
|
||||||
let datalist=response.data;
|
let datalist=response.data.memberVOList;
|
||||||
this.targetMemberList=datalist;
|
this.targetMemberList=datalist;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -140,7 +140,7 @@
|
|||||||
handleInputConfirm() {
|
handleInputConfirm() {
|
||||||
let inputValue = this.inputValue;
|
let inputValue = this.inputValue;
|
||||||
if (inputValue) {
|
if (inputValue) {
|
||||||
this.behavior.conditionVO.importantList.push(inputValue);
|
this.behavior.conditionVO.importantList.push(inputValue);
|
||||||
}
|
}
|
||||||
this.inputVisible = false;
|
this.inputVisible = false;
|
||||||
this.inputValue = '';
|
this.inputValue = '';
|
||||||
@ -150,40 +150,49 @@
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
let group=this.$props.group;
|
let group=this.$props.group;
|
||||||
let memberId=this.$props.memberId;
|
let memberId=this.$props.memberId;
|
||||||
if(this.behavior.conditionVO.triggerType=="DeviceCondition")
|
switch(this.behavior.conditionVO.triggerType)
|
||||||
{
|
{
|
||||||
if(this.isAdding)
|
case 'DeviceCondition':
|
||||||
{
|
{
|
||||||
this.behavior.conditionVO.deviceConditionList.pop();
|
if(this.isAdding)
|
||||||
this.$refs.deviceCondition.resetDisabled();
|
{
|
||||||
|
this.behavior.conditionVO.deviceConditionList.pop();
|
||||||
|
this.$refs.deviceCondition.resetDisabled();
|
||||||
|
}
|
||||||
|
if(this.behavior.conditionVO.deviceConditionList.length<=0)
|
||||||
|
{
|
||||||
|
this.$messageBox(`请添加设备条件`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(this.behavior.conditionVO.deviceConditionList.length<=0)
|
case 'None':
|
||||||
{
|
{
|
||||||
this.$messageBox(`请添加设备条件`);
|
this.behavior.conditionVO={};
|
||||||
return;
|
this.behavior.conditionVO.triggerType="None";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.behavior.conditionVO.triggerType=="None")
|
|
||||||
{
|
|
||||||
this.behavior.conditionVO={};
|
|
||||||
this.behavior.conditionVO.triggerType="None";
|
|
||||||
}
|
|
||||||
if(memberId)
|
if(memberId)
|
||||||
{
|
{
|
||||||
let behavior=this.behavior;
|
let behavior=this.behavior;
|
||||||
postMemberBehavior(group,memberId,behavior).then(response=>{
|
postMemberBehavior(group,memberId,behavior).then(response=>{
|
||||||
this.behavior.auto=false;
|
this.behavior={
|
||||||
this.behavior.description="";
|
auto:false,
|
||||||
this.behavior.conditionVO.triggerType="None";
|
description:"",
|
||||||
this.behavior.conditionVO.importantList=[];
|
conditionVO:{
|
||||||
this.behavior.targetMemberId=null;
|
triggerType:"None",
|
||||||
this.behavior.conditionVO.content="";
|
importantList:[],
|
||||||
this.behavior.conditionVO.keyWord="";
|
content:"",
|
||||||
this.behavior.id=null;
|
keyWord:"",
|
||||||
|
deviceConditionList:[],
|
||||||
|
},
|
||||||
|
targetMemberId:null,
|
||||||
|
id:null
|
||||||
|
};
|
||||||
this.isConversationShow=false;
|
this.isConversationShow=false;
|
||||||
this.isDeviceShow=false;
|
this.isDeviceShow=false;
|
||||||
this.behavior.conditionVO.deviceConditionList=[];
|
if(this.$props.operateType==="add")
|
||||||
if(this.$props.operateType=="add")
|
|
||||||
{
|
{
|
||||||
this.$message.success('添加行为成功');
|
this.$message.success('添加行为成功');
|
||||||
}
|
}
|
||||||
@ -194,7 +203,7 @@
|
|||||||
}
|
}
|
||||||
this.$emit('create');
|
this.$emit('create');
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
if(this.$props.operateType=="add")
|
if(this.$props.operateType==="add")
|
||||||
{
|
{
|
||||||
this.$messageBox(`添加行为失败: ${error.message}`);
|
this.$messageBox(`添加行为失败: ${error.message}`);
|
||||||
}
|
}
|
||||||
@ -236,7 +245,6 @@
|
|||||||
case 'DeviceCondition':{
|
case 'DeviceCondition':{
|
||||||
this.isConversationShow=false;
|
this.isConversationShow=false;
|
||||||
this.isDeviceShow=true;
|
this.isDeviceShow=true;
|
||||||
// this.$refs.deviceCondition.resetDisabled();
|
|
||||||
var newData=JSON.parse(JSON.stringify(data.conditionVO.deviceConditionList).replace(/\"code\"/g,'"isAdded":true,"code"'));
|
var newData=JSON.parse(JSON.stringify(data.conditionVO.deviceConditionList).replace(/\"code\"/g,'"isAdded":true,"code"'));
|
||||||
this.behavior.conditionVO.deviceConditionList=newData;
|
this.behavior.conditionVO.deviceConditionList=newData;
|
||||||
this.resetDisabled();
|
this.resetDisabled();
|
||||||
@ -249,7 +257,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
resetDisabled(){
|
resetDisabled(){
|
||||||
// debugger;
|
|
||||||
if(this.$refs['deviceCondition'])
|
if(this.$refs['deviceCondition'])
|
||||||
{
|
{
|
||||||
this.$refs['deviceCondition'].resetDisabled();
|
this.$refs['deviceCondition'].resetDisabled();
|
||||||
|
@ -1,34 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="tab-pane-big">
|
||||||
<div class="actionList">
|
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
|
||||||
<i class="el-icon-back" @click="backToMember"></i>
|
<div class="actionList">
|
||||||
<span class="titleStyle">{{memberName}}角色<span class="titleStyle">/</span><span class="titleStyle">{{behaviorName}}行为</span><span class="titleStyle">/</span><span class="titleStyle">动作信息</span></span>
|
<i class="el-icon-back" @click="backToMember"></i>
|
||||||
|
<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
|
||||||
|
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="200">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="type" label="动作类型" width="200">
|
||||||
|
</el-table-column>
|
||||||
|
<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>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
<add-action ref="addBehavior" :group="group" :memberId="memberId" :behaviorId="behaviorId" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
|
|
||||||
<el-table
|
|
||||||
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="200">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="type" label="动作类型" width="200">
|
|
||||||
</el-table-column>
|
|
||||||
<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>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import AddAction from './addAction';
|
import AddAction from './addAction';
|
||||||
import {getMembersByGroup,deleteMemberBehaviorAction} from '@/api/simulation';
|
import {getQuestRecord,deleteMemberBehaviorAction} from '@/api/simulation';
|
||||||
export default {
|
export default {
|
||||||
name: 'getAction',
|
name: 'getAction',
|
||||||
props: {
|
props: {
|
||||||
@ -68,8 +70,8 @@
|
|||||||
let group=obj.group;
|
let group=obj.group;
|
||||||
let memberId=this.$props.memberId;
|
let memberId=this.$props.memberId;
|
||||||
let behaviorId=this.$props.behaviorId;
|
let behaviorId=this.$props.behaviorId;
|
||||||
getMembersByGroup(group).then(response=>{
|
getQuestRecord(group).then(response=>{
|
||||||
let datalist=response.data;
|
let datalist=response.data.memberVOList;
|
||||||
let behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
|
let behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
|
||||||
this.actionList=behaviorList.find(elem=>{return elem.id==behaviorId}).actionVOList;
|
this.actionList=behaviorList.find(elem=>{return elem.id==behaviorId}).actionVOList;
|
||||||
this.loading=false;
|
this.loading=false;
|
||||||
@ -96,7 +98,8 @@
|
|||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
},
|
},
|
||||||
modifyAction(row){
|
modifyAction(row){
|
||||||
this.$emit('backToTop');
|
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
|
||||||
|
div.scrollTop=0;
|
||||||
this.operateType="modify";
|
this.operateType="modify";
|
||||||
this.buttonName="修改动作"
|
this.buttonName="修改动作"
|
||||||
this.$refs.addBehavior.doShow(row);
|
this.$refs.addBehavior.doShow(row);
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue';
|
import Vue from 'vue';
|
||||||
import {getMembersByGroup,deleteMemberBehavior} from '@/api/simulation';
|
import {getQuestRecord,deleteMemberBehavior} from '@/api/simulation';
|
||||||
import AddBehavior from './addBehavior';
|
import AddBehavior from './addBehavior';
|
||||||
export default {
|
export default {
|
||||||
name: 'behaviorList',
|
name: 'behaviorList',
|
||||||
@ -80,8 +80,8 @@
|
|||||||
loadInitData(obj) {
|
loadInitData(obj) {
|
||||||
let group=obj.group;
|
let group=obj.group;
|
||||||
let memberId=this.$props.memberId;
|
let memberId=this.$props.memberId;
|
||||||
getMembersByGroup(group).then(response=>{
|
getQuestRecord(group).then(response=>{
|
||||||
let datalist=response.data;
|
let datalist=response.data.memberVOList;
|
||||||
this.behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
|
this.behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
|
||||||
this.loading=false;
|
this.loading=false;
|
||||||
});
|
});
|
||||||
|
@ -60,6 +60,7 @@
|
|||||||
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
|
this.$store.dispatch('scriptRecord/updateDeviceCondition', deviceConditionList);
|
||||||
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
|
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
|
||||||
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
|
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
|
||||||
|
debugger;
|
||||||
if(response.data.mapLocation)
|
if(response.data.mapLocation)
|
||||||
{
|
{
|
||||||
let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
|
let mapLocation={"offsetX":response.data.mapLocation.x,"offsetY":response.data.mapLocation.y,"scaleRate":response.data.mapLocation.scale};
|
||||||
|
@ -14,14 +14,10 @@
|
|||||||
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
|
<role-condition-script :group="group" @getBehaviorList="getBehaviorList"></role-condition-script>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="displayType=='behavior'">
|
<template v-if="displayType=='behavior'">
|
||||||
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions"></get-behavior>
|
<get-behavior ref="getBehavior" :group="group" :memberId="memberId" @backToMember="backToMember" @getActions="getActions"></get-behavior>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="displayType=='action'">
|
<template v-if="displayType=='action'">
|
||||||
<div class="tab-pane-big">
|
<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>
|
</template>
|
||||||
<el-button-group class="button-group">
|
<el-button-group class="button-group">
|
||||||
<el-button type="primary" @click="saveMaplocation">更新定位</el-button>
|
<el-button type="primary" @click="saveMaplocation">更新定位</el-button>
|
||||||
@ -138,10 +134,6 @@
|
|||||||
this.displayType="behavior";
|
this.displayType="behavior";
|
||||||
this.memberId=id;
|
this.memberId=id;
|
||||||
},
|
},
|
||||||
backToActionTop(){
|
|
||||||
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
|
|
||||||
div.scrollTop=0;
|
|
||||||
},
|
|
||||||
saveMaplocation()
|
saveMaplocation()
|
||||||
{
|
{
|
||||||
let data=Vue.prototype.$jlmap.$options;
|
let data=Vue.prototype.$jlmap.$options;
|
||||||
|
Loading…
Reference in New Issue
Block a user