Merge branch 'dev' of https://git.qcloud.com/joylink/jl-nclient into dev
This commit is contained in:
commit
91b2674de4
@ -33,5 +33,11 @@ export default {
|
||||
createSpeedLevelFailed: 'Failed to create speed level',
|
||||
createOperationGraphFailed: 'Failed to create operation diagram',
|
||||
loadingCityListFailed: 'Failed to load city list',
|
||||
cannotNarrowDown: 'You cannot narrow down the training list you created last time'
|
||||
cannotNarrowDown: 'You cannot narrow down the training list you created last time',
|
||||
scanningError: 'Scanning error',
|
||||
serviceException: 'Service exception',
|
||||
codeHasExist: 'Coding already exists',
|
||||
formartError: 'The format is incorrect, only characters/numbers/_',
|
||||
createDictionaryFailed: 'Failed to create dictionary',
|
||||
updateDictionaryFailed: 'Failed to update dictionary'
|
||||
};
|
||||
|
@ -13,7 +13,8 @@ export default {
|
||||
add: 'Add',
|
||||
query: 'Query',
|
||||
detail: 'Details',
|
||||
quickEntry: 'Quick Entry',
|
||||
quickEntry: 'Quick entry',
|
||||
scan: 'Scan',
|
||||
chooseDate: 'Please choose the date',
|
||||
chooseTime: 'Please choose the time',
|
||||
chooseDateTime: 'Please choose the date and time',
|
||||
@ -65,5 +66,18 @@ export default {
|
||||
filteringKeywords: 'Enter keywords for filtering',
|
||||
previousStep: 'PreviousStep',
|
||||
skip: 'Skip',
|
||||
modify: 'Modify'
|
||||
modify: 'Modify',
|
||||
language: 'Language',
|
||||
exit: 'Exit',
|
||||
chooseLanguage: 'Please choose the language',
|
||||
switchLanguage: 'Switch language',
|
||||
joinRoom: 'Join Room',
|
||||
synthesisTrainingTitle: 'Synthesis Training Fast Entrance',
|
||||
pleaseChooseRoom: 'You did not choose a room',
|
||||
inviteJoinRoom: 'Invite you to join the synthesis training!',
|
||||
trainingHasStart: "(name)'s room has begun",
|
||||
trainingNotStart: "(name)'s room hasn't started yet",
|
||||
inputRoomNumber: 'Please enter the room number.',
|
||||
chooseRoom: 'Choose Room'
|
||||
|
||||
};
|
||||
|
@ -23,7 +23,7 @@ export default {
|
||||
|
||||
dpSystem: 'Large screen',
|
||||
|
||||
planSystem: 'Lian Plan',
|
||||
planSystem: 'Lian plan',
|
||||
|
||||
replayManage: 'Playback',
|
||||
|
||||
|
@ -142,6 +142,11 @@ export default {
|
||||
endSectionCode: '请选择终到区段',
|
||||
|
||||
selectTurnoutID: '请选择道岔ID',
|
||||
switchesCannot: '道岔不能为同一个'
|
||||
switchesCannot: '道岔不能为同一个',
|
||||
|
||||
pleaseInputName: '请输入名称',
|
||||
pleaseSelectStatus: '请选择状态',
|
||||
pleaseInputCode: '请输入编码',
|
||||
strLength1To25: '长度在 1 到 25 个字符',
|
||||
strLengthNotExceed50: '不能超过 50 个字符'
|
||||
};
|
||||
|
@ -6,5 +6,11 @@ export default {
|
||||
createDirectory: 'Create dictionary',
|
||||
editDictionary: 'Edit dictionary',
|
||||
deleteSuccess: 'Successful deletion',
|
||||
dleeteTipContext: 'This operation will delete the type. Do you want to continue?'
|
||||
dleeteTipContext: 'This operation will delete the type. Do you want to continue?',
|
||||
createSuccess: 'Create successful',
|
||||
updateSuccess: 'Update successful',
|
||||
destory: 'Destory',
|
||||
simulationGroup: 'Simulation group',
|
||||
username: 'User name',
|
||||
phoneNumber: 'Cell-phone number'
|
||||
};
|
||||
|
@ -33,6 +33,12 @@ export default {
|
||||
createSpeedLevelFailed: '创建速度等级失败',
|
||||
createOperationGraphFailed: '创建运行图失败',
|
||||
loadingCityListFailed: '加载城市列表失败',
|
||||
cannotNarrowDown: '不能缩小上次创建的实训列表的范围'
|
||||
cannotNarrowDown: '不能缩小上次创建的实训列表的范围',
|
||||
scanningError: '扫码错误',
|
||||
serviceException: '服务异常',
|
||||
codeHasExist: '编码已存在',
|
||||
formartError: '格式不正确,只能是字符/数字/_',
|
||||
createDictionaryFailed: '创建字典失败',
|
||||
updateDictionaryFailed: '更新字典失败'
|
||||
|
||||
};
|
||||
|
@ -14,6 +14,7 @@ export default {
|
||||
query: '查 询',
|
||||
detail: '明 细',
|
||||
quickEntry: '快速入口',
|
||||
scan: '扫码',
|
||||
chooseDate: '请选择日期',
|
||||
chooseTime: '请选择时间',
|
||||
chooseDateTime: '请选择日期时间',
|
||||
@ -66,5 +67,17 @@ export default {
|
||||
filteringKeywords: '输入关键字进行过滤',
|
||||
previousStep: '上一步',
|
||||
skip: '跳过',
|
||||
modify: '修改'
|
||||
modify: '修改',
|
||||
language: '语言',
|
||||
exit: '退出',
|
||||
chooseLanguage: '请选择语言',
|
||||
switchLanguage: '切换语言',
|
||||
joinRoom: '加入房间',
|
||||
synthesisTrainingTitle: '综合演练快速入口',
|
||||
pleaseChooseRoom: '您没有选择房间',
|
||||
inviteJoinRoom: '邀请你加入综合演练!',
|
||||
trainingHasStart: '{{name}}的房间已开始',
|
||||
trainingNotStart: '{{name}}的房间未开始',
|
||||
inputRoomNumber: '请输入房间号',
|
||||
chooseRoom: '选择房间'
|
||||
};
|
||||
|
@ -142,6 +142,11 @@ export default {
|
||||
endSectionCode: '请选择终到区段',
|
||||
|
||||
selectTurnoutID: '请选择道岔ID',
|
||||
switchesCannot: '道岔不能为同一个'
|
||||
switchesCannot: '道岔不能为同一个',
|
||||
|
||||
pleaseInputName: '请输入名称',
|
||||
pleaseSelectStatus: '请选择状态',
|
||||
pleaseInputCode: '请输入编码',
|
||||
strLength1To25: '长度在 1 到 25 个字符',
|
||||
strLengthNotExceed50: '不能超过 50 个字符'
|
||||
};
|
||||
|
@ -6,5 +6,11 @@ export default {
|
||||
createDirectory: '创建目录',
|
||||
editDictionary: '编辑目录',
|
||||
deleteSuccess: '删除成功',
|
||||
dleeteTipContext: '此操作将删除该类型, 是否继续?'
|
||||
dleeteTipContext: '此操作将删除该类型, 是否继续?',
|
||||
createSuccess: '创建成功',
|
||||
updateSuccess: '更新成功',
|
||||
destory: '销 毁',
|
||||
simulationGroup: '仿真Group',
|
||||
username: '用户名',
|
||||
phoneNumber: '手机号'
|
||||
};
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="avatar-container" style="right: 80px;">
|
||||
<el-menu-item v-for="item in entryList" :key="item.name" class="avatar-wrapper" index="" @click="item.handle">
|
||||
<span style="color: white;">{{ item.name }}</span>
|
||||
<span style="color: white;">{{ $t(item.name) }}</span>
|
||||
</el-menu-item>
|
||||
<deomon-list ref="deomonList" />
|
||||
<qcode ref="qcode" />
|
||||
@ -22,11 +22,11 @@ export default {
|
||||
return {
|
||||
entryList: [
|
||||
{
|
||||
name: this.$t('global.quickEntry'),
|
||||
name: 'global.quickEntry',
|
||||
handle: this.quickEntry
|
||||
},
|
||||
{
|
||||
name: '扫码',
|
||||
name: 'global.scan',
|
||||
handle: this.qcodeEntry
|
||||
}
|
||||
],
|
||||
|
@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="切换语言"
|
||||
:title="$t('global.switchLanguage')"
|
||||
:visible.sync="visible"
|
||||
width="360px"
|
||||
:before-close="doClose"
|
||||
>
|
||||
<div style="">
|
||||
<span>语言:</span>
|
||||
<el-select v-model="lang" placeholder="请选择语言">
|
||||
<span>{{ $t('global.language') }}:</span>
|
||||
<el-select v-model="lang" :placeholder="$t('global.chooseLanguage')">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
@ -17,8 +17,8 @@
|
||||
</el-select>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">确 定</el-button>
|
||||
<el-button @click="visible = false">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleConfirm">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<el-dropdown class="avatar-container" trigger="hover" :show-timeout="100">
|
||||
<div class="avatar-wrapper">
|
||||
<!-- <img class="user-avatar" :src="avatar+'?imageView2/1/w/80/h/80'"> -->
|
||||
<span style="color: white;">
|
||||
{{ username }}
|
||||
</span>
|
||||
@ -9,10 +8,10 @@
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||
<el-dropdown-item>
|
||||
<span style="display:block;" @click="language">语言</span>
|
||||
<span style="display:block;" @click="language">{{ $t('global.language') }}</span>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item>
|
||||
<span style="display:block;" @click="logout">退出</span>
|
||||
<span style="display:block;" @click="logout">{{ $t('global.exit') }}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
<language ref="language" />
|
||||
|
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<el-dialog title="输入房间号" :visible.sync="centerDialogVisible" width="30%" center>
|
||||
<el-input v-model="input" placeholder="请输入房间号" />
|
||||
<el-dialog :title="$t('global.chooseRoom')" :visible.sync="centerDialogVisible" width="30%" center>
|
||||
<el-input v-model="input" :placeholder="$t('global.inputRoomNumber')" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="comit">确 定</el-button>
|
||||
<el-button @click="centerDialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="comit">{{ $t('global.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -37,10 +37,10 @@ export default {
|
||||
await getPermissionJoint(`${this.input}`);
|
||||
this.centerDialogVisible = false;
|
||||
} catch (error) {
|
||||
this.$messageBox('扫码错误:' + error.message);
|
||||
this.$messageBox(`${this.$t('error.scanningError')}:${error.message}`);
|
||||
}
|
||||
} else {
|
||||
this.$messageBox('请输入房间号');
|
||||
this.$messageBox(this.$t('global.inputRoomNumber'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,84 +4,19 @@
|
||||
const scriptRecord = {
|
||||
namespaced: true,
|
||||
state: {
|
||||
deviceConditionList: [], //任务目标列表
|
||||
memberList:[], //角色列表,
|
||||
script:[], //剧本列表,
|
||||
memberName:"", //角色名称,
|
||||
behaviorName:"", //动作名称
|
||||
mapLocation: {}, //地图定位
|
||||
},
|
||||
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;
|
||||
},
|
||||
mapLocation:(state)=>{
|
||||
return state.mapLocation;
|
||||
}
|
||||
},
|
||||
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;
|
||||
},
|
||||
setMapLocation:(state, mapLocation) => {
|
||||
state.mapLocation = mapLocation;
|
||||
},
|
||||
},
|
||||
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);
|
||||
},
|
||||
/**
|
||||
* 设置地图定位
|
||||
*/
|
||||
|
@ -9,7 +9,6 @@
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<!-- <el-input v-model="filterText" placeholder="输入关键字进行过滤" /> -->
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height+'px'}">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
@ -22,14 +21,18 @@
|
||||
@node-click="clickEvent"
|
||||
>
|
||||
<span slot-scope="{ node, data }">
|
||||
<span>{{ data.creator.nickName }}的房间({{ data.state == '01' ? '未开始' : '已开始' }})</span>
|
||||
<span v-if="data.state=='01'">{{ $t('global.trainingHasStart').replace('(name)', data.creator.nickName) }}</span>
|
||||
<span v-else>{{ $t('global.trainingHasStart').replace('(name)', data.creator.nickName) }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</el-scrollbar>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<!-- <el-button type="primary" @click="handleWatch">观看</el-button> -->
|
||||
<el-button type="primary" @click="handleJoin">加入房间</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
<span
|
||||
slot="
|
||||
footer"
|
||||
class="dialog-footer"
|
||||
>
|
||||
<el-button type="primary" @click="handleJoin">{{ $t('global.joinRoom') }}</el-button>
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -46,7 +49,6 @@ export default {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
height: 120,
|
||||
// filterText: '',
|
||||
trainingList: [],
|
||||
defaultProps: {
|
||||
label: 'roomName'
|
||||
@ -61,7 +63,7 @@ export default {
|
||||
return this.dialogShow;
|
||||
},
|
||||
title() {
|
||||
return '综合演练快速入口';
|
||||
return this.$t('global.synthesisTrainingTitle');
|
||||
},
|
||||
isWatch() {
|
||||
return true;
|
||||
@ -116,7 +118,7 @@ export default {
|
||||
this.$router.push({ path: `/trainroom`, query: query });
|
||||
}
|
||||
} else {
|
||||
this.$message.info('您没有选择房间');
|
||||
this.$message.info(this.$t('global.pleaseChooseRoom'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,10 +9,10 @@
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div style="height: 80px; line-height: 80px; font-size: 16px; padding-left: 10px;">{{ roomName }}邀请你加入综合演练!</div>
|
||||
<div style="height: 80px; line-height: 80px; font-size: 16px; padding-left: 10px;">{{ roomName }}{{ $t('global.inviteJoinRoom') }}</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleJoin">确认</el-button>
|
||||
<el-button @click="dialogShow = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleJoin">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="dialogShow = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -38,7 +38,7 @@ export default {
|
||||
return this.dialogShow;
|
||||
},
|
||||
title() {
|
||||
return '综合演练快速入口';
|
||||
return this.$t('global.synthesisTrainingTitle');
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -30,12 +30,12 @@
|
||||
</el-scrollbar>
|
||||
</el-tab-pane>
|
||||
<div v-if="hasProduct" class="btn-buy">
|
||||
<el-button v-loading="buttonLoading" type="success" @click="buy">购买</el-button>
|
||||
<el-button v-if="hasPermssion" v-loading="buttonLoading" type="primary" @click="distribute">权限分发</el-button>
|
||||
<el-button v-if="hasPermssion" v-loading="buttonLoading" type="primary" @click="transfer">权限转赠</el-button>
|
||||
<el-button v-show="isStartDemon" v-loading="buttonLoading" type="primary" @click="start">开始仿真</el-button>
|
||||
<el-button v-show="isCreateRoom" v-loading="buttonLoading" type="primary" @click="start">创建房间</el-button>
|
||||
<el-button v-show="isInRoom" v-loading="buttonLoading" type="primary" @click="joinRoom">进入房间</el-button>
|
||||
<el-button :loading="buttonLoading" type="success" @click="buy">购买</el-button>
|
||||
<el-button v-if="hasPermssion" :loading="buttonLoading" type="primary" @click="distribute">权限分发</el-button>
|
||||
<el-button v-if="hasPermssion" :loading="buttonLoading" type="primary" @click="transfer">权限转赠</el-button>
|
||||
<el-button v-show="isStartDemon" :loading="buttonLoading" type="primary" @click="start">开始仿真</el-button>
|
||||
<el-button v-show="isCreateRoom" :loading="buttonLoading" type="primary" @click="start">创建房间</el-button>
|
||||
<el-button v-show="isInRoom" :loading="buttonLoading" type="primary" @click="joinRoom">进入房间</el-button>
|
||||
</div>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
@ -286,7 +286,6 @@ export default {
|
||||
const data = { mapId: this.courseModel.mapId, code: this.currentPrdCode };
|
||||
this.buttonLoading = true;
|
||||
simulationNotify(data).then(resp => {
|
||||
// try 0 有权限不走试用
|
||||
const query = { skinCode: this.courseModel.skinCode, group: resp.data, prdType: this.courseModel.prdType, mapId: this.courseModel.mapId, code: this.currentPrdCode, goodsId: this.goodsId, try: this.tryUser };
|
||||
this.$router.push({ path: `${UrlConfig.display}/demon`, query: query });
|
||||
launchFullscreen();
|
||||
|
@ -111,7 +111,6 @@ export default {
|
||||
if (this.trainingObj && this.trainingObj.id) {
|
||||
this.isDisable = true;
|
||||
startTraining(this.trainingObj, this.group).then(response => {
|
||||
debugger;
|
||||
this.$store.dispatch('map/clearJlmapTrainView').then(() => {
|
||||
this.$store.dispatch('training/teachModeStart', this.demoMode);
|
||||
this.$store.dispatch('training/setMapDefaultState').then(() => {
|
||||
|
@ -6,9 +6,9 @@
|
||||
<el-option v-for="member in memberList" :key="member.id" :label="member.role+(member.name==undefined?'':member.name)" :value="member.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成时间" class="conditionVO">
|
||||
<!-- <el-form-item label="完成时间" class="conditionVO">
|
||||
<el-input-number v-model="modalData.actionVO.time " class="inputStyle" :min="0"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="动作类型" class="conditionVO" prop="actionVO.type">
|
||||
<el-select v-model="modalData.actionVO.type " placeholder="请选择动作类型" @change="changeType">
|
||||
<el-option v-for="actionType in actionTypeList" :key="actionType.label" :label="actionType.label" :value="actionType.value"></el-option>
|
||||
@ -82,7 +82,7 @@
|
||||
actionVO:{
|
||||
memberId:"",
|
||||
targetId:"",
|
||||
time:0,
|
||||
// time:0,
|
||||
reply:"",
|
||||
type:"Conversation",
|
||||
deviceCommand:"",
|
||||
@ -208,10 +208,11 @@
|
||||
}
|
||||
},
|
||||
initActionData(){
|
||||
// debugger;
|
||||
this.modalData.actionVO.memberId="";
|
||||
this.modalData.actionVO.targetId="";
|
||||
this.modalData.actionVO.type="Conversation";
|
||||
this.modalData.actionVO.time=0;
|
||||
// this.modalData.actionVO.time=0;
|
||||
this.modalData.actionVO.reply="";
|
||||
this.modalData.param.startStation="";
|
||||
this.isConversitionAdd=true;
|
||||
@ -277,7 +278,7 @@
|
||||
this.modalData.actionVO.id=data.id;
|
||||
this.modalData.actionVO.memberId=data.memberId;
|
||||
this.modalData.actionVO.type=data.type;
|
||||
this.modalData.actionVO.time=data.time;
|
||||
// this.modalData.actionVO.time=data.time;
|
||||
if(data.type=="Conversation")
|
||||
{
|
||||
this.modalData.actionVO.targetId=data.targetId;
|
||||
|
@ -1,316 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<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>
|
||||
<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="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="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" 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"
|
||||
@keyup.enter.native="handleInputConfirm"
|
||||
@blur="handleInputConfirm"
|
||||
></el-input>
|
||||
<el-button v-else class="button-new-tag" size="small" @click="showInput">添加</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 {getQuestRecord,postMemberBehavior} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'addBehavior',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
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:[],
|
||||
deviceConditionList:[],
|
||||
trigConditionList:DeviceTypeDic.ConstSelect.triggerType,
|
||||
isConversationShow:false,
|
||||
isDeviceShow:false,
|
||||
isAdding:false,
|
||||
behavior:{
|
||||
auto:false,
|
||||
targetMemberId:null,
|
||||
description:"",
|
||||
conditionVO:{
|
||||
importantList:[],
|
||||
content:"",
|
||||
keyWord:"",
|
||||
triggerType:"None",
|
||||
deviceConditionList:[],
|
||||
},
|
||||
id:null,
|
||||
},
|
||||
rules:{
|
||||
targetMemberId:[
|
||||
{ required: true, message: '请选择目标角色', trigger: 'change' }
|
||||
],
|
||||
description:[
|
||||
{ required: true, message: '请输入描述', trigger: 'blur' }
|
||||
],
|
||||
conditionVO:{
|
||||
content: [
|
||||
{ required: true, message: '请输入内容', trigger: 'blur' }
|
||||
],
|
||||
keyWord:[
|
||||
{ required: true, message: '请输入关键字', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
methods:{
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
let memberId=this.$props.memberId;
|
||||
getQuestRecord(group).then(response=>{
|
||||
let datalist=response.data.memberVOList;
|
||||
this.targetMemberList=datalist;
|
||||
});
|
||||
},
|
||||
showInput() {
|
||||
this.inputVisible = true;
|
||||
this.$nextTick(_ => {
|
||||
this.$refs.saveTagInput.$refs.input.focus();
|
||||
});
|
||||
},
|
||||
handleClose(tag) {
|
||||
this.behavior.conditionVO.importantList.splice(this.behavior.conditionVO.importantList.indexOf(tag), 1);
|
||||
},
|
||||
handleInputConfirm() {
|
||||
let inputValue = this.inputValue;
|
||||
if (inputValue) {
|
||||
this.behavior.conditionVO.importantList.push(inputValue);
|
||||
}
|
||||
this.inputVisible = false;
|
||||
this.inputValue = '';
|
||||
},
|
||||
addQuestBehavior(){
|
||||
this.$refs["behavior"].validate((valid) => {
|
||||
if (valid) {
|
||||
let group=this.$props.group;
|
||||
let memberId=this.$props.memberId;
|
||||
switch(this.behavior.conditionVO.triggerType)
|
||||
{
|
||||
case 'DeviceCondition':
|
||||
{
|
||||
if(this.isAdding)
|
||||
{
|
||||
this.behavior.conditionVO.deviceConditionList.pop();
|
||||
this.$refs.deviceCondition.resetDisabled();
|
||||
}
|
||||
if(this.behavior.conditionVO.deviceConditionList.length<=0)
|
||||
{
|
||||
this.$messageBox(`请添加设备条件`);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'None':
|
||||
{
|
||||
this.behavior.conditionVO={};
|
||||
this.behavior.conditionVO.triggerType="None";
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(memberId)
|
||||
{
|
||||
let behavior=this.behavior;
|
||||
postMemberBehavior(group,memberId,behavior).then(response=>{
|
||||
this.behavior={
|
||||
auto:false,
|
||||
description:"",
|
||||
conditionVO:{
|
||||
triggerType:"None",
|
||||
importantList:[],
|
||||
content:"",
|
||||
keyWord:"",
|
||||
deviceConditionList:[],
|
||||
},
|
||||
targetMemberId:null,
|
||||
id:null
|
||||
};
|
||||
this.isConversationShow=false;
|
||||
this.isDeviceShow=false;
|
||||
if(this.$props.operateType==="add")
|
||||
{
|
||||
this.$message.success('添加行为成功');
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$emit('modifyButtonName');
|
||||
this.$message.success('修改行为成功');
|
||||
}
|
||||
this.$emit('create');
|
||||
}).catch(error => {
|
||||
if(this.$props.operateType==="add")
|
||||
{
|
||||
this.$messageBox(`添加行为失败: ${error.message}`);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.$messageBox(`修改行为失败: ${error.message}`);
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
doShow(data){
|
||||
if(data)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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;
|
||||
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(){
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.inputStyle{
|
||||
width:300px;
|
||||
height:20px;
|
||||
}
|
||||
.textareaStyle{
|
||||
width:300px;
|
||||
}
|
||||
.button-new-tag {
|
||||
margin-left: 10px;
|
||||
height: 32px;
|
||||
line-height: 30px;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.input-new-tag {
|
||||
width: 90px;
|
||||
margin-left: 10px;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
.el-tag + .el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
@ -1,173 +0,0 @@
|
||||
<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="$t('scriptRecord.deviceType')" 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="$t('scriptRecord.deviceCode')" 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="$t('scriptRecord.deviceCondition')" 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="$t('scriptRecord.paramDeviceType')" 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="$t('scriptRecord.paramDeviceCode')" 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="$t('scriptRecord.operation')" 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;
|
||||
resultData=this.changeData(index,resultData);
|
||||
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;
|
||||
resultData=this.changeData(index,resultData);
|
||||
this.paramDeviceCodeList=resultData;
|
||||
})
|
||||
},
|
||||
changeData(param,data){
|
||||
return param=="Train"?JSON.parse(JSON.stringify(data).replace(/groupNumber/g,"name")):data;
|
||||
},
|
||||
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>
|
@ -5,6 +5,7 @@
|
||||
</div>
|
||||
<div class="tab-pane-big">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elActionScrollbar">
|
||||
<add-action ref="addBehavior" :group="group" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName" class="addScript"></add-action>
|
||||
<div class="block actionListTable">
|
||||
<el-timeline :reverse="reverse">
|
||||
<el-timeline-item v-for="(actionInfo,index) in actionInfoList" :key="index">
|
||||
@ -23,7 +24,7 @@
|
||||
</el-timeline-item>
|
||||
</el-timeline>
|
||||
</div>
|
||||
<add-action ref="addBehavior" :group="group" @create="create" :buttonName="buttonName" :operateType="operateType" @modifyButtonName="modifyButtonName"></add-action>
|
||||
|
||||
<!-- <el-table
|
||||
v-loading="loading"
|
||||
:data="actionList" border class="actionListTable">
|
||||
@ -161,8 +162,8 @@
|
||||
this.reloadTable();
|
||||
},
|
||||
modifyAction(row){
|
||||
var div = this.$refs['elActionScrollbar'].$refs['wrap'];
|
||||
div.scrollTop=this.$refs['elActionScrollbar'].wrap.scrollHeight;
|
||||
// var div = this.$refs['elActionScrollbar'].$refs['wrap'];
|
||||
// div.scrollTop=this.$refs['elActionScrollbar'].wrap.scrollHeight;
|
||||
this.operateType="modify";
|
||||
this.buttonName="修改动作"
|
||||
this.$refs.addBehavior.doShow(row);
|
||||
@ -176,11 +177,19 @@
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.addScript{
|
||||
float:left;
|
||||
width:450px;
|
||||
display: inline-block;
|
||||
position: fixed;
|
||||
}
|
||||
.actionListTable{
|
||||
margin-top: 40px;
|
||||
margin-top: 15px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
width:802px;
|
||||
width:452px;
|
||||
display: inline-block;
|
||||
margin-left:450px;
|
||||
}
|
||||
.actionList{
|
||||
margin-top: 10px;
|
||||
@ -195,8 +204,8 @@
|
||||
height:380px;
|
||||
}
|
||||
.actionTable{
|
||||
width:570px;
|
||||
padding: 15px;
|
||||
width:370px;
|
||||
padding: 15px 0px 10px 15px;
|
||||
display: inline-block;
|
||||
line-height: 200%;
|
||||
}
|
||||
|
@ -1,147 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="behaviorList">
|
||||
<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>
|
||||
<div class="tab-pane-big">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper" ref="elScrollbar">
|
||||
<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
|
||||
v-loading="loading"
|
||||
:data="behaviorList" border class="behaviorListTable">
|
||||
<el-table-column label="是否主动触发" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.auto?"是":"否"}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="目标角色" width="200">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.targetMemberId}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="描述" width="200">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.description}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="触发条件" width="150">
|
||||
<template slot-scope="scope">
|
||||
<div>{{scope.row.conditionVO.triggerType==null?"无":scope.row.conditionVO.triggerType}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<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="getActions(scope.row)">动作操作</el-button></el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import {getQuestRecord,deleteMemberBehavior} from '@/api/simulation';
|
||||
import AddBehavior from './addBehavior';
|
||||
export default {
|
||||
name: 'behaviorList',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
memberId:{
|
||||
type: String,
|
||||
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:{
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
let memberId=this.$props.memberId;
|
||||
getQuestRecord(group).then(response=>{
|
||||
let datalist=response.data.memberVOList;
|
||||
this.behaviorList=datalist.find(elem=>{return elem.id==memberId}).behaviorVOList;
|
||||
this.loading=false;
|
||||
});
|
||||
},
|
||||
deleteBehavior(row){
|
||||
let group=this.$props.group;
|
||||
let memberId=this.$props.memberId;
|
||||
deleteMemberBehavior(group,memberId,row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success('删除任务角色行为成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`删除任务角色行为失败: ${error.message}`);
|
||||
});
|
||||
},
|
||||
reloadTable(){
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
backToMember(){
|
||||
this.$emit('backToMember');
|
||||
},
|
||||
modifyButtonName(){
|
||||
this.buttonName="添加行为",
|
||||
this.operateType="add"
|
||||
},
|
||||
modifyActions(row){
|
||||
var div = this.$refs['elScrollbar'].$refs['wrap'];
|
||||
div.scrollTop=0;
|
||||
this.operateType="modify";
|
||||
this.buttonName="修改行为"
|
||||
this.$refs.addBehavior.doShow(row);
|
||||
},
|
||||
getActions(row){
|
||||
this.$emit('getActions',row);
|
||||
},
|
||||
handleCreate(){
|
||||
this.reloadTable();
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.behaviorListTable{
|
||||
margin-top: 20px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
width:901px;
|
||||
}
|
||||
.behaviorList{
|
||||
margin-top: 10px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
margin-bottom:20px;
|
||||
}
|
||||
.titleStyle{
|
||||
margin-left:10px;
|
||||
}
|
||||
.tab-pane-big{
|
||||
height:370px;
|
||||
}
|
||||
</style>
|
@ -1,82 +0,0 @@
|
||||
<template>
|
||||
<el-tabs v-model="activeName" type="card">
|
||||
<el-tab-pane :label="$t('scriptRecord.roleManage')" name="first">
|
||||
<div class="tab-pane">
|
||||
<el-scrollbar wrapClass="scrollbar-wrapper">
|
||||
<role-section ref="roleSection" :group="group" @getBehaviorList="getBehaviorList"></role-section>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('scriptRecord.targetCondition')" 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="$t('scriptRecord.taskScript')" 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>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import RoleSection from './roleSection';
|
||||
import TargetCondition from './targetCondition';
|
||||
import TaskScript from './taskScript';
|
||||
|
||||
import {getQuestRecord} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'roleConditionScript',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
components: {
|
||||
TargetCondition,
|
||||
TaskScript,
|
||||
RoleSection,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName:"first",
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.loadInitData(this.$route.query);
|
||||
},
|
||||
methods: {
|
||||
loadInitData(obj) {
|
||||
let group=obj.group;
|
||||
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.$store.dispatch('scriptRecord/updateMapLocation', mapLocation);
|
||||
}
|
||||
});
|
||||
},
|
||||
getBehaviorList(row){
|
||||
this.$emit('getBehaviorList',row.id);
|
||||
this.$store.dispatch('scriptRecord/updateMemberName',row.name);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.tab-pane{
|
||||
height:360px;
|
||||
}
|
||||
</style>
|
@ -1,160 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="memberVO" ref="memberVO" :rules="rules" label-width="100px" class="roleAction" label-position="right">
|
||||
<el-form-item :label="$t('scriptRecord.roleName')" class="conditionVO" prop="name">
|
||||
<el-input v-model="memberVO.name" class="inputStyle"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('scriptRecord.roleType')" class="conditionVO" prop="role">
|
||||
<el-select v-model="memberVO.role" placeholder="请选择角色类型" @change="changeRoleType">
|
||||
<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="$t('scriptRecord.deviceCode')" class="conditionVO">
|
||||
<el-select v-model="memberVO.deviceCode" clearable 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>
|
||||
<el-button type="primary" @click="addQuestMember('memberVO')">{{$t('scriptRecord.roleAdd')}}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div class="roleList">{{$t('scriptRecord.roleList')}}</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="memberList" border class="memberList">
|
||||
<el-table-column prop="name" :label="$t('scriptRecord.roleName')" width="350">
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('scriptRecord.operation')" width="350">
|
||||
<template slot-scope="scope">
|
||||
<el-row>
|
||||
<el-button type="primary" size="mini" @click="getMembers(scope.row)">{{$t('scriptRecord.behaviorOperate')}}</el-button>
|
||||
<el-button type="primary" size="mini" @click="deleteMember(scope.$index,scope.row)">{{$t('scriptRecord.delete')}}</el-button>
|
||||
</el-row>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import {getQuestRecord,getDevicesByRole,postQuestMember,deleteQuestMember} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'roleSection',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
deviceCodeList:[],
|
||||
memberList:[],
|
||||
loading:true,
|
||||
memberVO:
|
||||
{
|
||||
role:"Admin",
|
||||
deviceCode:'',
|
||||
},
|
||||
roleTypeList:ConstConfig.ConstSelect.roleType,
|
||||
title:"添加角色",
|
||||
rules:{
|
||||
name:[
|
||||
{ required: true, message: '请输入角色名称', trigger: 'blur' }
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.scriptRecord.memberList': function (val, old){
|
||||
this.memberList=val;
|
||||
this.loading=false;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
getDeviceInfo(){
|
||||
let params = { role:this.memberVO.role};
|
||||
let group=this.$props.group;
|
||||
getDevicesByRole(group,params).then(response => {
|
||||
this.deviceCodeList=response.data;
|
||||
});
|
||||
},
|
||||
addQuestMember(formName){
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
let data=this.memberVO;
|
||||
let group=this.group;
|
||||
postQuestMember(group,data).then(resp => {
|
||||
this.reloadTable();
|
||||
this.memberVO.role="Admin";
|
||||
this.memberVO.deviceCode="";
|
||||
this.memberVO.name="";
|
||||
this.deviceCodeList=[];
|
||||
this.$message.success('添加任务角色成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`添加任务角色失败: ${error.message}`);
|
||||
})
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
changeRoleType(index){
|
||||
this.deviceCodeList=[];
|
||||
let params = { role:index};
|
||||
let group=this.group;
|
||||
getDevicesByRole(group,params).then(response => {
|
||||
this.memberVO.deviceCode="";
|
||||
let resultData=response.data;
|
||||
if(index=="Driver")
|
||||
{resultData=JSON.parse(JSON.stringify(response.data).replace(/groupNumber/g,"name"));}
|
||||
this.deviceCodeList=resultData;
|
||||
});
|
||||
},
|
||||
reloadTable(){
|
||||
let group=this.group;
|
||||
getQuestRecord(group).then(response=>{
|
||||
this.memberList=response.data.memberVOList;
|
||||
this.$store.dispatch('scriptRecord/updateScript', response.data.script);
|
||||
this.$store.dispatch('scriptRecord/updateMemberList', response.data.memberVOList);
|
||||
});
|
||||
},
|
||||
deleteMember(index,row){
|
||||
let group=this.group;
|
||||
deleteQuestMember(group,row.id).then(resp => {
|
||||
this.reloadTable();
|
||||
this.$message.success('删除任务角色成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`删除任务角色失败: ${error.message}`);
|
||||
});
|
||||
},
|
||||
getMembers(row){
|
||||
this.$emit('getBehaviorList',row);
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.roleAction{
|
||||
margin-top:10px;
|
||||
margin-left:10px;
|
||||
}
|
||||
.roleList{
|
||||
margin-top: 20px;
|
||||
margin-left: 5px;
|
||||
font-size: 15px;
|
||||
}
|
||||
.memberList{
|
||||
// width:94%;
|
||||
width:701px;
|
||||
margin-top:20px;
|
||||
margin-left:5px;
|
||||
}
|
||||
.inputStyle{
|
||||
width:200px;
|
||||
height:30px;
|
||||
}
|
||||
</style>
|
@ -1,97 +0,0 @@
|
||||
<template>
|
||||
<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 DeviceCondition from './deviceCondition';
|
||||
import {postTargetConditionAction} from '@/api/simulation';
|
||||
export default {
|
||||
name: 'targetCondition',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
watch:{
|
||||
// '$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:this.$t("scriptRecord.conditionTitle"),
|
||||
isAdding:false,
|
||||
// fieldS:"",
|
||||
}
|
||||
},
|
||||
components:{
|
||||
DeviceCondition
|
||||
},
|
||||
methods:{
|
||||
addQuestAction(){
|
||||
if(this.isAdding)
|
||||
{
|
||||
this.deviceConditionList.pop();
|
||||
this.$refs.deviceCondition.resetDisabled();
|
||||
}
|
||||
if(this.deviceConditionList.length<=0)
|
||||
{
|
||||
this.$messageBox(`请添加设备条件`);
|
||||
return;
|
||||
}
|
||||
let group=this.$props.group;
|
||||
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}`);
|
||||
});
|
||||
},
|
||||
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";
|
||||
.ConditionButton{
|
||||
margin-top:20px;
|
||||
margin-left:0px;
|
||||
}
|
||||
</style>
|
||||
|
@ -1,197 +0,0 @@
|
||||
<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();
|
||||
},
|
||||
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.taskScript.memberId="";
|
||||
this.taskScript.behavior="";
|
||||
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>
|
@ -1,127 +1,157 @@
|
||||
<template>
|
||||
<div class="reminder-drag">
|
||||
<div ref="drapBox" class="reminder-box">
|
||||
<div class="tip-title">
|
||||
<i v-show="isShrink" class="icon el-icon-minus" @click="shrink" />
|
||||
<i v-show="!isShrink" class="icon el-icon-plus" @click="shrink" />
|
||||
<p v-if="isShrink" style="color: #fff;">
|
||||
<span>{{ title }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div ref="dragBody" class="tip-body-box">
|
||||
<div class="tip-body">
|
||||
<div>
|
||||
<get-action ref="getAction" :group="group" />
|
||||
</div>
|
||||
<el-button-group class="button-group">
|
||||
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
|
||||
<el-button type="primary" @click="saveMaplocation">{{ $t('scriptRecord.saveMaplocation') }}</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">{{ $t('scriptRecord.saveBackground') }}</el-button>
|
||||
<el-button type="success" @click="saveScenesData">{{ $t('scriptRecord.saveData') }}</el-button>
|
||||
</el-button-group>
|
||||
<div class="reminder-drag">
|
||||
<div class="reminder-box" ref="drapBox">
|
||||
<div class="tip-title">
|
||||
<i class="icon el-icon-minus" @click="shrink" v-show="isShrink"></i>
|
||||
<i class="icon el-icon-plus" @click="shrink" v-show="!isShrink"></i>
|
||||
<p style="color: #fff;" v-if="isShrink">
|
||||
<span>{{ title }}</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="tip-body-box" ref="dragBody">
|
||||
<div class="tip-body">
|
||||
<div>
|
||||
<get-action ref="getAction" :group="group"></get-action>
|
||||
</div>
|
||||
<el-button-group class="button-group">
|
||||
<el-button type="danger" @click="dumpScenesData">重置剧本</el-button>
|
||||
<el-button type="primary" @click="saveMaplocation">{{$t('scriptRecord.saveMaplocation')}}</el-button>
|
||||
<el-button type="primary" @click="saveScenesStage">{{$t('scriptRecord.saveBackground')}}</el-button>
|
||||
<el-button type="success" @click="saveScenesData" :loading="isSavingScript" >{{$t('scriptRecord.saveData')}}</el-button>
|
||||
<!-- 暂停 -->
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData, updateMapLocation} from '@/api/simulation';
|
||||
import Vue from 'vue';
|
||||
import GetAction from './scriptRecord/getAction';
|
||||
import { launchFullscreen, exitFullscreen } from '@/utils/screen';
|
||||
import {saveScriptScenes, saveScriptData, dumpScriptData,updateMapLocation} from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
components: {
|
||||
GetAction
|
||||
},
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
// this.$t('scriptRecord.scriptTitle')
|
||||
data() {
|
||||
return {
|
||||
title: '剧本编制',
|
||||
isShrink: false,
|
||||
mapLocation: {}
|
||||
// isSaveStage: true,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
this.shrink();
|
||||
},
|
||||
methods: {
|
||||
jump(obj) {
|
||||
},
|
||||
shrink() {
|
||||
const height = this.$refs.dragBody.offsetHeight + 40;
|
||||
const top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
// getActions(row){
|
||||
// this.displayType="action";
|
||||
// this.behaviorId=row.id;
|
||||
// this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
// },
|
||||
saveScenesStage() {
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
this.$message.success('保存背景成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('保存背景失败!');
|
||||
});
|
||||
},
|
||||
saveScenesData() {
|
||||
saveScriptData(this.group).then(resp => {
|
||||
this.$message.success('保存数据成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`保存数据失败!: ${error.message}`);
|
||||
});
|
||||
},
|
||||
dumpScenesData() {
|
||||
const group=this.group;
|
||||
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
dumpScriptData(group).then(resp => {
|
||||
// this.isSaveStage = true;
|
||||
this.$message.success('清除数据成功');
|
||||
}).catch(() => {
|
||||
this.$messageBox('清除数据失败!');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
saveMaplocation() {
|
||||
const data=Vue.prototype.$jlmap.$options;
|
||||
const group=this.$route.query.group;
|
||||
const dataZoom={scale: data.scaleRate, x: data.offsetX, y: data.offsetY};
|
||||
updateMapLocation(group, dataZoom).then(response=>{
|
||||
this.$message.success('更新定位成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
export default {
|
||||
name: 'TipScriptRecord',
|
||||
props: {
|
||||
group: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
},
|
||||
components: {
|
||||
GetAction,
|
||||
},
|
||||
// this.$t('scriptRecord.scriptTitle')
|
||||
data() {
|
||||
return {
|
||||
title:"剧本编制",
|
||||
isShrink: false,
|
||||
mapLocation:{},
|
||||
autoSaveScript: null,
|
||||
isSavingScript:false,
|
||||
// isSaveStage: true,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapViewLoadedCount': function (val) {
|
||||
Vue.prototype.$jlmap.setOptions(this.$store.state.scriptRecord.mapLocation);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
mounted(){
|
||||
this.initAutoSaveScript();
|
||||
this.shrink();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.clearAutoSave();
|
||||
},
|
||||
methods: {
|
||||
jump(obj) {
|
||||
},
|
||||
shrink() {
|
||||
let height = this.$refs.dragBody.offsetHeight + 40;
|
||||
let top = this.$refs.drapBox.style.top;
|
||||
if (this.isShrink) {
|
||||
this.$refs.drapBox.style.height = '40px';
|
||||
this.$refs.drapBox.style.top = '';
|
||||
this.isShrink = false;
|
||||
} else {
|
||||
this.$refs.drapBox.style.height = height + 'px';
|
||||
this.$refs.drapBox.style.top = top;
|
||||
this.isShrink = true;
|
||||
}
|
||||
},
|
||||
initAutoSaveScript() {
|
||||
const timeout = 1000 * 20;
|
||||
this.clearAutoSave(this.autoSaveScript);
|
||||
this.autoSaveScript = setInterval(this.saveScenesData,timeout);
|
||||
},
|
||||
clearAutoSave() {
|
||||
if (this.autoSaveScript) {
|
||||
clearInterval(this.autoSaveScript);
|
||||
this.autoSaveScript = null;
|
||||
}
|
||||
},
|
||||
// getActions(row){
|
||||
// this.displayType="action";
|
||||
// this.behaviorId=row.id;
|
||||
// this.$store.dispatch('scriptRecord/updateBehaviorName',row.description);
|
||||
// },
|
||||
saveScenesStage() {
|
||||
|
||||
saveScriptScenes(this.group).then(resp => {
|
||||
// this.isSaveStage = false;
|
||||
this.$message.success('保存背景成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox('保存背景失败!');
|
||||
})
|
||||
},
|
||||
saveScenesData() {
|
||||
this.isSavingScript=true;
|
||||
saveScriptData(this.group).then(resp => {
|
||||
this.$message.success('保存数据成功');
|
||||
this.isSavingScript=false;
|
||||
this.initAutoSaveScript();
|
||||
}).catch(error => {
|
||||
this.$messageBox(`保存数据失败!: ${error.message}`);
|
||||
this.isSavingScript=false;
|
||||
if (error.code === 40004 || error.code === 40005 || error.code === 40003) {
|
||||
this.clearAutoSave();
|
||||
} else {
|
||||
this.initAutoSaveScript();
|
||||
}
|
||||
})
|
||||
},
|
||||
dumpScenesData() {
|
||||
let group=this.group;
|
||||
this.$confirm('此操作将会清除已保存的编制数据, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
dumpScriptData(group).then(resp => {
|
||||
// this.isSaveStage = true;
|
||||
this.$message.success('清除数据成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox('清除数据失败!');
|
||||
})
|
||||
}).catch(error => { })
|
||||
},
|
||||
saveMaplocation()
|
||||
{
|
||||
let data=Vue.prototype.$jlmap.$options;
|
||||
let group=this.$route.query.group;
|
||||
let dataZoom={scale:data.scaleRate,x:data.offsetX,y:data.offsetY};
|
||||
updateMapLocation(group,dataZoom).then(response=>{
|
||||
this.$message.success('更新定位成功');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新定位失败: ${error.message}`);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
@ -210,4 +240,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
@ -35,9 +35,9 @@
|
||||
</div>
|
||||
<div class="btn-buy">
|
||||
<el-button type="success" @click="buy">购买</el-button>
|
||||
<el-button v-if="hasPermssion" v-loading="loading" type="primary" @click="distribute">权限分发(考试)</el-button>
|
||||
<el-button v-if="hasPermssion" v-loading="loading" type="primary" @click="transfer">权限转赠</el-button>
|
||||
<el-button v-if="isAddRule" v-loading="loading" type="primary" @click="checkCourse">查看课程试卷</el-button>
|
||||
<el-button v-if="hasPermssion" :loading="loading" type="primary" @click="distribute">权限分发(考试)</el-button>
|
||||
<el-button v-if="hasPermssion" :loading="loading" type="primary" @click="transfer">权限转赠</el-button>
|
||||
<el-button v-if="isAddRule" :loading="loading" type="primary" @click="checkCourse">查看课程试卷</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -43,7 +43,7 @@
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="btn-start">
|
||||
<el-button v-loading="loading" type="primary" @click="exmaStart">开始考试</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="exmaStart">开始考试</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -22,8 +22,8 @@
|
||||
</p>
|
||||
<p>
|
||||
<span class="list-label" />
|
||||
<el-button v-loading="loading" type="primary" @click="start">开始考试</el-button>
|
||||
<el-button v-loading="loading" type="danger" @click="back">放弃考试</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="start">开始考试</el-button>
|
||||
<el-button :loading="loading" type="danger" @click="back">放弃考试</el-button>
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
|
@ -36,12 +36,12 @@ export default {
|
||||
const form = {
|
||||
labelWidth: '60px',
|
||||
items: [
|
||||
{ prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd },
|
||||
{ prop: 'name', label: '名称', type: 'text', required: true },
|
||||
{ prop: 'code', label: this.$t('system.code'), type: 'text', required: true, disabled: !isAdd },
|
||||
{ prop: 'name', label: this.$t('system.name'), type: 'text', required: true },
|
||||
{
|
||||
prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
prop: 'status', label: this.$t('system.status'), type: 'select', required: true, options: this.$ConstSelect.Status
|
||||
},
|
||||
{ prop: 'remarks', label: '备注', type: 'textarea', required: false }
|
||||
{ prop: 'remarks', label: this.$t('system.remarks'), type: 'textarea', required: false }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
@ -49,21 +49,21 @@ export default {
|
||||
rules() {
|
||||
const crules = {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }
|
||||
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '请选择状态', trigger: 'change' }
|
||||
{ required: true, message: this.$t('rules.pleaseSelectStatus'), trigger: 'change' }
|
||||
],
|
||||
remarks: [
|
||||
{ max: 50, message: '不能超过 50 个字符', trigger: 'blur' }
|
||||
{ max: 50, message: this.$t('rules.strLengthNotExceed50'), trigger: 'blur' }
|
||||
]
|
||||
};
|
||||
if (this.type === 'ADD') {
|
||||
return Object.assign(crules, {
|
||||
code: [
|
||||
{ required: true, message: '请输入编码', trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' },
|
||||
{ required: true, message: this.$t('rules.pleaseInputCode'), trigger: 'blur' },
|
||||
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' },
|
||||
{ validator: this.validateCode, trigger: 'blur' }
|
||||
]
|
||||
});
|
||||
@ -73,25 +73,25 @@ export default {
|
||||
},
|
||||
title() {
|
||||
if (this.type === 'ADD') {
|
||||
return '创建目录';
|
||||
return this.$t('system.createDirectory');
|
||||
} else {
|
||||
return '编辑目录';
|
||||
return this.$t('system.editDictionary');
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
validateCode(rule, value, callback) {
|
||||
if (!validateCharCode(value)) {
|
||||
return callback(new Error('格式不正确,只能是字符/数字/_'));
|
||||
return callback(new Error(this.$t('error.formartError')));
|
||||
} else {
|
||||
checkDicCodeExist(value).then(response => {
|
||||
if (response.data) {
|
||||
return callback(new Error('编码已存在'));
|
||||
return callback(new Error(this.$t('error.codeHasExist')));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
}).catch(() => {
|
||||
return callback(new Error('服务异常'));
|
||||
return callback(new Error(this.$t('error.serviceException')));
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -117,21 +117,21 @@ export default {
|
||||
create() {
|
||||
const self = this;
|
||||
create(this.formModel).then(response => {
|
||||
self.$message.success('创建字典目录成功');
|
||||
self.$message.success(this.$t('system.createSuccess'));
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('创建字典目录失败:' + error.message);
|
||||
self.$message.error(`${this.$t('error.createDictionaryFailed')}:${error.message}`);
|
||||
});
|
||||
},
|
||||
update() {
|
||||
const self = this;
|
||||
update(this.formModel).then(response => {
|
||||
self.$message.success('更新字典目录成功');
|
||||
self.$message.success(this.$t('system.updateSuccess'));
|
||||
self.handleClose();
|
||||
self.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
self.$message.error('更新字典目录失败:' + error.message);
|
||||
self.$message.error(`${this.$t('error.updateDictionaryFailed')}:${error.message}`);
|
||||
});
|
||||
},
|
||||
handleClose(done) {
|
||||
|
@ -2,8 +2,8 @@
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doSave">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -24,15 +24,15 @@ export default {
|
||||
queryObject: {
|
||||
group: {
|
||||
type: 'text',
|
||||
label: '仿真Group'
|
||||
label: this.$t('system.simulationGroup')
|
||||
},
|
||||
userName: {
|
||||
type: 'text',
|
||||
label: '用户名'
|
||||
label: this.$t('system.username')
|
||||
},
|
||||
mobile: {
|
||||
type: 'text',
|
||||
label: '手机号'
|
||||
label: this.$t('system.phoneNumber')
|
||||
},
|
||||
skinCode: {
|
||||
type: 'select',
|
||||
@ -137,11 +137,10 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: '操作',
|
||||
// width: '250',
|
||||
title: this.$t('global.operate'),
|
||||
buttons: [
|
||||
{
|
||||
name: '销毁',
|
||||
name: this.$t('system.destory'),
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
<template>
|
||||
<el-card v-loading="loading" class="map-list-main">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>地图列表</span>
|
||||
<span class="mapListTitle">地图列表</span>
|
||||
<el-button type="primary" size="small" @click="addScript" class="addScript">添加剧本</el-button>
|
||||
</div>
|
||||
<el-select v-model="mapSelect" size="medium" class="mapSelect" @change="mapSelectChange">
|
||||
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
<div class="addScript" @click="addScript">
|
||||
<!-- <div class="addScript" @click="addScript">
|
||||
<i class="el-icon-plus" style="color:#409eff;font-size:16px;"></i>
|
||||
<span class="addScriptText">添加剧本</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px', width:'100%',margin:'5px 0 0 0' }">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
@ -33,6 +34,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import localStore from 'storejs';
|
||||
import { getQuestPageList,createQuest,deleteQuest,updateQuest} from '@/api/quest';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
@ -71,20 +73,18 @@ export default {
|
||||
listPublishMap().then(response => {
|
||||
this.mapList = response.data;
|
||||
this.loading = false;
|
||||
this.mapSelect=this.mapList[0].id;
|
||||
this.mapSelect=localStore.get("script_mapId") || this.mapList[0].id;
|
||||
this.getQuestPageList(this.mapSelect);
|
||||
})
|
||||
},
|
||||
mapSelectChange(id){
|
||||
this.loading = true;
|
||||
// debugger;
|
||||
// this.$store
|
||||
localStore.set("script_mapId", id);
|
||||
this.getQuestPageList(id);
|
||||
},
|
||||
async getQuestPageList(id){
|
||||
// getQuestPageList(id).then(response => {
|
||||
// this.loading = false;
|
||||
// this.treeList=response.data;
|
||||
// }).catch((err) => {
|
||||
// });
|
||||
let response=await getQuestPageList(id);
|
||||
this.loading = false;
|
||||
this.treeList=response.data;
|
||||
@ -125,16 +125,17 @@ export default {
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.mapListTitle{
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
padding: 8px 0px;
|
||||
}
|
||||
.mapSelect {
|
||||
width:100%;
|
||||
}
|
||||
.addScript{
|
||||
border: 1px #ccc solid;
|
||||
padding: 10px 10px;
|
||||
font-size: 14px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
margin-top: 5px;
|
||||
float: right;
|
||||
display: inline-block;
|
||||
}
|
||||
.addScriptText{
|
||||
color:#409eff;
|
||||
|
@ -42,8 +42,8 @@
|
||||
</div>
|
||||
<div class="btn-buy">
|
||||
<el-button type="success" @click="buy">购买</el-button>
|
||||
<el-button v-if="hasPermssion" v-loading="loading" type="primary" @click="distribute">权限分发(上课)</el-button>
|
||||
<el-button v-if="hasPermssion" v-loading="loading" type="primary" @click="transfer">权限转赠</el-button>
|
||||
<el-button v-if="hasPermssion" :loading="loading" type="primary" @click="distribute">权限分发(上课)</el-button>
|
||||
<el-button v-if="hasPermssion" :loading="loading" type="primary" @click="transfer">权限转赠</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -20,7 +20,7 @@
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="btn-start">
|
||||
<el-button v-loading="loading" type="primary" @click="start">开始实训</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="start">开始实训</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -1,83 +1,98 @@
|
||||
<template>
|
||||
<el-dialog class="default route-cancel" :title="title" :visible.sync="show" width="20%" :zIndex="2000" :modal="true"
|
||||
:before-close="cancel" :close-on-click-modal="false" v-dialogDrag>
|
||||
<el-input placeholder="输入名称进行过滤" v-model="filterText" clearable> </el-input>
|
||||
<ul class="listBox">
|
||||
<li class="listLi" v-for="item in list">
|
||||
<input class="checkbox" :class="item.disabled ? 'disabled' : ''" type="checkbox" v-model="item.select"
|
||||
:disabled="item.disabled" @change="handleNodeClick(item)"></input>
|
||||
<span>{{item.nickName}}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="commit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="default route-cancel"
|
||||
:title="title"
|
||||
:visible.sync="show"
|
||||
width="20%"
|
||||
:z-index="2000"
|
||||
:modal="true"
|
||||
:before-close="cancel"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-input v-model="filterText" placeholder="输入名称进行过滤" clearable />
|
||||
<ul class="listBox">
|
||||
<li v-for="item in list" :key="item" class="listLi">
|
||||
<input
|
||||
v-model="item.select"
|
||||
class="checkbox"
|
||||
:class="item.disabled ? 'disabled' : ''"
|
||||
type="checkbox"
|
||||
:disabled="item.disabled"
|
||||
@change="handleNodeClick(item)"
|
||||
>
|
||||
<span>{{ item.nickName }}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="commit">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AddPerson',
|
||||
props: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
title: '',
|
||||
personList: [],
|
||||
props: {
|
||||
label: 'name'
|
||||
},
|
||||
treeList: [],
|
||||
list: [],
|
||||
filterText: '',
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.list = this.treeList.filter(p => p.nickName.indexOf(val) !== -1);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(title, list) {
|
||||
this.dialogShow = true;
|
||||
this.title = title;
|
||||
this.treeList = list;
|
||||
this.list = list;
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
if (data.select) {
|
||||
this.personList.push(data);
|
||||
} else {
|
||||
this.personList.splice(this.personList.findIndex(item => item.id == data.id), 1)
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.personList = [];
|
||||
this.list.forEach(nor => {
|
||||
nor.select = false;
|
||||
});
|
||||
this.$emit('handleUserList', this.list)
|
||||
},
|
||||
commit() {
|
||||
this.$emit('handleDispatch', this.personList)
|
||||
this.dialogShow = false;
|
||||
this.personList = [];
|
||||
},
|
||||
cancel() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
export default {
|
||||
name: 'AddPerson',
|
||||
props: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
title: '',
|
||||
personList: [],
|
||||
props: {
|
||||
label: 'name'
|
||||
},
|
||||
treeList: [],
|
||||
list: [],
|
||||
filterText: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
show() {
|
||||
return this.dialogShow;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.list = this.treeList.filter(p => p.nickName.indexOf(val) !== -1);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
doShow(title, list) {
|
||||
this.dialogShow = true;
|
||||
this.title = title;
|
||||
this.treeList = list;
|
||||
this.list = list;
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
if (data.select) {
|
||||
this.personList.push(data);
|
||||
} else {
|
||||
this.personList.splice(this.personList.findIndex(item => item.id == data.id), 1);
|
||||
}
|
||||
},
|
||||
doClose() {
|
||||
this.dialogShow = false;
|
||||
this.personList = [];
|
||||
this.list.forEach(nor => {
|
||||
nor.select = false;
|
||||
});
|
||||
this.$emit('handleUserList', this.list);
|
||||
},
|
||||
commit() {
|
||||
this.$emit('handleDispatch', this.personList);
|
||||
this.dialogShow = false;
|
||||
this.personList = [];
|
||||
},
|
||||
cancel() {
|
||||
this.doClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@ -155,4 +170,4 @@
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user