This commit is contained in:
2025-06-13 21:01:19 +08:00
parent e90242f469
commit f27e7f5137
6 changed files with 158 additions and 20 deletions

View File

@@ -7,7 +7,11 @@ import {Message} from "@arco-design/web-vue";
import useTableQuery from "../../hooks/useTableQuery.js";
import dayjs from "dayjs";
import {throttle} from "lodash";
import {useSystemStore} from "../../pinia/SystemStore/index.js";
import UploadSlot from "../upload/UploadSlot.vue";
const SystemStore = useSystemStore();
const emits = defineEmits(['success']);
const ChatBoxRef = useTemplateRef('ChatBox');
const {task} = defineProps({
task: {
@@ -19,6 +23,7 @@ const po = reactive({
id: task.id,
});
const vo = reactive({
info: null,
rows: [],
total: 0,
});
@@ -29,10 +34,11 @@ const form = reactive({
const {loading, pagination, initFetchData, fetchData} = useTableQuery({
parameter: po,
api: Api.merchant.getExchangeLog,
api: SystemStore.isRoot ? Api.admin.getExchangeLogIntervention : Api.merchant.getExchangeLog,
callback: (data) => {
if (data.rows.length === 0) {
} else {
vo.info = data.info;
vo.total = data.total;
vo.rows.push(...data.rows);
}
@@ -58,12 +64,19 @@ const handleScroll = ({target}) => {
}, 500)();
}
}
const addIntervention = async () => {
const {msg} = await Api.admin.addIntervention({...form, id: task.id,});
Message.success(msg);
await fetchData();
emits('success')
}
</script>
<template>
<div
@scroll="handleScroll"
class="size-full flex flex-col gap-[30px] max-h-[600px] overflow-auto">
:class="['size-full flex flex-col gap-[30px] overflow-auto', !SystemStore.isRoot ? 'max-h-[600px]' : 'max-h-[800px]']">
<div :class="['flex gap-[18px]', v.right === 0 ? 'chat-right' : 'chat-left']" v-for="v in vo.rows">
<a-image :src="v.people.avatar" class="rounded-[50%] overflow-hidden" width="64px"
height="64px"></a-image>
@@ -88,9 +101,46 @@ const handleScroll = ({target}) => {
</div>
</div>
</div>
<div v-if="SystemStore.isRoot && vo.info?.id" class="flex justify-center">
<a-card class="w-[528px]" title="达人发起了平台介入" :header-style="{textAlign: 'center'}">
<div class="font-bold text-[#1D2129] mb-[6px]">达人申诉理由:</div>
<div class="px-[16px] py-[12px] bg-[#F7F8FA]">
<div>
{{ vo.info.remark }}
</div>
<div class="grid grid-cols-5 gap-[12px] mt-[4px]">
<x-image hideDelete v-for="v in vo.info.image_arr" :src="v"></x-image>
</div>
</div>
<div class="font-bold text-[#1D2129] mt-[20px] mb-[6px]">平台处理结果:</div>
<div id="ROOT" class="flex flex-col justify-center items-center">
<a-textarea v-model:model-value="form.content" class="w-full h-[140px]"
placeholder="输入平台介入结果"></a-textarea>
<div class="flex flex-wrap gap-[16px] mt-[10px] mr-auto">
<x-image
v-for="(v, index) in form.images"
@delete="form.images.splice(index,1)"
:key="index"
width="32px"
height="32px"
:src="v">
</x-image>
<upload-slot @success="(e) => form.images.push(e)">
<div
class="size-[32px] bg-[#F2F3F5] flex justify-center items-center flex-col rounded-[8px] cursor-pointer">
<icon-plus/>
</div>
</upload-slot>
</div>
<a-button type="primary" class="mt-[10px]" @click="addIntervention">平台介入</a-button>
</div>
</a-card>
</div>
</div>
<div
v-if="!SystemStore.isRoot"
class="bg-white rounded-[2px] w-[calc(100%-40px)] h-[144px] absolute left-0 bottom-[20px] mx-[20px] py-[8px]">
<a-textarea
v-model:model-value="form.content"
@@ -131,6 +181,14 @@ const handleScroll = ({target}) => {
</div>
</template>
<style lang="scss">
#ROOT {
textarea {
background-color: #F7F8FA;
}
}
</style>
<style scoped lang="scss">
.chat-right {
@apply flex-row-reverse;

View File

@@ -10,6 +10,7 @@ const {task} = defineProps({
}
});
const visible = defineModel('visible');
const emits = defineEmits(['success']);
</script>
<template>
@@ -25,7 +26,7 @@ const visible = defineModel('visible');
</a-alert>
<div class="flex">
<div class="p-[20px] bg-[#F2F3F5] flex-grow min-h-[800px] relative">
<Information :task="task" v-if="visible"></Information>
<Information :task="task" v-if="visible" @success="emits('success')"></Information>
</div>
<div class="w-[280px] h-auto flex flex-col bg-[#F2F3F5] gap-[20px]" v-if="task">
<div class="bg-white p-[20px]">

View File

@@ -1,11 +1,14 @@
<script setup>
import Api from "../../api/index.js";
import {useSystemStore} from "../../pinia/SystemStore/index.js";
const emits = defineEmits(['success']);
const SystemStore = useSystemStore();
const upload = (e) => {
const file = e.target.files[0];
Api.system.uploadFile2(file).then(({data}) => {
const api = SystemStore.isRoot ? Api.system.uploadFile : Api.system.uploadFile2;
api(file).then(({data}) => {
emits('success', data);
});
}