refactor(shop): 重构店铺相关模型和界面组件
- 将店铺模型中的字段名从 shopName/shopAddress 更改为 name/address - 移除经纬度拆分字段 lng 和 lat,新增 location、district 和 points 字段 - 更新店铺编辑表单以匹配新的字段命名 - 在店铺列表中为店铺名称添加标签样式 - 修正配送员页面的列标题和数据显示逻辑 - 启用开发环境的 API URL 配置 - 修复双击编辑功能的调用问题
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
VITE_APP_NAME=后台管理(开发环境)
|
VITE_APP_NAME=后台管理(开发环境)
|
||||||
#VITE_API_URL=http://127.0.0.1:9200/api
|
VITE_API_URL=http://127.0.0.1:9200/api
|
||||||
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
#VITE_SERVER_API_URL=http://127.0.0.1:8000/api
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,9 @@ export interface ShopStore {
|
|||||||
// 自增ID
|
// 自增ID
|
||||||
id?: number;
|
id?: number;
|
||||||
// 店铺名称
|
// 店铺名称
|
||||||
shopName?: string;
|
name?: string;
|
||||||
// 门店横幅/图片
|
|
||||||
shopBanner?: string;
|
|
||||||
// 门店地址
|
// 门店地址
|
||||||
shopAddress?: string;
|
address?: string;
|
||||||
// 手机号码
|
// 手机号码
|
||||||
phone?: string;
|
phone?: string;
|
||||||
// 邮箱
|
// 邮箱
|
||||||
@@ -28,10 +26,12 @@ export interface ShopStore {
|
|||||||
region?: string;
|
region?: string;
|
||||||
// 经度和纬度
|
// 经度和纬度
|
||||||
lngAndLat?: string;
|
lngAndLat?: string;
|
||||||
// 经度(部分接口可能拆分返回)
|
// 位置
|
||||||
lng?: string;
|
location?:string;
|
||||||
// 纬度(部分接口可能拆分返回)
|
// 区域
|
||||||
lat?: string;
|
district?: string;
|
||||||
|
// 轮廓
|
||||||
|
points?: string;
|
||||||
// 用户ID
|
// 用户ID
|
||||||
userId?: number;
|
userId?: number;
|
||||||
// 状态
|
// 状态
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
>待审核</a-tag
|
>待审核</a-tag
|
||||||
>
|
>
|
||||||
<a-tag v-if="record.applyStatus === 20" color="success"
|
<a-tag v-if="record.applyStatus === 20" color="success"
|
||||||
>转账成功</a-tag
|
>审核通过</a-tag
|
||||||
>
|
>
|
||||||
<a-tag v-if="record.applyStatus === 30" color="error">用户取消</a-tag>
|
<a-tag v-if="record.applyStatus === 30" color="error">用户取消</a-tag>
|
||||||
<a-tag v-if="record.applyStatus === 40">已打款</a-tag>
|
<a-tag v-if="record.applyStatus === 40">已打款</a-tag>
|
||||||
@@ -443,7 +443,7 @@
|
|||||||
},
|
},
|
||||||
// 行双击事件
|
// 行双击事件
|
||||||
onDblclick: () => {
|
onDblclick: () => {
|
||||||
// openEdit(record);
|
openEdit(record);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -20,11 +20,11 @@
|
|||||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="店铺名称" name="shopName">
|
<a-form-item label="店铺名称" name="name">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入店铺名称"
|
placeholder="请输入店铺名称"
|
||||||
v-model:value="form.shopName"
|
v-model:value="form.name"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="门店经理" name="managerName">
|
<a-form-item label="门店经理" name="managerName">
|
||||||
@@ -49,11 +49,11 @@
|
|||||||
placeholder="请选择省/市/区"
|
placeholder="请选择省/市/区"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="门店地址" name="shopAddress">
|
<a-form-item label="门店地址" name="address">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入门店地址"
|
placeholder="请输入门店地址"
|
||||||
v-model:value="form.shopAddress"
|
v-model:value="form.address"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="经纬度" name="lngAndLat">
|
<a-form-item label="经纬度" name="lngAndLat">
|
||||||
@@ -66,6 +66,25 @@
|
|||||||
<a-button type="primary" @click="openUrl(`https://lbs.qq.com/getPoint/`)">获取经纬度</a-button>
|
<a-button type="primary" @click="openUrl(`https://lbs.qq.com/getPoint/`)">获取经纬度</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item label="轮廓" name="points">
|
||||||
|
<div class="flex">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请选取电子围栏的轮廓"
|
||||||
|
v-model:value="form.points"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<template #extra>
|
||||||
|
<p class="py-2">
|
||||||
|
<a
|
||||||
|
class="text-blue-500"
|
||||||
|
href="https://lbs.qq.com/dev/console/cloud/placeCloud/datamanage?table_id=0q3W4MrK1-_6Xag7V1"
|
||||||
|
target="_blank"
|
||||||
|
>使用腾讯地图的工具绘制电子围栏</a
|
||||||
|
>
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item label="备注" name="comments">
|
<a-form-item label="备注" name="comments">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
:rows="4"
|
:rows="4"
|
||||||
@@ -132,8 +151,8 @@
|
|||||||
// 用户信息
|
// 用户信息
|
||||||
const form = reactive<ShopStore>({
|
const form = reactive<ShopStore>({
|
||||||
id: undefined,
|
id: undefined,
|
||||||
shopName: undefined,
|
name: undefined,
|
||||||
shopAddress: undefined,
|
address: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
email: undefined,
|
email: undefined,
|
||||||
managerName: undefined,
|
managerName: undefined,
|
||||||
@@ -142,6 +161,9 @@
|
|||||||
city: undefined,
|
city: undefined,
|
||||||
region: undefined,
|
region: undefined,
|
||||||
lngAndLat: undefined,
|
lngAndLat: undefined,
|
||||||
|
location: undefined,
|
||||||
|
district: undefined,
|
||||||
|
points: undefined,
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
isDelete: undefined,
|
isDelete: undefined,
|
||||||
tenantId: undefined,
|
tenantId: undefined,
|
||||||
@@ -159,7 +181,7 @@
|
|||||||
|
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
shopName: [
|
name: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@@ -183,7 +205,7 @@
|
|||||||
trigger: 'change'
|
trigger: 'change'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
shopAddress: [
|
address: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'name'">
|
||||||
|
<a-tag color="orange">{{ record.name }}</a-tag>
|
||||||
|
</template>
|
||||||
<template v-if="column.key === 'image'">
|
<template v-if="column.key === 'image'">
|
||||||
<a-image :src="record.image" :width="50" />
|
<a-image :src="record.image" :width="50" />
|
||||||
</template>
|
</template>
|
||||||
@@ -49,7 +52,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { createVNode, ref, computed } from 'vue';
|
import { createVNode, ref } from 'vue';
|
||||||
import { message, Modal } from 'ant-design-vue';
|
import { message, Modal } from 'ant-design-vue';
|
||||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
@@ -100,16 +103,15 @@
|
|||||||
// 完整的列配置(包含所有字段)
|
// 完整的列配置(包含所有字段)
|
||||||
const columns = ref<ColumnItem[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
title: '店铺名称',
|
title: '店铺ID',
|
||||||
dataIndex: 'shopName',
|
dataIndex: 'id',
|
||||||
key: 'shopName',
|
key: 'id',
|
||||||
ellipsis: true
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '门店地址',
|
title: '店铺名称',
|
||||||
dataIndex: 'shopAddress',
|
dataIndex: 'name',
|
||||||
key: 'shopAddress',
|
key: 'name'
|
||||||
ellipsis: true
|
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: '手机号码',
|
// title: '手机号码',
|
||||||
@@ -141,6 +143,12 @@
|
|||||||
key: 'region',
|
key: 'region',
|
||||||
ellipsis: true
|
ellipsis: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '门店地址',
|
||||||
|
dataIndex: 'address',
|
||||||
|
key: 'address',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
// {
|
// {
|
||||||
// title: '经度',
|
// title: '经度',
|
||||||
// dataIndex: 'lng',
|
// dataIndex: 'lng',
|
||||||
|
|||||||
@@ -23,6 +23,9 @@
|
|||||||
<template v-if="column.key === 'image'">
|
<template v-if="column.key === 'image'">
|
||||||
<a-image :src="record.image" :width="50" />
|
<a-image :src="record.image" :width="50" />
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="column.key === 'storeName'">
|
||||||
|
<a-tag v-if="record.storeName" color="orange">{{ record.storeName }}</a-tag>
|
||||||
|
</template>
|
||||||
<template v-if="column.key === 'status'">
|
<template v-if="column.key === 'status'">
|
||||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||||
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
<a-tag v-if="record.status === 1" color="red">隐藏</a-tag>
|
||||||
@@ -106,7 +109,12 @@
|
|||||||
width: 90
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '姓名',
|
title: '所属门店',
|
||||||
|
dataIndex: 'storeName',
|
||||||
|
key: 'storeName'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '配送员',
|
||||||
dataIndex: 'realName',
|
dataIndex: 'realName',
|
||||||
key: 'realName'
|
key: 'realName'
|
||||||
},
|
},
|
||||||
@@ -125,11 +133,6 @@
|
|||||||
dataIndex: 'idCardNo',
|
dataIndex: 'idCardNo',
|
||||||
key: 'idCardNo'
|
key: 'idCardNo'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: '选择配送点',
|
|
||||||
dataIndex: 'dealerId',
|
|
||||||
key: 'dealerId'
|
|
||||||
},
|
|
||||||
// {
|
// {
|
||||||
// title: '状态',
|
// title: '状态',
|
||||||
// dataIndex: 'status',
|
// dataIndex: 'status',
|
||||||
|
|||||||
Reference in New Issue
Block a user