desc: 调整格式化,样式
This commit is contained in:
parent
0ebab6201f
commit
7b5255c3eb
@ -1,105 +1,106 @@
|
||||
<template>
|
||||
<div class="app-wrapper">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :height="height" :width="widthLeft"/>
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view :product-list="productList" :style="{width:currentWidth+'px',display:'inline-block'}"/>
|
||||
</transition>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div class="app-wrapper">
|
||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||
<div v-show="listShow" class="examList" :style="{width: widthLeft+'px'}">
|
||||
<demon-list ref="demonList" :height="height" :width="widthLeft" />
|
||||
</div>
|
||||
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
|
||||
<transition>
|
||||
<router-view :product-list="productList" />
|
||||
</transition>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import demonList from './demonList';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import localStore from 'storejs';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import MapCreate from '@/views/map/mapdraft/mapmanage/create';
|
||||
import { mapGetters } from 'vuex';
|
||||
import demonList from './demonList';
|
||||
import drapLeft from '@/views/components/drapLeft/index';
|
||||
import { launchFullscreen } from '@/utils/screen';
|
||||
import localStore from 'storejs';
|
||||
import { getSessionStorage, setSessionStorage } from '@/utils/auth';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
// import MapCreate from '@/views/map/mapdraft/mapmanage/create';
|
||||
|
||||
export default {
|
||||
name: 'DesignPlatform',
|
||||
components: {
|
||||
demonList,
|
||||
drapLeft,
|
||||
MapCreate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listShow: true,
|
||||
widthLeft: Number(localStore.get('LeftWidth')) || 450,
|
||||
productList: [],
|
||||
skinCode: '',
|
||||
currentWidth:'',
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'lessonbar'
|
||||
]),
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'lessonbar.opened': function (val) {
|
||||
this.listShow = val;
|
||||
},
|
||||
widthLeft(val) {
|
||||
this.setMapResize(val);
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.resize();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
||||
const againEnter = getSessionStorage('againEnter') || null;
|
||||
if (!againEnter){
|
||||
launchFullscreen();
|
||||
setSessionStorage('againEnter',true);
|
||||
}
|
||||
this.resize();
|
||||
this.widthLeft = Number(localStore.get('LeftWidth'));
|
||||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
export default {
|
||||
name: 'DesignPlatform',
|
||||
components: {
|
||||
demonList,
|
||||
drapLeft
|
||||
// MapCreate
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
listShow: true,
|
||||
widthLeft: Number(localStore.get('LeftWidth')) || 450,
|
||||
productList: [],
|
||||
skinCode: '',
|
||||
currentWidth: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'lessonbar'
|
||||
]),
|
||||
height() {
|
||||
return this.$store.state.app.height - 50;
|
||||
},
|
||||
width() {
|
||||
return this.$store.state.app.width;
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'lessonbar.opened': function (val) {
|
||||
this.listShow = val;
|
||||
},
|
||||
widthLeft(val) {
|
||||
this.setMapResize(val);
|
||||
},
|
||||
'$store.state.app.windowSizeCount': function() {
|
||||
this.resize();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
||||
const againEnter = getSessionStorage('againEnter') || null;
|
||||
if (!againEnter) {
|
||||
launchFullscreen();
|
||||
setSessionStorage('againEnter', true);
|
||||
}
|
||||
this.resize();
|
||||
this.widthLeft = Number(localStore.get('LeftWidth'));
|
||||
},
|
||||
methods: {
|
||||
refresh() {
|
||||
this.$refs && this.$refs.demonList && this.$refs.demonList.refresh();
|
||||
},
|
||||
drapWidth(width) {
|
||||
this.widthLeft = Number(width);
|
||||
},
|
||||
|
||||
refresh1() {
|
||||
refresh1() {
|
||||
|
||||
},
|
||||
mapSelected(data) {
|
||||
if (data && this.editModel) {
|
||||
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
|
||||
}
|
||||
},
|
||||
resize() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||
const height = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
setMapResize(LeftWidth) {
|
||||
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
||||
const widths = this.$store.state.app.width - 521 - LeftWidth;
|
||||
const heights = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: widths, height: heights });
|
||||
}
|
||||
},
|
||||
mapSelected(data) {
|
||||
if (data && this.editModel) {
|
||||
this.$router.push({ path: `${UrlConfig.map.draft}/${this.editModel.id}/${data.view}`, query: { name: this.editModel.name } });
|
||||
}
|
||||
},
|
||||
resize() {
|
||||
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
|
||||
const width = this.$store.state.app.width - 521 - this.widthLeft;
|
||||
const height = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: width, height: height });
|
||||
},
|
||||
setMapResize(LeftWidth) {
|
||||
this.currentWidth=this.$store.state.app.width - this.widthLeft;
|
||||
const widths = this.$store.state.app.width - 521 - LeftWidth;
|
||||
const heights = this.$store.state.app.height - 90;
|
||||
this.$store.dispatch('config/resize', { width: widths, height: heights });
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
@import "src/styles/mixin.scss";
|
||||
|
@ -1,252 +1,259 @@
|
||||
<template>
|
||||
<div style="height: 100%; overflow: hidden">
|
||||
<el-card>
|
||||
<div class="button_group">
|
||||
<el-button size="mini" v-if="hasRelease" @click="trainingManage">{{$t('lesson.trainingManage')}}</el-button>
|
||||
<el-button size="mini" v-if="hasRelease" @click="taskManage">{{$t('lesson.taskManage')}}</el-button>
|
||||
<el-button size="mini" v-if="hasRelease" @click="operationManage">{{$t('lesson.trainingRule')}}</el-button>
|
||||
<el-button size="mini" type="primary" @click="lessonCreateByPublish">{{$t('lesson.createNewCoursesFromRelease')}}</el-button>
|
||||
<el-button size="mini" type="primary" @click="lessonCreate">{{$t('lesson.newConstruction')}}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
border
|
||||
:label="this.$t('lesson.lesson')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="this.$t('global.status')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{handlerStatus(scope.row)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="explanation"
|
||||
show-overflow-tooltip
|
||||
:label="this.$t('lesson.rejectReason')">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
width="500"
|
||||
:label="this.$t('global.operate')">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="scope.row.status!=='1'"
|
||||
@click="createChapter(scope.row)"
|
||||
>{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter')}}</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="scope.row.status==='1'"
|
||||
@click="goDetail(scope.row)"
|
||||
>
|
||||
{{$t('lesson.review')}}
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary" plain
|
||||
v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"
|
||||
@click="treeSort(scope.row)"
|
||||
>{{$t('lesson.contentSorting')}}</el-button>
|
||||
<el-button size="mini"
|
||||
type="info"
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
|
||||
@click="editLesson(scope.row)"
|
||||
>{{$t('lesson.editCourse')}}</el-button>
|
||||
<el-button size="mini"
|
||||
type="primary"
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"
|
||||
@click="publish(scope.row)"
|
||||
>{{hasRelease?$t('global.release'):$t('lesson.applicationForRelease')}}</el-button>
|
||||
<el-button size="mini"
|
||||
type="danger"
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
|
||||
@click="deleteLesson(scope.row)"
|
||||
>{{$t('global.delete')}}</el-button>
|
||||
<el-button size="mini"
|
||||
type="danger"
|
||||
v-if="scope.row.status ==='1'"
|
||||
@click="revertLesson(scope.row)"
|
||||
>
|
||||
{{$t('lesson.withdraw')}}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<publish-create @refresh="refresh" ref="publishCreate" />
|
||||
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
||||
<lesson-detail ref="lessonDetail"/>
|
||||
</div>
|
||||
<div style="height: 100%; overflow: hidden">
|
||||
<el-card>
|
||||
<div class="button_group">
|
||||
<el-button v-if="hasRelease" size="mini" @click="trainingManage">{{ $t('lesson.trainingManage') }}</el-button>
|
||||
<el-button v-if="hasRelease" size="mini" @click="taskManage">{{ $t('lesson.taskManage') }}</el-button>
|
||||
<el-button v-if="hasRelease" size="mini" @click="operationManage">{{ $t('lesson.trainingRule') }}</el-button>
|
||||
<el-button size="mini" type="primary" @click="lessonCreateByPublish">{{ $t('lesson.createNewCoursesFromRelease') }}</el-button>
|
||||
<el-button size="mini" type="primary" @click="lessonCreate">{{ $t('lesson.newConstruction') }}</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card v-loading="loading">
|
||||
<el-table
|
||||
:data="tableData"
|
||||
row-key="id"
|
||||
border
|
||||
default-expand-all
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
border
|
||||
:label="this.$t('lesson.lesson')"
|
||||
/>
|
||||
<el-table-column
|
||||
:label="this.$t('global.status')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ handlerStatus(scope.row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="explanation"
|
||||
show-overflow-tooltip
|
||||
:label="this.$t('lesson.rejectReason')"
|
||||
/>
|
||||
<el-table-column
|
||||
width="500"
|
||||
:label="this.$t('global.operate')"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.status!=='1'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="createChapter(scope.row)"
|
||||
>{{ scope.row.type==='lesson'? $t('lesson.createChapter'):$t('lesson.updateChapter') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status==='1'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="goDetail(scope.row)"
|
||||
>
|
||||
{{ $t('lesson.review') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.type === 'lesson' && scope.row.status!=='1'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
plain
|
||||
@click="treeSort(scope.row)"
|
||||
>{{ $t('lesson.contentSorting') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
|
||||
size="mini"
|
||||
type="info"
|
||||
@click="editLesson(scope.row)"
|
||||
>{{ $t('lesson.editCourse') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status==='0'"
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="publish(scope.row)"
|
||||
>{{ hasRelease?$t('global.release'):$t('lesson.applicationForRelease') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.type === 'lesson'&& scope.row.status!=='1'"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="deleteLesson(scope.row)"
|
||||
>{{ $t('global.delete') }}</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.status ==='1'"
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="revertLesson(scope.row)"
|
||||
>
|
||||
{{ $t('lesson.withdraw') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<publish-create ref="publishCreate" @refresh="refresh" />
|
||||
<publish-lesson ref="publishLesson" @refresh="refresh" />
|
||||
<lesson-detail ref="lessonDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDraftLesson,releaseOrCancel } from '@/api/designPlatform';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import PublishCreate from './lessoncategory/edit/create';
|
||||
import PublishLesson from './lessoncategory/edit/lesson/publish';
|
||||
import { delLesson } from '@/api/jmap/lessondraft';
|
||||
import LessonDetail from '@/views/approval/lesson/detail';
|
||||
import { getDraftLesson, releaseOrCancel } from '@/api/designPlatform';
|
||||
import { UrlConfig } from '@/router/index';
|
||||
import PublishCreate from './lessoncategory/edit/create';
|
||||
import PublishLesson from './lessoncategory/edit/lesson/publish';
|
||||
import { delLesson } from '@/api/jmap/lessondraft';
|
||||
import LessonDetail from '@/views/approval/lesson/detail';
|
||||
|
||||
export default {
|
||||
name: 'LessonHome',
|
||||
components: {
|
||||
PublishCreate,
|
||||
PublishLesson,
|
||||
LessonDetail
|
||||
},
|
||||
computed: {
|
||||
mapId() {
|
||||
return this.$route.params.mapId;
|
||||
},
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
export default {
|
||||
name: 'LessonHome',
|
||||
components: {
|
||||
PublishCreate,
|
||||
PublishLesson,
|
||||
LessonDetail
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
loading: false,
|
||||
showEdit: false
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
mapId() {
|
||||
return this.$route.params.mapId;
|
||||
},
|
||||
hasRelease() {
|
||||
return this.$store.state.user.roles.includes('04') ||
|
||||
this.$store.state.user.roles.includes('05');
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
loading: false,
|
||||
showEdit: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.refresh();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
getDraftLesson({},this.mapId).then(response=> {
|
||||
response.data.forEach(elem => {
|
||||
if (elem.children) {
|
||||
elem.children.forEach( it => {
|
||||
it.parentId = elem.id;
|
||||
} )
|
||||
}
|
||||
});
|
||||
this.tableData = response.data;
|
||||
this.loading = false;
|
||||
}).catch(error=>{
|
||||
this.$messageBox(this.$t('error.getDraftCourseDataFailed'))
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
this.loading = true;
|
||||
getDraftLesson({},this.mapId).then(response=> {
|
||||
response.data.forEach(elem => {
|
||||
if (elem.children) {
|
||||
elem.children.forEach( it => {
|
||||
it.parentId = elem.id;
|
||||
} )
|
||||
}
|
||||
});
|
||||
this.tableData = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handlerStatus(row) {
|
||||
let lessonStatus = '';
|
||||
switch (row.status){
|
||||
case '0':
|
||||
lessonStatus = this.$t('lesson.notRelease');
|
||||
break;
|
||||
case '1':
|
||||
lessonStatus = this.$t('lesson.pendingReview');
|
||||
break;
|
||||
case '2':
|
||||
lessonStatus = this.$t('lesson.published');
|
||||
break;
|
||||
case '3':
|
||||
lessonStatus = this.$t('lesson.rejected');
|
||||
break;
|
||||
}
|
||||
return lessonStatus;
|
||||
},
|
||||
refresh() {
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
editLesson(row) {
|
||||
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/lessonEdit`, query: {id: row.id, skinCode: row.code}} )
|
||||
},
|
||||
lessonCreate() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`,query: {skinCode: this.$route.params.skinCode} })
|
||||
},
|
||||
lessonCreateByPublish() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.publishCreate.doShow();
|
||||
});
|
||||
},
|
||||
publish(row) {
|
||||
row.skinCode = this.$route.params.skinCode;
|
||||
row.cityCode = this.$route.query.cityCode;
|
||||
this.$refs.publishLesson.doShow(row);
|
||||
},
|
||||
deleteLesson(row) {
|
||||
delLesson(row).then(response => {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
}).catch(error => {
|
||||
this.$messageBox(this.$t('tip.failDelete'))
|
||||
});
|
||||
},
|
||||
createChapter(row) {
|
||||
if (row.type === 'lesson') {
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
|
||||
} else if (row.type === 'chapter') {
|
||||
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`,query: {id: row.id, lessonId: row.parentId}} )
|
||||
}
|
||||
},
|
||||
treeSort(row){
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row});
|
||||
},
|
||||
taskManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}})
|
||||
},
|
||||
trainingManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingManage}/${this.$route.params.skinCode}`, query: {mapId: this.$route.params.mapId}})
|
||||
},
|
||||
operationManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}})
|
||||
},
|
||||
revertLesson(row) {
|
||||
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
releaseOrCancel(row.id,"0").then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease'));
|
||||
this.refuse();
|
||||
}).catch(error => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
|
||||
this.refuse();
|
||||
});
|
||||
});
|
||||
},
|
||||
goDetail(row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route() {
|
||||
this.refresh();
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
methods: {
|
||||
loadInitData() {
|
||||
getDraftLesson({}, this.mapId).then(response=> {
|
||||
response.data.forEach(elem => {
|
||||
if (elem.children) {
|
||||
elem.children.forEach( it => {
|
||||
it.parentId = elem.id;
|
||||
} );
|
||||
}
|
||||
});
|
||||
this.tableData = response.data;
|
||||
this.loading = false;
|
||||
}).catch(( ) => {
|
||||
this.$messageBox(this.$t('error.getDraftCourseDataFailed'));
|
||||
});
|
||||
},
|
||||
refuse() {
|
||||
this.loading = true;
|
||||
getDraftLesson({}, this.mapId).then(response=> {
|
||||
response.data.forEach(elem => {
|
||||
if (elem.children) {
|
||||
elem.children.forEach( it => {
|
||||
it.parentId = elem.id;
|
||||
} );
|
||||
}
|
||||
});
|
||||
this.tableData = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
handlerStatus(row) {
|
||||
let lessonStatus = '';
|
||||
switch (row.status) {
|
||||
case '0':
|
||||
lessonStatus = this.$t('lesson.notRelease');
|
||||
break;
|
||||
case '1':
|
||||
lessonStatus = this.$t('lesson.pendingReview');
|
||||
break;
|
||||
case '2':
|
||||
lessonStatus = this.$t('lesson.published');
|
||||
break;
|
||||
case '3':
|
||||
lessonStatus = this.$t('lesson.rejected');
|
||||
break;
|
||||
}
|
||||
return lessonStatus;
|
||||
},
|
||||
refresh() {
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
},
|
||||
editLesson(row) {
|
||||
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/lessonEdit`, query: {id: row.id, skinCode: row.code}} );
|
||||
},
|
||||
lessonCreate() {
|
||||
this.$router.push({ path: `${UrlConfig.design.lessonEdit}/lessonCreate`, query: {skinCode: this.$route.params.skinCode} });
|
||||
},
|
||||
lessonCreateByPublish() {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.publishCreate.doShow();
|
||||
});
|
||||
},
|
||||
publish(row) {
|
||||
row.skinCode = this.$route.params.skinCode;
|
||||
row.cityCode = this.$route.query.cityCode;
|
||||
this.$refs.publishLesson.doShow(row);
|
||||
},
|
||||
deleteLesson(row) {
|
||||
delLesson(row).then(response => {
|
||||
this.$message.success(this.$t('tip.successfullyDelete'));
|
||||
this.loading = true;
|
||||
this.loadInitData();
|
||||
}).catch(() => {
|
||||
this.$messageBox(this.$t('tip.failDelete'));
|
||||
});
|
||||
},
|
||||
createChapter(row) {
|
||||
if (row.type === 'lesson') {
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/chapterCreate`, query: {lessonId: row.id}});
|
||||
} else if (row.type === 'chapter') {
|
||||
this.$router.push( {path: `${UrlConfig.design.lessonEdit}/chapterEdit`, query: {id: row.id, lessonId: row.parentId}} );
|
||||
}
|
||||
},
|
||||
treeSort(row) {
|
||||
this.$router.push({path: `${UrlConfig.design.lessonEdit}/treeSort`, query: row});
|
||||
},
|
||||
taskManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.taskManage}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}});
|
||||
},
|
||||
trainingManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingManage}/${this.$route.params.skinCode}`, query: {mapId: this.$route.params.mapId}});
|
||||
},
|
||||
operationManage() {
|
||||
this.$router.push({path: `${UrlConfig.design.trainingRule}`, query: {mapId: this.$route.params.mapId, skinCode: this.$route.params.skinCode}});
|
||||
},
|
||||
revertLesson(row) {
|
||||
this.$confirm(this.$t('tip.cancelCoursePublicationHint'), this.$t('global.tips'), {
|
||||
confirmButtonText: this.$t('global.confirm'),
|
||||
cancelButtonText: this.$t('global.cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
releaseOrCancel(row.id, '0').then(response => {
|
||||
this.loading = false;
|
||||
this.$message.success(this.$t('tip.cancelTheSuccessfulApplicationOfTheCourseRelease'));
|
||||
this.refuse();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.$messageBox(this.$t('tip.cancellationOfCoursePublicationApplicationFailed'));
|
||||
this.refuse();
|
||||
});
|
||||
});
|
||||
},
|
||||
goDetail(row) {
|
||||
this.$refs.lessonDetail.show(row.id);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
.draft {
|
||||
|
@ -8,11 +8,11 @@
|
||||
:training-operate-type-map="trainingOperateTypeMap"
|
||||
@refresh="reloadTable"
|
||||
/>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
<div class="draft">
|
||||
<el-button-group>
|
||||
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
|
||||
</el-button-group>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -139,11 +139,11 @@ export default {
|
||||
handleClick: this.demoDisplay,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '实训录制',
|
||||
handleClick: this.trainingRecord,
|
||||
type: ''
|
||||
}
|
||||
{
|
||||
name: '实训录制',
|
||||
handleClick: this.trainingRecord,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@ -151,7 +151,7 @@ export default {
|
||||
{ text: this.$t('lesson.generateTraining'), btnCode: 'employee_auto', handler: this.autoMaticTrainging },
|
||||
{ text: this.$t('lesson.updateTraining'), btnCode: 'employee_edit', handler: this.editTrainingByType, type: 'warning'},
|
||||
{ text: this.$t('lesson.deleteTraining'), btnCode: 'employee_delete', handler: this.delAutoMaticTrainging, type: 'danger'},
|
||||
{ text: '添加实训', btnCode: 'employee_add', handler:this.addTraining, type: 'primary' }
|
||||
{ text: '添加实训', btnCode: 'employee_add', handler: this.addTraining, type: 'primary' }
|
||||
]
|
||||
},
|
||||
|
||||
@ -161,28 +161,28 @@ export default {
|
||||
async created() {
|
||||
await this.loadInitData();
|
||||
const json = localStore.get(this.$route.path);
|
||||
json.type = '';
|
||||
json.prdCode = '';
|
||||
json.operateType = '';
|
||||
json.type = '';
|
||||
json.prdCode = '';
|
||||
json.operateType = '';
|
||||
},
|
||||
methods: {
|
||||
async loadInitData() {
|
||||
this.skinCodeList = [];
|
||||
this.queryForm.queryObject.prdCode.config.data = [];
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
getCommodityMapProduct(this.$route.params.skinCode).then((response) => {
|
||||
const productList = response.data;
|
||||
if (productList && productList.length > 0) {
|
||||
productList.forEach(elem => {
|
||||
// 过滤综合演练产品
|
||||
if (elem.prdType != '03') {
|
||||
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
getSkinCodeList().then(response => {
|
||||
this.skinCodeList = response.data;
|
||||
});
|
||||
getCommodityMapProduct(this.$route.params.skinCode).then((response) => {
|
||||
const productList = response.data;
|
||||
if (productList && productList.length > 0) {
|
||||
productList.forEach(elem => {
|
||||
// 过滤综合演练产品
|
||||
if (elem.prdType != '03') {
|
||||
this.queryForm.queryObject.prdCode.config.data.push({ value: elem.code, label: elem.name });
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.prdTypeList = [];
|
||||
getProductList({ pageSize: 500, pageNum: 1 }).then(res => {
|
||||
@ -256,24 +256,24 @@ export default {
|
||||
reloadTable() {
|
||||
this.queryList.reload();
|
||||
},
|
||||
turnback() {
|
||||
this.$router.go(-1)
|
||||
},
|
||||
trainingRecord(index, node) {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
this.group = resp.data;
|
||||
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
return pageQueryTraining(params);
|
||||
},
|
||||
addTraining() {
|
||||
turnback() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
trainingRecord(index, node) {
|
||||
trainingNotify({ trainingId: node.id }).then(resp => {
|
||||
this.group = resp.data;
|
||||
this.$router.push({ path: `${UrlConfig.design.trainingRecord}/${node.id}/${node.name}`, query: { group: resp.data } });
|
||||
}).catch(error => {
|
||||
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
|
||||
});
|
||||
},
|
||||
queryFunction(params) {
|
||||
params['mapId'] = this.$route.query.mapId;
|
||||
return pageQueryTraining(params);
|
||||
},
|
||||
addTraining() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user