Compare commits
No commits in common. "f10819bee8d2487fba487f31f0b476bbac8dc1da" and "6ee1930df590886566e4bb0b93da70e0228ca1b3" have entirely different histories.
f10819bee8
...
6ee1930df5
@ -21,7 +21,7 @@ const columns = defineModel<NaiveUI.TableColumnCheck[]>('columns', {
|
|||||||
{{ $t('common.columnSetting') }}
|
{{ $t('common.columnSetting') }}
|
||||||
</NButton>
|
</NButton>
|
||||||
</template>
|
</template>
|
||||||
<VueDraggable v-model="columns" :animation="150" filter=".none_draggable" class="table-column-setting-list">
|
<VueDraggable v-model="columns" :animation="150" filter=".none_draggable">
|
||||||
<div v-for="item in columns" :key="item.key" class="h-36px flex-y-center rd-4px hover:(bg-primary bg-opacity-20)">
|
<div v-for="item in columns" :key="item.key" class="h-36px flex-y-center rd-4px hover:(bg-primary bg-opacity-20)">
|
||||||
<SvgIcon local-icon="drag" class="mr-8px h-full cursor-move text-icon"/>
|
<SvgIcon local-icon="drag" class="mr-8px h-full cursor-move text-icon"/>
|
||||||
<NCheckbox v-model:checked="item.checked" class="none_draggable flex-1">
|
<NCheckbox v-model:checked="item.checked" class="none_draggable flex-1">
|
||||||
@ -35,15 +35,4 @@ const columns = defineModel<NaiveUI.TableColumnCheck[]>('columns', {
|
|||||||
</NPopover>
|
</NPopover>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped></style>
|
||||||
.table-column-setting-list {
|
|
||||||
max-height: 60vh;
|
|
||||||
overflow-y: auto;
|
|
||||||
scrollbar-width: none;
|
|
||||||
-ms-overflow-style: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-column-setting-list::-webkit-scrollbar {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, useAttrs } from 'vue';
|
import { computed, useAttrs } from 'vue';
|
||||||
import type { TagProps } from 'naive-ui';
|
import type { TagProps } from 'naive-ui';
|
||||||
import { jsonClone } from '@sa/utils';
|
|
||||||
import { useDict } from '@/hooks/business/dict';
|
import { useDict } from '@/hooks/business/dict';
|
||||||
import { isNotNull } from '@/utils/common';
|
import { isNotNull } from '@/utils/common';
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
@ -29,7 +28,7 @@ const { transformDictData } = useDict(props.dictCode, props.immediate);
|
|||||||
|
|
||||||
const dictTagData = computed<Api.System.DictData[]>(() => {
|
const dictTagData = computed<Api.System.DictData[]>(() => {
|
||||||
if (props.dictData) {
|
if (props.dictData) {
|
||||||
const dictData = jsonClone(props.dictData);
|
const dictData = props.dictData;
|
||||||
if (dictData.dictLabel?.startsWith(`dict.${dictData.dictType}.`)) {
|
if (dictData.dictLabel?.startsWith(`dict.${dictData.dictType}.`)) {
|
||||||
dictData.dictLabel = $t(dictData.dictLabel as App.I18n.I18nKey);
|
dictData.dictLabel = $t(dictData.dictLabel as App.I18n.I18nKey);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
import { computed } from 'vue';
|
import { computed } from 'vue';
|
||||||
import hljs from 'highlight.js/lib/core';
|
import hljs from 'highlight.js/lib/core';
|
||||||
import json from 'highlight.js/lib/languages/json';
|
import json from 'highlight.js/lib/languages/json';
|
||||||
import { twMerge } from 'tailwind-merge';
|
|
||||||
|
|
||||||
hljs.registerLanguage('json', json);
|
hljs.registerLanguage('json', json);
|
||||||
|
|
||||||
@ -11,19 +10,15 @@ defineOptions({
|
|||||||
});
|
});
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
class?: string;
|
|
||||||
code?: string;
|
code?: string;
|
||||||
showLineNumbers?: boolean;
|
showLineNumbers?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<Props>(), {
|
const props = withDefaults(defineProps<Props>(), {
|
||||||
class: '',
|
|
||||||
code: '',
|
code: '',
|
||||||
showLineNumbers: false
|
showLineNumbers: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const DEFAULT_CLASS = 'max-h-500px';
|
|
||||||
|
|
||||||
/** 格式化JSON数据 */
|
/** 格式化JSON数据 */
|
||||||
const jsonData = computed<string>(() => {
|
const jsonData = computed<string>(() => {
|
||||||
if (!props.code) return '';
|
if (!props.code) return '';
|
||||||
@ -38,9 +33,9 @@ const jsonData = computed<string>(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<NScrollbar :class="twMerge(DEFAULT_CLASS, props.class)">
|
<div class="json-preview">
|
||||||
<NCode :code="jsonData" :hljs="hljs" language="json" :show-line-numbers="showLineNumbers" :word-wrap="true" />
|
<NCode :code="jsonData" :hljs="hljs" language="json" :show-line-numbers="showLineNumbers" />
|
||||||
</NScrollbar>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@ -49,4 +44,18 @@ html[class='dark'] {
|
|||||||
background-color: #7c7777;
|
background-color: #7c7777;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.json-preview {
|
||||||
|
width: 100%;
|
||||||
|
max-height: 500px;
|
||||||
|
overflow-y: auto;
|
||||||
|
@include scrollbar();
|
||||||
|
.empty-data {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100%;
|
||||||
|
color: #999;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user