|
@@ -7,7 +7,7 @@ import {
|
|
DageUpload,
|
|
DageUpload,
|
|
DageUploadConsumer,
|
|
DageUploadConsumer,
|
|
DageUploadProvider,
|
|
DageUploadProvider,
|
|
-} from "@dage/web-components";
|
|
|
|
|
|
+} from "@dage/pc-components";
|
|
import { HistoryDictItem } from "@/types";
|
|
import { HistoryDictItem } from "@/types";
|
|
import { Form, FormInstance, Input, Select } from "antd";
|
|
import { Form, FormInstance, Input, Select } from "antd";
|
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
@@ -28,17 +28,15 @@ export default function HistoryCreateOrEdit() {
|
|
setLoading(true);
|
|
setLoading(true);
|
|
try {
|
|
try {
|
|
const {
|
|
const {
|
|
- data: {
|
|
|
|
- entity: { thumb, ...rest },
|
|
|
|
- file,
|
|
|
|
- },
|
|
|
|
|
|
+ entity: { thumb, ...rest },
|
|
|
|
+ file,
|
|
} = await weaponApi.getDetail(params.id as string);
|
|
} = await weaponApi.getDetail(params.id as string);
|
|
|
|
|
|
if (thumb) {
|
|
if (thumb) {
|
|
rest.thumb = [
|
|
rest.thumb = [
|
|
{
|
|
{
|
|
uid: thumb,
|
|
uid: thumb,
|
|
- url: `${process.env.REACT_APP_BACKEND_URL}${thumb}`,
|
|
|
|
|
|
+ url: `${process.env.REACT_APP_API_URL}${thumb}`,
|
|
name: thumb,
|
|
name: thumb,
|
|
status: "done",
|
|
status: "done",
|
|
},
|
|
},
|
|
@@ -50,8 +48,8 @@ export default function HistoryCreateOrEdit() {
|
|
dageFileCheckboxRef.current?.setFileList(
|
|
dageFileCheckboxRef.current?.setFileList(
|
|
file.map((i: any) => ({
|
|
file.map((i: any) => ({
|
|
uid: i.id + "",
|
|
uid: i.id + "",
|
|
- url: `${process.env.REACT_APP_BACKEND_URL}${i.filePath}`,
|
|
|
|
- thumbUrl: `${process.env.REACT_APP_BACKEND_URL}${i.filePath}`,
|
|
|
|
|
|
+ url: `${process.env.REACT_APP_API_URL}${i.filePath}`,
|
|
|
|
+ thumbUrl: `${process.env.REACT_APP_API_URL}${i.filePath}`,
|
|
name: i.fileName,
|
|
name: i.fileName,
|
|
dType: i.type,
|
|
dType: i.type,
|
|
status: "done",
|
|
status: "done",
|
|
@@ -63,7 +61,7 @@ export default function HistoryCreateOrEdit() {
|
|
}, [params.id]);
|
|
}, [params.id]);
|
|
|
|
|
|
const getDictList = useCallback(async () => {
|
|
const getDictList = useCallback(async () => {
|
|
- const { data } = await weaponApi.getDictList();
|
|
|
|
|
|
+ const data = await weaponApi.getDictList();
|
|
setDictList(data);
|
|
setDictList(data);
|
|
}, []);
|
|
}, []);
|
|
|
|
|
|
@@ -81,7 +79,9 @@ export default function HistoryCreateOrEdit() {
|
|
}
|
|
}
|
|
|
|
|
|
if (thumb[0] && thumb[0].imgAttrs) {
|
|
if (thumb[0] && thumb[0].imgAttrs) {
|
|
- rest.thumbInfo = (thumb[0].imgAttrs.width / thumb[0].imgAttrs.height).toFixed(2)
|
|
|
|
|
|
+ rest.thumbInfo = (
|
|
|
|
+ thumb[0].imgAttrs.width / thumb[0].imgAttrs.height
|
|
|
|
+ ).toFixed(2);
|
|
}
|
|
}
|
|
|
|
|
|
await weaponApi.add({
|
|
await weaponApi.add({
|
|
@@ -213,7 +213,7 @@ export default function HistoryCreateOrEdit() {
|
|
<Input.TextArea
|
|
<Input.TextArea
|
|
className="w450"
|
|
className="w450"
|
|
placeholder="请输入内容"
|
|
placeholder="请输入内容"
|
|
- maxLength={200}
|
|
|
|
|
|
+ maxLength={2000}
|
|
rows={4}
|
|
rows={4}
|
|
showCount
|
|
showCount
|
|
readOnly={readonly.current}
|
|
readOnly={readonly.current}
|