|
|
|
@ -21,7 +21,7 @@ import Write from './components/Write.vue'
|
|
|
|
|
import { Dialog } from '@/components/Dialog'
|
|
|
|
|
import { getWidth } from '@/utils';
|
|
|
|
|
import { Upload } from '@/components/Upload'
|
|
|
|
|
import { RULE_TYPE_LIST } from '@/views/IndexProcess/constants'
|
|
|
|
|
import { RULE_TYPE_LIST,RULE_CYCLE_LIST,RULE_IS_VALID_LIST } from '@/views/IndexProcess/constants'
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
|
@ -57,15 +57,23 @@ const tableColumns = reactive<TableColumn[]>([
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'ruleCode',
|
|
|
|
|
label: '指标集规则清单编码'
|
|
|
|
|
label: '指标集规则清单编码',
|
|
|
|
|
width:180
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'ruleName',
|
|
|
|
|
label: '规则名称'
|
|
|
|
|
label: '规则名称',
|
|
|
|
|
align: "left",
|
|
|
|
|
headerAlign: 'left',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'ruleClass',
|
|
|
|
|
label: '规则分类'
|
|
|
|
|
label: '规则分类',
|
|
|
|
|
slots:{
|
|
|
|
|
default:(data:any)=>{
|
|
|
|
|
return RULE_TYPE_LIST.find(item=>item.name==data.row.ruleClass)?.label;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'startDate',
|
|
|
|
@ -77,11 +85,21 @@ const tableColumns = reactive<TableColumn[]>([
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'ruleCycle',
|
|
|
|
|
label: '规则周期'
|
|
|
|
|
label: '规则周期',
|
|
|
|
|
slots:{
|
|
|
|
|
default:(data:any)=>{
|
|
|
|
|
return RULE_CYCLE_LIST.find(item=>item.value==data.row.ruleCycle)?.label;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'ruleStatus',
|
|
|
|
|
label: '是否有效'
|
|
|
|
|
label: '是否有效',
|
|
|
|
|
slots:{
|
|
|
|
|
default:(data:any)=>{
|
|
|
|
|
return RULE_IS_VALID_LIST.find(item=>item.value==data.row.ruleStatus)?.label;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'description',
|
|
|
|
@ -134,13 +152,13 @@ const tableColumns = reactive<TableColumn[]>([
|
|
|
|
|
{
|
|
|
|
|
field: 'action',
|
|
|
|
|
label: t('tableDemo.action'),
|
|
|
|
|
width: 160,
|
|
|
|
|
width: 120,
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
slots: {
|
|
|
|
|
default: (data: any) => {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<ElLink type="primary" underline={false} onClick={() => action(data.row, 'edit')}>
|
|
|
|
|
<ElLink type="primary" underline={false} onClick={() => AddAction(data.row.ruleClass, 'edit',data.row)}>
|
|
|
|
|
{t('tableDemo.edit')}
|
|
|
|
|
</ElLink>
|
|
|
|
|
<ElPopconfirm
|
|
|
|
@ -159,9 +177,9 @@ const tableColumns = reactive<TableColumn[]>([
|
|
|
|
|
}}
|
|
|
|
|
onConfirm={() => delData(data.row)}
|
|
|
|
|
></ElPopconfirm>
|
|
|
|
|
<ElLink type="primary" underline={false} onClick={() => action(data.row, 'detail')}>
|
|
|
|
|
{/* <ElLink type="primary" underline={false} onClick={() => action(data.row, 'detail')}>
|
|
|
|
|
{t('tableDemo.detail')}
|
|
|
|
|
</ElLink>
|
|
|
|
|
</ElLink> */}
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
@ -210,33 +228,13 @@ const actionType = ref('')
|
|
|
|
|
|
|
|
|
|
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 queryRepSetRuleApi(row.ruleCode)
|
|
|
|
|
.catch(() => {})
|
|
|
|
|
.finally(() => {
|
|
|
|
|
detailLoading.close()
|
|
|
|
|
})
|
|
|
|
|
detailLoading.close()
|
|
|
|
|
if (res) {
|
|
|
|
|
const data = res.body.result
|
|
|
|
|
dialogTitle.value = t(type === 'edit' ? 'tableDemo.edit' : 'tableDemo.detail')
|
|
|
|
|
actionType.value = type
|
|
|
|
|
currentRow.value = data
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let RuleType = ref('');
|
|
|
|
|
|
|
|
|
|
const AddAction = (ruleType: string) => {
|
|
|
|
|
const AddAction = (ruleType: string,actiontype: string,currentrow) => {
|
|
|
|
|
RuleType.value = ruleType;
|
|
|
|
|
dialogTitle.value = t('tableDemo.add')
|
|
|
|
|
currentRow.value = undefined
|
|
|
|
|
dialogVisible.value = true
|
|
|
|
|
actionType.value = 'add'
|
|
|
|
|
dialogTitle.value = actiontype=='add'?`新增规则`:`编辑规则`;
|
|
|
|
|
currentRow.value = currentrow;
|
|
|
|
|
dialogVisible.value = true;
|
|
|
|
|
actionType.value = actiontype;
|
|
|
|
|
}
|
|
|
|
|
const saveLoading = ref(false)
|
|
|
|
|
|
|
|
|
@ -303,6 +301,8 @@ const exportExcel = async () => {
|
|
|
|
|
<Search :schema="searchSchema" @reset="setSearchParams" @search="setSearchParams" />
|
|
|
|
|
|
|
|
|
|
<Table
|
|
|
|
|
headerAlign="center"
|
|
|
|
|
align="center"
|
|
|
|
|
:columns="tableColumns"
|
|
|
|
|
v-model:pageSize="pageSize"
|
|
|
|
|
v-model:currentPage="currentPage"
|
|
|
|
@ -322,7 +322,7 @@ const exportExcel = async () => {
|
|
|
|
|
<ElButton type="primary">添加规则</ElButton>
|
|
|
|
|
<template #dropdown>
|
|
|
|
|
<ElDropdownMenu>
|
|
|
|
|
<ElDropdownItem v-for="item in RULE_TYPE_LIST" :key="item.name" @click="AddAction(item.name)">{{ item.label }}</ElDropdownItem>
|
|
|
|
|
<ElDropdownItem v-for="item in RULE_TYPE_LIST" :key="item.name" @click="AddAction(item.name,'add',{})">{{ item.label }}</ElDropdownItem>
|
|
|
|
|
</ElDropdownMenu>
|
|
|
|
|
</template>
|
|
|
|
|
</ElDropdown>
|
|
|
|
@ -342,6 +342,7 @@ const exportExcel = async () => {
|
|
|
|
|
:current-row="currentRow"
|
|
|
|
|
:action-type="actionType"
|
|
|
|
|
:rule-type="RuleType"
|
|
|
|
|
@close-dialog="dialogVisible=false;getList()"
|
|
|
|
|
/>
|
|
|
|
|
</Dialog>
|
|
|
|
|
</template>
|