From c906860763c13650ed906be8ae255b5a6c09cca1 Mon Sep 17 00:00:00 2001 From: yangyuanshuai Date: Thu, 31 Oct 2024 09:25:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=87=E6=A0=87=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataset/IndexMannageMs/IndexMannageMs.vue | 234 ++++++++++++++---- .../IndexMannageMs/components/RuleConfig.vue | 84 +++++++ .../IndexSearchServiceMs.vue | 106 ++++---- 3 files changed, 328 insertions(+), 96 deletions(-) create mode 100644 src/views/dataset/IndexMannageMs/components/RuleConfig.vue diff --git a/src/views/dataset/IndexMannageMs/IndexMannageMs.vue b/src/views/dataset/IndexMannageMs/IndexMannageMs.vue index 4e39698..d6e0156 100644 --- a/src/views/dataset/IndexMannageMs/IndexMannageMs.vue +++ b/src/views/dataset/IndexMannageMs/IndexMannageMs.vue @@ -15,12 +15,16 @@ import { ElButton, ElLink, ElLoading, ElPopconfirm, ElMessage } from 'element-pl import { Search } from '@/components/Search' import { FormSchema } from '@/components/Form' import { ContentWrap } from '@/components/ContentWrap' +import RuleConfig from './components/Ruleconfig.vue' import Write from './components/Write.vue' import { Dialog } from '@/components/Dialog' import { getWidth } from '@/utils'; -import Detail from './components/Detail.vue' +import { method } from 'lodash-es' const { t } = useI18n() +/** + * 指标定义 + */ const ids = ref([]) @@ -30,7 +34,7 @@ const { tableRegister, tableState, tableMethods } = useTable({ const res = await getRepDataProblemListApi({ pageIndex: unref(currentPage), pageSize: unref(pageSize), - ...unref(searchParams) + ...unref(indexDefineSearchParams) }) return { list: res.body.list, @@ -45,8 +49,7 @@ const { tableRegister, tableState, tableMethods } = useTable({ const { loading, dataList, total, currentPage, pageSize } = tableState const { getList, getElTableExpose, delList, refresh } = tableMethods - -const tableColumns = reactive([ +const indexDefineTableColumns = reactive([ { field: 'selection', type: 'selection', @@ -108,7 +111,7 @@ const tableColumns = reactive([ }} onConfirm={() => delData(data.row)} > - action(data.row, 'detail')}> + action(data.row, 'ruleconfig')}> {'配置'} @@ -118,7 +121,67 @@ const tableColumns = reactive([ } ].map(item => ({ minWidth: item.label ? getWidth(item.label) : 120, ...item }) as TableColumn)) -const searchSchema = reactive([ +/** + * 指标属性 + */ +const indexPropertiesTableColumns = reactive([ + { + field: 'selection', + type: 'selection', + fixed: true + }, + { + field: 'dataDate', + label: '指标属性编号' + }, + { + field: 'createTime', + label: '指标属性名称' + }, + { + field: 'tCategory', + label: '开始时间' + }, + { + field: 'tCategory', + label: '结束时间' + }, + { + field: 'action', + label: t('tableDemo.action'), + width: 160, + fixed: 'right', + slots: { + default: (data: any) => { + return ( + <> + action(data.row, 'edit')}> + {t('tableDemo.edit')} + + { + return ( + <> + + {t('tableDemo.del')} + + + ) + } + }} + onConfirm={() => delData(data.row)} + > + + ) + } + } + } +].map(item => ({ minWidth: item.label ? getWidth(item.label) : 120, ...item }) as TableColumn)) + +const indexDefineSearchSchema = reactive([ { field: 'createTime', label: '指标代码', @@ -146,9 +209,31 @@ const searchSchema = reactive([ } ]) -const searchParams = ref({}) -const setSearchParams = (data: any) => { - searchParams.value = data +const indexPropertiesSearchSchema = reactive([ + { + field: 'createTime', + label: '编号', + componentProps: {}, + component: 'Input' + }, + { + field: 'tName', + label: '名称', + componentProps: {}, + component: 'Input' + } +]) + +const indexDefineSearchParams = ref({}) +const indexDefineSetSearchParams = (data: any) => { + indexDefineSearchParams.value = data + getList() +} + + +const indexPropertieSearchParams = ref({}) +const indexPropertieSetSearchParams = (data: any) => { + indexPropertieSearchParams.value = data getList() } @@ -158,8 +243,8 @@ const dialogTitle = ref('') const currentRow = ref() const actionType = ref('') +const ruleConfigRef = ref>() const writeRef = ref>() - /**单行查询**/ const action = async (row: TableData, type: string) => { let detailLoading = ElLoading.service({ @@ -173,7 +258,7 @@ const action = async (row: TableData, type: string) => { detailLoading.close() if (res) { const data = res.body.result - dialogTitle.value = t(type === 'edit' ? 'tableDemo.edit' : 'tableDemo.detail') + dialogTitle.value = type === 'edit' ? '编辑' : '规则配置' actionType.value = type currentRow.value = data dialogVisible.value = true @@ -207,6 +292,25 @@ const save = async () => { } } +/** 添加指标加工规则**/ +const addRuleConfig = async () => { + const ruleConfig = unref(ruleConfigRef) + const formData = await ruleConfig?.submit() + if (formData) { + saveLoading.value = true + const res = await saveRepDataProblemApi(formData) + .catch(() => {}) + .finally(() => { + saveLoading.value = false + }) + if (res) { + dialogVisible.value = false + currentPage.value = 1 + getList() + } + } +} + const delLoading = ref(false) /** 批量删除 **/ @@ -238,53 +342,95 @@ const disabled = ref(true) const onSelectionChange = (selection: TableData[]) => { disabled.value = selection.length === 0 } +const activeName = ref('indexDefination') + +const handleClick=(tab: any, event: Event | undefined)=> { + console.log(tab,event); +}