|
@@ -222,9 +222,10 @@
|
|
|
|
|
|
<!--查看表单-->
|
|
<!--查看表单-->
|
|
<template v-for="(item,index) in DragModalTableForm">
|
|
<template v-for="(item,index) in DragModalTableForm">
|
|
- <HcDragModal :eid="item.pkeyId" :height="DragModalHeight" :isShow="item.isShow" :loading="item.loading"
|
|
|
|
- :loadingText="item.loadingText" :title="item.title"
|
|
|
|
- isSortTop @close="TableFormClose(item, index)">
|
|
|
|
|
|
+ <HcDragModal :closeIconArr="closeIconArr" :eid="item.pkeyId" :height="DragModalHeight" :isShow="item.isShow"
|
|
|
|
+ :loading="item.loading" :loadingText="item.loadingText" :title="item.title"
|
|
|
|
+ isSortTop
|
|
|
|
+ @close="TableFormClose(item, index)" @closeIconTap="closeIconTap($event, item, index)">
|
|
<HcDragNode :more-menu="dragNodeMoreMenu" @menuTap="dragNodeMoreMenuTap($event, item)">
|
|
<HcDragNode :more-menu="dragNodeMoreMenu" @menuTap="dragNodeMoreMenuTap($event, item)">
|
|
<HcTableForm :ref="(el) => setItemRefs(el, item)" :api="apis" :classify="item.classify"
|
|
<HcTableForm :ref="(el) => setItemRefs(el, item)" :api="apis" :classify="item.classify"
|
|
:datas="changeFormDatas(item?.pkeyId, 'window')" :height="item.height"
|
|
:datas="changeFormDatas(item?.pkeyId, 'window')" :height="item.height"
|
|
@@ -235,6 +236,7 @@
|
|
</HcDragModal>
|
|
</HcDragModal>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
+
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
@@ -250,7 +252,7 @@ import HcTestFile from "./test-file.vue"
|
|
import HcFormula from "./formula.vue"
|
|
import HcFormula from "./formula.vue"
|
|
import HcDragNode from "~com/drag-node/index.vue"
|
|
import HcDragNode from "~com/drag-node/index.vue"
|
|
import NoDataSvg from '~src/assets/view/no-data.svg'
|
|
import NoDataSvg from '~src/assets/view/no-data.svg'
|
|
-import {setPosRange, isType, utilsArray, deepClone} from "vue-utils-plus"
|
|
|
|
|
|
+import {setPosRange, isType, utilsArray, deepClone, isArray} from "vue-utils-plus"
|
|
//初始变量
|
|
//初始变量
|
|
const useAppState = useAppStore()
|
|
const useAppState = useAppStore()
|
|
const {isIndex, getIndex} = utilsArray()
|
|
const {isIndex, getIndex} = utilsArray()
|
|
@@ -339,6 +341,10 @@ const setSpliceItemRefs = async ({pkeyId}) => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+const closeIconArr = [
|
|
|
|
+ {key: 'reduction', icon: 'picture-in-picture-2', name: '还原到面板内,并自动展开面板'}
|
|
|
|
+]
|
|
|
|
+
|
|
//事件
|
|
//事件
|
|
const emit = defineEmits(['renew', 'offsetTop'])
|
|
const emit = defineEmits(['renew', 'offsetTop'])
|
|
|
|
|
|
@@ -706,42 +712,37 @@ const formulaModalClose = () => {
|
|
const DragModalTableForm = ref([])
|
|
const DragModalTableForm = ref([])
|
|
const DragModalHeight = ref(600)
|
|
const DragModalHeight = ref(600)
|
|
const windowClick = async (item, indexs) => {
|
|
const windowClick = async (item, indexs) => {
|
|
- let KeyId = `item-${indexs}-${item?.pkeyId}`
|
|
|
|
- if (KeyId === ActiveKey.value) {
|
|
|
|
- const list = DragModalTableForm.value
|
|
|
|
- let index = getIndex(list, 'pkeyId', item.pkeyId)
|
|
|
|
- if (!item.isWindow) {
|
|
|
|
- const formSize = getTableFormSize(item?.pkeyId)
|
|
|
|
- const newTableForm = {
|
|
|
|
- ...setInitDragModalTableForm(item, indexs),
|
|
|
|
- ...formSize
|
|
|
|
- }
|
|
|
|
- await setChangeFormDatas(item?.pkeyId, 'window')
|
|
|
|
- item.isWindow = true
|
|
|
|
- //处理表单的ref
|
|
|
|
- await setSpliceItemRefs(item)
|
|
|
|
- //弹窗表单的排序
|
|
|
|
- if (index === -1) {
|
|
|
|
- list.push(newTableForm)
|
|
|
|
- } else if (index !== list.length - 1) {
|
|
|
|
- //检查是否在最上层,不在则置顶,可以解决多次点击时,频繁更改全局状态的问题
|
|
|
|
- list.splice(index, 1)
|
|
|
|
- list.push(newTableForm)
|
|
|
|
- }
|
|
|
|
- DragModalTableForm.value = list
|
|
|
|
- ActiveKey.value = []
|
|
|
|
- } else {
|
|
|
|
- await setChangeFormDatas(item?.pkeyId, 'collapse')
|
|
|
|
- //处理表单的ref
|
|
|
|
- await setSpliceItemRefs(item)
|
|
|
|
- if (index !== -1) {
|
|
|
|
- list.splice(index, 1)
|
|
|
|
- DragModalTableForm.value = list
|
|
|
|
- }
|
|
|
|
- item.isWindow = false
|
|
|
|
|
|
+ const list = DragModalTableForm.value
|
|
|
|
+ let index = getIndex(list, 'pkeyId', item.pkeyId)
|
|
|
|
+ if (!item.isWindow) {
|
|
|
|
+ const formSize = getTableFormSize(item?.pkeyId)
|
|
|
|
+ const newTableForm = {
|
|
|
|
+ ...setInitDragModalTableForm(item, indexs),
|
|
|
|
+ ...formSize
|
|
|
|
+ }
|
|
|
|
+ await setChangeFormDatas(item?.pkeyId, 'window')
|
|
|
|
+ item.isWindow = true
|
|
|
|
+ //处理表单的ref
|
|
|
|
+ await setSpliceItemRefs(item)
|
|
|
|
+ //弹窗表单的排序
|
|
|
|
+ if (index === -1) {
|
|
|
|
+ list.push(newTableForm)
|
|
|
|
+ } else if (index !== list.length - 1) {
|
|
|
|
+ //检查是否在最上层,不在则置顶,可以解决多次点击时,频繁更改全局状态的问题
|
|
|
|
+ list.splice(index, 1)
|
|
|
|
+ list.push(newTableForm)
|
|
}
|
|
}
|
|
|
|
+ DragModalTableForm.value = list
|
|
|
|
+ ActiveKey.value = []
|
|
} else {
|
|
} else {
|
|
- window.$message.warning('请先展开此表单,等待表单渲染完成后再操作')
|
|
|
|
|
|
+ await setChangeFormDatas(item?.pkeyId, 'collapse')
|
|
|
|
+ //处理表单的ref
|
|
|
|
+ await setSpliceItemRefs(item)
|
|
|
|
+ if (index !== -1) {
|
|
|
|
+ list.splice(index, 1)
|
|
|
|
+ DragModalTableForm.value = list
|
|
|
|
+ }
|
|
|
|
+ item.isWindow = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -781,6 +782,15 @@ const dragNodeMoreMenu = [
|
|
{key: 'preview', icon: 'eye', name: '预览'},
|
|
{key: 'preview', icon: 'eye', name: '预览'},
|
|
]
|
|
]
|
|
|
|
|
|
|
|
+//还原窗口
|
|
|
|
+const closeIconTap = async (event, item, indexs) => {
|
|
|
|
+ console.log(event)
|
|
|
|
+ const {index, pkeyId} = item
|
|
|
|
+ let KeyId = `item-${index}-${pkeyId}`
|
|
|
|
+ await TableFormClose(item, indexs)
|
|
|
|
+ ActiveKey.value = [KeyId]
|
|
|
|
+}
|
|
|
|
+
|
|
//菜单被点击
|
|
//菜单被点击
|
|
const dragNodeMoreMenuTap = ({key}, items) => {
|
|
const dragNodeMoreMenuTap = ({key}, items) => {
|
|
const {item} = items
|
|
const {item} = items
|
|
@@ -1060,16 +1070,17 @@ const delWindowRefs = (pkeyId) => {
|
|
|
|
|
|
//计算展开高度和滚动位置
|
|
//计算展开高度和滚动位置
|
|
const getOffsetTop = (key = '') => {
|
|
const getOffsetTop = (key = '') => {
|
|
|
|
+ const keys = ActiveKey.value
|
|
if (key) {
|
|
if (key) {
|
|
const dom = document.getElementById(key[key.length - 1])
|
|
const dom = document.getElementById(key[key.length - 1])
|
|
if (!draw_type.value) {
|
|
if (!draw_type.value) {
|
|
- if (dom?.offsetTop >= 583 && ActiveKey.value.length > 1) {
|
|
|
|
|
|
+ if (dom?.offsetTop >= 583 && keys.length > 1) {
|
|
emit('offsetTop', dom?.offsetTop - 583)
|
|
emit('offsetTop', dom?.offsetTop - 583)
|
|
} else {
|
|
} else {
|
|
emit('offsetTop', dom?.offsetTop)
|
|
emit('offsetTop', dom?.offsetTop)
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (dom.offsetTop >= 424 && ActiveKey.value.length > 1) {
|
|
|
|
|
|
+ if (dom.offsetTop >= 424 && keys.length > 1) {
|
|
emit('offsetTop', dom?.offsetTop - 424)
|
|
emit('offsetTop', dom?.offsetTop - 424)
|
|
} else {
|
|
} else {
|
|
emit('offsetTop', dom?.offsetTop)
|
|
emit('offsetTop', dom?.offsetTop)
|
|
@@ -1078,7 +1089,7 @@ const getOffsetTop = (key = '') => {
|
|
} else {
|
|
} else {
|
|
emit('offsetTop', 0)
|
|
emit('offsetTop', 0)
|
|
}
|
|
}
|
|
- ActiveKey.value = ActiveKey.value[ActiveKey.value.length - 1]
|
|
|
|
|
|
+ ActiveKey.value = [keys[keys.length - 1]]
|
|
}
|
|
}
|
|
|
|
|
|
//获取折叠面板的索引
|
|
//获取折叠面板的索引
|
|
@@ -1168,7 +1179,13 @@ const getActiveKey = () => {
|
|
|
|
|
|
//设置当前展开项
|
|
//设置当前展开项
|
|
const setActiveKey = (key) => {
|
|
const setActiveKey = (key) => {
|
|
- return ActiveKey.value = key;
|
|
|
|
|
|
+ let keys = [];
|
|
|
|
+ if (isArray(key)) {
|
|
|
|
+ keys = key
|
|
|
|
+ } else {
|
|
|
|
+ keys.push(key)
|
|
|
|
+ }
|
|
|
|
+ return ActiveKey.value = keys;
|
|
}
|
|
}
|
|
|
|
|
|
// 暴露出去
|
|
// 暴露出去
|