Compare commits

..

2 Commits

Author SHA1 Message Date
3be4a42fe8 新增:批量导入商品功能 2025-12-31 09:55:31 +08:00
f4e6705f3f 新增:批量导入商品功能 2025-12-30 17:18:20 +08:00
794 changed files with 24650 additions and 13908 deletions

View File

@@ -1,7 +1,8 @@
VITE_APP_NAME=后台管理系统 VITE_APP_NAME=后台管理系统
VITE_SOCKET_URL=wss://shop-server-api.ggsxiangan.com VITE_SOCKET_URL=wss://shop-server-api.ggsxiangan.com
VITE_THINK_URL=https://server.websoft.top/api VITE_THINK_URL=https://server.websoft.top/api
#VITE_API_URL=https://shop-api.ggsxiangan.com/api #VITE_API_URL=https://clinic-api.websoft.top/api
#VITE_API_URL=/api
VITE_API_URL=http://127.0.0.1:9013/api VITE_API_URL=http://127.0.0.1:9013/api
VITE_SERVER_URL=https://server.websoft.top/api VITE_SERVER_URL=https://server.websoft.top/api

View File

@@ -0,0 +1,34 @@
# 仅在你必须跨域直连接口(不做同源反代)时使用:
# 将以下内容放到 clinic-api.websoft.top 的 nginx server{} / location{} 中。
#
# 注意:
# - 建议把 allow-origin 固定到你的前端域名,避免使用 *。
# - 如果你使用 cookiewithCredentials还需要加 Access-Control-Allow-Credentials: true
# 并且 allow-origin 不能是 *。
location /api/ {
# 预检请求
if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Origin https://clinic.websoft.top always;
add_header Access-Control-Allow-Methods "GET,POST,PUT,DELETE,PATCH,OPTIONS" always;
add_header Access-Control-Allow-Headers "Authorization,Content-Type,TenantId,X-Requested-With" always;
add_header Access-Control-Max-Age 86400 always;
add_header Content-Length 0;
add_header Content-Type text/plain;
return 204;
}
add_header Access-Control-Allow-Origin https://clinic.websoft.top always;
add_header Access-Control-Expose-Headers Authorization always;
add_header Vary Origin always;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# TODO: 替换为真实 upstream
proxy_pass http://127.0.0.1:9013;
}

View File

@@ -0,0 +1,37 @@
server {
listen 443 ssl;
server_name clinic.websoft.top;
# TODO: 替换为你自己的证书路径
# ssl_certificate /path/to/fullchain.pem;
# ssl_certificate_key /path/to/privkey.pem;
root /home/wwwroot/clinic-admin/dist;
index index.html;
# SPA history
location / {
try_files $uri $uri/ /index.html;
}
# 模块接口(对应 VITE_API_URL=/api、VITE_THINK_URL=/api
location /api/ {
proxy_http_version 1.1;
proxy_set_header Host clinic-api.websoft.top;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass https://clinic-api.websoft.top/api/;
}
# 主接口(对应 VITE_SERVER_URL=/server-api
location /server-api/ {
proxy_http_version 1.1;
proxy_set_header Host server.websoft.top;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass https://server.websoft.top/api/;
}
}

6371
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

7
pnpm-workspace.yaml Normal file
View File

@@ -0,0 +1,7 @@
ignoredBuiltDependencies:
- core-js
- es5-ext
- esbuild
- less
- vue-demi
- vue-echarts

BIN
public/goods-import.xlsx Normal file

Binary file not shown.

View File

