新增部门选择视图
This commit is contained in:
parent
b55cbf263e
commit
86d80a3b1a
|
@ -2,6 +2,7 @@ import request from '@/utils/request'
|
|||
|
||||
const projectApi = {
|
||||
add: 'project/add',
|
||||
getDict:'projecct/getDict',
|
||||
// get: 'sys/menu/get',
|
||||
// update: 'sys/menu/update',
|
||||
// del: 'sys/menu/delete',
|
||||
|
@ -16,6 +17,13 @@ export function projectAdd (params) {
|
|||
data: params
|
||||
})
|
||||
}
|
||||
export function dictGet (params) {
|
||||
return request({
|
||||
url: projectApi.getDict,
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
// export function menuGet (params) {
|
||||
// return request({
|
||||
// url: menuApi.get,
|
||||
|
|
|
@ -90,6 +90,12 @@ export const asyncRouterMap = [
|
|||
component: () => import('@/views/project/ProjectForm'),
|
||||
meta: { title: '新增项目', keepAlive: true, permission: ['form'] }
|
||||
},
|
||||
{
|
||||
path: '/project/unitSelect',
|
||||
name: 'unitSelect',
|
||||
component: () => import('@/views/project/ProjectUnitSelect'),
|
||||
meta: { title: '部门选择', keepAlive: true, permission: ['form'] }
|
||||
},
|
||||
{
|
||||
path: '/form/step-form',
|
||||
name: 'StepForm',
|
||||
|
|
|
@ -2,10 +2,15 @@
|
|||
<page-header-wrapper :title="新增项目">
|
||||
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
|
||||
<a-form-model-item label="项目名称">
|
||||
<a-input v-model="form.projectName" />
|
||||
<a-input v-model="form.projectName" v-decorator="[
|
||||
'projectName',
|
||||
{
|
||||
rules: [{ required: true, message: '项目名称为必填' }],
|
||||
},
|
||||
]"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="培训种类">
|
||||
<a-select v-model="form.trainClass" placeholder="please select your zone">
|
||||
<a-select v-model="form.trainClass" placeholder="--请选择--">
|
||||
<a-select-option value="shanghai"> Zone one </a-select-option>
|
||||
<a-select-option value="beijing"> Zone two </a-select-option>
|
||||
</a-select>
|
||||
|
@ -26,8 +31,7 @@
|
|||
</a-form-model-item>
|
||||
<a-form-model-item label="人员类型">
|
||||
<a-select v-model="form.personType" placeholder="--请选择--">
|
||||
<a-select-option value="shanghai"> Zone one </a-select-option>
|
||||
<a-select-option value="beijing"> Zone two </a-select-option>
|
||||
<a-select-option v-for="item in personType" :key="item.id"> {{ item.name }} </a-select-option>
|
||||
</a-select>
|
||||
</a-form-model-item>
|
||||
<!-- 时间选择器呢 -->
|
||||
|
@ -41,7 +45,7 @@
|
|||
</a-form-item>
|
||||
</a-form-item>
|
||||
<!-- 时间选择器 -->
|
||||
<a-form-item v-if="form.trainWay !== '1'" label="练习时间" style="margin-bottom: 0">
|
||||
<a-form-item v-if="['2', '3', '4'].includes(form.trainWay)" label="练习时间" style="margin-bottom: 0">
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||
<a-date-picker v-model="form.practiceSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||
</a-form-item>
|
||||
|
@ -51,7 +55,7 @@
|
|||
</a-form-item>
|
||||
</a-form-item>
|
||||
<!-- 时间选择器 -->
|
||||
<a-form-item v-if="form.trainWay !== '1'" label="考试时间" style="margin-bottom: 0">
|
||||
<a-form-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试时间" style="margin-bottom: 0">
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||
<a-date-picker v-model="form.examSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||
</a-form-item>
|
||||
|
@ -61,55 +65,66 @@
|
|||
</a-form-item>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-model-item label="时间">
|
||||
<a-date-picker v-model="form.date1" show-time type="date" placeholder="Pick a date" style="width: 100%" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="开关">
|
||||
<a-switch v-model="form.delivery" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="多选">
|
||||
<a-checkbox-group v-model="form.type">
|
||||
<a-checkbox value="1" name="type"> Online </a-checkbox>
|
||||
<a-checkbox value="2" name="type"> Promotion </a-checkbox>
|
||||
<a-checkbox value="3" name="type"> Offline </a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="单选">
|
||||
<a-radio-group v-model="form.resource">
|
||||
<a-radio value="1"> Sponsor </a-radio>
|
||||
<a-radio value="2"> Venue </a-radio>
|
||||
<!-- 考试次数 -->
|
||||
<a-form-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试次数" style="margin-bottom: 0">
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||
<a-input-number v-model="form.examNumber" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
<span> 补考次数: </span>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||
<a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||
<a-button type="primary" @click="javascript;"> 随机补考 </a-button>
|
||||
</a-form-item>
|
||||
</a-form-item>
|
||||
|
||||
<a-form-model-item label="模拟考试" v-if="['2', '3', '4'].includes(form.trainWay)">
|
||||
<a-radio-group v-model="form.mockExam">
|
||||
<a-radio value="1"> 允许 </a-radio>
|
||||
<a-radio value="0"> 不允许 </a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item label="输入框">
|
||||
<a-input v-model="form.desc" type="textarea" />
|
||||
<a-form-model-item label="备注">
|
||||
<a-input v-model="form.remark" type="textarea" />
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
|
||||
<a-button type="primary" @click="onSubmit"> 提交 </a-button>
|
||||
<a-button type="primary" @click="toNext"> 下一步 </a-button>
|
||||
<a-button style="margin-left: 10px"> 取消 </a-button>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</page-header-wrapper>
|
||||
</template>
|
||||
<script>
|
||||
import {getPersonType} from '@/api/project/project'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
labelCol: { span: 4 },
|
||||
wrapperCol: { span: 14 },
|
||||
form: {
|
||||
// name: '',
|
||||
// region: undefined,
|
||||
// date1: undefined,
|
||||
// delivery: false,
|
||||
// type: [],
|
||||
// resource: '',
|
||||
// desc: '',
|
||||
projectName: '',
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
getPersonType,
|
||||
},
|
||||
created: {
|
||||
|
||||
},
|
||||
methods: {
|
||||
onSubmit() {
|
||||
console.log('submit!', this.form)
|
||||
//获取字典值
|
||||
getPersonType() {
|
||||
return getPersonType(Object.assign(parameter)).then((res) => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
|
||||
//下一步,跳转页面带上from对象
|
||||
toNext() {
|
||||
console.log('toNext', this.form)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -190,3 +190,4 @@ export default {
|
|||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<template>
|
||||
<div>
|
||||
<h1>我是张三</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
||||
//例如:import 《组件名称》 from '《组件路径》'
|
||||
|
||||
export default {
|
||||
//import引入的组件需要注入到对象中才能使用
|
||||
components: {},
|
||||
props: {},
|
||||
data() {
|
||||
//这里存放数据
|
||||
return {};
|
||||
},
|
||||
//计算属性 类似于data概念
|
||||
computed: {},
|
||||
//监控data中的数据变化
|
||||
watch: {},
|
||||
//方法集合
|
||||
methods: {},
|
||||
created() {}, //生命周期 - 创建完成(可以访问当前this实例)
|
||||
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
||||
beforeCreate() {}, //生命周期 - 创建之前
|
||||
beforeMount() {}, //生命周期 - 挂载之前
|
||||
beforeUpdate() {}, //生命周期 - 更新之前
|
||||
updated() {}, //生命周期 - 更新之后
|
||||
beforeDestroy() {}, //生命周期 - 销毁之前
|
||||
destroyed() {}, //生命周期 - 销毁完成
|
||||
activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
||||
};
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
</style>
|
Loading…
Reference in New Issue