This commit is contained in:
fan 2019-10-31 15:54:46 +08:00
commit a24ff9ad60
59 changed files with 653 additions and 1187 deletions

View File

@ -18,14 +18,22 @@ import JointTraining from '@/views/jointTraining/index';
import Error401 from '@/views/error-page/401';
import Errpr404 from '@/views/error-page/404';
import SkinCode from '@/views/system/skinCode/index';
import SkinCodeDraft from '@/views/system/skinCode/draft';
import MapProduct from '@/views/system/product/index';
import Dictionary from '@/views/system/dictionary/index';
import DictionaryDetail from '@/views/system/dictionaryDetail/index';
import UserControl from '@/views/system/userControl/index';
import UserTraining from '@/views/system/userTraining/index';
import UserExam from '@/views/system/userExam/index';
import UserSimulation from '@/views/system/userSimulation/index';
import ExistingSimulation from '@/views/system/existingSimulation/index';
import CacheControl from '@/views/system/cacheControl/index';
import Trainingrecord from '@/views/system/trainingrecord/index';
import SystemGenerate from '@/views/system/systemGenerate/index';
import IbpDraw from '@/views/system/ibpDraw/index';
import Mapedit from '@/views/mapdraft/index';
import Trainingrecord from '@/views/lesson/trainingrecord/index';
import TrainingrecordManage from '@/views/lesson/trainingrecord/manage/index';
import TrainingrecordManage from '@/views/lesson/trainingrecordmanage/index';
import Taskmanage from '@/views/lesson/taskmanage/list';
import TrainingRuleList from '@/views/lesson/trainingRule/list';
import TrainingRuleEdit from '@/views/lesson/trainingRule/detail/index';
@ -76,7 +84,6 @@ import RunplanView from '@/views/publish/runPlanEveryDay/runPlanView';
import PublishExamRule from '@/views/publish/examRule/index';
import PublishExamRuleDraft from '@/views/publish/examRule/draft/index';
import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index';
import TrainingPlatform from '@/views/trainingPlatform/index';
import Commodity from '@/views/orderauthor/commodity/index';
@ -92,21 +99,10 @@ import PermissionCreate from '@/views/orderauthor/permission/create/index';
import UserRules from '@/views/orderauthor/rules/index';
import UserRulesDetail from '@/views/orderauthor/rules/detail';
import Dictionary from '@/views/management/dictionary/index';
import DictionaryDetail from '@/views/management/dictionaryDetail/index';
import UserControl from '@/views/management/userControl/index';
import UserTraining from '@/views/management/userTraining/index';
import UserExam from '@/views/management/userExam/index';
import UserSimulation from '@/views/management/userSimulation/index';
import ExistingSimulation from '@/views/management/existingSimulation/index';
import CacheControl from '@/views/management/cacheControl/index';
import LessonApproval from '@/views/approval/lesson/index';
import ScriptApproval from '@/views/approval/script/index';
import RunPlanApproval from '@/views/approval/runPlan/index';
import SystemGenerate from '@/views/systemGenerate/index';
import { loginTitle } from '@/scripts/ConstDic';
import { getSessionStorage } from '@/utils/auth';
@ -312,22 +308,12 @@ export const asyncRouter = [
meta: {
}
},
{
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{
{ // 运行图设计
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{
{ // 剧本
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
@ -335,13 +321,37 @@ export const asyncRouter = [
},
hidden: true
},
{
{ // 课程列表
path: 'lesson/home/:mapId',
// /:skinCode
component: LessonHome,
hidden: true
},
{
{ // 操作定义
path: 'lesson/trainingRule',
component: TrainingRuleList,
hidden: true
},
{ // 操作定义步骤
path: 'lesson/trainingRule/detail',
hidden: true,
component: TrainingRuleEdit
},
{ // 任务管理
path: 'lesson/taskManage',
component: Taskmanage,
hidden: true
},
{ // 实训管理
path: 'lesson/trainingManage/:skinCode',
component: Trainingmanage,
hidden: true
},
{ // 创建课程
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{ // 课程详情
path: 'lesson/details',
component: LessonDetail,
hidden: true,
@ -358,32 +368,7 @@ export const asyncRouter = [
component: TrainingrecordManage,
hidden: true
},
{
path: 'lesson/taskManage',
component: Taskmanage,
hidden: true
},
{
path: 'lesson/trainingRule',
component: TrainingRuleList,
hidden: true
},
{
path: 'lesson/trainingRule/detail',
hidden: true,
component: TrainingRuleEdit
},
{
path: 'lesson/trainingManage/:skinCode',
component: Trainingmanage,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
},
{
{ // 地图预览
path: 'mapPreview/:mapId',
component: MapPreview,
hidden: true
@ -416,38 +401,15 @@ export const asyncRouter = [
meta: {
}
},
{
{ // 地图绘制
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{
{ // 运行图设计
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
i18n: 'router.scriptManage'
},
hidden: true
},
{
path: 'lesson/home/:mapId',
component: LessonHome,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
}
@ -507,17 +469,17 @@ export const asyncRouter = [
meta: {
},
children: [
{
{ // 仿真详情
path: 'detail/:subSystem',
component: DemonstrationDetail,
hidden: true
},
{
{ // 教学系统 课程列表
path: 'teachHome/:subSystem',
component: TeachHome,
hidden: true
},
{
{ // 课程详情
path: 'teach/:subSystem',
component: TeachDetail,
hidden: true
@ -774,21 +736,9 @@ export const asyncRouter = [
roles: [admin, userDesign]
},
children: [
{
path: 'skinCode',
component: SkinCode,
meta: {
i18n: 'router.skinManage'
}
},
{
path: 'skinCode/draft/:mode/:skinCodeId',
hidden: true,
component: SkinCodeDraft
},
{
path: 'ibp/edit',
component: IbpEdit,
component: IbpDraw,
meta: {
i18n: 'router.ibpDraw'
}

View File

@ -1,82 +0,0 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapPaint">
<div class="map-view">
<ibp-plate ref="ibpPlate" :size="size" />
</div>
<div class="map-draft">
<ibp-operate ref="ibpOperate" @ibpChange="ibpChange" />
</div>
</div>
</transition>
</template>
<script>
import IbpPlate from '@/views/ibp/index';
import IbpOperate from './ibpOperate/index';
export default {
name: 'IbpView',
components: {
IbpPlate,
IbpOperate
},
data() {
return {
size: {
width: this.$store.state.app.width-521,
height: this.$store.state.app.height - 60
}
};
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
}
},
created() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
},
mounted() {
this.$refs.ibpPlate.show();
this.$refs.ibpPlate.drawIbpInit();
},
beforeDestroy() {
},
methods: {
ibpChange(stationCode) {
this.$refs.ibpPlate.show(stationCode);
this.$refs.ibpPlate.drawIbpInit();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.map-draft{
/deep/{
.v-modal{
opacity: 0;
}
}
}
.map-view {
float: left;
width: 60%;
}
.mapPaint{
height: 100%;
overflow: hidden;
}
.map-draft {
float: right;
width: 520px;
// /deep/ .el-scrollbar__view {
// width: 510px !important;
// height: calc(100% - 40px);
// }
}
</style>

View File

@ -1,213 +0,0 @@
<template>
<div>
<div :id="ibpId" :style="{ width: this.canvasWidth +'px', height: this.canvasHeight +'px',background:'#000' }" class="ibp-canvas" v-loading="loading" />
<el-button v-if="showBackButton" class="ibp-button" type="primary" @click="back">{{$t('global.back')}}</el-button>
</div>
</template>
<script>
import Vue from 'vue';
import IbpPan from '@/ibp/ibpPan';
import { parser } from '@/ibp/utils/parser';
import ibpData from '@/ibp/constant/ibpData';
import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat';
import { handlerIbpEvent } from '@/api/simulation';
import { IbpOperation } from '@/scripts/ConstDic'
export default {
name: 'Ibp',
props: {
size: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
width: this.$store.state.config.width,
height: this.$store.state.config.height,
dataZoom: {
offsetX: '0',
offsetY: '0',
scaleRate: '1'
},
config: {
scaleRate: '1',
origin: {
x: 0,
y: 0
}
},
showBackButton: true,
initTime: '',
started: false,
loading: false,
stationCode: '',
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
]),
ibpId() {
return ['ibp', (Math.random().toFixed(5)) * 100000].join('_');
},
},
watch: {
'$store.state.config.canvasSizeCount': function (val) {
this.reSize();
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'$store.state.training.initTime': function (initTime) {
this.initTime = initTime;
if (this.$ibp) {
this.initClockTime(initTime);
}
},
'$store.state.training.started': function (started) {
this.started = started;
if (this.$ibp) {
this.setClockStart(started);
}
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length) {
this.statusMessage(val);
}
},
},
mounted() {
this.setWindowSize();
},
beforeDestroy() {
this.ibpDestroy();
},
methods: {
show (deviceCode,ibpPart) {
if (!deviceCode) {
return;
}
this.stationCode = deviceCode;
document.getElementById(this.ibpId).oncontextmenu = function (e) {
return false;
};
let offsetX = 0;
if (ibpPart === 'left'){
offsetX = 0;
}else if (ibpPart === 'right'){
offsetX = 1920;
}
this.ibpDestroy();
this.loading = true;
const data = parser(ibpData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight});
this.$ibp = new IbpPan({
dom: document.getElementById(this.ibpId),
config: {
renderer: 'canvas',
width: this.canvasWidth,
height: this.canvasHeight
},
options: {
scaleRate: 1,
offsetX: offsetX,
offsetY: 0
},
methods: {
viewLoaded: this.handleViewLoaded,
}
});
Vue.prototype.$ibp = this.$ibp;
this.$ibp.on('contextmenu', this.onContextMenu, this);
if (this.$route.query.group) {
this.$ibp.on('selected', this.onSelected, this);
}
this.setMap(data,ibpData[deviceCode]);
this.$store.dispatch('ibp/setIbpData', ibpData[deviceCode]);
this.initClockTime(this.initTime);
window.document.oncontextmenu = function () {
return false;
};
},
setMap(data,oldData) {
this.$ibp.setMap(oldData, data);
},
//
onSelected(em) {
if (em.deviceModel.mean) {
const params = { operate:IbpOperation[em.deviceModel.mean].operate,stationCode:this.stationCode };
handlerIbpEvent(this.$route.query.group,params);
}
},
//
onContextMenu(em) {
this.$store.dispatch('ibp/setUpdateDeviceData', em.eventTarget.model);
},
//
drawIbpInit() {
this.$ibp&&this.$ibp.drawIbpInit();
this.showBackButton = false;
},
//
initClockTime(initTime) {
this.$ibp.initClockTime(initTime);
},
//
setClockStart(started) {
this.$ibp.setClockStart(started);
},
reSize() {
this.$nextTick(() => {
this.width = this.$store.state.config.width;
this.height = this.$store.state.config.height;
this.$ibp && this.$ibp.resize({ width: this.width, height: this.height });
});
},
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height : this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height });
});
},
back() {
this.group = this.$route.query.group;
this.$store.dispatch('training/over').then(() => {
putJointTrainingSimulationUser(this.group).then(() => {
this.$router.push({ path: `/trainroom`, query: { group: this.group } });
exitFullscreen();
});
});
},
ibpDestroy() {
if (this.$ibp) {
this.$ibp.dispose();
this.$ibp = '';
Vue.prototype.$ibp = '';
}
},
handleViewLoaded() {
this.loading = false;
},
statusMessage(val) {
this.$ibp && this.$ibp.setDeviceStatus(val);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.ibp-button{
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
.ibp-canvas{
}
</style>

View File

@ -0,0 +1,213 @@
<template>
<div>
<div :id="ibpId" v-loading="loading" :style="{ width: this.canvasWidth +'px', height: this.canvasHeight +'px',background:'#000' }" class="ibp-canvas" />
<el-button v-if="showBackButton" class="ibp-button" type="primary" @click="back">{{ $t('global.back') }}</el-button>
</div>
</template>
<script>
import Vue from 'vue';
import IbpPan from '@/ibp/ibpPan';
import { parser } from '@/ibp/utils/parser';
import ibpData from '@/ibp/constant/ibpData';
import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat';
import { handlerIbpEvent } from '@/api/simulation';
import { IbpOperation } from '@/scripts/ConstDic';
export default {
name: 'Ibp',
props: {
size: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
width: this.$store.state.config.width,
height: this.$store.state.config.height,
dataZoom: {
offsetX: '0',
offsetY: '0',
scaleRate: '1'
},
config: {
scaleRate: '1',
origin: {
x: 0,
y: 0
}
},
showBackButton: true,
initTime: '',
started: false,
loading: false,
stationCode: ''
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
]),
ibpId() {
return ['ibp', (Math.random().toFixed(5)) * 100000].join('_');
}
},
watch: {
'$store.state.config.canvasSizeCount': function (val) {
this.reSize();
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'$store.state.training.initTime': function (initTime) {
this.initTime = initTime;
if (this.$ibp) {
this.initClockTime(initTime);
}
},
'$store.state.training.started': function (started) {
this.started = started;
if (this.$ibp) {
this.setClockStart(started);
}
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length) {
this.statusMessage(val);
}
}
},
mounted() {
this.setWindowSize();
},
beforeDestroy() {
this.ibpDestroy();
},
methods: {
show (deviceCode, ibpPart) {
if (!deviceCode) {
return;
}
this.stationCode = deviceCode;
document.getElementById(this.ibpId).oncontextmenu = function (e) {
return false;
};
let offsetX = 0;
if (ibpPart === 'left') {
offsetX = 0;
} else if (ibpPart === 'right') {
offsetX = 1920;
}
this.ibpDestroy();
this.loading = true;
const data = parser(ibpData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight});
this.$ibp = new IbpPan({
dom: document.getElementById(this.ibpId),
config: {
renderer: 'canvas',
width: this.canvasWidth,
height: this.canvasHeight
},
options: {
scaleRate: 1,
offsetX: offsetX,
offsetY: 0
},
methods: {
viewLoaded: this.handleViewLoaded
}
});
Vue.prototype.$ibp = this.$ibp;
this.$ibp.on('contextmenu', this.onContextMenu, this);
if (this.$route.query.group) {
this.$ibp.on('selected', this.onSelected, this);
}
this.setMap(data, ibpData[deviceCode]);
this.$store.dispatch('ibp/setIbpData', ibpData[deviceCode]);
this.initClockTime(this.initTime);
window.document.oncontextmenu = function () {
return false;
};
},
setMap(data, oldData) {
this.$ibp.setMap(oldData, data);
},
//
onSelected(em) {
if (em.deviceModel.mean) {
const params = { operate:IbpOperation[em.deviceModel.mean].operate, stationCode:this.stationCode };
handlerIbpEvent(this.$route.query.group, params);
}
},
//
onContextMenu(em) {
this.$store.dispatch('ibp/setUpdateDeviceData', em.eventTarget.model);
},
//
drawIbpInit() {
this.$ibp && this.$ibp.drawIbpInit();
this.showBackButton = false;
},
//
initClockTime(initTime) {
this.$ibp.initClockTime(initTime);
},
//
setClockStart(started) {
this.$ibp.setClockStart(started);
},
reSize() {
this.$nextTick(() => {
this.width = this.$store.state.config.width;
this.height = this.$store.state.config.height;
this.$ibp && this.$ibp.resize({ width: this.width, height: this.height });
});
},
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height : this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height });
});
},
back() {
this.group = this.$route.query.group;
this.$store.dispatch('training/over').then(() => {
putJointTrainingSimulationUser(this.group).then(() => {
this.$router.push({ path: `/trainroom`, query: { group: this.group } });
exitFullscreen();
});
});
},
ibpDestroy() {
if (this.$ibp) {
this.$ibp.dispose();
this.$ibp = '';
Vue.prototype.$ibp = '';
}
},
handleViewLoaded() {
this.loading = false;
},
statusMessage(val) {
this.$ibp && this.$ibp.setDeviceStatus(val);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.ibp-button{
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
.ibp-canvas{
}
</style>

View File

@ -33,7 +33,7 @@ import JoinFaultChoose from '@/views/display/demon/faultChoose';
import JoinRunPlanLoad from '@/views/display/demon/runPlanLoad';
import JoinRunPlanView from '@/views/display/demon/runPlanView';
import menuSystemTime from '@/views/display/menuSystemTime';
import IbpPlate from '@/views/ibp/index';
import IbpPlate from '@/views/ibpsystem/index';
import { mapGetters } from 'vuex';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';

View File

@ -60,7 +60,7 @@
import { createLesson, updateLesson, getLessonDetail } from '@/api/jmap/lessondraft';
import { getCommodityMapProduct } from '@/api/management/mapprd';
import { getSkinCodeList } from '@/api/management/mapskin';
import { UrlConfig } from '@/router/index';
// import { UrlConfig } from '@/router/index';
export default {
name: 'CourseEdit',
@ -187,7 +187,8 @@ export default {
}
},
back() {
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}/${this.$route.query.skinCode}`, query: {cityCode: this.$route.query.cityCode} });
// this.$router.push({ path: `${UrlConfig.design.lessonHome}/${this.$route.query.mapId}/${this.$route.query.skinCode}`, query: {cityCode: this.$route.query.cityCode} });
this.$router.go(-1);
}
}
};

View File

@ -145,7 +145,7 @@ export default {
.box{
height: 100%;
display: -webkit-box;
width: 100%;
width: 100%;
}
}
</style>

View File

@ -1,160 +0,0 @@
<template>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>{{ $t(`lesson.trainingList`) }}</span>
</div>
<div style="{width: 150px}">
<el-input v-model="filterText" :placeholder="$t(`lesson.filterPlaceholder`)" clearable />
</div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-270) +'px' }">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultShowKeys"
:filter-node-method="filterNode"
expand-on-click-node
highlight-current
:span="22"
@node-contextmenu="showContextMenu"
@node-click="clickEvent"
>
<div slot-scope="{ node: nodeScop }">
<span v-if="nodeScop.data.type == 'skin'" class="el-icon-news">&nbsp;{{ nodeScop.label }}</span>
<span v-else-if="nodeScop.data.type == 'prd'" class="el-icon-tickets">&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'trainingType'"
class="el-icon-document"
>&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'training'"
class="el-icon-edit-outline"
>&nbsp;{{ nodeScop.label }}</span>
</div>
</el-tree>
</el-scrollbar>
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @trainingShow="trainingShow" />
</el-card>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { getTrainingTree } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import OperateMenu from './category/operateMenu';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
export default {
name: 'TrainingOperate',
components: {
OperateMenu
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'name'
},
point: {
x: 0,
y: 0
},
node: {
}
};
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
mounted() {
this.refresh();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (obj && obj.type === 'Training') {
this.resize();
trainingNotify({ trainingId: obj.id }).then(resp => {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.design.lessonTraining}/${obj.id}/${obj.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
e.preventDefault();
this.point = {
x: e.clientX,
y: e.clientY
};
this.node = node;
const menu = DeviceMenu.Training;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
},
getParent(node) {
while (node && node.data.type != 'Skin') {
node = node.parent;
}
return node || {};
},
trainingShow() {
this.$emit('trainingStart', { id: this.node.data.id, lessonId: this.getParent(this.node).data.id });
},
refresh() {
this.loading = true;
getTrainingTree().then(response => {
this.treeData = response.data;
this.defaultShowKeys = [this.$route.params.trainingId];
this.$nextTick(() => {
this.loading = false;
this.$refs.tree.setCurrentKey(this.$route.params.trainingId); // value node-key
if (this.filterText) {
this.$refs.tree.filter(this.filterText);
}
});
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
});
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
}
}
};
</script>
<style>
.el-tree {
overflow-x: hidden;
}
.map-list-main {
text-align: center;
}
.el-tree-node.is-current>.el-tree-node__content {
background-color: #e4e3e3 !important;
}
</style>

View File

@ -1,137 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable" />
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { list, del } from '@/api/management/dictionary';
import DictionaryEdit from '@/views/management/dictionary/edit';
export default {
name: 'Dictionary',
components: {
DictionaryEdit
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: this.$t('system.code')
},
name: {
type: 'text',
label: this.$t('system.name')
},
status: {
type: 'select',
label: this.$t('system.status'),
config: {
data: this.$ConstSelect.Status
}
}
}
},
queryList: {
query: list,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('system.code'),
prop: 'code'
},
{
title: this.$t('system.name'),
prop: 'name'
},
{
title: this.$t('system.status'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
},
{
title: this.$t('system.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.detail'),
handleClick: this.handleViewDetail
},
{
name: this.$t('global.edit'),
handleClick: this.handleEdit
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
]
},
currentModel: {}
};
},
methods: {
handleViewDetail(index, row) {
this.$router.push({ path: `/system/dictionary/detail`, query: { id: row.id } });
},
handleEdit(index, row) {
this.$refs.edit.show(row.id);
},
handleAdd() {
this.$refs.create.show();
},
handleBatchDelete() {
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
del(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -1,167 +0,0 @@
<template>
<div>
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
<dictionary-detail-edit ref="create" type="ADD" :dic-id="dicId" @reloadTable="reloadTable" />
<dictionary-detail-edit ref="edit" type="EDIT" :dic-id="dicId" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { list, del } from '@/api/management/dictionaryDetail';
import { getData } from '@/api/management/dictionary';
import DictionaryDetailEdit from '@/views/management/dictionaryDetail/edit';
export default {
name: 'DictionaryDetail',
components: {
DictionaryDetailEdit
},
data() {
return {
dicId: '',
dic: {},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: this.$t('global.code')
},
name: {
type: 'text',
label: this.$t('global.name')
},
status: {
type: 'select',
label: this.$t('global.status'),
config: {
data: this.$ConstSelect.Status
}
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('global.code'),
prop: 'code'
},
{
title: this.$t('global.name'),
prop: 'name'
},
{
title: this.$t('global.status'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
},
{
title: this.$t('global.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleEdit
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
]
},
currentModel: {}
};
},
// computed: {
// turnbackBarTitle() {
// return this.dic.name + '(' + this.dic.code + ')'
// }
// },
created() {
this.dicId = this.$route.query.id;
getData(this.dicId).then(response => {
this.dic = response.data;
});
},
methods: {
queryFunction(params) {
return list(this.dicId, params);
},
handleEdit(index, row) {
this.$refs.edit.show(row.id);
},
handleAdd() {
this.$refs.create.show();
},
handleBatchDelete() {
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
del(this.dicId, row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -0,0 +1,138 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable" />
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { list, del } from '@/api/management/dictionary';
import DictionaryEdit from '@/views/system/dictionary/edit';
export default {
name: 'Dictionary',
components: {
DictionaryEdit
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: this.$t('system.code')
},
name: {
type: 'text',
label: this.$t('system.name')
},
status: {
type: 'select',
label: this.$t('system.status'),
config: {
data: this.$ConstSelect.Status
}
}
}
},
queryList: {
query: list,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('system.code'),
prop: 'code'
},
{
title: this.$t('system.name'),
prop: 'name'
},
{
title: this.$t('system.status'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
},
{
title: this.$t('system.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.detail'),
handleClick: this.handleViewDetail
},
{
name: this.$t('global.edit'),
handleClick: this.handleEdit
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
]
},
currentModel: {}
};
},
methods: {
handleViewDetail(index, row) {
this.$router.push({ path: `/system/dictionary/detail`, query: { id: row.id } });
},
handleEdit(index, row) {
this.$refs.edit.show(row.id);
},
handleAdd() {
this.$refs.create.show();
},
handleBatchDelete() {
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
del(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -0,0 +1,167 @@
<template>
<div>
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
<dictionary-detail-edit ref="create" type="ADD" :dic-id="dicId" @reloadTable="reloadTable" />
<dictionary-detail-edit ref="edit" type="EDIT" :dic-id="dicId" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { list, del } from '@/api/management/dictionaryDetail';
import { getData } from '@/api/management/dictionary';
import DictionaryDetailEdit from '@/views/system/dictionaryDetail/edit';
export default {
name: 'DictionaryDetail',
components: {
DictionaryDetailEdit
},
data() {
return {
dicId: '',
dic: {},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: this.$t('global.code')
},
name: {
type: 'text',
label: this.$t('global.name')
},
status: {
type: 'select',
label: this.$t('global.status'),
config: {
data: this.$ConstSelect.Status
}
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('global.code'),
prop: 'code'
},
{
title: this.$t('global.name'),
prop: 'name'
},
{
title: this.$t('global.status'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
},
{
title: this.$t('global.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleEdit
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
]
},
currentModel: {}
};
},
// computed: {
// turnbackBarTitle() {
// return this.dic.name + '(' + this.dic.code + ')'
// }
// },
created() {
this.dicId = this.$route.query.id;
getData(this.dicId).then(response => {
this.dic = response.data;
});
},
methods: {
queryFunction(params) {
return list(this.dicId, params);
},
handleEdit(index, row) {
this.$refs.edit.show(row.id);
},
handleAdd() {
this.$refs.create.show();
},
handleBatchDelete() {
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
del(this.dicId, row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -0,0 +1,82 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapPaint">
<div class="map-view">
<ibp-plate ref="ibpPlate" :size="size" />
</div>
<div class="map-draft">
<ibp-operate ref="ibpOperate" @ibpChange="ibpChange" />
</div>
</div>
</transition>
</template>
<script>
import IbpPlate from '@/views/ibpsystem/index';
import IbpOperate from './ibpOperate/index';
export default {
name: 'IbpView',
components: {
IbpPlate,
IbpOperate
},
data() {
return {
size: {
width: this.$store.state.app.width - 521,
height: this.$store.state.app.height - 60
}
};
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
}
},
created() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
},
mounted() {
this.$refs.ibpPlate.show();
this.$refs.ibpPlate.drawIbpInit();
},
beforeDestroy() {
},
methods: {
ibpChange(stationCode) {
this.$refs.ibpPlate.show(stationCode);
this.$refs.ibpPlate.drawIbpInit();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.map-draft{
/deep/{
.v-modal{
opacity: 0;
}
}
}
.map-view {
float: left;
width: 60%;
}
.mapPaint{
height: 100%;
overflow: hidden;
}
.map-draft {
float: right;
width: 520px;
// /deep/ .el-scrollbar__view {
// width: 510px !important;
// height: calc(100% - 40px);
// }
}
</style>

View File

@ -1,202 +0,0 @@
<template>
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<div style="padding-top: 40px; padding-bottom: 20px;">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isAdd" type="primary" style="margin-left: 120px" @click="create">{{ $t('global.create') }}</el-button>
<el-button v-if="isEdit" type="warning" style="margin-left: 120px" @click="update">{{ $t('global.update') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.return') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { addSkinCode, querySkinCode, updateSkinCode, querySkinCodeExistByCode } from '@/api/management/mapskin';
export default {
name: 'DictionaryDetailEdit',
data() {
return {
display: 1,
formModel: {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1',
linkWidth: 0,
zoneWidth: 0,
watermarkShow: false
}
};
},
computed: {
title() {
if (this.isAdd) {
return this.$t('map.addMapSkin');
}
if (this.isEdit) {
return this.$t('map.updateMapSkin');
}
return '';
},
isAdd() {
return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase();
},
isEdit() {
return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase();
},
isDisabled() {
return this.isEdit;
},
form() {
const form = {
labelWidth: '140px',
items: [
{ prop: 'code', label: this.$t('map.skinCoding'), type: 'text', required: false, disabled: this.isDisabled },
{ prop: 'name', label: this.$t('map.skinDesignation'), type: 'text', required: false },
{ prop: 'origin', label: this.$t('map.coordinatesOrigin'), type: 'point', required: false },
{ prop: 'scaling', label: this.$t('map.scaling'), type: 'number', required: false, message: this.$t('rules.maxScaling') }
]
};
return form;
},
rules() {
const baseRules = {
code: [
{ required: true, message: this.$t('rules.skinCodingInput'), trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('rules.skinDesignationInput'), trigger: 'blur' }
],
origin: [
{ required: true, message: this.$t('rules.coordinatesOriginInput'), trigger: 'blur' }
],
scaling: [
{ required: true, message: this.$t('rules.scalingInput'), trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number(value) >= 1 && Number(value) <= 8) {
callback();
} else {
callback(new Error(this.$t('rules.scalingInputPrompt')));
}
},
trigger: 'blur'
}
]
};
return baseRules;
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
//
this.display = 1;
this.formModel = {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1'
};
if (this.isEdit) {
querySkinCode(this.$route.params.skinCodeId).then(response => {
this.formModel = response.data;
});
}
//
this.$nextTick(() => {
this.$refs.dataform.resetForm();
});
},
create() {
this.formModel.id = '';
this.$refs.dataform.validateForm(() => {
querySkinCodeExistByCode(this.formModel.code).then(resp => {
addSkinCode(this.formModel).then(response => {
this.turnback();
this.$message.success(this.$t('tip.creatingSuccessful'));
}).catch(() => {
this.$messageBox(this.$t('tip.creatingFailed'));
});
}).catch(() => {
this.$messageBox(this.$t('tip.skinCodingExist'));
});
});
},
update() {
this.formModel.id = this.$route.params.skinCodeId;
this.$refs.dataform.validateForm(() => {
updateSkinCode(this.formModel).then(response => {
this.turnback();
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.updateFailed'));
});
});
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.steps {
width: 940px;
margin: 0 auto;
margin-top: 20px;
height: 100%;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 20px;
/deep/ {
.el-select {
float: left;
width: calc(600px);
}
.el-form-item__content>.el-input>.el-input__inner {
float: left;
width: calc(600px);
}
.el-input-number {
float: left;
width: calc(250px);
}
}
}
.draft {
width: 300px;
margin: 20px auto;
}
</style>

View File

@ -1,124 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { UrlConfig } from '@/router/index';
import { getSkinCodePageList, delSkinCode } from '@/api/management/mapskin';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'SkinCode',
data() {
return {
prdTypeList: [],
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('map.skinDesignation')
},
code: {
type: 'text',
label: this.$t('map.skinCoding')
}
}
},
queryList: {
query: getSkinCodePageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.skinCoding'),
prop: 'code'
},
{
title: this.$t('map.skinDesignation'),
prop: 'name'
},
{
title: this.$t('map.coordinatesOrigin'),
prop: 'origin',
type: 'tag',
columnValue: (row) => { return `(${row.origin.x}, ${row.origin.y})`; },
tagType: () => { return ''; }
},
{
title: this.$t('map.scalingColon'),
prop: 'scaling'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleEdit,
type: ''
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd }
]
}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.prdTypeList = [];
this.$Dictionary.productPostType().then(list => {
this.prdTypeList = list;
});
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
handleAdd() {
this.$router.push(`${UrlConfig.map.skinCodeDraft}/add/null`);
},
handleEdit(index, row) {
this.$router.push(`${UrlConfig.map.skinCodeDraft}/edit/${row.id}`);
},
handleDelete(index, row) {
this.$confirm(this.$t('tip.skinDeleteConfirmation'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
delSkinCode(row.id).then(() => {
this.$message.success(this.$t('tip.skinDeleteSuccessfully'),);
}).catch(() => {
this.$messageBox(this.$t('tip.skinDeleteFailed'));
});
}).catch(() => {
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>