更新发布课程信息
地图预览bug调整
This commit is contained in:
parent
9c99b2f451
commit
7ed9387731
@ -65,3 +65,13 @@ export function getCommodityProductLesson(prdCode) {
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/** 更新发布课程信息*/
|
||||
export function updatePublishLesson(data) {
|
||||
return request({
|
||||
url: `/api/lesson/${data.id}`,
|
||||
// update
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
@ -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`,
|
||||
|
@ -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%'}"
|
||||
|
@ -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',
|
||||
|
@ -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',
|
||||
|
@ -6,6 +6,7 @@ export default {
|
||||
updateMapName: '更新地图名称',
|
||||
updateCityName: '更新城市',
|
||||
updateTime: '更新时间',
|
||||
updateLesson: '修改课程',
|
||||
operationSuccess: '操作成功',
|
||||
deleteSuccess: '删除成功',
|
||||
wellDelType: '此操作将删除该类型, 是否继续?',
|
||||
|
@ -242,6 +242,7 @@ export default {
|
||||
enterCourseName: '请输入课程名称',
|
||||
selectAssociatedProduct: '请选择关联产品',
|
||||
enterCourseDescription: '请输入课程说明',
|
||||
pleaseLessonIntroduction: '请输入课程简介',
|
||||
courseIdIsEmpty: '课程Id为空',
|
||||
selectCity: '请选择城市',
|
||||
enterStandardTime: '请输入标准用时',
|
||||
|
@ -103,7 +103,7 @@
|
||||
},
|
||||
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 });
|
||||
|
80
src/views/publish/publishLesson/draft.vue
Normal file
80
src/views/publish/publishLesson/draft.vue
Normal 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>
|
@ -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'), {
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user