|
@@ -4,7 +4,6 @@ import {
|
|
|
Form,
|
|
|
Input,
|
|
|
InputNumber,
|
|
|
- message,
|
|
|
Modal,
|
|
|
Popconfirm,
|
|
|
Select,
|
|
@@ -33,6 +32,7 @@ import {
|
|
|
} from "@/store/action/object1";
|
|
|
import { goodsChangeObj } from "@/utils/dataChange";
|
|
|
import { editObj2GoodsAPI } from "@/store/action/object2";
|
|
|
+import { MessageFu } from "@/utils/message";
|
|
|
const { Option } = Select;
|
|
|
|
|
|
type Props = {
|
|
@@ -49,7 +49,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
|
|
|
// 没有通过校验
|
|
|
const onFinishFailed = () => {
|
|
|
setTitSelect("tit1");
|
|
|
- return message.warning("有表单不符号规则!");
|
|
|
+ return MessageFu.warning("有表单不符号规则!");
|
|
|
};
|
|
|
|
|
|
// --------通过校验之后发送请求----------点击确定
|
|
@@ -131,7 +131,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
|
|
|
}
|
|
|
}
|
|
|
if (JSON.stringify(before) === "{}")
|
|
|
- return message.warning("没有改变藏品的信息!");
|
|
|
+ return MessageFu.warning("没有改变藏品的信息!");
|
|
|
|
|
|
const editData = {
|
|
|
afterJson: after,
|
|
@@ -141,7 +141,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
|
|
|
|
|
|
const res: any = await editObj2GoodsAPI(editData);
|
|
|
if (res.code === 0) {
|
|
|
- message.success("编辑成功!");
|
|
|
+ MessageFu.success("编辑成功!");
|
|
|
// 通知父组件更新页面
|
|
|
upInfoAPIFu();
|
|
|
// 真正的删除 ----在藏品总账里面修改的时候不能删除
|
|
@@ -389,12 +389,12 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
|
|
|
const type = ["image/jpeg", "image/png"];
|
|
|
if (!type.includes(filesInfo.type)) {
|
|
|
e.target.value = "";
|
|
|
- return message.warning("只支持jpg、png格式!");
|
|
|
+ return MessageFu.warning("只支持jpg、png格式!");
|
|
|
}
|
|
|
// 校验大小
|
|
|
if (filesInfo.size > 10 * 1024 * 1024) {
|
|
|
e.target.value = "";
|
|
|
- return message.warning("最大支持10M!");
|
|
|
+ return MessageFu.warning("最大支持10M!");
|
|
|
}
|
|
|
// 创建FormData对象
|
|
|
const fd = new FormData();
|
|
@@ -407,7 +407,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
|
|
|
|
|
|
const res: any = await object1AddUpFileAPI(fd);
|
|
|
if (res.code === 0) {
|
|
|
- message.success("上传成功!");
|
|
|
+ MessageFu.success("上传成功!");
|
|
|
setCover(res.data.filePath);
|
|
|
}
|
|
|
UpAsyncLodingDom.style.opacity = 0;
|
|
@@ -454,7 +454,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
|
|
|
// 校验格式
|
|
|
if (!type.includes(filesInfo.type)) {
|
|
|
e.target.value = "";
|
|
|
- return message.warning(tit);
|
|
|
+ return MessageFu.warning(tit);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -468,7 +468,7 @@ function ObjectAdd({ id, colsePage, editId, dirCode, upInfoAPIFu }: Props) {
|
|
|
|
|
|
const res: any = await object1AddUpFileAPI(fd);
|
|
|
if (res.code === 0) {
|
|
|
- message.success("上传成功!");
|
|
|
+ MessageFu.success("上传成功!");
|
|
|
if (upFileFlagRef.current) {
|
|
|
// 重新上传
|
|
|
const id = upFileFlagRef.current;
|