This commit is contained in:
fan 2019-08-30 17:43:50 +08:00
commit bf23362b2b
47 changed files with 1200 additions and 1313 deletions

View File

@ -27,18 +27,10 @@ export function getPermissonDetail(id) {
}); });
} }
/** 获取权限list*/
export function getPermissonList() {
return request({
url: `/api/permission/list`,
method: 'get'
});
}
/** 获取用户某课程某段时间内可用的权限数量*/ /** 获取用户某课程某段时间内可用的权限数量*/
export function getTotalRemains(params) { export function getTotalRemains(params) {
return request({ return request({
url: '/api/permission/totalRemains', url: '/api/userPermission/totalRemains',
method: 'get', method: 'get',
params: params params: params
}); });
@ -46,7 +38,7 @@ export function getTotalRemains(params) {
/** 设置权限失效或有效*/ /** 设置权限失效或有效*/
export function setLessonPermisson(data) { export function setLessonPermisson(data) {
return request({ return request({
url: `/api/permission/${data.id}/status`, url: `/api/userPermission/${data.id}/status`,
method: 'put', method: 'put',
data: data data: data
}); });
@ -57,7 +49,7 @@ export function setLessonPermisson(data) {
*/ */
export function queryPermissionSimulation(data) { export function queryPermissionSimulation(data) {
return request({ return request({
url: `/api/permission/${data.mapId}/${data.prdCode}/simulation`, url: `/api/userPermission/${data.mapId}/${data.prdCode}/simulation`,
method: 'get' method: 'get'
}); });
} }
@ -65,38 +57,28 @@ export function queryPermissionSimulation(data) {
/** 获取大屏权限列表*/ /** 获取大屏权限列表*/
export function queryPermissionScreen() { export function queryPermissionScreen() {
return request({ return request({
url: `/api/permission/bigScreen`, url: `/api/userPermission/bigScreen`,
method: 'get' method: 'get'
}); });
} }
/** 更新课程权限*/
/*
export function updateLessonPermisson(data) {
return request({
url: '/api/permission',
method: 'put',
data: data
});
}
*/
/** 删除课程权限*/
/*
export function deleteLessonPermisson(id) {
return request({
url: '/api/permission/' + id,
method: 'delete'
});
}
*/
/** /**
* 用户权限列表 * 用户权限列表
*/ */
export function listPermision(params) {
return request({
url: `/api/userPermission`,
method: 'get',
params: params
});
}
/**
* 个人权限列表
*/
export function listUserPermision(params) { export function listUserPermision(params) {
return request({ return request({
url: `/api/permission/my`, url: `/api/userPermission/my`,
method: 'get', method: 'get',
params: params params: params
}); });
@ -110,10 +92,10 @@ export function getDistribute(id) {
}); });
} }
/** 用户权限列表 */ /** 设置权限所有者 */
export function putPermissionOwner(data) { export function putPermissionOwner(data) {
return request({ return request({
url: `/api/permission/${data.id}/owner`, url: `/api/userPermission/${data.id}/owner`,
method: 'put', method: 'put',
data: data.owner data: data.owner
}); });

View File

@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
/** 上课权限获取*/ /** 权限转增*/
export function getLessons(data) { export function getLessons(data) {
return request({ return request({
url: '/api/distribute/getLessons', url: '/api/distribute/getLessons',
@ -9,15 +9,41 @@ export function getLessons(data) {
}); });
} }
/** 上课权限分发*/ /** 权限分发*/
export function giveLessons(data) { export function giveLessons(data) {
return request({ return request({
url: '/api/distribute/givePermission', url: '/api/distribute/distribute',
method: 'post', method: 'post',
data: data data: data
}); });
} }
/** 权限转增*/
export function permissionTurnAdd(data) {
return request({
url: '/api/distribute/transfer',
method: 'post',
data: data
});
}
/** 从订单分发权限(获取二维码)*/
export function postDistribute(data) {
return request({
url: `/api/distribute/${data.code}/distribute`,
method: 'post',
data: data
});
}
/** 权限获取*/
export function getPermission(state) {
return request({
url: `/api/distribute/getPermission?state=${state}`,
method: 'get'
});
}
/** 接收课程权限*/ /** 接收课程权限*/
export function receiveLessons(data) { export function receiveLessons(data) {
return request({ return request({

View File

@ -37,3 +37,10 @@ export function saveScheduling(group, data) {
data data
}); });
} }
export function generateSchedulingAgain(group) {
return request({
url: `/api/scheduling/${group}/rebuild`,
method: 'delete'
});
}

View File

@ -63,8 +63,7 @@
:sortable="column.sortable" :sortable="column.sortable"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="column.tagType(scope.row, scope.$index)">{{ column.columnValue(scope.row, <el-tag v-if="column.columnValue(scope.row, scope.$index)" :type="column.tagType(scope.row, scope.$index)">{{ column.columnValue(scope.row, scope.$index) }}</el-tag>
scope.$index) }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column

View File

@ -10,7 +10,7 @@ export default {
permissionStatus: '权限状态', permissionStatus: '权限状态',
permissionUseType: '公用/专用', permissionUseType: '公用/专用',
permissionTotal: '权限总数', permissionTotal: '权限总数',
permissionRemains: '生于权限', permissionRemains: '剩余权限',
isForever: '是否永久', isForever: '是否永久',
startTime: '开始时间', startTime: '开始时间',
endTime: '结束时间', endTime: '结束时间',

View File

@ -28,6 +28,7 @@ export default {
replayManage: '回放管理', replayManage: '回放管理',
permissionManage: '权限管理', permissionManage: '权限管理',
selfPermission: '我的权限',
pulishManage: '发布内容管理', pulishManage: '发布内容管理',
publishMapManage: '发布地图管理', publishMapManage: '发布地图管理',

View File

@ -304,9 +304,9 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Station] = { this[deviceType.Station] = {
text: { // text: {
show: true // 公里标名称显示 // show: true // 公里标名称显示
}, // },
kmPostShow: true, // 公里标显示 kmPostShow: true, // 公里标显示
kilometerPosition: 'down', // 公里标位置 kilometerPosition: 'down', // 公里标位置
fontWeight: 'bold' // 文字错细 fontWeight: 'bold' // 文字错细

View File

@ -300,9 +300,9 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Station] = { this[deviceType.Station] = {
text: { // text: {
show: true // 公里标名称显示 // show: true // 公里标名称显示
}, // },
kmPostShow: false, // 公里标显示 kmPostShow: false, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up' // 公里标朝向
}; };

View File

@ -297,9 +297,9 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Station] = { this[deviceType.Station] = {
text: { // text: {
show: true // 公里标名称显示 // show: true // 公里标名称显示
}, // },
kmPostShow: false, // 公里标显示 kmPostShow: false, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up' // 公里标朝向
}; };

View File

@ -279,9 +279,9 @@ class SkinCode extends defaultStyle {
}; };
this[deviceType.Station] = { this[deviceType.Station] = {
text: { // text: {
show: true // 公里标名称显示 // show: true // 公里标名称显示
}, // },
kmPostShow: true, // 公里标显示 kmPostShow: true, // 公里标显示
kilometerPosition: 'up' // 公里标朝向 kilometerPosition: 'up' // 公里标朝向
}; };

View File

@ -21,7 +21,7 @@ export default class Station extends Group {
const model = this.model; const model = this.model;
const style = this.style; const style = this.style;
if (style.Station.text.show) { if (model.visible) {
// 公里标名称是否显示 // 公里标名称是否显示
this.stationText = new ETextName({ this.stationText = new ETextName({
zlevel: this.zlevel, zlevel: this.zlevel,

View File

@ -742,7 +742,7 @@ export const asyncRouter = [
path: 'manage', path: 'manage',
component: Package, component: Package,
meta: { meta: {
i18n: 'router.permissionManage' i18n: 'router.selfPermission'
} }
}, },
{ {

View File

@ -4,8 +4,8 @@ export function getBaseUrl() {
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.4:9000' // 琰培 // BASE_API = 'http://192.168.3.4:9000' // 琰培
} else { } else {
BASE_API = process.env.VUE_APP_BASE_API; BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -0,0 +1,173 @@
<template>
<div>
<el-table
:size="size"
:stripe="stripe"
:border="border"
:data="tableData"
:max-height="maxHeight"
:height="height"
>
<el-table-column v-if="tableForm.index" fixed type="index" />
<template v-for="(column, index) in tableForm.columns">
<el-table-column
v-if="checkFieldType(column.type, 'text')"
:key="index"
:prop="column.prop"
:label="column.title"
:width="column.width || labelWidth"
:sortable="column.sortable"
>
<template slot-scope="scopeT" @focus="handleFocus" @blur="handleBlur">
<template v-if="column.editable && (scopeT.row.editing || column.editing)">
<el-input v-model="scopeT.row[column.prop]" :size="size" />
</template>
<template v-else>
{{ formatText(column, scopeT.row) }}
</template>
</template>
</el-table-column>
<el-table-column
v-if="checkFieldType(column.type, 'select')"
:key="index"
:prop="column.prop"
:label="column.title"
:width="column.width || labelWidth"
:sortable="column.sortable"
>
<template slot-scope="scopeS">
<template v-if="column.editable && (scopeS.row.editing || column.editing)">
<el-select v-model="scopeS.row[column.prop]" :size="size">
<el-option
v-for="item in obtainOptions(column)"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
<template v-else>
{{ formatText(column, scopeS.row) }}
</template>
</template>
</el-table-column>
<el-table-column
v-if="checkFieldType(column.type, 'tag')"
:key="index"
:prop="column.prop"
:label="column.title"
:width="column.width || labelWidth"
:sortable="column.sortable"
>
<template slot-scope="scopeG">
<template v-for="tag in column.columnValue(scopeG.row)">
<el-tag
:key="tag"
:type="column.tagType(scopeG.row, scopeG.$index)"
style="margin-right: 10px; margin-bottom: 5px;"
>{{ tag }}</el-tag>
</template>
</template>
</el-table-column>
<el-table-column
v-if="checkFieldType(column.type, 'button')"
:key="index"
fixed="right"
:prop="column.prop"
:label="column.title"
:width="column.width || labelWidth"
:sortable="column.sortable"
>
<template slot-scope="scopeB">
<el-button :size="size" type="warning" @click.native.prevent="handleFocus(scopeB)">编辑</el-button>
<template v-for="(action,idx) in column.buttons">
<el-button :key="idx" :size="size" :type="action.type" @click.native.prevent="handleClick(action, scopeB)">{{ action.name }}</el-button>
</template>
</template>
</el-table-column>
</template>
</el-table>
</div>
</template>
<script>
export default {
props: {
maxHeight: {
type: Number,
default() {
return 400;
}
},
height: {
type: Number,
default() {
return 400;
}
},
size: {
type: String,
default() {
return 'mini';
}
},
border: {
type: Boolean
},
stripe: {
type: Boolean
},
tableData: {
type: Array,
default() {
return [];
}
},
tableForm: {
type: Object,
required: true
}
},
data() {
return {
scope: null,
labelWidth: '120'
};
},
methods: {
obtainOptions(column) {
return column.options();
},
checkFieldType(field, type) {
return field == type;
},
formatText(column, row) {
return column.format ? column.format(row) : row[column.prop];
},
handleClick(action, scope) {
this.handleBlur(this.scope);
action.handleClick(scope.$index, scope.row);
},
handleFocus(scope) {
this.handleBlur(this.scope);
this.$set(this.tableData[scope.$index], 'editing', true);
this.scope = scope;
},
handleBlur(scope) {
if (scope) {
this.$set(this.tableData[scope.$index], 'editing', false);
}
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-table {
td,th {
padding: 0px;
}
td:nth-child(1), th:nth-child(1) {
background: #fefefe;
}
}
</style>

View File

@ -10,7 +10,7 @@
<script> <script>
import { getTotalRemains } from '@/api/management/author'; import { getTotalRemains } from '@/api/management/author';
import { PermissionType, OperatorModel } from '@/scripts/ConstDic'; import { PermissionType } from '@/scripts/ConstDic';
import { giveLessons } from '@/api/management/distribute'; import { giveLessons } from '@/api/management/distribute';
export default { export default {
@ -47,6 +47,7 @@ export default {
return form; return form;
}, },
rules() { rules() {
const that = this;
const crules = { const crules = {
total: [ total: [
{ required: true, message: this.$t('global.pleaseInputPermissionNumber'), trigger: 'change' }, { required: true, message: this.$t('global.pleaseInputPermissionNumber'), trigger: 'change' },
@ -55,7 +56,7 @@ export default {
if (Number.isInteger(Number(value)) && Number(value) > 0) { if (Number.isInteger(Number(value)) && Number(value) > 0) {
callback(); callback();
} else { } else {
callback(new Error(this.$t('global.permissionGreaterThen0'))); callback(new Error(that.$t('global.permissionGreaterThen0')));
} }
}, },
trigger: 'blur' trigger: 'blur'
@ -102,21 +103,19 @@ export default {
this.maxTotal = 0; this.maxTotal = 0;
if (endTime && startTime) { if (endTime && startTime) {
const model = { const model = {
// lessonId: this.formModel.lessonId,
startTime: startTime, startTime: startTime,
endTime: endTime, endTime: endTime,
type: this.PermissionType permissionType: this.PermissionType
// mapId: this.mapId,
// mapProductCode: this.prdCode,
}; };
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) { if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId; model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.mapId; model['mapId'] = this.mapId;
model['mapProductCode'] = this.prdCode; model['prdCode'] = this.prdCode;
} else if (this.PermissionType == PermissionType.SIMULATION) { } else if (this.PermissionType == PermissionType.SIMULATION) {
model['mapId'] = this.mapId; model['mapId'] = this.mapId;
model['mapProductCode'] = this.prdCode; model['prdCode'] = this.prdCode;
} }
//
getTotalRemains(model).then(response => { getTotalRemains(model).then(response => {
this.maxTotal = response.data; this.maxTotal = response.data;
if (this.maxTotal == 0) { if (this.maxTotal == 0) {
@ -146,23 +145,20 @@ export default {
handleSure() { handleSure() {
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {
const model = { const model = {
// lessonId: this.formModel.lessonId,
startTime: this.formModel.date[0], startTime: this.formModel.date[0],
endTime: this.formModel.date[1], endTime: this.formModel.date[1],
permissionType: this.PermissionType, permissionType: this.PermissionType,
operator: OperatorModel.DISTRIBUTE,
amount: this.formModel.total amount: this.formModel.total
// mapId: this.mapId,
// mapProductCode: this.prdCode,
}; };
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) { if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId; model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.mapId; model['mapId'] = this.mapId;
model['mapProductCode'] = this.prdCode; model['prdCode'] = this.prdCode;
} else if (this.PermissionType == PermissionType.SIMULATION) { } else if (this.PermissionType == PermissionType.SIMULATION) {
model['mapId'] = this.mapId; model['mapId'] = this.mapId;
model['mapProductCode'] = this.prdCode; model['prdCode'] = this.prdCode;
} }
//
giveLessons(model).then(response => { giveLessons(model).then(response => {
const url = response.data; const url = response.data;
this.$emit('QrCodeShow', { this.$emit('QrCodeShow', {

View File

@ -12,8 +12,7 @@
<el-table-column prop="endTime" :label="`${$t('global.endTime')}`" /> <el-table-column prop="endTime" :label="`${$t('global.endTime')}`" />
<el-table-column prop="forever" :label="`${$t('global.isForever')}`"> <el-table-column prop="forever" :label="`${$t('global.isForever')}`">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.forever? 'success': 'primary'" disable-transitions>{{ $ConstSelect.translate(scope.row.forever, <el-tag :type="scope.row.forever? 'success': 'primary'" disable-transitions>{{ $ConstSelect.translate(scope.row.forever, 'Whether') }}</el-tag>
'Whether') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="amount" :label="$t('global.total')" /> <el-table-column prop="amount" :label="$t('global.total')" />
@ -102,12 +101,12 @@ export default {
}); });
return sums; return sums;
}, },
transfer(courseModel) { transfer(courseModel) { //
if (this.$refs) { if (this.$refs) {
this.$refs.transfer.doShow(courseModel); this.$refs.transfer.doShow(courseModel);
} }
}, },
distribute(courseModel) { distribute(courseModel) { //
if (this.$refs) { if (this.$refs) {
this.$refs.distribute.doShow(courseModel); this.$refs.distribute.doShow(courseModel);
} }

View File

@ -10,8 +10,8 @@
<script> <script>
import { getTotalRemains } from '@/api/management/author'; import { getTotalRemains } from '@/api/management/author';
import { giveLessons } from '@/api/management/distribute'; import { permissionTurnAdd } from '@/api/management/distribute';
import { PermissionType, OperatorModel } from '@/scripts/ConstDic'; import { PermissionType } from '@/scripts/ConstDic';
export default { export default {
name: 'GoLsesson', name: 'GoLsesson',
@ -54,6 +54,7 @@ export default {
return form; return form;
}, },
rules() { rules() {
const that = this;
const crules = { const crules = {
total: [ total: [
{ required: true, message: this.$t('global.pleaseInputPermissionNumber'), trigger: 'change' }, { required: true, message: this.$t('global.pleaseInputPermissionNumber'), trigger: 'change' },
@ -62,7 +63,7 @@ export default {
if (Number.isInteger(Number(value)) && Number(value) > 0) { if (Number.isInteger(Number(value)) && Number(value) > 0) {
callback(); callback();
} else { } else {
callback(new Error(this.$t('global.permissionGreaterThen0'))); callback(new Error(that.$t('global.permissionGreaterThen0')));
} }
}, },
trigger: 'blur' trigger: 'blur'
@ -109,20 +110,17 @@ export default {
this.maxTotal = 0; this.maxTotal = 0;
if (endTime && startTime) { if (endTime && startTime) {
const model = { const model = {
// lessonId: this.formModel.lessonId,
startTime: `${startTime} 00:00:00`, startTime: `${startTime} 00:00:00`,
endTime: `${endTime} 23:59:59`, endTime: `${endTime} 23:59:59`,
type: this.PermissionType permissionType: this.PermissionType
// mapId: this.mapId,
// mapProductCode: this.prdCode,
}; };
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) { if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId; model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.mapId; model['mapId'] = this.mapId;
model['mapProductCode'] = this.prdCode; model['prdCode'] = this.prdCode;
} else if (this.PermissionType == PermissionType.SIMULATION) { } else if (this.PermissionType == PermissionType.SIMULATION) {
model['mapId'] = this.mapId; model['mapId'] = this.mapId;
model['mapProductCode'] = this.prdCode; model['prdCode'] = this.prdCode;
} }
getTotalRemains(model).then(response => { getTotalRemains(model).then(response => {
this.maxTotal = response.data; this.maxTotal = response.data;
@ -153,24 +151,21 @@ export default {
handleSure() { handleSure() {
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {
const model = { const model = {
// lessonId: this.formModel.lessonId,
startTime: `${this.formModel.date[0]} 00:00:00`, startTime: `${this.formModel.date[0]} 00:00:00`,
endTime: `${this.formModel.date[1]} 23:59:59`, endTime: `${this.formModel.date[1]} 23:59:59`,
amount: this.formModel.total, amount: this.formModel.total,
permissionType: this.PermissionType, permissionType: this.PermissionType
operator: OperatorModel.TRANSFER
// mapId: this.mapId,
// mapProductCode: this.prdCode,
}; };
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) { if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId; model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.mapId; model['mapId'] = this.mapId;
model['mapProductCode'] = this.prdCode; model['prdCode'] = this.prdCode;
} else if (this.PermissionType == PermissionType.SIMULATION) { } else if (this.PermissionType == PermissionType.SIMULATION) {
model['mapId'] = this.mapId; model['mapId'] = this.mapId;
model['mapProductCode'] = this.prdCode; model['prdCode'] = this.prdCode;
} }
giveLessons(model).then(response => { //
permissionTurnAdd(model).then(response => {
const url = response.data; const url = response.data;
this.$emit('QrCodeShow', { this.$emit('QrCodeShow', {
url: url, url: url,

View File

@ -95,11 +95,13 @@ export default {
// //
initLoadPage() { initLoadPage() {
const data = { const data = {
mapId: this.$route.query.mapId, permissionType: this.$route.query.permissionType
lessonId: this.$route.params.lessonId,
productType: this.$route.query.permissionType,
mapProductCode: this.$route.query.prdCode
}; };
if (this.$route.query.permissionType != '04') {
data['mapId'] = this.$route.query.mapId;
data['prdCode'] = this.$route.query.prdCode;
data['lessonId'] = this.$route.query.lessonId;
}
getCommodityDetailByParams(data).then(response => { getCommodityDetailByParams(data).then(response => {
this.active = 0; this.active = 0;

View File

@ -159,10 +159,10 @@ export default {
}; };
(this.permissionList.filter(elem => { return elem.mapName == mapName; })|| []).forEach(elem => { (this.permissionList.filter(elem => { return elem.mapName == mapName; })|| []).forEach(elem => {
if (elem.mapProductName == Object.keys(permissionMap)[Object.keys(permissionMap).length -1]) { if (elem.prdName == Object.keys(permissionMap)[Object.keys(permissionMap).length -1]) {
permissionMap[`${elem.mapProductName}`] = elem.remains; permissionMap[`${elem.prdName}`] = elem.remains;
} else { } else {
permissionMap[`${elem.mapProductName}-${permissionDict[elem.type]}`] = elem.remains; permissionMap[`${elem.prdName}-${permissionDict[elem.permissionType]}`] = elem.remains;
} }
}); });

View File

@ -94,7 +94,7 @@ export default {
}, },
hasPermssion() { hasPermssion() {
let isShow = false; let isShow = false;
if (this.courseModel.pmsList.length) { if (this.courseModel.pmsList && this.courseModel.pmsList.length) {
isShow = true; isShow = true;
} }
return isShow; return isShow;
@ -190,15 +190,14 @@ export default {
pmsList: resp.data.pmsList || [], pmsList: resp.data.pmsList || [],
PermissionType: PermissionType.SIMULATION PermissionType: PermissionType.SIMULATION
}; };
const rest = await queryPermissionSimulation({ mapId: this.courseModel.mapId, prdCode: this.courseModel.prdCode }); const rest = await queryPermissionSimulation({ mapId: this.courseModel.mapId, prdCode: this.courseModel.prdCode });
this.courseModel.pmsList = rest.data; this.courseModel.pmsList = rest.data;
if (!this.courseModel.pmsList.length) { if (!this.courseModel.pmsList) {
this.tryUser = 1; this.tryUser = 1;
const paras = { const paras = {
mapId: data.id, mapId: data.id,
mapProductCode: data.code, prdCode: data.code,
productType: PermissionType.SIMULATION permissionType: PermissionType.SIMULATION
}; };
try { try {
@ -258,7 +257,7 @@ export default {
} else if (this.courseModel.prdType == '03') { } else if (this.courseModel.prdType == '03') {
this.createRoom(); this.createRoom();
} else { } else {
if (this.courseModel.pmsList.length) { if (this.courseModel.pmsList && this.courseModel.pmsList.length) {
this.jump(); this.jump();
} else { } else {
if (this.tryTime <= 1) { if (this.tryTime <= 1) {

View File

@ -17,6 +17,7 @@
<el-form-item label="派班选择:"> <el-form-item label="派班选择:">
<el-date-picker <el-date-picker
v-model="formModel.planDate" v-model="formModel.planDate"
clearable
size="small" size="small"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@ -63,7 +64,7 @@
</template> </template>
<script> <script>
import { querySecheduling, generateScheduling, getSchedulingAllTrains, checkScheduling, saveScheduling } from '@/api/scheduling'; import { querySecheduling, generateScheduling, getSchedulingAllTrains, checkScheduling, saveScheduling, generateSchedulingAgain } from '@/api/scheduling';
import EditTable from '@/views/components/editTable/index'; import EditTable from '@/views/components/editTable/index';
export default { export default {
@ -83,6 +84,7 @@ export default {
runPlanList: [], runPlanList: [],
groupNumberList: [], groupNumberList: [],
formModel: { formModel: {
id: '',
mode: '', mode: '',
planDate: '', planDate: '',
runPlanName: '' runPlanName: ''
@ -97,65 +99,13 @@ export default {
}, },
{ {
title: '车组号', title: '车组号',
prop: 'groupNumber', prop: 'trainCode',
type: 'select', type: 'select',
width: '150', width: '150',
options: () => { return this.groupNumberList; }, options: () => { return this.groupNumberList; },
editable: true, editable: true,
editing: true editing: true
}, },
{
title: '回库段',
prop: 'inDepot',
type: 'text'
},
{
title: '回库状态',
prop: 'inStatus',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.inStatus, 'Whether'); },
tagType: (row) => {
switch (row.inStatus) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: '下线方向码',
prop: 'offlineDirectionCode',
type: 'text'
},
{
title: '下线轨',
prop: 'offlineSection',
type: 'text'
},
{
title: '下线服务号',
prop: 'offlineServerNumber',
type: 'text'
},
{
title: '下线目的地',
prop: 'offlineTargetNumber',
type: 'text'
},
{
title: '下线时间',
prop: 'offlineTime',
type: 'text'
},
{
title: '下线车次号',
prop: 'offlineTripNumber',
type: 'text'
},
{
title: '上线方向码',
prop: 'onlineDirectionCode',
type: 'text'
},
{ {
title: '上线轨', title: '上线轨',
prop: 'onlineSection', prop: 'onlineSection',
@ -179,7 +129,8 @@ export default {
{ {
title: '上线车次号', title: '上线车次号',
prop: 'onlineTripNumber', prop: 'onlineTripNumber',
type: 'text' type: 'text',
format: (row) => { return `${row.onlineDirectionCode}${row.onlineTripNumber}`; }
}, },
{ {
title: '出库段', title: '出库段',
@ -199,9 +150,47 @@ export default {
} }
}, },
{ {
title: '列车编码', title: '下线轨',
prop: 'trainCode', prop: 'offlineSection',
type: 'text' type: 'text'
},
{
title: '下线服务号',
prop: 'offlineServerNumber',
type: 'text'
},
{
title: '下线目的地',
prop: 'offlineTargetNumber',
type: 'text'
},
{
title: '下线时间',
prop: 'offlineTime',
type: 'text'
},
{
title: '下线车次号',
prop: 'offlineTripNumber',
type: 'text',
format: (row) => { return `${row.offlineDirectionCode}${row.offlineTripNumber}`; }
},
{
title: '回库段',
prop: 'inDepot',
type: 'text'
},
{
title: '回库状态',
prop: 'inStatus',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.inStatus, 'Whether'); },
tagType: (row) => {
switch (row.inStatus) {
case true: return 'success';
case false: return 'danger';
}
}
} }
] ]
}, },
@ -240,18 +229,30 @@ export default {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.handleGenerate(day); this.handleGenerate(day);
}).catch(() => { this.clearData(); }); }).catch(() => {
this.clearData();
});
} else { } else {
this.tableData = resp.data.planList || []; this.tableData = resp.data.planList || [];
this.formModel.id = resp.data.id;
this.formModel.planDate = resp.data.planDate; this.formModel.planDate = resp.data.planDate;
this.formModel.runPlanName = resp.data.runPlanName; this.formModel.runPlanName = resp.data.runPlanName;
this.$message.success(`加载数据 ${day} 派班计划成功!`);
} }
}).catch(() => { this.clearData(); }); }).catch(error => {
this.clearData();
if (error.code == 30002) {
this.handleReGenerate(day);
} else {
this.$messageBox(`${error.message}`);
}
});
} }
}, },
handleGenerate(day) { handleGenerate(day) {
generateScheduling(this.group, {day}).then(resp => { generateScheduling(this.group, {day}).then(resp => {
this.tableData = resp.data.planList || []; this.tableData = resp.data.planList || [];
this.formModel.id = resp.data.id;
this.formModel.planDate = resp.data.planDate; this.formModel.planDate = resp.data.planDate;
this.formModel.runPlanName = resp.data.runPlanName; this.formModel.runPlanName = resp.data.runPlanName;
this.$message.success('创建派班计划成功'); this.$message.success('创建派班计划成功');
@ -260,6 +261,18 @@ export default {
this.$messageBox(`${error.message}`); this.$messageBox(`${error.message}`);
}); });
}, },
handleReGenerate(day) {
generateSchedulingAgain(this.group).then(resp => {
this.tableData = resp.data.planList || [];
this.formModel.id = resp.data.id;
this.formModel.planDate = resp.data.planDate;
this.formModel.runPlanName = resp.data.runPlanName;
this.$message.success('重新生成派班计划成功');
}).catch(error => {
this.clearData();
this.$messageBox(`${error.message}`);
});
},
handleCheck() { handleCheck() {
if (this.formModel.planDate) { if (this.formModel.planDate) {
checkScheduling(this.group).then(resp => { checkScheduling(this.group).then(resp => {

View File

@ -109,7 +109,7 @@ export default {
price: res.data.price, price: res.data.price,
remarks: res.data.remarks, remarks: res.data.remarks,
detail: res.data.examDefinitionVOList || [], detail: res.data.examDefinitionVOList || [],
pmsList: res.data.permissionVOList, pmsList: res.data.permissionVOList || [],
prdCode: res.data.prdCode, prdCode: res.data.prdCode,
mapId: res.data.mapId, mapId: res.data.mapId,
PermissionType: PermissionType.EXAM PermissionType: PermissionType.EXAM
@ -131,14 +131,14 @@ export default {
query: { lessonId: this.courseModel.id } query: { lessonId: this.courseModel.id }
}); });
}, },
transfer() { transfer() { //
this.loading = false; this.loading = false;
if (this.$refs) { if (this.$refs) {
this.activeName = 'second'; this.activeName = 'second';
this.$refs.limitList.transfer(this.courseModel); this.$refs.limitList.transfer(this.courseModel);
} }
}, },
distribute() { distribute() { //
this.loading = false; this.loading = false;
if (this.$refs) { if (this.$refs) {
this.activeName = 'second'; this.activeName = 'second';

View File

@ -316,6 +316,11 @@ export default {
} }
} }
.mapPaint{
height: 100%;
overflow: hidden;
}
.map-view { .map-view {
float: left; float: left;
width: auto; width: auto;

View File

@ -585,6 +585,10 @@ 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";
.view-control{
height: calc(100% - 100px);
}
.button_box{ .button_box{
width: 100%; width: 100%;
background: #f0f0f0; background: #f0f0f0;

View File

@ -182,7 +182,6 @@ export default {
destinationCode: '', // destinationCode: '', //
destinationCodePoint: { x: 0, y: 0 }, // destinationCodePoint: { x: 0, y: 0 }, //
destinationCodeShow: false, // destinationCodeShow: false, //
// nameShow: false,
axleShow: false, axleShow: false,
namePoint: { x: 0, y: 0 }, namePoint: { x: 0, y: 0 },
kmRangeRight: 0, kmRangeRight: 0,
@ -190,7 +189,6 @@ export default {
region: '', region: '',
logicSectionNum: [], logicSectionNum: [],
logicSectionShow: false, logicSectionShow: false,
// logicSectionNameShow: false,
isStandTrack: false, isStandTrack: false,
standTrackName: '', standTrackName: '',
standTrackNamePosition: { x: 0, y: 0 }, standTrackNamePosition: { x: 0, y: 0 },
@ -212,7 +210,6 @@ export default {
sepTypeRight: '', sepTypeRight: '',
offsetRight: 0, offsetRight: 0,
trainPosType: '01', trainPosType: '01',
// pointY: '',
parentCode: '', parentCode: '',
points: [], points: [],
isCurve: false isCurve: false
@ -326,7 +323,6 @@ export default {
{ prop: 'relSwitchCode', label: this.$t('map.relSwitchCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange, isHidden: !this.isRelSwitchCode, disabled: true }, { prop: 'relSwitchCode', label: this.$t('map.relSwitchCode'), type: 'select', optionLabel: 'code&&name', optionValue: 'code', options: this.switchList, change: true, deviceChange: this.deviceChange, isHidden: !this.isRelSwitchCode, disabled: true },
{ prop: 'logicSectionShow', label: this.$t('map.displayLogicalExtents'), type: 'checkbox', isHidden: !this.isSwitchSectionShow }, // 1 { prop: 'logicSectionShow', label: this.$t('map.displayLogicalExtents'), type: 'checkbox', isHidden: !this.isSwitchSectionShow }, // 1
// { prop: 'logicSectionNameShow', label: this.$t('map.displayLogicalWxtentNames'), type: 'checkbox', disabled: this.islogicSectionNameShow, isHidden: !this.isSwitchSectionShow }, // 1
{ prop: 'logicSectionNameSort', label: this.$t('map.logicSectionNameSort'), type: 'radio', isHidden: !this.isLogicSectionNameSort, radioList: [ { prop: 'logicSectionNameSort', label: this.$t('map.logicSectionNameSort'), type: 'radio', isHidden: !this.isLogicSectionNameSort, radioList: [
{value: true, label: this.$t('map.fromSmallToLarge')}, {value: true, label: this.$t('map.fromSmallToLarge')},
{value: false, label: this.$t('map.fromLargeToSmall')} {value: false, label: this.$t('map.fromLargeToSmall')}
@ -457,9 +453,6 @@ export default {
isStationAxleShow() { isStationAxleShow() {
return this.editModel.section == '02'; return this.editModel.section == '02';
}, },
// islogicSectionNameShow() {
// return !this.editModel.logicSectionShow;
// },
isstandTrackNameShow() { isstandTrackNameShow() {
return this.editModel.type !== '03' && this.editModel.isStandTrack; return this.editModel.type !== '03' && this.editModel.isStandTrack;
}, },
@ -561,7 +554,6 @@ export default {
x: selected.namePosition.x, x: selected.namePosition.x,
y: selected.namePosition.y y: selected.namePosition.y
}; };
// this.editModel.nameShow = selected.nameShow;
this.editModel.axleShow = selected.axleShow; this.editModel.axleShow = selected.axleShow;
this.editModel.relStandCode = selected.relStandCode; this.editModel.relStandCode = selected.relStandCode;
this.editModel.leftStopPointOffset = selected.leftStopPointOffset; this.editModel.leftStopPointOffset = selected.leftStopPointOffset;
@ -581,7 +573,6 @@ export default {
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0]; this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
this.editModel.logicSectionShow = selected.logicSectionShow; this.editModel.logicSectionShow = selected.logicSectionShow;
// this.editModel.logicSectionNameShow = selected.logicSectionNameShow;
this.editModel.isStandTrack = selected.isStandTrack; this.editModel.isStandTrack = selected.isStandTrack;
this.editModel.standTrackName = selected.standTrackName; this.editModel.standTrackName = selected.standTrackName;
this.editModel.standTrackNamePosition = { this.editModel.standTrackNamePosition = {
@ -666,7 +657,6 @@ export default {
axleShow: false, axleShow: false,
type: '02', type: '02',
namePosition: { x: 0, y: 0 }, namePosition: { x: 0, y: 0 },
// nameShow: model.logicSectionNameShow,
isStandTrack: false, isStandTrack: false,
standTrackName: model.standTrackName, standTrackName: model.standTrackName,
standTrackNamePosition: { standTrackNamePosition: {
@ -695,7 +685,6 @@ export default {
relSwitchCode: model.relSwitchCode, relSwitchCode: model.relSwitchCode,
logicSectionNum: [], logicSectionNum: [],
logicSectionShow: model.logicSectionShow, logicSectionShow: model.logicSectionShow,
// logicSectionNameShow: model.logicSectionNameShow,
stationCode: model.stationCode, stationCode: model.stationCode,
linkCode: model.linkCode, linkCode: model.linkCode,
offsetLeft: middleOffset * (index) + model.offsetLeft, offsetLeft: middleOffset * (index) + model.offsetLeft,
@ -776,7 +765,6 @@ export default {
code: uid, code: uid,
name: uname, name: uname,
type: '01', type: '01',
// nameShow: true,
axleShow: false, axleShow: false,
isStandTrack: false, isStandTrack: false,
standTrackName: '', standTrackName: '',
@ -797,7 +785,6 @@ export default {
namePosition: { x: 0, y: 0 }, namePosition: { x: 0, y: 0 },
logicSectionNum: [0], logicSectionNum: [0],
logicSectionShow: true, logicSectionShow: true,
// logicSectionNameShow: true,
logicSectionNameSort: true, logicSectionNameSort: true,
linkCode: link.code, linkCode: link.code,
sepTypeLeft: '01', sepTypeLeft: '01',
@ -880,8 +867,6 @@ export default {
relStandCode: this.editModel.relStandCode, relStandCode: this.editModel.relStandCode,
leftStopPointOffset: Number(this.editModel.leftStopPointOffset), leftStopPointOffset: Number(this.editModel.leftStopPointOffset),
rightStopPointOffset: Number(this.editModel.rightStopPointOffset), rightStopPointOffset: Number(this.editModel.rightStopPointOffset),
// nameShow: this.editModel.nameShow,
axleShow: this.editModel.axleShow, axleShow: this.editModel.axleShow,
namePosition: { namePosition: {
x: this.editModel.namePoint.x, x: this.editModel.namePoint.x,
@ -919,7 +904,6 @@ export default {
points: JSON.parse(pointArr), points: JSON.parse(pointArr),
logicSectionNum: this.editModel.logicSectionNum, logicSectionNum: this.editModel.logicSectionNum,
logicSectionShow: this.editModel.logicSectionShow, logicSectionShow: this.editModel.logicSectionShow,
// logicSectionNameShow: this.editModel.logicSectionNameShow,
sepTypeLeft: this.editModel.sepTypeLeft, sepTypeLeft: this.editModel.sepTypeLeft,
offsetLeft: this.editModel.offsetLeft, offsetLeft: this.editModel.offsetLeft,
sepTypeRight: this.editModel.sepTypeRight, sepTypeRight: this.editModel.sepTypeRight,
@ -947,15 +931,10 @@ export default {
const model = this.buildEditModel(); const model = this.buildEditModel();
this.sectionList.forEach(section => { this.sectionList.forEach(section => {
if (section.parentCode == model.code) { if (section.parentCode == model.code) {
// section.nameShow = section.logicSectionNameShow = model.logicSectionNameShow;
section.logicSectionShow = model.logicSectionShow; section.logicSectionShow = model.logicSectionShow;
section.trainPosType = model.trainPosType; section.trainPosType = model.trainPosType;
edits.push(section); edits.push(section);
} }
// if (section.points[0].y == this.editModel.pointY && section.points[section.points.length - 1].y == this.editModel.pointY) {
// section.trainPosType = this.editModel.trainPosType;
// edits.push(section);
// }
}); });
edits.push(model); edits.push(model);
this.fieldS = ''; this.fieldS = '';
@ -1005,7 +984,6 @@ export default {
name: uidL, name: uidL,
type: '01', type: '01',
parentCode: '', parentCode: '',
// nameShow: selected.nameShow,
axleShow: selected.axleShow, axleShow: selected.axleShow,
isStandTrack: false, isStandTrack: false,
kmRangeRight: '', kmRangeRight: '',
@ -1026,7 +1004,6 @@ export default {
logicSectionNameSort: selected.logicSectionNameSort, logicSectionNameSort: selected.logicSectionNameSort,
logicSectionNum: selected.logicSectionNum, logicSectionNum: selected.logicSectionNum,
logicSectionShow: selected.logicSectionShow, logicSectionShow: selected.logicSectionShow,
// logicSectionNameShow: selected.logicSectionNameShow,
sepTypeLeft: selected.sepTypeLeft, sepTypeLeft: selected.sepTypeLeft,
offsetLeft: selected.offsetLeft, offsetLeft: selected.offsetLeft,
sepTypeRight: '01', sepTypeRight: '01',
@ -1052,7 +1029,6 @@ export default {
name: uidR, name: uidR,
type: '01', type: '01',
parentCode: '', parentCode: '',
// nameShow: selected.nameShow,
axleShow: selected.axleShow, axleShow: selected.axleShow,
isStandTrack: false, isStandTrack: false,
kmRangeRight: '', kmRangeRight: '',
@ -1073,7 +1049,6 @@ export default {
logicSectionNameSort: selected.logicSectionNameSort, logicSectionNameSort: selected.logicSectionNameSort,
logicSectionNum: selected.logicSectionNum, logicSectionNum: selected.logicSectionNum,
logicSectionShow: selected.logicSectionShow, logicSectionShow: selected.logicSectionShow,
// logicSectionNameShow: selected.logicSectionNameShow,
sepTypeLeft: '01', sepTypeLeft: '01',
offsetLeft: selected.offsetLeft, offsetLeft: selected.offsetLeft,
sepTypeRight: selected.sepTypeRight, sepTypeRight: selected.sepTypeRight,
@ -1165,7 +1140,6 @@ export default {
}); });
if (lsection.points[lsection.points.length - 1].x == rsection.points[0].x && lsection.points[lsection.points.length - 1].y == rsection.points[0].y) { if (lsection.points[lsection.points.length - 1].x == rsection.points[0].x && lsection.points[lsection.points.length - 1].y == rsection.points[0].y) {
// model.nameShow = lsection.nameShow;
model.axleShow = lsection.axleShow; model.axleShow = lsection.axleShow;
model.logicSectionNum = lsection.logicSectionNum; model.logicSectionNum = lsection.logicSectionNum;
model.logicSectionShow = lsection.logicSectionShow; model.logicSectionShow = lsection.logicSectionShow;
@ -1174,7 +1148,6 @@ export default {
model.offsetLeft = lsection.offsetLeft; model.offsetLeft = lsection.offsetLeft;
model.sepTypeRight = rsection.sepTypeRight; model.sepTypeRight = rsection.sepTypeRight;
model.offsetRight = lsection.offsetRight + rsection.offsetRight; model.offsetRight = lsection.offsetRight + rsection.offsetRight;
// model.logicSectionNameShow = lsection.logicSectionNameShow;
model.isCurve = lsection.isCurve; model.isCurve = lsection.isCurve;
model.points = [ model.points = [
{ x: lsection.points[0].x, y: lsection.points[0].y }, { x: lsection.points[0].x, y: lsection.points[0].y },
@ -1186,7 +1159,6 @@ export default {
this.$emit('addOrUpdateMapModel', model); this.$emit('addOrUpdateMapModel', model);
} }
if (lsection.points[0].x == rsection.points[rsection.points.length - 1].x && lsection.points[0].y == rsection.points[rsection.points.length - 1].y) { if (lsection.points[0].x == rsection.points[rsection.points.length - 1].x && lsection.points[0].y == rsection.points[rsection.points.length - 1].y) {
// model.nameShow = rsection.nameShow;
model.axleShow = rsection.axleShow; model.axleShow = rsection.axleShow;
model.logicSectionNum = rsection.logicSectionNum; model.logicSectionNum = rsection.logicSectionNum;
model.logicSectionShow = rsection.logicSectionShow; model.logicSectionShow = rsection.logicSectionShow;
@ -1195,7 +1167,6 @@ export default {
model.offsetLeft = rsection.offsetLeft; model.offsetLeft = rsection.offsetLeft;
model.sepTypeRight = lsection.sepTypeRight; model.sepTypeRight = lsection.sepTypeRight;
model.offsetRight = lsection.offsetRight + rsection.offsetRight; model.offsetRight = lsection.offsetRight + rsection.offsetRight;
// model.logicSectionNameShow = rsection.logicSectionNameShow;
model.isCurve = rsection.isCurve; model.isCurve = rsection.isCurve;
model.points = [ model.points = [
{ x: rsection.points[0].x, y: rsection.points[0].y }, { x: rsection.points[0].x, y: rsection.points[0].y },
@ -1269,7 +1240,6 @@ export default {
code: uid, code: uid,
name: sectiona.name || sectionb.name || sectionc.name, name: sectiona.name || sectionb.name || sectionc.name,
type: '03', type: '03',
// nameShow: true,
axleShow: false, axleShow: false,
namePosition: point, namePosition: point,
isStandTrack: false, isStandTrack: false,
@ -1291,7 +1261,6 @@ export default {
points: [{ x: 0, y: 0 }, { x: 0, y: 0 }], points: [{ x: 0, y: 0 }, { x: 0, y: 0 }],
logicSectionNum: [0], logicSectionNum: [0],
logicSectionShow: false, logicSectionShow: false,
// logicSectionNameShow: false,
sepTypeLeft: '00', sepTypeLeft: '00',
offsetLeft: 0, offsetLeft: 0,
sepTypeRight: '00', sepTypeRight: '00',

View File

@ -223,7 +223,6 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }, ] },
// { prop: 'nameShow', label: this.$t('map.signalDisplayName'), type: 'checkbox' },
{ prop: 'lampPostType', label: this.$t('map.lampPostType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPostTypeList }, { prop: 'lampPostType', label: this.$t('map.lampPostType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPostTypeList },
{ prop: 'lampPositionType', label: this.$t('map.lampPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList }, { prop: 'lampPositionType', label: this.$t('map.lampPositionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalLampPositionTypeList },
{ prop: 'directionType', label: this.$t('map.signalDirectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalDirectionTypeList }, { prop: 'directionType', label: this.$t('map.signalDirectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SignalDirectionTypeList },

View File

@ -118,6 +118,7 @@ export default {
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
] }, ] },
{ prop: 'visible', label: this.$t('map.stationstandShowName'), type: 'checkbox' },
{ prop: 'nameFont', label: this.$t('map.stationNameFont'), type: 'font', placeholder: this.$t('tip.stationFont') }, { prop: 'nameFont', label: this.$t('map.stationNameFont'), type: 'font', placeholder: this.$t('tip.stationFont') },
{ prop: 'nameFontColor', label: this.$t('map.stationNameFontColor'), type: 'color' }, { prop: 'nameFontColor', label: this.$t('map.stationNameFontColor'), type: 'color' },
{ prop: 'kmRange', label: this.$t('map.stationKmRange'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }, { prop: 'kmRange', label: this.$t('map.stationKmRange'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
@ -236,7 +237,6 @@ export default {
zcCode: '', zcCode: '',
runPlanName: '', runPlanName: '',
visible: true, visible: true,
nameShow: true,
nameFont: '14px consolas', nameFont: '14px consolas',
nameFontColor: '#FFFFFF', nameFontColor: '#FFFFFF',
kmPost: '1000km~2000km', kmPost: '1000km~2000km',

View File

@ -6,6 +6,7 @@
<script> <script>
import { getLessonPermissonPageList } from '@/api/management/author'; import { getLessonPermissonPageList } from '@/api/management/author';
import { listPublishMap } from '@/api/jmap/map';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
export default { export default {
@ -15,6 +16,7 @@ export default {
data() { data() {
return { return {
PermissionTypeList: [], PermissionTypeList: [],
mapList: [],
ruleList: [ ruleList: [
{ value: true, label: '是' }, { value: true, label: '是' },
{ value: false, label: '否' } { value: false, label: '否' }
@ -24,7 +26,7 @@ export default {
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
queryForm: { queryForm: {
labelWidth: '140px', labelWidth: '100px',
reset: true, reset: true,
queryObject: { queryObject: {
'name': { 'name': {
@ -47,6 +49,13 @@ export default {
{ value: false, label: '否' } { value: false, label: '否' }
] ]
} }
},
mapId: {
type: 'select',
label: this.$t('orderAuthor.map'),
config: {
data: []
}
} }
} }
}, },
@ -66,6 +75,13 @@ export default {
columnValue: (row) => { return this.$convertField(row.isPackage, this.ruleList, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.isPackage, this.ruleList, ['value', 'label']); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{
title: '所属地图',
prop: 'mapId',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{ {
title: this.$t('orderAuthor.permissionType'), title: this.$t('orderAuthor.permissionType'),
prop: 'type', prop: 'type',
@ -110,7 +126,7 @@ export default {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
loadInitData() { async loadInitData() {
this.$Dictionary.permissionType().then(list => { this.$Dictionary.permissionType().then(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 });
@ -119,6 +135,17 @@ export default {
return true; return true;
}); });
}); });
try {
//
this.mapList = [];
const res = await listPublishMap();
res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
this.mapList.push({ value: elem.id, label: elem.name });
});
} catch (error) {
console.error(error, '获取发布地图');
}
}, },
queryFunction(params) { queryFunction(params) {
return getLessonPermissonPageList(params); return getLessonPermissonPageList(params);

View File

@ -36,6 +36,7 @@ export default {
show: false, show: false,
productTypeList: [], productTypeList: [],
EffectiveTypeList: [], EffectiveTypeList: [],
mapList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -48,26 +49,19 @@ export default {
type: 'text', type: 'text',
label: this.$t('orderAuthor.name') label: this.$t('orderAuthor.name')
}, },
productType: { // productType: {
type: 'select', // type: 'select',
label: this.$t('orderAuthor.productType'), // label: this.$t('orderAuthor.productType'),
config: { // config: {
data: [] // data: []
} // }
}, // },
mapId: { mapId: {
type: 'select', type: 'select',
label: this.$t('orderAuthor.map'), label: this.$t('orderAuthor.map'),
config: { config: {
data: [] data: []
} }
},
status: {
type: 'select',
label: this.$t('orderAuthor.state'),
config: {
data: this.$ConstSelect.Status
}
} }
} }
}, },
@ -81,28 +75,20 @@ export default {
prop: 'name' prop: 'name'
}, },
{ {
title: this.$t('orderAuthor.productType'), title: '权限名称',
prop: 'productType', prop: 'permissionName'
type: 'tag',
columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName'
},
{
title: this.$t('orderAuthor.productName'),
prop: 'prdName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName'
}, },
{ {
title: this.$t('orderAuthor.price'), title: this.$t('orderAuthor.price'),
prop: 'price' prop: 'price'
}, },
{
title: '所属地图',
prop: 'mapId',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.mapId, this.mapList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{ {
title: this.$t('orderAuthor.state'), title: this.$t('orderAuthor.state'),
prop: 'status', prop: 'status',
@ -160,20 +146,13 @@ export default {
return true; return true;
}); });
}); });
//
this.$Dictionary.productType().then(list => {
list.forEach(elem => {
this.queryForm.queryObject.productType.config.data.push({ value: elem.code, label: elem.name });
});
this.$convertList(list, this.productTypeList, elem => {
return true;
});
});
try { try {
// //
this.mapList = [];
const res = await listPublishMap(); const res = await listPublishMap();
res.data.forEach(elem => { res.data.forEach(elem => {
this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name }); this.queryForm.queryObject.mapId.config.data.push({ value: elem.id, label: elem.name });
this.mapList.push({ value: elem.id, label: elem.name });
}); });
} catch (error) { } catch (error) {
console.error(error, '获取发布地图'); console.error(error, '获取发布地图');

View File

@ -52,7 +52,11 @@ export default {
handleSure() { handleSure() {
this.doClose(); this.doClose();
Object.assign(this.data, this.formModel); Object.assign(this.data, this.formModel);
this.$emit('distribute', this.data); const model = {
code: this.data.code,
canDistribute: this.data.canDistribute ? this.data.canDistribute : false
};
this.$emit('distribute', model);
}, },
handleClose() { handleClose() {
this.doClose(); this.doClose();

View File

@ -0,0 +1,115 @@
<template>
<el-dialog title="订单详情" :visible.sync="show" width="500px" :before-do-close="doClose" :close-on-click-modal="false">
<div>
<el-scrollbar wrap-class="scrollbar-wrapper" style="height: 400px">
<data-form ref="dataform" :form="form" :form-model="formModel" class="data-box" />
</el-scrollbar>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="doClose"> </el-button>
</div>
</el-dialog>
</template>
<script>
export default {
name: 'RouteDetail',
components: {
},
props: {
},
data() {
return {
show: false,
formModel: {
organizationName: '',
userName: '',
goodsName: '',
amount: '',
forever: '',
startTime: '',
monthAmount: '',
totalPrice: '',
payWays: '',
createTime: '',
orderType: '',
contractNo: '',
bizType: '',
payStatusZh: '',
sellerName: ''
}
};
},
computed: {
form() {
const form = {
labelWidth: '120px',
items: [
{ prop: 'organizationName', label: `${this.$t('orderAuthor.organizationOrEnterprise')}:`, type: 'text', disabled: true },
{ prop: 'userName', label: `${this.$t('orderAuthor.userName')}:`, type: 'text', disabled: true },
{ prop: 'goodsName', label: `${this.$t('orderAuthor.commodityName')}:`, type: 'text', disabled: true },
{ prop: 'amount', label: `${this.$t('orderAuthor.permissionNumber')}:`, type: 'text', disabled: true },
{ prop: 'forever', label: `${this.$t('orderAuthor.permanenceOrNot')}:`, type: 'radio', disabled: true, required: false, options: this.$ConstSelect.Whether },
{ prop: 'startTime', label: `${this.$t('orderAuthor.startDate')}:`, type: 'text', disabled: true },
{ prop: 'monthAmount', label: `${this.$t('orderAuthor.purchaseMonths')}:`, type: 'text', disabled: true },
{ prop: 'totalPrice', label: `${this.$t('orderAuthor.totalPrice')}:`, type: 'text', disabled: true },
{ prop: 'payWays', label: `${this.$t('orderAuthor.paymentMethod')}:`, type: 'text', disabled: true },
{ prop: 'createTime', label: `${this.$t('orderAuthor.creationDate')}:`, type: 'text', disabled: true },
{ prop: 'orderType', label: `${this.$t('orderAuthor.orderType')}:`, type: 'text', disabled: true },
{ prop: 'contractNo', label: `${this.$t('orderAuthor.contractNumber')}:`, type: 'text', disabled: true },
{ prop: 'bizType', label: `${this.$t('orderAuthor.businessType')}:`, type: 'text', disabled: true },
{ prop: 'payStatusZh', label: `${this.$t('orderAuthor.paymentStatus')}:`, type: 'text', disabled: true },
{ prop: 'sellerName', label: `${this.$t('orderAuthor.salesman')}:`, type: 'text', disabled: true }
]
};
return form;
}
},
watch: {
},
mounted() {
},
methods: {
doShow(data) {
this.show = true;
this.formModel = {
organizationName: data.organizationName,
userName: data.userName,
goodsName: data.goodsName,
amount: data.amount,
forever: data.forever,
startTime: data.startTime,
monthAmount: data.monthAmount,
totalPrice: data.totalPrice,
payWays: data.payWays,
createTime: data.createTime,
orderType: data.orderType,
contractNo: data.contractNo,
bizType: data.bizType,
payStatusZh: data.payStatusZh,
sellerName: data.sellerName
};
},
doClose() {
this.show = false;
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
/deep/{
.data-box .el-form-item {
margin-bottom: 12px;
}
}
</style>

View File

@ -103,9 +103,6 @@ export default {
}; };
}, },
computed: { computed: {
// turnbackBarTitle() {
// return '';
// },
isAdd() { isAdd() {
return this.type === 'ADD'; return this.type === 'ADD';
}, },

View File

@ -3,6 +3,7 @@
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<can-distribute ref="canDistribute" @distribute="distribute" /> <can-distribute ref="canDistribute" @distribute="distribute" />
<qr-code ref="qrCode" /> <qr-code ref="qrCode" />
<detail ref="detail" />
</div> </div>
</template> </template>
@ -10,17 +11,19 @@
import { getOrderPageList } from '@/api/management/order'; import { getOrderPageList } from '@/api/management/order';
import { getSellerList } from '@/api/management/user'; import { getSellerList } from '@/api/management/user';
import { getOrganizationList } from '@/api/management/organization'; import { getOrganizationList } from '@/api/management/organization';
import { giveLessons } from '@/api/management/distribute'; import { postDistribute } from '@/api/management/distribute';
import { OperatorModel } from '@/scripts/ConstDic'; // import { OperatorModel } from '@/scripts/ConstDic';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import QrCode from '@/components/QrCode'; import QrCode from '@/components/QrCode';
import CanDistribute from './canDistribute'; import CanDistribute from './canDistribute';
import detail from './detail';
export default { export default {
name: 'List', name: 'List',
components: { components: {
QrCode, QrCode,
CanDistribute CanDistribute,
detail
}, },
data() { data() {
return { return {
@ -29,10 +32,9 @@ export default {
OrderTypeList: [], OrderTypeList: [],
PayTypeList: [], PayTypeList: [],
PayStatusList: [], PayStatusList: [],
// OrganizationList: [],
WhetherTypeList: [], WhetherTypeList: [],
EffectiveTypeList: [], EffectiveTypeList: [],
PermissionTypeList: [], // PermissionTypeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -51,13 +53,6 @@ export default {
'userName': { 'userName': {
type: 'text', type: 'text',
label: this.$t('orderAuthor.userName') label: this.$t('orderAuthor.userName')
},
'permissionType': {
type: 'select',
label: this.$t('orderAuthor.permissionType'),
config: {
data: []
}
} }
} }
}, },
@ -70,6 +65,7 @@ export default {
title: this.$t('orderAuthor.organizationOrEnterprise'), title: this.$t('orderAuthor.organizationOrEnterprise'),
prop: 'organizationName', prop: 'organizationName',
type: 'tag', type: 'tag',
width: '250',
columnValue: (row) => { return row.organizationName; }, columnValue: (row) => { return row.organizationName; },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
@ -81,13 +77,13 @@ export default {
title: this.$t('orderAuthor.commodityName'), title: this.$t('orderAuthor.commodityName'),
prop: 'goodsName' prop: 'goodsName'
}, },
{ // {
title: this.$t('orderAuthor.permissionType'), // title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType', // prop: 'permissionType',
type: 'tag', // type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); }, // columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; } // tagType: (row) => { return ''; }
}, // },
{ {
title: this.$t('orderAuthor.permissionNumber'), title: this.$t('orderAuthor.permissionNumber'),
prop: 'amount' prop: 'amount'
@ -111,39 +107,41 @@ export default {
title: this.$t('orderAuthor.purchaseMonths'), title: this.$t('orderAuthor.purchaseMonths'),
prop: 'monthAmount' prop: 'monthAmount'
}, },
{ // {
title: this.$t('orderAuthor.totalPrice'), // title: this.$t('orderAuthor.totalPrice'),
prop: 'totalPrice' // prop: 'totalPrice'
}, // },
{ // {
title: this.$t('orderAuthor.paymentMethod'), // title: this.$t('orderAuthor.paymentMethod'),
prop: 'payWays', // prop: 'payWays',
type: 'tag', // width: '130',
columnValue: (row) => { return this.$convertField(row.payWays, this.PayTypeList, ['value', 'label']); }, // type: 'tag',
tagType: (row) => { return 'success'; } // columnValue: (row) => { return this.$convertField(row.payWays, this.PayTypeList, ['value', 'label']); },
}, // tagType: (row) => { return 'success'; }
// },
{ {
title: this.$t('orderAuthor.creationDate'), title: this.$t('orderAuthor.creationDate'),
prop: 'createTime' prop: 'createTime',
}, width: '160'
{
title: this.$t('orderAuthor.orderType'),
prop: 'orderType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.orderType, this.OrderTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('orderAuthor.contractNumber'),
prop: 'contractNo'
},
{
title: this.$t('orderAuthor.businessType'),
prop: 'bizType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.bizType, this.BizTypeList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
}, },
// {
// title: this.$t('orderAuthor.orderType'),
// prop: 'orderType',
// type: 'tag',
// columnValue: (row) => { return this.$convertField(row.orderType, this.OrderTypeList, ['value', 'label']); },
// tagType: (row) => { return 'success'; }
// },
// {
// title: this.$t('orderAuthor.contractNumber'),
// prop: 'contractNo'
// },
// {
// title: this.$t('orderAuthor.businessType'),
// prop: 'bizType',
// type: 'tag',
// columnValue: (row) => { return this.$convertField(row.bizType, this.BizTypeList, ['value', 'label']); },
// tagType: (row) => { return 'success'; }
// },
{ {
title: this.$t('orderAuthor.paymentStatus'), title: this.$t('orderAuthor.paymentStatus'),
prop: 'payStatus', prop: 'payStatus',
@ -157,21 +155,21 @@ export default {
} }
} }
}, },
{ // {
title: this.$t('orderAuthor.salesman'), // title: this.$t('orderAuthor.salesman'),
prop: 'sellerName', // prop: 'sellerName',
type: 'tag', // type: 'tag',
columnValue: (row) => { return row.sellerName; }, // columnValue: (row) => { return row.sellerName; },
tagType: (row) => { return 'success'; } // tagType: (row) => { return 'success'; }
}, // },
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: '260', width: '260',
buttons: [ buttons: [
{ {
name: this.$t('global.edit'), name: '详情',
handleClick: this.handleEdit handleClick: this.handleDetail
}, },
{ {
name: this.$t('orderAuthor.obtainQrCode'), name: this.$t('orderAuthor.obtainQrCode'),
@ -201,7 +199,6 @@ export default {
loadInitData() { loadInitData() {
this.queryForm.queryObject.organizationId.config.data.length = 0; this.queryForm.queryObject.organizationId.config.data.length = 0;
getOrganizationList().then(response => { getOrganizationList().then(response => {
// this.OrganizationList = response.data;
response.data.forEach(elem => { response.data.forEach(elem => {
this.queryForm.queryObject.organizationId.config.data.push({ value: elem.id, label: elem.name }); this.queryForm.queryObject.organizationId.config.data.push({ value: elem.id, label: elem.name });
}); });
@ -241,14 +238,14 @@ export default {
}); });
}); });
this.$Dictionary.permissionType().then(list => { // this.$Dictionary.permissionType().then(list => {
list.forEach(elem => { // list.forEach(elem => {
this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name }); // this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name });
}); // });
this.$convertList(list, this.PermissionTypeList, elem => { // this.$convertList(list, this.PermissionTypeList, elem => {
return true; // return true;
}); // });
}); // });
}, },
queryFunction(params) { queryFunction(params) {
return getOrderPageList(params); return getOrderPageList(params);
@ -256,12 +253,12 @@ export default {
handleNormalAdd() { handleNormalAdd() {
this.$router.push({ path: `${UrlConfig.orderauthor.orderDraft}/add/0` }); this.$router.push({ path: `${UrlConfig.orderauthor.orderDraft}/add/0` });
}, },
handleEdit(index, data) { handleDetail(index, data) {
this.$alert('功能待开发', this.$t('tip.hint'), { data.payWays = this.$convertField(data.payWays, this.PayTypeList, ['value', 'label']);
confirmButtonText: this.$t('tip.confirm'), data.orderType = this.$convertField(data.orderType, this.OrderTypeList, ['value', 'label']);
callback: action => { data.bizType = this.$convertField(data.bizType, this.BizTypeList, ['value', 'label']);
} data.payStatusZh = this.$convertField(data.payStatus, this.PayStatusList, ['value', 'label']);
}); this.$refs.detail.doShow(data);
}, },
handleCanDistribute(index, data) { handleCanDistribute(index, data) {
if (data.qrCodeGenerated) { if (data.qrCodeGenerated) {
@ -273,21 +270,11 @@ export default {
}, },
distribute(data) { distribute(data) {
const model = { const model = {
amount: data.amount, code: data.code,
forever: data.forever, canDistribute: data.canDistribute ? data.canDistribute : false
orderCode: data.code,
startTime: data.startTime + ' 00:00:00',
monthAmount: data.monthAmount,
canDistribute: data.canDistribute,
operator: OperatorModel.TRANSFER,
mapId: data.mapId,
lessonId: data.lessonId || '',
mapProductCode: data.mapProductCode || '',
permissionType: data.permissionType,
organizationId: data.organizationId
}; };
giveLessons(model).then(response => { postDistribute(model).then(response => {
this.reloadTable(); this.reloadTable();
if (data.qrCodeGenerated) { if (data.qrCodeGenerated) {
this.$refs.qrCode.doShow({ this.$refs.qrCode.doShow({

View File

@ -0,0 +1,88 @@
<template>
<el-dialog title="扫码" :visible.sync="centerDialogVisible" width="30%" center>
<el-input v-model="input" :placeholder="$t('global.inputRoomNumber')" />
<span slot="footer" class="dialog-footer">
<el-button @click="centerDialogVisible = false">{{ $t('global.cancel') }}</el-button>
<el-button type="primary" @click="comit">{{ $t('global.confirm') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getPermission } from '@/api/management/distribute';
export default {
name: 'Dashboard',
data() {
return {
centerDialogVisible: false,
input: ''
};
},
methods: {
doShow() {
this.centerDialogVisible = true;
},
doClose() {
this.centerDialogVisible = false;
},
async comit() {
if (this.input) {
try {
await getPermission(`${this.input}`);
this.centerDialogVisible = false;
} catch (error) {
this.$messageBox(`${this.$t('error.scanningError')}:${error.message}`);
}
} else {
this.$messageBox(this.$t('global.inputRoomNumber'));
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard {
&-container {
margin: 30px;
}
&-text {
font-size: 30px;
line-height: 46px;
}
}
/deep/ .el-carousel {
overflow: hidden;
}
.home-box {
float: left;
width: 100%;
font-family: 'Microsoft YaHei';
.title {
font-size: 45px;
text-align: center;
font-weight: 400;
border-bottom: 2px dashed #333;
padding-bottom: 15px;
margin: 50px 200px 120px 200px;
position: relative;
.logo-img {
position: absolute;
right: 0;
top: 0;
width: 55px;
}
}
.card-box {
width: 100%;
padding: 0 300px;
}
}
</style>

View File

@ -73,6 +73,10 @@ export default {
title: this.$t('orderAuthor.organizationOrEnterprise'), title: this.$t('orderAuthor.organizationOrEnterprise'),
prop: 'organizationName' prop: 'organizationName'
}, },
{
title: '权限名称',
prop: 'permissionName'
},
{ {
title: this.$t('orderAuthor.userName'), title: this.$t('orderAuthor.userName'),
prop: 'userName' prop: 'userName'
@ -81,25 +85,25 @@ export default {
title: this.$t('orderAuthor.userMobile'), title: this.$t('orderAuthor.userMobile'),
prop: 'userMobile' prop: 'userMobile'
}, },
{ // {
title: this.$t('orderAuthor.mapName'), // title: this.$t('orderAuthor.mapName'),
prop: 'mapName' // prop: 'mapName'
}, // },
{ // {
title: this.$t('orderAuthor.mapProductName'), // title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName' // prop: 'mapProductName'
}, // },
{ // {
title: this.$t('orderAuthor.courseName'), // title: this.$t('orderAuthor.courseName'),
prop: 'lessonName' // prop: 'lessonName'
}, // },
{ // {
title: this.$t('orderAuthor.permissionType'), // title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType', // prop: 'permissionType',
type: 'tag', // type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); }, // columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; } // tagType: (row) => { return ''; }
}, // },
{ {
title: this.$t('orderAuthor.publicOrPrivate'), title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute', prop: 'canDistribute',
@ -154,13 +158,13 @@ export default {
name: this.$t('global.add'), name: this.$t('global.add'),
handleClick: this.handlePut, handleClick: this.handlePut,
type: '', type: '',
showControl: (row) => { return !row.isPut && row.permissionType; } showControl: (row) => { return !row.isPut; }
}, },
{ {
name: this.$t('global.delete'), name: this.$t('global.delete'),
handleClick: this.handlePop, handleClick: this.handlePop,
type: 'warning', type: 'warning',
showControl: (row) => { return row.isPut && row.permissionType; } showControl: (row) => { return row.isPut; }
} }
] ]
} }

View File

@ -16,16 +16,16 @@
style="width: 100%" style="width: 100%"
:height="height-300" :height="height-300"
> >
<el-table-column prop="mapName" :label="this.$t('orderAuthor.mapName')" /> <el-table-column prop="permissionName" label="权限名称" />
<el-table-column prop="mapProductName" :label="this.$t('orderAuthor.mapProductName')" width="120" /> <!-- <el-table-column prop="mapProductName" :label="this.$t('orderAuthor.mapProductName')" width="120" />
<el-table-column prop="lessonName" :label="this.$t('orderAuthor.courseName')" width="100" /> <el-table-column prop="lessonName" :label="this.$t('orderAuthor.courseName')" width="100" />
<el-table-column prop="permissionType" :label="this.$t('orderAuthor.permissionType')" width="100"> <el-table-column prop="permissionType" :label="this.$t('orderAuthor.permissionType')" width="100"> -->
<template slot-scope="scope"> <!-- <template slot-scope="scope">
{{ computedName(PermissionTypeList, scope.row.permissionType) }} {{ computedName(PermissionTypeList, scope.row.permissionType) }}
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column prop="amount" :label="this.$t('orderAuthor.totalPermissions')" width="80" /> <el-table-column prop="amount" :label="this.$t('orderAuthor.totalPermissions')" width="120" />
<el-table-column prop="remains" :label="this.$t('orderAuthor.residualPermissionNumber')" width="80" /> <el-table-column prop="remains" :label="this.$t('orderAuthor.residualPermissionNumber')" width="120" />
<el-table-column :label="this.$t('global.operate')" width="60"> <el-table-column :label="this.$t('global.operate')" width="60">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="deleteForm(scope.$index, scope.row)">{{ $t('global.delete') }} <el-button type="text" size="small" @click="deleteForm(scope.$index, scope.row)">{{ $t('global.delete') }}
@ -37,7 +37,7 @@
<div class="draft"> <div class="draft">
<el-button-group> <el-button-group>
<el-button v-if="!urlInfo.url" type="primary" @click="packForm">{{ $t('orderAuthor.packaging') }}</el-button> <el-button v-if="!urlInfo.url" type="primary" @click="packForm">{{ $t('orderAuthor.packaging') }}</el-button>
<el-button v-if="urlInfo.url" type="primary" @click="QrCodeShow">{{ $t('orderAuthor.obtainQrCode') }}</el-button> <el-button v-if="urlInfo.url" type="primary" @click="qrCodeShow">{{ $t('orderAuthor.obtainQrCode') }}</el-button>
<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>

View File

@ -2,6 +2,7 @@
<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" />
<qr-code ref="qrCode" /> <qr-code ref="qrCode" />
<qcode ref="qcode" />
</div> </div>
</template> </template>
@ -10,11 +11,13 @@ import { superAdmin } from '@/router';
import { listPackagePermission, restorePackagePermission, getPackageQrCode, permissionDistributeUnPackage } from '@/api/management/distribute'; import { listPackagePermission, restorePackagePermission, getPackageQrCode, permissionDistributeUnPackage } from '@/api/management/distribute';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import QrCode from '@/components/QrCode'; import QrCode from '@/components/QrCode';
import Qcode from './Qcode';
export default { export default {
name: 'Author', name: 'Author',
components: { components: {
QrCode QrCode,
Qcode
}, },
data() { data() {
return { return {
@ -36,13 +39,13 @@ export default {
type: 'text', type: 'text',
label: this.$t('orderAuthor.founder') label: this.$t('orderAuthor.founder')
}, },
'permissionType': { // 'permissionType': {
type: 'select', // type: 'select',
label: this.$t('orderAuthor.permissionType'), // label: this.$t('orderAuthor.permissionType'),
config: { // config: {
data: [] // data: []
} // }
}, // },
'status': { 'status': {
type: 'select', type: 'select',
label: this.$t('orderAuthor.authorityStatus'), label: this.$t('orderAuthor.authorityStatus'),
@ -62,6 +65,10 @@ export default {
title: this.$t('orderAuthor.organizationOrEnterprise'), title: this.$t('orderAuthor.organizationOrEnterprise'),
prop: 'organizationName' prop: 'organizationName'
}, },
{
title: '权限名称',
prop: 'permissionName'
},
{ {
title: this.$t('orderAuthor.founder'), title: this.$t('orderAuthor.founder'),
prop: 'userName' prop: 'userName'
@ -70,25 +77,25 @@ export default {
title: this.$t('orderAuthor.founderPhone'), title: this.$t('orderAuthor.founderPhone'),
prop: 'userMobile' prop: 'userMobile'
}, },
{ // {
title: this.$t('orderAuthor.mapName'), // title: this.$t('orderAuthor.mapName'),
prop: 'mapName' // prop: 'mapName'
}, // },
{ // {
title: this.$t('orderAuthor.mapProductName'), // title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName' // prop: 'mapProductName'
}, // },
{ // {
title: this.$t('orderAuthor.courseName'), // title: this.$t('orderAuthor.courseName'),
prop: 'lessonName' // prop: 'lessonName'
}, // },
{ // {
title: this.$t('orderAuthor.permissionType'), // title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType', // prop: 'permissionType',
type: 'tag', // type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); }, // columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; } // tagType: (row) => { return ''; }
}, // },
{ {
title: this.$t('orderAuthor.publicOrPrivate'), title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute', prop: 'canDistribute',
@ -172,7 +179,8 @@ export default {
} }
], ],
actions: [ actions: [
{ text: this.$t('orderAuthor.privilegePackaging'), btnCode: 'employee_insert', handler: this.handlePackage } { text: this.$t('orderAuthor.privilegePackaging'), btnCode: 'employee_insert', handler: this.handlePackage },
{ text: '领取权限', handler: this.handlerPermission, show: process.env.NODE_ENV == 'development' }
] ]
} }
}; };
@ -191,15 +199,15 @@ export default {
return true; return true;
}); });
}); });
this.$Dictionary.permissionType().then(list => { // this.$Dictionary.permissionType().then(list => {
list.forEach(elem => { // list.forEach(elem => {
this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name }); // this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name });
}); // });
this.$convertList(list, this.PermissionTypeList, elem => { // this.$convertList(list, this.PermissionTypeList, elem => {
return true; // return true;
}); // });
this.PermissionTypeList.push({ value: undefined, label: this.$t('orderAuthor.permissionPack') }); // this.PermissionTypeList.push({ value: undefined, label: this.$t('orderAuthor.permissionPack') });
}); // });
}, },
formatterDate(row, porpInfo) { formatterDate(row, porpInfo) {
return row[porpInfo.property]; return row[porpInfo.property];
@ -255,6 +263,9 @@ export default {
}, },
handlePackage() { handlePackage() {
this.$router.push({ path: `${UrlConfig.orderauthor.trainferPackage}` }); this.$router.push({ path: `${UrlConfig.orderauthor.trainferPackage}` });
},
handlerPermission() {
this.$refs.qcode.doShow();
} }
} }
}; };

View File

@ -1,174 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.return') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { getPermissionPackageDetail } from '@/api/management/distribute';
export default {
name: 'TrainsferDetail',
data() {
return {
show: false,
height: 0,
WhetherTypeList: [],
EffectiveTypeList: [],
PermissionTypeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '120px',
reset: true,
queryObject: {
'permissionType': {
type: 'select',
label: this.$t('orderAuthor.permissionType'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('orderAuthor.organizationOrEnterprise'),
prop: 'organizationName'
},
{
title: this.$t('orderAuthor.userName'),
prop: 'userName'
},
{
title: this.$t('orderAuthor.userMobile'),
prop: 'userMobile'
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName'
},
{
title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
tagType: (row) => {
switch (row.canDistribute) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: this.$t('orderAuthor.permanenceOrNot'),
prop: 'forever',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: this.$t('orderAuthor.startTime'),
prop: 'startTime',
type: 'formatter',
formatter: this.formatterDate
},
{
title: this.$t('orderAuthor.endTime'),
prop: 'endTime',
type: 'formatter',
formatter: this.formatterDate
},
{
title: this.$t('orderAuthor.courseAuthorityStatus'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
default: return 'danger';
}
}
}
]
}
};
},
mounted() {
this.loadInitData();
},
methods: {
loadInitData() {
this.$Dictionary.effectiveType().then(list => {
this.$convertList(list, this.EffectiveTypeList, elem => {
return true;
});
});
this.$Dictionary.permissionType().then(list => {
list.forEach(elem => {
this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name });
});
this.$convertList(list, this.PermissionTypeList, elem => {
return true;
});
});
},
formatterDate(row, porpInfo) {
return row[porpInfo.property];
},
queryFunction(params) {
// if (params.permissionType) {
return getPermissionPackageDetail(this.$route.params.permissionId, params);
// }
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -1,221 +0,0 @@
<template>
<el-dialog
:title="title"
:visible.sync="show"
top="20px"
width="90%"
:before-close="doClose"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { listCanPackagePermission } from '@/api/management/distribute';
export default {
name: 'Author',
props: {
ruleList: {
type: Array,
default() {
return [];
}
},
effectiveTypeList: {
type: Array,
default() {
return [];
}
},
permissionTypeList: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
show: false,
param: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '100px',
reset: true,
queryObject: {
'permissionType': {
type: 'select',
label: this.$t('orderAuthor.permissionType'),
config: {
data: []
}
},
'canDistribute': {
type: 'select',
label: this.$t('orderAuthor.publicOrPrivate'),
config: {
data: []
}
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('orderAuthor.organizationOrEnterprise'),
prop: 'organizationName'
},
{
title: this.$t('orderAuthor.userName'),
prop: 'userName'
},
{
title: this.$t('orderAuthor.userMobile'),
prop: 'userMobile'
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName'
},
{
title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'permissionType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
tagType: (row) => {
switch (row.canDistribute) {
case true: return 'success';
case false: return 'danger';
}
}
},
{
title: this.$t('orderAuthor.permanenceOrNot'),
prop: 'forever',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
tagType: (row) => {
switch (row.forever) {
case true: return 'success';
case false: return 'danger';
}
}
},
// {
// title: '',
// prop: 'amount'
// },
// {
// title: '',
// prop: 'remains'
// },
{
title: this.$t('orderAuthor.startTime'),
prop: 'startTime',
type: 'formatter',
formatter: this.formatterDate
},
{
title: this.$t('orderAuthor.endTime'),
prop: 'endTime',
type: 'formatter',
formatter: this.formatterDate
},
{
type: 'button',
title: this.$t('global.operate'),
width: '120',
buttons: [
{
name: this.$t('global.add'),
handleClick: this.handlePut,
type: '',
showControl: (row) => { return !row.isPut && row.permissionType; }
},
{
name: this.$t('global.delete'),
handleClick: this.handlePop,
type: 'warning',
showControl: (row) => { return row.isPut && row.permissionType; }
}
]
}
]
}
};
},
computed: {
title() {
return this.$t('orderAuthor.editPermissionRules');
}
},
watch: {
PermissionTypeList: function (list) {
if (list && list.length) {
this.queryForm.queryObject.permissionType.config.data = list;
}
}
},
mounted() {
this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList;
},
methods: {
formatterDate(row, porpInfo) {
return String(row[porpInfo.property] || '').split(' ')[0];
},
async queryFunction(params) {
const resp = await listCanPackagePermission(params);
this.ruleList.forEach(elem => {
resp.data.list.forEach(item => {
if (item.id == elem.id) {
item.isPut = true;
}
});
});
return resp;
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
doShow() {
this.show = true;
},
doClose() {
this.show = false;
},
handlePut(index, row) {
this.$emit('addRuleForm', index, row);
},
handlePop(index, row) {
this.$emit('deleteForm', index, row);
}
}
};
</script>

View File

@ -1,242 +0,0 @@
<template>
<el-card>
<div class="pack-box" :style="{ height: height +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper" style="">
<el-steps class="steps" :active="display">
<el-step :title="this.$t('orderAuthor.selectPermissionsPackage')" icon="el-icon-edit" />
<el-step icon="el-icon-setting" />
</el-steps>
<el-card class="forms pack-rule">
<el-button class="addList" size="small" @click="dialogSelect">{{ $t('orderAuthor.addRecords') }}</el-button>
<el-table
:data="ruleList"
border
show-summary
:summary-method="getSummaries"
style="width: 100%"
:height="height-300"
>
<el-table-column prop="mapName" :label="this.$t('orderAuthor.mapName')" />
<el-table-column prop="mapProductName" :label="this.$t('orderAuthor.mapProductName')" width="120" />
<el-table-column prop="lessonName" :label="this.$t('orderAuthor.courseName')" width="100" />
<el-table-column prop="permissionType" :label="this.$t('orderAuthor.permissionType')" width="100">
<template slot-scope="scope">
{{ computedName(PermissionTypeList, scope.row.permissionType) }}
</template>
</el-table-column>
<el-table-column prop="amount" :label="this.$t('orderAuthor.totalPermissions')" width="80" />
<el-table-column prop="remains" :label="this.$t('orderAuthor.residualPermissionNumber')" width="80" />
<el-table-column :label="this.$t('global.operate')" width="60">
<template slot-scope="scope">
<el-button type="text" size="small" @click="deleteForm(scope.$index, scope.row)">{{ $t('global.delete') }}
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="!urlInfo.url" type="primary" @click="packForm">{{ $t('orderAuthor.packaging') }}</el-button>
<el-button v-if="urlInfo.url" type="primary" @click="QrCodeShow">{{ $t('orderAuthor.obtainQrCode') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
<choose-permission
ref="choosePermission"
:rule-list="ruleList"
:effective-type-list="EffectiveTypeList"
:permission-type-list="PermissionTypeList"
@addRuleForm="addRuleForm"
@deleteForm="deleteForm"
/>
</el-scrollbar>
<qr-code ref="qrCode" />
</div>
</el-card>
</template>
<script>
// import { UrlConfig } from '@/router/index';
import { permissionDistributePackage } from '@/api/management/distribute';
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import ChoosePermission from './choosePermission';
import QrCode from '@/components/QrCode';
import { EventBus } from '@/scripts/event-bus';
export default {
name: 'PackRule',
components: {
ChoosePermission,
QrCode
},
mixins: [
WindowResizeHandler
],
data() {
return {
display: 1,
height: 0,
urlInfo: {},
ruleList: [],
EffectiveTypeList: [],
PermissionTypeList: []
};
},
mounted() {
this.loadInitData();
},
methods: {
turnback() {
this.$router.go(-1);
},
resizeHandler: function () {
this.height = this._clientHeight - 62;
},
computedName(list, code) {
let name = '';
list.forEach(elem => {
if (elem.value == code) {
name = elem.label;
}
});
return name;
},
loadInitData() {
this.EffectiveTypeList = [];
this.$Dictionary.effectiveType().then(list => {
this.EffectiveTypeList = list.map(elem => { return { value: elem.code, label: elem.name }; });
});
this.PermissionTypeList = [];
this.$Dictionary.permissionType().then(list => {
this.PermissionTypeList = list.map(elem => { return { value: elem.code, label: elem.name }; });
});
},
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = this.$t('orderAuthor.totalNumber');
return;
}
if (index === 4 || index === 5) {
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
}
});
return sums;
},
dialogSelect(row) {
this.$refs.choosePermission.doShow();
},
deleteForm(index, row) {
const idx = this.ruleList.findIndex(elem => { return elem.id == row.id; });
if (idx >= 0) {
row['isPut'] = false;
this.ruleList.splice(idx, 1);
}
EventBus.$emit('reloadTable', { index: index, list: row });
},
addRuleForm(index, row) {
row['isPut'] = true;
this.ruleList.push(row);
EventBus.$emit('reloadTable', { index: index, list: row });
},
packForm() {
if (this.ruleList && this.ruleList.length) {
const dis = [];
this.ruleList.forEach(elem => {
dis.push(elem.id);
});
permissionDistributePackage(dis).then(resp => {
this.urlInfo = {
url: resp.data,
title: this.$t('orderAuthor.permissionToDistributeQRCode')
};
this.qrCodeShow();
}).catch(() => {
this.$messageBox(this.$t('tip.packagingFailed'));
});
} else {
this.$messageBox(this.$t('tip.selectPackagingRecord'));
}
},
qrCodeShow() {
if (this.$refs) {
this.$refs.qrCode.doShow(this.urlInfo);
}
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.pack-box {
padding-top: 10px;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
.steps {
width: 980px;
margin: 0 auto;
padding-top: 5px;
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 20px;
padding: 40px;
}
}
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.pack-rule {
.addList {
float: right;
font-size: 14px;
color: #000;
margin-bottom: 8px;
cursor: pointer;
}
.btn-footer {
width: 100%;
display: flex;
justify-content: center;
margin-top: 20px;
}
/deep/ .el-table__footer-wrapper {
.is-leaf:nth-child(3) {
font-size: 0;
}
}
}
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -1,20 +1,23 @@
<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" />
<select-role ref="selectRole" @reloadTable="reloadTable" />
</div> </div>
</template> </template>
<script> <script>
import { superAdmin } from '@/router'; import { listPermision } from '@/api/management/author';
import { listPackagePermission } from '@/api/management/distribute'; import selectRole from './selectRole/list';
// import { UrlConfig } from '@/router/index';
export default { export default {
name: 'Author', name: 'Author',
components: { components: {
selectRole
}, },
data() { data() {
return { return {
PermissionTypeList: [],
EffectiveTypeList: [],
pagerConfig: { pagerConfig: {
pageSize: 'pageSize', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
@ -23,13 +26,19 @@ export default {
labelWidth: '120px', labelWidth: '120px',
reset: true, reset: true,
queryObject: { queryObject: {
'userName': { permissionType: {
type: 'text', type: 'select',
label: this.$t('orderAuthor.userName') label: this.$t('permission.permissionType'),
config: {
data: []
}
}, },
'userMobile': { status: {
type: 'text', type: 'select',
label: this.$t('global.mobile') label: '状态类型',
config: {
data: []
}
} }
} }
}, },
@ -39,31 +48,19 @@ export default {
indexShow: true, indexShow: true,
columns: [ columns: [
{ {
title: this.$t('orderAuthor.organizationOrEnterprise'), title: '权限名称',
prop: 'organizationName' width: '260',
prop: 'permissionName'
}, },
{ {
title: this.$t('orderAuthor.founder'), title: this.$t('permission.permissionType'),
prop: 'userName' prop: 'permissionType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.permissionType, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
}, },
{ {
title: this.$t('orderAuthor.founderPhone'), title: this.$t('permission.permissionUseType'),
prop: 'userMobile'
},
{
title: this.$t('orderAuthor.mapName'),
prop: 'mapName'
},
{
title: this.$t('orderAuthor.mapProductName'),
prop: 'mapProductName'
},
{
title: this.$t('orderAuthor.courseName'),
prop: 'lessonName'
},
{
title: this.$t('orderAuthor.publicOrPrivate'),
prop: 'canDistribute', prop: 'canDistribute',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); }, columnValue: (row) => { return this.$ConstSelect.translate(row.canDistribute, 'PermissionUseList'); },
@ -75,7 +72,7 @@ export default {
} }
}, },
{ {
title: this.$t('orderAuthor.permanenceOrNot'), title: this.$t('permission.isForever'),
prop: 'forever', prop: 'forever',
type: 'tag', type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); }, columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
@ -87,24 +84,52 @@ export default {
} }
}, },
{ {
title: this.$t('orderAuthor.startTime'), title: this.$t('permission.permissionTotal'),
prop: 'amount'
},
{
title: this.$t('permission.permissionRemains'),
prop: 'remains'
},
{
title: this.$t('permission.startTime'),
prop: 'startTime', prop: 'startTime',
type: 'formatter', type: 'formatter',
formatter: this.formatterDate formatter: this.formatterDate
}, },
{ {
title: this.$t('orderAuthor.endTime'), title: this.$t('permission.endTime'),
prop: 'endTime', prop: 'endTime',
type: 'formatter', type: 'formatter',
formatter: this.formatterDate formatter: this.formatterDate
}, },
{
title: this.$t('permission.belonger'),
prop: 'ownerName'
},
{
title: this.$t('permission.permissionStatus'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); },
tagType: (row) => {
switch (row.status) {
case '1': return 'success';
default: return 'danger';
}
}
},
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: '200', width: '200',
hide: (row) => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
buttons: [ buttons: [
{
name: this.$t('permission.setBelonger'),
handleClick: this.handleRoleVest,
type: ''
}
] ]
} }
], ],
@ -118,14 +143,33 @@ export default {
this.loadInitData(); this.loadInitData();
}, },
methods: { methods: {
handleRoleVest(index, row) {
this.$refs.selectRole.doShow(row.id);
},
loadInitData() { loadInitData() {
this.$Dictionary.effectiveType().then(list => {
list.forEach(elem => {
this.queryForm.queryObject.status.config.data.push({ value: elem.code, label: elem.name });
});
this.$convertList(list, this.EffectiveTypeList, elem => {
return true;
});
});
this.$Dictionary.permissionType().then(list => {
list.forEach(elem => {
this.queryForm.queryObject.permissionType.config.data.push({ value: elem.code, label: elem.name });
});
this.$convertList(list, this.PermissionTypeList, elem => {
return true;
});
});
}, },
formatterDate(row, porpInfo) { formatterDate(row, porpInfo) {
return row[porpInfo.property]; return row[porpInfo.property];
}, },
queryFunction(params) { queryFunction(params) {
return listPackagePermission(params); return listPermision(params);
}, },
reloadTable() { reloadTable() {
if (this.queryList && this.queryList.reload) { if (this.queryList && this.queryList.reload) {

View File

@ -0,0 +1,111 @@
<template>
<el-dialog
:title="$t('permission.userList')"
:visible.sync="show"
top="20px"
width="90%"
:before-do-close="doClose"
:close-on-click-modal="false"
>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
import { getUserList } from '@/api/management/user';
import { putPermissionOwner } from '@/api/management/author';
export default {
name: 'SelectRole',
data() {
return {
show: false,
roleId: '',
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('global.name')
}
}
},
queryList: {
query: getUserList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('global.name'),
prop: 'name'
},
{
title: this.$t('global.nickName'),
prop: 'nickname'
},
{
title: this.$t('global.mobile'),
prop: 'mobile'
},
{
title: this.$t('global.email'),
prop: 'email'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.select'),
handleClick: this.selectRole,
showControl: (row) => {
return row.id != this.$store.state.user.id;
}
}
]
}
]
},
currentModel: {}
};
},
created() {
},
methods: {
doShow(roleId) {
this.roleId = roleId;
this.show = true;
},
doClose() {
this.show = false;
},
selectRole(index, row) {
this.$confirm(this.$t('permission.isSureSetBelonger').replace('{name}', row.name), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
putPermissionOwner({ id: this.roleId, owner: row }).then(resp => {
this.$message.success(this.$t('permission.setSuccess'));
this.show = false;
this.$emit('reloadTable');
}).catch(() => {
this.$messageBox(this.$t('error.setFailed'));
});
}).catch(() => { });
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -2,7 +2,7 @@
<el-dialog :title="title" :visible.sync="show" width="800px" :before-close="doClose" center> <el-dialog :title="title" :visible.sync="show" width="800px" :before-close="doClose" 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 type="primary" :disabled="disabled" @click="draftRule">{{ isAdd? $t('global.add'): $t('global.edit') }} <el-button type="primary" @click="draftRule">{{ isAdd? $t('global.add'): $t('global.edit') }}
</el-button> </el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button> <el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span> </span>
@ -78,6 +78,7 @@ export default {
return form; return form;
}, },
rules() { rules() {
const that = this;
const crules = { const crules = {
permissionType: [ permissionType: [
{ required: true, message: this.$t('rules.permissionTypeInput'), trigger: 'change' } { required: true, message: this.$t('rules.permissionTypeInput'), trigger: 'change' }
@ -101,7 +102,7 @@ export default {
if (Number.isInteger(Number(value)) && Number(value) > 0) { if (Number.isInteger(Number(value)) && Number(value) > 0) {
callback(); callback();
} else { } else {
callback(new Error(this.$t('rules.permissionNumberGreater0'))); callback(new Error(that.$t('rules.permissionNumberGreater0')));
} }
}, },
trigger: 'blur' trigger: 'blur'
@ -164,17 +165,17 @@ export default {
const model = { const model = {
startTime: startTime, startTime: startTime,
endTime: endTime, endTime: endTime,
type: this.formModel.permissionType, permissionType: this.formModel.permissionType,
ownerId: this.formModel.ownerId ownerId: this.formModel.ownerId
}; };
if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) { if (this.formModel.permissionType == PermissionType.LESSON || this.formModel.permissionType == PermissionType.EXAM) {
model['lessonId'] = this.formModel.lessonId; model['lessonId'] = this.formModel.lessonId;
model['mapId'] = this.formModel.mapId; model['mapId'] = this.formModel.mapId;
model['mapProductCode'] = this.formModel.mapProductCode; model['prdCode'] = this.formModel.mapProductCode;
} else if (this.formModel.permissionType == PermissionType.SIMULATION) { } else if (this.formModel.permissionType == PermissionType.SIMULATION) {
model['mapId'] = this.formModel.mapId; model['mapId'] = this.formModel.mapId;
model['mapProductCode'] = this.formModel.mapProductCode; model['prdCode'] = this.formModel.mapProductCode;
} }
getTotalRemains(model).then(response => { getTotalRemains(model).then(response => {
@ -230,7 +231,6 @@ export default {
}); });
cb(results); cb(results);
} catch (error) { } catch (error) {
console.error(error, '查询用户list');
cb(results); cb(results);
} }
} else { } else {
@ -263,8 +263,8 @@ export default {
this.show = false; this.show = false;
}, },
draftRule() { draftRule() {
if (this.formModel.amount <= this.maxTotal && this.formModel.amount) { this.$refs.dataform.validateForm(() => {
this.$refs.dataform.validateForm(() => { if (this.formModel.amount <= this.maxTotal && this.formModel.amount) {
if (this.isAdd) { if (this.isAdd) {
this.$emit('addRuleForm', { this.$emit('addRuleForm', {
operator: OperatorModel.TRANSFER, operator: OperatorModel.TRANSFER,
@ -293,8 +293,8 @@ export default {
}); });
} }
this.doClose(); this.doClose();
}); }
} });
} }
} }
}; };

View File

@ -59,6 +59,11 @@ export default {
selectCheckShow: false, selectCheckShow: false,
indexShow: true, indexShow: true,
columns: [ columns: [
{
title: '权限名称',
width: '210',
prop: 'permissionName'
},
{ {
title: this.$t('permission.permissionType'), title: this.$t('permission.permissionType'),
prop: 'type', prop: 'type',
@ -66,18 +71,6 @@ export default {
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); }, columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; } tagType: (row) => { return ''; }
}, },
{
title: this.$t('permission.mapName'),
prop: 'mapName'
},
{
title: this.$t('permission.mapProductName'),
prop: 'mapProductName'
},
{
title: this.$t('permission.lessonName'),
prop: 'lessonName'
},
{ {
title: this.$t('permission.permissionUseType'), title: this.$t('permission.permissionUseType'),
prop: 'canDistribute', prop: 'canDistribute',

View File

@ -1,217 +1,214 @@
<template> <template>
<el-card> <el-card>
<div slot="header" style="text-align: center;"> <div slot="header" style="text-align: center;">
<span class=" title">{{$t('global.line') + courseModel.name }}</span> <span class=" title">{{ $t('global.line') + courseModel.name }}</span>
</div> </div>
<div style="margin:50px; overflow-x: auto;" :style="{ height: height - 150 +'px' }"> <div style="margin:50px; overflow-x: auto;" :style="{ height: height - 150 +'px' }">
<p class="list-item"> <p class="list-item">
<span class="list-label">{{ $t('global.updateTime') }}</span> <span class="list-label">{{ $t('global.updateTime') }}</span>
<span class="list-elem">{{ courseModel.updateTime }}</span> <span class="list-elem">{{ courseModel.updateTime }}</span>
</p> </p>
<p class="list-item" v-if="!courseModel.pmsList.length"> <p v-if="!courseModel.pmsList.length" class="list-item">
<span class="list-label">{{ $t('screenMonitor.productTrialDuration') }}</span> <span class="list-label">{{ $t('screenMonitor.productTrialDuration') }}</span>
<span class="list-elem">{{ showTryTime }}</span> <span class="list-elem">{{ showTryTime }}</span>
</p> </p>
<p class="list-item"> <p class="list-item">
<span class="list-label">{{ $t('global.permissionList') }}</span> <span class="list-label">{{ $t('global.permissionList') }}</span>
</p> </p>
<limit-list ref="limitList" :courseModel="courseModel" @initLoadPage="getScreenLists"></limit-list> <limit-list ref="limitList" :course-model="courseModel" @initLoadPage="getScreenLists" />
<p style="display: flex; justify-content: center;"> <p style="display: flex; justify-content: center;">
<span class="list-label"></span> <span class="list-label" />
<el-button type="success" @click="buy">{{ $t('global.buy') }}</el-button> <el-button type="success" @click="buy">{{ $t('global.buy') }}</el-button>
<el-button type="primary" @click="distribute" v-if="hasPermssion">{{$t('global.distributePermission')}}</el-button> <el-button v-if="hasPermssion" type="primary" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
<el-button type="primary" @click="transfer" v-if="hasPermssion">{{$t('global.transferQRCode')}}</el-button> <el-button v-if="hasPermssion" type="primary" @click="transfer">{{ $t('global.transferQRCode') }}</el-button>
<el-button type="primary" @click="start">{{$t('screenMonitor.aTSScreenSimulation')}}</el-button> <el-button type="primary" @click="start">{{ $t('screenMonitor.aTSScreenSimulation') }}</el-button>
</p> </p>
</div> </div>
<set-time ref="setTime" @ConfirmSelectBeginTime="jump"></set-time> <set-time ref="setTime" @ConfirmSelectBeginTime="jump" />
</el-card> </el-card>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'; import { getPublishMapInfo } from '@/api/jmap/map';
import { getCourseLessonTree } from '@/api/management/exam'; import { queryPermissionScreen } from '@/api/management/author';
import { listPublishMap, getPublishMapInfo } from '@/api/jmap/map'; import { getGoodsTryUse } from '@/api/management/goods';
import { queryPermissionScreen } from '@/api/management/author'; import { PermissionType } from '@/scripts/ConstDic';
import { getGoodsTryUse } from '@/api/management/goods'; import { launchFullscreen } from '@/utils/screen';
import { PermissionType } from '@/scripts/ConstDic'; import { UrlConfig } from '@/router/index';
import { launchFullscreen } from '@/utils/screen'; import WindowResizeHandler from '@/mixin/WindowResizeHandler';
import { UrlConfig } from '@/router/index'; import LimitList from '@/views/components/limits/index';
import WindowResizeHandler from '@/mixin/WindowResizeHandler'; import SetTime from '@/views/display/demon/setTime';
import LimitList from "@/views/components/limits/index"; import { bitScreenNotify } from '@/api/simulation';
import SetTime from '@/views/display/demon/setTime';
import { bitScreenNotify } from '@/api/simulation';
export default { export default {
name: 'ExamDetailList', name: 'ExamDetailList',
mixins: [ components: {
WindowResizeHandler LimitList,
], SetTime
components: { },
LimitList, filters: {
SetTime },
}, mixins: [
data() { WindowResizeHandler
return { ],
height: '', data() {
courseModel: { return {
mapId: '', height: '',
name: '', courseModel: {
skinCode: '', mapId: '',
updateTime: '', name: '',
pmsList: [], skinCode: '',
}, updateTime: '',
goodsId: '', pmsList: []
tryTime: 0, },
showTryTime: '0', goodsId: '',
tryUser: 0, tryTime: 0,
EffectiveTypeList: [], showTryTime: '0',
screenList: [], tryUser: 0,
} EffectiveTypeList: [],
}, screenList: []
mixins: [ };
WindowResizeHandler },
], computed: {
filters: { hasPermssion() {
}, let isShow = false;
computed: { this.courseModel.pmsList.forEach(item => {
hasPermssion() { if (item.canDistribute) {
let isShow = false; isShow = true;
this.courseModel.pmsList.forEach(item => { }
if (item.canDistribute) { });
isShow = true; return isShow;
} }
}); },
return isShow; watch: {
} $route(newVal) {
}, this.initLoadPage();
watch: { }
$route(newVal) { },
this.initLoadPage(); async mounted() {
} this.$Dictionary.effectiveType().then(list => {
}, this.EffectiveTypeList = list;
async mounted() { });
this.$Dictionary.effectiveType().then(list => { await this.getScreenLists();
this.EffectiveTypeList = list; this.initLoadPage();
}); },
await this.getScreenLists(); methods: {
this.initLoadPage(); resizeHandler: function () {
}, this.height = this._clientHeight;
methods: { },
resizeHandler: function () { async getScreenLists() {
this.height = this._clientHeight; const res = await queryPermissionScreen();
}, this.screenList = res.data;
async getScreenLists() { this.courseModel = {
let res = await queryPermissionScreen(); pmsList: this.screenList || []
this.screenList = res.data; };
this.courseModel = { },
pmsList: this.screenList || [], async initLoadPage() {
}; const data = { id: this.$route.params.lessonId };
}, if (parseInt(data.id)) {
async initLoadPage() { try {
let that = this; const res = await getPublishMapInfo(data.id);
let data = { id: this.$route.params.lessonId }; this.tryUser = 0;
if (parseInt(data.id)) { this.courseModel = {
try { name: res.data.name,
let res = await getPublishMapInfo(data.id); mapId: res.data.id,
this.tryUser = 0; skinCode: res.data.skinCode,
that.courseModel = { updateTime: res.data.updateTime,
name: res.data.name, pmsList: this.screenList || [],
mapId: res.data.id, permissionType: PermissionType.SCREEN
skinCode: res.data.skinCode, };
updateTime: res.data.updateTime, this.$store.dispatch('training/setPrdType', res.data.prdType);
pmsList: that.screenList || [], const paras = {
PermissionType: PermissionType.SCREEN permissionType: PermissionType.SCREEN
}; };
if (!this.courseModel.pmsList.length) {
this.$store.dispatch('training/setPrdType', res.data.prdType) this.tryUser = 1;
let paras = { try {
productType: PermissionType.SCREEN const resp = await getGoodsTryUse(paras);
}; if (resp.data.tryTime <= 0) {
this.tryTime = 0;
if (!that.courseModel.pmsList.length) { this.setTryTime(0);
this.tryUser = 1; } else {
try { this.tryTime = resp.data.tryTime;
let resp = await getGoodsTryUse(paras); this.setTryTime(resp.data.tryTime);
if (resp.data.tryTime <= 0) { this.goodsId = resp.data.goodsId;
this.tryTime = 0; }
this.setTryTime(0) } catch (error) {
} else { console.log(error);
this.tryTime = resp.data.tryTime; this.$messageBox(this.$t('error.acquisitionTimeFailed'));
this.setTryTime(resp.data.tryTime) }
this.goodsId = resp.data.goodsId; }
} } catch (error) {
console.log(error);
} catch (err) { this.$messageBox(this.$t('error.refreshFailed'));
this.$messageBox(this.$t('error.acquisitionTimeFailed')) }
} }
} },
} catch (error) { buy() {
this.$messageBox(this.$t('error.refreshFailed')) this.$router.push({
}; path: `${UrlConfig.dp.pay}/${this.$route.params.lessonId}`,
} query: { permissionType: PermissionType.SCREEN }
}, });
buy() { },
this.$router.push({ transfer() {
path: `${UrlConfig.dp.pay}/${this.$route.params.lessonId}`, if (this.$refs) {
query: { permissionType: PermissionType.SCREEN, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId } this.$refs.limitList.transfer(this.courseModel);
}); }
}, },
transfer() { distribute() {
if (this.$refs) { if (this.$refs) {
this.$refs.limitList.transfer(this.courseModel); this.$refs.limitList.distribute(this.courseModel);
} }
}, },
distribute() { selectBeginTime() {
if (this.$refs) { this.$refs.setTime.doShow();
this.$refs.limitList.distribute(this.courseModel); },
} jump(model) {
}, const data = { mapId: this.courseModel.mapId };
selectBeginTime() { bitScreenNotify(data).then(resp => {
this.$refs.setTime.doShow(); const query = {
}, skinCode: this.courseModel.skinCode,
jump(model) { group: resp.data, prdType: '01',
let data = { mapId: this.courseModel.mapId } mapId: this.courseModel.mapId,
bitScreenNotify(data).then(resp => { try: this.tryUser,
let query = { goodsId: this.goodsId,
skinCode: this.courseModel.skinCode, group: resp.data, prdType: '01', mapId: this.courseModel.mapId, try: this.tryUser, goodsId: this.goodsId, initTime: model.initTime, initTime: model.initTime
} };
this.$router.push({ path: `${UrlConfig.display}/dp`, query: query }); this.$router.push({ path: `${UrlConfig.display}/dp`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => {
}).catch(error => { this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
this.$messageBox(this.$t('error.createSimulationFailed') + error.message); });
}) },
}, start() {
start() { if (this.courseModel.pmsList.length) {
if (this.courseModel.pmsList.length) { this.selectBeginTime();
this.selectBeginTime(); } else {
} else { if (this.tryTime <= 0) {
if (this.tryTime <= 0) { this.$confirm(this.$t('tip.noPermissionHint'), this.$t('global.tips'), {
this.$confirm(this.$('tip.noPermissionHint'), this.$t('global.tips'), { confirmButtonText: this.$t('global.confirm'),
confirmButtonText: this.$t('global.confirm'), cancelButtonText: this.$t('global.cancel'),
cancelButtonText: this.$t('global.cancel'), type: 'warning'
type: 'warning' }).then(() => {
}).then(() => { this.buy();
this.buy(); }).catch(() => { });
}).catch(() => { }); } else {
} else { this.selectBeginTime();
this.selectBeginTime(); }
} }
} },
setTryTime(val) {
}, if (val <= 1) {
setTryTime(val) { this.showTryTime = `0`+ this.$t('global.minute');
if (val <= 1) { } else if (val > 1 && val <= 60) {
this.showTryTime = `0`+ this.$t('global.minute'); this.showTryTime = '1'+ this.$t('global.minute');
} else if (1 < val && val <= 60) { } else if (val > 60) {
this.showTryTime = '1'+ this.$t('global.minute'); const time = parseInt(val / 60);
} else if (val > 60) { this.showTryTime = time+ this.$t('global.minutes');
let time = parseInt(val / 60); }
this.showTryTime = time+ this.$t('global.minutes'); }
} }
} };
}
}
</script> </script>
<style scoped> <style scoped>
::-webkit-scrollbar { ::-webkit-scrollbar {

View File

@ -31,9 +31,8 @@
import FilterCity from '@/views/components/filterCity'; import FilterCity from '@/views/components/filterCity';
import { listPublishMap } from '@/api/jmap/map'; import { listPublishMap } from '@/api/jmap/map';
import { queryPermissionScreen } from '@/api/management/author'; import { queryPermissionScreen } from '@/api/management/author';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
import { UrlConfig } from '@/router/index'; import { UrlConfig } from '@/router/index';
import { getSessionStorage, setSessionStorage, removeSessionStorage } from '@/utils/auth';
export default { export default {
name: 'ExamDetailList', name: 'ExamDetailList',
@ -80,7 +79,7 @@ export default {
methods: { methods: {
async getScreenLists() { async getScreenLists() {
const list = await queryPermissionScreen(); const list = await queryPermissionScreen();
this.screenList = list.data; this.screenList = list.data || [];
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
@ -126,10 +125,9 @@ export default {
}); });
} }
this.$nextTick(() => { this.$nextTick(() => { this.loading = false; });
this.loading = false; }).catch(error => {
}); console.log(error);
}).catch(() => {
this.loading = false; this.loading = false;
this.$messageBox(this.$t('error.refreshFailed')); this.$messageBox(this.$t('error.refreshFailed'));
}); });

View File

@ -110,7 +110,7 @@ export default {
price: response.data.price, price: response.data.price,
remarks: response.data.remarks, remarks: response.data.remarks,
detail: response.data.chapters, detail: response.data.chapters,
pmsList: response.data.pmsList, pmsList: response.data.pmsList || [],
prdCode: response.data.prdCode, prdCode: response.data.prdCode,
mapId: response.data.mapId, mapId: response.data.mapId,
skinCode: response.data.skinCode, skinCode: response.data.skinCode,