Merge branch 'develop' of https://gitee.com/siwa-team/dawa-vue into HEAD
This commit is contained in:
commit
903e75936f
|
@ -2,7 +2,7 @@ import request from '@/utils/request'
|
||||||
|
|
||||||
const projectApi = {
|
const projectApi = {
|
||||||
add: 'project/add',
|
add: 'project/add',
|
||||||
getDict:'projecct/getDict',
|
getDict:'project/dict/get',
|
||||||
// get: 'sys/menu/get',
|
// get: 'sys/menu/get',
|
||||||
// update: 'sys/menu/update',
|
// update: 'sys/menu/update',
|
||||||
// del: 'sys/menu/delete',
|
// del: 'sys/menu/delete',
|
||||||
|
|
|
@ -108,14 +108,22 @@ export default {
|
||||||
this.selectKey = this.defaultOrganizationId;
|
this.selectKey = this.defaultOrganizationId;
|
||||||
this.$emit('getSelectTreeKey', this.selectKey);
|
this.$emit('getSelectTreeKey', this.selectKey);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 如果没有传入默认显示节点 则自动显示树的第一个
|
||||||
|
let firstNode = this.treeData[0];
|
||||||
|
this.defaultSelectedKeys.push(firstNode.key);
|
||||||
|
this.selectTitle = firstNode.title;
|
||||||
|
this.selectKey = firstNode.key;
|
||||||
|
this.$emit('getSelectTreeKey', this.selectKey);
|
||||||
}
|
}
|
||||||
console.log(this.defaultSelectedKeys)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 点击组织机构数节点时调用
|
// 点击组织机构数节点时调用
|
||||||
selectTree(selectedKeys, e) {
|
selectTree(selectedKeys, e) {
|
||||||
this.selectKey = e.node.dataRef.key;
|
this.selectKey = e.node.dataRef.key;
|
||||||
this.selectTitle = e.node.dataRef.title;
|
this.selectTitle = e.node.dataRef.title;
|
||||||
|
this.defaultSelectedKeys = [];
|
||||||
|
this.defaultSelectedKeys.push(this.selectKey);
|
||||||
this.$emit('getSelectTreeKey', this.selectKey);
|
this.$emit('getSelectTreeKey', this.selectKey);
|
||||||
},
|
},
|
||||||
// 展开/收起节点时触发
|
// 展开/收起节点时触发
|
||||||
|
|
|
@ -1,38 +1,126 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h1>课程选择</h1>
|
<a-form-model :model="form" :label-col="labelCol" :wrapper-col="wrapperCol" :layout="vertical">
|
||||||
</div>
|
<a-space direction="vertical" style="width: 100%">
|
||||||
|
<a-space direction="horizontal">
|
||||||
|
<span>总课时:{{ totalHours }}, 总学时要求:{{ totalLearnHours }}, 总题目数量:{{ totalTopicNum }} </span>
|
||||||
|
课程名:
|
||||||
|
<a-input v-model="queryParam.projectName" style="width: 100%" />
|
||||||
|
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">查询</a-button>
|
||||||
|
<a-button icon="select" @click="() => (queryParam = {})">添加课程</a-button>
|
||||||
|
</a-space>
|
||||||
|
<s-table
|
||||||
|
ref="table"
|
||||||
|
size="default"
|
||||||
|
rowKey="id"
|
||||||
|
:columns="columns"
|
||||||
|
:data="loadData"
|
||||||
|
:rowSelection="options.rowSelection"
|
||||||
|
>
|
||||||
|
<span slot="serial" slot-scope="text, record, index">
|
||||||
|
{{ index + 1 }}
|
||||||
|
</span>
|
||||||
|
<!-- slot-scope="text, record" -->
|
||||||
|
<span slot="action">
|
||||||
|
<template>
|
||||||
|
<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-popconfirm>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a href="javascript:;" @click="handleDetail(record)">详情</a>
|
||||||
|
<a-divider type="vertical" /> -->
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
|
</s-table>
|
||||||
|
<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-space>
|
||||||
|
</a-form-model>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
||||||
//例如:import 《组件名称》 from '《组件路径》'
|
//例如:import 《组件名称》 from '《组件路径》'
|
||||||
|
import { STable } from '@/components'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用
|
//import引入的组件需要注入到对象中才能使用
|
||||||
components: {},
|
components: {
|
||||||
props: {},
|
STable,
|
||||||
data() {
|
},
|
||||||
//这里存放数据
|
props: {},
|
||||||
return {};
|
data() {
|
||||||
},
|
//这里存放数据
|
||||||
//计算属性 类似于data概念
|
return {
|
||||||
computed: {},
|
form: {},
|
||||||
//监控data中的数据变化
|
totalHours: 0, //总课时
|
||||||
watch: {},
|
totalLearnHours: 0, //总学时
|
||||||
//方法集合
|
totalTopicNum: 0, //题目数量
|
||||||
methods: {},
|
//查询数据
|
||||||
created() {}, //生命周期 - 创建完成(可以访问当前this实例)
|
queryParam: {},
|
||||||
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
// 表头
|
||||||
beforeCreate() {}, //生命周期 - 创建之前
|
columns: [
|
||||||
beforeMount() {}, //生命周期 - 挂载之前
|
{ title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
|
||||||
beforeUpdate() {}, //生命周期 - 更新之前
|
{ title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
|
||||||
updated() {}, //生命周期 - 更新之后
|
{ title: '课程名称', dataIndex: 'courseName', key: 'courseName' },
|
||||||
beforeDestroy() {}, //生命周期 - 销毁之前
|
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' },
|
||||||
destroyed() {}, //生命周期 - 销毁完成
|
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' },
|
||||||
activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
|
{ title: '题量', dataIndex: 'topicNumber', key: 'projectName' },
|
||||||
};
|
{ title: '项目名称', dataIndex: 'projectName', key: 'projectName' },
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
width: 200,
|
||||||
|
align: 'center',
|
||||||
|
scopedSlots: { customRender: 'action' },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
// 加载数据方法 必须为 Promise 对象
|
||||||
|
loadData: (parameter) => {
|
||||||
|
return getProjectList(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||||
|
return res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//计算属性 类似于data概念
|
||||||
|
computed: {},
|
||||||
|
//监控data中的数据变化
|
||||||
|
watch: {},
|
||||||
|
//方法集合
|
||||||
|
methods: {
|
||||||
|
toNext() {
|
||||||
|
console.log('ProjectCourseSelect-toNext', this.form)
|
||||||
|
const {
|
||||||
|
form: { validateFields },
|
||||||
|
} = this
|
||||||
|
// 先校验,通过表单校验后,才进入下一步
|
||||||
|
validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
this.$emit('nextStep')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
//生命周期 - 创建完成(可以访问当前this实例)
|
||||||
|
created() {},
|
||||||
|
mounted() {}, //生命周期 - 挂载完成(可以访问DOM元素)
|
||||||
|
beforeCreate() {}, //生命周期 - 创建之前
|
||||||
|
beforeMount() {}, //生命周期 - 挂载之前
|
||||||
|
beforeUpdate() {}, //生命周期 - 更新之前
|
||||||
|
updated() {}, //生命周期 - 更新之后
|
||||||
|
beforeDestroy() {}, //生命周期 - 销毁之前
|
||||||
|
destroyed() {}, //生命周期 - 销毁完成
|
||||||
|
activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
</style>
|
</style>
|
|
@ -45,11 +45,13 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// handler
|
// handler
|
||||||
|
//下一步
|
||||||
nextStep () {
|
nextStep () {
|
||||||
if (this.currentTab < 2) {
|
if (this.currentTab < 5) {
|
||||||
this.currentTab += 1
|
this.currentTab += 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//上一步
|
||||||
prevStep () {
|
prevStep () {
|
||||||
if (this.currentTab > 0) {
|
if (this.currentTab > 0) {
|
||||||
this.currentTab -= 1
|
this.currentTab -= 1
|
||||||
|
|
Loading…
Reference in New Issue