xiaochan 1 rok pred
rodič
commit
2617ba8e93

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 576 - 41
package-lock.json


+ 2 - 0
package.json

@@ -22,6 +22,7 @@
     "driver.js": "^1.3.0",
     "echarts": "^5.2.0",
     "element-plus": "file:deps/element-plus.2.0.4.1.tar.gz",
+    "exceljs": "^4.4.0",
     "file-saver": "^2.0.5",
     "iconv-lite": "^0.6.3",
     "jquery": "^3.6.0",
@@ -39,6 +40,7 @@
     "vue3-print-nb": "^0.1.4",
     "vuex": "^4.0.2",
     "vxe-table": "^4.3.14",
+    "vxe-table-plugin-export-xlsx": "^4.0.1",
     "xe-utils": "^3.5.7",
     "xlsx": "^0.17.0"
   },

+ 1 - 1
src/api/zhu-yuan-yi-sheng/critical-value.js

@@ -4,7 +4,7 @@ export function getCriticalValues(patNo, id) {
     return request({
         url: '/criticalValue/getCriticalValues',
         method: 'get',
-        params: {patNo, id}
+        params: {patNo, id: id}
     })
 }
 

+ 3 - 1
src/components/cy/combo-grid/src/index.ts

@@ -452,7 +452,9 @@ export default function UesComboGrid(props: CyComboGridOptionsV2, emits: any) {
         } else {
             handleSelect()
         }
-        states.inputValue = states.selectedLabel
+        if (!expanded.value) {
+            states.inputValue = states.selectedLabel
+        }
     }
 
 

+ 6 - 0
src/main.js

@@ -20,6 +20,8 @@ import VTitle from "@/directives/v-title";
 import "driver.js/dist/driver.css";
 import DomZIndex from 'dom-zindex'
 import initVxeConfig from "@/utils/vxe-formatter";
+import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
+import ExcelJS from 'exceljs'
 
 DomZIndex.getNext = () => {
     return useZIndex().nextZIndex()
@@ -45,6 +47,10 @@ VXETable.config({
     },
 })
 
+VXETable.use(VXETablePluginExportXLSX, {
+    ExcelJS
+})
+
 app.use(ElementPlus, {locale: zhCn, size: store.state.app.elementSize})
 app.use(store)
 app.use(router)

+ 10 - 4
src/utils/cyRefList.ts

@@ -3,11 +3,17 @@ import XEUtils from "xe-utils";
 import {BizException, ExceptionEnum} from "@/utils/BizException";
 
 
