This commit is contained in:
fan 2019-08-16 17:15:36 +08:00
commit 8e401afe36
23 changed files with 148 additions and 200 deletions

View File

@ -17,6 +17,9 @@ export default {
add: '添加', add: '添加',
are: '是', are: '是',
deny: '否', deny: '否',
drawMap: '绘图',
advanced: '高级',
viewLayer: '视图图层',
save: '保存', save: '保存',
updata: '更新', updata: '更新',

View File

@ -2,7 +2,7 @@
<div> <div>
<div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" /> <div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" />
<div class="lesson-select"> <div class="lesson-select">
<el-select v-model="mapName" placeholder="请选择课程" size="mini" style="width: 300px"> <el-select v-model="mapName" placeholder="请选择地图线路" size="mini" style="width: 300px">
<el-option v-for="name in mapNameList" :key="name" :label="name" :value="name" /> <el-option v-for="name in mapNameList" :key="name" :label="name" :value="name" />
</el-select> </el-select>
</div> </div>
@ -32,6 +32,9 @@ export default {
title: { title: {
text: '', text: '',
subtext: '', subtext: '',
subtextStyle: {
color: '#909399'
},
y: 10, y: 10,
left: 'center', left: 'center',
textAlign: 'center' textAlign: 'center'
@ -47,7 +50,8 @@ export default {
}], }],
xAxis: { xAxis: {
type: 'value', type: 'value',
show: false show: false,
minInterval: 1
}, },
yAxis: { yAxis: {
type: 'category', type: 'category',
@ -118,7 +122,6 @@ export default {
this.chart.setOption(this.option); this.chart.setOption(this.option);
}, },
async loadExamData(mapName) { async loadExamData(mapName) {
this.option.title.text = '所属用户剩余权限分布图';
if (mapName) { if (mapName) {
var data = {}; var data = {};
var list = this.permissionList.filter(elem => { return elem.mapName == mapName; }); var list = this.permissionList.filter(elem => { return elem.mapName == mapName; });
@ -133,6 +136,7 @@ export default {
const keys = Object.keys(data); const keys = Object.keys(data);
const values = Object.values(data); const values = Object.values(data);
const sum = keys.length > 0? values.reduce((total, num) => total + num) : 0; const sum = keys.length > 0? values.reduce((total, num) => total + num) : 0;
this.option.title.text = `剩余权限分布图(${mapName}`;
this.option.title.subtext = `权限总计${sum}`; this.option.title.subtext = `权限总计${sum}`;
this.option.xAxis.show = true; this.option.xAxis.show = true;
this.option.yAxis.show = true; this.option.yAxis.show = true;
@ -142,7 +146,8 @@ export default {
} else { } else {
this.option.xAxis.show = false; this.option.xAxis.show = false;
this.option.yAxis.show = false; this.option.yAxis.show = false;
this.option.title.subtext = `暂无数据`; this.option.title.text = `剩余权限分布图(暂无地图线路数据)`;
this.option.title.subtext = `权限总计0个`;
} }
this.chart.setOption(this.option); this.chart.setOption(this.option);

View File

@ -60,6 +60,11 @@ export default {
physicalLevelsSelect: [] physicalLevelsSelect: []
}; };
}, },
watch: {
'$store.state.map.mapDataLoadedCount': function (val) {
this.handleSelectView(this.viewSelect);
}
},
mounted() { mounted() {
this.initPage(); this.initPage();
}, },

View File

@ -6,7 +6,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
/> />
<route-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" /> <route-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" />
</div> </div>
@ -31,7 +30,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
/> />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -111,9 +109,6 @@ export default {
setSelected(selected) { setSelected(selected) {
this.$refs.routeEdit.setSelected(selected); this.$refs.routeEdit.setSelected(selected);
}, },
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
} }

View File

@ -120,9 +120,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
}, },
methods: { methods: {
hover(field) { hover(field) {
@ -142,10 +140,6 @@ export default {
} }
} }
}, },
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
buildModel(code) { buildModel(code) {
const model = Object.assign({}, this.addModel); const model = Object.assign({}, this.addModel);
if (code) { model['code'] = code; } if (code) { model['code'] = code; }

View File

@ -21,12 +21,12 @@
type="text" type="text"
style="float: right; padding: 3px 0; margin-right: 5px;" style="float: right; padding: 3px 0; margin-right: 5px;"
@click="drawMap" @click="drawMap"
>地图绘制</el-button> >{{ $t('map.drawMap') }}</el-button>
<el-button <el-button
type="text" type="text"
style="float: right; padding: 3px 0; margin-right: 5px;" style="float: right; padding: 3px 0; margin-right: 5px;"
@click="showMap" @click="showMap"
>地图显示参数</el-button> >{{ $t('map.viewLayer') }}</el-button>
</div> </div>
<el-tabs v-model="enabledTab" type="card" @tab-click="changePane"> <el-tabs v-model="enabledTab" type="card" @tab-click="changePane">
<el-tab-pane label="进路" name="route"> <el-tab-pane label="进路" name="route">
@ -35,7 +35,6 @@
:card-height="cardHeight+25" :card-height="cardHeight+25"
:map-info="mapInfo" :map-info="mapInfo"
:selected="selected" :selected="selected"
@handleSelectView="handleSelectView"
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
@ -45,7 +44,6 @@
:card-height="cardHeight+25" :card-height="cardHeight+25"
:map-info="mapInfo" :map-info="mapInfo"
:selected="selected" :selected="selected"
@handleSelectView="handleSelectView"
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
@ -55,7 +53,6 @@
:card-height="cardHeight+25" :card-height="cardHeight+25"
:map-info="mapInfo" :map-info="mapInfo"
:selected="selected" :selected="selected"
@handleSelectView="handleSelectView"
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
@ -65,7 +62,6 @@
:card-height="cardHeight+25" :card-height="cardHeight+25"
:map-info="mapInfo" :map-info="mapInfo"
:selected="selected" :selected="selected"
@handleSelectView="handleSelectView"
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
@ -75,7 +71,6 @@
:card-height="cardHeight+25" :card-height="cardHeight+25"
:map-info="mapInfo" :map-info="mapInfo"
:selected="selected" :selected="selected"
@handleSelectView="handleSelectView"
@setCenter="setCenter" @setCenter="setCenter"
/> />
</el-tab-pane> </el-tab-pane>
@ -199,9 +194,6 @@ export default {
break; break;
} }
}, },
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
}, },

