# Conflicts:
#	src/views/designPlatform/mapPreview.vue
This commit is contained in:
zyy 2019-10-28 11:08:50 +08:00
commit ab9d300e2e
14 changed files with 147 additions and 25 deletions

View File

@ -65,3 +65,12 @@ export function getCommodityProductLesson(prdCode) {
method: 'get'
});
}
/** 更新发布课程信息*/
export function updatePublishLesson(data) {
return request({
url: `/api/lesson/${data.id}/nameAndRemarks`,
method: 'put',
data: data
});
}

View File

@ -115,7 +115,7 @@ export function updatePublishMapName(data) {
});
}
/** 修改发布地图名称*/
/** 获取发布地图详情*/
export function getPublishMapDetailList(params, code) {
return request({
url: `/api/map/${code}/versions`,
@ -132,7 +132,7 @@ export function hasDoorStationList(mapId) {
});
}
/** 修改发布地图名称*/
/** 修改发布地图城市*/
export function updatePublishMapCity(data) {
return request({
url: `/api/map/${data.mapId}/city`,

View File

@ -39,6 +39,7 @@
<el-input
v-model="formModel[item.prop]"
type="textarea"
:autosize='item.isAutoSize||false'
:placeholder="item.placeholder"
:disabled="item.disabled"
:style="{width: item.tooltip ? 'calc(100% - 50px)' : '100%'}"

View File

@ -10,7 +10,7 @@
style="padding-top: 18px;"
>
<el-row>
<el-col :span="18">
<el-col :span="leftSpan">
<template v-for="(colNum, rIndex) in rowColumnList">
<el-row :key="rIndex" :gutter="20">
<template v-for="(field, name, index) in queryObject">
@ -127,8 +127,8 @@
</el-row>
</template>
</el-col>
<el-col :span="5" :offset="1">
<el-button type="primary" size="small" :disabled="!canQuery" @click="query">{{ $t('global.query') }}</el-button>
<el-col :span="24-leftSpan-1" :offset="1">
<el-button style="margin-right: 10px" type="primary" size="small" :disabled="!canQuery" @click="query">{{ $t('global.query') }}</el-button>
<el-button v-if="queryForm.reset" type="primary" size="small" :disabled="!canQuery" @click="doClean">{{ $t('global.reset') }}</el-button>
<el-button v-if="exportFlag" type="primary" size="small" :disabled="!canQuery" @click="doExport">{{ $t('global.export') }}</el-button>
<template v-for="(button, index) in queryList.actions">
@ -138,8 +138,8 @@
:type="button.type ? button.type: 'primary'"
size="small"
:style="button.style"
@click="button.handler"
class="button_style"
@click="button.handler"
>{{ button.text }}</el-button>
</template>
</el-col>
@ -173,6 +173,12 @@ export default {
canQuery: {
type: Boolean,
required: true
},
leftSpan: {
type: Number,
default() {
return 18;
}
}
},
data() {
@ -481,7 +487,9 @@ export default {
max-width: 240px;
min-width: 100px;
}
.button_style {
.el-button+.el-button {
margin-right:10px;
margin-left: 0;
margin-bottom: 10px;
}
</style>

View File

@ -4,6 +4,7 @@
v-show="!(queryForm.show === false)"
ref="queryForm"
:query-form="queryForm"
:left-span="queryForm.leftSpan"
:query-list="queryList"
:before-query="queryForm.beforeQuery"
:can-query="canQuery"

View File

@ -5,6 +5,7 @@ export default {
lessonName: 'Lesson Name',
updateMapName: 'Update Map Name',
updateCityName: 'Update City',
updateLesson: 'Modify Lesson',
updateTime: 'Update Time',
operationSuccess: 'Operate successfully',
deleteSuccess: 'Delete successfully',

View File

@ -232,6 +232,7 @@ export default {
enterCourseName: 'Please enter the course name',
selectAssociatedProduct: 'Please select the associated product',
enterCourseDescription: 'Please enter the course description',
pleaseLessonIntroduction: 'Please enter the course description',
courseIdIsEmpty: 'Course Id is empty',
selectCity: 'Please select city',
enterStandardTime: 'Please enter standard time',

View File

@ -6,6 +6,7 @@ export default {
updateMapName: '更新地图名称',
updateCityName: '更新城市',
updateTime: '更新时间',
updateLesson: '修改课程',
operationSuccess: '操作成功',
deleteSuccess: '删除成功',
wellDelType: '此操作将删除该类型, 是否继续?',

View File

@ -242,6 +242,7 @@ export default {
enterCourseName: '请输入课程名称',
selectAssociatedProduct: '请选择关联产品',
enterCourseDescription: '请输入课程说明',
pleaseLessonIntroduction: '请输入课程简介',
courseIdIsEmpty: '课程Id为空',
selectCity: '请选择城市',
enterStandardTime: '请输入标准用时',

View File

@ -100,13 +100,10 @@ export default {
},
clickEvent(em) {
},
onContextmenu(em) {
},
setWindowSize() {
this.$nextTick(() => {
const width = this.$store.state.app.width-this.widthLeft;
const width = this.$store.state.app.width-(this.widthLeft||450);
const height = this.height;
this.$store.dispatch('config/resize', { width, height });
// this.$store.dispatch('training/updateOffsetStationCode', { offsetStationCode: this.offsetStationCode });

View File

@ -29,6 +29,7 @@ export default {
queryForm: {
labelWidth: '140px',
reset: true,
leftSpan: 18,
queryObject: {
'canDistribute': {
type: 'select',
@ -106,7 +107,7 @@ export default {
type: ''
},
{
name: '打包详情',
name: this.$t('orderAuthor.packingDetails'),
handleClick: this.handleDetail,
type: '',
showControl: (row) => { return !row.permissionType; }
@ -115,19 +116,19 @@ export default {
}
],
actions: [
{ text: this.$t('permission.permissionPack'), btnCode: 'employee_insert', handler: this.handlePermissionPack },
{ text: this.$t('permission.permissionPack'), btnCode: 'employee_insert', handler: this.handlePermissionPack }
]
}
};
},
watch: {
'$route.params.mapId': function (val) {
this.$refs.queryListPage.refresh(true);
}
},
mounted() {
this.loadInitData();
},
watch: {
'$route.params.mapId': function (val) {
this.$refs.queryListPage.refresh(true);
}
},
methods: {
handleRoleVest(index, row) {
this.$refs.selectRole.doShow(row.id);
@ -151,9 +152,9 @@ export default {
return row[porpInfo.property] ? row[porpInfo.property] : '---';
},
queryFunction(params) {
if (this.$route.params.mapId) {
params.mapId = this.$route.params.mapId;
}
if (this.$route.params.mapId) {
params.mapId = this.$route.params.mapId;
}
return listUserPermision(params);
},
handlePermissionPack() {

View File

@ -0,0 +1,80 @@
<template>
<div>
<el-dialog :title="title" :visible.sync="dialogVisible" width="500px" :before-close="doClose" center>
<data-form ref="dataform" :form="form" :formModel="formModel" :rules="rules"></data-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doCreate">{{$t('global.confirm')}}</el-button>
<el-button @click="doClose">{{$t('global.cancel')}}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'PublishLessonDraft',
data() {
return {
dialogVisible: false,
cityList:[],
formModel:{
id:'',
remarks:'',
name:'',
}
}
},
props: {
title: String
},
computed: {
form() {
let form={
labelWidth: '150px',
items: [
{ prop: 'name', label: this.$t('publish.lessonName'), type: 'text', required: true},
{ prop: 'remarks', label: this.$t('publish.lessonIntroduction'), type: 'textarea', required: true,isAutoSize:{ minRows:1, maxRows:5 }},
]
}
return form
},
rules() {
let crules ={
name:[
{ required: true, message: this.$t('rules.pleaseInputLessonName'), trigger: 'blur',max:100 },
{ required: true, message: this.$t('rules.pleaseInputLessonName'), trigger: 'change',max:100 },
],
remarks:[
{ required: true, message: this.$t('rules.pleaseLessonIntroduction'), trigger: 'blur',max:300 },
{ required: true, message: this.$t('rules.pleaseLessonIntroduction'), trigger: 'change',max:300 },
]
}
return crules
},
},
methods: {
doShow(row) {
this.formModel.id=row.id;
this.formModel.remarks=row.remarks;
this.formModel.name=row.name;
this.dialogVisible = true
},
doCreate() {
let self = this
this.$refs.dataform.validateForm(() => {
self.$emit('create', Object.assign({}, this.formModel));
self.doClose()
})
},
doClose() {
// this.$refs.dataform.resetForm();
this.isShow = false;
this.dialogVisible = false
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .el-dialog--center .el-dialog__body{
padding: 15px 65px 10px 10px;
}
</style>

View File

@ -1,16 +1,22 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<update-operate ref='updateLesson' @create="handleUpdate" :title="$t('publish.updateLesson')">
</update-operate>
</div>
</template>
<script>
import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine } from '@/api/jmap/lesson';
import { publishLessonList, delPublishLesson, putLessonOnLine, putLessonOffLine,updatePublishLesson } from '@/api/jmap/lesson';
import { getSkinCodeList } from '@/api/management/mapskin';
import localStore from 'storejs';
import UpdateOperate from './draft.vue';
export default {
name: 'PublishMap',
components:{
UpdateOperate
},
data() {
return {
cityList: [],
@ -74,6 +80,12 @@ export default {
type: 'warning',
showControl: (row) => { return row.status == 1; }
},
{
name: this.$t('global.edit'),
handleClick: this.handleEdit,
type: 'primary',
showControl: () => { return this.isShow != -1; }
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
@ -115,8 +127,17 @@ export default {
},
//
handleEdit(index, row) {
this.$refs.updateLesson.doShow(row);
},
//
handleUpdate(data){
updatePublishLesson(data).then(response => {
this.reloadTable();
this.$message.success(this.$t('publish.updateSuccess'));
}).catch(() => {
this.$messageBox(this.$t('error.updateFailed'));
});
},
//
handleDelete(index, row) {
this.$confirm(this.$t('publish.wellDelType'), this.$t('global.tips'), {

View File

@ -1,9 +1,9 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<update-operate ref='updateMapName' @reloadTable="reloadTable" @create="handleUpdateMap" :title="$t('publish.updateMapName')" type="updateMapName">
<update-operate ref='updateMapName' @create="handleUpdateMap" :title="$t('publish.updateMapName')" type="updateMapName">
</update-operate>
<update-operate ref='updateCityName' @reloadTable="reloadTable" @create="handleCityUpdate" :title="$t('publish.updateCityName')" type="updateCityName">
<update-operate ref='updateCityName' @create="handleCityUpdate" :title="$t('publish.updateCityName')" type="updateCityName">
</update-operate>
</div>
</template>