zmdms-webui 3.0.3 → 3.0.4
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.
|
@@ -19,6 +19,8 @@ interface IButtonDownloadProps extends Omit<IButtonProps, "onClick"> {
|
|
|
19
19
|
API_BASEURL?: string;
|
|
20
20
|
/** 代理点击事件 如果下载结束后 还需做别的处理 */
|
|
21
21
|
onClick?: (e: any, info: any) => void;
|
|
22
|
+
/** 是否需要水印 */
|
|
23
|
+
isWater?: boolean;
|
|
22
24
|
}
|
|
23
25
|
declare const ButtonDownload: React__default.FC<IButtonDownloadProps>;
|
|
24
26
|
|
|
@@ -9,14 +9,15 @@ import '../config/MyStorage.js';
|
|
|
9
9
|
import myMessage from '../message/index.js';
|
|
10
10
|
|
|
11
11
|
var ButtonDownload = function (props) {
|
|
12
|
-
var attachId = props.attachId, attachName = props.attachName, beforeDownloadHandle = props.beforeDownloadHandle, isPublic = props.isPublic, API_BASEURL = props.API_BASEURL, onClick = props.onClick, resetProps = __rest(props, ["attachId", "attachName", "beforeDownloadHandle", "isPublic", "API_BASEURL", "onClick"]);
|
|
13
|
-
var
|
|
12
|
+
var attachId = props.attachId, attachName = props.attachName, beforeDownloadHandle = props.beforeDownloadHandle, isPublic = props.isPublic, API_BASEURL = props.API_BASEURL, onClick = props.onClick, _a = props.isWater, isWater = _a === void 0 ? true : _a, resetProps = __rest(props, ["attachId", "attachName", "beforeDownloadHandle", "isPublic", "API_BASEURL", "onClick", "isWater"]);
|
|
13
|
+
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
|
14
14
|
var apiBaseUrl = useBaseContext().apiBaseUrl;
|
|
15
15
|
function downloadFileHandle(fileOptions, e) {
|
|
16
16
|
var attachId = fileOptions.attachId, attachName = fileOptions.attachName;
|
|
17
17
|
return downloadFile(attachId, attachName || "", {
|
|
18
18
|
API_BASEURL: API_BASEURL || apiBaseUrl,
|
|
19
19
|
open: isPublic,
|
|
20
|
+
waterMark: isWater,
|
|
20
21
|
})
|
|
21
22
|
.then(function (res) {
|
|
22
23
|
onClick && onClick(e, { result: true });
|