diff --git a/src/api/management/mapprd.js b/src/api/management/mapprd.js index 384e5759c..427d858ae 100644 --- a/src/api/management/mapprd.js +++ b/src/api/management/mapprd.js @@ -2,113 +2,113 @@ import request from '@/utils/request'; /** 获取发布地图树*/ export function getPublishMapTree(cityCode) { - return request({ - url: `/api/mapPrd/${cityCode}/tree`, - method: 'get' - }); + return request({ + url: `/api/mapPrd/${cityCode}/tree`, + method: 'get' + }); } /** 获取产品详细内容*/ export function getProductDetail(prdCode) { - return request({ - url: `/api/mapPrd/${prdCode}`, - method: 'get' - }); + return request({ + url: `/api/mapPrd/${prdCode}`, + method: 'get' + }); } /** 检查实训编码是否已存在*/ export function checkCodeExist(data) { - return request({ - url: '/api/mapPrd/checkCodeExist', - method: 'get', - params: data - }); + return request({ + url: '/api/mapPrd/checkCodeExist', + method: 'get', + params: data + }); } -/** 获取产品类目数*/ +/** 获取产品树*/ export function getProductTree() { - return request({ - url: `/api/mapPrd/tree`, - method: 'get' - }); + return request({ + url: `/api/mapPrd/tree`, + method: 'get' + }); } /** 创建实训类目*/ export function createTrainingCategory(data) { - return request({ - url: '/api/mapPrd', - method: 'post', - data: data - }); + return request({ + url: '/api/mapPrd', + method: 'post', + data: data + }); } /** 更新实训类目*/ export function updateTrainingCategory(data) { - return request({ - url: `/api/mapPrd/${data.id}`, - method: 'put', - data: data - }); + return request({ + url: `/api/mapPrd/${data.id}`, + method: 'put', + data: data + }); } /** 删除实训类目*/ export function deleteTrainingCategory(data) { - return request({ - url: `/api/mapPrd/${data.id}`, - method: 'delete' - }); + return request({ + url: `/api/mapPrd/${data.id}`, + method: 'delete' + }); } /** * 获取地图下的产品列表 */ export function getCommodityMapProduct(skinCode) { - return request({ - url: `/api/mapPrd/${skinCode}/list`, - method: 'get' - }); + return request({ + url: `/api/mapPrd/${skinCode}/list`, + method: 'get' + }); } /** * 获取地图下的产品详情 */ export function getMapProductDetail(prdCode) { - return request({ - url: `/api/mapPrd/${prdCode}`, - method: 'get' - }); + return request({ + url: `/api/mapPrd/${prdCode}`, + method: 'get' + }); } /** 获取产品管理列表*/ export function getProductList(data) { - return request({ - url: `/api/mapPrd/list`, - method: 'get', - params: data - }); + return request({ + url: `/api/mapPrd/list`, + method: 'get', + params: data + }); } /** 发布地图产品上架*/ export function putMapProductOnLine(id) { - return request({ - url: `/api/mapPrd/${id}/onLine`, - method: 'put' - }); + return request({ + url: `/api/mapPrd/${id}/onLine`, + method: 'put' + }); } /** 发布地图产品下架*/ export function putMapProductOffLine(id) { - return request({ - url: `/api/mapPrd/${id}/offLine`, - method: 'put' - }); + return request({ + url: `/api/mapPrd/${id}/offLine`, + method: 'put' + }); } /** 校验产品code是否已存在*/ export function checkMapProductCodeExist(params) { - return request({ - url: `/api/mapPrd/checkCodeExist`, - method: 'get', - params: params - }); + return request({ + url: `/api/mapPrd/checkCodeExist`, + method: 'get', + params: params + }); } diff --git a/src/api/runplan.js b/src/api/runplan.js index 8ef1d184b..876381619 100644 --- a/src/api/runplan.js +++ b/src/api/runplan.js @@ -112,7 +112,7 @@ export function publishRunPlan(data) { */ export function importRunPlan(data) { return request({ - url: `/api/runPlan/draft/${data.skinCode}/prdPlan`, + url: `/api/runPlan/draft/${data.mapId}/prdPlan`, method: 'post', data: data.runPlanList }); @@ -135,17 +135,17 @@ export function getRpListByMapId(mapId) { } /** 获取站间运行时间*/ -export function getStationRunning(skinCode) { +export function getStationRunning(mapId) { return request({ - url: `/api/runPlan/draft/${skinCode}/stationRunning`, + url: `/api/runPlan/draft/${mapId}/stationRunning`, method: 'get' }); } /** 设置站间运行时间*/ -export function setStationRunning(skinCode, data) { +export function setStationRunning(mapId, data) { return request({ - url: `/api/runPlan/draft/${skinCode}/stationRunning`, + url: `/api/runPlan/draft/${mapId}/stationRunning`, method: 'put', data: data }); diff --git a/src/jmap/theme/beijing_01/planSchedule/menuBar.vue b/src/jmap/theme/beijing_01/planSchedule/menuBar.vue index e5ff4115a..168a5bda6 100644 --- a/src/jmap/theme/beijing_01/planSchedule/menuBar.vue +++ b/src/jmap/theme/beijing_01/planSchedule/menuBar.vue @@ -119,240 +119,236 @@ diff --git a/src/jmap/theme/chengdu_03/planSchedule/menuBar.vue b/src/jmap/theme/chengdu_03/planSchedule/menuBar.vue index e5ff4115a..168a5bda6 100644 --- a/src/jmap/theme/chengdu_03/planSchedule/menuBar.vue +++ b/src/jmap/theme/chengdu_03/planSchedule/menuBar.vue @@ -119,240 +119,236 @@ diff --git a/src/jmap/theme/chengdu_04/planSchedule/menuBar.vue b/src/jmap/theme/chengdu_04/planSchedule/menuBar.vue index e5ff4115a..168a5bda6 100644 --- a/src/jmap/theme/chengdu_04/planSchedule/menuBar.vue +++ b/src/jmap/theme/chengdu_04/planSchedule/menuBar.vue @@ -119,240 +119,236 @@ diff --git a/src/router/index.js b/src/router/index.js index a5fa8d4e4..7e4533fed 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -21,12 +21,11 @@ import Errpr404 from '@/views/error-page/404'; import SkinCode from '@/views/system/skinCode/index'; import SkinCodeDraft from '@/views/system/skinCode/draft'; +import MapProduct from '@/views/system/product/index'; -import Mapdraft from '@/views/map/mapdraft/index'; +// import Mapdraft from '@/views/map/mapdraft/index'; import Mapedit from '@/views/map/mapdraft/mapedit/index'; -import Runplan from '@/views/map/runplan/index'; -import MapProduct from '@/views/map/product/index'; -import RunplanView from '@/views/map/runplan/chart'; +// import Runplan from '@/views/map/runplan/index'; import Trainingrecord from '@/views/lesson/trainingrecord/index'; import TrainingrecordManage from '@/views/lesson/trainingrecord/manage/index'; @@ -53,22 +52,23 @@ import PublishExamRule from '@/views/publish/examRule/index'; import PublishExamRuleDraft from '@/views/publish/examRule/draft/index'; import DemonstrationDetail from '@/views/demonstration/detail/index'; -import ScreenMonitor from '@/views/screenMonitor/index'; -import ScreenMonitorHome from '@/views/screenMonitor/home'; -import ScreenMonitorDetail from '@/views/screenMonitor/detail/index'; +// import ScreenMonitor from '@/views/screenMonitor/index'; +// import ScreenMonitorHome from '@/views/screenMonitor/home'; +// import ScreenMonitorDetail from '@/views/screenMonitor/detail/index'; import PlanMonitorEditTool from '@/views/planMonitor/editTool/index'; import PlanMonitorEditUserTool from '@/views/planMonitor/editTool/userindex'; -import PlanMonitor from '@/views/planMonitor/index'; -import PlanMonitorHome from '@/views/planMonitor/home'; +// import PlanMonitor from '@/views/planMonitor/index'; +// import PlanMonitorHome from '@/views/planMonitor/home'; 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 DesignPlatformUser from '@/views/designUser/index'; + +// import Replay from '@/views/replay/index'; import Package from '@/views/package/index'; import PackageDraft from '@/views/package/draft/ruleForm'; import PackageDetail from '@/views/package/detail'; @@ -82,6 +82,7 @@ import RunPlanTemplate from '@/views/publish/runPlanTemplate/index'; import RunPlanEveryDay from '@/views/publish/runPlanEveryDay/index'; import ProductStatus from '@/views/publish/productStatus/index'; import PublishLesson from '@/views/publish/publishLesson/index'; +import RunplanView from '@/views/publish/runPlanView/index'; import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index'; import TrainingPlatform from '@/views/trainingPlatform/index'; @@ -320,7 +321,7 @@ export const constantRoutes = [ ]; export const asyncRouter = [ - { + { // 公共地图 path: '/design', component: Layout, redirect: '/design/home', @@ -423,7 +424,7 @@ export const asyncRouter = [ } ] }, - { + { // 个人地图 path: '/design/userlist', redirect: '/design/userlist/home', component: Layout, @@ -483,7 +484,7 @@ export const asyncRouter = [ } ] }, - { + { // 全屏战场图 path: '/display/:mode', component: Display, meta: { @@ -504,7 +505,7 @@ export const asyncRouter = [ }, hidden: true }, - { + { // 综合演练室 path: '/trainroom', component: TrainRoom, meta: { @@ -679,67 +680,67 @@ export const asyncRouter = [ // } // ] // }, - { + { // 运行图编辑 path: '/plan/usertool', component: PlanMonitorEditUserTool, meta: { }, hidden: true }, - { + { // 运行图编辑 path: '/plan/tool', component: PlanMonitorEditTool, meta: { }, hidden: true }, - { - path: '/plan', - redirect: '/plan/home', - component: PlanMonitor, - hidden: true, - meta: { - roles: [admin, user, userDesign] - }, - children: [ - { - path: 'home', - component: PlanMonitorHome, - meta: { - i18n: 'router.planSystem' - }, - target: true - }, - { - path: 'detail/:lessonId', - component: PlanMonitorDetail, - hidden: true - }, - { - path: 'pay/:lessonId', - component: Pay, - hidden: true - } - ] - }, - { - path: '/replay', - component: Layout, - hidden: true, - meta: { - roles: [admin, userDesign] - }, - children: [ - { - path: 'manage', - component: Replay, - meta: { - i18n: 'router.replayManage' - } - } - ] - }, - { + // { // 琏计划 + // path: '/plan', + // redirect: '/plan/home', + // component: PlanMonitor, + // hidden: true, + // meta: { + // roles: [admin, user, userDesign] + // }, + // children: [ + // { + // path: 'home', + // component: PlanMonitorHome, + // meta: { + // i18n: 'router.planSystem' + // }, + // target: true + // }, + // { + // path: 'detail/:lessonId', + // component: PlanMonitorDetail, + // hidden: true + // }, + // { + // path: 'pay/:lessonId', + // component: Pay, + // hidden: true + // } + // ] + // }, + // { + // path: '/replay', + // component: Layout, + // hidden: true, + // meta: { + // roles: [admin, userDesign] + // }, + // children: [ + // { + // path: 'manage', + // component: Replay, + // meta: { + // i18n: 'router.replayManage' + // } + // } + // ] + // }, + { // 发布内容管理 path: '/publish', component: Layout, meta: { @@ -823,7 +824,7 @@ export const asyncRouter = [ } ] }, - { + { // 订单权限管理 path: '/orderauthor', component: Layout, meta: { @@ -915,7 +916,7 @@ export const asyncRouter = [ } ] }, - { + { // 系统管理 path: '/system', component: Layout, meta: { @@ -1031,7 +1032,7 @@ export const asyncRouter = [ } ] }, - { + { // 发布申请 path: '/apply', component: Layout, meta: { diff --git a/src/views/approval/runPlan/index.vue b/src/views/approval/runPlan/index.vue index 6c26a3f60..aa242fe97 100644 --- a/src/views/approval/runPlan/index.vue +++ b/src/views/approval/runPlan/index.vue @@ -10,8 +10,8 @@ diff --git a/src/views/designPlatform/userDemonList.vue b/src/views/designUser/demonList.vue similarity index 100% rename from src/views/designPlatform/userDemonList.vue rename to src/views/designUser/demonList.vue diff --git a/src/views/designUser/index.vue b/src/views/designUser/index.vue new file mode 100644 index 000000000..cc99b15b6 --- /dev/null +++ b/src/views/designUser/index.vue @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + diff --git a/src/views/map/mapdraft/index.vue b/src/views/map/mapdraft/index.vue deleted file mode 100644 index 6b7e112b6..000000000 --- a/src/views/map/mapdraft/index.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/views/map/mapdraft/mapedit/index.vue b/src/views/map/mapdraft/mapedit/index.vue index 9a575a06d..61258876a 100644 --- a/src/views/map/mapdraft/mapedit/index.vue +++ b/src/views/map/mapdraft/mapedit/index.vue @@ -59,287 +59,287 @@ import ConfigMap from './configMap'; import DataRelation from './dataRelation/index'; export default { - name: 'MapView', - components: { - JlmapVisual, - MapOperate, - DataRelation, - ConfigMap - // MapCreate, - }, - data() { - return { - viewSelect: ViewMode.MIX, - mapSaveing: false, - ViewMode: ViewMode, - viewDraft: 'draft', - autoSaveTask: null, - selected: null, - mapInfo: { name: this.$t('map.pleaseSelectMap') }, - timeDemon: null - }; - }, - computed: { - cardHeight() { - return this.$store.state.app.height - 195-30; - } - }, - watch: { - '$store.state.map.mapDataLoadedCount': function (val) { - this.initAutoSaveTask(); - }, - $route() { - this.$nextTick(() => { - this.loadInitPage(); - }); - } - }, - mounted() { - this.loadInitPage(); - this.timeDemon = setInterval(() => { - checkLoginLine(); - }, 5000 * 60); - }, - beforeDestroy() { - this.clearAutoSave(); - this.$store.dispatch('map/mapClear'); - if (this.timeDemon) { - clearTimeout(this.timeDemon); - } - }, - methods: { - endViewLoading(isSuccess) { - if (!isSuccess) { - this.$store.dispatch('map/mapClear'); - } + name: 'MapView', + components: { + JlmapVisual, + MapOperate, + DataRelation, + ConfigMap + // MapCreate, + }, + data() { + return { + viewSelect: ViewMode.MIX, + mapSaveing: false, + ViewMode: ViewMode, + viewDraft: 'draft', + autoSaveTask: null, + selected: null, + mapInfo: { name: this.$t('map.pleaseSelectMap') }, + timeDemon: null + }; + }, + computed: { + cardHeight() { + return this.$store.state.app.height - 195 - 30; + } + }, + watch: { + '$store.state.map.mapDataLoadedCount': function (val) { + this.initAutoSaveTask(); + }, + $route() { + this.$nextTick(() => { + this.loadInitPage(); + }); + } + }, + mounted() { + this.loadInitPage(); + this.timeDemon = setInterval(() => { + checkLoginLine(); + }, 5000 * 60); + }, + beforeDestroy() { + this.clearAutoSave(); + this.$store.dispatch('map/mapClear'); + if (this.timeDemon) { + clearTimeout(this.timeDemon); + } + }, + methods: { + endViewLoading(isSuccess) { + if (!isSuccess) { + this.$store.dispatch('map/mapClear'); + } - this.$nextTick(() => { - EventBus.$emit('viewLoading', false); - }); - }, - showMap() { - this.$refs.configMap.doShow(); - }, - selectViewDraft(data) { - this.viewDraft = data; - }, - loadInitPage() { - this.$store.dispatch('training/changeMode', { mode: TrainingMode.MAP_EDIT }); - this.mapInfo = { name: this.$t('map.pleaseSelectMap'), id: this.$route.params.mapId }; - if (parseInt(this.mapInfo.id)) { - this.mapInfo.name = this.$route.query.name; - getMapDetail(this.$route.params.mapId).then(response => { - this.$store.dispatch('map/setMapData', response.data).then(resp => { - this.$store.dispatch('training/setMapDefaultState'); - }); - this.setDelayUnlockStatus(response.data, '00'); - this.initAutoSaveTask(); - }).catch((error) => { - console.log(error); - this.$messageBox(this.$t('tip.failedLoadMap')); - this.endViewLoading(); - }); - } else { - this.endViewLoading(); - } - }, - initAutoSaveTask() { - const timeout = 1000 * 60 * 3; - this.clearAutoSave(this.autoSaveTask); - if (this.viewDraft == 'draft') { - this.autoSaveTask = setInterval(this.saveMapEvent, timeout); - } - }, - clearAutoSave() { - if (this.autoSaveTask) { - clearInterval(this.autoSaveTask); - this.autoSaveTask = null; - } - }, - handleSelectControlPage (model) { - if (this.$refs && this.$refs.mapOperate) { - this.$refs.mapOperate.handleSelectControlPage(model); - this.$store.dispatch('menuOperation/setMapDrawSelectCount'); - } - }, - handleSelectView(handle) { - if (this.$refs && this.$refs.jlmapVisual) { - this.$refs.jlmapVisual.setLayerVisible(handle); - } - }, - handleSelectLogicalView(handle) { - if (this.$refs && this.$refs.jlmapVisual) { - this.$refs.jlmapVisual.setLevelVisible(handle); - } - }, - handleSelectPhysicalView(handle) { - if (this.$refs && this.$refs.jlmapVisual) { - this.$refs.jlmapVisual.setLevelVisible(handle); - } - }, - handleSelectHybridView(handle) { - if (this.$refs && this.$refs.jlmapVisual) { - this.$refs.jlmapVisual.setLevelVisible(handle); - } - }, - clickEvent(em) { - var device = this.getDeviceByEm(em); - this.onSelect(device); - if (this.$refs.dataRelation) { - this.$refs.dataRelation.setSelected(device); - } - }, - // 获取设备数据 - getDeviceByEm(em) { - var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null; - if (device) { - device._viewVal = em.val; - } - return device; - }, - onSelect(device) { - this.selected = device || null; - this.selected && this.handleSelectControlPage(device); - }, - onContextmenu(em) { - this.point = { - x: em.clientX, - y: em.clientY - }; - if (!em.deviceType) { - var menu = getDeviceMenuByDeviceType('Cancel'); - this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); - } - }, - saveMapEvent() { - if (this.$refs.jlmapVisual) { - const map = this.$store.state.map.map; - if (map && parseInt(this.$route.params.mapId)) { - for (const i in map.sectionList) { - if (map.sectionList[i].points.length > 0) { - for (let index = 0; index < map.sectionList[i].points.length; index++) { - if (String(map.sectionList[i].points[index].x) == 'undefined' || String(map.sectionList[i].points[index].y) == 'undefined') { - this.$messageBox(this.$t('tip.sectionPointsDeficiency')); - return; - } - } - } else { - this.$messageBox(this.$t('tip.sectionPointsDeficiency')); - return; - } - } + this.$nextTick(() => { + EventBus.$emit('viewLoading', false); + }); + }, + showMap() { + this.$refs.configMap.doShow(); + }, + selectViewDraft(data) { + this.viewDraft = data; + }, + loadInitPage() { + this.$store.dispatch('training/changeMode', { mode: TrainingMode.MAP_EDIT }); + this.mapInfo = { name: this.$t('map.pleaseSelectMap'), id: this.$route.params.mapId }; + if (parseInt(this.mapInfo.id)) { + this.mapInfo.name = this.$route.query.name; + getMapDetail(this.$route.params.mapId).then(response => { + this.$store.dispatch('map/setMapData', response.data).then(resp => { + this.$store.dispatch('training/setMapDefaultState'); + }); + this.setDelayUnlockStatus(response.data, '00'); + this.initAutoSaveTask(); + }).catch((error) => { + console.log(error); + this.$messageBox(this.$t('tip.failedLoadMap')); + this.endViewLoading(); + }); + } else { + this.endViewLoading(); + } + }, + initAutoSaveTask() { + const timeout = 1000 * 60 * 3; + this.clearAutoSave(this.autoSaveTask); + if (this.viewDraft == 'draft') { + this.autoSaveTask = setInterval(this.saveMapEvent, timeout); + } + }, + clearAutoSave() { + if (this.autoSaveTask) { + clearInterval(this.autoSaveTask); + this.autoSaveTask = null; + } + }, + handleSelectControlPage (model) { + if (this.$refs && this.$refs.mapOperate) { + this.$refs.mapOperate.handleSelectControlPage(model); + this.$store.dispatch('menuOperation/setMapDrawSelectCount'); + } + }, + handleSelectView(handle) { + if (this.$refs && this.$refs.jlmapVisual) { + this.$refs.jlmapVisual.setLayerVisible(handle); + } + }, + handleSelectLogicalView(handle) { + if (this.$refs && this.$refs.jlmapVisual) { + this.$refs.jlmapVisual.setLevelVisible(handle); + } + }, + handleSelectPhysicalView(handle) { + if (this.$refs && this.$refs.jlmapVisual) { + this.$refs.jlmapVisual.setLevelVisible(handle); + } + }, + handleSelectHybridView(handle) { + if (this.$refs && this.$refs.jlmapVisual) { + this.$refs.jlmapVisual.setLevelVisible(handle); + } + }, + clickEvent(em) { + var device = this.getDeviceByEm(em); + this.onSelect(device); + if (this.$refs.dataRelation) { + this.$refs.dataRelation.setSelected(device); + } + }, + // 获取设备数据 + getDeviceByEm(em) { + var device = this.$store.getters['map/getDeviceByCode'](em.deviceCode) || null; + if (device) { + device._viewVal = em.val; + } + return device; + }, + onSelect(device) { + this.selected = device || null; + this.selected && this.handleSelectControlPage(device); + }, + onContextmenu(em) { + this.point = { + x: em.clientX, + y: em.clientY + }; + if (!em.deviceType) { + var menu = getDeviceMenuByDeviceType('Cancel'); + this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu }); + } + }, + saveMapEvent() { + if (this.$refs.jlmapVisual) { + const map = this.$store.state.map.map; + if (map && parseInt(this.$route.params.mapId)) { + for (const i in map.sectionList) { + if (map.sectionList[i].points.length > 0) { + for (let index = 0; index < map.sectionList[i].points.length; index++) { + if (String(map.sectionList[i].points[index].x) == 'undefined' || String(map.sectionList[i].points[index].y) == 'undefined') { + this.$messageBox(this.$t('tip.sectionPointsDeficiency')); + return; + } + } + } else { + this.$messageBox(this.$t('tip.sectionPointsDeficiency')); + return; + } + } - this.mapSaveing = true; - this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => { - saveMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(response => { - this.$message.success(this.$t('tip.saveSuccessfully')); - this.mapSaveing = false; - this.initAutoSaveTask(); - }).catch(error => { - console.log(error); - this.$messageBox(this.$t('tip.saveFailed')); - this.mapSaveing = false; - if (error.code === 40004 || error.code === 40005 || error.code === 40003) { - this.clearAutoSave(); - } else { - this.initAutoSaveTask(); - } - }); - }).catch(error => { - console.log(error, '错误提示'); - this.mapSaveing = false; - this.$messageBox(this.$t('tip.saveFailed')); - }); - } - } - }, - verifyMapEvent() { - if (this.$refs.jlmapVisual) { - const map = this.$store.state.map.map; - if (map && this.$route.params.mapId) { - verifyMap(this.$route.params.mapId).then(res => { - if (res.data.length) { - this.tableToExcel(res.data); - this.$messageBox(this.$t('tip.dataValidationFailed')); - } else { - this.$message.success(this.$t('tip.dataValidationSuccess')); - } - }).catch(() => { - this.$messageBox(this.$t('tip.requestFailed')); - }); - } - } - }, + this.mapSaveing = true; + this.$store.dispatch('map/saveMapDeviceDefaultRelations').then(() => { + saveMap(Object.assign(map, { mapId: this.$route.params.mapId })).then(response => { + this.$message.success(this.$t('tip.saveSuccessfully')); + this.mapSaveing = false; + this.initAutoSaveTask(); + }).catch(error => { + console.log(error); + this.$messageBox(this.$t('tip.saveFailed')); + this.mapSaveing = false; + if (error.code === 40004 || error.code === 40005 || error.code === 40003) { + this.clearAutoSave(); + } else { + this.initAutoSaveTask(); + } + }); + }).catch(error => { + console.log(error, '错误提示'); + this.mapSaveing = false; + this.$messageBox(this.$t('tip.saveFailed')); + }); + } + } + }, + verifyMapEvent() { + if (this.$refs.jlmapVisual) { + const map = this.$store.state.map.map; + if (map && this.$route.params.mapId) { + verifyMap(this.$route.params.mapId).then(res => { + if (res.data.length) { + this.tableToExcel(res.data); + this.$messageBox(this.$t('tip.dataValidationFailed')); + } else { + this.$message.success(this.$t('tip.dataValidationSuccess')); + } + }).catch(() => { + this.$messageBox(this.$t('tip.requestFailed')); + }); + } + } + }, - tableToExcel(data) { - const filterVal = ['index']; - const arr = []; - data.forEach(item => { - arr.push({ index: item }); - }); - const dataList = this.formatJson(filterVal, arr); + tableToExcel(data) { + const filterVal = ['index']; + const arr = []; + data.forEach(item => { + arr.push({ index: item }); + }); + const dataList = this.formatJson(filterVal, arr); import('@/utils/Export2Excel').then(excel => { - excel.export_json_to_excel([this.$t('tip.dataQuestion')], dataList, this.$t('tip.dataList')); + excel.export_json_to_excel([this.$t('tip.dataQuestion')], dataList, this.$t('tip.dataList')); }); - }, - formatJson(filterVal, jsonData) { - return jsonData.map(v => filterVal.map(j => v[j])); - }, + }, + formatJson(filterVal, jsonData) { + return jsonData.map(v => filterVal.map(j => v[j])); + }, - setDelayUnlockStatus(data, status) { - if (data && data.delayShowList) { - data.delayShowList.forEach(elem => { - elem.status = status; - }); - } - }, - // 增加数据数据 给vuex map对象中 - addOrUpdateMapModel(obj) { - this.$store.dispatch('map/updateMapDevices', obj); - }, - // 删除数据 同时del map - delMapModel(obj) { - this.$store.dispatch('map/deleteMapDevices', obj).then(() => { - this.selected = null; - }); - }, - // 设置显示中心 - setCenter(code) { - this.$refs.jlmapVisual.setCenter(code); - }, - createMap() { - this.$refs.mapCreate.show(); - }, - importf() { - const loading = this.$loading({ - lock: true, - text: '正在导入中...', - spinner: 'el-icon-loading', - background: 'rgba(0, 0, 0, 0.7)' - }); - setTimeout(() => { - const obj = this.$refs.files; - if (!obj.files) return; - const f = obj.files[0]; - const reader = new FileReader(); - const that = this; - reader.readAsText(f, 'utf-8'); - reader.onload = function(e) { - const data = e.target.result; - postBuildMapImport(JSON.parse(data)).then(res => { - loading.close(); - that.$message.success('导入成功!'); - that.refresh(); - loading.close(); - }).catch(error => { - loading.close(); - that.$message.error('导入失败' + error.message); - }); - obj.value = ''; - }; - }); - } - } + setDelayUnlockStatus(data, status) { + if (data && data.delayShowList) { + data.delayShowList.forEach(elem => { + elem.status = status; + }); + } + }, + // 增加数据数据 给vuex map对象中 + addOrUpdateMapModel(obj) { + this.$store.dispatch('map/updateMapDevices', obj); + }, + // 删除数据 同时del map + delMapModel(obj) { + this.$store.dispatch('map/deleteMapDevices', obj).then(() => { + this.selected = null; + }); + }, + // 设置显示中心 + setCenter(code) { + this.$refs.jlmapVisual.setCenter(code); + }, + createMap() { + this.$refs.mapCreate.show(); + }, + importf() { + const loading = this.$loading({ + lock: true, + text: '正在导入中...', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + setTimeout(() => { + const obj = this.$refs.files; + if (!obj.files) return; + const f = obj.files[0]; + const reader = new FileReader(); + const that = this; + reader.readAsText(f, 'utf-8'); + reader.onload = function(e) { + const data = e.target.result; + postBuildMapImport(JSON.parse(data)).then(res => { + loading.close(); + that.$message.success('导入成功!'); + that.refresh(); + loading.close(); + }).catch(error => { + loading.close(); + that.$message.error('导入失败' + error.message); + }); + obj.value = ''; + }; + }); + } + } }; - diff --git a/src/views/map/mapdraft/mapmanage/operateMenu.vue b/src/views/map/mapdraft/mapmanage/operateMenu.vue index 6c4d7ff4a..c45adb5d7 100644 --- a/src/views/map/mapdraft/mapmanage/operateMenu.vue +++ b/src/views/map/mapdraft/mapmanage/operateMenu.vue @@ -19,196 +19,196 @@ import MapPublish from './publish'; import { mapGetters } from 'vuex'; export default { - name: 'MapOperateMenu', - components: { - PopMenu, - MapEdit, - MapSaveAs, - MapPublish - }, - props: { - point: { - type: Object, - required: true - }, - skinCode: { - type: String, - required: true - }, - editModel: { - type: Object, - required: true - } - }, - data() { - return { - menuMap: [ - { - label: this.$t('map.updateObj'), - handler: this.updateObj - }, - // { - // label: this.$t('map.updateObjAxis'), - // handler: this.updateObjAxis - // }, - { - label: this.$t('map.saveAs'), - handler: this.saveAs - }, - { - label: this.$t('map.deleteObj'), - handler: this.deleteObj - }, - { - label: this.$t('map.jlmap3d'), - handler: this.jlmap3d - } - ], - publishMapMenu: { - label: this.$t('map.publish'), - handler: this.publish - }, - menuNormal: [], - menu: [] - }; - }, - computed: { - ...mapGetters('map', [ - 'stationList' - ]), - hasRelease() { - return this.$store.state.user.roles.includes('04') || + name: 'MapOperateMenu', + components: { + PopMenu, + MapEdit, + MapSaveAs, + MapPublish + }, + props: { + point: { + type: Object, + required: true + }, + skinCode: { + type: String, + required: true + }, + editModel: { + type: Object, + required: true + } + }, + data() { + return { + menuMap: [ + { + label: this.$t('map.updateObj'), + handler: this.updateObj + }, + // { + // label: this.$t('map.updateObjAxis'), + // handler: this.updateObjAxis + // }, + { + label: this.$t('map.saveAs'), + handler: this.saveAs + }, + { + label: this.$t('map.deleteObj'), + handler: this.deleteObj + }, + { + label: this.$t('map.jlmap3d'), + handler: this.jlmap3d + } + ], + publishMapMenu: { + label: this.$t('map.publish'), + handler: this.publish + }, + menuNormal: [], + menu: [] + }; + }, + computed: { + ...mapGetters('map', [ + 'stationList' + ]), + hasRelease() { + return this.$store.state.user.roles.includes('04') || this.$store.state.user.roles.includes('05'); - } - }, - watch: { - '$store.state.menuOperation.menuCount': function (val) { - if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Map)) { - this.menu = [...this.menuMap]; - if (this.hasRelease) { - this.menu.push(this.publishMapMenu); - } - this.doShow(this.$store.state.menuOperation.menuPosition); - } else if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) { - this.initCancelMenu(); - this.doShow(this.$store.state.menuOperation.menuPosition); - } else { - this.doClose(); - } - } - }, - mounted() { - this.closeEvent(); - }, - methods: { - closeEvent() { - const self = this; - window.onclick = function (e) { - self.doClose(); - }; - }, - doShow(point) { - this.closeEvent(); - if (this.$refs && this.$refs.popMenu) { - this.$refs.popMenu.resetShowPosition(point); - } - }, - doClose() { - if (this.$refs && this.$refs.popMenu) { - this.$refs.popMenu.close(); - } - }, - updateObj() { - this.doClose(); - if (this.$refs && this.$refs.edit) { - this.$refs.edit.show('editCode'); - } - }, - updateObjAxis() { - this.doClose(); - if (this.$refs && this.$refs.axisEdit) { - this.$refs.axisEdit.show('editPoint'); - } - }, - saveAs() { - this.doClose(); - if (this.$refs && this.$refs.saveAs) { - this.$refs.saveAs.show(); - } - }, - publish() { - this.doClose(); - if (this.$refs && this.$refs.publish) { - this.$refs.publish.show(); - } - }, - deleteObj() { - this.doClose(); - const _that = this; - this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { - confirmButtonText: this.$t('map.confirm'), - cancelButtonText: this.$t('map.cancel'), - type: 'warning' - }).then(() => { - deleteMap(this.editModel.id).then(response => { - if (this.editModel.id == this.$route.params.mapId) { - this.$store.dispatch('map/mapClear').then(() => { - _that.$emit('editMap', null); - // _that.$router.push({ path: `${UrlConfig.map.draft}/0/draft` }); - _that.$router.push({ path: `${UrlConfig.designUser.prefix}` }); - }); - } - _that.refresh(); - _that.$message.success(this.$t('map.successfullyDelete')); - }).catch(error => { - _that.$message.error(this.$t('map.failDelete') + error.message); - }); - }).catch(() => { - }); - }, - jlmap3d() { - this.$emit('jlmap3d'); - }, - refresh() { - this.$emit('refresh'); - }, - initCancelMenu() { - this.menuNormal = []; - this.stationList.forEach(station => { - if (station.code === station.concentrateStationCode) { - const node = { - label: station.name, - children: [] - }; + } + }, + watch: { + '$store.state.menuOperation.menuCount': function (val) { + if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Map)) { + this.menu = [...this.menuMap]; + if (this.hasRelease) { + this.menu.push(this.publishMapMenu); + } + this.doShow(this.$store.state.menuOperation.menuPosition); + } else if (this.$store.getters['menuOperation/checkDialogIsOpen'](DeviceMenu.Cancel)) { + this.initCancelMenu(); + this.doShow(this.$store.state.menuOperation.menuPosition); + } else { + this.doClose(); + } + } + }, + mounted() { + this.closeEvent(); + }, + methods: { + closeEvent() { + const self = this; + window.onclick = function (e) { + self.doClose(); + }; + }, + doShow(point) { + this.closeEvent(); + if (this.$refs && this.$refs.popMenu) { + this.$refs.popMenu.resetShowPosition(point); + } + }, + doClose() { + if (this.$refs && this.$refs.popMenu) { + this.$refs.popMenu.close(); + } + }, + updateObj() { + this.doClose(); + if (this.$refs && this.$refs.edit) { + this.$refs.edit.show('editCode'); + } + }, + updateObjAxis() { + this.doClose(); + if (this.$refs && this.$refs.axisEdit) { + this.$refs.axisEdit.show('editPoint'); + } + }, + saveAs() { + this.doClose(); + if (this.$refs && this.$refs.saveAs) { + this.$refs.saveAs.show(); + } + }, + publish() { + this.doClose(); + if (this.$refs && this.$refs.publish) { + this.$refs.publish.show(); + } + }, + deleteObj() { + this.doClose(); + const _that = this; + this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), { + confirmButtonText: this.$t('map.confirm'), + cancelButtonText: this.$t('map.cancel'), + type: 'warning' + }).then(() => { + deleteMap(this.editModel.id).then(response => { + if (this.editModel.id == this.$route.params.mapId) { + this.$store.dispatch('map/mapClear').then(() => { + _that.$emit('editMap', null); + // _that.$router.push({ path: `${UrlConfig.map.draft}/0/draft` }); + _that.$router.push({ path: `${UrlConfig.designUser.prefix}` }); + }); + } + _that.refresh(); + _that.$message.success(this.$t('map.successfullyDelete')); + }).catch(error => { + _that.$message.error(this.$t('map.failDelete') + error.message); + }); + }).catch(() => { + }); + }, + jlmap3d() { + this.$emit('jlmap3d'); + }, + refresh() { + this.$emit('refresh'); + }, + initCancelMenu() { + this.menuNormal = []; + this.stationList.forEach(station => { + if (station.code === station.concentrateStationCode) { + const node = { + label: station.name, + children: [] + }; - this.stationList.forEach(elem => { - if (elem.visible) { - let next = elem; - while (next.code != next.concentrateStationCode || !next.concentrateStationCode) { - next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode); - } + this.stationList.forEach(elem => { + if (elem.visible) { + let next = elem; + while (next.code != next.concentrateStationCode || !next.concentrateStationCode) { + next = this.$store.getters['map/getDeviceByCode'](next.concentrateStationCode); + } - if (station.code == next.code) { - node.children.push({ - code: elem.code, - label: elem.name, - handler: this.mapLocation - }); - } - } - }); + if (station.code == next.code) { + node.children.push({ + code: elem.code, + label: elem.name, + handler: this.mapLocation + }); + } + } + }); - this.menuNormal.push(node); - } - }); - this.menu = [...this.menuNormal]; - }, - mapLocation(item) { - if (item) { - this.doClose(); - this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code }); - } - } - } + this.menuNormal.push(node); + } + }); + this.menu = [...this.menuNormal]; + }, + mapLocation(item) { + if (item) { + this.doClose(); + this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: item.code }); + } + } + } }; diff --git a/src/views/map/product/edit.vue b/src/views/map/product/edit.vue deleted file mode 100644 index be3700aec..000000000 --- a/src/views/map/product/edit.vue +++ /dev/null @@ -1,312 +0,0 @@ - - - - - - - - - - - - - - - - {{ item.name }} - - - - - - - - - - - - - - - - - - - - - - - {{ $t('map.create') }} - {{ $t('map.updata') }} - {{ $t('map.deleteObj') }} - - - - - - - diff --git a/src/views/map/product/index.vue b/src/views/map/product/index.vue deleted file mode 100644 index c45d375f5..000000000 --- a/src/views/map/product/index.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - diff --git a/src/views/map/product/tree.vue b/src/views/map/product/tree.vue deleted file mode 100644 index cff6d790a..000000000 --- a/src/views/map/product/tree.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - - {{ $t('map.productCategories') }} - - - - - - - - - - {{ node.label }} - - - - - - - - diff --git a/src/views/map/runplan/draft/setting.vue b/src/views/map/runplan/draft/setting.vue deleted file mode 100644 index 25ec981c4..000000000 --- a/src/views/map/runplan/draft/setting.vue +++ /dev/null @@ -1,84 +0,0 @@ - - - - - - - - - {{ $t('global.cancel') }} - {{ $t(global.confirm) }} - - - - - - - diff --git a/src/views/map/runplan/index.vue b/src/views/map/runplan/index.vue deleted file mode 100644 index 657ccf3ed..000000000 --- a/src/views/map/runplan/index.vue +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - diff --git a/src/views/map/runplan/manage/check.vue b/src/views/map/runplan/manage/check.vue deleted file mode 100644 index 12dbc355c..000000000 --- a/src/views/map/runplan/manage/check.vue +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - {{ $t('global.confirm') }} - {{ $t('global.cancel') }} - - - - - - diff --git a/src/views/map/runplan/manage/create.vue b/src/views/map/runplan/manage/create.vue deleted file mode 100644 index 7f9b3ff2d..000000000 --- a/src/views/map/runplan/manage/create.vue +++ /dev/null @@ -1,351 +0,0 @@ - - - - - - - - - - - - - km/h - - - - km/h - - - - km/h - - - - km/h - - - - - - - - - - - - - - - s - - - - - - - - - s - - - - - - - - - - - - - - - - {{ $t('global.previousStep') }} - - {{ $t('global.skip') }} - {{ $t('global.create') }} - {{ $t('global.confirm') }} - - - - - - - diff --git a/src/views/map/runplan/manage/import.vue b/src/views/map/runplan/manage/import.vue deleted file mode 100644 index 2e70e2e90..000000000 --- a/src/views/map/runplan/manage/import.vue +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - {{ $t('map.import') }} - {{ $t('global.cancel') }} - - - - - - - diff --git a/src/views/map/runplan/manage/list.vue b/src/views/map/runplan/manage/list.vue deleted file mode 100644 index 54f9be9de..000000000 --- a/src/views/map/runplan/manage/list.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - - {{ $t('map.mapList') }} - - - - - - - - - {{ node.label }} - - - - {{ node.label }} - - - - - - - - - - - diff --git a/src/views/map/runplan/manage/operateMenu.vue b/src/views/map/runplan/manage/operateMenu.vue deleted file mode 100644 index f114b475d..000000000 --- a/src/views/map/runplan/manage/operateMenu.vue +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - - - diff --git a/src/views/map/runplan/manage/publish.vue b/src/views/map/runplan/manage/publish.vue deleted file mode 100644 index 07b120db8..000000000 --- a/src/views/map/runplan/manage/publish.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - {{ $t('global.cancel') }} - {{ $t('global.confirm') }} - - - - - diff --git a/src/views/planMonitor/editTool/menuBar.vue b/src/views/planMonitor/editTool/menuBar.vue index d9020595d..dbcdcea3a 100644 --- a/src/views/planMonitor/editTool/menuBar.vue +++ b/src/views/planMonitor/editTool/menuBar.vue @@ -113,9 +113,8 @@ diff --git a/src/views/system/product/edit.vue b/src/views/system/product/edit.vue new file mode 100644 index 000000000..16eff2fe1 --- /dev/null +++ b/src/views/system/product/edit.vue @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + {{ item.name }} + + + + + + + + + + + + + + + + + + + + + + {{ $t('map.create') }} + {{ $t('map.updata') }} + {{ $t('map.deleteObj') }} + + + + + + + diff --git a/src/views/system/product/index.vue b/src/views/system/product/index.vue new file mode 100644 index 000000000..26341ffd1 --- /dev/null +++ b/src/views/system/product/index.vue @@ -0,0 +1,58 @@ + + + + + + + + + + + + + diff --git a/src/views/system/product/tree.vue b/src/views/system/product/tree.vue new file mode 100644 index 000000000..93e390135 --- /dev/null +++ b/src/views/system/product/tree.vue @@ -0,0 +1,130 @@ + + + + {{ $t('map.productCategories') }} + + + + + + + + + + {{ node.label }} + + + + + + + + + + +