This commit is contained in:
2025-05-27 19:01:22 +08:00
parent c302c8ae50
commit 1371c6e701
11 changed files with 99 additions and 16 deletions

View File

@@ -1,4 +1,14 @@
<script setup></script>
<script setup>
import {onMounted} from "vue";
import {toPath} from "./utils/index.js";
import {useSystemStore} from "./pinia/SystemStore/index.js";
const SystemStore = useSystemStore();
onMounted(() => {
toPath(SystemStore.NOW_ROUTER, SystemStore.NOW_ROUTER_QUERY);
});
</script>
<template>
<a-config-provider>

View File

@@ -1,12 +1,14 @@
<script setup>
import UploadButton from "../upload/UploadButton.vue";
import XImage from "../XImage/Index.vue";
import {reactive} from "vue";
import {reactive, useTemplateRef} from "vue";
import Api from "../../api";
import {Message} from "@arco-design/web-vue";
import useTableQuery from "../../hooks/useTableQuery.js";
import dayjs from "dayjs";
import {throttle} from "lodash";
const ChatBoxRef = useTemplateRef('ChatBox');
const {task} = defineProps({
task: {
type: Object,
@@ -29,7 +31,11 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({
parameter: po,
api: Api.merchant.getExchangeLog,
callback: (data) => {
Object.assign(vo, data);
if (data.rows.length === 0) {
} else {
vo.total = data.total;
vo.rows.push(...data.rows);
}
}
});
@@ -43,10 +49,21 @@ const send = async () => {
form.images.length = 0;
await fetchData();
}
const handleScroll = ({target}) => {
const {scrollTop, clientHeight, scrollHeight} = target;
if (scrollTop + clientHeight >= scrollHeight - 10 && !loading.value) {
throttle(() => {
pagination.current++;
}, 500)();
}
}
</script>
<template>
<div class="size-full flex flex-col gap-[30px]">
<div
@scroll="handleScroll"
class="size-full flex flex-col gap-[30px] max-h-[600px] overflow-auto">
<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>
@@ -66,6 +83,9 @@ const send = async () => {
</x-image>
</div>
</div>
<div class="msg-state text-[14px] text-[#1D2129] mt-[4px]">
已读
</div>
</div>
</div>
</div>
@@ -119,6 +139,26 @@ const send = async () => {
}
}
.msg-state {
@apply flex items-center gap-[8px];
&::before {
content: '';
@apply block size-[14px] rounded-[50%];
}
}
.read {
&::before {
@apply bg-[rgb(var(--arcoblue-6))];
}
}
.unRead {
&::before {
@apply bg-[rgb(var(--orange-6))];
}
}
.chat-left {
}

View File

@@ -18,8 +18,8 @@ function useTableQuery({
const loading = ref(false);
const pagination = reactive({
page: 1,
pageSize: 20,
current: 1,
pageSize: 9,
total: 0
});

View File

@@ -45,6 +45,11 @@ const columns = [
title: '时间',
dataIndex: 'createtime',
},
{
title: '审核状态',
dataIndex: 'status',
slotName: 'status',
},
{
title: '操作',
dataIndex: 'action',
@@ -110,7 +115,6 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({
api: Api.admin.getExchangeLog,
callback: (data) => {
Object.assign(vo, data);
console.log(vo);
}
});
@@ -176,6 +180,12 @@ const refuseExchangeAll = async () => {
</div>
</template>
<template v-slot:status="{record}">
<a-tag v-if="record.status === 0" color="cyan">{{ record.status_text }}</a-tag>
<a-tag v-if="record.status === 1" color="green">{{ record.status_text }}</a-tag>
<a-tag v-if="record.status === -1" color="red">{{ record.status_text }}</a-tag>
</template>
<template v-slot:action="{record}">
<div class="flex items-center gap-[20px]">
<a-link @click="passExchange(record.id)" :hoverable="false" status="success">通过</a-link>

View File

@@ -45,6 +45,11 @@ const columns = [
title: '时间',
dataIndex: 'createtime',
},
{
title: '审核状态',
dataIndex: 'status',
slotName: 'status',
},
{
title: '操作',
dataIndex: 'action',
@@ -198,6 +203,12 @@ const refuseExchangeAll = async () => {
</div>
</template>
<template v-slot:status="{record}">
<a-tag v-if="record.status === 0" color="cyan">{{ record.status_text }}</a-tag>
<a-tag v-if="record.status === 1" color="green">{{ record.status_text }}</a-tag>
<a-tag v-if="record.status === -1" color="red">{{ record.status_text }}</a-tag>
</template>
<template v-slot:action="{record}">
<div class="flex items-center gap-[20px]">
<a-link @click="passExchange(record.id)" :hoverable="false" status="success">通过</a-link>

View File

@@ -1,6 +1,6 @@
<script setup>
import Filter from "../../../../components/Filter/index.vue";
import {reactive, computed} from "vue";
import {computed, reactive} from "vue";
import useTableQuery from "../../../../hooks/useTableQuery.js";
import Api from "../../../../api/index.js";
import LookBackfillModal from "./components/look-backfill-modal.vue";
@@ -103,7 +103,6 @@ const {loading, pagination, initFetchData} = useTableQuery({
api: Api.system.getData,
callback: (data) => {
Object.assign(vo, data);
console.log(vo);
}
});
</script>

View File

@@ -1,5 +1,5 @@
import {defineStore} from "pinia";
import {ref} from "vue";
import {reactive, ref} from "vue";
import router from "../../router/index.js";
import generateRouter from "../../router/generateRouter.js";
import Api from "../../api/index.js";
@@ -7,6 +7,8 @@ import Api from "../../api/index.js";
export const useSystemStore = defineStore("SystemStore", () => {
const isRoot = ref(false);
const RoutesTemp = ref([]);
const NOW_ROUTER = ref(null);
const NOW_ROUTER_QUERY = reactive({});
const installRoute = async () => {
const routes = generateRouter(RoutesTemp.value);
@@ -56,6 +58,8 @@ export const useSystemStore = defineStore("SystemStore", () => {
return {
isRoot,
RoutesTemp,
NOW_ROUTER,
NOW_ROUTER_QUERY,
setRouter,
installRoute,
clearRouter,
@@ -67,6 +71,6 @@ export const useSystemStore = defineStore("SystemStore", () => {
afterHydrate: (val) => {
val.store.installRoute && val.store.installRoute();
},
pick: ['RoutesTemp']
pick: ['RoutesTemp', 'NOW_ROUTER', 'NOW_ROUTER_QUERY'],
}
});

View File

@@ -1,10 +1,10 @@
import {createRouter, createWebHashHistory} from 'vue-router';
import {createRouter, createWebHistory} from 'vue-router';
import routes from "./routes.js";
import {useUserStore} from "../pinia/UserStore/index.js";
import {useSystemStore} from "../pinia/SystemStore/index.js";
const router = createRouter({
history: createWebHashHistory(),
history: createWebHistory(),
routes,
})
@@ -13,8 +13,10 @@ router.beforeEach((to, from, next) => {
const SystemStore = useSystemStore();
if (!isLogin && !to.path.includes('loginSYS')) {
next({ path: '/loginSYS' });
next({path: '/loginSYS'});
} else {
SystemStore.NOW_ROUTER = to.path;
Object.assign(SystemStore.NOW_ROUTER_QUERY, to.query);
next();
}
});

View File

@@ -1,5 +1,3 @@
import routesMap from "./routes-map.js";
const routes = [
{
path: '/',