xiaochan 1 سال پیش
والد
کامیت
3e6c0fca16

+ 6 - 2
src/api/reports/report-query-center.ts

@@ -1,9 +1,10 @@
 import request from '../../utils/request'
+import {ElAndXc} from "@/views/data-base/page-editor-help-v2/page-help-v2";
 
 export interface PageHeader {
     key: string,
     compKey: string
-    name: string,
+    name: keyof typeof ElAndXc,
     label: string,
     keyType: "string" | "number",
     defaultValue: string | any[] | number,
@@ -12,9 +13,12 @@ export interface PageHeader {
         [key: string]: any
     },
     on: {
+        [key: string]: string
         mounted: string
     },
-    func: {},
+    func: {
+        [key: string]: string
+    },
     selectOptions?: {
         code: string,
         name: string,

+ 1 - 2
src/main.js

@@ -38,12 +38,11 @@ DomZIndex.getCurrent = () => {
 
 initVxeConfig()
 
-export const app = createApp(App)
+const app = createApp(App)
 for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
     app.component(key, component)
 }
 
-
 piniaInstall(app)
 app.use(ElementPlus, {locale: zhCn, size: 'small'})
 app.use(DataVVue3)

+ 1 - 1
src/router/index.ts

@@ -92,7 +92,7 @@ function convertToRouter(value: IntergrationMenu[]) {
 async function beforeAddRoutes() {
     await useUserStore().getUserInfo
     routerMenus.value = await getUserMenu()
-    emptyRouter(XEUtils.clone(routerMenus.value, true))
+    emptyRouter(XEUtils.cloneDeep(routerMenus.value))
 
     secondLevelRouter.forEach((item) => {
         const tmp = XEUtils.eachAndReturnList(item.children, (i) => {

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

@@ -7,32 +7,39 @@ import {ComputedRef} from "vue";
 import {PageHelpTableName, PageStore} from "@/views/data-base/page-editor-help-v2/page-help-v2";
 import XEUtils from "xe-utils";
 import {VxeGridProps} from 'vxe-table'
-import {VxeGridPropTypes,} from "vxe-pc-ui/types/components/grid";
+import {VxeGridPropTypes, VxeGridSlots} from "vxe-pc-ui/types/components/grid";
 import {ElInput} from 'element-plus'
+import {VxeColumnProps} from "vxe-pc-ui/types/components/column";
+
+type ColumnsType = {
+  slots: {
+    [key: string]: string
+  }
+} & VxeColumnProps
 
 const props = defineProps<{
   data: any[];
-  columns: any[];
+  columns: ColumnsType[];
   store: PageStore,
   tableRefName: PageHelpTableName,
   tableBind: any,
   getSlotsData: (row: string, rowIndex: number, code: string) => any
 }>()
 
-function handleSlots(slots, tmp) {
+type VxeTableSlots = VxeGridSlots[string]
+
+function handleSlots(slots: any, tmp: any) {
   for (let key in slots) {
-    tmp.slots[key] = ({row, rowIndex}) => {
+    (tmp.slots[key] as VxeTableSlots) = ({row, rowIndex}) => {
       const code = slots[key]
       return props.getSlotsData(row, rowIndex, code)
     }
   }
 }
 
-// @ts-ignore
 const columnBindComputed: ComputedRef<VxeGridPropTypes.Columns> = computed(() => {
-  // @ts-ignore
   return XEUtils.eachAndReturnList(props!.columns, (item, index) => {
-    const {func, slots, ...temp} = item
+    const {slots, ...temp} = item
 
     let tmp: any = {...temp, slots: {}}
     if (props.store?.props.isEditor) {
@@ -42,7 +49,7 @@ const columnBindComputed: ComputedRef<VxeGridPropTypes.Columns> = computed(() =>
             onUpdate:modelValue={(value) => {
               props.columns[index].title = value
             }}
-            onFocus={() => handleFocus(props.columns?.[index].field)}
+            onFocus={() => handleFocus(props.columns[index]!.field)}
         />
       }
     }
@@ -52,8 +59,7 @@ const columnBindComputed: ComputedRef<VxeGridPropTypes.Columns> = computed(() =>
 
 })
 
-// @ts-ignore
-const tableGridComputed: ComputedRef<VxeGridProps> = computed(() => {
+const tableGridComputed = computed(() => {
   return {
     data: props.data,
     columns: columnBindComputed.value,
@@ -70,7 +76,7 @@ const tableGridComputed: ComputedRef<VxeGridProps> = computed(() => {
     scrollY: {gt: 0, enabled: true},
     showOverflow: true,
     ...props.tableBind
-  }
+  } as VxeGridProps
 })
 
 function setMainTableRef(el: any) {
@@ -79,7 +85,7 @@ function setMainTableRef(el: any) {
   }
 }
 
-function handleFocus(field: string) {
+function handleFocus(field: string | undefined) {
   if (typeof props.store !== 'undefined') {
     props.store!.mainTableRef.value.scrollToColumn(field)
   }

+ 48 - 31
src/views/data-base/page-editor-help-v2/components/page-editor-v2/PageHelpV2.vue

@@ -66,23 +66,26 @@ const userInfo = XEUtils.clone(userStore.userInfo, true)
 
 const render = (item: PageHeader) => {
   const modelValue = typeof pageData.value.params[item.key] === 'undefined' ? "" : pageData.value.params[item.key];
-  const tempProps = {
+  const tempProps: {
+    [key: string]: any
+  } = {
     modelValue: modelValue,
-    "onUpdate:modelValue": (val) => {
+    "onUpdate:modelValue": (val: any) => {
       pageData.value.params[item.key] = val
     },
     ...item.bind
   }
+
   if (item.on) {
     for (const onKey in item.on) {
       const key = capitalizeFirstLetter(onKey, 'on')
-      tempProps[key] = (...val) => newFunc(item, val, item.on[onKey])
+      tempProps[key] = (...val: any) => newFunc(item, val, item.on[onKey])
     }
   }
 
   if (item.func) {
     for (let funcKey in item.func) {
-      tempProps[funcKey] = (...val) => newFunc(item, val, item.func[funcKey])
+      tempProps[funcKey] = (...val: any) => newFunc(item, val, item.func[funcKey])
     }
   }
 
@@ -100,11 +103,11 @@ const render = (item: PageHeader) => {
   return h(ElAndXc[item.name], tempProps, () => child)
 }
 
-const isActive = (index) => {
+const isActive = (index: number) => {
   return index === currentClickIndex.value
 }
 
-function formItemClick(item: PageHeader, index) {
+function formItemClick(item: PageHeader, index: number) {
   emits('changeTabs', "属性配置")
   if (props.componentAttribute == null) {
     return
@@ -113,13 +116,13 @@ function formItemClick(item: PageHeader, index) {
   store.changeCurrentBind(item)
 }
 
-function upClick(index) {
+function upClick(index: number) {
   if (index === 0) return
   swapItems(pageData.value.header, index, index - 1)
   currentClickIndex.value = index - 1
 }
 
-function downClick(index) {
+function downClick(index: number) {
   if (index === pageData.value.header.length - 1) {
     return
   }
@@ -127,12 +130,12 @@ function downClick(index) {
   currentClickIndex.value = index + 1
 }
 
-function swapItems(arr, currentClickIndex, newIndex) {
+function swapItems(arr: any[], currentClickIndex: number, newIndex: number) {
   arr[currentClickIndex] = arr.splice(newIndex, 1, arr[currentClickIndex])[0]
   return arr
 }
 
-function delClick(index) {
+function delClick(index: number) {
   currentClickIndex.value = -1
   store.changeCurrentBind(null)
   pageData.value.header.splice(index, 1)
@@ -159,9 +162,15 @@ async function queryClick() {
       })
 }
 
+type TableBindTs = {
+  data: any[],
+  columns: any[],
+  tableBind: {}
+}
+
 const rules = ref({})
 
-const dialogTableData = ref({
+const dialogTableData = ref<TableBindTs>({
   data: [],
   columns: [],
   tableBind: {}
@@ -247,9 +256,14 @@ function getBindDefaultValue(name: string) {
 const AsyncFunction = Object.getPrototypeOf(async function () {
 }).constructor;
 
-const queryKey = ref({})
 
-function newFunc(currentBind, value, funcStr) {
+type QueryKeyTs = {
+  [K in PageHeader[][number]['key']]: any
+}
+
+const queryKey = ref<QueryKeyTs>({})
+
+function newFunc(currentBind: PageHeader, value: any, funcStr: string) {
   function updateView() {
     queryKey.value[currentBind.key] += pageData.value.header.length + queryKey.value[currentBind.key]
   }
@@ -262,7 +276,7 @@ function newFunc(currentBind, value, funcStr) {
   }
 }
 
-async function addComponent(data) {
+async function addComponent(data: PageHeader) {
   const temp = XEUtils.clone(data, true)
   Object.assign(temp.bind, getBindDefaultValue(data.name))
   queryKey.value[temp.key] = pageData.value.header.length
@@ -278,14 +292,14 @@ async function addComponent(data) {
 
 async function testClick() {
   await formRef.value!.validate()
-  const data = {}
+  const data: QueryKeyTs = {}
   pageData.value.header.forEach(item => {
     data[item.key] = pageData.value.params[item.key]
   })
   props?.doTest(data)
 }
 
-function openDialogAndSetData(data, title: string = '详情') {
+function openDialogAndSetData(data: TableBindTs, title: string = '详情') {
   dialogTitle.value = title
   showDialog.value = true
   dialogTableData.value = data
@@ -313,7 +327,7 @@ function setTableData(res: any) {
       width: 70,
       align: 'center',
       fixed: 'right',
-      func: {
+      slots: {
         default: `
         const {h} = vue
         const {ElButton} = el
@@ -385,8 +399,9 @@ defineExpose({
 </script>
 
 <template>
-  <CyFlex>
-    <template #header>
+
+  <div class="layout_container">
+    <header>
       <div class="cy-page_help_v2-header" ref="headerRef">
         <el-form v-bind="pageData.fromConfig"
                  :rules="rules"
@@ -433,8 +448,8 @@ defineExpose({
           </el-form-item>
         </el-form>
       </div>
-    </template>
-    <template #default>
+    </header>
+    <div class="layout_main">
       <div class="cy-page_help_v2-main"
            style="width: 100%; height: 100%"
            v-loading="loading">
@@ -446,21 +461,23 @@ defineExpose({
                        :columns="tableBind.columns"
         />
       </div>
-    </template>
-  </CyFlex>
+    </div>
+  </div>
 
   <el-dialog v-model="showDialog"
              :title="dialogTitle"
              width="90%"
              class="page_help-dialog">
-    <PageHelpTable
-        :store="store"
-        :getSlotsData="getSlotsData"
-        :table-bind="dialogTableData.tableBind"
-        table-ref-name="dialogTableRef"
-        :data="dialogTableData.data"
-        :columns="dialogTableData.columns"
-    />
+    <div style="height: calc(100vh - 400px)">
+      <PageHelpTable
+          :store="store"
+          :getSlotsData="getSlotsData"
+          :table-bind="dialogTableData.tableBind"
+          table-ref-name="dialogTableRef"
+          :data="dialogTableData.data"
+          :columns="dialogTableData.columns"
+      />
+    </div>
     <template #footer>
       <el-button v-if="props.isEditor" @click="dialogTableColumns">生成表格列</el-button>
       <el-button @click="exportExcel(dialogTableData ,store.dialogTableRef)" type="primary">导出Excel</el-button>

+ 2 - 1
src/views/data-base/page-editor-help-v2/page-help-v2.ts

@@ -13,6 +13,7 @@ interface TableData {
     columns: any[]
 }
 
+
 export const ElAndXc = {
     ...ElementPlus,
     XcComboGridV2: defineAsyncComponent(() => import('../../../components/xiao-chan/combo-grid/XcComboGridV2.vue')),
@@ -21,7 +22,7 @@ export const ElAndXc = {
     SystemStaffSelect: defineAsyncComponent(() => import('@/components/system/staff-select/SystemStaffSelect.vue')),
     SystemItemDrug: defineAsyncComponent(() => import('@/components/system/item-drug/SystemItemDrug.vue')),
     CyDateRange: defineAsyncComponent(() => import('@/components/cy/date-range/CyDateRange.vue'))
-}
+} as const
 
 export const createFile = () => {
     const data: PageJsonObject = {

+ 16 - 0
src/views/hospitalization/zhu-yuan-yi-sheng/cao-yao-yi-zhu/ChaXunChaoYaoYiZhu.vue

@@ -59,6 +59,22 @@
       </CyTabs>
     </div>
   </div>
+  <el-dialog v-model="xiangQing.dialog" title="草药医嘱详情">
+    <el-table :close-on-click-modal="false" :data="xiangQing.data" highlight-current-row stripe>
+      <el-table-column label="编码" prop="chargeCode"></el-table-column>
+      <el-table-column label="名称" prop="chargeCodeName"></el-table-column>
+      <el-table-column label="药房" prop="groupNoName"></el-table-column>
+      <el-table-column label="数量" prop="quantity"></el-table-column>
+      <el-table-column label="单价" prop="unitPrice"></el-table-column>
+      <el-table-column label="说明" prop="instruction"></el-table-column>
+      <el-table-column label="包装规格" prop="serial">
+        <template #default="scope">
+          <span v-if="scope.row.serial === '01'">小包装</span>
+          <span v-else-if="scope.row.serial === '99'">小包装</span>
+        </template>
+      </el-table-column>
+    </el-table>
+  </el-dialog>
 </template>
 
 <script setup>