desc: 修改权限列表显示字段内容,逻辑流程

This commit is contained in:
zyy 2019-09-02 14:43:16 +08:00
parent 4a466e6a8c
commit 0388b2a1df
12 changed files with 66 additions and 116 deletions

3
.gitignore vendored
View File

@ -6,7 +6,8 @@ yarn-debug.log*
yarn-error.log*
package-lock.json
tests/**/coverage/
src/utils/baseUrl*
/src/utils/baseUrl.js
/src/utils/
# Editor directories and files
.idea

View File

@ -144,6 +144,6 @@ export default {
line: '线路:',
permissionList: '权限列表:',
remove: '移除',
append: '添加',
append: '添 加',
release: '发布'
};

View File

@ -119,7 +119,7 @@ export default {
getTotalRemains(model).then(response => {
this.maxTotal = response.data;
if (this.maxTotal == 0) {
this.numberMessage = '';
this.numberMessage = '可用权限数量为0';
} else {
this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`;
}

View File

@ -125,7 +125,7 @@ export default {
getTotalRemains(model).then(response => {
this.maxTotal = response.data;
if (this.maxTotal == 0) {
this.numberMessage = '';
this.numberMessage = '可用权限数量为0';
} else {
this.numberMessage = `${this.$t('global.remainPermissionNumber')}${this.maxTotal}`;
}

View File

@ -51,16 +51,22 @@
<script>
import { getScriptPageListOnline, getScriptById } from '@/api/script';
import { listPublishMap } from '@/api/jmap/map';
import { roleType } from '@/scripts/ConstConfig';
// import { roleType } from '@/scripts/ConstConfig';
export default {
name: 'AddQuest',
props: {
trainings: {
type: Array
type: Array,
default() {
return [];
}
},
detail: {
type: Object
type: Object,
default() {
return null;
}
}
},
data() {
@ -123,15 +129,15 @@ export default {
},
currentModel: {},
roleConfig: {
'Admin': '管理员',
'Instructor': '教员',
'Dispatcher': '行调',
'Attendant': '车站',
'Audience': '观众',
'Driver': '列车',
'no':''
}
roleConfig: {
'Admin': '管理员',
'Instructor': '教员',
'Dispatcher': '行调',
'Attendant': '车站',
'Audience': '观众',
'Driver': '列车',
'no': ''
}
};
},
created() {
@ -161,10 +167,10 @@ export default {
const res = await getScriptById(row.id);
let newMemberList = [];
if (res.code == 200) {
if(res.data.memberVOList && res.data.memberVOList.length > 0) {
newMemberList = res.data.memberVOList.filter(item => item.hasPlay === true);
}
this.memberList = newMemberList?newMemberList : [];
if (res.data.memberVOList && res.data.memberVOList.length > 0) {
newMemberList = res.data.memberVOList.filter(item => item.hasPlay === true);
}
this.memberList = newMemberList || [];
this.memberList.unshift({ id: '', name: '无', role: 'no' });
}
this.roleShow = true;
@ -177,10 +183,10 @@ export default {
},
async confirm() {
await this.$store.dispatch('training/over');
await this.$store.dispatch('training/setMapDefaultState');
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
await this.$store.dispatch('training/over');
await this.$store.dispatch('training/setMapDefaultState');
await this.$store.dispatch('map/clearJlmapTrainView');
await this.$store.dispatch('map/setTrainWindowShow', false);
this.$emit('selectQuest', this.row, this.form.role);
this.doClose();
this.roleDoClose();
@ -201,9 +207,9 @@ export default {
}
},
handleName(item){
return this.roleConfig[item.role]?this.roleConfig[item.role]: ''+(item.name?item.name: '');
}
handleName(item) {
return this.roleConfig[item.role]?this.roleConfig[item.role]: ''+(item.name?item.name: '');
}
}
};
</script>

View File

@ -88,7 +88,6 @@ export default {
name: '',
lengthShow: 0,
lengthFact: 0,
color: '',
leftFdCode: '',
leftSdCode: '',
rightFdCode: '',
@ -111,8 +110,7 @@ export default {
lengthShow: 200,
lengthFact: 0,
lfd: '',
rfd: '',
color: '#4e8de6'
rfd: ''
},
skins: [],
makeRules1: {
@ -158,7 +156,7 @@ export default {
'linkList'
]),
form() {
const form = {
return {
labelWidth: '130px',
items: {
code: {
@ -192,10 +190,9 @@ export default {
}
}
};
return form;
},
rules() {
const rules = {
return {
code: [
{ required: true, message: this.$t('rules.selectEquipment'), trigger: 'change' }
],
@ -218,53 +215,39 @@ export default {
{ required: true, message: this.$t('rules.linkSelectName'), trigger: 'blur' }
]
};
//
this.$nextTick(() =>{
this.$refs.dataform &&
this.$refs.dataform.clearValidate();
});
return rules;
},
formMake1() {
const form = {
return {
labelWidth: '120px',
items: [
{ prop: 'lengthShow', label: this.$t('rules.lengthShow'), type: 'number', min: 0, placeholder: 'px' },
{ prop: 'lengthFact', label: this.$t('rules.lengthFact'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
{ prop: 'color', label: this.$t('rules.color'), type: 'color' },
{ prop: 'x', label: this.$t('rules.pointX'), type: 'number', placeholder: 'px' },
{ prop: 'y', label: this.$t('rules.pointY'), type: 'number', placeholder: 'px' }
]
};
return form;
},
formMake2() {
const form = {
return {
labelWidth: '120px',
items: [
{ prop: 'code', label: this.$t('rules.basisLink'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
{ prop: 'direct', label: this.$t('rules.direct'), type: 'radio', border: true, radioList: this.LinkDriectTypeList },
{ prop: 'lengthShow', label: this.$t('rules.lengthShow'), type: 'number', min: 0, placeholder: 'px', isHidden: this.isSd },
{ prop: 'lengthFact', label: this.$t('rules.lengthFact'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
{ prop: 'color', label: this.$t('rules.color'), type: 'color' }
{ prop: 'lengthFact', label: this.$t('rules.lengthFact'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }
]
};
return form;
},
formMake3() {
const form = {
return {
labelWidth: '120px',
items: [
{ prop: 'lfd', label: '左侧正向Link:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
{ prop: 'rfd', label: '右侧正向Link:', type: 'select', optionLabel: 'name', optionValue: 'code', options: this.linkList },
{ prop: 'lengthShow', label: this.$t('rules.lengthShow'), type: 'number', min: 0, placeholder: 'px', isHidden: this.isSd },
{ prop: 'lengthFact', label: this.$t('rules.lengthFact'), type: 'number', min: 0, placeholder: this.$t('tip.meter') },
{ prop: 'color', label: this.$t('rules.color'), type: 'color' }
{ prop: 'lengthFact', label: this.$t('rules.lengthFact'), type: 'number', min: 0, placeholder: this.$t('tip.meter') }
]
};
return form;
},
// link
@ -305,26 +288,9 @@ export default {
this.$nextTick(() => {
this.$refs.dataform.clearValidate();
this.$refs.make.resetFields();
this.activeName = 'first';
if (selected && selected._type.toUpperCase() === 'Link'.toUpperCase()) {
this.editModel.name = selected.name;
this.editModel.code = this.addModel.code = selected.code;
this.editModel.type = selected.type;
this.editModel.lengthShow = Math.sqrt(Math.pow(selected.rp.x - selected.lp.x, 2) + Math.pow(selected.rp.y - selected.lp.y, 2));
this.editModel.lengthFact = selected.lengthFact;
this.editModel.color = selected.color;
this.editModel.leftFdCode = selected.leftFdCode || '';
this.editModel.leftSdCode = selected.leftSdCode || '';
this.editModel.rightFdCode = selected.rightFdCode || '';
this.editModel.rightSdCode = selected.rightSdCode || '';
this.editModel.lp = {
x: selected.lp.x,
y: selected.lp.y
};
this.editModel.rp = {
x: selected.rp.x,
y: selected.rp.y
};
this.activeName = 'first';
Object.assign(this.editModel, selected);
}
});
},
@ -408,7 +374,6 @@ export default {
type: this.addModel.type,
lp: lp,
rp: rp,
color: this.addModel.color ? this.addModel.color : '#4e8de6',
lengthFact: this.addModel.lengthFact,
leftFdCode: leftFdCode,
rightFdCode: rightFdCode
@ -473,7 +438,6 @@ export default {
code: model.code,
name: model.name,
type: model.type,
color: model.color,
lp: model.lp,
rp: model.rp,
lengthFact: model.lengthFact,
@ -497,7 +461,6 @@ export default {
_type: 'Link',
code: this.editModel.code,
name: this.editModel.name,
color: this.editModel.color == '' ? '#4e8de6' : this.editModel.color,
leftFdCode: this.editModel.leftFdCode,
leftSdCode: this.editModel.leftSdCode,
rightFdCode: this.editModel.rightFdCode,

View File

@ -103,7 +103,7 @@ export default {
width: '120',
buttons: [
{
name: this.$t('global.add'),
name: this.$t('global.append'),
handleClick: this.handlePut,
type: '',
showControl: (row) => { return !row.isPut; }
@ -133,9 +133,9 @@ export default {
methods: {
loadInitData() {
this.$Dictionary.permissionType().then(list => {
if (list && list.length) {
this.queryForm.queryObject.type.config.data = list;
}
list.forEach(elem => {
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
});
this.$convertList(list, this.PermissionTypeList, elem => {
return true;
});

View File

@ -1,6 +1,6 @@
<template>
<el-dialog
:title="this.$t('orderAuthor.trainingList')"
title="选择权限"
:visible.sync="show"
top="20px"
width="90%"
@ -65,12 +65,8 @@ export default {
indexShow: true,
columns: [
{
title: '创建时间',
prop: 'createTime'
},
{
title: '创建者',
prop: 'creatorUserName'
title: '权限名称',
prop: 'name'
},
{
title: '是否包权限',
@ -79,10 +75,6 @@ export default {
columnValue: (row) => { return this.$convertField(row.isPackage, this.ruleLists, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: '权限名称',
prop: 'name'
},
{
title: this.$t('orderAuthor.permissionType'),
prop: 'type',
@ -90,6 +82,14 @@ export default {
columnValue: (row) => { return this.$convertField(row.type, this.PermissionTypeList, ['value', 'label']); },
tagType: (row) => { return ''; }
},
{
title: '创建者',
prop: 'creatorUserName'
},
{
title: '创建时间',
prop: 'createTime'
},
{
type: 'button',
title: this.$t('global.operate'),
@ -126,13 +126,12 @@ export default {
},
async loadInitData() {
this.$Dictionary.permissionType().then(list => {
if (list && list.length) {
this.queryForm.queryObject.type.config.data = list;
}
list.forEach(elem => {
this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name });
});
this.$convertList(list, this.PermissionTypeList, elem => {
return true;
});
this.PermissionTypeList.push({ value: undefined, label: this.$t('orderAuthor.permissionPack') });
});
},

View File

@ -281,6 +281,7 @@ export default {
selectGoods(data) {
this.formModel.goodsId = data.id;
this.formModel.goodsName = data.name;
this.formModel.price = data.price;
},
initLoadPage() {
//
@ -415,13 +416,6 @@ export default {
this.$message.info(this.$t('error.cancelled'));
});
},
selectCommodity(data) {
this.goodsList.forEach(v => {
if (v.value == data) {
this.formModel.price = v.price;
}
});
},
buildModel() {
// ,
let orgzId = this.formModel.organizationId;

View File

@ -7,7 +7,7 @@
</template>
<script>
import { superAdmin } from '@/router';
import { admin } from '@/router';
import { listPackagePermission, restorePackagePermission, getPackageQrCode, permissionDistributeUnPackage } from '@/api/management/distribute';
import { UrlConfig } from '@/router/index';
import QrCode from '@/components/QrCode';
@ -149,7 +149,7 @@ export default {
type: 'button',
title: this.$t('global.operate'),
width: this.$i18n.locale == 'en' ? '400': '300',
hide: (row) => { return this.$store.state.user.roles.indexOf(superAdmin) < 0; },
hide: (row) => { return this.$store.state.user.roles.indexOf(admin) < 0; },
buttons: [
{
name: this.$t('orderAuthor.obtainQrCode'),

View File

@ -11,7 +11,6 @@
<script>
import { getPublishMapDetailList } from '@/api/jmap/map';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'PublishMap',
@ -63,20 +62,7 @@ export default {
},
methods: {
loadInitData() {
// this.cityList = [];
// this.$Dictionary.cityType().then(list => {
// this.cityList = list;
// this.cityList.forEach(elem => {
// this.queryForm.queryObject.cityCode.config.data.push({ value: elem.code, label: elem.name });
// });
// }).catch(() => {
// this.$messageBox(this.$t('error.loadingCityListFailed'));
// });
// this.skinCodeList = [];
// getSkinCodeList().then(response => {
// this.skinCodeList = response.data;
// });
},
queryFunction(params) {
return getPublishMapDetailList(params, this.$route.query.code);

View File

@ -53,6 +53,7 @@ export default {
methods: {
doShow(row) {
this.formMdoel.planId = row.id;
this.formMdoel.mapId = '';
this.show = true;
getPublishMapListBySkinCode(row.skinCode).then(resp => {
this.mapList = resp.data;