style(sdy): 格式化代码以符合团队样式指南
- 标准化组件标签的闭合方式和缩进 - 统一导入语句的空格和换行格式 - 调整对象属性的换行和对齐方式 - 规范条件渲染表达式的格式 - 优化长逻辑行的换行和可读性 - 统一箭头函数和三元运算符的格式
This commit is contained in:
@@ -21,7 +21,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'applyStatus'">
|
<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 === 20" color="green">已签约</a-tag>
|
||||||
<a-tag v-if="record.applyStatus === 30" color="red">已取消</a-tag>
|
<a-tag v-if="record.applyStatus === 30" color="red">已取消</a-tag>
|
||||||
</template>
|
</template>
|
||||||
@@ -40,7 +42,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'comments'">
|
<template v-if="column.key === 'comments'">
|
||||||
<div class="text-gray-400">{{ record.comments }}</div>
|
<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>
|
||||||
<template v-if="column.key === 'createTime'">
|
<template v-if="column.key === 'createTime'">
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
@@ -83,7 +87,11 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<ShopDealerApplyEdit v-model:visible="showEdit" :data="current" @done="reload"/>
|
<ShopDealerApplyEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
</a-page-header>
|
</a-page-header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -112,7 +120,10 @@ import {
|
|||||||
batchApproveShopDealerApply,
|
batchApproveShopDealerApply,
|
||||||
updateShopDealerApply
|
updateShopDealerApply
|
||||||
} from '@/api/shop/shopDealerApply';
|
} 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);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -267,7 +278,8 @@ const rejectApply = (row: ShopDealerApply) => {
|
|||||||
createVNode('p', { style: 'margin-top: 12px;' }, '请输入驳回原因:'),
|
createVNode('p', { style: 'margin-top: 12px;' }, '请输入驳回原因:'),
|
||||||
createVNode('textarea', {
|
createVNode('textarea', {
|
||||||
placeholder: '请输入驳回原因...',
|
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) => {
|
onInput: (e: any) => {
|
||||||
rejectReason = e.target.value;
|
rejectReason = e.target.value;
|
||||||
}
|
}
|
||||||
@@ -333,7 +345,9 @@ const removeBatch = () => {
|
|||||||
return;
|
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) {
|
if (!validIds.length) {
|
||||||
message.error('选中的数据中没有有效的ID');
|
message.error('选中的数据中没有有效的ID');
|
||||||
return;
|
return;
|
||||||
@@ -348,7 +362,10 @@ const removeBatch = () => {
|
|||||||
okType: 'danger',
|
okType: 'danger',
|
||||||
cancelText: '取消',
|
cancelText: '取消',
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
const hide = message.loading(`正在删除 ${validIds.length} 条记录...`, 0);
|
const hide = message.loading(
|
||||||
|
`正在删除 ${validIds.length} 条记录...`,
|
||||||
|
0
|
||||||
|
);
|
||||||
removeBatchShopDealerApply(validIds)
|
removeBatchShopDealerApply(validIds)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
@@ -371,7 +388,9 @@ const batchApprove = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pendingApplies = selection.value.filter(item => item.applyStatus === 10);
|
const pendingApplies = selection.value.filter(
|
||||||
|
(item) => item.applyStatus === 10
|
||||||
|
);
|
||||||
if (!pendingApplies.length) {
|
if (!pendingApplies.length) {
|
||||||
message.error('所选申请中没有待审核的记录');
|
message.error('所选申请中没有待审核的记录');
|
||||||
return;
|
return;
|
||||||
@@ -387,7 +406,7 @@ const batchApprove = () => {
|
|||||||
onOk: async () => {
|
onOk: async () => {
|
||||||
const hide = message.loading('正在批量通过...', 0);
|
const hide = message.loading('正在批量通过...', 0);
|
||||||
try {
|
try {
|
||||||
const ids = pendingApplies.map(item => item.applyId);
|
const ids = pendingApplies.map((item) => item.applyId);
|
||||||
await batchApproveShopDealerApply(ids);
|
await batchApproveShopDealerApply(ids);
|
||||||
hide();
|
hide();
|
||||||
message.success(`成功通过 ${pendingApplies.length} 个申请`);
|
message.success(`成功通过 ${pendingApplies.length} 个申请`);
|
||||||
@@ -437,4 +456,3 @@ export default {
|
|||||||
name: 'ShopDealerApply'
|
name: 'ShopDealerApply'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,11 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<ShopDealerCapitalEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<ShopDealerCapitalEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
</a-page-header>
|
</a-page-header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -60,8 +64,15 @@
|
|||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import { getPageTitle } from '@/utils/common';
|
import { getPageTitle } from '@/utils/common';
|
||||||
import ShopDealerCapitalEdit from './components/shopDealerCapitalEdit.vue';
|
import ShopDealerCapitalEdit from './components/shopDealerCapitalEdit.vue';
|
||||||
import { pageShopDealerCapital, removeShopDealerCapital, removeBatchShopDealerCapital } from '@/api/shop/shopDealerCapital';
|
import {
|
||||||
import type { ShopDealerCapital, ShopDealerCapitalParam } from '@/api/shop/shopDealerCapital/model';
|
pageShopDealerCapital,
|
||||||
|
removeShopDealerCapital,
|
||||||
|
removeBatchShopDealerCapital
|
||||||
|
} from '@/api/shop/shopDealerCapital';
|
||||||
|
import type {
|
||||||
|
ShopDealerCapital,
|
||||||
|
ShopDealerCapitalParam
|
||||||
|
} from '@/api/shop/shopDealerCapital/model';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -127,7 +138,11 @@
|
|||||||
50: { text: '新人注册奖', color: 'processing' }
|
50: { text: '新人注册奖', color: 'processing' }
|
||||||
};
|
};
|
||||||
const type = typeMap[text] || { text: '未知', color: 'default' };
|
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',
|
align: 'center',
|
||||||
customRender: ({ text, record }) => {
|
customRender: ({ text, record }) => {
|
||||||
const amount = parseFloat(text || '0').toFixed(2);
|
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 {
|
return {
|
||||||
type: 'span',
|
type: 'span',
|
||||||
props: {
|
props: {
|
||||||
style: {
|
style: {
|
||||||
color: isIncome ? '#424242' : '#ff4d4f',
|
color: isIncome ? '#424242' : '#ff4d4f'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
children: `${isIncome ? '' : '-'} ${amount}`
|
children: `${isIncome ? '' : '-'} ${amount}`
|
||||||
@@ -161,7 +179,7 @@
|
|||||||
dataIndex: 'toUserId',
|
dataIndex: 'toUserId',
|
||||||
key: 'toUserId',
|
key: 'toUserId',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
customRender: ({ text }) => text ? `ID: ${text}` : '-'
|
customRender: ({ text }) => (text ? `ID: ${text}` : '-')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '描述',
|
title: '描述',
|
||||||
|
|||||||
Reference in New Issue
Block a user