This commit is contained in:
2024-12-31 22:12:10 +08:00
parent 827a8574bb
commit 1dc15aae3b
11 changed files with 3145 additions and 3048 deletions

View File

@@ -6,7 +6,9 @@ import type { PayNumData, SaleroomResult, VisitData, CloudData } from './model';
* 获取支付笔数数据
*/
export async function getPayNumList() {
const res = await request.get<ApiResult<PayNumData[]>>('/shop/dashboard/statistics');
const res = await request.get<ApiResult<PayNumData[]>>(
'/shop/dashboard/statistics'
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
@@ -16,9 +18,10 @@ export async function getPayNumList() {
/**
* 获取销售量数据
*/
export async function getSaleroomList() {
export async function getSaleroomList(params: any) {
const res = await request.get<ApiResult<SaleroomResult>>(
'/shop/dashboard/statistics/chart'
'/shop/dashboard/statistics/chart',
{ params }
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;

View File

@@ -21,7 +21,7 @@
</a-tooltip>
</template>
<template v-if="column.key === 'region'">
{{record.province}} - {{record.city}} - {{record.area}}
{{ record.province }} - {{ record.city }} - {{ record.area }}
</template>
</template>
<!-- 表头工具栏 -->
@@ -32,7 +32,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import { ref, reactive, watch, onMounted } from 'vue';
import ChooseSearch from './choose-search.vue';
import type { EleTableSelect } from 'ele-admin-pro/es';
import type { ProTableProps } from 'ele-admin-pro/es/ele-pro-table/types';
@@ -55,7 +55,7 @@
(e: 'clear'): void;
}>();
const selectedValue = ref<number>();
const selectedValue = defineModel();
// 回显值
const initValue = ref<Manager | null>(null);
// 选择框实例
@@ -117,12 +117,15 @@
setInitValue();
watch(
() => props.value,
(value) => {
if (value) {
setInitValue();
}
}
);
// watch(
// () => props.value,
// (value) => {
// if (value) {
// setInitValue();
// }
// }
// );
onMounted(() => {
search();
});
</script>

View File

@@ -47,7 +47,7 @@
name="managerId"
extra="请绑定负责人,注意:超管和游客账号不要绑定"
>
<ManagerChoose :value="form.managerId" @select="onSelectManager" />
<ManagerChoose v-model="form.managerId" @select="onSelectManager" />
</a-form-item>
<a-form-item label="商户简介" name="comments">
<a-textarea

View File

@@ -1,25 +1,25 @@
<template>
<div style="max-width: 260px">
<ele-table-select
ref="selectRef"
:multiple="false"
:allow-clear="true"
placeholder="请选择"
value-key="userId"
label-key="nickname"
v-model:value="selectedValue"
:table-config="tableConfig"
:overlay-style="{ width: '520px', maxWidth: '80%' }"
>
<!-- 表头工具栏 -->
<template #toolbar>
<user-advanced-search @search="search"/>
</template>
</ele-table-select>
</div>
<!-- <div style="margin-top: 12px">
<a-button type="primary" @click="setInitValue">回显数据</a-button>
</div> -->
<div style="max-width: 260px">
<ele-table-select
ref="selectRef"
:multiple="false"
:allow-clear="true"
placeholder="请选择"
value-key="userId"
label-key="nickname"
v-model:value="selectedValue"
:table-config="tableConfig"
:overlay-style="{ width: '520px', maxWidth: '80%' }"
>
<!-- 表头工具栏 -->
<template #toolbar>
<user-advanced-search @search="search" />
</template>
</ele-table-select>
</div>
<!-- <div style="margin-top: 12px">
<a-button type="primary" @click="setInitValue">回显数据</a-button>
</div> -->
</template>
<script lang="ts" setup>
@@ -29,9 +29,8 @@
import type { EleTableSelect } from 'ele-admin-pro/es';
import type { ProTableProps } from 'ele-admin-pro/es/ele-pro-table/types';
import type { WhereType } from '../types';
import type { User, UserParam } from '@/api/system/user/model';
const selectedValue = ref<number[]>([]);
const selectedValue = defineModel();
// 选择框实例
const selectRef = ref<InstanceType<typeof EleTableSelect> | null>(null);

View File

@@ -4,11 +4,19 @@
title="销售额趋势图"
:body-style="{ padding: '16px 6px 0 0' }"
>
<v-chart
ref="visitHourChartRef"
:option="visitHourChartOption"
style="height: 362px"
/>
<div style="padding: 2rem">
<a-range-picker
v-model:value="dateRange"
value-format="YYYY-MM-DD"
style="width: 500px"
@change="getVisitHourData"
/>
<v-chart
ref="visitHourChartRef"
:option="visitHourChartOption"
style="height: 362px"
/>
</div>
</a-card>
</template>
@@ -44,10 +52,14 @@
// 最近 1 小时访问情况折线图配置
const visitHourChartOption: EChartsCoreOption = reactive({});
const dateRange = ref<[string, string]>(['', '']);
/* 获取最近 1 小时访问情况数据 */
const getVisitHourData = () => {
getSaleroomList()
getSaleroomList({
createTimeStart: dateRange.value[0],
createTimeEnd: dateRange.value[1]
})
.then((data) => {
Object.assign(visitHourChartOption, {
tooltip: {
@@ -100,5 +112,9 @@
});
};
dateRange.value = [
dayjs().subtract(7, 'day').format('YYYY-MM-DD'),
dayjs().format('YYYY-MM-DD')
];
getVisitHourData();
</script>

View File

@@ -33,7 +33,7 @@
</a-form-item>
<a-form-item label="投资人" name="touziUserId">
<UserSelect
v-model:value="form.touziUserId"
v-model="form.touziUserId"
:placeholder="`请选择用户`"
/>
</a-form-item>

View File

@@ -283,7 +283,7 @@
</a-table>
</a-spin>
</a-card>
<a-card title="缴费记录" class="order-card">
<a-card title="租期记录" class="order-card">
<a-spin :spinning="loading">
<a-table
:data-source="renewOrderList"
@@ -409,7 +409,7 @@
: { span: 8 }
"
>
<a-form-item label="单位地址" name="officeAddress">
<a-form-item label="收货地址" name="officeAddress">
<span>{{ data.officeAddress }}</span>
</a-form-item>
</a-col>
@@ -630,7 +630,7 @@ const columns2 = ref<ColumnItem[]>([
key: 'payTime'
},
{
title: '逾期状态',
title: '使用天数',
dataIndex: 'expirationDay',
key: 'expirationDay'
},

View File

@@ -13,6 +13,10 @@
<!-- </template>-->
<!-- <span>批量删除</span>-->
<!-- </a-button>-->
<a-select v-model:value="type" style="width: 100px; margin: -5px -12px">
<a-select-option value="orderNo">订单号</a-select-option>
<a-select-option value="userId">用户ID</a-select-option>
</a-select>
<a-input-search
allow-clear
placeholder="请输入关键词"
@@ -53,6 +57,7 @@
// 表单数据
const { where, resetFields } = useSearch<OrderParam>({
keywords: undefined,
orderNo: undefined,
userId: undefined,
payStatus: undefined,