From 6aa05c217fceb93964b3a296346e8ed411f63101 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 30 Oct 2019 10:15:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?desc:=20=E4=BF=AE=E6=94=B9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 143 ++++++------ src/utils/baseUrl.js | 4 +- src/views/map/runplan/index.vue | 78 +++---- src/views/map/skinCode/draft.vue | 212 ------------------ src/views/map/skinCode/index.vue | 124 ---------- .../orderauthor/permission/create/order.vue | 83 +++++-- .../permission/create/permission.vue | 19 +- src/views/system/skinCode/draft.vue | 202 +++++++++++++++++ src/views/system/skinCode/index.vue | 124 ++++++++++ 9 files changed, 519 insertions(+), 470 deletions(-) delete mode 100644 src/views/map/skinCode/draft.vue delete mode 100644 src/views/map/skinCode/index.vue create mode 100644 src/views/system/skinCode/draft.vue create mode 100644 src/views/system/skinCode/index.vue diff --git a/src/router/index.js b/src/router/index.js index 4331f8679..7e5cc03b5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -19,8 +19,9 @@ import JointTraining from '@/views/jointTraining/index'; import Error401 from '@/views/error-page/401'; import Errpr404 from '@/views/error-page/404'; -import SkinCode from '@/views/map/skinCode/index'; -import SkinCodeDraft from '@/views/map/skinCode/draft'; +import SkinCode from '@/views/system/skinCode/index'; +import SkinCodeDraft from '@/views/system/skinCode/draft'; + import Mapdraft from '@/views/map/mapdraft/index'; import Mapedit from '@/views/map/mapdraft/mapedit/index'; import Runplan from '@/views/map/runplan/index'; @@ -523,46 +524,46 @@ export const asyncRouter = [ }, hidden: true }, - { - path: '/map', - meta: { - i18n: 'router.mapManage', - roles: [admin, mapCreater, userDesign] - }, - hidden: true, - component: Layout, - children: [ - { - path: 'draw', - redirect: '/map/draw/0/draft', - component: Mapdraft, - meta: { - i18n: 'router.mapDraw' - }, - children: [ - { - path: ':mapId/:view', - component: Mapedit, - hidden: true - } - ] - }, - { - path: 'runPlan', - redirect: '/map/runPlan/view/draft', - component: Runplan, - meta: { - i18n: 'router.runPlanManage' - }, - children: [{ - path: 'view/:mode', - component: RunplanView, - hidden: true - }] - } - ] - }, - { + // { + // path: '/map', + // meta: { + // i18n: 'router.mapManage', + // roles: [admin, mapCreater, userDesign] + // }, + // hidden: true, + // component: Layout, + // children: [ + // { + // path: 'draw', + // redirect: '/map/draw/0/draft', + // component: Mapdraft, + // meta: { + // i18n: 'router.mapDraw' + // }, + // children: [ + // { + // path: ':mapId/:view', + // component: Mapedit, + // hidden: true + // } + // ] + // }, + // { + // path: 'runPlan', + // redirect: '/map/runPlan/view/draft', + // component: Runplan, + // meta: { + // i18n: 'router.runPlanManage' + // }, + // children: [{ + // path: 'view/:mode', + // component: RunplanView, + // hidden: true + // }] + // } + // ] + // }, + { // 实训平台 path: '/trainingPlatform', component: Layout, hidden: true, @@ -655,35 +656,35 @@ export const asyncRouter = [ } ] }, - { - path: '/dp', - hidden: true, - redirect: '/dp/home', - component: ScreenMonitor, - meta: { - roles: [admin, userScreen, user] - }, - children: [ - { - path: 'home', - component: ScreenMonitorHome, - meta: { - i18n: 'router.dpSystem' - }, - target: true - }, - { - path: 'detail/:lessonId', - component: ScreenMonitorDetail, - hidden: true - }, - { - path: 'pay/:lessonId', - component: Pay, - hidden: true - } - ] - }, + // { + // path: '/dp', + // hidden: true, + // redirect: '/dp/home', + // component: ScreenMonitor, + // meta: { + // roles: [admin, userScreen, user] + // }, + // children: [ + // { + // path: 'home', + // component: ScreenMonitorHome, + // meta: { + // i18n: 'router.dpSystem' + // }, + // target: true + // }, + // { + // path: 'detail/:lessonId', + // component: ScreenMonitorDetail, + // hidden: true + // }, + // { + // path: 'pay/:lessonId', + // component: Pay, + // hidden: true + // } + // ] + // }, { path: '/plan/usertool', component: PlanMonitorEditUserTool, diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index cbc51f6c4..343289067 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,10 +3,10 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - BASE_API = 'https://test.joylink.club/jlcloud'; + // BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 - // BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 + BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 } else { BASE_API = process.env.VUE_APP_BASE_API; } diff --git a/src/views/map/runplan/index.vue b/src/views/map/runplan/index.vue index 0ec418ab9..657ccf3ed 100644 --- a/src/views/map/runplan/index.vue +++ b/src/views/map/runplan/index.vue @@ -15,45 +15,45 @@ import DrapLeft from '@/views/components/drapLeft/index'; import ChartList from './manage/list'; export default { - name: 'RunPlan', - components: { - DrapLeft, - ChartList - }, - data() { - return { - widthLeft: 320 - }; - }, - computed: { - width() { - return this.$store.state.app.width - this.widthLeft; - }, - height() { - return this.$store.state.app.height; - } - }, - watch: { - widthLeft(val) { - this.setRunPlanResize(val); - }, - '$store.state.app.windowSizeCount': function() { - this.setRunPlanResize(this.widthLeft); - } - }, - mounted() { - this.setRunPlanResize(); - }, - methods: { - drapWidth(width) { - this.widthLeft = Number(width); - }, - setRunPlanResize(LeftWidth) { - this.$nextTick(() => { - this.$store.dispatch('runPlan/resize', { width: this.width, height: this.height - 60 }); - }); - } - } + name: 'RunPlan', + components: { + DrapLeft, + ChartList + }, + data() { + return { + widthLeft: 320 + }; + }, + computed: { + width() { + return this.$store.state.app.width - this.widthLeft; + }, + height() { + return this.$store.state.app.height; + } + }, + watch: { + widthLeft(val) { + this.setRunPlanResize(val); + }, + '$store.state.app.windowSizeCount': function() { + this.setRunPlanResize(this.widthLeft); + } + }, + mounted() { + this.setRunPlanResize(); + }, + methods: { + drapWidth(width) { + this.widthLeft = Number(width); + }, + setRunPlanResize(LeftWidth) { + this.$nextTick(() => { + this.$store.dispatch('runPlan/resize', { width: this.width, height: this.height - 60 }); + }); + } + } }; diff --git a/src/views/map/skinCode/index.vue b/src/views/map/skinCode/index.vue deleted file mode 100644 index e27e6f5f3..000000000 --- a/src/views/map/skinCode/index.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - diff --git a/src/views/orderauthor/permission/create/order.vue b/src/views/orderauthor/permission/create/order.vue index a215280c2..e1ec1eeb0 100644 --- a/src/views/orderauthor/permission/create/order.vue +++ b/src/views/orderauthor/permission/create/order.vue @@ -33,7 +33,7 @@ import { addOrganization, getOrganizationList } from '@/api/management/organizat import { getSellerList } from '@/api/management/user'; import { createPermission } from '@/api/management/order'; import PremissionList from './list'; -import { deepAssign } from '@/utils/index'; +// import { deepAssign } from '@/utils/index'; export default { name: 'OrderForm', @@ -364,10 +364,11 @@ export default { this.orderList = []; this.goodsList.forEach(item => { this.formModel.organizationId = this.buildModel(); - const param = deepAssign({}, this.formModel); - param.goodsId = item.id; - param.goodsName = item.name; - param.price = item.price; + // const param = deepAssign({}, this.formModel); + const param = { + goodItem: item.goodItem, + permissionType: item.permissionType + }; this.orderList.push(param); }); this.packForm(); // 打包 生成二维码 @@ -379,9 +380,27 @@ export default { return nor.permissionId; }); const param = { - createVO: {isPackage: false, relPermissions: arr}, - orderList: this.orderList, - canDistribute: this.formModel.canDistribute == '01' + // createVO: {isPackage: false, relPermissions: arr}, + // orderList: this.orderList, + // canDistribute: this.formModel.canDistribute == '01' + isPackage: false, + organizationId: this.formModel.organizationId, + packageNum: this.formModel.amount, + amount: this.formModel.amount, + monthAmount: this.formModel.monthAmount, + packageName: this.goodsVo.name, + totalPrice: this.formModel.totalPrice, + orderType: this.formModel.orderType, + distributeType: this.formModel.canDistribute == '01', + startTime: this.formModel.startTime, + payStatus: this.formModel.payStatus, + bizType: this.formModel.bizType, + payWays: this.formModel.payWays, + forever: this.formModel.forever, + + // mapId: this.goodsList[0].mapId, + relPermissions: arr, + orderDetailList: this.orderList }; createPermission(param).then(res => { this.urlInfo = { @@ -389,8 +408,8 @@ export default { title: this.$t('orderAuthor.permissionToDistributeQRCode') }; this.$emit('orderNext', this.urlInfo); - }).catch(error => { - console.log(error); + }).catch((error) => { + this.$messageBox(`${error.message}`); }); } else { this.$messageBox(this.$t('tip.selectPackagingRecord')); @@ -401,16 +420,40 @@ export default { this.$refs.dataform.validateForm(() => { this.formModel.organizationId = this.buildModel(); const param = { - createVO: { - isPackage: true, - relPermissions: this.permissionVo.relPermissions, - name: this.permissionVo.name, - id: this.permissionVo.id, - remarks: this.permissionVo.remarks - }, - goodsVO: this.goodsVo, - orderList: [this.formModel], - canDistribute: this.formModel.canDistribute == '01' + // createVO: { + // isPackage: true, + // relPermissions: this.permissionVo.relPermissions, + // name: this.permissionVo.name, + // id: this.permissionVo.id, + // remarks: this.permissionVo.remarks + // }, + // goodsVO: this.goodsVo, + // orderList: [this.formModel], + // canDistribute: this.formModel.canDistribute == '01' + isPackage: true, + organizationId: this.formModel.organizationId, + packageNum: this.formModel.amount, + startTime: this.formModel.startTime, + monthAmount: this.formModel.monthAmount, + distributeType: this.formModel.canDistribute == '01', + bizType: this.formModel.bizType, + payWays: this.formModel.payWays, + forever: this.formModel.forever, + payStatus: this.formModel.payStatus, + totalPrice: this.formModel.totalPrice, + contractNo: this.formModel.contractNo, + orderType: this.formModel.orderType, + + packageName: this.goodsVo.name, + remarks: this.goodsVo.remarks, + price: this.goodsVo.price, + tryUse: this.goodsVo.tryUse, + tryUseTime: this.goodsVo.tryUseTime, + tryUseTimeUnit: this.goodsVo.tryUseTimeUnit, + relPermissions: this.permissionVo.relPermissions, + + mapId: this.permissionVo.mapId + // prdCode: this.permissionVo.prdCode }; createPermission(param).then(res => { this.urlInfo = { diff --git a/src/views/orderauthor/permission/create/permission.vue b/src/views/orderauthor/permission/create/permission.vue index 37faee18b..9ae8ef3fc 100644 --- a/src/views/orderauthor/permission/create/permission.vue +++ b/src/views/orderauthor/permission/create/permission.vue @@ -194,7 +194,7 @@ export default { }, changeRadio(data) { this.$emit('changeType', data); - if (data == '02') { + if (data == '02' && this.ruleList.length) { const arr = this.ruleList.map(item => { return item.id; }); @@ -323,7 +323,22 @@ export default { item.goods = ele; } }); - item.goods && this.goodsList.push(item.goods); + const param = { + goodItem: { + name: item.name, + permissionId: item.id, + permissionName: item.goods.name, + id: item.goods.id + }, + permissionType: item.type, + // mapId: item.mapId, + permissionId: item.id, + isPackage: item.isPackage, + name: item.goods.name, + price: item.goods.price, + remarks: item.goods.remarks + }; + item.goods && this.goodsList.push(param); }); if (this.goodsList.length == this.ruleList.length) { this.$emit('permissionNext', this.goodsList); diff --git a/src/views/system/skinCode/draft.vue b/src/views/system/skinCode/draft.vue new file mode 100644 index 000000000..264a9c90c --- /dev/null +++ b/src/views/system/skinCode/draft.vue @@ -0,0 +1,202 @@ + + + + + + + + + + + + + + {{ $t('global.create') }} + {{ $t('global.update') }} + {{ $t('global.return') }} + + + + + + + + diff --git a/src/views/system/skinCode/index.vue b/src/views/system/skinCode/index.vue new file mode 100644 index 000000000..56b0c06c1 --- /dev/null +++ b/src/views/system/skinCode/index.vue @@ -0,0 +1,124 @@ + + + + + + + From 443051edc30d037373cdeacee5b74d55a4ce51ad Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Wed, 30 Oct 2019 13:58:34 +0800 Subject: [PATCH 2/2] =?UTF-8?q?desc:=20=E8=B0=83=E6=95=B4=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/management/mapprd.js | 116 +- src/router/index.js | 133 +-- src/utils/baseUrl.js | 4 +- src/views/designPlatform/home.vue | 36 +- src/views/designPlatform/index.vue | 126 +- src/views/designPlatform/mapPreview.vue | 194 +-- src/views/designPlatform/userIndex.vue | 136 --- .../demonList.vue} | 0 src/views/designUser/index.vue | 136 +++ src/views/display/designIndex.vue | 1038 ++++++++--------- src/views/map/mapdraft/index.vue | 69 -- src/views/map/mapdraft/mapedit/index.vue | 550 ++++----- src/views/map/mapdraft/mapmanage/maplist.vue | 361 ------ .../map/mapdraft/mapmanage/operateMenu.vue | 374 +++--- src/views/map/product/edit.vue | 312 ----- src/views/map/product/index.vue | 59 - src/views/map/product/tree.vue | 119 -- src/views/replay/index.vue | 228 ++-- src/views/system/product/edit.vue | 305 +++++ src/views/system/product/index.vue | 58 + src/views/system/product/tree.vue | 130 +++ 21 files changed, 2029 insertions(+), 2455 deletions(-) delete mode 100644 src/views/designPlatform/userIndex.vue rename src/views/{designPlatform/userDemonList.vue => designUser/demonList.vue} (100%) create mode 100644 src/views/designUser/index.vue delete mode 100644 src/views/map/mapdraft/index.vue delete mode 100644 src/views/map/mapdraft/mapmanage/maplist.vue delete mode 100644 src/views/map/product/edit.vue delete mode 100644 src/views/map/product/index.vue delete mode 100644 src/views/map/product/tree.vue create mode 100644 src/views/system/product/edit.vue create mode 100644 src/views/system/product/index.vue create mode 100644 src/views/system/product/tree.vue 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/router/index.js b/src/router/index.js index 7e5cc03b5..9c4c5ca79 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -21,11 +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 Runplan from '@/views/map/runplan/index'; import RunplanView from '@/views/map/runplan/chart'; import Trainingrecord from '@/views/lesson/trainingrecord/index'; @@ -54,22 +54,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'; @@ -321,7 +322,7 @@ export const constantRoutes = [ ]; export const asyncRouter = [ - { + { // 公共地图 path: '/design', component: Layout, redirect: '/design/home', @@ -424,7 +425,7 @@ export const asyncRouter = [ } ] }, - { + { // 个人地图 path: '/design/userlist', redirect: '/design/userlist/home', component: Layout, @@ -484,7 +485,7 @@ export const asyncRouter = [ } ] }, - { + { // 全屏战场图 path: '/display/:mode', component: Display, meta: { @@ -505,7 +506,7 @@ export const asyncRouter = [ }, hidden: true }, - { + { // 综合演练室 path: '/trainroom', component: TrainRoom, meta: { @@ -685,67 +686,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: { @@ -829,7 +830,7 @@ export const asyncRouter = [ } ] }, - { + { // 订单权限管理 path: '/orderauthor', component: Layout, meta: { @@ -921,7 +922,7 @@ export const asyncRouter = [ } ] }, - { + { // 系统管理 path: '/system', component: Layout, meta: { @@ -1037,7 +1038,7 @@ export const asyncRouter = [ } ] }, - { + { // 发布申请 path: '/apply', component: Layout, meta: { diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 343289067..cbc51f6c4 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -3,10 +3,10 @@ export function getBaseUrl() { let BASE_API; if (process.env.NODE_ENV === 'development') { // BASE_API = 'https://joylink.club/jlcloud'; - // BASE_API = 'https://test.joylink.club/jlcloud'; + BASE_API = 'https://test.joylink.club/jlcloud'; // BASE_API = 'http://192.168.3.5:9000'; // 袁琪 // BASE_API = 'http://192.168.3.6:9000'; // 旭强 - BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 + // BASE_API = 'http://192.168.3.41:9000'; // 王兴杰 } else { BASE_API = process.env.VUE_APP_BASE_API; } diff --git a/src/views/designPlatform/home.vue b/src/views/designPlatform/home.vue index f6a68034f..6783c352b 100644 --- a/src/views/designPlatform/home.vue +++ b/src/views/designPlatform/home.vue @@ -29,24 +29,24 @@ import home5 from '@/assets/home/tring4.jpg'; import home6 from '@/assets/home/demon2.jpg'; export default { - name: 'Home', - data() { - return { - listImg: [ - { src: home1 }, - { src: home2 }, - { src: home3 }, - { src: home4 }, - { src: home5 }, - { src: home6 } - ] - }; - }, - computed: { - height() { - return this.$store.state.app.height - 93; - } - } + name: 'Home', + data() { + return { + listImg: [ + { src: home1 }, + { src: home2 }, + { src: home3 }, + { src: home4 }, + { src: home5 }, + { src: home6 } + ] + }; + }, + computed: { + height() { + return this.$store.state.app.height - 93; + } + } }; 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/display/designIndex.vue b/src/views/display/designIndex.vue index f0861581f..c4b25ab0f 100644 --- a/src/views/display/designIndex.vue +++ b/src/views/display/designIndex.vue @@ -76,13 +76,13 @@ import { mapGetters } from 'vuex'; import { getTrainingDetail, getTrainingStepsDetail } from '@/api/jmap/training'; import { setGoodsTryUse } from '@/api/management/goods'; import { getProductDetail } from '@/api/management/mapprd'; -import { runDiagramQuit, loadScript, getSimulationInfo } from '@/api/simulation'; +import { runDiagramQuit, getSimulationInfo } from '@/api/simulation'; import { OperateMode, TrainingMode } from '@/scripts/ConstDic'; import { checkLoginLine } from '@/api/login'; import { loadMapData, loadMapDataById } from '@/utils/loaddata'; import { EventBus } from '@/scripts/event-bus'; import Vue from 'vue'; -import { UrlConfig } from '@/router/index'; +// import { UrlConfig } from '@/router/index'; import {loadDraftScript} from '@/api/designPlatform'; // 三维 @@ -90,549 +90,549 @@ import Jl3dSimulation from '@/views/jlmap3d/simulation/jl3dsimulation'; import Jl3dDrive from '@/views/jlmap3d/drive/jl3ddrive'; export default { - name: 'DisplayDraft', - components: { - RunPlanLoad, - RunPlanView, - FaultChoose, - AddQuest, - MenuExam, - MenuLesson, - MenuReplay, - MapSystemDraft, - MenuPlan, - MenuDemon, - MenuScreen, - MenuScript, - MenuSchema, - MenuSystemTime, - Jl3dSimulation, - Jl3dDrive, - Scheduling - }, - props: { - size: { - type: Object, - default() { - return null; - } - } - }, - data() { - return { - mode: '', - trainingObj: {}, - timeDemonNum: 0, - checkLine: null, - offset: 15, - mouseNum: 1, - ierval: null, - mouseNumTime: 0, - mapBox: null, - mapBoxP: null, - panelShow: true, - simulationShow: false, - drivingShow: false, - questId: 0, // 加载任务的Id - group: '', - prdTypeMap: { - '01': '01', // 现地 => 现地 - '02': '02', // 行调 => 行调 - '04': '02', // 司机 => 行调 - '05': '' // 派班 => null - }, - isDrive: this.prdType == '04', - isShowScheduling: this.prdType == '05' - }; - }, - computed: { - ...mapGetters([ - 'canvasWidth', - 'canvasHeight' - ]), - ...mapGetters('map', [ - 'map' - ]), - ...mapGetters('training', [ - 'offsetStationCode' - ]), - ...mapGetters('config', [ - 'canvasId' - ]), - width() { - return this.$store.state.app.width; - }, - height() { - return this.$store.state.app.height; - }, - right() { - return this.$store.state.config.width / 2 - 55; - }, - trainingId() { - return this.$route.query.trainingId; - }, - mapId() { - return this.$route.query.mapId; - }, - prdType() { - // return this.$route.query.prdType; - return this.$store.state.training.prdType; - }, - skinCode() { - return this.$route.query.skinCode; - }, - isLesson() { - return this.mode === 'teach' || this.mode === 'record' || this.mode === 'manage'; - }, - isExam() { - return this.mode === 'exam'; - }, - isDemon() { - return this.mode === 'demon'; - }, - isScreen() { - return this.mode === 'dp'; - }, - isReplay() { - return this.mode === 'replay'; - }, - isScript() { - return this.mode === 'script'; - }, - isPlan() { - return this.mode === 'plan'; - } - // isDrive() { - // return this.prdType == '04'; - // }, - // isShowScheduling() { - // return this.prdType == '05'; - // } - }, - watch: { - '$store.state.config.menuBarLoadedCount': function (val) { - this.setPosition(); - }, - '$store.state.map.mapViewLoadedCount': function (val) { - this.mapBoxP = document.getElementById(this.canvasId).children[0]; - this.mapBox = document.getElementsByTagName('canvas'); + name: 'DisplayDraft', + components: { + RunPlanLoad, + RunPlanView, + FaultChoose, + AddQuest, + MenuExam, + MenuLesson, + MenuReplay, + MapSystemDraft, + MenuPlan, + MenuDemon, + MenuScreen, + MenuScript, + MenuSchema, + MenuSystemTime, + Jl3dSimulation, + Jl3dDrive, + Scheduling + }, + props: { + size: { + type: Object, + default() { + return null; + } + } + }, + data() { + return { + mode: '', + trainingObj: {}, + timeDemonNum: 0, + checkLine: null, + offset: 15, + mouseNum: 1, + ierval: null, + mouseNumTime: 0, + mapBox: null, + mapBoxP: null, + panelShow: true, + simulationShow: false, + drivingShow: false, + questId: 0, // 加载任务的Id + group: '', + prdTypeMap: { + '01': '01', // 现地 => 现地 + '02': '02', // 行调 => 行调 + '04': '02', // 司机 => 行调 + '05': '' // 派班 => null + }, + isDrive: this.prdType == '04', + isShowScheduling: this.prdType == '05' + }; + }, + computed: { + ...mapGetters([ + 'canvasWidth', + 'canvasHeight' + ]), + ...mapGetters('map', [ + 'map' + ]), + ...mapGetters('training', [ + 'offsetStationCode' + ]), + ...mapGetters('config', [ + 'canvasId' + ]), + width() { + return this.$store.state.app.width; + }, + height() { + return this.$store.state.app.height; + }, + right() { + return this.$store.state.config.width / 2 - 55; + }, + trainingId() { + return this.$route.query.trainingId; + }, + mapId() { + return this.$route.query.mapId; + }, + prdType() { + // return this.$route.query.prdType; + return this.$store.state.training.prdType; + }, + skinCode() { + return this.$route.query.skinCode; + }, + isLesson() { + return this.mode === 'teach' || this.mode === 'record' || this.mode === 'manage'; + }, + isExam() { + return this.mode === 'exam'; + }, + isDemon() { + return this.mode === 'demon'; + }, + isScreen() { + return this.mode === 'dp'; + }, + isReplay() { + return this.mode === 'replay'; + }, + isScript() { + return this.mode === 'script'; + }, + isPlan() { + return this.mode === 'plan'; + } + // isDrive() { + // return this.prdType == '04'; + // }, + // isShowScheduling() { + // return this.prdType == '05'; + // } + }, + watch: { + '$store.state.config.menuBarLoadedCount': function (val) { + this.setPosition(); + }, + '$store.state.map.mapViewLoadedCount': function (val) { + this.mapBoxP = document.getElementById(this.canvasId).children[0]; + this.mapBox = document.getElementsByTagName('canvas'); - if (this.trainingId) { - getTrainingStepsDetail(this.trainingId, { group: this.group }).then(resp => { - this.trainingObj = resp.data; - this.$store.dispatch('training/setTrainingData', this.trainingObj); - }); - } + if (this.trainingId) { + getTrainingStepsDetail(this.trainingId, { group: this.group }).then(resp => { + this.trainingObj = resp.data; + this.$store.dispatch('training/setTrainingData', this.trainingObj); + }); + } - }, - '$store.state.training.prdType': function(val) { - // this.prdType=val; - this.isDrive=(val == '04'); - this.isShowScheduling=(val == '05'); - }, - '$store.state.socket.permissionOver': function () { - this.$alert('用户权限已被收回', '提示', { - confirmButtonText: '确定', - callback: action => { - this.back(); - } - }); - }, - '$store.state.app.windowSizeCount': function() { - this.setWindowSize(); - }, - $route() { - this.$nextTick(() => { - this.initLoadData(); - }); - } - }, - async created() { - this.mode = this.$route.params.mode; - this.group = this.$route.query.group || ''; - }, - async mounted() { - EventBus.$on('clearCheckLogin', () => { - this.clearCheckLogin(); - }); + }, + '$store.state.training.prdType': function(val) { + // this.prdType=val; + this.isDrive = (val == '04'); + this.isShowScheduling = (val == '05'); + }, + '$store.state.socket.permissionOver': function () { + this.$alert('用户权限已被收回', '提示', { + confirmButtonText: '确定', + callback: action => { + this.back(); + } + }); + }, + '$store.state.app.windowSizeCount': function() { + this.setWindowSize(); + }, + $route() { + this.$nextTick(() => { + this.initLoadData(); + }); + } + }, + async created() { + this.mode = this.$route.params.mode; + this.group = this.$route.query.group || ''; + }, + async mounted() { + EventBus.$on('clearCheckLogin', () => { + this.clearCheckLogin(); + }); - await this.setWindowSize(); - await this.initLoadData(); - this.switchMode(''); - }, - async beforeDestroy() { - await this.clearAllTimer(); - if (!this.isReplay) { - await this.quit(); - } - await this.$store.dispatch('training/reset'); - await this.$store.dispatch('map/mapClear'); - EventBus.$off('clearCheckLogin'); - }, - methods: { - // 清除检查在线定时器 - clearAllTimer() { - if (this.ierval) { - clearTimeout(this.ierval); - this.ierval = null; - } + await this.setWindowSize(); + await this.initLoadData(); + this.switchMode(''); + }, + async beforeDestroy() { + await this.clearAllTimer(); + if (!this.isReplay) { + await this.quit(); + } + await this.$store.dispatch('training/reset'); + await this.$store.dispatch('map/mapClear'); + EventBus.$off('clearCheckLogin'); + }, + methods: { + // 清除检查在线定时器 + clearAllTimer() { + if (this.ierval) { + clearTimeout(this.ierval); + this.ierval = null; + } - if (this.checkLine) { - clearTimeout(this.checkLine); - this.checkLine = null; - } - }, - // 设置检查在线定时器 - checkLoginLineTimer() { - if (this.checkLine) { - clearTimeout(this.checkLine); - } + if (this.checkLine) { + clearTimeout(this.checkLine); + this.checkLine = null; + } + }, + // 设置检查在线定时器 + checkLoginLineTimer() { + if (this.checkLine) { + clearTimeout(this.checkLine); + } - this.checkLine = setInterval(() => { - checkLoginLine(); - }, 5000 * 60); - }, - // 设置手标显示状态 - checkMouseStatusTimer() { - if (this.ierval) { - clearTimeout(this.ierval); - } + this.checkLine = setInterval(() => { + checkLoginLine(); + }, 5000 * 60); + }, + // 设置手标显示状态 + checkMouseStatusTimer() { + if (this.ierval) { + clearTimeout(this.ierval); + } - this.ierval = setInterval(() => { - if (this.mouseNum) { - this.mouseNum = 0; - this.mouseNumTime = 0; - } else { - this.mouseNumTime += 1; - } - if (this.mapBox) { - if (this.mouseNumTime >= 15) { - for (let i = 0; i < this.mapBox.length; i++) { - this.mapBox[i].style.cursor = 'none'; - } - } else { - for (let i = 0; i < this.mapBox.length; i++) { - this.mapBox[i].style.cursor = ''; - } - } - } - }, 1000); - }, - mousemove(e) { - this.mouseNum = 1; - }, - setPosition() { - this.$nextTick(() => { - let offset = 15; - const menuBar = document.getElementById('menuBar'); - const menuTool = document.getElementById('menuTool'); - if (menuBar) { - offset += (menuBar.offsetHeight || 0); - } - if (menuTool) { - offset += (menuTool.offsetHeight || 0); - } + this.ierval = setInterval(() => { + if (this.mouseNum) { + this.mouseNum = 0; + this.mouseNumTime = 0; + } else { + this.mouseNumTime += 1; + } + if (this.mapBox) { + if (this.mouseNumTime >= 15) { + for (let i = 0; i < this.mapBox.length; i++) { + this.mapBox[i].style.cursor = 'none'; + } + } else { + for (let i = 0; i < this.mapBox.length; i++) { + this.mapBox[i].style.cursor = ''; + } + } + } + }, 1000); + }, + mousemove(e) { + this.mouseNum = 1; + }, + setPosition() { + this.$nextTick(() => { + let offset = 15; + const menuBar = document.getElementById('menuBar'); + const menuTool = document.getElementById('menuTool'); + if (menuBar) { + offset += (menuBar.offsetHeight || 0); + } + if (menuTool) { + offset += (menuTool.offsetHeight || 0); + } - if (this.offset != offset) { - this.offset = offset; - } - }); - }, - // 结束加载状态 - endViewLoading(isSuccess) { - if (!isSuccess) { - this.$store.dispatch('map/mapClear'); - } + if (this.offset != offset) { + this.offset = offset; + } + }); + }, + // 结束加载状态 + endViewLoading(isSuccess) { + if (!isSuccess) { + this.$store.dispatch('map/mapClear'); + } - this.$nextTick(() => { - EventBus.$emit('viewLoading', false); - }); - }, - // 加载仿真信息 - async loadSimulationInfo() { - const resp = await getSimulationInfo(this.group); - if (resp && resp.code == 200) { - this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); - this.questId = Number(resp.data.questId) || 0; - } - }, - // 加载地图数据 - async initLoadData() { - this.$store.dispatch('training/reset'); + this.$nextTick(() => { + EventBus.$emit('viewLoading', false); + }); + }, + // 加载仿真信息 + async loadSimulationInfo() { + const resp = await getSimulationInfo(this.group); + if (resp && resp.code == 200) { + this.$store.dispatch('scriptRecord/updateSimulationPause', resp.data.pause); + this.questId = Number(resp.data.questId) || 0; + } + }, + // 加载地图数据 + async initLoadData() { + this.$store.dispatch('training/reset'); - try { - if (!this.isReplay) { - await this.loadSimulationInfo(); - } + try { + if (!this.isReplay) { + await this.loadSimulationInfo(); + } - if (this.isReplay) { - await this.initLoadReplayData(); - } else if (this.isDemon) { - await this.initLoadDemonData(); - } else if (this.isScreen) { - await this.initLoadScreenData(); - } else if (this.isPlan) { - await this.initLoadTestRunData(); - } else if (this.isScript) { - await this.initLoadTaskData(); - } else { - await this.initLoadLessonOrExamData(); - } + if (this.isReplay) { + await this.initLoadReplayData(); + } else if (this.isDemon) { + await this.initLoadDemonData(); + } else if (this.isScreen) { + await this.initLoadScreenData(); + } else if (this.isPlan) { + await this.initLoadTestRunData(); + } else if (this.isScript) { + await this.initLoadTaskData(); + } else { + await this.initLoadLessonOrExamData(); + } - this.checkLoginLineTimer(); - this.checkMouseStatusTimer(); - } catch (error) { - this.$messageBox(`初始化失败: ${error.message}`); - this.endViewLoading(); - } - }, - // 课程和考试系统 - async initLoadLessonOrExamData() { - this.$store.dispatch('training/end', null); - this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 + this.checkLoginLineTimer(); + this.checkMouseStatusTimer(); + } catch (error) { + this.$messageBox(`初始化失败: ${error.message}`); + this.endViewLoading(); + } + }, + // 课程和考试系统 + async initLoadLessonOrExamData() { + this.$store.dispatch('training/end', null); + this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 - if (parseInt(this.trainingId)) { - // 设置地图数据 - // 设置实训数据 - const resp = await getTrainingDetail(this.trainingId); - if (resp && resp.code == 200) { - const detail = resp.data; - const rest = await getProductDetail(detail.prdCode); - if (rest && rest.code == 200) { - const data = rest.data; - await this.$store.dispatch('training/setPrdType', data.prdType); - await this.loadMapData(detail.skinCode); - } - } else { - this.$messageBox(`获取实训步骤数据失败`); - this.endViewLoading(); - } - } else { - this.endViewLoading(); - } - }, - // 回放系统 - async initLoadReplayData() { - this.$store.dispatch('training/end', TrainingMode.NORMAL); - this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 - this.$store.dispatch('training/setPrdType', ''); + if (parseInt(this.trainingId)) { + // 设置地图数据 + // 设置实训数据 + const resp = await getTrainingDetail(this.trainingId); + if (resp && resp.code == 200) { + const detail = resp.data; + const rest = await getProductDetail(detail.prdCode); + if (rest && rest.code == 200) { + const data = rest.data; + await this.$store.dispatch('training/setPrdType', data.prdType); + await this.loadMapData(detail.skinCode); + } + } else { + this.$messageBox(`获取实训步骤数据失败`); + this.endViewLoading(); + } + } else { + this.endViewLoading(); + } + }, + // 回放系统 + async initLoadReplayData() { + this.$store.dispatch('training/end', TrainingMode.NORMAL); + this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 + this.$store.dispatch('training/setPrdType', ''); - if (parseInt(this.skinCode)) { - await this.loadMapData(this.skinCode); + if (parseInt(this.skinCode)) { + await this.loadMapData(this.skinCode); - } else { - this.endViewLoading(); - } - }, - // 仿真系统 - async initLoadDemonData() { - this.$store.dispatch('training/end', TrainingMode.NORMAL); - this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 - this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]); + } else { + this.endViewLoading(); + } + }, + // 仿真系统 + async initLoadDemonData() { + this.$store.dispatch('training/end', TrainingMode.NORMAL); + this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 + this.$store.dispatch('training/setPrdType', this.prdTypeMap[this.prdType]); - if (parseInt(this.skinCode)) { - await this.loadMapData(this.skinCode); + if (parseInt(this.skinCode)) { + await this.loadMapData(this.skinCode); - } else { - this.endViewLoading(); - } - }, - // 大屏系统请求 - async initLoadScreenData() { - this.$store.dispatch('training/end', TrainingMode.NORMAL); - this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 - this.$store.dispatch('training/setPrdType', '01'); + } else { + this.endViewLoading(); + } + }, + // 大屏系统请求 + async initLoadScreenData() { + this.$store.dispatch('training/end', TrainingMode.NORMAL); + this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 + this.$store.dispatch('training/setPrdType', '01'); - if (parseInt(this.skinCode)) { - await this.loadMapData(this.skinCode); + if (parseInt(this.skinCode)) { + await this.loadMapData(this.skinCode); - } else { - this.endViewLoading(); - } - }, - // 任务录制系统 - async initLoadTaskData() { - this.$store.dispatch('training/end', TrainingMode.NORMAL); - this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 - this.switchMode('01'); + } else { + this.endViewLoading(); + } + }, + // 任务录制系统 + async initLoadTaskData() { + this.$store.dispatch('training/end', TrainingMode.NORMAL); + this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 + this.switchMode('01'); - if (parseInt(this.mapId)) { - await this.loadMapDataById(this.mapId); - } else { - this.endViewLoading(); - } - }, - // 测试跑车 - async initLoadTestRunData() { - this.$store.dispatch('training/end', TrainingMode.NORMAL); - this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 - this.$store.dispatch('training/setPrdType', '01'); + if (parseInt(this.mapId)) { + await this.loadMapDataById(this.mapId); + } else { + this.endViewLoading(); + } + }, + // 测试跑车 + async initLoadTestRunData() { + this.$store.dispatch('training/end', TrainingMode.NORMAL); + this.$store.dispatch('training/changeOperateMode', { mode: OperateMode.NORMAL }); // 默认为正常模式 + this.$store.dispatch('training/setPrdType', '01'); - if (parseInt(this.skinCode)) { - await this.loadMapData(this.skinCode); + if (parseInt(this.skinCode)) { + await this.loadMapData(this.skinCode); - } else { - this.endViewLoading(); - } - }, - // 加载剧本 - async runQuestLoadShow() { - this.$refs.addQuest.doShow(); - }, - async runAddRolesLoadShow() { - // this.$refs.addQuest.doShow(); - // const row={id: this.$route.query.scriptId}; - const row={group: this.$route.query.group,id: this.$route.query.scriptId}; - this.$refs.addQuest.handleLoad(1, row); - }, - // 选择脚本 - async selectQuest(row, id, mapLocation, roleName) { - try { - let prdType=''; - switch (roleName) { - case 'Attendant': { - prdType='01'; - break; - } - case 'Dispatcher': { - prdType='02'; - break; - } - case 'Driver': { - prdType='04'; - break; - } - case 'Repair': { - prdType=''; - break; - } - } - this.switchMode(prdType); - const res = await loadDraftScript(row.id,id, this.group); - if (res && res.code == 200) { - this.questId = parseInt(row.id); - if (mapLocation) { - const newMapLocation={'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale}; - Vue.prototype.$jlmap.setOptions(newMapLocation); - } - // if (res.data && res.data.mapLocation) { - // const mapLocation={'offsetX': res.data.mapLocation.x, 'offsetY': res.data.mapLocation.y, 'scaleRate': res.data.mapLocation.scale}; - // Vue.prototype.$jlmap.setOptions(mapLocation); - // } - } - if (this.$refs.menuDemon) { - await this.$refs.menuDemon.initLoadPage(); - } + } else { + this.endViewLoading(); + } + }, + // 加载剧本 + async runQuestLoadShow() { + this.$refs.addQuest.doShow(); + }, + async runAddRolesLoadShow() { + // this.$refs.addQuest.doShow(); + // const row={id: this.$route.query.scriptId}; + const row = {group: this.$route.query.group, id: this.$route.query.scriptId}; + this.$refs.addQuest.handleLoad(1, row); + }, + // 选择脚本 + async selectQuest(row, id, mapLocation, roleName) { + try { + let prdType = ''; + switch (roleName) { + case 'Attendant': { + prdType = '01'; + break; + } + case 'Dispatcher': { + prdType = '02'; + break; + } + case 'Driver': { + prdType = '04'; + break; + } + case 'Repair': { + prdType = ''; + break; + } + } + this.switchMode(prdType); + const res = await loadDraftScript(row.id, id, this.group); + if (res && res.code == 200) { + this.questId = parseInt(row.id); + if (mapLocation) { + const newMapLocation = {'offsetX': mapLocation.x, 'offsetY': mapLocation.y, 'scaleRate': mapLocation.scale}; + Vue.prototype.$jlmap.setOptions(newMapLocation); + } + // if (res.data && res.data.mapLocation) { + // const mapLocation={'offsetX': res.data.mapLocation.x, 'offsetY': res.data.mapLocation.y, 'scaleRate': res.data.mapLocation.scale}; + // Vue.prototype.$jlmap.setOptions(mapLocation); + // } + } + if (this.$refs.menuDemon) { + await this.$refs.menuDemon.initLoadPage(); + } - if (this.$refs.menuScript) { - await this.$refs.menuScript.initLoadPage(); - } - } catch (error) { - this.$messageBox(error.message); - } - }, - // 退出脚本 - async quitQuest() { - this.questId = 0; - }, - // 加载地图数据 - async loadMapData(skinCode) { - try { - await loadMapData(skinCode); - await this.$store.dispatch('training/setMapDefaultState'); - } catch (error) { - this.$messageBox(`获取地图数据失败: ${error.message}`); - this.endViewLoading(); - } - }, + if (this.$refs.menuScript) { + await this.$refs.menuScript.initLoadPage(); + } + } catch (error) { + this.$messageBox(error.message); + } + }, + // 退出脚本 + async quitQuest() { + this.questId = 0; + }, + // 加载地图数据 + async loadMapData(skinCode) { + try { + await loadMapData(skinCode); + await this.$store.dispatch('training/setMapDefaultState'); + } catch (error) { + this.$messageBox(`获取地图数据失败: ${error.message}`); + this.endViewLoading(); + } + }, - // 通过id加载地图数据 - async loadMapDataById(mapId) { - try { - await loadMapDataById(mapId); - await this.$store.dispatch('training/setMapDefaultState'); - } catch (error) { - this.$messageBox(`获取地图数据失败: ${error.message}`); - this.endViewLoading(); - } - }, + // 通过id加载地图数据 + async loadMapDataById(mapId) { + try { + await loadMapDataById(mapId); + await this.$store.dispatch('training/setMapDefaultState'); + } catch (error) { + this.$messageBox(`获取地图数据失败: ${error.message}`); + this.endViewLoading(); + } + }, - // 销毁仿真 - async quit() { - await runDiagramQuit(this.group); - await this.$store.dispatch('training/over'); - }, - // 仿真错误时,被动退出时调用 - async back() { - if (this.isExam) { - await this.$refs.menuExam.back(); - } else if (this.isLesson) { - await this.$refs.lessonMenu.back(); - } else if (this.isDemon) { - await this.$refs.menuDemon.back(); - } else if (this.isScreen) { - await this.$refs.menuScreen.back(); - } else if (this.isPlan) { - await this.$refs.menuPlan.back(); - } else if (this.isScript) { - await this.$refs.menuScript.back(); - } - }, - // 设置使用时间 - async tryTime(param) { - const data = { - goodsId: param.goodsId, - time: param.time - }; - if (data.goodsId) { - await setGoodsTryUse(data); - } - }, - switchMode(prdType) { - this.$store.dispatch('training/setPrdType', prdType); - }, - hidepanel() { - if (this.isDrive) { - this.panelShow = false; - this.drivingShow = true; - this.$refs.Jl3dDrive.show(this.skinCode); - } else { - this.panelShow = false; - this.simulationShow = true; - this.$refs.Jl3dSimulation.show(this.skinCode); - } - }, - showScheduling() { - this.$refs.scheduling.doShow(); - }, - showpanel() { - this.panelShow = true; - this.simulationShow = false; - }, - showdriving() { - this.panelShow = true; - this.drivingShow = false; - }, - runPlanViewShow() { - this.$refs.runPlanView.doShow(); - }, - runPlanLoadShow() { - this.$refs.runPlanLoad.doShow(); - }, - faultChooseShow() { - this.$refs.faultChoose.doShow(); - }, - setWindowSize() { - this.$nextTick(() => { - const width = this.size ? this.size.width : this.width; - const height = this.size ? this.size.height : this.height; + // 销毁仿真 + async quit() { + await runDiagramQuit(this.group); + await this.$store.dispatch('training/over'); + }, + // 仿真错误时,被动退出时调用 + async back() { + if (this.isExam) { + await this.$refs.menuExam.back(); + } else if (this.isLesson) { + await this.$refs.lessonMenu.back(); + } else if (this.isDemon) { + await this.$refs.menuDemon.back(); + } else if (this.isScreen) { + await this.$refs.menuScreen.back(); + } else if (this.isPlan) { + await this.$refs.menuPlan.back(); + } else if (this.isScript) { + await this.$refs.menuScript.back(); + } + }, + // 设置使用时间 + async tryTime(param) { + const data = { + goodsId: param.goodsId, + time: param.time + }; + if (data.goodsId) { + await setGoodsTryUse(data); + } + }, + switchMode(prdType) { + this.$store.dispatch('training/setPrdType', prdType); + }, + hidepanel() { + if (this.isDrive) { + this.panelShow = false; + this.drivingShow = true; + this.$refs.Jl3dDrive.show(this.skinCode); + } else { + this.panelShow = false; + this.simulationShow = true; + this.$refs.Jl3dSimulation.show(this.skinCode); + } + }, + showScheduling() { + this.$refs.scheduling.doShow(); + }, + showpanel() { + this.panelShow = true; + this.simulationShow = false; + }, + showdriving() { + this.panelShow = true; + this.drivingShow = false; + }, + runPlanViewShow() { + this.$refs.runPlanView.doShow(); + }, + runPlanLoadShow() { + this.$refs.runPlanLoad.doShow(); + }, + faultChooseShow() { + this.$refs.faultChoose.doShow(); + }, + setWindowSize() { + this.$nextTick(() => { + const width = this.size ? this.size.width : this.width; + const height = this.size ? this.size.height : this.height; - this.$store.dispatch('config/resize', { width, height }); + this.$store.dispatch('config/resize', { width, height }); - this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode }); - }); - } - } + this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode }); + }); + } + } }; 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/replay/index.vue b/src/views/replay/index.vue index b4de6156d..c1dc1d270 100644 --- a/src/views/replay/index.vue +++ b/src/views/replay/index.vue @@ -12,122 +12,122 @@ import { launchFullscreen } from '@/utils/screen'; import { UrlConfig } from '@/router/index'; export default { - name: 'ManagementList', + name: 'ManagementList', - data() { - return { - EffectiveTypeList: [], - pagerConfig: { - pageSize: 'pageSize', - pageIndex: 'pageNum' - }, - queryForm: { - labelWidth: '120px', - queryObject: { - mapName: { - type: 'text', - label: this.$t('replay.mapName') - } - } - }, - queryList: { - query: getSimulationRelpayList, - selectCheckShow: false, - indexShow: true, - columns: [ - { - title: this.$t('replay.mapName'), - prop: 'mapName' - }, - { - title: this.$t('replay.creatorId'), - prop: 'creatorId' - }, - { - title: this.$t('replay.createTime'), - prop: 'createTime' - }, - { - title: this.$t('global.status'), - prop: 'status', - type: 'tag', - columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); }, - tagType: (row) => { - switch (row.status) { - case '1': return 'success'; - default: return 'danger'; - } - } - }, - { - type: 'button', - title: this.$t('global.operate'), - width: '250', - buttons: [ - { - name: this.$t('replay.replay'), - handleClick: this.rePlay, - type: '', - showControl: (row) => { return row.status == '1'; } - }, - { - name: this.$t('global.delete'), - handleClick: this.delete, - type: 'danger', - showControl: (row) => { return this.role; } - } - ] - } - ] - }, + data() { + return { + EffectiveTypeList: [], + pagerConfig: { + pageSize: 'pageSize', + pageIndex: 'pageNum' + }, + queryForm: { + labelWidth: '120px', + queryObject: { + mapName: { + type: 'text', + label: this.$t('replay.mapName') + } + } + }, + queryList: { + query: getSimulationRelpayList, + selectCheckShow: false, + indexShow: true, + columns: [ + { + title: this.$t('replay.mapName'), + prop: 'mapName' + }, + { + title: this.$t('replay.creatorId'), + prop: 'creatorId' + }, + { + title: this.$t('replay.createTime'), + prop: 'createTime' + }, + { + title: this.$t('global.status'), + prop: 'status', + type: 'tag', + columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); }, + tagType: (row) => { + switch (row.status) { + case '1': return 'success'; + default: return 'danger'; + } + } + }, + { + type: 'button', + title: this.$t('global.operate'), + width: '250', + buttons: [ + { + name: this.$t('replay.replay'), + handleClick: this.rePlay, + type: '', + showControl: (row) => { return row.status == '1'; } + }, + { + name: this.$t('global.delete'), + handleClick: this.delete, + type: 'danger', + showControl: (row) => { return this.role; } + } + ] + } + ] + }, - currentModel: {} - }; - }, - computed: { - role() { - return this.$store.state.user.roles.includes('04') || + currentModel: {} + }; + }, + computed: { + role() { + return this.$store.state.user.roles.includes('04') || this.$store.state.user.roles.includes('05'); - } - }, - mounted() { - this.loadInitData(); - }, - methods: { - loadInitData() { - this.EffectiveTypeList = []; - this.$Dictionary.effectiveType().then(list => { - this.EffectiveTypeList = list.map(elem => { return { value: elem.code, label: elem.name }; }); - }); - }, - reloadTable() { - this.queryList.reload(); - }, - rePlay(index, data) { - getPublishMapInfo(data.mapId).then(resp => { - const model = resp.data; - simulationRelpay(data.id).then(rest => { - const query = { skinCode: model.skinCode, group: rest.data, replayId: data.id, createTime: data.createTime, destroyTime: data.destroyTime }; - this.$router.push({ path: `${UrlConfig.display}/replay`, query: query }); - launchFullscreen(); - }); - }); - }, - delete(index, data) { - this.$confirm(this.$t('replay.wellDelReplay'), this.$t('global.tips'), { - confirmButtonText: this.$t('global.confirm'), - cancelButtonText: this.$t('global.cancel'), - type: 'warning' - }).then(() => { - delSimulationRecord(data.id).then(response => { - this.$message.success(this.$t('replay.deleteSuccess')); - this.reloadTable(); - }).catch(() => { - this.reloadTable(); - this.$messageBox(this.$t('error.deleteFailedv')); - }); - }).catch(() => { }); - } - } + } + }, + mounted() { + this.loadInitData(); + }, + methods: { + loadInitData() { + this.EffectiveTypeList = []; + this.$Dictionary.effectiveType().then(list => { + this.EffectiveTypeList = list.map(elem => { return { value: elem.code, label: elem.name }; }); + }); + }, + reloadTable() { + this.queryList.reload(); + }, + rePlay(index, data) { + getPublishMapInfo(data.mapId).then(resp => { + const model = resp.data; + simulationRelpay(data.id).then(rest => { + const query = { skinCode: model.skinCode, group: rest.data, replayId: data.id, createTime: data.createTime, destroyTime: data.destroyTime }; + this.$router.push({ path: `${UrlConfig.display}/replay`, query: query }); + launchFullscreen(); + }); + }); + }, + delete(index, data) { + this.$confirm(this.$t('replay.wellDelReplay'), this.$t('global.tips'), { + confirmButtonText: this.$t('global.confirm'), + cancelButtonText: this.$t('global.cancel'), + type: 'warning' + }).then(() => { + delSimulationRecord(data.id).then(response => { + this.$message.success(this.$t('replay.deleteSuccess')); + this.reloadTable(); + }).catch(() => { + this.reloadTable(); + this.$messageBox(this.$t('error.deleteFailedv')); + }); + }).catch(() => { }); + } + } }; 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 }} + + + + + + + + + + +