Commit b02715a9 by lijiabin

【需求 21402】 feat: 官方账号发实践文章可以选择一级部门

parent 8b8c38e5
......@@ -207,6 +207,7 @@ export interface ArticleItemDto {
region: string
recommendSort: number
isOfficialAccount: BooleanFlag
deptId: string
}
/**
......
......@@ -263,3 +263,21 @@ export const specificVideoRewardListOptions: {
title: '从诗词歌赋聊到人生哲学',
},
]
export const firstDepListOptions = [
{ id: '1825', name: 'Amazon产品开发部' },
{ id: '76', name: 'Amazon销售部' },
{ id: '139', name: 'Amazon运营部' },
{ id: '5114', name: 'Temu销售部' },
{ id: '4491', name: 'Tiktok项目部' },
{ id: '39', name: '视觉设计部' },
{ id: '23', name: '知识产权部' },
{ id: '499', name: '供应链管理部' },
{ id: '20', name: 'IT技术部' },
{ id: '5', name: '财务部' },
{ id: '2357', name: '人力发展中心' },
{ id: '683', name: '副总经理' },
{ id: '6', name: '总经理' },
{ id: '3', name: '董事长' },
]
\ No newline at end of file
......@@ -75,7 +75,7 @@
</div>
<div class="flex flex-wrap gap-2">
<label
v-for="item in firstDepList"
v-for="item in firstDepListOptions"
:key="item.id"
:class="[
'px-4 py-2 rounded-lg text-sm font-medium cursor-pointer transition-all duration-200',
......@@ -228,14 +228,10 @@ import { getPracticeList } from '@/api/practice'
import { usePageSearch, useScrollTop } from '@/hooks'
import dayjs from 'dayjs'
import { TABS_REF_KEY } from '@/constants'
// import { useTagsStore } from '@/stores/tags'
// import { storeToRefs } from 'pinia'
import PublishPractice from '@/components/common/PublishBox/index.vue'
import { ArticleTypeEnum } from '@/constants'
import { ArticleTypeEnum ,firstDepListOptions} from '@/constants'
import { useNavigation } from '@/hooks'
// const tagsStore = useTagsStore()
// const { tagList } = storeToRefs(tagsStore)
const router = useRouter()
const { jumpToArticleDetailPage } = useNavigation()
......@@ -245,22 +241,6 @@ const filterOptions = ref([
{ title: '最新', id: 1 },
{ title: '最热', id: 0 },
])
const firstDepList = ref([
{ id: '1825', name: 'Amazon产品开发部' },
{ id: '76', name: 'Amazon销售部' },
{ id: '139', name: 'Amazon运营部' },
{ id: '5114', name: 'Temu销售部' },
{ id: '4491', name: 'Tiktok项目部' },
{ id: '39', name: '视觉设计部' },
{ id: '23', name: '知识产权部' },
{ id: '499', name: '供应链管理部' },
{ id: '20', name: 'IT技术部' },
{ id: '5', name: '财务部' },
{ id: '2357', name: '人力发展中心' },
{ id: '683', name: '副总经理' },
{ id: '6', name: '总经理' },
{ id: '3', name: '董事长' },
])
const { handleBackTop, ScrollTopComp } = useScrollTop(tabsRef!)
const { list, total, searchParams, goToPage, changePageSize, refresh } = usePageSearch(
getPracticeList,
......
......@@ -63,7 +63,7 @@
</div>
<div class="flex flex-wrap gap-2">
<label
v-for="item in firstDepList"
v-for="item in firstDepListOptions"
:key="item.id"
:class="[
'px-4 py-2 rounded-lg text-sm font-medium cursor-pointer transition-all duration-200',
......@@ -241,6 +241,7 @@ import { usePageSearch, useScrollTop, useNavigation } from '@/hooks'
import dayjs from 'dayjs'
import { storeToRefs } from 'pinia'
import { useTagsStore } from '@/stores/tags'
import { firstDepListOptions } from '@/constants'
const tagsStore = useTagsStore()
const { tagList } = storeToRefs(tagsStore)
......@@ -249,22 +250,7 @@ const route = useRoute()
const searchPageRef = ref<HTMLElement | null>(null)
const { handleBackTop } = useScrollTop(searchPageRef)
const { jumpToArticleDetailPage } = useNavigation()
const firstDepList = ref([
{ id: '1825', name: 'Amazon产品开发部' },
{ id: '76', name: 'Amazon销售部' },
{ id: '139', name: 'Amazon运营部' },
{ id: '5114', name: 'Temu销售部' },
{ id: '4491', name: 'Tiktok项目部' },
{ id: '39', name: '视觉设计部' },
{ id: '23', name: '知识产权部' },
{ id: '499', name: '供应链管理部' },
{ id: '20', name: 'IT技术部' },
{ id: '5', name: '财务部' },
{ id: '2357', name: '人力发展中心' },
{ id: '683', name: '副总经理' },
{ id: '6', name: '总经理' },
{ id: '3', name: '董事长' },
])
const sortOptions = [
{ label: '最新', value: 1 },
{ label: '最热', value: 0 },
......
......@@ -280,6 +280,19 @@
/>
</el-form-item>
</template>
<!-- 选一级部门 如果是官方账号 并且是 实践 选填 -->
<template v-if="userInfo.isOfficialAccount && form.type === ArticleTypeEnum.PRACTICE">
<el-form-item label="所属一级部门">
<el-select v-model="form.deptId" :placeholder="`请选择一级部门`" clearable>
<el-option
v-for="item in firstDepListOptions"
:key="item.id"
:value="item.id"
:label="item.name"
/>
</el-select>
</el-form-item>
</template>
<!-- 发布设置 -->
<div>
<el-form-item label="发布时间" prop="sendType">
......@@ -308,7 +321,11 @@
<template #footer>
<div class="flex gap-3 justify-end">
<el-button @click="handleDrawerClose" class="rounded-lg">取消</el-button>
<el-button @click="handleSubmit(ReleaseStatusTypeEnum.DRAFT)" class="rounded-lg">
<el-button
:loading="loading"
@click="handleSubmit(ReleaseStatusTypeEnum.DRAFT)"
class="rounded-lg"
>
存草稿
</el-button>
<el-button
......@@ -335,6 +352,7 @@ import {
ReleaseStatusTypeEnum,
articleTypeListOptions,
VideoPositionEnum,
firstDepListOptions,
} from '@/constants'
import UploadFile from '@/components/common/UploadFile/index.vue'
import UploadVideo from '@/components/common/UploadVideo/index.vue'
......@@ -399,6 +417,7 @@ const [form, resetForm] = useResetData({
// 视频
videoLocation: VideoPositionEnum.TOP,
articleVideoUrl: '',
deptId: '',
})
// 时间选择只允许整十分(:00、:10、:20、:30、:40、:50),秒固定为 0
......@@ -519,6 +538,9 @@ const transFormData = (releaseStatus: ReleaseStatusTypeEnum) => {
}
}
if (data.type === ArticleTypeEnum.PRACTICE && userInfo.value.isOfficialAccount) {
data.deptId = data.deptId || ''
}
return data
}
......@@ -646,6 +668,10 @@ onActivated(async () => {
})) || []
}
}
if (userInfo.value.isOfficialAccount && form.value.type === ArticleTypeEnum.PRACTICE) {
form.value.deptId = data.deptId
}
}
})
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment