update
This commit is contained in:
parent
f5c66f8fd9
commit
169c5fad49
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ant-design-pro",
|
||||
"version": "4.5.47",
|
||||
"version": "4.5.49",
|
||||
"private": true,
|
||||
"description": "An out-of-box UI solution for enterprise applications",
|
||||
"scripts": {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import React, {useEffect, useRef, useState} from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
|
||||
import Draggable from "react-draggable";
|
||||
import ProForm, {
|
||||
@ -12,12 +12,12 @@ import type { BrandModel } from "@/pages/basicManage/Brand/data";
|
||||
import type { FormInstance } from "antd";
|
||||
import { Button, Col, Form, Image, message, Modal, Row, Switch, TreeSelect } from "antd";
|
||||
import { getFieldEnum } from "@/services/options";
|
||||
import { uploadFile } from "@/pages/busniess/PaymentConfirm/service";
|
||||
import { uploadAHYDFile, uploadFile } from "@/pages/busniess/PaymentConfirm/service";
|
||||
import { ExclamationCircleOutlined } from "@ant-design/icons";
|
||||
import { getList, updateBrand } from "@/pages/basicManage/Brand/service";
|
||||
|
||||
import { getBase64 } from '@/utils/utils';
|
||||
import { getPictureList, deletePicture, uploadPicture } from '@/services/picture';
|
||||
import { getPictureList, deletePicture, uploadPicture, uploadAHYDPicture } from '@/services/picture';
|
||||
import type { UploadFile } from 'antd/es/upload/interface';
|
||||
import type { PictureModel } from '@/services/options/typings';
|
||||
|
||||
@ -36,21 +36,22 @@ const handleAddUpdate = async (fields: BrandModel) => {
|
||||
};
|
||||
|
||||
// 上传附件
|
||||
const customUploadRequest = async (fileList: UploadFile[], tableId: string,imageType: number) => {
|
||||
const customUploadRequest = async (fileList: UploadFile[], tableId: string, imageType: number) => {
|
||||
if (!fileList.length) {
|
||||
message.error("您上传的附件不存在.")
|
||||
return false
|
||||
}
|
||||
const formData = new FormData();
|
||||
fileList.forEach(file => {
|
||||
if (!file.ImageName){
|
||||
if (!file.ImageName) {
|
||||
formData.append('files[]', file);
|
||||
}
|
||||
});
|
||||
formData.append('ImageType', imageType);
|
||||
formData.append('TableType', '1125');
|
||||
formData.append('TableId', tableId);
|
||||
const success = await uploadPicture(formData)
|
||||
// const success = await uploadPicture(formData)
|
||||
const success = await uploadAHYDPicture(formData)
|
||||
if (success) {
|
||||
return true
|
||||
}
|
||||
@ -71,22 +72,22 @@ const customUploadRequest = async (fileList: UploadFile[], tableId: string,image
|
||||
// handleChangePreview 图片的预览
|
||||
|
||||
const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, handleTableList, size, actionRef,
|
||||
brandTreeData, loading, fileList,licenseList, handlePreview, handleChangeFieldList, imagePreviewVisible, handleChangePreview }: any) => {
|
||||
brandTreeData, loading, fileList, licenseList, handlePreview, handleChangeFieldList, imagePreviewVisible, handleChangePreview }: any) => {
|
||||
const { confirm } = Modal;
|
||||
const formRef = useRef<FormInstance>();
|
||||
const draggleRef = React.createRef<any>()
|
||||
const [confirmLoading, handleConfirmLoading] = useState<boolean>(false) // 弹出框的内容表单是否在提交
|
||||
const [addTrade, setAddTrade] = useState<boolean>() // 是否新增业态操作
|
||||
const [businessLicenseList,setBusinessLicenseList] = useState<UploadFile[]>([])// 营业执照文件列表
|
||||
const [businessLicenseList, setBusinessLicenseList] = useState<UploadFile[]>([])// 营业执照文件列表
|
||||
const [priviewImage, setPriviewImage] = useState<string>(); // 预览的文件地址
|
||||
const [managerForm,setManagerForm] = useState<number>()// 经营形式的类型 1000 品牌直营 2000 品牌加盟
|
||||
const [managerForm, setManagerForm] = useState<number>()// 经营形式的类型 1000 品牌直营 2000 品牌加盟
|
||||
const [disabled, setDraggleDisabled] = useState<boolean>() // 是否拖动
|
||||
const [bounds, setBounds] = useState<{ left: number, right: number, top: number, bottom: number }>() // 移动的位置
|
||||
const [list1001,setList1001] = useState<any>()// 1001的附件列表
|
||||
const [list1002,setList1002] = useState<any>()// 1002的附件列表
|
||||
const [list1003,setList1003] = useState<any>()// 1003的附件列表
|
||||
const [list1004,setList1004] = useState<any>()// 1004的附件列表
|
||||
const [list1005,setList1005] = useState<any>()// 1005的附件列表
|
||||
const [list1001, setList1001] = useState<any>()// 1001的附件列表
|
||||
const [list1002, setList1002] = useState<any>()// 1002的附件列表
|
||||
const [list1003, setList1003] = useState<any>()// 1003的附件列表
|
||||
const [list1004, setList1004] = useState<any>()// 1004的附件列表
|
||||
const [list1005, setList1005] = useState<any>()// 1005的附件列表
|
||||
const beforeUpload = (file: any) => {
|
||||
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
|
||||
if (!isJpgOrPng) {
|
||||
@ -113,31 +114,31 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(()=>{
|
||||
useEffect(() => {
|
||||
const type1001: UploadFile[] = []
|
||||
const type1002: UploadFile[] = []
|
||||
const type1003: UploadFile[] = []
|
||||
const type1004: UploadFile[] = []
|
||||
const type1005: UploadFile[] = []
|
||||
if (licenseList && licenseList.length>0){
|
||||
licenseList.forEach((item: any)=>{
|
||||
if (item.ImageType === 1001){
|
||||
if (licenseList && licenseList.length > 0) {
|
||||
licenseList.forEach((item: any) => {
|
||||
if (item.ImageType === 1001) {
|
||||
item.name = item.ImageName
|
||||
item.url = item.ImageUrl
|
||||
type1001.push(item)
|
||||
}else if(item.ImageType === 1002){
|
||||
} else if (item.ImageType === 1002) {
|
||||
item.name = item.ImageName
|
||||
item.url = item.ImageUrl
|
||||
type1002.push(item)
|
||||
}else if(item.ImageType === 1003){
|
||||
} else if (item.ImageType === 1003) {
|
||||
item.name = item.ImageName
|
||||
item.url = item.ImageUrl
|
||||
type1003.push(item)
|
||||
}else if(item.ImageType === 1004){
|
||||
} else if (item.ImageType === 1004) {
|
||||
item.name = item.ImageName
|
||||
item.url = item.ImageUrl
|
||||
type1004.push(item)
|
||||
}else if(item.ImageType === 1005){
|
||||
} else if (item.ImageType === 1005) {
|
||||
item.name = item.ImageName
|
||||
item.url = item.ImageUrl
|
||||
type1005.push(item)
|
||||
@ -150,11 +151,11 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
setList1003(type1003)
|
||||
setList1004(type1004)
|
||||
setList1005(type1005)
|
||||
},[licenseList])
|
||||
}, [licenseList])
|
||||
|
||||
useEffect(()=>{
|
||||
useEffect(() => {
|
||||
setManagerForm(currentRow?.MANAGE_TYPE)
|
||||
},[currentRow])
|
||||
}, [currentRow])
|
||||
return (
|
||||
<Modal
|
||||
title={
|
||||
@ -182,7 +183,7 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
destroyOnClose={true}
|
||||
confirmLoading={confirmLoading}
|
||||
width={900}
|
||||
bodyStyle={{height:'70vh',overflowY:'scroll'}}
|
||||
bodyStyle={{ height: '70vh', overflowY: 'scroll' }}
|
||||
visible={modalVisible}
|
||||
afterClose={() => {
|
||||
formRef.current?.resetFields();
|
||||
@ -265,19 +266,19 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
const type1004 = list1004.filter(n => n.status !== 'done')
|
||||
const type1005 = list1005.filter(n => n.status !== 'done')
|
||||
if (type1001.length > 0) {
|
||||
await customUploadRequest(type1001, success?.BRAND_ID,1001)
|
||||
await customUploadRequest(type1001, success?.BRAND_ID, 1001)
|
||||
}
|
||||
if (type1002.length > 0) {
|
||||
await customUploadRequest(type1002, success?.BRAND_ID,1002)
|
||||
await customUploadRequest(type1002, success?.BRAND_ID, 1002)
|
||||
}
|
||||
if (type1003.length > 0) {
|
||||
await customUploadRequest(type1003, success?.BRAND_ID,1003)
|
||||
await customUploadRequest(type1003, success?.BRAND_ID, 1003)
|
||||
}
|
||||
if (type1004.length > 0) {
|
||||
await customUploadRequest(type1004, success?.BRAND_ID,1004)
|
||||
await customUploadRequest(type1004, success?.BRAND_ID, 1004)
|
||||
}
|
||||
if (type1005.length > 0) {
|
||||
await customUploadRequest(type1005, success?.BRAND_ID,1005)
|
||||
await customUploadRequest(type1005, success?.BRAND_ID, 1005)
|
||||
}
|
||||
handleTableList(size)
|
||||
if (actionRef.current) {
|
||||
@ -377,7 +378,7 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
return await getFieldEnum({ FieldExplainField: "MANAGE_TYPE" });
|
||||
}}
|
||||
fieldProps={{
|
||||
onChange:(val: any)=>{
|
||||
onChange: (val: any) => {
|
||||
setManagerForm(val)
|
||||
}
|
||||
}}
|
||||
@ -412,7 +413,8 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
formData.append('TableName', 'BRAND');
|
||||
formData.append('ImageName', typeof info.file !== 'string' ? info.file?.name : '');
|
||||
if (info.filename) {
|
||||
const success = await uploadFile(formData)
|
||||
// const success = await uploadFile(formData)
|
||||
const success = await uploadAHYDFile(formData)
|
||||
if (success) {
|
||||
const list = [{
|
||||
uid: `${success.ImageId}`, // 注意,这个uid一定不能少,否则上传失败
|
||||
@ -677,7 +679,7 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
</ProFormUploadButton>
|
||||
</Col>
|
||||
{
|
||||
managerForm===2000?
|
||||
managerForm === 2000 ?
|
||||
<Col span={12}>
|
||||
<ProFormUploadButton
|
||||
name={'cooperate'}
|
||||
@ -740,10 +742,10 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
}}
|
||||
>
|
||||
</ProFormUploadButton>
|
||||
</Col>:''
|
||||
</Col> : ''
|
||||
}
|
||||
{
|
||||
managerForm===2000?
|
||||
managerForm === 2000 ?
|
||||
<Col span={12}>
|
||||
<ProFormUploadButton
|
||||
name={'permit'}
|
||||
@ -806,7 +808,7 @@ const AddEdit = ({ clickType, modalVisible, handleCloseAddEdit, currentRow, hand
|
||||
}}
|
||||
>
|
||||
</ProFormUploadButton>
|
||||
</Col>:''
|
||||
</Col> : ''
|
||||
}
|
||||
{/* <Col span={24}> */}
|
||||
{/* /!* 上传文件组件 *!/ */}
|
||||
|
||||
@ -239,8 +239,8 @@ const highwayHeadlines: React.FC<{ currentUser: CurrentUser }> = (props) => {
|
||||
})
|
||||
formData.append('TableType', '1401');
|
||||
formData.append('TableId', data.Result_Data.NOTICEINFO_ID.toString());
|
||||
const success = await uploadPicture(formData)
|
||||
// const success = await uploadAHYDPicture(formData)
|
||||
// const success = await uploadPicture(formData)
|
||||
const success = await uploadAHYDPicture(formData)
|
||||
console.log('success', success);
|
||||
}
|
||||
if (data.Result_Code === 100) {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { tableList } from '@/utils/format';
|
||||
import request from '@/utils/request';
|
||||
import type { PaymentConfirmModel, RemarksModel } from './data';
|
||||
import requestAHYD from '@/utils/requestAHYD';
|
||||
// 获取列表数据
|
||||
export async function getList(params?: any) {
|
||||
const search = params ? { ...params, sortstr: params.sortstr, PageIndex: params.current, pagesize: params.pageSize } : {};
|
||||
@ -85,6 +86,16 @@ export async function getPaymentConfirmList(params: { MerchantsId?: string, Acco
|
||||
return tableList(data.Result_Data);
|
||||
}
|
||||
|
||||
// 新的上传图片
|
||||
export async function uploadAHYDFile(params: FormData) {
|
||||
const data = await requestAHYD(`/Picture/SaveImgFile`, {
|
||||
method: 'POST',
|
||||
data: params,
|
||||
requestType: 'form',
|
||||
})
|
||||
return data.Result_Data
|
||||
}
|
||||
|
||||
// 上传图片
|
||||
export async function uploadFile(params: FormData) {
|
||||
const data = await request(`/Picture/SaveImgFile`, {
|
||||
|
||||
@ -58,7 +58,7 @@ const errorHandler = (error: { response: Response }): Response => {
|
||||
*/
|
||||
const request = extend({
|
||||
errorHandler, // default error handling
|
||||
// prefix: '/EShangApiMain',// 开发
|
||||
// prefix: '/EShangApiAHYD',// 开发
|
||||
prefix: 'https://ahyd.eshangtech.com/EShangApiMain', // 正式
|
||||
headers: {
|
||||
token: '',
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// 由 scripts/writeVersion.js 自动生成
|
||||
export const VERSION = "4.5.47";
|
||||
export const GIT_HASH = "30fa7f3";
|
||||
export const BUILD_TIME = "2025-09-03T06:42:56.086Z";
|
||||
export const VERSION = "4.5.49";
|
||||
export const GIT_HASH = "f5c66f8";
|
||||
export const BUILD_TIME = "2025-09-05T01:51:31.828Z";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user