|
|
@ -10,19 +10,13 @@ import {
|
|
|
|
import { TableData } from '@/api/reporting/RepDataProblem/RepDataProblem/types'
|
|
|
|
import { TableData } from '@/api/reporting/RepDataProblem/RepDataProblem/types'
|
|
|
|
import { useTable } from '@/hooks/web/useTable'
|
|
|
|
import { useTable } from '@/hooks/web/useTable'
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
|
import { Table, TableColumn } from '@/components/Table'
|
|
|
|
|
|
|
|
import { ElButton, ElLink, ElLoading, ElPopconfirm, ElMessage } from 'element-plus'
|
|
|
|
import { ElButton, ElLink, ElLoading, ElPopconfirm, ElMessage } from 'element-plus'
|
|
|
|
import { Search } from '@/components/Search'
|
|
|
|
|
|
|
|
import { FormSchema } from '@/components/Form'
|
|
|
|
|
|
|
|
import { ContentWrap } from '@/components/ContentWrap'
|
|
|
|
import { ContentWrap } from '@/components/ContentWrap'
|
|
|
|
import CodeRepItem from '@/views/dataset/CodeRepItem/CodeRepItem.vue';//指标定义界面
|
|
|
|
import CodeRepItem from '@/views/dataset/CodeRepItem/CodeRepItem.vue';//指标定义界面
|
|
|
|
import CodeRepTarget from '@/views/dataset/CodeRepTarget/CodeRepTarget.vue';//指标属性界面
|
|
|
|
import CodeRepTarget from '@/views/dataset/CodeRepTarget/CodeRepTarget.vue';//指标属性界面
|
|
|
|
|
|
|
|
|
|
|
|
import RuleConfig from './components/Ruleconfig.vue'
|
|
|
|
|
|
|
|
import Write from './components/Write.vue'
|
|
|
|
import Write from './components/Write.vue'
|
|
|
|
import { Dialog } from '@/components/Dialog'
|
|
|
|
import { Dialog } from '@/components/Dialog'
|
|
|
|
import { getWidth } from '@/utils';
|
|
|
|
|
|
|
|
import { INDEX_CATAGOTY_LIST } from './constants'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
const { t } = useI18n()
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -31,7 +25,7 @@ const { t } = useI18n()
|
|
|
|
|
|
|
|
|
|
|
|
const ids = ref<string[]>([])
|
|
|
|
const ids = ref<string[]>([])
|
|
|
|
|
|
|
|
|
|
|
|
const { tableRegister, tableState, tableMethods } = useTable({
|
|
|
|
const { tableState, tableMethods } = useTable({
|
|
|
|
fetchDataApi: async () => {
|
|
|
|
fetchDataApi: async () => {
|
|
|
|
const { currentPage, pageSize } = tableState
|
|
|
|
const { currentPage, pageSize } = tableState
|
|
|
|
const res = await getRepDataProblemListApi({
|
|
|
|
const res = await getRepDataProblemListApi({
|
|
|
@ -50,197 +44,15 @@ const { tableRegister, tableState, tableMethods } = useTable({
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const { loading, dataList, total, currentPage, pageSize } = tableState
|
|
|
|
const { currentPage } = tableState
|
|
|
|
const { getList, getElTableExpose, delList, refresh } = tableMethods
|
|
|
|
const { getList } = tableMethods
|
|
|
|
const indexDefineTableColumns = reactive<TableColumn[]>([
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'selection',
|
|
|
|
|
|
|
|
type: 'selection',
|
|
|
|
|
|
|
|
fixed: true
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'dataDate',
|
|
|
|
|
|
|
|
label: '指标代码'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'createTime',
|
|
|
|
|
|
|
|
label: '指标名称'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'tName',
|
|
|
|
|
|
|
|
label: '指标类型'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'tCategory',
|
|
|
|
|
|
|
|
label: '指标计算类型'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'tCategory',
|
|
|
|
|
|
|
|
label: '指标数据类型'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'tCategory',
|
|
|
|
|
|
|
|
label: '开始时间'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'tCategory',
|
|
|
|
|
|
|
|
label: '结束时间'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'action',
|
|
|
|
|
|
|
|
label: t('tableDemo.action'),
|
|
|
|
|
|
|
|
width: 160,
|
|
|
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
|
|
|
slots: {
|
|
|
|
|
|
|
|
default: (data: any) => {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
<ElLink type="primary" underline={false} onClick={() => action(data.row, 'edit')}>
|
|
|
|
|
|
|
|
{t('tableDemo.edit')}
|
|
|
|
|
|
|
|
</ElLink>
|
|
|
|
|
|
|
|
<ElPopconfirm
|
|
|
|
|
|
|
|
title={t('common.delTableMsg')}
|
|
|
|
|
|
|
|
width={200}
|
|
|
|
|
|
|
|
v-slots={{
|
|
|
|
|
|
|
|
reference: () => {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
<ElLink type="primary" underline={false}>
|
|
|
|
|
|
|
|
{t('tableDemo.del')}
|
|
|
|
|
|
|
|
</ElLink>
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
onConfirm={() => delData(data.row)}
|
|
|
|
|
|
|
|
></ElPopconfirm>
|
|
|
|
|
|
|
|
<ElLink type="primary" underline={false} onClick={() => action(data.row, 'ruleconfig')}>
|
|
|
|
|
|
|
|
{'配置'}
|
|
|
|
|
|
|
|
</ElLink>
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
].map(item => ({ minWidth: item.label ? getWidth(item.label) : 120, ...item }) as TableColumn))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 指标属性
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
const indexPropertiesTableColumns = reactive<TableColumn[]>([
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
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 (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
<ElLink type="primary" underline={false} onClick={() => action(data.row, 'edit')}>
|
|
|
|
|
|
|
|
{t('tableDemo.edit')}
|
|
|
|
|
|
|
|
</ElLink>
|
|
|
|
|
|
|
|
<ElPopconfirm
|
|
|
|
|
|
|
|
title={t('common.delTableMsg')}
|
|
|
|
|
|
|
|
width={200}
|
|
|
|
|
|
|
|
v-slots={{
|
|
|
|
|
|
|
|
reference: () => {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
<ElLink type="primary" underline={false}>
|
|
|
|
|
|
|
|
{t('tableDemo.del')}
|
|
|
|
|
|
|
|
</ElLink>
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
onConfirm={() => delData(data.row)}
|
|
|
|
|
|
|
|
></ElPopconfirm>
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
].map(item => ({ minWidth: item.label ? getWidth(item.label) : 120, ...item }) as TableColumn))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const indexDefineSearchSchema = reactive<FormSchema[]>([
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'createTime',
|
|
|
|
|
|
|
|
label: '指标代码',
|
|
|
|
|
|
|
|
componentProps: {},
|
|
|
|
|
|
|
|
component: 'Input'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'tName',
|
|
|
|
|
|
|
|
label: '指标名称',
|
|
|
|
|
|
|
|
componentProps: {},
|
|
|
|
|
|
|
|
component: 'Input'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'tCategory',
|
|
|
|
|
|
|
|
label: '指标计算类型',
|
|
|
|
|
|
|
|
componentProps: {
|
|
|
|
|
|
|
|
options:INDEX_CATAGOTY_LIST
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
component: 'Select'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'organCode',
|
|
|
|
|
|
|
|
label: '日期范围',
|
|
|
|
|
|
|
|
componentProps: {type: 'daterange'},
|
|
|
|
|
|
|
|
component: 'DatePicker'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const indexPropertiesSearchSchema = reactive<FormSchema[]>([
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'createTime',
|
|
|
|
|
|
|
|
label: '编号',
|
|
|
|
|
|
|
|
componentProps: {},
|
|
|
|
|
|
|
|
component: 'Input'
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
field: 'tName',
|
|
|
|
|
|
|
|
label: '名称',
|
|
|
|
|
|
|
|
componentProps: {},
|
|
|
|
|
|
|
|
component: 'Input'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const indexDefineSearchParams = ref({})
|
|
|
|
const indexDefineSearchParams = ref({})
|
|
|
|
const indexDefineSetSearchParams = (data: any) => {
|
|
|
|
|
|
|
|
indexDefineSearchParams.value = data
|
|
|
|
|
|
|
|
getList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const indexPropertieSearchParams = ref({})
|
|
|
|
|
|
|
|
const indexPropertieSetSearchParams = (data: any) => {
|
|
|
|
|
|
|
|
indexPropertieSearchParams.value = data
|
|
|
|
|
|
|
|
getList()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
const dialogVisible = ref(false)
|
|
|
|
const dialogTitle = ref('')
|
|
|
|
const dialogTitle = ref('')
|
|
|
@ -248,34 +60,8 @@ const dialogTitle = ref('')
|
|
|
|
const currentRow = ref()
|
|
|
|
const currentRow = ref()
|
|
|
|
const actionType = ref('')
|
|
|
|
const actionType = ref('')
|
|
|
|
|
|
|
|
|
|
|
|
const ruleConfigRef = ref<ComponentRef<typeof RuleConfig>>()
|
|
|
|
|
|
|
|
const writeRef = ref<ComponentRef<typeof Write>>()
|
|
|
|
const writeRef = ref<ComponentRef<typeof Write>>()
|
|
|
|
/**单行查询**/
|
|
|
|
|
|
|
|
const action = async (row: TableData, type: string) => {
|
|
|
|
|
|
|
|
let detailLoading = ElLoading.service({
|
|
|
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
const res = await queryRepDataProblemApi(row.pId)
|
|
|
|
|
|
|
|
.catch(() => {})
|
|
|
|
|
|
|
|
.finally(() => {
|
|
|
|
|
|
|
|
detailLoading.close()
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
detailLoading.close()
|
|
|
|
|
|
|
|
if (res) {
|
|
|
|
|
|
|
|
const data = res.body.result
|
|
|
|
|
|
|
|
dialogTitle.value = type === 'edit' ? '编辑' : '规则配置'
|
|
|
|
|
|
|
|
actionType.value = type
|
|
|
|
|
|
|
|
currentRow.value = data
|
|
|
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const AddAction = () => {
|
|
|
|
|
|
|
|
dialogTitle.value = t('tableDemo.add')
|
|
|
|
|
|
|
|
currentRow.value = undefined
|
|
|
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
|
|
|
actionType.value = 'add'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const saveLoading = ref(false)
|
|
|
|
const saveLoading = ref(false)
|
|
|
|
|
|
|
|
|
|
|
|
/** 保存 **/
|
|
|
|
/** 保存 **/
|
|
|
@ -297,36 +83,6 @@ 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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 批量删除 **/
|
|
|
|
|
|
|
|
const delDataBatch = async () => {
|
|
|
|
|
|
|
|
const elTableExpose = await getElTableExpose()
|
|
|
|
|
|
|
|
ids.value = elTableExpose?.getSelectionRows().map((v: TableData) => { v.pId }) || []
|
|
|
|
|
|
|
|
delLoading.value = true
|
|
|
|
|
|
|
|
await delList(unref(ids).length).finally(() => {
|
|
|
|
|
|
|
|
delLoading.value = false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 单行删除 */
|
|
|
|
/** 单行删除 */
|
|
|
|
const delData = async (row: TableData) => {
|
|
|
|
const delData = async (row: TableData) => {
|
|
|
@ -342,11 +98,7 @@ const delData = async (row: TableData) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const disabled = ref(true)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const onSelectionChange = (selection: TableData[]) => {
|
|
|
|
|
|
|
|
disabled.value = selection.length === 0
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const activeName = ref('indexDefination')
|
|
|
|
const activeName = ref('indexDefination')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -368,12 +120,11 @@ const handleClick=(tab: any, event: Event | undefined)=> {
|
|
|
|
</ContentWrap>
|
|
|
|
</ContentWrap>
|
|
|
|
<Dialog v-model="dialogVisible" :title="dialogTitle">
|
|
|
|
<Dialog v-model="dialogVisible" :title="dialogTitle">
|
|
|
|
<Write
|
|
|
|
<Write
|
|
|
|
v-if="actionType !== 'ruleconfig'"
|
|
|
|
v-if="actionType !== 'detail'"
|
|
|
|
ref="writeRef"
|
|
|
|
ref="writeRef"
|
|
|
|
:current-row="currentRow"
|
|
|
|
:current-row="currentRow"
|
|
|
|
:action-type="actionType"
|
|
|
|
:action-type="actionType"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<RuleConfig v-if="actionType === 'ruleconfig'" />
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
<template #footer>
|
|
|
|
<ElButton v-if="actionType == 'edit'" type="primary" :loading="saveLoading" @click="save">
|
|
|
|
<ElButton v-if="actionType == 'edit'" type="primary" :loading="saveLoading" @click="save">
|
|
|
|
{{ t('dialogDemo.save') }}
|
|
|
|
{{ t('dialogDemo.save') }}
|
|
|
|