rt-sim-training-client/src/jmap/theme/beijing_01/menusPlan/managePlanList.vue
2019-07-29 16:03:14 +08:00

124 lines
4.3 KiB
Vue

<template>
<el-dialog class="beijing-01__schedule manage-plan-list" :title="title" :visible.sync="dialogShow" width="80%"
:before-close="doClose" :zIndex="2000" :modal="false" :close-on-click-modal="false" v-dialogDrag>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList">
</QueryListPage>
</el-dialog>
</template>
<script>
import { getSkinStyleList } from '@/api/management/mapskin'
import { getRunPlanLoadList, deleteRunPlanLoad } from '@/api/runplan';
import { UrlConfig } from '@/router/index';
export default {
name: 'ManagePlanList',
data() {
return {
dialogShow: false,
loading: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '140px',
reset: true,
queryObject: {
runPlanName: {
type: 'text',
label: '运行图名称'
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图名称',
prop: 'mapName'
},
{
title: '运行图名称',
prop: 'runPlanName',
},
{
title: '加载日期',
prop: 'loadTime'
},
{
type: 'button',
title: '操作',
width: '100',
buttons: [
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: '创建', btnCode: 'employee_insert', handler: this.handleCreateRunPlan },
]
},
currentModel: {}
}
},
computed: {
title() {
return '运行图计划表'
}
},
created() {
},
methods: {
queryFunction(params) {
if (this.$route.query.mapId) {
params['mapId'] = this.$route.query.mapId;
}
if (this.$store.state.user.id) {
params['userId'] = this.$store.state.user.id;
}
return getRunPlanLoadList(params);
},
handleDelete(index, row) {
this.$confirm('此操作将删除次日加载的运行图, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteRunPlanLoad(row.id).then(response => {
this.$message.success('删除成功')
this.reloadTable()
}).catch(error => {
this.reloadTable()
this.$messageBox('删除失败')
})
}).catch(() => { })
},
handleCreateRunPlan() {
this.$emit('dispatchDialog', { name: 'createWeekPlan' });
},
doShow() {
this.dialogShow = true;
},
doClose() {
this.loading = false;
this.dialogShow = false;
},
reloadTable() {
this.queryList.reload()
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
</style>