新增部门选择视图
This commit is contained in:
parent
b55cbf263e
commit
86d80a3b1a
|
@ -2,6 +2,7 @@ import request from '@/utils/request'
|
||||||
|
|
||||||
const projectApi = {
|
const projectApi = {
|
||||||
add: 'project/add',
|
add: 'project/add',
|
||||||
|
getDict:'projecct/getDict',
|
||||||
// get: 'sys/menu/get',
|
// get: 'sys/menu/get',
|
||||||
// update: 'sys/menu/update',
|
// update: 'sys/menu/update',
|
||||||
// del: 'sys/menu/delete',
|
// del: 'sys/menu/delete',
|
||||||
|
@ -16,6 +17,13 @@ export function projectAdd (params) {
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export function dictGet (params) {
|
||||||
|
return request({
|
||||||
|
url: projectApi.getDict,
|
||||||
|
method: 'get',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
}
|
||||||
// export function menuGet (params) {
|
// export function menuGet (params) {
|
||||||
// return request({
|
// return request({
|
||||||
// url: menuApi.get,
|
// url: menuApi.get,
|
||||||
|
|
|
@ -90,6 +90,12 @@ export const asyncRouterMap = [
|
||||||
component: () => import('@/views/project/ProjectForm'),
|
component: () => import('@/views/project/ProjectForm'),
|
||||||
meta: { title: '新增项目', keepAlive: true, permission: ['form'] }
|
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',
|
path: '/form/step-form',
|
||||||
name: 'StepForm',
|
name: 'StepForm',
|
||||||
|
|
|
@ -2,10 +2,15 @@
|
||||||
<page-header-wrapper :title="新增项目">
|
<page-header-wrapper :title="新增项目">
|
||||||
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
|
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
|
||||||
<a-form-model-item label="项目名称">
|
<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>
|
||||||
<a-form-model-item label="培训种类">
|
<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="shanghai"> Zone one </a-select-option>
|
||||||
<a-select-option value="beijing"> Zone two </a-select-option>
|
<a-select-option value="beijing"> Zone two </a-select-option>
|
||||||
</a-select>
|
</a-select>
|
||||||
|
@ -26,90 +31,100 @@
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<a-form-model-item label="人员类型">
|
<a-form-model-item label="人员类型">
|
||||||
<a-select v-model="form.personType" placeholder="--请选择--">
|
<a-select v-model="form.personType" placeholder="--请选择--">
|
||||||
<a-select-option value="shanghai"> Zone one </a-select-option>
|
<a-select-option v-for="item in personType" :key="item.id"> {{ item.name }} </a-select-option>
|
||||||
<a-select-option value="beijing"> Zone two </a-select-option>
|
|
||||||
</a-select>
|
</a-select>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<!-- 时间选择器呢 -->
|
<!-- 时间选择器呢 -->
|
||||||
<a-form-item label="培训时间" style="margin-bottom: 0">
|
<a-form-item label="培训时间" style="margin-bottom: 0">
|
||||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||||
<a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss"/>
|
<a-date-picker v-model="form.trainSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
||||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||||
<a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss"/>
|
<a-date-picker v-model="form.trainEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</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-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-date-picker v-model="form.practiceSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
||||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||||
<a-date-picker v-model="form.practiceEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss"/>
|
<a-date-picker v-model="form.practiceEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</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-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-date-picker v-model="form.examSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
|
||||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(50% - 12px)' }">
|
||||||
<a-date-picker v-model="form.examEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss"/>
|
<a-date-picker v-model="form.examEdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</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-item v-if="['2', '3', '4'].includes(form.trainWay)" label="考试次数" style="margin-bottom: 0">
|
||||||
</a-form-model-item>
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||||
<a-form-model-item label="开关">
|
<a-input-number v-model="form.examNumber" :min="0" style="width: 100%" />
|
||||||
<a-switch v-model="form.delivery" />
|
</a-form-item>
|
||||||
</a-form-model-item>
|
<span> 补考次数: </span>
|
||||||
<a-form-model-item label="多选">
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||||
<a-checkbox-group v-model="form.type">
|
<a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" />
|
||||||
<a-checkbox value="1" name="type"> Online </a-checkbox>
|
</a-form-item>
|
||||||
<a-checkbox value="2" name="type"> Promotion </a-checkbox>
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||||
<a-checkbox value="3" name="type"> Offline </a-checkbox>
|
<a-button type="primary" @click="javascript;"> 随机补考 </a-button>
|
||||||
</a-checkbox-group>
|
</a-form-item>
|
||||||
</a-form-model-item>
|
</a-form-item>
|
||||||
<a-form-model-item label="单选">
|
|
||||||
<a-radio-group v-model="form.resource">
|
<a-form-model-item label="模拟考试" v-if="['2', '3', '4'].includes(form.trainWay)">
|
||||||
<a-radio value="1"> Sponsor </a-radio>
|
<a-radio-group v-model="form.mockExam">
|
||||||
<a-radio value="2"> Venue </a-radio>
|
<a-radio value="1"> 允许 </a-radio>
|
||||||
|
<a-radio value="0"> 不允许 </a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<a-form-model-item label="输入框">
|
<a-form-model-item label="备注">
|
||||||
<a-input v-model="form.desc" type="textarea" />
|
<a-input v-model="form.remark" type="textarea" />
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
|
<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-button style="margin-left: 10px"> 取消 </a-button>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
</a-form-model>
|
</a-form-model>
|
||||||
</page-header-wrapper>
|
</page-header-wrapper>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import {getPersonType} from '@/api/project/project'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
labelCol: { span: 4 },
|
labelCol: { span: 4 },
|
||||||
wrapperCol: { span: 14 },
|
wrapperCol: { span: 14 },
|
||||||
form: {
|
form: {
|
||||||
// name: '',
|
projectName: '',
|
||||||
// region: undefined,
|
|
||||||
// date1: undefined,
|
|
||||||
// delivery: false,
|
|
||||||
// type: [],
|
|
||||||
// resource: '',
|
|
||||||
// desc: '',
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
getPersonType,
|
||||||
|
},
|
||||||
|
created: {
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
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>
|
</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