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.

135 lines
3.7 KiB

1 year ago
<template>
1 year ago
<w-grid
ref="gridRef"
dense-body
class="px-1"
hide-bottom
:config-button="false"
6 months ago
dnd-mode="server"
1 year ago
selection="multiple"
10 months ago
:checkbox-selection="true"
6 months ago
db-click-operation="edit"
1 year ago
:tree="false"
:fetch-data-url="Environment.apiContextPath('/api/re/model/parameter/option/findByParameterId?parameterId=' + parameter.id)"
:data-url="Environment.apiContextPath('/api/re/model/parameter/option')"
:pageable="false"
6 months ago
:sort-by="['order']"
1 year ago
:toolbar-configure="{ noIcon: false }"
10 months ago
:toolbar-actions="[
'refresh',
'separator',
{
extend: 'add',
enableIf: (arg) => {
return !readOnly;
},
},
10 months ago
{
extend: 'clone',
enableIf: (arg) => {
return !readOnly && arg.selected;
},
},
10 months ago
{
extend: 'edit',
enableIf: (arg) => {
return !readOnly && arg.selected;
},
},
{
extend: 'remove',
enableIf: (arg) => {
return !readOnly && arg.selected;
},
},
'separator',
'view',
'separator',
'export',
]"
1 year ago
:columns="[
{ width: 60, name: 'order', label: $t('order'), align: 'right', showIf: false },
{ width: 100, name: 'inputValue', label: $t('re.option.grid.entity.inputValue') },
{ width: 100, name: 'value', label: $t('re.option.grid.entity.value') },
{ width: 400, name: 'title', label: $t('re.option.grid.entity.title') },
{ width: '100%', name: 'description', label: $t('description') },
1 year ago
]"
:editor="{
dialog: {
width: '600px',
},
form: {
colsNum: 1,
fields: [
8 months ago
{ name: 'parameter', label: 'parameter', type: 'w-text', defaultValue: parameter.id, showIf: false },
{ name: 'id', label: $t('id'), type: 'w-text', showIf: false },
1 year ago
{
name: 'inputValue',
6 months ago
label: $t('re.option.grid.entity.inputValue'),
8 months ago
type: 'w-text',
1 year ago
},
{
name: 'value',
6 months ago
label: $t('re.option.grid.entity.value'),
8 months ago
type: 'w-text',
1 year ago
},
{
name: 'title',
6 months ago
label: $t('re.option.grid.entity.title'),
8 months ago
type: 'w-text',
1 year ago
},
{
name: 'description',
label: $t('description'),
8 months ago
type: 'w-text',
1 year ago
},
],
},
}"
:viewer="{
panel: {
columnNum: 1,
fields: [
{ name: 'id', label: $t('id') },
{ name: 'order', label: $t('order') },
6 months ago
{ name: 'inputValue', label: $t('re.option.grid.entity.inputValue') },
{ name: 'value', label: $t('re.option.grid.entity.value') },
{ name: 'title', label: $t('re.option.grid.entity.title') },
1 year ago
{ name: 'description', label: $t('description') },
6 months ago
...CorporationAuditorEntityManager.getViewerFields(),
1 year ago
],
},
}"
></w-grid>
1 year ago
</template>
<script setup lang="ts">
import 'tailwindcss/utilities.css';
1 year ago
import { ref, onMounted } from 'vue';
6 months ago
import { Environment, Formater, CorporationAuditorEntityManager } from 'platform-core';
1 year ago
const props = defineProps({
fetchDataUrl: { type: String, default: '' },
dataUrl: { type: String, default: '' },
parameter: { type: Object, default: undefined },
10 months ago
readOnly: { type: Boolean, default: false },
1 year ago
});
const emit = defineEmits<{
(e: 'rowClick', evt: Event, row: any, index: number): void;
(e: 'beforeRequestData', requestParams: URLSearchParams | any, callback: any): void;
}>();
const gridRef = ref();
const refresh = () => {
gridRef.value.refresh();
};
onMounted(() => {
gridRef.value.refresh();
});
defineExpose({
refresh,
});
1 year ago
</script>