|
@@ -37,26 +37,13 @@ export function createPromotinController(
|
|
|
};
|
|
|
|
|
|
async function sharePromotion(record: any) {
|
|
|
- const userInfo: any = auth.store.userInfo;
|
|
|
- const isSys = userInfo.roles?.includes("system") ? true : false;
|
|
|
- await editor.actions.initDesign(record._id, isSys);
|
|
|
- editor.actions.switchMode("preview");
|
|
|
- resource.showModal(
|
|
|
- <ShareModal record={record} controller={ctrl}>
|
|
|
- {{
|
|
|
- preview: () => (
|
|
|
- <editor.components.Preview class="pointer-events-none" />
|
|
|
- ),
|
|
|
- }}
|
|
|
- </ShareModal>,
|
|
|
- {
|
|
|
- title: "编辑分享",
|
|
|
- width: "1000px",
|
|
|
- destroyOnClose: true,
|
|
|
- }
|
|
|
- );
|
|
|
+ resource.showModal(<ShareModal record={record} controller={ctrl} />, {
|
|
|
+ title: "编辑分享",
|
|
|
+ width: "1000px",
|
|
|
+ destroyOnClose: true,
|
|
|
+ });
|
|
|
}
|
|
|
- let url = ""
|
|
|
+ let url = "";
|
|
|
ctrl.onMenuClick = async (name, record) => {
|
|
|
switch (name) {
|
|
|
case "stat":
|
|
@@ -84,9 +71,12 @@ export function createPromotinController(
|
|
|
break;
|
|
|
|
|
|
case "thumbnail":
|
|
|
- url = await SelectOneImage() as string;
|
|
|
+ url = (await SelectOneImage()) as string;
|
|
|
if (!url) return;
|
|
|
- await resource.https.updatePromotion({_id: record._id, thumbnail: url});
|
|
|
+ await resource.https.updatePromotion({
|
|
|
+ _id: record._id,
|
|
|
+ thumbnail: url,
|
|
|
+ });
|
|
|
record.thumbnail = url;
|
|
|
queenApi.messageSuccess("替换成功");
|
|
|
break;
|