bug537:配置スペース自動全チェック問題修正

This commit is contained in:
xiaozhe.ma
2024-07-22 17:29:42 +09:00
parent c6a577b5ec
commit cc4276b727
4 changed files with 17 additions and 14 deletions

View File

@@ -7,12 +7,13 @@
<script lang="ts">
import { useAsyncState } from '@vueuse/core';
import { api } from 'boot/axios';
import { computed } from 'vue';
import { computed ,Prop,PropType} from 'vue';
import {IField} from 'src/types/ComponentTypes'
export default {
name: 'FieldList',
props: {
fields: Array,
fields: Array as PropType<IField[]>,
name: String,
type: String,
appId: Number,
@@ -30,22 +31,22 @@ export default {
{ name: 'code', label: 'フィールドコード', align: 'left', field: 'code', sortable: true },
{ name: 'type', label: 'フィールドタイプ', align: 'left', field: 'type', sortable: true }
]
const { state : rows, isReady: isLoaded, isLoading } = useAsyncState((args) => {
if (props.fields && Object.keys(props.fields).length > 0) {
return props.fields.map(f => ({ name: f.label, objectType: 'field', ...f }));
return props.fields.map(f => ({ name: f.label, ...f ,objectType: 'field'}));
} else {
return api.get('api/v1/appfields', {
params: {
app: props.appId
}
}).then(res => {
console.log(res);
return Object.values(res.data.properties).map(f => ({ name: f.label, objectType: 'field', ...f }));
const fields = res.data.properties;
return Object.values(fields).map(f => ({ name: fields.label, objectType: 'field', ...fields }));
});
}
}, [{ name: '', objectType: '', type: '', code: '', label: '' }])
return {
columns,
rows,