You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

256 lines
11 KiB

<template>
<w-grid
ref="gridRef"
:title="$t('icaap.appetite.indicator.grid.title')"
:config-button="true"
selection="multiple"
:checkbox-selection="true"
:data-url="Environment.apiContextPath('/api/icaap/appetite/indicator')"
:query-form-cols-num="4"
:query-form-fields="[
{ name: 'code', label: $t('code'), type: 'text' },
{ name: 'name', label: $t('name'), type: 'text' },
{
name: 'enable',
label: $t('enable'),
type: 'select',
clearable: true,
options: Options.yesNo(),
queryOperator: 'equals',
},
{
name: 'source',
label: $t('icaap.appetite.indicator.grid.entity.source'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_SOURCE),
queryOperator: 'equals',
},
{
name: 'category',
label: $t('icaap.appetite.indicator.grid.entity.category'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_CATEGORY),
queryOperator: 'equals',
},
{
name: 'categoryRisk',
label: $t('icaap.appetite.indicator.grid.entity.categoryRisk'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_CATEGORY_RISK),
queryOperator: 'equals',
},
{
name: 'categoryBusiness',
label: $t('icaap.appetite.indicator.grid.entity.categoryBusiness'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_CATEGORY_BUSINESS),
queryOperator: 'equals',
},
{
name: 'categoryCal',
label: $t('icaap.appetite.indicator.grid.entity.categoryCal'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_CATEGORY_CAL),
queryOperator: 'equals',
},
{
name: 'unit',
label: $t('icaap.appetite.indicator.grid.entity.unit'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_UNIT),
queryOperator: 'equals',
},
{
name: 'frequency',
label: $t('icaap.appetite.indicator.grid.entity.frequency'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_FREQUENCY),
queryOperator: 'equals',
},
]"
:pagination="{
sortBy: 'lastModifyDate',
descending: true,
}"
:toolbar-configure="{ noIcon: false }"
:toolbar-actions="[['query', 'moreQuery'], 'reset', 'refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'separator', 'export']"
:columns="[
{ width: 100, name: 'code', label: $t('code') },
{ width: 300, name: 'name', label: $t('name') },
{ width: 70, name: 'enable', label: $t('enable'), align: 'center', format: Formater.enableTag() },
{ width: 70, name: 'unit', label: $t('icaap.appetite.indicator.grid.entity.unit'), format: Formater.dictionary(INDICATOR_UNIT) },
{ width: 70, name: 'frequency', label: $t('icaap.appetite.indicator.grid.entity.frequency'), format: Formater.dictionary(INDICATOR_FREQUENCY) },
{ width: 80, name: 'category', label: $t('icaap.appetite.indicator.grid.entity.category'), format: Formater.dictionary(INDICATOR_CATEGORY) },
{ width: 100, name: 'categoryCal', label: $t('icaap.appetite.indicator.grid.entity.categoryCal'), format: Formater.dictionary(INDICATOR_CATEGORY_CAL) },
{
width: 100,
name: 'categoryRisk',
label: $t('icaap.appetite.indicator.grid.entity.categoryRisk'),
format: Formater.dictionary(INDICATOR_CATEGORY_RISK),
},
{
width: 100,
name: 'categoryBusiness',
label: $t('icaap.appetite.indicator.grid.entity.categoryBusiness'),
format: Formater.dictionary(INDICATOR_CATEGORY_BUSINESS),
},
{
width: 100,
name: 'source',
label: $t('icaap.appetite.indicator.grid.entity.source'),
format: Formater.dictionary(INDICATOR_SOURCE),
},
{
width: 100,
name: 'superviseCondition',
label: $t('icaap.appetite.indicator.grid.entity.superviseCondition'),
format: (value, row) => {
if (row.superviseCondition && !Tools.isUndefinedOrNull(row.superviseValue)) {
return row.superviseCondition + row.superviseValue;
}
return '';
},
},
{ width: 300, name: 'superviseSource', label: $t('icaap.appetite.indicator.grid.entity.superviseSource') },
{ width: 200, name: 'formula', label: $t('icaap.appetite.indicator.grid.entity.formula') },
{ width: 300, name: 'sql', label: $t('icaap.appetite.indicator.grid.entity.sql') },
{ width: 100, name: 'lastModifier', label: $t('lastModifier') },
{ width: 110, name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() },
]"
:editor="{
dialog: {
width: '800px',
height: '650px',
},
form: {
colsNum: 3,
fields: [
{ name: 'code', label: $t('code'), type: 'text', required: true },
{ name: 'name', label: $t('name'), type: 'text', required: true },
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true },
{ name: 'description', label: $t('description'), colSpan: 3, type: 'textarea', rows: 3 },
{
name: 'source',
label: $t('icaap.appetite.indicator.grid.entity.source'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_SOURCE),
},
{
name: 'category',
label: $t('icaap.appetite.indicator.grid.entity.category'),
type: 'select',
required: true,
options: Options.dictionary(INDICATOR_CATEGORY),
},
{
name: 'categoryCal',
label: $t('icaap.appetite.indicator.grid.entity.categoryCal'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_CATEGORY_CAL),
},
{
name: 'categoryRisk',
label: $t('icaap.appetite.indicator.grid.entity.categoryRisk'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_CATEGORY_RISK),
},
{
name: 'categoryBusiness',
label: $t('icaap.appetite.indicator.grid.entity.categoryBusiness'),
type: 'select',
clearable: true,
options: Options.dictionary(INDICATOR_CATEGORY_BUSINESS),
},
{
name: 'unit',
label: $t('icaap.appetite.indicator.grid.entity.unit'),
type: 'select',
options: Options.dictionary(INDICATOR_UNIT),
},
{
name: 'frequency',
label: $t('icaap.appetite.indicator.grid.entity.frequency'),
type: 'select',
options: Options.dictionary(INDICATOR_FREQUENCY),
},
{ name: 'formula', label: $t('icaap.appetite.indicator.grid.entity.formula'), type: 'code-mirror', colSpan: 3, rows: 3 },
{ name: 'sql', label: $t('icaap.appetite.indicator.grid.entity.sql'), type: 'code-mirror', colSpan: 3, rows: 3 },
{
name: 'superviseSource',
label: $t('icaap.appetite.indicator.grid.entity.superviseSource'),
type: 'text',
},
{
name: 'superviseCondition',
label: $t('icaap.appetite.indicator.grid.entity.superviseCondition'),
type: 'select',
options: CONDITIONS,
},
{
name: 'superviseValue',
label: $t('icaap.appetite.indicator.grid.entity.superviseValue'),
type: 'number',
},
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'id', label: $t('id') },
{ name: 'code', label: $t('code') },
{ name: 'name', label: $t('name') },
{ name: 'description', label: $t('description') },
{ name: 'enable', label: $t('enable'), format: Formater.none() },
{ name: 'category', label: $t('icaap.appetite.indicator.grid.entity.category'), format: Formater.none() },
{ name: 'categoryRisk', label: $t('icaap.appetite.indicator.grid.entity.categoryRisk'), format: Formater.none() },
{ name: 'categoryBusiness', label: $t('icaap.appetite.indicator.grid.entity.categoryBusiness'), format: Formater.none() },
{ name: 'categoryCal', label: $t('icaap.appetite.indicator.grid.entity.categoryCal'), format: Formater.none() },
{ name: 'unit', label: $t('icaap.appetite.indicator.grid.entity.unit'), format: Formater.none() },
{ name: 'frequency', label: $t('icaap.appetite.indicator.grid.entity.frequency'), format: Formater.none() },
{ name: 'source', label: $t('icaap.appetite.indicator.grid.entity.source'), format: Formater.none() },
{ name: 'formula', label: $t('icaap.appetite.indicator.grid.entity.formula') },
{ name: 'sql', label: $t('icaap.appetite.indicator.grid.entity.sql') },
{ name: 'superviseSource', label: $t('icaap.appetite.indicator.grid.entity.superviseSource') },
{ name: 'superviseCondition', label: $t('icaap.appetite.indicator.grid.entity.superviseCondition') },
{ name: 'superviseValue', label: $t('icaap.appetite.indicator.grid.entity.superviseValue') },
{ name: 'dataComeFrom', label: $t('dataComeFrom') },
{ name: 'creator', label: $t('creator') },
{ name: 'createDate', label: $t('createDate') },
{ name: 'lastModifier', label: $t('lastModifier') },
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() },
{ name: 'corporationCode', label: $t('corporationCode') },
],
},
}"
@row-click="(evt, row, index) => {}"
></w-grid>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import { Environment, DictionaryTools, Formater, Options, Tools } from 'platform-core';
import IndicatorStatus from './IndicatorStatus';
const gridRef = ref();
const INDICATOR_CATEGORY = await DictionaryTools.fetch('INDICATOR_CATEGORY');
const INDICATOR_CATEGORY_RISK = await DictionaryTools.fetch('INDICATOR_CATEGORY_RISK');
const INDICATOR_CATEGORY_BUSINESS = await DictionaryTools.fetch('INDICATOR_CATEGORY_BUSINESS');
const INDICATOR_CATEGORY_CAL = await DictionaryTools.fetch('INDICATOR_CATEGORY_CAL');
const INDICATOR_UNIT = await DictionaryTools.fetch('INDICATOR_UNIT');
const INDICATOR_FREQUENCY = await DictionaryTools.fetch('INDICATOR_FREQUENCY');
const INDICATOR_SOURCE = await DictionaryTools.fetch('INDICATOR_SOURCE');
const CONDITIONS = ['>', '>=', '<', '<='];
</script>