diff --git a/src/api/liswork/advancedReview/index.ts b/src/api/liswork/advancedReview/index.ts index 9d9d696..b913e4b 100644 --- a/src/api/liswork/advancedReview/index.ts +++ b/src/api/liswork/advancedReview/index.ts @@ -9,4 +9,22 @@ export function queryList(query?: Object) { method: 'get', params: query, }); +} + +//保存报告列表 +export function updateRules(data: Object) { + return request({ + url: '/labCheckrules/update', + method: 'post', + data: data, + }); +} + +//删除报告列表 +export function deleteRules(data: Object) { + return request({ + url: '/labCheckrules/delete', + method: 'get', + params: data, + }); } \ No newline at end of file diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 834f5b1..45860b1 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -358,4 +358,9 @@ aside { line-height: 1.875rem; color: #1f6dd3; } +} + +.dialog-footer { + margin-top: 20px; + text-align: right; } \ No newline at end of file diff --git a/src/components/SelectTable/index.vue b/src/components/SelectTable/index.vue index 8053e7d..910a045 100644 --- a/src/components/SelectTable/index.vue +++ b/src/components/SelectTable/index.vue @@ -61,6 +61,7 @@ const props = withDefaults(defineProps(), { dictType: '', clearable: true, objKey: 'value', + keyValue: false, fields: () => [ { prop: 'value', label: '代号', width: 80, enablePinyinSearch: true }, { prop: 'label', label: '名称', width: 150, enablePinyinSearch: true }, @@ -78,9 +79,6 @@ const filterData = ref<{ [key: string]: any; pinyinMap: Record } const processedTableData = ref<{ [key: string]: any; pinyinMap: Record }[]>([]); const currentIndex = ref(-1); - - - // 字典数据存储 const dictData = ref>({}); // 预处理数据:生成拼音信息 @@ -116,7 +114,7 @@ const visibleChange = (val: any) => { currentIndex.value = filterData.value.findIndex(item => item[props.value!] === props.data); if (currentIndex.value >= 0) { tableRef.value.setCurrentRow(filterData.value[currentIndex.value]); - tableRef.value.setScrollTop(currentIndex.value); + tableRef.value.setScrollTop(currentIndex.value * 30); } }, 10); } @@ -140,7 +138,7 @@ const handleDataEcho = () => { } else if (props.tableData) { row = props.tableData?.find((item: any) => props.objKey && item[props.objKey] === props.data) } - selectShowValue.value = row ? (props.label ? row[props.label] : (props.value ? row[props.value] : '')) : ''; + selectShowValue.value = row ? (props.keyValue ? `${row[props.value]} ${row[props.label]}` : (props.label ? row[props.label] : (props.value ? row[props.value] : ''))) : ''; } }; @@ -238,7 +236,7 @@ const handleKeydown = (e: any) => { tableRef.value.setCurrentRow(filterData.value[currentIndex.value]); // 滚动到当前行 - tableRef.value.setScrollTop(currentIndex.value); + tableRef.value.setScrollTop(currentIndex.value * 30); // 回车确认 if (e.key === "Enter") { @@ -301,6 +299,8 @@ const setLabel = (val: any) => { selectShowValue.value = val[props.label]; } else if (props.value) { selectShowValue.value = val[props.value]; + } else if (props.keyValue) { + selectShowValue.value = `${val[props.value]} ${val[props.label]}`; } if (props.objKey) { // 返回值objKey对应的对象数据 diff --git a/src/hooks/lisData/dictData.ts b/src/hooks/lisData/dictData.ts index d12369f..10db473 100644 --- a/src/hooks/lisData/dictData.ts +++ b/src/hooks/lisData/dictData.ts @@ -33,12 +33,12 @@ export const getDictData = async (...args: string[]) => { //字典数据格式化方法 export const formatDict = (v: string, dictType: string) => { if (v == undefined) return; - return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label; + return dictData.value[dictType]?.find((item: any) => item.value == v.trim())?.label || v; } //仪器格式化方法 export const formatInstr = (v: string) => { - return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc; + return instrOptions.value.find((item: any) => item.yq == v.trim())?.yqmc || v; } export { dictData, instrOptions } \ No newline at end of file diff --git a/src/main.js b/src/main.js index 618c0fa..68a3ef0 100644 --- a/src/main.js +++ b/src/main.js @@ -101,7 +101,7 @@ app.component('ImagePreview', ImagePreview) app.component('RightToolbar', RightToolbar) app.component('Editor', Editor) app.component('CustomTable', CustomTable) -app.component('CustomVxeTable ', CustomVxeTable) +app.component('CustomVxeTable', CustomVxeTable) app.component('SelectTable', SelectTable) //VUE3标准方法注入全局方法 diff --git a/src/types/SelectTable.d.ts b/src/types/SelectTable.d.ts index c076b43..dbb78eb 100644 --- a/src/types/SelectTable.d.ts +++ b/src/types/SelectTable.d.ts @@ -18,6 +18,7 @@ export interface Props { disabled?: boolean; dictType?: string; clearable?: boolean; + keyValue?: boolean; //是否使用键值对模式 } diff --git a/src/views/liswork/advancedReview/index.vue b/src/views/liswork/advancedReview/index.vue index e6f3a72..f476015 100644 --- a/src/views/liswork/advancedReview/index.vue +++ b/src/views/liswork/advancedReview/index.vue @@ -8,7 +8,7 @@
- +
@@ -17,33 +17,124 @@ 删除
- - - +