mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 06:16:46 +08:00
讲师管理
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
/>
|
||||
</template>
|
||||
<script setup>
|
||||
import {defineProps, defineExpose, ref, computed, onMounted, defineEmits, nextTick} from "vue";
|
||||
import {defineProps, defineExpose, ref, computed, onMounted, defineEmits, nextTick,watch} from "vue";
|
||||
import {usePage, useRequest, useRowsPageNoInit} from "@/api/request";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
@@ -65,7 +65,11 @@
|
||||
showSizeChanger:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
selectedRowKeys:{
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["update:params", "update:selectedRowKeys", "update:selectedRows"]);
|
||||
const rowSelectKeys = ref([]);
|
||||
@@ -74,7 +78,11 @@
|
||||
const postParam = computed(() => ({ ...params.value, ...props.params }));
|
||||
|
||||
const { data, loading, total, fetch: onFetch } = props.request(props.url, postParam);
|
||||
|
||||
watch(()=>data.value,(val)=>{
|
||||
if(val&&props.selectedRowKeys){
|
||||
rowSelectKeys.value = props.selectedRowKeys
|
||||
}
|
||||
})
|
||||
const rowSelection = computed(() => (props.type ? {
|
||||
type: props.type,
|
||||
columnWidth: 20,
|
||||
@@ -160,6 +168,7 @@
|
||||
|
||||
const fetch = () => nextTick(onFetch);
|
||||
|
||||
|
||||
defineExpose({ fetch, reset, resetSelected, clear, toLoading, remove , params });
|
||||
|
||||
</script>
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<a-button @click="openDrawer" type="link">
|
||||
<a-button @click="openDrawer" type="link" style="width:100%">
|
||||
<slot></slot>
|
||||
</a-button>
|
||||
</div>
|
||||
@@ -149,16 +149,16 @@ watch(stuSelectRows,(val)=>{
|
||||
teaunm.value = []
|
||||
return
|
||||
}
|
||||
console.log(stuSelectRowKeys.value,'xixixixi')
|
||||
teaunm.value = val.map((res,index)=>{
|
||||
return {
|
||||
userName:res.realName,
|
||||
userNo:res.userNo,
|
||||
type: props.type,
|
||||
userId: res.id,
|
||||
label: res.realName + res.userNo,
|
||||
...res
|
||||
}
|
||||
})
|
||||
console.log(teaunm.value);
|
||||
},{deep:true})
|
||||
const person = ref(false);
|
||||
const visiable = ref(false);
|
||||
@@ -238,6 +238,8 @@ function onLoadData(treeNode) {
|
||||
|
||||
const openDrawer = () => {
|
||||
visiable.value = true;
|
||||
stuSelectRows.value = props.arrayList
|
||||
stuSelectRowKeys.value = props.arrayList.map(item=>item.userId)
|
||||
};
|
||||
|
||||
function onSearchStu() {
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
</template>
|
||||
</a-table>
|
||||
<div class="tableBox ">
|
||||
<div style="float: right;">
|
||||
<div class="pa">
|
||||
|
||||
<a-pagination
|
||||
v-if="tableDataTotal > 10"
|
||||
:showSizeChanger="false"
|
||||
:showSizeChanger="true"
|
||||
:showQuickJumper="true"
|
||||
:hideOnSinglePage="true"
|
||||
:pageSize="searchParam.pageSize"
|
||||
@@ -122,7 +122,7 @@
|
||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||
<!-- <ProjectManager :type="0" v-model:value="formParam.actValue" :placeholder="'请选择担当'" v-model:arrayList="formParam.actArray" ></ProjectManager> -->
|
||||
<AddApprover v-model:arrayList="formParam.actArray" @valueChange="valueChange" :type="0">
|
||||
<a-select v-model:value="formParam.actValue" :open="false" :placeholder="'请选择担当'"></a-select>
|
||||
<a-select style="width:100%" v-model:value="formParam.actValue" :open="false" :placeholder="'请选择担当'"></a-select>
|
||||
</AddApprover>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -132,14 +132,20 @@
|
||||
<a-form-item label="一级审批人" name="leveOneValue">
|
||||
<!-- <a-select v-model:value="formParam.yjspr" placeholder="请选择一级审批人"
|
||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||
<ProjectManager :type="1" v-model:value="formParam.leveOneValue" :placeholder="'请选择一级审批人'" v-model:arrayList="formParam.leveOneArray" ></ProjectManager>
|
||||
<!-- <ProjectManager :type="1" v-model:value="formParam.leveOneValue" :placeholder="'请选择一级审批人'" v-model:arrayList="formParam.leveOneArray" ></ProjectManager> -->
|
||||
<AddApprover v-model:arrayList="formParam.leveOneArray" @valueChange="valueChange" :type="1">
|
||||
<a-select style="width:100%" v-model:value="formParam.leveOneValue" :open="false" :placeholder="'请选择一级审批人'"></a-select>
|
||||
</AddApprover>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="二级审批人">
|
||||
<!-- <a-select v-model:value="formParam.zzfzr" placeholder="请选择二级审批人"
|
||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||
<ProjectManager :type="1" :placeholder="'请选择二级审批人'" v-model:arrayList="formParam.leveTwoArray" ></ProjectManager>
|
||||
<!-- <ProjectManager :type="1" :placeholder="'请选择二级审批人'" v-model:arrayList="formParam.leveTwoArray" ></ProjectManager> -->
|
||||
<AddApprover v-model:arrayList="formParam.leveTwoArray" @valueChange="valueChange" :type="2">
|
||||
<a-select style="width:100%" v-model:value="formParam.leveTwoValue" :open="false" :placeholder="'请选择二级审批人'"></a-select>
|
||||
</AddApprover>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -148,7 +154,10 @@
|
||||
<a-form-item label="三级审批人" >
|
||||
<!-- <a-select v-model:value="formParam.sjspr" placeholder="请选择三级审批人"
|
||||
:options="PlaceOfPayList" allowClear showSearch/> -->
|
||||
<ProjectManager :type="1" :placeholder="'请选择三级审批人'" v-model:arrayList="formParam.leveThreeArray" ></ProjectManager>
|
||||
<!-- <ProjectManager :type="1" :placeholder="'请选择三级审批人'" v-model:arrayList="formParam.leveThreeArray" ></ProjectManager> -->
|
||||
<AddApprover v-model:arrayList="formParam.leveThreeArray" @valueChange="valueChange" :type="3">
|
||||
<a-select style="width:100%" v-model:value="formParam.leveThreeValue" :open="false" :placeholder="'请选择三级审批人'"></a-select>
|
||||
</AddApprover>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
@@ -227,6 +236,7 @@ export default{
|
||||
setup() {
|
||||
const formRef = ref();
|
||||
const state = reactive({
|
||||
tableDataTotal: 0,
|
||||
vf:true,
|
||||
showContent: false,
|
||||
tableLoading:false,
|
||||
@@ -247,6 +257,8 @@ export default{
|
||||
actValue: null,
|
||||
actArray: [],
|
||||
leveOneValue: null,
|
||||
leveTwoValue: null,
|
||||
leveThreeValue: null,
|
||||
leveOneArray: [],
|
||||
leveTwoArray: [],
|
||||
leveThreeArray: [],
|
||||
@@ -397,6 +409,7 @@ const getTableDate = (obj) => {
|
||||
let objA = { ...state.searchParam };
|
||||
queryTrainOrg(objA)
|
||||
.then((res) => {
|
||||
console.log(res,'res')
|
||||
tableData.value = res.data.data.records
|
||||
state.tableDataTotal = Number(res.data.data.total);
|
||||
state.tableLoading = false
|
||||
@@ -487,6 +500,7 @@ const getTableDate = (obj) => {
|
||||
return {
|
||||
label: item.userName + item.userNo,
|
||||
value: item.userId,
|
||||
realName: item.userName,
|
||||
...item
|
||||
};
|
||||
});
|
||||
@@ -495,6 +509,7 @@ const getTableDate = (obj) => {
|
||||
return {
|
||||
label: item.userName + item.userNo,
|
||||
value: item.userId,
|
||||
realName: item.userName,
|
||||
...item
|
||||
};
|
||||
});
|
||||
@@ -503,16 +518,20 @@ const getTableDate = (obj) => {
|
||||
return {
|
||||
label: item.userName + item.userNo,
|
||||
value: item.userId,
|
||||
realName: item.userName,
|
||||
...item
|
||||
};
|
||||
});
|
||||
state.formParam.leveTwoValue = state.formParam.leveTwoArray.map(item => item.label).join(',');
|
||||
state.formParam.leveThreeArray = leveThreeArray.map(item => {
|
||||
return {
|
||||
label: item.userName + item.userNo,
|
||||
value: item.userId,
|
||||
realName: item.userName,
|
||||
...item
|
||||
};
|
||||
});
|
||||
state.formParam.leveThreeValue = state.formParam.leveThreeArray.map(item => item.label).join(',');
|
||||
state.teacherdialog = true;
|
||||
state.teacherdialogtitle = '修改归属组织'
|
||||
state.vf = false
|
||||
@@ -533,6 +552,8 @@ const getTableDate = (obj) => {
|
||||
actValue: null,
|
||||
actArray: [],
|
||||
leveOneValue: null,
|
||||
leveTwoValue:null,
|
||||
leveThreeValue:null,
|
||||
leveOneArray: [],
|
||||
leveTwoArray: [],
|
||||
leveThreeArray: [],
|
||||
@@ -553,6 +574,17 @@ const getTableDate = (obj) => {
|
||||
}
|
||||
const valueChange = (val) => {
|
||||
console.log(val,'vallll')
|
||||
if(val.length>0){
|
||||
if(val[0].type==0){
|
||||
state.formParam.actValue = val.map(item=>item.label).join(',') || null
|
||||
}else if(val[0].type==1){
|
||||
state.formParam.leveOneValue = val.map(item=>item.label).join(',') || null
|
||||
}else if(val[0].type==2){
|
||||
state.formParam.leveTwoValue = val.map(item=>item.label).join(',') || null
|
||||
}else if(val[0].type==3){
|
||||
state.formParam.leveThreeValue = val.map(item=>item.label).join(',') || null
|
||||
}
|
||||
}
|
||||
}
|
||||
//保存
|
||||
const createTeacherDialog = async () => {
|
||||
@@ -635,7 +667,24 @@ const getTableDate = (obj) => {
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.tableBox {
|
||||
padding-bottom: 20px;
|
||||
margin: 20px 38px 30px;
|
||||
::v-deep .ant-select-dropdown{
|
||||
display: inline-block;
|
||||
}
|
||||
::v-deep .ant-select-selection-item{
|
||||
margin-left: 3px;
|
||||
}
|
||||
::v-deep .ant-pagination-options-size-changer.ant-select{
|
||||
width: 84px;
|
||||
}
|
||||
.pa {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
}
|
||||
}
|
||||
.add_content{
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
@@ -932,6 +981,7 @@ position: relative;
|
||||
border-radius:8px;
|
||||
height:40px;
|
||||
line-height: 40px;
|
||||
text-align: left;
|
||||
}
|
||||
.ant-col-12{
|
||||
height:90px;
|
||||
|
||||
Reference in New Issue
Block a user