2025-03-18 11:29:04 +08:00
|
|
|
|
<script setup>
|
2025-04-21 10:30:45 +08:00
|
|
|
|
import {reactive, ref, watch} from 'vue';
|
2025-05-09 14:57:18 +08:00
|
|
|
|
import Api from "../../api/index.ts";
|
2025-04-21 10:30:45 +08:00
|
|
|
|
import {Message} from "@arco-design/web-vue";
|
2025-03-18 11:29:04 +08:00
|
|
|
|
|
2025-04-21 10:30:45 +08:00
|
|
|
|
const emits = defineEmits(['success']);
|
|
|
|
|
|
const {id} = defineProps({
|
|
|
|
|
|
id: {
|
|
|
|
|
|
type: Number,
|
|
|
|
|
|
default: 0,
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2025-03-18 11:29:04 +08:00
|
|
|
|
const visible = ref(false);
|
2025-04-21 10:30:45 +08:00
|
|
|
|
const detail = reactive({});
|
2025-03-18 11:29:04 +08:00
|
|
|
|
const activeKey = ref(1);
|
|
|
|
|
|
|
2025-04-21 10:30:45 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
() => visible.value,
|
|
|
|
|
|
(val) => {
|
|
|
|
|
|
if (val) Api.admin.getTaskChildrenInfo(id).then(({data}) => {
|
|
|
|
|
|
Object.assign(detail, data);
|
|
|
|
|
|
console.log('我看看我看看', data);
|
|
|
|
|
|
});
|
|
|
|
|
|
},
|
|
|
|
|
|
{deep: true}
|
|
|
|
|
|
)
|
2025-03-18 11:29:04 +08:00
|
|
|
|
|
2025-04-21 10:30:45 +08:00
|
|
|
|
const passTaskChildren = async () => {
|
|
|
|
|
|
const {code, msg} = await Api.admin.passTaskChildren(id);
|
|
|
|
|
|
if (code === 1) Message.success(msg);
|
|
|
|
|
|
emits('success');
|
2025-03-18 11:29:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-04-21 10:30:45 +08:00
|
|
|
|
const refuseTaskChildren = async () => {
|
|
|
|
|
|
const {code, msg} = await Api.admin.refuseTaskChildren(id);
|
|
|
|
|
|
if (code === 1) Message.success(msg);
|
|
|
|
|
|
emits('success');
|
2025-03-18 11:29:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<a-link :hoverable="false" @click="visible=true">预览</a-link>
|
2025-05-09 14:57:18 +08:00
|
|
|
|
<div @click="visible=true">
|
|
|
|
|
|
<slot></slot>
|
|
|
|
|
|
</div>
|
2025-03-18 11:29:04 +08:00
|
|
|
|
|
|
|
|
|
|
<a-modal
|
|
|
|
|
|
title-align="start"
|
|
|
|
|
|
title="预览"
|
|
|
|
|
|
v-model:visible="visible">
|
2025-04-21 10:30:45 +08:00
|
|
|
|
<a-tabs v-model:active-key="activeKey" type="rounded" v-if="detail.id !== undefined && detail.id !== null">
|
|
|
|
|
|
<a-tab-pane v-for="(item, index) in detail.content" :title="`素材${index+1}`" :key="index">
|
2025-03-18 11:29:04 +08:00
|
|
|
|
<a-form
|
|
|
|
|
|
layout="vertical">
|
|
|
|
|
|
<a-form-item label="标题">
|
2025-04-21 10:30:45 +08:00
|
|
|
|
<a-input :model-value="item.title"></a-input>
|
2025-03-18 11:29:04 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
<a-form-item label="正文">
|
|
|
|
|
|
<a-textarea
|
|
|
|
|
|
auto-size
|
|
|
|
|
|
:max-length="1000"
|
|
|
|
|
|
show-word-limit
|
2025-04-21 10:30:45 +08:00
|
|
|
|
:model-value="item.content">
|
2025-03-18 11:29:04 +08:00
|
|
|
|
</a-textarea>
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
<a-form-item label="话题">
|
|
|
|
|
|
<div id="tag-list" class="w-full bg-[var(--color-neutral-2)] p-[4px]">
|
2025-04-21 10:30:45 +08:00
|
|
|
|
<a-tag v-for="v in item.tags_arr">#{{ v }}</a-tag>
|
2025-03-18 11:29:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item label="素材">
|
2025-04-21 10:30:45 +08:00
|
|
|
|
<div class="flex flex-wrap gap-[16px]">
|
|
|
|
|
|
<a-image
|
|
|
|
|
|
v-for="v in item.materia_arr"
|
|
|
|
|
|
width="60px"
|
|
|
|
|
|
height="60px"
|
|
|
|
|
|
:src="v">
|
|
|
|
|
|
</a-image>
|
|
|
|
|
|
</div>
|
2025-03-18 11:29:04 +08:00
|
|
|
|
</a-form-item>
|
|
|
|
|
|
|
|
|
|
|
|
<a-form-item label="评论区内容">
|
|
|
|
|
|
<div class="flex flex-col gap-[8px] w-full">
|
2025-04-21 10:30:45 +08:00
|
|
|
|
<div class="w-full flex gap-[10px] items-center" v-for="v in detail.comment">
|
|
|
|
|
|
{{ v.id }}.
|
2025-03-18 11:29:04 +08:00
|
|
|
|
<div class="flex-grow bg-[var(--color-neutral-2)] p-[4px] h-[40px] flex items-center">
|
2025-04-21 10:30:45 +08:00
|
|
|
|
<div class="text-[#4E5969] text-[14px] mr-[4px]" v-if="v.pid !== 0">
|
|
|
|
|
|
<icon-redo/>
|
|
|
|
|
|
回复{{ v.pid }}:
|
|
|
|
|
|
</div>
|
2025-03-18 11:29:04 +08:00
|
|
|
|
<a-image
|
2025-04-21 10:30:45 +08:00
|
|
|
|
v-if="v.image"
|
2025-03-18 11:29:04 +08:00
|
|
|
|
class="mr-[12px]"
|
|
|
|
|
|
width="30px"
|
|
|
|
|
|
height="30px"
|
2025-04-21 10:30:45 +08:00
|
|
|
|
:src="v.image">
|
2025-03-18 11:29:04 +08:00
|
|
|
|
</a-image>
|
|
|
|
|
|
第三个很好用,大家可以在网上搜同款
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</a-form-item>
|
|
|
|
|
|
</a-form>
|
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
|
</a-tabs>
|
|
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
|
<div class="flex items-center gap-[8px]">
|
2025-04-21 10:30:45 +08:00
|
|
|
|
<a-checkbox-group>
|
|
|
|
|
|
<template v-for="(item, index) in detail.content" :key="item">
|
|
|
|
|
|
<a-checkbox v-show="activeKey === index" :value="item">选中</a-checkbox>
|
2025-03-18 11:29:04 +08:00
|
|
|
|
</template>
|
2025-04-21 10:30:45 +08:00
|
|
|
|
</a-checkbox-group>
|
2025-03-18 11:29:04 +08:00
|
|
|
|
|
2025-04-21 10:30:45 +08:00
|
|
|
|
<a-button @click="passTaskChildren" type="primary" class="ml-auto">通过</a-button>
|
|
|
|
|
|
<a-button @click="refuseTaskChildren">拒绝</a-button>
|
2025-03-18 11:29:04 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
#tag-list {
|
|
|
|
|
|
:deep(.arco-tag) {
|
|
|
|
|
|
color: #000;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
border: 1px solid rgb(229, 230, 235);
|
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|