项目配置完善全部迁移为配置项

This commit is contained in:
fan 2023-05-24 11:04:39 +08:00
parent 341e0ff829
commit 43db0d138f
39 changed files with 4234 additions and 4188 deletions

View File

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

View File

@ -24,7 +24,7 @@
>确定</el-button>
</div>
<div style="width:100%; padding-top: 20px">
<span v-if="!thirdLogin"> 版权所有C2010-2011 北京玖琏科技有限公司</span>
<span v-if="copyrightShow"> 版权所有C2010-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: {

View File

@ -25,7 +25,7 @@
</div>
<div style="width:100%; padding-top: 20px">
<!-- <span >版权所有C2010-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: {

View File

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

View File

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

View File

@ -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') }} &nbsp;{{ $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) {

View File

@ -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');
@ -116,11 +116,11 @@ const PlanMonitorEditAUSTool = () => import('@/views/planMonitor/editToolAUS/too
const PlanMonitorEditAUSLine = () => import('@/views/planMonitor/editToolAUS/line/index');
const PlanMonitorDetail = () => import('@/views/planMonitor/detail');
const DesignPlatformHome = () => import('@/views/designPlatform/home');
const DesignPlatform = () => import('@/views/designPlatform/index');
const MapPreviewNew = () => import('@/views/designPlatform/mapPreviewNew');
const BigScreen = () => import('@/views/designPlatform/bigScreen');
const BigSplitScreen = () => import('@/views/designPlatform/bigSplitScreen');
// const DesignPlatformHome = () => import('@/views/designPlatform/home');
// const DesignPlatform = () => import('@/views/designPlatform/index');
// const MapPreviewNew = () => import('@/views/designPlatform/mapPreviewNew');
// const BigScreen = () => import('@/views/designPlatform/bigScreen');
// const BigSplitScreen = () => import('@/views/designPlatform/bigSplitScreen');
const SimulationPlatform = () => import('@/views/trainingPlatform/simulation');
@ -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,

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

@ -1,226 +1,226 @@
<template>
<div class="bigScreen">
<div v-show="maskOpen" class="bigScreenMask" />
<jlmap-visual ref="jlmapVisual" />
<div v-show="disPlay" class="bigScreenBack">
<el-button-group>
<el-button type="primary" @click="back">返回</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import {loadMapDataById } from '@/utils/loaddata';
import { clearSimulation } from '@/api/simulation';
import { mapGetters } from 'vuex';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
import { getToken } from '@/utils/auth';
import { TrainingMode } from '@/scripts/ConstDic';
<!--<template>-->
<!-- <div class="bigScreen">-->
<!-- <div v-show="maskOpen" class="bigScreenMask" />-->
<!-- <jlmap-visual ref="jlmapVisual" />-->
<!-- <div v-show="disPlay" class="bigScreenBack">-->
<!-- <el-button-group>-->
<!-- <el-button type="primary" @click="back">返回</el-button>-->
<!-- </el-button-group>-->
<!-- </div>-->
<!-- </div>-->
<!--</template>-->
<!--<script>-->
<!--import JlmapVisual from '@/views/newMap/jlmapNew/index';-->
<!--import {loadMapDataById } from '@/utils/loaddata';-->
<!--import { clearSimulation } from '@/api/simulation';-->
<!--import { mapGetters } from 'vuex';-->
<!--import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';-->
<!--import { getToken } from '@/utils/auth';-->
<!--import { TrainingMode } from '@/scripts/ConstDic';-->
export default {
name: 'BigScreen',
components: {
JlmapVisual
},
props: {
widthLeft: {
type: Number,
default: 0
}
},
data() {
return {
maskOpen: false,
disPlay: false
};
},
computed: {
mapId() {
return this.$route.params.mapId;
},
height() {
return this.$store.state.app.height - 50 - 40;
},
...mapGetters('map', [
'bigScreenConfig'
]),
...mapGetters('config', [
'canvasId'
]),
prdType() {
return this.$route.query.prdType;
}
},
watch: {
widthLeft(val) {
this.setWindowSize();
},
$route() {
this.$nextTick(() => {
this.initLoadData();
});
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'$store.state.map.mapViewLoadedCount':function() {
this.$store.dispatch('map/setTrainWindowShow', false);
// this.$jlmap.off('zoom');
this.handleUpdateScreen();
if (this.$route.query.group && !this.$route.path.includes('displayIscs')) {
this.subscribe();
}
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length && this.$route.query.group) {
this.statusMessage(val);
}
},
'$store.state.socket.simulationOver':function(val) {
this.backOut();
},
'$store.state.socket.whTrainInfo': function(val) {
<!--export default {-->
<!-- name: 'BigScreen',-->
<!-- components: {-->
<!-- JlmapVisual-->
<!-- },-->
<!-- props: {-->
<!-- widthLeft: {-->
<!-- type: Number,-->
<!-- default: 0-->
<!-- }-->
<!-- },-->
<!-- data() {-->
<!-- return {-->
<!-- maskOpen: false,-->
<!-- disPlay: false-->
<!-- };-->
<!-- },-->
<!-- computed: {-->
<!-- mapId() {-->
<!-- return this.$route.params.mapId;-->
<!-- },-->
<!-- height() {-->
<!-- return this.$store.state.app.height - 50 - 40;-->
<!-- },-->
<!-- ...mapGetters('map', [-->
<!-- 'bigScreenConfig'-->
<!-- ]),-->
<!-- ...mapGetters('config', [-->
<!-- 'canvasId'-->
<!-- ]),-->
<!-- prdType() {-->
<!-- return this.$route.query.prdType;-->
<!-- }-->
<!-- },-->
<!-- watch: {-->
<!-- widthLeft(val) {-->
<!-- this.setWindowSize();-->
<!-- },-->
<!-- $route() {-->
<!-- this.$nextTick(() => {-->
<!-- this.initLoadData();-->
<!-- });-->
<!-- },-->
<!-- '$store.state.app.windowSizeCount': function() {-->
<!-- this.setWindowSize();-->
<!-- },-->
<!-- '$store.state.map.mapViewLoadedCount':function() {-->
<!-- this.$store.dispatch('map/setTrainWindowShow', false);-->
<!-- // this.$jlmap.off('zoom');-->
<!-- this.handleUpdateScreen();-->
<!-- if (this.$route.query.group && !this.$route.path.includes('displayIscs')) {-->
<!-- this.subscribe();-->
<!-- }-->
<!-- },-->
<!-- '$store.state.socket.equipmentStatus': function (val) {-->
<!-- if (val.length && this.$route.query.group) {-->
<!-- this.statusMessage(val);-->
<!-- }-->
<!-- },-->
<!-- '$store.state.socket.simulationOver':function(val) {-->
<!-- this.backOut();-->
<!-- },-->
<!-- '$store.state.socket.whTrainInfo': function(val) {-->
}
},
async beforeDestroy() {
await this.$store.dispatch('map/mapClear');
this.$store.dispatch('training/setPrdType', '');
},
async mounted() {
this.$store.dispatch('training/setPrdType', this.$route.query.prdType || '07');
await this.setWindowSize();
await this.initLoadData();
this.disPlay = true;
if (this.$route.path.includes('design/bigScreen') || this.$route.query.noPreLogout || this.$route.query.projectDevice) {
this.disPlay = false;
}
},
methods: {
initLoadData() { //
if (this.$route.query.group) {
loadMapDataById(this.$route.query.mapId, 'simulation');
} else {
this.$store.dispatch('training/changeMode', { mode: TrainingMode.NORMAL });
loadMapDataById(this.$route.params.mapId, 'preview');
}
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
await this.$store.dispatch('socket/setEquipmentStatus');
},
setWindowSize() {
this.$nextTick(() => {
if (this.widthLeft) {
const width = this.$store.state.app.width - (this.widthLeft) - 2;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
} else {
const width = this.$store.state.app.width - 2;
const height = this.$store.state.app.height;
this.$store.dispatch('config/resize', { width, height });
}
this.handleUpdateScreen();
});
},
handleUpdateScreen() {
this.maskOpen = false;
let picture;
if (this.$store.state.map.map && this.$store.state.map.map.pictureList) {
picture = this.$store.state.map.map.pictureList.find(picture => picture.type === 'bigScreen');
}
if (picture) {
this.$store.dispatch('map/setPictureDeviceMap', picture.deviceMap);
const deviceList = [];
const mapDevice = this.$store.state.map.mapDevice;
for (const deviceCode in mapDevice) {
deviceList.push(deviceCode);
}
this.$jlmap.updatePicture(deviceList);
this.$jlmap.updateTransform(picture.scaling, picture.origin);
} else if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
const offsetList = this.bigScreenConfig.offsetList;
const width = this.bigScreenConfig.width;
const height = this.bigScreenConfig.height;
if (this.widthLeft) {
const size = {
width: (this.$store.state.app.width - (this.widthLeft || 450) - 2) * width,
height: this.height * height,
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
this.$jlmap.setUpdateScreen(size);
} else {
const size = {
width: (this.$store.state.app.width - 2) * width,
height: this.$store.state.app.height * height,
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
this.$jlmap.setUpdateScreen(size);
}
this.$refs.jlmapVisual.handleStateLoaded();
} else {
this.maskOpen = true;
// this.$messageBox('线, ');
}
},
async back() {
if (this.$route.query.group) {
await clearSimulation(this.$route.query.group);
this.clearSubscribe();
}
this.$store.dispatch('training/over').then(() => {
history.go(-1);
});
},
backOut() {
if (this.$route.query.projectDevice) {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
}
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
if (this.prdType === '10') {
creatSubscribe(`/topic/yjddzh/trainPosition/simulation/${this.$route.query.group}`, header);
}
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
if (this.prdType === '10') {
clearSubscribe(`/topic/yjddzh/trainPosition/simulation/${this.$route.query.group}`);
}
}
}
};
</script>
<style lang="scss" scoped>
.bigScreen {
width: 100%;
overflow: hidden;
position: relative;
}
.bigScreenMask{
opacity: 1;
background: #000;
position: absolute;
right: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9;
}
.bigScreenBack {
position: absolute;
float: right;
right: 15px;
bottom: 15px;
z-index: 19;
}
</style>
<!-- }-->
<!-- },-->
<!-- async beforeDestroy() {-->
<!-- await this.$store.dispatch('map/mapClear');-->
<!-- this.$store.dispatch('training/setPrdType', '');-->
<!-- },-->
<!-- async mounted() {-->
<!-- this.$store.dispatch('training/setPrdType', this.$route.query.prdType || '07');-->
<!-- await this.setWindowSize();-->
<!-- await this.initLoadData();-->
<!-- this.disPlay = true;-->
<!-- if (this.$route.path.includes('design/bigScreen') || this.$route.query.noPreLogout || this.$route.query.projectDevice) {-->
<!-- this.disPlay = false;-->
<!-- }-->
<!-- },-->
<!-- methods: {-->
<!-- initLoadData() { // -->
<!-- if (this.$route.query.group) {-->
<!-- loadMapDataById(this.$route.query.mapId, 'simulation');-->
<!-- } else {-->
<!-- this.$store.dispatch('training/changeMode', { mode: TrainingMode.NORMAL });-->
<!-- loadMapDataById(this.$route.params.mapId, 'preview');-->
<!-- }-->
<!-- },-->
<!-- async statusMessage(list) {-->
<!-- await this.$store.dispatch('training/updateMapState', list);-->
<!-- await this.$store.dispatch('socket/setEquipmentStatus');-->
<!-- },-->
<!-- setWindowSize() {-->
<!-- this.$nextTick(() => {-->
<!-- if (this.widthLeft) {-->
<!-- const width = this.$store.state.app.width - (this.widthLeft) - 2;-->
<!-- const height = this.height;-->
<!-- this.$store.dispatch('config/resize', { width, height });-->
<!-- } else {-->
<!-- const width = this.$store.state.app.width - 2;-->
<!-- const height = this.$store.state.app.height;-->
<!-- this.$store.dispatch('config/resize', { width, height });-->
<!-- }-->
<!-- this.handleUpdateScreen();-->
<!-- });-->
<!-- },-->
<!-- handleUpdateScreen() {-->
<!-- this.maskOpen = false;-->
<!-- let picture;-->
<!-- if (this.$store.state.map.map && this.$store.state.map.map.pictureList) {-->
<!-- picture = this.$store.state.map.map.pictureList.find(picture => picture.type === 'bigScreen');-->
<!-- }-->
<!-- if (picture) {-->
<!-- this.$store.dispatch('map/setPictureDeviceMap', picture.deviceMap);-->
<!-- const deviceList = [];-->
<!-- const mapDevice = this.$store.state.map.mapDevice;-->
<!-- for (const deviceCode in mapDevice) {-->
<!-- deviceList.push(deviceCode);-->
<!-- }-->
<!-- this.$jlmap.updatePicture(deviceList);-->
<!-- this.$jlmap.updateTransform(picture.scaling, picture.origin);-->
<!-- } else if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {-->
<!-- const offsetList = this.bigScreenConfig.offsetList;-->
<!-- const width = this.bigScreenConfig.width;-->
<!-- const height = this.bigScreenConfig.height;-->
<!-- if (this.widthLeft) {-->
<!-- const size = {-->
<!-- width: (this.$store.state.app.width - (this.widthLeft || 450) - 2) * width,-->
<!-- height: this.height * height,-->
<!-- list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),-->
<!-- offsetList: offsetList-->
<!-- };-->
<!-- this.$jlmap.setUpdateScreen(size);-->
<!-- } else {-->
<!-- const size = {-->
<!-- width: (this.$store.state.app.width - 2) * width,-->
<!-- height: this.$store.state.app.height * height,-->
<!-- list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),-->
<!-- offsetList: offsetList-->
<!-- };-->
<!-- this.$jlmap.setUpdateScreen(size);-->
<!-- }-->
<!-- this.$refs.jlmapVisual.handleStateLoaded();-->
<!-- } else {-->
<!-- this.maskOpen = true;-->
<!-- // this.$messageBox('线, ');-->
<!-- }-->
<!-- },-->
<!-- async back() {-->
<!-- if (this.$route.query.group) {-->
<!-- await clearSimulation(this.$route.query.group);-->
<!-- this.clearSubscribe();-->
<!-- }-->
<!-- this.$store.dispatch('training/over').then(() => {-->
<!-- history.go(-1);-->
<!-- });-->
<!-- },-->
<!-- backOut() {-->
<!-- if (this.$route.query.projectDevice) {-->
<!-- this.$store.dispatch('LogOut').then(() => {-->
<!-- location.reload();-->
<!-- });-->
<!-- }-->
<!-- },-->
<!-- async subscribe() {-->
<!-- this.clearSubscribe();-->
<!-- const header = { group: this.$route.query.group || '', 'X-Token': getToken() };-->
<!-- creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);-->
<!-- if (this.prdType === '10') {-->
<!-- creatSubscribe(`/topic/yjddzh/trainPosition/simulation/${this.$route.query.group}`, header);-->
<!-- }-->
<!-- // await this.$store.dispatch('training/setHasSubscribed');-->
<!-- },-->
<!-- clearSubscribe() {-->
<!-- clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);-->
<!-- if (this.prdType === '10') {-->
<!-- clearSubscribe(`/topic/yjddzh/trainPosition/simulation/${this.$route.query.group}`);-->
<!-- }-->
<!-- }-->
<!-- }-->
<!--};-->
<!--</script>-->
<!--<style lang="scss" scoped>-->
<!-- .bigScreen {-->
<!-- width: 100%;-->
<!-- overflow: hidden;-->
<!-- position: relative;-->
<!-- }-->
<!-- .bigScreenMask{-->
<!-- opacity: 1;-->
<!-- background: #000;-->
<!-- position: absolute;-->
<!-- right: 0;-->
<!-- top: 0;-->
<!-- width: 100%;-->
<!-- height: 100%;-->
<!-- z-index: 9;-->
<!-- }-->
<!-- .bigScreenBack {-->
<!-- position: absolute;-->
<!-- float: right;-->
<!-- right: 15px;-->
<!-- bottom: 15px;-->
<!-- z-index: 19;-->
<!-- }-->
<!--</style>-->

