暂存的修改

This commit is contained in:
Yuanjianghong 2021-09-06 11:59:37 +08:00
parent 0e62d9e1a4
commit 2e71de1cec
9 changed files with 464 additions and 342 deletions

38
src/api/project/class.js Normal file
View File

@ -0,0 +1,38 @@
import request from '@/utils/request'
const classApi = {
get: '/project/species/get',
add: '/project/species/add',
del: '/project/species/del',
list: '/project/species/pageList'
}
export function classAdd(params) {
return request({
url: classApi.add,
method: 'post',
data: params
})
}
export function classGet(params) {
return request({
url: classApi.getDict,
method: 'get',
params: params
})
}
export function classDel (params) {
return request({
url: classApi.get,
method: 'delete',
data: params
})
}
export function classList(params) {
console.log("------------{}", params)
return request({
url: classApi.list,
method: 'get',
params: params
})
}

View File

@ -1,36 +0,0 @@
<template>
<div></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>

View File

@ -38,9 +38,9 @@
<a-button icon="redo" @click="() => (queryParam = {})">重置</a-button>
</a-space>
<a-space direction="horizontal">
<a-button type="primary" icon="plus" @click="handledCreate()">新建</a-button>
<a-button type="primary" icon="minus" @click="handleEdit()">删除</a-button>
<a-space class="table-operator" direction="horizontal">
<a-button type="primary" icon="plus" @click="$refs.projectStepForm.add1()">新增项目</a-button>
<a-button type="primary" icon="minus" @click="handleEdit()">删除项目</a-button>
</a-space>
<s-table
@ -67,6 +67,7 @@
</template>
</span>
</s-table>
<project-step-form ref="projectStepForm"></project-step-form>
</a-space>
</div>
</template>
@ -75,16 +76,12 @@
import moment from 'moment'
import { STable } from '@/components'
import { getProjectList } from '@/api/project/project'
import ProjectForm from '@/views/project/form/ProjectForm'
import router from '@/router/index.js'
import projectStepForm from './ProjectStepForm'
export default {
name: 'ProjectList',
props: {},
components: {
STable,
ProjectForm,
router,
projectStepForm,
},
data() {
return {
@ -153,10 +150,10 @@ export default {
methods: {
//
handledCreate() {
return this.$router.push(
// {name: 'ProjectForm'}
{ path: 'project/project/add' }
)
// return this.$router.push(
// // {name: 'ProjectForm'}
// { path: 'project/project/add' }
// )
// router.push()
},

View File

@ -0,0 +1,147 @@
<template>
<a-modal
:title="modalTitle"
:width="1000"
:visible="visible"
:confirmLoading="confirmLoading"
:destroyOnClose="true"
@ok="handleSubmit"
@cancel="handleCancel"
>
<!-- PageHeader 第二种使用方式 (v-slot) -->
<a-card :bordered="false">
<a-steps class="steps" :current="currentTab">
<a-step title="基本信息" />
<a-step title="选择单位" />
<a-step title="选择课程" />
<a-step title="选择人员" />
<a-step title="完成" />
</a-steps>
<div class="content">
<step1 v-if="currentTab === 0" @nextStep="nextStep"/>
<step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep"/>
<step3 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep"/>
<step4 v-if="currentTab === 3" @nextStep="nextStep" @prevStep="prevStep"/>
<step5 v-if="currentTab === 4" @prevStep="prevStep" @finish="finish"/>
</div>
</a-card>
</a-modal>
</template>
<script>
import Step1 from './form/ProjectForm'
import Step2 from './form/ProjectUnitSelect'
import Step3 from './form/ProjectCourseSelect'
export default {
components: {
Step1,
Step2,
Step3,
},
data () {
return {
currentTab: 0,
labelCol: {
xs: { span: 24 },
sm: { span: 6 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 },
},
modalTitle: '新增项目',
visible: false,
confirmLoading: false,
menuTreeData: [],
componentShow: true,
componentDisabled: false,
componentRequired: true,
routerRequired: true,
routerShow: true,
pidShow: true,
permissionShow: true,
permissionRequired: true,
formLoading: true,
type: '',
form: this.$form.createForm(this),
}
},
methods: {
//
add1 (type) {
this.modalTitle = "新增菜单"
this.visible = true
// //
// this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: '1' })
// this.meneTypeFunc('1')
// //
// this.form.getFieldDecorator('visible', { initialValue: true })
// //
// this.getMenuTree()
this.formLoading = false
},
//
edit (record) {
this.modalTitle = "编辑菜单"
this.visible = true
// //
// this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: record.type.toString() })
// this.meneTypeFunc(record.type.toString())
// //
// // eslint-disable-next-line no-unused-vars
// const visibleDef = false
// // eslint-disable-next-line eqeqeq
// if (record.visible == 1) {
// this.visibleDef = true
// }
// this.form.getFieldDecorator('visible', { valuePropName: 'checked', initialValue: this.visibleDef })
// setTimeout(() => {
// this.setMenuItem(record)
// //
// this.getMenuTree()
// }, 100)
this.formLoading = false
},
// handler
//
nextStep () {
if (this.currentTab < 5) {
this.currentTab += 1
}
},
//
prevStep () {
if (this.currentTab > 0) {
this.currentTab -= 1
}
},
finish () {
this.currentTab = 0
},
handleSubmit() {
},
handleCancel() {
this.visible = false;
}
}
}
</script>
<style lang="less" scoped>
.steps {
max-width: 750px;
margin: 16px auto;
}
</style>

View File

@ -0,0 +1,65 @@
<template>
<page-header-wrapper title="新增种类">
<a-button type="primary" icon="rollback" @click="returnNext">返回</a-button>
<a-table ref="table" size="default" rowKey="id" :columns="columns" :data="dataTable" bordered>
<span slot="serial" slot-scope="text, record, index">
{{ index + 1 }}
</span>
<span slot="action" slot-scope="text, record">
<template>
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
<a-button @click="() => handleDetail(record)">删除</a-button>
</a-popconfirm>
</template>
</span>
</a-table>
</page-header-wrapper>
</template>
<script>
import { STable } from '@/components'
import { classDel, classList } from '@/api/project/class'
export default {
data() {
return {
// Promise
dataTable: (parameter) => {
return classList(Object.assign(parameter, this.queryParam)).then((res) => {
return res
})
},
columns: [
{ title: '序号', key: 'id', dataIndex: 'id', width: 80, scopedSlots: { customRender: 'serial' } },
{ title: '项目种类名称', dataIndex: 'value', key: 'value' },
{
title: '操作',
width: 200,
align: 'center',
scopedSlots: { customRender: 'action' },
},
],
}
},
components: {
STable,
classDel,
classList
},
methods: {
handledDel(){
classDel(Object.assign(parameter,params)).then((res) => {
if(res.code == 200){
return $this.$message = '操作成功';
}
})
},
returnNext(){
}
},
}
</script>
<style lang="less" scoped>
</style>

View File

@ -1,5 +1,4 @@
<template>
<div>
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
<a-space direction="vertical" style="width: 100%">
<a-space direction="horizontal">
@ -26,14 +25,9 @@
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">课程预览</a-button>
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">题库预览</a-button>
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">必选题设置</a-button>
<!-- <a href="javascript:;" @click="handleEdit(record)">修改</a>
<a-divider type="vertical" />
<a-popconfirm title="是否删除?" @confirm="() => handleDelete(record)">
<a href="javascript:;">删除</a>
<a-button type="primary" @click="$refs.table.refresh(true)">删除</a-button>
</a-popconfirm>
<a-divider type="vertical" />
<a href="javascript:;" @click="handleDetail(record)">详情</a>
<a-divider type="vertical" /> -->
</template>
</span>
</s-table>
@ -43,7 +37,6 @@
</a-form-model-item>
</a-space>
</a-form-model>
</div>
</template>
<script>
@ -60,7 +53,7 @@ export default {
data() {
//
return {
form: {},
form: this.$form.createForm(this),
totalHours: 0, //
totalLearnHours: 0, //
totalTopicNum: 0, //

View File

@ -1,31 +1,24 @@
<template>
<!-- <page-header-wrapper :title="新增项目"> -->
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
<!-- <page-header-wrapper :title="新增项目">
v-decorator="['form.XXX', { rules: [{ required: true, message: '项目名称为必填' }] }]"-->
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" layout="horizontal">
<a-row :gutter="24">
<a-col :md="24" :sm="24">
<a-form-model-item label="项目名称">
<a-input
v-model="form.projectName"
v-decorator="[
'projectName',
{
rules: [{ required: true, message: '项目名称为必填' }],
},
]"
/>
<a-input v-model="form.projectName" />
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-row :gutter="24">
<a-col :md="24" :sm="24">
<a-form-model-item label="培训种类">
<a-select v-model="form.trainClass" placeholder="--请选择--">
<a-select-option value="shanghai"> Zone one </a-select-option>
<a-select-option value="shanghai"> 参数待替换 </a-select-option>
</a-select>
<a-button type="primary" @click="createClass"> 新增种类 </a-button>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-col :span="24">
<a-form-model-item label="培训类型">
<a-select v-model="form.trainType" placeholder="--请选择--">
<a-select-option value="1"> 必修课 </a-select-option>
@ -33,7 +26,7 @@
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-col :span="24">
<a-form-model-item label="培训方式">
<a-select v-model="form.trainWay" placeholder="--请选择--">
<a-select-option value="1"> 培训 </a-select-option>
@ -43,7 +36,7 @@
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
<a-col :span="24">
<a-form-model-item label="人员类型">
<a-select v-model="form.personType" placeholder="--请选择--">
<a-select-option v-for="item in personType" :key="item.value"> {{ item.name }} </a-select-option>
@ -98,7 +91,7 @@
<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-button type="primary" @click="randomResit"> 随机补考 </a-button>
</a-form-item>
</a-form-item>
</a-col>
@ -119,7 +112,7 @@
<a-col :span="24">
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click="toNext"> 下一步 </a-button>
<a-button style="margin-left: 10px"> 取消 </a-button>
<a-button style="margin-left: 10px" @click="toNext"> 上一步 </a-button>
</a-form-model-item>
</a-col>
</a-row>
@ -129,13 +122,14 @@
<script>
import { dictGet } from '@/api/project/project'
export default {
data() {
return {
labelCol: { span: 4 },
wrapperCol: { span: 14 },
form: this.$form.createForm(this),
personType: [],
form: this.$form.createForm(this),
}
},
components: {
@ -161,7 +155,7 @@ export default {
name: r.name,
})
})
console.log("----------------",this.personType)
console.log('----------------', this.personType)
}
})
},
@ -170,19 +164,17 @@ export default {
//from
toNext() {
console.log('toNext', this.form)
const {
form: { validateFields },
} = this
//
validateFields((err, values) => {
if (!err) {
this.$emit('nextStep')
}
})
this.$emit('nextStep', this.form)
},
createClass() {
console.log('-------createClass--------')
},
//
randomResit() {
this.form.resitNumber = Math.floor(Math.random() * (5 - 1) + 1)
},
createClass(){
console.log("-------createClass--------")
}
},
}
</script>

View File

@ -1,72 +0,0 @@
<template>
<page-header-wrapper>
<!-- PageHeader 第二种使用方式 (v-slot) -->
<template v-slot:content>
将一个冗长或用户不熟悉的表单任务分成多个步骤指导用户完成
</template>
<a-card :bordered="false">
<a-steps class="steps" :current="currentTab">
<a-step title="基本信息" />
<a-step title="选择单位" />
<a-step title="选择课程" />
<a-step title="选择人员" />
<a-step title="完成" />
</a-steps>
<div class="content">
<step1 v-if="currentTab === 0" @nextStep="nextStep"/>
<step2 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep"/>
<step2 v-if="currentTab === 2" @nextStep="nextStep" @prevStep="prevStep"/>
<step2 v-if="currentTab === 3" @nextStep="nextStep" @prevStep="prevStep"/>
<step3 v-if="currentTab === 4" @prevStep="prevStep" @finish="finish"/>
</div>
</a-card>
</page-header-wrapper>
</template>
<script>
import Step1 from './ProjectForm'
import Step2 from './ProjectUnitSelect.vue'
import Step3 from './ProjectCourseSelect.vue'
export default {
name: 'StepForm',
components: {
Step1,
Step2,
Step3,
},
data () {
return {
currentTab: 0,
// form
form: null,
}
},
methods: {
// handler
//
nextStep () {
if (this.currentTab < 5) {
this.currentTab += 1
}
},
//
prevStep () {
if (this.currentTab > 0) {
this.currentTab -= 1
}
},
finish () {
this.currentTab = 0
}
}
}
</script>
<style lang="less" scoped>
.steps {
max-width: 750px;
margin: 16px auto;
}
</style>

View File

@ -1,10 +1,5 @@
<template>
<page-header-wrapper title="请选择受训单位">
<a-form-model :model="form">
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" @click="toNext"> 下一步 </a-button>
<a-button style="margin-left: 10px"> 取消 </a-button>
</a-form-model-item>
<!-- showSearch -->
<!-- height: '500px',overflowY: 'auto' -->
@ -42,8 +37,11 @@
/>
</template>
</a-transfer>
<a-form-model-item :wrapper-col="{ span: 14, offset: 4 }">
<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>