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

@ -2,20 +2,21 @@ import request from '@/utils/request'
const projectApi = {
add: 'project/addOrUpdate',
getDict:'project/dict/get',
getDict: 'project/dict/get',
list: 'project/pageList',
get: 'project/get',
projectCourseList: '',
release: '/project/release',
}
export function projectAdd (params) {
export function projectAdd(params) {
return request({
url: projectApi.add,
method: 'post',
data: params
})
}
export function dictGet (params) {
export function dictGet(params) {
return request({
url: projectApi.getDict,
method: 'get',
@ -23,7 +24,7 @@ export function dictGet (params) {
})
}
export function getProjectList (params) {
export function getProjectList(params) {
return request({
url: projectApi.list,
method: 'get',
@ -32,7 +33,7 @@ export function getProjectList (params) {
}
export function getProjectDetail (params) {
export function getProjectDetail(params) {
return request({
url: projectApi.get,
method: 'get',
@ -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',
del: '/project/terminal/del',
list: '/project/terminal/pageList',
get: '/project/terminal/get'
get: '/project/terminal/get',
release: '/project/terminal/release', //发布项目
}
export function terminalTrainEdit(params) {
@ -15,7 +16,7 @@ export function terminalTrainEdit(params) {
})
}
export function terminalTrainDel (params) {
export function terminalTrainDel(params) {
return request({
url: terminalTrainApi.del,
method: 'delete',
@ -39,7 +40,17 @@ export function terminalTrainGet(params) {
url: terminalTrainApi.get,
method: 'get',
params: {
id:params,
id: 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 slot="action" slot-scope="text, record">
<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 v-if="hasPerm('project:list')" href="javascript:;" @click="getDetail(record)">详情</a>
<a-divider type="vertical" v-if="hasPerm(power.edit) && hasPerm('project:list')" />
@ -56,7 +56,7 @@
<script>
import { STable } from '@/components'
import { getProjectList } from '@/api/project/project'
import { getProjectList,releaseProject } from '@/api/project/project'
export default {
components: {
@ -149,7 +149,12 @@ export default {
methods: {
//
handledRelease(record){
releaseProject({id: record.id}).then((res) => {
if(res.code == 200){
this.$message.success('项目:'+record.projectName+' 发布成功!');
this.$refs.table.refresh(false);
}
})
},
//
getDetail(record) {

View File

@ -12,7 +12,7 @@
<div class="content">
<!-- <keep-alive exclude="result"> -->
<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" />
<step4 v-if="currentTab === 3" :projectForm="form" @nextStep="nextStep" @prevStep="prevStep" />
<step5

View File

@ -7,7 +7,8 @@
<a-menu-item key="sys">系统课程</a-menu-item>
<a-menu-item key="self">自主课程</a-menu-item>
</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-tree>
</a-col>
@ -22,7 +23,7 @@
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
</a-row>
</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">
{{ index + 1 }}
</span>
@ -70,10 +71,10 @@ export default {
//
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: [],
autoExpandParent: true,
defaultExpandedKeys: [],
// defaultExpandedKeys: [],
selectedRowKeys: [],
selectedRows: [],
treeData: [],
@ -200,7 +201,7 @@ export default {
const list2tree1 = (list, parentId) => {
return list.filter((item) => {
//
if (this.treeDataOne) this.treeDataOne.push(item.id)
if (this.treeDataOne) this.treeDataOne.push(item.value)
if (item.parentId === parentId) {
item.children = list2tree1(list, item.id)
return true

View File

@ -128,8 +128,10 @@ export default {
},
//
handleSubmit() {
console.log('提交表单保存')
this.form.unitIds = this.targetKeys
if (this.form.unitIds.length > 0) {
console.log('进来判断')
this.$emit('executeSave', this.form)
} else {
this.$message.warning('请选择培训单位')

View File

@ -62,7 +62,7 @@
//jsjsjson
//import from ''
import { SearchCom, STable } from '@/components'
import { terminalTrainList, terminalTrainDel } from '@/api/project/terminalTrain'
import { terminalTrainList, terminalTrainDel ,releaseTerminalTrain } from '@/api/project/terminalTrain'
export default {
//import使
@ -157,7 +157,13 @@ export default {
},
//
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) {