diff --git a/src/api/liswork/xtwh/ReportSetting.ts b/src/api/liswork/xtwh/ReportSetting.ts index 573ca98..79081fc 100644 --- a/src/api/liswork/xtwh/ReportSetting.ts +++ b/src/api/liswork/xtwh/ReportSetting.ts @@ -9,4 +9,31 @@ export function addReportService(LabReportInstr: Object){ method: 'post', data: LabReportInstr }) +} + +//查询数据 +export function queryReportService(LabReportInstr: Object){ + return request({ + url: '/labReportinstr/query', + method: 'get', + params: LabReportInstr + }) +} + +//修改数据 +export function updateReportService(LabReportInstr: Object){ + return request({ + url: '/labReportinstr/update', + method: 'post', + data: LabReportInstr + }) +} + +//删除数据 +export function deleteReportService(LabReportInstr: Object){ + return request({ + url: '/labReportinstr/del', + method: 'get', + params: LabReportInstr + }) } \ No newline at end of file diff --git a/src/assets/styles/ruoyi.scss b/src/assets/styles/ruoyi.scss index 0ec4717..8827267 100644 --- a/src/assets/styles/ruoyi.scss +++ b/src/assets/styles/ruoyi.scss @@ -322,8 +322,8 @@ border-color: #aef5ef; } - // 表格input宽度 - .full-width-input .el-input__inner { + // 表格input宽度,表格select宽度 + .full-width-input .el-input__inner .el-select__inner { width: 100%; height: 100%; @@ -339,6 +339,16 @@ padding: 0 !important; outline: none; + &:hover { + box-shadow: none !important; + } + } + .el-select__wrapper { + box-shadow: none; + background: transparent !important; + padding: 0 !important; + outline: none; + &:hover { box-shadow: none !important; } diff --git a/src/auto-imports.d.ts b/src/auto-imports.d.ts new file mode 100644 index 0000000..a606bd4 --- /dev/null +++ b/src/auto-imports.d.ts @@ -0,0 +1,87 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// noinspection JSUnusedGlobalSymbols +// Generated by unplugin-auto-import +export {} +declare global { + const EffectScope: typeof import('vue')['EffectScope'] + const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate'] + const computed: typeof import('vue')['computed'] + const createApp: typeof import('vue')['createApp'] + const createPinia: typeof import('pinia')['createPinia'] + const customRef: typeof import('vue')['customRef'] + const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] + const defineComponent: typeof import('vue')['defineComponent'] + const defineStore: typeof import('pinia')['defineStore'] + const effectScope: typeof import('vue')['effectScope'] + const getActivePinia: typeof import('pinia')['getActivePinia'] + const getCurrentInstance: typeof import('vue')['getCurrentInstance'] + const getCurrentScope: typeof import('vue')['getCurrentScope'] + const h: typeof import('vue')['h'] + const inject: typeof import('vue')['inject'] + const isProxy: typeof import('vue')['isProxy'] + const isReactive: typeof import('vue')['isReactive'] + const isReadonly: typeof import('vue')['isReadonly'] + const isRef: typeof import('vue')['isRef'] + const mapActions: typeof import('pinia')['mapActions'] + const mapGetters: typeof import('pinia')['mapGetters'] + const mapState: typeof import('pinia')['mapState'] + const mapStores: typeof import('pinia')['mapStores'] + const mapWritableState: typeof import('pinia')['mapWritableState'] + const markRaw: typeof import('vue')['markRaw'] + const nextTick: typeof import('vue')['nextTick'] + const onActivated: typeof import('vue')['onActivated'] + const onBeforeMount: typeof import('vue')['onBeforeMount'] + const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] + const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] + const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] + const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] + const onDeactivated: typeof import('vue')['onDeactivated'] + const onErrorCaptured: typeof import('vue')['onErrorCaptured'] + const onMounted: typeof import('vue')['onMounted'] + const onRenderTracked: typeof import('vue')['onRenderTracked'] + const onRenderTriggered: typeof import('vue')['onRenderTriggered'] + const onScopeDispose: typeof import('vue')['onScopeDispose'] + const onServerPrefetch: typeof import('vue')['onServerPrefetch'] + const onUnmounted: typeof import('vue')['onUnmounted'] + const onUpdated: typeof import('vue')['onUpdated'] + const onWatcherCleanup: typeof import('vue')['onWatcherCleanup'] + const provide: typeof import('vue')['provide'] + const reactive: typeof import('vue')['reactive'] + const readonly: typeof import('vue')['readonly'] + const ref: typeof import('vue')['ref'] + const resolveComponent: typeof import('vue')['resolveComponent'] + const setActivePinia: typeof import('pinia')['setActivePinia'] + const setMapStoreSuffix: typeof import('pinia')['setMapStoreSuffix'] + const shallowReactive: typeof import('vue')['shallowReactive'] + const shallowReadonly: typeof import('vue')['shallowReadonly'] + const shallowRef: typeof import('vue')['shallowRef'] + const storeToRefs: typeof import('pinia')['storeToRefs'] + const toRaw: typeof import('vue')['toRaw'] + const toRef: typeof import('vue')['toRef'] + const toRefs: typeof import('vue')['toRefs'] + const toValue: typeof import('vue')['toValue'] + const triggerRef: typeof import('vue')['triggerRef'] + const unref: typeof import('vue')['unref'] + const useAttrs: typeof import('vue')['useAttrs'] + const useCssModule: typeof import('vue')['useCssModule'] + const useCssVars: typeof import('vue')['useCssVars'] + const useId: typeof import('vue')['useId'] + const useLink: typeof import('vue-router')['useLink'] + const useModel: typeof import('vue')['useModel'] + const useRoute: typeof import('vue-router')['useRoute'] + const useRouter: typeof import('vue-router')['useRouter'] + const useSlots: typeof import('vue')['useSlots'] + const useTemplateRef: typeof import('vue')['useTemplateRef'] + const watch: typeof import('vue')['watch'] + const watchEffect: typeof import('vue')['watchEffect'] + const watchPostEffect: typeof import('vue')['watchPostEffect'] + const watchSyncEffect: typeof import('vue')['watchSyncEffect'] +} +// for type re-export +declare global { + // @ts-ignore + export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue' + import('vue') +} diff --git a/src/components/SelectTable/YQSelectTable/index.vue b/src/components/SelectTable/YQSelectTable/index.vue new file mode 100644 index 0000000..9175153 --- /dev/null +++ b/src/components/SelectTable/YQSelectTable/index.vue @@ -0,0 +1,84 @@ + + + + \ No newline at end of file diff --git a/src/components/SelectTable/index.vue b/src/components/SelectTable/index.vue index b05183c..850b02e 100644 --- a/src/components/SelectTable/index.vue +++ b/src/components/SelectTable/index.vue @@ -49,29 +49,8 @@ import { getFirstLetter } from '@/utils/pinyin.js'; import { ElEmpty } from 'element-plus'; // @ts-ignore import { comDict } from '@/utils/dict' -interface Field { - prop: string; - label: string; - width?: number; - enablePinyinSearch?: boolean; //是否参与拼音搜索 -} +import { Emits, Props } from '@/types'; -interface Props { - data: any; - fields: Field[]; - tableData?: object[]; - label?: string; - value?: string; - objKey?: string; - isHighlight?: boolean; - size?: string; - placeholder?: string; - border?: boolean; - width?: string | number; - disabled?: boolean; - dictType?: string; - clearable?: boolean; -} const props = withDefaults(defineProps(), { placeholder: "请选择", size: "default", @@ -84,10 +63,7 @@ const props = withDefaults(defineProps(), { clearable: true }); -interface Emits { - (e: "update:data", val: any): void; - (e: "getDataValue", val: any): void; -} + const emits = defineEmits(); const searchKey = ref(''); const tableRef = ref(); diff --git a/src/hooks/lisData/dictData.ts b/src/hooks/lisData/dictData.ts new file mode 100644 index 0000000..375e16c --- /dev/null +++ b/src/hooks/lisData/dictData.ts @@ -0,0 +1,40 @@ +//仪器,字典数据自动格式化类 +import { DictData } from '@/types/index'; +import { getGroupInstrdList } from '@/api/liswork/work/LisWork'; +//@ts-ignore +import { comDict } from '@/utils/dict' + +const dictData = ref({}); +const instrOptions = ref<{ yq: string; yqmc: string }[]>([]) + +export const getYqData = () => { + getGroupInstrdList() + .then((res: any) => { + if (res.code == 0) { + instrOptions.value = res.data.map((item: any) => ({ + yq: item.yq.trim(), + yqmc: item.yqmc + })) + } + }) +} +//'XMGL','ITEMCLASS', 'YQDL' +export const getDictData = async (...args: string[]) => { + const dictRefs = await comDict(...args); + // 从 ref 中获取实际数据 + dictData.value = { + XMGL: toRaw(dictRefs.XMGL.value) || [], + ITEMCLASS: toRaw(dictRefs.ITEMCLASS.value) || [], + YQDL: toRaw(dictRefs.YQDL.value) || [] + }; +} + +// 格式化字典数据方法 +export const formatDict = async (v: string, dictType: string) => { + return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label; +} + +//仪器格式化方法 +export const formatInstr = (v: string) => { + return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc; +} \ No newline at end of file diff --git a/src/hooks/lisData/index.ts b/src/hooks/lisData/index.ts new file mode 100644 index 0000000..779dcd0 --- /dev/null +++ b/src/hooks/lisData/index.ts @@ -0,0 +1 @@ +export * from './dictData'; \ No newline at end of file diff --git a/src/types/Object.d.ts b/src/types/Object.d.ts index 28c9482..62a1c54 100644 --- a/src/types/Object.d.ts +++ b/src/types/Object.d.ts @@ -1,4 +1,5 @@ export interface LabReportInstr { + index?: number; //序号 yq: string; //仪器 xh: number; //序号 bgdh: string; //报告单号 @@ -6,4 +7,13 @@ export interface LabReportInstr { type: string; //使用类型 condition: string; //使用条件 status?: string; //状态 +} + +export interface DictData { + XMGL?: Array; + ITEMCLASS?: Array; + YQDL?: Array; + xmlbList?: Array; + YQ?: Array; + [key: string]: any[] | undefined; // 添加索引签名以支持动态访问 } \ No newline at end of file diff --git a/src/types/SelectTable.d.ts b/src/types/SelectTable.d.ts new file mode 100644 index 0000000..20cacdd --- /dev/null +++ b/src/types/SelectTable.d.ts @@ -0,0 +1,29 @@ +export interface Emits { + (e: "update:data", val: any): void; + (e: "getDataValue", val: any): void; +} + +export interface Props { + data: any; + fields: Field[]; + tableData?: object[]; + label?: string; + value?: string; + objKey?: string; + isHighlight?: boolean; + size?: string; + placeholder?: string; + border?: boolean; + width?: string | number; + disabled?: boolean; + dictType?: string; + clearable?: boolean; +} + + +export interface Field { + prop: string; + label: string; + width?: number; + enablePinyinSearch?: boolean; //是否参与拼音搜索 +} \ No newline at end of file diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 74f3072..76b63b7 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -1,4 +1,6 @@ //聚合文件,导出所有的类型定义 //对象文件 -export * from './Object'; \ No newline at end of file +export * from './Object'; + +export * from './SelectTable'; \ No newline at end of file diff --git a/src/views/liswork/xtwh/reportsetting/index.vue b/src/views/liswork/xtwh/reportsetting/index.vue index 866eb6a..d3c6783 100644 --- a/src/views/liswork/xtwh/reportsetting/index.vue +++ b/src/views/liswork/xtwh/reportsetting/index.vue @@ -1,58 +1,68 @@ \ No newline at end of file diff --git a/vite/plugins/auto-import.js b/vite/plugins/auto-import.js index a5d3576..ec09020 100644 --- a/vite/plugins/auto-import.js +++ b/vite/plugins/auto-import.js @@ -7,6 +7,7 @@ export default function createAutoImport() { 'vue-router', 'pinia' ], - dts: false + // 2. 生成类型声明文件(解决TS类型报错) + dts: 'src/auto-imports.d.ts', // 生成的.d.ts文件路径(会自动创建) }) }