Merge remote-tracking branch 'origin/test'
This commit is contained in:
commit
fd5af534af
@ -23,7 +23,6 @@
|
||||
<script>
|
||||
import { getToken, getUserIdKey } from '@/utils/auth';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import { loginInfo } from '@/scripts/ProjectConfig';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import LoadingImg from '@/assets/loading.gif';
|
||||
import AppLoading from '@/assets/appLoading.png';
|
||||
@ -68,7 +67,7 @@ export default {
|
||||
callback: action => {
|
||||
removeToken();
|
||||
this.$store.dispatch('exit').then(resp => {
|
||||
this.$router.push({path: loginInfo[this.$store.state.projectConfig.markKey].loginPath});
|
||||
this.$router.push({path: `/login?project=${this.$store.state.projectConfig.markKey}`});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -314,3 +314,18 @@ export function getClientDataById(mapId) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
/** 发布地图根据id生成实训 */
|
||||
export function generateTrainingData(data) {
|
||||
return request({
|
||||
url: `/api/v2/training/rule/generate/mapId`,
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 根据mapId获取列车信息 */
|
||||
export function getTrainListByMapId(mapId) {
|
||||
return request({
|
||||
url: `/api/map/${mapId}/trains`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -187,3 +187,35 @@ export function setGroupReadMessage(groupId, data) {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送私聊文字信息
|
||||
* @param {String} groupId 房间号
|
||||
* @param {Object} data
|
||||
* @param {Number} data.memberId 角色id
|
||||
* @param {String} data.content 文字内容
|
||||
* @returns
|
||||
*/
|
||||
export function sendPrivateText(groupId, data) {
|
||||
return request({
|
||||
url: `/simulation/${groupId}/operate/Conversation_Group_Private_Text_Chat`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送私聊BASE64信息
|
||||
* @param {String} groupId 房间号
|
||||
* @param {Object} data
|
||||
* @param {Number} data.memberId 角色id
|
||||
* @param {String} data.fileBase64Str 文件base64码
|
||||
* @returns
|
||||
*/
|
||||
export function sendPrivateBase64(groupId, data) {
|
||||
return request({
|
||||
url: `/simulation/${groupId}/operate/Conversation_Group_Private_Audio_Base64`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
10
src/api/record.js
Normal file
10
src/api/record.js
Normal file
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/** 查询用户使用记录统计 */
|
||||
export function queryUserSimulationRecord(params, userId) {
|
||||
return request({
|
||||
url: `/api/record/stats/list/criteria/${userId}`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
@ -193,3 +193,11 @@ export function queryTemplateMapFunPaged(params) {
|
||||
params
|
||||
});
|
||||
}
|
||||
/** 线路功能覆盖生成(主要用于客户端重新生成后线路功能里客户端重新匹配) */
|
||||
export function generateMapFun(data) {
|
||||
return request({
|
||||
url: `/api/mapFunction/generate/mapIds`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -130,9 +130,8 @@ export default {
|
||||
}
|
||||
return name;
|
||||
},
|
||||
expandPath() {
|
||||
console.log('展开进路预览');
|
||||
},
|
||||
// expandPath() {
|
||||
// },
|
||||
doShow(operate, selected, tempData) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
|
@ -348,9 +348,26 @@ export default {
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
},
|
||||
checkStationControl(device) {
|
||||
let cenStationCode = '';
|
||||
if (['Section', 'Signal', 'Switch', 'GuideLock', 'AutoTurnBack'].includes(device._type)) {
|
||||
cenStationCode = device.stationCode;
|
||||
} else if (device._type === 'Stand') {
|
||||
cenStationCode = device.deviceStationCode;
|
||||
}
|
||||
if (!cenStationCode) {
|
||||
return false;
|
||||
}
|
||||
const cenStation = this.$store.getters['map/getDeviceByCode'](cenStationCode);
|
||||
const flag = cenStation.controlMode === 'Emergency' || cenStation.controlMode === 'Local';
|
||||
if (!flag) {
|
||||
this.$message.info('请先切换到站控或紧急站控');
|
||||
}
|
||||
return flag;
|
||||
},
|
||||
selectedChange() {
|
||||
const model = this.$store.state.menuOperation.selected;
|
||||
if (model && model._type) {
|
||||
if (model && model._type && this.checkStationControl(model)) {
|
||||
switch (this.$store.state.menuOperation.buttonOperation) {
|
||||
case OperationEvent.Station.guideLock.button.operation : {
|
||||
if (model && model._type == 'GuideLock') {
|
||||
|
@ -58,7 +58,7 @@ export default {
|
||||
dialogShow: false,
|
||||
disabledClose: false,
|
||||
disabledCommit: false,
|
||||
stationType: '01',
|
||||
stationType: '',
|
||||
station:{},
|
||||
stationCode: '',
|
||||
stationName: '',
|
||||
@ -113,6 +113,7 @@ export default {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
}
|
||||
this.stationType = '';
|
||||
this.dialogShow = true;
|
||||
this.$store.dispatch('training/emitTipFresh');
|
||||
},
|
||||
|
@ -86,9 +86,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
expandPath() {
|
||||
console.log('展开进路预览');
|
||||
},
|
||||
doShow(operate, selected, tempData) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
|
@ -24,7 +24,7 @@
|
||||
>确定</el-button>
|
||||
</div>
|
||||
<div style="width:100%; padding-top: 20px">
|
||||
<span v-if="!thirdLogin"> 版权所有(C)2010-2011 北京玖琏科技有限公司</span>
|
||||
<span v-if="copyrightShow"> 版权所有(C)2010-2011 北京玖琏科技有限公司</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -40,8 +40,7 @@
|
||||
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { NoCopyrightList } from '@/scripts/ProjectConfig';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import {mapGetters} from 'vuex';
|
||||
export default {
|
||||
name: 'ManageUser',
|
||||
data() {
|
||||
@ -61,6 +60,9 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('projectConfig', [
|
||||
'copyrightShow'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
@ -72,9 +74,6 @@ export default {
|
||||
},
|
||||
title() {
|
||||
return '关于ControlMonitor';
|
||||
},
|
||||
thirdLogin() {
|
||||
return NoCopyrightList.includes(getSessionStorage('project'));
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -165,6 +165,7 @@ export default {
|
||||
if (!this.dialogShow) {
|
||||
this.operate = operate || {};
|
||||
this.operation = operate.operation;
|
||||
this.formModel.stationType = '';
|
||||
}
|
||||
this.initControlModeList();
|
||||
// this.$store.state.training.prdType
|
||||
|
@ -135,8 +135,14 @@ export default {
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount': function(val) {
|
||||
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Section') {
|
||||
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (this.buttonOperation && device._type == 'Section') {
|
||||
const cenStation = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (cenStation.controlMode !== 'Emergency' && cenStation.controlMode !== 'Local') {
|
||||
this.$message.info('请先切换到站控或紧急站控');
|
||||
return;
|
||||
}
|
||||
this.operationHandler(this.buttonOperation, device);
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -200,7 +206,7 @@ export default {
|
||||
// this.$refs.sectionUnLock.doShow(operate, this.selected);
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
}
|
||||
}).catch(error=>{
|
||||
}).catch(()=>{
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
break;
|
||||
@ -213,7 +219,7 @@ export default {
|
||||
// this.$refs.sectionUnLock.doShow(operate, this.selected);
|
||||
this.$store.dispatch('menuOperation/setButtonOperation', null);
|
||||
}
|
||||
}).catch(error=>{
|
||||
}).catch(()=>{
|
||||
this.$refs.noticeInfo.doShow();
|
||||
});
|
||||
break;
|
||||
|
@ -202,8 +202,14 @@ export default {
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount': function(val) {
|
||||
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Signal') {
|
||||
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (this.buttonOperation && device._type == 'Signal') {
|
||||
const cenStation = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (cenStation.controlMode !== 'Emergency' && cenStation.controlMode !== 'Local') {
|
||||
this.$message.info('请先切换到站控或紧急站控');
|
||||
return;
|
||||
}
|
||||
this.operationHandler(this.buttonOperation, device);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -175,8 +175,14 @@ export default {
|
||||
}
|
||||
},
|
||||
'$store.state.menuOperation.selectedCount': function(val) {
|
||||
if (this.buttonOperation && this.$store.state.menuOperation.selected._type == 'Switch') {
|
||||
this.operationHandler(this.buttonOperation, this.$store.state.menuOperation.selected);
|
||||
const device = this.$store.state.menuOperation.selected;
|
||||
if (this.buttonOperation && device._type == 'Switch') {
|
||||
const cenStation = this.$store.getters['map/getDeviceByCode'](device.stationCode);
|
||||
if (cenStation.controlMode !== 'Emergency' && cenStation.controlMode !== 'Local') {
|
||||
this.$message.info('请先切换到站控或紧急站控');
|
||||
return;
|
||||
}
|
||||
this.operationHandler(this.buttonOperation, device);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -25,7 +25,7 @@
|
||||
</div>
|
||||
<div style="width:100%; padding-top: 20px">
|
||||
<!-- <span >版权所有(C)2010-2021 北京玖琏科技有限公司</span> -->
|
||||
<span v-if="!thirdLogin">{{ $t('menu.menuDialog.copyright') }}</span>
|
||||
<span v-if="copyrightShow">{{ $t('menu.menuDialog.copyright') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -40,8 +40,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { NoCopyrightList } from '@/scripts/ProjectConfig';
|
||||
import {mapGetters} from 'vuex';
|
||||
export default {
|
||||
name: 'ManageUser',
|
||||
data() {
|
||||
@ -61,6 +60,9 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('projectConfig', [
|
||||
'copyrightShow'
|
||||
]),
|
||||
show() {
|
||||
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||
},
|
||||
@ -72,9 +74,6 @@ export default {
|
||||
},
|
||||
title() {
|
||||
return this.$t('menu.menuDialog.about');
|
||||
},
|
||||
thirdLogin() {
|
||||
return NoCopyrightList.includes(getSessionStorage('project'));
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -126,7 +126,7 @@ export default {
|
||||
try {
|
||||
this.setMap(this.mapData, this.mapDevice);
|
||||
} catch (error) {
|
||||
console.log('[ERROR] ', error);
|
||||
console.error('[ERROR] ', error);
|
||||
}
|
||||
},
|
||||
// 设置地图
|
||||
|
@ -153,9 +153,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
expandPath() {
|
||||
console.log('展开进路预览');
|
||||
},
|
||||
doShow(operate) {
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
this.dialogShow = true;
|
||||
|
@ -113,9 +113,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
expandPath() {
|
||||
console.log('展开进路预览');
|
||||
},
|
||||
doShow(data) {
|
||||
this.activeName = data.active;
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
|
@ -98,9 +98,8 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
expandPath() {
|
||||
console.log('展开进路预览');
|
||||
},
|
||||
// expandPath() {
|
||||
// },
|
||||
doShow(operate, selected, tempData) {
|
||||
this.selected = selected;
|
||||
// 如果不是断点激活,而是第一次显示,则需要设置初始值
|
||||
|
@ -1,188 +1,187 @@
|
||||
<template>
|
||||
<div style="display:inline-block">
|
||||
<div class="avatar-container" style="display:inline-block;margin-right:10px">
|
||||
<el-menu-item v-for="item in entryList" v-show="!item.hidden" :key="item.name" class="avatar-wrapper" :index="$route.fullPath" :style="item.style" @click="item.handle">
|
||||
<el-tooltip v-if="item.tip" effect="dark" :content="$t('login.clickSwitchLanguage')" placement="bottom-end">
|
||||
<span style="color: white;">{{ item.name }}</span>
|
||||
</el-tooltip>
|
||||
<el-dropdown v-else-if="item.isHelp" class="avatar-container" trigger="hover" :show-timeout="100" style="height:58px">
|
||||
<div class="avatar-wrapper">
|
||||
<span style="color: white;">
|
||||
{{ $t(item.name) }}
|
||||
</span>
|
||||
<i class="el-icon-caret-bottom" style="color: #909399;" />
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown" class="user-dropdown">
|
||||
<el-dropdown-item v-for="(el, i) in caseList" :key="i">
|
||||
<span style="display:block;" @click="goToCaseShow(el)">{{ el.name }}</span>
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<span v-else style="color: white;">{{ $t(item.name) }}</span>
|
||||
</el-menu-item>
|
||||
<deomon-list ref="deomonList" @enterQcode="qcodeEntry" />
|
||||
<qcode ref="qcode" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--<template>-->
|
||||
<!-- <div style="display:inline-block">-->
|
||||
<!-- <div class="avatar-container" style="display:inline-block;margin-right:10px">-->
|
||||
<!-- <el-menu-item v-for="item in entryList" v-show="!item.hidden" :key="item.name" class="avatar-wrapper" :index="$route.fullPath" :style="item.style" @click="item.handle">-->
|
||||
<!-- <el-tooltip v-if="item.tip" effect="dark" :content="$t('login.clickSwitchLanguage')" placement="bottom-end">-->
|
||||
<!-- <span style="color: white;">{{ item.name }}</span>-->
|
||||
<!-- </el-tooltip>-->
|
||||
<!-- <el-dropdown v-else-if="item.isHelp" class="avatar-container" trigger="hover" :show-timeout="100" style="height:58px">-->
|
||||
<!-- <div class="avatar-wrapper">-->
|
||||
<!-- <span style="color: white;">-->
|
||||
<!-- {{ $t(item.name) }}-->
|
||||
<!-- </span>-->
|
||||
<!-- <i class="el-icon-caret-bottom" style="color: #909399;" />-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-dropdown-menu slot="dropdown" class="user-dropdown">-->
|
||||
<!-- <el-dropdown-item v-for="(el, i) in caseList" :key="i">-->
|
||||
<!-- <span style="display:block;" @click="goToCaseShow(el)">{{ el.name }}</span>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </el-dropdown-menu>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<!-- <span v-else style="color: white;">{{ $t(item.name) }}</span>-->
|
||||
<!-- </el-menu-item>-->
|
||||
<!-- <deomon-list ref="deomonList" @enterQcode="qcodeEntry" />-->
|
||||
<!-- <qcode ref="qcode" />-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import DeomonList from '@/views/demonstration/deomonList/index';
|
||||
import Qcode from './Qcode';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import LangStorage from '@/utils/lang';
|
||||
import {goOtherPlatformMenu, CaseHideProjectList} from '@/scripts/ProjectConfig';
|
||||
<!--<script>-->
|
||||
<!--import DeomonList from '@/views/demonstration/deomonList/index';-->
|
||||
<!--import Qcode from './Qcode';-->
|
||||
<!--import { getSessionStorage } from '@/utils/auth';-->
|
||||
<!--import LangStorage from '@/utils/lang';-->
|
||||
|
||||
export default {
|
||||
name: 'Entry',
|
||||
components: {
|
||||
DeomonList,
|
||||
Qcode
|
||||
},
|
||||
data() {
|
||||
<!--export default {-->
|
||||
<!-- name: 'Entry',-->
|
||||
<!-- components: {-->
|
||||
<!-- DeomonList,-->
|
||||
<!-- Qcode-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
|
||||
return {
|
||||
entryList: [
|
||||
{
|
||||
name: 'global.designPlatformEntrance', // 设计平台入口
|
||||
handle: this.goToDesign,
|
||||
hidden: getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')] || getSessionStorage('project').startsWith('teaching')
|
||||
},
|
||||
{
|
||||
name: 'global.trainingPlatformEntrance', // 实训平台入口
|
||||
handle: this.goToTraining,
|
||||
hidden: !getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')]
|
||||
},
|
||||
{
|
||||
name: 'global.caseShow', // 案例展示
|
||||
handle: this.goEmpty,
|
||||
isHelp:true,
|
||||
style:'padding-right:0px;',
|
||||
hidden: CaseHideProjectList.includes(getSessionStorage('project'))
|
||||
},
|
||||
{
|
||||
name: 'global.scan', // 扫码
|
||||
handle: this.qcodeEntry,
|
||||
hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project').startsWith('design') || process.env.VUE_APP_PRO === 'local'
|
||||
},
|
||||
{
|
||||
name: 'global.quickEntry', // 快速入口
|
||||
handle: this.quickEntry,
|
||||
hidden: getSessionStorage('project').startsWith('design')
|
||||
},
|
||||
{
|
||||
name: LangStorage.getLang('zh') === 'zh' ? 'English' : '中文',
|
||||
handle: this.switchLanguage,
|
||||
hidden: false,
|
||||
tip: true
|
||||
},
|
||||
{
|
||||
name: 'global.help',
|
||||
handle: this.goToHelp,
|
||||
hidden: false
|
||||
// hidden: this.hideHelp
|
||||
}
|
||||
<!-- return {-->
|
||||
<!-- entryList: [-->
|
||||
<!-- {-->
|
||||
<!-- name: 'global.designPlatformEntrance', // 设计平台入口-->
|
||||
<!-- handle: this.goToDesign,-->
|
||||
<!-- hidden: getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')] || getSessionStorage('project').startsWith('teaching')-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: 'global.trainingPlatformEntrance', // 实训平台入口-->
|
||||
<!-- handle: this.goToTraining,-->
|
||||
<!-- hidden: !getSessionStorage('project').startsWith('design') || !goOtherPlatformMenu[getSessionStorage('project')]-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: 'global.caseShow', // 案例展示-->
|
||||
<!-- handle: this.goEmpty,-->
|
||||
<!-- isHelp:true,-->
|
||||
<!-- style:'padding-right:0px;',-->
|
||||
<!-- hidden: CaseHideProjectList.includes(getSessionStorage('project'))-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: 'global.scan', // 扫码-->
|
||||
<!-- handle: this.qcodeEntry,-->
|
||||
<!-- hidden: process.env.NODE_ENV != 'development' || getSessionStorage('project').startsWith('design') || process.env.VUE_APP_PRO === 'local'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: 'global.quickEntry', // 快速入口-->
|
||||
<!-- handle: this.quickEntry,-->
|
||||
<!-- hidden: getSessionStorage('project').startsWith('design')-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: LangStorage.getLang('zh') === 'zh' ? 'English' : '中文',-->
|
||||
<!-- handle: this.switchLanguage,-->
|
||||
<!-- hidden: false,-->
|
||||
<!-- tip: true-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: 'global.help',-->
|
||||
<!-- handle: this.goToHelp,-->
|
||||
<!-- hidden: false-->
|
||||
<!-- // hidden: this.hideHelp-->
|
||||
<!-- }-->
|
||||
|
||||
],
|
||||
caseList: [
|
||||
{
|
||||
name: '西安铁路职业技术学院',
|
||||
url: 'https://joylink.club/oss/portal/cases/西安铁路职业技术学院.pdf'
|
||||
},
|
||||
{
|
||||
name: '贵州装备制造职业学院',
|
||||
url: 'https://joylink.club/oss/portal/cases/贵州装备制造职业学院机电技术专业实训室建设.pdf'
|
||||
},
|
||||
{
|
||||
name: '江苏电子信息职业学院',
|
||||
url: 'https://joylink.club/oss/portal/cases/江苏电子信息职业学院-城市轨道交通行车组织综合实训室.pdf'
|
||||
}
|
||||
],
|
||||
stomp: null,
|
||||
header: null,
|
||||
lang: 'zh'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
username() {
|
||||
return this.$store.state.user.nickname;
|
||||
},
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
}
|
||||
// hideHelp() {
|
||||
// return !(getSessionStorage('project') == 'login' || getSessionStorage('project') == 'design');
|
||||
// }
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
const nowLang = LangStorage.getLang('zh');
|
||||
if (nowLang === 'zh') {
|
||||
this.lang = 'en';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
quickEntry() {
|
||||
this.$refs.deomonList.doShow();
|
||||
},
|
||||
qcodeEntry() {
|
||||
this.$refs.qcode.doShow();
|
||||
},
|
||||
goToDesign() {
|
||||
const routeData = this.$router.resolve({
|
||||
path: this.getPath()
|
||||
});
|
||||
window.open(routeData.href, '_blank');
|
||||
},
|
||||
goToHelp() {
|
||||
let href = '';
|
||||
// if (getSessionStorage('project').startsWith('design')) {
|
||||
// href = 'https://joylink.club/docs-design';
|
||||
// } else {
|
||||
// href = 'https://joylink.club/docs';
|
||||
// }
|
||||
href = this.$store.state.user.baseSite + '/docs/';
|
||||
window.open(href, '_blank');
|
||||
},
|
||||
goEmpty() {},
|
||||
goToCaseShow(item) {
|
||||
window.open(item.url, '_blank');
|
||||
},
|
||||
goToTraining() {
|
||||
const routeData = this.$router.resolve({
|
||||
path: this.getPath()
|
||||
});
|
||||
window.open(routeData.href, '_blank');
|
||||
},
|
||||
switchLanguage() {
|
||||
this.$i18n.locale = this.lang;
|
||||
LangStorage.setLang(this.lang);
|
||||
},
|
||||
getPath() {
|
||||
return goOtherPlatformMenu[this.project];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<!-- ],-->
|
||||
<!-- caseList: [-->
|
||||
<!-- {-->
|
||||
<!-- name: '西安铁路职业技术学院',-->
|
||||
<!-- url: 'https://joylink.club/oss/portal/cases/西安铁路职业技术学院.pdf'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: '贵州装备制造职业学院',-->
|
||||
<!-- url: 'https://joylink.club/oss/portal/cases/贵州装备制造职业学院机电技术专业实训室建设.pdf'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: '江苏电子信息职业学院',-->
|
||||
<!-- url: 'https://joylink.club/oss/portal/cases/江苏电子信息职业学院-城市轨道交通行车组织综合实训室.pdf'-->
|
||||
<!-- }-->
|
||||
<!-- ],-->
|
||||
<!-- stomp: null,-->
|
||||
<!-- header: null,-->
|
||||
<!-- lang: 'zh'-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- username() {-->
|
||||
<!-- return this.$store.state.user.nickname;-->
|
||||
<!-- },-->
|
||||
<!-- project() {-->
|
||||
<!-- return getSessionStorage('project');-->
|
||||
<!-- }-->
|
||||
<!-- // hideHelp() {-->
|
||||
<!-- // return !(getSessionStorage('project') == 'login' || getSessionStorage('project') == 'design');-->
|
||||
<!-- // }-->
|
||||
<!-- },-->
|
||||
<!-- watch: {-->
|
||||
<!-- },-->
|
||||
<!-- mounted() {-->
|
||||
<!-- const nowLang = LangStorage.getLang('zh');-->
|
||||
<!-- if (nowLang === 'zh') {-->
|
||||
<!-- this.lang = 'en';-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- quickEntry() {-->
|
||||
<!-- this.$refs.deomonList.doShow();-->
|
||||
<!-- },-->
|
||||
<!-- qcodeEntry() {-->
|
||||
<!-- this.$refs.qcode.doShow();-->
|
||||
<!-- },-->
|
||||
<!-- goToDesign() {-->
|
||||
<!-- const routeData = this.$router.resolve({-->
|
||||
<!-- path: this.getPath()-->
|
||||
<!-- });-->
|
||||
<!-- window.open(routeData.href, '_blank');-->
|
||||
<!-- },-->
|
||||
<!-- goToHelp() {-->
|
||||
<!-- let href = '';-->
|
||||
<!-- // if (getSessionStorage('project').startsWith('design')) {-->
|
||||
<!-- // href = 'https://joylink.club/docs-design';-->
|
||||
<!-- // } else {-->
|
||||
<!-- // href = 'https://joylink.club/docs';-->
|
||||
<!-- // }-->
|
||||
<!-- href = this.$store.state.user.baseSite + '/docs/';-->
|
||||
<!-- window.open(href, '_blank');-->
|
||||
<!-- },-->
|
||||
<!-- goEmpty() {},-->
|
||||
<!-- goToCaseShow(item) {-->
|
||||
<!-- window.open(item.url, '_blank');-->
|
||||
<!-- },-->
|
||||
<!-- goToTraining() {-->
|
||||
<!-- const routeData = this.$router.resolve({-->
|
||||
<!-- path: this.getPath()-->
|
||||
<!-- });-->
|
||||
<!-- window.open(routeData.href, '_blank');-->
|
||||
<!-- },-->
|
||||
<!-- switchLanguage() {-->
|
||||
<!-- this.$i18n.locale = this.lang;-->
|
||||
<!-- LangStorage.setLang(this.lang);-->
|
||||
<!-- },-->
|
||||
<!-- getPath() {-->
|
||||
<!-- return goOtherPlatformMenu[this.project];-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.avatar-wrapper{
|
||||
display: inline-block;
|
||||
}
|
||||
.linkClass{
|
||||
color: white;
|
||||
height: 30px;
|
||||
display:inline-block;
|
||||
line-height:30px;
|
||||
font-size:14px;
|
||||
margin-top:17px;
|
||||
}
|
||||
.linkDiv{
|
||||
display: inline-block;
|
||||
height: 60px;
|
||||
padding: 0 20px;
|
||||
font-size: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
</style>
|
||||
<!--<style rel="stylesheet/scss" lang="scss" scoped>-->
|
||||
<!--.avatar-wrapper{-->
|
||||
<!-- display: inline-block;-->
|
||||
<!--}-->
|
||||
<!--.linkClass{-->
|
||||
<!-- color: white;-->
|
||||
<!-- height: 30px;-->
|
||||
<!-- display:inline-block;-->
|
||||
<!-- line-height:30px;-->
|
||||
<!-- font-size:14px;-->
|
||||
<!-- margin-top:17px;-->
|
||||
<!--}-->
|
||||
<!--.linkDiv{-->
|
||||
<!-- display: inline-block;-->
|
||||
<!-- height: 60px;-->
|
||||
<!-- padding: 0 20px;-->
|
||||
<!-- font-size: 0;-->
|
||||
<!-- vertical-align: top;-->
|
||||
<!--}-->
|
||||
<!--</style>-->
|
||||
|
@ -111,7 +111,6 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import SystemTitle from './Title';
|
||||
import {getSessionStorage } from '@/utils/auth';
|
||||
import { ThirdLoginList } from '@/scripts/ProjectConfig';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@ -131,7 +130,7 @@ export default {
|
||||
'routers'
|
||||
]),
|
||||
thirdLogin() {
|
||||
return ThirdLoginList.includes(getSessionStorage('project'));
|
||||
return this.$store.state.user.thirdLogin;
|
||||
},
|
||||
username() {
|
||||
return this.$store.state.user.nickname;
|
||||
|
@ -8,9 +8,9 @@
|
||||
</transition>
|
||||
</section>
|
||||
<el-footer class="footers" style="height:30px;">
|
||||
<div v-if="!bottomColumnOnlyConInfo.includes(project)" style="font-size:14px;float:left;">{{ $t('global.companyInfo') }} {{ $t('global.companyTel') }}</div>
|
||||
<div style="font-size:14px;float:right;height: 30px;line-height: 30px;">{{ bottomColumnOnlyConInfo.includes(project)? companyInfo : $t('global.companyICP') }}</div>
|
||||
<img v-if="bottomIcon" style="float:right;height: 26px;margin: 2px 10px;" :src="bottomIcon">
|
||||
<div style="font-size:14px;float:left;">{{ bottomCompanyInfo }}</div>
|
||||
<div style="font-size:14px;float:right;height: 30px;line-height: 30px;">{{ bottomRecordNumber }}</div>
|
||||
<!-- <img v-if="bottomIcon" style="float:right;height: 26px;margin: 2px 10px;" :src="bottomIcon">-->
|
||||
</el-footer>
|
||||
</div>
|
||||
<div>
|
||||
@ -33,7 +33,8 @@
|
||||
<script>
|
||||
import { Navbar } from './components'; // Sidebar
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { loginInfo, BottomColumnOnlyConInfo} from '@/scripts/ProjectConfig';
|
||||
// import { loginInfo, BottomColumnOnlyConInfo} from '@/scripts/ProjectConfig';
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'Layout',
|
||||
@ -42,11 +43,15 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
bottomColumnOnlyConInfo: BottomColumnOnlyConInfo
|
||||
dialogVisible: false
|
||||
// bottomColumnOnlyConInfo: BottomColumnOnlyConInfo
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('projectConfig', [
|
||||
'bottomCompanyInfo',
|
||||
'bottomRecordNumber'
|
||||
]),
|
||||
sidebar() {
|
||||
return this.$store.state.app.sidebar;
|
||||
},
|
||||
@ -70,13 +75,10 @@ export default {
|
||||
},
|
||||
dialogMessage() {
|
||||
return this.$store.state.app.dialogMessage;
|
||||
},
|
||||
companyInfo() {
|
||||
return loginInfo[getSessionStorage('project')] ? loginInfo[getSessionStorage('project')].bottomColumn : '';
|
||||
},
|
||||
bottomIcon() {
|
||||
return loginInfo[getSessionStorage('project')] ? loginInfo[getSessionStorage('project')].bottomIcon : '';
|
||||
}
|
||||
// bottomIcon() {
|
||||
// return loginInfo[getSessionStorage('project')] ? loginInfo[getSessionStorage('project')].bottomIcon : '';
|
||||
// }
|
||||
},
|
||||
watch:{
|
||||
'$store.state.app.dialogMessage':function(val) {
|
||||
|
@ -63,7 +63,7 @@ const UserExam = () => import('@/views/system/userExam/index');
|
||||
// const UserSimulation = () => import('@/views/system/userSimulation/index');
|
||||
const ExistingSimulation = () => import('@/views/system/existingSimulation/index');
|
||||
const CacheControl = () => import('@/views/system/cacheControl/index');
|
||||
const SystemGenerate = () => import('@/views/system/systemGenerate/index');
|
||||
// const SystemGenerate = () => import('@/views/system/systemGenerate/index');
|
||||
const News = () => import('@/views/system/news/index');
|
||||
const CommandDictionary = () => import('@/views/system/commandDictionary/index');
|
||||
const CommandDictionaryDetail = () => import('@/views/system/commandDictionary/edit');
|
||||
@ -165,8 +165,8 @@ const CompanyManage = () => import('@/views/system/companyManage/index');
|
||||
const QuestionsRuleManage = () => import('@/views/system/questionsRuleManage/index');
|
||||
const PreTheoryImport = () => import('@/views/competitionManage/bankList/preImport');
|
||||
|
||||
const MessageBoard = () => import('@/views/messageBoard/index');
|
||||
const BoardManage = () => import('@/views/messageBoard/manage');
|
||||
// const MessageBoard = () => import('@/views/messageBoard/index');
|
||||
// const BoardManage = () => import('@/views/messageBoard/manage');
|
||||
const OrganizationManage = () => import('@/views/organization/index');
|
||||
const PersonalInfo = () => import('@/views/info/personalInfo');
|
||||
const OrgClassManage = () => import('@/views/organization/classManage/index');
|
||||
@ -199,7 +199,7 @@ const UeditorDraftList = () => import('@/views/editor/listDraft');
|
||||
const UploadPdfList = () => import('@/views/uploadPdf/list');
|
||||
|
||||
const ThirdLogin = () => import('@/views/thirdLogin');
|
||||
const ProjectServer = () => import('@/views/system/serverManage');
|
||||
// const ProjectServer = () => import('@/views/system/serverManage');
|
||||
const VoiceManage = () => import('@/views/fileManage/voiceManage');
|
||||
const ProjectManage = () => import('@/views/system/projectManage');
|
||||
const FrontProjectConfigManage = () => import('@/views/system/frontProjectConfigManage');
|
||||
@ -538,11 +538,11 @@ export const publicAsyncRoute = [
|
||||
component: ExamResult,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/messageBoard',
|
||||
component: MessageBoard,
|
||||
hidden: true
|
||||
},
|
||||
// {
|
||||
// path: '/messageBoard',
|
||||
// component: MessageBoard,
|
||||
// hidden: true
|
||||
// },
|
||||
{
|
||||
path: '/info',
|
||||
component: Layout,
|
||||
@ -664,114 +664,114 @@ export const publicAsyncRoute = [
|
||||
];
|
||||
// 城市轨道项目
|
||||
export const asyncRouter = [
|
||||
{ // 公共地图
|
||||
path: '/design',
|
||||
component: Layout,
|
||||
redirect: '/design/home',
|
||||
meta: {
|
||||
roles: [admin, user]
|
||||
},
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
redirect: '/design/home',
|
||||
component: DesignPlatform,
|
||||
meta: {
|
||||
i18n: 'router.designhomePage',
|
||||
icon: 'design'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'home',
|
||||
component: DesignPlatformHome,
|
||||
meta: {
|
||||
}
|
||||
},
|
||||
{ // 运行图设计
|
||||
path: 'runPlan/detail/:mapId',
|
||||
component: PlanMonitorDetail,
|
||||
hidden: true
|
||||
},
|
||||
{ // 剧本
|
||||
path: 'script/home/:mapId',
|
||||
component: ScriptmanageHome,
|
||||
meta: {
|
||||
i18n: 'router.scriptManage'
|
||||
},
|
||||
hidden: true
|
||||
},
|
||||
{ // 课程列表
|
||||
path: 'lesson/home/:mapId',
|
||||
component: LessonHome,
|
||||
hidden: true
|
||||
},
|
||||
{ // 三维课程列表
|
||||
path: 'lesson/lesson3d',
|
||||
component: Lesson3d,
|
||||
hidden: true
|
||||
},
|
||||
{ // 操作定义
|
||||
path: 'lesson/trainingRule',
|
||||
component: TrainingRuleList,
|
||||
hidden: true
|
||||
},
|
||||
{ // 操作定义步骤
|
||||
path: 'lesson/trainingRule/detail',
|
||||
hidden: true,
|
||||
component: TrainingRuleEdit
|
||||
},
|
||||
{ // 任务管理
|
||||
path: 'lesson/taskManage',
|
||||
component: Taskmanage,
|
||||
hidden: true
|
||||
},
|
||||
{ // 实训管理
|
||||
path: 'lesson/trainingManage',
|
||||
component: TrainingmanageOld,
|
||||
hidden: true
|
||||
},
|
||||
{ // 创建课程
|
||||
path: 'lesson/edit/:type',
|
||||
component: LessonEdit,
|
||||
hidden: true
|
||||
},
|
||||
{ // 课程详情
|
||||
path: 'lesson/details',
|
||||
component: LessonDetail,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'edit/:type',
|
||||
component: LessonEdit,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
},
|
||||
{ // 新版地图预览
|
||||
path: 'mapPreviewNew/:mapId',
|
||||
component: MapPreviewNew,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'bigScreen/:mapId',
|
||||
component: BigScreen,
|
||||
hidden: true
|
||||
},
|
||||
{ // ibp列表
|
||||
path: 'ibp/home/:mapId',
|
||||
component: IbpHome,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'ibp/edit',
|
||||
component: IbpDraw,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
// { // 公共地图
|
||||
// path: '/design',
|
||||
// component: Layout,
|
||||
// redirect: '/design/home',
|
||||
// meta: {
|
||||
// roles: [admin, user]
|
||||
// },
|
||||
// hidden: true,
|
||||
// children: [
|
||||
// {
|
||||
// path: '',
|
||||
// redirect: '/design/home',
|
||||
// component: DesignPlatform,
|
||||
// meta: {
|
||||
// i18n: 'router.designhomePage',
|
||||
// icon: 'design'
|
||||
// },
|
||||
// children: [
|
||||
// {
|
||||
// path: 'home',
|
||||
// component: DesignPlatformHome,
|
||||
// meta: {
|
||||
// }
|
||||
// },
|
||||
// { // 运行图设计
|
||||
// path: 'runPlan/detail/:mapId',
|
||||
// component: PlanMonitorDetail,
|
||||
// hidden: true
|
||||
// },
|
||||
// { // 剧本
|
||||
// path: 'script/home/:mapId',
|
||||
// component: ScriptmanageHome,
|
||||
// meta: {
|
||||
// i18n: 'router.scriptManage'
|
||||
// },
|
||||
// hidden: true
|
||||
// },
|
||||
// { // 课程列表
|
||||
// path: 'lesson/home/:mapId',
|
||||
// component: LessonHome,
|
||||
// hidden: true
|
||||
// },
|
||||
// { // 三维课程列表
|
||||
// path: 'lesson/lesson3d',
|
||||
// component: Lesson3d,
|
||||
// hidden: true
|
||||
// },
|
||||
// { // 操作定义
|
||||
// path: 'lesson/trainingRule',
|
||||
// component: TrainingRuleList,
|
||||
// hidden: true
|
||||
// },
|
||||
// { // 操作定义步骤
|
||||
// path: 'lesson/trainingRule/detail',
|
||||
// hidden: true,
|
||||
// component: TrainingRuleEdit
|
||||
// },
|
||||
// { // 任务管理
|
||||
// path: 'lesson/taskManage',
|
||||
// component: Taskmanage,
|
||||
// hidden: true
|
||||
// },
|
||||
// { // 实训管理
|
||||
// path: 'lesson/trainingManage',
|
||||
// component: TrainingmanageOld,
|
||||
// hidden: true
|
||||
// },
|
||||
// { // 创建课程
|
||||
// path: 'lesson/edit/:type',
|
||||
// component: LessonEdit,
|
||||
// hidden: true
|
||||
// },
|
||||
// { // 课程详情
|
||||
// path: 'lesson/details',
|
||||
// component: LessonDetail,
|
||||
// hidden: true,
|
||||
// children: [
|
||||
// {
|
||||
// path: 'edit/:type',
|
||||
// component: LessonEdit,
|
||||
// hidden: true
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// { // 新版地图预览
|
||||
// path: 'mapPreviewNew/:mapId',
|
||||
// component: MapPreviewNew,
|
||||
// hidden: true
|
||||
// },
|
||||
// {
|
||||
// path: 'bigScreen/:mapId',
|
||||
// component: BigScreen,
|
||||
// hidden: true
|
||||
// },
|
||||
// { // ibp列表
|
||||
// path: 'ibp/home/:mapId',
|
||||
// component: IbpHome,
|
||||
// hidden: true
|
||||
// },
|
||||
// {
|
||||
// path: 'ibp/edit',
|
||||
// component: IbpDraw,
|
||||
// hidden: true
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{ // 实训平台
|
||||
path: '/trainingPlatform',
|
||||
component: Layout,
|
||||
@ -1082,13 +1082,13 @@ export const asyncRouter = [
|
||||
component: OrgDetail,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'boardManage',
|
||||
component: BoardManage,
|
||||
meta: {
|
||||
i18n: 'router.boardManage'
|
||||
}
|
||||
},
|
||||
// {
|
||||
// path: 'boardManage',
|
||||
// component: BoardManage,
|
||||
// meta: {
|
||||
// i18n: 'router.boardManage'
|
||||
// }
|
||||
// },
|
||||
{ // 出题规则管理
|
||||
path: 'questionsRuleManage',
|
||||
hidden: true,
|
||||
@ -1133,14 +1133,14 @@ export const asyncRouter = [
|
||||
i18n: 'router.existingSimulation'
|
||||
}
|
||||
},
|
||||
{
|
||||
// 子系统生成
|
||||
path: 'systemGenerate',
|
||||
component: SystemGenerate,
|
||||
meta: {
|
||||
i18n: 'router.subsystemGeneration'
|
||||
}
|
||||
},
|
||||
// {
|
||||
// // 子系统生成
|
||||
// path: 'systemGenerate',
|
||||
// component: SystemGenerate,
|
||||
// meta: {
|
||||
// i18n: 'router.subsystemGeneration'
|
||||
// }
|
||||
// },
|
||||
{ // 消息公告
|
||||
path: 'news',
|
||||
component: News,
|
||||
@ -1210,13 +1210,13 @@ export const asyncRouter = [
|
||||
i18n: 'router.voiceTraining'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'projectServer',
|
||||
component: ProjectServer,
|
||||
meta: {
|
||||
i18n: 'router.projectServer'
|
||||
}
|
||||
},
|
||||
// {
|
||||
// path: 'projectServer',
|
||||
// component: ProjectServer,
|
||||
// meta: {
|
||||
// i18n: 'router.projectServer'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: 'iscsDeviceManage',
|
||||
component: IscsDeviceManage,
|
||||
|
@ -77,28 +77,29 @@ export default {
|
||||
{ label: '车务段段长', value: 'TRAIN_MASTER', enLabel: 'Train_Master' }
|
||||
],
|
||||
roleTypeList: [
|
||||
{label: '行调', value: 'DISPATCHER'},
|
||||
{label: 'NCC调度', value: 'NCC_DISPATCHER'},
|
||||
{label: '行值', value: 'STATION_SUPERVISOR'},
|
||||
{label: '司机', value: 'DRIVER'},
|
||||
{label: '通号', value: 'MAINTAINER'},
|
||||
{label: '车辆段/停车场调度', value: 'DEPOT_DISPATCHER'},
|
||||
{label: '车辆段/停车场信号楼', value: 'SIGNAL_BUILDING'},
|
||||
{label: '车站助理', value: 'STATION_ASSISTANT'},
|
||||
{label: '车站站长', value: 'STATION_MASTER'},
|
||||
{label: '车站信号员', value: 'STATION_SIGNALER'},
|
||||
{label: '车站客运员', value: 'STATION_PASSENGER'},
|
||||
{label: '车站扳道员', value: 'STATION_SWITCH_MAN'},
|
||||
{label: '车站引导员', value: 'STATION_FACILITATOR'},
|
||||
{label: '车站工务工', value: 'STATION_WORKER'},
|
||||
{label: '车务段段长', value: 'TRAIN_MASTER'},
|
||||
{label: '工电调度', value: 'ELECTRIC_DISPATCHER'},
|
||||
{ label: '电力工务', value: 'STATION_ELECTRIC_WORKER'},
|
||||
{label: '上级部分', value: 'PARENT_DEPARTMENT'},
|
||||
{label: '派班员', value: 'SCHEDULING'},
|
||||
{label: '设备管理员', value: 'DEVICE_MANAGER'},
|
||||
{label: '值班主任', value: 'SHIFT_MANAGER'},
|
||||
{label: '环控调度', value: 'ENVIRONMENT_DISPATCHER'}
|
||||
{label: 'NCC调度', value: 'NCC_DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
|
||||
{label: '信息调度', value: 'OCC_DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
|
||||
{label: '行调', value: 'DISPATCHER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
|
||||
{label: '行值', value: 'STATION_SUPERVISOR', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
|
||||
{label: '司机', value: 'DRIVER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
|
||||
{label: '通号', value: 'MAINTAINER', simTypeList: ['METRO', 'RAILWAY', 'EMERGENCY']},
|
||||
{label: '车辆段/停车场调度', value: 'DEPOT_DISPATCHER', simTypeList: ['METRO']},
|
||||
{label: '车辆段/停车场信号楼', value: 'SIGNAL_BUILDING', simTypeList: ['METRO']},
|
||||
{label: '车站助理', value: 'STATION_ASSISTANT', simTypeList: ['RAILWAY']},
|
||||
{label: '车站站长', value: 'STATION_MASTER', simTypeList: ['RAILWAY']},
|
||||
{label: '车站信号员', value: 'STATION_SIGNALER', simTypeList: ['RAILWAY']},
|
||||
{label: '车站客运员', value: 'STATION_PASSENGER', simTypeList: ['RAILWAY']},
|
||||
{label: '车站扳道员', value: 'STATION_SWITCH_MAN', simTypeList: ['RAILWAY']},
|
||||
{label: '车站引导员', value: 'STATION_FACILITATOR', simTypeList: ['RAILWAY']},
|
||||
{label: '车站工务工', value: 'STATION_WORKER', simTypeList: ['RAILWAY']},
|
||||
{label: '车务段段长', value: 'TRAIN_MASTER', simTypeList: ['METRO']},
|
||||
{label: '工电调度', value: 'ELECTRIC_DISPATCHER', simTypeList: ['METRO']},
|
||||
{label: '电力工务', value: 'STATION_ELECTRIC_WORKER', simTypeList: ['METRO']},
|
||||
{label: '上级部分', value: 'PARENT_DEPARTMENT', simTypeList: ['METRO']},
|
||||
{label: '派班员', value: 'SCHEDULING', simTypeList: ['METRO']},
|
||||
{label: '设备管理员', value: 'DEVICE_MANAGER', simTypeList: ['RAILWAY']},
|
||||
{label: '值班主任', value: 'SHIFT_MANAGER', simTypeList: ['METRO']},
|
||||
{label: '环控调度', value: 'ENVIRONMENT_DISPATCHER', simTypeList: ['METRO']}
|
||||
],
|
||||
releaseReview: [
|
||||
{ enlabel: 'Unpublished', label: '未发布', value: '0' },
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -514,7 +514,9 @@ export default {
|
||||
CMD_Conversation_Chat_Text: {value: 'Conversation_Chat_Text', label: '发送文本消息'},
|
||||
CMD_Conversation_Chat_Audio_Base64: {value: 'Conversation_Chat_Audio_Base64', label: '发送语音消息'},
|
||||
CMD_Conversation_Group_Text_Chat: {value: 'Conversation_Group_Text_Chat', label: '发送会话群文字消息'},
|
||||
CMD_Conversation_Group_Audio_Base64: {value: 'Conversation_Group_Audio_Base64', label: '发送会话群语音消息'}
|
||||
CMD_Conversation_Group_Audio_Base64: {value: 'Conversation_Group_Audio_Base64', label: '发送会话群语音消息'},
|
||||
CMD_Conversation_Group_Private_Text_Chat: {value: 'Conversation_Group_Private_Text_Chat', label: '发送私聊文字消息'},
|
||||
CMD_Conversation_Group_Private_Audio_Base64: {value: 'Conversation_Group_Private_Audio_Base64', label: '发送私聊语音消息'}
|
||||
},
|
||||
PSL: {
|
||||
CMD_PSL_PRESS_BUTTON: {value: 'PSL_PRESS_BUTTON', label: 'PSL按钮操作'}
|
||||
|
@ -180,6 +180,12 @@ class Handler {
|
||||
operation3.operationType = CMD.Conversation.CMD_Conversation_Group_Audio_Base64.value;
|
||||
operation3.params.id = operation.params.id;
|
||||
}
|
||||
if (operation.operationType == CMD.Conversation.CMD_Conversation_Group_Private_Text_Chat.value) { // 私聊新会话接口
|
||||
step2.description = `私聊选中:${operation.params.groupName},点击录制语音`;
|
||||
operation2.params.memberId = operation.params.memberId;
|
||||
operation3.operationType = CMD.Conversation.CMD_Conversation_Group_Private_Audio_Base64.value;
|
||||
operation3.params.memberId = operation.params.memberId;
|
||||
}
|
||||
const step3 = {
|
||||
description: `请说出“${operation.params.content}”后,再次点击发送语音!`,
|
||||
memberId: stepInfo.memberId,
|
||||
|
@ -38,6 +38,18 @@ const projectConfig = {
|
||||
},
|
||||
browserTitle: (state) => {
|
||||
return state.viewSetting.browserTitle;
|
||||
},
|
||||
isRichor: (state) => {
|
||||
return state.viewSetting.isRichor;
|
||||
},
|
||||
copyrightShow: (state) => {
|
||||
return state.viewSetting.copyrightShow;
|
||||
},
|
||||
bottomCompanyInfo: (state) => {
|
||||
return state.viewSetting.bottomCompanyInfo;
|
||||
},
|
||||
bottomRecordNumber: (state) => {
|
||||
return state.viewSetting.bottomRecordNumber;
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
|
@ -49,7 +49,8 @@ const training = {
|
||||
domConfig: {}, // 线路功能前端配置项
|
||||
simulationUserType: '', // 仿真用户角色
|
||||
simulationCreator: false,
|
||||
chatBoxMin: true // 聊天框最小化
|
||||
chatBoxMin: true, // 聊天框最小化
|
||||
memberTreeData: [] // 仿真成员树数据
|
||||
},
|
||||
|
||||
getters: {
|
||||
@ -273,6 +274,8 @@ const training = {
|
||||
state.simulationUserList.push(item);
|
||||
} else if (item.messageType === 'KICK_OUT' && memberIndex > -1) {
|
||||
state.simulationUserList.splice(memberIndex, 1);
|
||||
} else if (item.messageType === 'EXIT' && memberIndex > -1) {
|
||||
state.simulationUserList.splice(memberIndex, 1);
|
||||
}
|
||||
|
||||
if (item.messageType === 'PLAY_CHANGE') {
|
||||
@ -322,6 +325,9 @@ const training = {
|
||||
},
|
||||
setChatBoxMin: (state, chatBoxMin) => {
|
||||
state.chatBoxMin = chatBoxMin;
|
||||
},
|
||||
setMemberTreeData: (state, memberTreeData) => {
|
||||
state.memberTreeData = memberTreeData;
|
||||
}
|
||||
},
|
||||
|
||||
@ -658,6 +664,9 @@ const training = {
|
||||
},
|
||||
setChatBoxMin: ({ commit }, chatBoxMin) => {
|
||||
commit('setChatBoxMin', chatBoxMin);
|
||||
},
|
||||
setMemberTreeData: ({ commit }, memberTreeData) => {
|
||||
commit('setMemberTreeData', memberTreeData);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -22,6 +22,7 @@ const user = {
|
||||
companyAdmin: false,
|
||||
companyName: '',
|
||||
companyProjectList: [],
|
||||
thirdLogin: false,
|
||||
baseUrl:'',
|
||||
// resourcesUrl: '',
|
||||
// uploadUrl: '',
|
||||
@ -69,6 +70,9 @@ const user = {
|
||||
SET_COMPANYPROJECTLIST: (state, companyProjectList) => {
|
||||
state.companyProjectList = companyProjectList;
|
||||
},
|
||||
SET_THIRDLOGIN: (state, thirdLogin) => {
|
||||
state.thirdLogin = thirdLogin;
|
||||
},
|
||||
CLEAR_AUTO_PARAMS: () => {
|
||||
Cookies.remove('UserDesignName');
|
||||
Cookies.remove('UserDesignToken');
|
||||
@ -159,6 +163,7 @@ const user = {
|
||||
commit('SET_COMPANYADMIN', user.companyAdmin);
|
||||
commit('SET_COMPANYNAME', user.companyName);
|
||||
commit('SET_COMPANYPROJECTLIST', user.projectCodes);
|
||||
commit('SET_THIRDLOGIN', user.thirdLogin);
|
||||
resolve(user);
|
||||
}).catch(error => {
|
||||
reject(error);
|
||||
|
@ -1,17 +1,17 @@
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
// import { getSessionStorage } from '@/utils/auth';
|
||||
// listPublishMap
|
||||
import { getMapListByProjectCode, getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { ProjectCode } from '@/scripts/ProjectConfig';
|
||||
// import { ProjectCode } from '@/scripts/ProjectConfig';
|
||||
|
||||
export async function getMapListByProject() {
|
||||
const project = getSessionStorage('project');
|
||||
// const project = getSessionStorage('project');
|
||||
let mapList = [];
|
||||
if (project.endsWith('xty') || project.endsWith('gzb') || project.endsWith('heb') || project.endsWith('teaching')) {
|
||||
mapList = await getMapListByProjectCode(ProjectCode[project]);
|
||||
} else {
|
||||
// mapList = await listPublishMap({ 'drawWay': true });
|
||||
mapList = await getPublishMapListOnline();
|
||||
}
|
||||
// if (project.endsWith('xty') || project.endsWith('gzb') || project.endsWith('heb') || project.endsWith('teaching')) {
|
||||
// mapList = await getMapListByProjectCode(ProjectCode[project]);
|
||||
// } else {
|
||||
// mapList = await listPublishMap({ 'drawWay': true });
|
||||
mapList = await getPublishMapListOnline();
|
||||
// }
|
||||
return mapList;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,13 @@ function callback(Response) {
|
||||
} else if (Response.headers.destination.includes('sysTime')) {
|
||||
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
|
||||
} else if (Response.headers.destination.includes('state')) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
|
||||
const msg = JSON.parse(Response.body);
|
||||
if (msg.hasOwnProperty('state')) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(msg.state));
|
||||
}
|
||||
if (msg.hasOwnProperty('speed')) {
|
||||
store.dispatch('socket/setSimulationSpeed', Number.parseInt(msg.speed));
|
||||
}
|
||||
} else if (Response.headers.destination.includes('iscs/psd') || Response.headers.destination.includes('iscs/gate')) {
|
||||
store.dispatch('socket/handleIscsState', JSON.parse(Response.body));
|
||||
} else if (Response.headers.destination.includes('iscs/pa')) {
|
||||
|
@ -8,7 +8,13 @@ export function sysTimeCallback(Response) {
|
||||
store.dispatch('socket/setSimulationTimeSync', Number.parseInt(Response.body));
|
||||
}
|
||||
export function stateCallback(Response) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(Response.body));
|
||||
const msg = JSON.parse(Response.body);
|
||||
if (msg.hasOwnProperty('state')) {
|
||||
store.dispatch('socket/handleSimulationState', Number.parseInt(msg.state));
|
||||
}
|
||||
if (msg.hasOwnProperty('speed')) {
|
||||
store.dispatch('socket/setSimulationSpeed', Number.parseInt(msg.speed));
|
||||
}
|
||||
}
|
||||
export function iscsPsdCallback(Response) {
|
||||
store.dispatch('socket/handleIscsState', JSON.parse(Response.body));
|
||||
|
@ -1,304 +1,304 @@
|
||||
<template>
|
||||
<div v-loading="loading" class="map-list-main">
|
||||
<div>
|
||||
<div class="mapListName">
|
||||
<span>{{ $t('map.publishedMapList') }}</span>
|
||||
</div>
|
||||
<template v-if="!getMapByCode">
|
||||
<filter-city ref="filerCity" filter-empty :local-param-name="localParamName" @filterSelectChange="refresh" />
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
</template>
|
||||
</div>
|
||||
<div class="text_item">
|
||||
<el-tree ref="tree" :data="treeList" :default-expanded-keys="defaultShowKeys" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent">
|
||||
<span slot-scope="{ node:tnode, data }">
|
||||
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
|
||||
<span> {{ tnode.label }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
|
||||
import { UrlConfig } from '@/scripts/ConstDic';
|
||||
import { superAdmin, admin, lessonCreater } from '@/router/index';
|
||||
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||
import FilterCity from '@/views/components/filterCity';
|
||||
import localStore from 'storejs';
|
||||
import { ProjectCode, GetMapListByProjectList } from '@/scripts/ProjectConfig';
|
||||
import { createSimulationNew } from '@/api/simulation';
|
||||
<!--<template>-->
|
||||
<!-- <div v-loading="loading" class="map-list-main">-->
|
||||
<!-- <div>-->
|
||||
<!-- <div class="mapListName">-->
|
||||
<!-- <span>{{ $t('map.publishedMapList') }}</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <template v-if="!getMapByCode">-->
|
||||
<!-- <filter-city ref="filerCity" filter-empty :local-param-name="localParamName" @filterSelectChange="refresh" />-->
|
||||
<!-- <el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />-->
|
||||
<!-- </template>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="text_item">-->
|
||||
<!-- <el-tree ref="tree" :data="treeList" :default-expanded-keys="defaultShowKeys" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent">-->
|
||||
<!-- <span slot-scope="{ node:tnode, data }">-->
|
||||
<!-- <span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />-->
|
||||
<!-- <span> {{ tnode.label }}</span>-->
|
||||
<!-- </span>-->
|
||||
<!-- </el-tree>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
<!--<script>-->
|
||||
<!--import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';-->
|
||||
<!--import { UrlConfig } from '@/scripts/ConstDic';-->
|
||||
<!--import { superAdmin, admin, lessonCreater } from '@/router/index';-->
|
||||
<!--import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';-->
|
||||
<!--import FilterCity from '@/views/components/filterCity';-->
|
||||
<!--import localStore from 'storejs';-->
|
||||
<!--import { ProjectCode, GetMapListByProjectList } from '@/scripts/ProjectConfig';-->
|
||||
<!--import { createSimulationNew } from '@/api/simulation';-->
|
||||
|
||||
export default {
|
||||
name: 'PublicMapList',
|
||||
components: {
|
||||
FilterCity
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
widthLeft:0,
|
||||
defaultShowKeys: [],
|
||||
filterText: '',
|
||||
treeData: [],
|
||||
treeList: [],
|
||||
selected: {},
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'name'
|
||||
},
|
||||
node: {
|
||||
},
|
||||
localParamName: 'publish_cityCode'
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
project() {
|
||||
return getSessionStorage('project');
|
||||
},
|
||||
getMapByCode() {
|
||||
const project = getSessionStorage('project');
|
||||
return GetMapListByProjectList.includes(project);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
filterText(val) {
|
||||
this.treeList = this.treeData.filter((res) => {
|
||||
return res.name.includes(val);
|
||||
});
|
||||
}
|
||||
},
|
||||
beforeDestroy () {
|
||||
removeSessionStorage('demonList');
|
||||
},
|
||||
mounted() {
|
||||
if (this.getMapByCode) {
|
||||
this.refresh();
|
||||
}
|
||||
if (this.$route.query.mapId || this.$route.params.mapId) {
|
||||
const mapId = this.$route.query.mapId || this.$route.params.mapId;
|
||||
this.defaultShowKeys = [mapId];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
filterNode(value, data) {
|
||||
if (!value) return true;
|
||||
return data.name.indexOf(value) !== -1;
|
||||
},
|
||||
showContextMenu(e, obj, node, vueElem) {
|
||||
if (obj) {
|
||||
this.node = node;
|
||||
this.selected = obj;
|
||||
}
|
||||
},
|
||||
clickEvent(obj, data, ele) {
|
||||
switch (obj.type) {
|
||||
case 'scriptDesign': {
|
||||
const query = {lineCode:obj.lineCode};
|
||||
this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?`, query});
|
||||
break;
|
||||
}
|
||||
case 'lessonDesign': {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}?lineCode=${obj.lineCode}&cityCode=${obj.cityCode}` });
|
||||
break;
|
||||
}
|
||||
case 'lesson3dDesign': {
|
||||
this.$router.push({ path: `${UrlConfig.design.lesson3d}`});
|
||||
break;
|
||||
}
|
||||
case 'runPlanDesign': {
|
||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}` });
|
||||
break;
|
||||
}
|
||||
case 'map': {
|
||||
setSessionStorage('demonList', obj.id);
|
||||
break;
|
||||
}
|
||||
case 'mapPreview': {
|
||||
this.$router.push({ path: `${UrlConfig.design.mapPreviewNew}/${obj.mapId}` });
|
||||
break;
|
||||
}
|
||||
case 'ibpDesign': {
|
||||
this.$router.push({ path: `${UrlConfig.design.ibpHome}/${obj.mapId}`, query: {cityCode: obj.cityCode} });
|
||||
break;
|
||||
}
|
||||
case 'bigScreen': {
|
||||
this.$router.push({ path: `/design/bigScreen/${obj.mapId}` });
|
||||
break;
|
||||
}
|
||||
case 'bigSplitScreen': {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
this.$router.push({ path: `/bigSplitScreen/${obj.mapId}` });
|
||||
break;
|
||||
}
|
||||
case 'trainingDesign': {
|
||||
const data = { mapId: obj.mapId, prdType: '01' };
|
||||
createSimulationNew(data).then(resp => {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
const query = { mapId: obj.mapId, group: resp.data, lineCode:obj.lineCode};
|
||||
this.$router.push({ path: `/trainingDesign`, query });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
|
||||
});
|
||||
break;
|
||||
}
|
||||
case 'trainingPreview': {
|
||||
const data = { mapId: obj.mapId };
|
||||
createSimulationNew(data).then(resp => {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
this.$store.dispatch('training/setPrdType', '02');
|
||||
const query = { ...data, group: resp.data, scriptId: obj.id, lineCode:obj.lineCode};
|
||||
this.$router.push({ path: `/trainingPreview`, query });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
async refresh(filterSelect) {
|
||||
this.loading = true;
|
||||
this.treeData = this.treeList = [];
|
||||
const that = this;
|
||||
try {
|
||||
let res = '';
|
||||
if (this.getMapByCode) {
|
||||
res = await getMapListByProjectCode(ProjectCode[this.project]);
|
||||
} else {
|
||||
res = await listPublishMap({cityCode: filterSelect});
|
||||
}
|
||||
res.data && res.data.forEach(elem=>{
|
||||
elem.children = [
|
||||
{
|
||||
id: '1',
|
||||
name: this.$t('designPlatform.mapPreview'),
|
||||
type: 'mapPreview',
|
||||
mapId: elem.id,
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
];
|
||||
this.isAdministrator() ? elem.children.push({id: '2', name: this.$t('designPlatform.lessonDesign'), type: 'lessonDesign', mapId: elem.id, cityCode: elem.cityCode, lineCode: elem.lineCode}) : '';
|
||||
elem.children.push(
|
||||
{
|
||||
id: '3',
|
||||
name: this.$t('designPlatform.scriptDesign'),
|
||||
type: 'scriptDesign',
|
||||
mapId: elem.id,
|
||||
cityCode: elem.cityCode,
|
||||
lineCode: elem.lineCode
|
||||
// code:elem.children.find(n => { return n.name.includes("行调")})
|
||||
});
|
||||
elem.children.push(
|
||||
{
|
||||
id: '4',
|
||||
name: this.$t('designPlatform.runPlanDesign'),
|
||||
type: 'runPlanDesign',
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
);
|
||||
if (process.env.VUE_APP_PRO !== 'local') {
|
||||
elem.children.push(
|
||||
{
|
||||
id: '5',
|
||||
name: 'IBP盘设计',
|
||||
type: 'ibpDesign',
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
);
|
||||
}
|
||||
elem.children.push({
|
||||
id: '6',
|
||||
name: '大屏预览',
|
||||
type: 'bigScreen',
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
});
|
||||
elem.children.push({
|
||||
id: '7',
|
||||
name: '大屏分屏预览',
|
||||
type: 'bigSplitScreen',
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
});
|
||||
this.isAdministrator() ? elem.children.push({id: '8', name: this.$t('designPlatform.lesson3dDesign'), type: 'lesson3dDesign'}) : '';
|
||||
elem.children.push(
|
||||
{
|
||||
id: '9',
|
||||
name: '实训设计',
|
||||
type: 'trainingDesign',
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
);
|
||||
elem.children.push(
|
||||
{
|
||||
id: '10',
|
||||
name: '实训预览',
|
||||
type: 'trainingPreview',
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
);
|
||||
});
|
||||
<!--export default {-->
|
||||
<!-- name: 'PublicMapList',-->
|
||||
<!-- components: {-->
|
||||
<!-- FilterCity-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- loading: true,-->
|
||||
<!-- widthLeft:0,-->
|
||||
<!-- defaultShowKeys: [],-->
|
||||
<!-- filterText: '',-->
|
||||
<!-- treeData: [],-->
|
||||
<!-- treeList: [],-->
|
||||
<!-- selected: {},-->
|
||||
<!-- defaultProps: {-->
|
||||
<!-- children: 'children',-->
|
||||
<!-- label: 'name'-->
|
||||
<!-- },-->
|
||||
<!-- node: {-->
|
||||
<!-- },-->
|
||||
<!-- localParamName: 'publish_cityCode'-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- project() {-->
|
||||
<!-- return getSessionStorage('project');-->
|
||||
<!-- },-->
|
||||
<!-- getMapByCode() {-->
|
||||
<!-- const project = getSessionStorage('project');-->
|
||||
<!-- return GetMapListByProjectList.includes(project);-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- watch: {-->
|
||||
<!-- filterText(val) {-->
|
||||
<!-- this.treeList = this.treeData.filter((res) => {-->
|
||||
<!-- return res.name.includes(val);-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- beforeDestroy () {-->
|
||||
<!-- removeSessionStorage('demonList');-->
|
||||
<!-- },-->
|
||||
<!-- mounted() {-->
|
||||
<!-- if (this.getMapByCode) {-->
|
||||
<!-- this.refresh();-->
|
||||
<!-- }-->
|
||||
<!-- if (this.$route.query.mapId || this.$route.params.mapId) {-->
|
||||
<!-- const mapId = this.$route.query.mapId || this.$route.params.mapId;-->
|
||||
<!-- this.defaultShowKeys = [mapId];-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- filterNode(value, data) {-->
|
||||
<!-- if (!value) return true;-->
|
||||
<!-- return data.name.indexOf(value) !== -1;-->
|
||||
<!-- },-->
|
||||
<!-- showContextMenu(e, obj, node, vueElem) {-->
|
||||
<!-- if (obj) {-->
|
||||
<!-- this.node = node;-->
|
||||
<!-- this.selected = obj;-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- clickEvent(obj, data, ele) {-->
|
||||
<!-- switch (obj.type) {-->
|
||||
<!-- case 'scriptDesign': {-->
|
||||
<!-- const query = {lineCode:obj.lineCode};-->
|
||||
<!-- this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?`, query});-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'lessonDesign': {-->
|
||||
<!-- this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}?lineCode=${obj.lineCode}&cityCode=${obj.cityCode}` });-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'lesson3dDesign': {-->
|
||||
<!-- this.$router.push({ path: `${UrlConfig.design.lesson3d}`});-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'runPlanDesign': {-->
|
||||
<!-- this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?lineCode=${obj.lineCode}` });-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'map': {-->
|
||||
<!-- setSessionStorage('demonList', obj.id);-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'mapPreview': {-->
|
||||
<!-- this.$router.push({ path: `${UrlConfig.design.mapPreviewNew}/${obj.mapId}` });-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'ibpDesign': {-->
|
||||
<!-- this.$router.push({ path: `${UrlConfig.design.ibpHome}/${obj.mapId}`, query: {cityCode: obj.cityCode} });-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'bigScreen': {-->
|
||||
<!-- this.$router.push({ path: `/design/bigScreen/${obj.mapId}` });-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'bigSplitScreen': {-->
|
||||
<!-- this.$store.dispatch('app/transitionAnimations');-->
|
||||
<!-- this.$router.push({ path: `/bigSplitScreen/${obj.mapId}` });-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'trainingDesign': {-->
|
||||
<!-- const data = { mapId: obj.mapId, prdType: '01' };-->
|
||||
<!-- createSimulationNew(data).then(resp => {-->
|
||||
<!-- this.$store.dispatch('app/transitionAnimations');-->
|
||||
<!-- const query = { mapId: obj.mapId, group: resp.data, lineCode:obj.lineCode};-->
|
||||
<!-- this.$router.push({ path: `/trainingDesign`, query });-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);-->
|
||||
<!-- });-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- case 'trainingPreview': {-->
|
||||
<!-- const data = { mapId: obj.mapId };-->
|
||||
<!-- createSimulationNew(data).then(resp => {-->
|
||||
<!-- this.$store.dispatch('app/transitionAnimations');-->
|
||||
<!-- this.$store.dispatch('training/setPrdType', '02');-->
|
||||
<!-- const query = { ...data, group: resp.data, scriptId: obj.id, lineCode:obj.lineCode};-->
|
||||
<!-- this.$router.push({ path: `/trainingPreview`, query });-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$messageBox(`${this.$t('scriptRecord.createSimulationFail')}: ${error.message}`);-->
|
||||
<!-- });-->
|
||||
<!-- break;-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- async refresh(filterSelect) {-->
|
||||
<!-- this.loading = true;-->
|
||||
<!-- this.treeData = this.treeList = [];-->
|
||||
<!-- const that = this;-->
|
||||
<!-- try {-->
|
||||
<!-- let res = '';-->
|
||||
<!-- if (this.getMapByCode) {-->
|
||||
<!-- res = await getMapListByProjectCode(ProjectCode[this.project]);-->
|
||||
<!-- } else {-->
|
||||
<!-- res = await listPublishMap({cityCode: filterSelect});-->
|
||||
<!-- }-->
|
||||
<!-- res.data && res.data.forEach(elem=>{-->
|
||||
<!-- elem.children = [-->
|
||||
<!-- {-->
|
||||
<!-- id: '1',-->
|
||||
<!-- name: this.$t('designPlatform.mapPreview'),-->
|
||||
<!-- type: 'mapPreview',-->
|
||||
<!-- mapId: elem.id,-->
|
||||
<!-- cityCode: elem.cityCode-->
|
||||
<!-- }-->
|
||||
<!-- ];-->
|
||||
<!-- this.isAdministrator() ? elem.children.push({id: '2', name: this.$t('designPlatform.lessonDesign'), type: 'lessonDesign', mapId: elem.id, cityCode: elem.cityCode, lineCode: elem.lineCode}) : '';-->
|
||||
<!-- elem.children.push(-->
|
||||
<!-- {-->
|
||||
<!-- id: '3',-->
|
||||
<!-- name: this.$t('designPlatform.scriptDesign'),-->
|
||||
<!-- type: 'scriptDesign',-->
|
||||
<!-- mapId: elem.id,-->
|
||||
<!-- cityCode: elem.cityCode,-->
|
||||
<!-- lineCode: elem.lineCode-->
|
||||
<!-- // code:elem.children.find(n => { return n.name.includes("行调")})-->
|
||||
<!-- });-->
|
||||
<!-- elem.children.push(-->
|
||||
<!-- {-->
|
||||
<!-- id: '4',-->
|
||||
<!-- name: this.$t('designPlatform.runPlanDesign'),-->
|
||||
<!-- type: 'runPlanDesign',-->
|
||||
<!-- mapId: elem.id,-->
|
||||
<!-- lineCode: elem.lineCode,-->
|
||||
<!-- cityCode: elem.cityCode-->
|
||||
<!-- }-->
|
||||
<!-- );-->
|
||||
<!-- if (process.env.VUE_APP_PRO !== 'local') {-->
|
||||
<!-- elem.children.push(-->
|
||||
<!-- {-->
|
||||
<!-- id: '5',-->
|
||||
<!-- name: 'IBP盘设计',-->
|
||||
<!-- type: 'ibpDesign',-->
|
||||
<!-- mapId: elem.id,-->
|
||||
<!-- lineCode: elem.lineCode,-->
|
||||
<!-- cityCode: elem.cityCode-->
|
||||
<!-- }-->
|
||||
<!-- );-->
|
||||
<!-- }-->
|
||||
<!-- elem.children.push({-->
|
||||
<!-- id: '6',-->
|
||||
<!-- name: '大屏预览',-->
|
||||
<!-- type: 'bigScreen',-->
|
||||
<!-- mapId: elem.id,-->
|
||||
<!-- lineCode: elem.lineCode,-->
|
||||
<!-- cityCode: elem.cityCode-->
|
||||
<!-- });-->
|
||||
<!-- elem.children.push({-->
|
||||
<!-- id: '7',-->
|
||||
<!-- name: '大屏分屏预览',-->
|
||||
<!-- type: 'bigSplitScreen',-->
|
||||
<!-- mapId: elem.id,-->
|
||||
<!-- lineCode: elem.lineCode,-->
|
||||
<!-- cityCode: elem.cityCode-->
|
||||
<!-- });-->
|
||||
<!-- this.isAdministrator() ? elem.children.push({id: '8', name: this.$t('designPlatform.lesson3dDesign'), type: 'lesson3dDesign'}) : '';-->
|
||||
<!-- elem.children.push(-->
|
||||
<!-- {-->
|
||||
<!-- id: '9',-->
|
||||
<!-- name: '实训设计',-->
|
||||
<!-- type: 'trainingDesign',-->
|
||||
<!-- mapId: elem.id,-->
|
||||
<!-- lineCode: elem.lineCode,-->
|
||||
<!-- cityCode: elem.cityCode-->
|
||||
<!-- }-->
|
||||
<!-- );-->
|
||||
<!-- elem.children.push(-->
|
||||
<!-- {-->
|
||||
<!-- id: '10',-->
|
||||
<!-- name: '实训预览',-->
|
||||
<!-- type: 'trainingPreview',-->
|
||||
<!-- mapId: elem.id,-->
|
||||
<!-- lineCode: elem.lineCode,-->
|
||||
<!-- cityCode: elem.cityCode-->
|
||||
<!-- }-->
|
||||
<!-- );-->
|
||||
<!-- });-->
|
||||
|
||||
this.treeData = res.data;
|
||||
this.treeList = this.filterText
|
||||
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
|
||||
: res.data;
|
||||
this.$nextTick(() => {
|
||||
const mapId = getSessionStorage('demonList') || null;
|
||||
this.$refs.tree.setCurrentKey(mapId);
|
||||
this.loading = false;
|
||||
});
|
||||
} catch (error) {
|
||||
this.loading = false;
|
||||
this.$messageBox(that.$t('error.refreshFailed'));
|
||||
}
|
||||
},
|
||||
resize() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||
const height = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
isAdministrator() {
|
||||
return this.$store.state.user.roles.includes(superAdmin) || this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(lessonCreater);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.text_item{
|
||||
width: 100%;
|
||||
flex: 1;
|
||||
overflow: auto;
|
||||
padding-bottom: 10px;
|
||||
padding-top: 5px;
|
||||
}
|
||||
<!-- this.treeData = res.data;-->
|
||||
<!-- this.treeList = this.filterText-->
|
||||
<!-- ? res.data.filter(elem => { return elem.name.includes(this.filterText); })-->
|
||||
<!-- : res.data;-->
|
||||
<!-- this.$nextTick(() => {-->
|
||||
<!-- const mapId = getSessionStorage('demonList') || null;-->
|
||||
<!-- this.$refs.tree.setCurrentKey(mapId);-->
|
||||
<!-- this.loading = false;-->
|
||||
<!-- });-->
|
||||
<!-- } catch (error) {-->
|
||||
<!-- this.loading = false;-->
|
||||
<!-- this.$messageBox(that.$t('error.refreshFailed'));-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- resize() {-->
|
||||
<!-- this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;-->
|
||||
<!-- const width = this.$store.state.app.width - 521 - this.widthLeft;-->
|
||||
<!-- const height = this.$store.state.app.height - 90;-->
|
||||
<!-- this.$store.dispatch('config/resize', { width: width, height: height });-->
|
||||
<!-- },-->
|
||||
<!-- isAdministrator() {-->
|
||||
<!-- return this.$store.state.user.roles.includes(superAdmin) || this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(lessonCreater);-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
<!--<style rel="stylesheet/scss" lang="scss" scoped>-->
|
||||
<!-- .text_item{-->
|
||||
<!-- width: 100%;-->
|
||||
<!-- flex: 1;-->
|
||||
<!-- overflow: auto;-->
|
||||
<!-- padding-bottom: 10px;-->
|
||||
<!-- padding-top: 5px;-->
|
||||
<!-- }-->
|
||||
|
||||
.map-list-main{
|
||||
height: 100%;
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
}
|
||||
.mapListName{
|
||||
padding: 15px 0px 15px 20px;
|
||||
border-bottom: 1px solid #EBEEF5;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-tree {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.el-tree-node.is-current>.el-tree-node__content {
|
||||
background-color: #e4e3e3 !important;
|
||||
}
|
||||
</style>
|
||||
<!-- .map-list-main{-->
|
||||
<!-- height: 100%;-->
|
||||
<!-- display:flex;-->
|
||||
<!-- flex-direction:column;-->
|
||||
<!-- }-->
|
||||
<!-- .mapListName{-->
|
||||
<!-- padding: 15px 0px 15px 20px;-->
|
||||
<!-- border-bottom: 1px solid #EBEEF5;-->
|
||||
<!-- }-->
|
||||
<!--</style>-->
|
||||
<!--<style>-->
|
||||
<!-- .el-tree {-->
|
||||
<!-- overflow-x: hidden;-->
|
||||
<!-- }-->
|
||||
<!-- .el-tree-node.is-current>.el-tree-node__content {-->
|
||||
<!-- background-color: #e4e3e3 !important;-->
|
||||
<!-- }-->
|
||||
<!--</style>-->
|
||||
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="designPlatform" :style="'padding-left:'+(widthLeft)+'px'">
|
||||
<div class="designPubMapList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" />
|
||||
<!-- <demon-list ref="demonList" />-->
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
</div>
|
||||
<transition>
|
||||
@ -11,7 +11,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import demonList from './demonList';
|
||||
// import demonList from './demonList';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
import localStore from 'storejs';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
@ -19,7 +19,7 @@ import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
export default {
|
||||
name: 'DesignPlatform',
|
||||
components: {
|
||||
demonList,
|
||||
// demonList,
|
||||
drapLeft
|
||||
},
|
||||
data() {
|
||||
|
@ -37,7 +37,6 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { ProjectIcon } from '@/scripts/ProjectConfig';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import bgPsdImg from '@/assets/bg_psd.png';
|
||||
// import Jlmap3dMsg from '@/views/jlmap3d/show/msg';
|
||||
|
@ -57,7 +57,6 @@ import DevicefaultList from '@/views/jlmap3d/maintainer/component/devicefaultlis
|
||||
import FaultDevice from '@/views/jlmap3d/maintainer/component/faultdevice';
|
||||
|
||||
import Jlmap3dConfig from '@/views/jlmap3d/simulation/show/configmenu';
|
||||
import { ProjectIcon } from '@/scripts/ProjectConfig';
|
||||
|
||||
import bgPsdImg from '@/assets/bg_psd.png';
|
||||
// import Jlmap3dMsg from '@/views/jlmap3d/show/msg';
|
||||
|
@ -34,7 +34,6 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { ProjectIcon } from '@/scripts/ProjectConfig';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
import bgPsdImg from '@/assets/bg_psd.png';
|
||||
// import Jlmap3dMsg from '@/views/jlmap3d/show/msg';
|
||||
|
@ -70,9 +70,6 @@
|
||||
import {
|
||||
getSelectLesson3dList
|
||||
} from '@/api/jmap/lesson3d';
|
||||
import {
|
||||
ProjectIcon
|
||||
} from '@/scripts/ProjectConfig';
|
||||
import {
|
||||
JL3D_LOCAL_STATIC
|
||||
} from '@/api/jlmap3d/assets3d.js';
|
||||
|
@ -51,7 +51,6 @@ import Vue from 'vue';
|
||||
import Video from 'video.js';
|
||||
import 'video.js/dist/video-js.css';
|
||||
import { Jl3dpassflow } from '@/jlmap3d/jl3dpassflow/jl3dpassflownew.js';
|
||||
import { ProjectIcon, loginInfo } from '@/scripts/ProjectConfig';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
export default {
|
||||
name: 'Passflow',
|
||||
@ -101,8 +100,10 @@ export default {
|
||||
if (this.loadingProjectList.includes(this.$route.query.project)) {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
}
|
||||
document.querySelector("link[rel*='icon']").href =
|
||||
loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
|
||||
if(this.$store.state.projectConfig.loginProLogo) {
|
||||
document.querySelector("link[rel*='icon']").href = this.$store.state.projectConfig.loginProLogo;
|
||||
}
|
||||
|
||||
},
|
||||
// mounted() {
|
||||
// if (this.lineCode == '07') {
|
||||
|
@ -54,7 +54,6 @@ import { JLmap3d } from '@/jlmap3d/jl3dsimulation/jlmap3d.js';
|
||||
import Jlmap3dMenu from '@/views/jlmap3d/simulation/show/menu';
|
||||
|
||||
import Jlmap3dConfig from '@/views/jlmap3d/simulation/show/configmenu';
|
||||
import { ProjectIcon, loginInfo } from '@/scripts/ProjectConfig';
|
||||
|
||||
// import Jlmap3dMsg from '@/views/jlmap3d/show/msg';
|
||||
|
||||
@ -109,7 +108,9 @@ export default {
|
||||
if (this.loadingProjectList.includes(this.$route.query.project)) {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
}
|
||||
document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
|
||||
if(this.$store.state.projectConfig.loginProLogo) {
|
||||
document.querySelector("link[rel*='icon']").href = this.$store.state.projectConfig.loginProLogo;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.updatemenulist = this.updatemenulist;
|
||||
|
@ -32,7 +32,6 @@
|
||||
<script>
|
||||
import Vue from 'vue';
|
||||
import { Jl3dTrafficPlan } from '@/jlmap3d/jl3dtrafficplan/jl3dtrafficplan.js';
|
||||
import { ProjectIcon, loginInfo } from '@/scripts/ProjectConfig';
|
||||
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { JL3D_LOCAL_STATIC } from '@/api/jlmap3d/assets3d.js';
|
||||
@ -78,7 +77,9 @@ export default {
|
||||
if (this.loadingProjectList.includes(this.$route.query.project)) {
|
||||
this.$store.dispatch('app/transitionAnimations');
|
||||
}
|
||||
document.querySelector("link[rel*='icon']").href = loginInfo[this.$route.query.project].linkIcon || ProjectIcon[this.$route.query.project];
|
||||
if(this.$store.state.projectConfig.loginProLogo) {
|
||||
document.querySelector("link[rel*='icon']").href = this.$store.state.projectConfig.loginProLogo;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('beforeunload', e => this.beforeunloadHandler(e));
|
||||
|
@ -1,447 +1,447 @@
|
||||
<template>
|
||||
<div id="elDialog" class="message-board-box">
|
||||
<div class="message-board-title">留言板</div>
|
||||
<div class="message-board-content">
|
||||
<div v-if="postCommentList.length">
|
||||
<template v-for="(item,i) in postCommentList">
|
||||
<div :key="i" class="eachPostComment">
|
||||
<div style="margin-bottom: 10px;display: flex;align-items: center;">
|
||||
<img :src="avatarUrl(item)" class="head_portrait">
|
||||
<div class="MBCcreatorNickName">{{ item.creatorNickName }}</div>
|
||||
<div style="display: inline-block;">{{ item.createTime }}</div>
|
||||
</div>
|
||||
<div style="margin-left: 60px;" v-html="$escapeHTML(`${item.content}`)" />
|
||||
<div style="width: 100%;display:flex;align-items: center;justify-content: flex-end;">
|
||||
<img :src="replyIcon" class="replyIcon" @click="replyLeaveMessage(item.id, i)">
|
||||
<img v-if="userId == item.creatorId || superAdmin" :src="deleteIcon" class="deleteIcon" @click="deleteMessage(item.id)">
|
||||
</div>
|
||||
<div v-if="item.comments && item.comments.total > 0" class="eachComment">
|
||||
<div v-if="moreMessageId == item.id">
|
||||
<template v-for="(elem,j) in allCommentList">
|
||||
<div :key="j" style="font-size: 14px;margin-top: 10px;">
|
||||
<span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>
|
||||
<span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />
|
||||
<span style="margin-right: 10px;">{{ elem.commentTime }}</span>
|
||||
<span class="replyLeaveMessage" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>
|
||||
<span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else>
|
||||
<template v-for="(elem,j) in item.comments.list">
|
||||
<div :key="j" style="font-size: 14px;margin-top: 18px;">
|
||||
<span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>
|
||||
<span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />
|
||||
<span style="margin-right: 10px;">{{ elem.commentTime }}</span>
|
||||
<span class="replyLeaveMessage" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>
|
||||
<span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="item.comments.total > 3 && moreMessageId != item.id" style="margin-top: 10px;">
|
||||
<span class="view_more" @click="viewMoreComment(item)">{{ `共${item.comments.total}条回复,点击查看更多>>` }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="replyMessageId == item.id" style="width: 80%;margin-left: 10%;text-align: center;">
|
||||
<quill-editor
|
||||
:ref="'answerInput' + item.id"
|
||||
v-model="commentContent"
|
||||
style="width: 80%;margin-left: 10%;margin-top: 10px;"
|
||||
class-name="answer_input"
|
||||
:margin-bottom="20"
|
||||
editor-type="onlyEmoji"
|
||||
:no-handle-p="true"
|
||||
:height="100"
|
||||
:placeholder="replyUserName"
|
||||
/>
|
||||
<div>
|
||||
<el-button type="danger" size="small" @click="commentMessage">回复</el-button>
|
||||
<el-button size="small" @click="cancelComment">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else class="empty-text">
|
||||
<span>暂无留言</span>
|
||||
</div>
|
||||
<div style="width: 100%;text-align: center;">
|
||||
<el-pagination
|
||||
:current-page.sync="pageNum"
|
||||
:page-size="pageSize"
|
||||
layout="total, prev, pager, next,jumper"
|
||||
:total="total"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<quill-editor ref="quillEditor" v-model="content" style="width: 80%;margin-left: 10%;" :margin-bottom="20" editor-type="imgEmoji" :no-handle-p="true" />
|
||||
<span id="boardBottom" class="dialog-footer">
|
||||
<el-button @click="handleClear">清空</el-button>
|
||||
<el-button type="danger" @click="commitComment">留言</el-button>
|
||||
</span>
|
||||
<el-button size="mini" type="danger" class="goSlide" @click="goSlide">我要留言</el-button>
|
||||
<div v-show="imgShow" class="popUpImgView" @click="handelCloseImg">
|
||||
<img id="targetImg" src="" class="popUpImg">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--<template>-->
|
||||
<!-- <div id="elDialog" class="message-board-box">-->
|
||||
<!-- <div class="message-board-title">留言板</div>-->
|
||||
<!-- <div class="message-board-content">-->
|
||||
<!-- <div v-if="postCommentList.length">-->
|
||||
<!-- <template v-for="(item,i) in postCommentList">-->
|
||||
<!-- <div :key="i" class="eachPostComment">-->
|
||||
<!-- <div style="margin-bottom: 10px;display: flex;align-items: center;">-->
|
||||
<!-- <img :src="avatarUrl(item)" class="head_portrait">-->
|
||||
<!-- <div class="MBCcreatorNickName">{{ item.creatorNickName }}</div>-->
|
||||
<!-- <div style="display: inline-block;">{{ item.createTime }}</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div style="margin-left: 60px;" v-html="$escapeHTML(`${item.content}`)" />-->
|
||||
<!-- <div style="width: 100%;display:flex;align-items: center;justify-content: flex-end;">-->
|
||||
<!-- <img :src="replyIcon" class="replyIcon" @click="replyLeaveMessage(item.id, i)">-->
|
||||
<!-- <img v-if="userId == item.creatorId || superAdmin" :src="deleteIcon" class="deleteIcon" @click="deleteMessage(item.id)">-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="item.comments && item.comments.total > 0" class="eachComment">-->
|
||||
<!-- <div v-if="moreMessageId == item.id">-->
|
||||
<!-- <template v-for="(elem,j) in allCommentList">-->
|
||||
<!-- <div :key="j" style="font-size: 14px;margin-top: 10px;">-->
|
||||
<!-- <span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>-->
|
||||
<!-- <span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />-->
|
||||
<!-- <span style="margin-right: 10px;">{{ elem.commentTime }}</span>-->
|
||||
<!-- <span class="replyLeaveMessage" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>-->
|
||||
<!-- <span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-else>-->
|
||||
<!-- <template v-for="(elem,j) in item.comments.list">-->
|
||||
<!-- <div :key="j" style="font-size: 14px;margin-top: 18px;">-->
|
||||
<!-- <span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>-->
|
||||
<!-- <span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />-->
|
||||
<!-- <span style="margin-right: 10px;">{{ elem.commentTime }}</span>-->
|
||||
<!-- <span class="replyLeaveMessage" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>-->
|
||||
<!-- <span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="item.comments.total > 3 && moreMessageId != item.id" style="margin-top: 10px;">-->
|
||||
<!-- <span class="view_more" @click="viewMoreComment(item)">{{ `共${item.comments.total}条回复,点击查看更多>>` }}</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="replyMessageId == item.id" style="width: 80%;margin-left: 10%;text-align: center;">-->
|
||||
<!-- <quill-editor-->
|
||||
<!-- :ref="'answerInput' + item.id"-->
|
||||
<!-- v-model="commentContent"-->
|
||||
<!-- style="width: 80%;margin-left: 10%;margin-top: 10px;"-->
|
||||
<!-- class-name="answer_input"-->
|
||||
<!-- :margin-bottom="20"-->
|
||||
<!-- editor-type="onlyEmoji"-->
|
||||
<!-- :no-handle-p="true"-->
|
||||
<!-- :height="100"-->
|
||||
<!-- :placeholder="replyUserName"-->
|
||||
<!-- />-->
|
||||
<!-- <div>-->
|
||||
<!-- <el-button type="danger" size="small" @click="commentMessage">回复</el-button>-->
|
||||
<!-- <el-button size="small" @click="cancelComment">取消</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-else class="empty-text">-->
|
||||
<!-- <span>暂无留言</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div style="width: 100%;text-align: center;">-->
|
||||
<!-- <el-pagination-->
|
||||
<!-- :current-page.sync="pageNum"-->
|
||||
<!-- :page-size="pageSize"-->
|
||||
<!-- layout="total, prev, pager, next,jumper"-->
|
||||
<!-- :total="total"-->
|
||||
<!-- @current-change="handleCurrentChange"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <quill-editor ref="quillEditor" v-model="content" style="width: 80%;margin-left: 10%;" :margin-bottom="20" editor-type="imgEmoji" :no-handle-p="true" />-->
|
||||
<!-- <span id="boardBottom" class="dialog-footer">-->
|
||||
<!-- <el-button @click="handleClear">清空</el-button>-->
|
||||
<!-- <el-button type="danger" @click="commitComment">留言</el-button>-->
|
||||
<!-- </span>-->
|
||||
<!-- <el-button size="mini" type="danger" class="goSlide" @click="goSlide">我要留言</el-button>-->
|
||||
<!-- <div v-show="imgShow" class="popUpImgView" @click="handelCloseImg">-->
|
||||
<!-- <img id="targetImg" src="" class="popUpImg">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import { answerPost, queryMessagePagingByProjectCode, deleteMessageByAdmin, deleteMessageBySelf, commentLevelMessage, commentComents,
|
||||
queryMessageCommentList, deleteCommentByAdmin, deleteCommentBySelf, getPostByProjectCode } from '@/api/learn';
|
||||
import lick_icon from '@/assets/like.png';
|
||||
import unlike_icon from '@/assets/unlike.png';
|
||||
import reply_icon from '@/assets/reply.png';
|
||||
import delete_icon from '@/assets/delete.png';
|
||||
import { superAdmin } from '@/router/index';
|
||||
import { ProjectCode } from '@/scripts/ProjectConfig';
|
||||
import QuillEditor from '@/components/QuillEditor/index';
|
||||
export default {
|
||||
name: 'MessageBoard',
|
||||
components: {
|
||||
QuillEditor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content: '',
|
||||
postCommentList: [],
|
||||
pageSize: 10,
|
||||
pageNum: 0,
|
||||
total: 0,
|
||||
imgShow: false,
|
||||
lickIcon: lick_icon,
|
||||
unlikeIcon: unlike_icon,
|
||||
replyIcon: reply_icon,
|
||||
deleteIcon: delete_icon,
|
||||
replyMessageId: '',
|
||||
commentContent: '',
|
||||
replyCommentId: '',
|
||||
replyMessageIndex: '',
|
||||
allCommentList: [],
|
||||
moreMessageId: '',
|
||||
replyUserName: '',
|
||||
postId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
},
|
||||
superAdmin() {
|
||||
return this.$store.state.user.roles.includes(superAdmin);
|
||||
},
|
||||
projectCode() {
|
||||
const project = this.$route.query.project;
|
||||
return ProjectCode[project];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const that = this;
|
||||
window.handleZoomImg = function () {
|
||||
that.imgShow = true;
|
||||
document.getElementById('targetImg').src = event.target.currentSrc;
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
getPostByProjectCode(this.projectCode).then(resp => {
|
||||
this.postId = resp.data.id;
|
||||
});
|
||||
this.handleCurrentChange();
|
||||
},
|
||||
methods: {
|
||||
commitComment() {
|
||||
const images = this.content.match(/<img/g);
|
||||
const answerContent = this.handleEmojiContent(this.content);
|
||||
if (images && images.length > 3) {
|
||||
this.$message.error('留言内容使用图片应小于三张!');
|
||||
return;
|
||||
}
|
||||
if (answerContent.length > 1000) {
|
||||
this.$message.error('留言内容超出最大长度!');
|
||||
return;
|
||||
}
|
||||
if (!answerContent) {
|
||||
this.$message.error('留言内容不能为空!');
|
||||
return;
|
||||
}
|
||||
answerPost({postId: this.postId, content: answerContent}).then(resp => {
|
||||
this.pageNum = 1;
|
||||
this.handleCurrentChange();
|
||||
this.content = '';
|
||||
}).catch(error => {
|
||||
this.$message.error('留言失败 !');
|
||||
});
|
||||
},
|
||||
handleCurrentChange() {
|
||||
queryMessagePagingByProjectCode(this.projectCode, {pageSize: this.pageSize, pageNum: this.pageNum}).then(resp => {
|
||||
this.postCommentList = [];
|
||||
(resp.data.list || []).forEach(item => {
|
||||
item.content = this.replaceEmoji(item.content);
|
||||
item.comments && item.comments.list && item.comments.list.forEach(elem => {
|
||||
elem.content = this.replaceEmoji(elem.content);
|
||||
});
|
||||
this.postCommentList.push(item);
|
||||
});
|
||||
this.total = resp.data.total;
|
||||
});
|
||||
},
|
||||
replaceEmoji(content) {
|
||||
let value = content.replace(/<img/g, '<img style="width: 100px;height: auto;cursor: zoom-in;" onclick="handleZoomImg()"');
|
||||
const list = value.match(/<<<([^>]*)>>>/g);
|
||||
(list || []).forEach(elem => {
|
||||
const targetValue = elem.substring(3, elem.length - 3);
|
||||
value = value.replace(elem, `<span class="ql-emojiblot" data-name="${targetValue}"><span contenteditable="false"><span class="ap ap-${targetValue}">ss</span></span></span>`);
|
||||
});
|
||||
return value;
|
||||
},
|
||||
goSlide() {
|
||||
const bottom = document.getElementById('boardBottom');
|
||||
const element = document.getElementById('elDialog').childNodes[0];
|
||||
element.scrollTop = bottom.offsetTop;
|
||||
this.$refs.quillEditor.getFocus();
|
||||
},
|
||||
avatarUrl(val) {
|
||||
if (val && val.creatorAvatarPath) {
|
||||
return this.$store.state.user.ossUrl + val.creatorAvatarPath;
|
||||
} else {
|
||||
return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png';
|
||||
}
|
||||
},
|
||||
<!--<script>-->
|
||||
<!--import { answerPost, queryMessagePagingByProjectCode, deleteMessageByAdmin, deleteMessageBySelf, commentLevelMessage, commentComents,-->
|
||||
<!-- queryMessageCommentList, deleteCommentByAdmin, deleteCommentBySelf, getPostByProjectCode } from '@/api/learn';-->
|
||||
<!--import lick_icon from '@/assets/like.png';-->
|
||||
<!--import unlike_icon from '@/assets/unlike.png';-->
|
||||
<!--import reply_icon from '@/assets/reply.png';-->
|
||||
<!--import delete_icon from '@/assets/delete.png';-->
|
||||
<!--import { superAdmin } from '@/router/index';-->
|
||||
<!--import { ProjectCode } from '@/scripts/ProjectConfig';-->
|
||||
<!--import QuillEditor from '@/components/QuillEditor/index';-->
|
||||
<!--export default {-->
|
||||
<!-- name: 'MessageBoard',-->
|
||||
<!-- components: {-->
|
||||
<!-- QuillEditor-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- content: '',-->
|
||||
<!-- postCommentList: [],-->
|
||||
<!-- pageSize: 10,-->
|
||||
<!-- pageNum: 0,-->
|
||||
<!-- total: 0,-->
|
||||
<!-- imgShow: false,-->
|
||||
<!-- lickIcon: lick_icon,-->
|
||||
<!-- unlikeIcon: unlike_icon,-->
|
||||
<!-- replyIcon: reply_icon,-->
|
||||
<!-- deleteIcon: delete_icon,-->
|
||||
<!-- replyMessageId: '',-->
|
||||
<!-- commentContent: '',-->
|
||||
<!-- replyCommentId: '',-->
|
||||
<!-- replyMessageIndex: '',-->
|
||||
<!-- allCommentList: [],-->
|
||||
<!-- moreMessageId: '',-->
|
||||
<!-- replyUserName: '',-->
|
||||
<!-- postId: ''-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- userId() {-->
|
||||
<!-- return this.$store.state.user.id;-->
|
||||
<!-- },-->
|
||||
<!-- superAdmin() {-->
|
||||
<!-- return this.$store.state.user.roles.includes(superAdmin);-->
|
||||
<!-- },-->
|
||||
<!-- projectCode() {-->
|
||||
<!-- const project = this.$route.query.project;-->
|
||||
<!-- return ProjectCode[project];-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- created() {-->
|
||||
<!-- const that = this;-->
|
||||
<!-- window.handleZoomImg = function () {-->
|
||||
<!-- that.imgShow = true;-->
|
||||
<!-- document.getElementById('targetImg').src = event.target.currentSrc;-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- mounted() {-->
|
||||
<!-- getPostByProjectCode(this.projectCode).then(resp => {-->
|
||||
<!-- this.postId = resp.data.id;-->
|
||||
<!-- });-->
|
||||
<!-- this.handleCurrentChange();-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- commitComment() {-->
|
||||
<!-- const images = this.content.match(/<img/g);-->
|
||||
<!-- const answerContent = this.handleEmojiContent(this.content);-->
|
||||
<!-- if (images && images.length > 3) {-->
|
||||
<!-- this.$message.error('留言内容使用图片应小于三张!');-->
|
||||
<!-- return;-->
|
||||
<!-- }-->
|
||||
<!-- if (answerContent.length > 1000) {-->
|
||||
<!-- this.$message.error('留言内容超出最大长度!');-->
|
||||
<!-- return;-->
|
||||
<!-- }-->
|
||||
<!-- if (!answerContent) {-->
|
||||
<!-- this.$message.error('留言内容不能为空!');-->
|
||||
<!-- return;-->
|
||||
<!-- }-->
|
||||
<!-- answerPost({postId: this.postId, content: answerContent}).then(resp => {-->
|
||||
<!-- this.pageNum = 1;-->
|
||||
<!-- this.handleCurrentChange();-->
|
||||
<!-- this.content = '';-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('留言失败 !');-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- handleCurrentChange() {-->
|
||||
<!-- queryMessagePagingByProjectCode(this.projectCode, {pageSize: this.pageSize, pageNum: this.pageNum}).then(resp => {-->
|
||||
<!-- this.postCommentList = [];-->
|
||||
<!-- (resp.data.list || []).forEach(item => {-->
|
||||
<!-- item.content = this.replaceEmoji(item.content);-->
|
||||
<!-- item.comments && item.comments.list && item.comments.list.forEach(elem => {-->
|
||||
<!-- elem.content = this.replaceEmoji(elem.content);-->
|
||||
<!-- });-->
|
||||
<!-- this.postCommentList.push(item);-->
|
||||
<!-- });-->
|
||||
<!-- this.total = resp.data.total;-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- replaceEmoji(content) {-->
|
||||
<!-- let value = content.replace(/<img/g, '<img style="width: 100px;height: auto;cursor: zoom-in;" onclick="handleZoomImg()"');-->
|
||||
<!-- const list = value.match(/<<<([^>]*)>>>/g);-->
|
||||
<!-- (list || []).forEach(elem => {-->
|
||||
<!-- const targetValue = elem.substring(3, elem.length - 3);-->
|
||||
<!-- value = value.replace(elem, `<span class="ql-emojiblot" data-name="${targetValue}"><span contenteditable="false"><span class="ap ap-${targetValue}">ss</span></span></span>`);-->
|
||||
<!-- });-->
|
||||
<!-- return value;-->
|
||||
<!-- },-->
|
||||
<!-- goSlide() {-->
|
||||
<!-- const bottom = document.getElementById('boardBottom');-->
|
||||
<!-- const element = document.getElementById('elDialog').childNodes[0];-->
|
||||
<!-- element.scrollTop = bottom.offsetTop;-->
|
||||
<!-- this.$refs.quillEditor.getFocus();-->
|
||||
<!-- },-->
|
||||
<!-- avatarUrl(val) {-->
|
||||
<!-- if (val && val.creatorAvatarPath) {-->
|
||||
<!-- return this.$store.state.user.ossUrl + val.creatorAvatarPath;-->
|
||||
<!-- } else {-->
|
||||
<!-- return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png';-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
|
||||
handleClear() {
|
||||
this.content = '';
|
||||
},
|
||||
handelCloseImg() {
|
||||
this.imgShow = false;
|
||||
document.getElementById('targetImg').src = '';
|
||||
},
|
||||
replyLeaveMessage(messageId, messageIndex, commentId, userNickname) {
|
||||
this.cancelComment();
|
||||
this.replyMessageId = messageId;
|
||||
this.replyCommentId = commentId;
|
||||
this.replyMessageIndex = messageIndex;
|
||||
if (commentId) {
|
||||
this.replyUserName = '@' + userNickname + ' ';
|
||||
this.commentContent = '';
|
||||
}
|
||||
this.$nextTick(()=>{
|
||||
this.$refs['answerInput' + messageId][0].getFocus();
|
||||
});
|
||||
},
|
||||
cancelComment() {
|
||||
this.replyMessageId = '';
|
||||
this.commentContent = '';
|
||||
this.replyCommentId = '';
|
||||
this.replyMessageIndex = '';
|
||||
this.replyUserName = '';
|
||||
},
|
||||
commentMessage() {
|
||||
const contentValue = this.handleEmojiContent(this.commentContent);
|
||||
if (contentValue.length > 300) {
|
||||
this.$message.error('回复内容超出最大长度!');
|
||||
return;
|
||||
}
|
||||
if (this.replyCommentId) {
|
||||
commentComents(this.replyMessageId, this.replyCommentId, {content:contentValue}).then(resp => {
|
||||
this.getCommentList(this.replyMessageId, this.replyMessageIndex);
|
||||
this.cancelComment();
|
||||
}).catch(error => {
|
||||
this.$message.error('评论回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
} else {
|
||||
commentLevelMessage(this.replyMessageId, {content:contentValue}).then(resp => {
|
||||
this.getCommentList(this.replyMessageId, this.replyMessageIndex);
|
||||
this.cancelComment();
|
||||
}).catch(error => {
|
||||
this.$message.error('评论回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
getCommentList(messageId, messageIndex) {
|
||||
queryMessageCommentList(messageId).then(resp => {
|
||||
const replaceValue = [];
|
||||
resp.data && resp.data.forEach(item => {
|
||||
item.content = this.replaceEmoji(item.content);
|
||||
replaceValue.push(item);
|
||||
});
|
||||
if (this.moreMessageId == messageId) {
|
||||
this.allCommentList = replaceValue;
|
||||
}
|
||||
if (replaceValue.length > 3) {
|
||||
this.postCommentList[messageIndex].comments.list = replaceValue.slice(0, 3);
|
||||
this.postCommentList[messageIndex].comments.total = replaceValue.length;
|
||||
} else {
|
||||
this.postCommentList[messageIndex].comments.list = replaceValue;
|
||||
this.postCommentList[messageIndex].comments.total = replaceValue.length;
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$message.error('更新回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
computedCommentName(elem) {
|
||||
if (elem.replyUserNickName) {
|
||||
return `${elem.userNickname} 回复@ ${elem.replyUserNickName}:`;
|
||||
} else {
|
||||
return elem.userNickname + ':';
|
||||
}
|
||||
},
|
||||
deleteMessage(messageId) {
|
||||
if (this.superAdmin) {
|
||||
deleteMessageByAdmin(messageId).then(resp => {
|
||||
// this.$message.success('删除留言成功!');
|
||||
this.handleCurrentChange();
|
||||
}).catch(error => {
|
||||
this.$message.error('删除留言失败!');
|
||||
console.error(error);
|
||||
});
|
||||
} else {
|
||||
deleteMessageBySelf(messageId).then(resp => {
|
||||
// this.$message.success('删除留言成功!');
|
||||
this.handleCurrentChange();
|
||||
}).catch(error => {
|
||||
this.$message.error('删除留言失败!');
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
deleteComment(messageId, messageIndex, commentId) {
|
||||
if (this.superAdmin) {
|
||||
deleteCommentByAdmin(commentId).then(resp => {
|
||||
this.getCommentList(messageId, messageIndex);
|
||||
}).catch(error => {
|
||||
this.$message.error('删除回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
} else {
|
||||
deleteCommentBySelf(commentId).then(resp => {
|
||||
this.getCommentList(messageId, messageIndex);
|
||||
}).catch(error => {
|
||||
this.$message.error('删除回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
viewMoreComment(data) {
|
||||
queryMessageCommentList(data.id).then(resp => {
|
||||
this.allCommentList = [];
|
||||
resp.data && resp.data.forEach(item => {
|
||||
item.content = this.replaceEmoji(item.content);
|
||||
this.allCommentList.push(item);
|
||||
});
|
||||
this.moreMessageId = data.id;
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
handleEmojiContent(content) {
|
||||
const list = content.match(/<span class="ql-emojiblot" data-name="(\S*)"><span contenteditable="false"><span class="ap ap-(\S*)<\/span><\/span><\/span>/g);
|
||||
(list || []).forEach(item => {
|
||||
let targetValue = item.split(' ')[2];
|
||||
targetValue = targetValue.substring(11, targetValue.length - 8);
|
||||
content = content.replace(item, '<<<' + targetValue + '>>>');
|
||||
});
|
||||
return content;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<!-- handleClear() {-->
|
||||
<!-- this.content = '';-->
|
||||
<!-- },-->
|
||||
<!-- handelCloseImg() {-->
|
||||
<!-- this.imgShow = false;-->
|
||||
<!-- document.getElementById('targetImg').src = '';-->
|
||||
<!-- },-->
|
||||
<!-- replyLeaveMessage(messageId, messageIndex, commentId, userNickname) {-->
|
||||
<!-- this.cancelComment();-->
|
||||
<!-- this.replyMessageId = messageId;-->
|
||||
<!-- this.replyCommentId = commentId;-->
|
||||
<!-- this.replyMessageIndex = messageIndex;-->
|
||||
<!-- if (commentId) {-->
|
||||
<!-- this.replyUserName = '@' + userNickname + ' ';-->
|
||||
<!-- this.commentContent = '';-->
|
||||
<!-- }-->
|
||||
<!-- this.$nextTick(()=>{-->
|
||||
<!-- this.$refs['answerInput' + messageId][0].getFocus();-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- cancelComment() {-->
|
||||
<!-- this.replyMessageId = '';-->
|
||||
<!-- this.commentContent = '';-->
|
||||
<!-- this.replyCommentId = '';-->
|
||||
<!-- this.replyMessageIndex = '';-->
|
||||
<!-- this.replyUserName = '';-->
|
||||
<!-- },-->
|
||||
<!-- commentMessage() {-->
|
||||
<!-- const contentValue = this.handleEmojiContent(this.commentContent);-->
|
||||
<!-- if (contentValue.length > 300) {-->
|
||||
<!-- this.$message.error('回复内容超出最大长度!');-->
|
||||
<!-- return;-->
|
||||
<!-- }-->
|
||||
<!-- if (this.replyCommentId) {-->
|
||||
<!-- commentComents(this.replyMessageId, this.replyCommentId, {content:contentValue}).then(resp => {-->
|
||||
<!-- this.getCommentList(this.replyMessageId, this.replyMessageIndex);-->
|
||||
<!-- this.cancelComment();-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('评论回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- } else {-->
|
||||
<!-- commentLevelMessage(this.replyMessageId, {content:contentValue}).then(resp => {-->
|
||||
<!-- this.getCommentList(this.replyMessageId, this.replyMessageIndex);-->
|
||||
<!-- this.cancelComment();-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('评论回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- getCommentList(messageId, messageIndex) {-->
|
||||
<!-- queryMessageCommentList(messageId).then(resp => {-->
|
||||
<!-- const replaceValue = [];-->
|
||||
<!-- resp.data && resp.data.forEach(item => {-->
|
||||
<!-- item.content = this.replaceEmoji(item.content);-->
|
||||
<!-- replaceValue.push(item);-->
|
||||
<!-- });-->
|
||||
<!-- if (this.moreMessageId == messageId) {-->
|
||||
<!-- this.allCommentList = replaceValue;-->
|
||||
<!-- }-->
|
||||
<!-- if (replaceValue.length > 3) {-->
|
||||
<!-- this.postCommentList[messageIndex].comments.list = replaceValue.slice(0, 3);-->
|
||||
<!-- this.postCommentList[messageIndex].comments.total = replaceValue.length;-->
|
||||
<!-- } else {-->
|
||||
<!-- this.postCommentList[messageIndex].comments.list = replaceValue;-->
|
||||
<!-- this.postCommentList[messageIndex].comments.total = replaceValue.length;-->
|
||||
<!-- }-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('更新回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- computedCommentName(elem) {-->
|
||||
<!-- if (elem.replyUserNickName) {-->
|
||||
<!-- return `${elem.userNickname} 回复@ ${elem.replyUserNickName}:`;-->
|
||||
<!-- } else {-->
|
||||
<!-- return elem.userNickname + ':';-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- deleteMessage(messageId) {-->
|
||||
<!-- if (this.superAdmin) {-->
|
||||
<!-- deleteMessageByAdmin(messageId).then(resp => {-->
|
||||
<!-- // this.$message.success('删除留言成功!');-->
|
||||
<!-- this.handleCurrentChange();-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('删除留言失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- } else {-->
|
||||
<!-- deleteMessageBySelf(messageId).then(resp => {-->
|
||||
<!-- // this.$message.success('删除留言成功!');-->
|
||||
<!-- this.handleCurrentChange();-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('删除留言失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- deleteComment(messageId, messageIndex, commentId) {-->
|
||||
<!-- if (this.superAdmin) {-->
|
||||
<!-- deleteCommentByAdmin(commentId).then(resp => {-->
|
||||
<!-- this.getCommentList(messageId, messageIndex);-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('删除回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- } else {-->
|
||||
<!-- deleteCommentBySelf(commentId).then(resp => {-->
|
||||
<!-- this.getCommentList(messageId, messageIndex);-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('删除回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- viewMoreComment(data) {-->
|
||||
<!-- queryMessageCommentList(data.id).then(resp => {-->
|
||||
<!-- this.allCommentList = [];-->
|
||||
<!-- resp.data && resp.data.forEach(item => {-->
|
||||
<!-- item.content = this.replaceEmoji(item.content);-->
|
||||
<!-- this.allCommentList.push(item);-->
|
||||
<!-- });-->
|
||||
<!-- this.moreMessageId = data.id;-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- handleEmojiContent(content) {-->
|
||||
<!-- const list = content.match(/<span class="ql-emojiblot" data-name="(\S*)"><span contenteditable="false"><span class="ap ap-(\S*)<\/span><\/span><\/span>/g);-->
|
||||
<!-- (list || []).forEach(item => {-->
|
||||
<!-- let targetValue = item.split(' ')[2];-->
|
||||
<!-- targetValue = targetValue.substring(11, targetValue.length - 8);-->
|
||||
<!-- content = content.replace(item, '<<<' + targetValue + '>>>');-->
|
||||
<!-- });-->
|
||||
<!-- return content;-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-footer{
|
||||
margin: 0 auto;
|
||||
padding: 10px 0 30px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.empty-text{
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-size: 18px;
|
||||
color: #ccc;
|
||||
}
|
||||
.head_portrait{
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 25px;
|
||||
}
|
||||
.view_more {
|
||||
cursor: pointer;
|
||||
}
|
||||
.view_more:hover {
|
||||
cursor: pointer;
|
||||
color: #409EFF;
|
||||
}
|
||||
.img-box{
|
||||
width: 100px;
|
||||
height: auto;
|
||||
}
|
||||
.message-board-box{
|
||||
width: 100%;
|
||||
background-image:url('../../assets/bg_board.jpg');
|
||||
background-size: 100% 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
/deep/.ql-container{
|
||||
height: 80%;
|
||||
}
|
||||
.message-board-title{
|
||||
font-size: 30px;
|
||||
color: #F00;
|
||||
font-family: 'fangsong';
|
||||
font-weight: bolder;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
}
|
||||
.message-board-content{
|
||||
width: 80%;
|
||||
margin-left: 10%;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
background-color: rgba(255,255,255,0);
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
||||
}
|
||||
.eachPostComment{
|
||||
border: 1px solid #C0C0C0;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 2px 2px 3px #808080;
|
||||
padding: 10px 20px;
|
||||
background-color: #fff
|
||||
}
|
||||
.eachComment{
|
||||
background: #F5F5F5;
|
||||
margin-top: 10px;
|
||||
width: calc(100% - 120px);
|
||||
margin-left: 60px;
|
||||
border-radius: 5px;
|
||||
padding: 1px 10px 10px;
|
||||
}
|
||||
.replyLeaveMessage{color:#409EFF;cursor: pointer;margin-right: 10px;}
|
||||
.MBCcreatorNickName{display: inline-block;margin-right: 20px;margin-left:10px;font-size: 18px;color: #000;}
|
||||
.replyIcon{width: 16px;height: auto;margin-right: 30px;cursor: pointer;}
|
||||
.deleteIcon{width: 16px;height: auto;cursor:pointer;}
|
||||
.goSlide{position: fixed; left: 91%;top: 80px;width: 90px;}
|
||||
.popUpImgView{position: fixed;width: 100%;height: 100%;left: 0;top: 0;background: rgba(0,0,0,0.5);cursor: zoom-out;}
|
||||
.popUpImg{position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);min-width: 500px;max-height: 80%;height: auto;}
|
||||
</style>
|
||||
<style>
|
||||
.ql-size-small {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
.ql-size-large{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.ql-size-huge{
|
||||
font-size: 2.5em;
|
||||
}
|
||||
</style>
|
||||
<!--<style lang="scss" scoped>-->
|
||||
<!-- .dialog-footer{-->
|
||||
<!-- margin: 0 auto;-->
|
||||
<!-- padding: 10px 0 30px;-->
|
||||
<!-- display: flex;-->
|
||||
<!-- justify-content: center;-->
|
||||
<!-- }-->
|
||||
<!-- .empty-text{-->
|
||||
<!-- text-align: center;-->
|
||||
<!-- width: 100%;-->
|
||||
<!-- height: 50px;-->
|
||||
<!-- line-height: 50px;-->
|
||||
<!-- font-size: 18px;-->
|
||||
<!-- color: #ccc;-->
|
||||
<!-- }-->
|
||||
<!-- .head_portrait{-->
|
||||
<!-- width: 50px;-->
|
||||
<!-- height: 50px;-->
|
||||
<!-- border-radius: 25px;-->
|
||||
<!-- }-->
|
||||
<!-- .view_more {-->
|
||||
<!-- cursor: pointer;-->
|
||||
<!-- }-->
|
||||
<!-- .view_more:hover {-->
|
||||
<!-- cursor: pointer;-->
|
||||
<!-- color: #409EFF;-->
|
||||
<!-- }-->
|
||||
<!-- .img-box{-->
|
||||
<!-- width: 100px;-->
|
||||
<!-- height: auto;-->
|
||||
<!-- }-->
|
||||
<!-- .message-board-box{-->
|
||||
<!-- width: 100%;-->
|
||||
<!-- background-image:url('../../assets/bg_board.jpg');-->
|
||||
<!-- background-size: 100% 100%;-->
|
||||
<!-- min-height: 100%;-->
|
||||
<!-- }-->
|
||||
<!-- /deep/.ql-container{-->
|
||||
<!-- height: 80%;-->
|
||||
<!-- }-->
|
||||
<!-- .message-board-title{-->
|
||||
<!-- font-size: 30px;-->
|
||||
<!-- color: #F00;-->
|
||||
<!-- font-family: 'fangsong';-->
|
||||
<!-- font-weight: bolder;-->
|
||||
<!-- width: 100%;-->
|
||||
<!-- text-align: center;-->
|
||||
<!-- height: 80px;-->
|
||||
<!-- line-height: 80px;-->
|
||||
<!-- }-->
|
||||
<!-- .message-board-content{-->
|
||||
<!-- width: 80%;-->
|
||||
<!-- margin-left: 10%;-->
|
||||
<!-- padding: 20px;-->
|
||||
<!-- margin-bottom: 20px;-->
|
||||
<!-- background-color: rgba(255,255,255,0);-->
|
||||
<!-- border: 1px solid #ebeef5;-->
|
||||
<!-- border-radius: 4px;-->
|
||||
<!-- box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);-->
|
||||
<!-- }-->
|
||||
<!-- .eachPostComment{-->
|
||||
<!-- border: 1px solid #C0C0C0;-->
|
||||
<!-- border-radius: 5px;-->
|
||||
<!-- margin-bottom: 20px;-->
|
||||
<!-- box-shadow: 2px 2px 3px #808080;-->
|
||||
<!-- padding: 10px 20px;-->
|
||||
<!-- background-color: #fff-->
|
||||
<!-- }-->
|
||||
<!-- .eachComment{-->
|
||||
<!-- background: #F5F5F5;-->
|
||||
<!-- margin-top: 10px;-->
|
||||
<!-- width: calc(100% - 120px);-->
|
||||
<!-- margin-left: 60px;-->
|
||||
<!-- border-radius: 5px;-->
|
||||
<!-- padding: 1px 10px 10px;-->
|
||||
<!-- }-->
|
||||
<!-- .replyLeaveMessage{color:#409EFF;cursor: pointer;margin-right: 10px;}-->
|
||||
<!-- .MBCcreatorNickName{display: inline-block;margin-right: 20px;margin-left:10px;font-size: 18px;color: #000;}-->
|
||||
<!-- .replyIcon{width: 16px;height: auto;margin-right: 30px;cursor: pointer;}-->
|
||||
<!-- .deleteIcon{width: 16px;height: auto;cursor:pointer;}-->
|
||||
<!-- .goSlide{position: fixed; left: 91%;top: 80px;width: 90px;}-->
|
||||
<!-- .popUpImgView{position: fixed;width: 100%;height: 100%;left: 0;top: 0;background: rgba(0,0,0,0.5);cursor: zoom-out;}-->
|
||||
<!-- .popUpImg{position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);min-width: 500px;max-height: 80%;height: auto;}-->
|
||||
<!--</style>-->
|
||||
<!--<style>-->
|
||||
<!--.ql-size-small {-->
|
||||
<!-- font-size: 0.75em;-->
|
||||
<!--}-->
|
||||
<!--.ql-size-large{-->
|
||||
<!-- font-size: 1.5em;-->
|
||||
<!--}-->
|
||||
<!--.ql-size-huge{-->
|
||||
<!-- font-size: 2.5em;-->
|
||||
<!--}-->
|
||||
<!--</style>-->
|
||||
|
@ -1,121 +1,121 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<create-draft ref="createDraft" :project-option-list="projectOptionList" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
<!--<template>-->
|
||||
<!-- <div>-->
|
||||
<!-- <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />-->
|
||||
<!-- <create-draft ref="createDraft" :project-option-list="projectOptionList" @reloadTable="reloadTable" />-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import { queryPostPage } from '@/api/learn';
|
||||
import { ProjectList} from '@/scripts/ProjectConfig';
|
||||
import CreateDraft from './create';
|
||||
export default {
|
||||
name: 'Manage',
|
||||
components:{
|
||||
CreateDraft
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
projectOptionList: [],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '140px',
|
||||
reset: false,
|
||||
queryObject: {
|
||||
project: {
|
||||
type: 'select',
|
||||
label: '所属项目',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: queryPostPage,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '项目',
|
||||
prop: 'project',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.getProjectName(row.project); },
|
||||
tagType: (row) => {
|
||||
return 'success';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '留言板名称',
|
||||
prop: 'title'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '350',
|
||||
buttons: [
|
||||
{
|
||||
name: '进入',
|
||||
handleClick: this.handleEnter
|
||||
},
|
||||
{
|
||||
name: '修改',
|
||||
handleClick: this.handleUpdate
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: '创建留言板', handler: this.handleCreateMessageBoard }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.projectOptionList = [{value: 'DEFAULT', label: '玖琏云平台'}];
|
||||
ProjectList.forEach(item => {
|
||||
this.projectOptionList.push({value: item.value.toUpperCase(), label: item.label});
|
||||
});
|
||||
this.queryForm.queryObject.project.config.data = this.projectOptionList;
|
||||
},
|
||||
methods:{
|
||||
getProjectName(projectCode) {
|
||||
let name;
|
||||
this.projectOptionList.forEach(item => {
|
||||
if (item.value.toUpperCase() == projectCode) {
|
||||
name = item.label;
|
||||
}
|
||||
});
|
||||
return name;
|
||||
},
|
||||
handleCreateMessageBoard() {
|
||||
this.$refs.createDraft.doShow();
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
handleEnter(index, row) {
|
||||
const routeData = this.$router.resolve({
|
||||
path:'/messageBoard',
|
||||
query:{
|
||||
project: row.project.toLowerCase(),
|
||||
noPreLogout: true
|
||||
}
|
||||
});
|
||||
window.open(routeData.href, '_blank');
|
||||
},
|
||||
handleUpdate(index, row) {
|
||||
this.$refs.createDraft.doShow(row);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<!--<script>-->
|
||||
<!--import { queryPostPage } from '@/api/learn';-->
|
||||
<!--import { ProjectList} from '@/scripts/ProjectConfig';-->
|
||||
<!--import CreateDraft from './create';-->
|
||||
<!--export default {-->
|
||||
<!-- name: 'Manage',-->
|
||||
<!-- components:{-->
|
||||
<!-- CreateDraft-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- projectOptionList: [],-->
|
||||
<!-- pagerConfig: {-->
|
||||
<!-- pageSize: 'pageSize',-->
|
||||
<!-- pageIndex: 'pageNum'-->
|
||||
<!-- },-->
|
||||
<!-- queryForm: {-->
|
||||
<!-- labelWidth: '140px',-->
|
||||
<!-- reset: false,-->
|
||||
<!-- queryObject: {-->
|
||||
<!-- project: {-->
|
||||
<!-- type: 'select',-->
|
||||
<!-- label: '所属项目',-->
|
||||
<!-- config: {-->
|
||||
<!-- data: []-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- queryList: {-->
|
||||
<!-- query: queryPostPage,-->
|
||||
<!-- selectCheckShow: false,-->
|
||||
<!-- indexShow: true,-->
|
||||
<!-- columns: [-->
|
||||
<!-- {-->
|
||||
<!-- title: '项目',-->
|
||||
<!-- prop: 'project',-->
|
||||
<!-- type: 'tag',-->
|
||||
<!-- columnValue: (row) => { return this.getProjectName(row.project); },-->
|
||||
<!-- tagType: (row) => {-->
|
||||
<!-- return 'success';-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: '留言板名称',-->
|
||||
<!-- prop: 'title'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- type: 'button',-->
|
||||
<!-- title: this.$t('global.operate'),-->
|
||||
<!-- width: '350',-->
|
||||
<!-- buttons: [-->
|
||||
<!-- {-->
|
||||
<!-- name: '进入',-->
|
||||
<!-- handleClick: this.handleEnter-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: '修改',-->
|
||||
<!-- handleClick: this.handleUpdate-->
|
||||
<!-- }-->
|
||||
<!-- ]-->
|
||||
<!-- }-->
|
||||
<!-- ],-->
|
||||
<!-- actions: [-->
|
||||
<!-- { text: '创建留言板', handler: this.handleCreateMessageBoard }-->
|
||||
<!-- ]-->
|
||||
<!-- }-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- mounted() {-->
|
||||
<!-- this.projectOptionList = [{value: 'DEFAULT', label: '玖琏云平台'}];-->
|
||||
<!-- ProjectList.forEach(item => {-->
|
||||
<!-- this.projectOptionList.push({value: item.value.toUpperCase(), label: item.label});-->
|
||||
<!-- });-->
|
||||
<!-- this.queryForm.queryObject.project.config.data = this.projectOptionList;-->
|
||||
<!-- },-->
|
||||
<!-- methods:{-->
|
||||
<!-- getProjectName(projectCode) {-->
|
||||
<!-- let name;-->
|
||||
<!-- this.projectOptionList.forEach(item => {-->
|
||||
<!-- if (item.value.toUpperCase() == projectCode) {-->
|
||||
<!-- name = item.label;-->
|
||||
<!-- }-->
|
||||
<!-- });-->
|
||||
<!-- return name;-->
|
||||
<!-- },-->
|
||||
<!-- handleCreateMessageBoard() {-->
|
||||
<!-- this.$refs.createDraft.doShow();-->
|
||||
<!-- },-->
|
||||
<!-- reloadTable() {-->
|
||||
<!-- if (this.queryList && this.queryList.reload) {-->
|
||||
<!-- this.queryList.reload();-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- handleEnter(index, row) {-->
|
||||
<!-- const routeData = this.$router.resolve({-->
|
||||
<!-- path:'/messageBoard',-->
|
||||
<!-- query:{-->
|
||||
<!-- project: row.project.toLowerCase(),-->
|
||||
<!-- noPreLogout: true-->
|
||||
<!-- }-->
|
||||
<!-- });-->
|
||||
<!-- window.open(routeData.href, '_blank');-->
|
||||
<!-- },-->
|
||||
<!-- handleUpdate(index, row) {-->
|
||||
<!-- this.$refs.createDraft.doShow(row);-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
|
||||
<style scoped>
|
||||
<!--<style scoped>-->
|
||||
|
||||
</style>
|
||||
<!--</style>-->
|
||||
|
@ -1,139 +1,108 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="alarm-button">
|
||||
<el-button type="warning" icon="el-icon-message-solid" circle @click="showAlarm" />
|
||||
<div v-if="alarmDetailMessageList.length>0" class="alarm-counter">{{ alarmDetailMessageList.length }}</div>
|
||||
<div>
|
||||
<audio ref="audio" />
|
||||
</div>
|
||||
<!-- <el-dialog
|
||||
v-dialogDrag
|
||||
:modal="false"
|
||||
:visible.sync="showAlarmMessageList"
|
||||
width="900px"
|
||||
title="设备故障!!!"
|
||||
>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
style="width: 100%"
|
||||
@selection-change="handleSelectionChange"
|
||||
@select-all="handleSelectionAll"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="40"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="date"
|
||||
label="时间"
|
||||
width="110"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="故障设备"
|
||||
width="110"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="故障编号"
|
||||
width="90"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="message"
|
||||
label="故障信息"
|
||||
/>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
@click="goToDetail(scope.$index,scope.row)"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
:type="dealAlarmMessage[scope.$index] ? 'success' : 'danger'"
|
||||
@click="handleAlarmMessage(scope.$index,scope.row)"
|
||||
>{{ dealAlarmMessage[scope.$index] ? '故障信息已处理' : '故障信息未处理' }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="tag"
|
||||
label="标签"
|
||||
width="100"
|
||||
:filters="[{ text: '一般故障', value: '一般故障' }, { text: '中等故障', value: '中等故障' }, { text: '重大故障', value: '重大故障' }]"
|
||||
:filter-method="filterTag"
|
||||
filter-placement="bottom-end"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.tag === '一般故障' ? 'warning' : 'danger'"
|
||||
disable-transitions
|
||||
>{{ scope.row.tag }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
title="提示"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
>
|
||||
<span>进行全选操作</span>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
</span>
|
||||
:class="itemsstyle[index]"
|
||||
</el-dialog> -->
|
||||
<div v-if="showAlarmMessageList">
|
||||
<div v-for="(item, index) in alarmDetailMessageList" :key="index">
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
title="设备故障"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="item.show"
|
||||
width="40%"
|
||||
class="yellow"
|
||||
:class="[{'orange':item.color == 'O','red':item.color == 'R'},itemsstyle[index]]"
|
||||
>
|
||||
<div class="alarm-message-detail">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>故障信息</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="goToAlarmDetail">详情</el-button>
|
||||
</div>
|
||||
<div class="text item">
|
||||
时间:{{ item.time }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
级别:{{ item.levelNew }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
设备:{{ item.deviceCodeNew }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
类型:{{ item.typeNew }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
信息:{{ item.descriptionNew }}
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>辅助决策信息</span>
|
||||
</div>
|
||||
<div class="text item">
|
||||
(1)信息报送人员/群组:{{ item.showDecisionMessage.personGroup }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
(2)电话通报:{{ item.showDecisionMessage.telephoneNotified }}
|
||||
</div></el-card>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
title="设备故障"
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="showAlarmImportantMessage.show"
|
||||
width="40%"
|
||||
class="yellow"
|
||||
:class="{'orange':showAlarmImportantMessage.color == 'O','red':showAlarmImportantMessage.color == 'R'}"
|
||||
>
|
||||
<div class="alarm-message-detail">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>故障信息</span>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" @click="goToAlarmDetail">详情</el-button>
|
||||
</div>
|
||||
<div class="text item">
|
||||
时间:{{ showAlarmImportantMessage.time }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
级别:{{ showAlarmImportantMessage.levelNew }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
设备:{{ showAlarmImportantMessage.deviceCodeNew }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
类型:{{ showAlarmImportantMessage.typeNew }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
信息:{{ showAlarmImportantMessage.descriptionNew }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
原因:{{ showAlarmImportantMessage.reason }}
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>辅助决策信息</span>
|
||||
</div>
|
||||
<div class="text item">
|
||||
(1)信息报送人员/群组:{{ showAlarmImportantMessage.showDecisionMessage.personGroup }}
|
||||
</div>
|
||||
<div class="text item">
|
||||
(2)电话通报:{{ showAlarmImportantMessage.showDecisionMessage.telephoneNotified }}
|
||||
</div>
|
||||
<div v-if="showAlarmImportantMessage.color == 'O'" class="text item">
|
||||
(3)PIS信息模版:{{ showAlarmImportantMessage.pisTemplate }}
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
<div class="alarm-message-All">
|
||||
<el-card class="box-card">
|
||||
<el-table
|
||||
:data="alarmDetailMessageListShow"
|
||||
border
|
||||
:cell-style="{'text-align':'center'}"
|
||||
:header-cell-style="{'text-align':'center'}"
|
||||
style="width: 100%"
|
||||
max-height="250"
|
||||
>
|
||||
<el-table-column
|
||||
prop="time"
|
||||
label="时间"
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="levelNew"
|
||||
label="级别"
|
||||
width="70"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="deviceCodeNew"
|
||||
label="设备"
|
||||
width="105"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="typeNew"
|
||||
label="类型"
|
||||
width="80"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="descriptionNew"
|
||||
label="信息"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="reason"
|
||||
label="原因"
|
||||
width="105"
|
||||
/>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="pagination.currentPage"
|
||||
:page-size="2"
|
||||
layout="total, prev, pager, next"
|
||||
:total="pagination.total"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</el-card></div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -145,22 +114,8 @@ export default {
|
||||
name: 'ErrrorMessageBox',
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dealAlarmMessage:[true, false],
|
||||
activeName: '0',
|
||||
showAlarmMessageList:false,
|
||||
tableData: [{
|
||||
date: '2023-04-17',
|
||||
name: '车厢编号10',
|
||||
id: '001',
|
||||
message:'电路信号故障,车辆二次设备无法运行',
|
||||
tag: '一般故障'
|
||||
}, {
|
||||
date: '2023-04-21',
|
||||
name: '车厢编号8',
|
||||
id: '005',
|
||||
message:'新的故障信息',
|
||||
tag: '重大故障'
|
||||
}],
|
||||
decisionMessage:[{
|
||||
personGroup:'主要领导、应急管理部负责人、应急管理室负责人报送,并发党群信息群;故障群/应急群发布。',
|
||||
telephoneNotified:'如故障属于I类信息,分公司值班领导、主要领导、党群工作部、线网管控中心负责人、分管领导、应急管理部负责人、应急管理室负责人。'
|
||||
@ -177,7 +132,14 @@ export default {
|
||||
]),
|
||||
showDecisionMessage:{},
|
||||
alarmDetailMessageList:[],
|
||||
itemsstyle: ['item0', 'item1', 'item2', 'item3', 'item4', 'item5', 'item6', 'item7', 'item8', 'item9']
|
||||
alarmDetailMessageListShow:[],
|
||||
showAlarmImportantMessage:{},
|
||||
alarmReasonMap:[],
|
||||
oldShowAlarmMessage:{},
|
||||
pagination:{
|
||||
total:1,
|
||||
currentPage: 1
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -186,27 +148,17 @@ export default {
|
||||
]),
|
||||
alarmDetailMessage() {
|
||||
return this.$store.state.socket.simulationAlarmInfo;
|
||||
},
|
||||
finishDealAlarmMessage() {
|
||||
return this.dealAlarmMessage.reduce((prev, curr)=> curr === false ? prev + 1 : prev, 0);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
alarmDetailMessage(newValue, oldValue) {
|
||||
if (newValue.length > 0) {
|
||||
if (newValue.length > 0 && newValue[0].handleMethod === 'NCC') {
|
||||
const clone = JSON.parse(JSON.stringify(this.alarmDetailMessage));
|
||||
this.alarmDetailMessageList.push(...clone);
|
||||
let index;
|
||||
this.alarmDetailMessageList.unshift(...clone);
|
||||
this.alarmDetailMessageList.forEach((item, i)=>{
|
||||
this.$set(item, 'show', true);
|
||||
if (new Date(newValue[0].time).getTime() - new Date(item.time).getTime() > 90000) {
|
||||
index = i;
|
||||
}
|
||||
});
|
||||
if (index !== undefined) {
|
||||
this.alarmDetailMessageList.splice(0, index + 1);
|
||||
}
|
||||
if (newValue[0].handleMethod === 'NCC' && this.$store.getters['map/getDeviceByCode'](this.alarmDetailMessageList[0].deviceCode) !== undefined) {
|
||||
if (this.$store.getters['map/getDeviceByCode'](this.alarmDetailMessageList[0].deviceCode) !== undefined) {
|
||||
this.showAlarmPlayAlarmMusic();
|
||||
}
|
||||
}
|
||||
@ -217,24 +169,28 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
playAlarmMusic() {
|
||||
let alarmMusic = new Audio();
|
||||
alarmMusic = require('@/assets/buzzer.mp3');
|
||||
this.$refs.audio.src = alarmMusic;
|
||||
this.$refs.audio.play();
|
||||
},
|
||||
showAlarmPlayAlarmMusic() {
|
||||
if (this.$refs.audio.paused) {
|
||||
this.playAlarmMusic();
|
||||
}
|
||||
this.showAlarm();
|
||||
},
|
||||
playAlarmMusic() {
|
||||
let alarmMusic = new Audio();
|
||||
alarmMusic = require('@/assets/buzzer.mp3');
|
||||
this.$refs.audio.src = alarmMusic;
|
||||
this.$refs.audio.play();
|
||||
},
|
||||
showAlarm() {
|
||||
this.alarmDetailMessageList.forEach((showAlarmMessage)=>{
|
||||
showAlarmMessage.show = true;
|
||||
const station = this.$store.getters['map/getDeviceByCode'](showAlarmMessage.deviceCode);
|
||||
showAlarmMessage.levelNew = this.mapAlarmMessage.get(showAlarmMessage.level);
|
||||
showAlarmMessage.deviceCodeNew = '列车' + station.serviceNumber + station.tripNumber;
|
||||
if (station.tripNumber !== undefined) {
|
||||
showAlarmMessage.deviceCodeNew = '列车' + station.serviceNumber + station.tripNumber;
|
||||
} else {
|
||||
showAlarmMessage.deviceCodeNew = '列车' + showAlarmMessage.deviceCode;
|
||||
}
|
||||
showAlarmMessage.typeNew = this.mapAlarmMessage.get(showAlarmMessage.type);
|
||||
const index = showAlarmMessage.description.indexOf('列车');
|
||||
showAlarmMessage.descriptionNew = showAlarmMessage.description.slice(0, index) + showAlarmMessage.deviceCodeNew + showAlarmMessage.description.substring(index + 7);
|
||||
@ -246,49 +202,27 @@ export default {
|
||||
showAlarmMessage.showDecisionMessage = this.decisionMessage[1];
|
||||
}
|
||||
});
|
||||
const newAlarmMessage = this.alarmDetailMessageList[0];
|
||||
if (this.oldShowAlarmMessage.level == undefined) {
|
||||
this.oldShowAlarmMessage = newAlarmMessage;
|
||||
this.showAlarmImportantMessage = newAlarmMessage;
|
||||
} else if (newAlarmMessage.color == 'O') {
|
||||
this.oldShowAlarmMessage = newAlarmMessage;
|
||||
this.showAlarmImportantMessage = newAlarmMessage;
|
||||
} else if (newAlarmMessage.color == 'Y' && this.oldShowAlarmMessage.color == 'O') {
|
||||
this.showAlarmImportantMessage = this.oldShowAlarmMessage;
|
||||
} else {
|
||||
this.showAlarmImportantMessage = newAlarmMessage;
|
||||
}
|
||||
this.alarmDetailMessageListShow = this.alarmDetailMessageList.slice(0, 2);
|
||||
this.pagination.total = this.alarmDetailMessageList.length;
|
||||
this.showAlarmMessageList = true;
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
if (val.length === this.tableData.length) {
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
},
|
||||
handleSelectionAll(val) {
|
||||
if (val.length > 0) {
|
||||
this.dialogVisible = true;
|
||||
}
|
||||
},
|
||||
handleAlarmMessage(index, row) {
|
||||
this.$confirm('此操作将处理故障信息, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.dealAlarmMessage.splice(index, 1, !this.dealAlarmMessage[index]);
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '处理成功!'
|
||||
});
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消处理'
|
||||
});
|
||||
});
|
||||
},
|
||||
goToDetail(index, row) {
|
||||
/* const routeUrl = this.$router.resolve({
|
||||
path: '/thirdLogin'
|
||||
// query: { id: 96 }
|
||||
});
|
||||
window.open(routeUrl.href, '_blank'); */
|
||||
//
|
||||
|
||||
},
|
||||
filterTag(value, row) {
|
||||
return row.tag === value;
|
||||
},
|
||||
goToAlarmDetail() {
|
||||
},
|
||||
handleCurrentChange(page) {
|
||||
this.pagination.currentPage = page;
|
||||
this.alarmDetailMessageListShow = this.alarmDetailMessageList.slice((page - 1) * 2, page * 2);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -305,24 +239,6 @@ export default {
|
||||
}
|
||||
</style>
|
||||
<style lang="scss" scoped>
|
||||
.alarm-button{
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
bottom: 58%;
|
||||
.alarm-counter{
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
bottom: 62%;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background-color: red;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.alarm-message-detail {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
@ -345,6 +261,12 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
.alarm-message-All{
|
||||
margin-top:10px;
|
||||
.box-card{
|
||||
padding:10px;
|
||||
}
|
||||
}
|
||||
.yellow{
|
||||
/deep/ .el-dialog__body{
|
||||
padding: 0 10px 10px;
|
||||
@ -372,45 +294,4 @@ export default {
|
||||
background-color: red;
|
||||
}
|
||||
}
|
||||
.item0 {
|
||||
top: 0px;
|
||||
z-index: 1501 !important;
|
||||
}
|
||||
.item1 {
|
||||
top:50px;
|
||||
z-index: 1502 !important;
|
||||
}
|
||||
.item2 {
|
||||
top:100px;
|
||||
z-index: 1503 !important;
|
||||
}
|
||||
.item3 {
|
||||
top: 150px;
|
||||
z-index: 1504 !important;
|
||||
}
|
||||
.item4 {
|
||||
top:200px;
|
||||
z-index: 1505 !important;
|
||||
}
|
||||
.item5 {
|
||||
top:250px;
|
||||
z-index: 1506 !important;
|
||||
}
|
||||
.item6 {
|
||||
top:300px;
|
||||
z-index: 1507 !important;
|
||||
}
|
||||
.item7 {
|
||||
top:350px;
|
||||
z-index: 1508 !important;
|
||||
}
|
||||
.item8 {
|
||||
top:400px;
|
||||
z-index: 1509 !important;
|
||||
}
|
||||
.item9 {
|
||||
top:450px;
|
||||
z-index: 1510 !important;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
@ -30,8 +30,8 @@ import TrainingTip from './trainingList/trainingTip';
|
||||
import TrainingPositionTip from './trainingList/trainingPositionTip.vue';
|
||||
import TrainingMenu from './trainingList/trainingMenu';
|
||||
import TrainingDesign from './trainingDesign/designPane.vue';
|
||||
// import ChatBox from './newChat/index.vue';
|
||||
import ChatBox from './chatBox';
|
||||
import ChatBox from './newChat/index.vue';
|
||||
// import ChatBox from './chatBox';
|
||||
import TrainingLeftSlider from './trainingList/trainingLeftSlider';
|
||||
import LineBoard from './lineBoard';
|
||||
import BottomTable from './bottomTable';
|
||||
|
@ -43,6 +43,7 @@
|
||||
|
||||
<script>
|
||||
import { addSimulationMember } from '@/api/jointSimulation';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
export default {
|
||||
name: 'AddMember',
|
||||
props: {
|
||||
@ -78,27 +79,30 @@ export default {
|
||||
'STATION_FACILITATOR',
|
||||
'STATION_WORKER',
|
||||
'DEVICE_MANAGER'
|
||||
],
|
||||
typeList: [
|
||||
{label: '行调', value: 'DISPATCHER'},
|
||||
{label: 'NCC调度', value: 'NCC_DISPATCHER'},
|
||||
{label: '通号', value: 'MAINTAINER'},
|
||||
{label: '车站值班员', value: 'STATION_SUPERVISOR'},
|
||||
{label: '车站助理', value: 'STATION_ASSISTANT'},
|
||||
{label: '车站站长', value: 'STATION_MASTER'},
|
||||
{label: '车站信号员', value: 'STATION_SIGNALER'},
|
||||
{label: '车站客运员', value: 'STATION_PASSENGER'},
|
||||
{label: '车站扳道员', value: 'STATION_SWITCH_MAN'},
|
||||
{label: '车站引导员', value: 'STATION_FACILITATOR'},
|
||||
{label: '车站工务工', value: 'STATION_WORKER'},
|
||||
{label: '设备管理员', value: 'DEVICE_MANAGER'},
|
||||
{label: '车务段段长', value: 'TRAIN_MASTER'}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return '添加仿真角色成员';
|
||||
},
|
||||
simType() {
|
||||
return this.$route.query.simType || 'METRO';
|
||||
},
|
||||
typeList() {
|
||||
const list = [];
|
||||
ConstConfig.ConstSelect.roleTypeList.forEach(item => {
|
||||
if (item.simTypeList.includes(this.simType)) {
|
||||
const obj = {
|
||||
...item
|
||||
};
|
||||
if (item.value == 'STATION_SUPERVISOR' && this.simType == 'RAILWAY') {
|
||||
obj.label = '车站值班员';
|
||||
}
|
||||
list.push(obj);
|
||||
}
|
||||
});
|
||||
return list;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -58,6 +58,7 @@ import eMembers from './e-members';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
import { assignUsersPlayRoles } from '@/api/jointSimulation';
|
||||
import AddMember from './addMember';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
export default {
|
||||
name: 'MembersManage',
|
||||
components: {
|
||||
@ -94,10 +95,13 @@ export default {
|
||||
doorList: [],
|
||||
memberData: {},
|
||||
treeData: [{
|
||||
labelName: '行调',
|
||||
labelName: 'NCC调度',
|
||||
children: []
|
||||
}, {
|
||||
labelName: 'NCC调度',
|
||||
labelName: '信息调度',
|
||||
children: []
|
||||
}, {
|
||||
labelName: '行调',
|
||||
children: []
|
||||
}, {
|
||||
labelName: '车站值班员',
|
||||
@ -156,6 +160,9 @@ export default {
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
simType() {
|
||||
return this.$route.query.simType || 'METRO';
|
||||
},
|
||||
userId() {
|
||||
return this.$store.state.user ? this.$store.state.user.id : '';
|
||||
},
|
||||
@ -178,6 +185,7 @@ export default {
|
||||
this.memberData = this.$store.state.training.memberData;
|
||||
const dispatcherList = [];
|
||||
const nccDispatcherList = [];
|
||||
const occDispatcherList = [];
|
||||
const electricDispatcherList = [];
|
||||
const depotDispatcherList = [];
|
||||
const stationSupervisorList = [];
|
||||
@ -194,27 +202,41 @@ export default {
|
||||
const deviceManagerList = [];
|
||||
const trainMasterList = [];
|
||||
const stationElectricWorkerList = [];
|
||||
const signalBuildingList = [];
|
||||
const shiftManagerList = [];
|
||||
const environmentDispatherList = [];
|
||||
const parentDepartmentList = [];
|
||||
const schedulingList = [];
|
||||
const t = this.simType == 'METRO' ? '行值-' : '值班员-';
|
||||
val.forEach(item => {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
|
||||
switch (item.type) {
|
||||
case 'DISPATCHER':
|
||||
this.memberData[item.id].labelName = '行调' + (item.name || '');
|
||||
dispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'NCC_DISPATCHER':
|
||||
this.memberData[item.id].labelName = 'NCC调度' + (item.name || '');
|
||||
nccDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'OCC_DISPATCHER':
|
||||
this.memberData[item.id].labelName = item.name || '';
|
||||
occDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DISPATCHER':
|
||||
this.memberData[item.id].labelName = '行调' + (item.name || '');
|
||||
dispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'ELECTRIC_DISPATCHER':
|
||||
this.memberData[item.id].labelName = '电力调度' + (item.name || '');
|
||||
this.memberData[item.id].labelName = '工电调度' + (item.name || '');
|
||||
electricDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DEPOT_DISPATCHER':
|
||||
this.memberData[item.id].labelName = '信号楼-' + device.name + (item.name || '');
|
||||
this.memberData[item.id].labelName = '车辆段调度-' + device.name + (item.name || '');
|
||||
depotDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'SIGNAL_BUILDING':
|
||||
this.memberData[item.id].labelName = '信号楼-' + device.name + (item.name || '');
|
||||
signalBuildingList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_SUPERVISOR':
|
||||
this.memberData[item.id].labelName = '值班员-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
this.memberData[item.id].labelName = t + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationSupervisorList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DRIVER':
|
||||
@ -262,103 +284,176 @@ export default {
|
||||
deviceManagerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'TRAIN_MASTER':
|
||||
// device.name;
|
||||
this.memberData[item.id].labelName = '车务段段长-' + (item.name ? `-${item.name }` : '');
|
||||
trainMasterList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'SHIFT_MANAGER':
|
||||
this.memberData[item.id].labelName = '值班主任-' + (item.name ? `-${item.name }` : '');
|
||||
shiftManagerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'ENVIRONMENT_DISPATCHER':
|
||||
this.memberData[item.id].labelName = '环控调度-' + (item.name ? `-${item.name }` : '');
|
||||
environmentDispatherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'PARENT_DEPARTMENT':
|
||||
this.memberData[item.id].labelName = '上级部门' + (item.name ? `-${item.name }` : '');
|
||||
parentDepartmentList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'SCHEDULING':
|
||||
this.memberData[item.id].labelName = '派班员' + (item.name ? `-${item.name }` : '');
|
||||
schedulingList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_ELECTRIC_WORKER':
|
||||
this.memberData[item.id].labelName = '电力工务' + (item.name || '');
|
||||
stationElectricWorkerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
// DEVICE_MANAGER:'设备管理员' deviceManager
|
||||
}
|
||||
});
|
||||
this.treeData = [{
|
||||
labelName: '行调',
|
||||
id: 'dispatcher',
|
||||
children: dispatcherList
|
||||
}, {
|
||||
labelName: 'NCC调度',
|
||||
id: 'nccDispatcher',
|
||||
memberType: 'NCC_DISPATCHER',
|
||||
children: nccDispatcherList
|
||||
}, {
|
||||
labelName: '车站值班员',
|
||||
labelName: '信息调度',
|
||||
id: 'occDispatcher',
|
||||
memberType: 'OCC_DISPATCHER',
|
||||
children: occDispatcherList
|
||||
}, {
|
||||
labelName: '行调',
|
||||
id: 'dispatcher',
|
||||
memberType: 'DISPATCHER',
|
||||
children: dispatcherList
|
||||
}, {
|
||||
labelName: this.simType == 'METRO' ? '行值' : '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
memberType: 'STATION_SUPERVISOR',
|
||||
children: stationSupervisorList
|
||||
}, {
|
||||
labelName: '司机',
|
||||
id: 'driver',
|
||||
memberType: 'DRIVER',
|
||||
children: driverList
|
||||
}, {
|
||||
labelName: '通号',
|
||||
id: 'maintainer',
|
||||
memberType: 'MAINTAINER',
|
||||
children: maintainerList
|
||||
}, {
|
||||
labelName: '车辆段信号楼',
|
||||
labelName: '车辆段调度',
|
||||
id: 'depotDispatcher',
|
||||
memberType: 'DEPOT_DISPATCHER',
|
||||
children: depotDispatcherList
|
||||
}, {
|
||||
labelName: '电力调度',
|
||||
labelName: '车辆段信号楼',
|
||||
id: 'signalBuilding',
|
||||
memberType: 'SIGNAL_BUILDING',
|
||||
children: signalBuildingList
|
||||
}, {
|
||||
labelName: '工电调度',
|
||||
id: 'electricDispatcher',
|
||||
memberType: 'ELECTRIC_DISPATCHER',
|
||||
children: electricDispatcherList
|
||||
}, {
|
||||
labelName: 'CTC操作员',
|
||||
id: 'ctcOperator',
|
||||
memberType: 'RAIL_CTC',
|
||||
children: ctcOperatorList
|
||||
}, {
|
||||
labelName: '车站助理',
|
||||
id: 'stationAssistant',
|
||||
memberType: 'STATION_ASSISTANT',
|
||||
children: stationAssistantList
|
||||
},
|
||||
{
|
||||
labelName: '车站站长',
|
||||
id: 'stationMaster',
|
||||
memberType: 'STATION_MASTER',
|
||||
children: stationMasterList
|
||||
},
|
||||
{
|
||||
labelName: '车站信号员',
|
||||
id: 'stationSignaler',
|
||||
memberType: 'STATION_SIGNALER',
|
||||
children: stationSignalerList
|
||||
},
|
||||
{
|
||||
labelName: '车站客运员',
|
||||
id: 'stationPassenger',
|
||||
memberType: 'STATION_PASSENGER',
|
||||
children: stationPassengerList
|
||||
},
|
||||
{
|
||||
labelName: '车站扳道员',
|
||||
id: 'stationSwitchMan',
|
||||
memberType: 'STATION_SWITCH_MAN',
|
||||
children: stationSwitchManList
|
||||
},
|
||||
{
|
||||
labelName: '车站引导员',
|
||||
id: 'stationFacilitator',
|
||||
memberType: 'STATION_FACILITATOR',
|
||||
children: stationFacilitatorList
|
||||
},
|
||||
{
|
||||
labelName: '车站工务工',
|
||||
id: 'stationWorker',
|
||||
memberType: 'STATION_WORKER',
|
||||
children: stationWorkerList
|
||||
},
|
||||
{
|
||||
labelName: '设备管理员',
|
||||
id: 'deviceManager',
|
||||
memberType: 'DEVICE_MANAGER',
|
||||
children: deviceManagerList
|
||||
},
|
||||
{
|
||||
labelName: '车务段段长 ',
|
||||
id: 'trainMaster',
|
||||
memberType: 'TRAIN_MASTER',
|
||||
children: trainMasterList
|
||||
},
|
||||
{
|
||||
labelName: '值班主任 ',
|
||||
id: 'shiftManager',
|
||||
memberType: 'SHIFT_MANAGER',
|
||||
children: shiftManagerList
|
||||
},
|
||||
{
|
||||
labelName: '环控调度 ',
|
||||
id: 'environmentDispather',
|
||||
memberType: 'ENVIRONMENT_DISPATCHER',
|
||||
children: environmentDispatherList
|
||||
},
|
||||
{
|
||||
labelName: '电力工务 ',
|
||||
id: 'stationElectricWorker',
|
||||
memberType: 'STATION_ELECTRIC_WORKER',
|
||||
children: stationElectricWorkerList
|
||||
},
|
||||
{
|
||||
labelName: '上级部门 ',
|
||||
id: 'parentDepartment',
|
||||
memberType: 'PARENT_DEPARTMENT',
|
||||
children: parentDepartmentList
|
||||
},
|
||||
{
|
||||
labelName: '派班员 ',
|
||||
id: 'scheduling',
|
||||
memberType: 'SCHEDULING',
|
||||
children: schedulingList
|
||||
}
|
||||
];
|
||||
const sType = [];
|
||||
ConstConfig.ConstSelect.roleTypeList.forEach(ii => {
|
||||
if (ii.simTypeList.includes(this.simType)) {
|
||||
sType.push(ii.value);
|
||||
}
|
||||
});
|
||||
this.treeData = this.treeData.filter(ii => {
|
||||
return sType.includes(ii.memberType);
|
||||
});
|
||||
this.$store.dispatch('training/setMemberTreeData', this.treeData);
|
||||
EventBus.$emit('trainTicketMember', [...stationSupervisorList, ...stationAssistantList]);
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tree) {
|
||||
|
@ -1,451 +1,451 @@
|
||||
<template>
|
||||
<div id="elDialog" class="message-board-box">
|
||||
<div class="message-board-title">留言板</div>
|
||||
<div class="message-board-content">
|
||||
<div v-if="postCommentList.length">
|
||||
<template v-for="(item,i) in postCommentList">
|
||||
<div :key="i" class="eachPostComment">
|
||||
<div style="margin-bottom: 10px;display: flex;align-items: center;">
|
||||
<img :src="avatarUrl(item)" class="head_portrait">
|
||||
<div class="MBCcreatorNickName">{{ item.creatorNickName }}</div>
|
||||
<div style="display: inline-block;">{{ item.createTime }}</div>
|
||||
</div>
|
||||
<div style="margin-left: 60px;" v-html="$escapeHTML(`${item.content}`)" />
|
||||
<div style="width: 100%;display:flex;align-items: center;justify-content: flex-end;">
|
||||
<img :src="replyIcon" class="replyIcon" @click="replyLeaveMessage(item.id, i)">
|
||||
<img v-if="userId == item.creatorId || superAdmin" :src="deleteIcon" class="deleteIcon" @click="deleteMessage(item.id)">
|
||||
</div>
|
||||
<div v-if="item.comments && item.comments.total > 0" class="eachComment">
|
||||
<div v-if="moreMessageId == item.id">
|
||||
<template v-for="(elem,j) in allCommentList">
|
||||
<div :key="j" style="font-size: 14px;margin-top: 10px;">
|
||||
<span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>
|
||||
<span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />
|
||||
<span style="margin-right: 10px;">{{ elem.commentTime }}</span>
|
||||
<span class="replyLeaveMessage" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>
|
||||
<span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else>
|
||||
<template v-for="(elem,j) in item.comments.list">
|
||||
<div :key="j" style="font-size: 14px;margin-top: 18px;">
|
||||
<span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>
|
||||
<span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />
|
||||
<span style="margin-right: 10px;">{{ elem.commentTime }}</span>
|
||||
<span class="replyLeaveMessage" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>
|
||||
<span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-if="item.comments.total > 3 && moreMessageId != item.id" style="margin-top: 10px;">
|
||||
<span class="view_more" @click="viewMoreComment(item)">{{ `共${item.comments.total}条回复,点击查看更多>>` }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="replyMessageId == item.id" style="width: 80%;margin-left: 10%;text-align: center;">
|
||||
<quill-editor
|
||||
:ref="'answerInput' + item.id"
|
||||
v-model="commentContent"
|
||||
style="width: 80%;margin-left: 10%;margin-top: 10px;"
|
||||
class-name="answer_input"
|
||||
:margin-bottom="20"
|
||||
editor-type="onlyEmoji"
|
||||
:no-handle-p="true"
|
||||
:height="100"
|
||||
:placeholder="replyUserName"
|
||||
/>
|
||||
<div>
|
||||
<el-button type="danger" size="small" @click="commentMessage">回复</el-button>
|
||||
<el-button size="small" @click="cancelComment">取消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div v-else class="empty-text">
|
||||
<span>暂无留言</span>
|
||||
</div>
|
||||
<div style="width: 100%;text-align: center;">
|
||||
<el-pagination
|
||||
:current-page.sync="pageNum"
|
||||
:page-size="pageSize"
|
||||
layout="total, prev, pager, next,jumper"
|
||||
:total="total"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<quill-editor ref="quillEditor" v-model="content" style="width: 80%;margin-left: 10%;" :margin-bottom="20" editor-type="imgEmoji" :no-handle-p="true" />
|
||||
<span id="boardBottom" class="dialog-footer">
|
||||
<el-button @click="handleClear">清空</el-button>
|
||||
<el-button type="danger" @click="commitComment">留言</el-button>
|
||||
</span>
|
||||
<el-button size="mini" type="danger" class="goSlide" @click="goSlide">我要留言</el-button>
|
||||
<div v-show="imgShow" class="popUpImgView" @click="handelCloseImg">
|
||||
<img id="targetImg" src="" class="popUpImg">
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<!--<template>-->
|
||||
<!-- <div id="elDialog" class="message-board-box">-->
|
||||
<!-- <div class="message-board-title">留言板</div>-->
|
||||
<!-- <div class="message-board-content">-->
|
||||
<!-- <div v-if="postCommentList.length">-->
|
||||
<!-- <template v-for="(item,i) in postCommentList">-->
|
||||
<!-- <div :key="i" class="eachPostComment">-->
|
||||
<!-- <div style="margin-bottom: 10px;display: flex;align-items: center;">-->
|
||||
<!-- <img :src="avatarUrl(item)" class="head_portrait">-->
|
||||
<!-- <div class="MBCcreatorNickName">{{ item.creatorNickName }}</div>-->
|
||||
<!-- <div style="display: inline-block;">{{ item.createTime }}</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div style="margin-left: 60px;" v-html="$escapeHTML(`${item.content}`)" />-->
|
||||
<!-- <div style="width: 100%;display:flex;align-items: center;justify-content: flex-end;">-->
|
||||
<!-- <img :src="replyIcon" class="replyIcon" @click="replyLeaveMessage(item.id, i)">-->
|
||||
<!-- <img v-if="userId == item.creatorId || superAdmin" :src="deleteIcon" class="deleteIcon" @click="deleteMessage(item.id)">-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="item.comments && item.comments.total > 0" class="eachComment">-->
|
||||
<!-- <div v-if="moreMessageId == item.id">-->
|
||||
<!-- <template v-for="(elem,j) in allCommentList">-->
|
||||
<!-- <div :key="j" style="font-size: 14px;margin-top: 10px;">-->
|
||||
<!-- <span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>-->
|
||||
<!-- <span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />-->
|
||||
<!-- <span style="margin-right: 10px;">{{ elem.commentTime }}</span>-->
|
||||
<!-- <span class="replyLeaveMessage" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>-->
|
||||
<!-- <span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-else>-->
|
||||
<!-- <template v-for="(elem,j) in item.comments.list">-->
|
||||
<!-- <div :key="j" style="font-size: 14px;margin-top: 18px;">-->
|
||||
<!-- <span style="margin-right: 5px;">{{ computedCommentName(elem) }}</span>-->
|
||||
<!-- <span style="margin-right: 15px;" v-html="$escapeHTML(`${elem.content}`)" />-->
|
||||
<!-- <span style="margin-right: 10px;">{{ elem.commentTime }}</span>-->
|
||||
<!-- <span class="replyLeaveMessage" @click="replyLeaveMessage(item.id, i,elem.id, elem.userNickname)">回复</span>-->
|
||||
<!-- <span v-if="userId == elem.userId || superAdmin" style="color:#409EFF;cursor: pointer;" type="text" @click="deleteComment(item.id, i, elem.id)">删除</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="item.comments.total > 3 && moreMessageId != item.id" style="margin-top: 10px;">-->
|
||||
<!-- <span class="view_more" @click="viewMoreComment(item)">{{ `共${item.comments.total}条回复,点击查看更多>>` }}</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-if="replyMessageId == item.id" style="width: 80%;margin-left: 10%;text-align: center;">-->
|
||||
<!-- <quill-editor-->
|
||||
<!-- :ref="'answerInput' + item.id"-->
|
||||
<!-- v-model="commentContent"-->
|
||||
<!-- style="width: 80%;margin-left: 10%;margin-top: 10px;"-->
|
||||
<!-- class-name="answer_input"-->
|
||||
<!-- :margin-bottom="20"-->
|
||||
<!-- editor-type="onlyEmoji"-->
|
||||
<!-- :no-handle-p="true"-->
|
||||
<!-- :height="100"-->
|
||||
<!-- :placeholder="replyUserName"-->
|
||||
<!-- />-->
|
||||
<!-- <div>-->
|
||||
<!-- <el-button type="danger" size="small" @click="commentMessage">回复</el-button>-->
|
||||
<!-- <el-button size="small" @click="cancelComment">取消</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </template>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-else class="empty-text">-->
|
||||
<!-- <span>暂无留言</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div style="width: 100%;text-align: center;">-->
|
||||
<!-- <el-pagination-->
|
||||
<!-- :current-page.sync="pageNum"-->
|
||||
<!-- :page-size="pageSize"-->
|
||||
<!-- layout="total, prev, pager, next,jumper"-->
|
||||
<!-- :total="total"-->
|
||||
<!-- @current-change="handleCurrentChange"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <quill-editor ref="quillEditor" v-model="content" style="width: 80%;margin-left: 10%;" :margin-bottom="20" editor-type="imgEmoji" :no-handle-p="true" />-->
|
||||
<!-- <span id="boardBottom" class="dialog-footer">-->
|
||||
<!-- <el-button @click="handleClear">清空</el-button>-->
|
||||
<!-- <el-button type="danger" @click="commitComment">留言</el-button>-->
|
||||
<!-- </span>-->
|
||||
<!-- <el-button size="mini" type="danger" class="goSlide" @click="goSlide">我要留言</el-button>-->
|
||||
<!-- <div v-show="imgShow" class="popUpImgView" @click="handelCloseImg">-->
|
||||
<!-- <img id="targetImg" src="" class="popUpImg">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import { answerPost, queryMessagePagingByProjectCode, deleteMessageByAdmin, deleteMessageBySelf, commentLevelMessage, commentComents,
|
||||
queryMessageCommentList, deleteCommentByAdmin, deleteCommentBySelf, getPostByProjectCode } from '@/api/learn';
|
||||
import lick_icon from '@/assets/like.png';
|
||||
import unlike_icon from '@/assets/unlike.png';
|
||||
import reply_icon from '@/assets/reply.png';
|
||||
import delete_icon from '@/assets/delete.png';
|
||||
import { superAdmin } from '@/router/index';
|
||||
import { ProjectCode } from '@/scripts/ProjectConfig';
|
||||
import QuillEditor from '@/components/QuillEditor/index';
|
||||
export default {
|
||||
name: 'MessageBoard',
|
||||
components: {
|
||||
QuillEditor
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content: '',
|
||||
postCommentList: [],
|
||||
pageSize: 10,
|
||||
pageNum: 0,
|
||||
total: 0,
|
||||
imgShow: false,
|
||||
lickIcon: lick_icon,
|
||||
unlikeIcon: unlike_icon,
|
||||
replyIcon: reply_icon,
|
||||
deleteIcon: delete_icon,
|
||||
replyMessageId: '',
|
||||
commentContent: '',
|
||||
replyCommentId: '',
|
||||
replyMessageIndex: '',
|
||||
allCommentList: [],
|
||||
moreMessageId: '',
|
||||
replyUserName: '',
|
||||
postId: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
userId() {
|
||||
return this.$store.state.user.id;
|
||||
},
|
||||
superAdmin() {
|
||||
return this.$store.state.user.roles.includes(superAdmin);
|
||||
},
|
||||
projectCode() {
|
||||
const project = this.$route.query.project;
|
||||
return ProjectCode[project];
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const that = this;
|
||||
window.handleZoomImg = function () {
|
||||
that.imgShow = true;
|
||||
document.getElementById('targetImg').src = event.target.currentSrc;
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
getPostByProjectCode(this.projectCode).then(resp => {
|
||||
this.postId = resp.data.id;
|
||||
});
|
||||
this.handleCurrentChange();
|
||||
},
|
||||
methods: {
|
||||
commitComment() {
|
||||
const images = this.content.match(/<img/g);
|
||||
const answerContent = this.handleEmojiContent(this.content);
|
||||
if (images && images.length > 3) {
|
||||
this.$message.error('留言内容使用图片应小于三张!');
|
||||
return;
|
||||
}
|
||||
if (answerContent.length > 1000) {
|
||||
this.$message.error('留言内容超出最大长度!');
|
||||
return;
|
||||
}
|
||||
if (!answerContent) {
|
||||
this.$message.error('留言内容不能为空!');
|
||||
return;
|
||||
}
|
||||
answerPost({postId: this.postId, content: answerContent}).then(resp => {
|
||||
this.pageNum = 1;
|
||||
this.handleCurrentChange();
|
||||
this.content = '';
|
||||
}).catch(error => {
|
||||
this.$message.error('留言失败 !');
|
||||
});
|
||||
},
|
||||
handleCurrentChange() {
|
||||
queryMessagePagingByProjectCode(this.projectCode, {pageSize: this.pageSize, pageNum: this.pageNum}).then(resp => {
|
||||
this.postCommentList = [];
|
||||
(resp.data.list || []).forEach(item => {
|
||||
item.content = this.replaceEmoji(item.content);
|
||||
item.comments && item.comments.list && item.comments.list.forEach(elem => {
|
||||
elem.content = this.replaceEmoji(elem.content);
|
||||
});
|
||||
this.postCommentList.push(item);
|
||||
});
|
||||
this.total = resp.data.total;
|
||||
});
|
||||
},
|
||||
replaceEmoji(content) {
|
||||
let value = content.replace(/<img/g, '<img style="width: 100px;height: auto;cursor: zoom-in;" onclick="handleZoomImg()"');
|
||||
const list = value.match(/<<<([^>]*)>>>/g);
|
||||
(list || []).forEach(elem => {
|
||||
const targetValue = elem.substring(3, elem.length - 3);
|
||||
value = value.replace(elem, `<span class="ql-emojiblot" data-name="${targetValue}"><span contenteditable="false"><span class="ap ap-${targetValue}">ss</span></span></span>`);
|
||||
});
|
||||
return value;
|
||||
},
|
||||
goSlide() {
|
||||
const bottom = document.getElementById('boardBottom');
|
||||
const element = document.getElementById('elDialog').childNodes[0];
|
||||
element.scrollTop = bottom.offsetTop;
|
||||
this.$refs.quillEditor.getFocus();
|
||||
},
|
||||
avatarUrl(val) {
|
||||
if (val && val.creatorAvatarPath) {
|
||||
return this.$store.state.user.ossUrl + val.creatorAvatarPath;
|
||||
} else {
|
||||
return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png';
|
||||
}
|
||||
},
|
||||
<!--<script>-->
|
||||
<!--import { answerPost, queryMessagePagingByProjectCode, deleteMessageByAdmin, deleteMessageBySelf, commentLevelMessage, commentComents,-->
|
||||
<!-- queryMessageCommentList, deleteCommentByAdmin, deleteCommentBySelf, getPostByProjectCode } from '@/api/learn';-->
|
||||
<!--import lick_icon from '@/assets/like.png';-->
|
||||
<!--import unlike_icon from '@/assets/unlike.png';-->
|
||||
<!--import reply_icon from '@/assets/reply.png';-->
|
||||
<!--import delete_icon from '@/assets/delete.png';-->
|
||||
<!--import { superAdmin } from '@/router/index';-->
|
||||
<!--import { ProjectCode } from '@/scripts/ProjectConfig';-->
|
||||
<!--import QuillEditor from '@/components/QuillEditor/index';-->
|
||||
<!--export default {-->
|
||||
<!-- name: 'MessageBoard',-->
|
||||
<!-- components: {-->
|
||||
<!-- QuillEditor-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- content: '',-->
|
||||
<!-- postCommentList: [],-->
|
||||
<!-- pageSize: 10,-->
|
||||
<!-- pageNum: 0,-->
|
||||
<!-- total: 0,-->
|
||||
<!-- imgShow: false,-->
|
||||
<!-- lickIcon: lick_icon,-->
|
||||
<!-- unlikeIcon: unlike_icon,-->
|
||||
<!-- replyIcon: reply_icon,-->
|
||||
<!-- deleteIcon: delete_icon,-->
|
||||
<!-- replyMessageId: '',-->
|
||||
<!-- commentContent: '',-->
|
||||
<!-- replyCommentId: '',-->
|
||||
<!-- replyMessageIndex: '',-->
|
||||
<!-- allCommentList: [],-->
|
||||
<!-- moreMessageId: '',-->
|
||||
<!-- replyUserName: '',-->
|
||||
<!-- postId: ''-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- userId() {-->
|
||||
<!-- return this.$store.state.user.id;-->
|
||||
<!-- },-->
|
||||
<!-- superAdmin() {-->
|
||||
<!-- return this.$store.state.user.roles.includes(superAdmin);-->
|
||||
<!-- },-->
|
||||
<!-- projectCode() {-->
|
||||
<!-- const project = this.$route.query.project;-->
|
||||
<!-- return ProjectCode[project];-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- created() {-->
|
||||
<!-- const that = this;-->
|
||||
<!-- window.handleZoomImg = function () {-->
|
||||
<!-- that.imgShow = true;-->
|
||||
<!-- document.getElementById('targetImg').src = event.target.currentSrc;-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- mounted() {-->
|
||||
<!-- getPostByProjectCode(this.projectCode).then(resp => {-->
|
||||
<!-- this.postId = resp.data.id;-->
|
||||
<!-- });-->
|
||||
<!-- this.handleCurrentChange();-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- commitComment() {-->
|
||||
<!-- const images = this.content.match(/<img/g);-->
|
||||
<!-- const answerContent = this.handleEmojiContent(this.content);-->
|
||||
<!-- if (images && images.length > 3) {-->
|
||||
<!-- this.$message.error('留言内容使用图片应小于三张!');-->
|
||||
<!-- return;-->
|
||||
<!-- }-->
|
||||
<!-- if (answerContent.length > 1000) {-->
|
||||
<!-- this.$message.error('留言内容超出最大长度!');-->
|
||||
<!-- return;-->
|
||||
<!-- }-->
|
||||
<!-- if (!answerContent) {-->
|
||||
<!-- this.$message.error('留言内容不能为空!');-->
|
||||
<!-- return;-->
|
||||
<!-- }-->
|
||||
<!-- answerPost({postId: this.postId, content: answerContent}).then(resp => {-->
|
||||
<!-- this.pageNum = 1;-->
|
||||
<!-- this.handleCurrentChange();-->
|
||||
<!-- this.content = '';-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('留言失败 !');-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- handleCurrentChange() {-->
|
||||
<!-- queryMessagePagingByProjectCode(this.projectCode, {pageSize: this.pageSize, pageNum: this.pageNum}).then(resp => {-->
|
||||
<!-- this.postCommentList = [];-->
|
||||
<!-- (resp.data.list || []).forEach(item => {-->
|
||||
<!-- item.content = this.replaceEmoji(item.content);-->
|
||||
<!-- item.comments && item.comments.list && item.comments.list.forEach(elem => {-->
|
||||
<!-- elem.content = this.replaceEmoji(elem.content);-->
|
||||
<!-- });-->
|
||||
<!-- this.postCommentList.push(item);-->
|
||||
<!-- });-->
|
||||
<!-- this.total = resp.data.total;-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- replaceEmoji(content) {-->
|
||||
<!-- let value = content.replace(/<img/g, '<img style="width: 100px;height: auto;cursor: zoom-in;" onclick="handleZoomImg()"');-->
|
||||
<!-- const list = value.match(/<<<([^>]*)>>>/g);-->
|
||||
<!-- (list || []).forEach(elem => {-->
|
||||
<!-- const targetValue = elem.substring(3, elem.length - 3);-->
|
||||
<!-- value = value.replace(elem, `<span class="ql-emojiblot" data-name="${targetValue}"><span contenteditable="false"><span class="ap ap-${targetValue}">ss</span></span></span>`);-->
|
||||
<!-- });-->
|
||||
<!-- return value;-->
|
||||
<!-- },-->
|
||||
<!-- goSlide() {-->
|
||||
<!-- const bottom = document.getElementById('boardBottom');-->
|
||||
<!-- const element = document.getElementById('elDialog').childNodes[0];-->
|
||||
<!-- element.scrollTop = bottom.offsetTop;-->
|
||||
<!-- this.$refs.quillEditor.getFocus();-->
|
||||
<!-- },-->
|
||||
<!-- avatarUrl(val) {-->
|
||||
<!-- if (val && val.creatorAvatarPath) {-->
|
||||
<!-- return this.$store.state.user.ossUrl + val.creatorAvatarPath;-->
|
||||
<!-- } else {-->
|
||||
<!-- return 'https://joylink.club/oss/wxmicro_assistant/userhead/defaultuser.png';-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
|
||||
handleClear() {
|
||||
this.content = '';
|
||||
},
|
||||
handelCloseImg() {
|
||||
this.imgShow = false;
|
||||
document.getElementById('targetImg').src = '';
|
||||
},
|
||||
replyLeaveMessage(messageId, messageIndex, commentId, userNickname) {
|
||||
this.cancelComment();
|
||||
this.replyMessageId = messageId;
|
||||
this.replyCommentId = commentId;
|
||||
this.replyMessageIndex = messageIndex;
|
||||
if (commentId) {
|
||||
this.replyUserName = '@' + userNickname + ' ';
|
||||
this.commentContent = '';
|
||||
}
|
||||
this.$nextTick(()=>{
|
||||
this.$refs['answerInput' + messageId][0].getFocus();
|
||||
});
|
||||
},
|
||||
cancelComment() {
|
||||
this.replyMessageId = '';
|
||||
this.commentContent = '';
|
||||
this.replyCommentId = '';
|
||||
this.replyMessageIndex = '';
|
||||
this.replyUserName = '';
|
||||
},
|
||||
commentMessage() {
|
||||
const contentValue = this.handleEmojiContent(this.commentContent);
|
||||
if (contentValue.length > 300) {
|
||||
this.$message.error('回复内容超出最大长度!');
|
||||
return;
|
||||
}
|
||||
if (this.replyCommentId) {
|
||||
commentComents(this.replyMessageId, this.replyCommentId, {content:contentValue}).then(resp => {
|
||||
this.getCommentList(this.replyMessageId, this.replyMessageIndex);
|
||||
this.cancelComment();
|
||||
}).catch(error => {
|
||||
this.$message.error('评论回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
} else {
|
||||
commentLevelMessage(this.replyMessageId, {content:contentValue}).then(resp => {
|
||||
this.getCommentList(this.replyMessageId, this.replyMessageIndex);
|
||||
this.cancelComment();
|
||||
}).catch(error => {
|
||||
this.$message.error('评论回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
getCommentList(messageId, messageIndex) {
|
||||
queryMessageCommentList(messageId).then(resp => {
|
||||
const replaceValue = [];
|
||||
resp.data && resp.data.forEach(item => {
|
||||
item.content = this.replaceEmoji(item.content);
|
||||
replaceValue.push(item);
|
||||
});
|
||||
if (this.moreMessageId == messageId) {
|
||||
this.allCommentList = replaceValue;
|
||||
}
|
||||
if (replaceValue.length > 3) {
|
||||
this.postCommentList[messageIndex].comments.list = replaceValue.slice(0, 3);
|
||||
this.postCommentList[messageIndex].comments.total = replaceValue.length;
|
||||
} else {
|
||||
this.postCommentList[messageIndex].comments.list = replaceValue;
|
||||
this.postCommentList[messageIndex].comments.total = replaceValue.length;
|
||||
}
|
||||
}).catch(error => {
|
||||
this.$message.error('更新回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
computedCommentName(elem) {
|
||||
if (elem.replyUserNickName) {
|
||||
return `${elem.userNickname} 回复@ ${elem.replyUserNickName}:`;
|
||||
} else {
|
||||
return elem.userNickname + ':';
|
||||
}
|
||||
},
|
||||
deleteMessage(messageId) {
|
||||
if (this.superAdmin) {
|
||||
deleteMessageByAdmin(messageId).then(resp => {
|
||||
// this.$message.success('删除留言成功!');
|
||||
this.handleCurrentChange();
|
||||
}).catch(error => {
|
||||
this.$message.error('删除留言失败!');
|
||||
console.error(error);
|
||||
});
|
||||
} else {
|
||||
deleteMessageBySelf(messageId).then(resp => {
|
||||
// this.$message.success('删除留言成功!');
|
||||
this.handleCurrentChange();
|
||||
}).catch(error => {
|
||||
this.$message.error('删除留言失败!');
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
deleteComment(messageId, messageIndex, commentId) {
|
||||
if (this.superAdmin) {
|
||||
deleteCommentByAdmin(commentId).then(resp => {
|
||||
this.getCommentList(messageId, messageIndex);
|
||||
}).catch(error => {
|
||||
this.$message.error('删除回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
} else {
|
||||
deleteCommentBySelf(commentId).then(resp => {
|
||||
this.getCommentList(messageId, messageIndex);
|
||||
}).catch(error => {
|
||||
this.$message.error('删除回复失败!');
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
viewMoreComment(data) {
|
||||
queryMessageCommentList(data.id).then(resp => {
|
||||
this.allCommentList = [];
|
||||
resp.data && resp.data.forEach(item => {
|
||||
item.content = this.replaceEmoji(item.content);
|
||||
this.allCommentList.push(item);
|
||||
});
|
||||
this.moreMessageId = data.id;
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
handleEmojiContent(content) {
|
||||
const list = content.match(/<span class="ql-emojiblot" data-name="(\S*)"><span contenteditable="false"><span class="ap ap-(\S*)<\/span><\/span><\/span>/g);
|
||||
(list || []).forEach(item => {
|
||||
let targetValue = item.split(' ')[2];
|
||||
targetValue = targetValue.substring(11, targetValue.length - 8);
|
||||
content = content.replace(item, '<<<' + targetValue + '>>>');
|
||||
});
|
||||
return content;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<!-- handleClear() {-->
|
||||
<!-- this.content = '';-->
|
||||
<!-- },-->
|
||||
<!-- handelCloseImg() {-->
|
||||
<!-- this.imgShow = false;-->
|
||||
<!-- document.getElementById('targetImg').src = '';-->
|
||||
<!-- },-->
|
||||
<!-- replyLeaveMessage(messageId, messageIndex, commentId, userNickname) {-->
|
||||
<!-- this.cancelComment();-->
|
||||
<!-- this.replyMessageId = messageId;-->
|
||||
<!-- this.replyCommentId = commentId;-->
|
||||
<!-- this.replyMessageIndex = messageIndex;-->
|
||||
<!-- if (commentId) {-->
|
||||
<!-- this.replyUserName = '@' + userNickname + ' ';-->
|
||||
<!-- this.commentContent = '';-->
|
||||
<!-- }-->
|
||||
<!-- this.$nextTick(()=>{-->
|
||||
<!-- this.$refs['answerInput' + messageId][0].getFocus();-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- cancelComment() {-->
|
||||
<!-- this.replyMessageId = '';-->
|
||||
<!-- this.commentContent = '';-->
|
||||
<!-- this.replyCommentId = '';-->
|
||||
<!-- this.replyMessageIndex = '';-->
|
||||
<!-- this.replyUserName = '';-->
|
||||
<!-- },-->
|
||||
<!-- commentMessage() {-->
|
||||
<!-- const contentValue = this.handleEmojiContent(this.commentContent);-->
|
||||
<!-- if (contentValue.length > 300) {-->
|
||||
<!-- this.$message.error('回复内容超出最大长度!');-->
|
||||
<!-- return;-->
|
||||
<!-- }-->
|
||||
<!-- if (this.replyCommentId) {-->
|
||||
<!-- commentComents(this.replyMessageId, this.replyCommentId, {content:contentValue}).then(resp => {-->
|
||||
<!-- this.getCommentList(this.replyMessageId, this.replyMessageIndex);-->
|
||||
<!-- this.cancelComment();-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('评论回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- } else {-->
|
||||
<!-- commentLevelMessage(this.replyMessageId, {content:contentValue}).then(resp => {-->
|
||||
<!-- this.getCommentList(this.replyMessageId, this.replyMessageIndex);-->
|
||||
<!-- this.cancelComment();-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('评论回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- getCommentList(messageId, messageIndex) {-->
|
||||
<!-- queryMessageCommentList(messageId).then(resp => {-->
|
||||
<!-- const replaceValue = [];-->
|
||||
<!-- resp.data && resp.data.forEach(item => {-->
|
||||
<!-- item.content = this.replaceEmoji(item.content);-->
|
||||
<!-- replaceValue.push(item);-->
|
||||
<!-- });-->
|
||||
<!-- if (this.moreMessageId == messageId) {-->
|
||||
<!-- this.allCommentList = replaceValue;-->
|
||||
<!-- }-->
|
||||
<!-- if (replaceValue.length > 3) {-->
|
||||
<!-- this.postCommentList[messageIndex].comments.list = replaceValue.slice(0, 3);-->
|
||||
<!-- this.postCommentList[messageIndex].comments.total = replaceValue.length;-->
|
||||
<!-- } else {-->
|
||||
<!-- this.postCommentList[messageIndex].comments.list = replaceValue;-->
|
||||
<!-- this.postCommentList[messageIndex].comments.total = replaceValue.length;-->
|
||||
<!-- }-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('更新回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- computedCommentName(elem) {-->
|
||||
<!-- if (elem.replyUserNickName) {-->
|
||||
<!-- return `${elem.userNickname} 回复@ ${elem.replyUserNickName}:`;-->
|
||||
<!-- } else {-->
|
||||
<!-- return elem.userNickname + ':';-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- deleteMessage(messageId) {-->
|
||||
<!-- if (this.superAdmin) {-->
|
||||
<!-- deleteMessageByAdmin(messageId).then(resp => {-->
|
||||
<!-- // this.$message.success('删除留言成功!');-->
|
||||
<!-- this.handleCurrentChange();-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('删除留言失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- } else {-->
|
||||
<!-- deleteMessageBySelf(messageId).then(resp => {-->
|
||||
<!-- // this.$message.success('删除留言成功!');-->
|
||||
<!-- this.handleCurrentChange();-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('删除留言失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- deleteComment(messageId, messageIndex, commentId) {-->
|
||||
<!-- if (this.superAdmin) {-->
|
||||
<!-- deleteCommentByAdmin(commentId).then(resp => {-->
|
||||
<!-- this.getCommentList(messageId, messageIndex);-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('删除回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- } else {-->
|
||||
<!-- deleteCommentBySelf(commentId).then(resp => {-->
|
||||
<!-- this.getCommentList(messageId, messageIndex);-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error('删除回复失败!');-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- viewMoreComment(data) {-->
|
||||
<!-- queryMessageCommentList(data.id).then(resp => {-->
|
||||
<!-- this.allCommentList = [];-->
|
||||
<!-- resp.data && resp.data.forEach(item => {-->
|
||||
<!-- item.content = this.replaceEmoji(item.content);-->
|
||||
<!-- this.allCommentList.push(item);-->
|
||||
<!-- });-->
|
||||
<!-- this.moreMessageId = data.id;-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- console.error(error);-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- handleEmojiContent(content) {-->
|
||||
<!-- const list = content.match(/<span class="ql-emojiblot" data-name="(\S*)"><span contenteditable="false"><span class="ap ap-(\S*)<\/span><\/span><\/span>/g);-->
|
||||
<!-- (list || []).forEach(item => {-->
|
||||
<!-- let targetValue = item.split(' ')[2];-->
|
||||
<!-- targetValue = targetValue.substring(11, targetValue.length - 8);-->
|
||||
<!-- content = content.replace(item, '<<<' + targetValue + '>>>');-->
|
||||
<!-- });-->
|
||||
<!-- return content;-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dialog-footer{
|
||||
margin: 0 auto;
|
||||
padding: 10px 0 30px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.empty-text{
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
font-size: 18px;
|
||||
color: #ccc;
|
||||
}
|
||||
.head_portrait{
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 25px;
|
||||
}
|
||||
.view_more {
|
||||
cursor: pointer;
|
||||
}
|
||||
.view_more:hover {
|
||||
cursor: pointer;
|
||||
color: #409EFF;
|
||||
}
|
||||
.img-box{
|
||||
width: 100px;
|
||||
height: auto;
|
||||
}
|
||||
.message-board-box{
|
||||
width: 100%;
|
||||
background-image:url('../../../assets/bg_board.jpg');
|
||||
background-size: 100% 100%;
|
||||
min-height: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 18;
|
||||
}
|
||||
/deep/.ql-container{
|
||||
height: 80%;
|
||||
}
|
||||
.message-board-title{
|
||||
font-size: 30px;
|
||||
color: #F00;
|
||||
font-family: 'fangsong';
|
||||
font-weight: bolder;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 80px;
|
||||
line-height: 80px;
|
||||
}
|
||||
.message-board-content{
|
||||
width: 80%;
|
||||
margin-left: 10%;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
background-color: rgba(255,255,255,0);
|
||||
border: 1px solid #ebeef5;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
||||
}
|
||||
.eachPostComment{
|
||||
border: 1px solid #C0C0C0;
|
||||
border-radius: 5px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 2px 2px 3px #808080;
|
||||
padding: 10px 20px;
|
||||
background-color: #fff
|
||||
}
|
||||
.eachComment{
|
||||
background: #F5F5F5;
|
||||
margin-top: 10px;
|
||||
width: calc(100% - 120px);
|
||||
margin-left: 60px;
|
||||
border-radius: 5px;
|
||||
padding: 1px 10px 10px;
|
||||
}
|
||||
.replyLeaveMessage{color:#409EFF;cursor: pointer;margin-right: 10px;}
|
||||
.MBCcreatorNickName{display: inline-block;margin-right: 20px;margin-left:10px;font-size: 18px;color: #000;}
|
||||
.replyIcon{width: 16px;height: auto;margin-right: 30px;cursor: pointer;}
|
||||
.deleteIcon{width: 16px;height: auto;cursor:pointer;}
|
||||
.goSlide{position: fixed; left: 91%;top: 80px;width: 90px;}
|
||||
.popUpImgView{position: fixed;width: 100%;height: 100%;left: 0;top: 0;background: rgba(0,0,0,0.5);cursor: zoom-out;}
|
||||
.popUpImg{position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);min-width: 500px;max-height: 80%;height: auto;}
|
||||
</style>
|
||||
<style>
|
||||
.ql-size-small {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
.ql-size-large{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.ql-size-huge{
|
||||
font-size: 2.5em;
|
||||
}
|
||||
</style>
|
||||
<!--<style lang="scss" scoped>-->
|
||||
<!-- .dialog-footer{-->
|
||||
<!-- margin: 0 auto;-->
|
||||
<!-- padding: 10px 0 30px;-->
|
||||
<!-- display: flex;-->
|
||||
<!-- justify-content: center;-->
|
||||
<!-- }-->
|
||||
<!-- .empty-text{-->
|
||||
<!-- text-align: center;-->
|
||||
<!-- width: 100%;-->
|
||||
<!-- height: 50px;-->
|
||||
<!-- line-height: 50px;-->
|
||||
<!-- font-size: 18px;-->
|
||||
<!-- color: #ccc;-->
|
||||
<!-- }-->
|
||||
<!-- .head_portrait{-->
|
||||
<!-- width: 50px;-->
|
||||
<!-- height: 50px;-->
|
||||
<!-- border-radius: 25px;-->
|
||||
<!-- }-->
|
||||
<!-- .view_more {-->
|
||||
<!-- cursor: pointer;-->
|
||||
<!-- }-->
|
||||
<!-- .view_more:hover {-->
|
||||
<!-- cursor: pointer;-->
|
||||
<!-- color: #409EFF;-->
|
||||
<!-- }-->
|
||||
<!-- .img-box{-->
|
||||
<!-- width: 100px;-->
|
||||
<!-- height: auto;-->
|
||||
<!-- }-->
|
||||
<!-- .message-board-box{-->
|
||||
<!-- width: 100%;-->
|
||||
<!-- background-image:url('../../../assets/bg_board.jpg');-->
|
||||
<!-- background-size: 100% 100%;-->
|
||||
<!-- min-height: 100%;-->
|
||||
<!-- position: absolute;-->
|
||||
<!-- left: 0;-->
|
||||
<!-- top: 0;-->
|
||||
<!-- z-index: 18;-->
|
||||
<!-- }-->
|
||||
<!-- /deep/.ql-container{-->
|
||||
<!-- height: 80%;-->
|
||||
<!-- }-->
|
||||
<!-- .message-board-title{-->
|
||||
<!-- font-size: 30px;-->
|
||||
<!-- color: #F00;-->
|
||||
<!-- font-family: 'fangsong';-->
|
||||
<!-- font-weight: bolder;-->
|
||||
<!-- width: 100%;-->
|
||||
<!-- text-align: center;-->
|
||||
<!-- height: 80px;-->
|
||||
<!-- line-height: 80px;-->
|
||||
<!-- }-->
|
||||
<!-- .message-board-content{-->
|
||||
<!-- width: 80%;-->
|
||||
<!-- margin-left: 10%;-->
|
||||
<!-- padding: 20px;-->
|
||||
<!-- margin-bottom: 20px;-->
|
||||
<!-- background-color: rgba(255,255,255,0);-->
|
||||
<!-- border: 1px solid #ebeef5;-->
|
||||
<!-- border-radius: 4px;-->
|
||||
<!-- box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);-->
|
||||
<!-- }-->
|
||||
<!-- .eachPostComment{-->
|
||||
<!-- border: 1px solid #C0C0C0;-->
|
||||
<!-- border-radius: 5px;-->
|
||||
<!-- margin-bottom: 20px;-->
|
||||
<!-- box-shadow: 2px 2px 3px #808080;-->
|
||||
<!-- padding: 10px 20px;-->
|
||||
<!-- background-color: #fff-->
|
||||
<!-- }-->
|
||||
<!-- .eachComment{-->
|
||||
<!-- background: #F5F5F5;-->
|
||||
<!-- margin-top: 10px;-->
|
||||
<!-- width: calc(100% - 120px);-->
|
||||
<!-- margin-left: 60px;-->
|
||||
<!-- border-radius: 5px;-->
|
||||
<!-- padding: 1px 10px 10px;-->
|
||||
<!-- }-->
|
||||
<!-- .replyLeaveMessage{color:#409EFF;cursor: pointer;margin-right: 10px;}-->
|
||||
<!-- .MBCcreatorNickName{display: inline-block;margin-right: 20px;margin-left:10px;font-size: 18px;color: #000;}-->
|
||||
<!-- .replyIcon{width: 16px;height: auto;margin-right: 30px;cursor: pointer;}-->
|
||||
<!-- .deleteIcon{width: 16px;height: auto;cursor:pointer;}-->
|
||||
<!-- .goSlide{position: fixed; left: 91%;top: 80px;width: 90px;}-->
|
||||
<!-- .popUpImgView{position: fixed;width: 100%;height: 100%;left: 0;top: 0;background: rgba(0,0,0,0.5);cursor: zoom-out;}-->
|
||||
<!-- .popUpImg{position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);min-width: 500px;max-height: 80%;height: auto;}-->
|
||||
<!--</style>-->
|
||||
<!--<style>-->
|
||||
<!--.ql-size-small {-->
|
||||
<!-- font-size: 0.75em;-->
|
||||
<!--}-->
|
||||
<!--.ql-size-large{-->
|
||||
<!-- font-size: 1.5em;-->
|
||||
<!--}-->
|
||||
<!--.ql-size-huge{-->
|
||||
<!-- font-size: 2.5em;-->
|
||||
<!--}-->
|
||||
<!--</style>-->
|
||||
|
141
src/views/newMap/display/newChat/addressBook.vue
Normal file
141
src/views/newMap/display/newChat/addressBook.vue
Normal file
@ -0,0 +1,141 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<div class="left">
|
||||
<div class="searchBox">
|
||||
<el-input v-model="queryMember" placeholder="请输入搜索人员" clearable size="medium">
|
||||
<el-button slot="append" icon="el-icon-search" />
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="treeBox">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="memberTreeData"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
:default-expand-all="false"
|
||||
:filter-node-method="filterNode"
|
||||
@node-click="nodeClick"
|
||||
>
|
||||
<span slot-scope="{ data }" class="custom-tree-node">
|
||||
<span>{{ data.labelName }}</span>
|
||||
</span>
|
||||
</el-tree>
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<el-form ref="form" :model="activeNode" label-width="80px" size="small">
|
||||
<el-form-item v-if="activeNode.labelName" :label="activeNode.type? '名称:': '部门:'">
|
||||
<span>{{ activeNode.labelName }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="activeNode.type" label="部门:">
|
||||
<span>{{ activeNode.typeName }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="activeNode.children" label="人数:">
|
||||
<span>{{ activeNode.children.length }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="showSendBtn">
|
||||
<el-button type="primary" style="width: 200px;" @click="sendPrivateMsg">发消息</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AddressBook',
|
||||
components: {
|
||||
|
||||
},
|
||||
props: {
|
||||
memberTreeData: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeTrains: [],
|
||||
queryMember: '',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'labelName'
|
||||
},
|
||||
activeNode: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
memberData() {
|
||||
return this.$store.state.training.memberData;
|
||||
},
|
||||
showSendBtn() {
|
||||
let s = false;
|
||||
if (this.activeNode.type) {
|
||||
s = true;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
queryMember(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
sendPrivateMsg() {
|
||||
this.$emit('sendPrivateMsg', this.activeNode);
|
||||
},
|
||||
nodeClick(data, node) {
|
||||
this.activeNode = { ...data };
|
||||
if (node.isLeaf) {
|
||||
this.activeNode.typeName = node.parent.data.labelName;
|
||||
}
|
||||
},
|
||||
filterNode(value, data) {
|
||||
let flag = false;
|
||||
if (this.memberData[data.id] && this.memberData[data.id].nickName) {
|
||||
flag = this.memberData[data.id].nickName.indexOf(value) !== -1;
|
||||
}
|
||||
let driverNoShow = true;
|
||||
if (data.type && data.type === 'DRIVER' && !this.activeTrains.includes(data.deviceCode)) {
|
||||
driverNoShow = false;
|
||||
}
|
||||
return (data.labelName.indexOf(value) !== -1 || flag) && driverNoShow;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
.main {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
.left{
|
||||
width: 300px;
|
||||
.searchBox {
|
||||
padding: 2px 5px;
|
||||
}
|
||||
.treeBox {
|
||||
height: calc(100% - 40px);
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
.right {
|
||||
height: 100%;
|
||||
width: calc(100% - 300px);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-left: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -27,8 +27,8 @@
|
||||
</div>
|
||||
<div class="chat-box-footer">
|
||||
<el-input v-model="textContent" size="small" placeholder="请输入会话文字,点击T发送" style="flex: 1; margin-left: 5px;" :rows="1" />
|
||||
<el-button :id="sendTextId" size="mini" class="chat-box-footer-create" :disabled="contentSend || !id" @click="sendText">T</el-button>
|
||||
<el-button :id="recordVoice" class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" :disabled="audioPlay || (trainingDesign && !trainingSwitch) || !id" size="mini" type="primary" @click="startRecording()">
|
||||
<el-button :id="sendTextId" size="mini" class="chat-box-footer-create" :disabled="contentSend || (!id && !privateChatId)" @click="sendText">T</el-button>
|
||||
<el-button :id="recordVoice" class="chat-box-footer-create chat-box-footer-send" :class="{'active': recordSending}" :disabled="audioPlay || (trainingDesign && !trainingSwitch) || (!id && !privateChatId)" size="mini" type="primary" @click="startRecording()">
|
||||
<el-progress id="voice_progress_bar" type="circle" :show-text="false" :percentage="100/maxSeconds*seconds" :width="40" :stroke-width="2" status="success" />
|
||||
<i v-if="recordSending" class="el-icon-close close_icon" @click.stop="cancelRecording()" />
|
||||
<span class="iconfont icon-yuyin"></span>
|
||||
@ -58,6 +58,10 @@ export default {
|
||||
groupName: {
|
||||
type: String,
|
||||
required:true
|
||||
},
|
||||
privateChatId: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@ -130,6 +134,7 @@ export default {
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.contentDom.onscroll = null;
|
||||
this.contentDom = '';
|
||||
},
|
||||
methods: {
|
||||
setIsBottomFn() {
|
||||
@ -189,7 +194,7 @@ export default {
|
||||
return name;
|
||||
},
|
||||
sendText() {
|
||||
if (!this.id || !this.textContent) { return; }
|
||||
if ((!this.id && !this.privateChatId) || !this.textContent) { return; }
|
||||
const operate = {
|
||||
over: true,
|
||||
cmdType: CMD.Conversation.CMD_Conversation_Group_Text_Chat,
|
||||
@ -201,6 +206,11 @@ export default {
|
||||
content: this.textContent
|
||||
}
|
||||
};
|
||||
if (this.privateChatId) {
|
||||
operate.cmdType = CMD.Conversation.CMD_Conversation_Group_Private_Text_Chat;
|
||||
delete operate.param.id;
|
||||
operate.param.memberId = this.privateChatId;
|
||||
}
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.textContent = '';
|
||||
@ -237,6 +247,11 @@ export default {
|
||||
fileBase64Str: BaseURL
|
||||
}
|
||||
};
|
||||
if (that.privateChatId) {
|
||||
operate.cmdType = CMD.Conversation.CMD_Conversation_Group_Private_Audio_Base64;
|
||||
delete operate.param.id;
|
||||
operate.param.memberId = that.privateChatId;
|
||||
}
|
||||
that.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
that.textContent = '';
|
||||
@ -322,6 +337,10 @@ export default {
|
||||
id: this.id
|
||||
}
|
||||
};
|
||||
if (this.privateChatId) {
|
||||
delete operate.param.id;
|
||||
operate.param.memberId = this.privateChatId;
|
||||
}
|
||||
this.$store.dispatch('trainingNew/next', operate).then(({ valid }) => {
|
||||
if (valid) {
|
||||
this.audioPlay = true;
|
||||
|
@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="dialogBody">
|
||||
<div v-show="false" class="leftBox">
|
||||
<div class="leftBox">
|
||||
<div class="leftLogo">
|
||||
<img :src="logoImgUrl" :alt="logoImgUrl">
|
||||
</div>
|
||||
@ -25,7 +25,7 @@
|
||||
<div class="tabLabel">{{ item.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="tabActive==0" class="contentBox">
|
||||
<div v-show="tabActive==0" class="contentBox">
|
||||
<div class="middle">
|
||||
<div class="middleTop">
|
||||
<div v-for="(item, index) in filterTab" :key="index" class="filterType pointer" :class="{active: index === filterActive}" @click="filterClick(index)">
|
||||
@ -39,7 +39,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="middleMain">
|
||||
<div v-for="(item, index) in groupList" :key="index" class="row pointer" :class="{active: item.id === id}" @click="groupClick(item)">
|
||||
<div v-for="(item, index) in groupList" :ref="'dom'+index" :key="index" class="row pointer" :class="{active: item.id === id || (privateChatId && privateChatId == getPrivateChatId(item))}" @click="groupClick(item)" @contextmenu.prevent.stop="showMenu($event,item)">
|
||||
<div v-show="false" class="groupIcon">
|
||||
<img :src="getImgUrl(item.imageUrl)" alt="">
|
||||
</div>
|
||||
@ -56,28 +56,37 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<chat-content :id="id" :group-name="groupName" :message-list="activeMessageList" />
|
||||
<chat-content v-if="id || privateChatId" :id="id" :group-name="activeGroupName" :private-chat-id="privateChatId" :message-list="activeMessageList" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="tabActive==1">文档</div>
|
||||
<div v-else-if="tabActive==2">工作台</div>
|
||||
<div v-else-if="tabActive==3">通讯录</div>
|
||||
<div v-show="tabActive==1" class="contentBox">
|
||||
<address-book ref="addressBook" :member-tree-data="memberTreeData" @sendPrivateMsg="sendPrivateMsg" />
|
||||
</div>
|
||||
</div>
|
||||
<edit-group ref="editGroup" />
|
||||
<edit-group ref="editGroup" :member-tree-data="memberTreeData" />
|
||||
<pop-menu ref="popMenu" :menu="menu" />
|
||||
<dialog-member ref="dialogMember" :member-tree-data="memberTreeData" @updateLeaderId="updateLeaderId" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {mapGetters} from 'vuex';
|
||||
import { getGroupList, setGroupReadMessage } from '@/api/newChat';
|
||||
import { getGroupList, setGroupReadMessage, updateGroupName, updateGroupLeader } from '@/api/newChat';
|
||||
import { timestampFormat } from '@/utils/date';
|
||||
import ChatContent from './chatContent';
|
||||
import EditGroup from './editGroup';
|
||||
import AddressBook from './addressBook';
|
||||
import PopMenu from '@/components/PopMenu';
|
||||
import DialogMember from './dialogMember';
|
||||
import { objectIsEqual } from '@/utils/date';
|
||||
export default {
|
||||
name: '',
|
||||
name: 'ChatDialog',
|
||||
components: {
|
||||
ChatContent,
|
||||
EditGroup
|
||||
EditGroup,
|
||||
AddressBook,
|
||||
PopMenu,
|
||||
DialogMember
|
||||
},
|
||||
props: {
|
||||
|
||||
@ -88,8 +97,6 @@ export default {
|
||||
dialogVisible: false,
|
||||
tabs: [
|
||||
{label:'消息', icon:'el-icon-chat-dot-square'},
|
||||
{label:'文档', icon:'el-icon-document'},
|
||||
{label:'工作台', icon:'el-icon-menu'},
|
||||
{label:'通讯录', icon:'el-icon-notebook-1'}
|
||||
],
|
||||
tabActive: 0,
|
||||
@ -101,11 +108,10 @@ export default {
|
||||
// {label: '群聊', value: ''}
|
||||
],
|
||||
filterActive: 0,
|
||||
groupList: [
|
||||
// {name: '分公司领导', imageUrl: '', memberList:[], messageList: [{content: '控制中心消息:【I 类】', time: '2023-04-20 15:08:55'}]},
|
||||
// {name: '集团公司', imageUrl: '', memberList:[],messageList: [{content: '【演练结束】2号线二期:14:58 Y04列车演练结束', time: '2023-04-20 15:08:55'}], isMute: true}
|
||||
],
|
||||
id: 0 // 当前的群组id
|
||||
groupList: [],
|
||||
id: 0, // 当前的群组id
|
||||
privateChatId: '', // 私聊角色id
|
||||
menu: [] // 右键菜单
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -116,35 +122,54 @@ export default {
|
||||
myMemberId() {
|
||||
return this.$store.state.training.myMemberId;
|
||||
},
|
||||
memberList() {
|
||||
return this.$store.state.training.memberList;
|
||||
},
|
||||
memberData() {
|
||||
return this.$store.state.training.memberData;
|
||||
},
|
||||
totalUnread() {
|
||||
let n = 0;
|
||||
this.groupList.forEach(item => {
|
||||
n += this.getBadge(item.messageList);
|
||||
});
|
||||
return n;
|
||||
},
|
||||
activeMessageList() {
|
||||
let list = [];
|
||||
const find = this.groupList.find(item => {
|
||||
return item.id == this.id;
|
||||
return item.id == this.id || (this.privateChatId && this.privateChatId == this.getPrivateChatId(item));
|
||||
});
|
||||
if (find) {
|
||||
list = find.messageList;
|
||||
}
|
||||
return list;
|
||||
},
|
||||
groupName() {
|
||||
activeGroupName() {
|
||||
let name = '';
|
||||
const find = this.groupList.find(item => {
|
||||
return item.id == this.id;
|
||||
});
|
||||
if (find) {
|
||||
name = this.getGroupName(find);
|
||||
if (this.privateChatId) {
|
||||
const m = this.memberData[this.privateChatId];
|
||||
if (m) {
|
||||
name = m.labelName;
|
||||
}
|
||||
} else {
|
||||
const find = this.groupList.find(item => {
|
||||
return item.id == this.id;
|
||||
});
|
||||
if (find) {
|
||||
name = this.getGroupName(find);
|
||||
}
|
||||
}
|
||||
return name;
|
||||
},
|
||||
memberTreeData() {
|
||||
return this.$store.state.training.memberTreeData;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.simulationReset': function (val) { // 仿真重置
|
||||
if (val) {
|
||||
this.id = 0;
|
||||
this.$store.dispatch('socket/resetConversationGroup');
|
||||
this.initGroupList();
|
||||
}
|
||||
},
|
||||
'$store.state.socket.conversationGroup.MESSAGE': function(val) {
|
||||
@ -153,6 +178,9 @@ export default {
|
||||
});
|
||||
if (find) {
|
||||
find.messageList.push(val.message);
|
||||
if (!this.id && this.privateChatId && this.privateChatId == this.getPrivateChatId(find)) {
|
||||
this.id = val.id;
|
||||
}
|
||||
if (this.id == val.id) {
|
||||
this.setReadGroup();
|
||||
}
|
||||
@ -165,22 +193,210 @@ export default {
|
||||
if (val.messageTips) {
|
||||
this.$message.success(`${val.messageTips}`);
|
||||
}
|
||||
this.getGroupList();
|
||||
if (val.id) {
|
||||
const findIndex = this.groupList.findIndex(ii => {
|
||||
return val.id == ii.id || (val.type == 'PRIVATE_CHAT' && ii.type == 'PRIVATE_CHAT' && this.isEqualMember(ii.memberList, val.memberList));
|
||||
});
|
||||
const obj = {...val, messageList: [], imageUrl: ''};
|
||||
if (findIndex > -1) {
|
||||
this.groupList.splice(findIndex, 1, obj);
|
||||
} else {
|
||||
this.groupList.push(obj);
|
||||
}
|
||||
}
|
||||
},
|
||||
myMemberId() {
|
||||
this.getGroupList();
|
||||
'$store.state.socket.conversationGroup.UPDATE_NAME': function(val) {
|
||||
if (val.id) {
|
||||
const index = this.groupList.findIndex(item => {
|
||||
return item.id == val.id;
|
||||
});
|
||||
if (index > -1) {
|
||||
this.groupList.splice(index, 1, {...this.groupList[index], name: val.name});
|
||||
}
|
||||
}
|
||||
},
|
||||
'$store.state.socket.conversationGroup.UPDATE_MEMBER': function(val) {
|
||||
if (val.id) {
|
||||
const index = this.groupList.findIndex(item => {
|
||||
return item.id == val.id;
|
||||
});
|
||||
if (index > -1) {
|
||||
const obj = {
|
||||
...this.groupList[index],
|
||||
memberList: val.memberList
|
||||
};
|
||||
if (val.leaderId) {
|
||||
obj.leaderId = val.leaderId;
|
||||
}
|
||||
this.groupList.splice(index, 1, obj);
|
||||
}
|
||||
}
|
||||
},
|
||||
'$store.state.socket.conversationGroup.EXIT': function(val) {
|
||||
if (val.id) {
|
||||
const index = this.groupList.findIndex(item => {
|
||||
return item.id == val.id;
|
||||
});
|
||||
this.groupList.splice(index, 1);
|
||||
}
|
||||
},
|
||||
totalUnread() {
|
||||
this.$emit('setTotalUnread', this.totalUnread);
|
||||
},
|
||||
myMemberId: {
|
||||
handler(val) {
|
||||
this.initGroupList();
|
||||
if (val) {
|
||||
this.getGroupList();
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
created() {
|
||||
this.getBaseInfo();
|
||||
this.getGroupList();
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.initGroupList();
|
||||
this.handleClose();
|
||||
},
|
||||
methods: {
|
||||
showMenu(event, item) {
|
||||
this.groupClick(item);
|
||||
this.initMenu(item);
|
||||
const point = { x: event.x, y: event.y };
|
||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||
this.$refs.popMenu.resetShowPosition(point);
|
||||
}
|
||||
},
|
||||
closeMenu() {
|
||||
if (this.$refs && this.$refs.popMenu) {
|
||||
this.$refs.popMenu.close();
|
||||
}
|
||||
},
|
||||
groupSet(item) {
|
||||
this.$refs.editGroup.doShow(item.groupInfo, item.label);
|
||||
},
|
||||
editGroupName(item) {
|
||||
this.$prompt('请修改群名称', '提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
inputValue: item.groupInfo.name
|
||||
}).then(suc => {
|
||||
if (!item.groupInfo || !item.groupInfo.id) { return; }
|
||||
const data = {
|
||||
id: item.groupInfo.id,
|
||||
name: suc.value
|
||||
};
|
||||
updateGroupName(this.groupId, data).then(res => {
|
||||
this.$message.success('修改群名称成功!');
|
||||
}).catch(err => {
|
||||
this.$message.error(`修改群名称失败!,${err.message}`);
|
||||
});
|
||||
});
|
||||
},
|
||||
editGroupLeader(item) {
|
||||
this.$refs.dialogMember.doShow(item.groupInfo, item.label);
|
||||
},
|
||||
updateLeaderId(param) {
|
||||
updateGroupLeader(this.groupId, param).then(res => {
|
||||
this.$message.success('修改群主成功!');
|
||||
}).catch(err => {
|
||||
this.$message.error(`修改群主失败!,${err.message}`);
|
||||
});
|
||||
},
|
||||
initMenu(item) {
|
||||
const menuNormal = (item) => [
|
||||
{
|
||||
label: '查看群设置',
|
||||
handler: this.groupSet,
|
||||
groupInfo: item,
|
||||
isDisabled: (item) => {
|
||||
return false;
|
||||
},
|
||||
isShow: (item) => item.type === 'GROUP_CHAT'
|
||||
},
|
||||
{
|
||||
label: '修改群名称',
|
||||
handler: this.editGroupName,
|
||||
groupInfo: item,
|
||||
isDisabled: (item) => {
|
||||
return item.leaderId != this.myMemberId;
|
||||
},
|
||||
isShow: (item) => item.type === 'GROUP_CHAT'
|
||||
},
|
||||
{
|
||||
label: '修改群主',
|
||||
handler: this.editGroupLeader,
|
||||
groupInfo: item,
|
||||
isDisabled: (item) => {
|
||||
return item.leaderId != this.myMemberId;
|
||||
},
|
||||
isShow: (item) => item.type === 'GROUP_CHAT'
|
||||
},
|
||||
{
|
||||
label: '邀请成员',
|
||||
handler: this.groupSet,
|
||||
groupInfo: item,
|
||||
isDisabled: (item) => {
|
||||
return item.leaderId != this.myMemberId;
|
||||
},
|
||||
isShow: (item) => item.type === 'GROUP_CHAT'
|
||||
}
|
||||
];
|
||||
this.menu = [];
|
||||
const list = menuNormal(item);
|
||||
list.forEach(menuItem => {
|
||||
menuItem.disabled = menuItem.isDisabled ? menuItem.isDisabled(item) : false;
|
||||
menuItem.show = menuItem.isShow ? menuItem.isShow(item) : true;
|
||||
});
|
||||
this.menu = list;
|
||||
},
|
||||
scrollTop(index) {
|
||||
this.$nextTick(() => {
|
||||
const dom = document.querySelector('.middleMain');
|
||||
const refDom = this.$refs['dom' + index];
|
||||
const oTop = refDom[0].offsetTop;
|
||||
const d = oTop - dom.clientHeight / 2;
|
||||
dom.scrollTop = d;
|
||||
});
|
||||
},
|
||||
sendPrivateMsg(item) {
|
||||
this.privateChatId = item.id;
|
||||
const mList = [
|
||||
{memberId: this.myMemberId, connect: false, role: 'Leader'},
|
||||
{memberId: item.id, connect: false, role: 'Leader'}
|
||||
];
|
||||
const findIndex = this.groupList.findIndex(ii => {
|
||||
return ii.type == 'PRIVATE_CHAT' && this.isEqualMember(ii.memberList, mList);
|
||||
});
|
||||
let index = findIndex;
|
||||
if (findIndex < 0) {
|
||||
const obj = {
|
||||
creatorId: this.myMemberId,
|
||||
leaderId: this.myMemberId,
|
||||
memberList: mList,
|
||||
messageList: [],
|
||||
name: item.labelName,
|
||||
type: 'PRIVATE_CHAT'
|
||||
};
|
||||
this.groupList.push(obj);
|
||||
index = this.groupList.length - 1;
|
||||
}
|
||||
this.scrollTop(index);
|
||||
this.id = 0;
|
||||
this.tabActive = 0;
|
||||
},
|
||||
initGroupList() {
|
||||
this.id = 0;
|
||||
this.privateChatId = '';
|
||||
this.$store.dispatch('socket/resetConversationGroup');
|
||||
this.groupList = [];
|
||||
},
|
||||
getMessageStatus(val) {
|
||||
const find = this.groupList.find(item => {
|
||||
return item.id == val.id;
|
||||
@ -206,15 +422,28 @@ export default {
|
||||
},
|
||||
getGroupName(item) {
|
||||
let name = '';
|
||||
if (item.name) {
|
||||
name = item.name;
|
||||
if (item.type == 'PRIVATE_CHAT') {
|
||||
let mId = '';
|
||||
if (item.memberList[0].memberId == this.myMemberId && item.memberList[1]) {
|
||||
mId = item.memberList[1].memberId;
|
||||
} else {
|
||||
mId = item.memberList[0].memberId;
|
||||
}
|
||||
const node = this.memberData[mId];
|
||||
if (node) {
|
||||
name = node.labelName;
|
||||
}
|
||||
} else {
|
||||
const nArr = [];
|
||||
item.memberList.forEach(ii => {
|
||||
const node = this.memberData[ii.memberId];
|
||||
node && nArr.push(node.labelName);
|
||||
});
|
||||
name = nArr.join('、');
|
||||
if (item.name) {
|
||||
name = item.name;
|
||||
} else {
|
||||
const nArr = [];
|
||||
item.memberList.forEach(ii => {
|
||||
const node = this.memberData[ii.memberId];
|
||||
node && nArr.push(node.labelName);
|
||||
});
|
||||
name = nArr.join('、');
|
||||
}
|
||||
}
|
||||
return name;
|
||||
},
|
||||
@ -262,11 +491,19 @@ export default {
|
||||
},
|
||||
getGroupList() {
|
||||
getGroupList(this.groupId).then(res => {
|
||||
this.groupList = res.data;
|
||||
if (this.groupList && this.groupList[0] && !this.id) {
|
||||
res.data.forEach(item => {
|
||||
const findIndex = this.groupList.findIndex(ii => {
|
||||
return item.id == ii.id || (item.type == 'PRIVATE_CHAT' && ii.type == 'PRIVATE_CHAT' && this.isEqualMember(ii.memberList, item.memberList));
|
||||
});
|
||||
if (findIndex > -1) {
|
||||
this.groupList.splice(findIndex, 1, item);
|
||||
} else {
|
||||
this.groupList.push(item);
|
||||
}
|
||||
});
|
||||
if (this.groupList && this.groupList[0] && !this.id && !this.privateChatId) {
|
||||
this.id = this.groupList[0].id;
|
||||
}
|
||||
}).catch(err => {
|
||||
});
|
||||
},
|
||||
getImgUrl(url) {
|
||||
@ -281,11 +518,45 @@ export default {
|
||||
filterClick(index) {
|
||||
this.filterActive = index;
|
||||
},
|
||||
isEqualMember(arr1, arr2) {
|
||||
const list1 = JSON.parse(JSON.stringify(arr1));
|
||||
const list2 = JSON.parse(JSON.stringify(arr2));
|
||||
if (!list1[1] && list1[0]) {
|
||||
list1[1] = list1[0];
|
||||
}
|
||||
if (!list2[1] && list2[0]) {
|
||||
list2[1] = list2[0];
|
||||
}
|
||||
const m1 = list1.map(item => {
|
||||
return item.memberId;
|
||||
});
|
||||
const m2 = list2.map(item => {
|
||||
return item.memberId;
|
||||
});
|
||||
return objectIsEqual(m1.sort(), m2.sort());
|
||||
},
|
||||
groupClick(item) {
|
||||
this.id = item.id;
|
||||
this.id = item.id || 0;
|
||||
if (item.type == 'GROUP_CHAT') {
|
||||
this.privateChatId = '';
|
||||
} else {
|
||||
this.privateChatId = this.getPrivateChatId(item);
|
||||
}
|
||||
this.setReadGroup();
|
||||
},
|
||||
getPrivateChatId(item) {
|
||||
let pId = '';
|
||||
if (item.type == 'PRIVATE_CHAT') {
|
||||
if (item.memberList[0].memberId == this.myMemberId && item.memberList[1]) {
|
||||
pId = item.memberList[1].memberId;
|
||||
} else {
|
||||
pId = item.memberList[0].memberId;
|
||||
}
|
||||
}
|
||||
return pId;
|
||||
},
|
||||
setReadGroup() {
|
||||
if (!this.id) { return; }
|
||||
const id = this.id;
|
||||
setGroupReadMessage(this.groupId, {id}).then(res => {
|
||||
res.data.forEach(item => {
|
||||
@ -297,7 +568,6 @@ export default {
|
||||
};
|
||||
this.getMessageStatus(obj);
|
||||
});
|
||||
}).catch(err => {
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
@ -324,6 +594,12 @@ export default {
|
||||
border-top-right-radius: 5px;
|
||||
}
|
||||
}
|
||||
.pop-menu{
|
||||
padding: 0;
|
||||
background: #eee;
|
||||
border: none;
|
||||
box-shadow: 0 0 10px 3px #eee;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -462,7 +738,7 @@ export default {
|
||||
.text {
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
padding: 3px 5px;
|
||||
padding: 0px 5px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@ -475,7 +751,7 @@ export default {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.time, i {
|
||||
padding: 3px 0px;
|
||||
padding: 0px 0px;
|
||||
justify-content: center;
|
||||
}
|
||||
.time {
|
||||
|
87
src/views/newMap/display/newChat/dialogMember.vue
Normal file
87
src/views/newMap/display/newChat/dialogMember.vue
Normal file
@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="dialogMember"
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
:modal="false"
|
||||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<div class="dialogBody">
|
||||
<el-select v-model="value" placeholder="请选择">
|
||||
<el-option-group
|
||||
v-for="group in memberTreeData"
|
||||
:key="group.id"
|
||||
:label="group.labelName"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in group.children"
|
||||
:key="item.id"
|
||||
:label="item.labelName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-option-group>
|
||||
</el-select>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
<el-button type="primary" @click="save">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DialogMember',
|
||||
components: {},
|
||||
props: {
|
||||
memberTreeData: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
title: '修改群主',
|
||||
gId: '',
|
||||
value: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
created() {
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
methods: {
|
||||
save() {
|
||||
if (this.title == '修改群主') {
|
||||
this.$emit('updateLeaderId', {id: this.gId, memberId: this.value});
|
||||
}
|
||||
this.handleClose();
|
||||
},
|
||||
doShow(info, title) {
|
||||
this.title = title || '修改群主';
|
||||
this.gId = info.id;
|
||||
this.value = info.leaderId;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang='scss' scoped>
|
||||
</style>
|
@ -2,7 +2,7 @@
|
||||
<el-dialog
|
||||
v-dialogDrag
|
||||
class="editGroup"
|
||||
title="创建会话群"
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="40%"
|
||||
:modal="false"
|
||||
@ -20,7 +20,7 @@
|
||||
<div class="treeBox">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="treeData"
|
||||
:data="memberTreeData"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
@ -41,14 +41,14 @@
|
||||
<b>{{ selectTreeNode.length }}</b>
|
||||
<b>)</b>
|
||||
<div class="tagBox">
|
||||
<el-tag v-for="(tag, index) in selectTreeNode" :key="index" class="tag" :class="{disableClose: tag.disabled}" :type="tag.disabled ? 'warning' : ''" closable @close="tagClose(tag)">
|
||||
<el-tag v-for="(tag, index) in selectTreeNode" :key="index" class="tag" :class="{disableClose: tag.disabled || addDisabledNode(tag)}" :type="tag.disabled ? 'warning' : ''" :closable="!treeDisabled" @close="tagClose(tag)">
|
||||
{{ tag.labelName }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<el-divider />
|
||||
<el-form ref="form" :model="form" label-width="80px">
|
||||
<el-form-item label="群名称:" prop="name">
|
||||
<el-input v-model="form.name" />
|
||||
<el-form-item v-if="showFormName" label="群名称:" prop="name">
|
||||
<el-input v-model="form.name" :disabled="nameDisabled" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="群头像:" prop="imageUrl">
|
||||
<div class="uploadImgDiv">
|
||||
@ -57,7 +57,7 @@
|
||||
<input id="upload_file_group" ref="files" type="file" class="input_file_box" accept="image/jpeg,image/png" @change="uploadLogo()">
|
||||
</div>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-form-item v-if="showSubmitBtn">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit">确定</el-button>
|
||||
</el-form-item>
|
||||
@ -69,7 +69,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createGroup } from '@/api/newChat';
|
||||
import { createGroup, inviteMemberToGroup } from '@/api/newChat';
|
||||
import { getUploadUrl } from '@/api/projectConfig';
|
||||
export default {
|
||||
name: 'EditGroup',
|
||||
@ -77,102 +77,58 @@ export default {
|
||||
|
||||
},
|
||||
props: {
|
||||
|
||||
memberTreeData: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: '创建会话群',
|
||||
dialogVisible: false,
|
||||
queryMember: '',
|
||||
defaultProps: {
|
||||
children: 'children',
|
||||
label: 'labelName'
|
||||
label: 'labelName',
|
||||
disabled: (node) => {
|
||||
if (node.disabled || this.treeDisabled || this.addDisabledNode(node)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
activeTrains: [],
|
||||
defaultCheckedKeys: [],
|
||||
selectTreeNode: [],
|
||||
treeData: [{
|
||||
labelName: '行调',
|
||||
children: []
|
||||
}, {
|
||||
labelName: 'NCC调度',
|
||||
children: []
|
||||
}, {
|
||||
labelName: '车站值班员',
|
||||
children: []
|
||||
}, {
|
||||
labelName: '司机',
|
||||
children: []
|
||||
}, {
|
||||
labelName: '通号',
|
||||
children: []
|
||||
}, {
|
||||
labelName: '车辆段',
|
||||
children: []
|
||||
}, {
|
||||
labelName: 'CTC操作员',
|
||||
children: []
|
||||
}, {
|
||||
labelName: '车站助理',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
labelName: '车站站长',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
labelName: '车站信号员',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
labelName: '车站客运员',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
labelName: '车站扳道员',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
labelName: '车站引导员',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
labelName: '车站工务工',
|
||||
children: []
|
||||
},
|
||||
{
|
||||
labelName: '设备管理员',
|
||||
children: []
|
||||
}
|
||||
],
|
||||
form: {
|
||||
id: '',
|
||||
name: '',
|
||||
imageUrl: ''
|
||||
}
|
||||
},
|
||||
treeDisabled: false,
|
||||
nameDisabled: false,
|
||||
showFormName: true,
|
||||
showSubmitBtn: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
groupId() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
memberList() {
|
||||
return this.$store.state.training.memberList;
|
||||
},
|
||||
memberData() {
|
||||
return this.$store.state.training.memberData;
|
||||
},
|
||||
myMemberId() {
|
||||
return this.$store.state.training.myMemberId;
|
||||
},
|
||||
defaultCheckedKeys() {
|
||||
return [this.myMemberId];
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
queryMember(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
},
|
||||
memberList () {
|
||||
this.getTreeData();
|
||||
},
|
||||
myMemberId(val) {
|
||||
this.initData();
|
||||
if (!val) {
|
||||
@ -181,28 +137,52 @@ export default {
|
||||
},
|
||||
'$store.state.map.activeTrainListChange': function () {
|
||||
this.getActiveTrains();
|
||||
},
|
||||
title() {
|
||||
if (this.title == '邀请成员') {
|
||||
this.showFormName = false;
|
||||
this.showSubmitBtn = true;
|
||||
this.treeDisabled = false;
|
||||
this.nameDisabled = true;
|
||||
} else if (this.title == '创建会话群') {
|
||||
this.showFormName = true;
|
||||
this.showSubmitBtn = true;
|
||||
this.treeDisabled = false;
|
||||
this.nameDisabled = false;
|
||||
} else {
|
||||
this.showFormName = true;
|
||||
this.showSubmitBtn = false;
|
||||
this.treeDisabled = true;
|
||||
this.nameDisabled = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initData();
|
||||
},
|
||||
created() {
|
||||
this.getTreeData();
|
||||
this.getActiveTrains();
|
||||
},
|
||||
beforeDestroy() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
addDisabledNode(node) {
|
||||
let s = false;
|
||||
if (this.title == '邀请成员' && this.defaultCheckedKeys.includes(node.id)) {
|
||||
s = true;
|
||||
}
|
||||
return s;
|
||||
},
|
||||
getImgUrl(url) {
|
||||
return url ? this.$store.state.user.ossUrl + '/conversationGroup/' + url : '';
|
||||
},
|
||||
tagClose(item) {
|
||||
if (item.disabled) { return; }
|
||||
const filter = this.selectTreeNode.filter(ii => {
|
||||
return item != ii;
|
||||
return item.id != ii.id;
|
||||
});
|
||||
this.$refs.tree.setCheckedNodes(filter);
|
||||
this.$refs.tree.setChecked(item, false);
|
||||
this.selectTreeNode = filter;
|
||||
},
|
||||
getActiveTrains() {
|
||||
@ -215,200 +195,6 @@ export default {
|
||||
}
|
||||
this.$refs.tree && this.$refs.tree.filter(this.queryMember);
|
||||
},
|
||||
getTreeData() {
|
||||
const val = this.memberList;
|
||||
if (val && val.length) {
|
||||
// this.memberData = this.$store.state.training.memberData;
|
||||
const dispatcherList = [];
|
||||
const nccDispatcherList = [];
|
||||
const electricDispatcherList = [];
|
||||
const depotDispatcherList = [];
|
||||
const stationSupervisorList = [];
|
||||
const driverList = [];
|
||||
const maintainerList = [];
|
||||
const ctcOperatorList = [];
|
||||
const stationAssistantList = [];
|
||||
const stationMasterList = [];
|
||||
const stationSignalerList = [];
|
||||
const stationPassengerList = [];
|
||||
const stationSwitchManList = [];
|
||||
const stationFacilitatorList = [];
|
||||
const stationWorkerList = [];
|
||||
const deviceManagerList = [];
|
||||
const trainMasterList = [];
|
||||
const stationElectricWorkerList = [];
|
||||
val.forEach(item => {
|
||||
const device = this.$store.getters['map/getDeviceByCode'](item.deviceCode);
|
||||
switch (item.type) {
|
||||
case 'DISPATCHER':
|
||||
this.memberData[item.id].labelName = '行调' + (item.name || '');
|
||||
dispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'NCC_DISPATCHER':
|
||||
this.memberData[item.id].labelName = 'NCC调度' + (item.name || '');
|
||||
nccDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'ELECTRIC_DISPATCHER':
|
||||
this.memberData[item.id].labelName = '电力调度' + (item.name || '');
|
||||
electricDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DEPOT_DISPATCHER':
|
||||
this.memberData[item.id].labelName = '信号楼-' + device.name + (item.name || '');
|
||||
depotDispatcherList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_SUPERVISOR':
|
||||
this.memberData[item.id].labelName = '值班员-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationSupervisorList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DRIVER':
|
||||
this.memberData[item.id].labelName = '司机-列车' + item.deviceCode;
|
||||
driverList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'MAINTAINER':
|
||||
this.memberData[item.id].labelName = '通号' + (item.name || '');
|
||||
maintainerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'RAIL_CTC':
|
||||
this.memberData[item.id].labelName = 'CTC操作员' + device.name;
|
||||
ctcOperatorList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_ASSISTANT':
|
||||
this.memberData[item.id].labelName = '车站助理-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationAssistantList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_MASTER':
|
||||
this.memberData[item.id].labelName = '车站站长-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationMasterList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_SIGNALER':
|
||||
this.memberData[item.id].labelName = '车站信号员-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationSignalerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_PASSENGER':
|
||||
this.memberData[item.id].labelName = '车站客运员-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationPassengerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_SWITCH_MAN':
|
||||
this.memberData[item.id].labelName = '车站扳道员-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationSwitchManList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_FACILITATOR':
|
||||
this.memberData[item.id].labelName = '车站引导员-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationFacilitatorList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'STATION_WORKER':
|
||||
this.memberData[item.id].labelName = '车站工务工-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
stationWorkerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'DEVICE_MANAGER':
|
||||
this.memberData[item.id].labelName = '设备管理员-' + device.name + (item.name ? `-${item.name }` : '');
|
||||
deviceManagerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'TRAIN_MASTER':
|
||||
// device.name;
|
||||
this.memberData[item.id].labelName = '车务段段长-' + (item.name ? `-${item.name }` : '');
|
||||
trainMasterList.push(this.memberData[item.id]);
|
||||
break;
|
||||
case 'PARENT_DEPARTMENT':
|
||||
this.memberData[item.id].labelName = '上级部门' + (item.name ? `-${item.name }` : '');
|
||||
break;
|
||||
case 'STATION_ELECTRIC_WORKER':
|
||||
this.memberData[item.id].labelName = '电力工务' + (item.name || '');
|
||||
stationElectricWorkerList.push(this.memberData[item.id]);
|
||||
break;
|
||||
// DEVICE_MANAGER:'设备管理员' deviceManager
|
||||
}
|
||||
});
|
||||
this.treeData = [{
|
||||
labelName: '行调',
|
||||
id: 'dispatcher',
|
||||
children: dispatcherList
|
||||
}, {
|
||||
labelName: 'NCC调度',
|
||||
id: 'nccDispatcher',
|
||||
children: nccDispatcherList
|
||||
}, {
|
||||
labelName: '车站值班员',
|
||||
id: 'stationSupervisor',
|
||||
children: stationSupervisorList
|
||||
}, {
|
||||
labelName: '司机',
|
||||
id: 'driver',
|
||||
children: driverList
|
||||
}, {
|
||||
labelName: '通号',
|
||||
id: 'maintainer',
|
||||
children: maintainerList
|
||||
}, {
|
||||
labelName: '车辆段信号楼',
|
||||
id: 'depotDispatcher',
|
||||
children: depotDispatcherList
|
||||
}, {
|
||||
labelName: '电力调度',
|
||||
id: 'electricDispatcher',
|
||||
children: electricDispatcherList
|
||||
}, {
|
||||
labelName: 'CTC操作员',
|
||||
id: 'ctcOperator',
|
||||
children: ctcOperatorList
|
||||
}, {
|
||||
labelName: '车站助理',
|
||||
id: 'stationAssistant',
|
||||
children: stationAssistantList
|
||||
},
|
||||
{
|
||||
labelName: '车站站长',
|
||||
id: 'stationMaster',
|
||||
children: stationMasterList
|
||||
},
|
||||
{
|
||||
labelName: '车站信号员',
|
||||
id: 'stationSignaler',
|
||||
children: stationSignalerList
|
||||
},
|
||||
{
|
||||
labelName: '车站客运员',
|
||||
id: 'stationPassenger',
|
||||
children: stationPassengerList
|
||||
},
|
||||
{
|
||||
labelName: '车站扳道员',
|
||||
id: 'stationSwitchMan',
|
||||
children: stationSwitchManList
|
||||
},
|
||||
{
|
||||
labelName: '车站引导员',
|
||||
id: 'stationFacilitator',
|
||||
children: stationFacilitatorList
|
||||
},
|
||||
{
|
||||
labelName: '车站工务工',
|
||||
id: 'stationWorker',
|
||||
children: stationWorkerList
|
||||
},
|
||||
{
|
||||
labelName: '设备管理员',
|
||||
id: 'deviceManager',
|
||||
children: deviceManagerList
|
||||
},
|
||||
{
|
||||
labelName: '车务段段长 ',
|
||||
id: 'trainMaster',
|
||||
children: trainMasterList
|
||||
},
|
||||
{
|
||||
labelName: '电力工务 ',
|
||||
id: 'stationElectricWorker',
|
||||
children: stationElectricWorkerList
|
||||
}
|
||||
];
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tree) {
|
||||
this.$refs.tree.filter(this.queryMember);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
checkChange(data, node, val) {
|
||||
const filter = node.checkedNodes.filter(ii => {
|
||||
return !ii.children;
|
||||
@ -427,25 +213,47 @@ export default {
|
||||
return (data.labelName.indexOf(value) !== -1 || flag) && driverNoShow;
|
||||
},
|
||||
onSubmit() {
|
||||
const list = [];
|
||||
this.selectTreeNode.forEach(item => {
|
||||
list.push(item.id);
|
||||
});
|
||||
const params = {
|
||||
name: this.form.name,
|
||||
imageUrl: this.form.imageUrl,
|
||||
memberIds: list
|
||||
};
|
||||
createGroup(this.groupId, params).then(res => {
|
||||
this.initData();
|
||||
this.handleClose();
|
||||
this.$message.success('创建会话群成功!');
|
||||
}).catch(err => {
|
||||
this.$message.error(`创建会话群失败!${err.message}`);
|
||||
});
|
||||
if (this.title == '邀请成员') {
|
||||
const list = [];
|
||||
this.selectTreeNode.forEach(item => {
|
||||
if (!this.defaultCheckedKeys.includes(item.id)) {
|
||||
list.push(item.id);
|
||||
}
|
||||
});
|
||||
const params = {
|
||||
id: this.form.id,
|
||||
memberIds: list
|
||||
};
|
||||
inviteMemberToGroup(this.groupId, params).then(res => {
|
||||
this.initData();
|
||||
this.handleClose();
|
||||
this.$message.success('邀请成员成功!');
|
||||
}).catch(err => {
|
||||
this.$message.error(`邀请成员失败!${err.message}`);
|
||||
});
|
||||
|
||||
} else if (this.title == '创建会话群') {
|
||||
const list = [];
|
||||
this.selectTreeNode.forEach(item => {
|
||||
list.push(item.id);
|
||||
});
|
||||
const params = {
|
||||
name: this.form.name,
|
||||
imageUrl: this.form.imageUrl,
|
||||
memberIds: list
|
||||
};
|
||||
createGroup(this.groupId, params).then(res => {
|
||||
this.initData();
|
||||
this.handleClose();
|
||||
this.$message.success('创建会话群成功!');
|
||||
}).catch(err => {
|
||||
this.$message.error(`创建会话群失败!${err.message}`);
|
||||
});
|
||||
}
|
||||
},
|
||||
initData() {
|
||||
this.$refs.form && this.$refs.form.resetFields();
|
||||
this.defaultCheckedKeys = [this.myMemberId];
|
||||
this.selectTreeNode = [];
|
||||
const node = this.memberData[this.myMemberId];
|
||||
node && this.selectTreeNode.push(node);
|
||||
@ -499,7 +307,9 @@ export default {
|
||||
// fileName:存储文件名
|
||||
// method:生成链接的请求方式
|
||||
},
|
||||
doShow() {
|
||||
doShow(info, title) {
|
||||
this.title = title || '创建会话群';
|
||||
this.setInfo(info);
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.tree) {
|
||||
@ -507,6 +317,22 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
setInfo(info) {
|
||||
if (info) {
|
||||
this.form.id = info.id || '';
|
||||
this.form.name = info.name || '';
|
||||
this.form.imageUrl = info.imageUrl || '';
|
||||
this.defaultCheckedKeys = [];
|
||||
this.selectTreeNode = [];
|
||||
info.memberList.forEach(item => {
|
||||
this.defaultCheckedKeys.push(item.memberId);
|
||||
const node = this.memberData[item.memberId];
|
||||
node && this.selectTreeNode.push(node);
|
||||
});
|
||||
} else {
|
||||
this.initData();
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
@ -549,6 +375,7 @@ $imgHeight: 70px;
|
||||
.disableClose {
|
||||
/deep/ .el-icon-close {
|
||||
cursor: not-allowed;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
<template>
|
||||
<div v-quickMenuDrag class="voice-chat-box">
|
||||
<div v-if="chatBoxMin" :id="sideButtonDom.domId" @click="clickBtn">
|
||||
<el-button circle style="color: #0C161A;" icon="el-icon-mic" />
|
||||
<el-badge :value="totalUnreadNum" :hidden="!totalUnreadNum" :max="99">
|
||||
<el-button circle style="color: #0C161A;" icon="el-icon-mic" />
|
||||
</el-badge>
|
||||
</div>
|
||||
<chatDialog ref="chatDialog" />
|
||||
<chatDialog ref="chatDialog" @setTotalUnread="setTotalUnread" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -18,6 +20,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
totalUnreadNum: 0
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
@ -33,6 +36,9 @@ export default {
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
setTotalUnread(val) {
|
||||
this.totalUnreadNum = val;
|
||||
},
|
||||
clickBtn() {
|
||||
const operate = {
|
||||
operation: this.sideButtonDom.operation,
|
||||
|
@ -5,7 +5,7 @@
|
||||
width="400px"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<div v-if="thirdLogin">
|
||||
<div v-if="isRichor">
|
||||
<div><span class="el-icon-user" style="font-size:15px;margin-right:8px;" />联系人:欧阳炜椿</div>
|
||||
<div class="eachInfo"><span class="el-icon-mobile-phone" style="font-size:15px;margin-right:7px;" />电 话:4000500081</div>
|
||||
<div class="eachInfo"><span class="el-icon-message" style="font-size:15px;margin-right:7px;" />邮 箱:zhrc@richortech.com</div>
|
||||
@ -29,8 +29,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import wchat from '@/assets/wchat.png';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { RichorContectUsList } from '@/scripts/ProjectConfig';
|
||||
import {mapGetters} from 'vuex';
|
||||
export default {
|
||||
name:'',
|
||||
data() {
|
||||
@ -40,9 +39,9 @@ export default {
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
thirdLogin() {
|
||||
return RichorContectUsList.includes(getSessionStorage('project'));
|
||||
}
|
||||
...mapGetters('projectConfig', [
|
||||
'isRichor'
|
||||
])
|
||||
},
|
||||
methods:{
|
||||
handleClose() {
|
||||
|
@ -94,6 +94,9 @@ export default {
|
||||
watch: {
|
||||
'$store.state.socket.simulationTimeSync': function (time) { // 仿真时间更新
|
||||
this.initDate(time);
|
||||
},
|
||||
'$store.state.socket.simulationSpeed': function(speed) {
|
||||
this.speed = speed;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -91,9 +91,6 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
'$store.state.socket.simulationOver':function(val) {
|
||||
if (this.$store.state.training.simulationCreator) {
|
||||
return;
|
||||
}
|
||||
this.$alert('您所在仿真已被销毁', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
showClose: false,
|
||||
|
@ -82,7 +82,7 @@ export default {
|
||||
sendCommandNew(this.group, 'KEY_LINK_CONTROL_INFO_QUERY', params).then((res) => {
|
||||
this.searchList = res.data;
|
||||
}).catch(error => {
|
||||
console.log('查询失败!', error);
|
||||
console.error('查询失败!', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -145,7 +145,6 @@ export default {
|
||||
this.onRunningRouteChange();
|
||||
this.dataLoading = false;
|
||||
}).catch(_ => {
|
||||
console.log(_);
|
||||
this.dataLoading = false;
|
||||
this.$messageBox(`获取交路列表失败`);
|
||||
});
|
||||
|
@ -147,7 +147,6 @@ export default {
|
||||
center: true
|
||||
}).then(() => {
|
||||
clearPlaningData(this.loadRunPlanId).then(resp => {
|
||||
console.log('清除数据成功!');
|
||||
this.$emit('refresh');
|
||||
}).catch(() => {
|
||||
this.$message.error('清除数据失败!');
|
||||
|
@ -772,7 +772,6 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log('无线受令代签');
|
||||
const rcId = this.getRcId(this.trainRow.code);
|
||||
const params = {cmdId: this.command.cmdId, rcId: rcId, proxySign: true};
|
||||
const operate = {
|
||||
@ -1368,7 +1367,6 @@ export default {
|
||||
});
|
||||
},
|
||||
cacheCmd(showMsg) {
|
||||
console.log('缓存', this.command);
|
||||
return new Promise(async(resolve, reject) => {
|
||||
const data = JSON.parse(JSON.stringify(this.command));
|
||||
const idList = await this.getCompanyIdList(data.rcvCompanies.length + 1);
|
||||
@ -1410,7 +1408,6 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
console.log('代签');
|
||||
const rcId = this.getRcId(this.allographRow.code);
|
||||
const params = {cmdId: this.command.cmdId, rcId: rcId, proxySign: true};
|
||||
const operate = {
|
||||
|
@ -33,7 +33,7 @@
|
||||
</el-card>
|
||||
<div class="scheduling_body">
|
||||
<div class="scheduling_body-table">
|
||||
<edit-table ref="table" v-loading="loading" border stripe :table-data="tableData" :table-form="tableForm" :row-style="handleRowStyle" />
|
||||
<edit-table ref="table" v-loading="loading" border stripe :height="maxHeight" :max-height="maxHeight" :table-data="tableData" :table-form="tableForm" :row-style="handleRowStyle" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -41,6 +41,7 @@
|
||||
|
||||
<script>
|
||||
import { querySechedulingNew, generateSchedulingNew, saveSchedulingNew } from '@/api/scheduling';
|
||||
import { getTrainListByMapId } from '@/api/jmap/map';
|
||||
import { hexColor } from '@/jmapNew/theme/parser/util';
|
||||
import EditTable from '@/views/components/editTable/index';
|
||||
export default {
|
||||
@ -185,16 +186,18 @@ export default {
|
||||
computed: {
|
||||
group() {
|
||||
return this.$route.query.group;
|
||||
},
|
||||
maxHeight() {
|
||||
return this.$store.state.app.height - 200;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapDataLoadedCount': function () {
|
||||
const trainList = this.$store.state.map.map.trainList || [];
|
||||
mounted() {
|
||||
getTrainListByMapId(this.$route.query.mapId).then(resp => {
|
||||
this.groupNumberList = [];
|
||||
trainList.forEach(item => {
|
||||
resp.data.forEach(item => {
|
||||
this.groupNumberList.push({value: item.code, label: item.groupNumber});
|
||||
});
|
||||
}
|
||||
}).catch(e => console.error(e));
|
||||
},
|
||||
methods: {
|
||||
handleQuery(day) {
|
||||
|
@ -19,7 +19,7 @@
|
||||
<template v-for="terminal in terminalList">
|
||||
<div :key="terminal.id" class="terminal-button">
|
||||
<div class="terminal-button-name" :class="{ active: terminal.id === nowTerminal.id }" @click="changePictureShow(terminal)">{{ terminal.name }}</div>
|
||||
<div class="terminal-button-text" @click="openNewWindow(terminal)">新窗口打开</div>
|
||||
<div v-if="!trainingDesign" class="terminal-button-text" @click="openNewWindow(terminal)">新窗口打开</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
@ -50,6 +50,9 @@ export default {
|
||||
},
|
||||
roles() {
|
||||
return this.$store.state.training.roles;
|
||||
},
|
||||
trainingDesign() {
|
||||
return this.$store.state.training.domConfig && this.$store.state.training.domConfig.trainingDesign;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@ -62,7 +65,7 @@ export default {
|
||||
if (client) {
|
||||
this.changePictureShow(client);
|
||||
}
|
||||
} else if (this.$route.query.client && !this.nowTerminal) {
|
||||
} else if (this.$route.query.client && !this.nowTerminal.id) {
|
||||
this.changeQueryClient();
|
||||
} else {
|
||||
this.initPictureShow();
|
||||
@ -155,6 +158,7 @@ export default {
|
||||
findTerminalFromMapById(id) {
|
||||
const mapClientMap = this.$store.state.map.map ? this.$store.state.map.map.mapClientVOMap : {};
|
||||
const mapClientList = mapClientMap ? mapClientMap[this.$route.query.simType] : [];
|
||||
console.log(mapClientList, id, this.$route.query.simType, mapClientMap);
|
||||
return mapClientList.find(item => item.id === id);
|
||||
},
|
||||
findTerminalFromMap(type) {
|
||||
|
@ -249,6 +249,11 @@
|
||||
<el-input-number v-model="batchForm.NCC_DISPATCHER" size="small" :min="0" :step="1" :precision="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="信息调度:" prop="OCC_DISPATCHER">
|
||||
<el-input-number v-model="batchForm.OCC_DISPATCHER" size="small" :min="0" :step="1" :precision="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item>
|
||||
@ -471,6 +476,7 @@ export default {
|
||||
batchForm: {
|
||||
DISPATCHER: 0,
|
||||
NCC_DISPATCHER: 0,
|
||||
OCC_DISPATCHER: 0,
|
||||
STATION_SUPERVISOR: 0,
|
||||
DRIVER: 0,
|
||||
MAINTAINER: 0,
|
||||
@ -592,7 +598,8 @@ export default {
|
||||
name += findType.label;
|
||||
}
|
||||
name += '-';
|
||||
if (obj.type == 'NCC_DISPATCHER') {
|
||||
const typeList = ['NCC_DISPATCHER', 'OCC_DISPATCHER'];
|
||||
if (typeList.includes(obj.type)) {
|
||||
if (obj.name) {
|
||||
name += obj.name;
|
||||
}
|
||||
@ -718,6 +725,17 @@ export default {
|
||||
memberMap[this.batchForm.systemType].push(member);
|
||||
}
|
||||
}
|
||||
if (this.batchForm.OCC_DISPATCHER) {
|
||||
for (let i = 0; i < this.batchForm.OCC_DISPATCHER; i++) {
|
||||
const member = {
|
||||
id: this.getMemberId(this.batchForm.systemType),
|
||||
name: '',
|
||||
type: 'OCC_DISPATCHER',
|
||||
deviceCode: ''
|
||||
};
|
||||
memberMap[this.batchForm.systemType].push(member);
|
||||
}
|
||||
}
|
||||
this.stationList.forEach(station => {
|
||||
if (!station.depot) {
|
||||
if (this.batchForm.STATION_SUPERVISOR) {
|
||||
@ -917,6 +935,7 @@ export default {
|
||||
this.batchForm = {
|
||||
DISPATCHER: 0,
|
||||
NCC_DISPATCHER: 0,
|
||||
OCC_DISPATCHER: 0,
|
||||
STATION_SUPERVISOR: 0,
|
||||
DRIVER: 0,
|
||||
MAINTAINER: 0,
|
||||
@ -979,6 +998,13 @@ export default {
|
||||
deviceCode: ''
|
||||
};
|
||||
memberMap[this.generationForm.systemType].push(memberNccDispatcher);
|
||||
const memberOccDispatcher = {
|
||||
id: this.getMemberId(this.generationForm.systemType),
|
||||
name: '',
|
||||
type: 'OCC_DISPATCHER',
|
||||
deviceCode: ''
|
||||
};
|
||||
memberMap[this.generationForm.systemType].push(memberOccDispatcher);
|
||||
this.stationList.forEach(station => {
|
||||
if (!station.depot) {
|
||||
const member = {
|
||||
|
@ -245,6 +245,12 @@ export default {
|
||||
code: 'driverAtsWork',
|
||||
isShow: () => type === 'METRO'
|
||||
|
||||
},
|
||||
{
|
||||
name: '司机站场图',
|
||||
code: 'driverAtsWork',
|
||||
isShow: () => type === 'RAILWAY'
|
||||
|
||||
},
|
||||
{
|
||||
name: '运行图预览',
|
||||
|
@ -4,7 +4,7 @@
|
||||
<el-form-item label="项目:" prop="projectCode">
|
||||
<el-select v-model="formModel.projectCode" placeholder="请选择项目">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
v-for="item in projectList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@ -23,8 +23,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ProjectList } from '@/scripts/ProjectConfig';
|
||||
import { createProjectPackage } from '@/api/management/distribute';
|
||||
import { getBackProjectConfigList } from '@/api/projectConfig';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -33,18 +33,22 @@ export default {
|
||||
num: 1,
|
||||
projectCode: ''
|
||||
},
|
||||
options: []
|
||||
projectList: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
ProjectList.forEach(item => {
|
||||
this.options.push({label: item.label, value: item.value.toUpperCase()});
|
||||
getBackProjectConfigList().then(resp => {
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.projectList = resp.data;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.centerDialogVisible = true;
|
||||
this.formModel.projectCode = this.options[0].value;
|
||||
this.formModel.projectCode = this.projectList[0].value;
|
||||
},
|
||||
doClose() {
|
||||
this.centerDialogVisible = false;
|
||||
|
@ -138,7 +138,7 @@ export default {
|
||||
});
|
||||
},
|
||||
parseTime(time) {
|
||||
if (!time) { return ''; }
|
||||
if (!time) { return '0'; }
|
||||
const hours = Math.floor(time / 3600);
|
||||
const minutes = Math.floor((time % 3600) / 60);
|
||||
return hours + '小时' + minutes + '分';
|
||||
|
@ -1,97 +0,0 @@
|
||||
<template>
|
||||
<div id="mychart1" style="width:100%;height:100%"/>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
import { getLessonList } from '@/api/management/userexam';
|
||||
export default {
|
||||
name: 'ExamStatistics',
|
||||
data() {
|
||||
return {
|
||||
myChart2:null,
|
||||
title:{
|
||||
show:true,
|
||||
subtext:'',
|
||||
subtextStyle:{color:'#358ff8',fontSize:14},
|
||||
text:'学习时长统计',
|
||||
textAlign:'center',
|
||||
left:'50%',
|
||||
top:'5px',
|
||||
textStyle:{
|
||||
color:'#f00'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
this.initChart()
|
||||
this.loadData();
|
||||
},
|
||||
methods: {
|
||||
initChart(){
|
||||
var chartDom1 = document.getElementById('mychart1');
|
||||
this.myChart1 = echarts.init(chartDom1);
|
||||
let option1={
|
||||
title: this.title,
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function (params, ticket, callback) {
|
||||
let value=params.data.value;
|
||||
let hour=0;
|
||||
let minu=0;
|
||||
let seconds=0;
|
||||
hour=Math.floor(value/3600);
|
||||
minu=Math.floor((value%3600)/60);
|
||||
seconds=Math.floor((value%3600)%60);
|
||||
// hour=hour>9?hour:'0'+hour;
|
||||
// minu=minu>9?minu:'0'+minu;
|
||||
// seconds=seconds>9?seconds:'0'+seconds;
|
||||
let temp=hour+'时'+minu+"分"+seconds+'秒';
|
||||
let start=params.data.name?params.data.name+': ':params.data.name;
|
||||
return '<p>'+start+temp+'</p>'
|
||||
}
|
||||
},
|
||||
color:['#358ff8','#91cb74','#f7c757','#ec6566','#73c0de','#4ca273','#ee8250','#9a60b4','#ea7ccc','#59eca9'],
|
||||
legend: {orient: 'vertical',left: 'left',top:'65px'},
|
||||
series: [
|
||||
{
|
||||
data:[{value:0,name:''}],
|
||||
label:{show:false},
|
||||
radius: '60%',
|
||||
top:'60px',
|
||||
showEmptyCircle:true,
|
||||
type: 'pie'
|
||||
}
|
||||
]
|
||||
}
|
||||
option1 && this.myChart1 && this.myChart1.setOption(option1);
|
||||
},
|
||||
loadData(){
|
||||
getLessonList().then(response => {
|
||||
let timeList=response.data;
|
||||
if(timeList){
|
||||
let realList=[];
|
||||
let allcount=0;
|
||||
timeList.forEach(eachItem=>{
|
||||
allcount+=parseInt(eachItem.duration);
|
||||
realList.push({value:eachItem.duration,name:eachItem.statsProjectName});
|
||||
})
|
||||
let option=this.myChart1.getOption();
|
||||
let hour=0;
|
||||
let minu=0;
|
||||
let seconds=0;
|
||||
hour=Math.floor(allcount/3600);
|
||||
minu=Math.floor((allcount%3600)/60);
|
||||
seconds=Math.floor((allcount%3600)%60);
|
||||
if(timeList.length==0){realList=[{value:0,name:''}]}
|
||||
option.title[0].subtext="总时长: "+hour+'时'+minu+"分"+seconds+'秒';
|
||||
option.series[0].data=realList;
|
||||
option && this.myChart1 && this.myChart1.setOption(option);
|
||||
}
|
||||
}).catch(error=>{
|
||||
this.$message.error(error.message)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -1,42 +1,64 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="student_title_content">{{ '统计信息' }}</div>
|
||||
<el-button type="text" style="position: fixed;right: 20px;top: 70px;" @click="back">返回</el-button>
|
||||
<div class="statisticChart">
|
||||
<div class="statisticChartLeft" >
|
||||
<!-- id="mychart1" -->
|
||||
<exam-statistics/>
|
||||
</div>
|
||||
<!-- <div class="statisticChartCenter"> -->
|
||||
<!-- :creatorId="creatorId" :orgId="orgId" -->
|
||||
<!-- <grade-statistics :userId="userId"/> -->
|
||||
<!-- </div> -->
|
||||
<div id="mychart3" class="statisticChartRight" />
|
||||
</div>
|
||||
<div class="statistics-box">
|
||||
<div class="student_title_content">{{ '统计信息' }}</div>
|
||||
<el-button type="text" style="position: fixed;right: 20px;top: 70px;color: #fbfbfb;" @click="back">返回</el-button>
|
||||
<!-- <div class="statisticChart">-->
|
||||
<!-- <div id="mychart3" class="statisticChartRight" />-->
|
||||
<!-- </div>-->
|
||||
<div style="width: 90%;margin: 0 auto;">
|
||||
<el-form :inline="true" :model="queryForm" class="demo-form-inline">
|
||||
<el-form-item label="统计单位">
|
||||
<el-select v-model="queryForm.timeUnit" placeholder="统计单位">
|
||||
<el-option
|
||||
v-for="item in timeUnitList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="统计时段">
|
||||
<el-date-picker
|
||||
v-model="queryForm.times"
|
||||
type="datetimerange"
|
||||
:clearable="false"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="loadData">查询</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div id="mychart4" style="width: 100%;height: 500px;margin-top: 50px;" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
// import GradeStatistics from './gradeStatistic.vue';
|
||||
import ExamStatistics from './examStatistic.vue';
|
||||
import { getSimulationTimeChart } from '@/api/management/userexam';
|
||||
import { getSubSystemByProjectCode } from '@/api/trainingPlatform';
|
||||
import { queryUserSimulationRecord } from '@/api/record';
|
||||
import { timestampFormat } from '@/utils/date';
|
||||
export default {
|
||||
name: 'StudentStatistics',
|
||||
// GradeStatistics
|
||||
components: {
|
||||
ExamStatistics
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
myChart3:null,
|
||||
// creatorId:'',
|
||||
// orgId:'',
|
||||
// userId:'',
|
||||
queryForm: {
|
||||
timeUnit: 'DAY',
|
||||
times: []
|
||||
},
|
||||
timeUnitList:[
|
||||
{ label: '天', value: 'DAY' },
|
||||
{ label: '月', value: 'MONTH' },
|
||||
{ label: '年', value: 'YEAR' }
|
||||
],
|
||||
myChart:null,
|
||||
title:{
|
||||
show:true,
|
||||
subtext:'',
|
||||
subtextStyle:{color:'#358ff8',fontSize:14},
|
||||
subtextStyle:{color:'#358ff8', fontSize:14},
|
||||
text:'仿真时长统计',
|
||||
textAlign:'center',
|
||||
left:'50%',
|
||||
@ -44,112 +66,115 @@ export default {
|
||||
textStyle:{
|
||||
color:'#f00'
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
this.initChart()
|
||||
this.queryForm.times = [timestampFormat('YYYY-MM-DD HH:mm:ss', new Date() - 1000 * 60 * 60 * 24 * 7), timestampFormat('YYYY-MM-DD HH:mm:ss', new Date())];
|
||||
this.initChart();
|
||||
this.loadData();
|
||||
// this.userId=this.$store.state.user.id;
|
||||
// this.orgId=this.$store.state.user.companyId;
|
||||
},
|
||||
methods: {
|
||||
initChart(){
|
||||
var chartDom3 = document.getElementById('mychart3');
|
||||
this.myChart3 = echarts.init(chartDom3);
|
||||
let option3={
|
||||
title: this.title,
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: function (params, ticket, callback) {
|
||||
let value=params.data.value;
|
||||
let hour=0;
|
||||
let minu=0;
|
||||
let seconds=0;
|
||||
hour=Math.floor(value/3600);
|
||||
minu=Math.floor((value%3600)/60);
|
||||
seconds=Math.floor((value%3600)%60);
|
||||
// hour=hour>9?hour:'0'+hour;
|
||||
// minu=minu>9?minu:'0'+minu;
|
||||
// seconds=seconds>9?seconds:'0'+seconds;
|
||||
let temp=hour+'时'+minu+"分"+seconds+'秒';
|
||||
let start=params.data.name?params.data.name+': ':params.data.name;
|
||||
return '<p>'+start+temp+'</p>'
|
||||
initChart() {
|
||||
const charDom = document.getElementById('mychart4');
|
||||
this.myChart = echarts.init(charDom);
|
||||
const option = {
|
||||
title:{
|
||||
show:true,
|
||||
text:'仿真时长统计',
|
||||
textAlign:'center',
|
||||
left:'50%',
|
||||
top:'0',
|
||||
textStyle:{
|
||||
color:'#fff',
|
||||
fontSize: 26
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
name: '时长',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
width: 3
|
||||
}
|
||||
},
|
||||
nameTextStyle: {
|
||||
fontSize: 18
|
||||
},
|
||||
data: []
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
name: '时长',
|
||||
nameTextStyle: {
|
||||
fontSize: 18
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: '{value} 分钟'
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#fff',
|
||||
width: 3
|
||||
}
|
||||
}
|
||||
},
|
||||
color:['#358ff8','#91cb74','#f7c757','#ec6566','#73c0de','#4ca273','#ee8250','#9a60b4','#ea7ccc','#59eca9'],
|
||||
legend: {left: 'left',top:'65px',orient:'horizontal'},
|
||||
// http://2i38984j47.qicp.vip/doc/UserExamController.html
|
||||
series: [
|
||||
{
|
||||
data:[{value:0,name:''}],
|
||||
label:{show:false},
|
||||
showEmptyCircle:true,
|
||||
radius: '60%',
|
||||
top:'60px',
|
||||
type: 'pie'
|
||||
data: [],
|
||||
type: 'bar',
|
||||
itemStyle: {
|
||||
color: '#3c9bee'
|
||||
},
|
||||
barMaxWidth: 20,
|
||||
label: {
|
||||
show: true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
option3 && this.myChart3 && this.myChart3.setOption(option3);
|
||||
};
|
||||
this.myChart.setOption(option);
|
||||
},
|
||||
loadData(){
|
||||
// getPublishLessonListByMapId({mapId:this.mapId}).then(response => {
|
||||
getSubSystemByProjectCode().then(response => {
|
||||
let mapIdList = response.data;
|
||||
if(mapIdList.length>0){
|
||||
getSimulationTimeChart(mapIdList[0].id).then(res=>{
|
||||
let list=mapIdList[0].children.find(child=>{return child.id=='Simulation'})
|
||||
let dataMap={};
|
||||
if(list){
|
||||
list.children.forEach(item=>{
|
||||
dataMap[item.id]=item.name
|
||||
})
|
||||
}
|
||||
let timeList=res.data;
|
||||
if(timeList){
|
||||
let realList=[];
|
||||
let allcount=0;
|
||||
timeList.forEach(eachItem=>{
|
||||
let realtName=dataMap[eachItem.statsProjectId];
|
||||
if(realtName){
|
||||
allcount+=parseInt(eachItem.duration);
|
||||
realList.push({value:eachItem.duration,name:realtName});
|
||||
}
|
||||
})
|
||||
if(timeList.length==0){realList=[{value:0,name:''}]}
|
||||
let option=this.myChart3.getOption();
|
||||
option.series[0].data=realList;
|
||||
let hour=0;
|
||||
let minu=0;
|
||||
let seconds=0;
|
||||
hour=Math.floor(allcount/3600);
|
||||
minu=Math.floor((allcount%3600)/60);
|
||||
seconds=Math.floor((allcount%3600)%60);
|
||||
option.title[0].subtext="总时长: "+hour+'时'+minu+"分"+seconds+'秒';
|
||||
option && this.myChart3 && this.myChart3.setOption(option);
|
||||
}
|
||||
}).catch(error=>{
|
||||
this.$message.error(error.message)
|
||||
});
|
||||
}
|
||||
}).catch(error=>{
|
||||
this.$message.error(error.message)
|
||||
loadData() {
|
||||
const data = { timeUnit: this.queryForm.timeUnit, startTime: this.queryForm.times[0], endTime: this.queryForm.times[1] };
|
||||
queryUserSimulationRecord(data, this.$store.state.user.id).then(resp => {
|
||||
const option = this.myChart.getOption();
|
||||
const dates = [];
|
||||
const datas = [];
|
||||
(resp.data || []).forEach(item => {
|
||||
datas.push(Math.ceil(item.duration / 60));
|
||||
dates.push(item.timeSegment);
|
||||
});
|
||||
option.series[0].data = datas;
|
||||
option.xAxis[0].data = dates;
|
||||
option && this.myChart && this.myChart.setOption(option);
|
||||
});
|
||||
},
|
||||
back(){
|
||||
back() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
onSubmit() {
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.statistics-box{
|
||||
background: linear-gradient(to bottom, #01468B, #00172E);
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.student_title_content {
|
||||
width: 100%;
|
||||
margin: 20px 0 30px;
|
||||
padding: 30px;
|
||||
text-align: left;
|
||||
font-size: 22px;
|
||||
padding-left: 30px;
|
||||
color: #fbfbfb;
|
||||
}
|
||||
/deep/.el-form-item__label{
|
||||
color: #fbfbfb;
|
||||
}
|
||||
.statisticChart{
|
||||
width:90%;
|
||||
@ -163,11 +188,6 @@ export default {
|
||||
height: 500px;
|
||||
/* border:1px #ccc solid */
|
||||
}
|
||||
/* .statisticChartCenter{
|
||||
width: 40%;
|
||||
display: inline-block;
|
||||
height: 500px;
|
||||
} */
|
||||
.statisticChartRight{
|
||||
/* width: 30%; */
|
||||
width: 50%;
|
||||
|
@ -10,8 +10,7 @@ import { getPermissionPage } from '@/api/permissionManage';
|
||||
import Create from './create';
|
||||
import { getAllAbility } from '@/api/functionManage';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { ProjectList } from '@/scripts/ProjectConfig';
|
||||
|
||||
import { getBackProjectConfigList } from '@/api/projectConfig';
|
||||
export default {
|
||||
name: 'PermissionManage',
|
||||
components: {
|
||||
@ -41,6 +40,7 @@ export default {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
projectList: [],
|
||||
queryForm: {
|
||||
columnNum: 6,
|
||||
labelWidth: '100px',
|
||||
@ -164,11 +164,6 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
projectList() {
|
||||
return ProjectList;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getAllAbility();
|
||||
if (this.tableHeight) {
|
||||
@ -179,7 +174,17 @@ export default {
|
||||
methods: {
|
||||
loadInitData() {
|
||||
this.queryForm.queryObject.permissionType.config.data = this.$ConstSelect.permissionTypeList;
|
||||
this.queryForm.queryObject.projectCode.config.data = ProjectList;
|
||||
getBackProjectConfigList().then(resp => {
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
resp.data.forEach(item => {
|
||||
const obj = { value: item.value.toLowerCase(), label: item.label };
|
||||
this.projectList.push(obj);
|
||||
});
|
||||
this.queryForm.queryObject.projectCode.config.data = this.projectList;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
// 获取地图
|
||||
getPublishMapListOnline().then(res => {
|
||||
res.data.forEach(elem => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div id="PlanTitleBar">
|
||||
<img class="logo" :src="logoImg">
|
||||
<img class="logo" :src="loginProLogo">
|
||||
<span> {{ mapName }}  </span>
|
||||
<span v-if="runPlanName">({{ runPlanName }})</span>
|
||||
<!-- <span class="system-close el-icon-close" @click="back" />-->
|
||||
@ -9,25 +9,24 @@
|
||||
|
||||
<script>
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { ProjectIcon } from '@/scripts/ProjectConfig';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import {mapGetters} from 'vuex';
|
||||
|
||||
export default {
|
||||
name: 'PlanTitleBar',
|
||||
data() {
|
||||
return {
|
||||
mapName: '',
|
||||
logoImg: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters('projectConfig', [
|
||||
'loginProLogo'
|
||||
]),
|
||||
runPlanName() {
|
||||
return this.$route.query.planName || '';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const project = getSessionStorage('project');
|
||||
this.logoImg = ProjectIcon[project];
|
||||
if (this.$route.query.mapId) {
|
||||
getPublishMapInfo(this.$route.query.mapId).then(resp => {
|
||||
this.mapName = resp.data.name;
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div v-loading="loading">
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<update-operate ref="updateMapInfo" @create="handleUpdate" />
|
||||
<set-project ref="setProject" @refresh="reloadTable" />
|
||||
<set-project ref="setProject" :project-list="projectList" @refresh="reloadTable" />
|
||||
<copy-map ref="copyMap" @refresh="reloadTable" />
|
||||
<local-map ref="localMap" />
|
||||
<export-map ref="exportMap" />
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
<script>
|
||||
import { getPublishMapList, delPublishMap, putMapOnLine, putMapOffLine, simulationCheck, localImportMap, updatePublishMapInfo,
|
||||
getPublishMapExport, getPublishMapImportNew, generateAncillaryData, allSimulationCheck } from '@/api/jmap/map';
|
||||
getPublishMapExport, getPublishMapImportNew, generateAncillaryData, allSimulationCheck, generateTrainingData } from '@/api/jmap/map';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
import localStore from 'storejs';
|
||||
import UpdateOperate from './draft.vue';
|
||||
@ -37,8 +37,8 @@ import LocalMap from './localMap';
|
||||
import ExportMap from './exportMap';
|
||||
import MapSort from './mapSort';
|
||||
import { superAdmin } from '@/router/index';
|
||||
import { ProjectList } from '@/scripts/ProjectConfig';
|
||||
import { getPermissionQuickly } from '@/api/management/author';
|
||||
import { getBackProjectConfigList } from '@/api/projectConfig';
|
||||
|
||||
export default {
|
||||
name: 'PublishMap',
|
||||
@ -57,6 +57,7 @@ export default {
|
||||
cityList: [],
|
||||
mapName: '',
|
||||
mapId: '',
|
||||
projectList: [],
|
||||
permissionNum: 10,
|
||||
lineCodeList: [],
|
||||
pagerConfig: {
|
||||
@ -116,7 +117,7 @@ export default {
|
||||
title: '归属项目',
|
||||
prop: 'projectCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return row.project ? this.$convertField((row.projectCode || '').toLowerCase(), ProjectList, ['value', 'label']) : '无'; },
|
||||
columnValue: (row) => { return row.project ? this.$convertField((row.projectCode || ''), this.projectList, ['value', 'label']) : '无'; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
@ -215,6 +216,10 @@ export default {
|
||||
{
|
||||
name: '每日运行图管理',
|
||||
handleClick: this.runPlanEveryDayManage
|
||||
},
|
||||
{
|
||||
name: '生成实训',
|
||||
handleClick: this.produceTraining
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -258,6 +263,13 @@ export default {
|
||||
});
|
||||
this.queryForm.queryObject.lineCode.config.data = this.lineCodeList;
|
||||
});
|
||||
getBackProjectConfigList().then(resp => {
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.projectList = resp.data;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
handleSetProject(index, row) {
|
||||
this.$refs.setProject.doShow(row);
|
||||
@ -491,6 +503,24 @@ export default {
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
produceTraining(index, row) {
|
||||
this.$confirm('是否生成实训?', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
generateTrainingData([row.id]).then(res => {
|
||||
if (res.data.length) {
|
||||
const s = res.data.join(';');
|
||||
this.$message.error(`生成实训失败!${s}`);
|
||||
} else {
|
||||
this.$message.success('生成实训成功!');
|
||||
}
|
||||
}).catch((err) => {
|
||||
this.$message.error(`生成实训失败!${err.message}`);
|
||||
});
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
|
@ -2,12 +2,14 @@
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<edit-subsystem ref="editSubsystem" @tableReload="reloadTable" />
|
||||
<overlay-generation ref="overlayGeneration" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryTemplateMapFunPaged, deleteTemplateMapFunction } from '@/api/trainingPlatform';
|
||||
import EditSubsystem from './edit';
|
||||
import OverlayGeneration from './overlayGeneration';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
const simTypeMap = {
|
||||
METRO: '地铁CBTC',
|
||||
@ -17,7 +19,8 @@ const simTypeMap = {
|
||||
export default {
|
||||
name: 'PublishMap',
|
||||
components: {
|
||||
EditSubsystem
|
||||
EditSubsystem,
|
||||
OverlayGeneration
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -106,6 +109,7 @@ export default {
|
||||
],
|
||||
actions: [
|
||||
{ text: '新建', handler: this.handleAddSubsystem },
|
||||
{ text: '覆盖生成', handler: this.overlayGeneration },
|
||||
{ text: '返回', handler: this.goBack }
|
||||
]
|
||||
}
|
||||
@ -135,6 +139,9 @@ export default {
|
||||
handleAddSubsystem() {
|
||||
this.$refs.editSubsystem.doShow();
|
||||
},
|
||||
overlayGeneration() {
|
||||
this.$refs.overlayGeneration.doShow();
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
|
@ -0,0 +1,146 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="580px" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<el-form ref="ruleForm" :model="formModel" :rules="rules" label-width="80px">
|
||||
<el-form-item label="地图:" prop="ids">
|
||||
<el-select v-model="formModel.ids" multiple placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in mapIdList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="submit">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { generateMapFun } from '@/api/trainingPlatform';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
export default {
|
||||
name: 'OverlayGeneration',
|
||||
data() {
|
||||
return {
|
||||
mapIdList: [],
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
ids: []
|
||||
},
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
rules() {
|
||||
const crules = {
|
||||
ids: [
|
||||
{ required: true, message: '请选择需要重新生成的地图', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return '覆盖生成线路功能';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
getPublishMapListOnline().then(response => {
|
||||
this.mapIdList = response.data;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
doShow() {
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ruleForm.resetFields();
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
this.$refs.ruleForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
generateMapFun(this.formModel.ids).then(resp => {
|
||||
if (resp.data && resp.data.length) {
|
||||
let message = '';
|
||||
resp.data.forEach(item => {
|
||||
message = message + item + ';';
|
||||
});
|
||||
this.$messageBox(message);
|
||||
} else {
|
||||
this.$message.success('覆盖生成客户端成功!');
|
||||
}
|
||||
this.handleClose();
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
ids: []
|
||||
};
|
||||
this.$refs.ruleForm.resetFields();
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chat-box-footer-create{
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
left: 5px;
|
||||
top: 6px;
|
||||
line-height: 30px;
|
||||
cursor: pointer;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
background: green;
|
||||
border: none;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.chat-box-footer-send{
|
||||
background: #F2F2F2;
|
||||
right: 55px;
|
||||
cursor: pointer;
|
||||
.icon-yuyin{
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
margin: 0;
|
||||
}
|
||||
&.active{
|
||||
.icon-yuyin{
|
||||
color: green;
|
||||
}
|
||||
}
|
||||
.close_icon{
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left: 45px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
padding: 3px;
|
||||
}
|
||||
}
|
||||
#record_progress_bar{
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
</style>
|
@ -19,7 +19,7 @@
|
||||
}"
|
||||
>
|
||||
<el-select v-model="formModel.projectCode" :placeholder="this.$t('publish.pleaseSelectTheBelongsProject')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
<el-option v-for="item in projectList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -32,9 +32,16 @@
|
||||
|
||||
<script>
|
||||
import { setMapProject } from '@/api/jmap/map';
|
||||
import { getBackProjectConfigList } from '@/api/projectConfig';
|
||||
export default {
|
||||
name: 'SetMapProject',
|
||||
props: {
|
||||
projectList: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
@ -50,18 +57,8 @@ export default {
|
||||
booleanValue: {
|
||||
t: true,
|
||||
f: false
|
||||
},
|
||||
options: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
getBackProjectConfigList().then(resp => {
|
||||
if (resp.data && resp.data.length > 0) {
|
||||
this.options = resp.data;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
doShow(row) {
|
||||
|
@ -16,9 +16,18 @@
|
||||
<el-form-item label="联系方式:" prop="loginContectInformation" class="inlineBlock">
|
||||
<el-switch v-model="formModel.loginContectInformation" />
|
||||
</el-form-item>
|
||||
<el-form-item label="展示版权:" prop="copyrightShow" class="inlineBlock">
|
||||
<el-switch v-model="formModel.copyrightShow" />
|
||||
</el-form-item>
|
||||
<el-form-item label="关于系统:" prop="aboutSystem">
|
||||
<el-input v-model="formModel.aboutSystem" style="width: 400px;" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="底部栏公司信息:" prop="bottomCompanyInfo">
|
||||
<el-input v-model="formModel.bottomCompanyInfo" style="width: 400px;" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="底部栏备案号:" prop="bottomRecordNumber">
|
||||
<el-input v-model="formModel.bottomRecordNumber" style="width: 400px;" size="small" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目Logo:" prop="loginProLogo">
|
||||
<div class="eachButton uploadLogo">
|
||||
<img v-if="formModel.loginProLogo" :src="computedLoginLogo" :alt="computedLoginLogo" class="loginLogo">
|
||||
@ -49,6 +58,9 @@
|
||||
<el-form-item label="本地项目:" prop="localProject" class="inlineBlock">
|
||||
<el-switch v-model="formModel.localProject" />
|
||||
</el-form-item>
|
||||
<el-form-item label="中航项目:" prop="isRichor" class="inlineBlock">
|
||||
<el-switch v-model="formModel.isRichor" />
|
||||
</el-form-item>
|
||||
<br>
|
||||
<el-form-item label="登陆后跳转路径:" prop="judgeRoute" class="inlineBlock">
|
||||
<el-input v-model="formModel.judgeRoute" style="width: 210px;" size="small" />
|
||||
@ -89,6 +101,8 @@ export default {
|
||||
loginProLogo:'', // 登录页 logo
|
||||
loginProLogoWidth:0, // 登录页 logo 宽度
|
||||
homeProLogoWidth:0, // 主页 logo 宽度
|
||||
bottomCompanyInfo: '',
|
||||
bottomRecordNumber: '',
|
||||
|
||||
browserTitle:'', // 浏览器页签名称
|
||||
homeTitle:'', // 导航栏名称
|
||||
@ -97,6 +111,8 @@ export default {
|
||||
caseShow:true, // 导航栏案例展示是否展示
|
||||
helpShow:true, // 导航栏帮助展示是否展示
|
||||
localProject:false, // 是否本地项目
|
||||
isRichor: false, // 中航项目 控制联系我们展示中航联系方式
|
||||
copyrightShow: false, // 展示版权
|
||||
|
||||
judgeRoute:'', // 跳转路径
|
||||
baseApiUrl:'', // api链接
|
||||
@ -146,6 +162,8 @@ export default {
|
||||
this.loginProLogoImg = this.formModel.loginProLogo;
|
||||
this.formModel.loginProLogoWidth = viewSetting.loginProLogoWidth || 0;
|
||||
this.formModel.homeProLogoWidth = viewSetting.homeProLogoWidth || 0;
|
||||
this.formModel.bottomCompanyInfo = viewSetting.bottomCompanyInfo || '';
|
||||
this.formModel.bottomRecordNumber = viewSetting.bottomRecordNumber || '';
|
||||
|
||||
this.formModel.browserTitle = viewSetting.browserTitle || '';
|
||||
this.formModel.homeTitle = viewSetting.homeTitle || '';
|
||||
@ -154,6 +172,8 @@ export default {
|
||||
this.formModel.caseShow = viewSetting.caseShow || false;
|
||||
this.formModel.helpShow = viewSetting.helpShow || false;
|
||||
this.formModel.localProject = viewSetting.localProject || false;
|
||||
this.formModel.isRichor = viewSetting.isRichor || false;
|
||||
this.formModel.copyrightShow = viewSetting.copyrightShow || false;
|
||||
|
||||
this.formModel.judgeRoute = viewSetting.judgeRoute || '';
|
||||
this.formModel.baseApiUrl = viewSetting.baseApiUrl || '';
|
||||
@ -173,6 +193,8 @@ export default {
|
||||
loginProLogo:'', // 登录页 logo
|
||||
loginProLogoWidth:'', // 登录页 logo 宽度
|
||||
homeProLogoWidth:'', // 主页 logo 宽度
|
||||
bottomCompanyInfo: '',
|
||||
bottomRecordNumber: '',
|
||||
|
||||
browserTitle:'', // 浏览器页签名称
|
||||
homeTitle:'', // 导航栏名称
|
||||
@ -181,6 +203,8 @@ export default {
|
||||
caseShow:true, // 导航栏案例展示是否展示
|
||||
helpShow:true, // 导航栏帮助展示是否展示
|
||||
localProject:false, // 是否本地项目
|
||||
isRichor: false, // 中航项目 控制联系我们展示中航联系方式
|
||||
copyrightShow: false, // 展示版权
|
||||
|
||||
judgeRoute:'', // 跳转路径
|
||||
baseApiUrl:'', // api链接
|
||||
|
@ -1,118 +1,118 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<!--<template>-->
|
||||
<!-- <el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center :close-on-click-modal="false">-->
|
||||
<!-- <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />-->
|
||||
<!-- <span slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>-->
|
||||
<!-- <el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>-->
|
||||
<!-- </span>-->
|
||||
<!-- </el-dialog>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import { createProjectServer, updateProjectServer } from '@/api/projectServer';
|
||||
export default {
|
||||
name: 'DeviceAdd',
|
||||
props: {
|
||||
projectList: {
|
||||
type: Array,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
id: '',
|
||||
domainName: '',
|
||||
project: '',
|
||||
resourcesDomainName: ''
|
||||
},
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '120px',
|
||||
items: [
|
||||
{ prop: 'domainName', label: '接口域名', type: 'text', required: true, placeholder: '请输入域名' },
|
||||
{ prop: 'resourcesDomainName', label: '资源域名', type: 'text', required: true, placeholder: '请输入域名' },
|
||||
{ prop: 'project', label: '项目', type: 'select', required: true, options: this.projectList, placeholder: '请选择项目' }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
domainName: [
|
||||
{ required: true, message: '请输入接口域名', trigger: 'blur' }
|
||||
],
|
||||
resourcesDomainName: [
|
||||
{ required: true, message: '请输入资源域名', trigger: 'blur' }
|
||||
],
|
||||
project: [
|
||||
{ required: true, message: '请选择项目', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
},
|
||||
title() {
|
||||
return this.formModel.id ? '修改项目域名' : '创建项目域名';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
show(data) {
|
||||
if (data) {
|
||||
this.formModel.id = data.id;
|
||||
this.formModel.domainName = data.domainName;
|
||||
this.formModel.project = data.project;
|
||||
this.formModel.resourcesDomainName = data.resourcesDomainName;
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
this.loading = true;
|
||||
const data = {
|
||||
id: this.formModel.id,
|
||||
domainName: this.formModel.domainName,
|
||||
project: this.formModel.project.toUpperCase(),
|
||||
resourcesDomainName: this.formModel.resourcesDomainName
|
||||
};
|
||||
if (data.id) {
|
||||
updateProjectServer(data.id, data).then(resp => {
|
||||
this.$message.success('修改项目域名数据成功!');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
createProjectServer(data).then(resp => {
|
||||
this.$message.success('创建项目域名数据成功!');
|
||||
this.handleClose();
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
this.$message.error(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
this.formModel = {
|
||||
id: '',
|
||||
domainName: '',
|
||||
project: '',
|
||||
resourcesDomainName: ''
|
||||
};
|
||||
this.$refs.dataform.resetForm();
|
||||
this.dialogVisible = false;
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<!--<script>-->
|
||||
<!--import { createProjectServer, updateProjectServer } from '@/api/projectServer';-->
|
||||
<!--export default {-->
|
||||
<!-- name: 'DeviceAdd',-->
|
||||
<!-- props: {-->
|
||||
<!-- projectList: {-->
|
||||
<!-- type: Array,-->
|
||||
<!-- required: true-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- dialogVisible: false,-->
|
||||
<!-- formModel: {-->
|
||||
<!-- id: '',-->
|
||||
<!-- domainName: '',-->
|
||||
<!-- project: '',-->
|
||||
<!-- resourcesDomainName: ''-->
|
||||
<!-- },-->
|
||||
<!-- loading: false-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- form() {-->
|
||||
<!-- const form = {-->
|
||||
<!-- labelWidth: '120px',-->
|
||||
<!-- items: [-->
|
||||
<!-- { prop: 'domainName', label: '接口域名', type: 'text', required: true, placeholder: '请输入域名' },-->
|
||||
<!-- { prop: 'resourcesDomainName', label: '资源域名', type: 'text', required: true, placeholder: '请输入域名' },-->
|
||||
<!-- { prop: 'project', label: '项目', type: 'select', required: true, options: this.projectList, placeholder: '请选择项目' }-->
|
||||
<!-- ]-->
|
||||
<!-- };-->
|
||||
<!-- return form;-->
|
||||
<!-- },-->
|
||||
<!-- rules() {-->
|
||||
<!-- const crules = {-->
|
||||
<!-- domainName: [-->
|
||||
<!-- { required: true, message: '请输入接口域名', trigger: 'blur' }-->
|
||||
<!-- ],-->
|
||||
<!-- resourcesDomainName: [-->
|
||||
<!-- { required: true, message: '请输入资源域名', trigger: 'blur' }-->
|
||||
<!-- ],-->
|
||||
<!-- project: [-->
|
||||
<!-- { required: true, message: '请选择项目', trigger: 'change' }-->
|
||||
<!-- ]-->
|
||||
<!-- };-->
|
||||
<!-- return crules;-->
|
||||
<!-- },-->
|
||||
<!-- title() {-->
|
||||
<!-- return this.formModel.id ? '修改项目域名' : '创建项目域名';-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- mounted() {-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- show(data) {-->
|
||||
<!-- if (data) {-->
|
||||
<!-- this.formModel.id = data.id;-->
|
||||
<!-- this.formModel.domainName = data.domainName;-->
|
||||
<!-- this.formModel.project = data.project;-->
|
||||
<!-- this.formModel.resourcesDomainName = data.resourcesDomainName;-->
|
||||
<!-- }-->
|
||||
<!-- this.dialogVisible = true;-->
|
||||
<!-- },-->
|
||||
<!-- doSave() {-->
|
||||
<!-- this.$refs.dataform.validateForm(() => {-->
|
||||
<!-- this.loading = true;-->
|
||||
<!-- const data = {-->
|
||||
<!-- id: this.formModel.id,-->
|
||||
<!-- domainName: this.formModel.domainName,-->
|
||||
<!-- project: this.formModel.project.toUpperCase(),-->
|
||||
<!-- resourcesDomainName: this.formModel.resourcesDomainName-->
|
||||
<!-- };-->
|
||||
<!-- if (data.id) {-->
|
||||
<!-- updateProjectServer(data.id, data).then(resp => {-->
|
||||
<!-- this.$message.success('修改项目域名数据成功!');-->
|
||||
<!-- this.handleClose();-->
|
||||
<!-- this.$emit('reloadTable');-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error(error.message);-->
|
||||
<!-- this.loading = false;-->
|
||||
<!-- });-->
|
||||
<!-- } else {-->
|
||||
<!-- createProjectServer(data).then(resp => {-->
|
||||
<!-- this.$message.success('创建项目域名数据成功!');-->
|
||||
<!-- this.handleClose();-->
|
||||
<!-- this.$emit('reloadTable');-->
|
||||
<!-- }).catch(error => {-->
|
||||
<!-- this.$message.error(error.message);-->
|
||||
<!-- this.loading = false;-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- handleClose() {-->
|
||||
<!-- this.formModel = {-->
|
||||
<!-- id: '',-->
|
||||
<!-- domainName: '',-->
|
||||
<!-- project: '',-->
|
||||
<!-- resourcesDomainName: ''-->
|
||||
<!-- };-->
|
||||
<!-- this.$refs.dataform.resetForm();-->
|
||||
<!-- this.dialogVisible = false;-->
|
||||
<!-- this.loading = false;-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
|
@ -1,166 +1,166 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<add-server ref="addServer" :project-list="projectList" @reloadTable="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
<!--<template>-->
|
||||
<!-- <div>-->
|
||||
<!-- <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />-->
|
||||
<!-- <add-server ref="addServer" :project-list="projectList" @reloadTable="reloadTable" />-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import { projectServerPaging, deleteProjectServer } from '@/api/projectServer';
|
||||
import { getSessionStorage } from '@/utils/auth';
|
||||
import { ProjectList } from '@/scripts/ProjectConfig';
|
||||
import AddServer from './add';
|
||||
export default {
|
||||
name: 'DeviceManage',
|
||||
components: {
|
||||
AddServer
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
examResultList: [],
|
||||
url: '',
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '120px',
|
||||
beforeQuery: this.beforeQuery,
|
||||
reset: true,
|
||||
queryObject: {
|
||||
project: {
|
||||
type: 'select',
|
||||
label: '项目:',
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
<!--<script>-->
|
||||
<!--import { projectServerPaging, deleteProjectServer } from '@/api/projectServer';-->
|
||||
<!--import { getSessionStorage } from '@/utils/auth';-->
|
||||
<!--import { ProjectList } from '@/scripts/ProjectConfig';-->
|
||||
<!--import AddServer from './add';-->
|
||||
<!--export default {-->
|
||||
<!-- name: 'DeviceManage',-->
|
||||
<!-- components: {-->
|
||||
<!-- AddServer-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- examResultList: [],-->
|
||||
<!-- url: '',-->
|
||||
<!-- pagerConfig: {-->
|
||||
<!-- pageSize: 'pageSize',-->
|
||||
<!-- pageIndex: 'pageNum'-->
|
||||
<!-- },-->
|
||||
<!-- queryForm: {-->
|
||||
<!-- labelWidth: '120px',-->
|
||||
<!-- beforeQuery: this.beforeQuery,-->
|
||||
<!-- reset: true,-->
|
||||
<!-- queryObject: {-->
|
||||
<!-- project: {-->
|
||||
<!-- type: 'select',-->
|
||||
<!-- label: '项目:',-->
|
||||
<!-- config: {-->
|
||||
<!-- data: []-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: projectServerPaging,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '接口域名',
|
||||
prop: 'domainName'
|
||||
},
|
||||
{
|
||||
title: '资源域名',
|
||||
prop: 'resourcesDomainName'
|
||||
},
|
||||
{
|
||||
title: '项目名称',
|
||||
prop: 'projectCode',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.handleProjectName(row.project, this.projectList); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.handleTime(row.createTime); },
|
||||
tagType: (row) => { return 'success'; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '300',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.editConfig
|
||||
},
|
||||
{
|
||||
name: this.$t('global.delete'),
|
||||
handleClick: this.handleDelete,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('global.add'), handler: this.createProjectServer}
|
||||
]
|
||||
},
|
||||
currentModel: {}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
projectCode() {
|
||||
return this.projectMap[getSessionStorage('project')];
|
||||
},
|
||||
projectList() {
|
||||
return [{value: 'default', label: '默认'}, { value: 'test', label: '测试' }, ...ProjectList];
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.queryForm.queryObject.project.config.data = this.projectList;
|
||||
},
|
||||
methods: {
|
||||
createProjectDevice() {
|
||||
this.$refs.add.show();
|
||||
},
|
||||
beforeQuery(params) {
|
||||
params.project = params.project.toUpperCase();
|
||||
return params;
|
||||
},
|
||||
computation(fieldValue, type) {
|
||||
let list = [];
|
||||
if (type === 'projectType') {
|
||||
list = this.projectList;
|
||||
} else if ( type === 'deviceType' ) {
|
||||
list = this.deviceTypeList;
|
||||
}
|
||||
let value = '';
|
||||
list.forEach((elem) => {
|
||||
elem.label = fieldValue;
|
||||
value = elem.value;
|
||||
});
|
||||
return value;
|
||||
},
|
||||
handleTime(time) {
|
||||
const timeList = time.split('T');
|
||||
let newTime = '';
|
||||
if (timeList.length > 1) {
|
||||
newTime = timeList[0] + ' ' + timeList[1];
|
||||
} else {
|
||||
newTime = time;
|
||||
}
|
||||
return newTime;
|
||||
},
|
||||
// 删除
|
||||
handleDelete(index, row) {
|
||||
this.$confirm('此操作将删除该域名数据!', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteProjectServer(row.id).then(response => {
|
||||
this.$message.success(this.$t('system.deleteSuccess'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.reloadTable();
|
||||
this.$messageBox(this.$t('error.deleteFailed'));
|
||||
});
|
||||
});
|
||||
},
|
||||
handleProjectName(projectCode, projectList) {
|
||||
const project = projectList.find(elem => elem.value.toUpperCase() === projectCode);
|
||||
return project ? project.label : '无效项目';
|
||||
},
|
||||
createProjectServer() {
|
||||
this.$refs.addServer.show();
|
||||
},
|
||||
editConfig(index, row) {
|
||||
this.$refs.addServer.show(row);
|
||||
},
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<!-- },-->
|
||||
<!-- queryList: {-->
|
||||
<!-- query: projectServerPaging,-->
|
||||
<!-- selectCheckShow: false,-->
|
||||
<!-- indexShow: true,-->
|
||||
<!-- columns: [-->
|
||||
<!-- {-->
|
||||
<!-- title: '接口域名',-->
|
||||
<!-- prop: 'domainName'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: '资源域名',-->
|
||||
<!-- prop: 'resourcesDomainName'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: '项目名称',-->
|
||||
<!-- prop: 'projectCode',-->
|
||||
<!-- type: 'tag',-->
|
||||
<!-- columnValue: (row) => { return this.handleProjectName(row.project, this.projectList); },-->
|
||||
<!-- tagType: (row) => { return 'success'; }-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: '创建时间',-->
|
||||
<!-- prop: 'createTime',-->
|
||||
<!-- type: 'tag',-->
|
||||
<!-- columnValue: (row) => { return this.handleTime(row.createTime); },-->
|
||||
<!-- tagType: (row) => { return 'success'; }-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- type: 'button',-->
|
||||
<!-- title: this.$t('global.operate'),-->
|
||||
<!-- width: '300',-->
|
||||
<!-- buttons: [-->
|
||||
<!-- {-->
|
||||
<!-- name: '编辑',-->
|
||||
<!-- handleClick: this.editConfig-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: this.$t('global.delete'),-->
|
||||
<!-- handleClick: this.handleDelete,-->
|
||||
<!-- type: 'danger'-->
|
||||
<!-- }-->
|
||||
<!-- ]-->
|
||||
<!-- }-->
|
||||
<!-- ],-->
|
||||
<!-- actions: [-->
|
||||
<!-- { text: this.$t('global.add'), handler: this.createProjectServer}-->
|
||||
<!-- ]-->
|
||||
<!-- },-->
|
||||
<!-- currentModel: {}-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- projectCode() {-->
|
||||
<!-- return this.projectMap[getSessionStorage('project')];-->
|
||||
<!-- },-->
|
||||
<!-- projectList() {-->
|
||||
<!-- return [{value: 'default', label: '默认'}, { value: 'test', label: '测试' }, ...ProjectList];-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- mounted() {-->
|
||||
<!-- this.queryForm.queryObject.project.config.data = this.projectList;-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- createProjectDevice() {-->
|
||||
<!-- this.$refs.add.show();-->
|
||||
<!-- },-->
|
||||
<!-- beforeQuery(params) {-->
|
||||
<!-- params.project = params.project.toUpperCase();-->
|
||||
<!-- return params;-->
|
||||
<!-- },-->
|
||||
<!-- computation(fieldValue, type) {-->
|
||||
<!-- let list = [];-->
|
||||
<!-- if (type === 'projectType') {-->
|
||||
<!-- list = this.projectList;-->
|
||||
<!-- } else if ( type === 'deviceType' ) {-->
|
||||
<!-- list = this.deviceTypeList;-->
|
||||
<!-- }-->
|
||||
<!-- let value = '';-->
|
||||
<!-- list.forEach((elem) => {-->
|
||||
<!-- elem.label = fieldValue;-->
|
||||
<!-- value = elem.value;-->
|
||||
<!-- });-->
|
||||
<!-- return value;-->
|
||||
<!-- },-->
|
||||
<!-- handleTime(time) {-->
|
||||
<!-- const timeList = time.split('T');-->
|
||||
<!-- let newTime = '';-->
|
||||
<!-- if (timeList.length > 1) {-->
|
||||
<!-- newTime = timeList[0] + ' ' + timeList[1];-->
|
||||
<!-- } else {-->
|
||||
<!-- newTime = time;-->
|
||||
<!-- }-->
|
||||
<!-- return newTime;-->
|
||||
<!-- },-->
|
||||
<!-- // 删除-->
|
||||
<!-- handleDelete(index, row) {-->
|
||||
<!-- this.$confirm('此操作将删除该域名数据!', this.$t('global.tips'), {-->
|
||||
<!-- confirmButtonText: this.$t('global.confirm'),-->
|
||||
<!-- cancelButtonText: this.$t('global.cancel'),-->
|
||||
<!-- type: 'warning'-->
|
||||
<!-- }).then(() => {-->
|
||||
<!-- deleteProjectServer(row.id).then(response => {-->
|
||||
<!-- this.$message.success(this.$t('system.deleteSuccess'));-->
|
||||
<!-- this.reloadTable();-->
|
||||
<!-- }).catch(() => {-->
|
||||
<!-- this.reloadTable();-->
|
||||
<!-- this.$messageBox(this.$t('error.deleteFailed'));-->
|
||||
<!-- });-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- handleProjectName(projectCode, projectList) {-->
|
||||
<!-- const project = projectList.find(elem => elem.value.toUpperCase() === projectCode);-->
|
||||
<!-- return project ? project.label : '无效项目';-->
|
||||
<!-- },-->
|
||||
<!-- createProjectServer() {-->
|
||||
<!-- this.$refs.addServer.show();-->
|
||||
<!-- },-->
|
||||
<!-- editConfig(index, row) {-->
|
||||
<!-- this.$refs.addServer.show(row);-->
|
||||
<!-- },-->
|
||||
<!-- reloadTable() {-->
|
||||
<!-- this.queryList.reload();-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
|
@ -1,201 +1,201 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import {createMapSubSystem, updateSubSystem, generateMapSystem, generateAppointMapSystem} from '@/api/trainingPlatform';
|
||||
import { ProjectList} from '@/scripts/ProjectConfig';
|
||||
import Cookies from 'js-cookie';
|
||||
export default {
|
||||
name: 'CreateSubSystem',
|
||||
props: {
|
||||
mapList:{
|
||||
required:true,
|
||||
type:Array
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
disabled:null,
|
||||
productList:[],
|
||||
typeList:[],
|
||||
title:'',
|
||||
isAdd:true,
|
||||
isGernerate:false,
|
||||
formModel:{
|
||||
customized:'',
|
||||
mapId:'',
|
||||
name: '',
|
||||
prdType: '',
|
||||
type: '',
|
||||
newApi: false,
|
||||
appoint: false,
|
||||
id:null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
prdTypeList() {
|
||||
const productTypeList = ConstConfig.ConstSelect.prdType;
|
||||
return Cookies.get('user_lang') == 'en'
|
||||
? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: productTypeList.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
},
|
||||
form() {
|
||||
let form = {};
|
||||
if (this.isAdd) {
|
||||
// 新增
|
||||
form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true, options: ProjectList},
|
||||
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList},
|
||||
{ prop: 'prdType', label: this.$t('system.prdType'), type: 'select', required: true, options:this.prdTypeList},
|
||||
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},
|
||||
{ prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true, options: this.typeList}
|
||||
]
|
||||
};
|
||||
} else if (this.isGernerate) {
|
||||
// 一键生成
|
||||
form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList},
|
||||
{ prop: 'appoint', label: '是否指定生成', type: 'switch'},
|
||||
{ prop: 'prdType', label: '产品类型', type: 'select', required: true, options: this.prdTypeList, show: this.formModel.appoint }
|
||||
]
|
||||
};
|
||||
} else {
|
||||
// 修改
|
||||
form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},
|
||||
{ prop: 'newApi', label: '是否使用新API', type: 'switch' }
|
||||
]
|
||||
};
|
||||
}
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
let crules = {};
|
||||
crules = {customized:[
|
||||
{ required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'}
|
||||
],
|
||||
mapId:[
|
||||
{ required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'}
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },
|
||||
{ required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' }
|
||||
],
|
||||
type:[
|
||||
{ required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'}
|
||||
],
|
||||
prdType:[
|
||||
{ required: true, message: this.$t('rules.productTypeInput'), trigger: 'change'}
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods:{
|
||||
loadInitData() {
|
||||
const customeredProductType = ConstConfig.ConstSelect.customeredProductType;
|
||||
this.typeList = Cookies.get('user_lang') == 'en'
|
||||
? customeredProductType.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: customeredProductType.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
},
|
||||
doShow({type, row}) {
|
||||
if (row) {
|
||||
this.title = this.$t('systemGenerate.modifySubSystem');
|
||||
this.isAdd = false;
|
||||
this.isGernerate = false;
|
||||
this.formModel.name = row.name;
|
||||
this.formModel.id = row.id;
|
||||
this.formModel.newApi = row.newApi || false;
|
||||
} else {
|
||||
if (type == 'add') {
|
||||
this.title = this.$t('systemGenerate.createSubSystem');
|
||||
this.isAdd = true;
|
||||
this.isGernerate = false;
|
||||
this.formModel.mapId = '';
|
||||
this.formModel.name = '';
|
||||
} else {
|
||||
this.title = '生成子系统';
|
||||
this.isAdd = false;
|
||||
this.isGernerate = true;
|
||||
this.formModel.mapId = '';
|
||||
}
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(()=>{
|
||||
this.$refs.dataform.clearValidate();
|
||||
});
|
||||
},
|
||||
doCreate() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.isAdd) {
|
||||
delete this.formModel.id;
|
||||
createMapSubSystem(this.formModel).then(response => {
|
||||
this.$message.success(this.$t('systemGenerate.createMapSystemSuccess'));
|
||||
self.$emit('reloadTable');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.createMapSystemFail'));
|
||||
});
|
||||
} else if (this.isGernerate) {
|
||||
if (this.formModel.appoint) {
|
||||
generateAppointMapSystem(this.formModel.mapId, this.formModel.prdType).then(resp => {
|
||||
this.$message.success('生成指定子系统成功!');
|
||||
self.$emit('reloadTable');
|
||||
}).catch(() => {
|
||||
this.$messageBox('生成指定子系统异常!');
|
||||
});
|
||||
} else {
|
||||
generateMapSystem(this.formModel.mapId).then(response => {
|
||||
this.$message.success(this.$t('systemGenerate.generateSuccess'));
|
||||
self.$emit('reloadTable');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.generateFail'));
|
||||
});
|
||||
}
|
||||
<!--<template>-->
|
||||
<!-- <div>-->
|
||||
<!-- <el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>-->
|
||||
<!-- <data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />-->
|
||||
<!-- <span slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>-->
|
||||
<!-- <el-button @click="doClose">{{ $t('global.cancel') }}</el-button>-->
|
||||
<!-- </span>-->
|
||||
<!-- </el-dialog>-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
<!--<script>-->
|
||||
<!--import ConstConfig from '@/scripts/ConstConfig';-->
|
||||
<!--import {createMapSubSystem, updateSubSystem, generateMapSystem, generateAppointMapSystem} from '@/api/trainingPlatform';-->
|
||||
<!--import { ProjectList} from '@/scripts/ProjectConfig';-->
|
||||
<!--import Cookies from 'js-cookie';-->
|
||||
<!--export default {-->
|
||||
<!-- name: 'CreateSubSystem',-->
|
||||
<!-- props: {-->
|
||||
<!-- mapList:{-->
|
||||
<!-- required:true,-->
|
||||
<!-- type:Array-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- dialogVisible: false,-->
|
||||
<!-- disabled:null,-->
|
||||
<!-- productList:[],-->
|
||||
<!-- typeList:[],-->
|
||||
<!-- title:'',-->
|
||||
<!-- isAdd:true,-->
|
||||
<!-- isGernerate:false,-->
|
||||
<!-- formModel:{-->
|
||||
<!-- customized:'',-->
|
||||
<!-- mapId:'',-->
|
||||
<!-- name: '',-->
|
||||
<!-- prdType: '',-->
|
||||
<!-- type: '',-->
|
||||
<!-- newApi: false,-->
|
||||
<!-- appoint: false,-->
|
||||
<!-- id:null-->
|
||||
<!-- }-->
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- prdTypeList() {-->
|
||||
<!-- const productTypeList = ConstConfig.ConstSelect.prdType;-->
|
||||
<!-- return Cookies.get('user_lang') == 'en'-->
|
||||
<!-- ? productTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })-->
|
||||
<!-- : productTypeList.map(elem => { return { value: elem.value, label: elem.label }; });-->
|
||||
<!-- },-->
|
||||
<!-- form() {-->
|
||||
<!-- let form = {};-->
|
||||
<!-- if (this.isAdd) {-->
|
||||
<!-- // 新增-->
|
||||
<!-- form = {-->
|
||||
<!-- labelWidth: '150px',-->
|
||||
<!-- items: [-->
|
||||
<!-- { prop: 'customized', label: this.$t('systemGenerate.customized'), type: 'select', required: true, options: ProjectList},-->
|
||||
<!-- { prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList},-->
|
||||
<!-- { prop: 'prdType', label: this.$t('system.prdType'), type: 'select', required: true, options:this.prdTypeList},-->
|
||||
<!-- { prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},-->
|
||||
<!-- { prop: 'type', label: this.$t('systemGenerate.type'), type: 'select', required: true, options: this.typeList}-->
|
||||
<!-- ]-->
|
||||
<!-- };-->
|
||||
<!-- } else if (this.isGernerate) {-->
|
||||
<!-- // 一键生成-->
|
||||
<!-- form = {-->
|
||||
<!-- labelWidth: '150px',-->
|
||||
<!-- items: [-->
|
||||
<!-- { prop: 'mapId', label: this.$t('systemGenerate.mapName'), type: 'select', required: true, options: this.mapList},-->
|
||||
<!-- { prop: 'appoint', label: '是否指定生成', type: 'switch'},-->
|
||||
<!-- { prop: 'prdType', label: '产品类型', type: 'select', required: true, options: this.prdTypeList, show: this.formModel.appoint }-->
|
||||
<!-- ]-->
|
||||
<!-- };-->
|
||||
<!-- } else {-->
|
||||
<!-- // 修改-->
|
||||
<!-- form = {-->
|
||||
<!-- labelWidth: '150px',-->
|
||||
<!-- items: [-->
|
||||
<!-- { prop: 'name', label: this.$t('systemGenerate.name'), type: 'text', required: true},-->
|
||||
<!-- { prop: 'newApi', label: '是否使用新API', type: 'switch' }-->
|
||||
<!-- ]-->
|
||||
<!-- };-->
|
||||
<!-- }-->
|
||||
<!-- return form;-->
|
||||
<!-- },-->
|
||||
<!-- rules() {-->
|
||||
<!-- let crules = {};-->
|
||||
<!-- crules = {customized:[-->
|
||||
<!-- { required: true, message: this.$t('systemGenerate.selectProject'), trigger: 'change'}-->
|
||||
<!-- ],-->
|
||||
<!-- mapId:[-->
|
||||
<!-- { required: true, message: this.$t('systemGenerate.selectMap'), trigger: 'change'}-->
|
||||
<!-- ],-->
|
||||
<!-- name: [-->
|
||||
<!-- { required: true, message: this.$t('systemGenerate.inputName'), trigger: 'blur' },-->
|
||||
<!-- { required: true, message: this.$t('systemGenerate.inputName'), trigger: 'change' }-->
|
||||
<!-- ],-->
|
||||
<!-- type:[-->
|
||||
<!-- { required: true, message: this.$t('systemGenerate.selectType'), trigger: 'change'}-->
|
||||
<!-- ],-->
|
||||
<!-- prdType:[-->
|
||||
<!-- { required: true, message: this.$t('rules.productTypeInput'), trigger: 'change'}-->
|
||||
<!-- ]-->
|
||||
<!-- };-->
|
||||
<!-- return crules;-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- mounted() {-->
|
||||
<!-- this.loadInitData();-->
|
||||
<!-- },-->
|
||||
<!-- methods:{-->
|
||||
<!-- loadInitData() {-->
|
||||
<!-- const customeredProductType = ConstConfig.ConstSelect.customeredProductType;-->
|
||||
<!-- this.typeList = Cookies.get('user_lang') == 'en'-->
|
||||
<!-- ? customeredProductType.map(elem => { return { value: elem.value, label: elem.enlabel }; })-->
|
||||
<!-- : customeredProductType.map(elem => { return { value: elem.value, label: elem.label }; });-->
|
||||
<!-- },-->
|
||||
<!-- doShow({type, row}) {-->
|
||||
<!-- if (row) {-->
|
||||
<!-- this.title = this.$t('systemGenerate.modifySubSystem');-->
|
||||
<!-- this.isAdd = false;-->
|
||||
<!-- this.isGernerate = false;-->
|
||||
<!-- this.formModel.name = row.name;-->
|
||||
<!-- this.formModel.id = row.id;-->
|
||||
<!-- this.formModel.newApi = row.newApi || false;-->
|
||||
<!-- } else {-->
|
||||
<!-- if (type == 'add') {-->
|
||||
<!-- this.title = this.$t('systemGenerate.createSubSystem');-->
|
||||
<!-- this.isAdd = true;-->
|
||||
<!-- this.isGernerate = false;-->
|
||||
<!-- this.formModel.mapId = '';-->
|
||||
<!-- this.formModel.name = '';-->
|
||||
<!-- } else {-->
|
||||
<!-- this.title = '生成子系统';-->
|
||||
<!-- this.isAdd = false;-->
|
||||
<!-- this.isGernerate = true;-->
|
||||
<!-- this.formModel.mapId = '';-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- this.dialogVisible = true;-->
|
||||
<!-- this.$nextTick(()=>{-->
|
||||
<!-- this.$refs.dataform.clearValidate();-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- doCreate() {-->
|
||||
<!-- const self = this;-->
|
||||
<!-- this.$refs.dataform.validateForm(() => {-->
|
||||
<!-- if (this.isAdd) {-->
|
||||
<!-- delete this.formModel.id;-->
|
||||
<!-- createMapSubSystem(this.formModel).then(response => {-->
|
||||
<!-- this.$message.success(this.$t('systemGenerate.createMapSystemSuccess'));-->
|
||||
<!-- self.$emit('reloadTable');-->
|
||||
<!-- }).catch(() => {-->
|
||||
<!-- this.$messageBox(this.$t('systemGenerate.createMapSystemFail'));-->
|
||||
<!-- });-->
|
||||
<!-- } else if (this.isGernerate) {-->
|
||||
<!-- if (this.formModel.appoint) {-->
|
||||
<!-- generateAppointMapSystem(this.formModel.mapId, this.formModel.prdType).then(resp => {-->
|
||||
<!-- this.$message.success('生成指定子系统成功!');-->
|
||||
<!-- self.$emit('reloadTable');-->
|
||||
<!-- }).catch(() => {-->
|
||||
<!-- this.$messageBox('生成指定子系统异常!');-->
|
||||
<!-- });-->
|
||||
<!-- } else {-->
|
||||
<!-- generateMapSystem(this.formModel.mapId).then(response => {-->
|
||||
<!-- this.$message.success(this.$t('systemGenerate.generateSuccess'));-->
|
||||
<!-- self.$emit('reloadTable');-->
|
||||
<!-- }).catch(() => {-->
|
||||
<!-- this.$messageBox(this.$t('systemGenerate.generateFail'));-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
|
||||
} else {
|
||||
const datainfo = {name: this.formModel.name, newApi: this.formModel.newApi};
|
||||
updateSubSystem(this.formModel.id, datainfo).then(response => {
|
||||
this.$message.success(this.$t('systemGenerate.updateMapSystemSuccess'));
|
||||
self.$emit('reloadTable');
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.updateMapSystemFail'));
|
||||
});
|
||||
}
|
||||
self.doClose();
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .el-dialog--center .el-dialog__body{
|
||||
padding: 25px 55px 20px 20px;
|
||||
}
|
||||
/deep/ .el-dialog--center .el-dialog__body .el-input{
|
||||
width:200px !important;
|
||||
}
|
||||
</style>
|
||||
<!-- } else {-->
|
||||
<!-- const datainfo = {name: this.formModel.name, newApi: this.formModel.newApi};-->
|
||||
<!-- updateSubSystem(this.formModel.id, datainfo).then(response => {-->
|
||||
<!-- this.$message.success(this.$t('systemGenerate.updateMapSystemSuccess'));-->
|
||||
<!-- self.$emit('reloadTable');-->
|
||||
<!-- }).catch(() => {-->
|
||||
<!-- this.$messageBox(this.$t('systemGenerate.updateMapSystemFail'));-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- self.doClose();-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- doClose() {-->
|
||||
<!-- this.dialogVisible = false;-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
<!--<style lang="scss" scoped>-->
|
||||
<!--/deep/ .el-dialog--center .el-dialog__body{-->
|
||||
<!-- padding: 25px 55px 20px 20px;-->
|
||||
<!--}-->
|
||||
<!--/deep/ .el-dialog--center .el-dialog__body .el-input{-->
|
||||
<!-- width:200px !important;-->
|
||||
<!--}-->
|
||||
<!--</style>-->
|
||||
|
@ -1,176 +1,176 @@
|
||||
<template>
|
||||
<el-card>
|
||||
<QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<mapSystemOperate ref="mapSystemOperate" :map-list="mapList" @reloadTable="reloadTable" />
|
||||
</el-card>
|
||||
</template>
|
||||
<!--<template>-->
|
||||
<!-- <el-card>-->
|
||||
<!-- <QueryListPage ref="subSystemListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />-->
|
||||
<!-- <mapSystemOperate ref="mapSystemOperate" :map-list="mapList" @reloadTable="reloadTable" />-->
|
||||
<!-- </el-card>-->
|
||||
<!--</template>-->
|
||||
|
||||
<script>
|
||||
import Cookies from 'js-cookie';
|
||||
import { getPublishMapListOnline } from '@/api/jmap/map';
|
||||
import { getMapSystemPageList, deleteSubSystem} from '@/api/trainingPlatform';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import mapSystemOperate from './create';
|
||||
<!--<script>-->
|
||||
<!--import Cookies from 'js-cookie';-->
|
||||
<!--import { getPublishMapListOnline } from '@/api/jmap/map';-->
|
||||
<!--import { getMapSystemPageList, deleteSubSystem} from '@/api/trainingPlatform';-->
|
||||
<!--import ConstConfig from '@/scripts/ConstConfig';-->
|
||||
<!--import mapSystemOperate from './create';-->
|
||||
|
||||
export default {
|
||||
name: 'SystemGenerate',
|
||||
components: {
|
||||
mapSystemOperate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
systemList: [],
|
||||
mapList:[],
|
||||
mapId: '',
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
queryObject: {
|
||||
mapId: {
|
||||
type: 'select',
|
||||
label: this.$t('systemGenerate.map'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
},
|
||||
'name': {
|
||||
type: 'text',
|
||||
label: this.$t('systemGenerate.name')
|
||||
},
|
||||
'type': {
|
||||
type: 'select',
|
||||
label: this.$t('systemGenerate.type'),
|
||||
config: {
|
||||
data: []
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('systemGenerate.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: this.$t('systemGenerate.type'),
|
||||
type: 'tag',
|
||||
prop: 'type',
|
||||
columnValue: (row) => { return this.$convertField(row.type, this.systemList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('systemGenerate.mapName'),
|
||||
type: 'tag',
|
||||
prop: 'mapName',
|
||||
columnValue: (row) => { return row.mapName; },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('system.prdType'),
|
||||
type: 'tag',
|
||||
prop: 'prdType',
|
||||
columnValue: (row) => { return this.$convertField(row.prdType, this.systemPrdTypeList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '400',
|
||||
buttons: [
|
||||
{
|
||||
name: this.$t('systemGenerate.updateData'),
|
||||
handleClick: this.updateData,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: this.$t('systemGenerate.deleteData'),
|
||||
handleClick: this.deleteData,
|
||||
type: 'danger'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
actions: [
|
||||
{ text: this.$t('systemGenerate.commission'), handler: this.handleAdd },
|
||||
{ text: this.$t('systemGenerate.generate'), handler: this.generate }
|
||||
]
|
||||
}
|
||||
<!--export default {-->
|
||||
<!-- name: 'SystemGenerate',-->
|
||||
<!-- components: {-->
|
||||
<!-- mapSystemOperate-->
|
||||
<!-- },-->
|
||||
<!-- data() {-->
|
||||
<!-- return {-->
|
||||
<!-- systemList: [],-->
|
||||
<!-- mapList:[],-->
|
||||
<!-- mapId: '',-->
|
||||
<!-- pagerConfig: {-->
|
||||
<!-- pageSize: 'pageSize',-->
|
||||
<!-- pageIndex: 'pageNum'-->
|
||||
<!-- },-->
|
||||
<!-- queryForm: {-->
|
||||
<!-- labelWidth: '100px',-->
|
||||
<!-- reset: true,-->
|
||||
<!-- queryObject: {-->
|
||||
<!-- mapId: {-->
|
||||
<!-- type: 'select',-->
|
||||
<!-- label: this.$t('systemGenerate.map'),-->
|
||||
<!-- config: {-->
|
||||
<!-- data: []-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- 'name': {-->
|
||||
<!-- type: 'text',-->
|
||||
<!-- label: this.$t('systemGenerate.name')-->
|
||||
<!-- },-->
|
||||
<!-- 'type': {-->
|
||||
<!-- type: 'select',-->
|
||||
<!-- label: this.$t('systemGenerate.type'),-->
|
||||
<!-- config: {-->
|
||||
<!-- data: []-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- queryList: {-->
|
||||
<!-- query: this.queryFunction,-->
|
||||
<!-- selectCheckShow: false,-->
|
||||
<!-- indexShow: true,-->
|
||||
<!-- columns: [-->
|
||||
<!-- {-->
|
||||
<!-- title: this.$t('systemGenerate.name'),-->
|
||||
<!-- prop: 'name'-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: this.$t('systemGenerate.type'),-->
|
||||
<!-- type: 'tag',-->
|
||||
<!-- prop: 'type',-->
|
||||
<!-- columnValue: (row) => { return this.$convertField(row.type, this.systemList, ['value', 'label']); },-->
|
||||
<!-- tagType: (row) => { return ''; }-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: this.$t('systemGenerate.mapName'),-->
|
||||
<!-- type: 'tag',-->
|
||||
<!-- prop: 'mapName',-->
|
||||
<!-- columnValue: (row) => { return row.mapName; },-->
|
||||
<!-- tagType: (row) => { return ''; }-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- title: this.$t('system.prdType'),-->
|
||||
<!-- type: 'tag',-->
|
||||
<!-- prop: 'prdType',-->
|
||||
<!-- columnValue: (row) => { return this.$convertField(row.prdType, this.systemPrdTypeList, ['value', 'label']); },-->
|
||||
<!-- tagType: (row) => { return ''; }-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- type: 'button',-->
|
||||
<!-- title: this.$t('global.operate'),-->
|
||||
<!-- width: '400',-->
|
||||
<!-- buttons: [-->
|
||||
<!-- {-->
|
||||
<!-- name: this.$t('systemGenerate.updateData'),-->
|
||||
<!-- handleClick: this.updateData,-->
|
||||
<!-- type: ''-->
|
||||
<!-- },-->
|
||||
<!-- {-->
|
||||
<!-- name: this.$t('systemGenerate.deleteData'),-->
|
||||
<!-- handleClick: this.deleteData,-->
|
||||
<!-- type: 'danger'-->
|
||||
<!-- }-->
|
||||
<!-- ]-->
|
||||
<!-- }-->
|
||||
<!-- ],-->
|
||||
<!-- actions: [-->
|
||||
<!-- { text: this.$t('systemGenerate.commission'), handler: this.handleAdd },-->
|
||||
<!-- { text: this.$t('systemGenerate.generate'), handler: this.generate }-->
|
||||
<!-- ]-->
|
||||
<!-- }-->
|
||||
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
updateData(index, row) {
|
||||
this.$refs.mapSystemOperate.doShow({type:'update', row:row});
|
||||
},
|
||||
deleteData(index, row) {
|
||||
this.$confirm(this.$t('systemGenerate.deleteMapSystemTip'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteSubSystem(row.id).then(response => {
|
||||
this.$message.success(this.$t('systemGenerate.deleteMapSystemSuccess'));
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('systemGenerate.deleteMapSystemFail'));
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
handleAdd() {
|
||||
this.$refs.mapSystemOperate.doShow({type:'add'});
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
async loadInitData() {
|
||||
try {
|
||||
// 获取地图
|
||||
this.mapList = [];
|
||||
const res = await getPublishMapListOnline();
|
||||
res.data.forEach(elem => {
|
||||
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
|
||||
this.mapList.push({ value: elem.id, label: elem.name });
|
||||
});
|
||||
// 系统类型
|
||||
const systemListEnum = ConstConfig.ConstSelect.productType;
|
||||
this.systemList = Cookies.get('user_lang') == 'en'
|
||||
? systemListEnum.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: systemListEnum.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
// 系统内部的产品类型
|
||||
const systemProductTypeList = ConstConfig.ConstSelect.prdType;
|
||||
this.systemPrdTypeList = Cookies.get('user_lang') == 'en'
|
||||
? systemProductTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })
|
||||
: systemProductTypeList.map(elem => { return { value: elem.value, label: elem.label }; });
|
||||
this.queryForm.queryObject.type.config.data = this.systemList;
|
||||
<!-- };-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- height() {-->
|
||||
<!-- return this.$store.state.app.height - 50;-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- created() {-->
|
||||
<!-- this.loadInitData();-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- updateData(index, row) {-->
|
||||
<!-- this.$refs.mapSystemOperate.doShow({type:'update', row:row});-->
|
||||
<!-- },-->
|
||||
<!-- deleteData(index, row) {-->
|
||||
<!-- this.$confirm(this.$t('systemGenerate.deleteMapSystemTip'), this.$t('global.tips'), {-->
|
||||
<!-- confirmButtonText: this.$t('global.confirm'),-->
|
||||
<!-- cancelButtonText: this.$t('global.cancel'),-->
|
||||
<!-- type: 'warning'-->
|
||||
<!-- }).then(() => {-->
|
||||
<!-- deleteSubSystem(row.id).then(response => {-->
|
||||
<!-- this.$message.success(this.$t('systemGenerate.deleteMapSystemSuccess'));-->
|
||||
<!-- this.reloadTable();-->
|
||||
<!-- }).catch(() => {-->
|
||||
<!-- this.$messageBox(this.$t('systemGenerate.deleteMapSystemFail'));-->
|
||||
<!-- });-->
|
||||
<!-- }).catch(() => { });-->
|
||||
<!-- },-->
|
||||
<!-- handleAdd() {-->
|
||||
<!-- this.$refs.mapSystemOperate.doShow({type:'add'});-->
|
||||
<!-- },-->
|
||||
<!-- reloadTable() {-->
|
||||
<!-- if (this.queryList && this.queryList.reload) {-->
|
||||
<!-- this.queryList.reload();-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- async loadInitData() {-->
|
||||
<!-- try {-->
|
||||
<!-- // 获取地图-->
|
||||
<!-- this.mapList = [];-->
|
||||
<!-- const res = await getPublishMapListOnline();-->
|
||||
<!-- res.data.forEach(elem => {-->
|
||||
<!-- this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });-->
|
||||
<!-- this.mapList.push({ value: elem.id, label: elem.name });-->
|
||||
<!-- });-->
|
||||
<!-- // 系统类型-->
|
||||
<!-- const systemListEnum = ConstConfig.ConstSelect.productType;-->
|
||||
<!-- this.systemList = Cookies.get('user_lang') == 'en'-->
|
||||
<!-- ? systemListEnum.map(elem => { return { value: elem.value, label: elem.enlabel }; })-->
|
||||
<!-- : systemListEnum.map(elem => { return { value: elem.value, label: elem.label }; });-->
|
||||
<!-- // 系统内部的产品类型-->
|
||||
<!-- const systemProductTypeList = ConstConfig.ConstSelect.prdType;-->
|
||||
<!-- this.systemPrdTypeList = Cookies.get('user_lang') == 'en'-->
|
||||
<!-- ? systemProductTypeList.map(elem => { return { value: elem.value, label: elem.enlabel }; })-->
|
||||
<!-- : systemProductTypeList.map(elem => { return { value: elem.value, label: elem.label }; });-->
|
||||
<!-- this.queryForm.queryObject.type.config.data = this.systemList;-->
|
||||
|
||||
} catch (error) {
|
||||
console.error(error, '获取发布地图');
|
||||
}
|
||||
},
|
||||
generate() {
|
||||
this.$refs.mapSystemOperate.doShow({type:'generate'});
|
||||
},
|
||||
queryFunction(params) {
|
||||
return getMapSystemPageList(params);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<!-- } catch (error) {-->
|
||||
<!-- console.error(error, '获取发布地图');-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- generate() {-->
|
||||
<!-- this.$refs.mapSystemOperate.doShow({type:'generate'});-->
|
||||
<!-- },-->
|
||||
<!-- queryFunction(params) {-->
|
||||
<!-- return getMapSystemPageList(params);-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--};-->
|
||||
<!--</script>-->
|
||||
|
@ -14,7 +14,6 @@ import md5 from 'js-md5';
|
||||
import { setToken, getToken } from '@/utils/auth';
|
||||
import OrgSelect from '../login/orgSelect';
|
||||
// , ProjectLoginStyleList, VersionBaseNoShow, MainBodyNoShow, NoQrcodeList, localPackageProject, RegisterCodeList
|
||||
// import { loginInfo, ProjectIcon } from '@/scripts/ProjectConfig';
|
||||
|
||||
export default {
|
||||
name:'ThirdLogin',
|
||||
|
Loading…
Reference in New Issue
Block a user