|
@@ -1,6 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="table-box button-table">
|
|
<div class="table-box button-table">
|
|
|
- <ProTable ref="proTable" :columns="columns" :request-api="getTableList" :init-param="initParam" :data-callback="dataCallback">
|
|
|
|
|
|
|
+ <ProTable ref="proTable" :columns="columns" :request-api="getTableList" :init-param="initParam"
|
|
|
|
|
+ :data-callback="dataCallback">
|
|
|
<template #tableHeader="scope">
|
|
<template #tableHeader="scope">
|
|
|
<div class="action-buttons">
|
|
<div class="action-buttons">
|
|
|
<el-button :icon="Plus" class="button" type="primary" @click="newActivity" v-if="type"> 新建活动 </el-button>
|
|
<el-button :icon="Plus" class="button" type="primary" @click="newActivity" v-if="type"> 新建活动 </el-button>
|
|
@@ -9,37 +10,28 @@
|
|
|
<!-- 表格操作 -->
|
|
<!-- 表格操作 -->
|
|
|
<template #operation="scope">
|
|
<template #operation="scope">
|
|
|
<!-- 上架按钮 -->
|
|
<!-- 上架按钮 -->
|
|
|
- <el-button
|
|
|
|
|
- v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.上架)"
|
|
|
|
|
- link
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="changeStatus(scope.row, 1)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.上架)" link type="primary"
|
|
|
|
|
+ @click="changeStatus(scope.row, 1)">
|
|
|
上架
|
|
上架
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- 下架按钮 -->
|
|
<!-- 下架按钮 -->
|
|
|
- <el-button
|
|
|
|
|
- v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.下架)"
|
|
|
|
|
- link
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="changeStatus(scope.row, 6)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.下架)" link type="primary"
|
|
|
|
|
+ @click="changeStatus(scope.row, 6)">
|
|
|
下架
|
|
下架
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- 编辑按钮 -->
|
|
<!-- 编辑按钮 -->
|
|
|
- <el-button
|
|
|
|
|
- v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.编辑)"
|
|
|
|
|
- link
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="editRow(scope.row)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.编辑)" link type="primary"
|
|
|
|
|
+ @click="editRow(scope.row)">
|
|
|
编辑
|
|
编辑
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- 查看详情按钮 -->
|
|
<!-- 查看详情按钮 -->
|
|
|
- <el-button link type="primary" @click="toDetail(scope.row)"> 查看详情 </el-button>
|
|
|
|
|
|
|
+ <el-button v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.查看详情)" link type="primary"
|
|
|
|
|
+ @click="toDetail(scope.row)">
|
|
|
|
|
+ 查看详情
|
|
|
|
|
+ </el-button>
|
|
|
<!-- 上传活动结果按钮 -->
|
|
<!-- 上传活动结果按钮 -->
|
|
|
<el-button
|
|
<el-button
|
|
|
- v-if="Number(scope.row.status) === ACTIVITY_STATUS.已结束"
|
|
|
|
|
|
|
+ v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.上传活动结果) && !hasUploadedResult(scope.row)"
|
|
|
link
|
|
link
|
|
|
type="primary"
|
|
type="primary"
|
|
|
@click="openUploadResultDrawer(scope.row)"
|
|
@click="openUploadResultDrawer(scope.row)"
|
|
@@ -47,21 +39,13 @@
|
|
|
上传活动结果
|
|
上传活动结果
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- 删除按钮 -->
|
|
<!-- 删除按钮 -->
|
|
|
- <el-button
|
|
|
|
|
- v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.删除)"
|
|
|
|
|
- link
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="deleteRow(scope.row)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.删除)" link type="primary"
|
|
|
|
|
+ @click="deleteRow(scope.row)">
|
|
|
删除
|
|
删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- 查看拒绝原因按钮 -->
|
|
<!-- 查看拒绝原因按钮 -->
|
|
|
- <el-button
|
|
|
|
|
- v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.查看拒绝原因)"
|
|
|
|
|
- link
|
|
|
|
|
- type="primary"
|
|
|
|
|
- @click="viewRejectReason(scope.row)"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.查看拒绝原因)" link type="primary"
|
|
|
|
|
+ @click="viewRejectReason(scope.row)">
|
|
|
查看拒绝原因
|
|
查看拒绝原因
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -96,28 +80,22 @@
|
|
|
<div class="result-type-section">
|
|
<div class="result-type-section">
|
|
|
<div class="result-type-label">活动成果</div>
|
|
<div class="result-type-label">活动成果</div>
|
|
|
<el-radio-group v-model="uploadResultForm.resultType">
|
|
<el-radio-group v-model="uploadResultForm.resultType">
|
|
|
- <el-radio :label="1"> 文字 </el-radio>
|
|
|
|
|
- <el-radio :label="2"> 图片 </el-radio>
|
|
|
|
|
|
|
+ <el-radio :label="0"> 文字 </el-radio>
|
|
|
|
|
+ <el-radio :label="1"> 图片 </el-radio>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 文字输入 -->
|
|
<!-- 文字输入 -->
|
|
|
- <div v-if="uploadResultForm.resultType === 1" class="result-content-section">
|
|
|
|
|
|
|
+ <div v-if="uploadResultForm.resultType === 0" class="result-content-section">
|
|
|
<div class="result-content-label">文字</div>
|
|
<div class="result-content-label">文字</div>
|
|
|
- <el-input
|
|
|
|
|
- v-model="uploadResultForm.textContent"
|
|
|
|
|
- type="textarea"
|
|
|
|
|
- :rows="8"
|
|
|
|
|
- placeholder="请输入"
|
|
|
|
|
- maxlength="1000"
|
|
|
|
|
- show-word-limit
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-input v-model="uploadResultForm.resultText" type="textarea" :rows="8" placeholder="请输入" maxlength="1000"
|
|
|
|
|
+ show-word-limit />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 图片上传 -->
|
|
<!-- 图片上传 -->
|
|
|
- <div v-if="uploadResultForm.resultType === 2" class="result-content-section">
|
|
|
|
|
|
|
+ <div v-if="uploadResultForm.resultType === 1" class="result-content-section">
|
|
|
<div class="result-content-label">图片</div>
|
|
<div class="result-content-label">图片</div>
|
|
|
- <div class="upload-area-wrapper">
|
|
|
|
|
|
|
+ <div class="upload-area-wrapper" :class="{ 'has-file': resultImageFileList.length >= 1 }">
|
|
|
<el-upload
|
|
<el-upload
|
|
|
v-model:file-list="resultImageFileList"
|
|
v-model:file-list="resultImageFileList"
|
|
|
:accept="'.jpg,.jpeg,.png'"
|
|
:accept="'.jpg,.jpeg,.png'"
|
|
@@ -130,14 +108,9 @@
|
|
|
:before-remove="handleResultImageBeforeRemove"
|
|
:before-remove="handleResultImageBeforeRemove"
|
|
|
list-type="picture-card"
|
|
list-type="picture-card"
|
|
|
>
|
|
>
|
|
|
- <template #trigger>
|
|
|
|
|
- <div v-if="resultImageFileList.length < 1" class="upload-trigger-card el-upload--picture-card">
|
|
|
|
|
- <el-icon>
|
|
|
|
|
- <Plus />
|
|
|
|
|
- </el-icon>
|
|
|
|
|
- <div class="upload-count">({{ resultImageFileList.length }}/1)</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
|
|
+ <el-icon>
|
|
|
|
|
+ <Plus />
|
|
|
|
|
+ </el-icon>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -151,12 +124,8 @@
|
|
|
</el-drawer>
|
|
</el-drawer>
|
|
|
|
|
|
|
|
<!-- 图片预览 -->
|
|
<!-- 图片预览 -->
|
|
|
- <el-image-viewer
|
|
|
|
|
- v-if="resultImageViewerVisible"
|
|
|
|
|
- :url-list="resultImageViewerUrlList"
|
|
|
|
|
- :initial-index="resultImageViewerInitialIndex"
|
|
|
|
|
- @close="resultImageViewerVisible = false"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <el-image-viewer v-if="resultImageViewerVisible" :url-list="resultImageViewerUrlList"
|
|
|
|
|
+ :initial-index="resultImageViewerInitialIndex" @close="resultImageViewerVisible = false" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -187,11 +156,10 @@ const rejectReasonData = ref<any>({
|
|
|
const uploadResultDrawerVisible = ref(false);
|
|
const uploadResultDrawerVisible = ref(false);
|
|
|
const uploadResultSubmitting = ref(false);
|
|
const uploadResultSubmitting = ref(false);
|
|
|
const currentActivityId = ref<number>(0);
|
|
const currentActivityId = ref<number>(0);
|
|
|
-const currentSignupId = ref<number>(0);
|
|
|
|
|
const uploadResultForm = ref({
|
|
const uploadResultForm = ref({
|
|
|
- resultType: 1, // 1-文字,2-图片
|
|
|
|
|
- textContent: "",
|
|
|
|
|
- imageUrl: ""
|
|
|
|
|
|
|
+ resultType: 0, // 0-文字,1-图片
|
|
|
|
|
+ resultText: "",
|
|
|
|
|
+ resultMediaUrl: ""
|
|
|
});
|
|
});
|
|
|
const resultImageFileList = ref<UploadFile[]>([]);
|
|
const resultImageFileList = ref<UploadFile[]>([]);
|
|
|
const resultImageViewerVisible = ref(false);
|
|
const resultImageViewerVisible = ref(false);
|
|
@@ -220,20 +188,37 @@ const statusEnum = [
|
|
|
{ label: "审核通过", value: "8" }
|
|
{ label: "审核通过", value: "8" }
|
|
|
];
|
|
];
|
|
|
|
|
|
|
|
-// 操作按钮权限配置
|
|
|
|
|
|
|
+// 活动类型选项(用于搜索)
|
|
|
|
|
+const activityTypeEnum = [
|
|
|
|
|
+ { label: "评论有礼", value: 2 },
|
|
|
|
|
+ { label: "营销活动", value: 1 }
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
|
|
+// 操作按钮权限配置(根据状态-操作映射表)
|
|
|
const OPERATION_PERMISSIONS = {
|
|
const OPERATION_PERMISSIONS = {
|
|
|
查看详情: [
|
|
查看详情: [
|
|
|
ACTIVITY_STATUS.待审核,
|
|
ACTIVITY_STATUS.待审核,
|
|
|
ACTIVITY_STATUS.未开始,
|
|
ACTIVITY_STATUS.未开始,
|
|
|
ACTIVITY_STATUS.进行中,
|
|
ACTIVITY_STATUS.进行中,
|
|
|
ACTIVITY_STATUS.已下架,
|
|
ACTIVITY_STATUS.已下架,
|
|
|
- ACTIVITY_STATUS.已结束
|
|
|
|
|
|
|
+ ACTIVITY_STATUS.已结束,
|
|
|
|
|
+ ACTIVITY_STATUS.审核驳回
|
|
|
],
|
|
],
|
|
|
上架: [ACTIVITY_STATUS.已下架],
|
|
上架: [ACTIVITY_STATUS.已下架],
|
|
|
下架: [ACTIVITY_STATUS.进行中],
|
|
下架: [ACTIVITY_STATUS.进行中],
|
|
|
- 编辑: [ACTIVITY_STATUS.未开始, ACTIVITY_STATUS.审核驳回, ACTIVITY_STATUS.已下架, ACTIVITY_STATUS.已结束],
|
|
|
|
|
- 删除: [ACTIVITY_STATUS.未开始, ACTIVITY_STATUS.已结束, ACTIVITY_STATUS.已下架],
|
|
|
|
|
- 查看拒绝原因: [ACTIVITY_STATUS.审核驳回]
|
|
|
|
|
|
|
+ 编辑: [
|
|
|
|
|
+ ACTIVITY_STATUS.未开始,
|
|
|
|
|
+ ACTIVITY_STATUS.审核驳回,
|
|
|
|
|
+ ACTIVITY_STATUS.已下架,
|
|
|
|
|
+ ACTIVITY_STATUS.已结束
|
|
|
|
|
+ ],
|
|
|
|
|
+ 删除: [
|
|
|
|
|
+ ACTIVITY_STATUS.未开始,
|
|
|
|
|
+ ACTIVITY_STATUS.已下架,
|
|
|
|
|
+ ACTIVITY_STATUS.已结束
|
|
|
|
|
+ ],
|
|
|
|
|
+ 查看拒绝原因: [ACTIVITY_STATUS.审核驳回],
|
|
|
|
|
+ 上传活动结果: [ACTIVITY_STATUS.已结束]
|
|
|
} as const;
|
|
} as const;
|
|
|
|
|
|
|
|
// 判断按钮是否显示的工具函数
|
|
// 判断按钮是否显示的工具函数
|
|
@@ -241,6 +226,22 @@ const canShowButton = (status: number, allowedStatuses: readonly number[]) => {
|
|
|
return allowedStatuses.includes(status);
|
|
return allowedStatuses.includes(status);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 判断活动是否已上传结果
|
|
|
|
|
+const hasUploadedResult = (row: any) => {
|
|
|
|
|
+ // 检查是否有结果标识字段(可能的后端返回字段名:hasResult, resultUploaded, achievementUploaded, resultId等)
|
|
|
|
|
+ // 或者检查是否有结果内容字段(resultText, resultMediaUrl等)
|
|
|
|
|
+ return !!(
|
|
|
|
|
+ row.hasResult ||
|
|
|
|
|
+ row.resultUploaded ||
|
|
|
|
|
+ row.achievementUploaded ||
|
|
|
|
|
+ row.resultId ||
|
|
|
|
|
+ row.resultText ||
|
|
|
|
|
+ row.resultMediaUrl ||
|
|
|
|
|
+ row.achievementDesc ||
|
|
|
|
|
+ row.mediaUrls
|
|
|
|
|
+ );
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
// 获取状态标签
|
|
// 获取状态标签
|
|
|
const getStatusLabel = (status: number) => {
|
|
const getStatusLabel = (status: number) => {
|
|
|
const statusMap: Record<number, string> = {
|
|
const statusMap: Record<number, string> = {
|
|
@@ -258,12 +259,30 @@ const getStatusLabel = (status: number) => {
|
|
|
// 表格列配置
|
|
// 表格列配置
|
|
|
const columns = reactive<ColumnProps<any>[]>([
|
|
const columns = reactive<ColumnProps<any>[]>([
|
|
|
{
|
|
{
|
|
|
|
|
+ prop: "activityType",
|
|
|
|
|
+ label: "活动类型",
|
|
|
|
|
+ width: 120,
|
|
|
|
|
+ isShow:false,
|
|
|
|
|
+ enum: activityTypeEnum,
|
|
|
|
|
+ fieldNames: { label: "label", value: "value" },
|
|
|
|
|
+ search: {
|
|
|
|
|
+ el: "select",
|
|
|
|
|
+ props: { placeholder: "请选择所属活动" },
|
|
|
|
|
+ order: 1
|
|
|
|
|
+ },
|
|
|
|
|
+ render: (scope: any) => {
|
|
|
|
|
+ const type = scope.row.activityType;
|
|
|
|
|
+ const typeItem = activityTypeEnum.find(item => item.value === type);
|
|
|
|
|
+ return typeItem ? typeItem.label : "-";
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
prop: "activityName",
|
|
prop: "activityName",
|
|
|
- label: "活动名称"
|
|
|
|
|
- // search: {
|
|
|
|
|
- // el: "input",
|
|
|
|
|
- // props: { placeholder: "请输入" }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ label: "活动名称",
|
|
|
|
|
+ search: {
|
|
|
|
|
+ el: "input",
|
|
|
|
|
+ props: { placeholder: "请输入" }
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: "id",
|
|
prop: "id",
|
|
@@ -289,7 +308,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
prop: "status",
|
|
prop: "status",
|
|
|
- label: "状态",
|
|
|
|
|
|
|
+ label: "活动状态",
|
|
|
render: (scope: any) => {
|
|
render: (scope: any) => {
|
|
|
return getStatusLabel(scope.row.status);
|
|
return getStatusLabel(scope.row.status);
|
|
|
},
|
|
},
|
|
@@ -384,13 +403,10 @@ const closeRejectReasonDialog = () => {
|
|
|
// 打开上传活动结果抽屉
|
|
// 打开上传活动结果抽屉
|
|
|
const openUploadResultDrawer = (row: any) => {
|
|
const openUploadResultDrawer = (row: any) => {
|
|
|
currentActivityId.value = Number(row.id);
|
|
currentActivityId.value = Number(row.id);
|
|
|
- // 假设 signupId 可以从活动数据中获取,如果没有则需要查询或让用户选择
|
|
|
|
|
- // 这里先使用 row.signupId,如果不存在可能需要从其他地方获取
|
|
|
|
|
- currentSignupId.value = row.signupId ? Number(row.signupId) : 0;
|
|
|
|
|
uploadResultForm.value = {
|
|
uploadResultForm.value = {
|
|
|
- resultType: 1,
|
|
|
|
|
- textContent: "",
|
|
|
|
|
- imageUrl: ""
|
|
|
|
|
|
|
+ resultType: 0, // 默认选择文字
|
|
|
|
|
+ resultText: "",
|
|
|
|
|
+ resultMediaUrl: ""
|
|
|
};
|
|
};
|
|
|
resultImageFileList.value = [];
|
|
resultImageFileList.value = [];
|
|
|
uploadResultDrawerVisible.value = true;
|
|
uploadResultDrawerVisible.value = true;
|
|
@@ -400,9 +416,9 @@ const openUploadResultDrawer = (row: any) => {
|
|
|
const closeUploadResultDrawer = () => {
|
|
const closeUploadResultDrawer = () => {
|
|
|
uploadResultDrawerVisible.value = false;
|
|
uploadResultDrawerVisible.value = false;
|
|
|
uploadResultForm.value = {
|
|
uploadResultForm.value = {
|
|
|
- resultType: 1,
|
|
|
|
|
- textContent: "",
|
|
|
|
|
- imageUrl: ""
|
|
|
|
|
|
|
+ resultType: 0, // 默认选择文字
|
|
|
|
|
+ resultText: "",
|
|
|
|
|
+ resultMediaUrl: ""
|
|
|
};
|
|
};
|
|
|
resultImageFileList.value = [];
|
|
resultImageFileList.value = [];
|
|
|
};
|
|
};
|
|
@@ -445,7 +461,7 @@ const handleResultImageChange: UploadProps["onChange"] = async (uploadFile: Uplo
|
|
|
if (imageUrl) {
|
|
if (imageUrl) {
|
|
|
uploadFile.status = "success";
|
|
uploadFile.status = "success";
|
|
|
uploadFile.url = imageUrl;
|
|
uploadFile.url = imageUrl;
|
|
|
- uploadResultForm.value.imageUrl = imageUrl;
|
|
|
|
|
|
|
+ uploadResultForm.value.resultMediaUrl = imageUrl;
|
|
|
} else {
|
|
} else {
|
|
|
throw new Error("上传失败:未获取到图片URL");
|
|
throw new Error("上传失败:未获取到图片URL");
|
|
|
}
|
|
}
|
|
@@ -491,51 +507,37 @@ const handleResultImageBeforeRemove: UploadProps["beforeRemove"] = async () => {
|
|
|
|
|
|
|
|
// 删除活动结果图片
|
|
// 删除活动结果图片
|
|
|
const handleResultImageRemove: UploadProps["onRemove"] = () => {
|
|
const handleResultImageRemove: UploadProps["onRemove"] = () => {
|
|
|
- uploadResultForm.value.imageUrl = "";
|
|
|
|
|
|
|
+ uploadResultForm.value.resultMediaUrl = "";
|
|
|
ElMessage.success("图片已删除");
|
|
ElMessage.success("图片已删除");
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 提交上传活动结果
|
|
// 提交上传活动结果
|
|
|
const submitUploadResult = async () => {
|
|
const submitUploadResult = async () => {
|
|
|
- if (uploadResultForm.value.resultType === 1) {
|
|
|
|
|
|
|
+ // 验证必填字段
|
|
|
|
|
+ if (uploadResultForm.value.resultType === 0) {
|
|
|
// 文字类型
|
|
// 文字类型
|
|
|
- if (!uploadResultForm.value.textContent || uploadResultForm.value.textContent.trim() === "") {
|
|
|
|
|
|
|
+ if (!uploadResultForm.value.resultText || uploadResultForm.value.resultText.trim() === "") {
|
|
|
ElMessage.warning("请输入文字内容");
|
|
ElMessage.warning("请输入文字内容");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- } else {
|
|
|
|
|
|
|
+ } else if (uploadResultForm.value.resultType === 1) {
|
|
|
// 图片类型
|
|
// 图片类型
|
|
|
- if (!uploadResultForm.value.imageUrl) {
|
|
|
|
|
|
|
+ if (!uploadResultForm.value.resultMediaUrl) {
|
|
|
ElMessage.warning("请上传图片");
|
|
ElMessage.warning("请上传图片");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 获取用户ID
|
|
|
|
|
- const geekerUser = localGet("geeker-user");
|
|
|
|
|
- const userId = geekerUser?.userInfo?.id || geekerUser?.userInfo?.userId;
|
|
|
|
|
- if (!userId) {
|
|
|
|
|
- ElMessage.error("无法获取用户信息,请重新登录");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 检查 signupId
|
|
|
|
|
- if (!currentSignupId.value || currentSignupId.value === 0) {
|
|
|
|
|
- ElMessage.warning("缺少报名ID,无法上传活动结果");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
try {
|
|
try {
|
|
|
uploadResultSubmitting.value = true;
|
|
uploadResultSubmitting.value = true;
|
|
|
const params: any = {
|
|
const params: any = {
|
|
|
- activityId: currentActivityId.value,
|
|
|
|
|
- userId: Number(userId),
|
|
|
|
|
- signupId: currentSignupId.value,
|
|
|
|
|
- achievementDesc: uploadResultForm.value.resultType === 1 ? uploadResultForm.value.textContent : undefined,
|
|
|
|
|
- mediaUrls: uploadResultForm.value.resultType === 2 ? uploadResultForm.value.imageUrl : undefined
|
|
|
|
|
|
|
+ id: currentActivityId.value, // 活动ID
|
|
|
|
|
+ resultType: uploadResultForm.value.resultType, // 0-文字,1-图片
|
|
|
|
|
+ resultText: uploadResultForm.value.resultType === 0 ? uploadResultForm.value.resultText : undefined,
|
|
|
|
|
+ resultMediaUrl: uploadResultForm.value.resultType === 1 ? uploadResultForm.value.resultMediaUrl : undefined
|
|
|
};
|
|
};
|
|
|
- const res = await uploadActivityResult(params);
|
|
|
|
|
- if (res && res.code == 200) {
|
|
|
|
|
|
|
+ const res: any = await uploadActivityResult(params);
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
ElMessage.success("上传成功");
|
|
ElMessage.success("上传成功");
|
|
|
closeUploadResultDrawer();
|
|
closeUploadResultDrawer();
|
|
|
proTable.value?.getTableList();
|
|
proTable.value?.getTableList();
|
|
@@ -563,18 +565,23 @@ onMounted(async () => {
|
|
|
flex: 0 0 auto;
|
|
flex: 0 0 auto;
|
|
|
gap: 10px;
|
|
gap: 10px;
|
|
|
margin-right: 20px;
|
|
margin-right: 20px;
|
|
|
|
|
+
|
|
|
.button {
|
|
.button {
|
|
|
margin-bottom: 0;
|
|
margin-bottom: 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.reject-reason-content {
|
|
.reject-reason-content {
|
|
|
padding: 20px 0;
|
|
padding: 20px 0;
|
|
|
|
|
+
|
|
|
.reject-reason-item {
|
|
.reject-reason-item {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
margin-bottom: 20px;
|
|
margin-bottom: 20px;
|
|
|
|
|
+
|
|
|
&:last-child {
|
|
&:last-child {
|
|
|
margin-bottom: 0;
|
|
margin-bottom: 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.reject-reason-label {
|
|
.reject-reason-label {
|
|
|
flex-shrink: 0;
|
|
flex-shrink: 0;
|
|
|
min-width: 100px;
|
|
min-width: 100px;
|
|
@@ -582,11 +589,13 @@ onMounted(async () => {
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
color: #606266;
|
|
color: #606266;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.reject-reason-value {
|
|
.reject-reason-value {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
|
color: #303133;
|
|
color: #303133;
|
|
|
word-break: break-word;
|
|
word-break: break-word;
|
|
|
|
|
+
|
|
|
&.reject-reason-text {
|
|
&.reject-reason-text {
|
|
|
min-height: 80px;
|
|
min-height: 80px;
|
|
|
padding: 12px;
|
|
padding: 12px;
|
|
@@ -602,8 +611,10 @@ onMounted(async () => {
|
|
|
// 上传活动结果抽屉样式
|
|
// 上传活动结果抽屉样式
|
|
|
.upload-result-content {
|
|
.upload-result-content {
|
|
|
padding: 20px 0;
|
|
padding: 20px 0;
|
|
|
|
|
+
|
|
|
.result-type-section {
|
|
.result-type-section {
|
|
|
margin-bottom: 24px;
|
|
margin-bottom: 24px;
|
|
|
|
|
+
|
|
|
.result-type-label {
|
|
.result-type-label {
|
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
@@ -611,6 +622,7 @@ onMounted(async () => {
|
|
|
color: #606266;
|
|
color: #606266;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.result-content-section {
|
|
.result-content-section {
|
|
|
.result-content-label {
|
|
.result-content-label {
|
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
@@ -618,24 +630,18 @@ onMounted(async () => {
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
color: #606266;
|
|
color: #606266;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.upload-area-wrapper {
|
|
.upload-area-wrapper {
|
|
|
- .upload-trigger-card {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- justify-content: center;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- .upload-count {
|
|
|
|
|
- margin-top: 8px;
|
|
|
|
|
- font-size: 12px;
|
|
|
|
|
- color: #909399;
|
|
|
|
|
|
|
+ // 当有文件时,隐藏上传框
|
|
|
|
|
+ &.has-file {
|
|
|
|
|
+ :deep(.el-upload--picture-card) {
|
|
|
|
|
+ display: none !important;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
.drawer-footer {
|
|
.drawer-footer {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
gap: 12px;
|
|
gap: 12px;
|