Commit 4650bd49 by lijiabin

feat: 实践发布支持选择所属一级部门

parent a24b3b2b
...@@ -15,6 +15,7 @@ export interface AddOrUpdatePracticeDto { ...@@ -15,6 +15,7 @@ export interface AddOrUpdatePracticeDto {
tagList: { tagId: number; sort: number }[] tagList: { tagId: number; sort: number }[]
sendType: SendTypeEnum sendType: SendTypeEnum
sendTime: string sendTime: string
deptId?: string
type?: ArticleTypeEnum type?: ArticleTypeEnum
} }
......
...@@ -62,6 +62,21 @@ ...@@ -62,6 +62,21 @@
:height="100" :height="100"
/> />
</div> </div>
<div v-if="userInfo.isOfficialAccount && type === ArticleTypeEnum.PRACTICE" class="mb-3">
<el-select
v-model="form.deptId"
placeholder="请选择所属一级部门"
clearable
class="w-full"
>
<el-option
v-for="item in firstDepListOptions"
:key="item.id"
:value="item.id"
:label="item.name"
/>
</el-select>
</div>
<!-- 标签内容 --> <!-- 标签内容 -->
<div class="mb-2"> <div class="mb-2">
<!-- 选择的标签内容 --> <!-- 选择的标签内容 -->
...@@ -148,7 +163,12 @@ import { useUserStore } from '@/stores' ...@@ -148,7 +163,12 @@ import { useUserStore } from '@/stores'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import SelectTagsDialog from './components/selectTagsDialog.vue' import SelectTagsDialog from './components/selectTagsDialog.vue'
import { useResetData, useUploadImg } from '@/hooks' import { useResetData, useUploadImg } from '@/hooks'
import { ArticleTypeEnum, ReleaseStatusTypeEnum, SendTypeEnum } from '@/constants' import {
ArticleTypeEnum,
firstDepListOptions,
ReleaseStatusTypeEnum,
SendTypeEnum,
} from '@/constants'
import { useTagsStore } from '@/stores' import { useTagsStore } from '@/stores'
import { addOrUpdatePractice, addOrUpdateArticle } from '@/api' import { addOrUpdatePractice, addOrUpdateArticle } from '@/api'
import type { AddOrUpdatePracticeDto } from '@/api' import type { AddOrUpdatePracticeDto } from '@/api'
...@@ -238,6 +258,7 @@ const [form, , forReset] = useResetData({ ...@@ -238,6 +258,7 @@ const [form, , forReset] = useResetData({
tagList: [], tagList: [],
sendType: SendTypeEnum.IMMEDIATE, sendType: SendTypeEnum.IMMEDIATE,
sendTime: '', sendTime: '',
deptId: '',
}) })
const { imgList, handleFileChange, handleDeleteImg, uploadPercent } = useUploadImg( const { imgList, handleFileChange, handleDeleteImg, uploadPercent } = useUploadImg(
......
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