View File

@ -1,221 +1,221 @@
<template>
<div class="bigSplitScreen">
<div v-show="maskOpen" class="bigSplitScreenMask" />
<div v-show="disPlay" class="bigSplitScreenSelect">
<el-select v-model="value" placeholder="请选择" style="width: 125px;" @change="changeSplit">
<el-option
v-for="item in optionsList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</div>
<jlmap-visual ref="jlmapVisual" />
<div v-show="disPlay" class="bigSplitScreenBack">
<el-button-group>
<el-button type="primary" @click="back">返回</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import { loadMapDataById } from '@/utils/loaddata';
import { clearSimulation } from '@/api/simulation';
import { mapGetters } from 'vuex';
import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';
import { getToken } from '@/utils/auth';
import { getSessionStorage } from '@/utils/auth';
import { TrainingMode } from '@/scripts/ConstDic';
<!--<template>-->
<!-- <div class="bigSplitScreen">-->
<!-- <div v-show="maskOpen" class="bigSplitScreenMask" />-->
<!-- <div v-show="disPlay" class="bigSplitScreenSelect">-->
<!-- <el-select v-model="value" placeholder="请选择" style="width: 125px;" @change="changeSplit">-->
<!-- <el-option-->
<!-- v-for="item in optionsList"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </div>-->
<!-- <jlmap-visual ref="jlmapVisual" />-->
<!-- <div v-show="disPlay" class="bigSplitScreenBack">-->
<!-- <el-button-group>-->
<!-- <el-button type="primary" @click="back">返回</el-button>-->
<!-- </el-button-group>-->
<!-- </div>-->
<!-- </div>-->
<!--</template>-->
<!--<script>-->
<!--import JlmapVisual from '@/views/newMap/jlmapNew/index';-->
<!--import { loadMapDataById } from '@/utils/loaddata';-->
<!--import { clearSimulation } from '@/api/simulation';-->
<!--import { mapGetters } from 'vuex';-->
<!--import { creatSubscribe, clearSubscribe, displayTopic} from '@/utils/stomp';-->
<!--import { getToken } from '@/utils/auth';-->
<!--import { getSessionStorage } from '@/utils/auth';-->
<!--import { TrainingMode } from '@/scripts/ConstDic';-->
export default {
name: 'MapPreview',
components: {
JlmapVisual
},
props: {
<!--export default {-->
<!-- name: 'MapPreview',-->
<!-- components: {-->
<!-- JlmapVisual-->
<!-- },-->
<!-- props: {-->
},
data() {
return {
maskOpen: false,
disPlay: false,
value: 1,
optionsList: []
};
},
computed: {
mapId() {
return this.$route.params.mapId;
},
...mapGetters('map', [
'bigScreenConfig'
]),
...mapGetters('config', [
'canvasId'
])
},
watch: {
$route() {
this.$nextTick(() => {
this.initLoadData();
});
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'$store.state.map.mapViewLoadedCount':function() {
this.$store.dispatch('map/setTrainWindowShow', false);
this.$jlmap.off('zoom');
this.$jlmap.off('pan');
this.handleUpdateScreen();
if (this.$route.query.group) {
this.subscribe();
}
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length && this.$route.query.group) {
this.statusMessage(val);
}
},
'$store.state.socket.simulationOver':function(val) {
this.backOut();
}
},
async beforeDestroy() {
await this.$store.dispatch('map/mapClear');
this.$store.dispatch('training/setPrdType', '');
},
async mounted() {
this.$store.dispatch('training/setPrdType', '03');
await this.setWindowSize();
await this.initLoadData();
this.disPlay = true;
if (this.$route.path.includes('design/bigScreen')) {
this.disPlay = false;
}
if (this.$route.query.projectDevice) {
this.disPlay = false;
const data = JSON.parse(JSON.parse(getSessionStorage('projectDevice')).config);
this.changeSplit(data.quadrant);
}
},
methods: {
async initLoadData() { //
if (this.$route.query.group) {
await loadMapDataById(this.$route.query.mapId, 'simulation');
} else {
this.$store.dispatch('training/changeMode', { mode: TrainingMode.NORMAL });
loadMapDataById(this.$route.params.mapId, 'preview');
}
},
async statusMessage(list) {
await this.$store.dispatch('training/updateMapState', list);
await this.$store.dispatch('socket/setEquipmentStatus');
},
setWindowSize() {
this.$nextTick(() => {
const width = this.$store.state.app.width;
const height = this.$store.state.app.height;
this.$store.dispatch('config/resize', { width, height });
this.handleUpdateScreen();
});
},
changeSplit(data) {
const width = this.bigScreenConfig.width;
const height = this.bigScreenConfig.height;
const num = width * height;
const size = {
width: this.$store.state.app.width * width,
height: this.$store.state.app.height * height
};
const obj = {
width: width,
height: height
};
this.$refs.jlmapVisual.setOffset(size, data, num, obj);
},
handleUpdateScreen() {
this.maskOpen = false;
if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {
const offsetList = this.bigScreenConfig.offsetList;
const width = this.bigScreenConfig.width;
const height = this.bigScreenConfig.height;
const num = width * height;
this.optionsList = [];
for (let index = 0; index < num; index++) {
const param = { value: index + 1, label: `${index + 1}` };
this.optionsList.push(param);
}
const size = {
width: this.$store.state.app.width * width,
height: this.$store.state.app.height * height,
list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),
offsetList: offsetList
};
this.$jlmap.setUpdateScreen(size);
this.$refs.jlmapVisual.handleStateLoaded();
if (this.$route.query.projectDevice) {
this.disPlay = false;
const data = JSON.parse(JSON.parse(getSessionStorage('projectDevice')).config);
this.changeSplit(data.quadrant);
}
} else {
this.maskOpen = true;
}
},
async back() {
if (this.$route.query.group) {
await clearSimulation(this.$route.query.group);
this.clearSubscribe();
}
this.$store.dispatch('training/over').then(() => {
history.go(-1);
});
},
backOut() {
if (this.$route.query.projectDevice) {
this.$store.dispatch('LogOut').then(() => {
location.reload();
});
}
},
async subscribe() {
this.clearSubscribe();
const header = { group: this.$route.query.group || '', 'X-Token': getToken() };
creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);
// await this.$store.dispatch('training/setHasSubscribed');
},
clearSubscribe() {
clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);
}
}
};
</script>
<style lang="scss" scoped>
.bigSplitScreen {
float: left;
width: auto;
}
.bigSplitScreenMask{
opacity: 1;
background: #000;
position: absolute;
right: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9;
}
.bigSplitScreenBack,.bigSplitScreenSelect {
position: absolute;
float: right;
right: 15px;
bottom: 15px;
z-index: 19;
}
.bigSplitScreenSelect {
top: 15px;
}
</style>
<!-- },-->
<!-- data() {-->
<!-- return {-->
<!-- maskOpen: false,-->
<!-- disPlay: false,-->
<!-- value: 1,-->
<!-- optionsList: []-->
<!-- };-->
<!-- },-->
<!-- computed: {-->
<!-- mapId() {-->
<!-- return this.$route.params.mapId;-->
<!-- },-->
<!-- ...mapGetters('map', [-->
<!-- 'bigScreenConfig'-->
<!-- ]),-->
<!-- ...mapGetters('config', [-->
<!-- 'canvasId'-->
<!-- ])-->
<!-- },-->
<!-- watch: {-->
<!-- $route() {-->
<!-- this.$nextTick(() => {-->
<!-- this.initLoadData();-->
<!-- });-->
<!-- },-->
<!-- '$store.state.app.windowSizeCount': function() {-->
<!-- this.setWindowSize();-->
<!-- },-->
<!-- '$store.state.map.mapViewLoadedCount':function() {-->
<!-- this.$store.dispatch('map/setTrainWindowShow', false);-->
<!-- this.$jlmap.off('zoom');-->
<!-- this.$jlmap.off('pan');-->
<!-- this.handleUpdateScreen();-->
<!-- if (this.$route.query.group) {-->
<!-- this.subscribe();-->
<!-- }-->
<!-- },-->
<!-- '$store.state.socket.equipmentStatus': function (val) {-->
<!-- if (val.length && this.$route.query.group) {-->
<!-- this.statusMessage(val);-->
<!-- }-->
<!-- },-->
<!-- '$store.state.socket.simulationOver':function(val) {-->
<!-- this.backOut();-->
<!-- }-->
<!-- },-->
<!-- async beforeDestroy() {-->
<!-- await this.$store.dispatch('map/mapClear');-->
<!-- this.$store.dispatch('training/setPrdType', '');-->
<!-- },-->
<!-- async mounted() {-->
<!-- this.$store.dispatch('training/setPrdType', '03');-->
<!-- await this.setWindowSize();-->
<!-- await this.initLoadData();-->
<!-- this.disPlay = true;-->
<!-- if (this.$route.path.includes('design/bigScreen')) {-->
<!-- this.disPlay = false;-->
<!-- }-->
<!-- if (this.$route.query.projectDevice) {-->
<!-- this.disPlay = false;-->
<!-- const data = JSON.parse(JSON.parse(getSessionStorage('projectDevice')).config);-->
<!-- this.changeSplit(data.quadrant);-->
<!-- }-->
<!-- },-->
<!-- methods: {-->
<!-- async initLoadData() { // -->
<!-- if (this.$route.query.group) {-->
<!-- await loadMapDataById(this.$route.query.mapId, 'simulation');-->
<!-- } else {-->
<!-- this.$store.dispatch('training/changeMode', { mode: TrainingMode.NORMAL });-->
<!-- loadMapDataById(this.$route.params.mapId, 'preview');-->
<!-- }-->
<!-- },-->
<!-- async statusMessage(list) {-->
<!-- await this.$store.dispatch('training/updateMapState', list);-->
<!-- await this.$store.dispatch('socket/setEquipmentStatus');-->
<!-- },-->
<!-- setWindowSize() {-->
<!-- this.$nextTick(() => {-->
<!-- const width = this.$store.state.app.width;-->
<!-- const height = this.$store.state.app.height;-->
<!-- this.$store.dispatch('config/resize', { width, height });-->
<!-- this.handleUpdateScreen();-->
<!-- });-->
<!-- },-->
<!-- changeSplit(data) {-->
<!-- const width = this.bigScreenConfig.width;-->
<!-- const height = this.bigScreenConfig.height;-->
<!-- const num = width * height;-->
<!-- const size = {-->
<!-- width: this.$store.state.app.width * width,-->
<!-- height: this.$store.state.app.height * height-->
<!-- };-->
<!-- const obj = {-->
<!-- width: width,-->
<!-- height: height-->
<!-- };-->
<!-- this.$refs.jlmapVisual.setOffset(size, data, num, obj);-->
<!-- },-->
<!-- handleUpdateScreen() {-->
<!-- this.maskOpen = false;-->
<!-- if (this.bigScreenConfig.bigScreenSplitConfig && this.bigScreenConfig.bigScreenSplitConfig.length) {-->
<!-- const offsetList = this.bigScreenConfig.offsetList;-->
<!-- const width = this.bigScreenConfig.width;-->
<!-- const height = this.bigScreenConfig.height;-->
<!-- const num = width * height;-->
<!-- this.optionsList = [];-->
<!-- for (let index = 0; index < num; index++) {-->
<!-- const param = { value: index + 1, label: `${index + 1}` };-->
<!-- this.optionsList.push(param);-->
<!-- }-->
<!-- const size = {-->
<!-- width: this.$store.state.app.width * width,-->
<!-- height: this.$store.state.app.height * height,-->
<!-- list: this.bigScreenConfig.bigScreenSplitConfig.map(ele => ele.position),-->
<!-- offsetList: offsetList-->
<!-- };-->
<!-- this.$jlmap.setUpdateScreen(size);-->
<!-- this.$refs.jlmapVisual.handleStateLoaded();-->
<!-- if (this.$route.query.projectDevice) {-->
<!-- this.disPlay = false;-->
<!-- const data = JSON.parse(JSON.parse(getSessionStorage('projectDevice')).config);-->
<!-- this.changeSplit(data.quadrant);-->
<!-- }-->
<!-- } else {-->
<!-- this.maskOpen = true;-->
<!-- }-->
<!-- },-->
<!-- async back() {-->
<!-- if (this.$route.query.group) {-->
<!-- await clearSimulation(this.$route.query.group);-->
<!-- this.clearSubscribe();-->
<!-- }-->
<!-- this.$store.dispatch('training/over').then(() => {-->
<!-- history.go(-1);-->
<!-- });-->
<!-- },-->
<!-- backOut() {-->
<!-- if (this.$route.query.projectDevice) {-->
<!-- this.$store.dispatch('LogOut').then(() => {-->
<!-- location.reload();-->
<!-- });-->
<!-- }-->
<!-- },-->
<!-- async subscribe() {-->
<!-- this.clearSubscribe();-->
<!-- const header = { group: this.$route.query.group || '', 'X-Token': getToken() };-->
<!-- creatSubscribe(`${displayTopic}\/${this.$route.query.group}`, header);-->
<!-- // await this.$store.dispatch('training/setHasSubscribed');-->
<!-- },-->
<!-- clearSubscribe() {-->
<!-- clearSubscribe(`${displayTopic}\/${this.$route.query.group}`);-->
<!-- }-->
<!-- }-->
<!--};-->
<!--</script>-->
<!--<style lang="scss" scoped>-->
<!-- .bigSplitScreen {-->
<!-- float: left;-->
<!-- width: auto;-->
<!-- }-->
<!-- .bigSplitScreenMask{-->
<!-- opacity: 1;-->
<!-- background: #000;-->
<!-- position: absolute;-->
<!-- right: 0;-->
<!-- top: 0;-->
<!-- width: 100%;-->
<!-- height: 100%;-->
<!-- z-index: 9;-->
<!-- }-->
<!-- .bigSplitScreenBack,.bigSplitScreenSelect {-->
<!-- position: absolute;-->
<!-- float: right;-->
<!-- right: 15px;-->
<!-- bottom: 15px;-->
<!-- z-index: 19;-->
<!-- }-->
<!-- .bigSplitScreenSelect {-->
<!-- top: 15px;-->
<!-- }-->
<!--</style>-->

