diff --git a/src/components/QueryListPage/QueryForm.vue b/src/components/QueryListPage/QueryForm.vue index 83788aa5b..6f4cc8efd 100644 --- a/src/components/QueryListPage/QueryForm.vue +++ b/src/components/QueryListPage/QueryForm.vue @@ -165,8 +165,8 @@ export default { }, beforeQuery: { type: Function, - default() { - return () => {}; + default(val) { + return val; } }, canQuery: { @@ -447,12 +447,12 @@ export default { } // 对所有的数据进行trim操作 for (const item in resultData) { - if (resultData[item].trim) { + if (resultData[item] && resultData[item].trim) { resultData[item] = resultData[item].trim(); } } // 查询前数据处理 - resultData = this.beforeQuery ? this.beforeQuery(resultData) : resultData; + resultData = this.beforeQuery(resultData); return resultData; }, query() { diff --git a/src/components/QueryListPage/QueryListPage.vue b/src/components/QueryListPage/QueryListPage.vue index f72b09be4..02d099aa4 100644 --- a/src/components/QueryListPage/QueryListPage.vue +++ b/src/components/QueryListPage/QueryListPage.vue @@ -44,6 +44,17 @@ show-overflow-tooltip :sortable="column.sortable" /> + + + { - child.attr('invisible', invisible); - }); - } } diff --git a/src/jmap/shape/Train/index.js b/src/jmap/shape/Train/index.js index 822953b63..3f61939d2 100644 --- a/src/jmap/shape/Train/index.js +++ b/src/jmap/shape/Train/index.js @@ -107,10 +107,6 @@ export default class Train extends Group { // 获取设备提示坐标 getShapeTipPoint() { - return { - x: (this.train.shape.x), - y: (this.train.shape.y) - }; } // 恢复颜色状态 @@ -152,6 +148,9 @@ export default class Train extends Group { case 'trainServer': this.trainB && this.trainB.setTextTrainServerColor(item.showColor); break; + case 'trainWindowBorder': + this.trainB && this.trainB.setBodyBoxShape('stroke', item.showColor); + break; default: this.trainB && this.trainB.setTextTrainTargetColor(item.showColor); } @@ -166,6 +165,9 @@ export default class Train extends Group { case 'trainServer': this.trainB && this.trainB.setTextTrainServerColor(this.style.Train.trainStatusStyle.defaultDestinationColor); break; + case 'trainWindowBorder': + this.trainB && this.trainB.setBodyBoxShape('stroke', this.style.Train.trainStatusStyle.defaultDestinationColor); + break; default: this.trainB && this.trainB.setTextTrainTargetColor(this.style.Train.trainStatusStyle.defaultDestinationColor); } diff --git a/src/jmap/theme/beijing_01/menus/utils/menuItemStatus.js b/src/jmap/theme/beijing_01/menus/utils/menuItemStatus.js index 38013b495..66e461a8e 100644 --- a/src/jmap/theme/beijing_01/menus/utils/menuItemStatus.js +++ b/src/jmap/theme/beijing_01/menus/utils/menuItemStatus.js @@ -563,7 +563,6 @@ export function trainMenuFiltration(menuObj) { export function mouseCancelState(selected) { const device = Vue.prototype.$jlmap.getDeviceByCode(selected.code); const instance = (device || {}).instance; - debugger; if (instance && instance.mouseEvent && instance.mouseEvent.mouseout) { device['down'] = false; instance.mouseEvent.mouseout(Vue.prototype.$jlmap.$zr.curEvent); diff --git a/src/jmap/theme/beijing_01/menusPlan/chooseTemplatePlan.vue b/src/jmap/theme/beijing_01/menusPlan/chooseTemplatePlan.vue index 9677b8e13..34fdaf063 100644 --- a/src/jmap/theme/beijing_01/menusPlan/chooseTemplatePlan.vue +++ b/src/jmap/theme/beijing_01/menusPlan/chooseTemplatePlan.vue @@ -1,119 +1,126 @@ \ No newline at end of file + diff --git a/src/jmap/theme/beijing_01/menusPlan/createTodayPlan.vue b/src/jmap/theme/beijing_01/menusPlan/createTodayPlan.vue index 34d738a6d..8f5e78ae4 100644 --- a/src/jmap/theme/beijing_01/menusPlan/createTodayPlan.vue +++ b/src/jmap/theme/beijing_01/menusPlan/createTodayPlan.vue @@ -1,153 +1,160 @@ \ No newline at end of file + diff --git a/src/jmap/theme/chengdu_03/menusPlan/chooseTemplatePlan.vue b/src/jmap/theme/chengdu_03/menusPlan/chooseTemplatePlan.vue index 9677b8e13..c7562251e 100644 --- a/src/jmap/theme/chengdu_03/menusPlan/chooseTemplatePlan.vue +++ b/src/jmap/theme/chengdu_03/menusPlan/chooseTemplatePlan.vue @@ -1,119 +1,126 @@ \ No newline at end of file + diff --git a/src/jmap/theme/chengdu_03/menusPlan/createTodayPlan.vue b/src/jmap/theme/chengdu_03/menusPlan/createTodayPlan.vue index a8df6aadf..66879a4e6 100644 --- a/src/jmap/theme/chengdu_03/menusPlan/createTodayPlan.vue +++ b/src/jmap/theme/chengdu_03/menusPlan/createTodayPlan.vue @@ -59,7 +59,7 @@ export default { prop: 'skinStyle', type: 'tag', columnValue: (row) => { - return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); + return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); }, tagType: (row) => { return 'success'; } } @@ -96,7 +96,7 @@ export default { return runPlanTemplateList(params); }, convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { + if (enumList && converFormat && converFormat.length >= 2) { const value = converFormat[0]; const label = converFormat[1]; for (let i = 0; i < enumList.length; i++) { diff --git a/src/jmap/theme/chengdu_04/menusPlan/chooseTemplatePlan.vue b/src/jmap/theme/chengdu_04/menusPlan/chooseTemplatePlan.vue index 9677b8e13..50055c314 100644 --- a/src/jmap/theme/chengdu_04/menusPlan/chooseTemplatePlan.vue +++ b/src/jmap/theme/chengdu_04/menusPlan/chooseTemplatePlan.vue @@ -1,119 +1,126 @@ \ No newline at end of file + diff --git a/src/jmap/theme/chengdu_04/menusPlan/createTodayPlan.vue b/src/jmap/theme/chengdu_04/menusPlan/createTodayPlan.vue index 34d738a6d..308e5a92f 100644 --- a/src/jmap/theme/chengdu_04/menusPlan/createTodayPlan.vue +++ b/src/jmap/theme/chengdu_04/menusPlan/createTodayPlan.vue @@ -53,7 +53,7 @@ prop: 'skinStyle', type: 'tag', columnValue: (row) => { - return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) + return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, tagType: (row) => { return 'success' } } @@ -89,17 +89,6 @@ } return runPlanTemplateList(params); }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, // 生成每日运行图 handleConfirm() { if (this.$refs && this.$refs.pageRules) { diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/standDetainTrainAll.vue b/src/jmap/theme/fuzhou_01/menus/dialog/standDetainTrainAll.vue index 8f38a0cdd..0b579c057 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/standDetainTrainAll.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/standDetainTrainAll.vue @@ -1,176 +1,191 @@ \ No newline at end of file + this.$store.dispatch('training/next', operate).then(({ valid }) => { + if (valid) { + this.doClose(); + } + }).catch(() => { + this.doClose(); + }); + } + } +}; + diff --git a/src/jmap/theme/fuzhou_01/menus/dialog/trainControl.vue b/src/jmap/theme/fuzhou_01/menus/dialog/trainControl.vue index 75404bf8e..4587aa2a6 100644 --- a/src/jmap/theme/fuzhou_01/menus/dialog/trainControl.vue +++ b/src/jmap/theme/fuzhou_01/menus/dialog/trainControl.vue @@ -52,7 +52,8 @@ import { MapDeviceType, OperationEvent } from '@/scripts/ConstDic'; import { getPublishTrainList } from '@/api/jmap/map'; import ConfirmTrain from './childDialog/confirmTrain'; - import NoticeInfo from './childDialog/childDialog/noticeInfo' + import NoticeInfo from './childDialog/childDialog/noticeInfo'; + import Vue from 'vue'; export default { name: 'TrainControl', @@ -217,8 +218,7 @@ if (!this.dialogShow) { this.operation = operate.operation; } - - let model = (selected || {}).state; + let model = Vue.prototype.$jlmap.mapDevice[selected.code]; this.formModel = { groupNumber: model.groupNumber, tripNumber: model.tripNumber, @@ -421,4 +421,4 @@ } } } - \ No newline at end of file + diff --git a/src/jmap/theme/fuzhou_01/menus/menuStationStand.vue b/src/jmap/theme/fuzhou_01/menus/menuStationStand.vue index 92f8c31d9..abe19ea00 100644 --- a/src/jmap/theme/fuzhou_01/menus/menuStationStand.vue +++ b/src/jmap/theme/fuzhou_01/menus/menuStationStand.vue @@ -1,485 +1,485 @@ diff --git a/src/jmap/theme/fuzhou_01/menusPlan/chooseTemplatePlan.vue b/src/jmap/theme/fuzhou_01/menusPlan/chooseTemplatePlan.vue index 6e763a82a..775a4dbec 100644 --- a/src/jmap/theme/fuzhou_01/menusPlan/chooseTemplatePlan.vue +++ b/src/jmap/theme/fuzhou_01/menusPlan/chooseTemplatePlan.vue @@ -50,7 +50,7 @@ prop: 'skinStyle', type: 'tag', columnValue: (row) => { - return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) + return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, tagType: (row) => { return 'success' } } @@ -86,17 +86,6 @@ } return runPlanTemplateList(params); }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, handleConfirm() { this.doClose(); if (this.$refs && this.$refs.pageRules) { diff --git a/src/jmap/theme/fuzhou_01/menusPlan/createTodayPlan.vue b/src/jmap/theme/fuzhou_01/menusPlan/createTodayPlan.vue index 74103d67c..a877dc5b9 100644 --- a/src/jmap/theme/fuzhou_01/menusPlan/createTodayPlan.vue +++ b/src/jmap/theme/fuzhou_01/menusPlan/createTodayPlan.vue @@ -53,7 +53,7 @@ prop: 'skinStyle', type: 'tag', columnValue: (row) => { - return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) + return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, tagType: (row) => { return 'success' } } @@ -89,17 +89,6 @@ } return runPlanTemplateList(params); }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, // 生成每日运行图 handleConfirm() { if (this.$refs && this.$refs.pageRules) { diff --git a/src/main.js b/src/main.js index ad4f87f48..5e51b8c0a 100644 --- a/src/main.js +++ b/src/main.js @@ -22,9 +22,6 @@ import '@/scripts/GlobalPlugin'; import '@/directives'; import messages from '@/i18n/index'; -// window.THREE = require('@/jlmap3d/main/three.min.js'); -// window.zlib = require('@/jlmap3d/main/inflate.min.js'); - Vue.use(ElementUI); Vue.use(VueI18n); @@ -68,3 +65,39 @@ Vue.prototype.$messageBox = function(msge) { }); } }; + +Vue.prototype.$convertField = function(fieldValue, enumList, converFormat, isList = false) { + const arr = []; + if (enumList && converFormat && converFormat.length >= 2) { + const value = converFormat[0]; + const label = converFormat[1]; + if (isList) { + enumList.forEach((element, i) => { + fieldValue.forEach((v, j) => { + if ('' + fieldValue[j] === '' + enumList[i][value]) { + arr.push(enumList[i][label]); + } + }); + }); + } else { + for (let i = 0; i < enumList.length; i++) { + if ('' + fieldValue === '' + enumList[i][value]) { + return enumList[i][label]; + } + } + } + } + + return isList ? arr: ''; +}; + +Vue.prototype.$convertList = function(FromList, ToList, checktypeFunction) { + if (FromList) { + ToList.length = 0; + FromList.forEach(elem => { + if (checktypeFunction(elem)) { + ToList.push({ value: elem.code, label: elem.name }); + } + }); + } +}; diff --git a/src/router/index.js b/src/router/index.js index 4c304906b..66d4e2510 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -548,7 +548,7 @@ export const asyncRouter = [ component: resolve => require(['@/views/screenMonitor/index'], resolve), name: '大屏系统', meta: { - roles: [admin, userScreen] + roles: [admin, userScreen, user] }, children: [ { diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 604b68dee..16a88202c 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,4 +1,4 @@ -import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin } from '@/router'; +import { asyncRouter, constantRoutes, user, userLesson, userExam, userSimulation, userScreen, userPlan, superAdmin, admin } from '@/router'; import { PermissionType } from '@/utils/PermissionType'; import { UrlConfig } from '@/router/index'; @@ -63,6 +63,9 @@ function convertRouterRoles({ roles, permissionType }) { */ function filterAsyncRouter(asyncRouter, roles, parentsRoles) { return asyncRouter.filter(route => { + if (route.name === '大屏系统' && roles.indexOf(admin)===-1 && roles.indexOf(userScreen) ===-1){ + route.hidden = true; + } if (hasPermission(roles, route, parentsRoles)) { if (route.children && route.children.length) { route.children = filterAsyncRouter(route.children, roles, route.meta ? route.meta.roles : undefined); diff --git a/src/views/display/demon/addQuest.vue b/src/views/display/demon/addQuest.vue index d66c957cc..3e1ff47c3 100644 --- a/src/views/display/demon/addQuest.vue +++ b/src/views/display/demon/addQuest.vue @@ -29,7 +29,7 @@ :key="item.id" :label="item.name" :value="item.id" - :disabled="item.role != 'Dispatcher'" + :disabled="checkDisabled(item.role)" /> @@ -104,7 +104,7 @@ export default { title: '皮肤类型', prop: 'skinCode', type: 'tag', - columnValue: (row) => { return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']); }, + columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); }, tagType: (row) => { return 'success'; } }, { @@ -205,7 +205,19 @@ export default { roleDoClose() { this.$refs['ruleForm'].resetFields(); this.roleShow = false; - } + }, + + checkDisabled(role) { + if(this.$route.query.prdType == '01'){ + return role != 'Attendant'; + } else if (this.$route.query.prdType == '02'){ + return role != 'Dispatcher'; + }else if (this.$route.query.prdType == '04'){ + return role !== 'Driver'; + }else { + return false; + } + } } }; diff --git a/src/views/display/index.vue b/src/views/display/index.vue index 0905fa186..6b87348a4 100644 --- a/src/views/display/index.vue +++ b/src/views/display/index.vue @@ -82,6 +82,7 @@ import { checkLoginLine } from '@/api/login'; import { loadMapData } from '@/utils/loaddata'; // import { handleToken } from '@/utils/auth'; import { EventBus } from '@/scripts/event-bus'; +import Vue from 'vue'; // 三维 import ThreeTest from '@/views/jlmap3d/index'; @@ -445,6 +446,10 @@ export default { const res = await loadQuest(row.id, this.group); if (res && res.code == 200) { this.questId = parseInt(row.id); + if(res.data && res.data.mapLocation) { + let mapLocation={"offsetX":res.data.mapLocation.x,"offsetY":res.data.mapLocation.y,"scaleRate":res.data.mapLocation.scale}; + Vue.prototype.$jlmap.setPosition(mapLocation) + } } if (this.$refs.menuDemon) { diff --git a/src/views/display/menuDemon.vue b/src/views/display/menuDemon.vue index 35ac258b2..026c8f450 100644 --- a/src/views/display/menuDemon.vue +++ b/src/views/display/menuDemon.vue @@ -19,7 +19,6 @@ - @@ -27,7 +26,6 @@ + \ No newline at end of file diff --git a/src/views/display/scriptRecord/roleSection.vue b/src/views/display/scriptRecord/roleSection.vue index a84c1c9ff..c74d24ddd 100644 --- a/src/views/display/scriptRecord/roleSection.vue +++ b/src/views/display/scriptRecord/roleSection.vue @@ -73,10 +73,6 @@ this.loading=false; } }, - mounted(){ - this.memberList=this.$store.state.scriptRecord.memberList; - this.loading=false; - }, methods:{ getDeviceInfo(){ let params = { role:this.memberVO.role}; diff --git a/src/views/display/scriptRecord/targetCondition.vue b/src/views/display/scriptRecord/targetCondition.vue index a37b2fb79..82bcd0ba5 100644 --- a/src/views/display/scriptRecord/targetCondition.vue +++ b/src/views/display/scriptRecord/targetCondition.vue @@ -48,18 +48,6 @@ components:{ DeviceCondition }, - mounted(){ - let data=this.$store.state.scriptRecord.deviceConditionList; - if(data!=undefined) - { - var newData=JSON.parse(JSON.stringify(data).replace(/\"code\"/g,'"isAdded":true,"code"')); - this.deviceConditionList=newData; - } - else - { - this.deviceConditionList=[]; - } - }, methods:{ addQuestAction(){ if(this.isAdding) diff --git a/src/views/display/scriptRecord/taskScript.vue b/src/views/display/scriptRecord/taskScript.vue index 845e99a60..3382c5cf0 100644 --- a/src/views/display/scriptRecord/taskScript.vue +++ b/src/views/display/scriptRecord/taskScript.vue @@ -42,10 +42,6 @@ }, mounted(){ this.rowDrop(); - let script=this.$store.state.scriptRecord.script; - let memeberList=this.$store.state.scriptRecord.memberList; - this.taskScriptList=memeberList; - this.setScriptList(memeberList,script); }, data() { return { diff --git a/src/views/display/tipQuestDetail.vue b/src/views/display/tipQuestDetail.vue deleted file mode 100644 index 61a6d5944..000000000 --- a/src/views/display/tipQuestDetail.vue +++ /dev/null @@ -1,203 +0,0 @@ - - - - diff --git a/src/views/display/tipScriptRecord.vue b/src/views/display/tipScriptRecord.vue index 5869715bc..84bf0ca3f 100644 --- a/src/views/display/tipScriptRecord.vue +++ b/src/views/display/tipScriptRecord.vue @@ -11,31 +11,7 @@
\ No newline at end of file + this.loading = false; + this.dialogVisible = true; + }, + doSave() { + const self = this; + this.$refs.dataform.validateForm(() => { + if (this.isShow) { + this.$confirm('此操作将清空改皮肤下所有操作定义, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + self.create(); + }).catch(() => { }); + } else { + self.create(); + } + }); + }, + create() { + const self = this; + this.loading = true; + addTrainingRulesList(this.formModel.skinStyle, OperationList[this.formModel.skinStyle].list).then(response => { + self.loading = false; + self.$message.success('批量生成操作定义成功'); + self.handleClose(); + self.$emit('reloadTable'); // 刷新列表 + }).catch(error => { + self.loading = false; + self.$message.error('批量生成操作定义失败:' + error.message); + }); + }, + handleClose() { + this.formModel = { + skinStyle: '' + }; + this.$refs.dataform.resetForm(); + this.isShow = false; + this.dialogVisible = false; + } + } +}; + diff --git a/src/views/lesson/trainingRule/addEdit.vue b/src/views/lesson/trainingRule/addEdit.vue index 3e78a82d7..14840cd2e 100644 --- a/src/views/lesson/trainingRule/addEdit.vue +++ b/src/views/lesson/trainingRule/addEdit.vue @@ -1,300 +1,297 @@ \ No newline at end of file + this.loading = true; + putTrainingRulesData(this.formModel).then(response => { + self.loading = false; + self.$message.success('创建操作定义成功'); + self.handleClose(); + self.$emit('reloadTable'); + }).catch(error => { + self.loading = false; + self.$message.error('创建操作定义失败:' + error.message); + }); + }, + handleClose() { + this.formModel = { + trainingName: '', + trainingType: '', + operateType: '', + skinStyle: '', + minDuration: '', + maxDuration: '', + trainingRemark: '' + }; + this.$refs.dataform.resetForm(); + this.dialogVisible = false; + } + } +}; + diff --git a/src/views/lesson/trainingRule/detail/index.vue b/src/views/lesson/trainingRule/detail/index.vue index c3cb09788..9d2bf75e2 100644 --- a/src/views/lesson/trainingRule/detail/index.vue +++ b/src/views/lesson/trainingRule/detail/index.vue @@ -61,7 +61,7 @@ title: '设备类型', prop: 'deviceType', type: 'tag', - columnValue: (row) => { return this.convertField(row.deviceType, this.deviceList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.deviceType, this.deviceList, ['value', 'label']) }, tagType: (row) => { return 'success' } }, { @@ -136,18 +136,6 @@ queryFunction(params) { return getOperateStepDataList(this.dicId, params) }, - // 转义 - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, handleEdit(index, row) { this.$refs.edit.show(row) }, diff --git a/src/views/lesson/trainingRule/list.vue b/src/views/lesson/trainingRule/list.vue index bbe3fbb7f..b4d238593 100644 --- a/src/views/lesson/trainingRule/list.vue +++ b/src/views/lesson/trainingRule/list.vue @@ -72,21 +72,21 @@ title: '皮肤类型', prop: 'skinStyle', type: 'tag', - columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, + columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, tagType: (row) => { return '' } }, { title: '实训类型', prop: 'trainingType', type: 'tag', - columnValue: (row) => { return this.convertField(row.trainingType, this.trainingTypeList, ['code', 'name']) }, + columnValue: (row) => { return this.$convertField(row.trainingType, this.trainingTypeList, ['code', 'name']) }, tagType: (row) => { return 'success' } }, { title: '操作类型', prop: 'operateType', type: 'tag', - columnValue: (row) => { return this.convertField(row.operateType, this.trainingOperateTypeMap[row.trainingType], ['code', 'name']) }, + columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.trainingType], ['code', 'name']) }, tagType: (row) => { return 'success' } }, { @@ -205,17 +205,6 @@ return fieldValue; } }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, // 选择实训类型下的操作类型 暂时不用 typeChoose(form) { this.queryForm.queryObject.operateType.config.data = []; diff --git a/src/views/lesson/trainingmanage/index.vue b/src/views/lesson/trainingmanage/index.vue index af0806625..f76525aaa 100644 --- a/src/views/lesson/trainingmanage/index.vue +++ b/src/views/lesson/trainingmanage/index.vue @@ -1,286 +1,290 @@ \ No newline at end of file + }, + reloadTable() { + this.queryList.reload(); + } + } +}; + diff --git a/src/views/management/dictionary/edit.vue b/src/views/management/dictionary/edit.vue index 6269d09b9..e0c1883dc 100644 --- a/src/views/management/dictionary/edit.vue +++ b/src/views/management/dictionary/edit.vue @@ -1,155 +1,153 @@ \ No newline at end of file +import { create, checkDicCodeExist, getData, update } from '@/api/management/dictionary'; +import { validateCharCode } from '@/utils/validate'; +export default { + name: 'DictionaryEdit', + props: { + type: { + type: String, + required: true + } + }, + data() { + return { + dialogVisible: false, + formModel: { + code: '', + name: '', + status: '1', + remarks: '' + } + }; + }, + computed: { + form() { + const isAdd = this.type === 'ADD'; + const form = { + labelWidth: '60px', + items: [ + { prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd }, + { prop: 'name', label: '名称', type: 'text', required: true }, + { + prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status + }, + { prop: 'remarks', label: '备注', type: 'textarea', required: false } + ] + }; + return form; + }, + rules() { + const crules = { + name: [ + { required: true, message: '请输入名称', trigger: 'blur' }, + { min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + remarks: [ + { max: 50, message: '不能超过 50 个字符', trigger: 'blur' } + ] + }; + if (this.type === 'ADD') { + return Object.assign(crules, { + code: [ + { required: true, message: '请输入编码', trigger: 'blur' }, + { min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }, + { validator: this.validateCode, trigger: 'blur' } + ] + }); + } else { + return crules; + } + }, + title() { + if (this.type === 'ADD') { + return '创建目录'; + } else { + return '编辑目录'; + } + } + }, + methods: { + validateCode(rule, value, callback) { + if (!validateCharCode(value)) { + return callback(new Error('格式不正确,只能是字符/数字/_')); + } else { + checkDicCodeExist(value).then(response => { + if (response.data) { + return callback(new Error('编码已存在')); + } else { + return callback(); + } + }).catch(() => { + return callback(new Error('服务异常')); + }); + } + }, + show(id) { + this.dialogVisible = true; + if (id) { + getData(id).then(response => { + this.formModel = response.data; + this.$refs.dataform.resetForm(); + }); + } + }, + doSave() { + const self = this; + this.$refs.dataform.validateForm(() => { + if (self.type === 'ADD') { + self.create(); + } else { + self.update(); + } + }); + }, + create() { + const self = this; + create(this.formModel).then(response => { + self.$message.success('创建字典目录成功'); + self.handleClose(); + self.$emit('reloadTable'); + }).catch(error => { + self.$message.error('创建字典目录失败:' + error.message); + }); + }, + update() { + const self = this; + update(this.formModel).then(response => { + self.$message.success('更新字典目录成功'); + self.handleClose(); + self.$emit('reloadTable'); + }).catch(error => { + self.$message.error('更新字典目录失败:' + error.message); + }); + }, + handleClose(done) { + this.formModel = { + code: '', + name: '', + status: '1', + remarks: '' + }; + this.$refs.dataform.resetForm(); + if (done) { + done(); + } else { + this.dialogVisible = false; + } + } + } +}; + diff --git a/src/views/management/dictionary/index.vue b/src/views/management/dictionary/index.vue index 76dbbf8f2..b8a97fe48 100644 --- a/src/views/management/dictionary/index.vue +++ b/src/views/management/dictionary/index.vue @@ -1,138 +1,137 @@ \ No newline at end of file + reloadTable() { + this.queryList.reload(); + } + } +}; + diff --git a/src/views/management/dictionaryDetail/edit.vue b/src/views/management/dictionaryDetail/edit.vue index 71b8d69ae..a0a97fc40 100644 --- a/src/views/management/dictionaryDetail/edit.vue +++ b/src/views/management/dictionaryDetail/edit.vue @@ -1,159 +1,157 @@ \ No newline at end of file +import { create, checkDicDetailCodeExist, getData, update } from '@/api/management/dictionaryDetail'; +import { validateCharCode } from '@/utils/validate'; +export default { + name: 'DictionaryDetailEdit', + props: { + type: { + type: String, + required: true + }, + dicId: { + type: String, + required: true + } + }, + data() { + return { + dialogVisible: false, + formModel: { + code: '', + name: '', + status: '1', + remarks: '' + } + }; + }, + computed: { + form() { + const isAdd = this.type === 'ADD'; + const form = { + labelWidth: '60px', + items: [ + { prop: 'code', label: '编码', type: 'text', required: true, disabled: !isAdd }, + { prop: 'name', label: '名称', type: 'text', required: true }, + { + prop: 'status', label: '状态', type: 'select', required: true, options: this.$ConstSelect.Status + }, + { prop: 'remarks', label: '备注', type: 'textarea', required: false } + ] + }; + return form; + }, + rules() { + const crules = { + name: [ + { required: true, message: '请输入名称', trigger: 'blur' }, + { min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' } + ], + status: [ + { required: true, message: '请选择状态', trigger: 'change' } + ], + remarks: [ + { max: 50, message: '不能超过 50 个字符', trigger: 'blur' } + ] + }; + if (this.type === 'ADD') { + return Object.assign(crules, { + code: [ + { required: true, message: '请输入编码', trigger: 'blur' }, + { min: 1, max: 25, message: '长度在 1 到 25 个字符', trigger: 'blur' }, + { validator: this.validateCode, trigger: 'blur' } + ] + }); + } else { + return crules; + } + }, + title() { + if (this.type === 'ADD') { + return '创建明细'; + } else { + return '编辑明细'; + } + } + }, + methods: { + validateCode(rule, value, callback) { + if (!validateCharCode(value)) { + return callback(new Error('格式不正确,只能是字符/数字/_')); + } else { + checkDicDetailCodeExist(this.dicId, value).then(response => { + if (response.data) { + return callback(new Error('编码已存在')); + } else { + return callback(); + } + }).catch(() => { + return callback(new Error('服务异常')); + }); + } + }, + show(id) { + this.dialogVisible = true; + if (id) { + getData(this.dicId, id).then(response => { + this.formModel = response.data; + this.$refs.dataform.resetForm(); + }); + } + }, + doSave() { + const self = this; + this.$refs.dataform.validateForm(() => { + if (self.type === 'ADD') { + self.create(); + } else { + self.update(); + } + }); + }, + create() { + const self = this; + create(this.dicId, this.formModel).then(response => { + self.$message.success('创建字典目录成功'); + self.handleClose(); + self.$emit('reloadTable'); + }).catch(error => { + self.$message.error('创建字典目录失败:' + error.message); + }); + }, + update() { + const self = this; + update(this.dicId, this.formModel).then(response => { + self.$message.success('更新字典目录成功'); + self.handleClose(); + self.$emit('reloadTable'); + }).catch(error => { + self.$message.error('更新字典目录失败:' + error.message); + }); + }, + handleClose(done) { + this.formModel = { + code: '', + name: '', + status: '1', + remarks: '' + }; + this.$refs.dataform.resetForm(); + if (done) { + done(); + } else { + this.dialogVisible = false; + } + } + } +}; + diff --git a/src/views/management/dictionaryDetail/index.vue b/src/views/management/dictionaryDetail/index.vue index 1f8a7da4b..f2264e700 100644 --- a/src/views/management/dictionaryDetail/index.vue +++ b/src/views/management/dictionaryDetail/index.vue @@ -1,161 +1,156 @@ \ No newline at end of file + diff --git a/src/views/management/existingSimulation/index.vue b/src/views/management/existingSimulation/index.vue index c8aeb3bb5..1d750cf6a 100644 --- a/src/views/management/existingSimulation/index.vue +++ b/src/views/management/existingSimulation/index.vue @@ -1,206 +1,194 @@ diff --git a/src/views/management/userControl/index.vue b/src/views/management/userControl/index.vue index 52a885670..35aab7498 100644 --- a/src/views/management/userControl/index.vue +++ b/src/views/management/userControl/index.vue @@ -1,146 +1,129 @@ \ No newline at end of file + reloadTable() { + this.queryList.reload(); + } + } +}; + diff --git a/src/views/management/userExam/index.vue b/src/views/management/userExam/index.vue index df01a323c..0ac192522 100644 --- a/src/views/management/userExam/index.vue +++ b/src/views/management/userExam/index.vue @@ -57,7 +57,7 @@ title: '考试结果', prop: 'result', type: 'tag', - columnValue: (row) => { return this.convertField(row.result, this.$ConstSelect.examResultList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.result, this.$ConstSelect.examResultList, ['value', 'label']) }, tagType: (row) => { switch (row.result) { case '01': return 'warning'; @@ -108,17 +108,6 @@ loadInitData() { }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, // 编辑 edit(index, row) { diff --git a/src/views/management/userSimulation/index.vue b/src/views/management/userSimulation/index.vue index fdfe4c0cc..973d62059 100644 --- a/src/views/management/userSimulation/index.vue +++ b/src/views/management/userSimulation/index.vue @@ -129,17 +129,6 @@ } } }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, // 编辑 edit(index, row) { diff --git a/src/views/management/userTraining/add.vue b/src/views/management/userTraining/add.vue index 70e600f1a..d943c6e29 100644 --- a/src/views/management/userTraining/add.vue +++ b/src/views/management/userTraining/add.vue @@ -1,186 +1,184 @@ \ No newline at end of file +export default { + name: 'UsersTrainingAdd', + components: { + AddTraining + }, + props: { + type: { + type: String, + required: true + } + }, + data() { + return { + dialogVisible: false, + formModel: { + lessonId: '', + trainingId: '', + trainingName: '', + userId: '', + userName: '', + duration: '' + }, + LessonList: [], + UserList: [], + UserLoading: false + }; + }, + computed: { + form() { + this.type === 'ADD'; + const form = { + labelWidth: '100px', + items: [ + { prop: 'lessonId', label: '课程名称', type: 'select', required: true, options: this.LessonList }, + { prop: 'trainingName', label: '实训名称', type: 'text', required: true, rightWidth: true, disabled: true, buttontip: '选择实训', buttonClick: this.buttonClick, placeholder: '请选择实训' }, + { prop: 'userName', label: '用户名称', type: 'complete', required: false, querySearchAsync: this.querySearchAsync, handleSelect: this.prdSelect, placeholder: '请输入昵称/名字/手机号' }, + { prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' } + ] + }; + return form; + }, + rules() { + const crules = { + lessonId: [ + { required: true, message: '请输入教学名称', trigger: 'change' } + ], + trainingName: [ + { required: true, message: '请选择实训', trigger: 'change' } + ], + userName: [ + { required: true, message: '请输入用户名称', trigger: 'change' } + ], + duration: [ + { required: true, message: '请输入时长', trigger: 'blur' } + ] + }; + return crules; + }, + title() { + return '创建用户实训'; + } + }, + mounted() { + this.initLoadPage(); + }, + methods: { + initLoadPage() { + // 加载发布课程列表 + this.LessonList.length = 0; + this.UserList.length = 0; + getPublishLessonList().then(response => { + const data = response.data; + if (data && data.length) { + data.forEach(elem => { + this.LessonList.push({ value: elem.id, label: elem.name }); + }); + } + }); + }, + // 搜索查询input + async querySearchAsync(queryString, cb) { + // 根据queryString 查询用户 并显示 + const results = []; + if (queryString) { + try { + const params = { + fuzzyParam: queryString + }; + const res = await getDimUserList(params); + const list = res.data; + list.forEach(item => { + const value = { + id: item.id, + value: `${item.nickname}(${item.name})${item.mobile}` + }; + results.push(value); + }); + cb(results); + } catch (error) { + console.error(error, '查询用户list'); + cb(results); + } + } else { + cb(results); + } + }, + prdSelect(item) { + this.formModel.userId = item.id; + }, + selectTrain(data) { + this.formModel.trainingId = data.id; + this.formModel.trainingName = data.name; + }, + buttonClick() { + if (this.formModel.lessonId) { + this.$refs.addTraining.show(this.formModel.lessonId); + } else { + this.$message.error('请先选择课程名称'); + } + }, + show(data) { + this.dialogVisible = true; + // this.formModel = { + // lessonId: '', + // trainingId: '', + // trainingName: '', + // userId: '', + // userName: '', + // duration: '', + // }; + }, + doSave() { + const self = this; + this.$refs.dataform.validateForm(() => { + self.save(); + }); + }, + save() { + const self = this; + if (this.formModel.userId) { + addUserTraining(this.formModel).then(response => { + self.$message.success('创建成功!'); + self.handleClose(); + self.$emit('reloadTable'); + }).catch(error => { + self.$message.error('创建失败!' + error.message); + }); + } else { + self.$message.error('请选择用户'); + } + }, + handleClose(done) { + this.formModel = { + lessonId: '', + trainingId: '', + trainingName: '', + userId: '', + userName: '', + duration: '' + }; + this.dialogVisible = false; + } + } +}; + diff --git a/src/views/management/userTraining/addTraining.vue b/src/views/management/userTraining/addTraining.vue index 4d41fa0e3..fb7d44382 100644 --- a/src/views/management/userTraining/addTraining.vue +++ b/src/views/management/userTraining/addTraining.vue @@ -1,92 +1,98 @@ \ No newline at end of file + }, + mounted() { + }, + methods: { + clickEvent(data) { + if (data.trainingSelect) { + this.training = { + name: data.name, + id: data.id + }; + this.disabled = false; + } else { + this.disabled = true; + } + }, + async show(lessonId) { + this.dialogVisibles = true; + try { + const res = await getPublishLessonDetail({ id: lessonId }); + this.treeData[0].children = res.data.chapters; + this.treeData[0].name = res.data.name; + this.treeData[0].children.forEach(ele => { + ele.children = ele.trainingVos; + ele.children.forEach(item => { + item.trainingSelect = true; + }); + }); + } catch (error) { + console.error(error); + } + }, + doSave() { + this.$emit('selectTrain', this.training); + this.handleClose(); + }, + handleClose() { + this.treeData = [{ + children: [], + name: '' + }]; + this.trainingId = ''; + this.training = {}; + this.dialogVisibles = false; + } + } +}; + diff --git a/src/views/management/userTraining/edit.vue b/src/views/management/userTraining/edit.vue index cc72d67bb..ed229affe 100644 --- a/src/views/management/userTraining/edit.vue +++ b/src/views/management/userTraining/edit.vue @@ -1,108 +1,106 @@ \ No newline at end of file +import { putUserTraining } from '@/api/jmap/training'; +export default { + name: 'UsersTrainingEdit', + props: { + type: { + type: String, + required: true + } + }, + data() { + return { + dialogVisible: false, + formModel: { + id: '', + lessonName: '', + userName: '', + trainingName: '', + duration: '' + // trainingCount: '', + } + }; + }, + computed: { + form() { + this.type === 'ADD'; + const form = { + labelWidth: '100px', + items: [ + { prop: 'lessonName', label: '教学名称', type: 'text', required: false, disabled: true }, + { prop: 'trainingName', label: '实训名称', type: 'text', required: true, disabled: true }, + { prop: 'userName', label: '用户名称', type: 'text', required: true, disabled: true }, + { prop: 'duration', label: '实训时长', type: 'text', required: true, rightWidth: true, message: 's' } + ] + }; + return form; + }, + rules() { + const crules = { + duration: [ + { required: true, message: '请输入时长', trigger: 'blur' } + ] + }; + return crules; + }, + title() { + return '编辑实训详情'; + } + }, + methods: { + show(data) { + this.dialogVisible = true; + if (data && data.id) { + this.formModel = { + id: data.id, + lessonName: data.lessonName, + userName: data.userName, + trainingName: data.trainingName, + duration: data.duration + // trainingCount: data.trainingCount + }; + } + }, + doSave() { + const self = this; + this.$refs.dataform.validateForm(() => { + self.update(); + }); + }, + update() { + const self = this; + const param = { + id: this.formModel.id, + duration: this.formModel.duration + }; + putUserTraining(param).then(response => { + self.$message.success('修改成功!'); + self.handleClose(); + self.$emit('reloadTable'); + }).catch(error => { + self.$message.error('修改失败!' + error.message); + }); + }, + handleClose(done) { + this.formModel = { + id: '', + lessonName: '', + userName: '', + trainingName: '', + duration: '' + }; + this.dialogVisible = false; + } + } +}; + diff --git a/src/views/management/userTraining/index.vue b/src/views/management/userTraining/index.vue index 0f49e384b..39fac325b 100644 --- a/src/views/management/userTraining/index.vue +++ b/src/views/management/userTraining/index.vue @@ -1,146 +1,144 @@ \ No newline at end of file + reloadTable() { + this.queryList.reload(); + } + } +}; + diff --git a/src/views/map/product/list.vue b/src/views/map/product/list.vue index 9511579a8..b511c460f 100644 --- a/src/views/map/product/list.vue +++ b/src/views/map/product/list.vue @@ -52,7 +52,7 @@ title: '皮肤类型', prop: 'skinStyle', type: 'tag', - columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, + columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']) }, tagType: (row) => { return '' } }, { @@ -114,19 +114,6 @@ this.skinStyleList = response.data; }) }, - - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, - // 添加 handleAdd() { this.$router.push({ path: `${UrlConfig.map.productDraft}/add/0` }); diff --git a/src/views/map/skinStyle/draft.vue b/src/views/map/skinStyle/draft.vue index 4b44a09c9..315191738 100644 --- a/src/views/map/skinStyle/draft.vue +++ b/src/views/map/skinStyle/draft.vue @@ -152,16 +152,6 @@ resizeHandler: function () { this.height = this._clientHeight - 130; }, - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, initLoadPage() { //加载发布课程列表 this.display = 1; diff --git a/src/views/map/skinStyle/index.vue b/src/views/map/skinStyle/index.vue index 8107c76b0..6f4b8fec1 100644 --- a/src/views/map/skinStyle/index.vue +++ b/src/views/map/skinStyle/index.vue @@ -115,17 +115,6 @@ this.skinStyleList = response.data; }) }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, handleAdd() { this.$router.push(`${UrlConfig.map.skinStyleDraft}/add/null`); }, diff --git a/src/views/orderauthor/author/detail.vue b/src/views/orderauthor/author/detail.vue index f52ff9ab9..efad0dfc7 100644 --- a/src/views/orderauthor/author/detail.vue +++ b/src/views/orderauthor/author/detail.vue @@ -1,97 +1,91 @@ \ No newline at end of file +export default { + name: 'AuthorDetail', + data() { + return { + dialogVisible: false, + formModel: { + source: '', + userMobile: '', + userName: '' + }, + formOrderModel: { + source: '', + order: '' + }, + PermissionTypeList: [], + orderType: '', + order: '' + }; + }, + computed: { + form() { + const form = { + labelWidth: '100px', + items: [ + { prop: 'source', label: '来源', type: 'text', disabled: true }, + { prop: 'name', label: '分发用户', type: 'text', disabled: true }, + { prop: 'mobile', label: '用户手机号', type: 'text', disabled: true } + ] + }; + return form; + }, + formOrder() { + const form = { + labelWidth: '100px', + items: [ + { prop: 'source', label: '来源', type: 'text', disabled: true }, + { prop: 'order', label: '订单号', type: 'text', disabled: true } + ] + }; + return form; + }, + title() { + return '来源信息'; + } + }, + mounted() { + }, + methods: { + show(data) { + this.dialogVisible = true; + if (typeof data == 'object') { + this.orderType = false; + this.formModel = { + source: '权限分发', + mobile: data.mobile, + name: data.name + }; + } else { + this.orderType = true; + this.formOrderModel = { + source: '订单创建', + order: data + }; + } + }, + handleClose(done) { + this.formModel = { + source: '', + userMobile: '', + userName: '' + }; + this.dialogVisible = false; + } + } +}; + diff --git a/src/views/orderauthor/author/draft.vue b/src/views/orderauthor/author/draft.vue index f405f26fb..d826d7710 100644 --- a/src/views/orderauthor/author/draft.vue +++ b/src/views/orderauthor/author/draft.vue @@ -1,192 +1,191 @@ \ No newline at end of file + diff --git a/src/views/orderauthor/author/index.vue b/src/views/orderauthor/author/index.vue index 8f79cbb1f..3092fc010 100644 --- a/src/views/orderauthor/author/index.vue +++ b/src/views/orderauthor/author/index.vue @@ -76,7 +76,7 @@ title: '权限类型', prop: 'type', type: 'tag', - 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 '' } }, { @@ -128,7 +128,7 @@ title: '课程权限状态', prop: 'status', type: 'tag', - columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, tagType: (row) => { switch (row.status) { case '1': return 'success'; @@ -183,30 +183,9 @@ this.loadInitData(); }, methods: { - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, loadInitData() { this.$Dictionary.effectiveType().then(list => { - this.convertList(list, this.EffectiveTypeList, elem => { + this.$convertList(list, this.EffectiveTypeList, elem => { return true; }); }); @@ -214,7 +193,7 @@ list.forEach(elem => { this.queryForm.queryObject.type.config.data.push({ value: elem.code, label: elem.name }); }); - this.convertList(list, this.PermissionTypeList, elem => { + this.$convertList(list, this.PermissionTypeList, elem => { return true; }); }); diff --git a/src/views/orderauthor/commodity/draft.vue b/src/views/orderauthor/commodity/draft.vue index 672d1284f..1f830175a 100644 --- a/src/views/orderauthor/commodity/draft.vue +++ b/src/views/orderauthor/commodity/draft.vue @@ -190,16 +190,6 @@ resizeHandler: function () { this.height = this._clientHeight - 170; }, - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, async initLoadPage() { // 加载字典数据 // 加载地图,产品,课程 @@ -218,7 +208,7 @@ } // 产品类型 this.$Dictionary.productType().then(list => { - this.convertList(list, this.productTypeList, elem => { + this.$convertList(list, this.productTypeList, elem => { return true; }); }); @@ -226,7 +216,7 @@ // 时间类型 this.TimeStyleDict = {}; this.$Dictionary.timeStyleType().then(list => { - this.convertList(list, this.TimeStyleList, elem => { + this.$convertList(list, this.TimeStyleList, elem => { return true; }); list.forEach(elem => { diff --git a/src/views/orderauthor/commodity/index.vue b/src/views/orderauthor/commodity/index.vue index a3fd4f582..913c29417 100644 --- a/src/views/orderauthor/commodity/index.vue +++ b/src/views/orderauthor/commodity/index.vue @@ -64,7 +64,7 @@ title: '产品类型', prop: 'productType', type: 'tag', - columnValue: (row) => { return this.convertField(row.productType, this.productTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']) }, tagType: (row) => { return 'success' } }, { @@ -87,7 +87,7 @@ title: '状态', prop: 'status', type: 'tag', - columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, tagType: (row) => { switch (row.status) { case '1': return 'success'; @@ -149,19 +149,9 @@ this.loadInitData(); }, methods: { - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, async loadInitData() { this.$Dictionary.effectiveType().then(list => { - this.convertList(list, this.EffectiveTypeList, elem => { + this.$convertList(list, this.EffectiveTypeList, elem => { return true; }); }); @@ -170,7 +160,7 @@ list.forEach(elem => { this.queryForm.queryObject.productType.config.data.push({ value: elem.code, label: elem.name }); }); - this.convertList(list, this.productTypeList, elem => { + this.$convertList(list, this.productTypeList, elem => { return true; }); }); @@ -184,17 +174,6 @@ console.error(error, '获取发布地图'); } }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, handleEdit(index, row) { this.$router.push({ path: `${UrlConfig.orderauthor.commodityDraft}/edit/${row.id}` }); }, diff --git a/src/views/orderauthor/order/addGoods.vue b/src/views/orderauthor/order/addGoods.vue index e6aeb70f9..3b784f069 100644 --- a/src/views/orderauthor/order/addGoods.vue +++ b/src/views/orderauthor/order/addGoods.vue @@ -78,7 +78,7 @@ title: '产品类型', prop: 'productType', type: 'tag', - columnValue: (row) => { return this.convertField(row.productType, this.productTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.productType, this.productTypeList, ['value', 'label']) }, tagType: (row) => { return 'success' } }, { @@ -101,7 +101,7 @@ title: '状态', prop: 'status', type: 'tag', - columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, tagType: (row) => { switch (row.status) { case '1': return 'success'; @@ -148,19 +148,9 @@ doClose() { this.show = false; }, - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, async loadInitData() { this.$Dictionary.effectiveType().then(list => { - this.convertList(list, this.EffectiveTypeList, elem => { + this.$convertList(list, this.EffectiveTypeList, elem => { return true; }); }); @@ -169,7 +159,7 @@ list.forEach(elem => { this.queryForm.queryObject.productType.config.data.push({ value: elem.code, label: elem.name }); }); - this.convertList(list, this.productTypeList, elem => { + this.$convertList(list, this.productTypeList, elem => { return true; }); }); @@ -184,19 +174,6 @@ } }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, - - handleAdd(index, row) { this.$emit('selectGoods', row); this.doClose(); diff --git a/src/views/orderauthor/order/draft.vue b/src/views/orderauthor/order/draft.vue index 84d81cd0e..5a6baddb4 100644 --- a/src/views/orderauthor/order/draft.vue +++ b/src/views/orderauthor/order/draft.vue @@ -280,16 +280,6 @@ resizeHandler: function () { this.height = this._clientHeight - 170; }, - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, buttonClick() { this.$refs.addGoods.doShow(); }, @@ -328,31 +318,31 @@ }) this.$Dictionary.permissionType().then(list => { - this.convertList(list, this.PermissionTypeList, elem => { + this.$convertList(list, this.PermissionTypeList, elem => { return true; }); }); this.$Dictionary.orderType().then(list => { - this.convertList(list, this.OrderTypeList, elem => { + this.$convertList(list, this.OrderTypeList, elem => { return elem.code !== '01' //过滤个人 }); }); this.$Dictionary.payStatus().then(list => { - this.convertList(list, this.PayStatusTypeList, elem => { + this.$convertList(list, this.PayStatusTypeList, elem => { return elem.code !== '03' //过滤取消状态 }); }); this.$Dictionary.payType().then(list => { - this.convertList(list, this.PayTypeList, elem => { + this.$convertList(list, this.PayTypeList, elem => { return true }); }); this.$Dictionary.bizType().then(list => { - this.convertList(list, this.BizTypeList, elem => { + this.$convertList(list, this.BizTypeList, elem => { return true; }); }); diff --git a/src/views/orderauthor/order/list.vue b/src/views/orderauthor/order/list.vue index bffb1fefc..87e4e288e 100644 --- a/src/views/orderauthor/order/list.vue +++ b/src/views/orderauthor/order/list.vue @@ -86,7 +86,7 @@ title: '权限类型', prop: 'permissionType', 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 '' } }, { @@ -120,7 +120,7 @@ title: '支付方式', prop: 'payWays', type: 'tag', - columnValue: (row) => { return this.convertField(row.payWays, this.PayTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.payWays, this.PayTypeList, ['value', 'label']) }, tagType: (row) => { return 'success' } }, { @@ -131,7 +131,7 @@ title: '订单类型', prop: 'orderType', type: 'tag', - columnValue: (row) => { return this.convertField(row.orderType, this.OrderTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.orderType, this.OrderTypeList, ['value', 'label']) }, tagType: (row) => { return 'success' } }, { @@ -142,14 +142,14 @@ title: '业务类型', prop: 'bizType', type: 'tag', - columnValue: (row) => { return this.convertField(row.bizType, this.BizTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.bizType, this.BizTypeList, ['value', 'label']) }, tagType: (row) => { return 'success' } }, { title: '支付状态', prop: 'payStatus', type: 'tag', - columnValue: (row) => { return this.convertField(row.payStatus, this.PayStatusList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.payStatus, this.PayStatusList, ['value', 'label']) }, tagType: (row) => { switch (row.payStatus) { case '01': return 'danger'; @@ -199,27 +199,6 @@ this.loadInitData(); }, methods: { - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, loadInitData() { this.queryForm.queryObject.organizationId.config.data.length = 0; getOrganizationList().then(response => { @@ -234,32 +213,32 @@ }) this.$Dictionary.bizType().then(list => { - this.convertList(list, this.BizTypeList, elem => { + this.$convertList(list, this.BizTypeList, elem => { return true; }); }) this.$Dictionary.orderType().then(list => { - this.convertList(list, this.OrderTypeList, elem => { + this.$convertList(list, this.OrderTypeList, elem => { return true; }); }) this.$Dictionary.payType().then(list => { - this.convertList(list, this.PayTypeList, elem => { + this.$convertList(list, this.PayTypeList, elem => { return true; }); }) this.$Dictionary.payStatus().then(list => { - this.convertList(list, this.PayStatusList, elem => { + this.$convertList(list, this.PayStatusList, elem => { return true; }); }) this.$Dictionary.effectiveType().then(list => { - this.convertList(list, this.EffectiveTypeList, elem => { + this.$convertList(list, this.EffectiveTypeList, elem => { return true; }); }) @@ -268,7 +247,7 @@ list.forEach(elem => { 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; }); }) diff --git a/src/views/orderauthor/permission/detail.vue b/src/views/orderauthor/permission/detail.vue index 4e700b695..eb82f1dc4 100644 --- a/src/views/orderauthor/permission/detail.vue +++ b/src/views/orderauthor/permission/detail.vue @@ -74,7 +74,7 @@ title: '权限类型', prop: 'permissionType', 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 '' } }, { @@ -118,7 +118,7 @@ title: '课程权限状态', prop: 'status', type: 'tag', - columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, tagType: (row) => { switch (row.status) { case '1': return 'success'; @@ -134,30 +134,9 @@ this.loadInitData(); }, methods: { - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, loadInitData() { this.$Dictionary.effectiveType().then(list => { - this.convertList(list, this.EffectiveTypeList, elem => { + this.$convertList(list, this.EffectiveTypeList, elem => { return true; }); }); @@ -165,7 +144,7 @@ list.forEach(elem => { 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; }); }); diff --git a/src/views/orderauthor/permission/draft/choosePermission.vue b/src/views/orderauthor/permission/draft/choosePermission.vue index f21da73c8..442760807 100644 --- a/src/views/orderauthor/permission/draft/choosePermission.vue +++ b/src/views/orderauthor/permission/draft/choosePermission.vue @@ -84,7 +84,7 @@ title: '权限类型', prop: 'permissionType', 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 '' } }, { @@ -171,17 +171,6 @@ this.queryForm.queryObject.canDistribute.config.data = this.$ConstSelect.PermissionUseList; }, methods: { - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, formatterDate(row, porpInfo) { return String(row[porpInfo.property] || '').split(' ')[0]; }, diff --git a/src/views/orderauthor/permission/index.vue b/src/views/orderauthor/permission/index.vue index 5fddddc02..6747d1727 100644 --- a/src/views/orderauthor/permission/index.vue +++ b/src/views/orderauthor/permission/index.vue @@ -87,7 +87,7 @@ title: '权限类型', prop: 'permissionType', 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 '' } }, { @@ -131,7 +131,7 @@ title: '权限状态', prop: 'status', type: 'tag', - columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, tagType: (row) => { switch (row.status) { case '1': return 'success'; @@ -183,33 +183,12 @@ this.loadInitData(); }, methods: { - convertList(FromList, ToList, ChecktypeFunction) { - if (FromList) { - ToList.length = 0; - FromList.forEach(elem => { - if (ChecktypeFunction(elem)) { - ToList.push({ value: elem.code, label: elem.name }); - } - }); - } - }, - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, 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 => { + this.$convertList(list, this.EffectiveTypeList, elem => { return true; }); }); @@ -217,7 +196,7 @@ list.forEach(elem => { 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; }); this.PermissionTypeList.push({ value: undefined, label: '权限包' }); diff --git a/src/views/package/index.vue b/src/views/package/index.vue index 58aaaa229..cd233c674 100644 --- a/src/views/package/index.vue +++ b/src/views/package/index.vue @@ -1,232 +1,220 @@ \ No newline at end of file + this.$Dictionary.permissionType().then(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; + }); + }); + }, + formatterDate(row, porpInfo) { + if (row.hasOwnProperty(porpInfo.property)) { + } + return row[porpInfo.property]; + }, + queryFunction(params) { + return listUserPermision(params); + }, + handlePermissionPack() { + this.$router.push({ path: `${UrlConfig.permission.permissionDraft}` }); + }, + reloadTable() { + if (this.queryList && this.queryList.reload) { + this.queryList.reload(); + } + } + } +}; + diff --git a/src/views/package/selectRole/list.vue b/src/views/package/selectRole/list.vue index 1f5dd4da3..22968e4ce 100644 --- a/src/views/package/selectRole/list.vue +++ b/src/views/package/selectRole/list.vue @@ -82,21 +82,6 @@ doClose() { this.show = false; }, - convertField(fieldValue, enumList, converFormat) { - let arr = []; - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - enumList.forEach((element, i) => { - fieldValue.forEach((v, j) => { - if ('' + fieldValue[j] === '' + enumList[i][value]) { - arr.push(enumList[i][label]) - } - }) - }); - } - return arr; - }, selectRole(index, row) { this.$confirm(`是否确定设置"${row.name}"为权限所属人`, '提示', { diff --git a/src/views/publish/examRule/index.vue b/src/views/publish/examRule/index.vue index 9003e642f..503f3346a 100644 --- a/src/views/publish/examRule/index.vue +++ b/src/views/publish/examRule/index.vue @@ -74,7 +74,7 @@ export default { prop: 'lessonId', type: 'tag', show: !this.$route.query.lessonId, - columnValue: (row) => { return this.convertField(row.lessonId, this.OrganizationList, ['id', 'name']); }, + columnValue: (row) => { return this.$convertField(row.lessonId, this.OrganizationList, ['id', 'name']); }, tagType: (row) => { return ''; } }, { @@ -122,7 +122,7 @@ export default { title: '状态', prop: 'status', type: 'tag', - columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']); }, + columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']); }, tagType: (row) => { switch (row.status) { case '1': return 'success'; @@ -214,7 +214,7 @@ export default { }); this.$Dictionary.effectiveType().then(list => { - this.convertList(list, this.EffectiveTypeList, elem => { + this.$convertList(list, this.EffectiveTypeList, elem => { return true; }); }); diff --git a/src/views/publish/productStatus/index.vue b/src/views/publish/productStatus/index.vue index ce957c932..b56d00796 100644 --- a/src/views/publish/productStatus/index.vue +++ b/src/views/publish/productStatus/index.vue @@ -46,7 +46,7 @@ export default { title: '皮肤类型', prop: 'skinStyle', type: 'tag', - columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); }, + columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); }, tagType: (row) => { return ''; } }, { @@ -57,7 +57,7 @@ export default { title: '产品类型', prop: 'prdType', type: 'tag', - columnValue: (row) => { return this.convertField(row.prdType, this.prdTypeList, ['code', 'name']); }, + columnValue: (row) => { return this.$convertField(row.prdType, this.prdTypeList, ['code', 'name']); }, tagType: (row) => { return 'success'; } }, // { diff --git a/src/views/publish/publishLesson/index.vue b/src/views/publish/publishLesson/index.vue index 68b5a081e..4e74613e8 100644 --- a/src/views/publish/publishLesson/index.vue +++ b/src/views/publish/publishLesson/index.vue @@ -50,7 +50,7 @@ export default { title: '所属城市', prop: 'cityCode', type: 'tag', - columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']); }, + columnValue: (row) => { return this.$convertField(row.cityCode, this.cityList, ['code', 'name']); }, tagType: (row) => { return 'success'; } }, { diff --git a/src/views/publish/publishMap/index.vue b/src/views/publish/publishMap/index.vue index 404d6f49f..962d25a1b 100644 --- a/src/views/publish/publishMap/index.vue +++ b/src/views/publish/publishMap/index.vue @@ -51,14 +51,14 @@ export default { title: '所属城市', prop: 'cityCode', type: 'tag', - columnValue: (row) => { return this.convertField(row.cityCode, this.cityList, ['code', 'name']); }, + columnValue: (row) => { return this.$convertField(row.cityCode, this.cityList, ['code', 'name']); }, tagType: (row) => { return 'success'; } }, { title: '皮肤类型', prop: 'skinStyle', type: 'tag', - columnValue: (row) => { return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); }, + columnValue: (row) => { return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); }, tagType: (row) => { return ''; } }, { diff --git a/src/views/publish/runPlanCommon/chooseTemplatePlan.vue b/src/views/publish/runPlanCommon/chooseTemplatePlan.vue index a3ddefb8d..3ca3e6381 100644 --- a/src/views/publish/runPlanCommon/chooseTemplatePlan.vue +++ b/src/views/publish/runPlanCommon/chooseTemplatePlan.vue @@ -56,7 +56,7 @@ export default { prop: 'skinStyle', type: 'tag', columnValue: (row) => { - return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); + return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); }, tagType: (row) => { return 'success'; } } diff --git a/src/views/publish/runPlanEveryDay/index.vue b/src/views/publish/runPlanEveryDay/index.vue index 4b745dfbe..d19cfee76 100644 --- a/src/views/publish/runPlanEveryDay/index.vue +++ b/src/views/publish/runPlanEveryDay/index.vue @@ -50,7 +50,7 @@ export default { prop: 'skinStyle', type: 'tag', columnValue: (row) => { - return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); + return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); }, tagType: (row) => { return ''; } }, diff --git a/src/views/publish/runPlanTemplate/index.vue b/src/views/publish/runPlanTemplate/index.vue index ad12f7303..0d0a0f7c7 100644 --- a/src/views/publish/runPlanTemplate/index.vue +++ b/src/views/publish/runPlanTemplate/index.vue @@ -50,7 +50,7 @@ export default { prop: 'skinStyle', type: 'tag', columnValue: (row) => { - return this.convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); + return this.$convertField(row.skinStyle, this.skinStyleList, ['code', 'name']); }, tagType: (row) => { return ''; } }, diff --git a/src/views/publish/simulationScript/index.vue b/src/views/publish/simulationScript/index.vue index c4edae593..4a8742ba4 100644 --- a/src/views/publish/simulationScript/index.vue +++ b/src/views/publish/simulationScript/index.vue @@ -45,7 +45,7 @@ export default { prop: 'skinCode', type: 'tag', columnValue: (row) => { - return this.convertField(row.skinCode, this.skinCodeList, ['code', 'name']); + return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); }, tagType: (row) => { return ''; } }, diff --git a/src/views/replay/index.vue b/src/views/replay/index.vue index a3c198692..4544ea318 100644 --- a/src/views/replay/index.vue +++ b/src/views/replay/index.vue @@ -54,7 +54,7 @@ title: '状态', prop: 'status', type: 'tag', - columnValue: (row) => { return this.convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, + columnValue: (row) => { return this.$convertField(row.status, this.EffectiveTypeList, ['value', 'label']) }, tagType: (row) => { switch (row.status) { case '1': return 'success'; @@ -97,17 +97,6 @@ } }, methods: { - convertField(fieldValue, enumList, converFormat) { - if (converFormat && converFormat.length >= 2) { - let value = converFormat[0]; - let label = converFormat[1]; - for (let i = 0; enumList && i < enumList.length; i++) { - if ('' + fieldValue === '' + enumList[i][value]) { - return enumList[i][label]; - } - } - } - }, loadInitData() { this.EffectiveTypeList = []; this.$Dictionary.effectiveType().then(list => {