|
|
@@ -18,9 +18,11 @@ const opts = reactive({
|
|
|
{ field: "peopleMax", name: "人数上限", visible: true, width: 80 },
|
|
|
{ field: "activityDate", name: "活动日期", visible: true, width: 120 },
|
|
|
{ field: "expiryDate", name: "截止日期", visible: true, width: 120 },
|
|
|
- { field: "area", name: "活动区域", visible: true, width: 80 },
|
|
|
+ // { field: "area", name: "活动区域", visible: true, width: 80 },
|
|
|
{ field: "address", name: "活动地点", visible: true },
|
|
|
- { field: "auditStatus", name: "状态", visible: true, width: 100 },
|
|
|
+ { field: "auditStatus", name: "审核状态", visible: true, width: 100 },
|
|
|
+ { field: "isHead", name: "置顶", visible: true, width: 80 },
|
|
|
+ { field: "isHot", name: "热门", visible: true, width: 80 },
|
|
|
{ field: "actions", name: `操作`, width: 150 }
|
|
|
],
|
|
|
queryParams: {
|
|
|
@@ -284,10 +286,15 @@ const opts = reactive({
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
- field: "file",
|
|
|
+ field: "images",
|
|
|
label: "图片上传",
|
|
|
class: "w-100",
|
|
|
- component: "slot"
|
|
|
+ component: "VU",
|
|
|
+ props: {
|
|
|
+ uploadUrl: "/oss/upload/activity",
|
|
|
+ prefixUrl: "/oss/preview/",
|
|
|
+ limit: 8
|
|
|
+ }
|
|
|
}
|
|
|
] as any,
|
|
|
resetForm: () => {
|
|
|
@@ -345,6 +352,13 @@ const detailModalTitle = computed(() => {
|
|
|
const detailData = ref({})
|
|
|
const auditStatus = ref("1")
|
|
|
|
|
|
+/** 提交按钮 */
|
|
|
+function submitForm() {
|
|
|
+ apis.amActivity.activityApi.addOrUpdateActivity(form.value).then(() => {
|
|
|
+ handleQuery()
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
function handleAudit(row: any) {
|
|
|
detailType.value = "A"
|
|
|
apis.amActivity.activityApi.getActivity(row.activityId).then((res) => {
|
|
|
@@ -371,25 +385,74 @@ function submitDetail() {
|
|
|
return
|
|
|
}
|
|
|
if (detailType.value === "A") {
|
|
|
+ apis.amActivity.activityApi
|
|
|
+ .auditActivity(detailData.value.activityId, auditStatus.value)
|
|
|
+ .then(() => {
|
|
|
+ detailModalRef.value.hide()
|
|
|
+ handleQuery()
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/** 提交按钮 */
|
|
|
-function submitForm() {
|
|
|
- const formData = new FormData()
|
|
|
- fileList.value.forEach((file) => {
|
|
|
- formData.append("files", file.raw)
|
|
|
- })
|
|
|
- const data: any = {}
|
|
|
- Object.keys(emptyFormData.value).forEach((v) => {
|
|
|
- data[v] = form.value[v]
|
|
|
- formData.append(v, form.value[v])
|
|
|
- })
|
|
|
- //formData.append("form", JSON.stringify(data))
|
|
|
- apis.amActivity.activityApi.addOrUpdateActivity(formData, !!form.value.activityId).then(() => {
|
|
|
- handleQuery()
|
|
|
- })
|
|
|
+function handleClose(row: any) {
|
|
|
+ message
|
|
|
+ .confirm("是否确认关闭 [" + row.title + "] 的活动?")
|
|
|
+ .then(() => {
|
|
|
+ apis.amActivity.activityApi.closeActivity(row.activityId).then(() => {
|
|
|
+ handleQuery()
|
|
|
+ message.msgSuccess("关闭成功")
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ //
|
|
|
+ })
|
|
|
}
|
|
|
+function handleTop(row: any) {
|
|
|
+ if (row.auditStatus == "2") {
|
|
|
+ message.msgWarning("活动未审核通过")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (row.auditStatus == "3") {
|
|
|
+ message.msgWarning("活动已关闭")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const text = row.isHead === "0" ? "取消置顶" : "置顶"
|
|
|
+ message
|
|
|
+ .confirm("确认要" + text + " [" + row.title + "] 的活动?")
|
|
|
+ .then(() => {
|
|
|
+ apis.amActivity.activityApi.topActivity(row.activityId, row.isHead).then(() => {
|
|
|
+ message.msgSuccess(text + "成功")
|
|
|
+ handleQuery()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.isHead = row.isHead === "0" ? "1" : "0"
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+function handleHot(row: any) {
|
|
|
+ if (row.auditStatus == "2") {
|
|
|
+ message.msgWarning("活动未审核通过")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (row.auditStatus == "3") {
|
|
|
+ message.msgWarning("活动已关闭")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const text = row.isHot === "0" ? "取消热门" : "热门"
|
|
|
+ message
|
|
|
+ .confirm("确认要" + text + " [" + row.title + "] 的活动?")
|
|
|
+ .then(() => {
|
|
|
+ apis.amActivity.activityApi.topActivity(row.activityId, row.isHot).then(() => {
|
|
|
+ message.msgSuccess(text + "成功")
|
|
|
+ handleQuery()
|
|
|
+ })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.isHead = row.isHot === "0" ? "1" : "0"
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
function loadCategory() {
|
|
|
apis.system.categoryApi.getActivityCategory().then((res) => {
|
|
|
categoryColumns.value = []
|
|
|
@@ -442,6 +505,24 @@ onMounted(init)
|
|
|
{{ dayjs(row.expiryDate).format("YYYY-MM-DD") }}
|
|
|
</span>
|
|
|
</template>
|
|
|
+ <template #address="{ row }">
|
|
|
+ <span v-if="row.area == '线上活动'" class="text-info">{{ row.area }}</span>
|
|
|
+ <span v-else>{{ row.address }}</span>
|
|
|
+ </template>
|
|
|
+ <template #isHead="{ row }">
|
|
|
+ <el-switch
|
|
|
+ v-model="row.isHead"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="handleTop(row)"></el-switch>
|
|
|
+ </template>
|
|
|
+ <template #isHot="{ row }">
|
|
|
+ <el-switch
|
|
|
+ v-model="row.isHot"
|
|
|
+ active-value="1"
|
|
|
+ inactive-value="0"
|
|
|
+ @change="handleHot(row)"></el-switch>
|
|
|
+ </template>
|
|
|
<template #actions="{ row }">
|
|
|
<vb-tooltip
|
|
|
v-if="row.auditStatus != 0 && row.auditStatus != 2"
|
|
|
@@ -479,7 +560,7 @@ onMounted(init)
|
|
|
</template>
|
|
|
</el-button>
|
|
|
</vb-tooltip>
|
|
|
- <vb-tooltip content="修改" placement="top">
|
|
|
+ <vb-tooltip v-if="row.auditStatus != 3" content="修改" placement="top">
|
|
|
<el-button
|
|
|
link
|
|
|
type="primary"
|
|
|
@@ -490,7 +571,10 @@ onMounted(init)
|
|
|
</template>
|
|
|
</el-button>
|
|
|
</vb-tooltip>
|
|
|
- <vb-tooltip content="删除" placement="top">
|
|
|
+ <vb-tooltip
|
|
|
+ v-if="row.auditStatus == 0 || row.auditStatus == 3"
|
|
|
+ content="删除"
|
|
|
+ placement="top">
|
|
|
<el-button
|
|
|
link
|
|
|
type="primary"
|
|
|
@@ -510,14 +594,7 @@ onMounted(init)
|
|
|
:form-items="opts.formItems"
|
|
|
:label-width="opts.labelWidth"
|
|
|
append-to-body
|
|
|
- @confirm="submitForm">
|
|
|
- <template #file_form>
|
|
|
- <div>
|
|
|
- <VbUpload2 ref="uploadRef" v-model="fileList"></VbUpload2>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </VbModal>
|
|
|
-
|
|
|
+ @confirm="submitForm"></VbModal>
|
|
|
<VbModal
|
|
|
modalBodyClass="detail-modal"
|
|
|
v-model:modal="detailModalRef"
|
|
|
@@ -580,9 +657,9 @@ onMounted(init)
|
|
|
</dl>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="20" v-if="detailData.images">
|
|
|
+ <div class="d-flex justify-content-center my-3" v-if="detailData.images">
|
|
|
<VbImagePreview :src="detailData.images" :prefixSrc="'/oss/preview/'"></VbImagePreview>
|
|
|
- </el-row>
|
|
|
+ </div>
|
|
|
<div v-if="detailType == 'A'" class="d-flex justify-content-center">
|
|
|
<vb-select
|
|
|
v-model="auditStatus"
|