From e83e0afed3f380eb9ca4ea4c96f88b7094ccd154 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Tue, 6 Dec 2022 23:51:55 +0800 Subject: [PATCH] =?UTF-8?q?--=20=E9=A1=B9=E7=9B=AE=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=B8=A6=E5=87=BA=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/project/ProjectManagerNew.vue | 31 ++-- src/views/projectcenter/ProjectAdd.vue | 173 ++++++++++--------- src/views/projectcenter/ProjectManage.vue | 10 +- 3 files changed, 112 insertions(+), 102 deletions(-) diff --git a/src/components/project/ProjectManagerNew.vue b/src/components/project/ProjectManagerNew.vue index f3076888..9b802ec8 100644 --- a/src/components/project/ProjectManagerNew.vue +++ b/src/components/project/ProjectManagerNew.vue @@ -9,7 +9,7 @@ :placeholder="placeholder" :filterOption="false" style="width: 100%" - :options="options" + :options="isOpen?options:selectOptions" allowClear showSearch :mode="mode" @@ -39,13 +39,17 @@ const props = defineProps({ default: '' }, disabled: Boolean, - placeholder: String, + placeholder: { + type: String, + default: "请输入搜索关键字", + }, mode: String }) - const options = ref([]) +const selectOptions = ref([]) + const managerArray = computed(() => props.mode === 'select' ? props.value : (props.value ? props.value.split(',') : [])) const emit = defineEmits({}) @@ -61,10 +65,10 @@ watch(() => memberParam.value.pageNo, throttle(getPageMember, 500)) watch(props, init) function init() { - props.value && (options.value = props.value.split(',').map((e, i) => ({ - value: e, - label: props.name.split(',')[i] - }))) + //第一次进来 编辑赋值 + if (props.value && (props.value + '') !== selectOptions.value.map(e => e.value).join(',')) { + selectOptions.value = (props.value + '').split(',').map((e, i) => ({label: props.name.split(',')[i], value: e})) + } } onMounted(() => { @@ -94,7 +98,8 @@ function getMemberData() { } const list = res.data.data.rows.filter(e => !(props.value + '').includes(e.id)).map(e => ({ label: e.realName, - value: e.id + value: e.id, + deptId: e.departId })); memberParam.value.pageNo === 1 && props.value ? (options.value = list) : options.value.push(...list) loading.value = false @@ -117,16 +122,10 @@ const searchMember = (keyWord) => { }; function change(e, l) { - console.log('change', l) + selectOptions.value = l isOpen.value = false + emit('onChange', e, l, selectOptions.value.find(e => e.deptId)?.deptId) if (Array.isArray(l)) { - // const selectIds = l.filter(t => t.value).map(t => t.value).join(',') - // const arr = props.value ? props.value.split(',').filter(e => !selectIds.includes(e)).map((e, i) => ({ - // value: e, - // name: props.name.split(',')[i] - // })) : [] - // l.push(...arr) - // l=l.filter(t => t.label) emit('update:name', l.map(t => t.label).join(',')) emit('update:value', l.map(t => t.value).join(',')) } else { diff --git a/src/views/projectcenter/ProjectAdd.vue b/src/views/projectcenter/ProjectAdd.vue index e788de34..664d9909 100644 --- a/src/views/projectcenter/ProjectAdd.vue +++ b/src/views/projectcenter/ProjectAdd.vue @@ -3,13 +3,13 @@
{{ projectInfo.parentId ? "编辑" : "创建" }}项目{{ projectInfo.parentId ? "编辑" : "创建" }}项目
返回
@@ -19,8 +19,8 @@
项目归属
@@ -33,26 +33,26 @@
项目名称
分类
@@ -63,8 +63,8 @@
封面图
@@ -98,53 +98,54 @@
项目时间
项目经理
资源归属
@@ -154,12 +155,12 @@
@@ -169,16 +170,16 @@
同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)
是否BOEU实施
@@ -240,8 +241,8 @@ :disabled="viewDetail ? true : false" > --> @@ -254,19 +255,19 @@
模版
{ return triggerNode.parentNode || document.body; } " - v-model:value="classifySelect5" - placeholder="请选择模版" - :size="size" - style="width: 100%" - :options="classifyList5" - @change="classificationChange5" - @popupScroll="templateScroll" - :fieldNames="{ + v-model:value="classifySelect5" + placeholder="请选择模版" + :size="size" + style="width: 100%" + :options="classifyList5" + @change="classificationChange5" + @popupScroll="templateScroll" + :fieldNames="{ label: 'name', value: 'projectTemplateId', }" @@ -279,7 +280,7 @@