View File

@ -6,7 +6,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
/> />
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" /> <route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
<!-- <div class="mapControl"> <!-- <div class="mapControl">
@ -27,7 +26,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
/> />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -107,9 +105,6 @@ export default {
setSelected(selected) { setSelected(selected) {
this.$refs.routeEdit.setSelected(selected); this.$refs.routeEdit.setSelected(selected);
}, },
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
} }

View File

@ -194,9 +194,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
this.rowDrop(); this.rowDrop();
}, },
methods: { methods: {
@ -290,10 +287,6 @@ export default {
]; ];
} }
}, },
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
clear() { clear() {
if (this.$refs && this.$refs.form && this.mapInfo) { if (this.$refs && this.$refs.form && this.mapInfo) {
delete this.addModel.id; delete this.addModel.id;

View File

@ -6,41 +6,10 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
@setCenter="setCenter" @setCenter="setCenter"
/> />
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" /> <route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
</div> </div>
<!-- <transition name="el-zoom-in-center">
<div class="mapControl">
<el-card>
<div slot="header" class="clearfix">
<span>
地图名称
<b>{{ mapInfo.name }}</b>
</span>
<el-button type="text" style="float: right; padding: 3px 3px" @click="previewRouteEvent">预览
</el-button>
<el-button type="text" style="float: right; padding: 3px 3px" @click="createRouteEvent">创建
</el-button>
</div>
<el-tabs v-model="enabledTab" type="card">
<el-tab-pane label="进路" name="Route">
<route-draft
ref="routeEdit"
:selected="selected"
:map-info="mapInfo"
:route-data="routeData"
:card-height="cardHeight"
@handleSelectView="handleSelectView"
@setCenter="setCenter"
/>
</el-tab-pane>
</el-tabs>
</el-card>
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
</div>
</transition> -->
</template> </template>
<script> <script>
import RouteDraft from './route'; import RouteDraft from './route';
@ -113,9 +82,6 @@ export default {
setSelected(selected) { setSelected(selected) {
this.$refs.routeEdit.setSelected(selected); this.$refs.routeEdit.setSelected(selected);
}, },
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
} }

View File

@ -334,7 +334,7 @@
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { getUID } from '@/jmap/utils/Uid'; import { getUID } from '@/jmap/utils/Uid';
import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft'; import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic'; // import { ViewMode } from '@/scripts/ConstDic';
export default { export default {
name: 'RouteOperation', name: 'RouteOperation',
@ -487,9 +487,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
this.$Dictionary.routeNatureType().then(list => { this.$Dictionary.routeNatureType().then(list => {
this.RouteNatureTypeList = list; this.RouteNatureTypeList = list;
}); });
@ -514,10 +511,6 @@ export default {
deviceChange(code) { deviceChange(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
}, },
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
}, },

View File

@ -6,7 +6,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
/> />
<route-detail ref="routeDetail" :map-info="mapInfo" @routingSelected="routingSelected" /> <route-detail ref="routeDetail" :map-info="mapInfo" @routingSelected="routingSelected" />
</div> </div>
@ -31,7 +30,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
/> />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -111,9 +109,6 @@ export default {
setSelected(selected) { setSelected(selected) {
this.$refs.routeEdit.setSelected(selected); this.$refs.routeEdit.setSelected(selected);
}, },
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
} }

View File

@ -257,9 +257,6 @@ export default {
} }
}, },
mounted() { mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
this.rowDrop(); this.rowDrop();
}, },
methods: { methods: {
@ -312,10 +309,6 @@ export default {
deleteSection(list, index) { deleteSection(list, index) {
list.splice(index, 1); list.splice(index, 1);
}, },
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
buildModel(code) { buildModel(code) {
this.addModel.routingSectionList.forEach((elem, index) => { this.addModel.routingSectionList.forEach((elem, index) => {
elem['orderNum'] = index + 1; elem['orderNum'] = index + 1;

View File

@ -6,7 +6,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
/> />
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" /> <route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
</div> </div>
@ -29,7 +28,6 @@
:map-info="mapInfo" :map-info="mapInfo"
:route-data="routeData" :route-data="routeData"
:card-height="cardHeight" :card-height="cardHeight"
@handleSelectView="handleSelectView"
/> />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -109,9 +107,6 @@ export default {
setSelected(selected) { setSelected(selected) {
this.$refs.routeEdit.setSelected(selected); this.$refs.routeEdit.setSelected(selected);
}, },
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
setCenter(code) { setCenter(code) {
this.$emit('setCenter', code); this.$emit('setCenter', code);
} }

View File

@ -38,7 +38,7 @@
<script> <script>
import { mapGetters } from 'vuex'; import { mapGetters } from 'vuex';
import { createLinkageSwitch } from '@/api/jmap/mapdraft'; import { createLinkageSwitch } from '@/api/jmap/mapdraft';
import { ViewMode } from '@/scripts/ConstDic'; // import { ViewMode } from '@/scripts/ConstDic';
export default { export default {
name: 'RouteOperation', name: 'RouteOperation',
@ -141,15 +141,8 @@ export default {
} }
}, },
mounted() { mounted() {
this.$nextTick(() => {
this.handleSelectView(ViewMode.PHYSICAL);
});
}, },
methods: { methods: {
//
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
hover(field) { hover(field) {
this.field = field === this.field ? '' : field; this.field = field === this.field ? '' : field;
}, },

View File

@ -15,7 +15,6 @@
@hook:mounted="loading = false" @hook:mounted="loading = false"
@handleSelectLogicalView="handleSelectLogicalView" @handleSelectLogicalView="handleSelectLogicalView"
@handleSelectPhysicalView="handleSelectPhysicalView" @handleSelectPhysicalView="handleSelectPhysicalView"
@handleSelectView="handleSelectView"
@saveMapEvent="saveMapEvent" @saveMapEvent="saveMapEvent"
@verifyMapEvent="verifyMapEvent" @verifyMapEvent="verifyMapEvent"
@addOrUpdateMapModel="addOrUpdateMapModel" @addOrUpdateMapModel="addOrUpdateMapModel"
@ -31,7 +30,6 @@
:card-height="cardHeight" :card-height="cardHeight"
:map-info="mapInfo" :map-info="mapInfo"
:selected="selected" :selected="selected"
@handleSelectView="handleSelectView"
@selectView="selectViewDraft" @selectView="selectViewDraft"
@hook:mounted="loading = false" @hook:mounted="loading = false"
@showMap="showMap" @showMap="showMap"
@ -74,6 +72,7 @@ export default {
], ],
data() { data() {
return { return {
viewSelect: ViewMode.MIX,
mapSaveing: false, mapSaveing: false,
cardHeight: 400, cardHeight: 400,
ViewMode: ViewMode, ViewMode: ViewMode,
@ -88,6 +87,9 @@ export default {
watch: { watch: {
'$store.state.map.mapDataLoadedCount': function (val) { '$store.state.map.mapDataLoadedCount': function (val) {
this.initAutoSaveTask(); this.initAutoSaveTask();
},
$route() {
this.loadInitPage();
} }
}, },
mounted() { mounted() {

View File

@ -25,12 +25,12 @@
type="text" type="text"
style="float: right; padding: 3px 0; margin-right: 5px;" style="float: right; padding: 3px 0; margin-right: 5px;"
@click="dataRelation" @click="dataRelation"
>构建数据关系</el-button> >{{ $t('map.advanced') }}</el-button>
<el-button <el-button
type="text" type="text"
style="float: right; padding: 3px 0; margin-right: 5px;" style="float: right; padding: 3px 0; margin-right: 5px;"
@click="showMap" @click="showMap"
>地图显示参数</el-button> >{{ $t('map.viewLayer') }}</el-button>
</div> </div>
<el-tabs v-model="enabledTab" type="card"> <el-tabs v-model="enabledTab" type="card">
<el-tab-pane :label="$t('map.link')" name="Link"> <el-tab-pane :label="$t('map.link')" name="Link">
@ -283,7 +283,6 @@ export default {
], ],
logicalLevelsSelect: [], logicalLevelsSelect: [],
physicalLevelsSelect: [], physicalLevelsSelect: [],
viewSelect: ViewMode.MIX,
enabledTab: 'Link', enabledTab: 'Link',
autoSaveTask: null, autoSaveTask: null,
show: { show: {
@ -299,12 +298,6 @@ export default {
} }
}, },
watch: { watch: {
'$store.state.map.mapDataLoadedCount': function (val) {
this.handleSelectView(this.viewSelect);
},
viewSelect: function (val) {
this.resizeCardHeight();
},
cardHeight: function (val) { cardHeight: function (val) {
this.resizeCardHeight(); this.resizeCardHeight();
} }
@ -312,9 +305,6 @@ export default {
mounted() { mounted() {
this.resizeCardHeight(); this.resizeCardHeight();
this.initPage(); this.initPage();
this.$nextTick(() => {
this.handleSelectView(ViewMode.MIX);
});
}, },
methods: { methods: {
dataRelation() { dataRelation() {
@ -339,12 +329,7 @@ export default {
}, },
resizeCardHeight() { resizeCardHeight() {
var padding = 0; var padding = 0;
if (this.viewSelect === ViewMode.PHYSICAL) { this.cardHeights = this.cardHeight - padding - 90;
padding = 118;
} else if (this.viewSelect === ViewMode.LOGIC) {
padding = 20;
}
this.cardHeights = this.cardHeight - padding - 130;
}, },
handleSelectControlPage(device) { handleSelectControlPage(device) {
const type = device._type; const type = device._type;
@ -354,9 +339,6 @@ export default {
this.enabledTab = type; this.enabledTab = type;
} }
}, },
handleSelectView(handle) {
this.$emit('handleSelectView', handle);
},
handleSelectLogicalView(handle) { handleSelectLogicalView(handle) {
this.$emit('handleSelectLogicalView', handle); this.$emit('handleSelectLogicalView', handle);
}, },

View File

@ -4,12 +4,19 @@
<span>{{ $t('map.sketchMap') }}</span> <span>{{ $t('map.sketchMap') }}</span>
<el-button type="text" style="float: right; padding: 3px 0" @click="createMap">{{ $t('map.newConstruction') }}</el-button> <el-button type="text" style="float: right; padding: 3px 0" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
<el-button type="text" class="uploadDemo"> <el-button type="text" class="uploadDemo">
<input <!-- <input
ref="files" ref="files"
type="file" type="file"
class="file_box" class="file_box"
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
@change="importf" @change="importf"
> -->
<input
ref="files"
type="file"
class="file_box"
accept=".json, application/json"
@change="importf"
> >
{{ $t('map.importMap') }} {{ $t('map.importMap') }}
</el-button> </el-button>
@ -48,14 +55,14 @@
<script> <script>
import { DeviceMenu } from '@/scripts/ConstDic'; import { DeviceMenu } from '@/scripts/ConstDic';
import { getMapTree, getMapDetail, postBuildMapImport } from '@/api/jmap/mapdraft'; import { getMapTree, getMapDetail, postBuildMapImport } from '@/api/jmap/mapdraft';
// import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import { translate, translateSheetTitle } from '@/scripts/translate'; import { translate, translateSheetTitle } from '@/scripts/translate';
import { sheet_to_json } from '@/utils/Export2Excel'; // import { sheet_to_json } from '@/utils/Export2Excel';
// import PopMenu from '@/components/PopMenu'; // import PopMenu from '@/components/PopMenu';
import MapOperateMenu from './operateMenu'; import MapOperateMenu from './operateMenu';
import MapCreate from './create'; import MapCreate from './create';
import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import XLSX from 'xlsx'; // import XLSX from 'xlsx';
export default { export default {
name: 'MapListDraft', name: 'MapListDraft',
@ -118,14 +125,14 @@ export default {
if (obj && obj.type == 'map') { if (obj && obj.type == 'map') {
this.editModel = obj; this.editModel = obj;
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null }); this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
// this.mapSelected({ view: 'draft' }); this.mapSelected({ view: 'draft' });
}
},
mapSelected(data) {
if (data && this.editModel) {
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
} }
}, },
// mapSelected(data) {
// if (data && this.editModel) {
// this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
// }
// },
jlmap3d() { jlmap3d() {
this.$router.push({ path: '/jlmap3d/edit', query: { mapid: this.editModel.id } }); this.$router.push({ path: '/jlmap3d/edit', query: { mapid: this.editModel.id } });
}, },
@ -145,65 +152,94 @@ export default {
}); });
}, },
importf() { // importf() {
// const loading = this.$loading({
// lock: true,
// text: '...',
// spinner: 'el-icon-loading',
// background: 'rgba(0, 0, 0, 0.7)'
// });
// const obj = this.$refs.files;
// let wb;
// if (!obj.files) return;
// const f = obj.files[0];
// const reader = new FileReader();
// const that = this;
// reader.onload = function (e) {
// const data = e.target.result;
// if (that.rABS) {
// wb = XLSX.read(btoa(that.fixdata(data)), {//
// type: 'base64'
// });
// } else {
// wb = XLSX.read(data, {
// type: 'binary'
// });
// }
// const resultJSONData = { 'devices': {} };
// for (const index in wb.Sheets) {
// const titleNum = that.formatSheetTitle(index);
// const key = translateSheetTitle.sheetName[titleNum];
// const filterVal = that.handelData(key);
// const jsonData = sheet_to_json(wb.Sheets[index]);
// const data = that.formatJson(filterVal, jsonData, key);
// if (key === 'base') {
// Object.assign(resultJSONData, data[0]);
// } else if (key === 'skinVO') {
// resultJSONData['devices'][key] = data[0];
// } else {
// resultJSONData['devices'][key] = data;
// }
// }
// that.resultJSON = resultJSONData;
// if (that.resultJSON) {
// postBuildMapImport(that.resultJSON).then(res => {
// loading.close();
// that.$message.success('');
// that.refresh();
// }).catch(error => {
// loading.close();
// that.$message.error('' + error.message);
// });
// }
// obj.value = ''; //
// };
// if (that.rABS) {
// reader.readAsArrayBuffer(f);
// } else {
// reader.readAsBinaryString(f);
// }
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: '正在导入中...', text: '正在导入中...',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)' background: 'rgba(0, 0, 0, 0.7)'
}); });
setTimeout(() => {
const obj = this.$refs.files; const obj = this.$refs.files;
let wb;
if (!obj.files) return; if (!obj.files) return;
const f = obj.files[0]; const f = obj.files[0];
const reader = new FileReader(); const reader = new FileReader();
const that = this; const that = this;
reader.onload = function (e) { reader.readAsText(f, 'utf-8');
reader.onload = function(e) {
const data = e.target.result; const data = e.target.result;
if (that.rABS) { postBuildMapImport(JSON.parse(data)).then(res => {
wb = XLSX.read(btoa(that.fixdata(data)), {//
type: 'base64'
});
} else {
wb = XLSX.read(data, {
type: 'binary'
});
}
const resultJSONData = { 'devices': {} };
for (const index in wb.Sheets) {
const titleNum = that.formatSheetTitle(index);
const key = translateSheetTitle.sheetName[titleNum];
const filterVal = that.handelData(key);
const jsonData = sheet_to_json(wb.Sheets[index]);
const data = that.formatJson(filterVal, jsonData, key);
if (key === 'base') {
Object.assign(resultJSONData, data[0]);
} else if (key === 'skinVO') {
resultJSONData['devices'][key] = data[0];
} else {
resultJSONData['devices'][key] = data;
}
}
that.resultJSON = resultJSONData;
if (that.resultJSON) {
postBuildMapImport(that.resultJSON).then(res => {
loading.close(); loading.close();
that.$message.success('导入成功!'); that.$message.success('导入成功!');
that.refresh(); that.refresh();
loading.close();
}).catch(error => { }).catch(error => {
loading.close(); loading.close();
that.$message.error('导入失败' + error.message); that.$message.error('导入失败' + error.message);
}); });
} obj.value = '';
obj.value = ''; //
}; };
if (that.rABS) { });
reader.readAsArrayBuffer(f);
} else {
reader.readAsBinaryString(f);
}
}, },
// //
handelData(key) { handelData(key) {

View File

@ -38,10 +38,10 @@ export default {
data() { data() {
return { return {
menu1: [ menu1: [
{ // {
label: this.$t('map.createOperationGraph'), // label: this.$t('map.createOperationGraph'),
handler: this.createChart // handler: this.createChart
}, // },
{ {
label: this.$t('map.importOperationGraph'), label: this.$t('map.importOperationGraph'),
handler: this.importChart, handler: this.importChart,

View File

@ -12,7 +12,7 @@
<status-bar ref="statusBar" @dispatchDialog="dispatchDialog" @showTrain="showTrain" /> <status-bar ref="statusBar" @dispatchDialog="dispatchDialog" @showTrain="showTrain" />
<open-run-plan ref="openRunPlan" :skin-code="skinCode" @dispatchDialog="dispatchDialog" /> <open-run-plan ref="openRunPlan" :skin-code="skinCode" @dispatchDialog="dispatchDialog" />
<create-empty-plan ref="createEmptyPlan" @dispatchOperate="dispatchOperate" /> <create-empty-plan ref="createEmptyPlan" @dispatchOperate="dispatchOperate" @dispatchDialog="dispatchDialog" />
<parameter ref="parameter" /> <parameter ref="parameter" />
<off-line ref="offLine" @handleConfirm="handleConfirm" @dispatchDialog="dispatchDialog" /> <off-line ref="offLine" @handleConfirm="handleConfirm" @dispatchDialog="dispatchDialog" />
<add-planning-train ref="addPlanningTrain" @dispatchDialog="dispatchDialog" /> <add-planning-train ref="addPlanningTrain" @dispatchDialog="dispatchDialog" />

View File

@ -11,7 +11,7 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<el-row> <el-row>
<el-col :span="6" :offset="3" style="height: 30px; line-height: 30px;">服务号</el-col> <el-col :span="6" :offset="2" style="height: 30px; line-height: 30px;">服务号</el-col>
<el-col :span="10" :offset="1"> <el-col :span="10" :offset="1">
<el-input v-model="serviceNumber" size="mini" /> <el-input v-model="serviceNumber" size="mini" />
</el-col> </el-col>

View File

@ -72,6 +72,7 @@ export default {
}; };
this.$emit('dispatchOperate', params); this.$emit('dispatchOperate', params);
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {} });
this.$message.success('创建空运行图成功!'); this.$message.success('创建空运行图成功!');
this.doClose(); this.doClose();
}).catch(() => { }).catch(() => {

View File

@ -89,10 +89,10 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-row> </el-row>
<el-button type="flex" justify="center" class="button-group"> <div class="button-group" style="text-align: center; margin-top: 10px;">
<el-button @click="handleSave">保存</el-button> <el-button @click="handleSave">保存</el-button>
<el-button @click="doClose">取消&退出</el-button> <el-button @click="doClose">取消&退出</el-button>
</el-button> </div>
<update-station-interval-time ref="updateStationIntervalTime" @handleConfirm="handleConfirm" /> <update-station-interval-time ref="updateStationIntervalTime" @handleConfirm="handleConfirm" />
</el-dialog> </el-dialog>
</template> </template>

View File

@ -202,14 +202,24 @@ export default {
if (resultData === false) { if (resultData === false) {
return; return;
} }
const self = this;
import('@/utils/Export2Excel').then(excel => { // const self = this;
self.queryExportData(resultData).then(data => { // import('@/utils/Export2Excel').then(excel => {
excel.export_json_excel(data, resultData.name); // self.queryExportData(resultData).then(data => {
}).catch(error => { // excel.export_json_excel(data, resultData.name);
self.$message.error('导出执行异常:' + error.message); // }).catch(error => {
}); // self.$message.error('' + error.message);
}); // });
// });
const content = new Blob([JSON.stringify(resultData)]);
const urlObject = window.URL || window.webkitURL || window;
const url = urlObject.createObjectURL(content);
const el = document.createElement('a');
el.href = url;
el.download =`${resultData.name}.json`;
el.click();
urlObject.revokeObjectURL(url);
}, },
// //