|
@@ -408,8 +408,7 @@ function useBdMediaPup() {
|
|
|
}
|
|
|
|
|
|
/**编辑非图文素材名称*/
|
|
|
- const nameOk = useCallback(
|
|
|
- (selectWx: any) => {
|
|
|
+ const nameOk = useCallback((selectWx: any) => {
|
|
|
if (fileName && actionItem) {
|
|
|
let obj = {
|
|
|
title: fileName,
|
|
@@ -420,10 +419,10 @@ function useBdMediaPup() {
|
|
|
url: actionItem?.url,
|
|
|
sort,
|
|
|
};
|
|
|
- if (mediaType === 'VIDEO') {
|
|
|
- obj['videoTitle'] = videoTitle;
|
|
|
- obj['videoDescription'] = videoDescription;
|
|
|
- }
|
|
|
+ // if (mediaType === 'VIDEO') {
|
|
|
+ // obj['videoTitle'] = videoTitle;
|
|
|
+ // obj['videoDescription'] = videoDescription;
|
|
|
+ // }
|
|
|
edit.run(obj).then((res) => {
|
|
|
list.refresh();
|
|
|
offEditFile(); //关闭弹窗并清空相关数据
|
|
@@ -433,8 +432,7 @@ function useBdMediaPup() {
|
|
|
[fileName, actionItem, edit, belongUser, mediaType, videoTitle, videoDescription],
|
|
|
);
|
|
|
/**删除文件 */
|
|
|
- const dels = useCallback(
|
|
|
- (id?: any) => {
|
|
|
+ const dels = useCallback((id?: any) => {
|
|
|
let arr = typeof id === 'number' ? [id] : selectFile;
|
|
|
let len = arr?.length || 0;
|
|
|
if (len) {
|
|
@@ -447,6 +445,8 @@ function useBdMediaPup() {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
+ } else {
|
|
|
+ message.error('请选择文件')
|
|
|
}
|
|
|
},
|
|
|
[list, selectFile, mediaType],
|
|
@@ -623,24 +623,16 @@ function useBdMediaPup() {
|
|
|
offFile(null, { id: delPupId });
|
|
|
}, [delPupId]);
|
|
|
/**编辑 */
|
|
|
- const editFile = useCallback(
|
|
|
- (e?: any) => {
|
|
|
- e?.stopPropagation();
|
|
|
- onFile(null, rightClickPup, true, true);
|
|
|
- // if (rightClickPup?.mediaType !== 'news') {//不是图文开启编辑名字弹窗
|
|
|
- let obj = {
|
|
|
- fileVisible: true,
|
|
|
- actionItem: rightClickPup,
|
|
|
- fileName: rightClickPup.title,
|
|
|
- sort: rightClickPup.sort,
|
|
|
- };
|
|
|
- if (rightClickPup?.mediaType === 'video') {
|
|
|
- obj['videoTitle'] = rightClickPup?.videoTitle || rightClickPup?.title;
|
|
|
- obj['videoDescription'] = rightClickPup?.videoDescription;
|
|
|
- }
|
|
|
- set(obj);
|
|
|
- // }
|
|
|
- },
|
|
|
+ const editFile = useCallback((e?: any) => {
|
|
|
+ e?.stopPropagation();
|
|
|
+ onFile(null, rightClickPup, true, true);
|
|
|
+ let obj = { fileVisible: true, actionItem: { ...rightClickPup, fileType: mediaType }, fileName: rightClickPup.title, sort: rightClickPup.sort };
|
|
|
+ // if (rightClickPup?.mediaType === "video") {
|
|
|
+ // obj['videoTitle'] = rightClickPup?.videoTitle || rightClickPup?.title;
|
|
|
+ // obj['videoDescription'] = rightClickPup?.videoDescription;
|
|
|
+ // }
|
|
|
+ set(obj);
|
|
|
+ },
|
|
|
[rightClickPup],
|
|
|
);
|
|
|
/**取消编辑后清空选中存放的数据并关闭弹窗*/
|