@@ -2,7 +2,7 @@ import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { BookingCashier, BookingCashierParam } from './model'; import type { BookingCashier, BookingCashierParam } from './model';
import { MODULES_API_URL } from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
import type { CashierParam, CashierVo } from "@/api/shop/cashier/model"; import type { CashierParam, CashierVo } from '@/api/shop/cashier/model';
/** /**
* 分页查询收银 * 分页查询收银

View File

@@ -79,7 +79,9 @@ export async function removeBookingCooperate(id?: number) {
/** /**
* 批量删除商务合作 * 批量删除商务合作
*/ */
export async function removeBatchBookingCooperate(data: (number | undefined)[]) { export async function removeBatchBookingCooperate(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-cooperate/batch', MODULES_API_URL + '/booking/booking-cooperate/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商务合作留言记录 * 分页查询商务合作留言记录
*/ */
export async function pageBookingCooperateLog(params: BookingCooperateLogParam) { export async function pageBookingCooperateLog(
params: BookingCooperateLogParam
) {
const res = await request.get<ApiResult<PageResult<BookingCooperateLog>>>( const res = await request.get<ApiResult<PageResult<BookingCooperateLog>>>(
MODULES_API_URL + '/booking/booking-cooperate-log/page', MODULES_API_URL + '/booking/booking-cooperate-log/page',
{ {
@@ -22,7 +24,9 @@ export async function pageBookingCooperateLog(params: BookingCooperateLogParam)
/** /**
* 查询商务合作留言记录列表 * 查询商务合作留言记录列表
*/ */
export async function listBookingCooperateLog(params?: BookingCooperateLogParam) { export async function listBookingCooperateLog(
params?: BookingCooperateLogParam
) {
const res = await request.get<ApiResult<BookingCooperateLog[]>>( const res = await request.get<ApiResult<BookingCooperateLog[]>>(
MODULES_API_URL + '/booking/booking-cooperate-log', MODULES_API_URL + '/booking/booking-cooperate-log',
{ {
@@ -79,7 +83,9 @@ export async function removeBookingCooperateLog(id?: number) {
/** /**
* 批量删除商务合作留言记录 * 批量删除商务合作留言记录
*/ */
export async function removeBatchBookingCooperateLog(data: (number | undefined)[]) { export async function removeBatchBookingCooperateLog(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-cooperate-log/batch', MODULES_API_URL + '/booking/booking-cooperate-log/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeBookingEmergency(id?: number) {
/** /**
* 批量删除紧急联系人管理 * 批量删除紧急联系人管理
*/ */
export async function removeBatchBookingEmergency(data: (number | undefined)[]) { export async function removeBatchBookingEmergency(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-emergency/batch', MODULES_API_URL + '/booking/booking-emergency/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeBookingIntegralLog(id?: number) {
/** /**
* 批量删除 * 批量删除
*/ */
export async function removeBatchBookingIntegralLog(data: (number | undefined)[]) { export async function removeBatchBookingIntegralLog(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-integral-log/batch', MODULES_API_URL + '/booking/booking-integral-log/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeBookingOrderInfo(id?: number) {
/** /**
* 批量删除 * 批量删除
*/ */
export async function removeBatchBookingOrderInfo(data: (number | undefined)[]) { export async function removeBatchBookingOrderInfo(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-order-info/batch', MODULES_API_URL + '/booking/booking-order-info/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeBookingUserCoupon(id?: number) {
/** /**
* 批量删除我的优惠券 * 批量删除我的优惠券
*/ */
export async function removeBatchBookingUserCoupon(data: (number | undefined)[]) { export async function removeBatchBookingUserCoupon(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-user-coupon/batch', MODULES_API_URL + '/booking/booking-user-coupon/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询紧急联系人表 * 分页查询紧急联系人表
*/ */
export async function pageBookingUserEmergency(params: BookingUserEmergencyParam) { export async function pageBookingUserEmergency(
params: BookingUserEmergencyParam
) {
const res = await request.get<ApiResult<PageResult<BookingUserEmergency>>>( const res = await request.get<ApiResult<PageResult<BookingUserEmergency>>>(
MODULES_API_URL + '/booking/booking-user-emergency/page', MODULES_API_URL + '/booking/booking-user-emergency/page',
{ {
@@ -22,7 +24,9 @@ export async function pageBookingUserEmergency(params: BookingUserEmergencyParam
/** /**
* 查询紧急联系人表列表 * 查询紧急联系人表列表
*/ */
export async function listBookingUserEmergency(params?: BookingUserEmergencyParam) { export async function listBookingUserEmergency(
params?: BookingUserEmergencyParam
) {
const res = await request.get<ApiResult<BookingUserEmergency[]>>( const res = await request.get<ApiResult<BookingUserEmergency[]>>(
MODULES_API_URL + '/booking/booking-user-emergency', MODULES_API_URL + '/booking/booking-user-emergency',
{ {
@@ -79,7 +83,9 @@ export async function removeBookingUserEmergency(id?: number) {
/** /**
* 批量删除紧急联系人表 * 批量删除紧急联系人表
*/ */
export async function removeBatchBookingUserEmergency(data: (number | undefined)[]) { export async function removeBatchBookingUserEmergency(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-user-emergency/batch', MODULES_API_URL + '/booking/booking-user-emergency/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeBookingUserInvoice(id?: number) {
/** /**
* 批量删除发票 * 批量删除发票
*/ */
export async function removeBatchBookingUserInvoice(data: (number | undefined)[]) { export async function removeBatchBookingUserInvoice(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/booking/booking-user-invoice/batch', MODULES_API_URL + '/booking/booking-user-invoice/batch',
{ {

View File

@@ -1,5 +1,5 @@
import type { PageParam } from '@/api'; import type { PageParam } from '@/api';
import { OrderInfo } from "@/api/shop/orderInfo/model"; import { OrderInfo } from '@/api/shop/orderInfo/model';
/** /**
* 场馆场地 * 场馆场地

View File

@@ -78,7 +78,9 @@ export async function removeClinicAppointment(id?: number) {
/** /**
* 批量删除挂号 * 批量删除挂号
*/ */
export async function removeBatchClinicAppointment(data: (number | undefined)[]) { export async function removeBatchClinicAppointment(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-appointment/batch', '/clinic/clinic-appointment/batch',
{ {

View File

@@ -78,7 +78,9 @@ export async function removeClinicDoctorApply(id?: number) {
/** /**
* 批量删除医生入驻申请 * 批量删除医生入驻申请
*/ */
export async function removeBatchClinicDoctorApply(data: (number | undefined)[]) { export async function removeBatchClinicDoctorApply(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-apply/batch', '/clinic/clinic-doctor-apply/batch',
{ {

View File

@@ -1,17 +1,21 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { ClinicDoctorMedicalRecord, ClinicDoctorMedicalRecordParam } from './model'; import type {
ClinicDoctorMedicalRecord,
ClinicDoctorMedicalRecordParam
} from './model';
/** /**
* 分页查询医疗记录 * 分页查询医疗记录
*/ */
export async function pageClinicDoctorMedicalRecord(params: ClinicDoctorMedicalRecordParam) { export async function pageClinicDoctorMedicalRecord(
const res = await request.get<ApiResult<PageResult<ClinicDoctorMedicalRecord>>>( params: ClinicDoctorMedicalRecordParam
'/clinic/clinic-doctor-medical-record/page', ) {
{ const res = await request.get<
params ApiResult<PageResult<ClinicDoctorMedicalRecord>>
} >('/clinic/clinic-doctor-medical-record/page', {
); params
});
if (res.data.code === 0) { if (res.data.code === 0) {
return res.data.data; return res.data.data;
} }
@@ -21,7 +25,9 @@ export async function pageClinicDoctorMedicalRecord(params: ClinicDoctorMedicalR
/** /**
* 查询医疗记录列表 * 查询医疗记录列表
*/ */
export async function listClinicDoctorMedicalRecord(params?: ClinicDoctorMedicalRecordParam) { export async function listClinicDoctorMedicalRecord(
params?: ClinicDoctorMedicalRecordParam
) {
const res = await request.get<ApiResult<ClinicDoctorMedicalRecord[]>>( const res = await request.get<ApiResult<ClinicDoctorMedicalRecord[]>>(
'/clinic/clinic-doctor-medical-record', '/clinic/clinic-doctor-medical-record',
{ {
@@ -37,7 +43,9 @@ export async function listClinicDoctorMedicalRecord(params?: ClinicDoctorMedical
/** /**
* 添加医疗记录 * 添加医疗记录
*/ */
export async function addClinicDoctorMedicalRecord(data: ClinicDoctorMedicalRecord) { export async function addClinicDoctorMedicalRecord(
data: ClinicDoctorMedicalRecord
) {
const res = await request.post<ApiResult<unknown>>( const res = await request.post<ApiResult<unknown>>(
'/clinic/clinic-doctor-medical-record', '/clinic/clinic-doctor-medical-record',
data data
@@ -51,7 +59,9 @@ export async function addClinicDoctorMedicalRecord(data: ClinicDoctorMedicalReco
/** /**
* 修改医疗记录 * 修改医疗记录
*/ */
export async function updateClinicDoctorMedicalRecord(data: ClinicDoctorMedicalRecord) { export async function updateClinicDoctorMedicalRecord(
data: ClinicDoctorMedicalRecord
) {
const res = await request.put<ApiResult<unknown>>( const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-doctor-medical-record', '/clinic/clinic-doctor-medical-record',
data data
@@ -78,7 +88,9 @@ export async function removeClinicDoctorMedicalRecord(id?: number) {
/** /**
* 批量删除医疗记录 * 批量删除医疗记录
*/ */
export async function removeBatchClinicDoctorMedicalRecord(data: (number | undefined)[]) { export async function removeBatchClinicDoctorMedicalRecord(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-medical-record/batch', '/clinic/clinic-doctor-medical-record/batch',
{ {

View File

@@ -78,7 +78,9 @@ export async function removeClinicDoctorUser(id?: number) {
/** /**
* 批量删除分销商用户记录表 * 批量删除分销商用户记录表
*/ */
export async function removeBatchClinicDoctorUser(data: (number | undefined)[]) { export async function removeBatchClinicDoctorUser(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-doctor-user/batch', '/clinic/clinic-doctor-user/batch',
{ {

View File

@@ -5,7 +5,9 @@ import type { ClinicMedicalHistory, ClinicMedicalHistoryParam } from './model';
/** /**
* 分页查询病例 * 分页查询病例
*/ */
export async function pageClinicMedicalHistory(params: ClinicMedicalHistoryParam) { export async function pageClinicMedicalHistory(
params: ClinicMedicalHistoryParam
) {
const res = await request.get<ApiResult<PageResult<ClinicMedicalHistory>>>( const res = await request.get<ApiResult<PageResult<ClinicMedicalHistory>>>(
'/clinic/clinic-medical-history/page', '/clinic/clinic-medical-history/page',
{ {
@@ -21,7 +23,9 @@ export async function pageClinicMedicalHistory(params: ClinicMedicalHistoryParam
/** /**
* 查询病例列表 * 查询病例列表
*/ */
export async function listClinicMedicalHistory(params?: ClinicMedicalHistoryParam) { export async function listClinicMedicalHistory(
params?: ClinicMedicalHistoryParam
) {
const res = await request.get<ApiResult<ClinicMedicalHistory[]>>( const res = await request.get<ApiResult<ClinicMedicalHistory[]>>(
'/clinic/clinic-medical-history', '/clinic/clinic-medical-history',
{ {
@@ -78,7 +82,9 @@ export async function removeClinicMedicalHistory(id?: number) {
/** /**
* 批量删除病例 * 批量删除病例
*/ */
export async function removeBatchClinicMedicalHistory(data: (number | undefined)[]) { export async function removeBatchClinicMedicalHistory(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medical-history/batch', '/clinic/clinic-medical-history/batch',
{ {

View File

@@ -5,7 +5,9 @@ import type { ClinicMedicineInout, ClinicMedicineInoutParam } from './model';
/** /**
* 分页查询出入库 * 分页查询出入库
*/ */
export async function pageClinicMedicineInout(params: ClinicMedicineInoutParam) { export async function pageClinicMedicineInout(
params: ClinicMedicineInoutParam
) {
const res = await request.get<ApiResult<PageResult<ClinicMedicineInout>>>( const res = await request.get<ApiResult<PageResult<ClinicMedicineInout>>>(
'/clinic/clinic-medicine-inout/page', '/clinic/clinic-medicine-inout/page',
{ {
@@ -21,7 +23,9 @@ export async function pageClinicMedicineInout(params: ClinicMedicineInoutParam)
/** /**
* 查询出入库列表 * 查询出入库列表
*/ */
export async function listClinicMedicineInout(params?: ClinicMedicineInoutParam) { export async function listClinicMedicineInout(
params?: ClinicMedicineInoutParam
) {
const res = await request.get<ApiResult<ClinicMedicineInout[]>>( const res = await request.get<ApiResult<ClinicMedicineInout[]>>(
'/clinic/clinic-medicine-inout', '/clinic/clinic-medicine-inout',
{ {
@@ -78,7 +82,9 @@ export async function removeClinicMedicineInout(id?: number) {
/** /**
* 批量删除出入库 * 批量删除出入库
*/ */
export async function removeBatchClinicMedicineInout(data: (number | undefined)[]) { export async function removeBatchClinicMedicineInout(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medicine-inout/batch', '/clinic/clinic-medicine-inout/batch',
{ {

View File

@@ -5,7 +5,9 @@ import type { ClinicMedicineStock, ClinicMedicineStockParam } from './model';
/** /**
* 分页查询药品库存 * 分页查询药品库存
*/ */
export async function pageClinicMedicineStock(params: ClinicMedicineStockParam) { export async function pageClinicMedicineStock(
params: ClinicMedicineStockParam
) {
const res = await request.get<ApiResult<PageResult<ClinicMedicineStock>>>( const res = await request.get<ApiResult<PageResult<ClinicMedicineStock>>>(
'/clinic/clinic-medicine-stock/page', '/clinic/clinic-medicine-stock/page',
{ {
@@ -21,7 +23,9 @@ export async function pageClinicMedicineStock(params: ClinicMedicineStockParam)
/** /**
* 查询药品库存列表 * 查询药品库存列表
*/ */
export async function listClinicMedicineStock(params?: ClinicMedicineStockParam) { export async function listClinicMedicineStock(
params?: ClinicMedicineStockParam
) {
const res = await request.get<ApiResult<ClinicMedicineStock[]>>( const res = await request.get<ApiResult<ClinicMedicineStock[]>>(
'/clinic/clinic-medicine-stock', '/clinic/clinic-medicine-stock',
{ {
@@ -78,7 +82,9 @@ export async function removeClinicMedicineStock(id?: number) {
/** /**
* 批量删除药品库存 * 批量删除药品库存
*/ */
export async function removeBatchClinicMedicineStock(data: (number | undefined)[]) { export async function removeBatchClinicMedicineStock(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-medicine-stock/batch', '/clinic/clinic-medicine-stock/batch',
{ {

View File

@@ -78,7 +78,9 @@ export async function removeClinicPatientUser(id?: number) {
/** /**
* 批量删除患者 * 批量删除患者
*/ */
export async function removeBatchClinicPatientUser(data: (number | undefined)[]) { export async function removeBatchClinicPatientUser(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-patient-user/batch', '/clinic/clinic-patient-user/batch',
{ {

View File

@@ -84,7 +84,9 @@ export async function removeClinicPrescription(id?: number) {
* 批量删除处方主表 * 批量删除处方主表
*/ */
export async function removeBatchClinicPrescription(data: (number | undefined)[]) { export async function removeBatchClinicPrescription(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-prescription/batch', '/clinic/clinic-prescription/batch',
{ {

View File

@@ -1,12 +1,17 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { ClinicPrescriptionItem, ClinicPrescriptionItemParam } from './model'; import type {
ClinicPrescriptionItem,
ClinicPrescriptionItemParam
} from './model';
/** /**
* 分页查询处方明细表 * 分页查询处方明细表
*/ */
export async function pageClinicPrescriptionItem(params: ClinicPrescriptionItemParam) { export async function pageClinicPrescriptionItem(
params: ClinicPrescriptionItemParam
) {
const res = await request.get<ApiResult<PageResult<ClinicPrescriptionItem>>>( const res = await request.get<ApiResult<PageResult<ClinicPrescriptionItem>>>(
'/clinic/clinic-prescription-item/page', '/clinic/clinic-prescription-item/page',
{ {
@@ -23,7 +28,9 @@ export async function pageClinicPrescriptionItem(params: ClinicPrescriptionItemP
* 查询处方明细表 * 查询处方明细表
列表 列表
*/ */
export async function listClinicPrescriptionItem(params?: ClinicPrescriptionItemParam) { export async function listClinicPrescriptionItem(
params?: ClinicPrescriptionItemParam
) {
const res = await request.get<ApiResult<ClinicPrescriptionItem[]>>( const res = await request.get<ApiResult<ClinicPrescriptionItem[]>>(
'/clinic/clinic-prescription-item', '/clinic/clinic-prescription-item',
{ {
@@ -55,7 +62,9 @@ export async function addClinicPrescriptionItem(data: ClinicPrescriptionItem) {
* 修改处方明细表 * 修改处方明细表
*/ */
export async function updateClinicPrescriptionItem(data: ClinicPrescriptionItem) { export async function updateClinicPrescriptionItem(
data: ClinicPrescriptionItem
) {
const res = await request.put<ApiResult<unknown>>( const res = await request.put<ApiResult<unknown>>(
'/clinic/clinic-prescription-item', '/clinic/clinic-prescription-item',
data data
@@ -84,7 +93,9 @@ export async function removeClinicPrescriptionItem(id?: number) {
* 批量删除处方明细表 * 批量删除处方明细表
*/ */
export async function removeBatchClinicPrescriptionItem(data: (number | undefined)[]) { export async function removeBatchClinicPrescriptionItem(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-prescription-item/batch', '/clinic/clinic-prescription-item/batch',
{ {

View File

@@ -78,7 +78,9 @@ export async function removeClinicVisitRecord(id?: number) {
/** /**
* 批量删除病例 * 批量删除病例
*/ */
export async function removeBatchClinicVisitRecord(data: (number | undefined)[]) { export async function removeBatchClinicVisitRecord(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
'/clinic/clinic-visit-record/batch', '/clinic/clinic-visit-record/batch',
{ {

View File

@@ -85,7 +85,9 @@ export async function removePrescriptionOrder(id?: number) {
* 批量删除处方主表 * 批量删除处方主表
*/ */
export async function removeBatchPrescriptionOrder(data: (number | undefined)[]) { export async function removeBatchPrescriptionOrder(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/clinic/prescription-order/batch', MODULES_API_URL + '/clinic/prescription-order/batch',
{ {

View File

@@ -1,13 +1,18 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { PrescriptionOrderItem, PrescriptionOrderItemParam } from './model'; import type {
PrescriptionOrderItem,
PrescriptionOrderItemParam
} from './model';
import { MODULES_API_URL } from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询处方明细表 * 分页查询处方明细表
*/ */
export async function pagePrescriptionOrderItem(params: PrescriptionOrderItemParam) { export async function pagePrescriptionOrderItem(
params: PrescriptionOrderItemParam
) {
const res = await request.get<ApiResult<PageResult<PrescriptionOrderItem>>>( const res = await request.get<ApiResult<PageResult<PrescriptionOrderItem>>>(
MODULES_API_URL + '/clinic/prescription-order-item/page', MODULES_API_URL + '/clinic/prescription-order-item/page',
{ {
@@ -24,7 +29,9 @@ export async function pagePrescriptionOrderItem(params: PrescriptionOrderItemPar
* 查询处方明细表 * 查询处方明细表
列表 列表
*/ */
export async function listPrescriptionOrderItem(params?: PrescriptionOrderItemParam) { export async function listPrescriptionOrderItem(
params?: PrescriptionOrderItemParam
) {
const res = await request.get<ApiResult<PrescriptionOrderItem[]>>( const res = await request.get<ApiResult<PrescriptionOrderItem[]>>(
MODULES_API_URL + '/clinic/prescription-order-item', MODULES_API_URL + '/clinic/prescription-order-item',
{ {
@@ -85,7 +92,9 @@ export async function removePrescriptionOrderItem(id?: number) {
* 批量删除处方明细表 * 批量删除处方明细表
*/ */
export async function removeBatchPrescriptionOrderItem(data: (number | undefined)[]) { export async function removeBatchPrescriptionOrderItem(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/clinic/prescription-order-item/batch', MODULES_API_URL + '/clinic/prescription-order-item/batch',
{ {

View File

@@ -8,7 +8,7 @@ import { SERVER_API_URL } from '@/config/setting';
*/ */
export async function pageCmsArticleCategory(params: CmsArticleCategoryParam) { export async function pageCmsArticleCategory(params: CmsArticleCategoryParam) {
const res = await request.get<ApiResult<PageResult<CmsArticleCategory>>>( const res = await request.get<ApiResult<PageResult<CmsArticleCategory>>>(
SERVER_API_URL + '/cms/cms-article-category/page', '/cms/cms-article-category/page',
{ {
params params
} }
@@ -24,7 +24,7 @@ export async function pageCmsArticleCategory(params: CmsArticleCategoryParam) {
*/ */
export async function listCmsArticleCategory(params?: CmsArticleCategoryParam) { export async function listCmsArticleCategory(params?: CmsArticleCategoryParam) {
const res = await request.get<ApiResult<CmsArticleCategory[]>>( const res = await request.get<ApiResult<CmsArticleCategory[]>>(
SERVER_API_URL + '/cms/cms-article-category', '/cms/cms-article-category',
{ {
params params
} }

View File

@@ -79,7 +79,9 @@ export async function removeCmsArticleComment(id?: number) {
/** /**
* 批量删除文章评论表 * 批量删除文章评论表
*/ */
export async function removeBatchCmsArticleComment(data: (number | undefined)[]) { export async function removeBatchCmsArticleComment(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/article-comment/batch', MODULES_API_URL + '/cms/article-comment/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeCmsArticleContent(id?: number) {
/** /**
* 批量删除文章记录表 * 批量删除文章记录表
*/ */
export async function removeBatchCmsArticleContent(data: (number | undefined)[]) { export async function removeBatchCmsArticleContent(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/cms-article-content/batch', MODULES_API_URL + '/cms/cms-article-content/batch',
{ {

View File

@@ -1,7 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { CmsNavigation, CmsNavigationParam } from './model'; import type { CmsNavigation, CmsNavigationParam } from './model';
import { SERVER_API_URL } from '@/config/setting';
import type { Navigation, NavigationParam } from '@/api/cms/navigation/model'; import type { Navigation, NavigationParam } from '@/api/cms/navigation/model';
/** /**
@@ -9,7 +8,7 @@ import type { Navigation, NavigationParam } from '@/api/cms/navigation/model';
*/ */
export async function pageCmsNavigation(params: CmsNavigationParam) { export async function pageCmsNavigation(params: CmsNavigationParam) {
const res = await request.get<ApiResult<PageResult<CmsNavigation>>>( const res = await request.get<ApiResult<PageResult<CmsNavigation>>>(
SERVER_API_URL + '/cms/cms-navigation/page', 'https://cms-api.websoft.top/api/cms/cms-navigation/page',
{ {
params params
} }
@@ -25,7 +24,7 @@ export async function pageCmsNavigation(params: CmsNavigationParam) {
*/ */
export async function listCmsNavigation(params?: CmsNavigationParam) { export async function listCmsNavigation(params?: CmsNavigationParam) {
const res = await request.get<ApiResult<CmsNavigation[]>>( const res = await request.get<ApiResult<CmsNavigation[]>>(
SERVER_API_URL + '/cms/cms-navigation', 'https://cms-api.websoft.top/api/cms/cms-navigation',
{ {
params params
} }
@@ -41,7 +40,7 @@ export async function listCmsNavigation(params?: CmsNavigationParam) {
*/ */
export async function treeNavigation(params?: NavigationParam) { export async function treeNavigation(params?: NavigationParam) {
const res = await request.get<ApiResult<Navigation[]>>( const res = await request.get<ApiResult<Navigation[]>>(
SERVER_API_URL + '/cms/cms-navigation/tree', 'https://cms-api.websoft.top/api/cms/cms-navigation/tree',
{ {
params params
} }
@@ -56,7 +55,7 @@ export async function treeNavigation(params?: NavigationParam) {
*/ */
export async function addCmsNavigation(data: CmsNavigation) { export async function addCmsNavigation(data: CmsNavigation) {
const res = await request.post<ApiResult<unknown>>( const res = await request.post<ApiResult<unknown>>(
SERVER_API_URL + '/cms/cms-navigation', 'https://cms-api.websoft.top/api/cms/cms-navigation',
data data
); );
if (res.data.code === 0) { if (res.data.code === 0) {
@@ -70,7 +69,7 @@ export async function addCmsNavigation(data: CmsNavigation) {
*/ */
export async function updateCmsNavigation(data: CmsNavigation) { export async function updateCmsNavigation(data: CmsNavigation) {
const res = await request.put<ApiResult<unknown>>( const res = await request.put<ApiResult<unknown>>(
SERVER_API_URL + '/cms/cms-navigation', 'https://cms-api.websoft.top/api/cms/cms-navigation',
data data
); );
if (res.data.code === 0) { if (res.data.code === 0) {
@@ -84,7 +83,7 @@ export async function updateCmsNavigation(data: CmsNavigation) {
*/ */
export async function removeCmsNavigation(id?: number) { export async function removeCmsNavigation(id?: number) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
SERVER_API_URL + '/cms/cms-navigation/' + id '/cms/cms-navigation/' + id
); );
if (res.data.code === 0) { if (res.data.code === 0) {
return res.data.message; return res.data.message;
@@ -97,7 +96,7 @@ export async function removeCmsNavigation(id?: number) {
*/ */
export async function removeBatchCmsNavigation(data: (number | undefined)[]) { export async function removeBatchCmsNavigation(data: (number | undefined)[]) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
SERVER_API_URL + '/cms/cms-navigation/batch', 'https://cms-api.websoft.top/api/cms/cms-navigation/batch',
{ {
data data
} }
@@ -113,7 +112,7 @@ export async function removeBatchCmsNavigation(data: (number | undefined)[]) {
*/ */
export async function getCmsNavigation(id: number) { export async function getCmsNavigation(id: number) {
const res = await request.get<ApiResult<CmsNavigation>>( const res = await request.get<ApiResult<CmsNavigation>>(
SERVER_API_URL + '/cms/cms-navigation/' + id 'https://cms-api.websoft.top/api/cms/cms-navigation/' + 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;

View File

@@ -2,7 +2,7 @@ import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { CmsProduct, CmsProductParam } from './model'; import type { CmsProduct, CmsProductParam } from './model';
import { SERVER_API_URL } from '@/config/setting'; import { SERVER_API_URL } from '@/config/setting';
import type { ArticleParam } from "@/api/cms/article/model"; import type { ArticleParam } from '@/api/cms/article/model';
/** /**
* 分页查询产品 * 分页查询产品

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询规格值 * 分页查询规格值
*/ */
export async function pageCmsProductSpecValue(params: CmsProductSpecValueParam) { export async function pageCmsProductSpecValue(
params: CmsProductSpecValueParam
) {
const res = await request.get<ApiResult<PageResult<CmsProductSpecValue>>>( const res = await request.get<ApiResult<PageResult<CmsProductSpecValue>>>(
MODULES_API_URL + '/cms/cms-product-spec-value/page', MODULES_API_URL + '/cms/cms-product-spec-value/page',
{ {
@@ -22,7 +24,9 @@ export async function pageCmsProductSpecValue(params: CmsProductSpecValueParam)
/** /**
* 查询规格值列表 * 查询规格值列表
*/ */
export async function listCmsProductSpecValue(params?: CmsProductSpecValueParam) { export async function listCmsProductSpecValue(
params?: CmsProductSpecValueParam
) {
const res = await request.get<ApiResult<CmsProductSpecValue[]>>( const res = await request.get<ApiResult<CmsProductSpecValue[]>>(
MODULES_API_URL + '/cms/cms-product-spec-value', MODULES_API_URL + '/cms/cms-product-spec-value',
{ {
@@ -79,7 +83,9 @@ export async function removeCmsProductSpecValue(id?: number) {
/** /**
* 批量删除规格值 * 批量删除规格值
*/ */
export async function removeBatchCmsProductSpecValue(data: (number | undefined)[]) { export async function removeBatchCmsProductSpecValue(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/cms/cms-product-spec-value/batch', MODULES_API_URL + '/cms/cms-product-spec-value/batch',
{ {

View File

@@ -1,4 +1,4 @@
import type {PageParam} from '@/api'; import type { PageParam } from '@/api';
/** /**
* 设计征集报名 * 设计征集报名

View File

@@ -111,7 +111,10 @@ export async function removeBatchNavigation(data: (number | undefined)[]) {
/** /**
* 修改用户状态 * 修改用户状态
*/ */
export async function updateNavigationStatus(navigationId?: number, status?: number) { export async function updateNavigationStatus(
navigationId?: number,
status?: number
) {
const res = await request.put<ApiResult<unknown>>( const res = await request.put<ApiResult<unknown>>(
MODULES_API_URL + '/cms/navigation/status', MODULES_API_URL + '/cms/navigation/status',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopDealerCapital(id?: number) {
/** /**
* 批量删除分销商资金明细表 * 批量删除分销商资金明细表
*/ */
export async function removeBatchShopDealerCapital(data: (number | undefined)[]) { export async function removeBatchShopDealerCapital(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-dealer-capital/batch', MODULES_API_URL + '/mall/shop-dealer-capital/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopDealerReferee(id?: number) {
/** /**
* 批量删除分销商推荐关系表 * 批量删除分销商推荐关系表
*/ */
export async function removeBatchShopDealerReferee(data: (number | undefined)[]) { export async function removeBatchShopDealerReferee(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-dealer-referee/batch', MODULES_API_URL + '/mall/shop-dealer-referee/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopDealerSetting(id?: number) {
/** /**
* 批量删除分销商设置表 * 批量删除分销商设置表
*/ */
export async function removeBatchShopDealerSetting(data: (number | undefined)[]) { export async function removeBatchShopDealerSetting(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-dealer-setting/batch', MODULES_API_URL + '/mall/shop-dealer-setting/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopDealerWithdraw(id?: number) {
/** /**
* 批量删除分销商提现明细表 * 批量删除分销商提现明细表
*/ */
export async function removeBatchShopDealerWithdraw(data: (number | undefined)[]) { export async function removeBatchShopDealerWithdraw(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-dealer-withdraw/batch', MODULES_API_URL + '/mall/shop-dealer-withdraw/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopGoodsCategory(id?: number) {
/** /**
* 批量删除商品分类 * 批量删除商品分类
*/ */
export async function removeBatchShopGoodsCategory(data: (number | undefined)[]) { export async function removeBatchShopGoodsCategory(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-goods-category/batch', MODULES_API_URL + '/mall/shop-goods-category/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopGoodsComment(id?: number) {
/** /**
* 批量删除评论表 * 批量删除评论表
*/ */
export async function removeBatchShopGoodsComment(data: (number | undefined)[]) { export async function removeBatchShopGoodsComment(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-goods-comment/batch', MODULES_API_URL + '/mall/shop-goods-comment/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopGoodsRelation(id?: number) {
/** /**
* 批量删除商品点赞和收藏表 * 批量删除商品点赞和收藏表
*/ */
export async function removeBatchShopGoodsRelation(data: (number | undefined)[]) { export async function removeBatchShopGoodsRelation(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-goods-relation/batch', MODULES_API_URL + '/mall/shop-goods-relation/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商户账号 * 分页查询商户账号
*/ */
export async function pageShopMerchantAccount(params: ShopMerchantAccountParam) { export async function pageShopMerchantAccount(
params: ShopMerchantAccountParam
) {
const res = await request.get<ApiResult<PageResult<ShopMerchantAccount>>>( const res = await request.get<ApiResult<PageResult<ShopMerchantAccount>>>(
MODULES_API_URL + '/mall/shop-merchant-account/page', MODULES_API_URL + '/mall/shop-merchant-account/page',
{ {
@@ -22,7 +24,9 @@ export async function pageShopMerchantAccount(params: ShopMerchantAccountParam)
/** /**
* 查询商户账号列表 * 查询商户账号列表
*/ */
export async function listShopMerchantAccount(params?: ShopMerchantAccountParam) { export async function listShopMerchantAccount(
params?: ShopMerchantAccountParam
) {
const res = await request.get<ApiResult<ShopMerchantAccount[]>>( const res = await request.get<ApiResult<ShopMerchantAccount[]>>(
MODULES_API_URL + '/mall/shop-merchant-account', MODULES_API_URL + '/mall/shop-merchant-account',
{ {
@@ -79,7 +83,9 @@ export async function removeShopMerchantAccount(id?: number) {
/** /**
* 批量删除商户账号 * 批量删除商户账号
*/ */
export async function removeBatchShopMerchantAccount(data: (number | undefined)[]) { export async function removeBatchShopMerchantAccount(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-merchant-account/batch', MODULES_API_URL + '/mall/shop-merchant-account/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopMerchantApply(id?: number) {
/** /**
* 批量删除商户入驻申请 * 批量删除商户入驻申请
*/ */
export async function removeBatchShopMerchantApply(data: (number | undefined)[]) { export async function removeBatchShopMerchantApply(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-merchant-apply/batch', MODULES_API_URL + '/mall/shop-merchant-apply/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopMerchantCount(id?: number) {
/** /**
* 批量删除门店销售统计表 * 批量删除门店销售统计表
*/ */
export async function removeBatchShopMerchantCount(data: (number | undefined)[]) { export async function removeBatchShopMerchantCount(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-merchant-count/batch', MODULES_API_URL + '/mall/shop-merchant-count/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopMerchantType(id?: number) {
/** /**
* 批量删除商户类型 * 批量删除商户类型
*/ */
export async function removeBatchShopMerchantType(data: (number | undefined)[]) { export async function removeBatchShopMerchantType(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-merchant-type/batch', MODULES_API_URL + '/mall/shop-merchant-type/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopOrderCartInfo(id?: number) {
/** /**
* 批量删除订单购物详情表 * 批量删除订单购物详情表
*/ */
export async function removeBatchShopOrderCartInfo(data: (number | undefined)[]) { export async function removeBatchShopOrderCartInfo(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-order-cart-info/batch', MODULES_API_URL + '/mall/shop-order-cart-info/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopOrderInfoLog(id?: number) {
/** /**
* 批量删除订单核销 * 批量删除订单核销
*/ */
export async function removeBatchShopOrderInfoLog(data: (number | undefined)[]) { export async function removeBatchShopOrderInfoLog(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-order-info-log/batch', MODULES_API_URL + '/mall/shop-order-info-log/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopUserCollection(id?: number) {
/** /**
* 批量删除我的收藏 * 批量删除我的收藏
*/ */
export async function removeBatchShopUserCollection(data: (number | undefined)[]) { export async function removeBatchShopUserCollection(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-user-collection/batch', MODULES_API_URL + '/mall/shop-user-collection/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeShopWechatDeposit(id?: number) {
/** /**
* 批量删除押金 * 批量删除押金
*/ */
export async function removeBatchShopWechatDeposit(data: (number | undefined)[]) { export async function removeBatchShopWechatDeposit(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/mall/shop-wechat-deposit/batch', MODULES_API_URL + '/mall/shop-wechat-deposit/batch',
{ {

View File

@@ -1,6 +1,6 @@
import type { PageParam } from '@/api'; import type { PageParam } from '@/api';
import type { User } from '@/api/system/user/model'; import type { User } from '@/api/system/user/model';
import {AssetsUser} from "@/api/oa/assets/user/model"; import { AssetsUser } from '@/api/oa/assets/user/model';
/** /**
* 资产 * 资产

View File

@@ -1,13 +1,16 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult } from '@/api'; import type { ApiResult } from '@/api';
import { ChatParam } from '@/api/oa/chatgpt/model'; import { ChatParam } from '@/api/oa/chatgpt/model';
import {MODULES_API_URL} from "@/config/setting"; import { MODULES_API_URL } from '@/config/setting';
/** /**
* 发送 * 发送
*/ */
export async function send(data: ChatParam) { export async function send(data: ChatParam) {
const res = await request.post<ApiResult<unknown>>(MODULES_API_URL + '/open/chat/send', data); const res = await request.post<ApiResult<unknown>>(
MODULES_API_URL + '/open/chat/send',
data
);
if (res.data.code === 0) { if (res.data.code === 0) {
return res.data.data; return res.data.data;
} }

View File

@@ -1,5 +1,5 @@
import type { PageParam } from '@/api'; import type { PageParam } from '@/api';
import {Company} from "@/api/system/company/model"; import { Company } from '@/api/system/company/model';
/** /**
* 产品 * 产品

View File

@@ -179,7 +179,6 @@ export async function getByGroup(groupId: number) {
return Promise.reject(new Error(res.data.message)); return Promise.reject(new Error(res.data.message));
} }
/** /**
* 删除整单 * 删除整单
*/ */

View File

@@ -105,7 +105,6 @@ export async function getDealerWithdraw(id: number) {
return Promise.reject(new Error(res.data.message)); return Promise.reject(new Error(res.data.message));
} }
export async function getDealerWithdrawUnCheckNum() { export async function getDealerWithdrawUnCheckNum() {
const res = await request.get<ApiResult<number>>( const res = await request.get<ApiResult<number>>(
MODULES_API_URL + '/shop/dealer-withdraw/uncheck-num' MODULES_API_URL + '/shop/dealer-withdraw/uncheck-num'

View File

@@ -1,5 +1,5 @@
import type { PageParam } from '@/api'; import type { PageParam } from '@/api';
import {ExpressTemplateDetail} from "@/api/shop/expressTemplateDetail/model"; import { ExpressTemplateDetail } from '@/api/shop/expressTemplateDetail/model';
/** /**
* 运费模板 * 运费模板
@@ -24,7 +24,7 @@ export interface ExpressTemplate {
extraAmount?: number; extraAmount?: number;
firstNum?: number; firstNum?: number;
extraNum?: number; extraNum?: number;
detailList?: ExpressTemplateDetail[] detailList?: ExpressTemplateDetail[];
} }
/** /**

View File

@@ -1,12 +1,17 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { ExpressTemplateDetail, ExpressTemplateDetailParam } from './model'; import type {
ExpressTemplateDetail,
ExpressTemplateDetailParam
} from './model';
import { MODULES_API_URL } from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询运费模板 * 分页查询运费模板
*/ */
export async function pageExpressTemplateDetail(params: ExpressTemplateDetailParam) { export async function pageExpressTemplateDetail(
params: ExpressTemplateDetailParam
) {
const res = await request.get<ApiResult<PageResult<ExpressTemplateDetail>>>( const res = await request.get<ApiResult<PageResult<ExpressTemplateDetail>>>(
MODULES_API_URL + '/shop/express-template-detail/page', MODULES_API_URL + '/shop/express-template-detail/page',
{ {
@@ -22,7 +27,9 @@ export async function pageExpressTemplateDetail(params: ExpressTemplateDetailPar
/** /**
* 查询运费模板列表 * 查询运费模板列表
*/ */
export async function listExpressTemplateDetail(params?: ExpressTemplateDetailParam) { export async function listExpressTemplateDetail(
params?: ExpressTemplateDetailParam
) {
const res = await request.get<ApiResult<ExpressTemplateDetail[]>>( const res = await request.get<ApiResult<ExpressTemplateDetail[]>>(
MODULES_API_URL + '/shop/express-template-detail', MODULES_API_URL + '/shop/express-template-detail',
{ {
@@ -79,7 +86,9 @@ export async function removeExpressTemplateDetail(id?: number) {
/** /**
* 批量删除运费模板 * 批量删除运费模板
*/ */
export async function removeBatchExpressTemplateDetail(data: (number | undefined)[]) { export async function removeBatchExpressTemplateDetail(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/express-template-detail/batch', MODULES_API_URL + '/shop/express-template-detail/batch',
{ {

View File

@@ -1,6 +1,11 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { Goods, GoodsParam } from './model'; import type {
Goods,
GoodsImportExcelParam,
GoodsImportResult,
GoodsParam
} from './model';
import { MODULES_API_URL } from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
export async function getCount(params: GoodsParam) { export async function getCount(params: GoodsParam) {
@@ -114,3 +119,46 @@ export async function getGoods(id: number) {
} }
return Promise.reject(new Error(res.data.message)); return Promise.reject(new Error(res.data.message));
} }
/**
* 批量导入商品(Excel)
*/
export async function importGoodsExcel(params: GoodsImportExcelParam) {
const res = await request.post<ApiResult<GoodsImportResult>>(
MODULES_API_URL + '/shop/goods/import-excel',
{},
{ params }
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
const err: any = new Error(res.data.message);
err.data = res.data.data;
return Promise.reject(err);
}
/**
* 批量导入商品(Excel) - 直接上传文件
*/
export async function importGoodsExcelFile(
file: File,
params: GoodsImportExcelParam
) {
const formData = new FormData();
formData.append('file', file);
Object.entries(params ?? {}).forEach(([key, value]) => {
if (value === undefined || value === null || key === 'path') return;
formData.append(key, String(value));
});
const res = await request.post<ApiResult<GoodsImportResult>>(
MODULES_API_URL + '/shop/goods/import',
formData,
{ params }
);
if (res.data.code === 0 && res.data.data) {
return res.data.data;
}
const err: any = new Error(res.data.message);
err.data = res.data.data;
return Promise.reject(err);
}

View File

@@ -1,7 +1,7 @@
import type { PageParam } from '@/api'; 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';
import {GoodsRoleCommission} from "@/api/shop/goodsRoleCommission/model"; import { GoodsRoleCommission } from '@/api/shop/goodsRoleCommission/model';
export interface GoodsCount { export interface GoodsCount {
totalNum: number; totalNum: number;
@@ -144,3 +144,26 @@ export interface GoodsParam extends PageParam {
stock?: number; stock?: number;
keywords?: string; keywords?: string;
} }
export interface GoodsImportResult {
excelPath?: string;
sheetName?: string;
totalRows: number;
inserted: number;
skippedExists: number;
goods?: Goods[];
}
export interface GoodsImportExcelParam {
path?: string;
sheetName?: string;
skipExisting?: boolean;
createCategory?: boolean;
merchantId?: number;
defaultIsShow?: number;
defaultStock?: number;
/**
* Excel 中未提供轮播图(files)时的默认值(通常为 JSON 字符串,如 "[]"/"[{...}]"
*/
defaultFiles?: string;
}

View File

@@ -79,7 +79,9 @@ export async function removeGoodsDescription(id?: number) {
/** /**
* 批量删除商品描述表 * 批量删除商品描述表
*/ */
export async function removeBatchGoodsDescription(data: (number | undefined)[]) { export async function removeBatchGoodsDescription(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/goods-description/batch', MODULES_API_URL + '/shop/goods-description/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeGoodsIncomeConfig(id?: number) {
/** /**
* 批量删除分润配置 * 批量删除分润配置
*/ */
export async function removeBatchGoodsIncomeConfig(data: (number | undefined)[]) { export async function removeBatchGoodsIncomeConfig(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/goods-income-config/batch', MODULES_API_URL + '/shop/goods-income-config/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商品绑定角色的分润金额 * 分页查询商品绑定角色的分润金额
*/ */
export async function pageGoodsRoleCommission(params: GoodsRoleCommissionParam) { export async function pageGoodsRoleCommission(
params: GoodsRoleCommissionParam
) {
const res = await request.get<ApiResult<PageResult<GoodsRoleCommission>>>( const res = await request.get<ApiResult<PageResult<GoodsRoleCommission>>>(
MODULES_API_URL + '/shop/goods-role-commission/page', MODULES_API_URL + '/shop/goods-role-commission/page',
{ {
@@ -22,7 +24,9 @@ export async function pageGoodsRoleCommission(params: GoodsRoleCommissionParam)
/** /**
* 查询商品绑定角色的分润金额列表 * 查询商品绑定角色的分润金额列表
*/ */
export async function listGoodsRoleCommission(params?: GoodsRoleCommissionParam) { export async function listGoodsRoleCommission(
params?: GoodsRoleCommissionParam
) {
const res = await request.get<ApiResult<GoodsRoleCommission[]>>( const res = await request.get<ApiResult<GoodsRoleCommission[]>>(
MODULES_API_URL + '/shop/goods-role-commission', MODULES_API_URL + '/shop/goods-role-commission',
{ {
@@ -79,7 +83,9 @@ export async function removeGoodsRoleCommission(id?: number) {
/** /**
* 批量删除商品绑定角色的分润金额 * 批量删除商品绑定角色的分润金额
*/ */
export async function removeBatchGoodsRoleCommission(data: (number | undefined)[]) { export async function removeBatchGoodsRoleCommission(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/goods-role-commission/batch', MODULES_API_URL + '/shop/goods-role-commission/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商户商品库存 * 分页查询商户商品库存
*/ */
export async function pageGoodsStockInMerchant(params: GoodsStockInMerchantParam) { export async function pageGoodsStockInMerchant(
params: GoodsStockInMerchantParam
) {
const res = await request.get<ApiResult<PageResult<GoodsStockInMerchant>>>( const res = await request.get<ApiResult<PageResult<GoodsStockInMerchant>>>(
MODULES_API_URL + '/shop/goods-stock-in-merchant/page', MODULES_API_URL + '/shop/goods-stock-in-merchant/page',
{ {
@@ -22,7 +24,9 @@ export async function pageGoodsStockInMerchant(params: GoodsStockInMerchantParam
/** /**
* 查询商户商品库存列表 * 查询商户商品库存列表
*/ */
export async function listGoodsStockInMerchant(params?: GoodsStockInMerchantParam) { export async function listGoodsStockInMerchant(
params?: GoodsStockInMerchantParam
) {
const res = await request.get<ApiResult<GoodsStockInMerchant[]>>( const res = await request.get<ApiResult<GoodsStockInMerchant[]>>(
MODULES_API_URL + '/shop/goods-stock-in-merchant', MODULES_API_URL + '/shop/goods-stock-in-merchant',
{ {
@@ -79,7 +83,9 @@ export async function removeGoodsStockInMerchant(id?: number) {
/** /**
* 批量删除商户商品库存 * 批量删除商户商品库存
*/ */
export async function removeBatchGoodsStockInMerchant(data: (number | undefined)[]) { export async function removeBatchGoodsStockInMerchant(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/goods-stock-in-merchant/batch', MODULES_API_URL + '/shop/goods-stock-in-merchant/batch',
{ {

View File

@@ -1,7 +1,7 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type {ApiResult, PageResult} from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type {Merchant, MerchantParam} from './model'; import type { Merchant, MerchantParam } from './model';
import {MODULES_API_URL} from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商户 * 分页查询商户

View File

@@ -79,7 +79,9 @@ export async function removeMerchantCategory(id?: number) {
/** /**
* 批量删除商家分类 * 批量删除商家分类
*/ */
export async function removeBatchMerchantCategory(data: (number | undefined)[]) { export async function removeBatchMerchantCategory(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/merchant-category/batch', MODULES_API_URL + '/shop/merchant-category/batch',
{ {

View File

@@ -34,7 +34,7 @@ export interface MerchantCategory {
createTime?: string; createTime?: string;
// 修改时间 // 修改时间
updateTime?: string; updateTime?: string;
children?: MerchantCategory[] children?: MerchantCategory[];
} }
/** /**

View File

@@ -1,12 +1,17 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { MerchantChargePackage, MerchantChargePackageParam } from './model'; import type {
MerchantChargePackage,
MerchantChargePackageParam
} from './model';
import { MODULES_API_URL } from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商家充值套餐 * 分页查询商家充值套餐
*/ */
export async function pageMerchantChargePackage(params: MerchantChargePackageParam) { export async function pageMerchantChargePackage(
params: MerchantChargePackageParam
) {
const res = await request.get<ApiResult<PageResult<MerchantChargePackage>>>( const res = await request.get<ApiResult<PageResult<MerchantChargePackage>>>(
MODULES_API_URL + '/shop/merchant-charge-package/page', MODULES_API_URL + '/shop/merchant-charge-package/page',
{ {
@@ -22,7 +27,9 @@ export async function pageMerchantChargePackage(params: MerchantChargePackagePar
/** /**
* 查询商家充值套餐列表 * 查询商家充值套餐列表
*/ */
export async function listMerchantChargePackage(params?: MerchantChargePackageParam) { export async function listMerchantChargePackage(
params?: MerchantChargePackageParam
) {
const res = await request.get<ApiResult<MerchantChargePackage[]>>( const res = await request.get<ApiResult<MerchantChargePackage[]>>(
MODULES_API_URL + '/shop/merchant-charge-package', MODULES_API_URL + '/shop/merchant-charge-package',
{ {
@@ -79,7 +86,9 @@ export async function removeMerchantChargePackage(id?: number) {
/** /**
* 批量删除商家充值套餐 * 批量删除商家充值套餐
*/ */
export async function removeBatchMerchantChargePackage(data: (number | undefined)[]) { export async function removeBatchMerchantChargePackage(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/merchant-charge-package/batch', MODULES_API_URL + '/shop/merchant-charge-package/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商家充值套餐 * 分页查询商家充值套餐
*/ */
export async function pageMerchantGoodsPackage(params: MerchantGoodsPackageParam) { export async function pageMerchantGoodsPackage(
params: MerchantGoodsPackageParam
) {
const res = await request.get<ApiResult<PageResult<MerchantGoodsPackage>>>( const res = await request.get<ApiResult<PageResult<MerchantGoodsPackage>>>(
MODULES_API_URL + '/shop/merchant-goods-package/page', MODULES_API_URL + '/shop/merchant-goods-package/page',
{ {
@@ -22,7 +24,9 @@ export async function pageMerchantGoodsPackage(params: MerchantGoodsPackageParam
/** /**
* 查询商家充值套餐列表 * 查询商家充值套餐列表
*/ */
export async function listMerchantGoodsPackage(params?: MerchantGoodsPackageParam) { export async function listMerchantGoodsPackage(
params?: MerchantGoodsPackageParam
) {
const res = await request.get<ApiResult<MerchantGoodsPackage[]>>( const res = await request.get<ApiResult<MerchantGoodsPackage[]>>(
MODULES_API_URL + '/shop/merchant-goods-package', MODULES_API_URL + '/shop/merchant-goods-package',
{ {
@@ -79,7 +83,9 @@ export async function removeMerchantGoodsPackage(id?: number) {
/** /**
* 批量删除商家充值套餐 * 批量删除商家充值套餐
*/ */
export async function removeBatchMerchantGoodsPackage(data: (number | undefined)[]) { export async function removeBatchMerchantGoodsPackage(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/merchant-goods-package/batch', MODULES_API_URL + '/shop/merchant-goods-package/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeMerchantOfflinePay(id?: number) {
/** /**
* 批量删除商铺线下支付 * 批量删除商铺线下支付
*/ */
export async function removeBatchMerchantOfflinePay(data: (number | undefined)[]) { export async function removeBatchMerchantOfflinePay(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/merchant-offline-pay/batch', MODULES_API_URL + '/shop/merchant-offline-pay/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商家套餐可使用的商品 * 分页查询商家套餐可使用的商品
*/ */
export async function pageMerchantPackageGoods(params: MerchantPackageGoodsParam) { export async function pageMerchantPackageGoods(
params: MerchantPackageGoodsParam
) {
const res = await request.get<ApiResult<PageResult<MerchantPackageGoods>>>( const res = await request.get<ApiResult<PageResult<MerchantPackageGoods>>>(
MODULES_API_URL + '/shop/merchant-package-goods/page', MODULES_API_URL + '/shop/merchant-package-goods/page',
{ {
@@ -22,7 +24,9 @@ export async function pageMerchantPackageGoods(params: MerchantPackageGoodsParam
/** /**
* 查询商家套餐可使用的商品列表 * 查询商家套餐可使用的商品列表
*/ */
export async function listMerchantPackageGoods(params?: MerchantPackageGoodsParam) { export async function listMerchantPackageGoods(
params?: MerchantPackageGoodsParam
) {
const res = await request.get<ApiResult<MerchantPackageGoods[]>>( const res = await request.get<ApiResult<MerchantPackageGoods[]>>(
MODULES_API_URL + '/shop/merchant-package-goods', MODULES_API_URL + '/shop/merchant-package-goods',
{ {
@@ -79,7 +83,9 @@ export async function removeMerchantPackageGoods(id?: number) {
/** /**
* 批量删除商家套餐可使用的商品 * 批量删除商家套餐可使用的商品
*/ */
export async function removeBatchMerchantPackageGoods(data: (number | undefined)[]) { export async function removeBatchMerchantPackageGoods(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/merchant-package-goods/batch', MODULES_API_URL + '/shop/merchant-package-goods/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询商铺播报设备 * 分页查询商铺播报设备
*/ */
export async function pageMerchantVoiceDevice(params: MerchantVoiceDeviceParam) { export async function pageMerchantVoiceDevice(
params: MerchantVoiceDeviceParam
) {
const res = await request.get<ApiResult<PageResult<MerchantVoiceDevice>>>( const res = await request.get<ApiResult<PageResult<MerchantVoiceDevice>>>(
MODULES_API_URL + '/shop/merchant-voice-device/page', MODULES_API_URL + '/shop/merchant-voice-device/page',
{ {
@@ -22,7 +24,9 @@ export async function pageMerchantVoiceDevice(params: MerchantVoiceDeviceParam)
/** /**
* 查询商铺播报设备列表 * 查询商铺播报设备列表
*/ */
export async function listMerchantVoiceDevice(params?: MerchantVoiceDeviceParam) { export async function listMerchantVoiceDevice(
params?: MerchantVoiceDeviceParam
) {
const res = await request.get<ApiResult<MerchantVoiceDevice[]>>( const res = await request.get<ApiResult<MerchantVoiceDevice[]>>(
MODULES_API_URL + '/shop/merchant-voice-device', MODULES_API_URL + '/shop/merchant-voice-device',
{ {
@@ -79,7 +83,9 @@ export async function removeMerchantVoiceDevice(id?: number) {
/** /**
* 批量删除商铺播报设备 * 批量删除商铺播报设备
*/ */
export async function removeBatchMerchantVoiceDevice(data: (number | undefined)[]) { export async function removeBatchMerchantVoiceDevice(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/merchant-voice-device/batch', MODULES_API_URL + '/shop/merchant-voice-device/batch',
{ {

View File

@@ -1,7 +1,7 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type {ApiResult, PageResult} from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type {Order, OrderParam} from './model'; import type { Order, OrderParam } from './model';
import {MODULES_API_URL} from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询 * 分页查询

View File

@@ -1,8 +1,8 @@
import type { PageParam } from '@/api'; import type { PageParam } from '@/api';
import { OrderInfo } from '@/api/shop/orderInfo/model'; import { OrderInfo } from '@/api/shop/orderInfo/model';
import {OrderDelivery} from "@/api/shop/orderDelivery/model"; import { OrderDelivery } from '@/api/shop/orderDelivery/model';
import {OrderGoods} from "@/api/shop/orderGoods/model"; import { OrderGoods } from '@/api/shop/orderGoods/model';
import {Merchant} from "@/api/shop/merchant/model"; import { Merchant } from '@/api/shop/merchant/model';
/** /**
* *
@@ -120,7 +120,7 @@ export interface Order {
merchant?: Merchant; merchant?: Merchant;
orderInfo?: OrderInfo[]; orderInfo?: OrderInfo[];
orderGoods?: OrderGoods[]; orderGoods?: OrderGoods[];
orderDelivery?: OrderDelivery orderDelivery?: OrderDelivery;
} }
/** /**

View File

@@ -1,8 +1,7 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult } from '@/api'; import type { ApiResult } from '@/api';
import { MODULES_API_URL } from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
import {OrderDelivery} from "@/api/shop/orderDelivery/model"; import { OrderDelivery } from '@/api/shop/orderDelivery/model';
/** /**
* 添加 * 添加

View File

@@ -1,5 +1,5 @@
import type { PageParam } from '@/api'; import type { PageParam } from '@/api';
import {Express} from "@/api/shop/express/model"; import { Express } from '@/api/shop/express/model';
/** /**
* *

View File

@@ -1,4 +1,4 @@
import type {PageParam} from '@/api'; import type { PageParam } from '@/api';
/** /**
* 开屏广告 * 开屏广告
@@ -47,4 +47,4 @@ export const SplashJumpType = [
label: '店铺', label: '店铺',
value: 'merchant' value: 'merchant'
} }
] ];

View File

@@ -39,7 +39,6 @@ export interface SwiperParam extends PageParam {
keywords?: string; keywords?: string;
} }
export const SwiperType = [ export const SwiperType = [
{ {
label: '会员商城', label: '会员商城',
@@ -72,12 +71,12 @@ export const SwiperType = [
{ {
label: '招商', label: '招商',
value: '招商' value: '招商'
}, }
] ];
export const SwiperJumpType = [ export const SwiperJumpType = [
{ {
label: '商品', label: '商品',
value: 'goods' value: 'goods'
} }
] ];

View File

@@ -1,12 +1,17 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { UserBalanceInMerchant, UserBalanceInMerchantParam } from './model'; import type {
UserBalanceInMerchant,
UserBalanceInMerchantParam
} from './model';
import { MODULES_API_URL } from '@/config/setting'; import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询用户在商家中的余额 * 分页查询用户在商家中的余额
*/ */
export async function pageUserBalanceInMerchant(params: UserBalanceInMerchantParam) { export async function pageUserBalanceInMerchant(
params: UserBalanceInMerchantParam
) {
const res = await request.get<ApiResult<PageResult<UserBalanceInMerchant>>>( const res = await request.get<ApiResult<PageResult<UserBalanceInMerchant>>>(
MODULES_API_URL + '/shop/user-balance-in-merchant/page', MODULES_API_URL + '/shop/user-balance-in-merchant/page',
{ {
@@ -22,7 +27,9 @@ export async function pageUserBalanceInMerchant(params: UserBalanceInMerchantPar
/** /**
* 查询用户在商家中的余额列表 * 查询用户在商家中的余额列表
*/ */
export async function listUserBalanceInMerchant(params?: UserBalanceInMerchantParam) { export async function listUserBalanceInMerchant(
params?: UserBalanceInMerchantParam
) {
const res = await request.get<ApiResult<UserBalanceInMerchant[]>>( const res = await request.get<ApiResult<UserBalanceInMerchant[]>>(
MODULES_API_URL + '/shop/user-balance-in-merchant', MODULES_API_URL + '/shop/user-balance-in-merchant',
{ {
@@ -79,7 +86,9 @@ export async function removeUserBalanceInMerchant(id?: number) {
/** /**
* 批量删除用户在商家中的余额 * 批量删除用户在商家中的余额
*/ */
export async function removeBatchUserBalanceInMerchant(data: (number | undefined)[]) { export async function removeBatchUserBalanceInMerchant(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/user-balance-in-merchant/batch', MODULES_API_URL + '/shop/user-balance-in-merchant/batch',
{ {

View File

@@ -90,7 +90,9 @@ export async function removeUserCommissionRole(id?: number) {
/** /**
* 批量删除用户绑定分红角色 * 批量删除用户绑定分红角色
*/ */
export async function removeBatchUserCommissionRole(data: (number | undefined)[]) { export async function removeBatchUserCommissionRole(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/user-commission-role/batch', MODULES_API_URL + '/shop/user-commission-role/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { MODULES_API_URL } from '@/config/setting';
/** /**
* 分页查询用户在商家中的代金券 * 分页查询用户在商家中的代金券
*/ */
export async function pageUserGoodsInMerchant(params: UserGoodsInMerchantParam) { export async function pageUserGoodsInMerchant(
params: UserGoodsInMerchantParam
) {
const res = await request.get<ApiResult<PageResult<UserGoodsInMerchant>>>( const res = await request.get<ApiResult<PageResult<UserGoodsInMerchant>>>(
MODULES_API_URL + '/shop/user-goods-in-merchant/page', MODULES_API_URL + '/shop/user-goods-in-merchant/page',
{ {
@@ -22,7 +24,9 @@ export async function pageUserGoodsInMerchant(params: UserGoodsInMerchantParam)
/** /**
* 查询用户在商家中的代金券列表 * 查询用户在商家中的代金券列表
*/ */
export async function listUserGoodsInMerchant(params?: UserGoodsInMerchantParam) { export async function listUserGoodsInMerchant(
params?: UserGoodsInMerchantParam
) {
const res = await request.get<ApiResult<UserGoodsInMerchant[]>>( const res = await request.get<ApiResult<UserGoodsInMerchant[]>>(
MODULES_API_URL + '/shop/user-goods-in-merchant', MODULES_API_URL + '/shop/user-goods-in-merchant',
{ {
@@ -79,7 +83,9 @@ export async function removeUserGoodsInMerchant(id?: number) {
/** /**
* 批量删除用户在商家中的代金券 * 批量删除用户在商家中的代金券
*/ */
export async function removeBatchUserGoodsInMerchant(data: (number | undefined)[]) { export async function removeBatchUserGoodsInMerchant(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/user-goods-in-merchant/batch', MODULES_API_URL + '/shop/user-goods-in-merchant/batch',
{ {

View File

@@ -1,7 +1,7 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { Users, UsersParam } from './model'; import type { Users, UsersParam } from './model';
import {MODULES_API_URL, SERVER_API_URL} from '@/config/setting'; import { MODULES_API_URL, SERVER_API_URL } from '@/config/setting';
/** /**
* 分页查询 * 分页查询

View File

@@ -1,17 +1,18 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type {ApiResult} from '@/api'; import type { ApiResult } from '@/api';
import {Area} from "@/api/system/area/model"; import { Area } from '@/api/system/area/model';
export async function listArea(param: any) { export async function listArea(param: any) {
const res = await request.post<ApiResult<Area[]>>('/common/area/list-by-level', param); const res = await request.post<ApiResult<Area[]>>(
'/common/area/list-by-level',
param
);
if (res.data.code === 0 && res.data.data) { if (res.data.code === 0 && res.data.data) {
return res.data.data; return res.data.data;
} }
return Promise.reject(new Error(res.data.message)); return Promise.reject(new Error(res.data.message));
} }
export async function listCity() { export async function listCity() {
const res = await request.post<ApiResult<Area[]>>('/common/area/city-list'); const res = await request.post<ApiResult<Area[]>>('/common/area/city-list');
if (res.data.code === 0 && res.data.data) { if (res.data.code === 0 && res.data.data) {

View File

@@ -1,8 +1,7 @@
export interface Area { export interface Area {
id?: any, id?: any;
name?: any, name?: any;
fid?: any, fid?: any;
levelId?: any, levelId?: any;
children?: any, children?: any;
} }

View File

@@ -79,7 +79,9 @@ export async function removeChatConversation(id?: number) {
/** /**
* 批量删除聊天消息表 * 批量删除聊天消息表
*/ */
export async function removeBatchChatConversation(data: (number | undefined)[]) { export async function removeBatchChatConversation(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
MODULES_API_URL + '/shop/chat-conversation/batch', MODULES_API_URL + '/shop/chat-conversation/batch',
{ {

View File

@@ -90,7 +90,6 @@ export async function deleteParentMenu(id?: number) {
return Promise.reject(new Error(res.data.message)); return Promise.reject(new Error(res.data.message));
} }
/** /**
* 安装应用 * 安装应用
*/ */

View File

@@ -79,7 +79,9 @@ export async function removeThinkCardEditLog(id?: number) {
/** /**
* 批量删除IC卡编辑日志 * 批量删除IC卡编辑日志
*/ */
export async function removeBatchThinkCardEditLog(data: (number | undefined)[]) { export async function removeBatchThinkCardEditLog(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-card-edit-log/batch', THINK_API_URL + '/think/think-card-edit-log/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeThinkGatePassreord(id?: number) {
/** /**
* 批量删除 * 批量删除
*/ */
export async function removeBatchThinkGatePassreord(data: (number | undefined)[]) { export async function removeBatchThinkGatePassreord(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-gate-passreord/batch', THINK_API_URL + '/think/think-gate-passreord/batch',
{ {

View File

@@ -32,7 +32,6 @@ export interface ThinkGatePassreord {
deleteStatus?: string; deleteStatus?: string;
// //
siteId?: number; siteId?: number;
@TableField("consume_Money")
// 本次消费金额 // 本次消费金额
consumeMoney?: string; consumeMoney?: string;
} }

View File

@@ -79,7 +79,9 @@ export async function removeThinkGoodsCategory(id?: number) {
/** /**
* 批量删除 * 批量删除
*/ */
export async function removeBatchThinkGoodsCategory(data: (number | undefined)[]) { export async function removeBatchThinkGoodsCategory(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-goods-category/batch', THINK_API_URL + '/think/think-goods-category/batch',
{ {

View File

@@ -6,7 +6,9 @@ import { THINK_API_URL } from '@/config/setting';
/** /**
* 分页查询 * 分页查询
*/ */
export async function pageThinkGoodsOrderInfo(params: ThinkGoodsOrderInfoParam) { export async function pageThinkGoodsOrderInfo(
params: ThinkGoodsOrderInfoParam
) {
const res = await request.get<ApiResult<PageResult<ThinkGoodsOrderInfo>>>( const res = await request.get<ApiResult<PageResult<ThinkGoodsOrderInfo>>>(
THINK_API_URL + '/think/think-goods-order-info/page', THINK_API_URL + '/think/think-goods-order-info/page',
{ {
@@ -22,7 +24,9 @@ export async function pageThinkGoodsOrderInfo(params: ThinkGoodsOrderInfoParam)
/** /**
* 查询列表 * 查询列表
*/ */
export async function listThinkGoodsOrderInfo(params?: ThinkGoodsOrderInfoParam) { export async function listThinkGoodsOrderInfo(
params?: ThinkGoodsOrderInfoParam
) {
const res = await request.get<ApiResult<ThinkGoodsOrderInfo[]>>( const res = await request.get<ApiResult<ThinkGoodsOrderInfo[]>>(
THINK_API_URL + '/think/think-goods-order-info', THINK_API_URL + '/think/think-goods-order-info',
{ {
@@ -79,7 +83,9 @@ export async function removeThinkGoodsOrderInfo(id?: number) {
/** /**
* 批量删除 * 批量删除
*/ */
export async function removeBatchThinkGoodsOrderInfo(data: (number | undefined)[]) { export async function removeBatchThinkGoodsOrderInfo(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-goods-order-info/batch', THINK_API_URL + '/think/think-goods-order-info/batch',
{ {

View File

@@ -79,7 +79,9 @@ export async function removeThinkGoodsSpecRel(id?: number) {
/** /**
* 批量删除商品与规格值关系记录表 * 批量删除商品与规格值关系记录表
*/ */
export async function removeBatchThinkGoodsSpecRel(data: (number | undefined)[]) { export async function removeBatchThinkGoodsSpecRel(
data: (number | undefined)[]
) {
const res = await request.delete<ApiResult<unknown>>( const res = await request.delete<ApiResult<unknown>>(
THINK_API_URL + '/think/think-goods-spec-rel/batch', THINK_API_URL + '/think/think-goods-spec-rel/batch',
{ {

View File

@@ -1,7 +1,7 @@
import request from '@/utils/request'; import request from '@/utils/request';
import type { ApiResult, PageResult } from '@/api'; import type { ApiResult, PageResult } from '@/api';
import type { UserReferee, UserRefereeParam } from '@/api/user/referee/model'; import type { UserReferee, UserRefereeParam } from '@/api/user/referee/model';
import {SERVER_API_URL} from "@/config/setting"; import { SERVER_API_URL } from '@/config/setting';
/** /**
* 分页查询推荐关系 * 分页查询推荐关系
*/ */

View File

@@ -239,7 +239,7 @@
const updateColor = (color: string) => { const updateColor = (color: string) => {
item.value.style.background = color; item.value.style.background = color;
emit('done', item); emit('done', item.value);
}; };
const onClick = () => { const onClick = () => {

View File

@@ -154,7 +154,7 @@
const updateColor = (color: string) => { const updateColor = (color: string) => {
item.value.style.background = color; item.value.style.background = color;
emit('done', item); emit('done', item.value);
}; };
const onClick = () => { const onClick = () => {

View File

@@ -50,8 +50,8 @@
</div> </div>
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<a-radio @click="onDone(record)" /> <a-radio @click="onDone(record)" />
<span class="ele-text-secondary">选择</span> <span class="ele-text-secondary">选择</span>
</template> </template>
</template> </template>
</ele-pro-table> </ele-pro-table>

View File

@@ -115,7 +115,7 @@
}; };
const onRadio = (record: Design) => { const onRadio = (record: Design) => {
pageId.value = Number(record.pageId) pageId.value = Number(record.pageId);
updateVisible(false); updateVisible(false);
emit('done', record); emit('done', record);
}; };

View File

@@ -28,7 +28,7 @@
> >
<a-button type="primary" class="ele-btn-icon"> <a-button type="primary" class="ele-btn-icon">
<template #icon> <template #icon>
<UploadOutlined/> <UploadOutlined />
</template> </template>
<span>上传视频</span> <span>上传视频</span>
</a-button> </a-button>
@@ -41,7 +41,7 @@
> >
<a-button type="primary" class="ele-btn-icon"> <a-button type="primary" class="ele-btn-icon">
<template #icon> <template #icon>
<UploadOutlined/> <UploadOutlined />
</template> </template>
<span>上传音频</span> <span>上传音频</span>
</a-button> </a-button>
@@ -54,7 +54,7 @@
> >
<a-button type="primary" class="ele-btn-icon"> <a-button type="primary" class="ele-btn-icon">
<template #icon> <template #icon>
<UploadOutlined/> <UploadOutlined />
</template> </template>
<span>上传文件</span> <span>上传文件</span>
</a-button> </a-button>
@@ -67,7 +67,7 @@
> >
<a-button type="primary" class="ele-btn-icon"> <a-button type="primary" class="ele-btn-icon">
<template #icon> <template #icon>
<UploadOutlined/> <UploadOutlined />
</template> </template>
<span>上传图片</span> <span>上传图片</span>
</a-button> </a-button>
@@ -95,9 +95,8 @@
<a-button <a-button
style="margin-right: 20px" style="margin-right: 20px"
@click="openUrl('/cms/photo/dict')" @click="openUrl('/cms/photo/dict')"
>管理分组 >管理分组
</a-button </a-button>
>
</div> </div>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
@@ -112,8 +111,8 @@
<a-image <a-image
:src="`${record.path}`" :src="`${record.path}`"
:preview="{ :preview="{
src: `${record.downloadUrl}` src: `${record.downloadUrl}`
}" }"
:width="100" :width="100"
/> />
</div> </div>
@@ -129,22 +128,22 @@
<template v-if="column.dataIndex === 'name'"> <template v-if="column.dataIndex === 'name'">
<a-space class="ele-cell" style="display: flex"> <a-space class="ele-cell" style="display: flex">
<span>{{ record.name }}</span> <span>{{ record.name }}</span>
<EditOutlined title="编辑" @click="openEdit(record)"/> <EditOutlined title="编辑" @click="openEdit(record)" />
</a-space> </a-space>
</template> </template>
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
<template v-if="pageId == record.pageId"> <template v-if="pageId == record.pageId">
<a-radio v-model:checked="checked" @click="onRadio(record)"/> <a-radio v-model:checked="checked" @click="onRadio(record)" />
</template> </template>
<template v-else> <template v-else>
<a-space> <a-space>
<lebal> <lebal>
<a-radio @click="onRadio(record)"/> <a-radio @click="onRadio(record)" />
<a class="ele-text-success">选择</a> <a class="ele-text-success">选择</a>
</lebal> </lebal>
<a-divider type="vertical"/> <a-divider type="vertical" />
<a class="ele-text-placeholder">编辑</a> <a class="ele-text-placeholder">编辑</a>
<a-divider type="vertical"/> <a-divider type="vertical" />
<a class="ele-text-placeholder">删除</a> <a class="ele-text-placeholder">删除</a>
</a-space> </a-space>
</template> </template>
@@ -153,244 +152,253 @@
</ele-pro-table> </ele-pro-table>
</ele-modal> </ele-modal>
<!-- 编辑弹窗 --> <!-- 编辑弹窗 -->
<FileRecordEdit v-model:visible="showEdit" :data="current" @done="reload"/> <FileRecordEdit v-model:visible="showEdit" :data="current" @done="reload" />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {ref, watch} from 'vue'; import { ref, watch } from 'vue';
import { import {
ColumnItem, ColumnItem,
DatasourceFunction DatasourceFunction
} from 'ele-admin-pro/es/ele-pro-table/types'; } from 'ele-admin-pro/es/ele-pro-table/types';
import {pageFiles, uploadOss, uploadOssByGroupId} from '@/api/system/file'; import { pageFiles, uploadOss, uploadOssByGroupId } from '@/api/system/file';
import {EleProTable, messageLoading} from 'ele-admin-pro'; import { EleProTable, messageLoading } from 'ele-admin-pro';
import {FileRecord, FileRecordParam} from '@/api/system/file/model'; import { FileRecord, FileRecordParam } from '@/api/system/file/model';
import {EditOutlined, UploadOutlined} from '@ant-design/icons-vue'; import { EditOutlined, UploadOutlined } from '@ant-design/icons-vue';
import {DictData} from '@/api/system/dict-data/model'; import { DictData } from '@/api/system/dict-data/model';
import {pageDictData} from '@/api/system/dict-data'; import { pageDictData } from '@/api/system/dict-data';
import {isImage, openUrl} from '@/utils/common'; import { isImage, openUrl } from '@/utils/common';
import {message} from 'ant-design-vue/es'; import { message } from 'ant-design-vue/es';
import FileRecordEdit from './file-record-edit.vue'; import FileRecordEdit from './file-record-edit.vue';
const props = defineProps<{ const props = defineProps<{
// 弹窗是否打开 // 弹窗是否打开
visible: boolean; visible: boolean;
// 标题 // 标题
title?: string; title?: string;
// 文件类型 // 文件类型
type?: string; type?: string;
// 修改回显的数据 // 修改回显的数据
data?: FileRecord | null; data?: FileRecord | null;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'done', data: FileRecord): void; (e: 'done', data: FileRecord): void;
(e: 'update:visible', visible: boolean): void; (e: 'update:visible', visible: boolean): void;
}>(); }>();
/* 更新visible */ /* 更新visible */
const updateVisible = (value: boolean) => { const updateVisible = (value: boolean) => {
emit('update:visible', value); emit('update:visible', value);
}; };
// 搜索内容 // 搜索内容
const searchText = ref(null); const searchText = ref(null);
const pageId = ref<number>(0); const pageId = ref<number>(0);
const checked = ref<boolean>(true); const checked = ref<boolean>(true);
const groupList = ref<DictData[]>(); const groupList = ref<DictData[]>();
const showEdit = ref<boolean>(false); const showEdit = ref<boolean>(false);
const current = ref<FileRecord | null>(); const current = ref<FileRecord | null>();
const dictDataId = ref<any>(undefined); const dictDataId = ref<any>(undefined);
// 表格实例 // 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null); const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
// 表格配置 // 表格配置
const columns = ref<ColumnItem[]>([ const columns = ref<ColumnItem[]>([
{ {
title: 'ID', title: 'ID',
dataIndex: 'id' dataIndex: 'id'
}, },
{ {
title: '图片', title: '图片',
dataIndex: 'path', dataIndex: 'path',
key: 'path' key: 'path'
}, },
{ {
title: '名称', title: '名称',
dataIndex: 'name', dataIndex: 'name',
key: 'name' key: 'name'
}, },
{ {
title: '大小', title: '大小',
dataIndex: 'length', dataIndex: 'length',
key: 'length', key: 'length',
customRender: ({text}) => { customRender: ({ text }) => {
if (text < 1024) { if (text < 1024) {
return text + 'B'; return text + 'B';
} else if (text < 1024 * 1024) { } else if (text < 1024 * 1024) {
return (text / 1024).toFixed(1) + 'KB'; return (text / 1024).toFixed(1) + 'KB';
} else if (text < 1024 * 1024 * 1024) { } else if (text < 1024 * 1024 * 1024) {
return (text / 1024 / 1024).toFixed(1) + 'M'; return (text / 1024 / 1024).toFixed(1) + 'M';
} else { } else {
return (text / 1024 / 1024 / 1024).toFixed(1) + 'G'; return (text / 1024 / 1024 / 1024).toFixed(1) + 'G';
}
} }
},
{
title: '操作',
key: 'action',
align: 'center'
} }
}, ]);
{
title: '操作',
key: 'action',
align: 'center'
}
]);
// 表格数据源 // 表格数据源
const datasource: DatasourceFunction = ({page, limit, where, orders}) => { const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
where = {}; where = {};
// 搜索条件 // 搜索条件
if (searchText.value) { if (searchText.value) {
where.name = searchText.value; where.name = searchText.value;
}
if (dictDataId.value) {
where.groupId = dictDataId.value;
}
if (props.type) {
let contentTypes = ''
switch (props.type) {
case 'audio' : {
contentTypes = 'audio/mpeg';
}
break;
case 'file' : {
contentTypes = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
}
break;
case 'video' : {
contentTypes = 'video/mp4';
}
break;
default : {
contentTypes = 'image/jpeg,image/png,image/jpg';
}
break;
} }
where.contentTypes = contentTypes; if (dictDataId.value) {
} where.groupId = dictDataId.value;
return pageFiles({ }
...where, if (props.type) {
...orders, let contentTypes = '';
page, switch (props.type) {
limit case 'audio':
}); {
}; contentTypes = 'audio/mpeg';
}
/* 搜索 */ break;
const reload = (where?: FileRecordParam) => { case 'file':
tableRef?.value?.reload({page: 1, where}); {
}; contentTypes =
'application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
const onRadio = (record: FileRecord) => { }
pageId.value = Number(record.id); break;
updateVisible(false); case 'video':
emit('done', record); {
}; contentTypes = 'video/mp4';
}
const getGroupList = () => { break;
pageDictData({dictCode: 'groupId'}).then((res) => { default:
groupList.value = res?.list.map((d) => { {
return { contentTypes = 'image/jpeg,image/png,image/jpg';
label: d.dictDataName, }
value: d.dictDataId break;
}; }
where.contentTypes = contentTypes;
}
return pageFiles({
...where,
...orders,
page,
limit
}); });
}); };
};
const onGroupId = (index: number) => { /* 搜索 */
dictDataId.value = index; const reload = (where?: FileRecordParam) => {
reload(); tableRef?.value?.reload({ page: 1, where });
}; };
// 上传文件 const onRadio = (record: FileRecord) => {
const onUpload = (item) => { pageId.value = Number(record.id);
const {file} = item; updateVisible(false);
if (!file.type.startsWith('image') && props.type && !['video', 'audio', 'file'].includes(props.type)) { emit('done', record);
message.error('只能选择图片'); };
return;
} const getGroupList = () => {
if (props.type == 'video') { pageDictData({ dictCode: 'groupId' }).then((res) => {
if (file.size / 1024 / 1024 > 100) { groupList.value = res?.list.map((d) => {
message.error('大小不能超过 100MB'); return {
return; label: d.dictDataName,
} value: d.dictDataId
} else if (props.type == 'audio') { };
if (file.size / 1024 / 1024 > 20) {
message.error('大小不能超过 20MB');
return;
}
} else {
if (file.size / 1024 / 1024 > 10) {
message.error('大小不能超过 10MB');
return;
}
}
const hide = messageLoading({
content: '上传中..',
duration: 0,
mask: true
});
if (dictDataId.value > 0) {
uploadOssByGroupId(file, dictDataId.value)
.then(() => {
hide();
message.success('上传成功');
reload();
})
.catch((e) => {
message.error(e.message);
hide();
}); });
} else { });
uploadOss(file) };
.then(() => {
hide();
message.success('上传成功');
reload();
})
.catch((e) => {
message.error(e.message);
hide();
});
}
};
const openEdit = (row?: FileRecord) => { const onGroupId = (index: number) => {
current.value = row ?? null; dictDataId.value = index;
showEdit.value = true; reload();
}; };
/* 自定义行属性 */ // 上传文件
const customRow = (record: FileRecord) => { const onUpload = (item) => {
return { const { file } = item;
// 行点击事件 if (
// onClick: () => { !file.type.startsWith('image') &&
// updateVisible(false); props.type &&
// emit('done', record); !['video', 'audio', 'file'].includes(props.type)
// }, ) {
// 行双击事件 message.error('只能选择图片');
onDblclick: () => { return;
updateVisible(false); }
emit('done', record); if (props.type == 'video') {
if (file.size / 1024 / 1024 > 100) {
message.error('大小不能超过 100MB');
return;
}
} else if (props.type == 'audio') {
if (file.size / 1024 / 1024 > 20) {
message.error('大小不能超过 20MB');
return;
}
} else {
if (file.size / 1024 / 1024 > 10) {
message.error('大小不能超过 10MB');
return;
}
}
const hide = messageLoading({
content: '上传中..',
duration: 0,
mask: true
});
if (dictDataId.value > 0) {
uploadOssByGroupId(file, dictDataId.value)
.then(() => {
hide();
message.success('上传成功');
reload();
})
.catch((e) => {
message.error(e.message);
hide();
});
} else {
uploadOss(file)
.then(() => {
hide();
message.success('上传成功');
reload();
})
.catch((e) => {
message.error(e.message);
hide();
});
} }
}; };
};
watch( const openEdit = (row?: FileRecord) => {
() => props.visible, current.value = row ?? null;
(visible) => { showEdit.value = true;
if (visible) { };
getGroupList();
/* 自定义行属性 */
const customRow = (record: FileRecord) => {
return {
// 行点击事件
// onClick: () => {
// updateVisible(false);
// emit('done', record);
// },
// 行双击事件
onDblclick: () => {
updateVisible(false);
emit('done', record);
}
};
};
watch(
() => props.visible,
(visible) => {
if (visible) {
getGroupList();
}
} }
} );
);
</script> </script>

View File

@@ -1,20 +1,37 @@
<template> <template>
<a-space style="display: flex; <a-space
align-items: center; style="
justify-content: flex-start;flex-wrap: wrap"> display: flex;
align-items: center;
justify-content: flex-start;
flex-wrap: wrap;
"
>
<template v-for="(item, index) in data" :key="index"> <template v-for="(item, index) in data" :key="index">
<div v-if="type === 'video' || item.url.includes('.mp4')" class="relative cursor-pointer" @click="open(item.url)"> <div
v-if="type === 'video' || item.url.includes('.mp4')"
class="relative cursor-pointer"
@click="open(item.url)"
>
<img <img
:src="item.url + '?x-oss-process=video/snapshot,t_2000,f_jpg,w_200,h_200'" :src="
item.url + '?x-oss-process=video/snapshot,t_2000,f_jpg,w_200,h_200'
"
style="width: 80px; height: 80px" style="width: 80px; height: 80px"
/> />
<div class="absolute" style="left: 30px; top: 30px"> <div class="absolute" style="left: 30px; top: 30px">
<play-circle-outlined style="font-size: 20px; color:white"/> <play-circle-outlined style="font-size: 20px; color: white" />
</div> </div>
</div> </div>
<a-tag :key="item.url" closable @close="onDeleteItem(index)" <a-tag
@click.native="open(item.url)" style="cursor: pointer" :key="item.url"
v-else-if="type && ['audio', 'file'].includes(type)"> {{ item.url }} closable
@close="onDeleteItem(index)"
@click.native="open(item.url)"
style="cursor: pointer"
v-else-if="type && ['audio', 'file'].includes(type)"
>
{{ item.url }}
</a-tag> </a-tag>
<div class="image-upload-item bg-gray-300" v-else> <div class="image-upload-item bg-gray-300" v-else>
<a-image-preview-group> <a-image-preview-group>
@@ -25,22 +42,18 @@
:src="item.url" :src="item.url"
/> />
<a class="image-upload-close" @click="onDeleteItem(index)"> <a class="image-upload-close" @click="onDeleteItem(index)">
<CloseOutlined/> <CloseOutlined />
</a> </a>
</a-image-preview-group> </a-image-preview-group>
</div> </div>
</template> </template>
<template v-if="type === 'video'"> <template v-if="type === 'video'">
<a-button type="primary" <a-button type="primary" @click="openEdit" v-if="data?.length < limit">
@click="openEdit"
v-if="data?.length < limit">
选择视频 选择视频
</a-button> </a-button>
</template> </template>
<template v-else-if="type === 'audio'"> <template v-else-if="type === 'audio'">
<a-button type="primary" <a-button type="primary" @click="openEdit" v-if="data?.length < limit">
@click="openEdit"
v-if="data?.length < limit">
选择音频 选择音频
</a-button> </a-button>
</template> </template>
@@ -50,7 +63,7 @@
v-if="data?.length < limit || limit === -1" v-if="data?.length < limit || limit === -1"
class="select-picture-btn ele-text-placeholder" class="select-picture-btn ele-text-placeholder"
> >
<PlusOutlined/> <PlusOutlined />
</a-button> </a-button>
</template> </template>
</a-space> </a-space>
@@ -65,100 +78,108 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {PlusOutlined, CloseOutlined, PlayCircleOutlined} from '@ant-design/icons-vue'; import {
import {ref} from 'vue'; PlusOutlined,
import SelectData from './components/select-data.vue'; CloseOutlined,
import {FileRecord} from '@/api/system/file/model'; PlayCircleOutlined
} from '@ant-design/icons-vue';
import { ref } from 'vue';
import SelectData from './components/select-data.vue';
import { FileRecord } from '@/api/system/file/model';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
value?: any; value?: any;
data?: any[]; data?: any[];
width?: number; width?: number;
type?: string; type?: string;
limit?: number; limit?: number;
placeholder?: string; placeholder?: string;
index?: number; index?: number;
}>(), }>(),
{ {
placeholder: '请选择数据', placeholder: '请选择数据',
width: 80, width: 80,
limit: 1 limit: 1
} }
); );
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'done', data: FileRecord): void; (e: 'done', data: FileRecord): void;
(e: 'del', index: number): void; (e: 'del', index: number): void;
(e: 'clear'): void; (e: 'clear'): void;
}>(); }>();
// 是否显示编辑弹窗 // 是否显示编辑弹窗
const showEdit = ref(false); const showEdit = ref(false);
// 当前编辑数据 // 当前编辑数据
const current = ref<FileRecord | null>(null); const current = ref<FileRecord | null>(null);
/* 打开编辑弹窗 */ /* 打开编辑弹窗 */
const openEdit = (row?: FileRecord) => { const openEdit = (row?: FileRecord) => {
current.value = row ?? null; current.value = row ?? null;
showEdit.value = true; showEdit.value = true;
}; };
const onChange = (row) => { const onChange = (row) => {
row.index = props.index; row.index = props.index;
emit('done', row); emit('done', row);
}; };
const onDeleteItem = (index: number) => { const onDeleteItem = (index: number) => {
emit('del', index); emit('del', index);
}; };
const open = (url: string) => { const open = (url: string) => {
if (['docx', 'doc', 'xlsx', 'xls', 'pdf'].includes(url.split('.').pop()!)) { if (['docx', 'doc', 'xlsx', 'xls', 'pdf'].includes(url.split('.').pop()!)) {
window.open(`https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(url)}`); window.open(
} else window.open(url) `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(
} url
)}`
);
} else window.open(url);
};
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.select-picture-btn { .select-picture-btn {
background-color: var(--grey-9); background-color: var(--grey-9);
border: 1px dashed var(--border-color-base); border: 1px dashed var(--border-color-base);
width: 80px; width: 80px;
height: 80px; height: 80px;
font-size: 16px; font-size: 16px;
} }
//.ant-image-img { //.ant-image-img {
// width: 100px !important; // width: 100px !important;
// height: 100px !important; // height: 100px !important;
//} //}
.image-upload-item { .image-upload-item {
position: relative; position: relative;
} }
.image-upload-close { .image-upload-close {
width: 18px; width: 18px;
height: 18px; height: 18px;
color: rgb(255, 255, 255); color: rgb(255, 255, 255);
font-size: 10px; font-size: 10px;
border-bottom-left-radius: 18px; border-bottom-left-radius: 18px;
border-top-right-radius: 2px; border-top-right-radius: 2px;
background: rgba(0, 0, 0, 0.6); background: rgba(0, 0, 0, 0.6);
position: absolute; position: absolute;
top: 1px; top: 1px;
right: 1px; right: 1px;
line-height: 1; line-height: 1;
box-sizing: border-box; box-sizing: border-box;
padding: 2px 0 0 5px; padding: 2px 0 0 5px;
transition: background-color 0.2s ease-in-out 0s; transition: background-color 0.2s ease-in-out 0s;
cursor: pointer; cursor: pointer;
z-index: 2; z-index: 2;
//display: flex; //display: flex;
//justify-content: center; //justify-content: center;
//align-items: center; //align-items: center;
} }
.image-upload-close:hover { .image-upload-close:hover {
background-color: var(--red-6); background-color: var(--red-6);
} }
</style> </style>

Some files were not shown because too many files have changed in this diff Show More