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.

110 lines
2.8 KiB

1 year ago
<template>
<w-dialog
ref="dialogRef"
10 months ago
:title="$t('re.parameter.dialog.moveParameter.title')"
1 year ago
width="600px"
height="500px"
:can-maximize="false"
10 months ago
body-padding="2px 2px"
1 year ago
:buttons="[
{
label: $t('confirm'),
noCaps: true,
click: () => {
const tickeds = parameterGrid.getTickedRows();
const parameterIds = [];
1 year ago
tickeds.forEach((ticked) => {
1 year ago
parameterIds.push(ticked.id);
1 year ago
});
1 year ago
axios
.post(Environment.apiContextPath('/api/re/model/parameter/move'), {
one: modelGridRef.getSelectedRows()[0].id,
many: parameterIds,
})
.then((response) => {
close();
parameterGrid.refresh();
});
},
},
]"
>
<div class="pt-2" style="height: 100%">
<w-grid
ref="modelGridRef"
dense-body
class="px-1"
hide-bottom
:config-button="false"
selection="multiple"
:checkbox-selection="false"
:tree="true"
:tree-icon="
(row) => {
return { name: 'folder', color: 'amber' };
}
"
:fetch-data-url="Environment.apiContextPath('/api/re/model/findModelWithSubModelsByResourceId?resourceId=' + resource.id)"
:data-url="Environment.apiContextPath('/api/re/model')"
:pageable="false"
:toolbar-configure="{ noIcon: false }"
:columns="[
{ width: '100%', name: 'name', label: $t('name'), sortable: false },
{
width: 80,
name: 'category',
label: $t('category'),
sortable: false,
10 months ago
format: EngineEnums.ModelCategory.formater,
1 year ago
},
{
width: 80,
name: 'executeMode',
10 months ago
label: $t('re.model.grid.entity.executeMode'),
1 year ago
align: 'center',
sortable: false,
format: (value) => {
10 months ago
if (value === 'UP_DOWN') {
1 year ago
return {
componentType: 'QIcon',
attrs: { name: 'bi-arrow-down', size: '20px' },
};
}
return '';
},
},
]"
></w-grid>
</div>
</w-dialog>
</template>
<script setup lang="ts">
import 'tailwindcss/utilities.css';
1 year ago
import { ref } from 'vue';
10 months ago
import { axios, Environment } from 'platform-core';
import { EngineEnums } from '@/views/shared/enums/EngineEnums';
1 year ago
const props = defineProps({
parameterGrid: { type: Object, default: undefined },
resource: { type: Object, default: undefined },
});
const dialogRef = ref();
const modelGridRef = ref();
const open = () => {
dialogRef.value.show();
};
const close = () => {
dialogRef.value.hide();
};
defineExpose({
open,
close,
});
10 months ago
await EngineEnums.init();
1 year ago
</script>