|
@@ -257,6 +257,20 @@
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+ <div v-if="isAdmin" class="field mt-4">
|
|
|
|
|
+ <label for="edit-teamId" class="font-medium text-sm mb-2 block">选择团队</label>
|
|
|
|
|
+ <Select
|
|
|
|
|
+ id="edit-teamId"
|
|
|
|
|
+ v-model="editForm.teamId"
|
|
|
|
|
+ :options="teamSelectOptions"
|
|
|
|
|
+ optionLabel="label"
|
|
|
|
|
+ optionValue="value"
|
|
|
|
|
+ placeholder="选择团队"
|
|
|
|
|
+ class="w-full"
|
|
|
|
|
+ showClear
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
<div class="field mt-4">
|
|
<div class="field mt-4">
|
|
|
<label for="edit-link" class="font-medium text-sm mb-2 block">链接地址</label>
|
|
<label for="edit-link" class="font-medium text-sm mb-2 block">链接地址</label>
|
|
|
<InputText id="edit-link" v-model="editForm.link" class="w-full" />
|
|
<InputText id="edit-link" v-model="editForm.link" class="w-full" />
|
|
@@ -353,7 +367,8 @@ const editForm = ref({
|
|
|
name: null,
|
|
name: null,
|
|
|
type: null,
|
|
type: null,
|
|
|
link: null,
|
|
link: null,
|
|
|
- image: null
|
|
|
|
|
|
|
+ image: null,
|
|
|
|
|
+ teamId: null
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
// 搜索表单
|
|
// 搜索表单
|
|
@@ -381,6 +396,14 @@ const teamOptions = computed(() => {
|
|
|
return options
|
|
return options
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+// 团队选择选项(用于编辑表单)
|
|
|
|
|
+const teamSelectOptions = computed(() => {
|
|
|
|
|
+ return teamStore.teams.map((team) => ({
|
|
|
|
|
+ label: team.name,
|
|
|
|
|
+ value: team.id
|
|
|
|
|
+ }))
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
// 获取链接类型文本
|
|
// 获取链接类型文本
|
|
|
const getLinkTypeText = (type) => {
|
|
const getLinkTypeText = (type) => {
|
|
|
return LinkType[type] || type
|
|
return LinkType[type] || type
|
|
@@ -577,7 +600,8 @@ const openAddDialog = () => {
|
|
|
name: null,
|
|
name: null,
|
|
|
type: null,
|
|
type: null,
|
|
|
link: null,
|
|
link: null,
|
|
|
- image: null
|
|
|
|
|
|
|
+ image: null,
|
|
|
|
|
+ teamId: null
|
|
|
}
|
|
}
|
|
|
// 重置图片预览状态
|
|
// 重置图片预览状态
|
|
|
imagePreview.value = null
|
|
imagePreview.value = null
|
|
@@ -608,6 +632,11 @@ const saveEdit = async () => {
|
|
|
// 准备保存的数据
|
|
// 准备保存的数据
|
|
|
const saveData = { ...editForm.value }
|
|
const saveData = { ...editForm.value }
|
|
|
|
|
|
|
|
|
|
+ // 非管理员角色不传递团队ID
|
|
|
|
|
+ if (!isAdmin.value) {
|
|
|
|
|
+ delete saveData.teamId
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 处理图片逻辑
|
|
// 处理图片逻辑
|
|
|
if (imageFile.value) {
|
|
if (imageFile.value) {
|
|
|
// 有新选择的图片文件,先上传
|
|
// 有新选择的图片文件,先上传
|