新增部门选择视图

This commit is contained in:
Yuanjianghong 2021-08-26 16:30:04 +08:00
parent b55cbf263e
commit 86d80a3b1a
5 changed files with 109 additions and 41 deletions

View File

@ -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,

View File

@ -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',

View File

@ -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,90 +31,100 @@
</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>
<!-- 时间选择器呢 -->
<a-form-item label="培训时间" style="margin-bottom: 0">
<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>
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
<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 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-date-picker v-model="form.practiceSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item>
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
<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 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-date-picker v-model="form.examSdate" style="width: 100%" valueFormat="YYYY-MM-DD HH:mm:ss" />
</a-form-item>
<span :style="{ display: 'inline-block', width: '24px', textAlign: 'center' }"> - </span>
<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-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)
},
},
}

View File

@ -190,3 +190,4 @@ export default {
},
}
</script>

View File

@ -0,0 +1,38 @@
<template>
<div>
<h1>我是张三</h1>
</div>
</template>
<script>
//jsjsjson
//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>