|
@@ -313,10 +313,9 @@
|
|
|
<!-- <t-icon name="share" :class="{ primary: shared }" /> -->
|
|
|
</a>
|
|
|
</t-tooltip>
|
|
|
- <t-popup placement="bottom" v-model="qrcode.visible">
|
|
|
+ <!-- <t-popup placement="bottom" v-model="qrcode.visible">
|
|
|
<a>
|
|
|
<qrcode-icon />
|
|
|
- <!-- <t-icon name="qrcode" /> -->
|
|
|
</a>
|
|
|
<template #content>
|
|
|
<div style="padding: 12px 12px 6px 12px">
|
|
@@ -330,7 +329,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </t-popup>
|
|
|
+ </t-popup> -->
|
|
|
|
|
|
<t-tooltip placement="bottom" :content="$t('云发布')">
|
|
|
<a @click="onShowPublish">
|
|
@@ -773,7 +772,7 @@
|
|
|
</t-dialog>
|
|
|
|
|
|
<!-- 分享弹窗 -->
|
|
|
- <ShareModal :shared="shared" v-model:visible="shareVisible" />
|
|
|
+ <ShareModal :shared="shared" v-model:visible="shareVisible" @change="sChange"/>
|
|
|
<t-dialog
|
|
|
v-if="addDataDialog.show"
|
|
|
:visible="true"
|
|
@@ -2185,6 +2184,7 @@ const onSelDataset = async (init = false) => {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
const registerLe5leTheme = ()=>{
|
|
|
fetch((cdn ? cdn + '/v' : import.meta.env.BASE_URL.slice(0, -1)) + '/theme/custom.json')
|
|
|
.then((r) => r.json())
|
|
@@ -2222,9 +2222,44 @@ const share = async () => {
|
|
|
MessagePlugin.error($t('组件不允许分享!'));
|
|
|
return;
|
|
|
}
|
|
|
- shareVisible.value = true;
|
|
|
+ if(!shared.value){
|
|
|
+ const result = shareChange(!shared.value);
|
|
|
+ if(result){
|
|
|
+ shared.value = !shared.value;
|
|
|
+ MessagePlugin.success(shared.value ? "分享成功!" : "取消分享成功");
|
|
|
+ if(shared.value){
|
|
|
+ shareVisible.value = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ shareVisible.value = true;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
+const sChange = (e)=>{
|
|
|
+ shared.value = e;
|
|
|
+}
|
|
|
+
|
|
|
+//TODO 配置shared无用,图纸不能根据用户id查找
|
|
|
+async function shareChange(shared: boolean) {
|
|
|
+ const id = route.query.id;
|
|
|
+ if (!id) {
|
|
|
+ // 提示需要先保存
|
|
|
+ MessagePlugin.warning("请先保存!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const res: any = await axios.post(`/api/data/v/update`, {
|
|
|
+ _id: id,
|
|
|
+ id: id,
|
|
|
+ shared,
|
|
|
+ });
|
|
|
+ if (res.error) {
|
|
|
+ return false;
|
|
|
+ }else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
let qrTimer: any;
|
|
|
const onEnterQrcode = () => {
|
|
|
if (!qrcode.visible && !qrTimer) {
|