From d38b3761b81a80d959bf7a4eb9cef4c71a8642e2 Mon Sep 17 00:00:00 2001 From: zyy <1787816799@qq.com> Date: Mon, 2 Sep 2019 17:05:53 +0800 Subject: [PATCH] =?UTF-8?q?desc:=20=E5=AF=B9=E6=8E=A5=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AD=97=E6=AE=B5=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/management/author.js | 9 ++ .../QueryListPage/QueryListPage.vue | 6 +- src/utils/baseUrl.js | 4 +- src/views/components/limits/distribute.vue | 51 +++++----- src/views/components/limits/transfer.vue | 49 +++++----- src/views/components/pay/commit.vue | 17 ++-- src/views/exam/detail/courseDetail.vue | 2 +- .../map/mapdraft/mapedit/mapoperate/link.vue | 41 ++------ .../mapdraft/mapedit/mapoperate/section.vue | 88 ++--------------- src/views/orderauthor/author/detail.vue | 11 --- .../author/draft/choosePermission.vue | 19 +++- src/views/orderauthor/author/draft/edit.vue | 95 +++++++++++++++++++ .../orderauthor/author/draft/ruleForm.vue | 37 +++++++- src/views/orderauthor/author/index.vue | 19 +++- src/views/orderauthor/commodity/index.vue | 2 +- src/views/orderauthor/order/list.vue | 2 +- src/views/orderauthor/permission/Qcode.vue | 1 + .../permission/draft/choosePermission.vue | 4 + src/views/orderauthor/permission/index.vue | 14 ++- src/views/orderauthor/rules/index.vue | 4 +- src/views/teach/detail/index.vue | 2 +- 21 files changed, 276 insertions(+), 201 deletions(-) create mode 100644 src/views/orderauthor/author/draft/edit.vue diff --git a/src/api/management/author.js b/src/api/management/author.js index f1ab5456f..947b9acd0 100644 --- a/src/api/management/author.js +++ b/src/api/management/author.js @@ -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({ diff --git a/src/components/QueryListPage/QueryListPage.vue b/src/components/QueryListPage/QueryListPage.vue index 05f0fbf74..1faf56ee3 100644 --- a/src/components/QueryListPage/QueryListPage.vue +++ b/src/components/QueryListPage/QueryListPage.vue @@ -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) }} + >{{ getTableBtnName(button.name, scope.$index, scope.row) }} @@ -453,6 +452,9 @@ export default { }, currentChoose() { return this.choose; + }, + refresh() { + this.queryList.data = [...this.queryList.data]; } } diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index b49dd28b5..72be3b2f1 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -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 { diff --git a/src/views/components/limits/distribute.vue b/src/views/components/limits/distribute.vue index 0007596d8..0460bb11a 100644 --- a/src/views/components/limits/distribute.vue +++ b/src/views/components/limits/distribute.vue @@ -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 = ''; } diff --git a/src/views/components/limits/transfer.vue b/src/views/components/limits/transfer.vue index 40e1c41af..31034b6e6 100644 --- a/src/views/components/limits/transfer.vue +++ b/src/views/components/limits/transfer.vue @@ -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 = ''; } diff --git a/src/views/components/pay/commit.vue b/src/views/components/pay/commit.vue index 5ecb4e1b6..7cd51ac9e 100644 --- a/src/views/components/pay/commit.vue +++ b/src/views/components/pay/commit.vue @@ -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; + // } } } }, diff --git a/src/views/exam/detail/courseDetail.vue b/src/views/exam/detail/courseDetail.vue index b65f4c333..9f3c3543b 100644 --- a/src/views/exam/detail/courseDetail.vue +++ b/src/views/exam/detail/courseDetail.vue @@ -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() { diff --git a/src/views/map/mapdraft/mapedit/mapoperate/link.vue b/src/views/map/mapdraft/mapedit/mapoperate/link.vue index c1a5b8ca8..eaf3265f3 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/link.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/link.vue @@ -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); diff --git a/src/views/map/mapdraft/mapedit/mapoperate/section.vue b/src/views/map/mapdraft/mapedit/mapoperate/section.vue index 97e13fc71..341724227 100644 --- a/src/views/map/mapdraft/mapedit/mapoperate/section.vue +++ b/src/views/map/mapdraft/mapedit/mapoperate/section.vue @@ -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, diff --git a/src/views/orderauthor/author/detail.vue b/src/views/orderauthor/author/detail.vue index 84e70e698..d7c275023 100644 --- a/src/views/orderauthor/author/detail.vue +++ b/src/views/orderauthor/author/detail.vue @@ -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', diff --git a/src/views/orderauthor/author/draft/choosePermission.vue b/src/views/orderauthor/author/draft/choosePermission.vue index 9fcb8b733..a1ae70c06 100644 --- a/src/views/orderauthor/author/draft/choosePermission.vue +++ b/src/views/orderauthor/author/draft/choosePermission.vue @@ -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(); } } }; diff --git a/src/views/orderauthor/author/draft/edit.vue b/src/views/orderauthor/author/draft/edit.vue new file mode 100644 index 000000000..a0edfc8af --- /dev/null +++ b/src/views/orderauthor/author/draft/edit.vue @@ -0,0 +1,95 @@ + + + diff --git a/src/views/orderauthor/author/draft/ruleForm.vue b/src/views/orderauthor/author/draft/ruleForm.vue index 03aea6439..9b6bfca6d 100644 --- a/src/views/orderauthor/author/draft/ruleForm.vue +++ b/src/views/orderauthor/author/draft/ruleForm.vue @@ -14,6 +14,16 @@ + + + + + 添加权限 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; }); diff --git a/src/views/orderauthor/author/index.vue b/src/views/orderauthor/author/index.vue index 190bab457..08d51b668 100644 --- a/src/views/orderauthor/author/index.vue +++ b/src/views/orderauthor/author/index.vue @@ -1,6 +1,7 @@ @@ -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); } } }; diff --git a/src/views/orderauthor/commodity/index.vue b/src/views/orderauthor/commodity/index.vue index 4255e44fd..367a42643 100644 --- a/src/views/orderauthor/commodity/index.vue +++ b/src/views/orderauthor/commodity/index.vue @@ -75,7 +75,7 @@ export default { tagType: (row) => { switch (row.status) { case '1': return 'success'; - default: return 'danger'; + default: return 'warning'; } } }, diff --git a/src/views/orderauthor/order/list.vue b/src/views/orderauthor/order/list.vue index b2a9f6937..ec6a9418d 100644 --- a/src/views/orderauthor/order/list.vue +++ b/src/views/orderauthor/order/list.vue @@ -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'; } }, { diff --git a/src/views/orderauthor/permission/Qcode.vue b/src/views/orderauthor/permission/Qcode.vue index ec465d922..59ef645d9 100644 --- a/src/views/orderauthor/permission/Qcode.vue +++ b/src/views/orderauthor/permission/Qcode.vue @@ -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}`); diff --git a/src/views/orderauthor/permission/draft/choosePermission.vue b/src/views/orderauthor/permission/draft/choosePermission.vue index f7250cedf..c6756fae3 100644 --- a/src/views/orderauthor/permission/draft/choosePermission.vue +++ b/src/views/orderauthor/permission/draft/choosePermission.vue @@ -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(); } } }; diff --git a/src/views/orderauthor/permission/index.vue b/src/views/orderauthor/permission/index.vue index 1b33a61de..40f620b10 100644 --- a/src/views/orderauthor/permission/index.vue +++ b/src/views/orderauthor/permission/index.vue @@ -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'), diff --git a/src/views/orderauthor/rules/index.vue b/src/views/orderauthor/rules/index.vue index 89b066f7e..dd083ad40 100644 --- a/src/views/orderauthor/rules/index.vue +++ b/src/views/orderauthor/rules/index.vue @@ -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'; } } }, diff --git a/src/views/teach/detail/index.vue b/src/views/teach/detail/index.vue index 6d1b8eab9..6caa5dcd3 100644 --- a/src/views/teach/detail/index.vue +++ b/src/views/teach/detail/index.vue @@ -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() {