新增部门选择视图

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 = { 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,

View File

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

View File

@ -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,8 +31,7 @@
</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>
<!-- 时间选择器呢 --> <!-- 时间选择器呢 -->
@ -41,7 +45,7 @@
</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>
@ -51,7 +55,7 @@
</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>
@ -61,55 +65,66 @@
</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)
}, },
}, },
} }

View File

@ -190,3 +190,4 @@ export default {
}, },
} }
</script> </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>