|
@@ -1,7 +1,6 @@
|
|
|
<script setup lang="ts">
|
|
|
-import {h, nextTick, ref, getCurrentInstance} from "vue";
|
|
|
+import {h, nextTick, ref, getCurrentInstance, onActivated, watch, onUnmounted} from "vue";
|
|
|
import * as vue from 'vue'
|
|
|
-import * as ElementPlus from 'element-plus'
|
|
|
import {PageHeader, PageJsonObject} from "@/api/reports/report-query-center";
|
|
|
import {useCompRef} from "@/utils/useCompRef";
|
|
|
import {ElButton, ElForm, ElOption} from "element-plus";
|
|
@@ -18,8 +17,9 @@ import PageHelpOtherConfigurations
|
|
|
import {getWindowSize} from "@/utils/window-size";
|
|
|
import {ExcelName, Export} from '@/utils/ExportExcel'
|
|
|
import {userInfoStore} from "@/utils/store-public";
|
|
|
-import {capitalizeFirstLetter, usePageStore} from "@/views/data-base/page-editor-help-v2/page-help-v2";
|
|
|
+import {capitalizeFirstLetter, usePageStore , ElAndXc} from "@/views/data-base/page-editor-help-v2/page-help-v2";
|
|
|
import {generateRandomString} from "@/utils/getUuid";
|
|
|
+import {shortcutTrigger, xcEvent} from "@/utils/xckeydown";
|
|
|
|
|
|
interface Props {
|
|
|
componentAttribute?: any
|
|
@@ -49,7 +49,7 @@ const store = usePageStore()
|
|
|
//@ts-ignore
|
|
|
pageHelp.store = store
|
|
|
|
|
|
-const {currentClickIndex, pageData, clearOnAndFunc} = store
|
|
|
+const {currentClickIndex, pageData, clearOnAndFunc, tableBind, handleSavaData} = store
|
|
|
|
|
|
|
|
|
const formRef = useCompRef(ElForm)
|
|
@@ -100,7 +100,7 @@ const render = (item: PageHeader) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return h(ElementPlus[item.name], tempProps, () => child)
|
|
|
+ return h(ElAndXc[item.name], tempProps, () => child)
|
|
|
}
|
|
|
|
|
|
const isActive = (index) => {
|
|
@@ -171,10 +171,6 @@ function initTable() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const tableBind = ref({
|
|
|
- data: [],
|
|
|
- columns: []
|
|
|
-})
|
|
|
const dialogTableData = ref({
|
|
|
data: [],
|
|
|
columns: []
|
|
@@ -290,7 +286,7 @@ function handelColumnFunc(data) {
|
|
|
}
|
|
|
for (let key in item.func) {
|
|
|
const newFunc = new Function("row", "pageData", "apiFunc", "el", "vue", "openDialogAndSetData", item.func[key])
|
|
|
- item[key] = (row) => newFunc(row, pageData.value, reportQueryCenterApi, ElementPlus, vue, openDialogAndSetData)
|
|
|
+ item[key] = (row) => newFunc(row, pageData.value, reportQueryCenterApi, ElAndXc, vue, openDialogAndSetData)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -352,6 +348,24 @@ function exportExcel(data: {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+let shortcutKeyRegistration = {
|
|
|
+ ctrl: {s: handleSavaData}
|
|
|
+}
|
|
|
+
|
|
|
+let keyWatch = null
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ keyWatch && keyWatch()
|
|
|
+})
|
|
|
+
|
|
|
+onActivated(() => {
|
|
|
+ if (props.addComponent) {
|
|
|
+ keyWatch = watch(() => xcEvent.value, () => {
|
|
|
+ shortcutTrigger(xcEvent.value, shortcutKeyRegistration)
|
|
|
+ })
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
defineExpose({
|
|
|
setPageData,
|
|
|
setTableData,
|
|
@@ -410,6 +424,8 @@ defineExpose({
|
|
|
</div>
|
|
|
<div class="cy-page_help_v2-main" v-loading="loading">
|
|
|
<el-table-v2 v-bind="tableBind"
|
|
|
+ :h-scrollbar-size="10"
|
|
|
+ :v-scrollbar-size="10"
|
|
|
:height="height - headerHeight"
|
|
|
:width="width"/>
|
|
|
</div>
|
|
@@ -420,6 +436,8 @@ defineExpose({
|
|
|
<cy-auto-size>
|
|
|
<template #default="{width}">
|
|
|
<el-table-v2 v-bind="dialogTableData"
|
|
|
+ :h-scrollbar-size="12"
|
|
|
+ :v-scrollbar-size="12"
|
|
|
:height="getWindowSize.h - 500"
|
|
|
:width="width - 10"/>
|
|
|
</template>
|
|
@@ -445,10 +463,7 @@ defineExpose({
|
|
|
v-if="props.addComponent"/>
|
|
|
|
|
|
<PageHelpOtherConfigurations v-if="props.otherConfigurations"
|
|
|
- :data="pageData"
|
|
|
- :table-data="tableBind.data"
|
|
|
- :pageHeader="pageData.header"
|
|
|
- v-model:submitUrl="pageData.submitUrl"
|
|
|
+ :store="store"
|
|
|
:teleport-div="props.otherConfigurations"/>
|
|
|
|
|
|
</template>
|