|
@@ -16,56 +16,57 @@
|
|
|
</component>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
-import Header from './header.vue';
|
|
|
-import Content from './content.vue';
|
|
|
-import ModuleLeft from './original/moduleLeft.vue';
|
|
|
-import ModuleBottom from './original/moduleBottom.vue';
|
|
|
-import { computed, ref } from 'vue';
|
|
|
-import { openWindow } from '/@/utils';
|
|
|
-import { getFormattedText } from '../hooks/helper';
|
|
|
-// import { ModuleProps } from '../types';
|
|
|
+ import Header from './header.vue';
|
|
|
+ import Content from './content.vue';
|
|
|
+ import ModuleLeft from './original/moduleLeft.vue';
|
|
|
+ import ModuleRight from './original/moduleRight.vue';
|
|
|
+ import ModuleBottom from './original/moduleBottom.vue';
|
|
|
+ import { computed, ref } from 'vue';
|
|
|
+ import { openWindow } from '/@/utils';
|
|
|
+ import { getFormattedText } from '../hooks/helper';
|
|
|
+ // import { ModuleProps } from '../types';
|
|
|
|
|
|
-const props = defineProps<{
|
|
|
- /** 配置的详细模块信息 */
|
|
|
- moduleData: any;
|
|
|
- /** 配置的详细样式信息 */
|
|
|
- showStyle: any;
|
|
|
- /** 该模块配置中的设备标识符 */
|
|
|
- deviceType: string;
|
|
|
- /** api返回的数据 */
|
|
|
- data: any;
|
|
|
- moduleName: string;
|
|
|
- visible: boolean;
|
|
|
-}>();
|
|
|
-defineEmits(['close', 'click']);
|
|
|
+ const props = defineProps<{
|
|
|
+ /** 配置的详细模块信息 */
|
|
|
+ moduleData: any;
|
|
|
+ /** 配置的详细样式信息 */
|
|
|
+ showStyle: any;
|
|
|
+ /** 该模块配置中的设备标识符 */
|
|
|
+ deviceType: string;
|
|
|
+ /** api返回的数据 */
|
|
|
+ data: any;
|
|
|
+ moduleName: string;
|
|
|
+ visible: boolean;
|
|
|
+ }>();
|
|
|
+ defineEmits(['close', 'click']);
|
|
|
|
|
|
-const { header } = props.moduleData;
|
|
|
-const selectedData = ref();
|
|
|
+ const { header } = props.moduleData;
|
|
|
+ const selectedData = ref();
|
|
|
|
|
|
-const style = computed(() => {
|
|
|
- const size = props.showStyle.size;
|
|
|
- const position = props.showStyle.position;
|
|
|
- return size + position;
|
|
|
-});
|
|
|
+ const style = computed(() => {
|
|
|
+ const size = props.showStyle.size;
|
|
|
+ const position = props.showStyle.position;
|
|
|
+ return size + position;
|
|
|
+ });
|
|
|
|
|
|
-// 根据配置里的定位判断应该使用哪个module组件
|
|
|
-function getModuleComponent({ size, position }) {
|
|
|
- const [_, width] = size.match(/width:([0-9]+)px/) || [];
|
|
|
- if (position.includes('bottom') || parseInt(width) > 800) {
|
|
|
+ // 根据配置里的定位判断应该使用哪个module组件
|
|
|
+ function getModuleComponent({ size, position }) {
|
|
|
+ const [_, width] = size.match(/width:([0-9]+)px/) || [];
|
|
|
+ if (position.includes('bottom') || parseInt(width) > 800) {
|
|
|
+ return ModuleBottom;
|
|
|
+ }
|
|
|
+ if (position.includes('left')) {
|
|
|
+ return ModuleLeft;
|
|
|
+ }
|
|
|
+ if (position.includes('right')) {
|
|
|
+ return ModuleRight;
|
|
|
+ }
|
|
|
return ModuleBottom;
|
|
|
}
|
|
|
- if (position.includes('left')) {
|
|
|
- return ModuleLeft;
|
|
|
- }
|
|
|
- if (position.includes('right')) {
|
|
|
- return ModuleLeft;
|
|
|
- }
|
|
|
- return ModuleBottom;
|
|
|
-}
|
|
|
|
|
|
-function redirectTo() {
|
|
|
- const { to } = props.moduleData;
|
|
|
- if (!to) return;
|
|
|
- openWindow(getFormattedText(selectedData.value, to));
|
|
|
-}
|
|
|
+ function redirectTo() {
|
|
|
+ const { to } = props.moduleData;
|
|
|
+ if (!to) return;
|
|
|
+ openWindow(getFormattedText(selectedData.value, to));
|
|
|
+ }
|
|
|
</script>
|