|
@@ -1,7 +1,6 @@
|
|
|
<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>
|
|
@@ -10,23 +9,39 @@
|
|
|
<!-- 表格操作 -->
|
|
<!-- 表格操作 -->
|
|
|
<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 v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.查看详情)" link type="primary"
|
|
|
|
|
- @click="toDetail(scope.row)">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ v-if="canShowButton(scope.row.status, OPERATION_PERMISSIONS.查看详情)"
|
|
|
|
|
+ link
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ @click="toDetail(scope.row)"
|
|
|
|
|
+ >
|
|
|
查看详情
|
|
查看详情
|
|
|
</el-button>
|
|
</el-button>
|
|
|
<!-- 上传活动结果按钮 -->
|
|
<!-- 上传活动结果按钮 -->
|
|
@@ -39,13 +54,21 @@
|
|
|
上传活动结果
|
|
上传活动结果
|
|
|
</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>
|
|
@@ -88,8 +111,14 @@
|
|
|
<!-- 文字输入 -->
|
|
<!-- 文字输入 -->
|
|
|
<div v-if="uploadResultForm.resultType === 0" 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.resultText" 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>
|
|
|
|
|
|
|
|
<!-- 图片上传 -->
|
|
<!-- 图片上传 -->
|
|
@@ -124,8 +153,12 @@
|
|
|
</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>
|
|
|
|
|
|
|
@@ -206,17 +239,8 @@ 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.已结束]
|
|
|
} as const;
|
|
} as const;
|
|
@@ -262,7 +286,7 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
prop: "activityType",
|
|
prop: "activityType",
|
|
|
label: "活动类型",
|
|
label: "活动类型",
|
|
|
width: 120,
|
|
width: 120,
|
|
|
- isShow:false,
|
|
|
|
|
|
|
+ isShow: false,
|
|
|
enum: activityTypeEnum,
|
|
enum: activityTypeEnum,
|
|
|
fieldNames: { label: "label", value: "value" },
|
|
fieldNames: { label: "label", value: "value" },
|
|
|
search: {
|
|
search: {
|
|
@@ -310,7 +334,8 @@ const columns = reactive<ColumnProps<any>[]>([
|
|
|
prop: "status",
|
|
prop: "status",
|
|
|
label: "活动状态",
|
|
label: "活动状态",
|
|
|
render: (scope: any) => {
|
|
render: (scope: any) => {
|
|
|
- return getStatusLabel(scope.row.status);
|
|
|
|
|
|
|
+ // 优先使用返回的 statusName,如果没有则使用 getStatusLabel
|
|
|
|
|
+ return scope.row.statusName || getStatusLabel(scope.row.status);
|
|
|
},
|
|
},
|
|
|
search: {
|
|
search: {
|
|
|
el: "select",
|
|
el: "select",
|
|
@@ -337,7 +362,17 @@ const dataCallback = (data: any) => {
|
|
|
|
|
|
|
|
// 获取表格列表
|
|
// 获取表格列表
|
|
|
const getTableList = (params: any) => {
|
|
const getTableList = (params: any) => {
|
|
|
- return getActivityList(params);
|
|
|
|
|
|
|
+ // 处理参数:确保 status 是 number 类型,pageNum 和 pageSize 转换为 string
|
|
|
|
|
+ const newParams: any = {
|
|
|
|
|
+ ...params,
|
|
|
|
|
+ pageNum: params.pageNum ? String(params.pageNum) : undefined,
|
|
|
|
|
+ pageSize: params.pageSize ? String(params.pageSize) : undefined,
|
|
|
|
|
+ status: params.status !== undefined && params.status !== null && params.status !== "" ? Number(params.status) : undefined,
|
|
|
|
|
+ storeId: params.storeId ? String(params.storeId) : undefined
|
|
|
|
|
+ };
|
|
|
|
|
+ // 移除 activityType 参数(如果存在),因为新接口不支持此参数
|
|
|
|
|
+ delete newParams.activityType;
|
|
|
|
|
+ return getActivityList(newParams);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 新建活动
|
|
// 新建活动
|
|
@@ -565,23 +600,18 @@ 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;
|
|
@@ -589,13 +619,11 @@ 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;
|
|
@@ -611,10 +639,8 @@ 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;
|
|
@@ -622,7 +648,6 @@ onMounted(async () => {
|
|
|
color: #606266;
|
|
color: #606266;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
.result-content-section {
|
|
.result-content-section {
|
|
|
.result-content-label {
|
|
.result-content-label {
|
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
@@ -630,7 +655,6 @@ onMounted(async () => {
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
color: #606266;
|
|
color: #606266;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
.upload-area-wrapper {
|
|
.upload-area-wrapper {
|
|
|
// 当有文件时,隐藏上传框
|
|
// 当有文件时,隐藏上传框
|
|
|
&.has-file {
|
|
&.has-file {
|
|
@@ -641,7 +665,6 @@ onMounted(async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
.drawer-footer {
|
|
.drawer-footer {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
gap: 12px;
|
|
gap: 12px;
|