View File

@ -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>&nbsp;{{ 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>&nbsp;{{ 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>-->

View File

@ -1,83 +1,83 @@
<template>
<div class="joylink-card">
<el-scrollbar wrap-class="scrollbar-wrapper">
<div class="content_box">
<h1 class="title">城市轨道交通设计平台</h1>
<div class="card-box">
<el-carousel :interval="4000" type="card" height="380px">
<el-carousel-item v-for="(item, index) in listImg" :key="index">
<img :src="item.src" alt="" height="100%" width="100%">
</el-carousel-item>
</el-carousel>
</div>
<div class="brief-box">{{ $t('demonstration.simulationSystemDescription') }}</div>
</div>
</el-scrollbar>
</div>
</template>
<!--<template>-->
<!-- <div class="joylink-card">-->
<!-- <el-scrollbar wrap-class="scrollbar-wrapper">-->
<!-- <div class="content_box">-->
<!-- <h1 class="title">城市轨道交通设计平台</h1>-->
<!-- <div class="card-box">-->
<!-- <el-carousel :interval="4000" type="card" height="380px">-->
<!-- <el-carousel-item v-for="(item, index) in listImg" :key="index">-->
<!-- <img :src="item.src" alt="" height="100%" width="100%">-->
<!-- </el-carousel-item>-->
<!-- </el-carousel>-->
<!-- </div>-->
<!-- <div class="brief-box">{{ $t('demonstration.simulationSystemDescription') }}</div>-->
<!-- </div>-->
<!-- </el-scrollbar>-->
<!-- </div>-->
<!--</template>-->
<script>
import home1 from '@/assets/home/home1.png';
import home2 from '@/assets/home/home2.png';
import home3 from '@/assets/home/script.png';
<!--<script>-->
<!--import home1 from '@/assets/home/home1.png';-->
<!--import home2 from '@/assets/home/home2.png';-->
<!--import home3 from '@/assets/home/script.png';-->
export default {
name: 'Home',
data() {
return {
listImg: [
{ src: home1 },
{ src: home2 },
{ src: home3 }
]
};
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
<!--export default {-->
<!-- name: 'Home',-->
<!-- data() {-->
<!-- return {-->
<!-- listImg: [-->
<!-- { src: home1 },-->
<!-- { src: home2 },-->
<!-- { src: home3 }-->
<!-- ]-->
<!-- };-->
<!-- }-->
<!--};-->
<!--</script>-->
<!--<style rel="stylesheet/scss" lang="scss" scoped>-->
<!-- @import "src/styles/mixin.scss";-->
/deep/ .el-carousel {
overflow: hidden;
width:100%;
}
.joylink-card{
height: 100%;
font-family: 'Microsoft YaHei';
overflow: hidden;
.content_box{
padding: 0 100px 15px;
}
.title {
font-size: 35px;
width: 100%;
text-align: center;
font-weight: 400;
margin-top: 55px;
border-bottom: 2px dashed #333;
padding-bottom: 15px;
margin-bottom: 70px;
position: relative;
<!-- /deep/ .el-carousel {-->
<!-- overflow: hidden;-->
<!-- width:100%;-->
<!-- }-->
<!-- .joylink-card{-->
<!-- height: 100%;-->
<!-- font-family: 'Microsoft YaHei';-->
<!-- overflow: hidden;-->
<!-- .content_box{-->
<!-- padding: 0 100px 15px;-->
<!-- }-->
<!-- .title {-->
<!-- font-size: 35px;-->
<!-- width: 100%;-->
<!-- text-align: center;-->
<!-- font-weight: 400;-->
<!-- margin-top: 55px;-->
<!-- border-bottom: 2px dashed #333;-->
<!-- padding-bottom: 15px;-->
<!-- margin-bottom: 70px;-->
<!-- position: relative;-->
.logo-img {
position: absolute;
right: 0;
top: 0;
width: 55px;
}
}
<!-- .logo-img {-->
<!-- position: absolute;-->
<!-- right: 0;-->
<!-- top: 0;-->
<!-- width: 55px;-->
<!-- }-->
<!-- }-->
.card-box {
width: 100%;
padding: 0 50px;
}
<!-- .card-box {-->
<!-- width: 100%;-->
<!-- padding: 0 50px;-->
<!-- }-->
.brief-box {
font-size: 18px;
text-indent: 2em;
line-height: 32px;
padding: 40px 20px 0;
font-family: unset;
}
}
</style>
<!-- .brief-box {-->
<!-- font-size: 18px;-->
<!-- text-indent: 2em;-->
<!-- line-height: 32px;-->
<!-- padding: 40px 20px 0;-->
<!-- font-family: unset;-->
<!-- }-->
<!-- }-->
<!--</style>-->

View File

@ -1,82 +1,82 @@
<template>
<div class="designPlatform" :style="'padding-left:'+(widthLeft)+'px'">
<div class="designPubMapList" :style="{width: widthLeft+'px'}">
<demon-list ref="demonList" />
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
</div>
<transition>
<router-view :width-left="widthLeft" />
</transition>
</div>
</template>
<!--<template>-->
<!-- <div class="designPlatform" :style="'padding-left:'+(widthLeft)+'px'">-->
<!-- <div class="designPubMapList" :style="{width: widthLeft+'px'}">-->
<!--&lt;!&ndash; <demon-list ref="demonList" />&ndash;&gt;-->
<!-- <drap-left :width-left="widthLeft" @drapWidth="drapWidth" />-->
<!-- </div>-->
<!-- <transition>-->
<!-- <router-view :width-left="widthLeft" />-->
<!-- </transition>-->
<!-- </div>-->
<!--</template>-->
<script>
import demonList from './demonList';
import drapLeft from '@/views/components/drapLeft/index';
import localStore from 'storejs';
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
<!--<script>-->
<!--// import demonList from './demonList';-->
<!--import drapLeft from '@/views/components/drapLeft/index';-->
<!--import localStore from 'storejs';-->
<!--import { getSessionStorage, setSessionStorage } from '@/utils/auth';-->
export default {
name: 'DesignPlatform',
components: {
demonList,
drapLeft
},
data() {
return {
widthLeft: Number(localStore.get('LeftWidth')) || 450
};
},
computed: {
width() {
return this.$store.state.app.width;
}
},
watch: {
widthLeft(val) {
this.setMapResize(val);
},
'$store.state.app.windowSizeCount': function() {
this.resize();
}
},
mounted() {
const againEnter = getSessionStorage('againEnter') || null;
if (!againEnter) {
setSessionStorage('againEnter', true);
}
this.resize();
this.widthLeft = Number(localStore.get('LeftWidth')) || 450;
},
methods: {
drapWidth(width) {
this.widthLeft = Number(width);
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
this.$store.dispatch('config/resize', { width: width });
},
setMapResize(LeftWidth) {
const widths = this.$store.state.app.width - 521 - LeftWidth;
this.$store.dispatch('config/resize', { width: widths });
}
<!--export default {-->
<!-- name: 'DesignPlatform',-->
<!-- components: {-->
<!-- // demonList,-->
<!-- drapLeft-->
<!-- },-->
<!-- data() {-->
<!-- return {-->
<!-- widthLeft: Number(localStore.get('LeftWidth')) || 450-->
<!-- };-->
<!-- },-->
<!-- computed: {-->
<!-- width() {-->
<!-- return this.$store.state.app.width;-->
<!-- }-->
<!-- },-->
<!-- watch: {-->
<!-- widthLeft(val) {-->
<!-- this.setMapResize(val);-->
<!-- },-->
<!-- '$store.state.app.windowSizeCount': function() {-->
<!-- this.resize();-->
<!-- }-->
<!-- },-->
<!-- mounted() {-->
<!-- const againEnter = getSessionStorage('againEnter') || null;-->
<!-- if (!againEnter) {-->
<!-- setSessionStorage('againEnter', true);-->
<!-- }-->
<!-- this.resize();-->
<!-- this.widthLeft = Number(localStore.get('LeftWidth')) || 450;-->
<!-- },-->
<!-- methods: {-->
<!-- drapWidth(width) {-->
<!-- this.widthLeft = Number(width);-->
<!-- },-->
<!-- resize() {-->
<!-- this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;-->
<!-- const width = this.$store.state.app.width - 521 - this.widthLeft;-->
<!-- this.$store.dispatch('config/resize', { width: width });-->
<!-- },-->
<!-- setMapResize(LeftWidth) {-->
<!-- const widths = this.$store.state.app.width - 521 - LeftWidth;-->
<!-- this.$store.dispatch('config/resize', { width: widths });-->
<!-- }-->
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.designPlatform {
position: relative;
height: 100%;
width: 100%;
overflow: hidden;
}
<!-- }-->
<!--};-->
<!--</script>-->
<!--<style rel="stylesheet/scss" lang="scss" scoped>-->
<!-- .designPlatform {-->
<!-- position: relative;-->
<!-- height: 100%;-->
<!-- width: 100%;-->
<!-- overflow: hidden;-->
<!-- }-->
.designPubMapList {
position:absolute;
left:0;
top:0;
height: 100%;
}
</style>
<!-- .designPubMapList {-->
<!-- position:absolute;-->
<!-- left:0;-->
<!-- top:0;-->
<!-- height: 100%;-->
<!-- }-->
<!--</style>-->

View File

@ -1,177 +1,177 @@
<template>
<div class="mapPreview">
<jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" />
<pop-menu ref="popMenu" :menu="menu" pop-class="preview_new_pop" />
</div>
</template>
<script>
import JlmapVisual from '@/views/newMap/jlmapNew/index';
import { loadMapDataById } from '@/utils/loaddata';
import { EventBus } from '@/scripts/event-bus';
import { DeviceMenu, getDeviceMenuByDeviceType } from '@/scripts/ConstDic';
import PopMenu from '@/components/PopMenu';
import { mapGetters } from 'vuex';
import { TrainingMode } from '@/scripts/ConstDic';
<!--<template>-->
<!-- <div class="mapPreview">-->
<!-- <jlmap-visual ref="jlmapVisual" @onMenu="onContextmenu" />-->
<!-- <pop-menu ref="popMenu" :menu="menu" pop-class="preview_new_pop" />-->
<!-- </div>-->
<!--</template>-->
<!--<script>-->
<!--import JlmapVisual from '@/views/newMap/jlmapNew/index';-->
<!--import { loadMapDataById } from '@/utils/loaddata';-->
<!--import { EventBus } from '@/scripts/event-bus';-->
<!--import { DeviceMenu, getDeviceMenuByDeviceType } from '@/scripts/ConstDic';-->
<!--import PopMenu from '@/components/PopMenu';-->
<!--import { mapGetters } from 'vuex';-->
<!--import { TrainingMode } from '@/scripts/ConstDic';-->
export default {
name: 'MapPreview',
components: {
JlmapVisual,
PopMenu
},
props: {
widthLeft: {
type: Number,
required: true
}
},
data() {
return {
size: {
width: document.documentElement.clientWidth - 400,
height: document.documentElement.clientHeight - 80
},
menu: [],
menuNormal: []
};
},
computed: {
...mapGetters('map', [
'stationList'
]),
mapId() {
return this.$route.params.mapId;
},
height() {
return this.$store.state.app.height - 50 - 30;
}
},
watch: {
widthLeft(val) {
this.setWindowSize();
},
$route() {
this.$nextTick(() => {
this.initLoadData();
});
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'$store.state.map.mapViewLoadedCount':function() {
this.$store.dispatch('map/setTrainWindowShow', false);
},
'$store.state.menuOperation.menuCount': function (val) {
if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {
this.popDoShow(this.$store.state.menuOperation.menuPosition);
} else {
this.popDoClose();
}
}
},
async beforeDestroy() {
await this.$store.dispatch('map/mapClear');
},
mounted() {
this.setWindowSize();
this.initLoadData();
},
methods: {
initLoadData() { //
if (parseInt(this.mapId)) {
this.$store.dispatch('training/changeMode', { mode: TrainingMode.NORMAL });
loadMapDataById(this.mapId, 'preview');
} else {
this.endViewLoading();
}
},
onContextmenu(em) {
const point = { x: em.clientX, y: em.clientY };
if (!em.deviceType) {
var menu = getDeviceMenuByDeviceType('Cancel');
this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });
}
},
//
mapLocation(item) {
if (item) {
this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });
this.popDoClose();
}
},
initMenu() {
this.menuNormal = [];
this.stationList.forEach(station => {
if (station.chargeStationCodeList && station.chargeStationCodeList.length) {
const node = {
label: station.name,
children: [{
code: station.code,
label: station.name,
handler: this.mapLocation
}]
};
station.chargeStationCodeList.forEach(item => {
const next = this.$store.getters['map/getDeviceByCode'](item);
node.children.push({
code: next.code,
label: next.name,
handler: this.mapLocation
});
});
this.menuNormal.push(node);
}
});
this.menu = [...this.menuNormal];
},
popDoShow(point) {
this.popClickEvent();
this.initMenu();
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
this.$refs.popMenu.resetShowPosition(point);
}
},
popClickEvent() {
const self = this;
window.onclick = function (e) {
self.popDoClose();
};
},
popDoClose() {
if (this.$refs && this.$refs.popMenu) {
this.$refs.popMenu.close();
}
},
//
endViewLoading(isSuccess) {
if (!isSuccess) {
this.$store.dispatch('map/mapClear');
}
<!--export default {-->
<!-- name: 'MapPreview',-->
<!-- components: {-->
<!-- JlmapVisual,-->
<!-- PopMenu-->
<!-- },-->
<!-- props: {-->
<!-- widthLeft: {-->
<!-- type: Number,-->
<!-- required: true-->
<!-- }-->
<!-- },-->
<!-- data() {-->
<!-- return {-->
<!-- size: {-->
<!-- width: document.documentElement.clientWidth - 400,-->
<!-- height: document.documentElement.clientHeight - 80-->
<!-- },-->
<!-- menu: [],-->
<!-- menuNormal: []-->
<!-- };-->
<!-- },-->
<!-- computed: {-->
<!-- ...mapGetters('map', [-->
<!-- 'stationList'-->
<!-- ]),-->
<!-- mapId() {-->
<!-- return this.$route.params.mapId;-->
<!-- },-->
<!-- height() {-->
<!-- return this.$store.state.app.height - 50 - 30;-->
<!-- }-->
<!-- },-->
<!-- watch: {-->
<!-- widthLeft(val) {-->
<!-- this.setWindowSize();-->
<!-- },-->
<!-- $route() {-->
<!-- this.$nextTick(() => {-->
<!-- this.initLoadData();-->
<!-- });-->
<!-- },-->
<!-- '$store.state.app.windowSizeCount': function() {-->
<!-- this.setWindowSize();-->
<!-- },-->
<!-- '$store.state.map.mapViewLoadedCount':function() {-->
<!-- this.$store.dispatch('map/setTrainWindowShow', false);-->
<!-- },-->
<!-- '$store.state.menuOperation.menuCount': function (val) {-->
<!-- if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) {-->
<!-- this.popDoShow(this.$store.state.menuOperation.menuPosition);-->
<!-- } else {-->
<!-- this.popDoClose();-->
<!-- }-->
<!-- }-->
<!-- },-->
<!-- async beforeDestroy() {-->
<!-- await this.$store.dispatch('map/mapClear');-->
<!-- },-->
<!-- mounted() {-->
<!-- this.setWindowSize();-->
<!-- this.initLoadData();-->
<!-- },-->
<!-- methods: {-->
<!-- initLoadData() { // -->
<!-- if (parseInt(this.mapId)) {-->
<!-- this.$store.dispatch('training/changeMode', { mode: TrainingMode.NORMAL });-->
<!-- loadMapDataById(this.mapId, 'preview');-->
<!-- } else {-->
<!-- this.endViewLoading();-->
<!-- }-->
<!-- },-->
<!-- onContextmenu(em) {-->
<!-- const point = { x: em.clientX, y: em.clientY };-->
<!-- if (!em.deviceType) {-->
<!-- var menu = getDeviceMenuByDeviceType('Cancel');-->
<!-- this.$store.dispatch('menuOperation/setPopMenu', { position: point, menu: menu });-->
<!-- }-->
<!-- },-->
<!-- // -->
<!-- mapLocation(item) {-->
<!-- if (item) {-->
<!-- this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code });-->
<!-- this.popDoClose();-->
<!-- }-->
<!-- },-->
<!-- initMenu() {-->
<!-- this.menuNormal = [];-->
<!-- this.stationList.forEach(station => {-->
<!-- if (station.chargeStationCodeList && station.chargeStationCodeList.length) {-->
<!-- const node = {-->
<!-- label: station.name,-->
<!-- children: [{-->
<!-- code: station.code,-->
<!-- label: station.name,-->
<!-- handler: this.mapLocation-->
<!-- }]-->
<!-- };-->
<!-- station.chargeStationCodeList.forEach(item => {-->
<!-- const next = this.$store.getters['map/getDeviceByCode'](item);-->
<!-- node.children.push({-->
<!-- code: next.code,-->
<!-- label: next.name,-->
<!-- handler: this.mapLocation-->
<!-- });-->
<!-- });-->
<!-- this.menuNormal.push(node);-->
<!-- }-->
<!-- });-->
<!-- this.menu = [...this.menuNormal];-->
<!-- },-->
<!-- popDoShow(point) {-->
<!-- this.popClickEvent();-->
<!-- this.initMenu();-->
<!-- if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {-->
<!-- this.$refs.popMenu.resetShowPosition(point);-->
<!-- }-->
<!-- },-->
<!-- popClickEvent() {-->
<!-- const self = this;-->
<!-- window.onclick = function (e) {-->
<!-- self.popDoClose();-->
<!-- };-->
<!-- },-->
<!-- popDoClose() {-->
<!-- if (this.$refs && this.$refs.popMenu) {-->
<!-- this.$refs.popMenu.close();-->
<!-- }-->
<!-- },-->
<!-- // -->
<!-- endViewLoading(isSuccess) {-->
<!-- if (!isSuccess) {-->
<!-- this.$store.dispatch('map/mapClear');-->
<!-- }-->
this.$nextTick(() => {
EventBus.$emit('viewLoading', false);
});
},
setWindowSize() {
this.$nextTick(() => {
const width = this.$store.state.app.width - (this.widthLeft || 450) - 2;
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
});
}
}
};
</script>
<style lang="scss" scoped>
.mapPreview {
width: 100%;
}
.mapPreview .pop-menu{
background: #f1ecec;
}
</style>
<style lang="scss">
.mapPreview .container .preview_new_pop .pop-menu {
background: #f1ecec;
}
</style>
<!-- this.$nextTick(() => {-->
<!-- EventBus.$emit('viewLoading', false);-->
<!-- });-->
<!-- },-->
<!-- setWindowSize() {-->
<!-- this.$nextTick(() => {-->
<!-- const width = this.$store.state.app.width - (this.widthLeft || 450) - 2;-->
<!-- const height = this.height;-->
<!-- this.$store.dispatch('config/resize', { width, height });-->
<!-- });-->
<!-- }-->
<!-- }-->
<!--};-->
<!--</script>-->
<!--<style lang="scss" scoped>-->
<!-- .mapPreview {-->
<!-- width: 100%;-->
<!-- }-->
<!-- .mapPreview .pop-menu{-->
<!-- background: #f1ecec;-->
<!-- }-->
<!--</style>-->
<!--<style lang="scss">-->
<!-- .mapPreview .container .preview_new_pop .pop-menu {-->
<!-- background: #f1ecec;-->
<!-- }-->
<!--</style>-->

View File

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

View File

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

View File

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

View File

@ -70,9 +70,6 @@
import {
getSelectLesson3dList
} from '@/api/jmap/lesson3d';
import {
ProjectIcon
} from '@/scripts/ProjectConfig';
import {
JL3D_LOCAL_STATIC
} from '@/api/jlmap3d/assets3d.js';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;" />&nbsp;&nbsp;&nbsp;&nbsp;4000500081</div>
<div class="eachInfo"><span class="el-icon-message" style="font-size:15px;margin-right:7px;" />&nbsp;&nbsp;&nbsp;&nbsp;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() {

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<template>
<div id="PlanTitleBar">
<img class="logo" :src="logoImg">
<img class="logo" :src="loginProLogo">
<span> {{ mapName }} &ensp;</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;

View File

@ -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" />
@ -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 ''; }
},
{
@ -262,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);

View File

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

View File

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

View File

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

View File

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

View File

@ -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&#45;&#45;center .el-dialog__body{-->
<!-- padding: 25px 55px 20px 20px;-->
<!--}-->
<!--/deep/ .el-dialog&#45;&#45;center .el-dialog__body .el-input{-->
<!-- width:200px !important;-->
<!--}-->
<!--</style>-->

View File

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

View File

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