diff --git a/.env.base b/.env.base index a4c87c2..11471c1 100644 --- a/.env.base +++ b/.env.base @@ -8,7 +8,7 @@ VITE_DEV=true VITE_BASE_URL='http://localhost:48080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload' # 接口前缀 VITE_API_BASEPATH=/dev-api diff --git a/.env.dev b/.env.dev index 42a9402..d5db008 100644 --- a/.env.dev +++ b/.env.dev @@ -7,7 +7,7 @@ VITE_DEV=false VITE_BASE_URL='http://localhost:48080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload' # 接口前缀 VITE_API_BASEPATH=/dev-api diff --git a/.env.front b/.env.front index f31cf92..31379fb 100644 --- a/.env.front +++ b/.env.front @@ -7,7 +7,7 @@ VITE_DEV=true VITE_BASE_URL='http://118.31.23.45:48080' # 上传路径 -VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload' # 接口前缀 VITE_API_BASEPATH=/dev-api diff --git a/.env.pro b/.env.pro index 6c57331..e0b3180 100644 --- a/.env.pro +++ b/.env.pro @@ -7,7 +7,7 @@ VITE_DEV=false VITE_BASE_URL='http://localhost:48080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload' # 接口前缀 VITE_API_BASEPATH= diff --git a/.env.stage b/.env.stage index 634a27d..ae34e48 100644 --- a/.env.stage +++ b/.env.stage @@ -7,7 +7,7 @@ VITE_DEV=false VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn' # 上传路径 -VITE_UPLOAD_URL='http://api-dashboard.yudao.iocoder.cn/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload' # 接口前缀 VITE_API_BASEPATH= diff --git a/.env.static b/.env.static index a00ddf8..c0cc560 100644 --- a/.env.static +++ b/.env.static @@ -7,7 +7,7 @@ VITE_DEV=false VITE_BASE_URL='http://localhost:48080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload' # 接口前缀 VITE_API_BASEPATH= diff --git a/.env.test b/.env.test index 3e4b3e5..7af3d84 100644 --- a/.env.test +++ b/.env.test @@ -7,7 +7,7 @@ VITE_DEV=false VITE_BASE_URL='http://localhost:48080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload' # 接口前缀 VITE_API_BASEPATH= diff --git a/src/api/infra/file/index.ts b/src/api/infra/file/index.ts new file mode 100644 index 0000000..52a3723 --- /dev/null +++ b/src/api/infra/file/index.ts @@ -0,0 +1,45 @@ +import request from '@/config/axios' + +export interface FilePageReqVO extends PageParam { + path?: string + type?: string + createTime?: Date[] +} + +// 文件预签名地址 Response VO +export interface FilePresignedUrlRespVO { + // 文件配置编号 + configId: number + // 文件上传 URL + uploadUrl: string + // 文件 URL + url: string +} + +// 查询文件列表 +export const getFilePage = (params: FilePageReqVO) => { + return request.get({ url: '/infra/file/page', params }) +} + +// 删除文件 +export const deleteFile = (id: number) => { + return request.delete({ url: '/infra/file/delete?id=' + id }) +} + +// 获取文件预签名地址 +export const getFilePresignedUrl = (path: string) => { + return request.get({ + url: '/infra/file/presigned-url', + params: { path } + }) +} + +// 创建文件 +export const createFile = (data: any) => { + return request.post({ url: '/infra/file/create', data }) +} + +// 上传文件 +export const updateFile = (data: any) => { + return request.upload({ url: '/admin-api/system/file/upload', data }) +} diff --git a/src/api/mall/product/brand.ts b/src/api/mall/product/brand.ts index 94d5370..1173d98 100644 --- a/src/api/mall/product/brand.ts +++ b/src/api/mall/product/brand.ts @@ -32,30 +32,30 @@ export interface BrandVO { // 创建商品品牌 export const createBrand = (data: BrandVO) => { - return request.post({ url: '/product/brand/create', data }) + return request.post({ url: '/admin-api/crm/erp-product-brand/create', data }) } // 更新商品品牌 export const updateBrand = (data: BrandVO) => { - return request.put({ url: '/product/brand/update', data }) + return request.put({ url: '/admin-api/crm/erp-product-brand/update', data }) } // 删除商品品牌 export const deleteBrand = (id: number) => { - return request.delete({ url: `/product/brand/delete?id=${id}` }) + return request.delete({ url: `/admin-api/crm/erp-product-brand/delete?id=${id}` }) } // 获得商品品牌 export const getBrand = (id: number) => { - return request.get({ url: `/product/brand/get?id=${id}` }) + return request.get({ url: `/admin-api/crm/erp-product-brand/get?id=${id}` }) } // 获得商品品牌列表 export const getBrandParam = (params: PageParam) => { - return request.get({ url: '/product/brand/page', params }) + return request.get({ url: '/admin-api/crm/erp-product-brand/page', params }) } // 获得商品品牌精简信息列表 export const getSimpleBrandList = () => { - return request.get({ url: '/product/brand/list-all-simple' }) + return request.get({ url: '/admin-api/crm/erp-product-brand/simple-list' }) } diff --git a/src/api/mall/product/category.ts b/src/api/mall/product/category.ts index 8158fc0..9b40189 100644 --- a/src/api/mall/product/category.ts +++ b/src/api/mall/product/category.ts @@ -36,25 +36,30 @@ export interface CategoryVO { // 创建商品分类 export const createCategory = (data: CategoryVO) => { - return request.post({ url: '/product/category/create', data }) + return request.post({ url: '/admin-api/crm/erp-product-category/create', data }) } // 更新商品分类 export const updateCategory = (data: CategoryVO) => { - return request.put({ url: '/product/category/update', data }) + return request.put({ url: '/admin-api/crm/erp-product-category/update', data }) } // 删除商品分类 export const deleteCategory = (id: number) => { - return request.delete({ url: `/product/category/delete?id=${id}` }) + return request.delete({ url: `/admin-api/crm/erp-product-category/delete?id=${id}` }) } // 获得商品分类 export const getCategory = (id: number) => { - return request.get({ url: `/product/category/get?id=${id}` }) + return request.get({ url: `/admin-api/crm/erp-product-category/get?id=${id}` }) } // 获得商品分类列表 export const getCategoryList = (params: any) => { - return request.get({ url: '/product/category/list', params }) + return request.get({ url: '/admin-api/crm/erp-product-category/list', params }) +} + +// 获得商品分类列表 +export const getCategorySimpleList = (params: any) => { + return request.get({ url: '/admin-api/crm/erp-product-category/simple-list', params }) } diff --git a/src/api/mall/product/index.js b/src/api/mall/product/index.js index 23f25a4..3d1d185 100644 --- a/src/api/mall/product/index.js +++ b/src/api/mall/product/index.js @@ -1,25 +1,29 @@ import request from '@/config/axios' // 查询列表 export const getProductPage = async (params) => { - return await request.get({ url: '/admin-api/crm/erp-product//page', params }) + return await request.get({ url: '/admin-api/crm/erp-product/page', params }) } // 查询详情 export const getProduct = async (id) => { - return await request.get({ url: '/admin-api/crm/erp-product//get?id=' + id }) + return await request.get({ url: '/admin-api/crm/erp-product/get?id=' + id }) } // 新增 export const createProduct = async (data) => { - return await request.post({ url: '/admin-api/crm/erp-product//create', data: data }) + return await request.post({ url: '/admin-api/crm/erp-product/create', data: data }) } // 修改 export const updateProduct = async (params) => { - return await request.put({ url: '/admin-api/crm/erp-product//update', data: params }) + return await request.put({ url: '/admin-api/crm/erp-product/update', data: params }) } // 删除 export const deleteProduct = async (id) => { - return await request.delete({ url: '/admin-api/crm/erp-product//delete?id=' + id }) + return await request.delete({ url: '/admin-api/crm/erp-product/delete?id=' + id }) +} + +export const getSimpleProductList = async () => { + return await request.get({ url: '/admin-api/crm/erp-product/simple-list' }) } diff --git a/src/api/mall/product/property.ts b/src/api/mall/product/property.ts index ac8bac5..b9fb9b7 100644 --- a/src/api/mall/product/property.ts +++ b/src/api/mall/product/property.ts @@ -42,7 +42,7 @@ export interface PropertyValueDetailVO { // 创建属性项 export const createProperty = (data: PropertyVO) => { - return request.post({ url: '/product/property/create', data }) + return request.post({ url: '/admin-api/crm/erp-product-property/create', data }) } // 更新属性项 @@ -89,7 +89,7 @@ export const getPropertyValue = (id: number): Promise => { // 创建属性值 export const createPropertyValue = (data: PropertyValueVO) => { - return request.post({ url: '/product/property/value/create', data }) + return request.post({ url: '/admin-api/crm/erp-product-property-value/create', data }) } // 更新属性值 diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts deleted file mode 100644 index fd55e12..0000000 --- a/src/api/mall/product/spu.ts +++ /dev/null @@ -1,92 +0,0 @@ -import request from '@/config/axios' - -export interface Property { - propertyId?: number // 属性编号 - propertyName?: string // 属性名称 - valueId?: number // 属性值编号 - valueName?: string // 属性值名称 -} - -// TODO puhui999:是不是直接叫 Sku 更简洁一点哈。type 待后面,总感觉有个类型? -export interface SkuType { - id?: number // 商品 SKU 编号 - spuId?: number // SPU 编号 - properties?: Property[] // 属性数组 - price?: number // 商品价格 - marketPrice?: number // 市场价 - costPrice?: number // 成本价 - barCode?: string // 商品条码 - picUrl?: string // 图片地址 - stock?: number // 库存 - weight?: number // 商品重量,单位:kg 千克 - volume?: number // 商品体积,单位:m^3 平米 - subCommissionFirstPrice?: number // 一级分销的佣金 - subCommissionSecondPrice?: number // 二级分销的佣金 - salesCount?: number // 商品销量 -} - -// TODO puhui999:是不是直接叫 Spu 更简洁一点哈。type 待后面,总感觉有个类型? -export interface SpuType { - id?: number - name?: string // 商品名称 - categoryId?: number | null // 商品分类 - keyword?: string // 关键字 - unit?: number | null // 单位 - picUrl?: string // 商品封面图 - sliderPicUrls?: string[] // 商品轮播图 - introduction?: string // 商品简介 - deliveryTemplateId?: number | null // 运费模版 - brandId?: number | null // 商品品牌编号 - specType?: boolean // 商品规格 - subCommissionType?: boolean // 分销类型 - skus: SkuType[] // sku数组 - description?: string // 商品详情 - sort?: string // 商品排序 - giveIntegral?: number // 赠送积分 - virtualSalesCount?: number // 虚拟销量 - recommendHot?: boolean // 是否热卖 - recommendBenefit?: boolean // 是否优惠 - recommendBest?: boolean // 是否精品 - recommendNew?: boolean // 是否新品 - recommendGood?: boolean // 是否优品 -} - -// 获得 Spu 列表 -export const getSpuPage = (params: PageParam) => { - return request.get({ url: '/product/spu/page', params }) -} - -// 获得 Spu 列表 tabsCount -export const getTabsCount = () => { - return request.get({ url: '/product/spu/get-count' }) -} - -// 创建商品 Spu -export const createSpu = (data: SpuType) => { - return request.post({ url: '/product/spu/create', data }) -} - -// 更新商品 Spu -export const updateSpu = (data: SpuType) => { - return request.put({ url: '/product/spu/update', data }) -} - -// 更新商品 Spu status -export const updateStatus = (data: { id: number; status: number }) => { - return request.put({ url: '/product/spu/update-status', data }) -} - -// 获得商品 Spu -export const getSpu = (id: number) => { - return request.get({ url: `/product/spu/get-detail?id=${id}` }) -} - -// 删除商品 Spu -export const deleteSpu = (id: number) => { - return request.delete({ url: `/product/spu/delete?id=${id}` }) -} - -// 导出商品 Spu Excel -export const exportSpu = async (params) => { - return await request.download({ url: '/product/spu/export', params }) -} diff --git a/src/api/mall/purchase/index.js b/src/api/mall/purchase/index.js new file mode 100644 index 0000000..97b2f5e --- /dev/null +++ b/src/api/mall/purchase/index.js @@ -0,0 +1,25 @@ +import request from '@/config/axios' +// 查询列表 +export const getPurchasePage = async (params) => { + return await request.get({ url: '/admin-api/crm/erp-purchase/page', params }) +} + +// 新增 +export const createPurchase = async (data) => { + return await request.post({ url: '/admin-api/crm/erp-purchase/create', data: data }) +} + +// 修改 +export const updatePurchase = async (params) => { + return await request.put({ url: '/admin-api/crm/erp-purchase/update', data: params }) +} + +// 删除 +export const deletePurchase = async (id) => { + return await request.delete({ url: '/admin-api/crm/erp-purchase/delete?id=' + id }) +} + +// 审核 +export const auditPurchase = async (params) => { + return await request.get({ url: '/admin-api/crm/erp-purchase/audit', params }) +} diff --git a/src/api/system/dict/dict.data.ts b/src/api/system/dict/dict.data.ts index deded27..3b38226 100644 --- a/src/api/system/dict/dict.data.ts +++ b/src/api/system/dict/dict.data.ts @@ -15,7 +15,7 @@ export type DictDataVO = { // 查询字典数据(精简)列表 export const listSimpleDictData = () => { - return request.get({ url: '/admin-api/system/dict-data/simple-list' }) + return request.get({ url: '/admin-api/crm/dict-data/simple-list' }) } // 查询字典数据列表 diff --git a/src/api/system/library/index.js b/src/api/system/library/index.js new file mode 100644 index 0000000..3dedfcf --- /dev/null +++ b/src/api/system/library/index.js @@ -0,0 +1,26 @@ +import request from '@/config/axios' + +// 查询知识库列表 +export const getLibraryPage = (params) => { + return request.get({ url: '/admin-api/crm/knowledge-lib/page', params }) +} + +// 查询知识库详情 +export const getLibrary = (id) => { + return request.get({ url: '/admin-api/crm/knowledge-lib/get?id=' + id }) +} + +// 新增知识库 +export const createLibrary = (data) => { + return request.post({ url: '/admin-api/crm/knowledge-lib/create', data }) +} + +// 修改知识库 +export const updateLibrary = (data) => { + return request.put({ url: '/admin-api/crm/knowledge-lib/update', data }) +} + +// 删除知识库 +export const deleteLibrary = (id) => { + return request.delete({ url: '/admin-api/crm/knowledge-lib/delete?id=' + id }) +} diff --git a/src/api/system/library/resource.js b/src/api/system/library/resource.js new file mode 100644 index 0000000..633244f --- /dev/null +++ b/src/api/system/library/resource.js @@ -0,0 +1,26 @@ +import request from '@/config/axios' + +// 查询资源列表 +export const getResourcePage = (params) => { + return request.get({ url: '/admin-api/crm/knowledge-lib-info/page', params }) +} + +// 查询资源详情 +export const getResource = (id) => { + return request.get({ url: '/admin-api/crm/knowledge-lib-info/get?id=' + id }) +} + +// 新增资源 +export const createResource = (data) => { + return request.post({ url: '/admin-api/crm/knowledge-lib-info/create', data }) +} + +// 修改资源 +export const updateResource = (data) => { + return request.put({ url: '/admin-api/crm/knowledge-lib-info/update', data }) +} + +// 删除资源 +export const deleteResource = (id) => { + return request.delete({ url: '/admin-api/crm/knowledge-lib-info/delete?id=' + id }) +} diff --git a/src/components/Editor/src/Editor.vue b/src/components/Editor/src/Editor.vue index b2efe7b..a75ef4a 100644 --- a/src/components/Editor/src/Editor.vue +++ b/src/components/Editor/src/Editor.vue @@ -6,7 +6,7 @@ import { propTypes } from '@/utils/propTypes' import { isNumber } from '@/utils/is' import { ElMessage } from 'element-plus' import { useLocaleStore } from '@/store/modules/locale' -import { getAccessToken, getTenantId } from '@/utils/auth' +import { getAccessToken, getTenantId, getAppId } from '@/utils/auth' type InsertFnType = (url: string, alt: string, href: string) => void @@ -103,7 +103,8 @@ const editorConfig = computed((): IEditorConfig => { headers: { Accept: '*', Authorization: 'Bearer ' + getAccessToken(), - 'tenant-id': getTenantId() + 'tenant-id': getTenantId(), + 'instance-id': getAppId() }, // 跨域是否传递 cookie ,默认为 false @@ -140,6 +141,63 @@ const editorConfig = computed((): IEditorConfig => { customInsert(res: any, insertFn: InsertFnType) { insertFn(res.data, 'image', res.data) } + }, + ['uploadVideo']: { + server: import.meta.env.VITE_UPLOAD_URL, + // 单个文件的最大体积限制,默认为 2M + maxFileSize: 100 * 1024 * 1024, + // 最多可上传几个文件,默认为 100 + maxNumberOfFiles: 10, + // 选择文件时的类型限制,默认为 ['image/*'] 。如不想限制,则设置为 [] + allowedFileTypes: ['video/*'], + + // 自定义上传参数,例如传递验证的 token 等。参数会被添加到 formData 中,一起上传到服务端。 + meta: { updateSupport: 0 }, + // 将 meta 拼接到 url 参数中,默认 false + metaWithUrl: true, + + // 自定义增加 http header + headers: { + Accept: '*', + Authorization: 'Bearer ' + getAccessToken(), + 'tenant-id': getTenantId(), + 'instance-id': getAppId() + }, + + // 跨域是否传递 cookie ,默认为 false + withCredentials: true, + + // 超时时间,默认为 10 秒 + timeout: 10 * 1000, // 5 秒 + + // form-data fieldName,后端接口参数名称,默认值wangeditor-uploaded-image + fieldName: 'file', + + // 上传之前触发 + onBeforeUpload(file: File) { + console.log(file) + return file + }, + // 上传进度的回调函数 + onProgress(progress: number) { + // progress 是 0-100 的数字 + console.log('progress', progress) + }, + onSuccess(file: File, res: any) { + console.log('onSuccess', file, res) + }, + onFailed(file: File, res: any) { + alert(res.message) + console.log('onFailed', file, res) + }, + onError(file: File, err: any, res: any) { + alert(err.message) + console.error('onError', file, err, res) + }, + // 自定义插入图片 + customInsert(res: any, insertFn: InsertFnType) { + insertFn(res.data, 'video', res.data) + } } }, uploadImgShowBase64: true diff --git a/src/components/SSTable/index.vue b/src/components/SSTable/index.vue index 72dac3f..bcdfeb0 100644 --- a/src/components/SSTable/index.vue +++ b/src/components/SSTable/index.vue @@ -39,7 +39,7 @@ @@ -61,7 +61,7 @@ const emit = defineEmits(['update:tableObject', 'getList', 'getCheckedColumns']) const route = useRoute() const { id: userId } = useUserStore().user //取用户ID -const currentPage = ref(props.tableObject?.currentPage || 1) +const pageNo = ref(props.tableObject?.pageNo || 1) const pageSize = ref(props.tableObject?.pageSize || 20) @@ -74,7 +74,7 @@ const checkedColumns = ref([]) // 调用获取数据的接口,分页时需要使用 function getList({ page, limit }) { - emit('update:tableObject', { ...props.tableObject, currentPage: page, pageSize: limit }) + emit('update:tableObject', { ...props.tableObject, pageNo: page, pageSize: limit }) nextTick(() => { emit('getList') }) diff --git a/src/components/Search/src/Search.vue b/src/components/Search/src/Search.vue index ccd3746..c41c66e 100644 --- a/src/components/Search/src/Search.vue +++ b/src/components/Search/src/Search.vue @@ -33,8 +33,8 @@ const props = defineProps({ .validate((v: string) => ['left', 'center', 'right'].includes(v)) .def('center'), showLabel: propTypes.bool.def(false), - showSearch: propTypes.bool.def(true), - showReset: propTypes.bool.def(true), + showSearch: propTypes.bool.def(false), + showReset: propTypes.bool.def(false), // 是否显示伸缩 expand: propTypes.bool.def(false), // 伸缩的界限字段 @@ -199,10 +199,10 @@ initSearch() - + - + + --> diff --git a/src/views/Basic/Library/Comp/DialogResource.vue b/src/views/Basic/Library/Comp/DialogResource.vue index aca33c4..36019a9 100644 --- a/src/views/Basic/Library/Comp/DialogResource.vue +++ b/src/views/Basic/Library/Comp/DialogResource.vue @@ -1,6 +1,6 @@ - diff --git a/src/views/Basic/Library/Comp/ImagePreview.vue b/src/views/Basic/Library/Comp/ImagePreview.vue index 1ca05fb..d184dd1 100644 --- a/src/views/Basic/Library/Comp/ImagePreview.vue +++ b/src/views/Basic/Library/Comp/ImagePreview.vue @@ -1,7 +1,6 @@ - - - {{ info.title }} - - - {{ info.fileName }} - - - {{ - item - }} - - - {{ info.remark }} - - +
+
+
标题:
+
{{ info.title }}
+
+
+
文件名称:
+
{{ + info.files + }}
+
+
+
标签:
+
+ + {{ getDictLabel('knowledge_tags', item) }} + +
+
+
+
备注:
+
{{ info.remark }}
+
+
- +
{{ imgIndex + 1 }} / {{ imgList.length }}
diff --git a/src/views/Clue/Set/index.vue b/src/views/Clue/Set/index.vue index 8f5ee5b..f50f702 100644 --- a/src/views/Clue/Set/index.vue +++ b/src/views/Clue/Set/index.vue @@ -16,7 +16,10 @@ - + + + + @@ -30,6 +33,7 @@ import ClueSource from './Comp/ClueSource.vue' import ClueGet from './Comp/ClueGet.vue' import ClueSend from './Comp/ClueSend.vue' import MsgSend from './Comp/MsgSend.vue' +import GeneralSet from './Comp/GeneralSet.vue' const tabIndex = ref(0) diff --git a/src/views/MiniMall/Inventory/index.vue b/src/views/MiniMall/Inventory/index.vue index 88c5539..a0bfbe0 100644 --- a/src/views/MiniMall/Inventory/index.vue +++ b/src/views/MiniMall/Inventory/index.vue @@ -1,12 +1,12 @@ diff --git a/src/views/MiniMall/MallSet/Comp/CategorySet.vue b/src/views/MiniMall/MallSet/Comp/CategorySet.vue index b0d43c4..6a312fc 100644 --- a/src/views/MiniMall/MallSet/Comp/CategorySet.vue +++ b/src/views/MiniMall/MallSet/Comp/CategorySet.vue @@ -15,30 +15,34 @@ 新增 - - - + + + - - + + + + @@ -48,58 +52,61 @@ diff --git a/src/views/MiniMall/MallSet/Comp/DialogBrand.vue b/src/views/MiniMall/MallSet/Comp/DialogBrand.vue index bcb7703..19bfaee 100644 --- a/src/views/MiniMall/MallSet/Comp/DialogBrand.vue +++ b/src/views/MiniMall/MallSet/Comp/DialogBrand.vue @@ -1,5 +1,5 @@ diff --git a/src/views/MiniMall/MallSet/index.vue b/src/views/MiniMall/MallSet/index.vue index 533ddf7..9bb4afe 100644 --- a/src/views/MiniMall/MallSet/index.vue +++ b/src/views/MiniMall/MallSet/index.vue @@ -1,22 +1,22 @@ @@ -28,6 +28,7 @@ import MsgSend from './Comp/MsgSend.vue' import CategorySet from './Comp/CategorySet.vue' import BrandSet from './Comp/BrandSet.vue' import SupplierSet from './Comp/SupplierSet.vue' +import { checkPermi } from '@/utils/permission' const tabIndex = ref(0) diff --git a/src/views/MiniMall/Product/Comp/ProductAttributesAddForm.vue b/src/views/MiniMall/Product/Comp/ProductAttributesAddForm.vue index 9ab56aa..e596cd2 100644 --- a/src/views/MiniMall/Product/Comp/ProductAttributesAddForm.vue +++ b/src/views/MiniMall/Product/Comp/ProductAttributesAddForm.vue @@ -6,6 +6,7 @@ :model="formData" :rules="formRules" label-width="80px" + @submit.prevent > @@ -33,7 +34,7 @@ const formRules = reactive({ name: [{ required: true, message: '名称不能为空', trigger: 'blur' }] }) const formRef = ref() // 表单 Ref -const attributeList = ref([]) // 商品属性列表 +const attributeList = ref([]) // 商品属性列表 const props = defineProps({ propertyList: { type: Array, @@ -69,17 +70,13 @@ const submitForm = async () => { formLoading.value = true try { const data = formData.value as PropertyApi.PropertyVO - // 检查属性是否已存在,如果有则返回属性和其下属性值 - const res = await PropertyApi.getPropertyListAndValue({ name: data.name }) - if (res.length === 0) { - const propertyId = await PropertyApi.createProperty(data) - attributeList.value.push({ id: propertyId, ...formData.value, values: [] }) - } else { - if (res[0].values === null) { - res[0].values = [] - } - attributeList.value.push(res[0]) // 因为只用一个 - } + const propertyId = await PropertyApi.createProperty(data) + // 添加到属性列表 + attributeList.value.push({ + id: propertyId + '', + ...formData.value, + values: [] + }) message.success(t('common.createSuccess')) dialogVisible.value = false } finally { @@ -90,8 +87,7 @@ const submitForm = async () => { /** 重置表单 */ const resetForm = () => { formData.value = { - name: '', - remark: '' + name: '' } formRef.value?.resetFields() } diff --git a/src/views/MiniMall/Product/Comp/SkuList.vue b/src/views/MiniMall/Product/Comp/SkuList.vue deleted file mode 100644 index 527f658..0000000 --- a/src/views/MiniMall/Product/Comp/SkuList.vue +++ /dev/null @@ -1,317 +0,0 @@ - - diff --git a/src/views/MiniMall/Product/add.vue b/src/views/MiniMall/Product/add.vue index 5447064..10a16e6 100644 --- a/src/views/MiniMall/Product/add.vue +++ b/src/views/MiniMall/Product/add.vue @@ -1,5 +1,5 @@