From 43b84ff537b0791dc284c876a113d7620b2525c7 Mon Sep 17 00:00:00 2001 From: wyuu Date: Thu, 12 Feb 2026 16:42:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/liswork/xtwh/StatsparameterApi.ts | 65 +++-- src/components/SelectTable/index.vue | 27 +- src/types/SelectTable.d.ts | 1 + .../liswork/qualityControl/westGard/index.vue | 12 +- .../statisticalAnalysis/report/index copy.vue | 238 ++++++++++++++++ .../statisticalAnalysis/report/index.vue | 260 ++++++++---------- 6 files changed, 427 insertions(+), 176 deletions(-) create mode 100644 src/views/statisticalAnalysis/report/index copy.vue diff --git a/src/api/liswork/xtwh/StatsparameterApi.ts b/src/api/liswork/xtwh/StatsparameterApi.ts index 4770f25..c6f5be8 100644 --- a/src/api/liswork/xtwh/StatsparameterApi.ts +++ b/src/api/liswork/xtwh/StatsparameterApi.ts @@ -3,44 +3,53 @@ import request from '@/utils/request' // 查询字典列表 -export function liststatsparam(params:any) { - return request({ - url: '/statstemp/param/list', - method: 'get', - params - }) +export function liststatsparam(params: any) { + return request({ + url: '/statstemp/param/list', + method: 'get', + params + }) } // 查询字典详细 -export function getstatsparam(id:number) { - return request({ - url: `/statstemp/param/${id}`, - method: 'get' - }) +export function getstatsparam(id: number) { + return request({ + url: `/statstemp/param/${id}`, + method: 'get' + }) } // 新增字典 -export function addstatsparam(params:any) { - return request({ - url: '/statstemp/param', - method: 'post', - data:params - }) +export function addstatsparam(params: any) { + return request({ + url: '/statstemp/param', + method: 'post', + data: params + }) } // 修改字典 -export function updatestatsparam(params:any) { - return request({ - url: '/statstemp/param', - method: 'put', - data:params - }) +export function updatestatsparam(params: any) { + return request({ + url: '/statstemp/param', + method: 'put', + data: params + }) } // 删除字典 -export function delstatsparam(id:any) { - return request({ - url: `/statstemp/param/${id}`, - method: 'delete' - }) +export function delstatsparam(id: any) { + return request({ + url: `/statstemp/param/${id}`, + method: 'delete' + }) +} + +// 获取模板详细信息 +export function getstatsTemplate(params: any) { + return request({ + url: '/stats/gettemplate', + method: 'get', + params + }) } diff --git a/src/components/SelectTable/index.vue b/src/components/SelectTable/index.vue index cc87a3d..2c19fe5 100644 --- a/src/components/SelectTable/index.vue +++ b/src/components/SelectTable/index.vue @@ -37,7 +37,7 @@ --> (), { @@ -67,6 +68,7 @@ const props = withDefaults(defineProps(), { border: true, width: "100%", dictType: '', + optionselect: false, clearable: true, objKey: 'value', keyValue: false, @@ -150,6 +152,11 @@ const handleDataEcho = () => { } }; +interface DictRefs { + [key: string]: { + value: any[]; + }; +} // 初始化数据 const initData = async () => { if (props.tableData) { @@ -157,8 +164,20 @@ const initData = async () => { processedTableData.value = processTableData(props.tableData); filterData.value = [...processedTableData.value]; } else if (props.dictType) { - // 如果传入dictType,通过comDict获取数据 - const dictRefs = await comDict(props.dictType); + + let dictRefs: DictRefs = {}; + // 如果传入dictType,通过comDict获取数据 optionselect为true 用通用接口 + if (props.optionselect) { + const resp = await getoptionselect({ zdlb: props.dictType }); + const dictList = resp.data.map((p: any) => ({ + label: p.zdmc, + value: p.zddh, + })); + + dictRefs[props.dictType] = { value: dictList }; + } else { + dictRefs = await comDict(props.dictType); + } // // 从 ref 中获取实际数据 dictData.value = { [props.dictType]: toRaw(dictRefs[props.dictType].value) || [], @@ -170,8 +189,8 @@ const initData = async () => { handleDataEcho(); }; -// 初始化数据 initData(); +// 初始化数据 onMounted(() => { }); diff --git a/src/types/SelectTable.d.ts b/src/types/SelectTable.d.ts index dbb78eb..686021d 100644 --- a/src/types/SelectTable.d.ts +++ b/src/types/SelectTable.d.ts @@ -17,6 +17,7 @@ export interface Props { width?: string | number; disabled?: boolean; dictType?: string; + optionselect?: boolean; clearable?: boolean; keyValue?: boolean; //是否使用键值对模式 } diff --git a/src/views/liswork/qualityControl/westGard/index.vue b/src/views/liswork/qualityControl/westGard/index.vue index a5318fa..bf20269 100644 --- a/src/views/liswork/qualityControl/westGard/index.vue +++ b/src/views/liswork/qualityControl/westGard/index.vue @@ -185,8 +185,8 @@ const form = ref({ sd: '', }) const queryParams = ref({ - // instrGroup: mbStore.defaultConfig.lisgroupid || 'ALL', - instrGroup: 'ALL', + instrGroup: mbStore.defaultConfig.lisgroupid || 'ALL', + //instrGroup: 'ALL', yq: mbStore.defaultConfig.defaultinstr || '1', zkrq1: '', zkrq2: '', @@ -618,10 +618,10 @@ const getList = () => { const timeDate = () => { const today = dayjs(); const startOfWeek = today.subtract(6, 'day'); - // queryParams.zkrq1 = startOfWeek.format('YYYY-MM-DD'); - // queryParams.zkrq2 = today.format('YYYY-MM-DD'); - queryParams.value.zkrq1 = '2025-02-01'; - queryParams.value.zkrq2 = today.format('YYYY-MM-DD'); + queryParams.zkrq1 = startOfWeek.format('YYYY-MM-DD'); + queryParams.zkrq2 = today.format('YYYY-MM-DD'); + // queryParams.value.zkrq1 = '2025-02-01'; + // queryParams.value.zkrq2 = today.format('YYYY-MM-DD'); } onMounted(() => { diff --git a/src/views/statisticalAnalysis/report/index copy.vue b/src/views/statisticalAnalysis/report/index copy.vue new file mode 100644 index 0000000..d90938e --- /dev/null +++ b/src/views/statisticalAnalysis/report/index copy.vue @@ -0,0 +1,238 @@ +/** +* @file index.vue 报告统计 +* @author: w +* @since: 2026-01-27 +*/ + + + + + \ No newline at end of file diff --git a/src/views/statisticalAnalysis/report/index.vue b/src/views/statisticalAnalysis/report/index.vue index fde04bc..98779ae 100644 --- a/src/views/statisticalAnalysis/report/index.vue +++ b/src/views/statisticalAnalysis/report/index.vue @@ -5,148 +5,95 @@ */ \ No newline at end of file