mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 11:56:46 +08:00
讲师查询管理供应商
This commit is contained in:
@@ -1,10 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-select :getPopupContainer="(triggerNode) => {
|
<a-select
|
||||||
return triggerNode.parentNode || document.body;
|
:getPopupContainer="
|
||||||
}
|
(triggerNode) => {
|
||||||
" v-model:value="managerArray" :placeholder="placeholder" :filterOption="false"
|
return triggerNode.parentNode || document.body;
|
||||||
:options="isOpen ? options : selectOptions" allowClear showSearch :disabled="disabled" @popupScroll="memberScroll"
|
}
|
||||||
@search="searchMember" :open="isOpen" @change="change" @blur="blur" :show-arrow="false" style="width: 100%">
|
"
|
||||||
|
v-model:value="managerArray"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
:filterOption="false"
|
||||||
|
:options="isOpen ? options : selectOptions"
|
||||||
|
allowClear
|
||||||
|
showSearch
|
||||||
|
:disabled="disabled"
|
||||||
|
@popupScroll="memberScroll"
|
||||||
|
@search="searchMember"
|
||||||
|
:open="isOpen"
|
||||||
|
@change="change"
|
||||||
|
@blur="blur"
|
||||||
|
:show-arrow="false"
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
<template v-if="loading" #notFoundContent>
|
<template v-if="loading" #notFoundContent>
|
||||||
<a-spin size="small" />
|
<a-spin size="small" />
|
||||||
</template>
|
</template>
|
||||||
@@ -17,31 +32,38 @@ import { getTeacherList } from "@/api/Lecturer";
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
value: {
|
value: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: "",
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: "",
|
||||||
|
},
|
||||||
|
supplier: {
|
||||||
|
type: String,
|
||||||
|
default: ""
|
||||||
},
|
},
|
||||||
mobile: {
|
mobile: {
|
||||||
type: String,
|
type: String,
|
||||||
default: ''
|
default: "",
|
||||||
},
|
},
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
placeholder: {
|
placeholder: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "请输入搜索关键字",
|
default: "请输入搜索关键字",
|
||||||
},
|
},
|
||||||
mode: String
|
mode: String,
|
||||||
})
|
});
|
||||||
|
|
||||||
const selectOptions = ref([])
|
const selectOptions = ref([]);
|
||||||
|
|
||||||
const managerArray = computed(() => props.value === '' ? null : props.value)
|
const supplier = ref('')
|
||||||
|
|
||||||
const emit = defineEmits({})
|
|
||||||
|
|
||||||
const isOpen = ref(false)
|
const managerArray = computed(() => (props.value === "" ? null : props.value));
|
||||||
|
|
||||||
|
const emit = defineEmits({});
|
||||||
|
|
||||||
|
const isOpen = ref(false);
|
||||||
function debounce(func, wait) {
|
function debounce(func, wait) {
|
||||||
let timeout;
|
let timeout;
|
||||||
return function (...args) {
|
return function (...args) {
|
||||||
@@ -49,29 +71,36 @@ function debounce(func, wait) {
|
|||||||
timeout = setTimeout(() => func.apply(this, args), wait);
|
timeout = setTimeout(() => func.apply(this, args), wait);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const memberParam = ref({ name: '', pageNo: 1, pageSize: 999, teacherType: 2, status: 1 })
|
const memberParam = ref({
|
||||||
|
name: "",
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 999,
|
||||||
|
teacherType: 2,
|
||||||
|
status: 1,
|
||||||
|
});
|
||||||
|
|
||||||
const userList = ref([])
|
const userList = ref([]);
|
||||||
const loading = ref(false)
|
const loading = ref(false);
|
||||||
const getOutTeacher = () => {
|
const getOutTeacher = () => {
|
||||||
getTeacherList(memberParam.value).then(res => {
|
getTeacherList(memberParam.value).then((res) => {
|
||||||
if (res.data.code == 200) {
|
if (res.data.code == 200) {
|
||||||
userList.value = res.data.data.records
|
userList.value = res.data.data.records;
|
||||||
loading.value = false
|
loading.value = false;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
const options = computed(() =>
|
const options = computed(() =>
|
||||||
userList.value.map(e => ({
|
userList.value.map((e) => ({
|
||||||
// label: e.name + '(' + e.userNo + ')' + e.organizationName,
|
// label: e.name + '(' + e.userNo + ')' + e.organizationName,
|
||||||
label: e.name + '/' + e.supplier,
|
label: e.name + "/" + e.supplier,
|
||||||
value: e.name,
|
value: e.name,
|
||||||
...e,
|
supplier: e.supplier,
|
||||||
audienceList: null
|
...e,
|
||||||
})
|
audienceList: null,
|
||||||
))
|
}))
|
||||||
|
);
|
||||||
|
|
||||||
watch(props, init)
|
watch(props, init);
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
//第一次进来 编辑赋值
|
//第一次进来 编辑赋值
|
||||||
@@ -81,46 +110,47 @@ function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
console.log('onMounted')
|
console.log("onMounted");
|
||||||
init()
|
init();
|
||||||
getOutTeacher()
|
getOutTeacher();
|
||||||
})
|
});
|
||||||
|
|
||||||
|
const memberScroll = ({
|
||||||
const memberScroll = ({ target: { scrollHeight, scrollTop, clientHeight } }) => {
|
target: { scrollHeight, scrollTop, clientHeight },
|
||||||
scrollHeight === (clientHeight + scrollTop) && memberParam.value.pageNo++
|
}) => {
|
||||||
|
scrollHeight === clientHeight + scrollTop && memberParam.value.pageNo++;
|
||||||
};
|
};
|
||||||
const debounceObject = debounce(getOutTeacher, 1000)
|
const debounceObject = debounce(getOutTeacher, 1000);
|
||||||
//搜索学员
|
//搜索学员
|
||||||
const searchMember = (keyword) => {
|
const searchMember = (keyword) => {
|
||||||
console.log('searchMember', keyword)
|
console.log("searchMember", keyword);
|
||||||
loading.value = true
|
loading.value = true;
|
||||||
isOpen.value = true
|
isOpen.value = true;
|
||||||
userList.value = []
|
userList.value = [];
|
||||||
memberParam.value.pageNo = 1
|
memberParam.value.pageNo = 1;
|
||||||
memberParam.value.teacherType = 2
|
memberParam.value.teacherType = 2;
|
||||||
memberParam.value.name = keyword
|
memberParam.value.name = keyword;
|
||||||
console.log('searchMember', memberParam.value)
|
console.log("searchMember", memberParam.value);
|
||||||
debounceObject()
|
debounceObject();
|
||||||
};
|
};
|
||||||
|
|
||||||
function blur() {
|
function blur() {
|
||||||
isOpen.value = false
|
isOpen.value = false;
|
||||||
memberParam.value.name = ''
|
memberParam.value.name = "";
|
||||||
memberParam.value.pageNo = 1
|
memberParam.value.pageNo = 1;
|
||||||
memberParam.value.teacherType = 2
|
memberParam.value.teacherType = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
function change(e, l) {
|
function change(e, l) {
|
||||||
memberParam.value.name = ''
|
memberParam.value.name = "";
|
||||||
memberParam.value.teacherType = 2
|
memberParam.value.teacherType = 2;
|
||||||
memberParam.value.pageNo = 1
|
memberParam.value.pageNo = 1;
|
||||||
isOpen.value = false
|
isOpen.value = false;
|
||||||
Array.isArray(l) && (selectOptions.value = l)
|
Array.isArray(l) && (selectOptions.value = l);
|
||||||
Array.isArray(selectOptions.value) && emit('onChange', e, l)
|
Array.isArray(selectOptions.value) && emit("onChange", e, l);
|
||||||
emit('update:name', l?.label)
|
emit("update:name", l?.label);
|
||||||
emit('update:value', l?.value)
|
emit("update:value", l?.value);
|
||||||
emit('update:mobile', l?.label)
|
emit("update:supplier", l?.supplier);
|
||||||
|
emit("update:mobile", l?.label);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -139,7 +139,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<!-- TODO GX01 -->
|
<!-- TODO GX01 -->
|
||||||
<ProjectManagerOutTeacher v-model:value="formParam.name" v-model:name="formParam.teacherName"
|
<ProjectManagerOutTeacher v-model:value="formParam.name" v-model:name="formParam.teacherName"
|
||||||
placeholder="请输入工号/讲师姓名进行检索" @onChange="managerChange"></ProjectManagerOutTeacher>
|
v-model:supplier="formParam.supplier"
|
||||||
|
placeholder="请输入工号/讲师姓名进行检索" @onChange="managerChange"></ProjectManagerOutTeacher>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="12">
|
||||||
@@ -474,15 +475,15 @@ export default {
|
|||||||
|
|
||||||
//获取内容分类
|
//获取内容分类
|
||||||
const sysTypeOptions = computed(() => store.state.content_type);
|
const sysTypeOptions = computed(() => store.state.content_type);
|
||||||
|
|
||||||
//TODO GX01
|
watch(() => state.formParam.name, (val) => {
|
||||||
watch(() => state.formParam.name ,
|
console.log(val, 'name gx data')
|
||||||
(newValue, oldValue) => {
|
})
|
||||||
console.log('教师姓名值 发生了变更', newValue, oldValue);
|
|
||||||
},
|
watch(() => state.formParam.teacherName, (val) => {
|
||||||
{ immediate: true }
|
console.log(val, 'teacherName gx data')
|
||||||
)
|
})
|
||||||
|
|
||||||
const treetype = (val, lab) => {
|
const treetype = (val, lab) => {
|
||||||
state.formParam.courseTypeName = lab.toString()
|
state.formParam.courseTypeName = lab.toString()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,6 +172,7 @@
|
|||||||
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
|
src="@/assets/images/coursewareManage/asterisk.png" alt="" />
|
||||||
讲师姓名
|
讲师姓名
|
||||||
</template>
|
</template>
|
||||||
|
<!-- TODO GX01 -->
|
||||||
<SearchTeacher @tlevel="teacherTlevel" :lecturer="true" :disabled="!!id"
|
<SearchTeacher @tlevel="teacherTlevel" :lecturer="true" :disabled="!!id"
|
||||||
v-model:value="formParam.name" v-model:lable="formParam.orgNames" v-model:orgId="formParam.orgId"
|
v-model:value="formParam.name" v-model:lable="formParam.orgNames" v-model:orgId="formParam.orgId"
|
||||||
v-model:id="formParam.id" v-model:system="tSystemNames" v-model:level="formParam.tlevelId">
|
v-model:id="formParam.id" v-model:system="tSystemNames" v-model:level="formParam.tlevelId">
|
||||||
|
|||||||
Reference in New Issue
Block a user