Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈智峰
jinfa-platform
Commits
a1dd8442
Commit
a1dd8442
authored
Jan 07, 2021
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 编辑添加图片修改、完善图片展示相关
parent
807a81e5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
40 additions
and
32 deletions
+40
-32
index.tsx
src/components/NiceForm/components/AntUpload/index.tsx
+7
-3
useBusinessEffects.tsx
...sent/components/DetailInfo/effects/useBusinessEffects.tsx
+3
-1
index.tsx
.../purchaserEvaluation/sent/components/DetailInfo/index.tsx
+4
-12
index.ts
...aserEvaluation/sent/components/DetailInfo/schema/index.ts
+7
-1
index.tsx
...action/purchaserEvaluation/unevaluated/evaluate/index.tsx
+3
-1
useBusinessEffects.tsx
...sent/components/DetailInfo/effects/useBusinessEffects.tsx
+3
-1
index.tsx
...n/supplierEvaluation/sent/components/DetailInfo/index.tsx
+4
-12
index.ts
...lierEvaluation/sent/components/DetailInfo/schema/index.ts
+6
-0
index.tsx
...saction/supplierEvaluation/unevaluated/evaluate/index.tsx
+3
-1
No files found.
src/components/NiceForm/components/AntUpload/index.tsx
View file @
a1dd8442
...
...
@@ -111,10 +111,10 @@ const normalizeFileList = fileList => {
status
:
file
.
status
,
name
:
file
.
name
,
url
:
file
.
downloadURL
||
file
.
imgURL
||
file
.
url
,
...
file
.
response
,
...
file
.
response
.
data
,
thumbUrl
:
file
.
imgURL
||
getImageByUrl
(
file
.
downloadURL
||
file
.
url
,
{
exclude
:
[
'.png'
,
'.jpg'
,
'.jpeg'
,
'.gif'
]
})
})
,
}
:
file
;
})
}
...
...
@@ -242,6 +242,8 @@ export const Upload = connect({
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const
{
listType
,
locale
,
onChange
,
value
,
...
others
}
=
this
.
props
console
.
log
(
'this.state.value'
,
this
.
state
.
value
)
if
(
listType
.
indexOf
(
'card'
)
>
-
1
)
{
return
(
<
AntdUpload
...
...
@@ -251,7 +253,9 @@ export const Upload = connect({
onRemove=
{
this
.
onRemoveHandler
}
listType=
{
'picture-card'
}
>
<
UploadPlaceholder
/>
{
!
others
.
readOnly
?
(
<
UploadPlaceholder
/>
)
:
null
}
</
AntdUpload
>
)
}
...
...
src/pages/transaction/purchaserEvaluation/sent/components/DetailInfo/effects/useBusinessEffects.tsx
View file @
a1dd8442
...
...
@@ -18,7 +18,9 @@ export const useBusinessEffects = (context, actions) => {
return
`comments.
${
$1
}
.picture`
}),
state
=>
{
state
.
props
[
'x-component-props'
].
disabled
=
value
.
length
>=
4
;
// 禁用掉 或者 editable 设置成 false,删除按钮也会禁用掉的
// 所以目前先用过 rules 去限制最多可上传多少张
// state.props['x-component-props'].disabled = value.length >= 4;
}
);
});
...
...
src/pages/transaction/purchaserEvaluation/sent/components/DetailInfo/index.tsx
View file @
a1dd8442
...
...
@@ -117,6 +117,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
id
,
star
,
comment
,
pics
:
picture
.
map
(
item
=>
item
.
status
===
'done'
&&
item
.
data
.
url
).
filter
(
Boolean
),
};
});
...
...
@@ -130,9 +131,11 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}
else
{
setSubmitLoading
(
false
);
}
})
.
finally
(()
=>
{
.
catch
(()
=>
{
setSubmitLoading
(
false
);
});
};
...
...
@@ -228,17 +231,6 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
}
}
effects=
{
(
$
,
actions
)
=>
{
createEffects
(
$
,
actions
);
onFormInit$
().
subscribe
(()
=>
{
if
(
isEdit
)
{
actions
.
setFieldState
(
'comments.*.picture'
,
state
=>
{
state
.
visible
=
false
;
}
);
}
});
}
}
schema=
{
evaluateSchema
}
/>
...
...
src/pages/transaction/purchaserEvaluation/sent/components/DetailInfo/schema/index.ts
View file @
a1dd8442
...
...
@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-23 17:00:24
* @LastEditors: XieZhiXiong
* @LastEditTime: 202
0-10-19 16:23:2
4
* @LastEditTime: 202
1-01-07 15:04:4
4
* @Description:
*/
import
{
ISchema
}
from
'@formily/antd'
;
...
...
@@ -76,6 +76,12 @@ export const evaluateSchema: ISchema = {
beforeUpload
:
'{{beforeUpload}}'
,
accept
:
'.png, .jpg, .jpeg'
,
},
'x-rules'
:
[
{
len
:
4
,
message
:
'最多可上传4张图片'
,
},
],
'x-mega-props'
:
{
addonAfter
:
'{{UploadTip}}'
,
},
...
...
src/pages/transaction/purchaserEvaluation/unevaluated/evaluate/index.tsx
View file @
a1dd8442
...
...
@@ -116,8 +116,10 @@ const EvaluateOrder: React.FC = () => {
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}
else
{
setSubmitLoading
(
false
);
}
}).
finally
(()
=>
{
}).
catch
(()
=>
{
setSubmitLoading
(
false
);
});
};
...
...
src/pages/transaction/supplierEvaluation/sent/components/DetailInfo/effects/useBusinessEffects.tsx
View file @
a1dd8442
...
...
@@ -18,7 +18,9 @@ export const useBusinessEffects = (context, actions) => {
return
`comments.
${
$1
}
.picture`
}),
state
=>
{
state
.
props
[
'x-component-props'
].
disabled
=
value
.
length
>=
4
;
// 禁用掉 或者 editable 设置成 false,删除按钮也会禁用掉的
// 所以目前先用过 rules 去限制最多可上传多少张
// state.props['x-component-props'].disabled = value.length >= 4;
}
);
});
...
...
src/pages/transaction/supplierEvaluation/sent/components/DetailInfo/index.tsx
View file @
a1dd8442
...
...
@@ -116,6 +116,7 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
id
,
star
,
comment
,
pics
:
picture
.
map
(
item
=>
item
.
status
===
'done'
&&
item
.
data
.
url
).
filter
(
Boolean
),
};
});
...
...
@@ -129,9 +130,11 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}
else
{
setSubmitLoading
(
false
);
}
})
.
finally
(()
=>
{
.
catch
(()
=>
{
setSubmitLoading
(
false
);
});
};
...
...
@@ -229,17 +232,6 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
}
}
effects=
{
(
$
,
actions
)
=>
{
createEffects
(
$
,
actions
);
onFormInit$
().
subscribe
(()
=>
{
if
(
isEdit
)
{
actions
.
setFieldState
(
'comments.*.picture'
,
state
=>
{
state
.
visible
=
false
;
}
);
}
});
}
}
schema=
{
evaluateSchema
}
/>
...
...
src/pages/transaction/supplierEvaluation/sent/components/DetailInfo/schema/index.ts
View file @
a1dd8442
...
...
@@ -76,6 +76,12 @@ export const evaluateSchema: ISchema = {
beforeUpload
:
'{{beforeUpload}}'
,
accept
:
'.png, .jpg, .jpeg'
,
},
'x-rules'
:
[
{
len
:
4
,
message
:
'最多可上传4张图片'
,
},
],
'x-mega-props'
:
{
addonAfter
:
'{{UploadTip}}'
,
},
...
...
src/pages/transaction/supplierEvaluation/unevaluated/evaluate/index.tsx
View file @
a1dd8442
...
...
@@ -116,8 +116,10 @@ const EvaluateOrder: React.FC = () => {
setTimeout
(()
=>
{
history
.
goBack
();
},
800
);
}
else
{
setSubmitLoading
(
false
);
}
}).
finally
(()
=>
{
}).
catch
(()
=>
{
setSubmitLoading
(
false
);
});
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment