This commit is contained in:
zjf committed 2025-09-28 19:00:53 +08:00
1 parent 7c6cc51751
commit 8bf898adec
8 files changed
+454 -70

No files matched your search

+3 -3
View File
@@ -32,7 +32,7 @@
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" border
<el-table :data="state.dataList" v-loading="state.loading" border
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
@@ -45,7 +45,7 @@
<dict-tag :options="visitor_status" :value="scope.row.status"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>
<!-- <el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>-->
<el-table-column prop="registerTime" label="首次注册时间" show-overflow-tooltip/>
<el-table-column prop="lastLogin" label="最后登录日期" show-overflow-tooltip/>
<el-table-column label="操作" width="150">
@@ -136,4 +136,4 @@ const handleDelete = async (ids: string[]) => {
useMessage().error(err.msg);
}
};
</script>
</script>
+10 -9
View File
@@ -31,8 +31,8 @@
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="到访单位" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入到访单位"/>
<el-form-item label="到访单位" prop="deptName">
<el-input v-model="form.deptName" placeholder="请输入到访单位"/>
</el-form-item>
</el-col>
@@ -61,13 +61,13 @@
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="到访开始时间" prop="vDate">
<el-input v-model="form.vStartDate" placeholder="请输入到访时间"/>
<el-form-item label="到访开始时间" prop="vstartDate">
<el-input v-model="form.vstartDate" placeholder="请输入到访开始时间"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="到访结束时间" prop="vDate">
<el-input v-model="form.vEndDate" placeholder="请输入到访时间"/>
<el-form-item label="到访结束时间" prop="vendDate">
<el-input v-model="form.vendDate" placeholder="请输入到访结束时间"/>
</el-form-item>
</el-col>
@@ -113,16 +113,17 @@ const form = reactive({
idCard: '',
description: '',
checkStatus: '',
deptId: '',
deptName: '',
userName: '',
carId: '',
companyName: '',
peopleNumber: '',
vStartDate: '',
vEndDate: '',
vstartDate: '',
vendDate: '',
isDrive: '',
processInstanceId: '',
checkReason: '',
type: '1', // 主动申请类型
});
// 定义校验规则
+45 -24
View File
@@ -19,14 +19,14 @@
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"
v-auth="'integrated_visitors_add'">
新 增
</el-button>
<el-button plain :disabled="multiple" icon="Delete" type="primary"
v-auth="'integrated_visitors_del'" @click="handleDelete(selectObjs)">
删除
</el-button>
<!-- <el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"-->
<!-- v-auth="'integrated_visitors_add'">-->
<!-- 新 增-->
<!-- </el-button>-->
<!-- <el-button plain :disabled="multiple" icon="Delete" type="primary"-->
<!-- v-auth="'integrated_visitors_del'" @click="handleDelete(selectObjs)">-->
<!-- 删除-->
<!-- </el-button>-->
<right-toolbar v-model:showSearch="showSearch" :export="'integrated_visitors_export'"
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
@queryTable="getDataList"></right-toolbar>
@@ -41,32 +41,53 @@
<el-table-column prop="name" label="姓名" show-overflow-tooltip/>
<el-table-column prop="mobile" label="手机号" show-overflow-tooltip/>
<el-table-column prop="idCard" label="身份证号" show-overflow-tooltip/>
<el-table-column prop="description" label="描述" show-overflow-tooltip/>
<!-- <el-table-column prop="description" label="描述" show-overflow-tooltip/>-->
<el-table-column prop="checkStatus" label="审核状态" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="deptId" label="到访单位" show-overflow-tooltip/>
<el-table-column prop="deptName" label="到访单位" show-overflow-tooltip/>
<el-table-column prop="userName" label="接待人" show-overflow-tooltip/>
<!-- <el-table-column prop="carId" label="车牌号id" show-overflow-tooltip/>-->
<el-table-column prop="companyName" label="公司名称" show-overflow-tooltip/>
<el-table-column prop="peopleNumber" label="随行人员数量" show-overflow-tooltip/>
<el-table-column prop="vDate" label="到访时间" show-overflow-tooltip/>
<el-table-column prop="isDrive" label="是否驾驶车辆" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="is_drive" :value="scope.row.isDrive"></dict-tag>
<!-- <el-table-column prop="peopleNumber" label="随行人员数量" show-overflow-tooltip/>-->
<el-table-column prop="carList" label="车辆信息" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.carList && scope.row.carList.length > 0">
<el-tag v-for="(car, index) in scope.row.carList" :key="index" size="small" style="margin-right: 4px;">
{{ car.carNumber }}
</el-tag>
</div>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="processInstanceId" label="流程id" show-overflow-tooltip/>
<el-table-column prop="checkReason" label="审核原因" show-overflow-tooltip/>
<el-table-column label="操作" width="150">
<template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'integrated_visitors_edit'"
@click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>
<el-button icon="delete" text type="primary" v-auth="'integrated_visitors_del'" @click="handleDelete([scope.row.id])">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="otherPeople" label="随行人员" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.otherPeople && scope.row.otherPeople.length > 0">
<div v-for="(person, index) in scope.row.otherPeople" :key="index" style="margin-bottom: 2px;">
<el-tag size="small">{{ person.name }}({{ person.mobile }})</el-tag>
</div>
</div>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="vstartDate" label="到访开始时间" show-overflow-tooltip/>
<el-table-column prop="vendDate" label="到访结束时间" show-overflow-tooltip/>
<!-- <el-table-column prop="isDrive" label="是否驾驶车辆" show-overflow-tooltip>-->
<!-- <template #default="scope">-->
<!-- <dict-tag :options="is_drive" :value="scope.row.isDrive"></dict-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="processInstanceId" label="流程id" show-overflow-tooltip/>-->
<!-- <el-table-column prop="checkReason" label="审核原因" show-overflow-tooltip/>-->
<!-- <el-table-column label="操作" width="150">-->
<!-- <template #default="scope">-->
<!-- <el-button icon="edit-pen" text type="primary" v-auth="'integrated_visitors_edit'"-->
<!-- @click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>-->
<!-- <el-button icon="delete" text type="primary" v-auth="'integrated_visitors_del'" @click="handleDelete([scope.row.id])">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
+186
View File
@@ -0,0 +1,186 @@
<template>
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible"
:close-on-click-modal="false" draggable>
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
<el-row :gutter="24">
<el-col :span="12" class="mb20">
<el-form-item label="姓名" prop="name">
<el-input v-model="form.name" placeholder="请输入姓名"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="手机号" prop="mobile">
<el-input v-model="form.mobile" placeholder="请输入手机号"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="身份证号" prop="idCard">
<el-input v-model="form.idCard" placeholder="请输入身份证号"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="邀约理由" prop="description">
<el-select v-model="form.description" placeholder="请选择邀约理由">
<el-option :value="item.value" :label="item.label" v-for="(item, index) in visitor_reason" :key="index"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="到访单位" prop="deptName">
<el-input v-model="form.deptName" placeholder="请输入到访单位"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="邀约人" prop="userName">
<el-input v-model="form.userName" placeholder="请输入接待人"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="车牌号id" prop="carId">
<el-input v-model="form.carId" placeholder="请输入车牌号id"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="公司名称" prop="companyName">
<el-input v-model="form.companyName" placeholder="请输入公司名称"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="随行人数" prop="peopleNumber">
<el-input v-model="form.peopleNumber" placeholder="请输入随行人员数量"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="到访开始时间" prop="vstartDate">
<el-input v-model="form.vstartDate" placeholder="请输入到访开始时间"/>
</el-form-item>
</el-col>
<el-col :span="12" class="mb20">
<el-form-item label="到访结束时间" prop="vendDate">
<el-input v-model="form.vendDate" placeholder="请输入到访结束时间"/>
</el-form-item>
</el-col>
<!-- <el-col :span="12" class="mb20">-->
<!-- <el-form-item label="是否驾驶车辆" prop="isDrive">-->
<!-- <el-radio-group v-model="form.isDrive">-->
<!-- <el-radio :label="item.value" v-for="(item, index) in is_drive" border :key="index">{{ item.label }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="onSubmit" :disabled="loading">确认</el-button>
</span>
</template>
</el-dialog>
</template>
<script setup lang="ts" name="VisitorYYDialog">
import { useDict } from '/@/hooks/dict';
import { useMessage } from "/@/hooks/message";
import { getObj, addObj, putObj } from '/@/api/integrated/visitors'
import { rule } from '/@/utils/validate';
const emit = defineEmits(['refresh']);
// 定义变量内容
const dataFormRef = ref();
const visible = ref(false)
const loading = ref(false)
// 定义字典
const { check_status,is_drive,visitor_reason } = useDict('check_status','is_drive','visitor_reason')
// 提交表单数据
const form = reactive({
id:'',
name: '',
mobile: '',
idCard: '',
description: '',
checkStatus: '',
deptName: '',
userName: '',
carId: '',
companyName: '',
peopleNumber: '',
vstartDate: '',
vendDate: '',
isDrive: '',
processInstanceId: '',
checkReason: '',
type: '2', // 邀约类型
});
// 定义校验规则
const dataRules = ref({
name: [{required: true, message: '姓名不能为空', trigger: 'blur'}],
mobile: [{required: true, message: '手机号不能为空', trigger: 'blur'}, { validator: rule.mobilePhone, trigger: 'blur' }],
})
// 打开弹窗
const openDialog = (id: string) => {
visible.value = true
form.id = ''
// 重置表单数据
nextTick(() => {
dataFormRef.value?.resetFields();
});
// 获取visitorYY信息
if (id) {
form.id = id
getvisitorYYData(id)
}
};
// 提交
const onSubmit = async () => {
const valid = await dataFormRef.value.validate().catch(() => {});
if (!valid) return false;
try {
loading.value = true;
form.id ? await putObj(form) : await addObj(form);
useMessage().success(form.id ? '修改成功' : '添加成功');
visible.value = false;
emit('refresh');
} catch (err: any) {
useMessage().error(err.msg);
} finally {
loading.value = false;
}
};
// 初始化表单数据
const getvisitorYYData = (id: string) => {
// 获取数据
loading.value = true
getObj(id).then((res: any) => {
Object.assign(form, res.data)
}).finally(() => {
loading.value = false
})
};
// 暴露变量
defineExpose({
openDialog
});
</script>
+176
View File
@@ -0,0 +1,176 @@
<template>
<div class="layout-padding">
<div class="layout-padding-auto layout-padding-view">
<el-row v-show="showSearch">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="getDataList">
<el-form-item label="姓名" prop="name" >
<el-input placeholder="请输入姓名" v-model="state.queryForm.name" />
</el-form-item>
<el-form-item label="手机号" prop="mobile" >
<el-input placeholder="请输入手机号" v-model="state.queryForm.mobile" />
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="getDataList">
查询
</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<!-- <el-button icon="folder-add" type="primary" class="ml10" @click="formDialogRef.openDialog()"-->
<!-- v-auth="'integrated_visitorYY_add'">-->
<!-- 新 增-->
<!-- </el-button>-->
<!-- <el-button plain :disabled="multiple" icon="Delete" type="primary"-->
<!-- v-auth="'integrated_visitorYY_del'" @click="handleDelete(selectObjs)">-->
<!-- 删除-->
<!-- </el-button>-->
<right-toolbar v-model:showSearch="showSearch" :export="'integrated_visitorYY_export'"
@exportExcel="exportExcel" class="ml10 mr20" style="float: right;"
@queryTable="getDataList"></right-toolbar>
</div>
</el-row>
<el-table :data="state.dataList" v-loading="state.loading" border
:cell-style="tableStyle.cellStyle" :header-cell-style="tableStyle.headerCellStyle"
@selection-change="selectionChangHandle"
@sort-change="sortChangeHandle">
<el-table-column type="selection" width="40" align="center" />
<el-table-column type="index" label="#" width="40" />
<el-table-column prop="name" label="访客姓名" show-overflow-tooltip/>
<el-table-column prop="mobile" label="手机号" show-overflow-tooltip/>
<el-table-column prop="idCard" label="身份证号" show-overflow-tooltip/>
<!-- <el-table-column prop="description" label="描述" show-overflow-tooltip/>-->
<el-table-column prop="checkStatus" label="审核状态" show-overflow-tooltip>
<template #default="scope">
<dict-tag :options="check_status" :value="scope.row.checkStatus"></dict-tag>
</template>
</el-table-column>
<el-table-column prop="deptName" label="到访单位" show-overflow-tooltip/>
<el-table-column prop="userName" label="邀约人" show-overflow-tooltip/>
<!-- <el-table-column prop="carId" label="车牌号id" show-overflow-tooltip/>-->
<el-table-column prop="companyName" label="公司名称" show-overflow-tooltip/>
<!-- <el-table-column prop="peopleNumber" label="随行人员数量" show-overflow-tooltip/>-->
<el-table-column prop="carList" label="车辆信息" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.carList && scope.row.carList.length > 0">
<el-tag v-for="(car, index) in scope.row.carList" :key="index" size="small" style="margin-right: 4px;">
{{ car.carNumber }}
</el-tag>
</div>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="otherPeople" label="随行人员" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.otherPeople && scope.row.otherPeople.length > 0">
<div v-for="(person, index) in scope.row.otherPeople" :key="index" style="margin-bottom: 2px;">
<el-tag size="small">{{ person.name }}({{ person.mobile }})</el-tag>
</div>
</div>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column prop="vstartDate" label="到访开始时间" show-overflow-tooltip/>
<el-table-column prop="vendDate" label="到访结束时间" show-overflow-tooltip/>
<!-- <el-table-column prop="isDrive" label="是否驾驶车辆" show-overflow-tooltip>-->
<!-- <template #default="scope">-->
<!-- <dict-tag :options="is_drive" :value="scope.row.isDrive"></dict-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="processInstanceId" label="流程id" show-overflow-tooltip/>-->
<!-- <el-table-column prop="checkReason" label="审核原因" show-overflow-tooltip/>-->
<!-- <el-table-column label="操作" width="150">-->
<!-- <template #default="scope">-->
<!-- <el-button icon="edit-pen" text type="primary" v-auth="'integrated_visitorYY_edit'"-->
<!-- @click="formDialogRef.openDialog(scope.row.id)">编辑</el-button>-->
<!-- <el-button icon="delete" text type="primary" v-auth="'integrated_visitorYY_del'" @click="handleDelete([scope.row.id])">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</div>
<!-- 编辑、新增 -->
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
</div>
</template>
<script setup lang="ts" name="systemVisitorYY">
import { BasicTableProps, useTable } from "/@/hooks/table";
import { fetchList, delObjs } from "/@/api/integrated/visitors";
import { useMessage, useMessageBox } from "/@/hooks/message";
import { useDict } from '/@/hooks/dict';
// 引入组件
const FormDialog = defineAsyncComponent(() => import('./form.vue'));
// 定义查询字典
const { check_status,is_drive } = useDict('check_status','is_drive')
// 定义变量内容
const formDialogRef = ref()
// 搜索变量
const queryRef = ref()
const showSearch = ref(true)
// 多选变量
const selectObjs = ref([]) as any
const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
type: '2' // 邀约类型
},
pageList: fetchList
})
// table hook
const {
getDataList,
currentChangeHandle,
sizeChangeHandle,
sortChangeHandle,
downBlobFile,
tableStyle
} = useTable(state)
// 清空搜索条件
const resetQuery = () => {
// 清空搜索条件
queryRef.value?.resetFields()
// 清空多选
selectObjs.value = []
// 重置type为邀约类型
state.queryForm.type = '2'
getDataList()
}
// 导出excel
const exportExcel = () => {
downBlobFile('/integrated/visitors/export', Object.assign(state.queryForm, { ids: selectObjs }), 'visitorsYY.xlsx')
}
// 多选事件
const selectionChangHandle = (objs: { id: string }[]) => {
selectObjs.value = objs.map(({ id }) => id);
multiple.value = !objs.length;
};
// 删除操作
const handleDelete = async (ids: string[]) => {
try {
await useMessageBox().confirm('此操作将永久删除');
} catch {
return;
}
try {
await delObjs(ids);
getDataList();
useMessage().success('删除成功');
} catch (err: any) {
useMessage().error(err.msg);
}
};
</script>
@@ -14,18 +14,18 @@
</div>
</div>
</template>
<el-table
:data="data"
stripe
<el-table
:data="data"
stripe
:loading="loading"
@row-click="handleRowClick"
class="ranking-table"
>
<el-table-column prop="ranking" label="排名" width="60" align="center">
<template #default="{ row }">
<el-tag
:type="getRankingTagType(row.ranking)"
<el-tag
:type="getRankingTagType(row.ranking)"
size="small"
class="ranking-tag"
>
@@ -33,7 +33,7 @@
</el-tag>
</template>
</el-table-column>
<el-table-column prop="productName" label="商品名称" min-width="150" show-overflow-tooltip>
<template #default="{ row }">
<div class="product-info">
@@ -42,27 +42,27 @@
</div>
</template>
</el-table-column>
<el-table-column prop="categoryName" label="分类" width="100" show-overflow-tooltip />
<el-table-column prop="salesAmount" label="销售额" width="120" align="right">
<template #default="{ row }">
<div class="amount-cell">
<div class="amount-value">{{ formatCurrency(row.salesAmount) }}</div>
<div v-if="row.yearOverYearGrowthRate !== undefined" class="growth-rate">
<el-icon
v-if="row.yearOverYearGrowthRate > 0"
<el-icon
v-if="row.yearOverYearGrowthRate > 0"
class="growth-icon up"
>
<ArrowUp />
</el-icon>
<el-icon
v-else-if="row.yearOverYearGrowthRate < 0"
<el-icon
v-else-if="row.yearOverYearGrowthRate < 0"
class="growth-icon down"
>
<ArrowDown />
</el-icon>
<span
<span
:class="getGrowthRateClass(row.yearOverYearGrowthRate)"
>
{{ Math.abs(row.yearOverYearGrowthRate).toFixed(1) }}%
@@ -71,44 +71,44 @@
</div>
</template>
</el-table-column>
<el-table-column prop="salesQuantity" label="销量" width="100" align="right">
<template #default="{ row }">
{{ formatNumber(row.salesQuantity) }}
</template>
</el-table-column>
<el-table-column prop="salesCount" label="笔数" width="80" align="right">
<template #default="{ row }">
{{ formatNumber(row.salesCount) }}
</template>
</el-table-column>
<el-table-column prop="averagePrice" label="均价" width="100" align="right">
<template #default="{ row }">
{{ formatCurrency(row.averagePrice) }}
</template>
</el-table-column>
<el-table-column prop="marketShare" label="市场份额" width="100" align="right">
<template #default="{ row }">
<div class="market-share">
<div class="share-value">{{ (row.marketShare * 100).toFixed(1) }}%</div>
<div class="share-bar">
<div
class="share-progress"
<div
class="share-progress"
:style="{ width: (row.marketShare * 100) + '%' }"
></div>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="80" align="center" fixed="right">
<template #default="{ row }">
<el-button
type="primary"
size="small"
<el-button
type="primary"
size="small"
text
@click.stop="viewDetail(row)"
>
@@ -117,7 +117,7 @@
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div v-if="showPagination" class="pagination-wrapper">
<el-pagination
@@ -31,7 +31,7 @@ let chartInstance: echarts.ECharts | null = null;
// 初始化图表
const initChart = () => {
if (!chartContainer.value) return;
chartInstance = echarts.init(chartContainer.value);
updateChart();
};
@@ -39,7 +39,7 @@ const initChart = () => {
// 更新图表
const updateChart = () => {
if (!chartInstance) return;
const option = getChartOption();
chartInstance.setOption(option, true);
};
@@ -79,7 +79,7 @@ const getChartOption = () => {
...item,
})),
};
case 'bar':
return {
...baseOption,
@@ -95,7 +95,7 @@ const getChartOption = () => {
...item,
})),
};
case 'pie':
return {
...baseOption,
@@ -121,7 +121,7 @@ const getChartOption = () => {
},
}],
};
case 'area':
return {
...baseOption,
@@ -139,7 +139,7 @@ const getChartOption = () => {
...item,
})),
};
default:
return baseOption;
}
@@ -46,17 +46,17 @@ const formattedValue = computed(() => {
if (typeof props.value === 'string') {
return props.value;
}
switch (props.format) {
case 'currency':
return new Intl.NumberFormat('zh-CN', {
style: 'currency',
currency: 'CNY',
}).format(props.value);
case 'percent':
return `${props.value.toFixed(2)}%`;
case 'number':
default:
return new Intl.NumberFormat('zh-CN').format(props.value);