Merge remote-tracking branch 'remotes/origin/test'
This commit is contained in:
commit
72b4fc5f25
59
.eslintrc.js
59
.eslintrc.js
@ -25,31 +25,31 @@ module.exports = {
|
|||||||
"vue/no-v-html": "off",
|
"vue/no-v-html": "off",
|
||||||
'accessor-pairs': 2,
|
'accessor-pairs': 2,
|
||||||
"arrow-spacing": 0,//=>的前/后括号
|
"arrow-spacing": 0,//=>的前/后括号
|
||||||
'block-spacing': [2, 'always'],
|
'block-spacing': [2, 'always'], // 禁止或强制在代码块中开括号前和闭括号后有空格 { return 11 }
|
||||||
'brace-style': [2, '1tbs', {
|
'brace-style': [2, '1tbs', { // 强制在代码块中使用一致的大括号风格
|
||||||
'allowSingleLine': true
|
'allowSingleLine': true
|
||||||
}],
|
}],
|
||||||
'camelcase': [0, {
|
'camelcase': [0, { // 强制使用驼峰拼写法命名规定
|
||||||
'properties': 'always'
|
'properties': 'always'
|
||||||
}],
|
}],
|
||||||
'comma-dangle': [2, 'never'],
|
'comma-dangle': [2, 'never'], // 要求或禁止末尾逗号
|
||||||
'comma-spacing': [2, {
|
'comma-spacing': [2, { // 强制在逗号前后使用一致的空格
|
||||||
'before': false,
|
'before': false,
|
||||||
'after': true
|
'after': true
|
||||||
}],
|
}],
|
||||||
'comma-style': [2, 'last'],
|
'comma-style': [2, 'last'], // 强制在逗号前后使用一致的空格
|
||||||
'constructor-super': 2,
|
'constructor-super': 2, // 要求在构造函数中有super()调用
|
||||||
'curly': [2, 'multi-line'],
|
'curly': [2, 'multi-line'], // 强制所有控制语句使用一致的括号风格
|
||||||
'dot-location': [2, 'property'],
|
'dot-location': [2, 'property'], // 强制在点号之前和之后一致的换行
|
||||||
'eol-last': 2,
|
'eol-last': 2, // 禁止文件末尾存在空行禁止文件末尾存在空行
|
||||||
'generator-star-spacing': [2, {
|
'generator-star-spacing': [2, {
|
||||||
'before': true,
|
'before': true,
|
||||||
'after': true
|
'after': true
|
||||||
}],
|
}],
|
||||||
'handle-callback-err': [2, '^(err|error)$'],
|
'handle-callback-err': [2, '^(err|error)$'],
|
||||||
'indent': ["error", "tab"],
|
'indent': [2, 4], // 强制使用一致的缩进
|
||||||
'jsx-quotes': [2, 'prefer-single'],
|
'jsx-quotes': [2, 'prefer-single'], // 强制在JSX属性中一致地使用双引号或单引号
|
||||||
'key-spacing': [2, {
|
'key-spacing': [0, { // 强制要求在对象字面量的属性中键和值之间使用一致的间距
|
||||||
'beforeColon': false,
|
'beforeColon': false,
|
||||||
'afterColon': true
|
'afterColon': true
|
||||||
}],
|
}],
|
||||||
@ -58,8 +58,8 @@ module.exports = {
|
|||||||
'after': true
|
'after': true
|
||||||
}],
|
}],
|
||||||
"new-cap": 2,//函数名首行大写必须使用new方式调用,首行小写必须用不带new方式调用
|
"new-cap": 2,//函数名首行大写必须使用new方式调用,首行小写必须用不带new方式调用
|
||||||
'new-parens': 2,
|
'new-parens': 2, // 要求构造无参构造函数时有圆括号
|
||||||
'no-array-constructor': 2,
|
'no-array-constructor': 2, // 禁用Array构造函数
|
||||||
'no-caller': 2,
|
'no-caller': 2,
|
||||||
'no-console': 'off',
|
'no-console': 'off',
|
||||||
'no-class-assign': 2,
|
'no-class-assign': 2,
|
||||||
@ -94,9 +94,10 @@ module.exports = {
|
|||||||
}],
|
}],
|
||||||
'no-lone-blocks': 2,
|
'no-lone-blocks': 2,
|
||||||
"no-mixed-spaces-and-tabs": [2, false],//禁止混用tab和空格
|
"no-mixed-spaces-and-tabs": [2, false],//禁止混用tab和空格
|
||||||
"no-multi-spaces": 1,//不能用多余的空格
|
"no-multi-spaces": 1,// 不能用多余的空格
|
||||||
'no-multi-str': 2,
|
'no-multi-str': 2,
|
||||||
'no-multiple-empty-lines': [2, {
|
'no-multiple-empty-lines': [2, { // 禁止出现多行空行
|
||||||
|
// 最大连续空行数
|
||||||
'max': 1
|
'max': 1
|
||||||
}],
|
}],
|
||||||
'no-native-reassign': 2,
|
'no-native-reassign': 2,
|
||||||
@ -121,7 +122,7 @@ module.exports = {
|
|||||||
'no-sparse-arrays': 2,
|
'no-sparse-arrays': 2,
|
||||||
'no-this-before-super': 2,
|
'no-this-before-super': 2,
|
||||||
'no-throw-literal': 2,
|
'no-throw-literal': 2,
|
||||||
"no-trailing-spaces": 1,//一行结束后面不要有空格
|
"no-trailing-spaces": 1,// 禁止行尾空格
|
||||||
'no-undef': 2,
|
'no-undef': 2,
|
||||||
'no-undef-init': 2,
|
'no-undef-init': 2,
|
||||||
'no-unexpected-multiline': 2,
|
'no-unexpected-multiline': 2,
|
||||||
@ -139,7 +140,7 @@ module.exports = {
|
|||||||
'no-useless-computed-key': 2,
|
'no-useless-computed-key': 2,
|
||||||
'no-useless-constructor': 2,
|
'no-useless-constructor': 2,
|
||||||
'no-useless-escape': 0,
|
'no-useless-escape': 0,
|
||||||
'no-whitespace-before-property': 2,
|
'no-whitespace-before-property': 2, // 禁止属性前有空白
|
||||||
'no-with': 2,
|
'no-with': 2,
|
||||||
'one-var': [2, {
|
'one-var': [2, {
|
||||||
'initialized': 'never'
|
'initialized': 'never'
|
||||||
@ -150,21 +151,21 @@ module.exports = {
|
|||||||
':': 'before'
|
':': 'before'
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
"padded-blocks": 0,//块语句内行首行尾是否要空行
|
"padded-blocks": 0, // 块语句内行首行尾是否要空行
|
||||||
'quotes': [2, 'single', {
|
'quotes': [2, 'single', {
|
||||||
'avoidEscape': true,
|
'avoidEscape': true,
|
||||||
'allowTemplateLiterals': true
|
'allowTemplateLiterals': true
|
||||||
}],
|
}],
|
||||||
'semi': [2, 'always'], //语句强制分号结尾
|
'semi': [2, 'always'], // 语句强制分号结尾
|
||||||
'semi-spacing': [2, {
|
'semi-spacing': [2, { // 强制分号之前和之后使用一致的空格
|
||||||
'before': false,
|
'before': false,
|
||||||
'after': true
|
'after': true
|
||||||
}],
|
}],
|
||||||
"strict": 2,//使用严格模式
|
"strict": 2,//使用严格模式
|
||||||
'space-before-blocks': [2, 'always'], //不以新行开始的块{前面要不要有空格
|
'space-before-blocks': [2, 'always'], // 不以新行开始的块{前面要不要有空格 强制在块之前使用一致的空格
|
||||||
"space-before-function-paren": [0, "always"],//函数定义时括号前面要不要有空格
|
"space-before-function-paren": [0, "always"],// 函数定义时括号前面要不要有空格
|
||||||
"space-in-parens": [0, "never"],//小括号里面要不要有空格
|
"space-in-parens": [0, "never"],// 小括号里面要不要有空格
|
||||||
"space-infix-ops": 0,//中缀操作符周围要不要有空格
|
"space-infix-ops": 2,// 要求操作符周围有空格
|
||||||
'space-unary-ops': [2, {
|
'space-unary-ops': [2, {
|
||||||
'words': true,
|
'words': true,
|
||||||
'nonwords': false
|
'nonwords': false
|
||||||
@ -172,7 +173,7 @@ module.exports = {
|
|||||||
'spaced-comment': [2, 'always', {
|
'spaced-comment': [2, 'always', {
|
||||||
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
|
||||||
}], //注释风格要不要有空格什么的
|
}], //注释风格要不要有空格什么的
|
||||||
'template-curly-spacing': [2, 'never'],
|
// 'template-curly-spacing': [2, 'never'],
|
||||||
'use-isnan': 2, //禁止比较时使用NaN,只能用isNaN()
|
'use-isnan': 2, //禁止比较时使用NaN,只能用isNaN()
|
||||||
'valid-typeof': 2, //必须使用合法的typeof的值
|
'valid-typeof': 2, //必须使用合法的typeof的值
|
||||||
"wrap-iife": [2, "inside"],//立即执行函数表达式的小括号风格
|
"wrap-iife": [2, "inside"],//立即执行函数表达式的小括号风格
|
||||||
@ -180,7 +181,7 @@ module.exports = {
|
|||||||
'yoda': [2, 'never'], //禁止尤达条件
|
'yoda': [2, 'never'], //禁止尤达条件
|
||||||
'prefer-const': 2,
|
'prefer-const': 2,
|
||||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
|
||||||
"object-curly-spacing": [0, "never"],//大括号内是否允许不必要的空格
|
"object-curly-spacing": [0, "never"], // 强制在大括号中使用一致的空格
|
||||||
"array-bracket-spacing": [2, "never"], //是否允许非空数组里面有多余的空格
|
"array-bracket-spacing": [2, "never"], // 禁止或强制在括号内使用空格
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,3 +65,12 @@ export function getCommodityProductLesson(prdCode) {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 更新发布课程信息*/
|
||||||
|
export function updatePublishLesson(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/lesson/${data.id}/nameAndRemarks`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -115,7 +115,7 @@ export function updatePublishMapName(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改发布地图名称*/
|
/** 获取发布地图详情*/
|
||||||
export function getPublishMapDetailList(params, code) {
|
export function getPublishMapDetailList(params, code) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/map/${code}/versions`,
|
url: `/api/map/${code}/versions`,
|
||||||
@ -132,7 +132,7 @@ export function hasDoorStationList(mapId) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 修改发布地图名称*/
|
/** 修改发布地图城市*/
|
||||||
export function updatePublishMapCity(data) {
|
export function updatePublishMapCity(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/map/${data.mapId}/city`,
|
url: `/api/map/${data.mapId}/city`,
|
||||||
@ -140,3 +140,20 @@ export function updatePublishMapCity(data) {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 设置归属项目 */
|
||||||
|
export function setMapProject(data) {
|
||||||
|
return request({
|
||||||
|
url: `/api/map/${data.id}/project`,
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 根据定制项目编号查询地图列表 */
|
||||||
|
export function getMapListByProjectCode(projectCode) {
|
||||||
|
return request({
|
||||||
|
url: `/api/map/project/${projectCode}/list`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
@ -26,9 +26,9 @@ export function getScriptById(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
/** 通过ID查询未发布剧本的详细信息 */
|
/** 通过ID查询未发布剧本的详细信息 */
|
||||||
export function getDraftScriptById(id) {
|
export function getDraftScriptByGroup(group) {
|
||||||
return request({
|
return request({
|
||||||
url: `/api/script/draft/${id}/detail`,
|
url: `/api/simulation/${group}/script/loadedScript`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -425,3 +425,12 @@ export function handlerIbpEvent(group, data) {
|
|||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 预览脚本仿真*/
|
||||||
|
export function scriptDraftRecordNotify(scriptId) {
|
||||||
|
return request({
|
||||||
|
url: `/api/simulation/scriptDraft/${scriptId}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -85,3 +85,11 @@ export function deleteSubSystem(id) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getSubSystemByProjectCode(projectCode) {
|
||||||
|
/** 根据项目编号查询地图子系统 */
|
||||||
|
return request({
|
||||||
|
url: `/api/mapSystem/project/${projectCode}`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
<el-input
|
<el-input
|
||||||
v-model="formModel[item.prop]"
|
v-model="formModel[item.prop]"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
:autosize='item.isAutoSize||false'
|
||||||
:placeholder="item.placeholder"
|
:placeholder="item.placeholder"
|
||||||
:disabled="item.disabled"
|
:disabled="item.disabled"
|
||||||
:style="{width: item.tooltip ? 'calc(100% - 50px)' : '100%'}"
|
:style="{width: item.tooltip ? 'calc(100% - 50px)' : '100%'}"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
style="padding-top: 18px;"
|
style="padding-top: 18px;"
|
||||||
>
|
>
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="18">
|
<el-col :span="leftSpan">
|
||||||
<template v-for="(colNum, rIndex) in rowColumnList">
|
<template v-for="(colNum, rIndex) in rowColumnList">
|
||||||
<el-row :key="rIndex" :gutter="20">
|
<el-row :key="rIndex" :gutter="20">
|
||||||
<template v-for="(field, name, index) in queryObject">
|
<template v-for="(field, name, index) in queryObject">
|
||||||
@ -127,8 +127,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="5" :offset="1">
|
<el-col :span="24-leftSpan-1" :offset="1">
|
||||||
<el-button type="primary" size="small" :disabled="!canQuery" @click="query">{{ $t('global.query') }}</el-button>
|
<el-button style="margin-right: 10px" type="primary" size="small" :disabled="!canQuery" @click="query">{{ $t('global.query') }}</el-button>
|
||||||
<el-button v-if="queryForm.reset" type="primary" size="small" :disabled="!canQuery" @click="doClean">{{ $t('global.reset') }}</el-button>
|
<el-button v-if="queryForm.reset" type="primary" size="small" :disabled="!canQuery" @click="doClean">{{ $t('global.reset') }}</el-button>
|
||||||
<el-button v-if="exportFlag" type="primary" size="small" :disabled="!canQuery" @click="doExport">{{ $t('global.export') }}</el-button>
|
<el-button v-if="exportFlag" type="primary" size="small" :disabled="!canQuery" @click="doExport">{{ $t('global.export') }}</el-button>
|
||||||
<template v-for="(button, index) in queryList.actions">
|
<template v-for="(button, index) in queryList.actions">
|
||||||
@ -138,8 +138,8 @@
|
|||||||
:type="button.type ? button.type: 'primary'"
|
:type="button.type ? button.type: 'primary'"
|
||||||
size="small"
|
size="small"
|
||||||
:style="button.style"
|
:style="button.style"
|
||||||
@click="button.handler"
|
|
||||||
class="button_style"
|
class="button_style"
|
||||||
|
@click="button.handler"
|
||||||
>{{ button.text }}</el-button>
|
>{{ button.text }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -173,6 +173,12 @@ export default {
|
|||||||
canQuery: {
|
canQuery: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true
|
required: true
|
||||||
|
},
|
||||||
|
leftSpan: {
|
||||||
|
type: Number,
|
||||||
|
default() {
|
||||||
|
return 18;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -481,7 +487,9 @@ export default {
|
|||||||
max-width: 240px;
|
max-width: 240px;
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
}
|
}
|
||||||
.button_style {
|
.el-button+.el-button {
|
||||||
|
margin-right:10px;
|
||||||
|
margin-left: 0;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="query-list-page" :style="{height: queryList.height ? 'auto' : listPageHeight}">
|
<!-- :style="{height: queryList.height ? 'auto' : listPageHeight}" -->
|
||||||
|
<div class="query-list-page">
|
||||||
<query-form
|
<query-form
|
||||||
v-show="!(queryForm.show === false)"
|
v-show="!(queryForm.show === false)"
|
||||||
ref="queryForm"
|
ref="queryForm"
|
||||||
:query-form="queryForm"
|
:query-form="queryForm"
|
||||||
|
:left-span="queryForm.leftSpan"
|
||||||
:query-list="queryList"
|
:query-list="queryList"
|
||||||
:before-query="queryForm.beforeQuery"
|
:before-query="queryForm.beforeQuery"
|
||||||
:can-query="canQuery"
|
:can-query="canQuery"
|
||||||
@ -151,315 +153,315 @@
|
|||||||
// import { mapGetters } from 'vuex'
|
// import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
QueryForm: resolve => { require(['@/components/QueryListPage/QueryForm'], resolve); } // 懒加载
|
QueryForm: resolve => { require(['@/components/QueryListPage/QueryForm'], resolve); } // 懒加载
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
queryForm: {
|
queryForm: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default() {
|
default() {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
choose: null,
|
choose: null,
|
||||||
queryData: {},
|
queryData: {},
|
||||||
currentpagerConfig: {},
|
currentpagerConfig: {},
|
||||||
headerCellStyle: {
|
headerCellStyle: {
|
||||||
// "background-color ": 'rgba(48, 60, 86, 1)',
|
// "background-color ": 'rgba(48, 60, 86, 1)',
|
||||||
// color: 'white'
|
// color: 'white'
|
||||||
},
|
},
|
||||||
listPageHeight: '100%',
|
listPageHeight: '100%',
|
||||||
tableHeight: 0,
|
tableHeight: 0,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageOffset: 0,
|
pageOffset: 0,
|
||||||
canQuery: true, // 查询按钮是否可点
|
canQuery: true, // 查询按钮是否可点
|
||||||
thirdQRCodeMakeUrl: 'http://s.jiathis.com/qrcode.php?url='
|
thirdQRCodeMakeUrl: 'http://s.jiathis.com/qrcode.php?url='
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
globalPagerConfig: function() {
|
globalPagerConfig: function() {
|
||||||
const pagerConfig = {
|
const pagerConfig = {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNow'
|
pageIndex: 'pageNow'
|
||||||
};
|
};
|
||||||
return pagerConfig;
|
return pagerConfig;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
const self = this;
|
const self = this;
|
||||||
// queryList 如果没有data属性,就创建并赋值为[]
|
// queryList 如果没有data属性,就创建并赋值为[]
|
||||||
if (!this.queryList.data) {
|
if (!this.queryList.data) {
|
||||||
this.$set(this.queryList, 'data', []);
|
this.$set(this.queryList, 'data', []);
|
||||||
}
|
}
|
||||||
// queryList 如果没有total属性,就创建并赋值为0
|
// queryList 如果没有total属性,就创建并赋值为0
|
||||||
if (!this.queryList.total) {
|
if (!this.queryList.total) {
|
||||||
this.$set(this.queryList, 'total', 0);
|
this.$set(this.queryList, 'total', 0);
|
||||||
}
|
}
|
||||||
// 如果设置了pageConfig就使用它,否则使用globalPageConfig
|
// 如果设置了pageConfig就使用它,否则使用globalPageConfig
|
||||||
if (!this.pagerConfig) {
|
if (!this.pagerConfig) {
|
||||||
this.currentpagerConfig = Object.assign({}, this.globalPagerConfig);
|
this.currentpagerConfig = Object.assign({}, this.globalPagerConfig);
|
||||||
} else {
|
} else {
|
||||||
this.currentpagerConfig = Object.assign({}, this.pagerConfig);
|
this.currentpagerConfig = Object.assign({}, this.pagerConfig);
|
||||||
}
|
}
|
||||||
// queryList 如果没有selection属性,就创建并赋值为[]
|
// queryList 如果没有selection属性,就创建并赋值为[]
|
||||||
if (!this.queryList.selection) {
|
if (!this.queryList.selection) {
|
||||||
this.$set(this.queryList, 'selection', []);
|
this.$set(this.queryList, 'selection', []);
|
||||||
}
|
}
|
||||||
// 给queryList添加数据重载的方法
|
// 给queryList添加数据重载的方法
|
||||||
this.queryList.reload = function() {
|
this.queryList.reload = function() {
|
||||||
return self.commitQuery();
|
return self.commitQuery();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.commitQuery();
|
// this.commitQuery();
|
||||||
// this.tableHeight = this.$refs.table2.$el.offsetHeight + 23;
|
// this.tableHeight = this.$refs.table2.$el.offsetHeight + 23;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 根据类型显示
|
// 根据类型显示
|
||||||
checkColumnTyep(column, typeName) {
|
checkColumnTyep(column, typeName) {
|
||||||
if (column.show === false) {
|
if (column.show === false) {
|
||||||
return false;
|
return false;
|
||||||
} else if (column.isShow) {
|
} else if (column.isShow) {
|
||||||
return column.isShow();
|
return column.isShow();
|
||||||
}
|
}
|
||||||
if (typeof column.type === 'undefined') {
|
if (typeof column.type === 'undefined') {
|
||||||
if (column.formatter instanceof Function) {
|
if (column.formatter instanceof Function) {
|
||||||
column.type = 'formatter';
|
column.type = 'formatter';
|
||||||
} else {
|
} else {
|
||||||
column.type = 'basic';
|
column.type = 'basic';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 类型是否匹配
|
// 类型是否匹配
|
||||||
const typeFlag = column.type === typeName;
|
const typeFlag = column.type === typeName;
|
||||||
return typeFlag;
|
return typeFlag;
|
||||||
},
|
},
|
||||||
isTableBtnDisabled(button, index, row) {
|
isTableBtnDisabled(button, index, row) {
|
||||||
if (button.isDisabled) {
|
if (button.isDisabled) {
|
||||||
return button.isDisabled(index, row);
|
return button.isDisabled(index, row);
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 计算列表的列为链接时显示的名称,可能为列对象的字段
|
// 计算列表的列为链接时显示的名称,可能为列对象的字段
|
||||||
getTableBtnName(btnName, index, row) {
|
getTableBtnName(btnName, index, row) {
|
||||||
if (typeof btnName.trim() === 'function') {
|
if (typeof btnName.trim() === 'function') {
|
||||||
return btnName(index, row);
|
return btnName(index, row);
|
||||||
} else {
|
} else {
|
||||||
return btnName;
|
return btnName;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 按钮查询
|
// 按钮查询
|
||||||
query(queryData) {
|
query(queryData) {
|
||||||
this.queryData = queryData;
|
this.queryData = queryData;
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
},
|
},
|
||||||
// 导出操作
|
// 导出操作
|
||||||
queryExport(queryData) {
|
queryExport(queryData) {
|
||||||
const self = this;
|
const self = this;
|
||||||
self.disableQuery();
|
self.disableQuery();
|
||||||
self.queryData = queryData;
|
self.queryData = queryData;
|
||||||
import('@/utils/Export2Excel').then(excel => {
|
import('@/utils/Export2Excel').then(excel => {
|
||||||
const tHeader = self.queryForm.exportConfig.header;
|
const tHeader = self.queryForm.exportConfig.header;
|
||||||
self.prepareExportData().then(data => {
|
self.prepareExportData().then(data => {
|
||||||
excel.export_json_to_excel(tHeader, data, self.queryForm.exportConfig.filename);
|
excel.export_json_to_excel(tHeader, data, self.queryForm.exportConfig.filename);
|
||||||
self.enableQuery();
|
self.enableQuery();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
self.enableQuery();
|
self.enableQuery();
|
||||||
self.$message.error(`${this.$t('error.exportFailed')}: ${error.message}`);
|
self.$message.error(`${this.$t('error.exportFailed')}: ${error.message}`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 导出数据准备
|
// 导出数据准备
|
||||||
prepareExportData() {
|
prepareExportData() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const filterVals = this.queryForm.exportConfig.filterVals;
|
const filterVals = this.queryForm.exportConfig.filterVals;
|
||||||
this.queryExportData().then(result => {
|
this.queryExportData().then(result => {
|
||||||
const list = result.list;
|
const list = result.list;
|
||||||
const data = this.formatJson(filterVals, list);
|
const data = this.formatJson(filterVals, list);
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 格式化数据列表
|
// 格式化数据列表
|
||||||
formatJson(filterVals, list) {
|
formatJson(filterVals, list) {
|
||||||
return list.map(v => filterVals.map(fv => {
|
return list.map(v => filterVals.map(fv => {
|
||||||
let keys = [];
|
let keys = [];
|
||||||
if (typeof (fv) === 'string') {
|
if (typeof (fv) === 'string') {
|
||||||
keys = fv.split('.');
|
keys = fv.split('.');
|
||||||
} else {
|
} else {
|
||||||
keys = fv.key.split('.');
|
keys = fv.key.split('.');
|
||||||
}
|
}
|
||||||
let obj = v;
|
let obj = v;
|
||||||
keys.forEach(element => {
|
keys.forEach(element => {
|
||||||
obj = obj[element];
|
obj = obj[element];
|
||||||
});
|
});
|
||||||
if (fv.type === 'date') {
|
if (fv.type === 'date') {
|
||||||
const format = fv.format || 'yyyy-MM-dd';
|
const format = fv.format || 'yyyy-MM-dd';
|
||||||
return new Date(obj).Format(format);
|
return new Date(obj).Format(format);
|
||||||
} else if (fv.formatter instanceof Function) {
|
} else if (fv.formatter instanceof Function) {
|
||||||
return fv.formatter(v);
|
return fv.formatter(v);
|
||||||
} else {
|
} else {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
// 查询需要导出的数据列表
|
// 查询需要导出的数据列表
|
||||||
queryExportData() {
|
queryExportData() {
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 翻页方法
|
* 翻页方法
|
||||||
* pageIndex: 翻页后是第几页
|
* pageIndex: 翻页后是第几页
|
||||||
* params: 查询条件
|
* params: 查询条件
|
||||||
**/
|
**/
|
||||||
changePage(pageIndex, params) {
|
changePage(pageIndex, params) {
|
||||||
this.pageIndex = pageIndex;
|
this.pageIndex = pageIndex;
|
||||||
this.pageOffset = (this.pageIndex - 1) * this.pageSize;
|
this.pageOffset = (this.pageIndex - 1) * this.pageSize;
|
||||||
if (params) {
|
if (params) {
|
||||||
// 如果是点查询按钮到这来的,不用混合分页信息,已经有默认的第一页信息
|
// 如果是点查询按钮到这来的,不用混合分页信息,已经有默认的第一页信息
|
||||||
this.queryData = params;
|
this.queryData = params;
|
||||||
// 以防pageSize改变, 重新赋值
|
// 以防pageSize改变, 重新赋值
|
||||||
this.queryData[this.currentpagerConfig.pageSize] = this.pageSize;
|
this.queryData[this.currentpagerConfig.pageSize] = this.pageSize;
|
||||||
} else {
|
} else {
|
||||||
// 如果是点翻页按钮到这来的,把分页信息混合到this.queryData里
|
// 如果是点翻页按钮到这来的,把分页信息混合到this.queryData里
|
||||||
this.mixinBackPageInfoToQueryData();
|
this.mixinBackPageInfoToQueryData();
|
||||||
}
|
}
|
||||||
// 加时间戳
|
// 加时间戳
|
||||||
// this.queryData._time = this.$moment()._d.getTime();
|
// this.queryData._time = this.$moment()._d.getTime();
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 改变分页大小回调函数,执行完毕后,iview会自动触发changePage事件,去查第一页数据
|
* 改变分页大小回调函数,执行完毕后,iview会自动触发changePage事件,去查第一页数据
|
||||||
*/
|
*/
|
||||||
pageSizeChange(newPageSize) {
|
pageSizeChange(newPageSize) {
|
||||||
if (newPageSize) {
|
if (newPageSize) {
|
||||||
this.pageSize = newPageSize;
|
this.pageSize = newPageSize;
|
||||||
this.changePage(1, this.queryData);
|
this.changePage(1, this.queryData);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 把分页信息混合到this.queryData里
|
* 把分页信息混合到this.queryData里
|
||||||
*/
|
*/
|
||||||
mixinBackPageInfoToQueryData() {
|
mixinBackPageInfoToQueryData() {
|
||||||
// 当前的分页信息
|
// 当前的分页信息
|
||||||
const pagerParams = {
|
const pagerParams = {
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
pageIndex: this.pageIndex,
|
pageIndex: this.pageIndex,
|
||||||
pageOffset: this.pageOffset
|
pageOffset: this.pageOffset
|
||||||
};
|
};
|
||||||
const tempPagerParams = {};
|
const tempPagerParams = {};
|
||||||
// 肯定要有pageSize
|
// 肯定要有pageSize
|
||||||
tempPagerParams[this.currentpagerConfig.pageSize] = pagerParams.pageSize || this.queryData[this.currentpagerConfig.pageSize];
|
tempPagerParams[this.currentpagerConfig.pageSize] = pagerParams.pageSize || this.queryData[this.currentpagerConfig.pageSize];
|
||||||
// 判断使用 pageIndex 还是 pageOffset
|
// 判断使用 pageIndex 还是 pageOffset
|
||||||
if (this.currentpagerConfig.pageIndex) {
|
if (this.currentpagerConfig.pageIndex) {
|
||||||
// 使用 pageIndex
|
// 使用 pageIndex
|
||||||
tempPagerParams[this.currentpagerConfig.pageIndex] = pagerParams.pageIndex || this.queryData[this.currentpagerConfig.pageIndex];
|
tempPagerParams[this.currentpagerConfig.pageIndex] = pagerParams.pageIndex || this.queryData[this.currentpagerConfig.pageIndex];
|
||||||
} else {
|
} else {
|
||||||
// 使用 pageOffset
|
// 使用 pageOffset
|
||||||
tempPagerParams[this.currentpagerConfig.pageOffset] = pagerParams.pageOffset !== undefined ? pagerParams.pageOffset : this.queryData[this.currentpagerConfig.pageOffset];
|
tempPagerParams[this.currentpagerConfig.pageOffset] = pagerParams.pageOffset !== undefined ? pagerParams.pageOffset : this.queryData[this.currentpagerConfig.pageOffset];
|
||||||
}
|
}
|
||||||
// 将分页信息封装到查询条件中
|
// 将分页信息封装到查询条件中
|
||||||
this.queryData = { ...this.queryData, ...tempPagerParams };
|
this.queryData = { ...this.queryData, ...tempPagerParams };
|
||||||
},
|
},
|
||||||
preCommitQueryHandler() {
|
preCommitQueryHandler() {
|
||||||
// 填充表单
|
// 填充表单
|
||||||
// this.$refs.form2.initFormData(this.queryData);
|
// this.$refs.form2.initFormData(this.queryData);
|
||||||
// 预设分页组件
|
// 预设分页组件
|
||||||
this.pageIndex = parseInt(this.queryData[this.currentpagerConfig.pageIndex] || this.pageIndex);
|
this.pageIndex = parseInt(this.queryData[this.currentpagerConfig.pageIndex] || this.pageIndex);
|
||||||
this.pageSize = parseInt(this.queryData[this.currentpagerConfig.pageSize]);
|
this.pageSize = parseInt(this.queryData[this.currentpagerConfig.pageSize]);
|
||||||
},
|
},
|
||||||
commitQuery() {
|
commitQuery() {
|
||||||
const self = this;
|
const self = this;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
self.disableQuery();
|
self.disableQuery();
|
||||||
self.mixinBackPageInfoToQueryData();
|
self.mixinBackPageInfoToQueryData();
|
||||||
const postData = this.queryData;
|
const postData = this.queryData;
|
||||||
if (postData === false) {
|
if (postData === false) {
|
||||||
self.enableQuery();
|
self.enableQuery();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.queryList.query instanceof Function) {
|
if (this.queryList.query instanceof Function) {
|
||||||
this.queryList.query(this.queryData).then(response => {
|
this.queryList.query(this.queryData).then(response => {
|
||||||
self.enableQuery();
|
self.enableQuery();
|
||||||
if (this.queryList.afterQuery && this.queryList.afterQuery instanceof Function) {
|
if (this.queryList.afterQuery && this.queryList.afterQuery instanceof Function) {
|
||||||
this.queryList.afterQuery(response.data);
|
this.queryList.afterQuery(response.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
const resultData = response.data;
|
const resultData = response.data;
|
||||||
this.$set(this.queryList, 'data', resultData.list);
|
this.$set(this.queryList, 'data', resultData.list);
|
||||||
this.$set(this.queryList, 'total', resultData.total);
|
this.$set(this.queryList, 'total', resultData.total);
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
self.enableQuery();
|
self.enableQuery();
|
||||||
this.$message.error(`${this.$t('error.getListFailed')}:${error.message}`);
|
this.$message.error(`${this.$t('error.getListFailed')}:${error.message}`);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
const data = this.queryList.data;
|
const data = this.queryList.data;
|
||||||
if (data) {
|
if (data) {
|
||||||
self.enableQuery();
|
self.enableQuery();
|
||||||
if (this.queryList.afterQuery && this.queryList.afterQuery instanceof Function) {
|
if (this.queryList.afterQuery && this.queryList.afterQuery instanceof Function) {
|
||||||
this.queryList.afterQuery(data);
|
this.queryList.afterQuery(data);
|
||||||
}
|
}
|
||||||
this.$set(this.queryList, 'data', data);
|
this.$set(this.queryList, 'data', data);
|
||||||
|
|
||||||
let total = this.queryList.total;
|
let total = this.queryList.total;
|
||||||
if (!total) {
|
if (!total) {
|
||||||
total = this.queryList.data.length;
|
total = this.queryList.data.length;
|
||||||
}
|
}
|
||||||
this.$set(this.queryList, 'total', total);
|
this.$set(this.queryList, 'total', total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
enableQuery() {
|
enableQuery() {
|
||||||
this.canQuery = true;
|
this.canQuery = true;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
disableQuery() {
|
disableQuery() {
|
||||||
// 禁止查询按钮
|
// 禁止查询按钮
|
||||||
this.canQuery = false;
|
this.canQuery = false;
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
// 清空表格的数据
|
// 清空表格的数据
|
||||||
// this.queryList.data = [];
|
// this.queryList.data = [];
|
||||||
},
|
},
|
||||||
onSelect(selection, row) {
|
onSelect(selection, row) {
|
||||||
this.queryList.onSelect && this.queryList.onSelect(selection, row);
|
this.queryList.onSelect && this.queryList.onSelect(selection, row);
|
||||||
this.queryList.selection = selection;
|
this.queryList.selection = selection;
|
||||||
},
|
},
|
||||||
onSelectAll(selection) {
|
onSelectAll(selection) {
|
||||||
this.queryList.onSelectAll && this.queryList.onSelectAll(selection);
|
this.queryList.onSelectAll && this.queryList.onSelectAll(selection);
|
||||||
this.queryList.selection = selection;
|
this.queryList.selection = selection;
|
||||||
},
|
},
|
||||||
onSelectionChange(selection) {
|
onSelectionChange(selection) {
|
||||||
this.queryList.onSelectionChange && this.queryList.onSelectionChange(selection);
|
this.queryList.onSelectionChange && this.queryList.onSelectionChange(selection);
|
||||||
this.queryList.selection = selection;
|
this.queryList.selection = selection;
|
||||||
},
|
},
|
||||||
onRowClick(row) {
|
onRowClick(row) {
|
||||||
this.choose = row;
|
this.choose = row;
|
||||||
},
|
},
|
||||||
currentChoose() {
|
currentChoose() {
|
||||||
return this.choose;
|
return this.choose;
|
||||||
},
|
},
|
||||||
refresh(flag) {
|
refresh(flag) {
|
||||||
if (flag) {
|
if (flag) {
|
||||||
this.commitQuery();
|
this.commitQuery();
|
||||||
}
|
}
|
||||||
this.queryList.data = [...this.queryList.data];
|
this.queryList.data = [...this.queryList.data];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@ export default {
|
|||||||
passedScriptFailed: 'Passed script failed',
|
passedScriptFailed: 'Passed script failed',
|
||||||
rejectScriptSuccess: 'Reject script success',
|
rejectScriptSuccess: 'Reject script success',
|
||||||
rejectScriptFailed: 'Reject script failed',
|
rejectScriptFailed: 'Reject script failed',
|
||||||
|
passedRunPlanSuccess: 'Passed run plan success',
|
||||||
|
passedRunPlanFailed: 'Passed run plan failed',
|
||||||
|
rejectRunPlanSuccess: 'reject run plan success',
|
||||||
|
rejectRunPlanFailed: 'reject run plan failed',
|
||||||
runPlanName: 'Run Plan Name',
|
runPlanName: 'Run Plan Name',
|
||||||
passedRunPlan: 'Passed Run Plan',
|
passedRunPlan: 'Passed Run Plan',
|
||||||
rejectRunPlan: 'Reject Run Plan',
|
rejectRunPlan: 'Reject Run Plan',
|
||||||
|
@ -5,6 +5,7 @@ export default {
|
|||||||
lessonName: 'Lesson Name',
|
lessonName: 'Lesson Name',
|
||||||
updateMapName: 'Update Map Name',
|
updateMapName: 'Update Map Name',
|
||||||
updateCityName: 'Update City',
|
updateCityName: 'Update City',
|
||||||
|
updateLesson: 'Modify Lesson',
|
||||||
updateTime: 'Update Time',
|
updateTime: 'Update Time',
|
||||||
operationSuccess: 'Operate successfully',
|
operationSuccess: 'Operate successfully',
|
||||||
deleteSuccess: 'Delete successfully',
|
deleteSuccess: 'Delete successfully',
|
||||||
|
@ -232,6 +232,7 @@ export default {
|
|||||||
enterCourseName: 'Please enter the course name',
|
enterCourseName: 'Please enter the course name',
|
||||||
selectAssociatedProduct: 'Please select the associated product',
|
selectAssociatedProduct: 'Please select the associated product',
|
||||||
enterCourseDescription: 'Please enter the course description',
|
enterCourseDescription: 'Please enter the course description',
|
||||||
|
pleaseLessonIntroduction: 'Please enter the course description',
|
||||||
courseIdIsEmpty: 'Course Id is empty',
|
courseIdIsEmpty: 'Course Id is empty',
|
||||||
selectCity: 'Please select city',
|
selectCity: 'Please select city',
|
||||||
enterStandardTime: 'Please enter standard time',
|
enterStandardTime: 'Please enter standard time',
|
||||||
|
@ -205,5 +205,6 @@ export default {
|
|||||||
publishTheCourseHint: 'This operation will publish the course. Are you sure?',
|
publishTheCourseHint: 'This operation will publish the course. Are you sure?',
|
||||||
rejectedCourseReleaseApplicationSuccessful: 'Rejected course release application successful!',
|
rejectedCourseReleaseApplicationSuccessful: 'Rejected course release application successful!',
|
||||||
rejectedCourseReleaseApplicationFailed: 'Rejected course release application failed!',
|
rejectedCourseReleaseApplicationFailed: 'Rejected course release application failed!',
|
||||||
duplicatePlanFailedTips: 'The interval needs to be more than 30 seconds or the times is more than 1'
|
duplicatePlanFailedTips: 'The interval needs to be more than 30 seconds or the times is more than 1',
|
||||||
|
createSwitchPortion: 'The relevant turnout is not formed'
|
||||||
};
|
};
|
||||||
|
@ -21,6 +21,12 @@ export default {
|
|||||||
passedScriptFailed: '通过剧本失败',
|
passedScriptFailed: '通过剧本失败',
|
||||||
rejectScriptSuccess: '驳回剧本成功',
|
rejectScriptSuccess: '驳回剧本成功',
|
||||||
rejectScriptFailed: '驳回剧本失败',
|
rejectScriptFailed: '驳回剧本失败',
|
||||||
|
|
||||||
|
passedRunPlanSuccess: '通过剧本成功',
|
||||||
|
passedRunPlanFailed: '通过剧本失败',
|
||||||
|
rejectRunPlanSuccess: '驳回剧本成功',
|
||||||
|
rejectRunPlanFailed: '驳回剧本失败',
|
||||||
|
|
||||||
runPlanName: '运行图名称',
|
runPlanName: '运行图名称',
|
||||||
passedRunPlan: '通过运行图',
|
passedRunPlan: '通过运行图',
|
||||||
rejectRunPlan: '驳回运行图',
|
rejectRunPlan: '驳回运行图',
|
||||||
|
@ -6,6 +6,7 @@ export default {
|
|||||||
updateMapName: '更新地图名称',
|
updateMapName: '更新地图名称',
|
||||||
updateCityName: '更新城市',
|
updateCityName: '更新城市',
|
||||||
updateTime: '更新时间',
|
updateTime: '更新时间',
|
||||||
|
updateLesson: '修改课程',
|
||||||
operationSuccess: '操作成功',
|
operationSuccess: '操作成功',
|
||||||
deleteSuccess: '删除成功',
|
deleteSuccess: '删除成功',
|
||||||
wellDelType: '此操作将删除该类型, 是否继续?',
|
wellDelType: '此操作将删除该类型, 是否继续?',
|
||||||
|
@ -242,6 +242,7 @@ export default {
|
|||||||
enterCourseName: '请输入课程名称',
|
enterCourseName: '请输入课程名称',
|
||||||
selectAssociatedProduct: '请选择关联产品',
|
selectAssociatedProduct: '请选择关联产品',
|
||||||
enterCourseDescription: '请输入课程说明',
|
enterCourseDescription: '请输入课程说明',
|
||||||
|
pleaseLessonIntroduction: '请输入课程简介',
|
||||||
courseIdIsEmpty: '课程Id为空',
|
courseIdIsEmpty: '课程Id为空',
|
||||||
selectCity: '请选择城市',
|
selectCity: '请选择城市',
|
||||||
enterStandardTime: '请输入标准用时',
|
enterStandardTime: '请输入标准用时',
|
||||||
|
@ -205,5 +205,6 @@ export default {
|
|||||||
publishTheCourseHint: '此操作将发布课程,是否确定?',
|
publishTheCourseHint: '此操作将发布课程,是否确定?',
|
||||||
rejectedCourseReleaseApplicationSuccessful: '驳回课程发布申请成功!',
|
rejectedCourseReleaseApplicationSuccessful: '驳回课程发布申请成功!',
|
||||||
rejectedCourseReleaseApplicationFailed: '驳回课程发布申请失败!',
|
rejectedCourseReleaseApplicationFailed: '驳回课程发布申请失败!',
|
||||||
duplicatePlanFailedTips: '间隔时间需要大于30秒或次数大于1'
|
duplicatePlanFailedTips: '间隔时间需要大于30秒或次数大于1',
|
||||||
|
createSwitchPortion: '相关道岔未生成'
|
||||||
};
|
};
|
||||||
|
@ -40,6 +40,7 @@ class Jlmap {
|
|||||||
initMapInstance(opts) {
|
initMapInstance(opts) {
|
||||||
const width = opts.dom.clientWidth;
|
const width = opts.dom.clientWidth;
|
||||||
const height = opts.dom.clientHeight;
|
const height = opts.dom.clientHeight;
|
||||||
|
this.zoomOnMouseWheel = opts.options.zoomOnMouseWheel;
|
||||||
|
|
||||||
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
|
this.$zr = zrender.init(opts.dom, deepAssign({ renderer, devicePixelRatio, width, height }, opts.config));
|
||||||
|
|
||||||
@ -125,6 +126,7 @@ class Jlmap {
|
|||||||
if (this.$options.disabled == true) {
|
if (this.$options.disabled == true) {
|
||||||
this.$mouseController.disable();
|
this.$mouseController.disable();
|
||||||
} else {
|
} else {
|
||||||
|
opts['zoomOnMouseWheel'] = this.zoomOnMouseWheel;
|
||||||
this.$mouseController.enable(opts);
|
this.$mouseController.enable(opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
<template>
|
|
||||||
<section class="app-main">
|
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
|
||||||
<transition name="fade" mode="out-in">
|
|
||||||
<router-view />
|
|
||||||
</transition>
|
|
||||||
</el-scrollbar>
|
|
||||||
</section>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'AppMain',
|
|
||||||
computed: {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
@ -26,17 +26,18 @@ export default {
|
|||||||
Qcode
|
Qcode
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
entryList: [
|
entryList: [
|
||||||
{
|
{
|
||||||
name: 'global.designPlatformEntrance',
|
name: 'global.designPlatformEntrance',
|
||||||
handle: this.goToDesign,
|
handle: this.goToDesign,
|
||||||
hidden: getSessionStorage('project') === 'design'
|
hidden: getSessionStorage('project').startsWith('design')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'global.trainingPlatformEntrance',
|
name: 'global.trainingPlatformEntrance',
|
||||||
handle: this.goToTraining,
|
handle: this.goToTraining,
|
||||||
hidden: getSessionStorage('project') !== 'design'
|
hidden: !getSessionStorage('project').startsWith('design')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'global.scan',
|
name: 'global.scan',
|
||||||
@ -46,7 +47,7 @@ export default {
|
|||||||
{
|
{
|
||||||
name: 'global.quickEntry',
|
name: 'global.quickEntry',
|
||||||
handle: this.quickEntry,
|
handle: this.quickEntry,
|
||||||
hidden: getSessionStorage('project') === 'design'
|
hidden: getSessionStorage('project').startsWith('design')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: LangStorage.getLang('zh')==='zh'?'English':'中文',
|
name: LangStorage.getLang('zh')==='zh'?'English':'中文',
|
||||||
@ -62,6 +63,9 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
username() {
|
username() {
|
||||||
return this.$store.state.user.nickname;
|
return this.$store.state.user.nickname;
|
||||||
|
},
|
||||||
|
project() {
|
||||||
|
return getSessionStorage('project');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@ -81,19 +85,37 @@ export default {
|
|||||||
},
|
},
|
||||||
goToDesign() {
|
goToDesign() {
|
||||||
const routeData = this.$router.resolve({
|
const routeData = this.$router.resolve({
|
||||||
path: '/design'
|
path: this.getPath()
|
||||||
});
|
});
|
||||||
window.open(routeData.href, '_blank');
|
window.open(routeData.href, '_blank');
|
||||||
},
|
},
|
||||||
goToTraining() {
|
goToTraining() {
|
||||||
const routeData = this.$router.resolve({
|
const routeData = this.$router.resolve({
|
||||||
path: '/'
|
path: this.getPath()
|
||||||
});
|
});
|
||||||
window.open(routeData.href, '_blank');
|
window.open(routeData.href, '_blank');
|
||||||
},
|
},
|
||||||
switchLanguage() {
|
switchLanguage() {
|
||||||
this.$i18n.locale = this.lang;
|
this.$i18n.locale = this.lang;
|
||||||
LangStorage.setLang(this.lang);
|
LangStorage.setLang(this.lang);
|
||||||
|
},
|
||||||
|
getPath() {
|
||||||
|
let path = '/';
|
||||||
|
switch (this.project) {
|
||||||
|
case 'login':
|
||||||
|
path = '/design/login';
|
||||||
|
break;
|
||||||
|
case 'xty':
|
||||||
|
path='/designxty/login';
|
||||||
|
break;
|
||||||
|
case 'design':
|
||||||
|
path = '/login';
|
||||||
|
break;
|
||||||
|
case 'designxty':
|
||||||
|
path= '/xty/login';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
export { default as Navbar } from './Navbar';
|
export { default as Navbar } from './Navbar';
|
||||||
export { default as Sidebar } from './Sidebar';
|
export { default as Sidebar } from './Sidebar';
|
||||||
export { default as AppMain } from './AppMain';
|
// export { default as AppMain } from './AppMain';
|
||||||
|
@ -119,7 +119,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import md5 from 'js-md5';
|
import md5 from 'js-md5';
|
||||||
import { getInfo } from '@/api/login';
|
import { getInfo } from '@/api/login';
|
||||||
import { getDesignToken } from '@/utils/auth'; // 验权
|
import { getDesignToken, getToken } from '@/utils/auth'; // 验权
|
||||||
import { getUserinfoName, getUserinfoNickname, getUserinfoMobile, getUserinfoMobileCode, getUserinfoEmailCode, getUserinfoEmail, getUserinfoPassword } from '@/api/management/user';
|
import { getUserinfoName, getUserinfoNickname, getUserinfoMobile, getUserinfoMobileCode, getUserinfoEmailCode, getUserinfoEmail, getUserinfoPassword } from '@/api/management/user';
|
||||||
import { setInterval, clearInterval } from 'timers';
|
import { setInterval, clearInterval } from 'timers';
|
||||||
|
|
||||||
@ -187,7 +187,8 @@ export default {
|
|||||||
},
|
},
|
||||||
doShow() {
|
doShow() {
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
getInfo(getDesignToken()).then(response => {
|
const token = getToken() || getDesignToken();
|
||||||
|
getInfo(token).then(response => {
|
||||||
const user = response.data;
|
const user = response.data;
|
||||||
this.userInfo = {
|
this.userInfo = {
|
||||||
name: user.name,
|
name: user.name,
|
||||||
|
@ -2,22 +2,28 @@
|
|||||||
<div class="app-wrapper" :class="classObj">
|
<div class="app-wrapper" :class="classObj">
|
||||||
<div class="main-container">
|
<div class="main-container">
|
||||||
<navbar />
|
<navbar />
|
||||||
<app-main :style="{width: width+'px', height: height+'px'}" />
|
<section class="app-main" :style="{height: height+'px'}">
|
||||||
<el-footer style="height:30px;text-align:right;line-height: 30px;">
|
<!-- <el-scrollbar wrap-class="scrollbar-wrapper app_scrollbar_box"> -->
|
||||||
<span style="font-size:14px;">Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号</span>
|
<transition name="fade" mode="out-in">
|
||||||
|
<router-view />
|
||||||
|
</transition>
|
||||||
|
<!-- </el-scrollbar> -->
|
||||||
|
</section>
|
||||||
|
<el-footer class="footers" style="height:30px;">
|
||||||
|
<div style="font-size:14px;float:left;">北京玖琏科技有限公司 联系电话: 13201793090 </div>
|
||||||
|
<div style="font-size:14px;float:right;">Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号</div>
|
||||||
</el-footer>
|
</el-footer>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { Navbar, AppMain } from './components'; // Sidebar
|
import { Navbar } from './components'; // Sidebar
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Layout',
|
name: 'Layout',
|
||||||
components: {
|
components: {
|
||||||
Navbar,
|
Navbar
|
||||||
AppMain
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -40,7 +46,7 @@ export default {
|
|||||||
return this.$store.state.app.width;
|
return this.$store.state.app.width;
|
||||||
},
|
},
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height-60-30;
|
return this.$store.state.app.height - 90;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -70,6 +76,10 @@ export default {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app-main{
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
.drawer-bg {
|
.drawer-bg {
|
||||||
background: #000;
|
background: #000;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
@ -79,5 +89,65 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
|
.footers{
|
||||||
|
line-height: 30px;
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
bottom: 0;
|
||||||
|
background: #fff;
|
||||||
|
border-top: 1px #ebeef5 solid;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style rel="stylesheet/scss" lang="scss">
|
||||||
|
.app_scrollbar_box{
|
||||||
|
.el-scrollbar__view{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义公共card样式
|
||||||
|
.joylink-card{
|
||||||
|
border: 1px solid #EBEEF5;
|
||||||
|
background-color: #FFF;
|
||||||
|
color: #303133;
|
||||||
|
transition: .3s;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 谷歌、safari、qq浏览器、360浏览器滚动条样式
|
||||||
|
// 定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
// height: 110px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
/*定义滚动条轨道 内阴影+圆角*/
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
// box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #FFFFFF;;
|
||||||
|
}
|
||||||
|
/*定义滑块 内阴影+圆角*/
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
border-radius: 10px;
|
||||||
|
// box-shadow: inset 0 0 6px rgba(0,0,0,.3);
|
||||||
|
background-color: #eaeaea;
|
||||||
|
}
|
||||||
|
/*滑块效果*/
|
||||||
|
::-webkit-scrollbar-thumb:hover {
|
||||||
|
border-radius: 5px;
|
||||||
|
// box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
|
||||||
|
background: rgba(0,0,0,0.4);
|
||||||
|
}
|
||||||
|
/*IE滚动条颜色*/
|
||||||
|
html {
|
||||||
|
scrollbar-face-color:#bfbfbf;/*滚动条颜色*/
|
||||||
|
scrollbar-highlight-color:#000;
|
||||||
|
scrollbar-3dlight-color:#000;
|
||||||
|
scrollbar-darkshadow-color:#000;
|
||||||
|
scrollbar-Shadow-color:#adadad;/*滑块边色*/
|
||||||
|
scrollbar-arrow-color:rgba(0,0,0,0.4);/*箭头颜色*/
|
||||||
|
scrollbar-track-color:#eeeeee;/*背景颜色*/
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -10,12 +10,12 @@ import { getSessionStorage } from '@/utils/auth';
|
|||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
|
|
||||||
function hasPermission(roles, permissionRoles) {
|
function hasPermission(roles, permissionRoles) {
|
||||||
if (roles.indexOf(admin) >= 0) return true;
|
if (roles.indexOf(admin) >= 0) return true;
|
||||||
if (!permissionRoles) return true;
|
if (!permissionRoles) return true;
|
||||||
return roles.some(role => permissionRoles.indexOf(role) >= 0);
|
return roles.some(role => permissionRoles.indexOf(role) >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const whiteList = ['/login', '/design/login', '/xty/login']; // 不重定向白名单
|
const whiteList = ['/login', '/design/login', '/xty/login', '/designxty/login']; // 不重定向白名单
|
||||||
|
|
||||||
const loginPage = whiteList[0];
|
const loginPage = whiteList[0];
|
||||||
|
|
||||||
@ -23,108 +23,110 @@ const loginDesignPage = whiteList[1];
|
|||||||
|
|
||||||
const loginXtyPage = whiteList[2];
|
const loginXtyPage = whiteList[2];
|
||||||
|
|
||||||
|
const loginDesignXtyPage = whiteList[3];
|
||||||
|
|
||||||
// 获取路径数据
|
// 获取路径数据
|
||||||
function getRouteInfo(to) {
|
function getRouteInfo(to) {
|
||||||
let loginPath = '/';
|
let loginPath = '/';
|
||||||
let getTokenInfo = () => { };
|
let getTokenInfo = () => { };
|
||||||
let clientId = '';
|
let clientId = '';
|
||||||
const toRoutePath = to.redirectedFrom || to.path;
|
const toRoutePath = to.redirectedFrom || to.path;
|
||||||
if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/system/.test(toRoutePath)|| /^\/display\/record/.test(toRoutePath) || /^\/display\/manage/.test(toRoutePath) || /^\/apply/.test(toRoutePath)) {
|
if (/^\/designxty/.test(toRoutePath)) {
|
||||||
loginPath = loginDesignPage;
|
loginPath = loginDesignXtyPage;
|
||||||
getTokenInfo = getDesignToken;
|
getTokenInfo = getDesignToken;
|
||||||
clientId = LoginParams.Design.clientId;
|
clientId = LoginParams.Design.clientId;
|
||||||
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath)) {
|
} else if (/^\/design/.test(toRoutePath) || /^\/scriptDisplay/.test(toRoutePath) || /^\/publish/.test(toRoutePath) || /^\/orderauthor/.test(toRoutePath) || /^\/system/.test(toRoutePath) || /^\/display\/record/.test(toRoutePath) || /^\/display\/manage/.test(toRoutePath) || /^\/apply/.test(toRoutePath)) {
|
||||||
if (getSessionStorage('project')==='design') {
|
loginPath = getSessionStorage('project') === 'designxty' ? loginDesignXtyPage : loginDesignPage;
|
||||||
loginPath = loginDesignPage;
|
getTokenInfo = getDesignToken;
|
||||||
getTokenInfo = getDesignToken;
|
clientId = LoginParams.Design.clientId;
|
||||||
clientId = LoginParams.Design.clientId;
|
} else if (/^\/plan/.test(toRoutePath) || /^\/display\/plan/.test(toRoutePath)) {
|
||||||
} else {
|
if (getSessionStorage('project').startsWith('design')) {
|
||||||
loginPath = getSessionStorage('project')==='xty'?loginXtyPage:loginPage;
|
loginPath = getSessionStorage('project') === 'designxty' ? loginDesignXtyPage : loginDesignPage;
|
||||||
getTokenInfo = getToken;
|
getTokenInfo = getDesignToken;
|
||||||
clientId = null;
|
clientId = LoginParams.Design.clientId;
|
||||||
}
|
} else {
|
||||||
} else if ( /^\/xty/.test(toRoutePath)) {
|
loginPath = getSessionStorage('project') === 'xty' ? loginXtyPage : loginPage;
|
||||||
loginPath = loginXtyPage;
|
getTokenInfo = getToken;
|
||||||
getTokenInfo = getToken;
|
clientId = null;
|
||||||
clientId = null;
|
}
|
||||||
} else {
|
} else if ( /^\/xty/.test(toRoutePath)) {
|
||||||
loginPath = getSessionStorage('project')==='xty'?loginXtyPage:loginPage;
|
loginPath = loginXtyPage;
|
||||||
getTokenInfo = getToken;
|
getTokenInfo = getToken;
|
||||||
clientId = null;
|
clientId = null;
|
||||||
}
|
} else {
|
||||||
|
loginPath = getSessionStorage('project') === 'xty' ? loginXtyPage : loginPage;
|
||||||
|
getTokenInfo = getToken;
|
||||||
|
clientId = null;
|
||||||
|
}
|
||||||
|
|
||||||
return { clientId, loginPath, getTokenInfo };
|
return { clientId, loginPath, getTokenInfo };
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleRoute(to, from, next, routeInfo) {
|
function handleRoute(to, from, next, routeInfo) {
|
||||||
if (store.getters.roles.length === 0) {
|
if (store.getters.roles.length === 0) {
|
||||||
// 拉取用户信息
|
// 拉取用户信息
|
||||||
store.dispatch('GetInfo', routeInfo.getTokenInfo).then(res => {
|
store.dispatch('GetInfo', routeInfo.getTokenInfo).then(res => {
|
||||||
// 根据roles权限生成可访问的路由表
|
// 根据roles权限生成可访问的路由表
|
||||||
const roles = res.roles;
|
const roles = res.roles;
|
||||||
if (getSessionStorage('project')==='design') {
|
if (getSessionStorage('project').startsWith('design')) {
|
||||||
roles.push(userDesign);
|
roles.push(userDesign);
|
||||||
}
|
}
|
||||||
store.dispatch('GenerateRoutes', { roles, clientId: routeInfo.clientId }).then(() => {
|
store.dispatch('GenerateRoutes', { roles, clientId: routeInfo.clientId }).then(() => {
|
||||||
// 动态添加可访问路由表
|
// 动态添加可访问路由表
|
||||||
router.addRoutes(store.getters.addRouters);
|
router.addRoutes(store.getters.addRouters);
|
||||||
// router.addRoutes(asyncRouter1);
|
// router.addRoutes(asyncRouter1);
|
||||||
if (to.redirectedFrom) {
|
if (to.redirectedFrom) {
|
||||||
next({ path: to.redirectedFrom, replace: true });
|
next({ path: to.redirectedFrom, replace: true });
|
||||||
} else {
|
} else {
|
||||||
next({ ...to, replace: true });
|
next({ ...to, replace: true });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
store.dispatch('FedLogOut', routeInfo.clientId).then(() => {
|
store.dispatch('FedLogOut', routeInfo.clientId).then(() => {
|
||||||
Vue.prototype.$messageBox('验证失败,请重新登录!');
|
Vue.prototype.$messageBox('验证失败,请重新登录!');
|
||||||
next({ path: routeInfo.loginPath });
|
next({ path: routeInfo.loginPath });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// 除没有动态改变权限的需求可直接next() 删下方权限判断
|
// 除没有动态改变权限的需求可直接next() 删下方权限判断
|
||||||
if (hasPermission(store.getters.roles, to.meta.roles)) {
|
if (hasPermission(store.getters.roles, to.meta.roles)) {
|
||||||
if (to.path==='/404' && to.redirectedFrom==='/') {
|
if (to.path === '/404' && to.redirectedFrom === '/') {
|
||||||
if (getSessionStorage('project') === 'design') {
|
next(localStore.get('trainingPlatformRoute' + store.getters.id) || '/trainingPlatform');
|
||||||
next('/design/home');
|
} else {
|
||||||
} else {
|
next();
|
||||||
next(localStore.get('trainingPlatformRoute'+store.getters.id) ||'/trainingPlatform');
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
next({ path: '/401', replace: true, query: { noGoBack: true } });
|
||||||
next();
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
next({ path: '/401', replace: true, query: { noGoBack: true } });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start();
|
NProgress.start();
|
||||||
const routeInfo = getRouteInfo(to);
|
const routeInfo = getRouteInfo(to);
|
||||||
if (routeInfo.getTokenInfo()) {
|
if (routeInfo.getTokenInfo()) {
|
||||||
// 已登录
|
// 已登录
|
||||||
if (to.path === routeInfo.loginPath) {
|
if (to.path === routeInfo.loginPath) {
|
||||||
// 登录页面不拦截
|
// 登录页面不拦截
|
||||||
next();
|
next();
|
||||||
} else {
|
} else {
|
||||||
// 进入系统重新计算路由
|
// 进入系统重新计算路由
|
||||||
handleRoute(to, from, next, routeInfo);
|
handleRoute(to, from, next, routeInfo);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 未登录情况下
|
// 未登录情况下
|
||||||
if (whiteList.indexOf(to.path) !== -1) {
|
if (whiteList.indexOf(to.path) !== -1) {
|
||||||
// 在免登录白名单,直接进入
|
// 在免登录白名单,直接进入
|
||||||
next();
|
next();
|
||||||
} else {
|
} else {
|
||||||
// 否则全部重定向到登录页
|
// 否则全部重定向到登录页
|
||||||
next(routeInfo.loginPath);
|
next(routeInfo.loginPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
// 结束Progress
|
// 结束Progress
|
||||||
NProgress.done();
|
NProgress.done();
|
||||||
});
|
});
|
||||||
|
1804
src/router/index.js
1804
src/router/index.js
File diff suppressed because it is too large
Load Diff
@ -2200,5 +2200,11 @@ export const IbpOperation = {
|
|||||||
export const loginTitle = {
|
export const loginTitle = {
|
||||||
xty: '西铁院实训平台',
|
xty: '西铁院实训平台',
|
||||||
login: '城市轨道交通实训平台',
|
login: '城市轨道交通实训平台',
|
||||||
design: '城市轨道交通设计平台'
|
design: '城市轨道交通设计平台',
|
||||||
|
designxty: '西铁院设计平台'
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ProjectCode = {
|
||||||
|
xty: 'XTY',
|
||||||
|
designxty: 'XTY'
|
||||||
};
|
};
|
||||||
|
@ -48,7 +48,7 @@ function hasPermission(roles, route, parentsRoles) {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// return roles.some(role => route.meta.roles.indexOf(role) >= 0);
|
// return roles.some(role => route.meta.roles.indexOf(role) >= 0);
|
||||||
if (getSessionStorage('project')==='design') {
|
if (getSessionStorage('project').startsWith('design')) {
|
||||||
roles= roles.filter(function (role) {
|
roles= roles.filter(function (role) {
|
||||||
return route.meta.roles.indexOf(role) >= 0;
|
return route.meta.roles.indexOf(role) >= 0;
|
||||||
});
|
});
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
|
|
||||||
export function getBaseUrl() {
|
export function getBaseUrl() {
|
||||||
let BASE_API;
|
let BASE_API;
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// BASE_API = 'https://joylink.club/jlcloud';
|
// BASE_API = 'https://joylink.club/jlcloud';
|
||||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||||
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||||
BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||||
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
|
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
|
||||||
} else {
|
} else {
|
||||||
BASE_API = process.env.VUE_APP_BASE_API;
|
BASE_API = process.env.VUE_APP_BASE_API;
|
||||||
}
|
}
|
||||||
return BASE_API;
|
return BASE_API;
|
||||||
}
|
}
|
||||||
|
@ -158,22 +158,22 @@
|
|||||||
handleConfirmPass(data){
|
handleConfirmPass(data){
|
||||||
publishRunPlan(data.id,data).then(resp => {
|
publishRunPlan(data.id,data).then(resp => {
|
||||||
if(resp.data.length<=0){
|
if(resp.data.length<=0){
|
||||||
this.$message.success(this.$t('approval.passedScriptSuccess'));
|
this.$message.success(this.$t('approval.passedRunPlanSuccess'));
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${resp.data[0]}`);
|
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${resp.data[0]}`);
|
||||||
}
|
}
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$messageBox(`${this.$t('approval.passedScriptFailed')}: ${error.message}`);
|
this.$messageBox(`${this.$t('approval.passedRunPlanFailed')}: ${error.message}`);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleConfirmReject(data){
|
handleConfirmReject(data){
|
||||||
rejectRunPlan(data.id,data).then(resp => {
|
rejectRunPlan(data.id,data).then(resp => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
this.$message.success(this.$t('approval.rejectScriptSuccess'));
|
this.$message.success(this.$t('approval.rejectRunPlanSuccess'));
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$messageBox(`${this.$t('approval.rejectScriptFailed')}: ${error.message}`);
|
this.$messageBox(`${this.$t('approval.rejectRunPlanFailed')}: ${error.message}`);
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
import { scriptRecordNotify } from '@/api/simulation';
|
import { scriptDraftRecordNotify } from '@/api/simulation';
|
||||||
import ScriptOperate from './operate';
|
import ScriptOperate from './operate';
|
||||||
import { reviewScriptList,publishScript,rejectScript } from '@/api/designPlatform';
|
import { reviewScriptList,publishScript,rejectScript } from '@/api/designPlatform';
|
||||||
import { listPublishMap } from '@/api/jmap/map';
|
import { listPublishMap } from '@/api/jmap/map';
|
||||||
@ -148,7 +148,7 @@
|
|||||||
},
|
},
|
||||||
scriptPreview(index,row){
|
scriptPreview(index,row){
|
||||||
let mapInfo=this.allMapList.find(elem=>{return elem.id==row.mapId});
|
let mapInfo=this.allMapList.find(elem=>{return elem.id==row.mapId});
|
||||||
scriptRecordNotify(row.id).then(resp => {
|
scriptDraftRecordNotify(row.id).then(resp => {
|
||||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id,skinCode:mapInfo.skinCode,try:0};
|
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id,skinCode:mapInfo.skinCode,try:0};
|
||||||
this.$router.push({ path: `${UrlConfig.design.display}/demon`, query });
|
this.$router.push({ path: `${UrlConfig.design.display}/demon`, query });
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div slot="header" style="text-align: center;">
|
<div slot="header" style="text-align: center;">
|
||||||
<span><b>{{ $t('demonstration.simulationName') + courseModel.name }}</b></span>
|
<span><b>{{ $t('demonstration.simulationName') + courseModel.name }}</b></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="simulation-detail" :style="{ height: height-190 +'px' }">
|
<div class="simulation-detail" :style="{ height: height-230 +'px' }">
|
||||||
<p class="list-item">
|
<p class="list-item">
|
||||||
<span class="list-label">{{ $t('demonstration.productDescription') }}</span>
|
<span class="list-label">{{ $t('demonstration.productDescription') }}</span>
|
||||||
<span class="list-elem">{{ courseModel.remarks }}</span>
|
<span class="list-elem">{{ courseModel.remarks }}</span>
|
||||||
|
@ -1,196 +1,191 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div v-loading="loading" class="joylink-card map-list-main">
|
||||||
<el-card v-loading="loading" class="map-list-main" :header="$t('map.publishedMapList')">
|
<div class="clearfix">
|
||||||
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
|
<span>{{ $t('map.publishedMapList') }}</span>
|
||||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
</div>
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
|
<div class="text_item" style="height: calc(100% - 47px);">
|
||||||
<el-tree
|
<filter-city v-if="project==='design'" ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
|
||||||
ref="tree"
|
<el-input v-if="project==='design'" v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||||
:data="treeList"
|
<div style="height: calc(100% - 76px);">
|
||||||
node-key="id"
|
<el-tree ref="tree" class="tree_box" :data="treeList" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent">
|
||||||
:props="defaultProps"
|
<span slot-scope="{ node:tnode, data }">
|
||||||
highlight-current
|
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
|
||||||
:span="22"
|
<span> {{ tnode.label }}</span>
|
||||||
:filter-node-method="filterNode"
|
|
||||||
@node-click="clickEvent"
|
|
||||||
>
|
|
||||||
<!-- @node-contextmenu="showContextMenu" -->
|
|
||||||
<span slot-scope="{ node:tnode, data }" >
|
|
||||||
<span
|
|
||||||
class="el-icon-tickets"
|
|
||||||
:style="{color: data.valid ? 'green':''}"
|
|
||||||
></span>
|
|
||||||
<span> {{ tnode.label }}</span>
|
|
||||||
</span>
|
</span>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-scrollbar>
|
</div>
|
||||||
</el-card>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { listPublishMap } from '@/api/jmap/map';
|
import { listPublishMap, getMapListByProjectCode } from '@/api/jmap/map';
|
||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
import { superAdmin, admin } from '@/router';
|
import { superAdmin, admin } from '@/router';
|
||||||
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
|
||||||
import FilterCity from '@/views/components/filterCity';
|
import FilterCity from '@/views/components/filterCity';
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
|
import { ProjectCode } from '@/scripts/ConstDic';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PublicMapList',
|
name: 'PublicMapList',
|
||||||
components: {
|
components: {
|
||||||
FilterCity
|
FilterCity
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
height: {
|
width: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
},
|
}
|
||||||
width: {
|
},
|
||||||
type: Number,
|
data() {
|
||||||
required: true
|
return {
|
||||||
}
|
loading: true,
|
||||||
},
|
defaultShowKeys: [],
|
||||||
data() {
|
queryFunction: listPublishMap,
|
||||||
return {
|
filterText: '',
|
||||||
loading: true,
|
treeData: [],
|
||||||
defaultShowKeys: [],
|
treeList: [],
|
||||||
queryFunction: listPublishMap,
|
selected: {},
|
||||||
filterText: '',
|
defaultProps: {
|
||||||
treeData: [],
|
children: 'children',
|
||||||
treeList: [],
|
label: 'name'
|
||||||
selected: {},
|
},
|
||||||
defaultProps: {
|
node: {
|
||||||
children: 'children',
|
},
|
||||||
label: 'name'
|
point: {
|
||||||
},
|
x: 0,
|
||||||
node: {
|
y: 0
|
||||||
},
|
},
|
||||||
point: {
|
editModel: {},
|
||||||
x: 0,
|
localParamName: 'publish_cityCode'
|
||||||
y: 0
|
};
|
||||||
},
|
},
|
||||||
editModel: {},
|
computed: {
|
||||||
localParamName: 'publish_cityCode',
|
project() {
|
||||||
cityCode: ''
|
return getSessionStorage('project');
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
filterText(val) {
|
filterText(val) {
|
||||||
this.treeList = this.treeData.filter((res) => {
|
this.treeList = this.treeData.filter((res) => {
|
||||||
return res.name.includes(val);
|
return res.name.includes(val);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
removeSessionStorage('demonList');
|
removeSessionStorage('demonList');
|
||||||
},
|
},
|
||||||
methods: {
|
mounted() {
|
||||||
filterNode(value, data) {
|
if (this.project === 'designxty') {
|
||||||
if (!value) return true;
|
this.refresh();
|
||||||
return data.name.indexOf(value) !== -1;
|
}
|
||||||
},
|
},
|
||||||
showContextMenu(e, obj, node, vueElem) {
|
methods: {
|
||||||
if (obj) {
|
filterNode(value, data) {
|
||||||
this.node = node;
|
if (!value) return true;
|
||||||
this.selected = obj;
|
return data.name.indexOf(value) !== -1;
|
||||||
}
|
},
|
||||||
},
|
showContextMenu(e, obj, node, vueElem) {
|
||||||
clickEvent(obj, data, ele) {
|
if (obj) {
|
||||||
switch (obj.type) {
|
this.node = node;
|
||||||
case 'scriptDesign': {
|
this.selected = obj;
|
||||||
setSessionStorage('designType', 'scriptDesign');
|
}
|
||||||
this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?skinCode=${obj.skinCode}` });
|
},
|
||||||
break;
|
clickEvent(obj, data, ele) {
|
||||||
}
|
switch (obj.type) {
|
||||||
case 'lessonDesign': {
|
case 'scriptDesign': {
|
||||||
setSessionStorage('designType', 'lessonDesign');
|
setSessionStorage('designType', 'scriptDesign');
|
||||||
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}/${obj.skinCode}`, query: {cityCode: this.cityCode} });
|
this.$router.push({ path: `${UrlConfig.design.scriptHome}/${obj.mapId}?skinCode=${obj.skinCode}` });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'runPlanDesign': {
|
case 'lessonDesign': {
|
||||||
setSessionStorage('designType', 'runPlanDesign');
|
setSessionStorage('designType', 'lessonDesign');
|
||||||
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` });
|
this.$router.push({ path: `${UrlConfig.design.lessonHome}/${obj.mapId}/${obj.skinCode}`, query: {cityCode: obj.cityCode} });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'map': {
|
case 'runPlanDesign': {
|
||||||
setSessionStorage('demonList', obj.id);
|
setSessionStorage('designType', 'runPlanDesign');
|
||||||
break;
|
this.$router.push({ path: `${UrlConfig.design.runPlan}/${obj.mapId}?skinCode=${obj.skinCode}` });
|
||||||
}
|
break;
|
||||||
case 'mapPreview':{
|
}
|
||||||
this.$router.push({ path: `${UrlConfig.design.mapPreview}/${obj.mapId}` });
|
case 'map': {
|
||||||
break;
|
setSessionStorage('demonList', obj.id);
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
// this.$refs.menu.doClose();
|
case 'mapPreview': {
|
||||||
},
|
this.$router.push({ path: `${UrlConfig.design.mapPreview}/${obj.mapId}` });
|
||||||
// async myrefresh(filterSelect){
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async refresh(filterSelect) {
|
||||||
|
this.loading = true;
|
||||||
|
this.treeData = this.treeList = [];
|
||||||
|
try {
|
||||||
|
let res = '';
|
||||||
|
if (this.project === 'designxty') {
|
||||||
|
res = await getMapListByProjectCode(ProjectCode[this.project]);
|
||||||
|
} else {
|
||||||
|
res = await listPublishMap({cityCode: filterSelect});
|
||||||
|
}
|
||||||
|
|
||||||
// },
|
res.data && res.data.forEach(elem=>{
|
||||||
async refresh(filterSelect) {
|
// elem.children.find(n => { return n.name.includes("行调")})
|
||||||
this.cityCode=filterSelect;
|
elem.children = [
|
||||||
this.loading = true;
|
{
|
||||||
this.treeData = this.treeList = [];
|
id: '1',
|
||||||
try {
|
name: this.$t('designPlatform.mapPreview'),
|
||||||
const res = await listPublishMap({cityCode: filterSelect});
|
type: 'mapPreview',
|
||||||
|
mapId: elem.id,
|
||||||
res.data.forEach(elem=>{
|
cityCode: elem.cityCode
|
||||||
// debugger;
|
}
|
||||||
// elem.children.find(n => { return n.name.includes("行调")})
|
];
|
||||||
elem.children=[
|
this.isAdministrator() ? elem.children.push({id: '2', name: this.$t('designPlatform.lessonDesign'), type: 'lessonDesign', mapId: elem.id, skinCode: elem.skinCode, cityCode: elem.cityCode}) : '';
|
||||||
{
|
elem.children.push(
|
||||||
id:'1',
|
{
|
||||||
name:this.$t('designPlatform.mapPreview'),
|
id: '3',
|
||||||
type:'mapPreview',
|
name: this.$t('designPlatform.scriptDesign'),
|
||||||
mapId: elem.id
|
type: 'scriptDesign',
|
||||||
}
|
mapId: elem.id,
|
||||||
];
|
skinCode: elem.skinCode,
|
||||||
this.isAdministrator()?elem.children.push({id: '2',name: this.$t('designPlatform.lessonDesign'),type: 'lessonDesign',mapId: elem.id,skinCode: elem.skinCode}):'';
|
cityCode: elem.cityCode
|
||||||
elem.children.push(
|
// code:elem.children.find(n => { return n.name.includes("行调")})
|
||||||
{
|
});
|
||||||
id: '3',
|
elem.children.push(
|
||||||
name: this.$t('designPlatform.scriptDesign'),
|
{
|
||||||
type: 'scriptDesign',
|
id: '4',
|
||||||
mapId: elem.id,
|
name: this.$t('designPlatform.runPlanDesign'),
|
||||||
skinCode: elem.skinCode
|
type: 'runPlanDesign',
|
||||||
// code:elem.children.find(n => { return n.name.includes("行调")})
|
mapId: elem.id,
|
||||||
});
|
skinCode: elem.skinCode,
|
||||||
elem.children.push(
|
cityCode: elem.cityCode
|
||||||
{
|
}
|
||||||
id: '4',
|
);
|
||||||
name: this.$t('designPlatform.runPlanDesign'),
|
});
|
||||||
type: 'runPlanDesign',
|
this.treeData = res.data;
|
||||||
mapId: elem.id,
|
this.treeList = this.filterText
|
||||||
skinCode: elem.skinCode
|
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
|
||||||
}
|
: res.data;
|
||||||
);
|
this.$nextTick(() => {
|
||||||
});
|
const mapId = getSessionStorage('demonList') || null;
|
||||||
this.treeData = res.data;
|
this.$refs.tree.setCurrentKey(mapId);
|
||||||
this.treeList = this.filterText
|
this.loading = false;
|
||||||
? res.data.filter(elem => { return elem.name.includes(this.filterText); })
|
});
|
||||||
: res.data;
|
} catch (error) {
|
||||||
this.$nextTick(() => {
|
this.loading = false;
|
||||||
const mapId = getSessionStorage('demonList') || null;
|
this.$messageBox(this.$t('error.refreshFailed'));
|
||||||
this.$refs.tree.setCurrentKey(mapId);
|
}
|
||||||
this.loading = false;
|
},
|
||||||
});
|
resize() {
|
||||||
} catch (error) {
|
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||||
this.loading = false;
|
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||||
this.$messageBox(this.$t('error.refreshFailed'));
|
const height = this.$store.state.app.height - 90;
|
||||||
}
|
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||||
},
|
},
|
||||||
resize() {
|
isAdministrator() {
|
||||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
return this.$store.state.user.roles.includes(superAdmin) || this.$store.state.user.roles.includes(admin);
|
||||||
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 });
|
|
||||||
},
|
|
||||||
isAdministrator() {
|
|
||||||
return this.$store.state.user.roles.includes(superAdmin) || this.$store.state.user.roles.includes(admin);
|
|
||||||
},
|
|
||||||
// createMap() {
|
|
||||||
// this.$emit("createMap");
|
|
||||||
// },
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@ -205,7 +200,18 @@ export default {
|
|||||||
|
|
||||||
.map-list-main{
|
.map-list-main{
|
||||||
text-align:left;
|
text-align:left;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
.clearfix{
|
||||||
|
padding: 0 20px;
|
||||||
|
border-bottom: 1px solid #EBEEF5;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 47px;
|
||||||
|
line-height: 47px;
|
||||||
|
}
|
||||||
|
.tree_box{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.el-tree {
|
.el-tree {
|
||||||
|
@ -1,53 +1,53 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card :style="{height: height+'px'}">
|
<el-card>
|
||||||
<div class="home-box" :style="{height: height+'px'}">
|
<div class="home-box" :style="{height: height+'px'}">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||||
<h1 class="title">
|
<div class="content_box">
|
||||||
城市轨道交通设计平台
|
<h1 class="title">
|
||||||
<!-- <img :src="logo" alt="" class="logo-img"> -->
|
城市轨道交通设计平台
|
||||||
</h1>
|
</h1>
|
||||||
<div class="card-box">
|
<div class="card-box">
|
||||||
<el-carousel :interval="4000" type="card" height="380px">
|
<el-carousel :interval="4000" type="card" height="380px">
|
||||||
<el-carousel-item v-for="(item, index) in listImg" :key="index">
|
<el-carousel-item v-for="(item, index) in listImg" :key="index">
|
||||||
<img :src="item.src" alt="" height="100%" width="100%">
|
<img :src="item.src" alt="" height="100%" width="100%">
|
||||||
</el-carousel-item>
|
</el-carousel-item>
|
||||||
</el-carousel>
|
</el-carousel>
|
||||||
</div>
|
</div>
|
||||||
<div class="brief-box">{{ $t('demonstration.simulationSystemDescription') }}</div>
|
<div class="brief-box">{{ $t('demonstration.simulationSystemDescription') }}</div>
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-scrollbar>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import logo from '@/assets/logo.png';
|
import home1 from '@/assets/home/home1.png';
|
||||||
import home1 from '@/assets/home/home1.png';
|
import home2 from '@/assets/home/home2.png';
|
||||||
import home2 from '@/assets/home/home2.png';
|
import home3 from '@/assets/home/demon1.jpg';
|
||||||
import home3 from '@/assets/home/demon1.jpg';
|
import home4 from '@/assets/home/tring1.png';
|
||||||
import home4 from '@/assets/home/tring1.png';
|
import home5 from '@/assets/home/tring4.jpg';
|
||||||
import home5 from '@/assets/home/tring4.jpg';
|
import home6 from '@/assets/home/demon2.jpg';
|
||||||
import home6 from '@/assets/home/demon2.jpg';
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Home',
|
name: 'Home',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
listImg: [
|
listImg: [
|
||||||
{ src: home1 },
|
{ src: home1 },
|
||||||
{ src: home2 },
|
{ src: home2 },
|
||||||
{ src: home3 },
|
{ src: home3 },
|
||||||
{ src: home4 },
|
{ src: home4 },
|
||||||
{ src: home5 },
|
{ src: home5 },
|
||||||
{ src: home6 }
|
{ src: home6 }
|
||||||
],
|
]
|
||||||
logo: logo
|
};
|
||||||
};
|
},
|
||||||
},
|
computed: {
|
||||||
computed: {
|
height() {
|
||||||
height() {
|
return this.$store.state.app.height - 93;
|
||||||
return this.$store.state.app.height - 50-30;
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
@ -57,41 +57,43 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.home-box {
|
.home-box {
|
||||||
padding: 15px 100px;
|
|
||||||
float: left;
|
float: left;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-family: 'Microsoft YaHei';
|
font-family: 'Microsoft YaHei';
|
||||||
|
|
||||||
.title {
|
.content_box{
|
||||||
font-size: 35px;
|
padding: 0 100px 15px;
|
||||||
width: 100%;
|
}
|
||||||
text-align: center;
|
.title {
|
||||||
font-weight: 400;
|
font-size: 35px;
|
||||||
margin-top: 55px;
|
width: 100%;
|
||||||
border-bottom: 2px dashed #333;
|
text-align: center;
|
||||||
padding-bottom: 15px;
|
font-weight: 400;
|
||||||
margin-bottom: 70px;
|
margin-top: 55px;
|
||||||
position: relative;
|
border-bottom: 2px dashed #333;
|
||||||
|
padding-bottom: 15px;
|
||||||
|
margin-bottom: 70px;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
.logo-img {
|
.logo-img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 55px;
|
width: 55px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-box {
|
.card-box {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0 50px;
|
padding: 0 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.brief-box {
|
.brief-box {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
text-indent: 2em;
|
text-indent: 2em;
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
padding: 40px 20px 0;
|
padding: 40px 20px 0;
|
||||||
font-family: unset;
|
font-family: unset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-wrapper">
|
<div class="app-wrapper">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
<demon-list ref="demonList" :width="widthLeft" />
|
||||||
<demon-list ref="demonList" :height="height" :width="widthLeft" />
|
</div>
|
||||||
</div>
|
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
<transition>
|
||||||
<transition>
|
<router-view :product-list="productList" :width-left="widthLeft" />
|
||||||
<router-view :product-list="productList" :widthLeft="widthLeft"/>
|
</transition>
|
||||||
</transition>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -39,9 +37,6 @@ export default {
|
|||||||
...mapGetters([
|
...mapGetters([
|
||||||
'lessonbar'
|
'lessonbar'
|
||||||
]),
|
]),
|
||||||
height() {
|
|
||||||
return this.$store.state.app.height - 50-30;
|
|
||||||
},
|
|
||||||
width() {
|
width() {
|
||||||
return this.$store.state.app.width;
|
return this.$store.state.app.width;
|
||||||
}
|
}
|
||||||
@ -77,14 +72,14 @@ export default {
|
|||||||
resize() {
|
resize() {
|
||||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||||
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||||
const height = this.$store.state.app.height - 90;
|
// const height = this.$store.state.app.height - 90;
|
||||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
this.$store.dispatch('config/resize', { width: width });
|
||||||
},
|
},
|
||||||
setMapResize(LeftWidth) {
|
setMapResize(LeftWidth) {
|
||||||
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
||||||
const widths = this.$store.state.app.width - 521 - LeftWidth;
|
const widths = this.$store.state.app.width - 521 - LeftWidth;
|
||||||
const heights = this.$store.state.app.height - 90;
|
// const heights = this.$store.state.app.height - 90;
|
||||||
this.$store.dispatch('config/resize', { width: widths, height: heights });
|
this.$store.dispatch('config/resize', { width: widths });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -102,8 +97,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.examList {
|
.examList {
|
||||||
// position: fixed;
|
|
||||||
// top: 61px;
|
|
||||||
float: left;
|
float: left;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
@ -1,116 +1,113 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="map-view">
|
<div class="map-view">
|
||||||
<jlmap-visual ref="jlmapVisual" @onSelect="clickEvent" @onMenu="onContextmenu" />
|
<jlmap-visual ref="jlmapVisual" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import JlmapVisual from '@/views/jlmap/index';
|
import JlmapVisual from '@/views/jlmap/index';
|
||||||
import { loadMapData, loadMapDataById } from '@/utils/loaddata';
|
import { loadMapDataById } from '@/utils/loaddata';
|
||||||
export default {
|
import { EventBus } from '@/scripts/event-bus';
|
||||||
name: 'mapPreview',
|
|
||||||
components: {
|
|
||||||
JlmapVisual
|
|
||||||
},
|
|
||||||
data(){
|
|
||||||
return{
|
|
||||||
size: {
|
|
||||||
width: document.documentElement.clientWidth - 400,
|
|
||||||
height: document.documentElement.clientHeight-80
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
widthLeft: {
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
mapId() {
|
|
||||||
return this.$route.params.mapId;
|
|
||||||
},
|
|
||||||
height() {
|
|
||||||
return this.$store.state.app.height - 50-30;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async beforeDestroy() {
|
|
||||||
// await this.clearAllTimer();
|
|
||||||
// if (!this.isReplay) {
|
|
||||||
// await this.quit();
|
|
||||||
// }
|
|
||||||
// await this.$store.dispatch('training/reset');
|
|
||||||
await this.$store.dispatch('map/mapClear');
|
|
||||||
// EventBus.$off('clearCheckLogin');
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
widthLeft(val){
|
|
||||||
this.setWindowSize();
|
|
||||||
},
|
|
||||||
$route() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.initLoadData();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// '$store.state.map.mapViewLoadedCount': function (val) {
|
|
||||||
// // this.subscribe();
|
|
||||||
// debugger;
|
|
||||||
// this.$store.dispatch('map/setTrainWindowShow', false);
|
|
||||||
// },
|
|
||||||
'$store.state.app.windowSizeCount': function() {
|
|
||||||
this.setWindowSize();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
async mounted() {
|
|
||||||
await this.setWindowSize();
|
|
||||||
await this.initLoadData();
|
|
||||||
},
|
|
||||||
methods:{
|
|
||||||
async initLoadData(){
|
|
||||||
if (parseInt(this.mapId)) {
|
|
||||||
await this.loadMapDataById(this.mapId);
|
|
||||||
} else {
|
|
||||||
this.endViewLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 通过id加载地图数据
|
|
||||||
async loadMapDataById(mapId) {
|
|
||||||
try {
|
|
||||||
await this.$store.dispatch('training/changeMode', { mode: null });
|
|
||||||
await loadMapDataById(mapId);
|
|
||||||
await this.$store.dispatch('training/over');
|
|
||||||
await this.$store.dispatch('training/setMapDefaultState');
|
|
||||||
await this.$store.dispatch('map/clearJlmapTrainView');
|
|
||||||
await this.$store.dispatch('map/setTrainWindowShow', false);
|
|
||||||
} catch (error) {
|
|
||||||
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
|
||||||
this.endViewLoading();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 结束加载状态
|
|
||||||
endViewLoading(isSuccess) {
|
|
||||||
if (!isSuccess) {
|
|
||||||
this.$store.dispatch('map/mapClear');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$nextTick(() => {
|
export default {
|
||||||
EventBus.$emit('viewLoading', false);
|
name: 'MapPreview',
|
||||||
});
|
components: {
|
||||||
},
|
JlmapVisual
|
||||||
clickEvent(em){
|
},
|
||||||
|
props: {
|
||||||
|
widthLeft: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
size: {
|
||||||
|
width: document.documentElement.clientWidth - 400,
|
||||||
|
height: document.documentElement.clientHeight - 80
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
mapId() {
|
||||||
|
return this.$route.params.mapId;
|
||||||
|
},
|
||||||
|
height() {
|
||||||
|
return this.$store.state.app.height - 50-30;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
widthLeft(val) {
|
||||||
|
this.setWindowSize();
|
||||||
|
},
|
||||||
|
$route() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.initLoadData();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// '$store.state.map.mapViewLoadedCount': function (val) {
|
||||||
|
// // this.subscribe();
|
||||||
|
// debugger;
|
||||||
|
// this.$store.dispatch('map/setTrainWindowShow', false);
|
||||||
|
// },
|
||||||
|
'$store.state.app.windowSizeCount': function() {
|
||||||
|
this.setWindowSize();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async beforeDestroy() {
|
||||||
|
// await this.clearAllTimer();
|
||||||
|
// if (!this.isReplay) {
|
||||||
|
// await this.quit();
|
||||||
|
// }
|
||||||
|
// await this.$store.dispatch('training/reset');
|
||||||
|
await this.$store.dispatch('map/mapClear');
|
||||||
|
// EventBus.$off('clearCheckLogin');
|
||||||
|
},
|
||||||
|
async mounted() {
|
||||||
|
await this.setWindowSize();
|
||||||
|
await this.initLoadData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async initLoadData() {
|
||||||
|
if (parseInt(this.mapId)) {
|
||||||
|
await this.loadMapDataById(this.mapId);
|
||||||
|
} else {
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 通过id加载地图数据
|
||||||
|
async loadMapDataById(mapId) {
|
||||||
|
try {
|
||||||
|
await this.$store.dispatch('training/changeMode', { mode: null });
|
||||||
|
await loadMapDataById(mapId);
|
||||||
|
await this.$store.dispatch('training/over');
|
||||||
|
await this.$store.dispatch('training/setMapDefaultState');
|
||||||
|
await this.$store.dispatch('map/clearJlmapTrainView');
|
||||||
|
await this.$store.dispatch('map/setTrainWindowShow', false);
|
||||||
|
} catch (error) {
|
||||||
|
this.$messageBox(`获取地图数据失败: ${error.message}`);
|
||||||
|
this.endViewLoading();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 结束加载状态
|
||||||
|
endViewLoading(isSuccess) {
|
||||||
|
if (!isSuccess) {
|
||||||
|
this.$store.dispatch('map/mapClear');
|
||||||
|
}
|
||||||
|
|
||||||
},
|
this.$nextTick(() => {
|
||||||
onContextmenu(em){
|
EventBus.$emit('viewLoading', false);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
setWindowSize() {
|
setWindowSize() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const width = this.$store.state.app.width-this.widthLeft;
|
const width = this.$store.state.app.width-(this.widthLeft||450);
|
||||||
const height = this.height;
|
const height = this.height;
|
||||||
this.$store.dispatch('config/resize', { width, height });
|
this.$store.dispatch('config/resize', { width, height });
|
||||||
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
|
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.map-view {
|
.map-view {
|
||||||
|
@ -1,39 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card v-loading="loading" class="map-list-main" :header="$t('map.myMapList')">
|
<div v-loading="loading" class="joylink-card map-list-main">
|
||||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
<div class="clearfix">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-185) +'px' }">
|
<span>{{ $t('map.myMapList') }}</span>
|
||||||
<el-tree
|
</div>
|
||||||
ref="tree"
|
<div class="text_item" style="height: calc(100% - 47px);">
|
||||||
:data="treeList"
|
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||||
node-key="id"
|
<div style="height: calc(100% - 89px); overflow-y: auto;">
|
||||||
:props="defaultProps"
|
<el-tree ref="tree" :data="treeList" node-key="id" :props="defaultProps" highlight-current :span="22" :filter-node-method="filterNode" @node-click="clickEvent" @node-contextmenu="showContextMenu">
|
||||||
highlight-current
|
<span slot-scope="{ node:tnode, data }">
|
||||||
:span="22"
|
<span class="el-icon-tickets" :style="{color: data.valid ? 'green':''}" />
|
||||||
:filter-node-method="filterNode"
|
<span> {{ tnode.label }}</span>
|
||||||
@node-click="clickEvent"
|
</span>
|
||||||
@node-contextmenu="showContextMenu"
|
</el-tree>
|
||||||
>
|
</div>
|
||||||
<span slot-scope="{ node:tnode, data }">
|
<div class="buttonList">
|
||||||
<span
|
<el-button size="small" type="primary" class="eachButton uploadDemo ">
|
||||||
class="el-icon-tickets"
|
<input ref="files" type="file" class="file_box" accept=".json, application/json" @change="importf">
|
||||||
:style="{color: data.valid ? 'green':''}"
|
{{ $t('map.importMap') }}
|
||||||
></span>
|
</el-button>
|
||||||
<span> {{ tnode.label }}</span>
|
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
|
||||||
</span>
|
</div>
|
||||||
</el-tree>
|
|
||||||
</el-scrollbar>
|
|
||||||
<div class="buttonList">
|
|
||||||
<el-button size="small" type="primary" class="eachButton uploadDemo ">
|
|
||||||
<input
|
|
||||||
ref="files"
|
|
||||||
type="file"
|
|
||||||
class="file_box"
|
|
||||||
accept=".json, application/json"
|
|
||||||
@change="importf"
|
|
||||||
>
|
|
||||||
{{ $t('map.importMap') }}
|
|
||||||
</el-button>
|
|
||||||
<el-button size="small" type="primary" class="eachButton" @click="createMap">{{ $t('map.newConstruction') }}</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<map-operate-menu
|
<map-operate-menu
|
||||||
ref="menu"
|
ref="menu"
|
||||||
@ -43,7 +29,7 @@
|
|||||||
@refresh="loadInitData"
|
@refresh="loadInitData"
|
||||||
@jlmap3d="jlmap3d"
|
@jlmap3d="jlmap3d"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||||
@ -59,10 +45,6 @@ export default {
|
|||||||
MapOperateMenu
|
MapOperateMenu
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
height: {
|
|
||||||
type: Number,
|
|
||||||
required: true
|
|
||||||
},
|
|
||||||
width: {
|
width: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
@ -223,6 +205,16 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.clearfix{
|
||||||
|
padding: 0 20px;
|
||||||
|
border-bottom: 1px solid #EBEEF5;
|
||||||
|
box-sizing: border-box;
|
||||||
|
height: 47px;
|
||||||
|
line-height: 47px;
|
||||||
|
}
|
||||||
|
.tree_box{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
.buttonList{
|
.buttonList{
|
||||||
padding: 8px 0px 8px 0px;
|
padding: 8px 0px 8px 0px;
|
||||||
border-top: 1px #ccc solid;
|
border-top: 1px #ccc solid;
|
||||||
@ -249,5 +241,6 @@ export default {
|
|||||||
}
|
}
|
||||||
.map-list-main{
|
.map-list-main{
|
||||||
text-align:left;
|
text-align:left;
|
||||||
|
height: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,20 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-wrapper">
|
<div class="app-wrapper" style="height: 100%;">
|
||||||
<map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh1" @editmap="handleNodeClick" />
|
<map-create ref="mapCreate" :skin-code="skinCode" @refresh="refresh1" @editmap="handleNodeClick" />
|
||||||
<!-- <el-scrollbar wrap-class="scrollbar-wrapper"> -->
|
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||||
<div>
|
<demon-list ref="demonList" :width="widthLeft" @createMap="createMap" />
|
||||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
|
||||||
<demon-list ref="demonList" :height="height" :width="widthLeft" @createMap="createMap" />
|
|
||||||
</div>
|
|
||||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
|
||||||
<transition>
|
|
||||||
<!-- position:'relative', -->
|
|
||||||
<!-- :style="{left:widthLeft+'px', width: (width - widthLeft)+'px'}" -->
|
|
||||||
<router-view :product-list="productList" />
|
|
||||||
</transition>
|
|
||||||
</div>
|
</div>
|
||||||
|
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||||
<!-- </el-scrollbar> -->
|
<transition>
|
||||||
|
<router-view :product-list="productList" />
|
||||||
|
</transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -26,6 +19,7 @@ import { launchFullscreen } from '@/utils/screen';
|
|||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||||
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
|
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
|
||||||
|
import { UrlConfig } from '@/router/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DesignPlatform',
|
name: 'DesignPlatform',
|
||||||
@ -46,9 +40,6 @@ export default {
|
|||||||
...mapGetters([
|
...mapGetters([
|
||||||
'lessonbar'
|
'lessonbar'
|
||||||
]),
|
]),
|
||||||
height() {
|
|
||||||
return this.$store.state.app.height - 50;
|
|
||||||
},
|
|
||||||
width() {
|
width() {
|
||||||
return this.$store.state.app.width;
|
return this.$store.state.app.width;
|
||||||
}
|
}
|
||||||
@ -139,8 +130,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.examList {
|
.examList {
|
||||||
// position: fixed;
|
|
||||||
// top: 61px;
|
|
||||||
float: left;
|
float: left;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getScriptPageListOnline, getScriptById,getDraftScriptById } from '@/api/script';
|
import { getScriptPageListOnline, getScriptById,getDraftScriptByGroup } from '@/api/script';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddQuest',
|
name: 'AddQuest',
|
||||||
@ -154,7 +154,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async handleLoad(index, row) {
|
async handleLoad(index, row) {
|
||||||
this.row = row;
|
this.row = row;
|
||||||
const res = this.$route.fullPath.includes('design/display/demon')?await getDraftScriptById(row.id):await getScriptById(row.id);
|
const res = this.$route.fullPath.includes('design/display/demon')?await getDraftScriptByGroup(row.group):await getScriptById(row.id);
|
||||||
let newMemberList = [];
|
let newMemberList = [];
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
if (res.data.playerVOList && res.data.playerVOList.length > 0) {
|
if (res.data.playerVOList && res.data.playerVOList.length > 0) {
|
||||||
|
@ -258,6 +258,7 @@ export default {
|
|||||||
|
|
||||||
await this.setWindowSize();
|
await this.setWindowSize();
|
||||||
await this.initLoadData();
|
await this.initLoadData();
|
||||||
|
this.switchMode('');
|
||||||
},
|
},
|
||||||
async beforeDestroy() {
|
async beforeDestroy() {
|
||||||
await this.clearAllTimer();
|
await this.clearAllTimer();
|
||||||
@ -480,7 +481,8 @@ export default {
|
|||||||
},
|
},
|
||||||
async runAddRolesLoadShow() {
|
async runAddRolesLoadShow() {
|
||||||
// this.$refs.addQuest.doShow();
|
// this.$refs.addQuest.doShow();
|
||||||
const row={id: this.$route.query.scriptId};
|
// const row={id: this.$route.query.scriptId};
|
||||||
|
const row={group: this.$route.query.group,id: this.$route.query.scriptId};
|
||||||
this.$refs.addQuest.handleLoad(1, row);
|
this.$refs.addQuest.handleLoad(1, row);
|
||||||
},
|
},
|
||||||
// 选择脚本
|
// 选择脚本
|
||||||
@ -506,7 +508,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.switchMode(prdType);
|
this.switchMode(prdType);
|
||||||
const res = await loadDraftScript(row.id, id, this.group);
|
const res = await loadDraftScript(row.id,id, this.group);
|
||||||
if (res && res.code == 200) {
|
if (res && res.code == 200) {
|
||||||
this.questId = parseInt(row.id);
|
this.questId = parseInt(row.id);
|
||||||
if (mapLocation) {
|
if (mapLocation) {
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
<el-button v-if="isShowScheduling" type="primary" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
|
<el-button v-if="isShowScheduling" type="primary" @click="jumpScheduling">{{ $t('display.demon.dispatchingPlan') }}</el-button>
|
||||||
<el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
|
<el-button type="jumpjlmap3d" @click="jumpjlmap3d">{{ jl3dname }}</el-button>
|
||||||
<template v-if="isShowQuest">
|
<template v-if="isShowQuest">
|
||||||
<el-button type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
|
<!-- && !isDesignPlatform -->
|
||||||
|
<el-button v-if="!isDesignPlatform " type="danger" @click="handleQuitQuest">{{ $t('display.demon.exitScript') }}</el-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
|
<el-button type="success" :disabled="isDisable" @click="selectBeginTime">{{ $t('display.demon.drivingByPlan') }}</el-button>
|
||||||
@ -81,6 +82,9 @@ export default {
|
|||||||
},
|
},
|
||||||
isShowScheduling() {
|
isShowScheduling() {
|
||||||
return this.$route.query.prdType == '05';
|
return this.$route.query.prdType == '05';
|
||||||
|
},
|
||||||
|
isDesignPlatform(){
|
||||||
|
return this.$route.fullPath.includes('design/display/demon');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div slot="header" style="text-align: center;">
|
<div slot="header" style="text-align: center;">
|
||||||
<b>{{ $t('exam.courseName') + ': '+ courseModel.name }}</b>
|
<b>{{ $t('exam.courseName') + ': '+ courseModel.name }}</b>
|
||||||
</div>
|
</div>
|
||||||
<div style=" margin:50px" :style="{ height: height - 150 +'px' }">
|
<div style=" margin:50px" :style="{ height: height - 190 +'px' }">
|
||||||
<el-tabs v-model="activeName">
|
<el-tabs v-model="activeName">
|
||||||
<el-tab-pane :label="this.$t('exam.itemList')" name="first">
|
<el-tab-pane :label="this.$t('exam.itemList')" name="first">
|
||||||
<div v-if="courseModel.treeList.length != 0" :style="{ height: height - 230 +'px' }">
|
<div v-if="courseModel.treeList.length != 0" :style="{ height: height - 230 +'px' }">
|
||||||
|
@ -131,6 +131,12 @@ export default {
|
|||||||
document.getElementById(this.canvasId).oncontextmenu = function (e) {
|
document.getElementById(this.canvasId).oncontextmenu = function (e) {
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
// 默认个人地图绘制可以滚轮放大缩小 其他地图显示不允许此操作
|
||||||
|
const path = window.location.href;
|
||||||
|
let flag = false;
|
||||||
|
if (path.includes('design/userlist/map/draw')) {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
Vue.prototype.$jlmap = new Jlmap({
|
Vue.prototype.$jlmap = new Jlmap({
|
||||||
dom: document.getElementById(this.canvasId),
|
dom: document.getElementById(this.canvasId),
|
||||||
@ -142,7 +148,8 @@ export default {
|
|||||||
options: {
|
options: {
|
||||||
scaleRate: 1,
|
scaleRate: 1,
|
||||||
offsetX: 0,
|
offsetX: 0,
|
||||||
offsetY: 0
|
offsetY: 0,
|
||||||
|
zoomOnMouseWheel: flag
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
dataLoaded: this.handleDataLoaded,
|
dataLoaded: this.handleDataLoaded,
|
||||||
@ -283,7 +290,11 @@ export default {
|
|||||||
.zoom-view {
|
.zoom-view {
|
||||||
// position: fixed;
|
// position: fixed;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
height: 28px;
|
bottom: 0;
|
||||||
|
background: #fff;
|
||||||
|
padding-top: 5px;
|
||||||
|
height: 42px;
|
||||||
|
border-bottom: 1px #f3f3f3 solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ {
|
/deep/ {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card>
|
<el-card style="height: 100%; overflow-y: auto;">
|
||||||
<div slot="header" style="text-align: center;">
|
<div slot="header" style="text-align: center;">
|
||||||
<b>{{ $t('lesson.courseName') + ': '+ name }}</b>
|
<b>{{ $t('lesson.courseName') + ': '+ name }}</b>
|
||||||
</div>
|
</div>
|
||||||
@ -38,98 +38,98 @@ import { getLessonTree } from '@/api/jmap/lessondraft';
|
|||||||
import { DeviceMenu } from '@/scripts/ConstDic';
|
import { DeviceMenu } from '@/scripts/ConstDic';
|
||||||
import OperateMenu from './operateMenu';
|
import OperateMenu from './operateMenu';
|
||||||
export default {
|
export default {
|
||||||
name: 'LessonDetail',
|
name: 'LessonDetail',
|
||||||
components: {
|
components: {
|
||||||
OperateMenu
|
OperateMenu
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
treeList: [],
|
treeList: [],
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name'
|
label: 'name'
|
||||||
},
|
},
|
||||||
name: '',
|
name: '',
|
||||||
lessonId: '',
|
lessonId: '',
|
||||||
expandList: [],
|
expandList: [],
|
||||||
point: {
|
point: {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0
|
y: 0
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
width() {
|
width() {
|
||||||
return this.$store.state.app.width - 481 - this.widthLeft;
|
return this.$store.state.app.width - 481 - this.widthLeft;
|
||||||
},
|
},
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height - 120;
|
return this.$store.state.app.height - 120;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.initPageData();
|
this.initPageData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initPageData() {
|
initPageData() {
|
||||||
getLessonTree(this.$route.query.lessonId || this.$route.query.id).then(resp => {
|
getLessonTree(this.$route.query.lessonId || this.$route.query.id).then(resp => {
|
||||||
if (resp.data && resp.data[0]) {
|
if (resp.data && resp.data[0]) {
|
||||||
this.name = resp.data[0].name;
|
this.name = resp.data[0].name;
|
||||||
this.lessonId = resp.data[0].id;
|
this.lessonId = resp.data[0].id;
|
||||||
this.treeList = resp.data;
|
this.treeList = resp.data;
|
||||||
}
|
}
|
||||||
this.editLesson();
|
this.editLesson();
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
clickEvent(obj, node, ele) {
|
clickEvent(obj, node, ele) {
|
||||||
},
|
},
|
||||||
filterNode(value, data) {
|
filterNode(value, data) {
|
||||||
if (!value) return true;
|
if (!value) return true;
|
||||||
return data.name.indexOf(value) !== -1;
|
return data.name.indexOf(value) !== -1;
|
||||||
},
|
},
|
||||||
editLesson() {
|
editLesson() {
|
||||||
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.lessonId, skinCode: this.$route.query.skinCode, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}} );
|
this.$router.push( {path: `/design/lesson/details/edit/lessonEdit`, query: {id: this.lessonId, skinCode: this.$route.query.skinCode, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}} );
|
||||||
},
|
},
|
||||||
createChapte(node) {
|
createChapte(node) {
|
||||||
this.$router.push({path: `/design/lesson/details/edit/chapterCreate`, query: {id: node.data.id, lessonId: this.lessonId, skinCode: this.$route.query.skinCode, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}});
|
this.$router.push({path: `/design/lesson/details/edit/chapterCreate`, query: {id: node.data.id, lessonId: this.lessonId, skinCode: this.$route.query.skinCode, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}});
|
||||||
},
|
},
|
||||||
updateChapte(node) {
|
updateChapte(node) {
|
||||||
this.$router.push( {path: `/design/lesson/details/edit/chapterEdit`, query: {id: node.data.id, skinCode: this.$route.query.skinCode, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}});
|
this.$router.push( {path: `/design/lesson/details/edit/chapterEdit`, query: {id: node.data.id, skinCode: this.$route.query.skinCode, lessonId: this.lessonId, cityCode: this.$route.query.cityCode, mapId: this.$route.query.mapId}});
|
||||||
},
|
},
|
||||||
showContextMenu(e, obj, node, vueElem) {
|
showContextMenu(e, obj, node, vueElem) {
|
||||||
if (obj && obj.type === 'Lesson' || obj.type === 'Chapter') {
|
if (obj && obj.type === 'Lesson' || obj.type === 'Chapter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.point = {
|
this.point = {
|
||||||
x: e.clientX,
|
x: e.clientX,
|
||||||
y: e.clientY
|
y: e.clientY
|
||||||
};
|
};
|
||||||
this.node = node;
|
this.node = node;
|
||||||
const menu = DeviceMenu.Lesson;
|
const menu = DeviceMenu.Lesson;
|
||||||
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeRouter(params) {
|
changeRouter(params) {
|
||||||
switch (params.event) {
|
switch (params.event) {
|
||||||
case '01':
|
case '01':
|
||||||
this.editLesson();
|
this.editLesson();
|
||||||
break;
|
break;
|
||||||
case '02':
|
case '02':
|
||||||
this.createChapte(params.node);
|
this.createChapte(params.node);
|
||||||
break;
|
break;
|
||||||
case '03':
|
case '03':
|
||||||
this.updateChapte(params.node);
|
this.updateChapte(params.node);
|
||||||
break;
|
break;
|
||||||
case '04':
|
case '04':
|
||||||
this.createChapte(params.node);
|
this.createChapte(params.node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
refresh() {
|
refresh() {
|
||||||
this.initPageData();
|
this.initPageData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="card-box">
|
<div class="card-box steps">
|
||||||
<el-steps class="steps" :active="display">
|
<!-- class="steps" -->
|
||||||
|
<el-steps :active="display">
|
||||||
<el-step :title="this.$t('lesson.trainingSequence')" icon="el-icon-edit-outline" />
|
<el-step :title="this.$t('lesson.trainingSequence')" icon="el-icon-edit-outline" />
|
||||||
<el-step title="" icon="el-icon-upload" />
|
<el-step title="" icon="el-icon-upload" />
|
||||||
</el-steps>
|
</el-steps>
|
||||||
<el-card class="forms">
|
<el-card class="forms">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height -60 + 'px'}">
|
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height -60-30 + 'px'}">
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="lessonTree"
|
ref="lessonTree"
|
||||||
:data="treeData"
|
:data="treeData"
|
||||||
@ -82,14 +83,23 @@ export default {
|
|||||||
},
|
},
|
||||||
allowDrop(draggingNode, dropNode, type) {
|
allowDrop(draggingNode, dropNode, type) {
|
||||||
if (draggingNode && draggingNode.data.type === 'Chapter') {
|
if (draggingNode && draggingNode.data.type === 'Chapter') {
|
||||||
return dropNode && draggingNode.parent == dropNode.parent && (
|
// debugger;
|
||||||
dropNode.data.type === 'Chapter' && type !== 'Inner');
|
return dropNode && (dropNode.data.type === 'Chapter');
|
||||||
} else if (draggingNode && draggingNode.data.type === 'Training') {
|
// return dropNode && draggingNode.parent == dropNode.parent && (
|
||||||
return dropNode && draggingNode.parent == dropNode.parent && (
|
// dropNode.data.type === 'Chapter' && type !== 'Inner');
|
||||||
dropNode.data.type === 'Training' && type !== 'Inner');
|
}
|
||||||
|
else if (draggingNode && draggingNode.data.type === 'Training') {
|
||||||
|
// dropNode.data.type === 'Chapter' ||
|
||||||
|
return dropNode && (dropNode.data.type === 'Training' && type !== 'inner' && draggingNode.parent == dropNode.parent );
|
||||||
|
// return dropNode && draggingNode.parent == dropNode.parent && (
|
||||||
|
// dropNode.data.type === 'Training' && type !== 'Inner');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
allowDrag(draggingNode) {
|
allowDrag(draggingNode) {
|
||||||
|
// debugger;
|
||||||
return draggingNode && (draggingNode.data.type === 'Chapter' || draggingNode.data.type === 'Training');
|
return draggingNode && (draggingNode.data.type === 'Chapter' || draggingNode.data.type === 'Training');
|
||||||
},
|
},
|
||||||
getLeesonId(node) {
|
getLeesonId(node) {
|
||||||
|
@ -148,6 +148,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.draftContext {
|
.draftContext {
|
||||||
// float: left;
|
width:100%;
|
||||||
}
|
}
|
||||||
|
.mainContext{
|
||||||
|
display: -webkit-box;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="25%" :before-close="handleClose" center>
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="25%"
|
||||||
|
:before-close="handleClose"
|
||||||
|
center
|
||||||
|
>
|
||||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||||
@ -14,102 +21,126 @@ import { OperationList } from '@/scripts/OperationConfig';
|
|||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddBatch',
|
name: 'AddBatch',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
formModel: {
|
formModel: {
|
||||||
skinCode: this.$route.query.skinCode
|
|
||||||
},
|
|
||||||
skinCodeList: [],
|
|
||||||
isShow: false
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
form() {
|
|
||||||
this.type === 'ADD';
|
|
||||||
const form = {
|
|
||||||
labelWidth: '120px',
|
|
||||||
items: [
|
|
||||||
{ prop: 'skinCode', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: true }
|
|
||||||
]
|
|
||||||
};
|
|
||||||
return form;
|
|
||||||
},
|
|
||||||
rules() {
|
|
||||||
const crules = {
|
|
||||||
skinCode: [
|
|
||||||
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
|
|
||||||
]
|
|
||||||
};
|
|
||||||
return crules;
|
|
||||||
},
|
|
||||||
title() {
|
|
||||||
return this.$t('lesson.generationOperation');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
// 获取皮肤列表
|
|
||||||
this.skinCodeList = [];
|
|
||||||
getSkinCodeList().then(response => {
|
|
||||||
this.skinCodeList = response.data.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
show(total) {
|
|
||||||
if (total) {
|
|
||||||
this.isShow = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loading = false;
|
|
||||||
this.dialogVisible = true;
|
|
||||||
},
|
|
||||||
doSave() {
|
|
||||||
const self = this;
|
|
||||||
this.$refs.dataform.validateForm(() => {
|
|
||||||
if (this.isShow) {
|
|
||||||
this.$confirm(this.$t('lesson.wellClearOperate'), this.$t('global.tips'), {
|
|
||||||
confirmButtonText: this.$t('global.confirm'),
|
|
||||||
cancelButtonText: this.$t('global.cancel'),
|
|
||||||
type: 'warning'
|
|
||||||
}).then(() => {
|
|
||||||
self.create();
|
|
||||||
}).catch(() => { });
|
|
||||||
} else {
|
|
||||||
self.create();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
create() {
|
|
||||||
const self = this;
|
|
||||||
this.loading = true;
|
|
||||||
addTrainingRulesList(this.formModel.skinCode, OperationList[this.formModel.skinCode].list).then(response => {
|
|
||||||
self.loading = false;
|
|
||||||
self.$message.success(this.$t('lesson.batchCreateSuccess'));
|
|
||||||
self.handleClose();
|
|
||||||
self.$emit('reloadTable'); // 刷新列表
|
|
||||||
}).catch(error => {
|
|
||||||
self.loading = false;
|
|
||||||
self.$message.error(`${this.$('error.batchCreateFailed')}:${error.message}`);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleClose() {
|
|
||||||
this.formModel = {
|
|
||||||
skinCode: this.$route.query.skinCode
|
skinCode: this.$route.query.skinCode
|
||||||
};
|
},
|
||||||
this.$refs.dataform.resetForm();
|
skinCodeList: [],
|
||||||
this.isShow = false;
|
isShow: false
|
||||||
this.dialogVisible = false;
|
};
|
||||||
}
|
},
|
||||||
}
|
computed: {
|
||||||
|
form() {
|
||||||
|
this.type === 'ADD';
|
||||||
|
const form = {
|
||||||
|
labelWidth: '120px',
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
prop: 'skinCode',
|
||||||
|
label: this.$t('lesson.skinType'),
|
||||||
|
type: 'select',
|
||||||
|
required: true,
|
||||||
|
options: this.skinCodeList,
|
||||||
|
disabled: true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
return form;
|
||||||
|
},
|
||||||
|
rules() {
|
||||||
|
const crules = {
|
||||||
|
skinCode: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: this.$t('rules.inputSkinType'),
|
||||||
|
trigger: 'change'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
return crules;
|
||||||
|
},
|
||||||
|
title() {
|
||||||
|
return this.$t('lesson.generationOperation');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.init();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init() {
|
||||||
|
// 获取皮肤列表
|
||||||
|
this.skinCodeList = [];
|
||||||
|
getSkinCodeList().then(response => {
|
||||||
|
this.skinCodeList = response.data.map(item => {
|
||||||
|
const params = {};
|
||||||
|
params.label = item.name;
|
||||||
|
params.value = item.code;
|
||||||
|
return params;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
show(total) {
|
||||||
|
if (total) {
|
||||||
|
this.isShow = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loading = false;
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
doSave() {
|
||||||
|
const self = this;
|
||||||
|
this.$refs.dataform.validateForm(() => {
|
||||||
|
if (this.isShow) {
|
||||||
|
this.$confirm(
|
||||||
|
this.$t('lesson.wellClearOperate'),
|
||||||
|
this.$t('global.tips'),
|
||||||
|
{
|
||||||
|
confirmButtonText: this.$t('global.confirm'),
|
||||||
|
cancelButtonText: this.$t('global.cancel'),
|
||||||
|
type: 'warning'
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
self.create();
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
self.create();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
create() {
|
||||||
|
const self = this;
|
||||||
|
this.loading = true;
|
||||||
|
addTrainingRulesList(
|
||||||
|
this.formModel.skinCode,
|
||||||
|
OperationList[this.formModel.skinCode].list
|
||||||
|
)
|
||||||
|
.then(response => {
|
||||||
|
self.loading = false;
|
||||||
|
self.$message.success(this.$t('lesson.batchCreateSuccess'));
|
||||||
|
self.handleClose();
|
||||||
|
self.$emit('reloadTable'); // 刷新列表
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
self.loading = false;
|
||||||
|
self.$message.error(
|
||||||
|
`${this.$('error.batchCreateFailed')}:${error.message}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
this.formModel = {
|
||||||
|
skinCode: this.$route.query.skinCode
|
||||||
|
};
|
||||||
|
this.$refs.dataform.resetForm();
|
||||||
|
this.isShow = false;
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -13,289 +13,289 @@ import { postTrainingRulesData, putTrainingRulesData, getPlaceholderList } from
|
|||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TrainingEdit',
|
name: 'TrainingEdit',
|
||||||
props: {
|
props: {
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
formModel: {
|
formModel: {
|
||||||
trainingName: '',
|
trainingName: '',
|
||||||
trainingType: '',
|
trainingType: '',
|
||||||
operateType: '',
|
operateType: '',
|
||||||
skinCode: '',
|
skinCode: '',
|
||||||
minDuration: '',
|
minDuration: '',
|
||||||
maxDuration: '',
|
maxDuration: '',
|
||||||
trainingRemark: '',
|
trainingRemark: '',
|
||||||
productTypes: []
|
productTypes: []
|
||||||
},
|
},
|
||||||
skinCodeList: [],
|
skinCodeList: [],
|
||||||
trainingTypeList: [],
|
trainingTypeList: [],
|
||||||
trainingOperateTypeMap: {},
|
trainingOperateTypeMap: {},
|
||||||
placeholderList: []
|
placeholderList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
form() {
|
form() {
|
||||||
const isAdd = this.type === 'ADD';
|
const isAdd = this.type === 'ADD';
|
||||||
const form = {
|
const form = {
|
||||||
labelWidth: '120px',
|
labelWidth: '120px',
|
||||||
items: [
|
items: [
|
||||||
{ prop: 'skinCode', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: true },
|
{ prop: 'skinCode', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: true },
|
||||||
{ prop: 'trainingType', label: this.$t('lesson.trainingType'), type: 'select', required: true, options: this.trainingTypeList, disabled: !isAdd, change: true, onChange: this.changeList },
|
{ prop: 'trainingType', label: this.$t('lesson.trainingType'), type: 'select', required: true, options: this.trainingTypeList, disabled: !isAdd, change: true, onChange: this.changeList },
|
||||||
{ prop: 'operateType', label: this.$t('lesson.operationType'), type: 'select', required: true, options: this.trainingOperateTypeMap[this.formModel.trainingType], disabled: !isAdd },
|
{ prop: 'operateType', label: this.$t('lesson.operationType'), type: 'select', required: true, options: this.trainingOperateTypeMap[this.formModel.trainingType], disabled: !isAdd },
|
||||||
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainName },
|
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainName },
|
||||||
{ prop: 'trainingName', label: this.$t('lesson.trainingName'), type: 'text', required: true, rightWidth: true, tooltip: true, info: this.$t('lesson.tipNamePlaceholderInfo') },
|
{ prop: 'trainingName', label: this.$t('lesson.trainingName'), type: 'text', required: true, rightWidth: true, tooltip: true, info: this.$t('lesson.tipNamePlaceholderInfo') },
|
||||||
{ prop: 'minDuration', label: this.$t('lesson.minDuration'), type: 'text', required: true },
|
{ prop: 'minDuration', label: this.$t('lesson.minDuration'), type: 'text', required: true },
|
||||||
{ prop: 'maxDuration', label: this.$t('lesson.maxDuration'), type: 'text', required: true },
|
{ prop: 'maxDuration', label: this.$t('lesson.maxDuration'), type: 'text', required: true },
|
||||||
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainRemark },
|
{ label: '', type: 'button', options: this.placeholderList, style: 'margin-bottom: 0; margin-top: -10px;', typeBtn: 'info', click: this.addTrainRemark },
|
||||||
{ prop: 'trainingRemark', label: this.$t('lesson.trainingRemark'), type: 'textarea', required: true, tooltip: true, info: this.$t('lesson.tipExplainPlaceholderInfo') }
|
{ prop: 'trainingRemark', label: this.$t('lesson.trainingRemark'), type: 'textarea', required: true, tooltip: true, info: this.$t('lesson.tipExplainPlaceholderInfo') }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return form;
|
return form;
|
||||||
},
|
},
|
||||||
rules() {
|
rules() {
|
||||||
const crules = {
|
const crules = {
|
||||||
trainingName: [
|
trainingName: [
|
||||||
{ required: true, message: this.$t('rules.inputTrainingName'), trigger: 'blur' }
|
{ required: true, message: this.$t('rules.inputTrainingName'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
trainingType: [
|
trainingType: [
|
||||||
{ required: true, message: this.$t('rules.inputTrainingType'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.inputTrainingType'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
operateType: [
|
operateType: [
|
||||||
{ required: true, message: this.$t('rules.inputOperationType'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.inputOperationType'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
skinCode: [
|
skinCode: [
|
||||||
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
|
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
|
||||||
],
|
],
|
||||||
minDuration: [
|
minDuration: [
|
||||||
{ required: true, message: this.$t('rules.inputMinDuration'), trigger: 'blur' }
|
{ required: true, message: this.$t('rules.inputMinDuration'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
maxDuration: [
|
maxDuration: [
|
||||||
{ required: true, message: this.$t('rules.inputMaxDuration'), trigger: 'blur' }
|
{ required: true, message: this.$t('rules.inputMaxDuration'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
trainingRemark: [
|
trainingRemark: [
|
||||||
{ required: true, max: 500, message: this.$t('rules.inputTrainingRemark'), trigger: 'blur' }
|
{ required: true, max: 500, message: this.$t('rules.inputTrainingRemark'), trigger: 'blur' }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return crules;
|
return crules;
|
||||||
},
|
},
|
||||||
title() {
|
title() {
|
||||||
if (this.type === 'ADD') {
|
if (this.type === 'ADD') {
|
||||||
return this.$t('lesson.createOperateRule');
|
return this.$t('lesson.createOperateRule');
|
||||||
} else {
|
} else {
|
||||||
return this.$t('lesson.editOperateRule');
|
return this.$t('lesson.editOperateRule');
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.init();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
// 获取皮肤列表
|
|
||||||
this.skinCodeList = [];
|
|
||||||
getSkinCodeList().then(response => {
|
|
||||||
this.skinCodeList = response.data.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 获取实训类型
|
|
||||||
this.trainingTypeList = [];
|
|
||||||
this.$Dictionary.trainingType().then(list => {
|
|
||||||
this.trainingTypeList = list.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// 获取实训操作类型
|
|
||||||
this.trainingOperateTypeMap = {};
|
|
||||||
this.$Dictionary.stationControl().then(list => {
|
|
||||||
this.trainingOperateTypeMap['01'] = list.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
}); // 控制权实训
|
|
||||||
});
|
|
||||||
this.$Dictionary.signalOperation().then(list => {
|
|
||||||
this.trainingOperateTypeMap['02'] = list.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
}); // 信号机实训
|
|
||||||
});
|
|
||||||
this.$Dictionary.switchOperation().then(list => {
|
|
||||||
this.trainingOperateTypeMap['03'] = list.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
}); // 道岔实训
|
|
||||||
});
|
|
||||||
this.$Dictionary.sectionOperation().then(list => {
|
|
||||||
this.trainingOperateTypeMap['04'] = list.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
}); // 区段实训
|
|
||||||
});
|
|
||||||
this.$Dictionary.stationStandOperation().then(list => {
|
|
||||||
this.trainingOperateTypeMap['05'] = list.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
}); // 站台实训
|
|
||||||
});
|
|
||||||
this.$Dictionary.trainPlanOperation().then(list => {
|
|
||||||
this.trainingOperateTypeMap['06'] = list.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
}); // 行车计划实训
|
|
||||||
});
|
|
||||||
this.$Dictionary.trainOperation().then(list => {
|
|
||||||
this.trainingOperateTypeMap['07'] = list.map(item => {
|
|
||||||
const params = {};
|
|
||||||
params.label = item.name;
|
|
||||||
params.value = item.code;
|
|
||||||
return params;
|
|
||||||
}); // 列车实训
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
async show(data) {
|
|
||||||
this.loading = false;
|
|
||||||
this.dialogVisible = true;
|
|
||||||
if (data && data.id) {
|
|
||||||
// 获取操作占位列表
|
|
||||||
const res = await getPlaceholderList({ trainingType: data.trainingType, skinCode: data.skinCode });
|
|
||||||
this.placeholderList = res.data;
|
|
||||||
this.formModel = {
|
|
||||||
id: data.id,
|
|
||||||
trainingName: this.repliceName(data.trainingName, this.placeholderList),
|
|
||||||
trainingType: data.trainingType,
|
|
||||||
operateType: data.operateType,
|
|
||||||
productTypes: data.productTypes,
|
|
||||||
skinCode: data.skinCode,
|
|
||||||
minDuration: data.minDuration,
|
|
||||||
maxDuration: data.maxDuration,
|
|
||||||
trainingRemark: this.repliceName(data.trainingRemark, this.placeholderList)
|
|
||||||
};
|
|
||||||
}else {
|
|
||||||
this.formModel = {
|
|
||||||
skinCode: this.$route.query.skinCode
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
repliceName(fieldValue, enumList) {
|
},
|
||||||
if (enumList && enumList.length > 0) {
|
mounted() {
|
||||||
for (let i = 0; i < enumList.length; i++) {
|
this.init();
|
||||||
if (fieldValue.includes(`{${enumList[i].id}}`)) {
|
},
|
||||||
fieldValue = fieldValue.replace(`{${enumList[i].id}}`, `{${enumList[i].name}}`);
|
methods: {
|
||||||
}
|
init() {
|
||||||
}
|
// 获取皮肤列表
|
||||||
return fieldValue;
|
this.skinCodeList = [];
|
||||||
}
|
getSkinCodeList().then(response => {
|
||||||
},
|
this.skinCodeList = response.data.map(item => {
|
||||||
changeList(val) {
|
const params = {};
|
||||||
// 获取操作占位列表
|
params.label = item.name;
|
||||||
getPlaceholderList({ trainingType: val, skinCode: '02' }).then(res => {
|
params.value = item.code;
|
||||||
this.placeholderList = res.data;
|
return params;
|
||||||
});
|
});
|
||||||
},
|
});
|
||||||
addTrainName(val) {
|
|
||||||
this.formModel.trainingName = `${this.formModel.trainingName}{${val.name}}`;
|
|
||||||
},
|
|
||||||
addTrainRemark(val) {
|
|
||||||
this.formModel.trainingRemark = `${this.formModel.trainingRemark}{${val.name}}`;
|
|
||||||
},
|
|
||||||
doSave() {
|
|
||||||
const self = this;
|
|
||||||
this.$refs.dataform.validateForm(() => {
|
|
||||||
if (self.type === 'ADD') {
|
|
||||||
self.create();
|
|
||||||
} else {
|
|
||||||
self.update();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
create() {
|
|
||||||
const self = this;
|
|
||||||
this.placeholderList.forEach(item => {
|
|
||||||
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
|
||||||
const name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
|
||||||
this.formModel.trainingName = name;
|
|
||||||
}
|
|
||||||
if (this.formModel.trainingRemark.includes(`{${item.name}}`)) {
|
|
||||||
const remark = this.formModel.trainingRemark.replace(`{${item.name}}`, `{${item.id}}`);
|
|
||||||
this.formModel.trainingRemark = remark;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.loading = true;
|
// 获取实训类型
|
||||||
postTrainingRulesData(this.formModel).then(response => {
|
this.trainingTypeList = [];
|
||||||
self.loading = false;
|
this.$Dictionary.trainingType().then(list => {
|
||||||
self.$message.success(this.$t('lesson.createOperateSuccess'));
|
this.trainingTypeList = list.map(item => {
|
||||||
self.handleClose();
|
const params = {};
|
||||||
self.$emit('reloadTable');
|
params.label = item.name;
|
||||||
}).catch(error => {
|
params.value = item.code;
|
||||||
self.loading = false;
|
return params;
|
||||||
self.$message.error(`${this.$t('error.createOperateRuleFailed')}:${error.message}`);
|
});
|
||||||
});
|
});
|
||||||
},
|
// 获取实训操作类型
|
||||||
update() {
|
this.trainingOperateTypeMap = {};
|
||||||
const self = this;
|
this.$Dictionary.stationControl().then(list => {
|
||||||
this.placeholderList.forEach(item => {
|
this.trainingOperateTypeMap['01'] = list.map(item => {
|
||||||
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
const params = {};
|
||||||
const name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
params.label = item.name;
|
||||||
this.formModel.trainingName = name;
|
params.value = item.code;
|
||||||
}
|
return params;
|
||||||
if (this.formModel.trainingRemark.includes(`{${item.name}}`)) {
|
}); // 控制权实训
|
||||||
const remark = this.formModel.trainingRemark.replace(`{${item.name}}`, `{${item.id}}`);
|
});
|
||||||
this.formModel.trainingRemark = remark;
|
this.$Dictionary.signalOperation().then(list => {
|
||||||
}
|
this.trainingOperateTypeMap['02'] = list.map(item => {
|
||||||
});
|
const params = {};
|
||||||
|
params.label = item.name;
|
||||||
|
params.value = item.code;
|
||||||
|
return params;
|
||||||
|
}); // 信号机实训
|
||||||
|
});
|
||||||
|
this.$Dictionary.switchOperation().then(list => {
|
||||||
|
this.trainingOperateTypeMap['03'] = list.map(item => {
|
||||||
|
const params = {};
|
||||||
|
params.label = item.name;
|
||||||
|
params.value = item.code;
|
||||||
|
return params;
|
||||||
|
}); // 道岔实训
|
||||||
|
});
|
||||||
|
this.$Dictionary.sectionOperation().then(list => {
|
||||||
|
this.trainingOperateTypeMap['04'] = list.map(item => {
|
||||||
|
const params = {};
|
||||||
|
params.label = item.name;
|
||||||
|
params.value = item.code;
|
||||||
|
return params;
|
||||||
|
}); // 区段实训
|
||||||
|
});
|
||||||
|
this.$Dictionary.stationStandOperation().then(list => {
|
||||||
|
this.trainingOperateTypeMap['05'] = list.map(item => {
|
||||||
|
const params = {};
|
||||||
|
params.label = item.name;
|
||||||
|
params.value = item.code;
|
||||||
|
return params;
|
||||||
|
}); // 站台实训
|
||||||
|
});
|
||||||
|
this.$Dictionary.trainPlanOperation().then(list => {
|
||||||
|
this.trainingOperateTypeMap['06'] = list.map(item => {
|
||||||
|
const params = {};
|
||||||
|
params.label = item.name;
|
||||||
|
params.value = item.code;
|
||||||
|
return params;
|
||||||
|
}); // 行车计划实训
|
||||||
|
});
|
||||||
|
this.$Dictionary.trainOperation().then(list => {
|
||||||
|
this.trainingOperateTypeMap['07'] = list.map(item => {
|
||||||
|
const params = {};
|
||||||
|
params.label = item.name;
|
||||||
|
params.value = item.code;
|
||||||
|
return params;
|
||||||
|
}); // 列车实训
|
||||||
|
});
|
||||||
|
|
||||||
this.loading = true;
|
},
|
||||||
putTrainingRulesData(this.formModel).then(response => {
|
async show(data) {
|
||||||
self.loading = false;
|
this.loading = false;
|
||||||
self.$message.success(this.$t('lesson.createOperateSuccess'));
|
this.dialogVisible = true;
|
||||||
self.handleClose();
|
if (data && data.id) {
|
||||||
self.$emit('reloadTable');
|
// 获取操作占位列表
|
||||||
}).catch(error => {
|
const res = await getPlaceholderList({ trainingType: data.trainingType, skinCode: data.skinCode });
|
||||||
self.loading = false;
|
this.placeholderList = res.data;
|
||||||
self.$message.error(`${this.$t('error.createOperateRuleFailed')}:${error.message}`);
|
this.formModel = {
|
||||||
});
|
id: data.id,
|
||||||
},
|
trainingName: this.repliceName(data.trainingName, this.placeholderList),
|
||||||
handleClose() {
|
trainingType: data.trainingType,
|
||||||
this.formModel = {
|
operateType: data.operateType,
|
||||||
trainingName: '',
|
productTypes: data.productTypes,
|
||||||
trainingType: '',
|
skinCode: data.skinCode,
|
||||||
operateType: '',
|
minDuration: data.minDuration,
|
||||||
skinCode: '',
|
maxDuration: data.maxDuration,
|
||||||
minDuration: '',
|
trainingRemark: this.repliceName(data.trainingRemark, this.placeholderList)
|
||||||
maxDuration: '',
|
};
|
||||||
trainingRemark: ''
|
} else {
|
||||||
};
|
this.formModel = {
|
||||||
this.$refs.dataform.resetForm();
|
skinCode: this.$route.query.skinCode
|
||||||
this.dialogVisible = false;
|
};
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
repliceName(fieldValue, enumList) {
|
||||||
|
if (enumList && enumList.length > 0) {
|
||||||
|
for (let i = 0; i < enumList.length; i++) {
|
||||||
|
if (fieldValue.includes(`{${enumList[i].id}}`)) {
|
||||||
|
fieldValue = fieldValue.replace(`{${enumList[i].id}}`, `{${enumList[i].name}}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fieldValue;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeList(val) {
|
||||||
|
// 获取操作占位列表
|
||||||
|
getPlaceholderList({ trainingType: val, skinCode: '02' }).then(res => {
|
||||||
|
this.placeholderList = res.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
addTrainName(val) {
|
||||||
|
this.formModel.trainingName = `${this.formModel.trainingName}{${val.name}}`;
|
||||||
|
},
|
||||||
|
addTrainRemark(val) {
|
||||||
|
this.formModel.trainingRemark = `${this.formModel.trainingRemark}{${val.name}}`;
|
||||||
|
},
|
||||||
|
doSave() {
|
||||||
|
const self = this;
|
||||||
|
this.$refs.dataform.validateForm(() => {
|
||||||
|
if (self.type === 'ADD') {
|
||||||
|
self.create();
|
||||||
|
} else {
|
||||||
|
self.update();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
create() {
|
||||||
|
const self = this;
|
||||||
|
this.placeholderList.forEach(item => {
|
||||||
|
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
||||||
|
const name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
||||||
|
this.formModel.trainingName = name;
|
||||||
|
}
|
||||||
|
if (this.formModel.trainingRemark.includes(`{${item.name}}`)) {
|
||||||
|
const remark = this.formModel.trainingRemark.replace(`{${item.name}}`, `{${item.id}}`);
|
||||||
|
this.formModel.trainingRemark = remark;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
postTrainingRulesData(this.formModel).then(response => {
|
||||||
|
self.loading = false;
|
||||||
|
self.$message.success(this.$t('lesson.createOperateSuccess'));
|
||||||
|
self.handleClose();
|
||||||
|
self.$emit('reloadTable');
|
||||||
|
}).catch(error => {
|
||||||
|
self.loading = false;
|
||||||
|
self.$message.error(`${this.$t('error.createOperateRuleFailed')}:${error.message}`);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
update() {
|
||||||
|
const self = this;
|
||||||
|
this.placeholderList.forEach(item => {
|
||||||
|
if (this.formModel.trainingName.includes(`{${item.name}}`)) {
|
||||||
|
const name = this.formModel.trainingName.replace(`{${item.name}}`, `{${item.id}}`);
|
||||||
|
this.formModel.trainingName = name;
|
||||||
|
}
|
||||||
|
if (this.formModel.trainingRemark.includes(`{${item.name}}`)) {
|
||||||
|
const remark = this.formModel.trainingRemark.replace(`{${item.name}}`, `{${item.id}}`);
|
||||||
|
this.formModel.trainingRemark = remark;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
this.loading = true;
|
||||||
|
putTrainingRulesData(this.formModel).then(response => {
|
||||||
|
self.loading = false;
|
||||||
|
self.$message.success(this.$t('lesson.createOperateSuccess'));
|
||||||
|
self.handleClose();
|
||||||
|
self.$emit('reloadTable');
|
||||||
|
}).catch(error => {
|
||||||
|
self.loading = false;
|
||||||
|
self.$message.error(`${this.$t('error.createOperateRuleFailed')}:${error.message}`);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
this.formModel = {
|
||||||
|
trainingName: '',
|
||||||
|
trainingType: '',
|
||||||
|
operateType: '',
|
||||||
|
skinCode: '',
|
||||||
|
minDuration: '',
|
||||||
|
maxDuration: '',
|
||||||
|
trainingRemark: ''
|
||||||
|
};
|
||||||
|
this.$refs.dataform.resetForm();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,20 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div style="height: 100%; overflow-y: auto;">
|
||||||
|
<!-- <div style="height: calc(100% - 80px); overflow-y: auto;"> -->
|
||||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||||
|
<!-- </div> -->
|
||||||
<training-edit ref="create" type="ADD" @reloadTable="reloadTable" />
|
<training-edit ref="create" type="ADD" @reloadTable="reloadTable" />
|
||||||
<training-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
<training-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
|
||||||
<add-batch ref="addBatch" @reloadTable="reloadTable" />
|
<add-batch ref="addBatch" @reloadTable="reloadTable" />
|
||||||
<save-as ref="saveAs" @reloadTable="reloadTable" />
|
<save-as ref="saveAs" @reloadTable="reloadTable" />
|
||||||
<div class="draft">
|
<div class="draft">
|
||||||
<el-button-group>
|
<el-button-group>
|
||||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getTrainingRulesList, deleteTrainingRulesData, getPlaceholderList } from '@/api/management/operation';
|
import {
|
||||||
|
getTrainingRulesList,
|
||||||
|
deleteTrainingRulesData,
|
||||||
|
getPlaceholderList
|
||||||
|
} from '@/api/management/operation';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||||
import TrainingEdit from './addEdit';
|
import TrainingEdit from './addEdit';
|
||||||
import AddBatch from './addBatch';
|
import AddBatch from './addBatch';
|
||||||
@ -22,251 +28,301 @@ import SaveAs from './saveAs.vue';
|
|||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TrainingRule',
|
name: 'TrainingRule',
|
||||||
components: {
|
components: {
|
||||||
TrainingEdit,
|
TrainingEdit,
|
||||||
AddBatch,
|
AddBatch,
|
||||||
SaveAs
|
SaveAs
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
placeholderMap: {},
|
placeholderMap: {},
|
||||||
trainingOperateTypeMap: {},
|
trainingOperateTypeMap: {},
|
||||||
trainingTypeList: [],
|
trainingTypeList: [],
|
||||||
skinCodeList: [],
|
skinCodeList: [],
|
||||||
totals: '',
|
totals: '',
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
labelWidth: '140px',
|
labelWidth: '140px',
|
||||||
reset: true,
|
reset: true,
|
||||||
queryObject: {
|
queryObject: {
|
||||||
trainingType: {
|
trainingType: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: this.$t('lesson.trainingType'),
|
label: this.$t('lesson.trainingType'),
|
||||||
config: {
|
config: {
|
||||||
data: []
|
data: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
trainingName: {
|
trainingName: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: this.$t('lesson.trainingName')
|
label: this.$t('lesson.trainingName')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
queryList: {
|
||||||
|
query: this.getList,
|
||||||
|
selectCheckShow: false,
|
||||||
|
indexShow: true,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
title: this.$t('lesson.trainingName'),
|
||||||
|
prop: 'trainingName',
|
||||||
|
type: 'replicText',
|
||||||
|
columnValue: row => {
|
||||||
|
return this.repliceName(
|
||||||
|
row.trainingName,
|
||||||
|
this.placeholderMap[row.trainingType]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('lesson.skinType'),
|
||||||
|
prop: 'skinCode',
|
||||||
|
type: 'tag',
|
||||||
|
columnValue: row => {
|
||||||
|
return this.$convertField(row.skinCode, this.skinCodeList, [
|
||||||
|
'code',
|
||||||
|
'name'
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
tagType: row => {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('lesson.trainingType'),
|
||||||
|
prop: 'trainingType',
|
||||||
|
type: 'tag',
|
||||||
|
columnValue: row => {
|
||||||
|
return this.$convertField(
|
||||||
|
row.trainingType,
|
||||||
|
this.trainingTypeList,
|
||||||
|
['code', 'name']
|
||||||
|
);
|
||||||
|
},
|
||||||
|
tagType: row => {
|
||||||
|
return 'success';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('lesson.operationType'),
|
||||||
|
prop: 'operateType',
|
||||||
|
type: 'tag',
|
||||||
|
columnValue: row => {
|
||||||
|
return this.$convertField(
|
||||||
|
row.operateType,
|
||||||
|
this.trainingOperateTypeMap[row.trainingType],
|
||||||
|
['code', 'name']
|
||||||
|
);
|
||||||
|
},
|
||||||
|
tagType: row => {
|
||||||
|
return 'success';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('lesson.minDuration'),
|
||||||
|
prop: 'minDuration'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.$t('lesson.maxDuration'),
|
||||||
|
prop: 'maxDuration'
|
||||||
|
},
|
||||||
|
|
||||||
},
|
{
|
||||||
queryList: {
|
title: this.$t('lesson.trainingRemark'),
|
||||||
query: this.getList,
|
prop: 'trainingRemark',
|
||||||
selectCheckShow: false,
|
type: 'replicText',
|
||||||
indexShow: true,
|
columnValue: row => {
|
||||||
columns: [
|
return this.repliceName(
|
||||||
{
|
row.trainingRemark,
|
||||||
title: this.$t('lesson.trainingName'),
|
this.placeholderMap[row.trainingType]
|
||||||
prop: 'trainingName',
|
);
|
||||||
type: 'replicText',
|
}
|
||||||
columnValue: (row) => { return this.repliceName(row.trainingName, this.placeholderMap[row.trainingType]); }
|
},
|
||||||
},
|
{
|
||||||
{
|
type: 'button',
|
||||||
title: this.$t('lesson.skinType'),
|
title: this.$t('global.operate'),
|
||||||
prop: 'skinCode',
|
width: '250',
|
||||||
type: 'tag',
|
buttons: [
|
||||||
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
|
{
|
||||||
tagType: (row) => { return ''; }
|
name: this.$t('lesson.stepDetail'),
|
||||||
},
|
handleClick: this.handleViewDetail
|
||||||
{
|
},
|
||||||
title: this.$t('lesson.trainingType'),
|
{
|
||||||
prop: 'trainingType',
|
name: this.$t('global.edit'),
|
||||||
type: 'tag',
|
handleClick: this.handleEdit
|
||||||
columnValue: (row) => { return this.$convertField(row.trainingType, this.trainingTypeList, ['code', 'name']); },
|
},
|
||||||
tagType: (row) => { return 'success'; }
|
{
|
||||||
},
|
name: this.$t('global.delete'),
|
||||||
{
|
handleClick: this.handleDelete,
|
||||||
title: this.$t('lesson.operationType'),
|
type: 'danger'
|
||||||
prop: 'operateType',
|
}
|
||||||
type: 'tag',
|
]
|
||||||
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.trainingType], ['code', 'name']); },
|
}
|
||||||
tagType: (row) => { return 'success'; }
|
],
|
||||||
},
|
actions: [
|
||||||
{
|
{ text: this.$t('global.add'), handler: this.handleAdd },
|
||||||
title: this.$t('lesson.minDuration'),
|
|
||||||
prop: 'minDuration'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: this.$t('lesson.maxDuration'),
|
|
||||||
prop: 'maxDuration'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: this.$t('lesson.trainingRemark'),
|
|
||||||
prop: 'trainingRemark',
|
|
||||||
type: 'replicText',
|
|
||||||
columnValue: (row) => { return this.repliceName(row.trainingRemark, this.placeholderMap[row.trainingType]); }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
title: this.$t('global.operate'),
|
|
||||||
width: '250',
|
|
||||||
buttons: [
|
|
||||||
{
|
|
||||||
name: this.$t('lesson.stepDetail'),
|
|
||||||
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: this.$t('lesson.generation'), handler: this.handleBatchAdd },
|
{ text: this.$t('lesson.generation'), handler: this.handleBatchAdd },
|
||||||
{ text: this.$t('lesson.saveAs'), handler: this.handleSaveAs }
|
{ text: this.$t('lesson.saveAs'), handler: this.handleSaveAs }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
this.trainingOperateTypeMap = {};
|
this.trainingOperateTypeMap = {};
|
||||||
this.$Dictionary.stationControl().then(list => {
|
this.$Dictionary.stationControl().then(list => {
|
||||||
this.trainingOperateTypeMap['01'] = list; // 控制权实训
|
this.trainingOperateTypeMap['01'] = list; // 控制权实训
|
||||||
});
|
});
|
||||||
this.$Dictionary.signalOperation().then(list => {
|
this.$Dictionary.signalOperation().then(list => {
|
||||||
this.trainingOperateTypeMap['02'] = list; // 信号机实训
|
this.trainingOperateTypeMap['02'] = list; // 信号机实训
|
||||||
});
|
});
|
||||||
this.$Dictionary.switchOperation().then(list => {
|
this.$Dictionary.switchOperation().then(list => {
|
||||||
this.trainingOperateTypeMap['03'] = list; // 道岔实训
|
this.trainingOperateTypeMap['03'] = list; // 道岔实训
|
||||||
});
|
});
|
||||||
this.$Dictionary.sectionOperation().then(list => {
|
this.$Dictionary.sectionOperation().then(list => {
|
||||||
this.trainingOperateTypeMap['04'] = list; // 区段实训
|
this.trainingOperateTypeMap['04'] = list; // 区段实训
|
||||||
});
|
});
|
||||||
this.$Dictionary.stationStandOperation().then(list => {
|
this.$Dictionary.stationStandOperation().then(list => {
|
||||||
this.trainingOperateTypeMap['05'] = list; // 站台实训
|
this.trainingOperateTypeMap['05'] = list; // 站台实训
|
||||||
});
|
});
|
||||||
this.$Dictionary.trainPlanOperation().then(list => {
|
this.$Dictionary.trainPlanOperation().then(list => {
|
||||||
this.trainingOperateTypeMap['06'] = list; // 行车计划实训
|
this.trainingOperateTypeMap['06'] = list; // 行车计划实训
|
||||||
});
|
});
|
||||||
this.$Dictionary.trainOperation().then(list => {
|
this.$Dictionary.trainOperation().then(list => {
|
||||||
this.trainingOperateTypeMap['07'] = list; // 列车实训
|
this.trainingOperateTypeMap['07'] = list; // 列车实训
|
||||||
});
|
});
|
||||||
this.$Dictionary.limitOperation().then(list => {
|
this.$Dictionary.limitOperation().then(list => {
|
||||||
this.trainingOperateTypeMap['08'] = list; // 限速实训
|
this.trainingOperateTypeMap['08'] = list; // 限速实训
|
||||||
});
|
});
|
||||||
this.placeholderMap = {};
|
this.placeholderMap = {};
|
||||||
getPlaceholderList({ skinCode: '', trainingType: '' }).then(res => {
|
getPlaceholderList({ skinCode: '', trainingType: '' }).then(res => {
|
||||||
res.data.forEach(item => {
|
res.data.forEach(item => {
|
||||||
if (!this.placeholderMap[item.trainingType]) {
|
if (!this.placeholderMap[item.trainingType]) {
|
||||||
this.placeholderMap[item.trainingType] = [];
|
this.placeholderMap[item.trainingType] = [];
|
||||||
}
|
}
|
||||||
this.placeholderMap[item.trainingType].push(item);
|
this.placeholderMap[item.trainingType].push(item);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取皮肤列表
|
// 获取皮肤列表
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
getSkinCodeList().then(response => {
|
getSkinCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取实训类型
|
// 获取实训类型
|
||||||
this.trainingTypeList = [];
|
this.trainingTypeList = [];
|
||||||
this.$Dictionary.trainingType().then(list => {
|
this.$Dictionary.trainingType().then(list => {
|
||||||
this.trainingTypeList = list;
|
this.trainingTypeList = list;
|
||||||
list.forEach(elem => {
|
list.forEach(elem => {
|
||||||
this.queryForm.queryObject.trainingType.config.data.push({ value: elem.code, label: elem.name });
|
this.queryForm.queryObject.trainingType.config.data.push({
|
||||||
});
|
value: elem.code,
|
||||||
});
|
label: elem.name
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
},
|
},
|
||||||
repliceName(fieldValue, enumList) {
|
repliceName(fieldValue, enumList) {
|
||||||
if (enumList && enumList.length > 0) {
|
if (enumList && enumList.length > 0) {
|
||||||
for (let i = 0; i < enumList.length; i++) {
|
for (let i = 0; i < enumList.length; i++) {
|
||||||
if (fieldValue.includes(`{${enumList[i].id}}`)) {
|
if (fieldValue.includes(`{${enumList[i].id}}`)) {
|
||||||
fieldValue = fieldValue.replace(`{${enumList[i].id}}`, `{${enumList[i].name}}`);
|
fieldValue = fieldValue.replace(
|
||||||
}
|
`{${enumList[i].id}}`,
|
||||||
}
|
`{${enumList[i].name}}`
|
||||||
return fieldValue;
|
);
|
||||||
} else if (!enumList) {
|
}
|
||||||
return fieldValue;
|
}
|
||||||
}
|
return fieldValue;
|
||||||
},
|
} else if (!enumList) {
|
||||||
// 选择实训类型下的操作类型 暂时不用
|
return fieldValue;
|
||||||
typeChoose(form) {
|
}
|
||||||
this.queryForm.queryObject.operateType.config.data = [];
|
},
|
||||||
if (form && form.trainingType) {
|
// 选择实训类型下的操作类型 暂时不用
|
||||||
form.operateType = '';
|
typeChoose(form) {
|
||||||
this.trainingOperateTypeMap[form.trainingType].forEach(elem => {
|
this.queryForm.queryObject.operateType.config.data = [];
|
||||||
this.queryForm.queryObject.operateType.config.data.push({ value: elem.code, label: elem.name });
|
if (form && form.trainingType) {
|
||||||
});
|
form.operateType = '';
|
||||||
}
|
this.trainingOperateTypeMap[form.trainingType].forEach(elem => {
|
||||||
},
|
this.queryForm.queryObject.operateType.config.data.push({
|
||||||
async getList(params) {
|
value: elem.code,
|
||||||
|
label: elem.name
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getList(params) {
|
||||||
params['mapId'] = this.$route.query.mapId;
|
params['mapId'] = this.$route.query.mapId;
|
||||||
const res = await getTrainingRulesList(params);
|
const res = await getTrainingRulesList(params);
|
||||||
this.totals = res.data.total;
|
this.totals = res.data.total;
|
||||||
return res;
|
return res;
|
||||||
},
|
},
|
||||||
handleViewDetail(index, row) {
|
handleViewDetail(index, row) {
|
||||||
this.$router.push({ path: `${UrlConfig.design.trainingRuleDetail}`, query: { id: row.id, type: row.trainingType, skinCode: row.skinCode } });
|
this.$router.push({
|
||||||
},
|
path: `${UrlConfig.design.trainingRuleDetail}`,
|
||||||
|
query: { id: row.id, type: row.trainingType, skinCode: row.skinCode }
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
handleEdit(index, row) {
|
handleEdit(index, row) {
|
||||||
this.$refs.edit.show(row);
|
this.$refs.edit.show(row);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.$refs.create.show();
|
this.$refs.create.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleBatchAdd() {
|
handleBatchAdd() {
|
||||||
this.$refs.addBatch.show(this.totals);
|
this.$refs.addBatch.show(this.totals);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSaveAs() {
|
handleSaveAs() {
|
||||||
this.$refs.saveAs.show();
|
this.$refs.saveAs.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm(this.$t('lesson.wellDelTrainingRule'), this.$t('global.tips'), {
|
this.$confirm(
|
||||||
confirmButtonText: this.$t('global.confirm'),
|
this.$t('lesson.wellDelTrainingRule'),
|
||||||
cancelButtonText: this.$t('global.cancel'),
|
this.$t('global.tips'),
|
||||||
type: 'warning'
|
{
|
||||||
}).then(() => {
|
confirmButtonText: this.$t('global.confirm'),
|
||||||
deleteTrainingRulesData(row.id).then(response => {
|
cancelButtonText: this.$t('global.cancel'),
|
||||||
this.$message.success(this.$t('lesson.deleteSuccess'));
|
type: 'warning'
|
||||||
this.reloadTable();
|
}
|
||||||
}).catch(() => {
|
).then(() => {
|
||||||
this.reloadTable();
|
deleteTrainingRulesData(row.id)
|
||||||
this.$messageBox(this.$t('error.deleteFailed'));
|
.then(response => {
|
||||||
});
|
this.$message.success(this.$t('lesson.deleteSuccess'));
|
||||||
});
|
this.reloadTable();
|
||||||
},
|
})
|
||||||
turnback() {
|
.catch(() => {
|
||||||
this.$router.go(-1)
|
this.reloadTable();
|
||||||
|
this.$messageBox(this.$t('error.deleteFailed'));
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
reloadTable() {
|
turnback() {
|
||||||
this.queryList.reload();
|
this.$router.go(-1);
|
||||||
}
|
},
|
||||||
}
|
reloadTable() {
|
||||||
|
this.queryList.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
.draft {
|
.draft {
|
||||||
width: 400px;
|
width: 400px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 20px auto;
|
margin: 20px auto;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="25%" :before-close="handleClose" center>
|
<el-dialog
|
||||||
|
v-dialogDrag
|
||||||
|
:title="title"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
width="25%"
|
||||||
|
:before-close="handleClose"
|
||||||
|
center
|
||||||
|
>
|
||||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||||
@ -13,94 +20,118 @@ import { postOperateSaveAs } from '@/api/management/operation';
|
|||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AddBatch',
|
name: 'AddBatch',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
dialogVisible: false,
|
dialogVisible: false,
|
||||||
formModel: {
|
formModel: {
|
||||||
skinCodeFrom: '',
|
skinCodeFrom: '',
|
||||||
skinCodeTo: ''
|
skinCodeTo: ''
|
||||||
},
|
},
|
||||||
skinCodeList: []
|
skinCodeList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
form() {
|
form() {
|
||||||
this.type === 'ADD';
|
this.type === 'ADD';
|
||||||
const form = {
|
const form = {
|
||||||
labelWidth: '120px',
|
labelWidth: '120px',
|
||||||
items: [
|
items: [
|
||||||
{ prop: 'skinCodeFrom', label: this.$t('lesson.skinTypeFrom'), type: 'select', required: true, options: this.skinCodeList },
|
{
|
||||||
{ prop: 'skinCodeTo', label: this.$t('lesson.skinTypeTo'), type: 'select', required: true, options: this.skinCodeList }
|
prop: 'skinCodeFrom',
|
||||||
]
|
label: this.$t('lesson.skinTypeFrom'),
|
||||||
};
|
type: 'select',
|
||||||
return form;
|
required: true,
|
||||||
},
|
options: this.skinCodeList
|
||||||
rules() {
|
},
|
||||||
const crules = {
|
{
|
||||||
skinCodeFrom: [
|
prop: 'skinCodeTo',
|
||||||
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
|
label: this.$t('lesson.skinTypeTo'),
|
||||||
],
|
type: 'select',
|
||||||
skinCodeTo: [
|
required: true,
|
||||||
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
|
options: this.skinCodeList
|
||||||
]
|
}
|
||||||
};
|
]
|
||||||
return crules;
|
};
|
||||||
},
|
return form;
|
||||||
title() {
|
},
|
||||||
return this.$t('lesson.copyLesson');
|
rules() {
|
||||||
}
|
const crules = {
|
||||||
},
|
skinCodeFrom: [
|
||||||
mounted() {
|
{
|
||||||
this.init();
|
required: true,
|
||||||
},
|
message: this.$t('rules.inputSkinType'),
|
||||||
methods: {
|
trigger: 'change'
|
||||||
init() {
|
}
|
||||||
// 获取皮肤列表
|
],
|
||||||
this.skinCodeList = [];
|
skinCodeTo: [
|
||||||
getSkinCodeList().then(response => {
|
{
|
||||||
this.skinCodeList = response.data.map(item => {
|
required: true,
|
||||||
const params = {};
|
message: this.$t('rules.inputSkinType'),
|
||||||
params.label = item.name;
|
trigger: 'change'
|
||||||
params.value = item.code;
|
}
|
||||||
return params;
|
]
|
||||||
});
|
};
|
||||||
});
|
return crules;
|
||||||
},
|
},
|
||||||
show() {
|
title() {
|
||||||
this.dialogVisible = true;
|
return this.$t('lesson.copyLesson');
|
||||||
},
|
}
|
||||||
doSave() {
|
},
|
||||||
const self = this;
|
mounted() {
|
||||||
this.$refs.dataform.validateForm(() => {
|
this.init();
|
||||||
if (this.formModel.skinCodeFrom != this.formModel.skinCodeTo) {
|
},
|
||||||
self.create();
|
methods: {
|
||||||
} else {
|
init() {
|
||||||
this.$alert(this.$t('lesson.countSkinCode'), this.$t('global.tips'), {
|
// 获取皮肤列表
|
||||||
confirmButtonText: this.$t('global.confirm'),
|
this.skinCodeList = [];
|
||||||
callback: () => { }
|
getSkinCodeList().then(response => {
|
||||||
});
|
this.skinCodeList = response.data.map(item => {
|
||||||
}
|
const params = {};
|
||||||
});
|
params.label = item.name;
|
||||||
},
|
params.value = item.code;
|
||||||
create() {
|
return params;
|
||||||
const self = this;
|
});
|
||||||
this.loading = true;
|
});
|
||||||
postOperateSaveAs(this.formModel.skinCodeFrom, this.formModel.skinCodeTo).then(response => {
|
},
|
||||||
self.loading = false;
|
show() {
|
||||||
self.$message.success(this.$t('lesson.batchCreateSuccess'));
|
this.dialogVisible = true;
|
||||||
self.handleClose();
|
},
|
||||||
self.$emit('reloadTable'); // 刷新列表
|
doSave() {
|
||||||
}).catch(error => {
|
const self = this;
|
||||||
self.loading = false;
|
this.$refs.dataform.validateForm(() => {
|
||||||
self.$message.error(`${this.$('error.batchCreateFailed')}:${error.message}`);
|
if (this.formModel.skinCodeFrom != this.formModel.skinCodeTo) {
|
||||||
});
|
self.create();
|
||||||
},
|
} else {
|
||||||
handleClose() {
|
this.$alert(this.$t('lesson.countSkinCode'), this.$t('global.tips'), {
|
||||||
this.$refs.dataform.resetForm();
|
confirmButtonText: this.$t('global.confirm'),
|
||||||
this.dialogVisible = false;
|
callback: () => {}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
create() {
|
||||||
|
const self = this;
|
||||||
|
this.loading = true;
|
||||||
|
postOperateSaveAs(this.formModel.skinCodeFrom, this.formModel.skinCodeTo)
|
||||||
|
.then(response => {
|
||||||
|
self.loading = false;
|
||||||
|
self.$message.success(this.$t('lesson.batchCreateSuccess'));
|
||||||
|
self.handleClose();
|
||||||
|
self.$emit('reloadTable'); // 刷新列表
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
self.loading = false;
|
||||||
|
self.$message.error(
|
||||||
|
`${this.$('error.batchCreateFailed')}:${error.message}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleClose() {
|
||||||
|
this.$refs.dataform.resetForm();
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div style="height: 100%; overflow-y: auto;">
|
||||||
|
<!-- <div style="height: calc(100% - 80px); overflow-y: auto;"> -->
|
||||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||||
|
<!-- </div> -->
|
||||||
<training-draft
|
<training-draft
|
||||||
ref="draftTrain"
|
ref="draftTrain"
|
||||||
:skin-code-list="skinCodeList"
|
:skin-code-list="skinCodeList"
|
||||||
@ -27,253 +29,253 @@ import TrainingDraft from './draft';
|
|||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TrainingGeneration',
|
name: 'TrainingGeneration',
|
||||||
components: {
|
components: {
|
||||||
TrainingDraft
|
TrainingDraft
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
skinCodeList: [],
|
skinCodeList: [],
|
||||||
trainingTypeList: [],
|
trainingTypeList: [],
|
||||||
prdTypeList: [],
|
prdTypeList: [],
|
||||||
trainingOperateTypeMap: {},
|
trainingOperateTypeMap: {},
|
||||||
pagerConfig: {
|
pagerConfig: {
|
||||||
pageSize: 'pageSize',
|
pageSize: 'pageSize',
|
||||||
pageIndex: 'pageNum'
|
pageIndex: 'pageNum'
|
||||||
},
|
},
|
||||||
queryForm: {
|
queryForm: {
|
||||||
labelWidth: '120px',
|
labelWidth: '120px',
|
||||||
queryObject: {
|
queryObject: {
|
||||||
prdCode: {
|
prdCode: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: this.$t('lesson.product'),
|
label: this.$t('lesson.product'),
|
||||||
change: this.prdChoose,
|
change: this.prdChoose,
|
||||||
config: {
|
config: {
|
||||||
data: []
|
data: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: this.$t('lesson.trainingType'),
|
label: this.$t('lesson.trainingType'),
|
||||||
change: this.typeChoose,
|
change: this.typeChoose,
|
||||||
config: {
|
config: {
|
||||||
data: []
|
data: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
operateType: {
|
operateType: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: this.$t('lesson.operationType'),
|
label: this.$t('lesson.operationType'),
|
||||||
config: {
|
config: {
|
||||||
data: []
|
data: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* generateType: {
|
/* generateType: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
label: this.$t('lesson.automaticOrManual'),
|
label: this.$t('lesson.automaticOrManual'),
|
||||||
config: {
|
config: {
|
||||||
data: [{ value: '02', label: this.$t('lesson.manual') }, { value: '01', label: this.$t('lesson.automatic') }]
|
data: [{ value: '02', label: this.$t('lesson.manual') }, { value: '01', label: this.$t('lesson.automatic') }]
|
||||||
}
|
}
|
||||||
},*/
|
},*/
|
||||||
name: {
|
name: {
|
||||||
type: 'text',
|
type: 'text',
|
||||||
label: this.$t('lesson.trainingName')
|
label: this.$t('lesson.trainingName')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryList: {
|
queryList: {
|
||||||
query: this.queryFunction,
|
query: this.queryFunction,
|
||||||
selectCheckShow: false,
|
selectCheckShow: false,
|
||||||
indexShow: true,
|
indexShow: true,
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: this.$t('lesson.trainingName'),
|
title: this.$t('lesson.trainingName'),
|
||||||
prop: 'name'
|
prop: 'name'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('lesson.skinType'),
|
title: this.$t('lesson.skinType'),
|
||||||
prop: 'skinCode',
|
prop: 'skinCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
|
||||||
tagType: (row) => { return ''; }
|
tagType: (row) => { return ''; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('lesson.product'),
|
title: this.$t('lesson.product'),
|
||||||
prop: 'prdCode',
|
prop: 'prdCode',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.prdCode, this.prdTypeList, ['code', 'name']); },
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('lesson.trainingType'),
|
title: this.$t('lesson.trainingType'),
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.type, this.trainingTypeList, ['code', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.type, this.trainingTypeList, ['code', 'name']); },
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('lesson.operationType'),
|
title: this.$t('lesson.operationType'),
|
||||||
prop: 'operateType',
|
prop: 'operateType',
|
||||||
type: 'tag',
|
type: 'tag',
|
||||||
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']); },
|
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.type], ['code', 'name']); },
|
||||||
tagType: (row) => { return 'success'; }
|
tagType: (row) => { return 'success'; }
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('lesson.minDuration'),
|
title: this.$t('lesson.minDuration'),
|
||||||
prop: 'minDuration'
|
prop: 'minDuration'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('lesson.maxDuration'),
|
title: this.$t('lesson.maxDuration'),
|
||||||
prop: 'maxDuration'
|
prop: 'maxDuration'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.$t('lesson.remarks'),
|
title: this.$t('lesson.remarks'),
|
||||||
prop: 'remarks'
|
prop: 'remarks'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'button',
|
type: 'button',
|
||||||
title: this.$t('global.operate'),
|
title: this.$t('global.operate'),
|
||||||
width: '250',
|
width: '250',
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
name: this.$t('lesson.demonstration'),
|
name: this.$t('lesson.demonstration'),
|
||||||
handleClick: this.demoDisplay,
|
handleClick: this.demoDisplay,
|
||||||
type: ''
|
type: ''
|
||||||
}
|
}
|
||||||
/* {
|
/* {
|
||||||
name: this.$t('lesson.trainingRecord'),
|
name: this.$t('lesson.trainingRecord'),
|
||||||
handleClick: this.trainingRecord,
|
handleClick: this.trainingRecord,
|
||||||
type: ''
|
type: ''
|
||||||
}*/
|
}*/
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging },
|
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging },
|
||||||
{ text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
|
{ text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
|
||||||
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'}
|
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'}
|
||||||
/* { text: this.$t('lesson.addTraining'), btnCode: 'employee_add', handler: this.addingTraining, type: 'primary' }*/
|
/* { text: this.$t('lesson.addTraining'), btnCode: 'employee_add', handler: this.addingTraining, type: 'primary' }*/
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
currentModel: {}
|
currentModel: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
await this.loadInitData();
|
await this.loadInitData();
|
||||||
const json = localStore.get(this.$route.path);
|
const json = localStore.get(this.$route.path);
|
||||||
json.type = '';
|
json.type = '';
|
||||||
json.prdCode = '';
|
json.prdCode = '';
|
||||||
json.operateType = '';
|
json.operateType = '';
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async loadInitData() {
|
async loadInitData() {
|
||||||
this.skinCodeList = [];
|
this.skinCodeList = [];
|
||||||
this.queryForm.queryObject.prdCode.config.data = [];
|
this.queryForm.queryObject.prdCode.config.data = [];
|
||||||
getSkinCodeList().then(response => {
|
getSkinCodeList().then(response => {
|
||||||
this.skinCodeList = response.data;
|
this.skinCodeList = response.data;
|
||||||
});
|
});
|
||||||
getCommodityMapProduct(this.$route.params.skinCode).then((response) => {
|
getCommodityMapProduct(this.$route.params.skinCode).then((response) => {
|
||||||
const productList = response.data;
|
const productList = response.data;
|
||||||
if (productList && productList.length > 0) {
|
if (productList && productList.length > 0) {
|
||||||
productList.forEach(elem => {
|
productList.forEach(elem => {
|
||||||
// 过滤综合演练产品
|
// 过滤综合演练产品
|
||||||
if (elem.prdType != '03') {
|
if (elem.prdType != '03') {
|
||||||
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.prdTypeList = [];
|
this.prdTypeList = [];
|
||||||
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
|
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
|
||||||
const list = res.data.list;
|
const list = res.data.list;
|
||||||
if (list && list.length > 0) {
|
if (list && list.length > 0) {
|
||||||
this.prdTypeList = list.filter(elem => { return elem.prdType != '03'; });
|
this.prdTypeList = list.filter(elem => { return elem.prdType != '03'; });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 获取实训类型
|
// 获取实训类型
|
||||||
this.trainingTypeList = [];
|
this.trainingTypeList = [];
|
||||||
this.$Dictionary.trainingType().then(list => {
|
this.$Dictionary.trainingType().then(list => {
|
||||||
this.trainingTypeList = list;
|
this.trainingTypeList = list;
|
||||||
list.forEach(elem => {
|
list.forEach(elem => {
|
||||||
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
|
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.trainingOperateTypeMap = {};
|
this.trainingOperateTypeMap = {};
|
||||||
const list01 = await this.$Dictionary.stationControl();
|
const list01 = await this.$Dictionary.stationControl();
|
||||||
this.trainingOperateTypeMap['01'] = list01; // 控制权实训
|
this.trainingOperateTypeMap['01'] = list01; // 控制权实训
|
||||||
const list02 = await this.$Dictionary.signalOperation();
|
const list02 = await this.$Dictionary.signalOperation();
|
||||||
this.trainingOperateTypeMap['02'] = list02; // 信号机实训
|
this.trainingOperateTypeMap['02'] = list02; // 信号机实训
|
||||||
const list03 = await this.$Dictionary.switchOperation();
|
const list03 = await this.$Dictionary.switchOperation();
|
||||||
this.trainingOperateTypeMap['03'] = list03; // 道岔实训
|
this.trainingOperateTypeMap['03'] = list03; // 道岔实训
|
||||||
const list04 = await this.$Dictionary.sectionOperation();
|
const list04 = await this.$Dictionary.sectionOperation();
|
||||||
this.trainingOperateTypeMap['04'] = list04; // 区段实训
|
this.trainingOperateTypeMap['04'] = list04; // 区段实训
|
||||||
const list05 = await this.$Dictionary.stationStandOperation();
|
const list05 = await this.$Dictionary.stationStandOperation();
|
||||||
this.trainingOperateTypeMap['05'] = list05; // 站台实训
|
this.trainingOperateTypeMap['05'] = list05; // 站台实训
|
||||||
const list06 = await this.$Dictionary.trainPlanOperation();
|
const list06 = await this.$Dictionary.trainPlanOperation();
|
||||||
this.trainingOperateTypeMap['06'] = list06; // 行车计划实训
|
this.trainingOperateTypeMap['06'] = list06; // 行车计划实训
|
||||||
const list07 = await this.$Dictionary.trainOperation();
|
const list07 = await this.$Dictionary.trainOperation();
|
||||||
this.trainingOperateTypeMap['07'] = list07; // 列车实训
|
this.trainingOperateTypeMap['07'] = list07; // 列车实训
|
||||||
const list08 = await this.$Dictionary.limitOperation();
|
const list08 = await this.$Dictionary.limitOperation();
|
||||||
this.trainingOperateTypeMap['08'] = list08; // 限速实训
|
this.trainingOperateTypeMap['08'] = list08; // 限速实训
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
},
|
},
|
||||||
prdChoose(form) {
|
prdChoose(form) {
|
||||||
form.type = '';
|
form.type = '';
|
||||||
form.operateType = '';
|
form.operateType = '';
|
||||||
},
|
},
|
||||||
typeChoose(form) {
|
typeChoose(form) {
|
||||||
this.queryForm.queryObject.operateType.config.data = [];
|
this.queryForm.queryObject.operateType.config.data = [];
|
||||||
form.operateType = '';
|
form.operateType = '';
|
||||||
if (form && form.type) {
|
if (form && form.type) {
|
||||||
this.trainingOperateTypeMap[form.type].forEach(elem => {
|
this.trainingOperateTypeMap[form.type].forEach(elem => {
|
||||||
this.queryForm.queryObject.operateType.config.data.push({ value: elem.code, label: elem.name });
|
this.queryForm.queryObject.operateType.config.data.push({ value: elem.code, label: elem.name });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
autoMaticTrainging() {
|
autoMaticTrainging() {
|
||||||
this.$refs.draftTrain.show({ event: '01', title: this.$t('lesson.automaticGenerationOfTraining') });
|
this.$refs.draftTrain.show({ event: '01', title: this.$t('lesson.automaticGenerationOfTraining') });
|
||||||
},
|
},
|
||||||
editTrainingByType() {
|
editTrainingByType() {
|
||||||
this.$refs.draftTrain.show({ event: '02', title: this.$t('lesson.modifyTrainingByCategory') });
|
this.$refs.draftTrain.show({ event: '02', title: this.$t('lesson.modifyTrainingByCategory') });
|
||||||
},
|
},
|
||||||
delAutoMaticTrainging() {
|
delAutoMaticTrainging() {
|
||||||
this.$refs.draftTrain.show({ event: '03', title: this.$t('lesson.deleteAutoGeneratedTraining') });
|
this.$refs.draftTrain.show({ event: '03', title: this.$t('lesson.deleteAutoGeneratedTraining') });
|
||||||
},
|
},
|
||||||
// addingTraining() {
|
// addingTraining() {
|
||||||
// this.$refs.draftTrain.show({ event: '04', title: this.$t('lesson.addTraining') });
|
// this.$refs.draftTrain.show({ event: '04', title: this.$t('lesson.addTraining') });
|
||||||
// },
|
// },
|
||||||
demoDisplay(index, node) {
|
demoDisplay(index, node) {
|
||||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||||
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
/** 区分演示和正式,需要在演示时设置lessonId为0*/
|
||||||
const query = { group: resp.data, trainingId: node.id, lessonId: 0 };
|
const query = { group: resp.data, trainingId: node.id, lessonId: 0 };
|
||||||
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
|
this.$router.push({ path: `${UrlConfig.display}/manage`, query: query });
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$messageBox(this.$t('error.createSimulationFailed') +error.message);
|
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
},
|
},
|
||||||
turnback() {
|
turnback() {
|
||||||
this.$router.go(-1);
|
this.$router.go(-1);
|
||||||
},
|
},
|
||||||
trainingRecord(index, node) {
|
trainingRecord(index, node) {
|
||||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||||
this.group = resp.data;
|
this.group = resp.data;
|
||||||
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
params['mapId'] = this.$route.query.mapId;
|
params['mapId'] = this.$route.query.mapId;
|
||||||
return pageQueryTraining(params);
|
return pageQueryTraining(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
|
<div class="login-container" :style="{'background-image': 'url('+bgImg+')'}">
|
||||||
<div v-if="project==='xty'" class="text-box">{{ title }}</div>
|
<div v-if="project.endsWith('xty')" class="text-box">{{ title }}</div>
|
||||||
<div class="language_box">
|
<div class="language_box">
|
||||||
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
|
<el-tooltip effect="dark" :content="this.$t('login.clickSwitchLanguage')" placement="bottom-end">
|
||||||
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
|
<el-button class="language_btn" type="text" @click="handleLanguage">{{ language }}</el-button>
|
||||||
@ -131,7 +131,7 @@ export default {
|
|||||||
password: ''
|
password: ''
|
||||||
},
|
},
|
||||||
loginRules: {
|
loginRules: {
|
||||||
username: [{ required: true, trigger: 'blur', validator: validateUsername }, { required: true, trigger: 'change', validator: validateUsername }],
|
username: [{ required: true, trigger: 'blur', validator: validateUsername }],
|
||||||
password: [{ required: true, trigger: 'blur', validator: validatePass }]
|
password: [{ required: true, trigger: 'blur', validator: validatePass }]
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
@ -187,7 +187,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
computedAttribute() {
|
computedAttribute() {
|
||||||
if (this.project === 'design') {
|
if (this.project.startsWith('design')) {
|
||||||
this.cookiesName = 'UserDesignName';
|
this.cookiesName = 'UserDesignName';
|
||||||
this.cookiesToken = 'UserDesignToken';
|
this.cookiesToken = 'UserDesignToken';
|
||||||
this.modelType = 'design';
|
this.modelType = 'design';
|
||||||
@ -238,7 +238,7 @@ export default {
|
|||||||
this.clearTimer(this.checkLogin);
|
this.clearTimer(this.checkLogin);
|
||||||
this.checkLogin = setTimeout(() => {
|
this.checkLogin = setTimeout(() => {
|
||||||
checkLoginStatus(self.sessionId).then(response => {
|
checkLoginStatus(self.sessionId).then(response => {
|
||||||
if (this.project === 'design') {
|
if (this.project.startsWith('design')) {
|
||||||
setDesignToken(response.data.token);
|
setDesignToken(response.data.token);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -244,12 +244,8 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -255,11 +255,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@
|
|||||||
<div class="point-section">
|
<div class="point-section">
|
||||||
<template v-for="(point, index) in formModel[item.prop]">
|
<template v-for="(point, index) in formModel[item.prop]">
|
||||||
<div :key="index" style="overflow: hidden;">
|
<div :key="index" style="overflow: hidden;">
|
||||||
|
<span style="display: table; margin-right: 3px; font-size: 14px; float: left; line-height: 28px;">{{ index == 0 ? '(起点)' : index == formModel[item.prop].length - 1 ? '(终点)' : `(中点${index})` }}</span>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label=""
|
label=""
|
||||||
:prop="'points[' + index + '].x'"
|
:prop="'points[' + index + '].x'"
|
||||||
@ -120,7 +121,7 @@
|
|||||||
label=""
|
label=""
|
||||||
:prop="'points[' + index + '].y'"
|
:prop="'points[' + index + '].y'"
|
||||||
style="display: table; float: left; margin-right: 5px;"
|
style="display: table; float: left; margin-right: 5px;"
|
||||||
label-width="10px"
|
label-width="4px"
|
||||||
>
|
>
|
||||||
<el-input-number v-model="point.y" :disabled="item.pointDisabled" />
|
<el-input-number v-model="point.y" :disabled="item.pointDisabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -136,6 +137,7 @@
|
|||||||
:disabled="index == 0 || index == formModel[item.prop].length - 1"
|
:disabled="index == 0 || index == formModel[item.prop].length - 1"
|
||||||
circle
|
circle
|
||||||
class="point-button"
|
class="point-button"
|
||||||
|
style="margin-left: 4px;"
|
||||||
@click="item.delPoint(index)"
|
@click="item.delPoint(index)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -107,6 +107,7 @@
|
|||||||
<div class="point-section" :style="{ width: `calc(100% - 10px - ${item.width})` }">
|
<div class="point-section" :style="{ width: `calc(100% - 10px - ${item.width})` }">
|
||||||
<template v-for="(point, index) in formModel[item.prop]">
|
<template v-for="(point, index) in formModel[item.prop]">
|
||||||
<div :key="index" style="overflow: hidden;">
|
<div :key="index" style="overflow: hidden;">
|
||||||
|
<span style="display: table; margin-right: 3px; font-size: 14px; float: left; line-height: 28px;" :style="{'margin-right': index == 0 || index == formModel[item.prop].length - 1 ? '9px' : '5px'}">{{ index == 0 ? '起 点' : index == formModel[item.prop].length - 1 ? '终 点' : `中点${index}` }}</span>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
label=""
|
label=""
|
||||||
:prop="'points[' + index + '].x'"
|
:prop="'points[' + index + '].x'"
|
||||||
@ -123,7 +124,7 @@
|
|||||||
label=""
|
label=""
|
||||||
:prop="'points[' + index + '].y'"
|
:prop="'points[' + index + '].y'"
|
||||||
style="display: table; float: left; margin-right: 5px;"
|
style="display: table; float: left; margin-right: 5px;"
|
||||||
label-width="10px"
|
label-width="4px"
|
||||||
>
|
>
|
||||||
<el-input-number v-model="point.y" :disabled="item.pointDisabled" />
|
<el-input-number v-model="point.y" :disabled="item.pointDisabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -139,6 +140,7 @@
|
|||||||
:disabled="index == 0 || index == formModel[item.prop].length - 1"
|
:disabled="index == 0 || index == formModel[item.prop].length - 1"
|
||||||
circle
|
circle
|
||||||
class="point-button"
|
class="point-button"
|
||||||
|
style="margin-left: 4px;"
|
||||||
@click="item.delPoint(index)"
|
@click="item.delPoint(index)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -247,9 +247,4 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -229,9 +229,4 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -398,6 +398,19 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/deep/ .button_box{
|
||||||
|
// width: 100%;
|
||||||
|
// background: #f0f0f0;
|
||||||
|
// overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
background: #ffffff;
|
||||||
|
overflow: hidden;
|
||||||
|
border-top: 1px #f3f1f1 solid;
|
||||||
|
box-shadow: 4px 7px 10px #565656;
|
||||||
|
border-radius: 0;
|
||||||
|
border-bottom: 1px transparent solid;
|
||||||
|
}
|
||||||
|
|
||||||
/deep/ .map-draft-group {
|
/deep/ .map-draft-group {
|
||||||
float: right;
|
float: right;
|
||||||
margin: 6px 5px;
|
margin: 6px 5px;
|
||||||
|
@ -225,11 +225,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -216,11 +216,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ export default {
|
|||||||
{ prop: 'code', label: this.$t('map.lineCoding'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.lineList, change: true, deviceChange: this.deviceChange },
|
{ prop: 'code', label: this.$t('map.lineCoding'), type: 'select', optionLabel: 'code', optionValue: 'code', options: this.lineList, change: true, deviceChange: this.deviceChange },
|
||||||
{ prop: 'type', label: this.$t('map.lineType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.LineTypeList },
|
{ prop: 'type', label: this.$t('map.lineType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.LineTypeList },
|
||||||
{ prop: 'width', label: this.$t('map.lineWidth'), type: 'number', min: 1, placeholder: 'px' },
|
{ prop: 'width', label: this.$t('map.lineWidth'), type: 'number', min: 1, placeholder: 'px' },
|
||||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '120px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint }
|
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, addPoint: this.addPoint, delPoint: this.delPoint }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
map: {
|
map: {
|
||||||
@ -258,11 +258,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.view-control {
|
.view-control {
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
@ -525,12 +525,6 @@ export default {
|
|||||||
height: calc(100% - 100px);
|
height: calc(100% - 100px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@
|
|||||||
<el-tab-pane class="view-control" label="批量删除" name="five" :style="{ height: cardHeight + 30 +'px' }">
|
<el-tab-pane class="view-control" label="批量删除" name="five" :style="{ height: cardHeight + 30 +'px' }">
|
||||||
<div class="link_box_select">
|
<div class="link_box_select">
|
||||||
<span style="margin-right: 12px;">选择link:</span>
|
<span style="margin-right: 12px;">选择link:</span>
|
||||||
<el-select v-model="linkCode" filterable size="mini">
|
<el-select v-model="linkCode" filterable multiple size="mini">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in linkList"
|
v-for="item in linkList"
|
||||||
:key="item.code"
|
:key="item.code"
|
||||||
@ -225,6 +225,7 @@ export default {
|
|||||||
},
|
},
|
||||||
linkCode: '',
|
linkCode: '',
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
oldPoint: [], // 区段未修改前 坐标
|
||||||
addModel: {
|
addModel: {
|
||||||
code: '',
|
code: '',
|
||||||
splitNumber: 2,
|
splitNumber: 2,
|
||||||
@ -343,7 +344,7 @@ export default {
|
|||||||
{ prop: 'segmentationPosition.y', firstLevel: 'segmentationPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
|
{ prop: 'segmentationPosition.y', firstLevel: 'segmentationPosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '20px', disabled: true }
|
||||||
] },
|
] },
|
||||||
{ prop: 'isCurve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSectionType },
|
{ prop: 'isCurve', label: this.$t('map.isCurve'), type: 'checkbox', isHidden: !this.isSectionType },
|
||||||
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '140px', isHidden: !this.isPointsShow, pointDisabled: this.pointDisabledName, addPoint: this.addPoint, delPoint: this.delPoint }
|
{ prop: 'points', label: this.$t('map.segmentCoordinates'), type: 'points', width: '100px', isHidden: !this.isPointsShow, pointDisabled: this.pointDisabledName, addPoint: this.addPoint, delPoint: this.delPoint }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
map: {
|
map: {
|
||||||
@ -565,6 +566,7 @@ export default {
|
|||||||
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
|
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
|
||||||
this.editModel.isSegmentation = selected.isSegmentation || false;
|
this.editModel.isSegmentation = selected.isSegmentation || false;
|
||||||
this.editModel.points = JSON.parse(JSON.stringify(selected.points));
|
this.editModel.points = JSON.parse(JSON.stringify(selected.points));
|
||||||
|
this.oldPoint = JSON.parse(JSON.stringify(selected.points));
|
||||||
|
|
||||||
this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
|
this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
|
||||||
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
|
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
|
||||||
@ -836,7 +838,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(models, remove);
|
|
||||||
|
|
||||||
const _that = this;
|
const _that = this;
|
||||||
this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), {
|
this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), {
|
||||||
@ -865,7 +866,7 @@ export default {
|
|||||||
this.$refs['dataform'].validate((valid) => {
|
this.$refs['dataform'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
const edits = [];
|
const edits = [];
|
||||||
const model = Object.assign({_type: 'Section'}, this.editModel);
|
const model = Object.assign({_type: 'Section'}, this.editModel); // 修改元素model
|
||||||
model.leftStopPointOffset = Number(model.leftStopPointOffset);
|
model.leftStopPointOffset = Number(model.leftStopPointOffset);
|
||||||
model.rightStopPointOffset = Number(model.rightStopPointOffset);
|
model.rightStopPointOffset = Number(model.rightStopPointOffset);
|
||||||
this.sectionList.forEach(section => {
|
this.sectionList.forEach(section => {
|
||||||
@ -874,10 +875,24 @@ export default {
|
|||||||
section.trainPosType = model.trainPosType;
|
section.trainPosType = model.trainPosType;
|
||||||
edits.push(section);
|
edits.push(section);
|
||||||
}
|
}
|
||||||
|
if (section.linkCode == model.linkCode && model.code != section.code) {
|
||||||
|
// debugger;
|
||||||
|
const lastIndex = this.oldPoint.length - 1;
|
||||||
|
if (this.oldPoint[0].x == section.points[section.points.length -1].x && this.oldPoint[0].y == section.points[section.points.length -1].y) {
|
||||||
|
section.points[section.points.length -1].x = model.points[0].x;
|
||||||
|
section.points[section.points.length -1].y = model.points[0].y;
|
||||||
|
}
|
||||||
|
if (this.oldPoint[lastIndex].x == section.points[0].x && this.oldPoint[lastIndex].y == section.points[0].y) {
|
||||||
|
section.points[0].x = model.points[model.points.length -1].x;
|
||||||
|
section.points[0].y = model.points[model.points.length -1].y;
|
||||||
|
}
|
||||||
|
edits.push(section);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
edits.push(model);
|
edits.push(model);
|
||||||
this.fieldS = '';
|
this.fieldS = '';
|
||||||
this.$emit('addOrUpdateMapModel', edits);
|
this.$emit('addOrUpdateMapModel', edits);
|
||||||
|
this.oldPoint = JSON.parse(JSON.stringify(model.points));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -1101,17 +1116,19 @@ export default {
|
|||||||
delRelevanceSection() {
|
delRelevanceSection() {
|
||||||
const selected = [];
|
const selected = [];
|
||||||
const switchList = [];
|
const switchList = [];
|
||||||
this.sectionList.forEach(section => {
|
this.linkCode.forEach(linkCode => {
|
||||||
if (section.linkCode == this.linkCode) {
|
this.sectionList.forEach(section => {
|
||||||
const selectedSection = this.$store.getters['map/getDeviceByCode'](section.code);
|
if (section.linkCode == linkCode) {
|
||||||
selected.push(selectedSection);
|
const selectedSection = this.$store.getters['map/getDeviceByCode'](section.code);
|
||||||
this.switchList.forEach(switchEle => {
|
selected.push(selectedSection);
|
||||||
if (section.relSwitchCode == switchEle.code) {
|
this.switchList.forEach(switchEle => {
|
||||||
const selectedSwitch = this.$store.getters['map/getDeviceByCode'](switchEle.code);
|
if (section.relSwitchCode == switchEle.code) {
|
||||||
switchList.push(selectedSwitch);
|
const selectedSwitch = this.$store.getters['map/getDeviceByCode'](switchEle.code);
|
||||||
}
|
switchList.push(selectedSwitch);
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
this.$confirm(this.$t('tip.confirmDeletion'), this.$t('tip.hint'), {
|
||||||
confirmButtonText: this.$t('tip.confirm'),
|
confirmButtonText: this.$t('tip.confirm'),
|
||||||
@ -1123,6 +1140,7 @@ export default {
|
|||||||
});
|
});
|
||||||
await this.$emit('delMapModel', selected);
|
await this.$emit('delMapModel', selected);
|
||||||
this.deviceSelect();
|
this.deviceSelect();
|
||||||
|
this.linkCode = '';
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message.info(this.$t('tip.cancelledDelete'));
|
this.$message.info(this.$t('tip.cancelledDelete'));
|
||||||
});
|
});
|
||||||
@ -1153,11 +1171,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.el-transfer {
|
.el-transfer {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
@ -420,9 +420,4 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -276,9 +276,4 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -246,9 +246,4 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -300,9 +300,4 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
@ -171,15 +171,15 @@ export default {
|
|||||||
create() { // 一键生成道岔
|
create() { // 一键生成道岔
|
||||||
this.questionList = []; // 有问题区段列表
|
this.questionList = []; // 有问题区段列表
|
||||||
const models = [];
|
const models = [];
|
||||||
// const remove = [];
|
|
||||||
const linkObj = {};
|
const linkObj = {};
|
||||||
this.linkList.forEach(link => {
|
this.linkList.forEach(link => {
|
||||||
if (link && link.leftFdCode && link.leftSdCode) { // 左侧同时都有关联link
|
if (link && link.leftFdCode && link.leftSdCode) { // 左侧同时都有关联link
|
||||||
linkObj[`${link.code}`] = { name: '', num: 0 };
|
linkObj[`${link.code}`] = { name: '', num: 0 };
|
||||||
} else if (link && link.rightFdCode && link.rightSdCode) { // 右侧同时都有关联link
|
} else if (link && link.rightFdCode && link.rightSdCode) { // 右侧同时都有关联link
|
||||||
linkObj[`${link.code}`] = { name: '', num: 0 };
|
linkObj[`${link.code}`] = { name: '', num: 0 };
|
||||||
|
} else if (link && link.leftFdCode && !link.leftSdCode && link.rightFdCode && !link.rightSdCode) { // 左右正向link关联,侧向link不关联检测
|
||||||
|
linkObj[`${link.code}`] = { name: '', num: 0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
this.sectionList.forEach(section => {
|
this.sectionList.forEach(section => {
|
||||||
for (const link in linkObj) {
|
for (const link in linkObj) {
|
||||||
@ -227,7 +227,7 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
|
const swch = this.findSwitchData(model.sectionACode, model.sectionBCode, model.sectionCCode);
|
||||||
!swch && models.push(model);
|
!swch && models.push(model); // 已有的道岔不在创建
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -273,6 +273,16 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
const createArr = [];
|
||||||
|
models.forEach((item) => {
|
||||||
|
const sectionA = this.$store.getters['map/getDeviceByCode'](item.sectionACode);
|
||||||
|
const sectionB = this.$store.getters['map/getDeviceByCode'](item.sectionBCode);
|
||||||
|
const sectionC = this.$store.getters['map/getDeviceByCode'](item.sectionCCode);
|
||||||
|
if (linkObj[sectionA.linkCode].num != 1 && linkObj[sectionB.linkCode].num != 1 && linkObj[sectionC.linkCode].num != 1 ) {
|
||||||
|
createArr.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// console.log(models, createArr, '创建道岔list');
|
||||||
this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), {
|
this.$confirm(this.$t('tip.confirmBatchGeneration'), this.$t('tip.hint'), {
|
||||||
confirmButtonText: this.$t('tip.confirm'),
|
confirmButtonText: this.$t('tip.confirm'),
|
||||||
cancelButtonText: this.$t('tip.cancel'),
|
cancelButtonText: this.$t('tip.cancel'),
|
||||||
@ -280,14 +290,11 @@ export default {
|
|||||||
}).then(() => {
|
}).then(() => {
|
||||||
for (const link in linkObj) {
|
for (const link in linkObj) {
|
||||||
if (linkObj[link].num == 1) {
|
if (linkObj[link].num == 1) {
|
||||||
this.questionList.push(`${this.$t('map.section')}${linkObj[link].name}${this.$t('tip.linkNoneSplit')}`);
|
this.questionList.push(`${this.$t('map.section')}${linkObj[link].name}${this.$t('tip.linkNoneSplit')}, ${this.$t('tip.createSwitchPortion')}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!this.questionList.length) { // 没有问题list 再去创建
|
this.$emit('addOrUpdateMapModel', createArr);
|
||||||
// this.$emit('delMapModel', remove);
|
this.createSwitchSection(createArr);
|
||||||
this.$emit('addOrUpdateMapModel', models);
|
|
||||||
this.createSwitchSection(models);
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
@ -485,11 +492,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.el-transfer {
|
.el-transfer {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
@ -236,11 +236,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -196,8 +196,15 @@ export default {
|
|||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
.button_box{
|
||||||
|
// width: 100%;
|
||||||
|
// background: #f0f0f0;
|
||||||
|
// overflow: hidden;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background: #f0f0f0;
|
background: #ffffff;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
border-top: 1px #f3f1f1 solid;
|
||||||
|
box-shadow: 4px 7px 10px #565656;
|
||||||
|
border-radius: 0;
|
||||||
|
border-bottom: 1px transparent solid;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -298,11 +298,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
/deep/ {
|
/deep/ {
|
||||||
.card .el-transfer-panel__filter{
|
.card .el-transfer-panel__filter{
|
||||||
|
@ -223,11 +223,6 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@import "src/styles/mixin.scss";
|
@import "src/styles/mixin.scss";
|
||||||
.button_box{
|
|
||||||
width: 100%;
|
|
||||||
background: #f0f0f0;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.coordinate {
|
.coordinate {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ export default {
|
|||||||
queryForm: {
|
queryForm: {
|
||||||
labelWidth: '140px',
|
labelWidth: '140px',
|
||||||
reset: true,
|
reset: true,
|
||||||
|
leftSpan: 18,
|
||||||
queryObject: {
|
queryObject: {
|
||||||
'canDistribute': {
|
'canDistribute': {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
@ -106,7 +107,7 @@ export default {
|
|||||||
type: ''
|
type: ''
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '打包详情',
|
name: this.$t('orderAuthor.packingDetails'),
|
||||||
handleClick: this.handleDetail,
|
handleClick: this.handleDetail,
|
||||||
type: '',
|
type: '',
|
||||||
showControl: (row) => { return !row.permissionType; }
|
showControl: (row) => { return !row.permissionType; }
|
||||||
@ -115,19 +116,19 @@ export default {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
actions: [
|
actions: [
|
||||||
{ text: this.$t('permission.permissionPack'), btnCode: 'employee_insert', handler: this.handlePermissionPack },
|
{ text: this.$t('permission.permissionPack'), btnCode: 'employee_insert', handler: this.handlePermissionPack }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
'$route.params.mapId': function (val) {
|
||||||
|
this.$refs.queryListPage.refresh(true);
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadInitData();
|
this.loadInitData();
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
'$route.params.mapId': function (val) {
|
|
||||||
this.$refs.queryListPage.refresh(true);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
handleRoleVest(index, row) {
|
handleRoleVest(index, row) {
|
||||||
this.$refs.selectRole.doShow(row.id);
|
this.$refs.selectRole.doShow(row.id);
|
||||||
@ -151,9 +152,9 @@ export default {
|
|||||||
return row[porpInfo.property] ? row[porpInfo.property] : '---';
|
return row[porpInfo.property] ? row[porpInfo.property] : '---';
|
||||||
},
|
},
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
if (this.$route.params.mapId) {
|
if (this.$route.params.mapId) {
|
||||||
params.mapId = this.$route.params.mapId;
|
params.mapId = this.$route.params.mapId;
|
||||||
}
|
}
|
||||||
return listUserPermision(params);
|
return listUserPermision(params);
|
||||||
},
|
},
|
||||||
handlePermissionPack() {
|
handlePermissionPack() {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-card :style="{height: height+'px'}">
|
<el-card :style="{height: height+'px'}" style="overflow-y:scroll;padding-bottom:20px;">
|
||||||
<div class="runPlanHeader" style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
|
<div class="runPlanHeader" style="width: 90%;margin-left:5%;margin-top:20px;display: inline-block;">
|
||||||
<div class="runPlanList">{{$t('planMonitor.openRunPlan.runPlanList')}}</div>
|
<div class="runPlanList">{{$t('planMonitor.openRunPlan.runPlanList')}}</div>
|
||||||
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">{{$t('planMonitor.createRunningDiagram')}}</el-button>
|
<el-button size="small" type="primary" @click="handleCreate" class="createRunPlan" v-if="isCreate">{{$t('planMonitor.createRunningDiagram')}}</el-button>
|
||||||
|
80
src/views/publish/publishLesson/draft.vue
Normal file
80
src/views/publish/publishLesson/draft.vue
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
|
||||||
|
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doCreate">{{$t('global.confirm')}}</el-button>
|
||||||
|
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'PublishLessonDraft',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
cityList:[],
|
||||||
|
formModel:{
|
||||||
|
id:'',
|
||||||
|
remarks:'',
|
||||||
|
name:'',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
title: String
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
form() {
|
||||||
|
let form={
|
||||||
|
labelWidth: '150px',
|
||||||
|
items: [
|
||||||
|
{ prop: 'name', label: this.$t('publish.lessonName'), type: 'text', required: true},
|
||||||
|
{ prop: 'remarks', label: this.$t('publish.lessonIntroduction'), type: 'textarea', required: true,isAutoSize:{ minRows:1, maxRows:5 }},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
return form
|
||||||
|
},
|
||||||
|
rules() {
|
||||||
|
let crules ={
|
||||||
|
name:[
|
||||||
|
{ required: true, message: this.$t('rules.pleaseInputLessonName'), trigger: 'blur',max:100 },
|
||||||
|
{ required: true, message: this.$t('rules.pleaseInputLessonName'), trigger: 'change',max:100 },
|
||||||
|
],
|
||||||
|
remarks:[
|
||||||
|
{ required: true, message: this.$t('rules.pleaseLessonIntroduction'), trigger: 'blur',max:300 },
|
||||||
|
{ required: true, message: this.$t('rules.pleaseLessonIntroduction'), trigger: 'change',max:300 },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
return crules
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doShow(row) {
|
||||||
|
this.formModel.id=row.id;
|
||||||
|
this.formModel.remarks=row.remarks;
|
||||||
|
this.formModel.name=row.name;
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
doCreate() {
|
||||||
|
let self = this
|
||||||
|
this.$refs.dataform.validateForm(() => {
|
||||||
|
self.$emit('create', Object.assign({}, this.formModel));
|
||||||
|
self.doClose()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
// this.$refs.dataform.resetForm();
|
||||||
|
this.isShow = false;
|
||||||
|
this.dialogVisible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
/deep/ .el-dialog--center .el-dialog__body{
|
||||||
|
padding: 15px 65px 10px 10px;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,16 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||||
|
<update-operate ref='updateLesson' @create="handleUpdate" :title="$t('publish.updateLesson')">
|
||||||
|
</update-operate>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine } from '@/api/jmap/lesson';
|
import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine,updatePublishLesson } from '@/api/jmap/lesson';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
|
import UpdateOperate from './draft.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PublishMap',
|
name: 'PublishMap',
|
||||||
|
components:{
|
||||||
|
UpdateOperate
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cityList: [],
|
cityList: [],
|
||||||
@ -74,6 +80,12 @@ export default {
|
|||||||
type: 'warning',
|
type: 'warning',
|
||||||
showControl: (row) => { return row.status == 1; }
|
showControl: (row) => { return row.status == 1; }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: this.$t('global.edit'),
|
||||||
|
handleClick: this.handleEdit,
|
||||||
|
type: 'primary',
|
||||||
|
showControl: () => { return this.isShow != -1; }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: this.$t('global.delete'),
|
name: this.$t('global.delete'),
|
||||||
handleClick: this.handleDelete,
|
handleClick: this.handleDelete,
|
||||||
@ -115,8 +127,17 @@ export default {
|
|||||||
},
|
},
|
||||||
// 编辑
|
// 编辑
|
||||||
handleEdit(index, row) {
|
handleEdit(index, row) {
|
||||||
|
this.$refs.updateLesson.doShow(row);
|
||||||
|
},
|
||||||
|
// 确认编辑
|
||||||
|
handleUpdate(data){
|
||||||
|
updatePublishLesson(data).then(response => {
|
||||||
|
this.reloadTable();
|
||||||
|
this.$message.success(this.$t('publish.updateSuccess'));
|
||||||
|
}).catch(() => {
|
||||||
|
this.$messageBox(this.$t('error.updateFailed'));
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
handleDelete(index, row) {
|
handleDelete(index, row) {
|
||||||
this.$confirm(this.$t('publish.wellDelType'), this.$t('global.tips'), {
|
this.$confirm(this.$t('publish.wellDelType'), this.$t('global.tips'), {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
|
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
|
||||||
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
|
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="doCreate">{{$t('global.confirm')}}</el-button>
|
<el-button type="primary" @click="doCreate">{{ $t('global.confirm') }}</el-button>
|
||||||
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
|
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="card-box">
|
<!-- <div class="card-box">
|
||||||
<el-steps class="steps" :active="display">
|
<el-steps class="steps" :active="display">
|
||||||
<el-step :title="title" icon="el-icon-edit-outline" />
|
<el-step :title="title" icon="el-icon-edit-outline" />
|
||||||
@ -28,97 +28,96 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { updatePublishMapName } from '@/api/jmap/map';
|
// import { updatePublishMapName } from '@/api/jmap/map';
|
||||||
export default {
|
export default {
|
||||||
name: 'PublishMapDraft',
|
name: 'PublishMapDraft',
|
||||||
data() {
|
props: {
|
||||||
return {
|
title: String,
|
||||||
dialogVisible: false,
|
type: String
|
||||||
cityList:[],
|
},
|
||||||
formModel:{
|
data() {
|
||||||
mapId:'',
|
return {
|
||||||
cityCode:'',
|
dialogVisible: false,
|
||||||
name:'',
|
cityList: [],
|
||||||
}
|
formModel: {
|
||||||
}
|
mapId: '',
|
||||||
|
cityCode: '',
|
||||||
|
name: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
form() {
|
||||||
|
let form={};
|
||||||
|
if (this.type=='updateMapName') {
|
||||||
|
form={
|
||||||
|
labelWidth: '150px',
|
||||||
|
items: [
|
||||||
|
{ prop: 'name', label: this.$t('publish.mapName'), type: 'text', required: true}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
form={
|
||||||
|
labelWidth: '150px',
|
||||||
|
items: [
|
||||||
|
{ prop: 'cityCode', label: this.$t('publish.city'), type: 'select', required: true, options: this.cityList}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return form;
|
||||||
},
|
},
|
||||||
mounted(){
|
rules() {
|
||||||
this.loadInitData();
|
let crules ={};
|
||||||
|
if (this.type=='updateMapName') {
|
||||||
|
crules ={
|
||||||
|
name: [
|
||||||
|
{ required: true, message: this.$t('rules.pleaseInputMapName'), trigger: 'blur', max: 100 },
|
||||||
|
{ required: true, message: this.$t('rules.pleaseInputMapName'), trigger: 'change', max: 100 }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
crules ={
|
||||||
|
id: [
|
||||||
|
{ required: true, message: this.$t('rules.pleaseSelectCity'), trigger: 'change', max: 100 }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return crules;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.loadInitData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
async loadInitData() {
|
||||||
|
this.cityList = [];
|
||||||
|
const res=await this.$Dictionary.cityType();
|
||||||
|
this.cityList = res.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||||
},
|
},
|
||||||
props: {
|
doShow(row) {
|
||||||
title: String,
|
this.formModel.mapId=row.id;
|
||||||
type:String,
|
if (this.type=='updateMapName') {
|
||||||
},
|
this.formModel.name=row.name;
|
||||||
computed: {
|
} else {
|
||||||
form() {
|
this.formModel.cityCode=row.cityCode;
|
||||||
let form={};
|
}
|
||||||
if(this.type=="updateMapName"){
|
|
||||||
form={
|
|
||||||
labelWidth: '150px',
|
|
||||||
items: [
|
|
||||||
{ prop: 'name', label: this.$t('publish.mapName'), type: 'text', required: true},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
form={
|
|
||||||
labelWidth: '150px',
|
|
||||||
items: [
|
|
||||||
{ prop: 'cityCode', label: this.$t('publish.city'), type: 'select', required: true,options:this.cityList},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return form
|
|
||||||
},
|
|
||||||
rules() {
|
|
||||||
let crules ={};
|
|
||||||
if(this.type=="updateMapName"){
|
|
||||||
crules ={
|
|
||||||
name:[
|
|
||||||
{ required: true, message: this.$t('rules.pleaseInputMapName'), trigger: 'blur',max:100 },
|
|
||||||
{ required: true, message: this.$t('rules.pleaseInputMapName'), trigger: 'change',max:100 },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
crules ={
|
|
||||||
id:[
|
|
||||||
{ required: true, message: this.$t('rules.pleaseSelectCity'), trigger: 'change',max:100 },
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return crules
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async loadInitData() {
|
|
||||||
this.cityList = [];
|
|
||||||
let res=await this.$Dictionary.cityType();
|
|
||||||
this.cityList = res.map(elem => { return { value: elem.code, label: elem.name } });
|
|
||||||
},
|
|
||||||
doShow(row) {
|
|
||||||
this.formModel.mapId=row.id;
|
|
||||||
if(this.type=="updateMapName"){
|
|
||||||
this.formModel.name=row.name;
|
|
||||||
}else{
|
|
||||||
this.formModel.cityCode=row.cityCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.dialogVisible = true
|
|
||||||
},
|
|
||||||
doCreate() {
|
|
||||||
let self = this
|
|
||||||
this.$refs.dataform.validateForm(() => {
|
|
||||||
self.$emit('create', Object.assign({}, this.formModel));
|
|
||||||
self.doClose()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
doClose() {
|
|
||||||
this.$refs.dataform.resetForm();
|
|
||||||
this.isShow = false;
|
|
||||||
this.dialogVisible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
this.dialogVisible = true;
|
||||||
|
},
|
||||||
|
doCreate() {
|
||||||
|
const self = this;
|
||||||
|
this.$refs.dataform.validateForm(() => {
|
||||||
|
self.$emit('create', Object.assign({}, this.formModel));
|
||||||
|
self.doClose();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
doClose() {
|
||||||
|
this.$refs.dataform.resetForm();
|
||||||
|
this.isShow = false;
|
||||||
|
this.dialogVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// export default {
|
// export default {
|
||||||
// name: 'PublishMapDraft',
|
// name: 'PublishMapDraft',
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||||
<update-operate ref='updateMapName' @reloadTable="reloadTable" @create="handleUpdateMap" :title="$t('publish.updateMapName')" type="updateMapName">
|
<update-operate ref="updateMapName" :title="$t('publish.updateMapName')" type="updateMapName" @create="handleUpdateMap" />
|
||||||
</update-operate>
|
<update-operate ref="updateCityName" :title="$t('publish.updateCityName')" type="updateCityName" @create="handleCityUpdate" />
|
||||||
<update-operate ref='updateCityName' @reloadTable="reloadTable" @create="handleCityUpdate" :title="$t('publish.updateCityName')" type="updateCityName">
|
<set-project ref="setProject" @refresh="reloadTable" />
|
||||||
</update-operate>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine,updatePublishMapName,updatePublishMapCity } from '@/api/jmap/map';
|
import { getPublishMapList, delPublishMap, getPublishMapExport, putMapOnLine, putMapOffLine, updatePublishMapName, updatePublishMapCity } from '@/api/jmap/map';
|
||||||
import { getSkinCodeList } from '@/api/management/mapskin';
|
import { getSkinCodeList } from '@/api/management/mapskin';
|
||||||
import { UrlConfig } from '@/router/index';
|
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
import UpdateOperate from './draft.vue';
|
import UpdateOperate from './draft.vue';
|
||||||
|
import SetProject from './project';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'PublishMap',
|
name: 'PublishMap',
|
||||||
components:{
|
components: {
|
||||||
UpdateOperate
|
UpdateOperate,
|
||||||
|
SetProject
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -117,6 +117,10 @@ export default {
|
|||||||
name: this.$t('global.export'),
|
name: this.$t('global.export'),
|
||||||
handleClick: this.handleExportMapSame,
|
handleClick: this.handleExportMapSame,
|
||||||
showControl: () => { return process.env.NODE_ENV === 'development'; }
|
showControl: () => { return process.env.NODE_ENV === 'development'; }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '设置所属项目',
|
||||||
|
handleClick: this.handleSetProject
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -156,8 +160,11 @@ export default {
|
|||||||
// this.$router.push({ path: `${UrlConfig.publish.mapDraft}/edit/${row.id}`, query: { name: row.name } });
|
// this.$router.push({ path: `${UrlConfig.publish.mapDraft}/edit/${row.id}`, query: { name: row.name } });
|
||||||
this.$refs.updateMapName.doShow(row);
|
this.$refs.updateMapName.doShow(row);
|
||||||
},
|
},
|
||||||
|
handleSetProject(index, row) {
|
||||||
|
this.$refs.setProject.doShow(row);
|
||||||
|
},
|
||||||
// 编辑城市
|
// 编辑城市
|
||||||
handleUpdateCity(index, row){
|
handleUpdateCity(index, row) {
|
||||||
this.$refs.updateCityName.doShow(row);
|
this.$refs.updateCityName.doShow(row);
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
@ -177,7 +184,7 @@ export default {
|
|||||||
});
|
});
|
||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
handleUpdateMap(data){
|
handleUpdateMap(data) {
|
||||||
delete data.cityCode;
|
delete data.cityCode;
|
||||||
updatePublishMapName(data).then(response => {
|
updatePublishMapName(data).then(response => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
@ -186,14 +193,14 @@ export default {
|
|||||||
this.$messageBox(this.$t('error.updateFailed'));
|
this.$messageBox(this.$t('error.updateFailed'));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleCityUpdate(data){
|
handleCityUpdate(data) {
|
||||||
delete data.name;
|
delete data.name;
|
||||||
updatePublishMapCity(data).then(response => {
|
updatePublishMapCity(data).then(response => {
|
||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
this.$message.success(this.$t('publish.updateSuccess'));
|
this.$message.success(this.$t('publish.updateSuccess'));
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$messageBox(this.$t('error.updateFailed'));
|
this.$messageBox(this.$t('error.updateFailed'));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reloadTable() {
|
reloadTable() {
|
||||||
this.queryList.reload();
|
this.queryList.reload();
|
||||||
|
87
src/views/publish/publishMap/project.vue
Normal file
87
src/views/publish/publishMap/project.vue
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-dialogDrag title="设置归属项目" :visible.sync="dialogVisible" width="30%" center>
|
||||||
|
<el-form ref="form" :model="formModel" label-width="100px" label-position="left">
|
||||||
|
<el-form-item label="地图名称">
|
||||||
|
<span>{{ formModel.name }}</span>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否归属项目" prop="project">
|
||||||
|
<el-radio-group v-model="formModel.project" @change="changeProject">
|
||||||
|
<el-radio :label="booleanValue.t">是</el-radio>
|
||||||
|
<el-radio :label="booleanValue.f">否</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="formModel.project"
|
||||||
|
label="归属项目"
|
||||||
|
prop="projectCode"
|
||||||
|
:rules="{
|
||||||
|
required: true, message: '归属项目不能为空', trigger: 'change'
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-select v-model="formModel.projectCode" placeholder="请选择归属项目">
|
||||||
|
<el-option label="西铁院" value="XTY" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||||
|
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { setMapProject } from '@/api/jmap/map';
|
||||||
|
export default {
|
||||||
|
name: 'SetMapProject',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialogVisible: false,
|
||||||
|
formModel: {
|
||||||
|
id: '',
|
||||||
|
name: '',
|
||||||
|
cityCode: '',
|
||||||
|
skinCode: '',
|
||||||
|
project: false,
|
||||||
|
projectCode: ''
|
||||||
|
},
|
||||||
|
projectCodeShow: false,
|
||||||
|
booleanValue: {
|
||||||
|
t: true,
|
||||||
|
f: false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doShow(row) {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
this.formModel.id = row.id;
|
||||||
|
this.formModel.name = row.name;
|
||||||
|
this.formModel.cityCode = row.cityCode;
|
||||||
|
this.formModel.skinCode = row.skinCode;
|
||||||
|
},
|
||||||
|
doSave() {
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
setMapProject(this.formModel).then(resp =>{
|
||||||
|
this.$message.success('设置归属项目成功!');
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$emit('refresh');
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
changeProject(val) {
|
||||||
|
if (!val) {
|
||||||
|
this.formModel.projectCode = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
@ -22,7 +22,7 @@ import { mapGetters } from 'vuex';
|
|||||||
import { admin, superAdmin} from '@/router';
|
import { admin, superAdmin} from '@/router';
|
||||||
import { getQuestPageList,createQuest,deleteQuest,updateQuest,publishQuest,retractQuest} from '@/api/quest';
|
import { getQuestPageList,createQuest,deleteQuest,updateQuest,publishQuest,retractQuest} from '@/api/quest';
|
||||||
import { launchFullscreen } from '@/utils/screen';
|
import { launchFullscreen } from '@/utils/screen';
|
||||||
import { scriptRecordNotify } from '@/api/simulation';
|
import { scriptDraftRecordNotify,scriptRecordNotify } from '@/api/simulation';
|
||||||
import CreateScript from './create';
|
import CreateScript from './create';
|
||||||
import ScriptPublish from './publish';
|
import ScriptPublish from './publish';
|
||||||
|
|
||||||
@ -124,9 +124,6 @@ export default {
|
|||||||
this.reloadTable();
|
this.reloadTable();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.reloadTable();
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
queryFunction(params) {
|
queryFunction(params) {
|
||||||
return getQuestPageList(this.$route.params.mapId,params);
|
return getQuestPageList(this.$route.params.mapId,params);
|
||||||
@ -266,7 +263,7 @@ export default {
|
|||||||
}).catch(() => { });
|
}).catch(() => { });
|
||||||
},
|
},
|
||||||
previewScript(index,row){
|
previewScript(index,row){
|
||||||
scriptRecordNotify(row.id).then(resp => {
|
scriptDraftRecordNotify(row.id).then(resp => {
|
||||||
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id,skinCode:this.$route.query.skinCode,try:0};
|
const query = { mapId: row.mapId, group: resp.data, scriptId: row.id,skinCode:this.$route.query.skinCode,try:0};
|
||||||
this.$router.push({ path: `${UrlConfig.design.display}/demon`, query });
|
this.$router.push({ path: `${UrlConfig.design.display}/demon`, query });
|
||||||
launchFullscreen();
|
launchFullscreen();
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<div slot="header" style="text-align: center;">
|
<div slot="header" style="text-align: center;">
|
||||||
<b>{{ $t('teach.courseName') }}: {{ courseModel.name }}</b>
|
<b>{{ $t('teach.courseName') }}: {{ courseModel.name }}</b>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin:50px" :style="{ height: height - 190 +'px' }">
|
<div style="margin:50px" :style="{ height: height - 230 +'px' }">
|
||||||
<el-tabs v-model="activeName">
|
<el-tabs v-model="activeName">
|
||||||
<el-tab-pane :label="$t('teach.courseDetails')" name="first">
|
<el-tab-pane :label="$t('teach.courseDetails')" name="first">
|
||||||
<div :style="{ height: height - 270 +'px' }">
|
<div :style="{ height: height - 270 +'px' }">
|
||||||
|
@ -40,37 +40,39 @@ import { UrlConfig } from '@/router/index';
|
|||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TeachHome',
|
name: 'TeachHome',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [],
|
tableData: [],
|
||||||
loading: false
|
loading: false
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'$route.params.subSystem': function(newVal) {
|
'$route.params.subSystem': function(newVal) {
|
||||||
this.loadInitPage();
|
this.loadInitPage();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.loadInitPage();
|
this.loadInitPage();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadInitPage() {
|
loadInitPage() {
|
||||||
if (this.$route.params.subSystem) {
|
if (this.$route.params.subSystem) {
|
||||||
getSubSystemDetail(this.$route.params.subSystem).then(resp =>{
|
getSubSystemDetail(this.$route.params.subSystem).then(resp =>{
|
||||||
if (resp.data) {
|
if (resp.data) {
|
||||||
this.tableData = resp.data.lessonList;
|
this.tableData = resp.data.lessonList;
|
||||||
}
|
} else {
|
||||||
}).catch(()=>{
|
this.tableData = [];
|
||||||
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
|
}
|
||||||
});
|
}).catch(()=>{
|
||||||
}
|
this.$messageBox(this.$t('error.obtainCourseInformationFailed'));
|
||||||
},
|
});
|
||||||
goLesson(row) {
|
}
|
||||||
localStore.set('teachDetail'+this.$route.params.subSystem, `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}?lessonId=${row.id}&mapId=${row.mapId}&prdCode=${row.prdCode}`);
|
},
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdCode: row.prdCode}});
|
goLesson(row) {
|
||||||
}
|
localStore.set('teachDetail' + this.$route.params.subSystem, `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}?lessonId=${row.id}&mapId=${row.mapId}&prdCode=${row.prdCode}`);
|
||||||
}
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachDetail}/${this.$route.params.subSystem}`, query: {lessonId: row.id, mapId: row.mapId, prdCode: row.prdCode}});
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -3,210 +3,219 @@
|
|||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>{{ $t('global.mapList') }}</span>
|
<span>{{ $t('global.mapList') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<filter-city ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
|
<div style="height: calc(100% - 47px);">
|
||||||
<el-input v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
<filter-city v-if="project==='login'" ref="filerCity" filter-empty :query-function="queryFunction" :local-param-name="localParamName" @filterSelectChange="refresh" />
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-125) +'px' }">
|
<el-input v-if="project==='login'" v-model="filterText" :placeholder="this.$t('global.filteringKeywords')" clearable />
|
||||||
<el-tree
|
<div style="height: 100%;">
|
||||||
ref="tree"
|
<el-tree
|
||||||
:data="treeList"
|
ref="tree"
|
||||||
node-key="id"
|
:data="treeList"
|
||||||
:props="defaultProps"
|
node-key="id"
|
||||||
highlight-current
|
:props="defaultProps"
|
||||||
:span="22"
|
highlight-current
|
||||||
:filter-node-method="filterNode"
|
:span="22"
|
||||||
:default-expanded-keys="expandList"
|
:filter-node-method="filterNode"
|
||||||
@node-click="clickEvent"
|
:default-expanded-keys="expandList"
|
||||||
@node-contextmenu="showContextMenu"
|
@node-click="clickEvent"
|
||||||
@node-expand="nodeExpand"
|
@node-contextmenu="showContextMenu"
|
||||||
@node-collapse="nodeCollapse"
|
@node-expand="nodeExpand"
|
||||||
>
|
@node-collapse="nodeCollapse"
|
||||||
<span slot-scope="{ node }">
|
>
|
||||||
<span
|
<span slot-scope="{ node }">
|
||||||
class="el-icon-tickets"
|
<span
|
||||||
/>
|
class="el-icon-tickets"
|
||||||
<span v-if="node.data.id ==='Simulation'"> {{ node.data.name+ $t('global.simulationSystem') }}</span>
|
/>
|
||||||
<span v-else-if="node.data.id ==='Lesson'"> {{ node.data.name+ $t('global.lessonSystem') }}</span>
|
<span v-if="node.data.id ==='Simulation'"> {{ node.data.name+ $t('global.simulationSystem') }}</span>
|
||||||
<span v-else-if="node.data.id ==='Exam'"> {{ node.data.name+ $t('global.examSystem') }}</span>
|
<span v-else-if="node.data.id ==='Lesson'"> {{ node.data.name+ $t('global.lessonSystem') }}</span>
|
||||||
<span v-else-if="node.data.id ==='Plan'"> {{ node.data.name+ $t('global.runPlanSystem') }}</span>
|
<span v-else-if="node.data.id ==='Exam'"> {{ node.data.name+ $t('global.examSystem') }}</span>
|
||||||
<span v-else> {{ node.data.name }}</span>
|
<span v-else-if="node.data.id ==='Plan'"> {{ node.data.name+ $t('global.runPlanSystem') }}</span>
|
||||||
</span>
|
<span v-else> {{ node.data.name }}</span>
|
||||||
</el-tree>
|
</span>
|
||||||
</el-scrollbar>
|
</el-tree>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getPublishMapTree } from '@/api/management/mapprd';
|
import { getPublishMapTree } from '@/api/management/mapprd';
|
||||||
import { getTrainingSystemList, getSubSystemInfo } from '@/api/trainingPlatform';
|
import { getTrainingSystemList, getSubSystemInfo, getSubSystemByProjectCode } from '@/api/trainingPlatform';
|
||||||
import { UrlConfig } from '@/router/index';
|
import { UrlConfig } from '@/router/index';
|
||||||
import FilterCity from '@/views/components/filterCity';
|
import FilterCity from '@/views/components/filterCity';
|
||||||
import localStore from 'storejs';
|
import localStore from 'storejs';
|
||||||
import { getSessionStorage } from '@/utils/auth';
|
import { getSessionStorage } from '@/utils/auth';
|
||||||
|
import { ProjectCode } from '@/scripts/ConstDic';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'DemonList',
|
name: 'DemonList',
|
||||||
components: {
|
components: {
|
||||||
FilterCity
|
FilterCity
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
height: {
|
height: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
defaultShowKeys: [],
|
defaultShowKeys: [],
|
||||||
queryFunction: getPublishMapTree,
|
queryFunction: getPublishMapTree,
|
||||||
filterText: '',
|
filterText: '',
|
||||||
treeList: [],
|
treeList: [],
|
||||||
selected: {},
|
selected: {},
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: 'children',
|
children: 'children',
|
||||||
label: 'name'
|
label: 'name'
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
},
|
},
|
||||||
mapId: '',
|
mapId: '',
|
||||||
expandList: [],
|
expandList: [],
|
||||||
filterSelect: '',
|
filterSelect: '',
|
||||||
localParamName: 'training_cityCode'
|
localParamName: 'training_cityCode'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
userId() {
|
userId() {
|
||||||
return this.$store.state.user.id;
|
return this.$store.state.user.id;
|
||||||
},
|
},
|
||||||
project() {
|
project() {
|
||||||
return getSessionStorage('project');
|
return getSessionStorage('project');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
filterText(val) {
|
filterText(val) {
|
||||||
this.$refs.tree.filter(val);
|
this.$refs.tree.filter(val);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeDestroy () {
|
beforeDestroy () {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
},
|
if (this.project === 'xty') {
|
||||||
methods: {
|
this.refresh();
|
||||||
filterNode(value, data) {
|
}
|
||||||
if (!value) return true;
|
},
|
||||||
return data.name.indexOf(value) !== -1;
|
methods: {
|
||||||
},
|
filterNode(value, data) {
|
||||||
showContextMenu(e, obj, node, vueElem) {
|
if (!value) return true;
|
||||||
if (obj) {
|
return data.name.indexOf(value) !== -1;
|
||||||
this.node = node;
|
},
|
||||||
this.selected = obj;
|
showContextMenu(e, obj, node, vueElem) {
|
||||||
}
|
if (obj) {
|
||||||
},
|
this.node = node;
|
||||||
clickEvent(obj, data, ele) {
|
this.selected = obj;
|
||||||
localStore.set('trainingPlatformCheckId'+this.filterSelect+this.userId, obj.id);
|
}
|
||||||
while (data) {
|
},
|
||||||
if (data.data.type === 'Map') {
|
clickEvent(obj, data, ele) {
|
||||||
this.mapId = data.data.id;
|
localStore.set('trainingPlatformCheckId' + this.filterSelect + this.userId, obj.id);
|
||||||
break;
|
while (data) {
|
||||||
}
|
if (data.data.type === 'Map') {
|
||||||
data = data.parent;
|
this.mapId = data.data.id;
|
||||||
}
|
break;
|
||||||
if ( obj.type === 'Map') {
|
}
|
||||||
this.mapId = obj.id;
|
data = data.parent;
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
|
}
|
||||||
} else if ( obj.type === 'MapSystem') {
|
if ( obj.type === 'Map') {
|
||||||
getSubSystemInfo(obj.id).then(resp => {
|
this.mapId = obj.id;
|
||||||
let router = '';
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${this.mapId}`});
|
||||||
switch (resp.data.type) {
|
} else if ( obj.type === 'MapSystem') {
|
||||||
case 'Exam':
|
getSubSystemInfo(obj.id).then(resp => {
|
||||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
|
let router = '';
|
||||||
router = localStore.get('examDetail' + obj.id);
|
switch (resp.data.type) {
|
||||||
if (router) {
|
case 'Exam':
|
||||||
this.$router.push(router);
|
this.setLocalRoute(`${UrlConfig.trainingPlatform.examHome}/${obj.id}`);
|
||||||
} else {
|
router = localStore.get('examDetail' + obj.id);
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
|
if (router) {
|
||||||
}
|
this.$router.push(router);
|
||||||
break;
|
} else {
|
||||||
case 'Lesson':
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.examHome}/${obj.id}`});
|
||||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
|
}
|
||||||
router = localStore.get('teachDetail' + obj.id);
|
break;
|
||||||
if (router) {
|
case 'Lesson':
|
||||||
this.$router.push(router);
|
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
|
||||||
} else {
|
router = localStore.get('teachDetail' + obj.id);
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
|
if (router) {
|
||||||
}
|
this.$router.push(router);
|
||||||
break;
|
} else {
|
||||||
case 'Simulation':
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`});
|
||||||
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
|
}
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
|
break;
|
||||||
break;
|
case 'Simulation':
|
||||||
case 'Plan':
|
this.setLocalRoute(`${UrlConfig.trainingPlatform.prodDetail}/${obj.id}?mapId=${this.mapId}`);
|
||||||
this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {skinCode: '02'} });
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.prodDetail}/${obj.id}`, query: { mapId: this.mapId}});
|
||||||
break;
|
break;
|
||||||
}
|
case 'Plan':
|
||||||
}).catch((error) => {
|
this.$router.push({ path: `${UrlConfig.trainingPlatform.runPlan}/${this.mapId}`, query: {skinCode: '02'} });
|
||||||
if (error.code === '40004') {
|
break;
|
||||||
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
|
}
|
||||||
}
|
}).catch((error) => {
|
||||||
});
|
if (error.code === '40004') {
|
||||||
}
|
this.$messageBox(this.$t('systemGenerate.getSubSystemInfoFail'));
|
||||||
},
|
}
|
||||||
setLocalRoute(path) {
|
});
|
||||||
localStore.set('trainingPlatformRoute'+this.userId, path);
|
}
|
||||||
},
|
},
|
||||||
async refresh(filterSelect) {
|
setLocalRoute(path) {
|
||||||
this.loading = true;
|
localStore.set('trainingPlatformRoute' + this.userId, path);
|
||||||
this.treeList = [];
|
},
|
||||||
this.filterSelect = filterSelect;
|
async refresh(filterSelect) {
|
||||||
try {
|
this.loading = true;
|
||||||
let params={};
|
this.treeList = [];
|
||||||
if (this.project === 'xty') {
|
this.filterSelect = filterSelect;
|
||||||
params={'customized': 'xty'};
|
try {
|
||||||
}
|
let res = {};
|
||||||
const res = await getTrainingSystemList(filterSelect, params);
|
if (this.project === 'xty') {
|
||||||
res.data.forEach(item =>{
|
res = await getSubSystemByProjectCode(ProjectCode[this.project]);
|
||||||
item.key = item.id + item.type;
|
} else {
|
||||||
item.children && item.children.forEach(childrenItem => {
|
res = await getTrainingSystemList(filterSelect);
|
||||||
childrenItem.key = childrenItem.id + item.type;
|
}
|
||||||
});
|
this.$emit('goRoutePath', res.data);
|
||||||
});
|
res.data && res.data.forEach(item =>{
|
||||||
this.treeList = res.data;
|
item.key = item.id + item.type;
|
||||||
this.getExpandList(filterSelect);
|
item.children && item.children.forEach(childrenItem => {
|
||||||
// this.changeCityWithPage(this.treeList);
|
childrenItem.key = childrenItem.id + item.type;
|
||||||
this.$nextTick(() => {
|
});
|
||||||
const checkId = localStore.get('trainingPlatformCheckId'+filterSelect+this.userId) || null;
|
});
|
||||||
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
|
this.treeList = res.data;
|
||||||
this.loading = false;
|
this.getExpandList(filterSelect);
|
||||||
});
|
// this.changeCityWithPage(this.treeList);
|
||||||
} catch (error) {
|
this.$nextTick(() => {
|
||||||
this.loading = false;
|
const checkId = localStore.get('trainingPlatformCheckId' + filterSelect + this.userId) || null;
|
||||||
this.$messageBox(this.$t('error.refreshFailed'));
|
this.$refs.tree && this.$refs.tree.setCurrentKey(checkId);
|
||||||
}
|
this.loading = false;
|
||||||
},
|
});
|
||||||
nodeExpand(obj, node, ele) {
|
} catch (error) {
|
||||||
const key = obj.id;
|
this.loading = false;
|
||||||
this.expandList = this.expandList.filter(item => item!==key);
|
this.$messageBox(this.$t('error.refreshFailed'));
|
||||||
this.expandList.push(key);
|
}
|
||||||
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.userId, this.expandList);
|
},
|
||||||
},
|
nodeExpand(obj, node, ele) {
|
||||||
nodeCollapse(obj, node, ele) {
|
const key = obj.id;
|
||||||
const key = obj.id;
|
this.expandList = this.expandList.filter(item => item !== key);
|
||||||
this.expandList = this.expandList.filter(item => item!==key);
|
this.expandList.push(key);
|
||||||
localStore.set('trainIngPlatformExpandList'+this.filterSelect+this.userId, this.expandList);
|
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId, this.expandList);
|
||||||
},
|
},
|
||||||
getExpandList(filterSelect) {
|
nodeCollapse(obj, node, ele) {
|
||||||
let expand = localStore.get('trainIngPlatformExpandList'+filterSelect+this.userId);
|
const key = obj.id;
|
||||||
expand = expand?(expand+'').split(','):'';
|
this.expandList = this.expandList.filter(item => item !== key);
|
||||||
if (expand instanceof Array) {
|
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId, this.expandList);
|
||||||
this.expandList = expand;
|
},
|
||||||
}
|
getExpandList(filterSelect) {
|
||||||
}
|
let expand = localStore.get('trainIngPlatformExpandList' + filterSelect + this.userId);
|
||||||
// changeCityWithPage(treeList) {
|
expand = expand ? (expand + '').split(',') : '';
|
||||||
// if (treeList.length > 0) {
|
if (expand instanceof Array) {
|
||||||
// this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${treeList[0].id}`});
|
this.expandList = expand;
|
||||||
// this.$refs.tree.setCurrentKey(treeList[0].id);
|
}
|
||||||
// }
|
}
|
||||||
// }
|
// changeCityWithPage(treeList) {
|
||||||
}
|
// if (treeList.length > 0) {
|
||||||
|
// this.$router.push({ path: `${UrlConfig.trainingPlatform.permission}/${treeList[0].id}`});
|
||||||
|
// this.$refs.tree.setCurrentKey(treeList[0].id);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
@ -223,7 +232,10 @@ export default {
|
|||||||
.el-tree {
|
.el-tree {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
.map-list-main{
|
||||||
|
text-align:left;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
.el-tree-node.is-current>.el-tree-node__content {
|
.el-tree-node.is-current>.el-tree-node__content {
|
||||||
background-color: #e4e3e3 !important;
|
background-color: #e4e3e3 !important;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="app-wrapper">
|
<div class="app-wrapper">
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||||
<demon-list ref="demonList" :height="height" />
|
<demon-list ref="demonList" :height="height" @goRoutePath="goRoutePath" />
|
||||||
</div>
|
</div>
|
||||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||||
<transition>
|
<transition>
|
||||||
@ -21,58 +21,61 @@ import localStore from 'storejs';
|
|||||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'TrainingPlatform',
|
name: 'TrainingPlatform',
|
||||||
components: {
|
components: {
|
||||||
demonList,
|
demonList,
|
||||||
drapLeft
|
drapLeft
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
listShow: true,
|
listShow: true,
|
||||||
widthLeft: 450,
|
widthLeft: 450,
|
||||||
productList: []
|
productList: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'lessonbar'
|
'lessonbar'
|
||||||
]),
|
]),
|
||||||
height() {
|
height() {
|
||||||
return this.$store.state.app.height - 50;
|
return this.$store.state.app.height - 50;
|
||||||
},
|
},
|
||||||
width() {
|
width() {
|
||||||
return this.$store.state.app.width;
|
return this.$store.state.app.width;
|
||||||
},
|
},
|
||||||
userId() {
|
userId() {
|
||||||
return this.$store.state.user.id;
|
return this.$store.state.user.id;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'lessonbar.opened': function (val) {
|
'lessonbar.opened': function (val) {
|
||||||
this.listShow = val;
|
this.listShow = val;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
const againEnter = getSessionStorage('againEnter') || null;
|
this.widthLeft = Number(localStore.get('LeftWidth')) ? Number(localStore.get('LeftWidth')) : 450;
|
||||||
if (!againEnter) {
|
},
|
||||||
launchFullscreen();
|
methods: {
|
||||||
const path = localStore.get('trainingPlatformRoute'+ this.userId);
|
refresh() {
|
||||||
if (path && path.startsWith('/trainingPlatform')) {
|
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
|
||||||
this.$router.push(path);
|
},
|
||||||
}
|
drapWidth(width) {
|
||||||
setSessionStorage('againEnter', true);
|
this.widthLeft = Number(width);
|
||||||
}
|
},
|
||||||
|
goRoutePath(data) {
|
||||||
this.widthLeft = Number(localStore.get('LeftWidth'))?Number(localStore.get('LeftWidth')):450;
|
const againEnter = getSessionStorage('againEnter') || null;
|
||||||
},
|
if (!againEnter) {
|
||||||
methods: {
|
launchFullscreen();
|
||||||
refresh() {
|
const path = localStore.get('trainingPlatformRoute' + this.userId);
|
||||||
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
|
if (path && path.startsWith('/trainingPlatform')) {
|
||||||
},
|
this.$router.push(path);
|
||||||
drapWidth(width) {
|
} else if (data && data[0]) {
|
||||||
this.widthLeft = Number(width);
|
this.$router.push(`/trainingPlatform/permission/${data[0].id}`);
|
||||||
}
|
}
|
||||||
}
|
setSessionStorage('againEnter', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||||
|
Loading…
Reference in New Issue
Block a user