|
|
@@ -1,61 +1,42 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <InfoWindow
|
|
|
- :info-window-no="infoWindowNo" :multiple="true" :is-search-widget="false" :is-new-similar-assets="false"
|
|
|
- @get-select-model-data="getSelectModelData"
|
|
|
- >
|
|
|
+ <InfoWindow ref="infoWindowRef" :info-window-no="infoWindowNo" :multiple="true" :is-search-widget="true">
|
|
|
+ <template #customButton>
|
|
|
+ <a-button :icon="h(PlusCircleTwoTone)" @click="getSelectModelData">自定义按钮</a-button>
|
|
|
+ <a-button :icon="h(PlusCircleTwoTone)" @click="getSelectModelData">自定义按钮</a-button>
|
|
|
+ </template>
|
|
|
<template #customContent>
|
|
|
<div>这是自定义内容</div>
|
|
|
</template>
|
|
|
</InfoWindow>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script>
|
|
|
-
|
|
|
+<script setup>
|
|
|
import InfoWindow from '@/info/index.js';
|
|
|
+import { ref, getCurrentInstance, h, onMounted } from 'vue';
|
|
|
+import { PlusCircleTwoTone } from '@ant-design/icons-vue';
|
|
|
+
|
|
|
+const infoWindowNo = ref(null);
|
|
|
+const infoWindowRef = ref(null);
|
|
|
+const { proxy } = getCurrentInstance(); //访问this
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getInfoWindowNo();
|
|
|
+});
|
|
|
+
|
|
|
+const getInfoWindowNo = () => {
|
|
|
+ if (proxy.$route.params != undefined) {
|
|
|
+ var routeInfoWindowNo = proxy.$route.params.infoWindowNo;
|
|
|
+ if (infoWindowNo.value != routeInfoWindowNo) {
|
|
|
+ infoWindowNo.value = routeInfoWindowNo;
|
|
|
+ console.log('open info window: ' + routeInfoWindowNo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
|
|
|
-export default {
|
|
|
- components: {
|
|
|
- InfoWindow,
|
|
|
- },
|
|
|
-
|
|
|
- props: {
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- data: function () {
|
|
|
- return {
|
|
|
- 'infoWindowNo': null,
|
|
|
- };
|
|
|
- },
|
|
|
-
|
|
|
- watch: {
|
|
|
- '$route': function (to, from) {
|
|
|
- this.getInfoWindowNo();
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
- mounted: function () {
|
|
|
- this.getInfoWindowNo();
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- /**
|
|
|
- * 获取查询窗口的编号
|
|
|
- */
|
|
|
- getInfoWindowNo: function () {
|
|
|
- if (this.$route.params != undefined) {
|
|
|
- var routeInfoWindowNo = this.$route.params.infoWindowNo;
|
|
|
- if (this.infoWindowNo != routeInfoWindowNo) {
|
|
|
- this.infoWindowNo = routeInfoWindowNo;
|
|
|
- console.log('open info window: ' + routeInfoWindowNo);
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- getSelectModelData: function (selected) {
|
|
|
- console.log(selected, '---');
|
|
|
- },
|
|
|
- },
|
|
|
+const getSelectModelData = () => {
|
|
|
+ const selectDatas = infoWindowRef.value.getSelectedModelDatas();
|
|
|
+ console.log(selectDatas, '---');
|
|
|
};
|
|
|
|
|
|
</script>
|