From f597ce530fa867e17d93ac41df50115b1feb7af7 Mon Sep 17 00:00:00 2001 From: joylink_cuiweidong <364937672@qq.com> Date: Thu, 24 Oct 2019 18:11:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B8=83=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=20=E5=9C=B0=E5=9B=BE=E9=A2=84=E8=A7=88=20=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=20=E8=AF=BE=E7=A8=8B=E8=AE=BE=E8=AE=A1=E5=8F=AF?= =?UTF-8?q?=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 2 +- src/router/index.js | 11 ++- src/views/designPlatform/demonList.vue | 88 +++++++++--------- src/views/designPlatform/index.vue | 2 +- src/views/designPlatform/mapPreview.vue | 117 ++++++++++++++++++++++++ 5 files changed, 169 insertions(+), 51 deletions(-) create mode 100644 src/views/designPlatform/mapPreview.vue diff --git a/src/layout/index.vue b/src/layout/index.vue index d1669aa3d..ed158e407 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -40,7 +40,7 @@ export default { return this.$store.state.app.width; }, height() { - return this.$store.state.app.height - 60-30; + return this.$store.state.app.height-60-30; } }, created() { diff --git a/src/router/index.js b/src/router/index.js index 3f19be68c..960aba404 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -66,6 +66,7 @@ import PlanMonitorDetail from '@/views/planMonitor/detail'; import DesignPlatformHome from '@/views/designPlatform/home'; import DesignPlatform from '@/views/designPlatform/index'; import DesignPlatformUser from '@/views/designPlatform/userIndex'; +import MapPreview from '@/views/designPlatform/mapPreview'; import Replay from '@/views/replay/index'; import Package from '@/views/package/index'; @@ -149,7 +150,6 @@ export const userPlan = '015'; // 计划系统 export const userDesign='016'; // 设计系统 const isDev = process.env.NODE_ENV === 'development'; - export const UrlConfig = { display: '/display', scriptDisplay: '/scriptDisplay', @@ -200,7 +200,8 @@ export const UrlConfig = { trainingRecord: '/design/lesson/training', runPlan: '/design/runPlan/detail', scriptHome: '/design/script/home', - display: '/design/display' + display: '/design/display', + mapPreview: '/design/mapPreview' }, designUser: { prefix: '/design/userlist/home', @@ -399,6 +400,12 @@ export const asyncRouter = [ path: 'lesson/training/:trainingId/:trainingName', component: TrainingrecordManage, hidden: true + }, + { + path: 'mapPreview/:mapId', + component: MapPreview, + hidden: true + } ] } diff --git a/src/views/designPlatform/demonList.vue b/src/views/designPlatform/demonList.vue index 1fc5738de..e3ffd3706 100644 --- a/src/views/designPlatform/demonList.vue +++ b/src/views/designPlatform/demonList.vue @@ -4,7 +4,6 @@ - import { listPublishMap } from '@/api/jmap/map'; import { UrlConfig } from '@/router/index'; +import { superAdmin, admin } from '@/router'; import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth'; import FilterCity from '@/views/components/filterCity'; import localStore from 'storejs'; @@ -65,8 +65,6 @@ export default { }, node: { }, - // mapId: '', - heightUp: 450, point: { x: 0, y: 0 @@ -74,16 +72,8 @@ export default { editModel: {}, localParamName: 'publish_cityCode', cityCode: '' - // skinCode:'' }; }, - computed: { - role() { - return this.$store.state.user.roles.includes('04') || - this.$store.state.user.roles.includes('05') || - this.$store.state.user.roles.includes('01'); - } - }, watch: { filterText(val) { this.treeList = this.treeData.filter((res) => { @@ -94,9 +84,6 @@ export default { beforeDestroy () { removeSessionStorage('demonList'); }, - mounted() { - this.heightUp = Number(localStore.get('upHeight')?localStore.get('upHeight'):(this.height)/2); - }, methods: { filterNode(value, data) { if (!value) return true; @@ -110,24 +97,29 @@ export default { }, clickEvent(obj, data, ele) { switch (obj.type) { - case 'scriptDesign': { - setSessionStorage('designType', 'scriptDesign'); - this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?skinCode=${obj.skinCode}` }); - break; - } - case 'lessonDesign': { - setSessionStorage('designType', 'lessonDesign'); - this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}/${obj.skinCode}`, query: {cityCode: this.cityCode} }); - break; - } - case 'runPlanDesign': { - setSessionStorage('designType', 'runPlanDesign'); - this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` }); - break; - } - case 'map': { - setSessionStorage('demonList', obj.id); - } + case 'scriptDesign': { + setSessionStorage('designType', 'scriptDesign'); + this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?skinCode=${obj.skinCode}` }); + break; + } + case 'lessonDesign': { + setSessionStorage('designType', 'lessonDesign'); + this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}/${obj.skinCode}`, query: {cityCode: this.cityCode} }); + break; + } + case 'runPlanDesign': { + setSessionStorage('designType', 'runPlanDesign'); + this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` }); + break; + } + case 'map': { + setSessionStorage('demonList', obj.id); + break; + } + case 'mapPreview':{ + this.$router.push({ path: `${UrlConfig.design.mapPreview}/${obj.mapId}` }); + break; + } } // this.$refs.menu.doClose(); }, @@ -144,24 +136,28 @@ export default { // debugger; // elem.children.find(n => { return n.name.includes("行调")}) elem.children=[ - // { - // id:'1', - // name:'地图设计', - // type:'mapDesign' - // }, + { + id:'1', + name:'地图预览', + type:'mapPreview', + mapId: elem.id, + hidden:false + }, { id: '2', name: '课程设计', type: 'lessonDesign', mapId: elem.id, - skinCode: elem.skinCode + skinCode: elem.skinCode, + hidden:this.isAdministrator() }, { id: '3', name: '剧本设计', type: 'scriptDesign', mapId: elem.id, - skinCode: elem.skinCode + skinCode: elem.skinCode, + hidden:false // code:elem.children.find(n => { return n.name.includes("行调")}) }, { @@ -169,7 +165,8 @@ export default { name: '运行图设计', type: 'runPlanDesign', mapId: elem.id, - skinCode: elem.skinCode + skinCode: elem.skinCode, + hidden:false } ]; }); @@ -187,18 +184,15 @@ export default { this.$messageBox(this.$t('error.refreshFailed')); } }, - // refresh1(){ - - // }, - drapHeight(height) { - this.heightUp = Number(height); - }, 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.indexOf(superAdmin) || this.$store.state.user.roles.indexOf(admin); + }, // createMap() { // this.$emit("createMap"); // }, diff --git a/src/views/designPlatform/index.vue b/src/views/designPlatform/index.vue index b3e427ad1..932a76f6c 100644 --- a/src/views/designPlatform/index.vue +++ b/src/views/designPlatform/index.vue @@ -6,7 +6,7 @@ - + diff --git a/src/views/designPlatform/mapPreview.vue b/src/views/designPlatform/mapPreview.vue new file mode 100644 index 000000000..3b59dab4b --- /dev/null +++ b/src/views/designPlatform/mapPreview.vue @@ -0,0 +1,117 @@ + + +