chore(config): 初始化项目配置文件

- 添加 .editorconfig 文件统一代码风格
- 配置 .env.development 环境变量文件
- 创建 .env.example 环境变量示例文件
- 设置 .eslintignore 忽略检查规则
- 配置 .eslintrc.js 代码检查规则
- 添加 .gitignore 文件忽略版本控制
- 设置 .prettierignore 忽略格式化规则
- 新增隐私政策HTML页面文件
- 创建API密钥编辑组件基础结构
This commit is contained in:
2025-12-15 13:29:17 +08:00
commit 1856a611ce
877 changed files with 176918 additions and 0 deletions

View File

@@ -0,0 +1,161 @@
<template>
<ele-modal
:width="750"
:visible="visible"
:maskClosable="false"
:title="title"
:footer="null"
:body-style="{ paddingBottom: '28px' }"
@update:visible="updateVisible"
>
<ele-pro-table
ref="tableRef"
row-key="merchantId"
:datasource="datasource"
:columns="columns"
:customRow="customRow"
:pagination="false"
>
<template #toolbar>
<a-input-search
allow-clear
v-model:value="searchText"
placeholder="请输入搜索关键词"
style="width: 200px"
@search="reload"
@pressEnter="reload"
/>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'image'">
<a-image
v-if="record.image"
:src="record.image"
:preview="false"
:width="45"
/>
</template>
<template v-if="column.key === 'shopType'">
<a-tag v-if="record.shopType === 10">企业</a-tag>
<a-tag v-if="record.shopType === 20">政府单位</a-tag>
</template>
<template v-if="column.key === 'action'">
<a-button type="primary" @click="onRadio(record)">选择</a-button>
</template>
</template>
</ele-pro-table>
</ele-modal>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import {
ColumnItem,
DatasourceFunction
} from 'ele-admin-pro/es/ele-pro-table/types';
import { pageShopMerchant } from '@/api/shop/shopMerchant';
import { EleProTable } from 'ele-admin-pro';
import { ShopMerchant, ShopMerchantParam } from '@/api/shop/shopMerchant/model';
const props = defineProps<{
// 弹窗是否打开
visible: boolean;
// 标题
title?: string;
// 商户类型
shopType?: string;
type?: string;
// 修改回显的数据
data?: ShopMerchant | null;
}>();
const emit = defineEmits<{
(e: 'done', data: ShopMerchant): void;
(e: 'update:visible', visible: boolean): void;
}>();
/* 更新visible */
const updateVisible = (value: boolean) => {
emit('update:visible', value);
};
// 搜索内容
const searchText = ref(null);
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格配置
const columns = ref<ColumnItem[]>([
{
title: 'LOGO',
dataIndex: 'image',
key: 'image',
align: 'center'
},
{
title: '商户名称',
dataIndex: 'merchantName'
},
{
title: '商户类型',
dataIndex: 'shopType',
// key: 'shopType'
},
{
title: '操作',
key: 'action',
align: 'center'
}
]);
// 表格数据源
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
where = {};
// 搜索条件
if (searchText.value) {
where.keywords = searchText.value;
}
if (props.shopType == 'empty') {
where.emptyType = true;
} else {
where.shopType = props.shopType;
}
if (props.type) {
where.type = props.type;
}
return pageShopMerchant({
...where,
...orders,
page,
limit
});
};
/* 搜索 */
const reload = (where?: ShopMerchantParam) => {
tableRef?.value?.reload({ page: 1, where });
};
const onRadio = (record: ShopMerchant) => {
updateVisible(false);
emit('done', record);
};
/* 自定义行属性 */
const customRow = (record: ShopMerchant) => {
return {
// 行点击事件
// onClick: () => {
// updateVisible(false);
// emit('done', record);
// },
// 行双击事件
onDblclick: () => {
updateVisible(false);
emit('done', record);
}
};
};
</script>
<style lang="less"></style>

View File

@@ -0,0 +1,64 @@
<template>
<div>
<a-input-group compact>
<a-input
disabled
style="width: calc(100% - 32px)"
v-model:value="content"
:placeholder="placeholder"
/>
<a-button @click="openEdit">
<template #icon><BulbOutlined class="ele-text-warning" /></template>
</a-button>
</a-input-group>
<!-- 选择弹窗 -->
<SelectData
v-model:visible="showEdit"
:data="current"
:title="placeholder"
:customer-type="customerType"
:shopType="shopType"
@done="onChange"
/>
</div>
</template>
<script lang="ts" setup>
import { BulbOutlined } from '@ant-design/icons-vue';
import { ref } from 'vue';
import SelectData from './components/select-data.vue';
import { ShopMerchant } from '@/api/shop/shopMerchant/model';
const props = withDefaults(
defineProps<{
value?: any;
customerType?: string;
placeholder?: string;
shopType?: string;
}>(),
{
placeholder: '请选择商户'
}
);
const emit = defineEmits<{
(e: 'done', ShopMerchant): void;
(e: 'clear'): void;
}>();
// 是否显示编辑弹窗
const showEdit = ref(false);
const content = ref<string>(props.value)
// 当前编辑数据
const current = ref<ShopMerchant | null>(null);
/* 打开编辑弹窗 */
const openEdit = (row?: ShopMerchant) => {
current.value = row ?? null;
showEdit.value = true;
};
const onChange = (row) => {
emit('done', row);
};
</script>