Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
style: schema preview loading
Browse files Browse the repository at this point in the history
  • Loading branch information
hibig committed Mar 12, 2024
1 parent ae07951 commit 205baa8
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 78 deletions.
2 changes: 1 addition & 1 deletion src/api/axios-chunk-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function useSetChunkRequest() {
console.log('chunkrequest===', {
result,
url: `${url}?${qs.stringify(params)}`,
cres
raw: cres
});
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/assets/style/global.less
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ html[arco-theme='dark'] {
.arco-card-header .arco-card-header-title {
color: var(--color-text-1);
font-weight: var(--font-weight-bold);
font-size: var(--font-size-large);
font-size: var(--font-size-normal);
}
}

Expand Down
164 changes: 92 additions & 72 deletions src/components/group-title/index.vue
Original file line number Diff line number Diff line change
@@ -1,81 +1,101 @@
<template>
<div
class="group-title"
:class="{
'bordered': bordered,
'is-detail': isDetail,
'iconed': iconed,
'flex-start': flexStart
}"
>
<div class="label">
<a-link v-if="showBack" @click="handleBack"
><icon-arrow-left style="stroke-width: 5; font-size: 16px"
/></a-link>
<a-divider v-if="showBack" direction="vertical"></a-divider>
<div class="title-wrap">
<slot name="title">{{ title }}</slot>
<slot name="extra"></slot>
<a-link v-if="showEdit" class="m-l-10" @click="handleEdit">
<icon-edit></icon-edit>
<span class="mleft-5">{{ $t('common.button.edit') }}</span>
</a-link>
</div>
</div>
<div><slot name="right" class="right"></slot></div>
</div>
</template>

<script lang="ts" setup>
<script lang="tsx">
import i18n from '@/locale';
import useCallCommon from '@/hooks/use-call-common';
import { defineComponent } from 'vue';
defineProps({
title: String,
bordered: {
type: Boolean,
default() {
return true;
}
},
flexStart: {
type: Boolean,
default() {
return false;
}
},
isDetail: {
type: Boolean,
default() {
return false;
}
},
showBack: {
type: Boolean,
default() {
return false;
}
},
showEdit: {
type: Boolean,
default() {
return false;
export default defineComponent({
props: {
title: String,
bordered: {
type: Boolean,
default() {
return true;
}
},
flexStart: {
type: Boolean,
default() {
return false;
}
},
isDetail: {
type: Boolean,
default() {
return false;
}
},
showBack: {
type: Boolean,
default() {
return false;
}
},
showEdit: {
type: Boolean,
default() {
return false;
}
},
iconed: {
type: Boolean,
default() {
return false;
}
}
},
iconed: {
type: Boolean,
default() {
return false;
}
emits: ['edit'],
setup(props, { slots, emit }) {
const { router } = useCallCommon();
const handleBack = () => {
router.back();
};
const handleEdit = () => {
emit('edit');
};
return () => (
<div
class={[
'group-title',
{
'bordered': props.bordered,
'is-detail': props.isDetail,
'iconed': props.iconed,
'flex-start': props.flexStart
}
]}
>
<div class="label">
{props.showBack && (
<>
<a-link onClick={() => handleBack()}>
<icon-arrow-left
style={{ 'stroke-width': 5, 'font-size': '16px' }}
/>
</a-link>
<a-divider direction="vertical"></a-divider>
</>
)}
<div class="title-wrap">
<>
{slots.title ? slots.title() : <span>{props.title}</span>}
{slots.extra?.()}
{props.showEdit && (
<a-link class="m-l-10" onClick={() => handleEdit()}>
<icon-edit></icon-edit>
<span class="mleft-5">
{i18n.global.t('common.button.edit')}
</span>
</a-link>
)}
</>
</div>
</div>
{slots.right && <div class="right">{slots.right?.()}</div>}
</div>
);
}
});
const emits = defineEmits(['edit']);
const { router } = useCallCommon();
const handleBack = () => {
router.back();
};
const handleEdit = () => {
emits('edit');
};
</script>

<style lang="less" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@
return () => (
<div>
<a-spin loading={loading.value} style={{ width: '100%' }}>
<a-spin
loading={loading.value}
style={{ width: '100%', minHeight: '100px' }}
>
<CodeDiffView
maxHeight={maxHeight.value}
content={diffContent.value}
Expand Down
4 changes: 2 additions & 2 deletions src/views/operation-hub/resource-definitions/pages/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
flex-start
:show-edit="
pageAction === PageAction.VIEW &&
!_.get(formData, 'builtin') &&
userStore.hasRolesActionsPermission({
resource: Resources.ResourceDefinitions,
actions: [Actions.PUT]
}) &&
!_.get(formData, 'builtin')
})
"
@edit="handleEditPage"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@
if (loading.value) {
setTimeout(() => {
loading.value = false;
}, 200);
}, 500);
}
}
},
Expand Down

0 comments on commit 205baa8

Please sign in to comment.