Merge branch 'dev' of https://git.cloud.tencent.com/joylink/jl-nclient into dev
This commit is contained in:
commit
8e401afe36
@ -17,6 +17,9 @@ export default {
|
||||
add: '添加',
|
||||
are: '是',
|
||||
deny: '否',
|
||||
drawMap: '绘图',
|
||||
advanced: '高级',
|
||||
viewLayer: '视图图层',
|
||||
|
||||
save: '保存',
|
||||
updata: '更新',
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<div :id="id" :style="{height: size.height+'px', width: size.width+'px'}" />
|
||||
<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-select>
|
||||
</div>
|
||||
@ -32,6 +32,9 @@ export default {
|
||||
title: {
|
||||
text: '',
|
||||
subtext: '',
|
||||
subtextStyle: {
|
||||
color: '#909399'
|
||||
},
|
||||
y: 10,
|
||||
left: 'center',
|
||||
textAlign: 'center'
|
||||
@ -47,7 +50,8 @@ export default {
|
||||
}],
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
show: false
|
||||
show: false,
|
||||
minInterval: 1
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
@ -118,7 +122,6 @@ export default {
|
||||
this.chart.setOption(this.option);
|
||||
},
|
||||
async loadExamData(mapName) {
|
||||
this.option.title.text = '所属用户剩余权限分布图';
|
||||
if (mapName) {
|
||||
var data = {};
|
||||
var list = this.permissionList.filter(elem => { return elem.mapName == mapName; });
|
||||
@ -133,6 +136,7 @@ export default {
|
||||
const keys = Object.keys(data);
|
||||
const values = Object.values(data);
|
||||
const sum = keys.length > 0? values.reduce((total, num) => total + num) : 0;
|
||||
this.option.title.text = `剩余权限分布图(${mapName})`;
|
||||
this.option.title.subtext = `权限总计${sum}个`;
|
||||
this.option.xAxis.show = true;
|
||||
this.option.yAxis.show = true;
|
||||
@ -142,7 +146,8 @@ export default {
|
||||
} else {
|
||||
this.option.xAxis.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);
|
||||
|
@ -60,6 +60,11 @@ export default {
|
||||
physicalLevelsSelect: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapDataLoadedCount': function (val) {
|
||||
this.handleSelectView(this.viewSelect);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.initPage();
|
||||
},
|
||||
|
@ -6,7 +6,6 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
/>
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @autoMaticoSelected="autoMaticoSelected" />
|
||||
</div>
|
||||
@ -31,7 +30,6 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -111,9 +109,6 @@ export default {
|
||||
setSelected(selected) {
|
||||
this.$refs.routeEdit.setSelected(selected);
|
||||
},
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
setCenter(code) {
|
||||
this.$emit('setCenter', code);
|
||||
}
|
||||
|
@ -120,9 +120,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.handleSelectView(ViewMode.PHYSICAL);
|
||||
});
|
||||
|
||||
},
|
||||
methods: {
|
||||
hover(field) {
|
||||
@ -142,10 +140,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
// 切换地图属性
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
buildModel(code) {
|
||||
const model = Object.assign({}, this.addModel);
|
||||
if (code) { model['code'] = code; }
|
||||
|
@ -21,12 +21,12 @@
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0; margin-right: 5px;"
|
||||
@click="drawMap"
|
||||
>地图绘制</el-button>
|
||||
>{{ $t('map.drawMap') }}</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0; margin-right: 5px;"
|
||||
@click="showMap"
|
||||
>地图显示参数</el-button>
|
||||
>{{ $t('map.viewLayer') }}</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="enabledTab" type="card" @tab-click="changePane">
|
||||
<el-tab-pane label="进路" name="route">
|
||||
@ -35,7 +35,6 @@
|
||||
:card-height="cardHeight+25"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@handleSelectView="handleSelectView"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -45,7 +44,6 @@
|
||||
:card-height="cardHeight+25"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@handleSelectView="handleSelectView"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -55,7 +53,6 @@
|
||||
:card-height="cardHeight+25"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@handleSelectView="handleSelectView"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -65,7 +62,6 @@
|
||||
:card-height="cardHeight+25"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@handleSelectView="handleSelectView"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -75,7 +71,6 @@
|
||||
:card-height="cardHeight+25"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@handleSelectView="handleSelectView"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
@ -199,9 +194,6 @@ export default {
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
setCenter(code) {
|
||||
this.$emit('setCenter', code);
|
||||
},
|
||||
|
@ -6,7 +6,6 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
/>
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
|
||||
<!-- <div class="mapControl">
|
||||
@ -27,7 +26,6 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -107,9 +105,6 @@ export default {
|
||||
setSelected(selected) {
|
||||
this.$refs.routeEdit.setSelected(selected);
|
||||
},
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
setCenter(code) {
|
||||
this.$emit('setCenter', code);
|
||||
}
|
||||
|
@ -194,9 +194,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.handleSelectView(ViewMode.PHYSICAL);
|
||||
});
|
||||
this.rowDrop();
|
||||
},
|
||||
methods: {
|
||||
@ -290,10 +287,6 @@ export default {
|
||||
];
|
||||
}
|
||||
},
|
||||
// 切换地图属性
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
clear() {
|
||||
if (this.$refs && this.$refs.form && this.mapInfo) {
|
||||
delete this.addModel.id;
|
||||
|
@ -6,41 +6,10 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
@setCenter="setCenter"
|
||||
/>
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
|
||||
</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>
|
||||
<script>
|
||||
import RouteDraft from './route';
|
||||
@ -113,9 +82,6 @@ export default {
|
||||
setSelected(selected) {
|
||||
this.$refs.routeEdit.setSelected(selected);
|
||||
},
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
setCenter(code) {
|
||||
this.$emit('setCenter', code);
|
||||
}
|
||||
|
@ -334,7 +334,7 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import { getUID } from '@/jmap/utils/Uid';
|
||||
import { createRouteRoute, updateRouteRoute } from '@/api/jmap/mapdraft';
|
||||
import { ViewMode } from '@/scripts/ConstDic';
|
||||
// import { ViewMode } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'RouteOperation',
|
||||
@ -487,9 +487,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.handleSelectView(ViewMode.PHYSICAL);
|
||||
});
|
||||
this.$Dictionary.routeNatureType().then(list => {
|
||||
this.RouteNatureTypeList = list;
|
||||
});
|
||||
@ -514,10 +511,6 @@ export default {
|
||||
deviceChange(code) {
|
||||
this.$emit('setCenter', code);
|
||||
},
|
||||
// 切换地图属性
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
},
|
||||
|
@ -6,7 +6,6 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
/>
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @routingSelected="routingSelected" />
|
||||
</div>
|
||||
@ -31,7 +30,6 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -111,9 +109,6 @@ export default {
|
||||
setSelected(selected) {
|
||||
this.$refs.routeEdit.setSelected(selected);
|
||||
},
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
setCenter(code) {
|
||||
this.$emit('setCenter', code);
|
||||
}
|
||||
|
@ -257,9 +257,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.handleSelectView(ViewMode.PHYSICAL);
|
||||
});
|
||||
this.rowDrop();
|
||||
},
|
||||
methods: {
|
||||
@ -312,10 +309,6 @@ export default {
|
||||
deleteSection(list, index) {
|
||||
list.splice(index, 1);
|
||||
},
|
||||
// 切换地图属性
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
buildModel(code) {
|
||||
this.addModel.routingSectionList.forEach((elem, index) => {
|
||||
elem['orderNum'] = index + 1;
|
||||
|
@ -6,7 +6,6 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
/>
|
||||
<route-detail ref="routeDetail" :map-info="mapInfo" @routeSelected="routeSelected" />
|
||||
</div>
|
||||
@ -29,7 +28,6 @@
|
||||
:map-info="mapInfo"
|
||||
:route-data="routeData"
|
||||
:card-height="cardHeight"
|
||||
@handleSelectView="handleSelectView"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@ -109,9 +107,6 @@ export default {
|
||||
setSelected(selected) {
|
||||
this.$refs.routeEdit.setSelected(selected);
|
||||
},
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
setCenter(code) {
|
||||
this.$emit('setCenter', code);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { createLinkageSwitch } from '@/api/jmap/mapdraft';
|
||||
import { ViewMode } from '@/scripts/ConstDic';
|
||||
// import { ViewMode } from '@/scripts/ConstDic';
|
||||
|
||||
export default {
|
||||
name: 'RouteOperation',
|
||||
@ -141,15 +141,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.handleSelectView(ViewMode.PHYSICAL);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
// 切换地图属性
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
hover(field) {
|
||||
this.field = field === this.field ? '' : field;
|
||||
},
|
||||
|
@ -15,7 +15,6 @@
|
||||
@hook:mounted="loading = false"
|
||||
@handleSelectLogicalView="handleSelectLogicalView"
|
||||
@handleSelectPhysicalView="handleSelectPhysicalView"
|
||||
@handleSelectView="handleSelectView"
|
||||
@saveMapEvent="saveMapEvent"
|
||||
@verifyMapEvent="verifyMapEvent"
|
||||
@addOrUpdateMapModel="addOrUpdateMapModel"
|
||||
@ -31,7 +30,6 @@
|
||||
:card-height="cardHeight"
|
||||
:map-info="mapInfo"
|
||||
:selected="selected"
|
||||
@handleSelectView="handleSelectView"
|
||||
@selectView="selectViewDraft"
|
||||
@hook:mounted="loading = false"
|
||||
@showMap="showMap"
|
||||
@ -74,6 +72,7 @@ export default {
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
viewSelect: ViewMode.MIX,
|
||||
mapSaveing: false,
|
||||
cardHeight: 400,
|
||||
ViewMode: ViewMode,
|
||||
@ -88,6 +87,9 @@ export default {
|
||||
watch: {
|
||||
'$store.state.map.mapDataLoadedCount': function (val) {
|
||||
this.initAutoSaveTask();
|
||||
},
|
||||
$route() {
|
||||
this.loadInitPage();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -25,12 +25,12 @@
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0; margin-right: 5px;"
|
||||
@click="dataRelation"
|
||||
>构建数据关系</el-button>
|
||||
>{{ $t('map.advanced') }}</el-button>
|
||||
<el-button
|
||||
type="text"
|
||||
style="float: right; padding: 3px 0; margin-right: 5px;"
|
||||
@click="showMap"
|
||||
>地图显示参数</el-button>
|
||||
>{{ $t('map.viewLayer') }}</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="enabledTab" type="card">
|
||||
<el-tab-pane :label="$t('map.link')" name="Link">
|
||||
@ -283,7 +283,6 @@ export default {
|
||||
],
|
||||
logicalLevelsSelect: [],
|
||||
physicalLevelsSelect: [],
|
||||
viewSelect: ViewMode.MIX,
|
||||
enabledTab: 'Link',
|
||||
autoSaveTask: null,
|
||||
show: {
|
||||
@ -299,12 +298,6 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'$store.state.map.mapDataLoadedCount': function (val) {
|
||||
this.handleSelectView(this.viewSelect);
|
||||
},
|
||||
viewSelect: function (val) {
|
||||
this.resizeCardHeight();
|
||||
},
|
||||
cardHeight: function (val) {
|
||||
this.resizeCardHeight();
|
||||
}
|
||||
@ -312,9 +305,6 @@ export default {
|
||||
mounted() {
|
||||
this.resizeCardHeight();
|
||||
this.initPage();
|
||||
this.$nextTick(() => {
|
||||
this.handleSelectView(ViewMode.MIX);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
dataRelation() {
|
||||
@ -339,12 +329,7 @@ export default {
|
||||
},
|
||||
resizeCardHeight() {
|
||||
var padding = 0;
|
||||
if (this.viewSelect === ViewMode.PHYSICAL) {
|
||||
padding = 118;
|
||||
} else if (this.viewSelect === ViewMode.LOGIC) {
|
||||
padding = 20;
|
||||
}
|
||||
this.cardHeights = this.cardHeight - padding - 130;
|
||||
this.cardHeights = this.cardHeight - padding - 90;
|
||||
},
|
||||
handleSelectControlPage(device) {
|
||||
const type = device._type;
|
||||
@ -354,9 +339,6 @@ export default {
|
||||
this.enabledTab = type;
|
||||
}
|
||||
},
|
||||
handleSelectView(handle) {
|
||||
this.$emit('handleSelectView', handle);
|
||||
},
|
||||
handleSelectLogicalView(handle) {
|
||||
this.$emit('handleSelectLogicalView', handle);
|
||||
},
|
||||
|
@ -4,12 +4,19 @@
|
||||
<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" class="uploadDemo">
|
||||
<input
|
||||
<!-- <input
|
||||
ref="files"
|
||||
type="file"
|
||||
class="file_box"
|
||||
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
|
||||
@change="importf"
|
||||
> -->
|
||||
<input
|
||||
ref="files"
|
||||
type="file"
|
||||
class="file_box"
|
||||
accept=".json, application/json"
|
||||
@change="importf"
|
||||
>
|
||||
{{ $t('map.importMap') }}
|
||||
</el-button>
|
||||
@ -48,14 +55,14 @@
|
||||
<script>
|
||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||
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 { sheet_to_json } from '@/utils/Export2Excel';
|
||||
// import { sheet_to_json } from '@/utils/Export2Excel';
|
||||
// import PopMenu from '@/components/PopMenu';
|
||||
import MapOperateMenu from './operateMenu';
|
||||
import MapCreate from './create';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import XLSX from 'xlsx';
|
||||
// import XLSX from 'xlsx';
|
||||
|
||||
export default {
|
||||
name: 'MapListDraft',
|
||||
@ -118,14 +125,14 @@ export default {
|
||||
if (obj && obj.type == 'map') {
|
||||
this.editModel = obj;
|
||||
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() {
|
||||
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({
|
||||
lock: true,
|
||||
text: '正在导入中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
setTimeout(() => {
|
||||
const obj = this.$refs.files;
|
||||
let wb;
|
||||
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;
|
||||
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 => {
|
||||
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 = ''; // 清空上次导入文件
|
||||
obj.value = '';
|
||||
};
|
||||
if (that.rABS) {
|
||||
reader.readAsArrayBuffer(f);
|
||||
} else {
|
||||
reader.readAsBinaryString(f);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
// 转换数据格式
|
||||
handelData(key) {
|
||||
|
@ -38,10 +38,10 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
menu1: [
|
||||
{
|
||||
label: this.$t('map.createOperationGraph'),
|
||||
handler: this.createChart
|
||||
},
|
||||
// {
|
||||
// label: this.$t('map.createOperationGraph'),
|
||||
// handler: this.createChart
|
||||
// },
|
||||
{
|
||||
label: this.$t('map.importOperationGraph'),
|
||||
handler: this.importChart,
|
||||
|
@ -12,7 +12,7 @@
|
||||
<status-bar ref="statusBar" @dispatchDialog="dispatchDialog" @showTrain="showTrain" />
|
||||
|
||||
<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" />
|
||||
<off-line ref="offLine" @handleConfirm="handleConfirm" @dispatchDialog="dispatchDialog" />
|
||||
<add-planning-train ref="addPlanningTrain" @dispatchDialog="dispatchDialog" />
|
||||
|
@ -11,7 +11,7 @@
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<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-input v-model="serviceNumber" size="mini" />
|
||||
</el-col>
|
||||
|
@ -72,6 +72,7 @@ export default {
|
||||
};
|
||||
|
||||
this.$emit('dispatchOperate', params);
|
||||
this.$emit('dispatchDialog', { name: 'openRunPlan', params: {} });
|
||||
this.$message.success('创建空运行图成功!');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
|
@ -89,10 +89,10 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</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="doClose">取消&退出</el-button>
|
||||
</el-button>
|
||||
</div>
|
||||
<update-station-interval-time ref="updateStationIntervalTime" @handleConfirm="handleConfirm" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
@ -202,14 +202,24 @@ export default {
|
||||
if (resultData === false) {
|
||||
return;
|
||||
}
|
||||
const self = this;
|
||||
import('@/utils/Export2Excel').then(excel => {
|
||||
self.queryExportData(resultData).then(data => {
|
||||
excel.export_json_excel(data, resultData.name);
|
||||
}).catch(error => {
|
||||
self.$message.error('导出执行异常:' + error.message);
|
||||
});
|
||||
});
|
||||
|
||||
// const self = this;
|
||||
// import('@/utils/Export2Excel').then(excel => {
|
||||
// self.queryExportData(resultData).then(data => {
|
||||
// excel.export_json_excel(data, resultData.name);
|
||||
// }).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);
|
||||
},
|
||||
|
||||
// 部分导出
|
||||
|
Loading…
Reference in New Issue
Block a user