style(sdy): 格式化代码以符合团队样式指南

- 标准化组件标签的闭合方式和缩进
- 统一导入语句的空格和换行格式
- 调整对象属性的换行和对齐方式
- 规范条件渲染表达式的格式
- 优化长逻辑行的换行和可读性
- 统一箭头函数和三元运算符的格式
This commit is contained in:
2026-01-13 16:55:38 +08:00
parent ea8c799b19
commit 7a37f66081
2 changed files with 426 additions and 390 deletions

View File

@@ -21,7 +21,9 @@
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'applyStatus'">
<a-tag v-if="record.applyStatus === 10" color="orange">跟进中</a-tag>
<a-tag v-if="record.applyStatus === 10" color="orange"
>跟进中</a-tag
>
<a-tag v-if="record.applyStatus === 20" color="green">已签约</a-tag>
<a-tag v-if="record.applyStatus === 30" color="red">已取消</a-tag>
</template>
@@ -40,7 +42,9 @@
</template>
<template v-if="column.key === 'comments'">
<div class="text-gray-400">{{ record.comments }}</div>
<div class="text-gray-400" v-if="record.comments">{{ record.updateTime }}</div>
<div class="text-gray-400" v-if="record.comments">{{
record.updateTime
}}</div>
</template>
<template v-if="column.key === 'createTime'">
<div class="flex flex-col">
@@ -83,7 +87,11 @@
</a-card>
<!-- 编辑弹窗 -->
<ShopDealerApplyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
<ShopDealerApplyEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -112,7 +120,10 @@ import {
batchApproveShopDealerApply,
updateShopDealerApply
} from '@/api/shop/shopDealerApply';
import type {ShopDealerApply, ShopDealerApplyParam} from '@/api/shop/shopDealerApply/model';
import type {
ShopDealerApply,
ShopDealerApplyParam
} from '@/api/shop/shopDealerApply/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -267,7 +278,8 @@ const rejectApply = (row: ShopDealerApply) => {
createVNode('p', { style: 'margin-top: 12px;' }, '请输入驳回原因:'),
createVNode('textarea', {
placeholder: '请输入驳回原因...',
style: 'width: 100%; height: 80px; margin-top: 8px; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px;',
style:
'width: 100%; height: 80px; margin-top: 8px; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px;',
onInput: (e: any) => {
rejectReason = e.target.value;
}
@@ -333,7 +345,9 @@ const removeBatch = () => {
return;
}
const validIds = selection.value.filter(d => d.applyId).map(d => d.applyId);
const validIds = selection.value
.filter((d) => d.applyId)
.map((d) => d.applyId);
if (!validIds.length) {
message.error('选中的数据中没有有效的ID');
return;
@@ -348,7 +362,10 @@ const removeBatch = () => {
okType: 'danger',
cancelText: '取消',
onOk: () => {
const hide = message.loading(`正在删除 ${validIds.length} 条记录...`, 0);
const hide = message.loading(
`正在删除 ${validIds.length} 条记录...`,
0
);
removeBatchShopDealerApply(validIds)
.then((msg) => {
hide();
@@ -371,7 +388,9 @@ const batchApprove = () => {
return;
}
const pendingApplies = selection.value.filter(item => item.applyStatus === 10);
const pendingApplies = selection.value.filter(
(item) => item.applyStatus === 10
);
if (!pendingApplies.length) {
message.error('所选申请中没有待审核的记录');
return;
@@ -387,7 +406,7 @@ const batchApprove = () => {
onOk: async () => {
const hide = message.loading('正在批量通过...', 0);
try {
const ids = pendingApplies.map(item => item.applyId);
const ids = pendingApplies.map((item) => item.applyId);
await batchApproveShopDealerApply(ids);
hide();
message.success(`成功通过 ${pendingApplies.length} 个申请`);
@@ -437,4 +456,3 @@ export default {
name: 'ShopDealerApply'
};
</script>

View File

@@ -44,7 +44,11 @@
</a-card>
<!-- 编辑弹窗 -->
<ShopDealerCapitalEdit v-model:visible="showEdit" :data="current" @done="reload" />
<ShopDealerCapitalEdit
v-model:visible="showEdit"
:data="current"
@done="reload"
/>
</a-page-header>
</template>
@@ -60,8 +64,15 @@
import Search from './components/search.vue';
import { getPageTitle } from '@/utils/common';
import ShopDealerCapitalEdit from './components/shopDealerCapitalEdit.vue';
import { pageShopDealerCapital, removeShopDealerCapital, removeBatchShopDealerCapital } from '@/api/shop/shopDealerCapital';
import type { ShopDealerCapital, ShopDealerCapitalParam } from '@/api/shop/shopDealerCapital/model';
import {
pageShopDealerCapital,
removeShopDealerCapital,
removeBatchShopDealerCapital
} from '@/api/shop/shopDealerCapital';
import type {
ShopDealerCapital,
ShopDealerCapitalParam
} from '@/api/shop/shopDealerCapital/model';
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -127,7 +138,11 @@
50: { text: '新人注册奖', color: 'processing' }
};
const type = typeMap[text] || { text: '未知', color: 'default' };
return { type: 'tag', props: { color: type.color }, children: type.text };
return {
type: 'tag',
props: { color: type.color },
children: type.text
};
}
},
{
@@ -137,12 +152,15 @@
align: 'center',
customRender: ({ text, record }) => {
const amount = parseFloat(text || '0').toFixed(2);
const isIncome = record.flowType === 10 || record.flowType === 40 || record.flowType === 50;
const isIncome =
record.flowType === 10 ||
record.flowType === 40 ||
record.flowType === 50;
return {
type: 'span',
props: {
style: {
color: isIncome ? '#424242' : '#ff4d4f',
color: isIncome ? '#424242' : '#ff4d4f'
}
},
children: `${isIncome ? '' : '-'} ${amount}`
@@ -161,7 +179,7 @@
dataIndex: 'toUserId',
key: 'toUserId',
align: 'center',
customRender: ({ text }) => text ? `ID: ${text}` : '-'
customRender: ({ text }) => (text ? `ID: ${text}` : '-')
},
{
title: '描述',