feat: 自主项目新建部分样式修改
This commit is contained in:
parent
f9e51792e4
commit
9d6ba97e74
|
@ -55,7 +55,7 @@ export default {
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'file' // img: 图片上传, file: 文件上传
|
default: 'img' // img: 图片上传, file: 文件上传
|
||||||
},
|
},
|
||||||
// 最大上传数量
|
// 最大上传数量
|
||||||
max: {
|
max: {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- PageHeader 第二种使用方式 (v-slot) -->
|
<!-- PageHeader 第二种使用方式 (v-slot) -->
|
||||||
<a-card :bordered="false" :title="title">
|
<a-card :bordered="false" :title="title">
|
||||||
<a-steps class="steps" type="navigation" :current="currentTab">
|
<a-steps class="steps" :current="currentTab">
|
||||||
<a-step title="基本信息" />
|
<a-step title="基本信息" />
|
||||||
<a-step title="选择单位" />
|
<a-step title="选择单位" />
|
||||||
<!-- v-if="['2', '3', '4'].includes(form.trainWay)" -->
|
|
||||||
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="选择课程" />
|
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="选择课程" />
|
||||||
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="选择人员" />
|
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="选择人员" />
|
||||||
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="组卷策略" />
|
<a-step v-if="['2', '3', '4'].includes(form.trainWay)" title="组卷策略" />
|
||||||
|
@ -23,7 +22,13 @@
|
||||||
@executeSave="executeSave"
|
@executeSave="executeSave"
|
||||||
@executeIssue="executeIssue"
|
@executeIssue="executeIssue"
|
||||||
/>
|
/>
|
||||||
<result v-if="currentTab === 5" :projectForm="form" @prevStep="prevStep" :projectSaveStatus="status" @close="close" />
|
<result
|
||||||
|
v-if="currentTab === 5"
|
||||||
|
:projectForm="form"
|
||||||
|
@prevStep="prevStep"
|
||||||
|
:projectSaveStatus="status"
|
||||||
|
@close="close"
|
||||||
|
/>
|
||||||
<!-- </keep-alive> -->
|
<!-- </keep-alive> -->
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
@ -48,13 +53,13 @@ export default {
|
||||||
Step3,
|
Step3,
|
||||||
Step4,
|
Step4,
|
||||||
step5,
|
step5,
|
||||||
result,
|
result
|
||||||
},
|
},
|
||||||
//生命周期 - 创建完成(可以访问当前this实例)
|
//生命周期 - 创建完成(可以访问当前this实例)
|
||||||
created() {
|
created() {
|
||||||
console.log('分步表单创建完成',this.$route)
|
console.log('分步表单创建完成', this.$route)
|
||||||
if (this.$route.query.projectId) {
|
if (this.$route.query.projectId) {
|
||||||
getProjectDetail({ id: this.$route.query.projectId }).then((res) => {
|
getProjectDetail({ id: this.$route.query.projectId }).then(res => {
|
||||||
this.form = res.data
|
this.form = res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -65,16 +70,16 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '',
|
title: '',
|
||||||
currentTab: 0,
|
currentTab: 1,
|
||||||
sourcePath: '',
|
sourcePath: '',
|
||||||
t: '',
|
t: '',
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 6 },
|
sm: { span: 6 }
|
||||||
},
|
},
|
||||||
wrapperCol: {
|
wrapperCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 16 },
|
sm: { span: 16 }
|
||||||
},
|
},
|
||||||
modalTitle: '新增项目',
|
modalTitle: '新增项目',
|
||||||
visible: false,
|
visible: false,
|
||||||
|
@ -84,10 +89,10 @@ export default {
|
||||||
t: this.$route.query.t,
|
t: this.$route.query.t,
|
||||||
projectType: this.$route.query.t === 'sys' ? 0 : 1,
|
projectType: this.$route.query.t === 'sys' ? 0 : 1,
|
||||||
trainWay: '2',
|
trainWay: '2',
|
||||||
totalScore: '100',
|
totalScore: '100'
|
||||||
},
|
},
|
||||||
result: true,
|
result: true,
|
||||||
status: '',
|
status: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -107,7 +112,7 @@ export default {
|
||||||
|
|
||||||
//发送请求保存数据
|
//发送请求保存数据
|
||||||
saveData() {
|
saveData() {
|
||||||
projectAdd(Object.assign({}, this.form)).then((res) => {
|
projectAdd(Object.assign({}, this.form)).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.status = 'success'
|
this.status = 'success'
|
||||||
this.currentTab = 5
|
this.currentTab = 5
|
||||||
|
@ -145,14 +150,14 @@ export default {
|
||||||
close() {
|
close() {
|
||||||
console.log('close------', this.$route.query.t)
|
console.log('close------', this.$route.query.t)
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
path: '/project/list/'+this.$route.query.t,
|
path: '/project/list/' + this.$route.query.t,
|
||||||
query: {
|
query: {
|
||||||
t: this.$route.query.t,
|
t: this.$route.query.t,
|
||||||
queryParam: this.$route.query.projectQueryParam,
|
queryParam: this.$route.query.projectQueryParam
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -161,4 +166,8 @@ export default {
|
||||||
max-width: 750px;
|
max-width: 750px;
|
||||||
margin: 16px auto;
|
margin: 16px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::v-deep .ant-btn + .ant-btn {
|
||||||
|
margin-left: 0px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,122 +1,136 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false" title="项目基本信息">
|
<div>
|
||||||
<template slot="extra">
|
<a-card :bordered="false" title="项目基本信息">
|
||||||
|
<!-- <template slot="extra">
|
||||||
<a-button type="primary" size="default" @click="toNext">下一步</a-button>
|
<a-button type="primary" size="default" @click="toNext">下一步</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template slot="extra">
|
<template slot="extra">
|
||||||
<a-button type="primary" size="default" @click="close">退出</a-button>
|
<a-button type="primary" size="default" @click="close">退出</a-button>
|
||||||
</template>
|
</template> -->
|
||||||
<a-form-model ref="form" :rules="rules" :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal">
|
<a-form-model
|
||||||
<a-row :gutter="24">
|
ref="form"
|
||||||
<a-col :md="24" :sm="24">
|
:rules="rules"
|
||||||
<a-form-model-item label="项目名称" prop="projectName">
|
:model="form"
|
||||||
<a-input v-model="form.projectName" />
|
:label-col="labelCol"
|
||||||
</a-form-model-item>
|
:wrapper-col="wrapperCol"
|
||||||
</a-col>
|
layout="horizontal"
|
||||||
</a-row>
|
>
|
||||||
<a-row :gutter="24">
|
<a-row :gutter="24">
|
||||||
<a-col :md="24" :sm="24">
|
<a-col :md="24" :sm="24">
|
||||||
<a-form-model-item label="培训种类" prop="trainClass">
|
<a-form-model-item label="项目名称" prop="projectName">
|
||||||
<a-select v-model="form.trainClass" placeholder="--请选择--">
|
<a-input v-model="form.projectName" />
|
||||||
<a-select-option v-for="entity in trainClass" :key="entity.value"> {{ entity.name }} </a-select-option>
|
|
||||||
</a-select>
|
|
||||||
<!-- <a-button type="primary" @click="$refs.classList.list()"> 新增种类 </a-button> -->
|
|
||||||
</a-form-model-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-model-item label="培训类型" prop="trainType">
|
|
||||||
<a-select v-model="form.trainType" placeholder="--请选择--">
|
|
||||||
<a-select-option value="1"> 必修课 </a-select-option>
|
|
||||||
<a-select-option value="2"> 选修课 </a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-model-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-model-item label="培训方式" prop="trainWay">
|
|
||||||
<a-select v-model="form.trainWay" placeholder="--请选择--">
|
|
||||||
<a-select-option value="1"> 培训 </a-select-option>
|
|
||||||
<a-select-option value="2"> 考试 </a-select-option>
|
|
||||||
<a-select-option value="3"> 培训-练习 </a-select-option>
|
|
||||||
<a-select-option value="4"> 培训-练习-考试 </a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-model-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-model-item label="人员类型" prop="personType">
|
|
||||||
<a-select v-model="form.personType" placeholder="--请选择--">
|
|
||||||
<a-select-option v-for="item in personType" :key="item.value"> {{ item.name }} </a-select-option>
|
|
||||||
</a-select>
|
|
||||||
</a-form-model-item>
|
|
||||||
</a-col>
|
|
||||||
<!-- 时间选择器呢 -->
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-model-item label="培训时间" style="margin-bottom: 0">
|
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="trainSdate">
|
|
||||||
<a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
</a-col>
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="trainEdate">
|
</a-row>
|
||||||
<a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
<a-row :gutter="24">
|
||||||
|
<a-col :md="24" :sm="24">
|
||||||
|
<a-form-model-item label="培训种类" prop="trainClass">
|
||||||
|
<a-select v-model="form.trainClass" placeholder="--请选择--">
|
||||||
|
<a-select-option v-for="entity in trainClass" :key="entity.value"> {{ entity.name }} </a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<!-- <a-button type="primary" @click="$refs.classList.list()"> 新增种类 </a-button> -->
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-form-model-item>
|
</a-col>
|
||||||
</a-col>
|
<a-col :span="24">
|
||||||
<!-- 时间选择器 -->
|
<a-form-model-item label="培训类型" prop="trainType">
|
||||||
<a-col :span="24">
|
<a-select v-model="form.trainType" placeholder="--请选择--">
|
||||||
<a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="练习时间" style="margin-bottom: 0">
|
<a-select-option value="1"> 必修课 </a-select-option>
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="practiceSdate">
|
<a-select-option value="2"> 选修课 </a-select-option>
|
||||||
<a-date-picker v-model="form.practiceSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
</a-col>
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="practiceEdate">
|
<a-col :span="24">
|
||||||
<a-date-picker v-model="form.practiceEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
<a-form-model-item label="培训方式" prop="trainWay">
|
||||||
|
<a-select v-model="form.trainWay" placeholder="--请选择--">
|
||||||
|
<a-select-option value="1"> 培训 </a-select-option>
|
||||||
|
<a-select-option value="2"> 考试 </a-select-option>
|
||||||
|
<a-select-option value="3"> 培训-练习 </a-select-option>
|
||||||
|
<a-select-option value="4"> 培训-练习-考试 </a-select-option>
|
||||||
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-form-model-item>
|
</a-col>
|
||||||
</a-col>
|
<a-col :span="24">
|
||||||
<!-- 时间选择器 -->
|
<a-form-model-item label="人员类型" prop="personType">
|
||||||
<a-col :span="24">
|
<a-select v-model="form.personType" placeholder="--请选择--">
|
||||||
<a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试时间" style="margin-bottom: 0">
|
<a-select-option v-for="item in personType" :key="item.value"> {{ item.name }} </a-select-option>
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="examSdate">
|
</a-select>
|
||||||
<a-date-picker v-model="form.examSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
</a-col>
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="examEdate">
|
<!-- 时间选择器呢 -->
|
||||||
<a-date-picker v-model="form.examEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
<a-col :span="24">
|
||||||
|
<a-form-model-item label="培训时间" style="margin-bottom: 0">
|
||||||
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="trainSdate">
|
||||||
|
<a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
|
</a-form-model-item>
|
||||||
|
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
||||||
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="trainEdate">
|
||||||
|
<a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
|
</a-form-model-item>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-form-model-item>
|
</a-col>
|
||||||
</a-col>
|
<!-- 时间选择器 -->
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="练习时间" style="margin-bottom: 0">
|
||||||
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="practiceSdate">
|
||||||
|
<a-date-picker v-model="form.practiceSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
|
</a-form-model-item>
|
||||||
|
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
||||||
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="practiceEdate">
|
||||||
|
<a-date-picker v-model="form.practiceEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-col>
|
||||||
|
<!-- 时间选择器 -->
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试时间" style="margin-bottom: 0">
|
||||||
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="examSdate">
|
||||||
|
<a-date-picker v-model="form.examSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
|
</a-form-model-item>
|
||||||
|
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
||||||
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }" prop="examEdate">
|
||||||
|
<a-date-picker v-model="form.examEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
<!-- 考试次数 -->
|
<!-- 考试次数 -->
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试次数" style="margin-bottom: 0">
|
<a-form-model-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试次数" style="margin-bottom: 0">
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }" prop="examNumber">
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }" prop="examNumber">
|
||||||
<a-input-number v-model="form.examNumber" :min="0" style="width: 100%" />
|
<a-input-number v-model="form.examNumber" :min="0" style="width: 100%" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<!-- <span> 补考次数: </span>
|
<!-- <span> 补考次数: </span>
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||||
<a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" />
|
<a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
<a-form-model-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||||
<a-button type="primary" @click="randomResit"> 随机补考 </a-button>
|
<a-button type="primary" @click="randomResit"> 随机补考 </a-button>
|
||||||
</a-form-model-item> -->
|
</a-form-model-item> -->
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-model-item label="模拟考试" v-if="['2', '3', '4'].includes(form.trainWay)" prop="mockExam">
|
<a-form-model-item label="模拟考试" v-if="['2', '3', '4'].includes(form.trainWay)" prop="mockExam">
|
||||||
<a-radio-group v-model="form.mockExam">
|
<a-radio-group v-model="form.mockExam">
|
||||||
<a-radio value="1"> 允许 </a-radio>
|
<a-radio value="1"> 允许 </a-radio>
|
||||||
<a-radio value="0"> 不允许 </a-radio>
|
<a-radio value="0"> 不允许 </a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-model-item label="备注">
|
||||||
|
<a-input v-model="form.remark" type="textarea" />
|
||||||
|
</a-form-model-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-col :span="24" style="text-align: center;">
|
||||||
|
<a-button type="primary" size="default" @click="toNext">下一步</a-button>
|
||||||
|
<a-button type="default" size="default" @click="close">退出</a-button>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
</a-form-model>
|
||||||
<a-form-model-item label="备注">
|
</a-card>
|
||||||
<a-input v-model="form.remark" type="textarea" />
|
</div>
|
||||||
</a-form-model-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-form-model>
|
|
||||||
</a-card>
|
|
||||||
<!-- </page-header-wrapper> -->
|
<!-- </page-header-wrapper> -->
|
||||||
<!-- <class-list ref="ClassList"></class-list> -->
|
<!-- <class-list ref="ClassList"></class-list> -->
|
||||||
</template>
|
</template>
|
||||||
|
@ -128,8 +142,8 @@ import { classList } from '@/api/project/class'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
projectForm: {
|
projectForm: {
|
||||||
type: Object,
|
type: Object
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -154,14 +168,14 @@ export default {
|
||||||
examSdate: [{ required: true, message: '请输入考试开始时间', trigger: 'change' }],
|
examSdate: [{ required: true, message: '请输入考试开始时间', trigger: 'change' }],
|
||||||
examEdate: [{ required: true, message: '请输入考试结束时间', trigger: 'change' }],
|
examEdate: [{ required: true, message: '请输入考试结束时间', trigger: 'change' }],
|
||||||
examNumber: [{ required: true, message: '请输入考试次数', trigger: 'blur' }],
|
examNumber: [{ required: true, message: '请输入考试次数', trigger: 'blur' }],
|
||||||
mockExam: [{ required: true, message: '请选择是否允许模拟考试', trigger: 'change' }],
|
mockExam: [{ required: true, message: '请选择是否允许模拟考试', trigger: 'change' }]
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
dictGet,
|
dictGet,
|
||||||
ClassList,
|
ClassList,
|
||||||
classList,
|
classList
|
||||||
},
|
},
|
||||||
created(ClassList) {
|
created(ClassList) {
|
||||||
console.log('第一个表单创建了')
|
console.log('第一个表单创建了')
|
||||||
|
@ -176,14 +190,14 @@ export default {
|
||||||
//获取字典值,请求查询培训种类
|
//获取字典值,请求查询培训种类
|
||||||
fetchTemplateData() {
|
fetchTemplateData() {
|
||||||
let formData = { type: 2 }
|
let formData = { type: 2 }
|
||||||
dictGet(formData).then((res) => {
|
dictGet(formData).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
const result = res.data
|
const result = res.data
|
||||||
result.forEach((r) => {
|
result.forEach(r => {
|
||||||
this.personType.push({
|
this.personType.push({
|
||||||
value: r.value,
|
value: r.value,
|
||||||
name: r.name,
|
name: r.name
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -193,14 +207,14 @@ export default {
|
||||||
//获取培训种类列表
|
//获取培训种类列表
|
||||||
getTrainClass() {
|
getTrainClass() {
|
||||||
let formData = { type: 1 }
|
let formData = { type: 1 }
|
||||||
dictGet(formData).then((res) => {
|
dictGet(formData).then(res => {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
const result = res.data
|
const result = res.data
|
||||||
result.forEach((r) => {
|
result.forEach(r => {
|
||||||
this.trainClass.push({
|
this.trainClass.push({
|
||||||
value: r.id,
|
value: r.id,
|
||||||
name: r.name,
|
name: r.name
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// console.log("222222222222222222222222222",this.trainClass)
|
// console.log("222222222222222222222222222",this.trainClass)
|
||||||
|
@ -212,15 +226,15 @@ export default {
|
||||||
//下一步,跳转页面带上from对象
|
//下一步,跳转页面带上from对象
|
||||||
toNext() {
|
toNext() {
|
||||||
// console.log('toNext', this.form)
|
// console.log('toNext', this.form)
|
||||||
this.$refs.form.validate((validate) => {
|
this.$refs.form.validate(validate => {
|
||||||
if (validate) {
|
if (validate) {
|
||||||
this.$emit('nextStep', this.form)
|
this.$emit('nextStep', this.form)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
console.log('第一个表单销毁了')
|
console.log('第一个表单销毁了')
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,28 +1,45 @@
|
||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false" title="选择培训单位">
|
<div>
|
||||||
<template slot="extra">
|
<a-card :bordered="false" title="选择培训单位">
|
||||||
<a-button type="primary" size="default" @click="toPrep">上一步</a-button>
|
<a-transfer
|
||||||
</template>
|
class="tree-transfer"
|
||||||
<template slot="extra">
|
:data-source="dataSource"
|
||||||
<a-button type="primary" v-if="['2', '3', '4'].includes(form.trainWay)" size="default" @click="toNext">下一步</a-button>
|
:target-keys="targetKeys"
|
||||||
</template>
|
:render="item => item.title"
|
||||||
<template type="primary" v-if="form.trainWay === '1'" slot="extra">
|
:show-select-all="false"
|
||||||
<a-button size="default" @click="handleSubmit">保存</a-button>
|
@change="onChange"
|
||||||
</template>
|
>
|
||||||
<a-transfer class="tree-transfer" :data-source="dataSource" :target-keys="targetKeys" :render="(item) => item.title" :show-select-all="false" @change="onChange">
|
<template slot="children" slot-scope="{ props: { direction, selectedKeys }, on: { itemSelect } }">
|
||||||
<template slot="children" slot-scope="{ props: { direction, selectedKeys }, on: { itemSelect } }">
|
<a-tree
|
||||||
<a-tree v-if="direction === 'left'" blockNode checkable checkStrictly defaultExpandAll :checkedKeys="[...selectedKeys, ...targetKeys]" :treeData="treeData" @check="
|
v-if="direction === 'left'"
|
||||||
(_, props) => {
|
blockNode
|
||||||
onChecked(_, props, [...selectedKeys, ...targetKeys], itemSelect)
|
checkable
|
||||||
}
|
checkStrictly
|
||||||
" @select="
|
defaultExpandAll
|
||||||
(_, props) => {
|
:checkedKeys="[...selectedKeys, ...targetKeys]"
|
||||||
onChecked(_, props, [...selectedKeys, ...targetKeys], itemSelect)
|
:treeData="treeData"
|
||||||
}
|
@check="
|
||||||
" />
|
(_, props) => {
|
||||||
</template>
|
onChecked(_, props, [...selectedKeys, ...targetKeys], itemSelect)
|
||||||
</a-transfer>
|
}
|
||||||
</a-card>
|
"
|
||||||
|
@select="
|
||||||
|
(_, props) => {
|
||||||
|
onChecked(_, props, [...selectedKeys, ...targetKeys], itemSelect)
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</a-transfer>
|
||||||
|
</a-card>
|
||||||
|
<a-col :span="24" style="text-align: center;">
|
||||||
|
<a-button type="primary" size="default" @click="toPrep" style="margin-right: 8px;">上一步</a-button>
|
||||||
|
<a-button type="primary" v-if="['2', '3', '4'].includes(form.trainWay)" size="default" @click="toNext"
|
||||||
|
>下一步</a-button
|
||||||
|
>
|
||||||
|
<a-button v-if="form.trainWay === '1'" size="default" @click="handleSubmit">保存</a-button>
|
||||||
|
</a-col>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -47,7 +64,7 @@ const treeData = []
|
||||||
const transferDataSource = []
|
const transferDataSource = []
|
||||||
|
|
||||||
function flatten(list = []) {
|
function flatten(list = []) {
|
||||||
list.forEach((item) => {
|
list.forEach(item => {
|
||||||
transferDataSource.push(item)
|
transferDataSource.push(item)
|
||||||
flatten(item.children)
|
flatten(item.children)
|
||||||
})
|
})
|
||||||
|
@ -80,7 +97,7 @@ export default {
|
||||||
targetKeys: this.projectForm.unitIds || [],
|
targetKeys: this.projectForm.unitIds || [],
|
||||||
dataSource: transferDataSource,
|
dataSource: transferDataSource,
|
||||||
// treeData() {return handleTreeData(treeData, this.targetKeys)},
|
// treeData() {return handleTreeData(treeData, this.targetKeys)},
|
||||||
treeData: [],
|
treeData: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 计算属性 类似于data概念
|
// 计算属性 类似于data概念
|
||||||
|
@ -99,16 +116,16 @@ export default {
|
||||||
},
|
},
|
||||||
//获取数据源
|
//获取数据源
|
||||||
getSourceList(orgType) {
|
getSourceList(orgType) {
|
||||||
orgList({ orgType: orgType || 1 }).then((res) => {
|
orgList({ orgType: orgType || 1 }).then(res => {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.dataSource = []
|
this.dataSource = []
|
||||||
res.data.forEach((item) => {
|
res.data.forEach(item => {
|
||||||
this.dataSource.push({
|
this.dataSource.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
key: item.id.toString(),
|
key: item.id.toString(),
|
||||||
title: item.name,
|
title: item.name,
|
||||||
children: [],
|
children: [],
|
||||||
pid: item.pid,
|
pid: item.pid
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
console.log('dataSource', this.dataSource)
|
console.log('dataSource', this.dataSource)
|
||||||
|
@ -140,7 +157,7 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('请选择培训单位')
|
this.$message.warning('请选择培训单位')
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
// 生命周期 - 创建完成(可以访问当前this实例)
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
||||||
created() {
|
created() {
|
||||||
|
@ -150,23 +167,23 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
// 生命周期 - 挂载完成(可以访问DOM元素)
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
||||||
mounted() { },
|
mounted() {},
|
||||||
// 生命周期 - 创建之前
|
// 生命周期 - 创建之前
|
||||||
beforeCreate() { },
|
beforeCreate() {},
|
||||||
// 生命周期 - 挂载之前
|
// 生命周期 - 挂载之前
|
||||||
beforeMount() { },
|
beforeMount() {},
|
||||||
// 生命周期 - 更新之前
|
// 生命周期 - 更新之前
|
||||||
beforeUpdate() { },
|
beforeUpdate() {},
|
||||||
// 生命周期 - 更新之后
|
// 生命周期 - 更新之后
|
||||||
updated() { },
|
updated() {},
|
||||||
// 生命周期 - 销毁之前
|
// 生命周期 - 销毁之前
|
||||||
beforeDestroy() { },
|
beforeDestroy() {},
|
||||||
// 生命周期 - 销毁完成
|
// 生命周期 - 销毁完成
|
||||||
destroyed() {
|
destroyed() {
|
||||||
console.log('第2个表单销毁了')
|
console.log('第2个表单销毁了')
|
||||||
},
|
},
|
||||||
// 如果页面有keep-alive缓存功能,这个函数会触发
|
// 如果页面有keep-alive缓存功能,这个函数会触发
|
||||||
activated() { },
|
activated() {}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
@ -175,5 +192,3 @@ export default {
|
||||||
flex: none;
|
flex: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue