Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
6ba7b730a5
@ -1,13 +1,22 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
|
|
||||||
/** 创建分组 */
|
/** 创建 */
|
||||||
export function postUploadFile(data) {
|
export function postUploadFile(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/file`,
|
url: `/api/file/basic`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /** 复制一条文件基础信息 */
|
||||||
|
// export function copyUploadFile(id) {
|
||||||
|
// return request({
|
||||||
|
// url: `/api/file/basic/copy/${id}`,
|
||||||
|
// method: 'post'
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
// 查询
|
// 查询
|
||||||
export function getUploadFile(params) {
|
export function getUploadFile(params) {
|
||||||
return request({
|
return request({
|
||||||
@ -19,15 +28,27 @@ export function getUploadFile(params) {
|
|||||||
// 修改
|
// 修改
|
||||||
export function putUploadFile(data) {
|
export function putUploadFile(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/file`,
|
url: `/api/file/basic`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data
|
data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 删除
|
// 删除
|
||||||
export function deleteUploadFile(data) {
|
export function deleteUploadFile(id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/file`,
|
url: `/api/file/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询文件绑定信息
|
||||||
|
export function getFileBindInfo(fileId, mapId) {
|
||||||
|
return request({
|
||||||
|
url: `/api/file/binding/${fileId}/${mapId}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** */
|
||||||
|
// @GetMapping("")
|
||||||
|
|
||||||
|
BIN
src/assets/icon/favicon_zzww.png
Normal file
BIN
src/assets/icon/favicon_zzww.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
148
src/jmapNew/theme/datie_01/menus/dialog/drawSelect.vue
Normal file
148
src/jmapNew/theme/datie_01/menus/dialog/drawSelect.vue
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
class="chengdou-03__systerm stand-stop-time"
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="show"
|
||||||
|
width="600px"
|
||||||
|
:before-close="doClose"
|
||||||
|
:z-index="2000"
|
||||||
|
:modal="false"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-form :inline="true" :model="form" class="demo-form-inline">
|
||||||
|
<el-form-item label="设备类型:">
|
||||||
|
<el-select v-model="form.deviceType" :disabled="true" style="width: 150px;">
|
||||||
|
<el-option
|
||||||
|
v-for="item in deviceTypeList"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备名称:">
|
||||||
|
<el-input v-model="form.deviceName" :disabled="true" style="width: 150px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-card>
|
||||||
|
<el-table
|
||||||
|
v-loading="loading"
|
||||||
|
:data="tableData"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-table-column
|
||||||
|
prop="fileName"
|
||||||
|
label="文件"
|
||||||
|
width="400"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="name"
|
||||||
|
label="操作"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div class="text-button" @click="openPdf(scope.row)">打开</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { mapGetters } from 'vuex';
|
||||||
|
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||||
|
import { getUploadFile } from '@/api/pdf';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'TrainMove',
|
||||||
|
mixins: [
|
||||||
|
CancelMouseState
|
||||||
|
],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selected: null,
|
||||||
|
dialogShow: false,
|
||||||
|
loading: false,
|
||||||
|
tableData: [],
|
||||||
|
deviceTypeList: [
|
||||||
|
{ label: '区段', value: 'Section' },
|
||||||
|
{ label: '信号机', value: 'Signal' },
|
||||||
|
{ label: '道岔', value: 'Switch' },
|
||||||
|
{ label: '车站', value: 'Station' }
|
||||||
|
],
|
||||||
|
deviceIdList: [],
|
||||||
|
form: {
|
||||||
|
mapId: '',
|
||||||
|
deviceId: '',
|
||||||
|
deviceCode: '',
|
||||||
|
deviceName: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters('map', [
|
||||||
|
'stationStandList'
|
||||||
|
]),
|
||||||
|
show() {
|
||||||
|
return this.dialogShow && !this.$store.state.menuOperation.break;
|
||||||
|
},
|
||||||
|
title() {
|
||||||
|
return '图纸检索';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doShow(selected) {
|
||||||
|
this.selected = selected;
|
||||||
|
this.form.deviceName = selected.name;
|
||||||
|
this.form.deviceType = selected._type;
|
||||||
|
const params = { mapId: this.$route.query.mapId, deviceType: selected._type.toUpperCase(), deviceId: selected.code };
|
||||||
|
this.loading = true;
|
||||||
|
getUploadFile(params).then(resp => {
|
||||||
|
this.tableData = resp.data;
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(error => {
|
||||||
|
this.loading = false;
|
||||||
|
this.$message.error('图纸检索失败!');
|
||||||
|
});
|
||||||
|
this.dialogShow = true;
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
});
|
||||||
|
},
|
||||||
|
openPdf(row) {
|
||||||
|
const url = `https://joylink.club/oss/joylink/${row.filePath}`;
|
||||||
|
window.open(url, '_blank');
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.loading = false;
|
||||||
|
this.dialogShow = false;
|
||||||
|
this.$store.dispatch('training/emitTipFresh');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.chengdou-03__systerm .el-dialog .base-label {
|
||||||
|
background: rgba(0, 0, 0, x);
|
||||||
|
position: relative;
|
||||||
|
left: -5px;
|
||||||
|
top: -18px;
|
||||||
|
padding: 0 5px;
|
||||||
|
background-color: #F0F0F0;
|
||||||
|
}
|
||||||
|
.text-button{
|
||||||
|
color: #148ad0;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
.text-button:active{
|
||||||
|
color: #b938e1;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
.text-button:hover{
|
||||||
|
color: #b938e1;
|
||||||
|
text-decoration: underline;
|
||||||
|
}
|
||||||
|
</style>
|
@ -7,6 +7,7 @@
|
|||||||
<train-add-plan ref="trainAddPlan" pop-class="chengdou-03__systerm" />
|
<train-add-plan ref="trainAddPlan" pop-class="chengdou-03__systerm" />
|
||||||
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
||||||
<load-spare-train ref="loadSpareTrain" pop-class="chengdou-03__systerm" />
|
<load-spare-train ref="loadSpareTrain" pop-class="chengdou-03__systerm" />
|
||||||
|
<draw-select ref="drawSelect" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -21,9 +22,9 @@ import { mapGetters } from 'vuex';
|
|||||||
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
||||||
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
import { OperationEvent } from '@/scripts/cmdPlugin/OperationHandler';
|
||||||
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
import { DeviceMenu, OperateMode } from '@/scripts/ConstDic';
|
||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
|
||||||
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
|
import { menuOperate, commitOperate } from '@/jmapNew/theme/components/utils/menuOperate';
|
||||||
import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain';
|
import LoadSpareTrain from '@/jmapNew/theme/components/menus/dialog/loadSpareTrain';
|
||||||
|
import DrawSelect from './dialog/drawSelect';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SectionMenu',
|
name: 'SectionMenu',
|
||||||
@ -34,7 +35,8 @@ export default {
|
|||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
TrainAddPlan,
|
TrainAddPlan,
|
||||||
SetFault,
|
SetFault,
|
||||||
LoadSpareTrain
|
LoadSpareTrain,
|
||||||
|
DrawSelect
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
@ -49,6 +51,10 @@ export default {
|
|||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [
|
Local: [
|
||||||
|
{
|
||||||
|
label: '图纸调用',
|
||||||
|
handler: this.drawingCall
|
||||||
|
}
|
||||||
],
|
],
|
||||||
Center: [
|
Center: [
|
||||||
// {
|
// {
|
||||||
@ -119,7 +125,8 @@ export default {
|
|||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
if (this.selected.type != '04') {
|
if (this.selected.type != '04') {
|
||||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
|
this.menu = this.menuNormal.Local;
|
||||||
} else {
|
} else {
|
||||||
this.menu = [];
|
this.menu = [];
|
||||||
}
|
}
|
||||||
@ -128,6 +135,9 @@ export default {
|
|||||||
this.menu = this.menuForce;
|
this.menu = this.menuForce;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
drawingCall() {
|
||||||
|
this.$refs.drawSelect.doShow(this.selected);
|
||||||
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
<route-hand-control ref="routeHandControl" />
|
<route-hand-control ref="routeHandControl" />
|
||||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||||
<password-box ref="passwordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" />
|
<password-box ref="passwordBox" pop-class="chengdou-03__systerm" @checkOver="passWordCommit" />
|
||||||
|
<draw-select ref="drawSelect" />
|
||||||
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -28,6 +29,7 @@ import CMD from '@/scripts/cmdPlugin/CommandEnum';
|
|||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
||||||
import PasswordBox from '@/jmapNew/theme/components/menus/childDialog/passwordInputBox';
|
import PasswordBox from '@/jmapNew/theme/components/menus/childDialog/passwordInputBox';
|
||||||
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
import {menuOperate, commitOperate} from '@/jmapNew/theme/components/utils/menuOperate';
|
||||||
|
import DrawSelect from './dialog/drawSelect';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SignalMenu',
|
name: 'SignalMenu',
|
||||||
@ -40,7 +42,8 @@ export default {
|
|||||||
RouteGuide,
|
RouteGuide,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
PasswordBox,
|
PasswordBox,
|
||||||
SetFault
|
SetFault,
|
||||||
|
DrawSelect
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
selected: {
|
selected: {
|
||||||
@ -55,6 +58,10 @@ export default {
|
|||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [
|
Local: [
|
||||||
|
{
|
||||||
|
label: '图纸调用',
|
||||||
|
handler: this.drawingCall
|
||||||
|
}
|
||||||
// {
|
// {
|
||||||
// label: '办理进路',
|
// label: '办理进路',
|
||||||
// handler: this.arrangementRoute,
|
// handler: this.arrangementRoute,
|
||||||
@ -190,13 +197,16 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
|
this.menu = this.menuNormal.Local;
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
this.menu = this.menuForce;
|
this.menu = this.menuForce;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
drawingCall() {
|
||||||
|
this.$refs.drawSelect.doShow(this.selected);
|
||||||
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<pop-menu ref="popMenu" :menu="menu" />
|
<pop-menu ref="popMenu" :menu="menu" />
|
||||||
|
<draw-select ref="drawSelect" />
|
||||||
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
||||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||||
</div>
|
</div>
|
||||||
@ -8,7 +9,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PopMenu from '@/components/PopMenu';
|
import PopMenu from '@/components/PopMenu';
|
||||||
import MenuContextHandler from '@/scripts/cmdPlugin/MenuContextHandler';
|
import DrawSelect from './dialog/drawSelect';
|
||||||
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
import NoticeInfo from '@/jmapNew/theme/components/menus/childDialog/noticeInfo';
|
||||||
import CancelMouseState from '@/mixin/CancelMouseState';
|
import CancelMouseState from '@/mixin/CancelMouseState';
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
@ -22,7 +23,8 @@ export default {
|
|||||||
components: {
|
components: {
|
||||||
PopMenu,
|
PopMenu,
|
||||||
SetFault,
|
SetFault,
|
||||||
NoticeInfo
|
NoticeInfo,
|
||||||
|
DrawSelect
|
||||||
},
|
},
|
||||||
mixins: [
|
mixins: [
|
||||||
CancelMouseState
|
CancelMouseState
|
||||||
@ -41,24 +43,8 @@ export default {
|
|||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [
|
Local: [
|
||||||
{
|
{
|
||||||
label: '系统结构图一前置图',
|
label: '图纸调用',
|
||||||
file: '01-系统结构图一前视图.pdf',
|
handler: this.drawingCall
|
||||||
handler: this.handlerOpenPdf
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '系统结构图二后视图',
|
|
||||||
file: '02-系统结构图二后视图.pdf',
|
|
||||||
handler: this.handlerOpenPdf
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '系统供电示意图',
|
|
||||||
file: '03-系统供电示意图.pdf',
|
|
||||||
handler: this.handlerOpenPdf
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '车站布线图',
|
|
||||||
file: '04-车站布线图.pdf',
|
|
||||||
handler: this.handlerOpenPdf
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
Center: [
|
Center: [
|
||||||
@ -114,6 +100,9 @@ export default {
|
|||||||
this.menu = this.menuForce;
|
this.menu = this.menuForce;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
drawingCall() {
|
||||||
|
this.$refs.drawSelect.doShow(this.selected);
|
||||||
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
|
@ -6,11 +6,13 @@
|
|||||||
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
<notice-info ref="noticeInfo" pop-class="chengdou-03__systerm" />
|
||||||
<switch-hook-lock ref="switchHookLock" pop-class="chengdou-03__systerm" />
|
<switch-hook-lock ref="switchHookLock" pop-class="chengdou-03__systerm" />
|
||||||
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
<set-fault ref="setFault" pop-class="chengdou-03__systerm" />
|
||||||
|
<draw-select ref="drawSelect" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import PopMenu from '@/components/PopMenu';
|
import PopMenu from '@/components/PopMenu';
|
||||||
|
import DrawSelect from './dialog/drawSelect';
|
||||||
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
|
import SectionControl from '@/jmapNew/theme/components/menus/dialog/sectionControl';
|
||||||
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
|
import SwitchControl from '@/jmapNew/theme/components/menus/dialog/switchControl';
|
||||||
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
import SetFault from '@/jmapNew/theme/components/menus/dialog/setFaultNew';
|
||||||
@ -31,7 +33,8 @@ export default {
|
|||||||
SwitchControl,
|
SwitchControl,
|
||||||
NoticeInfo,
|
NoticeInfo,
|
||||||
SetFault,
|
SetFault,
|
||||||
SwitchHookLock
|
SwitchHookLock,
|
||||||
|
DrawSelect
|
||||||
},
|
},
|
||||||
mixins: [
|
mixins: [
|
||||||
CancelMouseState
|
CancelMouseState
|
||||||
@ -48,7 +51,12 @@ export default {
|
|||||||
return {
|
return {
|
||||||
menu: [],
|
menu: [],
|
||||||
menuNormal: {
|
menuNormal: {
|
||||||
Local: [],
|
Local: [
|
||||||
|
{
|
||||||
|
label: '图纸调用',
|
||||||
|
handler: this.drawingCall
|
||||||
|
}
|
||||||
|
],
|
||||||
Center: [
|
Center: [
|
||||||
// {
|
// {
|
||||||
// label: '单操到定位',
|
// label: '单操到定位',
|
||||||
@ -131,8 +139,8 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
initMenu() {
|
initMenu() {
|
||||||
// 编辑模式菜单列表
|
// 编辑模式菜单列表
|
||||||
this.menu = MenuContextHandler.covert(this.menuNormal);
|
// this.menu = MenuContextHandler.covert(this.menuNormal);
|
||||||
|
this.menu = this.menuNormal.Local;
|
||||||
// 故障模式菜单列表
|
// 故障模式菜单列表
|
||||||
if (this.operatemode === OperateMode.FAULT) {
|
if (this.operatemode === OperateMode.FAULT) {
|
||||||
if (!this.$store.state.scriptRecord.bgSet) {
|
if (!this.$store.state.scriptRecord.bgSet) {
|
||||||
@ -147,6 +155,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
drawingCall() {
|
||||||
|
this.$refs.drawSelect.doShow(this.selected);
|
||||||
|
},
|
||||||
doShow(point) {
|
doShow(point) {
|
||||||
this.initMenu();
|
this.initMenu();
|
||||||
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
if (this.$refs && this.$refs.popMenu && this.menu && this.menu.length) {
|
||||||
|
@ -101,8 +101,8 @@
|
|||||||
<el-row style="display: flex;align-items: center;">
|
<el-row style="display: flex;align-items: center;">
|
||||||
<el-col :span="7" style="height: 25px;line-height: 25px;">车次号</el-col>
|
<el-col :span="7" style="height: 25px;line-height: 25px;">车次号</el-col>
|
||||||
<el-col :span="17">
|
<el-col :span="17">
|
||||||
<el-input v-if="trainOperateType!=='create'" v-model="formModelTripNum" size="mini" style="height: 20px;" :disabled="true" />
|
<el-input v-if="trainOperateType!=='create'" v-model="formModelTripNum" :maxlength="7" size="mini" style="height: 20px;" :disabled="true" />
|
||||||
<el-input v-if="trainOperateType==='create'" v-model="formModelNewTrip" size="mini" style="height: 20px;" />
|
<el-input v-if="trainOperateType==='create'" v-model="formModelNewTrip" :maxlength="7" size="mini" style="height: 20px;" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row style="display: flex;align-items: center;">
|
<el-row style="display: flex;align-items: center;">
|
||||||
@ -115,7 +115,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row v-if="trainOperateType ==='create'" style="display: flex;align-items: center;">
|
<el-row v-if="trainOperateType ==='create'" style="display: flex;align-items: center;">
|
||||||
<el-col :span="7" style="height: 25px;line-height: 25px;">新车组号</el-col>
|
<el-col :span="7" style="height: 25px;line-height: 25px;">新车组号</el-col>
|
||||||
<el-col :span="17"><el-input v-model="formModelNewGroup" size="mini" style="height: 20px;" /></el-col>
|
<el-col :span="17"><el-input v-model="formModelNewGroup" :maxlength="6" size="mini" style="height: 20px;" /></el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row v-if="trainOperateType === 'move'" style="display: flex;align-items: center;">
|
<el-row v-if="trainOperateType === 'move'" style="display: flex;align-items: center;">
|
||||||
<el-col :span="7" style="height: 25px;line-height: 25px;">新轨道号</el-col>
|
<el-col :span="7" style="height: 25px;line-height: 25px;">新轨道号</el-col>
|
||||||
|
@ -30,9 +30,7 @@ export default {
|
|||||||
mapDevice: {},
|
mapDevice: {},
|
||||||
routeData: [],
|
routeData: [],
|
||||||
mapData: null,
|
mapData: null,
|
||||||
autoReentryData: [],
|
autoReentryData: []
|
||||||
width: 1920,
|
|
||||||
height: 960
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -41,7 +39,13 @@ export default {
|
|||||||
},
|
},
|
||||||
...mapGetters('map', [
|
...mapGetters('map', [
|
||||||
'bigScreenConfig'
|
'bigScreenConfig'
|
||||||
])
|
]),
|
||||||
|
width() {
|
||||||
|
return this.$store.state.app.width - 40;
|
||||||
|
},
|
||||||
|
height() {
|
||||||
|
return this.$store.state.app.height - 60;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$store.state.config.canvasSizeCount': function (val) {
|
'$store.state.config.canvasSizeCount': function (val) {
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-dialogDrag
|
v-dialogDrag
|
||||||
class="haerbin-01__systerm stand-stop-time"
|
class="haerbin-01__systerm"
|
||||||
:title="title"
|
:title="title"
|
||||||
:visible.sync="show"
|
:visible.sync="show"
|
||||||
:fullscreen="true"
|
:fullscreen="true"
|
||||||
:before-close="doClose"
|
:before-close="doClose"
|
||||||
:z-index="2000"
|
:z-index="2000"
|
||||||
>
|
>
|
||||||
<map-visual ref="map" style="width: 100%;height: 100%;" />
|
<map-visual ref="map" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -81,12 +81,12 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.haerbin-01__systerm .el-dialog .base-label {
|
/deep/ .el-dialog {
|
||||||
background: rgba(0, 0, 0, x);
|
background: rgba(100, 100, 100, 1);
|
||||||
position: relative;
|
position: relative;
|
||||||
left: -5px;
|
border: 2px solid rgb(144, 144, 144, 0.8);
|
||||||
top: -18px;
|
border-radius: 6px;
|
||||||
padding: 0 5px;
|
color: #000;
|
||||||
background-color: #F0F0F0;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -84,8 +84,8 @@
|
|||||||
<el-row style="display: flex;align-items: center;">
|
<el-row style="display: flex;align-items: center;">
|
||||||
<el-col :span="7" style="height: 25px;line-height: 25px;">车次号</el-col>
|
<el-col :span="7" style="height: 25px;line-height: 25px;">车次号</el-col>
|
||||||
<el-col :span="17">
|
<el-col :span="17">
|
||||||
<el-input v-if="trainOperateType!=='create'" v-model="formModelTripNum" size="mini" style="height: 20px;" :disabled="true" />
|
<el-input v-if="trainOperateType!=='create'" v-model="formModelTripNum" :maxlength="7" size="mini" style="height: 20px;" :disabled="true" />
|
||||||
<el-input v-if="trainOperateType==='create'" v-model="formModelNewTrip" size="mini" style="height: 20px;" />
|
<el-input v-if="trainOperateType==='create'" v-model="formModelNewTrip" :maxlength="7" size="mini" style="height: 20px;" />
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row style="display: flex;align-items: center;">
|
<el-row style="display: flex;align-items: center;">
|
||||||
@ -98,7 +98,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row v-if="trainOperateType ==='create'" style="display: flex;align-items: center;">
|
<el-row v-if="trainOperateType ==='create'" style="display: flex;align-items: center;">
|
||||||
<el-col :span="7" style="height: 25px;line-height: 25px;">新车组号</el-col>
|
<el-col :span="7" style="height: 25px;line-height: 25px;">新车组号</el-col>
|
||||||
<el-col :span="17"><el-input v-model="formModelNewGroup" size="mini" style="height: 20px;" /></el-col>
|
<el-col :span="17"><el-input v-model="formModelNewGroup" :maxlength="6" size="mini" style="height: 20px;" /></el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row v-if="trainOperateType === 'move'" style="display: flex;align-items: center;">
|
<el-row v-if="trainOperateType === 'move'" style="display: flex;align-items: center;">
|
||||||
<el-col :span="7" style="height: 25px;line-height: 25px;">新轨道号</el-col>
|
<el-col :span="7" style="height: 25px;line-height: 25px;">新轨道号</el-col>
|
||||||
|
@ -15,6 +15,7 @@ import FaviconNty from '@/assets/icon/favicon_nty.png';
|
|||||||
import FaviconBjd from '@/assets/icon/favicon_bjd.png';
|
import FaviconBjd from '@/assets/icon/favicon_bjd.png';
|
||||||
import FaviconSdy from '@/assets/icon/favicon_jdy.png';
|
import FaviconSdy from '@/assets/icon/favicon_jdy.png';
|
||||||
import FaviconCgy from '@/assets/icon/favicon_cgy.png';
|
import FaviconCgy from '@/assets/icon/favicon_cgy.png';
|
||||||
|
import FaviconZzww from '@/assets/icon/favicon_zzww.png';
|
||||||
import Link_Bxkc from '@/assets/icon/link_bxkc.png';
|
import Link_Bxkc from '@/assets/icon/link_bxkc.png';
|
||||||
import Link_Crsc from '@/assets/icon/link_crsc.png';
|
import Link_Crsc from '@/assets/icon/link_crsc.png';
|
||||||
import Link_Hls from '@/assets/icon/link_hls.png';
|
import Link_Hls from '@/assets/icon/link_hls.png';
|
||||||
@ -37,9 +38,10 @@ export const loginInfo = {
|
|||||||
title: '共赢列车仿真驾驶系统',
|
title: '共赢列车仿真驾驶系统',
|
||||||
loginPath: '/login?project=zzww',
|
loginPath: '/login?project=zzww',
|
||||||
loginParam: 'ZZWW',
|
loginParam: 'ZZWW',
|
||||||
titleDistance: '-150px',
|
loginTitle: '空串',
|
||||||
navigationLogoWidth: '40px',
|
logoWidth: '140px',
|
||||||
navigationMarginLeft: '60px',
|
navigationLogoWidth: '120px',
|
||||||
|
navigationMarginLeft: '140px',
|
||||||
systemType: '011'
|
systemType: '011'
|
||||||
},
|
},
|
||||||
bjd: {
|
bjd: {
|
||||||
@ -428,7 +430,7 @@ export const loginInfo = {
|
|||||||
|
|
||||||
export const ProjectIcon = {
|
export const ProjectIcon = {
|
||||||
xty: FaviconXty,
|
xty: FaviconXty,
|
||||||
zzww: FaviconXty,
|
zzww: FaviconZzww,
|
||||||
login: Favicon,
|
login: Favicon,
|
||||||
design: Favicon,
|
design: Favicon,
|
||||||
designxty: FaviconXty,
|
designxty: FaviconXty,
|
||||||
|
@ -2,11 +2,11 @@ export function getBaseUrl() {
|
|||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// 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.8.107:9000'; // 袁琪
|
// BASE_API = 'http://192.168.8.107:9000'; // 袁琪
|
||||||
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
|
// BASE_API = 'http://192.168.3.83:9000'; // 旭强 有线
|
||||||
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
|
// BASE_API = 'http://192.168.8.114:9000'; // 旭强 无线
|
||||||
// BASE_API = 'http://192.168.3.120:9000'; // 张赛
|
BASE_API = 'http://192.168.3.120:9000'; // 张赛
|
||||||
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
// BASE_API = 'http://192.168.8.140:9000'; // 杜康
|
||||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||||
|
@ -210,7 +210,7 @@ export default {
|
|||||||
});
|
});
|
||||||
this.$jlmap.updateShowStation(list, deviceId);
|
this.$jlmap.updateShowStation(list, deviceId);
|
||||||
}
|
}
|
||||||
// 'Station83189';
|
this.$jlmap.setCenter(deviceId);
|
||||||
if (this.try != '0') {
|
if (this.try != '0') {
|
||||||
this.loadInitData();
|
this.loadInitData();
|
||||||
}
|
}
|
||||||
|
87
src/views/uploadPdf/bindMap.vue
Normal file
87
src/views/uploadPdf/bindMap.vue
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-dialogDrag title="绑定地图数据" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center class="uploadDialog">
|
||||||
|
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||||
|
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { getPublishMapList } from '@/api/jmap/map';
|
||||||
|
import { getFileBindInfo } from '@/api/pdf';
|
||||||
|
export default {
|
||||||
|
name:'BindMap',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
mapList:[],
|
||||||
|
fileId:'',
|
||||||
|
dialogVisible: false,
|
||||||
|
formModel: {
|
||||||
|
mapId:''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed:{
|
||||||
|
form() {
|
||||||
|
const form = {
|
||||||
|
labelWidth: '120px',
|
||||||
|
items: [
|
||||||
|
{ prop: 'mapId', label: '选择线路:', type:'select', options: this.mapList, optionValue:'id', optionLabel:'name' }
|
||||||
|
// change: true, onChange: this.handleMap
|
||||||
|
]
|
||||||
|
};
|
||||||
|
return form;
|
||||||
|
},
|
||||||
|
rules() {
|
||||||
|
const crules = {
|
||||||
|
mapId: [
|
||||||
|
{ required: true, message: ' 地图不能为空', trigger: 'blur'},
|
||||||
|
{ required: true, message: ' 地图不能为空', trigger: 'change'}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
return crules;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
const params = {
|
||||||
|
pageSize: 9999,
|
||||||
|
pageNum: 1
|
||||||
|
};
|
||||||
|
getPublishMapList(params).then(res => {
|
||||||
|
this.mapList = res.data.list || [];
|
||||||
|
});
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
doShow(data) {
|
||||||
|
this.fileId = data.id;
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
this.formModel = {
|
||||||
|
mapId: ''
|
||||||
|
};
|
||||||
|
this.$refs.dataform.resetForm();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
},
|
||||||
|
doSave() {
|
||||||
|
const self = this;
|
||||||
|
this.$refs.dataform.validateForm(() => {
|
||||||
|
if (self.fileId) {
|
||||||
|
getFileBindInfo(self.fileId, self.formModel.mapId).then((res) => {
|
||||||
|
let data = null;
|
||||||
|
if (res.data) {
|
||||||
|
data = res.data;
|
||||||
|
}
|
||||||
|
this.$refs.bindMapInfo.doShow(data);
|
||||||
|
}).catch(error => {
|
||||||
|
console.log(error);
|
||||||
|
// self.$message.error(`上传PDF失败:${error.message}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center class="uploadDialog">
|
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="30%" :before-close="handleClose" center class="uploadDialog">
|
||||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||||
|
<div class="fileError">{{ message }}</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||||
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
<el-button @click="handleClose">{{ $t('global.cancel') }}</el-button>
|
||||||
@ -10,8 +11,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { postUploadFile, putUploadFile } from '@/api/pdf';
|
import { postUploadFile, putUploadFile } from '@/api/pdf';
|
||||||
import { getPublishMapDetailById, getPublishMapVersionById } from '@/api/jmap/map';
|
// import { getPublishMapDetailById, getPublishMapVersionById } from '@/api/jmap/map';
|
||||||
import { dbReadData, dbAddData, dbUpdateData } from '@/utils/indexedDb';
|
// import { dbReadData, dbAddData, dbUpdateData } from '@/utils/indexedDb';
|
||||||
// uploadFile
|
// uploadFile
|
||||||
import { meansUrl } from '@/api/upload';
|
import { meansUrl } from '@/api/upload';
|
||||||
|
|
||||||
@ -21,39 +22,30 @@ export default {
|
|||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
},
|
|
||||||
mapList:{
|
|
||||||
type: Array,
|
|
||||||
required: true
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
formModel: {
|
formModel: {
|
||||||
// cityCode: '',
|
|
||||||
mapId: '',
|
|
||||||
deviceTypes: '',
|
|
||||||
deviceIds: [],
|
|
||||||
upload: '',
|
upload: '',
|
||||||
filePath: '',
|
filePath: '',
|
||||||
fileType: 'DRAWING'
|
fileType: 'DRAWING',
|
||||||
|
fileName:''
|
||||||
},
|
},
|
||||||
rowData: null,
|
|
||||||
graphDataNew: null,
|
|
||||||
fileList: [],
|
fileList: [],
|
||||||
formData: '',
|
formData: '',
|
||||||
id: '',
|
id: '',
|
||||||
deviceTypeList: [
|
message:''
|
||||||
{ label: '区段', value: 'sectionList', code: 'SECTION' },
|
// deviceTypeList: [
|
||||||
{ label: '道岔', value: 'switchList', code: 'SWITCH' },
|
// { label: '区段', value: 'sectionList', code: 'SECTION' },
|
||||||
{ label: '信号机', value: 'signalList', code: 'SIGNAL' },
|
// { label: '道岔', value: 'switchList', code: 'SWITCH' },
|
||||||
{ label: '车站', value: 'stationList', code: 'STATION' },
|
// { label: '信号机', value: 'signalList', code: 'SIGNAL' },
|
||||||
{ label: '站台', value: 'stationStandList', code: 'STAND' },
|
// { label: '车站', value: 'stationList', code: 'STATION' },
|
||||||
{ label: '屏蔽门', value: 'psdList', code: 'PSD' },
|
// { label: '站台', value: 'stationStandList', code: 'STAND' },
|
||||||
{ label: '列车', value: 'trainList', code: 'TRAIN' }
|
// { label: '屏蔽门', value: 'psdList', code: 'PSD' },
|
||||||
],
|
// { label: '列车', value: 'trainList', code: 'TRAIN' }
|
||||||
deviceCodesList: []
|
// ],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -64,25 +56,23 @@ export default {
|
|||||||
const form = {
|
const form = {
|
||||||
labelWidth: '120px',
|
labelWidth: '120px',
|
||||||
items: [
|
items: [
|
||||||
{ prop: 'mapId', label: '选择线路:', type:'select', options: this.mapList, optionValue:'id', optionLabel:'name', change: true, onChange: this.handleMap },
|
// { prop: 'mapId', label: '选择线路:', type:'select', options: this.mapList, optionValue:'id', optionLabel:'name', change: true, onChange: this.handleMap },
|
||||||
{ prop: 'deviceTypes', label: '选择设备类型:', type:'select', options: this.deviceTypeList, optionValue:'value', optionLabel:'label', change: true, onChange: this.handleDevice },
|
// { prop: 'deviceTypes', label: '选择设备类型:', type:'select', options: this.deviceTypeList, optionValue:'value', optionLabel:'label', change: true, onChange: this.handleDevice },
|
||||||
{ prop: 'deviceIds', label: '选择设备:', type:'select', multiple: true, options: this.deviceCodesList, optionValue:'code', optionLabel:'name' },
|
// { prop: 'deviceIds', label: '选择设备:', type:'select', multiple: true, options: this.deviceCodesList, optionValue:'code', optionLabel:'name' },
|
||||||
{ prop: 'upload', label: '上传:', type:'uploadPicture', show: this.type == 'ADD', action: this.action, fileList: this.fileList, onChange: this.onChange, onSuccess: this.onSuccess }
|
{ prop: 'fileName', label: '文件名:', type:'text', show:true, rightWidth:true, required:true },
|
||||||
|
{ prop: 'upload', label: '上传:', type:'uploadPicture', fileList: this.fileList, show: this.type == 'ADD', action: this.action, onChange: this.onChange, onSuccess: this.onSuccess }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return form;
|
return form;
|
||||||
},
|
},
|
||||||
rules() {
|
rules() {
|
||||||
const crules = {
|
const crules = {
|
||||||
mapId: [
|
fileName: [
|
||||||
{ required: true, message: '请选择线路', trigger: 'change' }
|
{ required: true, message: '文件名不能为空', trigger: 'blur'}
|
||||||
],
|
|
||||||
deviceTypes: [
|
|
||||||
{ required: true, message: '请选择设备类型', trigger: 'change' }
|
|
||||||
],
|
|
||||||
deviceIds: [
|
|
||||||
{ required: true, message: '请选择设备', trigger: 'change' }
|
|
||||||
]
|
]
|
||||||
|
// upload: [
|
||||||
|
// { required: true, message: '请上传文件', trigger: 'onChange' }
|
||||||
|
// ]
|
||||||
};
|
};
|
||||||
return crules;
|
return crules;
|
||||||
},
|
},
|
||||||
@ -90,7 +80,7 @@ export default {
|
|||||||
if (this.type === 'ADD') {
|
if (this.type === 'ADD') {
|
||||||
return '上传PDF';
|
return '上传PDF';
|
||||||
} else {
|
} else {
|
||||||
return '更新文章';
|
return '更新PDF';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -98,88 +88,84 @@ export default {
|
|||||||
async show(data) {
|
async show(data) {
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
if (this.type != 'ADD') {
|
if (this.type != 'ADD') {
|
||||||
const obj = this.deviceTypeList.find(el => el.code == data.deviceTypes[0]);
|
|
||||||
this.id = data.id;
|
this.id = data.id;
|
||||||
this.rowData = data;
|
|
||||||
this.rowData.deviceTypes = obj ? obj.value : '';
|
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
mapId: data.mapId,
|
|
||||||
deviceTypes: obj ? obj.value : '',
|
|
||||||
deviceIds: data.deviceIds,
|
|
||||||
upload: '',
|
upload: '',
|
||||||
|
fileName:data.fileName,
|
||||||
filePath: data.filePath
|
filePath: data.filePath
|
||||||
};
|
};
|
||||||
await this.handleMap(data.mapId);
|
|
||||||
obj && await this.handleDevice(obj.value);
|
|
||||||
} else {
|
} else {
|
||||||
this.rowData = {};
|
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
mapId: '',
|
|
||||||
deviceTypes: '',
|
|
||||||
deviceIds: [],
|
|
||||||
upload: '',
|
upload: '',
|
||||||
filePath: ''
|
filePath: '',
|
||||||
|
fileName:''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handleMap(mapId) {
|
// async handleMap(mapId) {
|
||||||
if (mapId) {
|
// if (mapId) {
|
||||||
if (mapId != this.rowData.mapId) {
|
// if (mapId != this.rowData.mapId) {
|
||||||
this.formModel.deviceIds = [];
|
// this.formModel.deviceIds = [];
|
||||||
this.formModel.deviceTypes = '';
|
// this.formModel.deviceTypes = '';
|
||||||
}
|
// }
|
||||||
return new Promise(async (resolve, reject) => {
|
// return new Promise(async (resolve, reject) => {
|
||||||
const resp = await getPublishMapVersionById(mapId);
|
// const resp = await getPublishMapVersionById(mapId);
|
||||||
const version = resp.data;
|
// const version = resp.data;
|
||||||
dbReadData('mapData', mapId, version, async (mapData, version) =>{
|
// dbReadData('mapData', mapId, version, async (mapData, version) =>{
|
||||||
if (mapData && mapData.version == version) {
|
// if (mapData && mapData.version == version) {
|
||||||
this.graphDataNew = mapData.graphDataNew;
|
// this.graphDataNew = mapData.graphDataNew;
|
||||||
resolve();
|
// resolve();
|
||||||
} else if (mapData) {
|
// } else if (mapData) {
|
||||||
const res = await getPublishMapDetailById(mapId);
|
// const res = await getPublishMapDetailById(mapId);
|
||||||
this.graphDataNew = res.data.graphDataNew;
|
// this.graphDataNew = res.data.graphDataNew;
|
||||||
dbUpdateData('mapData', res.data);
|
// dbUpdateData('mapData', res.data);
|
||||||
resolve();
|
// resolve();
|
||||||
} else {
|
// } else {
|
||||||
const res = await getPublishMapDetailById(mapId);
|
// const res = await getPublishMapDetailById(mapId);
|
||||||
this.graphDataNew = res.data.graphDataNew;
|
// this.graphDataNew = res.data.graphDataNew;
|
||||||
dbAddData('mapData', res.data);
|
// dbAddData('mapData', res.data);
|
||||||
resolve();
|
// resolve();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
this.formModel.deviceIds = [];
|
// this.formModel.deviceIds = [];
|
||||||
this.formModel.mapId = '';
|
// this.formModel.mapId = '';
|
||||||
this.formModel.deviceTypes = '';
|
// this.formModel.deviceTypes = '';
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
handleDevice(type) {
|
// handleDevice(type) {
|
||||||
if (type) {
|
// if (type) {
|
||||||
if (type != this.rowData.deviceTypes) {
|
// if (type != this.rowData.deviceTypes) {
|
||||||
this.formModel.deviceIds = [];
|
// this.formModel.deviceIds = [];
|
||||||
}
|
// }
|
||||||
this.deviceCodesList = this.graphDataNew[type].map(el => {
|
// this.deviceCodesList = this.graphDataNew[type].map(el => {
|
||||||
return {
|
// return {
|
||||||
code: el.code,
|
// code: el.code,
|
||||||
name: `${el.name}(${el.code})`
|
// name: `${el.name}(${el.code})`
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
this.formModel.deviceIds = [];
|
// this.formModel.deviceIds = [];
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
// uploadFile(file) {
|
// uploadFile(file) {
|
||||||
// this.formData.append('file', file.file);
|
// this.formData.append('file', file.file);
|
||||||
// },
|
// },
|
||||||
onSuccess(res, file) {
|
onSuccess(res, file) {
|
||||||
this.formModel.filePath = res.data;
|
this.formModel.filePath = res.data;
|
||||||
|
this.message = '';
|
||||||
},
|
},
|
||||||
doSave() {
|
doSave() {
|
||||||
const self = this;
|
const self = this;
|
||||||
this.$refs.dataform.validateForm(() => {
|
this.$refs.dataform.validateForm(() => {
|
||||||
if (self.type == 'ADD') {
|
if (self.type == 'ADD') {
|
||||||
self.create();
|
if (this.formModel.filePath) {
|
||||||
|
self.create();
|
||||||
|
} else {
|
||||||
|
this.message = '请上传文件';
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
self.update();
|
self.update();
|
||||||
}
|
}
|
||||||
@ -187,16 +173,10 @@ export default {
|
|||||||
},
|
},
|
||||||
create() {
|
create() {
|
||||||
const self = this;
|
const self = this;
|
||||||
const obj = this.deviceTypeList.find(el => el.value == this.formModel.deviceTypes);
|
|
||||||
if (obj) {
|
|
||||||
this.formModel.deviceTypes = [obj.code];
|
|
||||||
}
|
|
||||||
const data = {
|
const data = {
|
||||||
fileType: 'DRAWING',
|
fileType: 'DRAWING',
|
||||||
mapId: this.formModel.mapId,
|
filePath: this.formModel.filePath,
|
||||||
deviceTypes: this.formModel.deviceTypes,
|
fileName:this.formModel.fileName
|
||||||
deviceIds: this.formModel.deviceIds,
|
|
||||||
filePath: this.formModel.filePath
|
|
||||||
};
|
};
|
||||||
postUploadFile(data).then((res) => {
|
postUploadFile(data).then((res) => {
|
||||||
self.$message.success('上传PDF成功!');
|
self.$message.success('上传PDF成功!');
|
||||||
@ -204,34 +184,31 @@ export default {
|
|||||||
self.$emit('reloadTable');
|
self.$emit('reloadTable');
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
self.$message.error(`创建文章失败:${error.message}`);
|
self.$message.error(`上传PDF失败:${error.message}`);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
update() {
|
update() {
|
||||||
const self = this;
|
const self = this;
|
||||||
const obj = this.deviceTypeList.find(el => el.value == this.formModel.deviceTypes);
|
|
||||||
if (obj) {
|
|
||||||
this.formModel.deviceTypes = [obj.code];
|
|
||||||
}
|
|
||||||
const data = {
|
const data = {
|
||||||
id: this.id,
|
id: this.id,
|
||||||
fileType: 'DRAWING',
|
fileType: 'DRAWING',
|
||||||
mapId: this.formModel.mapId,
|
fileName:this.formModel.fileName,
|
||||||
deviceTypes: this.formModel.deviceTypes,
|
|
||||||
deviceIds: this.formModel.deviceIds,
|
|
||||||
filePath: this.formModel.filePath
|
filePath: this.formModel.filePath
|
||||||
};
|
};
|
||||||
putUploadFile(data).then(() => {
|
putUploadFile(data).then(() => {
|
||||||
self.$message.success('更新文章成功!');
|
self.$message.success('更新PDF成功!');
|
||||||
self.handleClose();
|
self.handleClose();
|
||||||
self.$emit('reloadTable');
|
self.$emit('reloadTable');
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
self.$message.error(`更新文章失败:${error.message}`);
|
self.$message.error(`更新PDF失败:${error.message}`);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleClose() {
|
handleClose() {
|
||||||
|
this.message = '';
|
||||||
this.formModel = {
|
this.formModel = {
|
||||||
title: ''
|
upload: '',
|
||||||
|
filePath: '',
|
||||||
|
fileName:''
|
||||||
};
|
};
|
||||||
this.$refs.dataform.resetForm();
|
this.$refs.dataform.resetForm();
|
||||||
this.dialogVisible = false;
|
this.dialogVisible = false;
|
||||||
@ -248,4 +225,12 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.fileError{
|
||||||
|
color: red;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-left: 122px;
|
||||||
|
vertical-align: top;
|
||||||
|
display: inline-block;
|
||||||
|
margin-top: -10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -4,12 +4,11 @@
|
|||||||
<el-card>
|
<el-card>
|
||||||
<el-form
|
<el-form
|
||||||
ref="queryForm"
|
ref="queryForm"
|
||||||
:model="formModel"
|
|
||||||
size="small"
|
size="small"
|
||||||
style="padding: 6px 20px 6px 20px;overflow: hidden;"
|
style="padding: 6px 20px 6px 20px;overflow: hidden;"
|
||||||
>
|
>
|
||||||
<el-form-item label="地图" style="margin-bottom: 0;float: left; width: 300px;">
|
<!-- <el-form-item label="地图" style="margin-bottom: 0;float: left; width: 300px;">
|
||||||
<el-select v-model="formModel.mapId" placeholder="请选择" filterable style="width: 240px;" @change="handleMap">
|
<el-select v-model="formModel.mapId" placeholder="请选择" clearable filterable style="width: 240px;" @change="handleMap">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in mapList"
|
v-for="item in mapList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
@ -17,8 +16,8 @@
|
|||||||
:value="item.id"
|
:value="item.id"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="设备类型" style="margin-bottom: 0;float: left; width:350px;">
|
<!-- <el-form-item label="设备类型" style="margin-bottom: 0;float: left; width:350px;">
|
||||||
<el-select v-model="formModel.deviceType" placeholder="请选择" filterable clearable style="width: 240px;" @change="handleDevice">
|
<el-select v-model="formModel.deviceType" placeholder="请选择" filterable clearable style="width: 240px;" @change="handleDevice">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in deviceTypeList"
|
v-for="item in deviceTypeList"
|
||||||
@ -27,8 +26,8 @@
|
|||||||
:value="item.value"
|
:value="item.value"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-form-item label="设备id" style="margin-bottom: 0;float: left; width: 300px;">
|
<!-- <el-form-item label="设备id" style="margin-bottom: 0;float: left; width: 300px;">
|
||||||
<el-select v-model="formModel.deviceId" placeholder="请选择" filterable clearable style="width: 200px;">
|
<el-select v-model="formModel.deviceId" placeholder="请选择" filterable clearable style="width: 200px;">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in deviceIdList"
|
v-for="item in deviceIdList"
|
||||||
@ -37,18 +36,18 @@
|
|||||||
:value="item.code"
|
:value="item.code"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item> -->
|
||||||
<el-button style="margin-right: 10px; float: right;" type="primary" size="small" @click="createTitle">创建</el-button>
|
<el-button style="margin-right: 10px; float: right;" type="primary" size="small" @click="createTitle">创建</el-button>
|
||||||
<el-button style="margin-right: 10px; float: right;" type="primary" size="small" @click="query">查询</el-button>
|
<el-button style="margin-right: 10px; float: right;" type="primary" size="small" @click="query">查询</el-button>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-table :data="tableData" border style="width: 100%">
|
<el-table :data="tableData" border style="width: 100%">
|
||||||
<el-table-column label="线路">
|
<!-- <el-table-column label="线路">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ getMapName(scope.row.mapId) }}</span>
|
<span>{{ getMapName(scope.row.mapId) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="类型">
|
<!-- <el-table-column label="类型">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.deviceTypes }}</span>
|
<span>{{ scope.row.deviceTypes }}</span>
|
||||||
</template>
|
</template>
|
||||||
@ -57,80 +56,80 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-for="(item, index) in scope.row.deviceIds" :key="index" class="deviceIdTag">{{ item }}</el-tag>
|
<el-tag v-for="(item, index) in scope.row.deviceIds" :key="index" class="deviceIdTag">{{ item }}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
|
<el-table-column label="pdf名称" prop="fileName" />
|
||||||
<el-table-column label="路径" prop="filePath" />
|
<el-table-column label="路径" prop="filePath" />
|
||||||
<el-table-column label="时间" prop="createTime" />
|
<el-table-column label="时间" prop="createTime" />
|
||||||
<el-table-column label="操作" width="450">
|
<el-table-column label="操作" width="450">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> -->
|
<!-- <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> -->
|
||||||
<el-button size="mini" @click="handleUpdate(scope.$index, scope.row)">更新</el-button>
|
<el-button size="mini" type="primary" @click="handleBind(scope.$index, scope.row)">绑定</el-button>
|
||||||
|
<el-button size="mini" type="success" @click="handleUpdate(scope.$index, scope.row)">更新</el-button>
|
||||||
<!-- <el-button size="mini" @click="handlePublish(scope.$index, scope.row)">发布</el-button> -->
|
<!-- <el-button size="mini" @click="handlePublish(scope.$index, scope.row)">发布</el-button> -->
|
||||||
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
<el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<Edit ref="edits" type="ADD" :map-list="mapList" @reloadTable="reloadTable" />
|
<Edit ref="edits" type="ADD" @reloadTable="reloadTable" />
|
||||||
<Edit ref="edit" type="EDIT" :map-list="mapList" @reloadTable="reloadTable" />
|
<Edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||||
|
<Bind-Map ref="bindMap" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getPublishMapDetailById, getPublishMapVersionById } from '@/api/jmap/map';
|
// import { getPublishMapDetailById, getPublishMapVersionById } from '@/api/jmap/map';
|
||||||
import { getUploadFile, deleteUploadFile } from '@/api/pdf';
|
import { getUploadFile, deleteUploadFile } from '@/api/pdf';
|
||||||
import { getPublishMapList } from '@/api/jmap/map';
|
// import { dbReadData, dbAddData, dbUpdateData } from '@/utils/indexedDb';
|
||||||
import { dbReadData, dbAddData, dbUpdateData } from '@/utils/indexedDb';
|
|
||||||
import Edit from './edit';
|
import Edit from './edit';
|
||||||
|
import BindMap from './bindMap';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CacheControl',
|
name: 'CacheControl',
|
||||||
components: {
|
components: {
|
||||||
Edit
|
Edit,
|
||||||
|
BindMap
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formModel: {
|
// formModel: {
|
||||||
mapId: '',
|
// mapId: '',
|
||||||
deviceType:'',
|
// deviceType:'',
|
||||||
deviceId:''
|
// deviceId:''
|
||||||
},
|
// },
|
||||||
mapList: [],
|
// mapList: [],
|
||||||
graphDataNew:null,
|
// graphDataNew:null,
|
||||||
deviceIdList:[],
|
deviceIdList:[]
|
||||||
deviceTypeList: [
|
// deviceTypeList: [
|
||||||
{ label: '区段', value: 'sectionList', code: 'SECTION' },
|
// { label: '区段', value: 'sectionList', code: 'SECTION' },
|
||||||
{ label: '道岔', value: 'switchList', code: 'SWITCH' },
|
// { label: '道岔', value: 'switchList', code: 'SWITCH' },
|
||||||
{ label: '信号机', value: 'signalList', code: 'SIGNAL' },
|
// { label: '信号机', value: 'signalList', code: 'SIGNAL' },
|
||||||
{ label: '车站', value: 'stationList', code: 'STATION' },
|
// { label: '车站', value: 'stationList', code: 'STATION' },
|
||||||
{ label: '站台', value: 'stationStandList', code: 'STAND' },
|
// { label: '站台', value: 'stationStandList', code: 'STAND' },
|
||||||
{ label: '屏蔽门', value: 'psdList', code: 'PSD' },
|
// { label: '屏蔽门', value: 'psdList', code: 'PSD' },
|
||||||
{ label: '列车', value: 'trainList', code: 'TRAIN' }
|
// { label: '列车', value: 'trainList', code: 'TRAIN' }
|
||||||
]
|
// ]
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const params = {
|
this.query();
|
||||||
pageSize: 9999,
|
// getPublishMapList(params).then(res => {
|
||||||
pageNum: 1
|
// // this.mapList = res.data.list.filter(el => !el.project );
|
||||||
};
|
// this.mapList = res.data.list || [];
|
||||||
getPublishMapList(params).then(res => {
|
// // if (this.mapList.length > 0) { this.formModel.mapId = this.mapList[0].id; this.handleMap(this.formModel.mapId); }
|
||||||
// this.mapList = res.data.list.filter(el => !el.project );
|
// });
|
||||||
this.mapList = res.data.list || [];
|
|
||||||
if (this.mapList.length > 0) { this.formModel.mapId = this.mapList[0].id; this.handleMap(this.formModel.mapId); }
|
|
||||||
this.query();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
query() {
|
query() {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
},
|
},
|
||||||
getMapName(val) {
|
// getMapName(val) {
|
||||||
if (this && this.mapList.length) {
|
// if (this && this.mapList.length) {
|
||||||
const data = this.mapList.find(el => el.id == val);
|
// const data = this.mapList.find(el => el.id == val);
|
||||||
return data.name;
|
// return data.name;
|
||||||
}
|
// }
|
||||||
return val;
|
// return val;
|
||||||
},
|
// },
|
||||||
createTitle() {
|
createTitle() {
|
||||||
this.$refs.edits.show();
|
this.$refs.edits.show();
|
||||||
},
|
},
|
||||||
@ -139,7 +138,7 @@ export default {
|
|||||||
// this.$router.push({path : '/editor', query: {docId: data.id, draft: 1}});
|
// this.$router.push({path : '/editor', query: {docId: data.id, draft: 1}});
|
||||||
// },
|
// },
|
||||||
// 更新标题
|
// 更新标题
|
||||||
handleUpdate(row, data) {
|
handleUpdate(index, data) {
|
||||||
this.$refs.edit.show(data);
|
this.$refs.edit.show(data);
|
||||||
},
|
},
|
||||||
// // 草稿发布
|
// // 草稿发布
|
||||||
@ -152,14 +151,17 @@ export default {
|
|||||||
// this.$message.error(`发布失败: ${error.data}`);
|
// this.$message.error(`发布失败: ${error.data}`);
|
||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
handleDelete(row, data) {
|
handleBind(index, data) {
|
||||||
|
this.$refs.bindMap.doShow(data);
|
||||||
|
},
|
||||||
|
handleDelete(index, data) {
|
||||||
this.$confirm('是否确认删除?', this.$t('tip.hint'), {
|
this.$confirm('是否确认删除?', this.$t('tip.hint'), {
|
||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
deleteUploadFile(data.id).then(res => {
|
deleteUploadFile(data.id).then(res => {
|
||||||
this.$message.success('删除文章成功!');
|
this.$message.success('删除pdf成功!');
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$message.error(`删除失败: ${error.data}`);
|
this.$message.error(`删除失败: ${error.data}`);
|
||||||
@ -168,59 +170,59 @@ export default {
|
|||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.tableData = [];
|
this.tableData = [];
|
||||||
getUploadFile(this.formModel).then(res => {
|
getUploadFile({}).then(res => {
|
||||||
this.tableData = res.data;
|
this.tableData = res.data;
|
||||||
this.tableData.forEach(each=>{
|
// this.tableData.forEach(each=>{
|
||||||
const deviceTypeName = this.deviceTypeList.find(type=>{ return type.code == each.deviceTypes[0]; }) || {label:''};
|
// const deviceTypeName = this.deviceTypeList.find(type=>{ return type.code == each.deviceTypes[0]; }) || {label:''};
|
||||||
each.deviceTypes = deviceTypeName.label;
|
// each.deviceTypes = deviceTypeName.label;
|
||||||
});
|
// });
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
});
|
});
|
||||||
},
|
|
||||||
handleMap(mapId) {
|
|
||||||
this.deviceIdList = [];
|
|
||||||
this.formModel.deviceId = '';
|
|
||||||
this.formModel.deviceType = '';
|
|
||||||
return new Promise(async (resolve, reject) => {
|
|
||||||
const resp = await getPublishMapVersionById(mapId);
|
|
||||||
const version = resp.data;
|
|
||||||
dbReadData('mapData', mapId, version, async (mapData, version) =>{
|
|
||||||
if (mapData && mapData.version == version) {
|
|
||||||
this.graphDataNew = mapData.graphDataNew;
|
|
||||||
resolve();
|
|
||||||
} else if (mapData) {
|
|
||||||
const res = await getPublishMapDetailById(mapId);
|
|
||||||
this.graphDataNew = res.data.graphDataNew;
|
|
||||||
dbUpdateData('mapData', res.data);
|
|
||||||
resolve();
|
|
||||||
} else {
|
|
||||||
const res = await getPublishMapDetailById(mapId);
|
|
||||||
this.graphDataNew = res.data.graphDataNew;
|
|
||||||
dbAddData('mapData', res.data);
|
|
||||||
resolve();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleDevice(type) {
|
|
||||||
if (type) {
|
|
||||||
const data = this.graphDataNew[type];
|
|
||||||
if (data && data.length > 0) {
|
|
||||||
this.deviceIdList = this.graphDataNew[type].map(el => {
|
|
||||||
return {
|
|
||||||
code: el.code,
|
|
||||||
name: `${el.name}(${el.code})`
|
|
||||||
};
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.deviceIdList = [];
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.formModel.deviceId = '';
|
|
||||||
this.deviceIdList = [];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
// handleMap(mapId) {
|
||||||
|
// this.deviceIdList = [];
|
||||||
|
// this.formModel.deviceId = '';
|
||||||
|
// this.formModel.deviceType = '';
|
||||||
|
// return new Promise(async (resolve, reject) => {
|
||||||
|
// const resp = await getPublishMapVersionById(mapId);
|
||||||
|
// const version = resp.data;
|
||||||
|
// dbReadData('mapData', mapId, version, async (mapData, version) =>{
|
||||||
|
// if (mapData && mapData.version == version) {
|
||||||
|
// this.graphDataNew = mapData.graphDataNew;
|
||||||
|
// resolve();
|
||||||
|
// } else if (mapData) {
|
||||||
|
// const res = await getPublishMapDetailById(mapId);
|
||||||
|
// this.graphDataNew = res.data.graphDataNew;
|
||||||
|
// dbUpdateData('mapData', res.data);
|
||||||
|
// resolve();
|
||||||
|
// } else {
|
||||||
|
// const res = await getPublishMapDetailById(mapId);
|
||||||
|
// this.graphDataNew = res.data.graphDataNew;
|
||||||
|
// dbAddData('mapData', res.data);
|
||||||
|
// resolve();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// },
|
||||||
|
// handleDevice(type) {
|
||||||
|
// if (type) {
|
||||||
|
// const data = this.graphDataNew[type];
|
||||||
|
// if (data && data.length > 0) {
|
||||||
|
// this.deviceIdList = this.graphDataNew[type].map(el => {
|
||||||
|
// return {
|
||||||
|
// code: el.code,
|
||||||
|
// name: `${el.name}(${el.code})`
|
||||||
|
// };
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// this.deviceIdList = [];
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// this.formModel.deviceId = '';
|
||||||
|
// this.deviceIdList = [];
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user