Merge branch 'develop' of https://gitee.com/siwa-team/dawa-vue into develop
This commit is contained in:
commit
6337cb1c0a
|
@ -1,42 +1,50 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
const projectApi = {
|
const projectApi = {
|
||||||
add: 'project/addOrUpdate',
|
add: 'project/addOrUpdate',
|
||||||
getDict:'project/dict/get',
|
getDict: 'project/dict/get',
|
||||||
list: 'project/pageList',
|
list: 'project/pageList',
|
||||||
get: 'project/get',
|
get: 'project/get',
|
||||||
projectCourseList: '',
|
projectCourseList: '',
|
||||||
|
release: '/project/release',
|
||||||
}
|
}
|
||||||
|
|
||||||
export function projectAdd (params) {
|
export function projectAdd(params) {
|
||||||
return request({
|
return request({
|
||||||
url: projectApi.add,
|
url: projectApi.add,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export function dictGet (params) {
|
export function dictGet(params) {
|
||||||
return request({
|
return request({
|
||||||
url: projectApi.getDict,
|
url: projectApi.getDict,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getProjectList (params) {
|
export function getProjectList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: projectApi.list,
|
url: projectApi.list,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function getProjectDetail (params) {
|
export function getProjectDetail(params) {
|
||||||
return request({
|
return request({
|
||||||
url: projectApi.get,
|
url: projectApi.get,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function releaseProject(params) {
|
||||||
|
return request({
|
||||||
|
url: projectApi.release,
|
||||||
|
method: 'post',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
}
|
|
@ -4,7 +4,8 @@ const terminalTrainApi = {
|
||||||
edit: '/project/terminal/addOrUpdate',
|
edit: '/project/terminal/addOrUpdate',
|
||||||
del: '/project/terminal/del',
|
del: '/project/terminal/del',
|
||||||
list: '/project/terminal/pageList',
|
list: '/project/terminal/pageList',
|
||||||
get: '/project/terminal/get'
|
get: '/project/terminal/get',
|
||||||
|
release: '/project/terminal/release', //发布项目
|
||||||
}
|
}
|
||||||
|
|
||||||
export function terminalTrainEdit(params) {
|
export function terminalTrainEdit(params) {
|
||||||
|
@ -15,12 +16,12 @@ export function terminalTrainEdit(params) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function terminalTrainDel (params) {
|
export function terminalTrainDel(params) {
|
||||||
return request({
|
return request({
|
||||||
url: terminalTrainApi.del,
|
url: terminalTrainApi.del,
|
||||||
method: 'delete',
|
method: 'delete',
|
||||||
params: params
|
params: params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function terminalTrainList(params) {
|
export function terminalTrainList(params) {
|
||||||
|
@ -39,7 +40,17 @@ export function terminalTrainGet(params) {
|
||||||
url: terminalTrainApi.get,
|
url: terminalTrainApi.get,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: {
|
params: {
|
||||||
id:params,
|
id: params,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// releaseTerminalTrain
|
||||||
|
export function releaseTerminalTrain(params) {
|
||||||
|
console.log("terminalTrainRelease------------{}", params)
|
||||||
|
return request({
|
||||||
|
url: terminalTrainApi.release,
|
||||||
|
method: 'put',
|
||||||
|
params: params
|
||||||
|
})
|
||||||
|
}
|
|
@ -38,7 +38,7 @@
|
||||||
</span>
|
</span>
|
||||||
<span slot="action" slot-scope="text, record">
|
<span slot="action" slot-scope="text, record">
|
||||||
<template>
|
<template>
|
||||||
<a v-if="hasPerm(power.release) && record.status == 1" href="javascript:;" @click="handledRelease(record)">发布</a>
|
<a v-if="hasPerm(power.release) && record.status == '1'" href="javascript:;" @click="handledRelease(record)">发布</a>
|
||||||
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
|
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
|
||||||
<a v-if="hasPerm('project:list')" href="javascript:;" @click="getDetail(record)">详情</a>
|
<a v-if="hasPerm('project:list')" href="javascript:;" @click="getDetail(record)">详情</a>
|
||||||
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
|
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { STable } from '@/components'
|
import { STable } from '@/components'
|
||||||
import { getProjectList } from '@/api/project/project'
|
import { getProjectList,releaseProject } from '@/api/project/project'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
@ -149,7 +149,12 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
//发布项目
|
//发布项目
|
||||||
handledRelease(record){
|
handledRelease(record){
|
||||||
|
releaseProject({id: record.id}).then((res) => {
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$message.success('项目:'+record.projectName+' 发布成功!');
|
||||||
|
this.$refs.table.refresh(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
//编辑时获取详情
|
//编辑时获取详情
|
||||||
getDetail(record) {
|
getDetail(record) {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- <keep-alive exclude="result"> -->
|
<!-- <keep-alive exclude="result"> -->
|
||||||
<step1 v-if="currentTab === 0" :projectForm="form" @nextStep="nextStep" @close="close" @setFormType="setFormType"/>
|
<step1 v-if="currentTab === 0" :projectForm="form" @nextStep="nextStep" @close="close" @setFormType="setFormType"/>
|
||||||
<step2 v-if="currentTab === 1" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
<step2 v-if="currentTab === 1" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" @executeSave="executeSave"/>
|
||||||
<step3 v-if="currentTab === 2" :projectForm="form" :courseChange="courseChange" @nextStep="nextStep" @prevStep="prevStep" />
|
<step3 v-if="currentTab === 2" :projectForm="form" :courseChange="courseChange" @nextStep="nextStep" @prevStep="prevStep" />
|
||||||
<step4 v-if="currentTab === 3" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
<step4 v-if="currentTab === 3" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
|
||||||
<step5
|
<step5
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
<a-menu-item key="sys">系统课程</a-menu-item>
|
<a-menu-item key="sys">系统课程</a-menu-item>
|
||||||
<a-menu-item key="self">自主课程</a-menu-item>
|
<a-menu-item key="self">自主课程</a-menu-item>
|
||||||
</a-menu>
|
</a-menu>
|
||||||
<a-tree :treeData="treeData" @select="onSelect" :defaultExpandAll="true" :defaultExpandedKeys="defaultExpandedKeys" :replaceFields="replaceFields">
|
<!-- :defaultExpandedKeys="defaultExpandedKeys" -->
|
||||||
|
<a-tree :treeData="treeData" @select="onSelect" :defaultExpandAll="true" :replaceFields="replaceFields">
|
||||||
<a-icon slot="switcherIcon" type="down" />
|
<a-icon slot="switcherIcon" type="down" />
|
||||||
</a-tree>
|
</a-tree>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -22,7 +23,7 @@
|
||||||
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
<s-table ref="table" :columns="columns" :data="loadData" :rowKey="(record) => record.id" :rowSelection="{ selectedRowKeys: selectedRowKeys, selectedRows: selectedRows, onChange: onSelectChange }">
|
<s-table ref="table" :columns="columns" :data="loadData" :rowKey="(record) => record.value" :rowSelection="{ selectedRowKeys: selectedRowKeys, selectedRows: selectedRows, onChange: onSelectChange }">
|
||||||
<span slot="serial" slot-scope="text, record, index">
|
<span slot="serial" slot-scope="text, record, index">
|
||||||
{{ index + 1 }}
|
{{ index + 1 }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -70,10 +71,10 @@ export default {
|
||||||
|
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParam: { name: '', classType: 0 ,type: 0},
|
queryParam: { name: '', classType: 0 ,type: 0},
|
||||||
replaceFields: { children: 'children', title: 'name', key: 'id', value: 'id' },
|
replaceFields: { children: 'children', title: 'name', key: 'key', value: 'value' },
|
||||||
expandedKeys: [],
|
expandedKeys: [],
|
||||||
autoExpandParent: true,
|
autoExpandParent: true,
|
||||||
defaultExpandedKeys: [],
|
// defaultExpandedKeys: [],
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
selectedRows: [],
|
selectedRows: [],
|
||||||
treeData: [],
|
treeData: [],
|
||||||
|
@ -200,7 +201,7 @@ export default {
|
||||||
const list2tree1 = (list, parentId) => {
|
const list2tree1 = (list, parentId) => {
|
||||||
return list.filter((item) => {
|
return list.filter((item) => {
|
||||||
// 默认选中第一个节点
|
// 默认选中第一个节点
|
||||||
if (this.treeDataOne) this.treeDataOne.push(item.id)
|
if (this.treeDataOne) this.treeDataOne.push(item.value)
|
||||||
if (item.parentId === parentId) {
|
if (item.parentId === parentId) {
|
||||||
item.children = list2tree1(list, item.id)
|
item.children = list2tree1(list, item.id)
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -128,8 +128,10 @@ export default {
|
||||||
},
|
},
|
||||||
//提交表单
|
//提交表单
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
console.log('提交表单保存')
|
||||||
this.form.unitIds = this.targetKeys
|
this.form.unitIds = this.targetKeys
|
||||||
if (this.form.unitIds.length > 0) {
|
if (this.form.unitIds.length > 0) {
|
||||||
|
console.log('进来判断')
|
||||||
this.$emit('executeSave', this.form)
|
this.$emit('executeSave', this.form)
|
||||||
} else {
|
} else {
|
||||||
this.$message.warning('请选择培训单位')
|
this.$message.warning('请选择培训单位')
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
||||||
//例如:import 《组件名称》 from '《组件路径》'
|
//例如:import 《组件名称》 from '《组件路径》'
|
||||||
import { SearchCom, STable } from '@/components'
|
import { SearchCom, STable } from '@/components'
|
||||||
import { terminalTrainList, terminalTrainDel } from '@/api/project/terminalTrain'
|
import { terminalTrainList, terminalTrainDel ,releaseTerminalTrain } from '@/api/project/terminalTrain'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
//import引入的组件需要注入到对象中才能使用
|
//import引入的组件需要注入到对象中才能使用
|
||||||
|
@ -157,7 +157,13 @@ export default {
|
||||||
},
|
},
|
||||||
//发布项目
|
//发布项目
|
||||||
executeRelease(record) {
|
executeRelease(record) {
|
||||||
console.log('发布项目 id:', record.id)
|
// console.log('发布项目 id:', record.id)
|
||||||
|
releaseTerminalTrain({id:record.id}).then((res) => {
|
||||||
|
if(res.code == 200){
|
||||||
|
this.$message.success('项目:'+record.projectName+' 发布成功!');
|
||||||
|
this.$refs.table.refresh(false);
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
//跳转详情页面
|
//跳转详情页面
|
||||||
getDetail(record) {
|
getDetail(record) {
|
||||||
|
|
Loading…
Reference in New Issue