Browse Source

图片添加

dev
dengyinhuan 1 year ago
parent
commit
e0b36b3436
  1. 1
      web/client/src/sections/fillion/components/luzhengmodel.js
  2. 11
      web/client/src/sections/fillion/components/uploads.js

1
web/client/src/sections/fillion/components/luzhengmodel.js

@ -89,6 +89,7 @@ const LuzhengModel = ({ editData, check, visible, onCancel, dispatch }) => {
maxFileSize={200}
fileList={editData?.picfile}
listType ={'picture-card'}
isedit={editData?true:false}
/>
</Form.Item>
</Form>

11
web/client/src/sections/fillion/components/uploads.js

@ -18,7 +18,7 @@ class Uploads extends Component {
removeFilesList: []
};
}
dealName = (uploaded) => {
console.log(uploaded)
let realName = uploaded.split('/')[2]
@ -29,7 +29,6 @@ class Uploads extends Component {
}
setFileList = (value) => {
console.log(value,'value')
let defaultFileList = [];
defaultFileList = value.map((u, index) => {
let fileUrl = `${u.url}`;
@ -57,11 +56,11 @@ class Uploads extends Component {
componentWillReceiveProps (np) {
const { dispatch, value: thisEditData, onChange } = this.props;
const { value: nextEditData, clearFileList } = np;
console.log(np,'npp')
const setFileList = () => {
let defaultFileList = [];
defaultFileList = nextEditData.map((u, index) => {
let fileUrl = `${u.storageUrl}`;
let fileUrl = `${this.ApiRoot}/${u.storageUrl}`;
return {
uid: -index - 1,
name: this.dealName(u.storageUrl),
@ -151,7 +150,7 @@ class Uploads extends Component {
name: 'checkFile_',
multiple: false,
showUploadList: showUploadList || true,
action: `attachments/${uploadType_}`,
action: `${this.ApiRoot}/attachments/${uploadType_}`,
listType: listType || 'text',
disabled: disabled,
beforeUpload: (file) => {
@ -247,7 +246,6 @@ class Uploads extends Component {
});
},
onPreview (file) {
console.log(file,'file')
let filePostfix = file.url.split('.').pop();
filePostfix = filePostfix.toLowerCase();
if (UploadPath.image.some((img) => img == filePostfix)) {
@ -261,7 +259,6 @@ class Uploads extends Component {
};
let fileList_ = fileList
// .map(f => {
// if (f.storageUrl) {
// let realName = f.storageUrl.split('/').pop()

Loading…
Cancel
Save