|
@@ -1,10 +1,15 @@
|
|
|
-import { defineComponent, onMounted, reactive } from 'vue';
|
|
|
+import { defineComponent, onMounted, reactive, ref } from 'vue';
|
|
|
import { useUserStore } from '/src/store/modules/users';
|
|
|
import styles from './index.module.less';
|
|
|
+import PreviewWindow from '../preview-window';
|
|
|
+import { state } from '/src/state';
|
|
|
+import { NModal } from 'naive-ui';
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: 'notation-a',
|
|
|
setup() {
|
|
|
+ const previewModal = ref(false);
|
|
|
+ const previewParams = ref({} as any);
|
|
|
const userStore = useUserStore();
|
|
|
const Authorization = userStore.getToken || '';
|
|
|
console.log(Authorization);
|
|
@@ -19,7 +24,16 @@ export default defineComponent({
|
|
|
});
|
|
|
const handleOpen = (e: MessageEvent) => {
|
|
|
if (e.data.api === 'notation_open') {
|
|
|
- window.open(e.data.url);
|
|
|
+ console.log(e.data, state.application);
|
|
|
+ console.log(previewModal.value);
|
|
|
+ // if (!state.application) {
|
|
|
+ previewModal.value = true;
|
|
|
+ previewParams.value = {
|
|
|
+ url: e.data.url
|
|
|
+ };
|
|
|
+ // } else {
|
|
|
+ // window.open(e.data.url);
|
|
|
+ // }
|
|
|
}
|
|
|
};
|
|
|
onMounted(() => {
|
|
@@ -28,6 +42,16 @@ export default defineComponent({
|
|
|
return () => (
|
|
|
<div class={styles.wrap}>
|
|
|
<iframe src={data.src}></iframe>
|
|
|
+
|
|
|
+ <NModal
|
|
|
+ v-model:show={previewModal.value}
|
|
|
+ class={styles.previewWindow}
|
|
|
+ showIcon={false}
|
|
|
+ displayDirective="show">
|
|
|
+ <iframe
|
|
|
+ class={styles.previewIframe}
|
|
|
+ src={previewParams.value.url}></iframe>
|
|
|
+ </NModal>
|
|
|
</div>
|
|
|
);
|
|
|
}
|