-export function eachAndReturnList<T = any>(list: T[] | Ref<T[]>, iteration: (item: T, index: number) => any) {
+export function eachAndReturnList<T = any>(list: T[] | Ref<T[]> | number, iteration: (item: T, index: number) => any) {
     const temp: any[] = []
-    XEUtils.arrayEach(unref(list), (item, index) => {
-        temp.push(iteration(item, index))
-    })
+    if (XEUtils.isNumber(list)) {
+        for (let i = 0; i < list; i++) {
+            temp.push(iteration(i as T, i))
+        }
+    } else {
+        XEUtils.arrayEach(unref(list), (item, index) => {
+            temp.push(iteration(item, index))
+        })
+    }
     return temp;
 }
 

+ 95 - 0
src/utils/useVxeTable.tsx

@@ -0,0 +1,95 @@
+import {ref, computed, reactive, watch, Ref, defineComponent} from 'vue'
+import {VxeTable} from "vxe-table";
+import type {VxeTableProps} from "vxe-table";
+import {TablePublicMethods, VxeTableEventProps} from "vxe-table/types/table";
+import XEUtils from "xe-utils";
+import {stringNotBlank} from "@/utils/blank-utils";
+import {TableExportMethods} from "vxe-table/types/export";
+
+declare type SimplifiedConfiguration<D> = {
+    rowHeight?: number,
+    keyField?: string,
+    currentKey?: string | number,
+    tableProps?: VxeTableEventProps<D> & VxeTableProps<D>,
+}
+
+
+function useVxeTable<D = any>(simplifiedConfiguration: SimplifiedConfiguration<D> = {}) {
+    const tableRef: Ref<TablePublicMethods<D> & TableExportMethods<D> | undefined> = ref()
+    const props: VxeTableProps<D> & VxeTableEventProps<D> & SimplifiedConfiguration<D> = reactive({
+        height: '100%',
+        rowConfig: {
+            isHover: true,
+            isCurrent: true,
+            height: simplifiedConfiguration?.rowHeight || 48,
+            useKey: true,
+            keyField: simplifiedConfiguration?.keyField || '',
+        },
+        scrollY: {
+            enabled: true,
+            gt: 0
+        },
+        scrollX: {
+            enabled: false,
+        },
+        exportConfig: {},
+        showOverflow: true,
+    })
+
+    watch(() => props.currentKey, () => {
+        if (stringNotBlank(defaultProps.value.rowConfig?.keyField)) {
+            const findData = XEUtils.find(defaultProps.value.data as [], (item) => {
+                // @ts-ignore
+                return item[defaultProps.value.rowConfig?.keyField] === props.currentKey;
+            })
+            if (!XEUtils.isEmpty(findData)) {
+                tableRef.value?.scrollToRow(findData)
+                tableRef.value?.setCurrentRow(findData)
+            }
+        }
+    }, {flush: 'post'})
+
+    const defaultProps = computed(() => {
+        return {
+            ...simplifiedConfiguration?.tableProps,
+            ...props
+        } as VxeTableProps<D>
+    })
+
+    const CyVxeTable = (props: VxeTableProps<D>, {slots}: any) => {
+        return <VxeTable
+            ref={tableRef}
+            {...defaultProps.value}
+            {...props}
+        >
+            {{
+                default: () => {
+                    return slots.default ? slots.default() : null;
+                }
+            }}
+        </VxeTable>
+    }
+
+    function exportExcel(filename: string = '', sheetName: string = 'sheet1') {
+        if (!XEUtils.isString(filename)) {
+            filename = ''
+        }
+        tableRef.value?.openExport({
+            filename,
+            sheetName,
+            types: ['xlsx', 'csv', 'html', 'xml', 'txt'],
+            type: 'xlsx',
+            useStyle: true,
+            original: true,
+        })
+    }
+
+    return {
+        tableRef,
+        CyVxeTable: CyVxeTable,
+        tableProps: props,
+        exportExcel
+    }
+}
+
+export default useVxeTable

+ 1 - 1
src/views/data-base/data-base-api/DataBase.vue

@@ -52,7 +52,7 @@ onMounted(async () => {
 
 <template>
   <DataBaseDialog ref="dialogRef"/>
-  <iframe :src="MAGIC_API"
+  <iframe :src="MAGIC_API + '/magic/web/index.html'"
           width="100%"
           height="100%"
           style="border: 0"

+ 2 - 2
src/views/data-base/page-editor-help-v2/components/PageHelpTable.vue

@@ -7,7 +7,7 @@
       :height="height"
       :column-config="{resizable: true}"
       style="{width: 100%}"
-      :row-config="{height: 50 , isCurrent: true,isHover:true, useKey: true} "
+      :row-config="{height: 48 , isCurrent: true,isHover:true, useKey: true} "
       :scroll-x="{enabled: false}"
       :scroll-y="{gt: 0 ,enabled: true}"
       show-overflow
@@ -24,7 +24,7 @@
       <template #default="{row , $rowIndex}"
                 v-if="item.func && item.func.default"
       >
-        <Component :is="handleTableColumnDefault(row, $rowIndex, item  )"/>
+        <Component :is="handleTableColumnDefault(row, $rowIndex, item)"/>
       </template>
     </VxeColumn>
   </vxe-table>

+ 5 - 2
src/views/data-base/page-editor-help-v2/components/page-editor-v2/PageHelpV2.vue

@@ -13,7 +13,6 @@ import XEUtils from "xe-utils";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
 import PageAddComponent from "@/views/data-base/page-editor-help-v2/components/page-editor-v2/PageAddComponent.vue";
 import {getWindowSize} from "@/utils/window-size";
-import {ExcelName, Export} from '@/utils/ExportExcel'
 import {userInfoStore} from "@/utils/store-public";
 import {capitalizeFirstLetter, usePageStore, ElAndXc} from "@/views/data-base/page-editor-help-v2/page-help-v2";
 import {shortcutTrigger, xcEvent} from "@/utils/xckeydown";
@@ -415,7 +414,11 @@ defineExpose({
             <el-button @click="refresh">刷新</el-button>
             <el-button type="warning" v-if="props.doTest" @click="testClick">测试</el-button>
             <el-button type="primary" @click="queryClick" icon="Search">查询</el-button>
-            <el-button @click="exportExcel(tableBind , store.mainTableRef)" type="primary" icon="Download">导出Excel
+            <el-button
+                @click="exportExcel(tableBind,store.mainTableRef)"
+                type="primary"
+                icon="Download">
+              导出Excel
             </el-button>
           </el-form-item>
         </el-form>

+ 2 - 1
src/views/data-base/page-editor-help-v2/components/page-help-editor/MagicIframeEditor.vue

@@ -5,12 +5,13 @@ import {ReportForms} from "@/api/reports/report-query-center";
 import {pageHelpV2Mitt} from "@/views/data-base/page-editor-help-v2/page-help-v2";
 import {useEventListener} from "@vueuse/core";
 import {xcMessage} from "@/utils/xiaochan-element-plus";
+import {MAGIC_API} from "@/utils/database/magic-api-request";
 
 const iframe = ref<HTMLIFrameElement>()
 // const src = 'http://192.168.56.1:8991'
 // const src = import.meta.env.VITE_DATA_BASE + '/magic/web/index.html'
 
-const src = 'http://172.16.32.160:9205/magic/web/index.html'
+const src = `${MAGIC_API}/magic/web/index.html`
 
 function sendMessage(name: string, value: any) {
   const data = {

+ 2 - 4
src/views/hospitalization/zhu-yuan-yi-sheng/critical-value/CriticalValue.vue

@@ -3,7 +3,7 @@
     <el-header>
       住院号:
       <el-input style="width: 120px" v-model="patNo" clearable/>
-      <el-button @click="queryClick">查询</el-button>
+      <el-button @click="queryClick(null)">查询</el-button>
       <span style="margin-left: 12px; color: #8e8e8e">提示:
         <span style="font-weight: bold;color: #727272">双击</span>
         危急值条目可快速处理该危急值。</span>
@@ -20,7 +20,7 @@
   </el-container>
 </template>
 
-<script setup name='CriticalValue'>
+<script setup>
 import {huanZheXinXi, onChangePatient} from "@/views/hospitalization/zhu-yuan-yi-sheng/public-js/zhu-yuan-yi-sheng";
 import {getCriticalValues, handleZyCriticalValue} from "@/api/zhu-yuan-yi-sheng/critical-value";
 import XcTable from "@/components/xiao-chan/xc-table/XcTable.vue";
@@ -32,7 +32,6 @@ import router from '@/router'
 const patNo = ref('')
 const data = ref([])
 
-let criticalId = null
 
 const windowSize = store.state.app.windowSize
 const tableHeight = windowSize.h - 86
@@ -40,7 +39,6 @@ const tableHeight = windowSize.h - 86
 const userName = store.state.user.info.name
 
 const queryClick = (id = null) => {
-  criticalId = id
   if (!patNo.value) {
     patNo.value = ''
   }

Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov