整理商品管理模块
This commit is contained in:
@@ -10,6 +10,8 @@ export interface Mp {
|
|||||||
appId?: string;
|
appId?: string;
|
||||||
// 小程序密钥
|
// 小程序密钥
|
||||||
appSecret?: string;
|
appSecret?: string;
|
||||||
|
// 是否主账号
|
||||||
|
type?: number;
|
||||||
// 小程序名称
|
// 小程序名称
|
||||||
mpName?: string;
|
mpName?: string;
|
||||||
// 小程序简称
|
// 小程序简称
|
||||||
|
|||||||
@@ -17,13 +17,16 @@ export interface Website {
|
|||||||
address?: string;
|
address?: string;
|
||||||
phone?: string;
|
phone?: string;
|
||||||
email?: string;
|
email?: string;
|
||||||
|
version?: number;
|
||||||
websiteType?: string;
|
websiteType?: string;
|
||||||
expirationTime?: string;
|
expirationTime?: string;
|
||||||
templateId?: string;
|
templateId?: string;
|
||||||
industryParent?: string;
|
industryParent?: string;
|
||||||
industryChild?: string;
|
industryChild?: string;
|
||||||
companyId?: number;
|
companyId?: number;
|
||||||
|
prefix?: string;
|
||||||
domain?: string;
|
domain?: string;
|
||||||
|
adminUrl?: string;
|
||||||
icpNo?: string;
|
icpNo?: string;
|
||||||
policeNo?: string;
|
policeNo?: string;
|
||||||
comments?: string;
|
comments?: string;
|
||||||
@@ -36,7 +39,7 @@ export interface Website {
|
|||||||
region?: string;
|
region?: string;
|
||||||
appId?: number;
|
appId?: number;
|
||||||
fields?: WebsiteField[];
|
fields?: WebsiteField[];
|
||||||
status?: boolean;
|
status?: number;
|
||||||
tenantId?: number;
|
tenantId?: number;
|
||||||
tenantName?: string;
|
tenantName?: string;
|
||||||
navigations?: Navigation[];
|
navigations?: Navigation[];
|
||||||
|
|||||||
@@ -3,6 +3,14 @@ import type { ApiResult, PageResult } from '@/api';
|
|||||||
import type { Goods, GoodsParam } from './model';
|
import type { Goods, GoodsParam } from './model';
|
||||||
import { MODULES_API_URL } from '@/config/setting';
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
|
export async function getCount() {
|
||||||
|
const res = await request.get(MODULES_API_URL + '/shop/goods/data');
|
||||||
|
if (res.data.code === 0) {
|
||||||
|
return res.data.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.data.message));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询商品记录表
|
* 分页查询商品记录表
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -2,6 +2,12 @@ import type { PageParam } from '@/api';
|
|||||||
import { GoodsSpec } from '@/api/shop/goodsSpec/model';
|
import { GoodsSpec } from '@/api/shop/goodsSpec/model';
|
||||||
import { GoodsSku } from '@/api/shop/goodsSku/model';
|
import { GoodsSku } from '@/api/shop/goodsSku/model';
|
||||||
|
|
||||||
|
export interface GoodsCount {
|
||||||
|
totalNum: number;
|
||||||
|
totalNum2: number;
|
||||||
|
totalNum3: number;
|
||||||
|
totalNum4: number;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 商品记录表
|
* 商品记录表
|
||||||
*/
|
*/
|
||||||
@@ -45,6 +51,7 @@ export interface Goods {
|
|||||||
// 推荐
|
// 推荐
|
||||||
recommend?: number;
|
recommend?: number;
|
||||||
// 状态, 0正常, 1待修,2异常已修,3异常未修
|
// 状态, 0正常, 1待修,2异常已修,3异常未修
|
||||||
|
isShow?: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
// 备注
|
// 备注
|
||||||
comments?: string;
|
comments?: string;
|
||||||
@@ -58,6 +65,8 @@ export interface Goods {
|
|||||||
tenantId?: number;
|
tenantId?: number;
|
||||||
// 商户ID
|
// 商户ID
|
||||||
merchantId?: number;
|
merchantId?: number;
|
||||||
|
// 店铺名称
|
||||||
|
merchantName?: string;
|
||||||
// 创建时间
|
// 创建时间
|
||||||
createTime?: string;
|
createTime?: string;
|
||||||
// 修改时间
|
// 修改时间
|
||||||
@@ -80,5 +89,8 @@ export interface BathSet {
|
|||||||
*/
|
*/
|
||||||
export interface GoodsParam extends PageParam {
|
export interface GoodsParam extends PageParam {
|
||||||
goodsId?: number;
|
goodsId?: number;
|
||||||
|
status?: number;
|
||||||
|
isShow?: number;
|
||||||
|
stock?: number;
|
||||||
keywords?: string;
|
keywords?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
import type { MerchantAccount, MerchantAccountParam } from './model';
|
import type { MerchantAccount, MerchantAccountParam } from './model';
|
||||||
import { SERVER_API_URL } from '@/config/setting';
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询商户账号
|
* 分页查询商户账号
|
||||||
*/
|
*/
|
||||||
export async function pageMerchantAccount(params: MerchantAccountParam) {
|
export async function pageMerchantAccount(params: MerchantAccountParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<MerchantAccount>>>(
|
const res = await request.get<ApiResult<PageResult<MerchantAccount>>>(
|
||||||
SERVER_API_URL + '/system/merchant-account/page',
|
MODULES_API_URL + '/shop/merchant-account/page',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ export async function pageMerchantAccount(params: MerchantAccountParam) {
|
|||||||
*/
|
*/
|
||||||
export async function listMerchantAccount(params?: MerchantAccountParam) {
|
export async function listMerchantAccount(params?: MerchantAccountParam) {
|
||||||
const res = await request.get<ApiResult<MerchantAccount[]>>(
|
const res = await request.get<ApiResult<MerchantAccount[]>>(
|
||||||
SERVER_API_URL + '/system/merchant-account',
|
MODULES_API_URL + '/shop/merchant-account',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export async function listMerchantAccount(params?: MerchantAccountParam) {
|
|||||||
*/
|
*/
|
||||||
export async function addMerchantAccount(data: MerchantAccount) {
|
export async function addMerchantAccount(data: MerchantAccount) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-account',
|
MODULES_API_URL + '/shop/merchant-account',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -54,7 +54,7 @@ export async function addMerchantAccount(data: MerchantAccount) {
|
|||||||
*/
|
*/
|
||||||
export async function updateMerchantAccount(data: MerchantAccount) {
|
export async function updateMerchantAccount(data: MerchantAccount) {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-account',
|
MODULES_API_URL + '/shop/merchant-account',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -68,7 +68,7 @@ export async function updateMerchantAccount(data: MerchantAccount) {
|
|||||||
*/
|
*/
|
||||||
export async function removeMerchantAccount(id?: number) {
|
export async function removeMerchantAccount(id?: number) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-account/' + id
|
MODULES_API_URL + '/shop/merchant-account/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
@@ -81,7 +81,7 @@ export async function removeMerchantAccount(id?: number) {
|
|||||||
*/
|
*/
|
||||||
export async function removeBatchMerchantAccount(data: (number | undefined)[]) {
|
export async function removeBatchMerchantAccount(data: (number | undefined)[]) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-account/batch',
|
MODULES_API_URL + '/shop/merchant-account/batch',
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ export async function removeBatchMerchantAccount(data: (number | undefined)[]) {
|
|||||||
*/
|
*/
|
||||||
export async function getMerchantAccount(id: number) {
|
export async function getMerchantAccount(id: number) {
|
||||||
const res = await request.get<ApiResult<MerchantAccount>>(
|
const res = await request.get<ApiResult<MerchantAccount>>(
|
||||||
SERVER_API_URL + '/system/merchant-account/' + id
|
MODULES_API_URL + '/shop/merchant-account/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
@@ -107,7 +107,7 @@ export async function getMerchantAccount(id: number) {
|
|||||||
|
|
||||||
export async function getMerchantAccountByPhone(params?: MerchantAccountParam) {
|
export async function getMerchantAccountByPhone(params?: MerchantAccountParam) {
|
||||||
const res = await request.get<ApiResult<MerchantAccount>>(
|
const res = await request.get<ApiResult<MerchantAccount>>(
|
||||||
SERVER_API_URL + '/system/merchant-account/getMerchantAccountByPhone',
|
MODULES_API_URL + '/shop/merchant-account/getMerchantAccountByPhone',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export interface MerchantAccount {
|
|||||||
roleName?: string;
|
roleName?: string;
|
||||||
// 用户ID
|
// 用户ID
|
||||||
userId?: number;
|
userId?: number;
|
||||||
|
nickname?: string;
|
||||||
// 备注
|
// 备注
|
||||||
comments?: string;
|
comments?: string;
|
||||||
// 状态
|
// 状态
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
import type { MerchantApply, MerchantApplyParam } from './model';
|
import type { MerchantApply, MerchantApplyParam } from './model';
|
||||||
import { SERVER_API_URL } from '@/config/setting';
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询商户入驻申请
|
* 分页查询商户入驻申请
|
||||||
*/
|
*/
|
||||||
export async function pageMerchantApply(params: MerchantApplyParam) {
|
export async function pageMerchantApply(params: MerchantApplyParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<MerchantApply>>>(
|
const res = await request.get<ApiResult<PageResult<MerchantApply>>>(
|
||||||
SERVER_API_URL + '/system/merchant-apply/page',
|
MODULES_API_URL + '/shop/merchant-apply/page',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ export async function pageMerchantApply(params: MerchantApplyParam) {
|
|||||||
*/
|
*/
|
||||||
export async function listMerchantApply(params?: MerchantApplyParam) {
|
export async function listMerchantApply(params?: MerchantApplyParam) {
|
||||||
const res = await request.get<ApiResult<MerchantApply[]>>(
|
const res = await request.get<ApiResult<MerchantApply[]>>(
|
||||||
SERVER_API_URL + '/system/merchant-apply',
|
MODULES_API_URL + '/shop/merchant-apply',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export async function listMerchantApply(params?: MerchantApplyParam) {
|
|||||||
*/
|
*/
|
||||||
export async function addMerchantApply(data: MerchantApply) {
|
export async function addMerchantApply(data: MerchantApply) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-apply',
|
MODULES_API_URL + '/shop/merchant-apply',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -54,7 +54,7 @@ export async function addMerchantApply(data: MerchantApply) {
|
|||||||
*/
|
*/
|
||||||
export async function updateMerchantApply(data: MerchantApply) {
|
export async function updateMerchantApply(data: MerchantApply) {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-apply',
|
MODULES_API_URL + '/shop/merchant-apply',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -68,7 +68,7 @@ export async function updateMerchantApply(data: MerchantApply) {
|
|||||||
*/
|
*/
|
||||||
export async function removeMerchantApply(id?: number) {
|
export async function removeMerchantApply(id?: number) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-apply/' + id
|
MODULES_API_URL + '/shop/merchant-apply/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
@@ -81,7 +81,7 @@ export async function removeMerchantApply(id?: number) {
|
|||||||
*/
|
*/
|
||||||
export async function removeBatchMerchantApply(data: (number | undefined)[]) {
|
export async function removeBatchMerchantApply(data: (number | undefined)[]) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-apply/batch',
|
MODULES_API_URL + '/shop/merchant-apply/batch',
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ export async function removeBatchMerchantApply(data: (number | undefined)[]) {
|
|||||||
*/
|
*/
|
||||||
export async function getMerchantApply(id: number) {
|
export async function getMerchantApply(id: number) {
|
||||||
const res = await request.get<ApiResult<MerchantApply>>(
|
const res = await request.get<ApiResult<MerchantApply>>(
|
||||||
SERVER_API_URL + '/system/merchant-apply/' + id
|
MODULES_API_URL + '/shop/merchant-apply/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import type { ApiResult, PageResult } from '@/api';
|
import type { ApiResult, PageResult } from '@/api';
|
||||||
import type { MerchantType, MerchantTypeParam } from './model';
|
import type { MerchantType, MerchantTypeParam } from './model';
|
||||||
import { SERVER_API_URL } from '@/config/setting';
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询商户类型
|
* 分页查询商户类型
|
||||||
*/
|
*/
|
||||||
export async function pageMerchantType(params: MerchantTypeParam) {
|
export async function pageMerchantType(params: MerchantTypeParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<MerchantType>>>(
|
const res = await request.get<ApiResult<PageResult<MerchantType>>>(
|
||||||
SERVER_API_URL + '/system/merchant-type/page',
|
MODULES_API_URL + '/shop/merchant-type/page',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ export async function pageMerchantType(params: MerchantTypeParam) {
|
|||||||
*/
|
*/
|
||||||
export async function listMerchantType(params?: MerchantTypeParam) {
|
export async function listMerchantType(params?: MerchantTypeParam) {
|
||||||
const res = await request.get<ApiResult<MerchantType[]>>(
|
const res = await request.get<ApiResult<MerchantType[]>>(
|
||||||
SERVER_API_URL + '/system/merchant-type',
|
MODULES_API_URL + '/shop/merchant-type',
|
||||||
{
|
{
|
||||||
params
|
params
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export async function listMerchantType(params?: MerchantTypeParam) {
|
|||||||
*/
|
*/
|
||||||
export async function addMerchantType(data: MerchantType) {
|
export async function addMerchantType(data: MerchantType) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-type',
|
MODULES_API_URL + '/shop/merchant-type',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -54,7 +54,7 @@ export async function addMerchantType(data: MerchantType) {
|
|||||||
*/
|
*/
|
||||||
export async function updateMerchantType(data: MerchantType) {
|
export async function updateMerchantType(data: MerchantType) {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-type',
|
MODULES_API_URL + '/shop/merchant-type',
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
@@ -68,7 +68,7 @@ export async function updateMerchantType(data: MerchantType) {
|
|||||||
*/
|
*/
|
||||||
export async function removeMerchantType(id?: number) {
|
export async function removeMerchantType(id?: number) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-type/' + id
|
MODULES_API_URL + '/shop/merchant-type/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0) {
|
if (res.data.code === 0) {
|
||||||
return res.data.message;
|
return res.data.message;
|
||||||
@@ -81,7 +81,7 @@ export async function removeMerchantType(id?: number) {
|
|||||||
*/
|
*/
|
||||||
export async function removeBatchMerchantType(data: (number | undefined)[]) {
|
export async function removeBatchMerchantType(data: (number | undefined)[]) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
SERVER_API_URL + '/system/merchant-type/batch',
|
MODULES_API_URL + '/shop/merchant-type/batch',
|
||||||
{
|
{
|
||||||
data
|
data
|
||||||
}
|
}
|
||||||
@@ -97,7 +97,7 @@ export async function removeBatchMerchantType(data: (number | undefined)[]) {
|
|||||||
*/
|
*/
|
||||||
export async function getMerchantType(id: number) {
|
export async function getMerchantType(id: number) {
|
||||||
const res = await request.get<ApiResult<MerchantType>>(
|
const res = await request.get<ApiResult<MerchantType>>(
|
||||||
SERVER_API_URL + '/system/merchant-type/' + id
|
MODULES_API_URL + '/shop/merchant-type/' + id
|
||||||
);
|
);
|
||||||
if (res.data.code === 0 && res.data.data) {
|
if (res.data.code === 0 && res.data.data) {
|
||||||
return res.data.data;
|
return res.data.data;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import type { Spec, SpecParam } from './model';
|
|||||||
import { MODULES_API_URL } from '@/config/setting';
|
import { MODULES_API_URL } from '@/config/setting';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询商品规格组记录表
|
* 分页查询规格
|
||||||
*/
|
*/
|
||||||
export async function pageSpec(params: SpecParam) {
|
export async function pageSpec(params: SpecParam) {
|
||||||
const res = await request.get<ApiResult<PageResult<Spec>>>(
|
const res = await request.get<ApiResult<PageResult<Spec>>>(
|
||||||
@@ -20,7 +20,7 @@ export async function pageSpec(params: SpecParam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询商品规格组记录表列表
|
* 查询规格列表
|
||||||
*/
|
*/
|
||||||
export async function listSpec(params?: SpecParam) {
|
export async function listSpec(params?: SpecParam) {
|
||||||
const res = await request.get<ApiResult<Spec[]>>(
|
const res = await request.get<ApiResult<Spec[]>>(
|
||||||
@@ -36,7 +36,7 @@ export async function listSpec(params?: SpecParam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加商品规格组记录表
|
* 添加规格
|
||||||
*/
|
*/
|
||||||
export async function addSpec(data: Spec) {
|
export async function addSpec(data: Spec) {
|
||||||
const res = await request.post<ApiResult<unknown>>(
|
const res = await request.post<ApiResult<unknown>>(
|
||||||
@@ -50,7 +50,7 @@ export async function addSpec(data: Spec) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改商品规格组记录表
|
* 修改规格
|
||||||
*/
|
*/
|
||||||
export async function updateSpec(data: Spec) {
|
export async function updateSpec(data: Spec) {
|
||||||
const res = await request.put<ApiResult<unknown>>(
|
const res = await request.put<ApiResult<unknown>>(
|
||||||
@@ -64,7 +64,7 @@ export async function updateSpec(data: Spec) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除商品规格组记录表
|
* 删除规格
|
||||||
*/
|
*/
|
||||||
export async function removeSpec(id?: number) {
|
export async function removeSpec(id?: number) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
@@ -77,7 +77,7 @@ export async function removeSpec(id?: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除商品规格组记录表
|
* 批量删除规格
|
||||||
*/
|
*/
|
||||||
export async function removeBatchSpec(data: (number | undefined)[]) {
|
export async function removeBatchSpec(data: (number | undefined)[]) {
|
||||||
const res = await request.delete<ApiResult<unknown>>(
|
const res = await request.delete<ApiResult<unknown>>(
|
||||||
@@ -93,7 +93,7 @@ export async function removeBatchSpec(data: (number | undefined)[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询商品规格组记录表
|
* 根据id查询规格
|
||||||
*/
|
*/
|
||||||
export async function getSpec(id: number) {
|
export async function getSpec(id: number) {
|
||||||
const res = await request.get<ApiResult<Spec>>(
|
const res = await request.get<ApiResult<Spec>>(
|
||||||
|
|||||||
@@ -1,31 +1,33 @@
|
|||||||
import type { PageParam } from '@/api';
|
import type { PageParam } from '@/api';
|
||||||
import { SpecValue } from '@/api/shop/specValue/model';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品规格组记录表
|
* 规格
|
||||||
*/
|
*/
|
||||||
export interface Spec {
|
export interface Spec {
|
||||||
// 规格组ID
|
// 规格ID
|
||||||
specId?: number;
|
specId?: number;
|
||||||
// 规格组名称
|
// 规格名称
|
||||||
specName?: string;
|
specName?: string;
|
||||||
// 描述
|
// 规格值
|
||||||
|
specValue?: string;
|
||||||
|
// 创建用户
|
||||||
|
userId?: number;
|
||||||
|
// 更新者
|
||||||
|
updater?: number;
|
||||||
|
// 备注
|
||||||
comments?: string;
|
comments?: string;
|
||||||
// 状态
|
// 状态, 0正常, 1待修,2异常已修,3异常未修
|
||||||
status?: number;
|
status?: number;
|
||||||
// 排序
|
// 排序号
|
||||||
sortNumber?: number;
|
sortNumber?: number;
|
||||||
// 租户id
|
// 租户id
|
||||||
tenantId?: number;
|
tenantId?: number;
|
||||||
// 规格值
|
// 创建时间
|
||||||
specValues?: SpecValue[];
|
createTime?: string;
|
||||||
key?: string;
|
|
||||||
label?: string;
|
|
||||||
value?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品规格组记录表搜索条件
|
* 规格搜索条件
|
||||||
*/
|
*/
|
||||||
export interface SpecParam extends PageParam {
|
export interface SpecParam extends PageParam {
|
||||||
specId?: number;
|
specId?: number;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ export interface SpecValue {
|
|||||||
key?: string;
|
key?: string;
|
||||||
label?: string;
|
label?: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
|
detail?: [string];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,13 +3,14 @@
|
|||||||
<div class="phone-header-black ele-fluid">
|
<div class="phone-header-black ele-fluid">
|
||||||
<div class="title ele-fluid">
|
<div class="title ele-fluid">
|
||||||
<div class="title-bar">
|
<div class="title-bar">
|
||||||
<a class="back" @click="openUrl(`/mp-weixin/home`)"></a>
|
<span class="back"></span>
|
||||||
<span>{{ form.pageName || '商品详情' }}</span>
|
<span>{{ form.title || '首页' }}</span>
|
||||||
<a class="share" @click="onShare"></a>
|
<a class="share" @click="onShare"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template v-if="form.showUserCard">
|
<!-- 会员信息卡片 -->
|
||||||
|
<template v-if="form.title == '我的'">
|
||||||
<a-popover>
|
<a-popover>
|
||||||
<template #content> 点击更换背景 </template>
|
<template #content> 点击更换背景 </template>
|
||||||
<div
|
<div
|
||||||
@@ -41,229 +42,162 @@
|
|||||||
@done="reload"
|
@done="reload"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="form.showOrderCard">
|
|
||||||
<div class="order-card ele-cell">
|
|
||||||
<div
|
|
||||||
v-for="(item, index) in order"
|
|
||||||
:key="index"
|
|
||||||
class="ele-cell-content ele-text-center btn-center"
|
|
||||||
@click="openMpMenuEdit(item)"
|
|
||||||
>
|
|
||||||
<a-image :src="item.icon" :width="30" :preview="false" />
|
|
||||||
<span>{{ item.title }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<template v-if="form.showToolsCard">
|
|
||||||
<div class="tools-card">
|
|
||||||
<div
|
|
||||||
v-for="(item, index) in server"
|
|
||||||
:key="index"
|
|
||||||
class="ele-cell"
|
|
||||||
@click="openMpMenuEdit(item)"
|
|
||||||
>
|
|
||||||
<a-avatar :src="item.icon" :size="24" />
|
|
||||||
<div
|
|
||||||
class="title ele-cell-content"
|
|
||||||
:style="{ color: item.color || '#333333' }"
|
|
||||||
>{{ item.title }}</div
|
|
||||||
>
|
|
||||||
<RightOutlined class="ele-text-secondary" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<MpMenuEdit
|
|
||||||
v-model:visible="showMpMenuEdit"
|
|
||||||
:data="current"
|
|
||||||
@done="reload"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
<template v-if="form.title">
|
<template v-if="form.title">
|
||||||
<div class="phone-body" style="overflow-y: auto; overflow-x: hidden">
|
<div class="phone-body" style="overflow-y: auto; overflow-x: hidden">
|
||||||
<a-carousel arrows autoplay :dots="true">
|
<!-- 幻灯片轮播 -->
|
||||||
<template #prevArrow>
|
<template v-if="form.showCarousel">
|
||||||
<div class="custom-slick-arrow" style="left: 20px; z-index: 1">
|
<div
|
||||||
<LeftCircleOutlined />
|
class="ad-bar"
|
||||||
</div>
|
:style="{
|
||||||
</template>
|
backgroundImage: 'url(' + param.mp_user_top + ')'
|
||||||
<template #nextArrow>
|
}"
|
||||||
<div class="custom-slick-arrow" style="right: 40px">
|
@click="onCarousel"
|
||||||
<RightCircleOutlined />
|
>
|
||||||
</div>
|
<a-carousel arrows autoplay :dots="true">
|
||||||
</template>
|
<template v-if="adImageList">
|
||||||
<template v-if="form.fields">
|
<template v-for="(img, index) in adImageList" :key="index">
|
||||||
<template
|
<div class="ad-item">
|
||||||
v-for="(img, index) in JSON.parse(form.fields)"
|
<a-image
|
||||||
|
:preview="false"
|
||||||
|
:src="img.url"
|
||||||
|
width="100%"
|
||||||
|
height="200px"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-carousel>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<!-- 导航菜单 -->
|
||||||
|
<template v-if="mpMenus">
|
||||||
|
<!-- 单排 -->
|
||||||
|
<div class="order-card ele-cell">
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in mpMenus"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
class="ele-cell-content ele-text-center btn-center"
|
||||||
|
@click="openMpMenuEdit(item)"
|
||||||
>
|
>
|
||||||
<div class="ad-item">
|
<a-image :src="item.avatar" :width="40" :preview="false" />
|
||||||
<a-image :preview="false" :src="img" width="100%" />
|
<span style="white-space: nowrap">{{ item.title }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <MpMenuEdit-->
|
||||||
|
<!-- v-model:visible="showMpMenuEdit"-->
|
||||||
|
<!-- :data="current"-->
|
||||||
|
<!-- @done="reload"-->
|
||||||
|
<!-- />-->
|
||||||
|
</template>
|
||||||
|
<!-- 商户列表 -->
|
||||||
|
<template v-if="form.showShopCard">
|
||||||
|
<div class="merchant-card-title">场地预定</div>
|
||||||
|
<div
|
||||||
|
class="merchant-card ele-cell"
|
||||||
|
v-for="(item, index) in shopList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<a-image :src="item.image" :width="96" :preview="false" />
|
||||||
|
<div class="merchant-info ele-cell-content">
|
||||||
|
<div class="merchant-name">{{ item.merchantName }}</div>
|
||||||
|
<div class="merchant-desc ele-cell-desc">
|
||||||
|
{{ item.comments }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
|
||||||
</template>
|
|
||||||
<template v-else>
|
|
||||||
<div class="ad-item">
|
|
||||||
<a-image :preview="false" :src="form.image" width="100%" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<!-- <div class="">-->
|
||||||
</a-carousel>
|
<!-- <a-button>我要去</a-button>-->
|
||||||
<a-card
|
<!-- </div>-->
|
||||||
v-if="form.title"
|
|
||||||
class="goods"
|
|
||||||
:bordered="false"
|
|
||||||
:body-style="{ padding: '16px' }"
|
|
||||||
>
|
|
||||||
<div class="ele-cell price ele-text-danger">
|
|
||||||
<div class="ele-cell-content ele-cell">
|
|
||||||
<span class="ele-text-danger"><sub>¥</sub></span>
|
|
||||||
<a-statistic
|
|
||||||
:precision="2"
|
|
||||||
:value="`${form.price ? form.price : 0}`"
|
|
||||||
:valueStyle="{ color: 'var(--error-color)' }"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div class="ele-cell-desc">已售 {{ formatNumber(form.sales) }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="ele-cell-title">{{ form.title }}</div>
|
</template>
|
||||||
<div class="ele-cell goods-attr">
|
<!-- 培训课程 -->
|
||||||
<div class="ele-cell-content">
|
<template v-if="form.showTtrainCard">
|
||||||
<a-tag color="orange">交通银行满减</a-tag>
|
<div class="merchant-card-title">培训课程</div>
|
||||||
<a-tag color="orange">满30减10</a-tag>
|
<div
|
||||||
|
class="merchant-card ele-cell"
|
||||||
|
v-for="(item, index) in shopList"
|
||||||
|
:key="index"
|
||||||
|
@click="openMpMenuEdit(item)"
|
||||||
|
>
|
||||||
|
<a-image :src="item.image" :width="96" :preview="false" />
|
||||||
|
<div class="merchant-info ele-cell-content">
|
||||||
|
<div class="merchant-name">{{ item.merchantName }}</div>
|
||||||
|
<div class="merchant-desc ele-cell-desc">
|
||||||
|
{{ item.comments }}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</template>
|
||||||
<a-divider class="goods-divider" />
|
|
||||||
<a-card
|
|
||||||
class="goods"
|
|
||||||
:bordered="false"
|
|
||||||
:body-style="{ padding: '8px 16px' }"
|
|
||||||
>
|
|
||||||
<div class="ele-cell goods-attr">
|
|
||||||
<div class="ele-text-secondary">已选择:</div>
|
|
||||||
<div class="ele-cell-content">颜色</div>
|
|
||||||
<div class="ele-cell-desc"><RightOutlined /></div>
|
|
||||||
</div>
|
|
||||||
</a-card>
|
|
||||||
<a-divider class="goods-divider" />
|
|
||||||
<a-card
|
|
||||||
class="goods"
|
|
||||||
:bordered="false"
|
|
||||||
:body-style="{ padding: '8px 16px' }"
|
|
||||||
>
|
|
||||||
<div class="ele-cell goods-attr">
|
|
||||||
<div class="ele-text-secondary">用户评价(0)</div>
|
|
||||||
<div class="ele-cell-content"></div>
|
|
||||||
</div>
|
|
||||||
</a-card>
|
|
||||||
<a-divider style="padding: 0 30px">商品详情</a-divider>
|
|
||||||
<a-card
|
|
||||||
class="goods"
|
|
||||||
:bordered="false"
|
|
||||||
:body-style="{ padding: '16px' }"
|
|
||||||
>
|
|
||||||
<!-- 文档内容 -->
|
|
||||||
<tinymce-editor
|
|
||||||
id="content"
|
|
||||||
v-model:value="form.content"
|
|
||||||
:disabled="true"
|
|
||||||
:init="config"
|
|
||||||
/>
|
|
||||||
</a-card>
|
|
||||||
<div class="goods-content" v-if="form.files">
|
|
||||||
<template v-for="(img, index) in JSON.parse(form.files)" :key="index">
|
|
||||||
<div class="ad-item">
|
|
||||||
<a-image :preview="false" :src="img" width="100%" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
<a-card
|
|
||||||
class="buy-bar"
|
|
||||||
:bordered="false"
|
|
||||||
:body-style="{ padding: '12px 16px' }"
|
|
||||||
>
|
|
||||||
<div class="ele-cell">
|
|
||||||
<div class="shop-btn ele-text-secondary">
|
|
||||||
<ShopOutlined class="icon ele-text-danger" />
|
|
||||||
店铺
|
|
||||||
</div>
|
|
||||||
<div class="kefu-btn ele-text-secondary">
|
|
||||||
<CustomerServiceOutlined class="icon ele-text-warning" />
|
|
||||||
客服
|
|
||||||
</div>
|
|
||||||
<div class="star-btn ele-text-secondary">
|
|
||||||
<StarOutlined class="icon" />
|
|
||||||
收藏
|
|
||||||
</div>
|
|
||||||
<div class="ele-cell-content buy-btn">
|
|
||||||
<a-space :size="0">
|
|
||||||
<a-button class="add-cart">加入购物车</a-button
|
|
||||||
><a-button class="buy-now">立即购买</a-button>
|
|
||||||
</a-space>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</a-card>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<a-card
|
||||||
|
class="buy-bar"
|
||||||
|
:bordered="false"
|
||||||
|
v-if="form"
|
||||||
|
:body-style="{ padding: '12px 16px' }"
|
||||||
|
>
|
||||||
|
<div class="ele-cell">
|
||||||
|
<template v-for="(item, index) in tabBar" :key="index">
|
||||||
|
<a
|
||||||
|
class="home-btn ele-cell-content ele-text-secondary"
|
||||||
|
@click="openUrl(`/mp-design/${item.id}`)"
|
||||||
|
>
|
||||||
|
<component
|
||||||
|
v-if="item.icon"
|
||||||
|
class="icon"
|
||||||
|
:class="form.id === item.id ? 'ele-text-danger' : ''"
|
||||||
|
:is="item.icon"
|
||||||
|
/>
|
||||||
|
<span :class="form.id === item.id ? 'ele-text-danger' : ''">{{
|
||||||
|
item.title
|
||||||
|
}}</span>
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
<AdEdit v-model:visible="showAdEdit" :data="ad" @done="reload" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {
|
import { ref, watch } from 'vue';
|
||||||
LeftCircleOutlined,
|
|
||||||
RightCircleOutlined,
|
|
||||||
RightOutlined,
|
|
||||||
ShopOutlined,
|
|
||||||
CustomerServiceOutlined,
|
|
||||||
StarOutlined
|
|
||||||
} from '@ant-design/icons-vue';
|
|
||||||
import { formatNumber } from 'ele-admin-pro/es';
|
|
||||||
import { ref } from 'vue';
|
|
||||||
import { MpWeixinParam, WebsiteField } from '@/api/cms/website/field/model';
|
import { MpWeixinParam, WebsiteField } from '@/api/cms/website/field/model';
|
||||||
import { listWebsiteField } from '@/api/system/website/field';
|
|
||||||
import UserCardEdit from '@/views/cms/field/components/website-field-edit.vue';
|
|
||||||
import MpMenuEdit from '@/views/cms/mpDesign/components/mpMenuEdit.vue';
|
|
||||||
import { MpMenu } from '@/api/cms/mp-menu/model';
|
import { MpMenu } from '@/api/cms/mp-menu/model';
|
||||||
import { listMpMenu } from '@/api/cms/mp-menu';
|
import type { MpPages } from '@/api/cms/mpPages/model';
|
||||||
import { openUrl } from '@/utils/common';
|
import { openUrl } from '@/utils/common';
|
||||||
|
|
||||||
withDefaults(
|
// import MpMenuEdit from './mpMenuEdit.vue';
|
||||||
|
import { Ad } from '@/api/cms/ad/model';
|
||||||
|
import AdEdit from '@/views/cms/ad/components/ad-edit.vue';
|
||||||
|
import UserCardEdit from '@/views/cms/field/components/website-field-edit.vue';
|
||||||
|
|
||||||
|
const prpos = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
value?: string;
|
value?: string;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
form?: any | null;
|
form?: MpPages;
|
||||||
|
tabBar?: MpPages[];
|
||||||
type?: number;
|
type?: number;
|
||||||
list?: any[] | null;
|
mpMenus?: any[] | null;
|
||||||
|
refresh?: boolean;
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
placeholder: undefined
|
placeholder: undefined
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
const param = ref<MpWeixinParam>({});
|
const param = ref<MpWeixinParam>({});
|
||||||
const showUserCardEdit = ref(false);
|
const showUserCardEdit = ref(false);
|
||||||
const showMpMenuEdit = ref(false);
|
const showMpMenuEdit = ref(false);
|
||||||
|
const showAdEdit = ref(false);
|
||||||
|
const ad = ref<Ad>();
|
||||||
// 当前编辑数据
|
// 当前编辑数据
|
||||||
const current = ref<WebsiteField | null>(null);
|
const current = ref<WebsiteField | null>(null);
|
||||||
|
|
||||||
// 订单图标
|
|
||||||
const order = ref<any[]>();
|
|
||||||
// 服务图标
|
|
||||||
const server = ref<any[]>();
|
|
||||||
|
|
||||||
const config = ref({
|
|
||||||
selector: '#content', //容器,可使用css选择器
|
|
||||||
branding: false,
|
|
||||||
language: 'zh_CN', //调用放在langs文件夹内的语言包
|
|
||||||
toolbar: false, //隐藏工具栏
|
|
||||||
menubar: false, //隐藏菜单栏
|
|
||||||
inline: true, //开启内联模式
|
|
||||||
plugins: [] //选择需加载的插件
|
|
||||||
//选中时出现的快捷工具,与插件有依赖关系
|
|
||||||
// quickbars_selection_toolbar: 'bold italic forecolor | link blockquote quickimage',
|
|
||||||
// init_instance_callback: function (editor) {
|
|
||||||
// editor.setContent('这里是你的内容字符串');
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
|
|
||||||
/* 打开编辑弹窗 */
|
/* 打开编辑弹窗 */
|
||||||
const openUserCard = (row?: WebsiteField) => {
|
const openUserCard = (row?: WebsiteField) => {
|
||||||
current.value = row ?? null;
|
current.value = row ?? null;
|
||||||
@@ -276,29 +210,41 @@
|
|||||||
showMpMenuEdit.value = true;
|
showMpMenuEdit.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onShare = () => {
|
const onShare = () => {};
|
||||||
|
|
||||||
}
|
const onCarousel = (row?: Ad) => {
|
||||||
|
showAdEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
const reload = () => {};
|
const reload = () => {
|
||||||
|
emit('done');
|
||||||
|
};
|
||||||
|
|
||||||
listWebsiteField({}).then((list) => {
|
reload();
|
||||||
list.map((d) => {
|
|
||||||
const key = String(d.name);
|
|
||||||
param.value[key] = d.value;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
listMpMenu({}).then((list) => {
|
watch(
|
||||||
server.value = list.filter((d) => d.type == 0);
|
() => prpos.refresh,
|
||||||
order.value = list.filter((d) => d.type == 1);
|
(refresh) => {
|
||||||
});
|
if (refresh) {
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
import * as MenuIcons from '@/layout/menu-icons';
|
||||||
|
export default {
|
||||||
|
name: 'Simulator',
|
||||||
|
components: MenuIcons
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.phone-layout {
|
.phone-layout {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 16px;
|
right: 26px;
|
||||||
width: 390px;
|
width: 390px;
|
||||||
height: 844px;
|
height: 844px;
|
||||||
background: url('@/assets/img/app-ui.png');
|
background: url('@/assets/img/app-ui.png');
|
||||||
@@ -318,6 +264,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: end;
|
align-items: end;
|
||||||
padding-bottom: 13px;
|
padding-bottom: 13px;
|
||||||
|
|
||||||
.title-bar {
|
.title-bar {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -325,7 +272,8 @@
|
|||||||
.back {
|
.back {
|
||||||
display: block;
|
display: block;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
cursor: pointer;
|
margin-left: 3px;
|
||||||
|
background-color: #ffffff;
|
||||||
}
|
}
|
||||||
.share {
|
.share {
|
||||||
display: block;
|
display: block;
|
||||||
@@ -335,6 +283,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.ad-bar {
|
||||||
|
background-color: var(--grey-10);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
.phone-body-bg {
|
.phone-body-bg {
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
height: 680px;
|
height: 680px;
|
||||||
@@ -389,9 +342,10 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
.home-btn,
|
||||||
.shop-btn,
|
.shop-btn,
|
||||||
.kefu-btn,
|
.order-btn,
|
||||||
.star-btn {
|
.user-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
@@ -474,20 +428,43 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.order-card {
|
.menu-card {
|
||||||
width: 340px;
|
width: 330px;
|
||||||
height: 80px;
|
margin: 6px auto;
|
||||||
margin: 0 1px;
|
|
||||||
background: #ffffff;
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
border-color: slategrey;
|
border-color: slategrey;
|
||||||
position: absolute;
|
|
||||||
top: 230px;
|
|
||||||
left: 24px;
|
|
||||||
.btn-center {
|
.btn-center {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.merchant-card-title {
|
||||||
|
width: 340px;
|
||||||
|
margin: 6px auto;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-top: 16px;
|
||||||
|
}
|
||||||
|
.merchant-card {
|
||||||
|
width: 340px;
|
||||||
|
max-height: 80px;
|
||||||
|
margin: 6px auto;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
padding: 8px;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 5px;
|
||||||
|
border-color: slategrey;
|
||||||
|
.merchant-name {
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
.merchant-desc {
|
||||||
|
width: 200px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -511,4 +488,23 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.order-card {
|
||||||
|
width: 330px;
|
||||||
|
height: 80px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 8px;
|
||||||
|
background: #ffffff;
|
||||||
|
border-radius: 5px;
|
||||||
|
border-color: slategrey;
|
||||||
|
//position: absolute;
|
||||||
|
//top: 230px;
|
||||||
|
//left: 24px;
|
||||||
|
.btn-center {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export const copyText = (text) => {
|
|||||||
// 执行浏览器复制命令
|
// 执行浏览器复制命令
|
||||||
// 复制命令会将当前选中的内容复制到剪切板中(这里就是创建的input标签)
|
// 复制命令会将当前选中的内容复制到剪切板中(这里就是创建的input标签)
|
||||||
// Input要在正常的编辑状态下原生复制方法才会生效
|
// Input要在正常的编辑状态下原生复制方法才会生效
|
||||||
message.success('复制成功');
|
message.success(`复制成功 ${text}`);
|
||||||
document.execCommand('copy');
|
document.execCommand('copy');
|
||||||
|
|
||||||
// 复制成功后再将构造的标签 移除
|
// 复制成功后再将构造的标签 移除
|
||||||
|
|||||||
@@ -44,6 +44,20 @@
|
|||||||
v-model:value="form.mpName"
|
v-model:value="form.mpName"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item label="小程序ID" name="appId">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入小程序ID"
|
||||||
|
v-model:value="form.appId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="小程序密钥" name="appSecret">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入小程序密钥"
|
||||||
|
v-model:value="form.appSecret"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item label="主体信息" name="companyName">
|
<a-form-item label="主体信息" name="companyName">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
@@ -65,20 +79,6 @@
|
|||||||
v-model:value="form.email"
|
v-model:value="form.email"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="小程序ID" name="appId">
|
|
||||||
<a-input
|
|
||||||
allow-clear
|
|
||||||
placeholder="请输入小程序ID"
|
|
||||||
v-model:value="form.appId"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="小程序密钥" name="appSecret">
|
|
||||||
<a-input
|
|
||||||
allow-clear
|
|
||||||
placeholder="请输入小程序密钥"
|
|
||||||
v-model:value="form.appSecret"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="原始ID" name="ghId">
|
<a-form-item label="原始ID" name="ghId">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
@@ -109,12 +109,6 @@
|
|||||||
<a-radio :value="1">未认证</a-radio>
|
<a-radio :value="1">未认证</a-radio>
|
||||||
</a-radio-group>
|
</a-radio-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="状态" name="status">
|
|
||||||
<a-radio-group v-model:value="form.status">
|
|
||||||
<a-radio :value="0">正常</a-radio>
|
|
||||||
<a-radio :value="1">已过期</a-radio>
|
|
||||||
</a-radio-group>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
</a-form>
|
||||||
</ele-modal>
|
</ele-modal>
|
||||||
</template>
|
</template>
|
||||||
@@ -164,11 +158,12 @@
|
|||||||
mpId: undefined,
|
mpId: undefined,
|
||||||
appId: undefined,
|
appId: undefined,
|
||||||
appSecret: undefined,
|
appSecret: undefined,
|
||||||
|
type: undefined,
|
||||||
mpName: undefined,
|
mpName: undefined,
|
||||||
shortName: undefined,
|
shortName: undefined,
|
||||||
avatar: undefined,
|
avatar: undefined,
|
||||||
mpQrcode: undefined,
|
mpQrcode: undefined,
|
||||||
authentication: undefined,
|
authentication: 1,
|
||||||
companyName: undefined,
|
companyName: undefined,
|
||||||
icpNo: undefined,
|
icpNo: undefined,
|
||||||
email: undefined,
|
email: undefined,
|
||||||
@@ -189,6 +184,22 @@
|
|||||||
|
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
|
appId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写小程序ID',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
appSecret: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写小程序秘钥',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
mpName: [
|
mpName: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
|
|||||||
@@ -1,19 +1,34 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap" v-if="count === 0">
|
<a-space style="flex-wrap: wrap">
|
||||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
|
||||||
<template #icon>
|
<!-- <template #icon>-->
|
||||||
<PlusOutlined />
|
<!-- <PlusOutlined />-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<span>创建</span>
|
<!-- <span>添加</span>-->
|
||||||
</a-button>
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-pages`)">-->
|
||||||
|
<!-- <span>页面管理</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-field/0`)">-->
|
||||||
|
<!-- <span>参数配置</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-ad`)">-->
|
||||||
|
<!-- <span>广告管理</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-group`)">-->
|
||||||
|
<!-- <span>卡片管理</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-package`)">-->
|
||||||
|
<!-- <span>分包管理</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
import type { GradeParam } from '@/api/user/grade/model';
|
|
||||||
import { watch } from 'vue';
|
import { watch } from 'vue';
|
||||||
|
import { openUrl } from '@/utils/common';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -25,13 +40,9 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'search', where?: GradeParam): void;
|
|
||||||
(e: 'add'): void;
|
(e: 'add'): void;
|
||||||
(e: 'remove'): void;
|
|
||||||
(e: 'batchMove'): void;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// 新增
|
|
||||||
const add = () => {
|
const add = () => {
|
||||||
emit('add');
|
emit('add');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
|
:need-page="false"
|
||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
>
|
>
|
||||||
@@ -15,7 +16,6 @@
|
|||||||
<search
|
<search
|
||||||
@search="reload"
|
@search="reload"
|
||||||
:selection="selection"
|
:selection="selection"
|
||||||
:count="count"
|
|
||||||
@add="openEdit"
|
@add="openEdit"
|
||||||
@remove="removeBatch"
|
@remove="removeBatch"
|
||||||
@batchMove="openMove"
|
@batchMove="openMove"
|
||||||
@@ -28,13 +28,22 @@
|
|||||||
<template v-if="column.key === 'mpQrcode'">
|
<template v-if="column.key === 'mpQrcode'">
|
||||||
<a-image :src="record.mpQrcode" :width="50" />
|
<a-image :src="record.mpQrcode" :width="50" />
|
||||||
</template>
|
</template>
|
||||||
|
<template v-if="column.key === 'type'">
|
||||||
|
<a-tag v-if="record.type === 1" color="green">是</a-tag>
|
||||||
|
<a-tag
|
||||||
|
v-if="record.type === 0"
|
||||||
|
@click="updateType(record)"
|
||||||
|
class="cursor-pointer"
|
||||||
|
>否</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>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openEdit(record)">修改</a>
|
<a @click="openEdit(record)">编辑</a>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -59,7 +68,7 @@
|
|||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import MpEdit from './components/mpEdit.vue';
|
import MpEdit from './components/mpEdit.vue';
|
||||||
import { pageMp, removeMp, removeBatchMp } from '@/api/cms/mp';
|
import { pageMp, removeMp, removeBatchMp, updateMp } from '@/api/cms/mp';
|
||||||
import type { Mp, MpParam } from '@/api/cms/mp/model';
|
import type { Mp, MpParam } from '@/api/cms/mp/model';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
@@ -67,7 +76,6 @@
|
|||||||
|
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const selection = ref<Mp[]>([]);
|
const selection = ref<Mp[]>([]);
|
||||||
const count = ref<number>(0);
|
|
||||||
// 当前编辑数据
|
// 当前编辑数据
|
||||||
const current = ref<Mp | null>(null);
|
const current = ref<Mp | null>(null);
|
||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
@@ -128,11 +136,18 @@
|
|||||||
key: 'comments',
|
key: 'comments',
|
||||||
align: 'center'
|
align: 'center'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '主账号',
|
||||||
|
dataIndex: 'type',
|
||||||
|
key: 'type',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
align: 'center'
|
align: 'center',
|
||||||
|
hideInTable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
@@ -146,7 +161,7 @@
|
|||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
width: 180,
|
width: 120,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSetting: true
|
hideInSetting: true
|
||||||
@@ -170,6 +185,14 @@
|
|||||||
showMove.value = true;
|
showMove.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const updateType = (row: Mp) => {
|
||||||
|
row.type = 1;
|
||||||
|
updateMp(row).then((msg) => {
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: Mp) => {
|
const remove = (row: Mp) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
@@ -215,10 +238,6 @@
|
|||||||
/* 查询 */
|
/* 查询 */
|
||||||
const query = () => {
|
const query = () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
pageMp({}).then((res) => {
|
|
||||||
console.log(res?.count);
|
|
||||||
count.value = res?.count;
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 自定义行属性 */
|
/* 自定义行属性 */
|
||||||
|
|||||||
@@ -132,12 +132,12 @@
|
|||||||
width: 280,
|
width: 280,
|
||||||
ellipsis: true
|
ellipsis: true
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '位置',
|
// title: '位置',
|
||||||
dataIndex: 'pageName',
|
// dataIndex: 'pageName',
|
||||||
key: 'pageName',
|
// key: 'pageName',
|
||||||
width: 120
|
// width: 120
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '描述',
|
title: '描述',
|
||||||
dataIndex: 'comments',
|
dataIndex: 'comments',
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
|
:need-page="false"
|
||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -27,16 +27,10 @@
|
|||||||
<a-form-item label="值" name="value">
|
<a-form-item label="值" name="value">
|
||||||
<a-input allow-clear placeholder="淘宝网" v-model:value="form.value" />
|
<a-input allow-clear placeholder="淘宝网" v-model:value="form.value" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="描述" name="comments">
|
|
||||||
<a-input
|
|
||||||
allow-clear
|
|
||||||
placeholder="网站名称"
|
|
||||||
v-model:value="form.comments"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="位置"
|
label="位置"
|
||||||
name="pageId"
|
name="pageId"
|
||||||
|
v-if="!pageId"
|
||||||
extra="页面参数,留空视为全局参数"
|
extra="页面参数,留空视为全局参数"
|
||||||
>
|
>
|
||||||
<SelectMpAd
|
<SelectMpAd
|
||||||
@@ -62,6 +56,13 @@
|
|||||||
v-model:value="form.sortNumber"
|
v-model:value="form.sortNumber"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item label="描述" name="comments">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="网站名称"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</ele-modal>
|
</ele-modal>
|
||||||
</template>
|
</template>
|
||||||
@@ -87,6 +88,7 @@
|
|||||||
// 弹窗是否打开
|
// 弹窗是否打开
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
mpFieldId: number | null | undefined;
|
mpFieldId: number | null | undefined;
|
||||||
|
pageId: number | null | undefined;
|
||||||
// 修改回显的数据
|
// 修改回显的数据
|
||||||
data?: MpField | null;
|
data?: MpField | null;
|
||||||
}>();
|
}>();
|
||||||
|
|||||||
256
src/views/cms/mpField/index.bak.vue
Normal file
256
src/views/cms/mpField/index.bak.vue
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
<template>
|
||||||
|
<a-page-header :title="getPageTitle()" @back="() => $router.go(-1)">
|
||||||
|
<a-card :bordered="false">
|
||||||
|
<div class="mp-field">
|
||||||
|
<!-- 表格 -->
|
||||||
|
<ele-pro-table
|
||||||
|
ref="tableRef"
|
||||||
|
row-key="mpId"
|
||||||
|
:columns="columns"
|
||||||
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
tool-class="ele-toolbar-form"
|
||||||
|
class="sys-org-table"
|
||||||
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<MpFieldSearch @add="openEdit" />
|
||||||
|
</template>
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'name'">
|
||||||
|
<div class="ele-text-heading">{{ record.name }}</div>
|
||||||
|
<span class="ele-text-placeholder">{{ record.comments }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'pageId'">
|
||||||
|
<span v-if="record.pageId === 0" class="ele-text-placeholder"
|
||||||
|
>全局</span
|
||||||
|
>
|
||||||
|
<span v-else class="ele-text-placeholder">{{
|
||||||
|
record.pageName
|
||||||
|
}}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'value'">
|
||||||
|
<a-image
|
||||||
|
v-if="record.type === 1"
|
||||||
|
:src="record.value"
|
||||||
|
:width="120"
|
||||||
|
/>
|
||||||
|
<span v-else>{{ record.value }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'action'">
|
||||||
|
<a @click="copyText('{{ config.' + record.name + ' }}')">调用</a>
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a @click="openEdit(record)">编辑</a>
|
||||||
|
<template v-if="record.deleted == 0">
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要删除此记录吗?"
|
||||||
|
@confirm="remove(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">删除</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</template>
|
||||||
|
<template v-if="record.deleted == 1">
|
||||||
|
<a-divider type="vertical" />
|
||||||
|
<a-popconfirm
|
||||||
|
title="确定要放回原处吗?"
|
||||||
|
@confirm="recovery(record)"
|
||||||
|
>
|
||||||
|
<a class="ele-text-danger">恢复</a>
|
||||||
|
</a-popconfirm>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
<template #footer>
|
||||||
|
<div class="ele-text-secondary"
|
||||||
|
>温馨提示:跟随程序自动加载,通过<span v-pre
|
||||||
|
>{{ config.mpLogo }}可以方便调用,文本内容不加密。</span
|
||||||
|
><a
|
||||||
|
href="https://websoft.top"
|
||||||
|
class="ele-text-secondary"
|
||||||
|
target="_blank"
|
||||||
|
>查看帮助文档</a
|
||||||
|
></div
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</ele-pro-table>
|
||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<MpFieldEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
:pageId="pageId"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
</a-page-header>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, watch } from 'vue';
|
||||||
|
import { message } from 'ant-design-vue';
|
||||||
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import type { DatasourceFunction } from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
|
import MpFieldSearch from './components/mp-field-search.vue';
|
||||||
|
import { Mp } from '@/api/cms/mp/model';
|
||||||
|
import MpFieldEdit from './components/mp-field-edit.vue';
|
||||||
|
import { MpField, MpFieldParam } from '@/api/cms/mpField/model';
|
||||||
|
import {
|
||||||
|
pageMpField,
|
||||||
|
removeMpField,
|
||||||
|
undeleteMpField,
|
||||||
|
updateMpField
|
||||||
|
} from '@/api/cms/mpField';
|
||||||
|
import { copyText, getPageTitle } from '@/utils/common';
|
||||||
|
import router from '@/router';
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
mpId: any;
|
||||||
|
data: Mp;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 表格实例
|
||||||
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
|
const selection = ref<any[]>();
|
||||||
|
// 当前编辑数据
|
||||||
|
const current = ref<MpField | null>(null);
|
||||||
|
// 是否显示编辑弹窗
|
||||||
|
const showEdit = ref(false);
|
||||||
|
const pageId = ref(0);
|
||||||
|
|
||||||
|
// 表格数据源
|
||||||
|
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
||||||
|
// 搜索条件
|
||||||
|
if (pageId.value > 0) {
|
||||||
|
where.pageId = pageId.value;
|
||||||
|
}
|
||||||
|
// where.pageId = router.currentRoute.value.params.id;
|
||||||
|
return pageMpField({
|
||||||
|
...where,
|
||||||
|
...orders,
|
||||||
|
page,
|
||||||
|
limit
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
|
const columns = ref<any[]>([
|
||||||
|
{
|
||||||
|
title: '键',
|
||||||
|
dataIndex: 'name',
|
||||||
|
key: 'name'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '值',
|
||||||
|
dataIndex: 'value',
|
||||||
|
key: 'value'
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '位置',
|
||||||
|
// dataIndex: 'pageId',
|
||||||
|
// key: 'pageId',
|
||||||
|
// width: 180,
|
||||||
|
// align: 'center'
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '排序',
|
||||||
|
dataIndex: 'sortNumber',
|
||||||
|
width: 120,
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
key: 'action',
|
||||||
|
width: 180,
|
||||||
|
align: 'center',
|
||||||
|
hideInSetting: true
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
const moveUp = (row?: MpField) => {
|
||||||
|
updateMpField({
|
||||||
|
id: row?.id,
|
||||||
|
sortNumber: Number(row?.sortNumber) + 1
|
||||||
|
}).then((msg) => {
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 打开编辑弹窗 */
|
||||||
|
const openEdit = (row?: MpField) => {
|
||||||
|
current.value = row ?? null;
|
||||||
|
showEdit.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const reload = (where?: MpFieldParam) => {
|
||||||
|
selection.value = [];
|
||||||
|
tableRef?.value?.reload({ where: where });
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 删除单个 */
|
||||||
|
const remove = (row: MpField) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
removeMpField(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 从回收站放回原处
|
||||||
|
const recovery = (row: MpField) => {
|
||||||
|
const hide = message.loading('请求中..', 0);
|
||||||
|
undeleteMpField(row.id)
|
||||||
|
.then((msg) => {
|
||||||
|
hide();
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
hide();
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: MpField) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => router.currentRoute.value.params.id,
|
||||||
|
(id) => {
|
||||||
|
if (id) {
|
||||||
|
console.log(router.currentRoute);
|
||||||
|
if (id == ':id') {
|
||||||
|
pageId.value = 0;
|
||||||
|
} else {
|
||||||
|
pageId.value = Number(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reload();
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default {
|
||||||
|
name: 'MpFieldIndex'
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -77,6 +77,7 @@
|
|||||||
<MpFieldEdit
|
<MpFieldEdit
|
||||||
v-model:visible="showEdit"
|
v-model:visible="showEdit"
|
||||||
:data="current"
|
:data="current"
|
||||||
|
:pageId="pageId"
|
||||||
@done="reload"
|
@done="reload"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -100,6 +101,7 @@
|
|||||||
updateMpField
|
updateMpField
|
||||||
} from '@/api/cms/mpField';
|
} from '@/api/cms/mpField';
|
||||||
import { copyText, getPageTitle } from '@/utils/common';
|
import { copyText, getPageTitle } from '@/utils/common';
|
||||||
|
import router from '@/router';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
mpId: any;
|
mpId: any;
|
||||||
@@ -113,10 +115,15 @@
|
|||||||
const current = ref<MpField | null>(null);
|
const current = ref<MpField | null>(null);
|
||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
|
const pageId = ref(0);
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
||||||
// 搜索条件
|
// 搜索条件
|
||||||
|
if (pageId.value > 0) {
|
||||||
|
where.pageId = pageId.value;
|
||||||
|
}
|
||||||
|
// where.pageId = router.currentRoute.value.params.id;
|
||||||
return pageMpField({
|
return pageMpField({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -137,13 +144,13 @@
|
|||||||
dataIndex: 'value',
|
dataIndex: 'value',
|
||||||
key: 'value'
|
key: 'value'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '位置',
|
// title: '位置',
|
||||||
dataIndex: 'pageId',
|
// dataIndex: 'pageId',
|
||||||
key: 'pageId',
|
// key: 'pageId',
|
||||||
width: 180,
|
// width: 180,
|
||||||
align: 'center'
|
// align: 'center'
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '排序',
|
title: '排序',
|
||||||
dataIndex: 'sortNumber',
|
dataIndex: 'sortNumber',
|
||||||
@@ -226,11 +233,17 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.mpId,
|
() => router.currentRoute.value.params.id,
|
||||||
(mpId) => {
|
(id) => {
|
||||||
if (mpId) {
|
if (id) {
|
||||||
reload();
|
console.log(router.currentRoute);
|
||||||
|
if (id == ':id') {
|
||||||
|
pageId.value = 0;
|
||||||
|
} else {
|
||||||
|
pageId.value = Number(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
reload();
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,18 +17,7 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined />
|
<plus-outlined />
|
||||||
</template>
|
</template>
|
||||||
<span>新建</span>
|
<span>添加</span>
|
||||||
</a-button>
|
|
||||||
<a-button
|
|
||||||
danger
|
|
||||||
type="primary"
|
|
||||||
class="ele-btn-icon"
|
|
||||||
@click="removeBatch"
|
|
||||||
>
|
|
||||||
<template #icon>
|
|
||||||
<delete-outlined />
|
|
||||||
</template>
|
|
||||||
<span>删除</span>
|
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -60,7 +49,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { createVNode, ref } from 'vue';
|
import { createVNode, ref, watch } from 'vue';
|
||||||
import { message, Modal } from 'ant-design-vue/es';
|
import { message, Modal } from 'ant-design-vue/es';
|
||||||
import {
|
import {
|
||||||
PlusOutlined,
|
PlusOutlined,
|
||||||
@@ -83,10 +72,12 @@
|
|||||||
import { DictData } from '@/api/system/dict-data/model';
|
import { DictData } from '@/api/system/dict-data/model';
|
||||||
import { addDict, listDictionaries } from '@/api/system/dict';
|
import { addDict, listDictionaries } from '@/api/system/dict';
|
||||||
import { Dictionary } from '@/api/system/dictionary/model';
|
import { Dictionary } from '@/api/system/dictionary/model';
|
||||||
|
import router from '@/router';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
const dictId = ref(0);
|
const dictId = ref(0);
|
||||||
|
const pageId = ref(0);
|
||||||
|
|
||||||
// 表格列配置
|
// 表格列配置
|
||||||
const columns = ref<ColumnItem[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
@@ -214,6 +205,21 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => router.currentRoute.value.params.id,
|
||||||
|
(id) => {
|
||||||
|
if (id) {
|
||||||
|
if (id == ':id') {
|
||||||
|
pageId.value = 0;
|
||||||
|
} else {
|
||||||
|
pageId.value = Number(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
reload();
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -17,24 +17,13 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined />
|
<plus-outlined />
|
||||||
</template>
|
</template>
|
||||||
<span>新建</span>
|
<span>添加</span>
|
||||||
</a-button>
|
|
||||||
<a-button
|
|
||||||
danger
|
|
||||||
type="primary"
|
|
||||||
class="ele-btn-icon"
|
|
||||||
@click="removeBatch"
|
|
||||||
>
|
|
||||||
<template #icon>
|
|
||||||
<delete-outlined />
|
|
||||||
</template>
|
|
||||||
<span>删除</span>
|
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space v-if="record.dictDataName === 'package'">
|
||||||
<a @click="openEdit(record)">修改</a>
|
<a @click="openEdit(record)">修改</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
@@ -109,7 +98,6 @@
|
|||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
dataIndex: 'comments',
|
dataIndex: 'comments',
|
||||||
sorter: true,
|
|
||||||
showSorterTooltip: false
|
showSorterTooltip: false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -215,7 +203,9 @@
|
|||||||
const customRow = (record: DictData) => {
|
const customRow = (record: DictData) => {
|
||||||
return {
|
return {
|
||||||
onDblclick: () => {
|
onDblclick: () => {
|
||||||
openEdit(record);
|
if (record.dictDataName === 'package') {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
:customRow="customRow"
|
:customRow="customRow"
|
||||||
|
:need-page="false"
|
||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
>
|
>
|
||||||
@@ -44,6 +45,10 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
|
<!-- <a @click="openUrl(`/mp-field/${record.id}`)">配置</a>-->
|
||||||
|
<!-- <a-divider type="vertical" />-->
|
||||||
|
<!-- <a @click="openUrl(`/mp-group/${record.id}`)">组件</a>-->
|
||||||
|
<!-- <a-divider type="vertical" />-->
|
||||||
<a @click="openUrl(`/mp-design/${record.id}`)">设计</a>
|
<a @click="openUrl(`/mp-design/${record.id}`)">设计</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a @click="openEdit(record)">修改</a>
|
<a @click="openEdit(record)">修改</a>
|
||||||
@@ -91,7 +96,8 @@
|
|||||||
import {
|
import {
|
||||||
pageMpPages,
|
pageMpPages,
|
||||||
removeMpPages,
|
removeMpPages,
|
||||||
removeBatchMpPages
|
removeBatchMpPages,
|
||||||
|
listMpPages
|
||||||
} from '@/api/cms/mpPages';
|
} from '@/api/cms/mpPages';
|
||||||
import type { MpPages, MpPagesParam } from '@/api/cms/mpPages/model';
|
import type { MpPages, MpPagesParam } from '@/api/cms/mpPages/model';
|
||||||
import { copyText, openUrl } from '@/utils/common';
|
import { copyText, openUrl } from '@/utils/common';
|
||||||
@@ -113,21 +119,9 @@
|
|||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({
|
const datasource: DatasourceFunction = ({ where }) => {
|
||||||
page,
|
return listMpPages({
|
||||||
limit,
|
...where
|
||||||
where,
|
|
||||||
orders,
|
|
||||||
filters
|
|
||||||
}) => {
|
|
||||||
if (filters) {
|
|
||||||
where.status = filters.status;
|
|
||||||
}
|
|
||||||
return pageMpPages({
|
|
||||||
...where,
|
|
||||||
...orders,
|
|
||||||
page,
|
|
||||||
limit
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -158,6 +152,7 @@
|
|||||||
dataIndex: 'createTime',
|
dataIndex: 'createTime',
|
||||||
key: 'createTime',
|
key: 'createTime',
|
||||||
sorter: true,
|
sorter: true,
|
||||||
|
hideInTable: true,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||||
},
|
},
|
||||||
@@ -243,7 +238,7 @@
|
|||||||
onClick: () => {},
|
onClick: () => {},
|
||||||
// 行双击事件
|
// 行双击事件
|
||||||
onDblclick: () => {
|
onDblclick: () => {
|
||||||
openUrl(`/mp-design/${record.id}`);
|
openEdit(record);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,227 +0,0 @@
|
|||||||
<!-- 编辑弹窗 -->
|
|
||||||
<template>
|
|
||||||
<ele-modal
|
|
||||||
:width="isUpdate ? 880 : 500"
|
|
||||||
:visible="visible"
|
|
||||||
:maskClosable="false"
|
|
||||||
:title="isUpdate ? '域名DNS解析验证' : '添加域名'"
|
|
||||||
:body-style="{ paddingBottom: '28px' }"
|
|
||||||
@update:visible="updateVisible"
|
|
||||||
:confirmLoading="loading"
|
|
||||||
@ok="save"
|
|
||||||
>
|
|
||||||
<a-form
|
|
||||||
ref="formRef"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
:label-col="styleResponsive ? { md: 5, sm: 7, xs: 24 } : { flex: '90px' }"
|
|
||||||
:wrapper-col="
|
|
||||||
styleResponsive ? { md: 18, sm: 19, xs: 24 } : { flex: '1' }
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<a-form-item label="https://" name="domain">
|
|
||||||
<a-input
|
|
||||||
allow-clear
|
|
||||||
:maxlength="100"
|
|
||||||
placeholder="example.com"
|
|
||||||
:disabled="isUpdate"
|
|
||||||
v-model:value="form.domain"
|
|
||||||
@pressEnter="save"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="添加DNS解析" name="check" v-if="isUpdate">
|
|
||||||
<a-space direction="vertical">
|
|
||||||
<div class="ele-text-placeholder" style="line-height: 2.2em"
|
|
||||||
>请按以下提示,在您的域名控制台添加DNS解析配置</div
|
|
||||||
>
|
|
||||||
<table
|
|
||||||
class="ele-table ele-table-border ele-table-stripe ele-table-medium"
|
|
||||||
>
|
|
||||||
<colgroup>
|
|
||||||
<col width="180" />
|
|
||||||
<col width="120" />
|
|
||||||
<col />
|
|
||||||
</colgroup>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>主机记录</th>
|
|
||||||
<th>记录类型</th>
|
|
||||||
<th>记录值</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
|
||||||
<td>{{ form.hostName }}</td>
|
|
||||||
<td>CNAME</td>
|
|
||||||
<td>{{ form.hostValue }}</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</a-space>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="排序" name="sortNumber">
|
|
||||||
<a-input-number
|
|
||||||
:min="0"
|
|
||||||
:max="99999"
|
|
||||||
placeholder="请输入排序号"
|
|
||||||
v-model:value="form.sortNumber"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item label="操作" v-if="isUpdate && form.status == 0">
|
|
||||||
<a-button type="primary" @click="save">验证域名</a-button>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</ele-modal>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ref, reactive, watch } from 'vue';
|
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
import { addDomain, resolvable } from '@/api/cms/domain';
|
|
||||||
import { Domain } from '@/api/cms/domain/model';
|
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
|
||||||
import { storeToRefs } from 'pinia';
|
|
||||||
import { FormInstance, type Rule } from 'ant-design-vue/es/form';
|
|
||||||
import useFormData from '@/utils/use-form-data';
|
|
||||||
import { isUrl } from 'ele-admin-pro';
|
|
||||||
|
|
||||||
// 是否是修改
|
|
||||||
const isUpdate = ref(false);
|
|
||||||
// 是否开启响应式布局
|
|
||||||
const themeStore = useThemeStore();
|
|
||||||
const { styleResponsive } = storeToRefs(themeStore);
|
|
||||||
|
|
||||||
const props = defineProps<{
|
|
||||||
// 弹窗是否打开
|
|
||||||
visible: boolean;
|
|
||||||
// 修改回显的数据
|
|
||||||
data?: Domain | null;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
(e: 'done'): void;
|
|
||||||
(e: 'update:visible', visible: boolean): void;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
// 提交状态
|
|
||||||
const loading = ref(false);
|
|
||||||
const disabled = ref(false);
|
|
||||||
// 表格选中数据
|
|
||||||
const formRef = ref<FormInstance | null>(null);
|
|
||||||
|
|
||||||
// 表单数据
|
|
||||||
const { form, resetFields, assignFields } = useFormData<Domain>({
|
|
||||||
id: undefined,
|
|
||||||
domain: '',
|
|
||||||
hostName: '',
|
|
||||||
hostValue: '',
|
|
||||||
status: 0,
|
|
||||||
comments: '',
|
|
||||||
sortNumber: 100
|
|
||||||
});
|
|
||||||
|
|
||||||
/* 更新visible */
|
|
||||||
const updateVisible = (value: boolean) => {
|
|
||||||
emit('update:visible', value);
|
|
||||||
};
|
|
||||||
|
|
||||||
// 表单验证规则
|
|
||||||
const rules = reactive({
|
|
||||||
domain: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
type: 'string',
|
|
||||||
message: '请输入合法域名',
|
|
||||||
trigger: 'blur',
|
|
||||||
validator: (_rule: Rule, value: string) => {
|
|
||||||
return new Promise<void>((resolve, reject) => {
|
|
||||||
if (!isUrl(`https://${value}`)) {
|
|
||||||
if (value.includes('http')) {
|
|
||||||
return reject('不含http开头');
|
|
||||||
}
|
|
||||||
return reject('请输入合法域名');
|
|
||||||
}
|
|
||||||
disabled.value = true;
|
|
||||||
return resolve();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
|
|
||||||
/* 保存编辑 */
|
|
||||||
const save = () => {
|
|
||||||
if (!formRef.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
formRef.value
|
|
||||||
.validate()
|
|
||||||
.then(() => {
|
|
||||||
loading.value = true;
|
|
||||||
if (form.domain) {
|
|
||||||
form.domain = form.domain.trim();
|
|
||||||
form.domain = form.domain.replace('https://', '');
|
|
||||||
form.domain = form.domain.replace('http://', '');
|
|
||||||
const split = form.domain.split('.');
|
|
||||||
if (split.length == 2) {
|
|
||||||
form.hostName = '@';
|
|
||||||
}
|
|
||||||
if (split.length > 2) {
|
|
||||||
const suffix = split[split.length - 1];
|
|
||||||
const name = split[split.length - 2];
|
|
||||||
form.hostName = form.domain.replace(`.${name}.${suffix}`, '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const formData = {
|
|
||||||
...form
|
|
||||||
};
|
|
||||||
if (isUpdate.value) {
|
|
||||||
setTimeout(() => {
|
|
||||||
resolvable(Number(form.id))
|
|
||||||
.then((data) => {
|
|
||||||
loading.value = false;
|
|
||||||
message.success(data.message);
|
|
||||||
updateVisible(false);
|
|
||||||
emit('done');
|
|
||||||
})
|
|
||||||
.catch((res) => {
|
|
||||||
loading.value = false;
|
|
||||||
message.error(res.message);
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
if (!isUpdate.value) {
|
|
||||||
addDomain(formData)
|
|
||||||
.then((msg) => {
|
|
||||||
loading.value = false;
|
|
||||||
message.success(msg);
|
|
||||||
updateVisible(false);
|
|
||||||
emit('done');
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
loading.value = false;
|
|
||||||
message.error(e.message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.visible,
|
|
||||||
(visible) => {
|
|
||||||
if (visible) {
|
|
||||||
if (props.data) {
|
|
||||||
assignFields(props.data);
|
|
||||||
isUpdate.value = true;
|
|
||||||
} else {
|
|
||||||
isUpdate.value = false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
resetFields();
|
|
||||||
formRef.value?.clearValidate();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
@@ -1,36 +1,48 @@
|
|||||||
<!-- 搜索表单 -->
|
<!-- 搜索表单 -->
|
||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
<a-space style="flex-wrap: wrap">
|
||||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
<!-- <a-button type="primary" class="ele-btn-icon" @click="add">-->
|
||||||
<template #icon>
|
<!-- <template #icon>-->
|
||||||
<PlusOutlined />
|
<!-- <PlusOutlined />-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
<span>添加</span>
|
<!-- <span>添加</span>-->
|
||||||
</a-button>
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-pages`)">-->
|
||||||
|
<!-- <span>页面管理</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-field/0`)">-->
|
||||||
|
<!-- <span>参数配置</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-ad`)">-->
|
||||||
|
<!-- <span>广告管理</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-group`)">-->
|
||||||
|
<!-- <span>卡片管理</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
|
<!-- <a-button class="ele-btn-icon" @click="openUrl(`/mp-package`)">-->
|
||||||
|
<!-- <span>分包管理</span>-->
|
||||||
|
<!-- </a-button>-->
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
import type { GradeParam } from '@/api/user/grade/model';
|
|
||||||
import { watch } from 'vue';
|
import { watch } from 'vue';
|
||||||
|
import { openUrl } from '@/utils/common';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
// 选中的角色
|
// 选中的角色
|
||||||
selection?: [];
|
selection?: [];
|
||||||
|
count?: 0;
|
||||||
}>(),
|
}>(),
|
||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'search', where?: GradeParam): void;
|
|
||||||
(e: 'add'): void;
|
(e: 'add'): void;
|
||||||
(e: 'remove'): void;
|
|
||||||
(e: 'batchMove'): void;
|
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// 新增
|
|
||||||
const add = () => {
|
const add = () => {
|
||||||
emit('add');
|
emit('add');
|
||||||
};
|
};
|
||||||
|
|||||||
325
src/views/cms/website/components/websiteEdit.vue
Normal file
325
src/views/cms/website/components/websiteEdit.vue
Normal file
@@ -0,0 +1,325 @@
|
|||||||
|
<!-- 编辑弹窗 -->
|
||||||
|
<template>
|
||||||
|
<ele-modal
|
||||||
|
:width="800"
|
||||||
|
:visible="visible"
|
||||||
|
:maskClosable="false"
|
||||||
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑网站信息' : '添加网站信息'"
|
||||||
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
|
@update:visible="updateVisible"
|
||||||
|
@ok="save"
|
||||||
|
>
|
||||||
|
<a-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
|
:wrapper-col="
|
||||||
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<a-form-item label="Logo" name="avatar">
|
||||||
|
<SelectFile
|
||||||
|
:placeholder="`请选择图片`"
|
||||||
|
:limit="1"
|
||||||
|
:data="images"
|
||||||
|
@done="chooseImage"
|
||||||
|
@del="onDeleteItem"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="网站名称" name="websiteName">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入网站名称"
|
||||||
|
v-model:value="form.websiteName"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="网站描述" name="comments">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入网站描述"
|
||||||
|
v-model:value="form.comments"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="SEO关键词" name="keywords">
|
||||||
|
<a-textarea
|
||||||
|
:rows="4"
|
||||||
|
:maxlength="200"
|
||||||
|
placeholder="请输入SEO关键词"
|
||||||
|
v-model:value="form.keywords"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="网站域名" name="domain">
|
||||||
|
<a-input v-model:value="form.domain" placeholder="domain.com">
|
||||||
|
<template #addonBefore>
|
||||||
|
<a-select v-model:value="form.prefix" style="width: 90px">
|
||||||
|
<a-select-option value="http://">http://</a-select-option>
|
||||||
|
<a-select-option value="https://">https://</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
</a-input>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="后台管理" name="adminUrl">
|
||||||
|
<a-input v-model:value="form.adminUrl" placeholder="admin.domain.com">
|
||||||
|
<template #addonBefore>
|
||||||
|
<a-select v-model:value="form.prefix" style="width: 90px">
|
||||||
|
<a-select-option value="http://">http://</a-select-option>
|
||||||
|
<a-select-option value="https://">https://</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</template>
|
||||||
|
</a-input>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="ICP备案号" name="icpNo">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入网站备案"
|
||||||
|
v-model:value="form.icpNo"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="网站类型" name="websiteType">
|
||||||
|
<a-select
|
||||||
|
:options="websiteType"
|
||||||
|
:value="form.websiteType"
|
||||||
|
placeholder="请选择主体类型"
|
||||||
|
@change="onWebsiteType"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="当前版本" name="version">
|
||||||
|
<span v-if="form.version === 10">免费版</span>
|
||||||
|
<span v-if="form.version === 20">授权版</span>
|
||||||
|
<span v-if="form.version === 30">永久授权</span>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item label="排序" name="sortNumber">
|
||||||
|
<a-input-number
|
||||||
|
:min="0"
|
||||||
|
:max="9999"
|
||||||
|
class="ele-fluid"
|
||||||
|
placeholder="请输入排序号"
|
||||||
|
v-model:value="form.sortNumber"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<!-- <a-form-item label="状态" name="status">-->
|
||||||
|
<!-- <a-radio-group v-model:value="form.status">-->
|
||||||
|
<!-- <a-radio :value="0">正常</a-radio>-->
|
||||||
|
<!-- <a-radio :value="1">已过期</a-radio>-->
|
||||||
|
<!-- </a-radio-group>-->
|
||||||
|
<!-- </a-form-item>-->
|
||||||
|
</a-form>
|
||||||
|
</ele-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, watch } from 'vue';
|
||||||
|
import { Form, message } from 'ant-design-vue';
|
||||||
|
import { assignObject, uuid, SelectProps } from 'ele-admin-pro';
|
||||||
|
import { addWebsite, updateWebsite } from '@/api/cms/website';
|
||||||
|
import { Website } from '@/api/cms/website/model';
|
||||||
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
|
|
||||||
|
// 是否是修改
|
||||||
|
const isUpdate = ref(false);
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
// 是否开启响应式布局
|
||||||
|
const themeStore = useThemeStore();
|
||||||
|
const { styleResponsive } = storeToRefs(themeStore);
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
// 弹窗是否打开
|
||||||
|
visible: boolean;
|
||||||
|
// 修改回显的数据
|
||||||
|
data?: Website | null;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'done'): void;
|
||||||
|
(e: 'update:visible', visible: boolean): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 提交状态
|
||||||
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
// 表格选中数据
|
||||||
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
const websiteQrcode = ref<ItemType[]>([]);
|
||||||
|
|
||||||
|
// 用户信息
|
||||||
|
const form = reactive<Website>({
|
||||||
|
websiteId: undefined,
|
||||||
|
websiteLogo: undefined,
|
||||||
|
websiteName: undefined,
|
||||||
|
keywords: '',
|
||||||
|
prefix: '',
|
||||||
|
domain: '',
|
||||||
|
adminUrl: '',
|
||||||
|
icpNo: undefined,
|
||||||
|
email: undefined,
|
||||||
|
version: undefined,
|
||||||
|
websiteType: '',
|
||||||
|
expirationTime: undefined,
|
||||||
|
sortNumber: undefined,
|
||||||
|
comments: undefined,
|
||||||
|
status: undefined
|
||||||
|
});
|
||||||
|
|
||||||
|
const websiteType = ref<SelectProps['options']>([
|
||||||
|
{
|
||||||
|
value: '企业官网',
|
||||||
|
label: '企业官网'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '门户网站',
|
||||||
|
label: '门户网站'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '电子商城',
|
||||||
|
label: '电子商城'
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
/* 更新visible */
|
||||||
|
const updateVisible = (value: boolean) => {
|
||||||
|
emit('update:visible', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
// 表单验证规则
|
||||||
|
const rules = reactive({
|
||||||
|
comments: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写网站描述',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
keywords: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写SEO关键词',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
domain: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写网站域名',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
adminUrl: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写网站后台管理地址',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
icpNo: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写ICP备案号',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
appSecret: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写网站秘钥',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
websiteName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'string',
|
||||||
|
message: '请填写网站信息名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
const chooseImage = (data: FileRecord) => {
|
||||||
|
images.value.push({
|
||||||
|
uid: data.id,
|
||||||
|
url: data.path,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
form.websiteLogo = data.downloadUrl;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onDeleteItem = (index: number) => {
|
||||||
|
images.value.splice(index, 1);
|
||||||
|
form.websiteLogo = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
const onWebsiteType = (text: string) => {
|
||||||
|
form.websiteType = text;
|
||||||
|
};
|
||||||
|
|
||||||
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
|
/* 保存编辑 */
|
||||||
|
const save = () => {
|
||||||
|
if (!formRef.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
formRef.value
|
||||||
|
.validate()
|
||||||
|
.then(() => {
|
||||||
|
loading.value = true;
|
||||||
|
const formData = {
|
||||||
|
...form
|
||||||
|
};
|
||||||
|
const saveOrUpdate = isUpdate.value ? updateWebsite : addWebsite;
|
||||||
|
saveOrUpdate(formData)
|
||||||
|
.then((msg) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.success(msg);
|
||||||
|
updateVisible(false);
|
||||||
|
emit('done');
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
loading.value = false;
|
||||||
|
message.error(e.message);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => props.visible,
|
||||||
|
(visible) => {
|
||||||
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
|
websiteQrcode.value = [];
|
||||||
|
if (props.data) {
|
||||||
|
assignObject(form, props.data);
|
||||||
|
if (props.data.websiteLogo) {
|
||||||
|
images.value.push({
|
||||||
|
uid: uuid(),
|
||||||
|
url: props.data.websiteLogo,
|
||||||
|
status: 'done'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
isUpdate.value = true;
|
||||||
|
} else {
|
||||||
|
isUpdate.value = false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -4,51 +4,55 @@
|
|||||||
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
<a-card :bordered="false" :body-style="{ padding: '16px' }">
|
||||||
<ele-pro-table
|
<ele-pro-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
row-key="id"
|
row-key="websiteId"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:datasource="datasource"
|
:datasource="datasource"
|
||||||
|
:customRow="customRow"
|
||||||
|
:need-page="false"
|
||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
>
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'websiteName'">
|
<template v-if="column.key === 'websiteLogo'">
|
||||||
<a-space class="ele-cell">
|
<a-image :src="record.websiteLogo" :width="50" />
|
||||||
<a-avatar
|
|
||||||
:src="record.websiteLogo"
|
|
||||||
size="small"
|
|
||||||
shape="square"
|
|
||||||
/>
|
|
||||||
<span class="ele-text-secondary">{{ record.websiteName }}</span>
|
|
||||||
</a-space>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'hostName'">
|
<template v-if="column.key === 'domain'">
|
||||||
<span class="ele-text-placeholder">{{ record.hostName }}</span>
|
<a-button
|
||||||
|
type="link"
|
||||||
|
@click="openUrl(`${record.prefix}${record.domain}`)"
|
||||||
|
>{{ record.domain }}</a-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'hostType'">
|
<template v-if="column.key === 'type'">
|
||||||
<span class="ele-text-placeholder">CNAME</span>
|
<a-tag v-if="record.type === 1" color="green">是</a-tag>
|
||||||
|
<a-tag
|
||||||
|
v-if="record.type === 0"
|
||||||
|
@click="updateType(record)"
|
||||||
|
class="cursor-pointer"
|
||||||
|
>否</a-tag
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'hostValue'">
|
<template v-if="column.key === 'version'">
|
||||||
<span class="ele-text-placeholder">{{ record.hostValue }}</span>
|
<a-tag v-if="record.version === 10">免费版</a-tag>
|
||||||
</template>
|
<a-tag v-if="record.version === 20">授权版</a-tag>
|
||||||
<template v-if="column.key === 'photo'">
|
<a-tag v-if="record.version === 30">永久授权</a-tag>
|
||||||
<a-image :src="record.photo" />
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'status'">
|
<template v-if="column.key === 'status'">
|
||||||
<a-switch
|
<a-tag v-if="record.status === 0" color="green">正常</a-tag>
|
||||||
v-model:checked="record.status"
|
<a-tag v-if="record.status === 1" color="red">已过期</a-tag>
|
||||||
@change="updateStatus(record)"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button @click="openEdit(record)" size="small">管理</a-button>
|
<a-button type="primary" ghost @click="openUrl(`${record.prefix}${record.adminUrl}`)">进入后台</a-button>
|
||||||
<a-popconfirm
|
|
||||||
title="确定要删除此域名吗?"
|
|
||||||
:disabled="record.home == 1"
|
|
||||||
@confirm="remove(record)"
|
|
||||||
>
|
|
||||||
<a-button size="small">删除</a-button>
|
|
||||||
</a-popconfirm>
|
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
@@ -56,7 +60,7 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<Edit v-model:visible="showEdit" :data="current" @done="reload" />
|
<WebsiteEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -66,12 +70,13 @@
|
|||||||
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';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
import type {
|
import type {
|
||||||
DatasourceFunction,
|
DatasourceFunction,
|
||||||
ColumnItem
|
ColumnItem
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
// import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import Edit from './components/edit.vue';
|
import WebsiteEdit from './components/websiteEdit.vue';
|
||||||
import {
|
import {
|
||||||
pageWebsite,
|
pageWebsite,
|
||||||
removeWebsite,
|
removeWebsite,
|
||||||
@@ -79,9 +84,7 @@
|
|||||||
updateWebsite
|
updateWebsite
|
||||||
} from '@/api/cms/website';
|
} from '@/api/cms/website';
|
||||||
import type { Website, WebsiteParam } from '@/api/cms/website/model';
|
import type { Website, WebsiteParam } from '@/api/cms/website/model';
|
||||||
import { openPreview } from '@/utils/common';
|
import { openUrl } from '@/utils/common';
|
||||||
import type { Payment } from '@/api/system/payment/model';
|
|
||||||
import { updatePayment } from '@/api/system/payment';
|
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -94,6 +97,8 @@
|
|||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
// 是否显示批量移动弹窗
|
// 是否显示批量移动弹窗
|
||||||
const showMove = ref(false);
|
const showMove = ref(false);
|
||||||
|
// 加载状态
|
||||||
|
const loading = ref(true);
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({
|
const datasource: DatasourceFunction = ({
|
||||||
@@ -103,6 +108,9 @@
|
|||||||
orders,
|
orders,
|
||||||
filters
|
filters
|
||||||
}) => {
|
}) => {
|
||||||
|
if (filters) {
|
||||||
|
where.status = filters.status;
|
||||||
|
}
|
||||||
return pageWebsite({
|
return pageWebsite({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -116,26 +124,53 @@
|
|||||||
{
|
{
|
||||||
title: '网站名称',
|
title: '网站名称',
|
||||||
dataIndex: 'websiteName',
|
dataIndex: 'websiteName',
|
||||||
width: 240,
|
key: 'websiteName',
|
||||||
key: 'websiteName'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '主机类型',
|
title: 'Logo',
|
||||||
dataIndex: 'websiteType',
|
dataIndex: 'websiteLogo',
|
||||||
align: 'center',
|
key: 'websiteLogo',
|
||||||
key: 'websiteType'
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '是否启用',
|
title: '主域名',
|
||||||
|
dataIndex: 'domain',
|
||||||
|
key: 'domain',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '网站描述',
|
||||||
|
dataIndex: 'comments',
|
||||||
|
key: 'comments',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '当前版本',
|
||||||
|
dataIndex: 'version',
|
||||||
|
key: 'version',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
width: 120,
|
key: 'status',
|
||||||
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
key: 'status'
|
sorter: true,
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
fixed: 'right',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSetting: true
|
hideInSetting: true
|
||||||
}
|
}
|
||||||
@@ -158,20 +193,17 @@
|
|||||||
showMove.value = true;
|
showMove.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateStatus = (item: Website) => {
|
const updateType = (row: Website) => {
|
||||||
updateWebsite(item)
|
updateWebsite(row).then((msg) => {
|
||||||
.then((msg) => {
|
message.success(msg);
|
||||||
message.success(msg);
|
reload();
|
||||||
})
|
});
|
||||||
.catch((msg) => {
|
|
||||||
message.error(msg);
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: Website) => {
|
const remove = (row: Website) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
removeWebsite(row.id)
|
removeWebsite(row.websiteId)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
@@ -196,7 +228,7 @@
|
|||||||
maskClosable: true,
|
maskClosable: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
removeBatchWebsite(selection.value.map((d) => d.id))
|
removeBatchWebsite(selection.value.map((d) => d.websiteId))
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
hide();
|
hide();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
@@ -209,9 +241,32 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* 查询 */
|
||||||
|
const query = () => {
|
||||||
|
loading.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 自定义行属性 */
|
||||||
|
const customRow = (record: Website) => {
|
||||||
|
return {
|
||||||
|
// 行点击事件
|
||||||
|
onClick: () => {
|
||||||
|
// console.log(record);
|
||||||
|
},
|
||||||
|
// 行双击事件
|
||||||
|
onDblclick: () => {
|
||||||
|
openEdit(record);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
query();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export default {
|
export default {
|
||||||
name: 'Website'
|
name: 'Website'
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
|
|||||||
@@ -105,37 +105,40 @@
|
|||||||
dataIndex: 'brandId',
|
dataIndex: 'brandId',
|
||||||
key: 'brandId',
|
key: 'brandId',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 90,
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '品牌名称',
|
title: '品牌名称',
|
||||||
dataIndex: 'brandName',
|
dataIndex: 'brandName',
|
||||||
key: 'brandName',
|
key: 'brandName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '图标',
|
title: '图标',
|
||||||
dataIndex: 'image',
|
dataIndex: 'image',
|
||||||
key: 'image',
|
key: 'image',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
dataIndex: 'comments',
|
dataIndex: 'comments',
|
||||||
key: 'comments',
|
key: 'comments',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
hideInTable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
hideInTable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '排序号',
|
title: '排序号',
|
||||||
dataIndex: 'sortNumber',
|
dataIndex: 'sortNumber',
|
||||||
key: 'sortNumber',
|
key: 'sortNumber',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
|
hideInTable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
|
|||||||
@@ -23,6 +23,14 @@
|
|||||||
styleResponsive ? { md: 24, sm: 24, xs: 24 } : { span: 8 }
|
styleResponsive ? { md: 24, sm: 24, xs: 24 } : { span: 8 }
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
|
<a-form-item label="选择店铺" name="merchantId" v-if="!form.merchantId">
|
||||||
|
<SelectMerchant
|
||||||
|
:placeholder="`选择商户`"
|
||||||
|
class="input-item"
|
||||||
|
v-model:value="form.merchantName"
|
||||||
|
@done="chooseMerchantId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item
|
<a-form-item
|
||||||
label="商品类型"
|
label="商品类型"
|
||||||
name="type"
|
name="type"
|
||||||
@@ -252,29 +260,32 @@
|
|||||||
<a-card title="商品参数" :bordered="false" class="goods-form" />
|
<a-card title="商品参数" :bordered="false" class="goods-form" />
|
||||||
|
|
||||||
<a-card title="更多设置" :bordered="false" class="goods-form" />
|
<a-card title="更多设置" :bordered="false" class="goods-form" />
|
||||||
|
<a-card :bordered="false" class="goods-form">
|
||||||
|
<a-button type="primary" block size="large" @click="save">保存</a-button>
|
||||||
|
</a-card>
|
||||||
|
|
||||||
|
|
||||||
<div class="body-bottom"></div>
|
<div class="body-bottom"></div>
|
||||||
|
|
||||||
|
|
||||||
<a-card
|
<a-card
|
||||||
:bordered="false"
|
:bordered="false"
|
||||||
class="goods-form"
|
class="goods-form"
|
||||||
style="position: fixed; bottom: 0; opacity: 0.9"
|
style="position: fixed; bottom: 0; opacity: 0.9"
|
||||||
>
|
>
|
||||||
<a-space :size="20">
|
<!-- <div style="width: 100px">-->
|
||||||
|
<!-- <a-button block danger size="large" @click="save"-->
|
||||||
|
<!-- >删除</a-button-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- </div>-->
|
||||||
<div style="width: 100px">
|
<div style="width: 100px">
|
||||||
<a-button block danger size="large" @click="save"
|
<a-button type="primary" block size="large" @click="save">保存</a-button>
|
||||||
>删除</a-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100px">
|
<!-- <div style="width: 100px">-->
|
||||||
<a-button block size="large" @click="save">保存草稿</a-button>
|
<!-- <a-button type="primary" block size="large" @click="save"-->
|
||||||
</div>
|
<!-- >上架</a-button-->
|
||||||
<div style="width: 100px">
|
<!-- >-->
|
||||||
<a-button type="primary" block size="large" @click="save"
|
<!-- </div>-->
|
||||||
>上架</a-button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</a-space>
|
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
@@ -309,6 +320,8 @@
|
|||||||
import {listSpec} from '@/api/shop/spec';
|
import {listSpec} from '@/api/shop/spec';
|
||||||
import {Spec} from "@/api/shop/spec/model";
|
import {Spec} from "@/api/shop/spec/model";
|
||||||
import { getMerchantName } from "@/utils/merchant";
|
import { getMerchantName } from "@/utils/merchant";
|
||||||
|
import router from "@/router";
|
||||||
|
import { Merchant } from "@/api/shop/merchant/model";
|
||||||
|
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
@@ -368,6 +381,7 @@
|
|||||||
recommend: 0,
|
recommend: 0,
|
||||||
sortNumber: undefined,
|
sortNumber: undefined,
|
||||||
status: undefined,
|
status: undefined,
|
||||||
|
merchantName: '',
|
||||||
merchantId: getMerchantId()
|
merchantId: getMerchantId()
|
||||||
});
|
});
|
||||||
const skuColumns = ref<ColumnItem[]>([
|
const skuColumns = ref<ColumnItem[]>([
|
||||||
@@ -450,6 +464,14 @@
|
|||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
merchantId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择店铺',
|
||||||
|
type: 'number',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
|
],
|
||||||
categoryId: [
|
categoryId: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -689,6 +711,12 @@
|
|||||||
form.categoryChildren = value[1].label;
|
form.categoryChildren = value[1].label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 搜索 */
|
||||||
|
const chooseMerchantId = (item: Merchant) => {
|
||||||
|
form.merchantName = item.merchantName;
|
||||||
|
form.merchantId = item.merchantId;
|
||||||
|
};
|
||||||
|
|
||||||
const onBathSet = () => {
|
const onBathSet = () => {
|
||||||
skuList.value.map(d => {
|
skuList.value.map(d => {
|
||||||
console.log(d);
|
console.log(d);
|
||||||
@@ -880,11 +908,13 @@
|
|||||||
skuList.value.map(d => {
|
skuList.value.map(d => {
|
||||||
d.images = undefined
|
d.images = undefined
|
||||||
})
|
})
|
||||||
|
if(getMerchantId()){
|
||||||
|
form.merchantId = getMerchantId();
|
||||||
|
form.merchantName = getMerchantName();
|
||||||
|
}
|
||||||
const formData = {
|
const formData = {
|
||||||
...form,
|
...form,
|
||||||
content: content.value,
|
content: content.value,
|
||||||
merchantId: getMerchantId(),
|
|
||||||
merchantName: getMerchantName(),
|
|
||||||
image: JSON.stringify(imgList.value),
|
image: JSON.stringify(imgList.value),
|
||||||
files: JSON.stringify(fileList.value),
|
files: JSON.stringify(fileList.value),
|
||||||
goodsSpecs: specList.value,
|
goodsSpecs: specList.value,
|
||||||
@@ -899,6 +929,9 @@
|
|||||||
category.value = []
|
category.value = []
|
||||||
resetFields();
|
resetFields();
|
||||||
message.success(msg);
|
message.success(msg);
|
||||||
|
setTimeout(() => {
|
||||||
|
router.go(-1)
|
||||||
|
},1000)
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
115
src/views/shop/goods.bak/components/search.vue
Normal file
115
src/views/shop/goods.bak/components/search.vue
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
<!-- 搜索表单 -->
|
||||||
|
<template>
|
||||||
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
|
<a-button type="primary" class="ele-btn-icon" @click="add">
|
||||||
|
<template #icon>
|
||||||
|
<PlusOutlined />
|
||||||
|
</template>
|
||||||
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
<a-radio-group v-model:value="type" @change="handleSearch">
|
||||||
|
<a-radio-button value="出售中"
|
||||||
|
>出售中({{ goodsCount?.totalNum }})</a-radio-button
|
||||||
|
>
|
||||||
|
<a-radio-button value="待上架"
|
||||||
|
>待上架({{ goodsCount?.totalNum2 }})</a-radio-button
|
||||||
|
>
|
||||||
|
<a-radio-button value="已售罄"
|
||||||
|
>已售罄({{ goodsCount?.totalNum3 }})</a-radio-button
|
||||||
|
>
|
||||||
|
</a-radio-group>
|
||||||
|
<a-input-search
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
v-model:value="where.keywords"
|
||||||
|
@pressEnter="reload"
|
||||||
|
@search="reload"
|
||||||
|
/>
|
||||||
|
<a-button @click="reset">重置</a-button>
|
||||||
|
</a-space>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
|
import { ref, watch } from 'vue';
|
||||||
|
import { getCount } from '@/api/shop/goods';
|
||||||
|
import type { GoodsCount, GoodsParam } from '@/api/shop/goods/model';
|
||||||
|
import useSearch from '@/utils/use-search';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
const { currentRoute } = useRouter();
|
||||||
|
|
||||||
|
const props = withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
// 选中的角色
|
||||||
|
selection?: [];
|
||||||
|
}>(),
|
||||||
|
{}
|
||||||
|
);
|
||||||
|
|
||||||
|
const type = ref<string>();
|
||||||
|
// 统计数据
|
||||||
|
const goodsCount = ref<GoodsCount>();
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const { where, resetFields } = useSearch<GoodsParam>({
|
||||||
|
goodsId: undefined,
|
||||||
|
status: undefined,
|
||||||
|
isShow: undefined,
|
||||||
|
stock: undefined,
|
||||||
|
keywords: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
(e: 'search', where?: GradeParam): void;
|
||||||
|
(e: 'add'): void;
|
||||||
|
(e: 'remove'): void;
|
||||||
|
(e: 'batchMove'): void;
|
||||||
|
}>();
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
const add = () => {
|
||||||
|
emit('add');
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSearch = (e) => {
|
||||||
|
const text = e.target.value;
|
||||||
|
resetFields();
|
||||||
|
if (text === '出售中') {
|
||||||
|
where.isShow = 1;
|
||||||
|
}
|
||||||
|
if (text === '待上架') {
|
||||||
|
where.isShow = 0;
|
||||||
|
}
|
||||||
|
if (text === '已售罄') {
|
||||||
|
where.stock = 0;
|
||||||
|
}
|
||||||
|
emit('search', where);
|
||||||
|
};
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
getCount().then((data: any) => {
|
||||||
|
goodsCount.value = data;
|
||||||
|
});
|
||||||
|
emit('search', where);
|
||||||
|
};
|
||||||
|
|
||||||
|
/* 重置 */
|
||||||
|
const reset = () => {
|
||||||
|
resetFields();
|
||||||
|
type.value = '';
|
||||||
|
reload();
|
||||||
|
};
|
||||||
|
|
||||||
|
// watch(
|
||||||
|
// () => props.selection,
|
||||||
|
// () => {}
|
||||||
|
// );
|
||||||
|
watch(
|
||||||
|
currentRoute,
|
||||||
|
() => {
|
||||||
|
reload();
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
@@ -32,9 +32,25 @@
|
|||||||
<a-image v-if="index == 0" :src="img" :width="80" />
|
<a-image v-if="index == 0" :src="img" :width="80" />
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'status'">
|
|
||||||
<a-tag v-if="record.status === 0" color="green">已上架</a-tag>
|
<template v-if="column.key === 'salePrice'">
|
||||||
<a-tag v-if="record.status === 1" color="red">已下架</a-tag>
|
¥{{ formatNumber(record.salePrice) }}
|
||||||
|
</template>
|
||||||
|
<template v-if="column.key === 'isShow'">
|
||||||
|
<a-tag
|
||||||
|
v-if="record.isShow === 1"
|
||||||
|
color="green"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="onUpdate(record)"
|
||||||
|
>出售中</a-tag
|
||||||
|
>
|
||||||
|
<a-tag
|
||||||
|
v-if="record.isShow === 0"
|
||||||
|
color="red"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="onUpdate(record)"
|
||||||
|
>已下架</a-tag
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
@@ -69,9 +85,15 @@
|
|||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import GoodsEdit from './components/goodsEdit.vue';
|
import GoodsEdit from './components/goodsEdit.vue';
|
||||||
import { pageGoods, removeGoods, removeBatchGoods } from '@/api/shop/goods';
|
import {
|
||||||
|
pageGoods,
|
||||||
|
removeGoods,
|
||||||
|
removeBatchGoods,
|
||||||
|
updateGoods
|
||||||
|
} from '@/api/shop/goods';
|
||||||
import type { Goods, GoodsParam } from '@/api/shop/goods/model';
|
import type { Goods, GoodsParam } from '@/api/shop/goods/model';
|
||||||
import { getMerchantId, openPreview, openUrl } from "@/utils/common";
|
import { getMerchantId, openUrl } from '@/utils/common';
|
||||||
|
import { formatNumber } from 'ele-admin-pro/es';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -88,16 +110,7 @@
|
|||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({
|
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
||||||
page,
|
|
||||||
limit,
|
|
||||||
where,
|
|
||||||
orders,
|
|
||||||
filters
|
|
||||||
}) => {
|
|
||||||
if (filters) {
|
|
||||||
where.status = filters.status;
|
|
||||||
}
|
|
||||||
where.merchantId = getMerchantId();
|
where.merchantId = getMerchantId();
|
||||||
return pageGoods({
|
return pageGoods({
|
||||||
...where,
|
...where,
|
||||||
@@ -114,6 +127,10 @@
|
|||||||
width: 90,
|
width: 90,
|
||||||
dataIndex: 'goodsId'
|
dataIndex: 'goodsId'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '店铺名称',
|
||||||
|
dataIndex: 'merchantName'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '封面图',
|
title: '封面图',
|
||||||
dataIndex: 'image',
|
dataIndex: 'image',
|
||||||
@@ -152,10 +169,10 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'isShow',
|
||||||
width: 120,
|
width: 120,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
key: 'status'
|
key: 'isShow'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@@ -169,6 +186,7 @@
|
|||||||
|
|
||||||
/* 搜索 */
|
/* 搜索 */
|
||||||
const reload = (where?: GoodsParam) => {
|
const reload = (where?: GoodsParam) => {
|
||||||
|
console.log(where);
|
||||||
selection.value = [];
|
selection.value = [];
|
||||||
tableRef?.value?.reload({ where: where });
|
tableRef?.value?.reload({ where: where });
|
||||||
};
|
};
|
||||||
@@ -184,6 +202,14 @@
|
|||||||
showMove.value = true;
|
showMove.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onUpdate = (row?: Goods) => {
|
||||||
|
const isShow = row?.isShow == 0 ? 1 : 0;
|
||||||
|
updateGoods({ ...row, isShow }).then((msg) => {
|
||||||
|
message.success(msg);
|
||||||
|
reload();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/* 删除单个 */
|
/* 删除单个 */
|
||||||
const remove = (row: Goods) => {
|
const remove = (row: Goods) => {
|
||||||
const hide = message.loading('请求中..', 0);
|
const hide = message.loading('请求中..', 0);
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
<!-- 搜索表单 -->
|
|
||||||
<template>
|
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
|
||||||
<a-button type="primary" class="ele-btn-icon" @click="add">
|
|
||||||
<template #icon>
|
|
||||||
<PlusOutlined />
|
|
||||||
</template>
|
|
||||||
<span>添加</span>
|
|
||||||
</a-button>
|
|
||||||
</a-space>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
|
||||||
import type { GradeParam } from '@/api/user/grade/model';
|
|
||||||
import { watch } from 'vue';
|
|
||||||
|
|
||||||
const props = withDefaults(
|
|
||||||
defineProps<{
|
|
||||||
// 选中的角色
|
|
||||||
selection?: [];
|
|
||||||
}>(),
|
|
||||||
{}
|
|
||||||
);
|
|
||||||
|
|
||||||
const emit = defineEmits<{
|
|
||||||
(e: 'search', where?: GradeParam): void;
|
|
||||||
(e: 'add'): void;
|
|
||||||
(e: 'remove'): void;
|
|
||||||
(e: 'batchMove'): void;
|
|
||||||
}>();
|
|
||||||
|
|
||||||
// 新增
|
|
||||||
const add = () => {
|
|
||||||
emit('add');
|
|
||||||
};
|
|
||||||
|
|
||||||
watch(
|
|
||||||
() => props.selection,
|
|
||||||
() => {}
|
|
||||||
);
|
|
||||||
</script>
|
|
||||||
@@ -5,7 +5,19 @@
|
|||||||
<template #icon>
|
<template #icon>
|
||||||
<PlusOutlined />
|
<PlusOutlined />
|
||||||
</template>
|
</template>
|
||||||
<span>添加商户</span>
|
<span>添加</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="openUrl(`/shop/index`)">
|
||||||
|
<span>店铺管理</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="openUrl(`/shop/apply`)">
|
||||||
|
<span>入驻申请</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="openUrl(`/shop/desk`)">
|
||||||
|
<span>桌号管理</span>
|
||||||
|
</a-button>
|
||||||
|
<a-button class="ele-btn-icon" @click="openUrl(`/shop/type`)">
|
||||||
|
<span>店铺类型</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -14,6 +26,8 @@
|
|||||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
import type { GradeParam } from '@/api/user/grade/model';
|
import type { GradeParam } from '@/api/user/grade/model';
|
||||||
import { watch } from 'vue';
|
import { watch } from 'vue';
|
||||||
|
import { openUrl } from '@/utils/common';
|
||||||
|
import router from '@/router';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -36,7 +50,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.selection,
|
() => router.currentRoute,
|
||||||
() => {}
|
(route) => {
|
||||||
|
console.log(route,'route');
|
||||||
|
}
|
||||||
);
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -30,7 +30,9 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openNew(record.adminUrl)">商家后台</a>
|
<a @click="openUrl(`/shop/account/${record.merchantId}`)"
|
||||||
|
>门店用户</a
|
||||||
|
>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a @click="openEdit(record)">修改</a>
|
<a @click="openEdit(record)">修改</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
@@ -64,9 +66,13 @@
|
|||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import MerchantEdit from './components/merchantEdit.vue';
|
import MerchantEdit from './components/merchantEdit.vue';
|
||||||
import { pageMerchant, removeMerchant, removeBatchMerchant } from '@/api/shop/merchant';
|
import {
|
||||||
|
pageMerchant,
|
||||||
|
removeMerchant,
|
||||||
|
removeBatchMerchant
|
||||||
|
} from '@/api/shop/merchant';
|
||||||
import type { Merchant, MerchantParam } from '@/api/shop/merchant/model';
|
import type { Merchant, MerchantParam } from '@/api/shop/merchant/model';
|
||||||
import {openNew, openPreview} from "@/utils/common";
|
import { openNew, openPreview, openUrl } from '@/utils/common';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -107,49 +113,49 @@
|
|||||||
title: 'ID',
|
title: 'ID',
|
||||||
dataIndex: 'merchantId',
|
dataIndex: 'merchantId',
|
||||||
key: 'merchantId',
|
key: 'merchantId',
|
||||||
width: 90,
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商户名称',
|
title: '店铺名称',
|
||||||
dataIndex: 'merchantName',
|
dataIndex: 'merchantName',
|
||||||
key: 'merchantName',
|
key: 'merchantName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商户图标',
|
title: '商户图标',
|
||||||
dataIndex: 'image',
|
dataIndex: 'image',
|
||||||
key: 'image',
|
key: 'image',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商户姓名',
|
title: '商户姓名',
|
||||||
dataIndex: 'realName',
|
dataIndex: 'realName',
|
||||||
key: 'realName',
|
key: 'realName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商户手机号',
|
title: '商户手机号',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
key: 'phone',
|
key: 'phone',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '店铺类型',
|
title: '店铺类型',
|
||||||
dataIndex: 'shopType',
|
dataIndex: 'shopType',
|
||||||
key: 'shopType',
|
key: 'shopType',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '排序号',
|
title: '排序号',
|
||||||
dataIndex: 'sortNumber',
|
dataIndex: 'sortNumber',
|
||||||
key: 'sortNumber',
|
key: 'sortNumber',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="选择商户" name="merchantId">
|
<a-form-item label="选择商户" name="merchantId" v-if="!merchantId">
|
||||||
<SelectMerchant
|
<SelectMerchant
|
||||||
:placeholder="`选择商户`"
|
:placeholder="`选择商户`"
|
||||||
class="input-item"
|
class="input-item"
|
||||||
@@ -26,11 +26,18 @@
|
|||||||
@done="chooseMerchantId"
|
@done="chooseMerchantId"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<a-form-item label="选择用户" name="userId" v-if="!isUpdate">
|
||||||
|
<SelectUser
|
||||||
|
:placeholder="`选择用户`"
|
||||||
|
class="input-item"
|
||||||
|
v-model:value="form.nickname"
|
||||||
|
@done="chooseUserId"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
<a-form-item label="选择角色" name="roleId">
|
<a-form-item label="选择角色" name="roleId">
|
||||||
<SelectRole
|
<SelectRole
|
||||||
:placeholder="`选择角色`"
|
:placeholder="`选择角色`"
|
||||||
class="input-item"
|
class="input-item"
|
||||||
:type="`merchant`"
|
|
||||||
v-model:value="form.roleName"
|
v-model:value="form.roleName"
|
||||||
@done="chooseRoleId"
|
@done="chooseRoleId"
|
||||||
/>
|
/>
|
||||||
@@ -40,7 +47,7 @@
|
|||||||
allow-clear
|
allow-clear
|
||||||
placeholder="请输入手机号码"
|
placeholder="请输入手机号码"
|
||||||
maxlength="11"
|
maxlength="11"
|
||||||
:disabled="isUpdate"
|
:disabled="true"
|
||||||
v-model:value="form.phone"
|
v-model:value="form.phone"
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
@@ -75,16 +82,20 @@
|
|||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { Form, message } from 'ant-design-vue';
|
||||||
import { assignObject, uuid } from 'ele-admin-pro';
|
import { assignObject, uuid } from 'ele-admin-pro';
|
||||||
import { addMerchantAccount, updateMerchantAccount } from '@/api/shop/merchantAccount';
|
import {
|
||||||
|
addMerchantAccount,
|
||||||
|
updateMerchantAccount
|
||||||
|
} from '@/api/shop/merchantAccount';
|
||||||
import { MerchantAccount } from '@/api/shop/merchantAccount/model';
|
import { MerchantAccount } from '@/api/shop/merchantAccount/model';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
import { FileRecord } from '@/api/system/file/model';
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
import {DictData} from "@/api/system/dict-data/model";
|
import { DictData } from '@/api/system/dict-data/model';
|
||||||
import {Merchant} from "@/api/shop/merchant/model";
|
import { Merchant } from '@/api/shop/merchant/model';
|
||||||
import {Role} from "@/api/system/role/model";
|
import { Role } from '@/api/system/role/model';
|
||||||
|
import { User } from '@/api/system/user/model';
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@@ -98,6 +109,8 @@
|
|||||||
visible: boolean;
|
visible: boolean;
|
||||||
// 修改回显的数据
|
// 修改回显的数据
|
||||||
data?: MerchantAccount | null;
|
data?: MerchantAccount | null;
|
||||||
|
// 商户ID
|
||||||
|
merchantId?: number | null;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
@@ -121,6 +134,7 @@
|
|||||||
merchantId: undefined,
|
merchantId: undefined,
|
||||||
merchantName: '',
|
merchantName: '',
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
|
nickname: '',
|
||||||
roleId: undefined,
|
roleId: undefined,
|
||||||
roleName: '',
|
roleName: '',
|
||||||
comments: undefined,
|
comments: undefined,
|
||||||
@@ -153,11 +167,11 @@
|
|||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
roleId: [
|
userId: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
message: '请选择角色',
|
message: '请选择用户',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@@ -184,6 +198,14 @@
|
|||||||
message: '请填写真实姓名',
|
message: '请填写真实姓名',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
roleId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
type: 'number',
|
||||||
|
message: '请选择角色权限',
|
||||||
|
trigger: 'blur'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -193,10 +215,17 @@
|
|||||||
form.merchantId = item.merchantId;
|
form.merchantId = item.merchantId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const chooseUserId = (item: User) => {
|
||||||
|
form.userId = item.userId;
|
||||||
|
form.nickname = item.realName ? item.realName : item.nickname;
|
||||||
|
form.phone = item.phone;
|
||||||
|
form.realName = item.realName;
|
||||||
|
};
|
||||||
|
|
||||||
const chooseRoleId = (item: Role) => {
|
const chooseRoleId = (item: Role) => {
|
||||||
form.roleId = item.roleId;
|
form.roleId = item.roleId;
|
||||||
form.roleName = item.roleName;
|
form.roleName = item.roleName;
|
||||||
}
|
};
|
||||||
|
|
||||||
const { resetFields } = useForm(form, rules);
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
@@ -210,9 +239,14 @@
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const formData = {
|
const formData = {
|
||||||
...form
|
...form,
|
||||||
|
merchantId: Number(props.merchantId)
|
||||||
|
? props.merchantId
|
||||||
|
: form.merchantId
|
||||||
};
|
};
|
||||||
const saveOrUpdate = isUpdate.value ? updateMerchantAccount : addMerchantAccount;
|
const saveOrUpdate = isUpdate.value
|
||||||
|
? updateMerchantAccount
|
||||||
|
: addMerchantAccount;
|
||||||
saveOrUpdate(formData)
|
saveOrUpdate(formData)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
@@ -7,13 +7,21 @@
|
|||||||
</template>
|
</template>
|
||||||
<span>添加</span>
|
<span>添加</span>
|
||||||
</a-button>
|
</a-button>
|
||||||
|
<a-input-search
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
v-model:value="where.keywords"
|
||||||
|
@pressEnter="reload"
|
||||||
|
@search="reload"
|
||||||
|
/>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PlusOutlined } from '@ant-design/icons-vue';
|
import { PlusOutlined } from '@ant-design/icons-vue';
|
||||||
import type { GradeParam } from '@/api/user/grade/model';
|
|
||||||
import { watch } from 'vue';
|
import { watch } from 'vue';
|
||||||
|
import { UserParam } from '@/api/system/user/model';
|
||||||
|
import useSearch from '@/utils/use-search';
|
||||||
|
|
||||||
const props = withDefaults(
|
const props = withDefaults(
|
||||||
defineProps<{
|
defineProps<{
|
||||||
@@ -23,8 +31,15 @@
|
|||||||
{}
|
{}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
|
const { where } = useSearch<UserParam>({
|
||||||
|
userId: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
keywords: ''
|
||||||
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'search', where?: GradeParam): void;
|
(e: 'search', where?: UserParam): void;
|
||||||
(e: 'add'): void;
|
(e: 'add'): void;
|
||||||
(e: 'remove'): void;
|
(e: 'remove'): void;
|
||||||
(e: 'batchMove'): void;
|
(e: 'batchMove'): void;
|
||||||
@@ -35,6 +50,10 @@
|
|||||||
emit('add');
|
emit('add');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const reload = () => {
|
||||||
|
emit('search', where);
|
||||||
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.selection,
|
() => props.selection,
|
||||||
() => {}
|
() => {}
|
||||||
|
|||||||
@@ -30,13 +30,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openEdit(record)">修改</a>
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
title="确定要删除此记录吗?"
|
title="确定要移除该门店用户吗?"
|
||||||
@confirm="remove(record)"
|
@confirm="remove(record)"
|
||||||
>
|
>
|
||||||
<a class="ele-text-danger">删除</a>
|
<a class="ele-text-danger">移除</a>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
@@ -45,13 +43,18 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<MerchantAccountEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<MerchantAccountEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
:merchantId="merchantId"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { createVNode, ref } from 'vue';
|
import { createVNode, ref, watch } 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';
|
||||||
@@ -62,8 +65,16 @@
|
|||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import MerchantAccountEdit from './components/merchantAccountEdit.vue';
|
import MerchantAccountEdit from './components/merchantAccountEdit.vue';
|
||||||
import { pageMerchantAccount, removeMerchantAccount, removeBatchMerchantAccount } from '@/api/shop/merchantAccount';
|
import {
|
||||||
import type { MerchantAccount, MerchantAccountParam } from '@/api/shop/merchantAccount/model';
|
pageMerchantAccount,
|
||||||
|
removeMerchantAccount,
|
||||||
|
removeBatchMerchantAccount
|
||||||
|
} from '@/api/shop/merchantAccount';
|
||||||
|
import type {
|
||||||
|
MerchantAccount,
|
||||||
|
MerchantAccountParam
|
||||||
|
} from '@/api/shop/merchantAccount/model';
|
||||||
|
import router from '@/router';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -78,6 +89,8 @@
|
|||||||
const showMove = ref(false);
|
const showMove = ref(false);
|
||||||
// 加载状态
|
// 加载状态
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
|
// 门店ID
|
||||||
|
const merchantId = ref(0);
|
||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({
|
const datasource: DatasourceFunction = ({
|
||||||
@@ -90,6 +103,10 @@
|
|||||||
if (filters) {
|
if (filters) {
|
||||||
where.status = filters.status;
|
where.status = filters.status;
|
||||||
}
|
}
|
||||||
|
if (merchantId.value > 0) {
|
||||||
|
where.merchantId = merchantId.value;
|
||||||
|
}
|
||||||
|
console.log('>>>>>>>>', merchantId.value);
|
||||||
return pageMerchantAccount({
|
return pageMerchantAccount({
|
||||||
...where,
|
...where,
|
||||||
...orders,
|
...orders,
|
||||||
@@ -101,35 +118,41 @@
|
|||||||
// 表格列配置
|
// 表格列配置
|
||||||
const columns = ref<ColumnItem[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: '用户ID',
|
||||||
dataIndex: 'id',
|
dataIndex: 'userId',
|
||||||
key: 'id',
|
key: 'userId',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 90,
|
width: 90
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '店铺名称',
|
||||||
|
dataIndex: 'merchantName',
|
||||||
|
key: 'merchantName',
|
||||||
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '账号',
|
title: '账号',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
key: 'phone',
|
key: 'phone',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '真实姓名',
|
title: '真实姓名',
|
||||||
dataIndex: 'realName',
|
dataIndex: 'realName',
|
||||||
key: 'realName',
|
key: 'realName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '角色',
|
title: '角色',
|
||||||
dataIndex: 'roleName',
|
dataIndex: 'roleName',
|
||||||
key: 'roleName',
|
key: 'roleName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
dataIndex: 'comments',
|
dataIndex: 'comments',
|
||||||
key: 'comments',
|
key: 'comments',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@@ -202,7 +225,9 @@
|
|||||||
|
|
||||||
/* 查询 */
|
/* 查询 */
|
||||||
const query = () => {
|
const query = () => {
|
||||||
|
console.log('query()', merchantId.value);
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
reload();
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 自定义行属性 */
|
/* 自定义行属性 */
|
||||||
@@ -218,7 +243,21 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
query();
|
|
||||||
|
watch(
|
||||||
|
() => router.currentRoute.value.params.id,
|
||||||
|
(id) => {
|
||||||
|
if (id) {
|
||||||
|
if (id == ':id') {
|
||||||
|
merchantId.value = 0;
|
||||||
|
} else {
|
||||||
|
merchantId.value = Number(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
query();
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -11,6 +11,15 @@
|
|||||||
tool-class="ele-toolbar-form"
|
tool-class="ele-toolbar-form"
|
||||||
class="sys-org-table"
|
class="sys-org-table"
|
||||||
>
|
>
|
||||||
|
<template #toolbar>
|
||||||
|
<search
|
||||||
|
@search="reload"
|
||||||
|
:selection="selection"
|
||||||
|
@add="openEdit"
|
||||||
|
@remove="removeBatch"
|
||||||
|
@batchMove="openMove"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<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" />
|
||||||
@@ -21,8 +30,11 @@
|
|||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button :size="`small`" @click="openEdit(record)">详情</a-button>
|
<a-button :size="`small`" @click="openEdit(record)"
|
||||||
<a-button :size="`small`"
|
>详情</a-button
|
||||||
|
>
|
||||||
|
<a-button
|
||||||
|
:size="`small`"
|
||||||
title="确定要删除此记录吗?"
|
title="确定要删除此记录吗?"
|
||||||
:disabled="record.status === 1"
|
:disabled="record.status === 1"
|
||||||
@confirm="remove(record)"
|
@confirm="remove(record)"
|
||||||
@@ -36,7 +48,11 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<MerchantApplyEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<MerchantApplyEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -51,10 +67,17 @@
|
|||||||
DatasourceFunction,
|
DatasourceFunction,
|
||||||
ColumnItem
|
ColumnItem
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from '../merchant/components/search.vue';
|
||||||
import MerchantApplyEdit from './components/merchantApplyEdit.vue';
|
import MerchantApplyEdit from './components/merchantApplyEdit.vue';
|
||||||
import { pageMerchantApply, removeMerchantApply, removeBatchMerchantApply } from '@/api/shop/merchantApply';
|
import {
|
||||||
import type { MerchantApply, MerchantApplyParam } from '@/api/shop/merchantApply/model';
|
pageMerchantApply,
|
||||||
|
removeMerchantApply,
|
||||||
|
removeBatchMerchantApply
|
||||||
|
} from '@/api/shop/merchantApply';
|
||||||
|
import type {
|
||||||
|
MerchantApply,
|
||||||
|
MerchantApplyParam
|
||||||
|
} from '@/api/shop/merchantApply/model';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -95,25 +118,25 @@
|
|||||||
title: 'ID',
|
title: 'ID',
|
||||||
dataIndex: 'applyId',
|
dataIndex: 'applyId',
|
||||||
key: 'applyId',
|
key: 'applyId',
|
||||||
width: 90,
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商户名称',
|
title: '商户名称',
|
||||||
dataIndex: 'merchantName',
|
dataIndex: 'merchantName',
|
||||||
key: 'merchantName',
|
key: 'merchantName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商户姓名',
|
title: '商户姓名',
|
||||||
dataIndex: 'realName',
|
dataIndex: 'realName',
|
||||||
key: 'realName',
|
key: 'realName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '商户手机号',
|
title: '商户手机号',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
key: 'phone',
|
key: 'phone',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '申请时间',
|
title: '申请时间',
|
||||||
@@ -128,13 +151,13 @@
|
|||||||
title: '店铺类型',
|
title: '店铺类型',
|
||||||
dataIndex: 'shopType',
|
dataIndex: 'shopType',
|
||||||
key: 'shopType',
|
key: 'shopType',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
|||||||
@@ -45,7 +45,11 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<MerchantTypeEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<MerchantTypeEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -60,10 +64,17 @@
|
|||||||
DatasourceFunction,
|
DatasourceFunction,
|
||||||
ColumnItem
|
ColumnItem
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from '../merchant/components/search.vue';
|
||||||
import MerchantTypeEdit from './components/merchantTypeEdit.vue';
|
import MerchantTypeEdit from './components/merchantTypeEdit.vue';
|
||||||
import { pageMerchantType, removeMerchantType, removeBatchMerchantType } from '@/api/shop/merchantType';
|
import {
|
||||||
import type { MerchantType, MerchantTypeParam } from '@/api/shop/merchantType/model';
|
pageMerchantType,
|
||||||
|
removeMerchantType,
|
||||||
|
removeBatchMerchantType
|
||||||
|
} from '@/api/shop/merchantType';
|
||||||
|
import type {
|
||||||
|
MerchantType,
|
||||||
|
MerchantTypeParam
|
||||||
|
} from '@/api/shop/merchantType/model';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -105,31 +116,31 @@
|
|||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
key: 'id',
|
key: 'id',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 90,
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '店铺类型',
|
title: '店铺类型',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '店铺入驻条件',
|
title: '店铺入驻条件',
|
||||||
dataIndex: 'comments',
|
dataIndex: 'comments',
|
||||||
key: 'comments',
|
key: 'comments',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '状态',
|
title: '状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '排序号',
|
title: '排序号',
|
||||||
dataIndex: 'sortNumber',
|
dataIndex: 'sortNumber',
|
||||||
key: 'sortNumber',
|
key: 'sortNumber',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-space :size="10" style="flex-wrap: wrap">
|
<a-space :size="10" style="flex-wrap: wrap">
|
||||||
<SelectMerchantDown
|
<SelectMerchantDown
|
||||||
:placeholder="`选择场馆`"
|
:placeholder="`选择店铺`"
|
||||||
class="input-item"
|
class="input-item"
|
||||||
v-model:value="where.merchantCode"
|
v-model:value="where.merchantCode"
|
||||||
@change="search"
|
@change="search"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
@search="search"
|
@search="search"
|
||||||
@pressEnter="search"
|
@pressEnter="search"
|
||||||
/>
|
/>
|
||||||
<!-- <a-button @click="getCode">生成支付二维码</a-button>-->
|
<!-- <a-button @click="getCode">生成支付二维码</a-button>-->
|
||||||
<a-button @click="reset">重置</a-button>
|
<a-button @click="reset">重置</a-button>
|
||||||
</a-space>
|
</a-space>
|
||||||
<ele-modal
|
<ele-modal
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<template>
|
<template>
|
||||||
<ele-modal
|
<ele-modal
|
||||||
:width="500"
|
:width="800"
|
||||||
:visible="visible"
|
:visible="visible"
|
||||||
:maskClosable="false"
|
:maskClosable="false"
|
||||||
:title="isUpdate ? '编辑商品规格' : '添加商品规格'"
|
:maxable="maxable"
|
||||||
|
:title="isUpdate ? '编辑规格' : '添加规格'"
|
||||||
:body-style="{ paddingBottom: '28px' }"
|
:body-style="{ paddingBottom: '28px' }"
|
||||||
@update:visible="updateVisible"
|
@update:visible="updateVisible"
|
||||||
@ok="save"
|
@ok="save"
|
||||||
@@ -13,48 +14,65 @@
|
|||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="form"
|
:model="form"
|
||||||
:rules="rules"
|
:rules="rules"
|
||||||
:label-col="styleResponsive ? { md: 5, sm: 5, xs: 24 } : { flex: '90px' }"
|
:label-col="styleResponsive ? { md: 4, sm: 5, xs: 24 } : { flex: '90px' }"
|
||||||
:wrapper-col="
|
:wrapper-col="
|
||||||
styleResponsive ? { md: 18, sm: 19, xs: 24 } : { flex: '1' }
|
styleResponsive ? { md: 19, sm: 19, xs: 24 } : { flex: '1' }
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<a-form-item label="规格名称" name="specName">
|
<a-form-item label="规格名称" name="specName">
|
||||||
<a-input
|
<a-input
|
||||||
allow-clear
|
allow-clear
|
||||||
:maxlength="100"
|
placeholder="请输入规格名称"
|
||||||
placeholder="机型"
|
|
||||||
v-model:value="form.specName"
|
v-model:value="form.specName"
|
||||||
@pressEnter="save"
|
|
||||||
/>
|
/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="排序号" name="sortNumber" v-if="isUpdate">
|
<a-form-item name="specValue">
|
||||||
<a-input-number
|
<a-space direction="vertical" class="ml-[124px]">
|
||||||
:min="0"
|
<template v-for="(item, index) in spec" :key="index">
|
||||||
:max="9999"
|
<div class="text-left flex items-center leading-10 text-gray-400">
|
||||||
class="ele-fluid"
|
<div class="mr-2">{{ item.value }} :</div>
|
||||||
placeholder="请输入排序号"
|
<CloseCircleOutlined
|
||||||
v-model:value="form.sortNumber"
|
class="cursor-pointer"
|
||||||
/>
|
@click="onClose(index)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<ele-edit-tag
|
||||||
|
v-model:data="item.detail"
|
||||||
|
size="middle"
|
||||||
|
shape="round"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
<a-card class="ml-[124px]" v-if="showSpecForm">
|
||||||
|
<a-form-item name="name">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入规格"
|
||||||
|
v-model:value="name"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item name="value">
|
||||||
|
<a-input
|
||||||
|
allow-clear
|
||||||
|
placeholder="请输入规格值"
|
||||||
|
v-model:value="value"
|
||||||
|
/>
|
||||||
|
</a-form-item>
|
||||||
|
<a-space>
|
||||||
|
<a-button type="primary" @click="addSpecValue">确定</a-button>
|
||||||
|
<a-button @click="openSpecForm">取消</a-button>
|
||||||
|
</a-space>
|
||||||
|
</a-card>
|
||||||
|
<a-button type="primary" class="mt-5" v-else @click="openSpecForm"
|
||||||
|
>添加新规格</a-button
|
||||||
|
>
|
||||||
|
</a-space>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item label="描述" name="comments">
|
|
||||||
<a-textarea
|
|
||||||
:rows="4"
|
|
||||||
:maxlength="200"
|
|
||||||
placeholder="iphone15"
|
|
||||||
v-model:value="form.comments"
|
|
||||||
/>
|
|
||||||
</a-form-item>
|
|
||||||
<!-- <a-form-item label="状态" name="status">-->
|
|
||||||
<!-- <a-radio-group v-model:value="form.status">-->
|
|
||||||
<!-- <a-radio :value="0">已启用</a-radio>-->
|
|
||||||
<!-- <a-radio :value="1">未启用</a-radio>-->
|
|
||||||
<!-- </a-radio-group>-->
|
|
||||||
<!-- </a-form-item>-->
|
|
||||||
</a-form>
|
</a-form>
|
||||||
</ele-modal>
|
</ele-modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { CloseCircleOutlined } from '@ant-design/icons-vue';
|
||||||
import { ref, reactive, watch } from 'vue';
|
import { ref, reactive, watch } from 'vue';
|
||||||
import { Form, message } from 'ant-design-vue';
|
import { Form, message } from 'ant-design-vue';
|
||||||
import { assignObject } from 'ele-admin-pro';
|
import { assignObject } from 'ele-admin-pro';
|
||||||
@@ -62,7 +80,9 @@
|
|||||||
import { Spec } from '@/api/shop/spec/model';
|
import { Spec } from '@/api/shop/spec/model';
|
||||||
import { useThemeStore } from '@/store/modules/theme';
|
import { useThemeStore } from '@/store/modules/theme';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FormInstance } from 'ant-design-vue/es/form';
|
import { FormInstance } from 'ant-design-vue/es/form';
|
||||||
|
import { SpecValue } from '@/api/shop/specValue/model';
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@@ -85,16 +105,24 @@
|
|||||||
|
|
||||||
// 提交状态
|
// 提交状态
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
// 是否显示最大化切换按钮
|
||||||
|
const maxable = ref(true);
|
||||||
|
const showSpecForm = ref(false);
|
||||||
// 表格选中数据
|
// 表格选中数据
|
||||||
const formRef = ref<FormInstance | null>(null);
|
const formRef = ref<FormInstance | null>(null);
|
||||||
|
const images = ref<ItemType[]>([]);
|
||||||
|
const spec = ref<SpecValue[]>([]);
|
||||||
|
const name = ref();
|
||||||
|
const value = ref();
|
||||||
|
|
||||||
// 用户信息
|
// 用户信息
|
||||||
const form = reactive<Spec>({
|
const form = reactive<Spec>({
|
||||||
specId: undefined,
|
specId: undefined,
|
||||||
specName: '',
|
specName: undefined,
|
||||||
|
specValue: undefined,
|
||||||
|
status: 0,
|
||||||
comments: '',
|
comments: '',
|
||||||
sortNumber: 100,
|
sortNumber: 100
|
||||||
status: 0
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* 更新visible */
|
/* 更新visible */
|
||||||
@@ -108,12 +136,48 @@
|
|||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
type: 'string',
|
type: 'string',
|
||||||
message: '请填写商品规格名称',
|
message: '请填写规格名称',
|
||||||
trigger: 'blur'
|
trigger: 'blur'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// const validator = (value: string) => {
|
||||||
|
// return new Promise<void>((_resolve, reject) => {
|
||||||
|
// setTimeout(() => {
|
||||||
|
// reject(new Error(value + '不合法, 请重新输入'));
|
||||||
|
// }, 1000);
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
|
// 新增规格
|
||||||
|
const addSpecValue = () => {
|
||||||
|
if (!name.value || !value.value) {
|
||||||
|
message.error(`请输入规格和规格值)`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
const findIndex = spec.value.findIndex((d) => d.value == name.value);
|
||||||
|
if (findIndex == 0) {
|
||||||
|
message.error(`${name.value}已存在)`);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
spec.value.push({
|
||||||
|
value: name.value,
|
||||||
|
detail: [value.value]
|
||||||
|
});
|
||||||
|
name.value = '';
|
||||||
|
value.value = '';
|
||||||
|
openSpecForm();
|
||||||
|
};
|
||||||
|
|
||||||
|
const openSpecForm = () => {
|
||||||
|
showSpecForm.value = !showSpecForm.value;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onClose = (index) => {
|
||||||
|
spec.value.splice(index, 1);
|
||||||
|
};
|
||||||
|
|
||||||
const { resetFields } = useForm(form, rules);
|
const { resetFields } = useForm(form, rules);
|
||||||
|
|
||||||
/* 保存编辑 */
|
/* 保存编辑 */
|
||||||
@@ -125,8 +189,13 @@
|
|||||||
.validate()
|
.validate()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
if (spec.value.length === 0) {
|
||||||
|
message.error('请添加规格');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const formData = {
|
const formData = {
|
||||||
...form
|
...form,
|
||||||
|
specValue: JSON.stringify(spec.value)
|
||||||
};
|
};
|
||||||
const saveOrUpdate = isUpdate.value ? updateSpec : addSpec;
|
const saveOrUpdate = isUpdate.value ? updateSpec : addSpec;
|
||||||
saveOrUpdate(formData)
|
saveOrUpdate(formData)
|
||||||
@@ -148,10 +217,15 @@
|
|||||||
() => props.visible,
|
() => props.visible,
|
||||||
(visible) => {
|
(visible) => {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
images.value = [];
|
||||||
if (props.data) {
|
if (props.data) {
|
||||||
assignObject(form, props.data);
|
assignObject(form, props.data);
|
||||||
|
if (props.data.specValue) {
|
||||||
|
spec.value = JSON.parse(props.data.specValue);
|
||||||
|
}
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
} else {
|
} else {
|
||||||
|
spec.value = [];
|
||||||
isUpdate.value = false;
|
isUpdate.value = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -21,16 +21,32 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.key === 'specValue'">
|
||||||
|
<a-space direction="vertical">
|
||||||
|
<template
|
||||||
|
v-for="(item, index) in JSON.parse(record.specValue)"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<div class="text-left">
|
||||||
|
<span class="text-gray-400 mr-2">{{ item.value }} :</span>
|
||||||
|
<ele-tag
|
||||||
|
shape="round"
|
||||||
|
size="small"
|
||||||
|
v-for="(sub, subIndex) in item.detail"
|
||||||
|
:key="subIndex"
|
||||||
|
>
|
||||||
|
{{ sub }}
|
||||||
|
</ele-tag>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</a-space>
|
||||||
|
</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>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="column.key === 'action'">
|
<template v-if="column.key === 'action'">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a @click="openSpecValue(record)">规格值</a>
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a @click="moveUp(record)">上移<ArrowUpOutlined /></a>
|
|
||||||
<a-divider type="vertical" />
|
|
||||||
<a @click="openEdit(record)">修改</a>
|
<a @click="openEdit(record)">修改</a>
|
||||||
<a-divider type="vertical" />
|
<a-divider type="vertical" />
|
||||||
<a-popconfirm
|
<a-popconfirm
|
||||||
@@ -47,13 +63,6 @@
|
|||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<SpecEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<SpecEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||||
|
|
||||||
<!-- 规则值弹窗 -->
|
|
||||||
<SpecValueEdit
|
|
||||||
v-model:visible="showSpecValueEdit"
|
|
||||||
:data="current"
|
|
||||||
@done="reload"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -61,25 +70,17 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { createVNode, ref } from 'vue';
|
import { createVNode, ref } from 'vue';
|
||||||
import { message, Modal } from 'ant-design-vue';
|
import { message, Modal } from 'ant-design-vue';
|
||||||
import {
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||||
ArrowUpOutlined,
|
|
||||||
ExclamationCircleOutlined
|
|
||||||
} from '@ant-design/icons-vue';
|
|
||||||
import type { EleProTable } from 'ele-admin-pro';
|
import type { EleProTable } from 'ele-admin-pro';
|
||||||
|
import { toDateString } from 'ele-admin-pro';
|
||||||
import type {
|
import type {
|
||||||
DatasourceFunction,
|
DatasourceFunction,
|
||||||
ColumnItem
|
ColumnItem
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import SpecEdit from './components/specEdit.vue';
|
import SpecEdit from './components/specEdit.vue';
|
||||||
import {
|
import { pageSpec, removeSpec, removeBatchSpec } from '@/api/shop/spec';
|
||||||
pageSpec,
|
|
||||||
removeSpec,
|
|
||||||
removeBatchSpec,
|
|
||||||
updateSpec
|
|
||||||
} from '@/api/shop/spec';
|
|
||||||
import type { Spec, SpecParam } from '@/api/shop/spec/model';
|
import type { Spec, SpecParam } from '@/api/shop/spec/model';
|
||||||
import SpecValueEdit from '../specValue/index.vue';
|
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -90,8 +91,6 @@
|
|||||||
const current = ref<Spec | null>(null);
|
const current = ref<Spec | null>(null);
|
||||||
// 是否显示编辑弹窗
|
// 是否显示编辑弹窗
|
||||||
const showEdit = ref(false);
|
const showEdit = ref(false);
|
||||||
// 是否显示规格值弹窗
|
|
||||||
const showSpecValueEdit = ref(false);
|
|
||||||
// 是否显示批量移动弹窗
|
// 是否显示批量移动弹窗
|
||||||
const showMove = ref(false);
|
const showMove = ref(false);
|
||||||
// 加载状态
|
// 加载状态
|
||||||
@@ -120,24 +119,49 @@
|
|||||||
const columns = ref<ColumnItem[]>([
|
const columns = ref<ColumnItem[]>([
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: 'ID',
|
||||||
width: 90,
|
dataIndex: 'specId',
|
||||||
dataIndex: 'specId'
|
key: 'specId',
|
||||||
|
align: 'center',
|
||||||
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '规格名称',
|
title: '规格名称',
|
||||||
dataIndex: 'specName',
|
dataIndex: 'specName',
|
||||||
width: 240,
|
key: 'specName',
|
||||||
key: 'specName'
|
align: 'center'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '规格值',
|
||||||
|
dataIndex: 'specValue',
|
||||||
|
key: 'specValue'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
dataIndex: 'comments',
|
dataIndex: 'comments',
|
||||||
key: 'comments'
|
key: 'comments',
|
||||||
|
align: 'center',
|
||||||
|
hideInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
key: 'status',
|
||||||
|
align: 'center',
|
||||||
|
hideInTable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
dataIndex: 'createTime',
|
||||||
|
key: 'createTime',
|
||||||
|
align: 'center',
|
||||||
|
sorter: true,
|
||||||
|
ellipsis: true,
|
||||||
|
customRender: ({ text }) => toDateString(text, 'yyyy-MM-dd')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
width: 280,
|
width: 180,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
hideInSetting: true
|
hideInSetting: true
|
||||||
@@ -156,11 +180,6 @@
|
|||||||
showEdit.value = true;
|
showEdit.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
const openSpecValue = (row?: Spec) => {
|
|
||||||
current.value = row ?? null;
|
|
||||||
showSpecValueEdit.value = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 打开批量移动弹窗 */
|
/* 打开批量移动弹窗 */
|
||||||
const openMove = () => {
|
const openMove = () => {
|
||||||
showMove.value = true;
|
showMove.value = true;
|
||||||
@@ -208,17 +227,6 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// 上移
|
|
||||||
const moveUp = (row?: Spec) => {
|
|
||||||
updateSpec({
|
|
||||||
specId: row?.specId,
|
|
||||||
sortNumber: Number(row?.sortNumber) - 1
|
|
||||||
}).then((msg) => {
|
|
||||||
message.success(msg);
|
|
||||||
reload();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/* 查询 */
|
/* 查询 */
|
||||||
const query = () => {
|
const query = () => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
@@ -233,11 +241,10 @@
|
|||||||
},
|
},
|
||||||
// 行双击事件
|
// 行双击事件
|
||||||
onDblclick: () => {
|
onDblclick: () => {
|
||||||
openSpecValue(record);
|
openEdit(record);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
query();
|
query();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,11 @@
|
|||||||
</a-card>
|
</a-card>
|
||||||
|
|
||||||
<!-- 编辑弹窗 -->
|
<!-- 编辑弹窗 -->
|
||||||
<WechatDepositEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
<WechatDepositEdit
|
||||||
|
v-model:visible="showEdit"
|
||||||
|
:data="current"
|
||||||
|
@done="reload"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -62,8 +66,15 @@
|
|||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import Search from './components/search.vue';
|
import Search from './components/search.vue';
|
||||||
import WechatDepositEdit from './components/wechatDepositEdit.vue';
|
import WechatDepositEdit from './components/wechatDepositEdit.vue';
|
||||||
import { pageWechatDeposit, removeWechatDeposit, removeBatchWechatDeposit } from '@/api/shop/wechatDeposit';
|
import {
|
||||||
import type { WechatDeposit, WechatDepositParam } from '@/api/shop/wechatDeposit/model';
|
pageWechatDeposit,
|
||||||
|
removeWechatDeposit,
|
||||||
|
removeBatchWechatDeposit
|
||||||
|
} from '@/api/shop/wechatDeposit';
|
||||||
|
import type {
|
||||||
|
WechatDeposit,
|
||||||
|
WechatDepositParam
|
||||||
|
} from '@/api/shop/wechatDeposit/model';
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -105,73 +116,73 @@
|
|||||||
dataIndex: 'id',
|
dataIndex: 'id',
|
||||||
key: 'id',
|
key: 'id',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 90,
|
width: 90
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '订单id',
|
title: '订单id',
|
||||||
dataIndex: 'oid',
|
dataIndex: 'oid',
|
||||||
key: 'oid',
|
key: 'oid',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '用户id',
|
title: '用户id',
|
||||||
dataIndex: 'uid',
|
dataIndex: 'uid',
|
||||||
key: 'uid',
|
key: 'uid',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '场地订单号',
|
title: '场地订单号',
|
||||||
dataIndex: 'orderNum',
|
dataIndex: 'orderNum',
|
||||||
key: 'orderNum',
|
key: 'orderNum',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '付款订单号',
|
title: '付款订单号',
|
||||||
dataIndex: 'wechatOrder',
|
dataIndex: 'wechatOrder',
|
||||||
key: 'wechatOrder',
|
key: 'wechatOrder',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '退款订单号 ',
|
title: '退款订单号 ',
|
||||||
dataIndex: 'wechatReturn',
|
dataIndex: 'wechatReturn',
|
||||||
key: 'wechatReturn',
|
key: 'wechatReturn',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '场馆名称',
|
title: '场馆名称',
|
||||||
dataIndex: 'siteName',
|
dataIndex: 'siteName',
|
||||||
key: 'siteName',
|
key: 'siteName',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '微信昵称',
|
title: '微信昵称',
|
||||||
dataIndex: 'username',
|
dataIndex: 'username',
|
||||||
key: 'username',
|
key: 'username',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '手机号码',
|
title: '手机号码',
|
||||||
dataIndex: 'phone',
|
dataIndex: 'phone',
|
||||||
key: 'phone',
|
key: 'phone',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '物品名称',
|
title: '物品名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
key: 'name',
|
key: 'name',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '押金金额',
|
title: '押金金额',
|
||||||
dataIndex: 'price',
|
dataIndex: 'price',
|
||||||
key: 'price',
|
key: 'price',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '押金状态,1已付款,2未付款,已退押金',
|
title: '押金状态,1已付款,2未付款,已退押金',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
align: 'center',
|
align: 'center'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '',
|
title: '',
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
class="monitor-card-tabs"
|
class="monitor-card-tabs"
|
||||||
@change="onSaleTypeChange"
|
@change="onSaleTypeChange"
|
||||||
>
|
>
|
||||||
<a-tab-pane tab="销售额" key="saleroom" />
|
<a-tab-pane tab="商品销售排行(全门店)" key="saleroom" />
|
||||||
|
<a-tab-pane tab="用户消费排行(全门店)" />
|
||||||
<template #rightExtra>
|
<template #rightExtra>
|
||||||
<a-space
|
<a-space
|
||||||
size="middle"
|
size="middle"
|
||||||
|
|||||||
@@ -8,22 +8,15 @@
|
|||||||
<div class="ele-text-secondary ele-cell">
|
<div class="ele-text-secondary ele-cell">
|
||||||
<div class="ele-cell-content">总销售额</div>
|
<div class="ele-cell-content">总销售额</div>
|
||||||
<a-tooltip title="指标说明">
|
<a-tooltip title="指标说明">
|
||||||
<question-circle-outlined />
|
<ele-tag color="green">全门店</ele-tag>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</div>
|
</div>
|
||||||
<h1 class="analysis-chart-card-num">¥ 126,560</h1>
|
<h1 class="analysis-chart-card-num">¥ 126,560</h1>
|
||||||
<div class="analysis-chart-card-content" style="padding-top: 16px">
|
|
||||||
<a-space size="middle">
|
|
||||||
<span class="analysis-trend-text">
|
|
||||||
周同比12% <caret-up-outlined class="ele-text-danger" />
|
|
||||||
</span>
|
|
||||||
<span class="analysis-trend-text">
|
|
||||||
日同比11% <caret-down-outlined class="ele-text-success" />
|
|
||||||
</span>
|
|
||||||
</a-space>
|
|
||||||
</div>
|
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<div>日销售额 ¥12,423</div>
|
<div class="flex justify-between">
|
||||||
|
<span>本月订单数</span>
|
||||||
|
<span>6,234单</span>
|
||||||
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col
|
<a-col
|
||||||
@@ -31,17 +24,15 @@
|
|||||||
>
|
>
|
||||||
<a-card class="analysis-chart-card" :bordered="false">
|
<a-card class="analysis-chart-card" :bordered="false">
|
||||||
<div class="ele-text-secondary ele-cell">
|
<div class="ele-text-secondary ele-cell">
|
||||||
<div class="ele-cell-content">访问量</div>
|
<div class="ele-cell-content">订单总数</div>
|
||||||
<ele-tag color="red">日</ele-tag>
|
<ele-tag color="green">全门店</ele-tag>
|
||||||
</div>
|
</div>
|
||||||
<h1 class="analysis-chart-card-num">8,846</h1>
|
<h1 class="analysis-chart-card-num">8,846</h1>
|
||||||
<v-chart
|
|
||||||
ref="visitChartRef"
|
|
||||||
:option="visitChartOption"
|
|
||||||
style="height: 40px"
|
|
||||||
/>
|
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<div>日访问量 1,234</div>
|
<div class="flex justify-between">
|
||||||
|
<span>昨日订单数</span>
|
||||||
|
<span>634单</span>
|
||||||
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col
|
<a-col
|
||||||
@@ -49,17 +40,15 @@
|
|||||||
>
|
>
|
||||||
<a-card class="analysis-chart-card" :bordered="false">
|
<a-card class="analysis-chart-card" :bordered="false">
|
||||||
<div class="ele-text-secondary ele-cell">
|
<div class="ele-text-secondary ele-cell">
|
||||||
<div class="ele-cell-content">支付笔数</div>
|
<div class="ele-cell-content">会员总数</div>
|
||||||
<ele-tag color="blue">月</ele-tag>
|
<ele-tag color="blue">全门店</ele-tag>
|
||||||
</div>
|
</div>
|
||||||
<h1 class="analysis-chart-card-num">6,560</h1>
|
<h1 class="analysis-chart-card-num">16,560</h1>
|
||||||
<v-chart
|
|
||||||
ref="payNumChartRef"
|
|
||||||
:option="payNumChartOption"
|
|
||||||
style="height: 40px"
|
|
||||||
/>
|
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<div>转化率 60%</div>
|
<div class="flex justify-between">
|
||||||
|
<span>今日订单数</span>
|
||||||
|
<span>1单</span>
|
||||||
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col
|
<a-col
|
||||||
@@ -67,27 +56,17 @@
|
|||||||
>
|
>
|
||||||
<a-card class="analysis-chart-card" :bordered="false">
|
<a-card class="analysis-chart-card" :bordered="false">
|
||||||
<div class="ele-text-secondary ele-cell">
|
<div class="ele-text-secondary ele-cell">
|
||||||
<div class="ele-cell-content">活动运营效果</div>
|
<div class="ele-cell-content">商品总数</div>
|
||||||
<ele-tag color="green">周</ele-tag>
|
<ele-tag color="green">全门店</ele-tag>
|
||||||
</div>
|
|
||||||
<h1 class="analysis-chart-card-num">78%</h1>
|
|
||||||
<div class="analysis-chart-card-content" style="padding-top: 16px">
|
|
||||||
<a-progress
|
|
||||||
:percent="78"
|
|
||||||
:show-info="false"
|
|
||||||
stroke-color="#13c2c2"
|
|
||||||
status="active"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
|
<h1 class="analysis-chart-card-num">78</h1>
|
||||||
|
<!-- <div class="analysis-chart-card-content" style="padding-top: 16px">-->
|
||||||
|
<!-- </div>-->
|
||||||
<a-divider />
|
<a-divider />
|
||||||
<a-space size="middle">
|
<div class="flex justify-between">
|
||||||
<span class="analysis-trend-text">
|
<span>今日订单数</span>
|
||||||
周同比12% <caret-up-outlined class="ele-text-danger" />
|
<span>1单</span>
|
||||||
</span>
|
</div>
|
||||||
<span class="analysis-trend-text">
|
|
||||||
日同比11% <caret-down-outlined class="ele-text-success" />
|
|
||||||
</span>
|
|
||||||
</a-space>
|
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|||||||
@@ -393,7 +393,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&:hover:after {
|
&:hover:after {
|
||||||
background-color: rgba(0, 0, 0, 0.4);
|
background-color: rgb(228, 255, 215);
|
||||||
}
|
}
|
||||||
|
|
||||||
& + h1 {
|
& + h1 {
|
||||||
|
|||||||
Reference in New Issue
Block a user