增加公共地图ibp配置绘图 逻辑
This commit is contained in:
parent
b356187e44
commit
e156bac9ca
54
src/api/ibp.js
Normal file
54
src/api/ibp.js
Normal file
@ -0,0 +1,54 @@
|
||||
|
||||
import request from '@/utils/request';
|
||||
// 创建草稿数据 ibp
|
||||
export function createIbp(params) {
|
||||
return request({
|
||||
url: '/api/draftIbp',
|
||||
method: 'post',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
// 发布IBP盘数据
|
||||
export function postIbpPublish(params) {
|
||||
return request({
|
||||
url: '/api/draftIbp/{id}/publish',
|
||||
method: 'post',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
// 分页查询IBP数据基本信息
|
||||
export function getIbpAllList(mapId, params) {
|
||||
return request({
|
||||
url: '/api/ibp/list/all',
|
||||
method: 'get',
|
||||
param: params
|
||||
});
|
||||
}
|
||||
|
||||
// 更新草稿IBP盘基本信息
|
||||
export function putIbpBasicInfo(id, params) {
|
||||
return request({
|
||||
url: `/api/draftIbp/${id}/basic`,
|
||||
method: 'put',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
// 更新草稿IBP盘绘图数据
|
||||
export function putIbpDrawData(id, params) {
|
||||
return request({
|
||||
url: `/api/draftIbp/${id}/data`,
|
||||
method: 'put',
|
||||
data: params
|
||||
});
|
||||
}
|
||||
|
||||
// 删除草稿IBP盘绘图数据
|
||||
export function deleteIbpInfo(id) {
|
||||
return request({
|
||||
url: `/api/draftIbp/${id}/data`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
@ -58,6 +58,8 @@ const LessonDetail = () => import('@/views/lesson/details');
|
||||
const ScriptmanageHome = () => import('@/views/scriptManage/home');
|
||||
const ScriptDisplay = () => import('@/views/scriptManage/display/index');
|
||||
|
||||
const IbpHome = () => import('@/views/ibp/home');
|
||||
|
||||
const TeachDetail = () => import('@/views/teach/detail/index');
|
||||
const TeachHome = () => import('@/views/teach/index');
|
||||
const Pay = () => import('@/views/components/pay/index');
|
||||
@ -174,7 +176,8 @@ export const UrlConfig = {
|
||||
scriptHome: '/design/script/home',
|
||||
display: '/design/display',
|
||||
mapPreview: '/design/mapPreview',
|
||||
mapPreviewNew: '/design/mapPreviewNew'
|
||||
mapPreviewNew: '/design/mapPreviewNew',
|
||||
ibpHome: '/design/ibp/home'
|
||||
},
|
||||
designUser: {
|
||||
prefix: '/design/userlist/home',
|
||||
@ -433,6 +436,16 @@ export const asyncRouter = [
|
||||
path: 'mapPreviewNew/:mapId',
|
||||
component: MapPreviewNew,
|
||||
hidden: true
|
||||
},
|
||||
{ // ibp列表
|
||||
path: 'ibp/home/:mapId',
|
||||
component: IbpHome,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'ibp/edit',
|
||||
component: IbpDraw,
|
||||
hidden: true
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -784,13 +797,13 @@ export const asyncRouter = [
|
||||
roles: [admin]
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'ibp/edit',
|
||||
component: IbpDraw,
|
||||
meta: {
|
||||
i18n: 'router.ibpDraw'
|
||||
}
|
||||
},
|
||||
// {
|
||||
// path: 'ibp/edit',
|
||||
// component: IbpDraw,
|
||||
// meta: {
|
||||
// i18n: 'router.ibpDraw'
|
||||
// }
|
||||
// },
|
||||
{
|
||||
path: 'dictionary',
|
||||
component: Dictionary,
|
||||
|
@ -516,7 +516,7 @@ const map = {
|
||||
if (map && map.skinVO) {
|
||||
state.map = map;
|
||||
let showConfig = {};
|
||||
if (Vue.prototype.$jlmap && ( typeof(Vue.prototype.$jlmap.getShowConfig) === 'function')) {
|
||||
if (Vue.prototype.$jlmap && ( typeof (Vue.prototype.$jlmap.getShowConfig) === 'function')) {
|
||||
showConfig = Vue.prototype.$jlmap.getShowConfig();
|
||||
}
|
||||
state.mapDevice = parser(map, map.skinVO.code, showConfig);
|
||||
|
@ -5,8 +5,8 @@ export function getBaseUrl() {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
BASE_API = 'http://192.168.3.41:9000'; // 张赛
|
||||
// BASE_API = 'http://192.168.3.82:9000'; // 杜康
|
||||
// BASE_API = 'http://b29z135112.zicp.vip';
|
||||
// BASE_API = 'http://2925963m2a.zicp.vip'; // 杜康
|
||||
|
@ -24,7 +24,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPublishMapInfo, getByGroupStationList } from '@/api/jmap/map';
|
||||
import { getPublishMapInfo } from '@/api/jmap/map';
|
||||
import { getGoodsTryUse } from '@/api/management/goods';
|
||||
import { PermissionType } from '@/scripts/ConstDic';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
|
@ -115,6 +115,11 @@ export default {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'ibpDesign': {
|
||||
setSessionStorage('designType', 'ibpDesign');
|
||||
this.$router.push({ path: `${UrlConfig.design.ibpHome}/${obj.mapId}`, query: {cityCode: obj.cityCode} });
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
async refresh(filterSelect) {
|
||||
@ -160,6 +165,16 @@ export default {
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
);
|
||||
elem.children.push(
|
||||
{
|
||||
id: '5',
|
||||
name: 'IBP盘设计',
|
||||
type: 'ibpDesign',
|
||||
mapId: elem.id,
|
||||
lineCode: elem.lineCode,
|
||||
cityCode: elem.cityCode
|
||||
}
|
||||
);
|
||||
});
|
||||
this.treeData = res.data;
|
||||
this.treeList = this.filterText
|
||||
|
123
src/views/ibp/create.vue
Normal file
123
src/views/ibp/create.vue
Normal file
@ -0,0 +1,123 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-if="!isPut" type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button v-if="isPut" type="primary" @click="putInfo">更新</el-button>
|
||||
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getStationList } from '@/api/runplan';
|
||||
import { createIbp, putIbpBasicInfo } from '@/api/ibp';
|
||||
|
||||
export default {
|
||||
name: 'ScriptDraft',
|
||||
props: {
|
||||
title: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
isPut: false,
|
||||
stationList: [],
|
||||
formModel: {
|
||||
stationCode: ''
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
form() {
|
||||
const form = {
|
||||
labelWidth: '150px',
|
||||
items: [
|
||||
{ prop: 'stationCode', label: '关联站台:', type: 'select', options: this.stationList }
|
||||
]
|
||||
};
|
||||
return form;
|
||||
},
|
||||
rules() {
|
||||
const crules = {
|
||||
stationCode: [
|
||||
{ required: true, message: '请选择', trigger: 'change' }
|
||||
]
|
||||
};
|
||||
return crules;
|
||||
}
|
||||
},
|
||||
async created () {
|
||||
try {
|
||||
const res = await getStationList(this.$route.params.mapId);
|
||||
this.stationList = [];
|
||||
if (res.code == 200) {
|
||||
console.log(res.data);
|
||||
res.data.forEach(station => {
|
||||
const param = {
|
||||
label: station.name,
|
||||
value: station.code
|
||||
};
|
||||
this.stationList.push(param);
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doShow(code) {
|
||||
if (code) {
|
||||
this.formModel.stationCode = code;
|
||||
} else {
|
||||
this.formModel.stationCode = '';
|
||||
}
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doCreate() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
const param = {
|
||||
mapId: this.$route.params.mapId,
|
||||
stationCode: this.formModel.stationCode
|
||||
};
|
||||
createIbp(param).then(resp => {
|
||||
this.$message.success('创建成功');
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`创建失败: ${error.message}`);
|
||||
});
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
putInfo() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
const param = {
|
||||
mapId: this.$route.params.mapId,
|
||||
stationCode: this.formModel.stationCode
|
||||
};
|
||||
putIbpBasicInfo(param).then(resp => {
|
||||
this.$message.success('更新成功');
|
||||
this.$emit('reloadTable');
|
||||
}).catch(error => {
|
||||
this.$messageBox(`更新失败: ${error.message}`);
|
||||
});
|
||||
this.doClose();
|
||||
});
|
||||
},
|
||||
doClose() {
|
||||
this.$refs.dataform.resetForm();
|
||||
this.dialogVisible = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .el-dialog--center .el-dialog__body{
|
||||
padding: 25px 65px 30px 10px;
|
||||
}
|
||||
</style>
|
186
src/views/ibp/home.vue
Normal file
186
src/views/ibp/home.vue
Normal file
@ -0,0 +1,186 @@
|
||||
<template>
|
||||
<div class="joylink-card">
|
||||
<div class="scriptHeader">
|
||||
<div class="scriptList">IBP盘列表</div>
|
||||
<el-button size="small" type="primary" class="createScript" @click="handleCreate">{{ $t('scriptRecord.scriptCreate') }}</el-button>
|
||||
</div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" style="width: 91%;margin-left:4%;margin-top:20px;" />
|
||||
<create-ibp ref="createScript" :title="'创建数据'" @reloadTable="reloadTable" />
|
||||
<create-ibp ref="modifyScript" :title="'修改数据'" @reloadTable="reloadTable" @create="handleConfirmModify" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Cookies from 'js-cookie';
|
||||
import ConstConfig from '@/scripts/ConstConfig';
|
||||
import { postIbpPublish, getIbpAllList, deleteIbpInfo } from '@/api/ibp';
|
||||
import CreateIbp from './create';
|
||||
|
||||
export default {
|
||||
name: 'ScriptDraft',
|
||||
components: {
|
||||
CreateIbp
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '100px',
|
||||
reset: true,
|
||||
show:false
|
||||
},
|
||||
queryList: {
|
||||
query: this.queryFunction,
|
||||
selectCheckShow: false,
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: '关联站台',
|
||||
prop: 'status',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.covertData(row); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: '更新时间',
|
||||
prop: 'updateTime'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('scriptRecord.operate'),
|
||||
width: '400',
|
||||
buttons: [
|
||||
{
|
||||
name: '修改基础信息',
|
||||
handleClick: this.editInfo,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '修改绘图',
|
||||
handleClick: this.handleModify,
|
||||
type: 'primary'
|
||||
},
|
||||
{
|
||||
name: '删除',
|
||||
handleClick: this.deleteScript,
|
||||
type: 'danger'
|
||||
},
|
||||
{
|
||||
name: '发布',
|
||||
handleClick: this.publishScript,
|
||||
type: 'primary'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$route' () {
|
||||
this.reloadTable();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
queryFunction(params) {
|
||||
return getIbpAllList(this.$route.params.mapId, params);
|
||||
},
|
||||
reloadTable() {
|
||||
if (this.queryList && this.queryList.reload) {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
covertData(row) {
|
||||
const releaseReview = ConstConfig.ConstSelect.releaseReview;
|
||||
const lastData = Object.assign({}, row);
|
||||
if (Cookies.get('user_lang') == 'en') {
|
||||
releaseReview.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
if (lastData.status == rolename) {
|
||||
lastData.status = element.enlabel;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
releaseReview.forEach(function(element) {
|
||||
const rolename = element.value;
|
||||
if (lastData.status == rolename) {
|
||||
lastData.status = element.label;
|
||||
}
|
||||
});
|
||||
}
|
||||
return lastData.status;
|
||||
},
|
||||
// 进入绘图数据
|
||||
handleModify(index, row) {
|
||||
const query = { mapId: this.$route.params.mapId, stationCode: '33333' };
|
||||
this.$router.push({ path: `/design/ibp/edit`, query: query });
|
||||
},
|
||||
// 更新
|
||||
editInfo(index, row) {
|
||||
this.$refs.modifyScript.doShow(row.code);
|
||||
},
|
||||
// 创建
|
||||
handleCreate() {
|
||||
this.$refs.createScript.doShow(null);
|
||||
},
|
||||
// 发布
|
||||
publishScript(index, row) {
|
||||
this.$confirm('您确定发布,此条IBP盘数据', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
postIbpPublish(row.id).then(response => {
|
||||
this.$message.success('发布成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.$messageBox('发布失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
},
|
||||
// 删除此条数据
|
||||
deleteScript(index, row) {
|
||||
this.$confirm('您确定是否删除,此条IBP盘数据', this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deleteIbpInfo(row.id).then(response => {
|
||||
this.$message.success('删除成功');
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.$messageBox('删除失败');
|
||||
});
|
||||
}).catch(() => { });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
.joylink-card{
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.createScript{
|
||||
float: right;
|
||||
margin-right:20px;
|
||||
}
|
||||
.scriptHeader{
|
||||
display:inline-block;margin-top:40px;width: 90%;margin-left:5%;
|
||||
}
|
||||
.scriptList{
|
||||
display:inline-block;padding:7px 0px
|
||||
}
|
||||
/deep/.el-button+.el-button {
|
||||
margin-left: 5px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
</style>
|
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div v-loading="loading" class="joylink-card map-list-main">
|
||||
<div class="clearfix">
|
||||
<span>我的iscs系统列表</span>
|
||||
<span>iscs系统列表</span>
|
||||
</div>
|
||||
<div class="text_item">
|
||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||
@ -96,13 +96,13 @@ export default {
|
||||
name: '站台报警',
|
||||
mode: 'fas',
|
||||
id: '11',
|
||||
type: 'interface',
|
||||
type: 'interface'
|
||||
},
|
||||
{
|
||||
name: '站厅报警',
|
||||
mode: 'fas',
|
||||
id: '12',
|
||||
type: 'interface',
|
||||
type: 'interface'
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -122,7 +122,7 @@ export default {
|
||||
name: '屏蔽门',
|
||||
mode: 'psd',
|
||||
id: '31',
|
||||
type: 'interface',
|
||||
type: 'interface'
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -136,13 +136,13 @@ export default {
|
||||
name: '车站控制-站厅',
|
||||
mode: 'cctv',
|
||||
id: '41',
|
||||
type: 'interface',
|
||||
type: 'interface'
|
||||
},
|
||||
{
|
||||
name: '车站控制-站台',
|
||||
mode: 'cctv',
|
||||
id: '42',
|
||||
type: 'interface',
|
||||
type: 'interface'
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -156,7 +156,7 @@ export default {
|
||||
name: '售检票',
|
||||
mode: 'afc',
|
||||
id: '51',
|
||||
type: 'interface',
|
||||
type: 'interface'
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -170,13 +170,13 @@ export default {
|
||||
name: '门禁-站台层',
|
||||
mode: 'acs',
|
||||
id: '61',
|
||||
type: 'interface',
|
||||
type: 'interface'
|
||||
},
|
||||
{
|
||||
name: '门禁-站厅层',
|
||||
mode: 'acs',
|
||||
id: '62',
|
||||
type: 'interface',
|
||||
type: 'interface'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="app-wrapper">
|
||||
<map-create ref="mapCreate" :line-code="lineCode" @refresh="refresh1" />
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :width="widthLeft" @createMap="createMap" />
|
||||
</div>
|
||||
@ -17,12 +18,14 @@ import drapLeft from '@/views/components/drapLeft/index';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import localStore from 'storejs';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import MapCreate from './mapmanage/create';
|
||||
|
||||
export default {
|
||||
name: 'DesignPlatform',
|
||||
components: {
|
||||
demonList,
|
||||
drapLeft
|
||||
drapLeft,
|
||||
MapCreate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -65,6 +68,12 @@ export default {
|
||||
refresh() {
|
||||
this.$refs && this.$refs.demonList && this.$refs.demonList.loadInitData();
|
||||
},
|
||||
refresh1() {
|
||||
this.$refs.demonList.loadInitData();
|
||||
},
|
||||
createMap() {
|
||||
this.$refs.mapCreate.show();
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
|
202
src/views/iscs/iscsDesign/mapmanage/create.vue
Normal file
202
src/views/iscs/iscsDesign/mapmanage/create.vue
Normal file
@ -0,0 +1,202 @@
|
||||
<template>
|
||||
<el-dialog v-dialogDrag v-dialogLoading="loadingUpload" :title="$t('map.createNewMap')" :visible.sync="dialogShow" width="30%" :close-on-click-modal="false" :before-close="handleClose">
|
||||
<div>
|
||||
<el-tabs v-model="activeTab" type="card">
|
||||
<el-tab-pane :label="$t('map.normalCreate')" name="first">
|
||||
<el-form ref="newForm" label-position="right" :model="newModel" label-width="140px" size="mini" :rules="newRules" @submit.native.prevent>
|
||||
<el-form-item :label="$t('map.lineCode')" prop="lineCode">
|
||||
<el-select v-model="newModel.lineCode" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in lineCodeList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
||||
<el-input v-model.trim="newModel.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="$t('map.publishMapCreation')" name="second">
|
||||
<el-form ref="pullForm" label-position="right" :model="pullModel" :rules="pullRules" label-width="140px" size="mini">
|
||||
<el-form-item :label="$t('map.publishMap')+ ':'" prop="id">
|
||||
<el-select v-model="pullModel.id" :placeholder="$t('map.pleaseSelect')">
|
||||
<el-option
|
||||
v-for="item in publishMapList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
||||
<el-input v-model.trim="pullModel.name" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="create">{{ $t('map.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { newMap, newUsePublishMap } from '@/api/jmap/mapdraft';
|
||||
import { getLineCodeList } from '@/api/management/mapline';
|
||||
import { getMapListByProject } from '@/utils/mapList';
|
||||
|
||||
export default {
|
||||
name: 'MapCreate',
|
||||
props: {
|
||||
lineCode: {
|
||||
type: String,
|
||||
default() {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
file: null,
|
||||
rABS: false,
|
||||
loadingUpload: false,
|
||||
resultJSON: {},
|
||||
activeTab: 'first',
|
||||
lineCodeList: [],
|
||||
publishMapList: [],
|
||||
newModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
lineCode: ''
|
||||
},
|
||||
pullModel: {
|
||||
id: '',
|
||||
name: ''
|
||||
},
|
||||
newRules: {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
|
||||
],
|
||||
lineCode: [
|
||||
{ required: true, message: this.$t('rules.pleaseChooseLineCode'), trigger: 'change' }
|
||||
]
|
||||
},
|
||||
pullRules: {
|
||||
id: [
|
||||
{ required: true, message: this.$t('rules.pleaseSelectMapSource'), trigger: 'change' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
cityList: []
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
lineCode(val) {
|
||||
this.newModel.lineCode = val;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
show() {
|
||||
this.dialogShow = true;
|
||||
this.initLoadData();
|
||||
},
|
||||
close() {
|
||||
if (this.$refs.newForm) {
|
||||
this.$refs.newForm.resetFields();
|
||||
}
|
||||
if (this.$refs.pullForm) {
|
||||
this.$refs.pullForm.resetFields();
|
||||
}
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleClose() {
|
||||
this.close();
|
||||
},
|
||||
initLoadData() {
|
||||
this.lineCodeList = [];
|
||||
this.$Dictionary.cityType().then(list => {
|
||||
this.cityList = list;
|
||||
});
|
||||
|
||||
getLineCodeList().then(response => {
|
||||
this.lineCodeList = response.data;
|
||||
});
|
||||
|
||||
// 新地图
|
||||
const drawWay = true;
|
||||
getMapListByProject(drawWay).then(response => {
|
||||
this.publishMapList = response.data;
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('map.failedLoadListPublishedMaps'));
|
||||
});
|
||||
},
|
||||
create() {
|
||||
if (this.activeTab === 'first') {
|
||||
this.$refs['newForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
this.newModel['drawWay'] = true;
|
||||
newMap(this.newModel).then(response => {
|
||||
this.loading = false;
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('map.creatingSuccessful'));
|
||||
this.close();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('map.createFailure'));
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs['pullForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
newUsePublishMap(this.pullModel).then(response => {
|
||||
this.loading = false;
|
||||
this.$emit('refresh');
|
||||
this.$message.success(this.$t('map.creatingSuccessful'));
|
||||
this.close();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('map.createFailure'));
|
||||
this.close();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped rel="stylesheet/scss" lang="scss">
|
||||
.uploadDemo {
|
||||
.el-upload-dragger {
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.file_box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-loading-mask {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
</style>
|
@ -47,24 +47,24 @@
|
||||
ref="iscsText"
|
||||
style="width: 90%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel">
|
||||
</iscs-text>
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="线段" name="IscsLine">
|
||||
<iscs-line
|
||||
ref="iscsLine"
|
||||
style="width: 90%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel">
|
||||
</iscs-line>
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="矩形" name="IscsRect">
|
||||
<iscs-rect
|
||||
ref="iscsRect"
|
||||
style="width: 90%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel">
|
||||
</iscs-rect>
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
|
@ -87,24 +87,24 @@
|
||||
ref="iscsText"
|
||||
style="width: 90%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel">
|
||||
</iscs-text>
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="线段" name="IscsLine">
|
||||
<iscs-line
|
||||
ref="iscsLine"
|
||||
style="width: 90%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel">
|
||||
</iscs-line>
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="矩形" name="IscsRect">
|
||||
<iscs-rect
|
||||
ref="iscsRect"
|
||||
style="width: 90%;"
|
||||
@createDataModel="createDataModel"
|
||||
@deleteDataModel="deleteDataModel">
|
||||
</iscs-rect>
|
||||
@deleteDataModel="deleteDataModel"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
|
@ -33,7 +33,8 @@ import FaultChoose from './demon/faultChoose';
|
||||
import AddQuest from './demon/addQuest';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
// import { getStationList } from '@/api/runplan';
|
||||
import { getByGroupStationList } from '@/api/jmap/map';
|
||||
import { getEveryDayRunPlanNew } from '@/api/simulation';
|
||||
|
||||
// 右上角操作
|
||||
@ -106,7 +107,8 @@ export default {
|
||||
this.$store.dispatch('runPlan/clear').then(() => {
|
||||
if (opt && opt.mapId) {
|
||||
this.viewDisabled = true;
|
||||
getStationList(opt.mapId).then(response => {
|
||||
getByGroupStationList(this.$route.query.group).then(response => {
|
||||
// getStationList(opt.mapId).then(response => {
|
||||
this.$store.dispatch('runPlan/setStations', response.data).then(() => {
|
||||
getEveryDayRunPlanNew(this.group).then(resp => {
|
||||
this.$store.dispatch('runPlan/setPlanData', resp.data);
|
||||
|
@ -21,7 +21,7 @@
|
||||
import SetTime from './demon/setTime';
|
||||
import { Notification } from 'element-ui';
|
||||
import { ranAsPlan, runDiagramOver, runDiagramGetTime } from '@/api/simulation';
|
||||
import { timeFormat } from '@/utils/date';
|
||||
// import { timeFormat } from '@/utils/date';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
|
||||
export default {
|
||||
|
@ -37,7 +37,8 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { OperateMode } from '@/scripts/ConstDic';
|
||||
import { getStationList } from '@/api/runplan';
|
||||
// import { getStationList } from '@/api/runplan';
|
||||
import { getByGroupStationList } from '@/api/jmap/map';
|
||||
import { getEveryDayRunPlanData } from '@/api/simulation';
|
||||
|
||||
export default {
|
||||
@ -104,7 +105,8 @@ export default {
|
||||
this.$store.dispatch('runPlan/clear').then(resp => {
|
||||
if (opt && opt.mapId) {
|
||||
this.viewDisabled = true;
|
||||
getStationList(opt.mapId).then(response => {
|
||||
getByGroupStationList(this.$route.query.group).then(response => {
|
||||
// getStationList(opt.mapId).then(response => {
|
||||
const stations = response.data;
|
||||
this.$store.dispatch('runPlan/setStations', stations).then(() => {
|
||||
getEveryDayRunPlanData(this.group).then(resp => {
|
||||
|
Loading…
Reference in New Issue
Block a user