Merge branch 'zcwy-teacher-manage' of https://codeup.aliyun.com/648097ddb583fece2f059e59/vue/fe-manage into zcwy-teacher-manage

This commit is contained in:
wangxuemei
2024-11-18 16:26:11 +08:00
7 changed files with 91 additions and 41 deletions

View File

@@ -42,7 +42,7 @@
v-for="(item, index) in treeAddData"
:key="index"
>
<div class="tag_text" :title="`${item?.orgName} - (原:${item?.updateName || '-'})`">{{ item?.orgName }} - ({{ item?.updateName || '-' }})</div>
<div class="tag_text" :title="`${item?.name} - (原:${item?.orgName || '-'})`">{{ item?.name }} - ({{ item?.orgName || '-' }})</div>
<div @click="deleteTree(item)" class="tag_delete">+</div>
</div>
</div>
@@ -105,6 +105,7 @@ import * as lecturerApi from "@/api/Lecturer.js";
console.log(props.AddContentList,'xixiixix')
getNot()
treeAddData.value = props?.AddContentList
orgLists.value = props?.AddContentList
checkedKeys.value = props?.AddContentList?.map(item=>item.orgId)
}
});
@@ -113,32 +114,47 @@ import * as lecturerApi from "@/api/Lecturer.js";
console.log(res,'ressss')
})
}
const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => {
const orgLists = ref([])
const onCheck = async (checkedKeys, {checked: bool, checkedNodes, node, event}) => {
// "965356037047586816"
let length = treeAddData.value.length
if(checkedNodes.length > length){
lecturerApi.getSelectOrg(node.id).then(res=>{
console.log(res,'ressssss')
const targetNode = checkedNodes.find(item=>item.id === res?.data[0]?.orgId)
await lecturerApi.getSelectOrg(node.id).then(res=>{
const targetNode = checkedNodes.find(item=>item.id == res?.data?.data[0]?.orgId)
if(targetNode){
Object.assign(targetNode,res.data[0]);
orgLists.value.push(Object.assign(targetNode,res?.data?.data[0]));
}
}).catch(err=>{
message.error('获取被占用组织失败,请重新尝试')
})
}
checkedNodes = checkedNodes.map(item=>{
return {
orgId: item.id,
orgName: item.name,
affiliationId: item.id,
...item
treeAddData.value = checkedNodes.map(item => {
if (!item || !item.id) {
return item;
}
})
treeAddData.value = checkedNodes;
console.log(treeAddData.value,'checkedNodes')
try {
const orgItem = orgLists.value?.find(i => i && i.id == item.id);
if (orgItem) {
item.isSelect = orgItem.isSelect;
item.orgName = orgItem.orgName;
item.leaders = orgItem.leaders;
}
return {
orgId: item.id,
affiliationId: item.id,
...item
};
} catch (err) {
return item;
}
});
// treeAddData.value = checkedNodes;
console.log(treeAddData.value,'checkedNodes',orgLists.value)
}
const clearTree = () => {
treeAddData.value = [];
checkedKeys.value = [];
orgLists.value = [];
}
const deleteTree = (item) => {
treeAddData.value = treeAddData.value.filter(node => node.orgId !== item.orgId);

View File

@@ -83,7 +83,7 @@
</a-drawer>
</template>
<script setup>
<script setup lang="jsx">
import {defineEmits, defineProps, ref,watch} from "vue";
import * as api from '@/api/Lecturer'
const props = defineProps({
@@ -112,9 +112,25 @@ const columns = [
},
{
title: '状态',
dataIndex: 'address',
key: 'address',
dataIndex: 'status',
key: 'status',
align: 'center',
customRender: ({text})=>{
switch (text) {
case 1:
return <span>待审核</span>;
case 2:
return <span>审核中</span>;
case 3:
return <span>已完成</span>;
case 4:
return <span>审核失败</span>;
case 5:
return <span>待审核</span>;
default:
return <span>-</span>;
}
},
},
];
const formData = ref({})

View File

@@ -2,7 +2,7 @@
<template>
<div>
<!-- 搜索框及按钮 -->
<div class="filter" style="min-width: 1380px;">
<div class="filter" >
<a-form layout="inline">
<a-form-item class="select">
<!-- v-model:value="searchParam.name" -->
@@ -40,10 +40,10 @@
<template #action="{ record, column }">
<a-space >
<a-button type="link" @click="() => handleLook(record, String(record.courseform))">查看</a-button>
<a-button type="link" v-if="record.isPermission==='true'||record.isSuperPermission==='true'" @click="() => handleModify(record, String(record.courseform))">编辑</a-button>
<a-button v-if="record.status == '1'&&(record.isPermission==='true'||record.isSuperPermission==='true')" type="link"
<a-button type="link" @click="() => handleModify(record, String(record.courseform))">编辑</a-button>
<a-button v-if="record.status == '1'" type="link"
@click="() => handleOperate(record, String(record.courseform))">停用</a-button>
<a-button v-if="record.status == '2'&&(record.isPermission==='true'||record.isSuperPermission==='true')" type="link"
<a-button v-if="record.status == '2'" type="link"
@click="() => handleOperate(record, String(record.courseform))">启用</a-button>
<a-button type="link" v-if="record.isSuperPermission==='true'" @click="() => deleteModal(record, String(record.courseform))"
>删除</a-button>
@@ -79,12 +79,13 @@
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
:headers="headers" :before-upload="beforeUpload">
<img class="i_upload_img" v-if="formParam.photo" :src="formParam.photo" alt="avatar" title="更换头像" />
<div class="i_upload" v-else>
<img class="i_upload_img" v-else src="../../assets/avatar.png" alt="avatar" title="更换头像" />
<!-- <div class="i_upload" v-else>
<div class="addimg">
<div class="heng"></div>
<div class="shu"></div>
</div>
</div>
</div> -->
</a-upload>
<div class="i_bottom">
<div class="tip" style="margin-bottom: 10px;">
@@ -315,7 +316,7 @@ export default {
formParam: {
description:"",
teacherType:'2',
photo:avatar,
photo:null,
status:1,
teaching:'',
},
@@ -492,7 +493,7 @@ export default {
state.teacherdialog = true;
state.teacherdialogtitle = '新增讲师'
// state.formParam.photo =userInfo.value?.avatar
state.formParam.photo = avatar
state.formParam.photo = null
state.vf = true
state.formParam.status = '1'
// state.formParam.photo = state.formParam.photo === null ?boe : state.formParam.photo
@@ -679,7 +680,7 @@ export default {
console.log("外部讲师详情", res.data);
state.formParam = res.data.data
state.formParam.description = state.formParam.description === null ? '' : state.formParam.description
state.formParam.photo = state.formParam.photo === null ? userInfo.value?.avatar : state.formParam.photo
// state.formParam.photo = state.formParam.photo === null ? userInfo.value?.avatar : state.formParam.photo
})
.catch((err) => {
console.log("外部讲师详情", err);
@@ -715,7 +716,7 @@ export default {
}
const clearNonNumber = () => {
state.formParam.teaching = state.formParam.teaching.replace(/\D/g, '');
// state.formParam.teaching
state.formParam.teaching = state.formParam.teaching.slice(0,8)
}
const sendRemark=()=>{
state.formParam.remark = state.formParam.remark.replace(/\s/g, '');

View File

@@ -118,7 +118,7 @@
<a-space >
<a-button type="link" @click="() => handleLook(record, String(record.courseform))">查看</a-button>
<!-- :disabled="record.createFrom==1 ?false :true" -->
<a-button type="link" :disabled="record.createFrom==1 ?false :true" @click="() => handleModify(record, String(record.courseform))">编辑</a-button>
<a-button type="link" :disabled="record.createFrom!=1 ?false :true" @click="() => handleModify(record, String(record.courseform))">编辑</a-button>
<!-- <a-button :disabled="record.status==='A20' || record.status==='A30'||record.status==='S20' ?true :false" type="link" @click="() => handleOperate(record, String(record.courseform))">提交</a-button>
<a-button :disabled="record.status==='A10' && record.status!=='A20' || record.status==='A30'||record.status==='S20' ||record.status==='E10' ?true :false" type="link" @click="() => handleOperate(record, String(record.courseform))">撤回</a-button> -->
<!-- <a-button type="link" @click="() => deleteModal(record, String(record.courseform))">删除</a-button> -->

View File

@@ -170,8 +170,8 @@ export default{
},
{
title: '内容分类',
dataIndex: 'nrfl',
key: 'nrfl',
dataIndex: 'courseTypeName',
key: 'courseTypeName',
ellipsis: true, align: "center",
width: 120,
},

View File

@@ -235,7 +235,7 @@ export default{
{
title: "内容分类",
width: 100,
dataIndex: "sysType1",
dataIndex: "courseTypeName",
ellipsis: true,
key: "keywords",
align: "center",
@@ -352,22 +352,29 @@ export default{
const promotionrecordsColumns = ref([
{
title: '变更时间',
dataIndex: 'updateTime',
key: 'updateTime',
dataIndex: 'createTime',
key: 'createTime',
ellipsis: true, align: "center",
width: 120,
},
{
title: '变更方式',
dataIndex: 'operatorType',
key: 'operatorType',
dataIndex: 'type',
key: 'type',
ellipsis: true, align: "center",
width: 120,
customRender: (value) => {
return (
<div>
{value.record.type == 1 ? "自动" : value.record.type == 0 ? '手动':"-"}
</div>
)
}
},
{
title: '变更结果',
dataIndex: 'levelName',
key: 'levelName',
dataIndex: 'result',
key: 'result',
ellipsis: true, align: "center",
width: 120,
},

View File

@@ -200,7 +200,7 @@
<a-form-item label="">
<!-- <a-textarea v-model:value="formParam.remark" showCount :maxlength="200"
style="width: 100%; height: 100px; border-radius: 8px" placeholder="请输入" /> -->
<a-table :dataSource="formParam?.affiliationOrgList" :columns="orgColumns"/>
<a-table :dataSource="formParam?.affiliationOrgList" :scroll="{ x: '600' }" :columns="orgColumns"/>
</a-form-item>
</a-col>
</a-row>
@@ -391,15 +391,21 @@ const orgColumns = ref([
title: '组织名称',
dataIndex: 'orgName',
key: 'orgName',
ellipsis: true,
width: '20%',
align: 'center',
},
{
title: '是否被培训发生组织选择',
dataIndex: 'isSelect',
key: 'isSelect',
ellipsis: true,
align: 'center',
width: '30%',
customRender: (text) => {
return (
<div>
{text.record.isSelect == 1 ? `${text.record.isSelect} (${text.record.orgName})` : "否 (-)"}
{text.record.isSelect == 1 ? ` (${text.record.orgName})` : "否 (-)"}
</div>
)
}
@@ -408,6 +414,9 @@ const orgColumns = ref([
title: '担当',
dataIndex: 'leaders',
key: 'leaders',
ellipsis: true,
align: 'center',
width: '60%',
customRender: (text) => {
return (
<div>
@@ -572,6 +581,7 @@ const getTableDate = (obj) => {
};
});
state.formParam.leveThreeValue = state.formParam.leveThreeArray.map(item => item.label).join(',');
state.formParam.orglistName = state.formParam.affiliationOrgList?.map(item=>item.id).join(',')
state.teacherdialog = true;
state.teacherdialogtitle = '编辑培训发生组织'
state.vf = false
@@ -629,7 +639,7 @@ const getTableDate = (obj) => {
console.log(state.formParam,'state.formParam')
state.formParam.affiliationName = state.formParam.affiliationName?.trim()
state.formParam.affiliationUserList = [...state.formParam?.actArray,...state.formParam?.leveOneArray,...state.formParam?.leveTwoArray,...state.formParam?.leveThreeArray]
state.formParam.orglistName = state.formParam.affiliationOrgList?.map(item=>item.name).join(',')
state.formParam.orglistName = state.formParam.affiliationOrgList?.map(item=>item.id).join(',')
const formItemNames = Object.keys(rules);
for(let i=0;i<formItemNames.length;i++){
const result = await validateField(formItemNames[i]);