Merge branch 'develop' of https://gitee.com/siwa-team/dawa-vue into develop

This commit is contained in:
18571350067 2021-12-28 19:55:25 +08:00
commit 6337cb1c0a
7 changed files with 81 additions and 48 deletions

View File

@ -6,6 +6,7 @@ const projectApi = {
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) {
@ -40,3 +41,10 @@ export function getProjectDetail (params) {
}) })
} }
export function releaseProject(params) {
return request({
url: projectApi.release,
method: 'post',
params: params
})
}

View File

@ -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) {
@ -43,3 +44,13 @@ export function terminalTrainGet(params) {
} }
}) })
} }
// releaseTerminalTrain
export function releaseTerminalTrain(params) {
console.log("terminalTrainRelease------------{}", params)
return request({
url: terminalTrainApi.release,
method: 'put',
params: params
})
}

View File

@ -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) {

View File

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

View File

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

View File

@ -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('请选择培训单位')

View File

@ -62,7 +62,7 @@
//jsjsjson //jsjsjson
//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) {