desc: 对接权限编辑接口,修改显示字段内容
This commit is contained in:
parent
0388b2a1df
commit
d38b3761b8
@ -27,6 +27,15 @@ export function getPermissonDetail(id) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 修改权限*/
|
||||
export function putPermissonDetail(data) {
|
||||
return request({
|
||||
url: `/api/permission/${data.id}`,
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/** 获取用户某课程某段时间内可用的权限数量*/
|
||||
export function getTotalRemains(params) {
|
||||
return request({
|
||||
|
@ -117,8 +117,7 @@
|
||||
:type="button.type ? button.type : 'primary'"
|
||||
:disabled="isTableBtnDisabled(button, scope.$index, scope.row)"
|
||||
@click="button.handleClick(scope.$index, scope.row) "
|
||||
>{{ getTableBtnName(button.name,
|
||||
scope.$index, scope.row) }}</el-button>
|
||||
>{{ getTableBtnName(button.name, scope.$index, scope.row) }}</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@ -453,6 +452,9 @@ export default {
|
||||
},
|
||||
currentChoose() {
|
||||
return this.choose;
|
||||
},
|
||||
refresh() {
|
||||
this.queryList.data = [...this.queryList.data];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@ export function getBaseUrl() {
|
||||
let BASE_API;
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
// BASE_API = 'https://joylink.club/jlcloud';
|
||||
BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
// BASE_API = 'http://192.168.9.255:9000'; // 袁琪
|
||||
// BASE_API = 'https://test.joylink.club/jlcloud';
|
||||
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
|
||||
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
|
||||
// BASE_API = 'http://192.168.3.4:9000' // 琰培
|
||||
} else {
|
||||
|
@ -102,31 +102,34 @@ export default {
|
||||
}
|
||||
this.maxTotal = 0;
|
||||
if (endTime && startTime) {
|
||||
const model = {
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
permissionType: this.PermissionType
|
||||
};
|
||||
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
|
||||
model['lessonId'] = this.formModel.lessonId;
|
||||
model['mapId'] = this.mapId;
|
||||
model['prdCode'] = this.prdCode;
|
||||
} else if (this.PermissionType == PermissionType.SIMULATION) {
|
||||
model['mapId'] = this.mapId;
|
||||
model['prdCode'] = this.prdCode;
|
||||
}
|
||||
// 获取用户某课程某段时间内可用的权限数量
|
||||
getTotalRemains(model).then(response => {
|
||||
this.maxTotal = response.data;
|
||||
if (this.maxTotal == 0) {
|
||||
this.numberMessage = '可用权限数量为0';
|
||||
} else {
|
||||
this.numberMessage = `(${this.$t('global.remainPermissionNumber')}:${this.maxTotal})`;
|
||||
if (endTime > startTime) {
|
||||
const model = {
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
permissionType: this.PermissionType
|
||||
};
|
||||
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
|
||||
model['lessonId'] = this.formModel.lessonId;
|
||||
model['mapId'] = this.mapId;
|
||||
model['prdCode'] = this.prdCode;
|
||||
} else if (this.PermissionType == PermissionType.SIMULATION) {
|
||||
model['mapId'] = this.mapId;
|
||||
model['prdCode'] = this.prdCode;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
|
||||
});
|
||||
|
||||
// 获取用户某课程某段时间内可用的权限数量
|
||||
getTotalRemains(model).then(response => {
|
||||
this.maxTotal = response.data;
|
||||
if (this.maxTotal == 0) {
|
||||
this.numberMessage = '可用权限数量为0';
|
||||
} else {
|
||||
this.numberMessage = `(${this.$t('global.remainPermissionNumber')}:${this.maxTotal})`;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
|
||||
});
|
||||
} else {
|
||||
this.numberMessage = '结束时间必须大于开始时间';
|
||||
}
|
||||
} else {
|
||||
this.numberMessage = '';
|
||||
}
|
||||
|
@ -109,30 +109,33 @@ export default {
|
||||
}
|
||||
this.maxTotal = 0;
|
||||
if (endTime && startTime) {
|
||||
const model = {
|
||||
startTime: `${startTime} 00:00:00`,
|
||||
endTime: `${endTime} 23:59:59`,
|
||||
permissionType: this.PermissionType
|
||||
};
|
||||
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
|
||||
model['lessonId'] = this.formModel.lessonId;
|
||||
model['mapId'] = this.mapId;
|
||||
model['prdCode'] = this.prdCode;
|
||||
} else if (this.PermissionType == PermissionType.SIMULATION) {
|
||||
model['mapId'] = this.mapId;
|
||||
model['prdCode'] = this.prdCode;
|
||||
}
|
||||
getTotalRemains(model).then(response => {
|
||||
this.maxTotal = response.data;
|
||||
if (this.maxTotal == 0) {
|
||||
this.numberMessage = '可用权限数量为0';
|
||||
} else {
|
||||
this.numberMessage = `(${this.$t('global.remainPermissionNumber')}:${this.maxTotal})`;
|
||||
if (endTime > startTime) {
|
||||
const model = {
|
||||
startTime: `${startTime} 00:00:00`,
|
||||
endTime: `${endTime} 23:59:59`,
|
||||
permissionType: this.PermissionType
|
||||
};
|
||||
if (this.PermissionType == PermissionType.LESSON || this.PermissionType == PermissionType.EXAM) {
|
||||
model['lessonId'] = this.formModel.lessonId;
|
||||
model['mapId'] = this.mapId;
|
||||
model['prdCode'] = this.prdCode;
|
||||
} else if (this.PermissionType == PermissionType.SIMULATION) {
|
||||
model['mapId'] = this.mapId;
|
||||
model['prdCode'] = this.prdCode;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
|
||||
});
|
||||
|
||||
getTotalRemains(model).then(response => {
|
||||
this.maxTotal = response.data;
|
||||
if (this.maxTotal == 0) {
|
||||
this.numberMessage = '可用权限数量为0';
|
||||
} else {
|
||||
this.numberMessage = `(${this.$t('global.remainPermissionNumber')}:${this.maxTotal})`;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('error.obtainMaxNumberFailed'));
|
||||
});
|
||||
} else {
|
||||
this.numberMessage = '结束时间必须大于开始时间';
|
||||
}
|
||||
} else {
|
||||
this.numberMessage = '';
|
||||
}
|
||||
|
@ -149,14 +149,15 @@ export default {
|
||||
if (val) {
|
||||
this.saleModel.price = val.price;
|
||||
this.saleModel.goodsId = val.id;
|
||||
if (this.$route.query.permissionType == PermissionType.LESSON ||
|
||||
this.$route.query.permissionType == PermissionType.EXAM) {
|
||||
this.saleModel.name = val.lessonName;
|
||||
} else if (this.$route.query.permissionType == PermissionType.SCREEN) {
|
||||
this.saleModel.name = val.name;
|
||||
} else {
|
||||
this.saleModel.name = val.prdName;
|
||||
}
|
||||
this.saleModel.name = val.name;
|
||||
// if (this.$route.query.permissionType == PermissionType.LESSON ||
|
||||
// this.$route.query.permissionType == PermissionType.EXAM) {
|
||||
// this.saleModel.name = val.name;
|
||||
// } else if (this.$route.query.permissionType == PermissionType.SCREEN) {
|
||||
// this.saleModel.name = val.name;
|
||||
// } else {
|
||||
// this.saleModel.name = val.prdName;
|
||||
// }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -121,7 +121,7 @@ export default {
|
||||
this.loading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.exam.pay}/${this.$route.params.lessonId}`,
|
||||
query: { permissionType: PermissionType.EXAM, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
|
||||
query: { permissionType: PermissionType.EXAM, lessonId: this.$route.params.lessonId, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
|
||||
});
|
||||
},
|
||||
checkCourse() {
|
||||
|
@ -306,6 +306,7 @@ export default {
|
||||
const x = this.addModel.x;
|
||||
const y = this.addModel.y;
|
||||
var model = {
|
||||
_type: 'Link',
|
||||
code: uid,
|
||||
name: uname,
|
||||
type: this.addModel.type,
|
||||
@ -320,7 +321,7 @@ export default {
|
||||
lengthFact: this.addModel.lengthFact,
|
||||
color: this.addModel.color ? this.addModel.color : '#4e8de6'
|
||||
};
|
||||
edits.push(this.createLinkModel(model));
|
||||
edits.push(model);
|
||||
}
|
||||
this.$emit('addOrUpdateMapModel', edits);
|
||||
}
|
||||
@ -369,6 +370,7 @@ export default {
|
||||
edits.push(baseLink);
|
||||
}
|
||||
const model = {
|
||||
_type: 'Link',
|
||||
code: uid,
|
||||
name: uname,
|
||||
type: this.addModel.type,
|
||||
@ -378,7 +380,7 @@ export default {
|
||||
leftFdCode: leftFdCode,
|
||||
rightFdCode: rightFdCode
|
||||
};
|
||||
edits.push(this.createLinkModel(model));
|
||||
edits.push(model);
|
||||
}
|
||||
}
|
||||
this.$emit('addOrUpdateMapModel', edits);
|
||||
@ -397,6 +399,7 @@ export default {
|
||||
var rnode = this.findLinkData(this.addModel.rfd);
|
||||
if (lnode && rnode) {
|
||||
const model = {
|
||||
_type: 'Link',
|
||||
code: uid,
|
||||
name: uname,
|
||||
type: this.addModel.type,
|
||||
@ -425,50 +428,22 @@ export default {
|
||||
edits.push(lnode);
|
||||
edits.push(rnode);
|
||||
}
|
||||
edits.push(this.createLinkModel(model));
|
||||
edits.push(model);
|
||||
}
|
||||
}
|
||||
this.$emit('addOrUpdateMapModel', edits);
|
||||
}
|
||||
});
|
||||
},
|
||||
createLinkModel(model) {
|
||||
const link = {
|
||||
_type: 'Link',
|
||||
code: model.code,
|
||||
name: model.name,
|
||||
type: model.type,
|
||||
lp: model.lp,
|
||||
rp: model.rp,
|
||||
lengthFact: model.lengthFact,
|
||||
leftFdCode: model.leftFdCode || '',
|
||||
leftSdCode: model.leftSdCode || '',
|
||||
rightFdCode: model.rightFdCode || '',
|
||||
rightSdCode: model.rightSdCode || ''
|
||||
};
|
||||
return link;
|
||||
},
|
||||
// 修改对象
|
||||
edit() {
|
||||
this.$refs['dataform'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.$emit('addOrUpdateMapModel', this.buildEditModel());
|
||||
const model = Object.assign({_type: 'Link'}, this.editModel);
|
||||
this.$emit('addOrUpdateMapModel', model);
|
||||
}
|
||||
});
|
||||
},
|
||||
buildEditModel() {
|
||||
const model = {
|
||||
_type: 'Link',
|
||||
code: this.editModel.code,
|
||||
name: this.editModel.name,
|
||||
leftFdCode: this.editModel.leftFdCode,
|
||||
leftSdCode: this.editModel.leftSdCode,
|
||||
rightFdCode: this.editModel.rightFdCode,
|
||||
rightSdCode: this.editModel.rightSdCode,
|
||||
lengthFact: this.editModel.lengthFact
|
||||
};
|
||||
return model;
|
||||
},
|
||||
// 删除对象
|
||||
deleteObj() {
|
||||
const selected = this.$store.getters['map/getDeviceByCode'](this.editModel.code);
|
||||
|
@ -183,7 +183,7 @@ export default {
|
||||
destinationCodePoint: { x: 0, y: 0 }, // 目的地码坐标
|
||||
destinationCodeShow: false, // 是否显示目的地码
|
||||
axleShow: false,
|
||||
namePoint: { x: 0, y: 0 },
|
||||
namePosition: { x: 0, y: 0 },
|
||||
kmRangeRight: 0,
|
||||
kmRangeLeft: 0,
|
||||
region: '',
|
||||
@ -214,10 +214,6 @@ export default {
|
||||
points: [],
|
||||
isCurve: false
|
||||
},
|
||||
editRuleModel: {
|
||||
// trainType: '01',
|
||||
pointY: 0
|
||||
},
|
||||
tableData: [],
|
||||
addModel: {
|
||||
code: '',
|
||||
@ -278,9 +274,9 @@ export default {
|
||||
item: [
|
||||
{ prop: 'code', label: this.$t('map.blockCoding'), type: 'select', mode: false, optionLabel: 'name&&code', optionValue: 'code', options: this.sectionList, change: true, deviceChange: this.deviceChange },
|
||||
{ prop: 'name', label: this.$t('map.sectionNameColon'), type: 'input' },
|
||||
{ prop: 'namePoint', label: this.$t('map.sectionNameOffset'), type: 'coordinate', width: '150px', children: [
|
||||
{ prop: 'namePoint.x', firstLevel: 'namePoint', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
||||
{ prop: 'namePoint.y', firstLevel: 'namePoint', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
||||
{ prop: 'namePosition', label: this.$t('map.sectionNameOffset'), type: 'coordinate', width: '150px', children: [
|
||||
{ prop: 'namePosition.x', firstLevel: 'namePosition', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px' },
|
||||
{ prop: 'namePosition.y', firstLevel: 'namePosition', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px' }
|
||||
] },
|
||||
{ prop: 'type', label: this.$t('map.sectionType'), type: 'select', optionLabel: 'name', optionValue: 'code', options: this.SectionTypeList, disabled: true },
|
||||
{ prop: 'linkCode', label: this.$t('map.relevanceLinkCode'), type: 'select', optionLabel: 'name&&code', optionValue: 'code', options: this.linkList, disabled: true, isHidden: !this.isSectionType },
|
||||
@ -383,10 +379,10 @@ export default {
|
||||
'destinationCodePoint.y': [
|
||||
{ required: true, message: this.$t('rules.destinationCodePointY'), trigger: 'blur' }
|
||||
],
|
||||
'namePoint.x': [
|
||||
'namePosition.x': [
|
||||
{ required: true, message: this.$t('rules.sectionNamePointX'), trigger: 'blur' }
|
||||
],
|
||||
'namePoint.y': [
|
||||
'namePosition.y': [
|
||||
{ required: true, message: this.$t('rules.sectionNamePointY'), trigger: 'blur' }
|
||||
],
|
||||
logicSectionNameSort: [
|
||||
@ -547,76 +543,12 @@ export default {
|
||||
this.$refs.dataform.clearValidate();
|
||||
this.activeName = 'first';
|
||||
if (selected && selected._type.toUpperCase() === 'Section'.toUpperCase()) {
|
||||
this.editModel.code = selected.code;
|
||||
this.editModel.name = selected.name;
|
||||
this.editModel.type = selected.type;
|
||||
this.editModel.namePoint = {
|
||||
x: selected.namePosition.x,
|
||||
y: selected.namePosition.y
|
||||
};
|
||||
this.editModel.axleShow = selected.axleShow;
|
||||
this.editModel.relStandCode = selected.relStandCode;
|
||||
this.editModel.leftStopPointOffset = selected.leftStopPointOffset;
|
||||
this.editModel.rightStopPointOffset = selected.rightStopPointOffset;
|
||||
this.editModel.destinationCode = selected.destinationCode;
|
||||
if (selected.destinationCodePoint) {
|
||||
this.editModel.destinationCodePoint = {
|
||||
x: selected.destinationCodePoint.x,
|
||||
y: selected.destinationCodePoint.y
|
||||
};
|
||||
}
|
||||
this.editModel.kmRangeRight = selected.kmRangeRight;
|
||||
this.editModel.kmRangeLeft = selected.kmRangeLeft;
|
||||
this.editModel.region = selected.region;
|
||||
|
||||
this.editModel.destinationCodeShow = selected.destinationCodeShow;
|
||||
|
||||
Object.assign(this.editModel, selected);
|
||||
this.editModel.logicSectionNum = selected.type === '01' ? selected.logicSectionNum : [0];
|
||||
this.editModel.logicSectionShow = selected.logicSectionShow;
|
||||
this.editModel.isStandTrack = selected.isStandTrack;
|
||||
this.editModel.standTrackName = selected.standTrackName;
|
||||
this.editModel.standTrackNamePosition = {
|
||||
x: selected.standTrackNamePosition.x,
|
||||
y: selected.standTrackNamePosition.y
|
||||
};
|
||||
this.editModel.isReentryTrack = selected.isReentryTrack;
|
||||
this.editModel.reentryTrackName = selected.reentryTrackName;
|
||||
this.editModel.reentryTrackNamePosition = {
|
||||
x: selected.reentryTrackNamePosition.x,
|
||||
y: selected.reentryTrackNamePosition.y
|
||||
};
|
||||
this.editModel.isTransferTrack = selected.isTransferTrack;
|
||||
this.editModel.transferTrackName = selected.transferTrackName;
|
||||
this.editModel.transferTrackNamePosition = {
|
||||
x: selected.transferTrackNamePosition.x,
|
||||
y: selected.transferTrackNamePosition.y
|
||||
};
|
||||
this.editModel.isSegmentation = selected.isSegmentation || false;
|
||||
if (selected.segmentationPosition) {
|
||||
this.editModel.segmentationPosition = {
|
||||
x: selected.segmentationPosition.x,
|
||||
y: selected.segmentationPosition.y
|
||||
};
|
||||
} else {
|
||||
this.editModel.segmentationPosition = { x: 0, y: 0 };
|
||||
}
|
||||
|
||||
this.editModel.logicSectionNameSort = selected.logicSectionNameSort;
|
||||
this.editModel.isSwitchSection = selected.isSwitchSection;
|
||||
this.editModel.relSwitchCode = selected.relSwitchCode;
|
||||
this.editModel.linkCode = selected.linkCode;
|
||||
this.editModel.sepTypeLeft = selected.sepTypeLeft;
|
||||
this.editModel.offsetLeft = selected.offsetLeft;
|
||||
this.editModel.sepTypeRight = selected.sepTypeRight;
|
||||
this.editModel.offsetRight = selected.offsetRight;
|
||||
this.editModel.stationCode = selected.stationCode;
|
||||
this.editModel.trainPosType = selected.trainPosType;
|
||||
this.editModel.parentCode = selected.parentCode;
|
||||
this.editModel.points = selected.points.slice();
|
||||
this.editModel.isCurve = selected.isCurve;
|
||||
|
||||
this.addModel.splitOffsetMax = Math.sqrt(new JTriangle(selected.points[0], selected.points[selected.points.length - 1]).abspowz);
|
||||
this.addModel.splitOffset = this.addModel.splitOffsetMax / 2;
|
||||
|
||||
this.computedLogicSectionNumList(this.editModel.logicSectionNum);
|
||||
|
||||
if (this.field.toUpperCase() === 'splitSection'.toUpperCase()) {
|
||||
@ -869,8 +801,8 @@ export default {
|
||||
rightStopPointOffset: Number(this.editModel.rightStopPointOffset),
|
||||
axleShow: this.editModel.axleShow,
|
||||
namePosition: {
|
||||
x: this.editModel.namePoint.x,
|
||||
y: this.editModel.namePoint.y
|
||||
x: this.editModel.namePosition.x,
|
||||
y: this.editModel.namePosition.y
|
||||
},
|
||||
kmRangeRight: this.editModel.kmRangeRight,
|
||||
kmRangeLeft: this.editModel.kmRangeLeft,
|
||||
|
@ -19,10 +19,6 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
PermissionTypeList: [],
|
||||
ruleList: [
|
||||
{ value: true, label: '是' },
|
||||
{ value: false, label: '否' }
|
||||
],
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
@ -43,13 +39,6 @@ export default {
|
||||
title: '权限名称',
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '是否包权限',
|
||||
prop: 'isPackage',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$convertField(row.isPackage, this.ruleList, ['value', 'label']); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
title: this.$t('orderAuthor.permissionType'),
|
||||
prop: 'type',
|
||||
|
@ -38,6 +38,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mapId: '',
|
||||
PermissionTypeList: [],
|
||||
ruleLists: [
|
||||
{ value: true, label: '是' },
|
||||
@ -126,6 +127,10 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
// ruleList(list) {
|
||||
// console.log(list, 1111);
|
||||
// this.reloadTable();
|
||||
// }
|
||||
},
|
||||
mounted() {
|
||||
this.loadInitData();
|
||||
@ -139,7 +144,7 @@ export default {
|
||||
this.$convertList(list, this.PermissionTypeList, elem => {
|
||||
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) {
|
||||
@ -147,15 +152,17 @@ export default {
|
||||
},
|
||||
async queryFunction(params) {
|
||||
params['isPackage'] = false;
|
||||
params['mapId'] = this.mapId;
|
||||
const resp = await getLessonPermissonPageList(params);
|
||||
this.ruleList.forEach(elem => {
|
||||
resp.data.list.forEach(item => {
|
||||
if (item.id == elem.id) {
|
||||
item.isPut = true;
|
||||
} else {
|
||||
item.isPut = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return resp;
|
||||
},
|
||||
reloadTable() {
|
||||
@ -163,17 +170,23 @@ export default {
|
||||
this.queryList.reload();
|
||||
}
|
||||
},
|
||||
doShow() {
|
||||
doShow(mapId) {
|
||||
this.mapId = mapId;
|
||||
this.show = true;
|
||||
this.reloadTable();
|
||||
},
|
||||
doClose() {
|
||||
this.show = false;
|
||||
},
|
||||
handlePut(index, row) {
|
||||
row.isPut = true;
|
||||
this.$emit('addRuleForm', index, row);
|
||||
this.$refs.queryListPage.refresh();
|
||||
},
|
||||
handlePop(index, row) {
|
||||
row.isPut = false;
|
||||
this.$emit('deleteForm', index, row);
|
||||
this.$refs.queryListPage.refresh();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
95
src/views/orderauthor/author/draft/edit.vue
Normal file
95
src/views/orderauthor/author/draft/edit.vue
Normal file
@ -0,0 +1,95 @@
|
||||
<template>
|
||||
<el-dialog title="修改权限内容" :visible.sync="dialogShow" width="30%" :before-close="handleClose">
|
||||
<div>
|
||||
<el-form
|
||||
ref="form"
|
||||
label-position="right"
|
||||
:model="editModel"
|
||||
label-width="100px"
|
||||
:rules="editRules"
|
||||
size="mini"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item :label="$t('map.mapName')" prop="name">
|
||||
<el-input v-model="editModel.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="remarks">
|
||||
<el-input
|
||||
v-model="editModel.remarks"
|
||||
type="textarea"
|
||||
:rows="2"
|
||||
placeholder="请输入内容"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogShow = false">{{ $t('map.cancel') }}</el-button>
|
||||
<el-button type="primary" :loading="loading" @click="saveAs">{{ $t('map.confirm') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { putPermissonDetail } from '@/api/management/author';
|
||||
|
||||
export default {
|
||||
name: 'MapSaveAs',
|
||||
props: {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
editModel: {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
},
|
||||
editRules: {
|
||||
name: [
|
||||
{ required: true, message: this.$t('rules.pleaseEnterMapName'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
doShow(data) {
|
||||
this.dialogShow = true;
|
||||
this.editModel = {
|
||||
id: data.id,
|
||||
name: data.name,
|
||||
remarks: data.remarks
|
||||
};
|
||||
},
|
||||
close() {
|
||||
this.editModel = {
|
||||
id: '',
|
||||
name: '',
|
||||
remarks: ''
|
||||
};
|
||||
this.dialogShow = false;
|
||||
},
|
||||
handleClose() {
|
||||
this.close();
|
||||
},
|
||||
saveAs() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
this.loading = true;
|
||||
putPermissonDetail(this.editModel).then(response => {
|
||||
this.loading = false;
|
||||
this.$emit('refresh');
|
||||
this.close();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('map.saveFailed'));
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -14,6 +14,16 @@
|
||||
<el-form-item label="是否包权限:">
|
||||
<el-checkbox v-model="addModel.isPackage" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地图名称:">
|
||||
<el-select v-model="addModel.mapId">
|
||||
<el-option
|
||||
v-for="item in mapList"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-button class="addList" size="small" @click="dialogSelect">添加权限</el-button>
|
||||
<el-table
|
||||
@ -60,6 +70,7 @@
|
||||
<script>
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import { createLessonPermisson } from '@/api/management/author';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import WindowResizeHandler from '@/mixin/WindowResizeHandler';
|
||||
import ChoosePermission from './choosePermission';
|
||||
import { EventBus } from '@/scripts/event-bus';
|
||||
@ -79,7 +90,8 @@ export default {
|
||||
height: 0,
|
||||
addModel: {
|
||||
name: '',
|
||||
isPackage: true
|
||||
isPackage: true,
|
||||
mapId: ''
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
@ -89,7 +101,8 @@ export default {
|
||||
urlInfo: {},
|
||||
ruleList: [],
|
||||
EffectiveTypeList: [],
|
||||
PermissionTypeList: []
|
||||
PermissionTypeList: [],
|
||||
mapList: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@ -111,7 +124,7 @@ export default {
|
||||
});
|
||||
return name;
|
||||
},
|
||||
loadInitData() {
|
||||
async loadInitData() {
|
||||
this.EffectiveTypeList = [];
|
||||
this.$Dictionary.effectiveType().then(list => {
|
||||
this.EffectiveTypeList = list.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
@ -121,9 +134,25 @@ export default {
|
||||
this.$Dictionary.permissionType().then(list => {
|
||||
this.PermissionTypeList = list.map(elem => { return { value: elem.code, label: elem.name }; });
|
||||
});
|
||||
|
||||
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, '获取发布地图');
|
||||
}
|
||||
},
|
||||
dialogSelect(row) {
|
||||
this.$refs.choosePermission.doShow();
|
||||
if (this.addModel.mapId) {
|
||||
this.$refs.choosePermission.doShow(this.addModel.mapId);
|
||||
} else {
|
||||
this.$messageBox('请选择地图');
|
||||
}
|
||||
},
|
||||
deleteForm(index, row) {
|
||||
const idx = this.ruleList.findIndex(elem => { return elem.id == row.id; });
|
||||
|
@ -1,6 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<edit ref="edit" @refresh="reloadTable" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -8,10 +9,12 @@
|
||||
import { getLessonPermissonPageList } from '@/api/management/author';
|
||||
import { listPublishMap } from '@/api/jmap/map';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import Edit from './draft/edit';
|
||||
|
||||
export default {
|
||||
name: 'Author',
|
||||
components: {
|
||||
Edit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -97,15 +100,20 @@ export default {
|
||||
title: '创建者',
|
||||
prop: 'creatorUserName'
|
||||
},
|
||||
// {
|
||||
// title: '更新者',
|
||||
// prop: 'updateUserName'
|
||||
// },
|
||||
{
|
||||
title: '描述',
|
||||
prop: 'remarks'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '250',
|
||||
buttons: [
|
||||
{
|
||||
name: '编辑',
|
||||
handleClick: this.handleEdit,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '打包详情',
|
||||
handleClick: this.handleRulesDetail,
|
||||
@ -160,6 +168,9 @@ export default {
|
||||
},
|
||||
handleAdd() {
|
||||
this.$router.push({ path: `${UrlConfig.orderauthor.authorMange}/rules` });
|
||||
},
|
||||
handleEdit(index, row) {
|
||||
this.$refs.edit.doShow(row);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -75,7 +75,7 @@ export default {
|
||||
tagType: (row) => {
|
||||
switch (row.status) {
|
||||
case '1': return 'success';
|
||||
default: return 'danger';
|
||||
default: return 'warning';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -94,7 +94,7 @@ export default {
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.forever, 'Whether'); },
|
||||
tagType: (row) => {
|
||||
return row.forever ? 'success' : 'danger';
|
||||
return row.forever ? 'success' : 'warning';
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -30,6 +30,7 @@ export default {
|
||||
if (this.input) {
|
||||
try {
|
||||
await getPermission(`${this.input}`);
|
||||
this.$message.success('领取权限成功');
|
||||
this.centerDialogVisible = false;
|
||||
} catch (error) {
|
||||
this.$messageBox(`${this.$t('error.scanningError')}:${error.message}`);
|
||||
|
@ -215,10 +215,14 @@ export default {
|
||||
this.show = false;
|
||||
},
|
||||
handlePut(index, row) {
|
||||
row.isPut = true;
|
||||
this.$emit('addRuleForm', index, row);
|
||||
this.$refs.queryListPage.refresh();
|
||||
},
|
||||
handlePop(index, row) {
|
||||
row.isPut = false;
|
||||
this.$emit('deleteForm', index, row);
|
||||
this.$refs.queryListPage.refresh();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -104,7 +104,7 @@ export default {
|
||||
tagType: (row) => {
|
||||
switch (row.canDistribute) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
case false: return 'warning';
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -116,10 +116,18 @@ export default {
|
||||
tagType: (row) => {
|
||||
switch (row.forever) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
case false: return 'warning';
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '总数量',
|
||||
prop: 'amount'
|
||||
},
|
||||
{
|
||||
title: '剩余数量',
|
||||
prop: 'remains'
|
||||
},
|
||||
{
|
||||
title: this.$t('orderAuthor.startTime'),
|
||||
prop: 'startTime',
|
||||
@ -155,7 +163,7 @@ export default {
|
||||
name: this.$t('orderAuthor.obtainQrCode'),
|
||||
handleClick: this.handleRtCodeShow,
|
||||
type: '',
|
||||
showControl: (row) => { return true; }
|
||||
showControl: (row) => { return row.status == '1'; }
|
||||
},
|
||||
{
|
||||
name: this.$t('orderAuthor.authorityDetails'),
|
||||
|
@ -67,7 +67,7 @@ export default {
|
||||
tagType: (row) => {
|
||||
switch (row.canDistribute) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
case false: return 'warning';
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -79,7 +79,7 @@ export default {
|
||||
tagType: (row) => {
|
||||
switch (row.forever) {
|
||||
case true: return 'success';
|
||||
case false: return 'danger';
|
||||
case false: return 'warning';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -125,7 +125,7 @@ export default {
|
||||
this.loading = true;
|
||||
this.$router.push({
|
||||
path: `${UrlConfig.teach.pay}/${this.$route.params.lessonId}`,
|
||||
query: { permissionType: PermissionType.LESSON, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
|
||||
query: { permissionType: PermissionType.LESSON, lessonId: this.$route.params.lessonId, prdCode: this.courseModel.prdCode, mapId: this.courseModel.mapId }
|
||||
});
|
||||
},
|
||||
transfer() {
|
||||
|
Loading…
Reference in New Issue
Block a user