@cqsjjb/jjb-react-admin-component 3.0.27 → 3.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,6 +56,10 @@ interface FormilyDescriptionsProps extends ComponentProps {
|
|
|
56
56
|
* @see https://ant.design/components/descriptions-cn#descriptions
|
|
57
57
|
*/
|
|
58
58
|
contentStyle?: React.CSSProperties;
|
|
59
|
+
/**
|
|
60
|
+
* @description 是否外部预览?
|
|
61
|
+
*/
|
|
62
|
+
extraFileLink: boolean;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
interface FormilyDescriptionsFc extends React.FC<FormilyDescriptionsProps> {
|
|
@@ -69,7 +69,8 @@ export function ItemRender(props) {
|
|
|
69
69
|
data,
|
|
70
70
|
imageWidth,
|
|
71
71
|
imageHeight,
|
|
72
|
-
imagePreview
|
|
72
|
+
imagePreview,
|
|
73
|
+
extraFileLink
|
|
73
74
|
} = props;
|
|
74
75
|
return /*#__PURE__*/React.createElement(React.Fragment, null, tools.isArray(data.value) ? tools.isStringArray(data.value) || tools.isNumberArray(data.value) ? data.value.join('、') : tools.isObjectArray(data.value) ? data.formType === 'Table' ? /*#__PURE__*/React.createElement("div", {
|
|
75
76
|
style: {
|
|
@@ -93,7 +94,12 @@ export function ItemRender(props) {
|
|
|
93
94
|
src: next.url,
|
|
94
95
|
width: imageWidth || 64,
|
|
95
96
|
height: imageHeight || 64,
|
|
96
|
-
preview:
|
|
97
|
+
preview: extraFileLink ? {
|
|
98
|
+
visible: false,
|
|
99
|
+
onVisibleChange: e => {
|
|
100
|
+
window.open(next.url);
|
|
101
|
+
}
|
|
102
|
+
} : imagePreview
|
|
97
103
|
}));
|
|
98
104
|
} else {
|
|
99
105
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -106,9 +112,13 @@ export function ItemRender(props) {
|
|
|
106
112
|
alignItems: 'center'
|
|
107
113
|
},
|
|
108
114
|
onClick: () => {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
115
|
+
if (extraFileLink) {
|
|
116
|
+
window.open(next.url);
|
|
117
|
+
} else {
|
|
118
|
+
setType('pdf');
|
|
119
|
+
setOpen(true);
|
|
120
|
+
setPreviewUrl(next.url);
|
|
121
|
+
}
|
|
112
122
|
}
|
|
113
123
|
}, /*#__PURE__*/React.createElement(FilePdfOutlined, null), "\u70B9\u51FB\u67E5\u770B") : /\.(mp4|ogg|mkv|webm)$/.test(next.url) ? /*#__PURE__*/React.createElement("a", {
|
|
114
124
|
key: nextIndex,
|
|
@@ -118,9 +128,13 @@ export function ItemRender(props) {
|
|
|
118
128
|
alignItems: 'center'
|
|
119
129
|
},
|
|
120
130
|
onClick: () => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
if (props.extraFileLink) {
|
|
132
|
+
window.open(next.url);
|
|
133
|
+
} else {
|
|
134
|
+
setType('video');
|
|
135
|
+
setOpen(true);
|
|
136
|
+
setPreviewUrl(next.url);
|
|
137
|
+
}
|
|
124
138
|
}
|
|
125
139
|
}, /*#__PURE__*/React.createElement(PlayCircleOutlined, null), "\u70B9\u51FB\u67E5\u770B") : /*#__PURE__*/React.createElement("a", {
|
|
126
140
|
key: nextIndex,
|
|
@@ -84,7 +84,8 @@ export function ItemRender(props) {
|
|
|
84
84
|
data,
|
|
85
85
|
imageWidth,
|
|
86
86
|
imageHeight,
|
|
87
|
-
imagePreview
|
|
87
|
+
imagePreview,
|
|
88
|
+
extraFileLink
|
|
88
89
|
} = props;
|
|
89
90
|
|
|
90
91
|
return (
|
|
@@ -121,7 +122,12 @@ export function ItemRender(props) {
|
|
|
121
122
|
src={next.url}
|
|
122
123
|
width={imageWidth || 64}
|
|
123
124
|
height={imageHeight || 64}
|
|
124
|
-
preview={
|
|
125
|
+
preview={extraFileLink ? {
|
|
126
|
+
visible: false,
|
|
127
|
+
onVisibleChange: e => {
|
|
128
|
+
window.open(next.url);
|
|
129
|
+
}
|
|
130
|
+
} : imagePreview}
|
|
125
131
|
/>
|
|
126
132
|
</span>
|
|
127
133
|
);
|
|
@@ -138,9 +144,13 @@ export function ItemRender(props) {
|
|
|
138
144
|
alignItems: 'center'
|
|
139
145
|
}}
|
|
140
146
|
onClick={() => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
147
|
+
if (extraFileLink) {
|
|
148
|
+
window.open(next.url);
|
|
149
|
+
} else {
|
|
150
|
+
setType('pdf');
|
|
151
|
+
setOpen(true);
|
|
152
|
+
setPreviewUrl(next.url);
|
|
153
|
+
}
|
|
144
154
|
}}
|
|
145
155
|
>
|
|
146
156
|
<FilePdfOutlined />
|
|
@@ -157,9 +167,13 @@ export function ItemRender(props) {
|
|
|
157
167
|
alignItems: 'center'
|
|
158
168
|
}}
|
|
159
169
|
onClick={() => {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
170
|
+
if (props.extraFileLink) {
|
|
171
|
+
window.open(next.url);
|
|
172
|
+
} else {
|
|
173
|
+
setType('video');
|
|
174
|
+
setOpen(true);
|
|
175
|
+
setPreviewUrl(next.url);
|
|
176
|
+
}
|
|
163
177
|
}}
|
|
164
178
|
>
|
|
165
179
|
<PlayCircleOutlined />
|