Commit 7606108d67fd9db41b4e4af380dd37f802d41466

Authored by loveumiko
2 parents 106ae376 f25c4521

Merge branch 'main_dev' of http://git.yunteng.com/yunteng/thingskit-front into fix/DEFECT-1362

... ... @@ -3,18 +3,20 @@
3 3 import IconData from '/@/components/Icon/data/iconfont.data';
4 4 import { SvgIcon } from '/@/components/Icon';
5 5 import { computed } from '@vue/reactivity';
6   - import { onMounted, unref } from 'vue';
  6 + import { onMounted } from 'vue';
7 7
8   - const props = defineProps<{
9   - value?: string;
10   - color?: string;
11   - }>();
  8 + const props = withDefaults(
  9 + defineProps<{
  10 + value?: string;
  11 + color?: string;
  12 + }>(),
  13 + {
  14 + value: 'shuiwen',
  15 + }
  16 + );
12 17 const emit = defineEmits(['update:value']);
13 18 const iconList = IconData.icons;
14 19 const [register, { openDrawer, closeDrawer }] = useDrawer();
15   - const getIcon = computed(() => {
16   - return props.value || 'shuiwen';
17   - });
18 20
19 21 const getColor = computed(() => {
20 22 return props.color || '#377DFF';
... ... @@ -30,14 +32,13 @@
30 32 };
31 33
32 34 onMounted(() => {
33   - emit('update:value', unref(getIcon));
  35 + emit('update:value', props.value);
34 36 });
35 37 </script>
36 38
37 39 <template>
38 40 <SvgIcon
39   - :name="getIcon"
40   - :icon="getIcon"
  41 + :name="value"
41 42 prefix="iconfont"
42 43 class="cursor-pointer !w-6 !h-6"
43 44 :style="{ color: getColor }"
... ...
... ... @@ -21,7 +21,7 @@ export const getVideoTypeByUrl = (url: string) => {
21 21 const type = VideoPlayerType[ext];
22 22 return type ? type : VideoPlayerType.webm;
23 23 } catch (error) {
24   - console.error(error);
  24 + console.error(`url: '${url}' is invalid!`);
25 25 return VideoPlayerType.webm;
26 26 }
27 27 };
... ...
... ... @@ -68,16 +68,17 @@ export const usePlatform = async () => {
68 68 .vben-login::before{
69 69 background-image:url("${background || lightThemeBgImage}");
70 70 position:absolute;
  71 + background-size: ${background ? '100%' : 'auto'} 100% !important;
71 72 margin-left: ${background ? 0 : '-48%'} !important;
72 73 }
73 74 html[data-theme='dark'] .vben-login::before{
74 75 background-image:url("${background || darkThemeBgImage}");
75 76 position:absolute;
  77 + background-size: ${background ? '100%' : 'auto'} 100% !important;
76 78 margin-left: ${background ? 0 : '-48%'} !important;
77 79 }
78 80 `;
79 81
80   - console.log(styleEl);
81 82 document.head.appendChild(styleEl);
82 83 };
83 84
... ...
... ... @@ -105,7 +105,8 @@
105 105 if (activeKey === TabKeyEnum.VISUAL) {
106 106 dataSource.value = (dataSourceFormEl.value?.getFormValues() as DataSourceType[]) || [];
107 107 }
108   - currentRecord.value = basicInfoFromEl.value?.getFormValues() || {};
  108 + const value = basicInfoFromEl.value?.getFormValues() || {};
  109 + currentRecord.value = { ...unref(currentRecord), ...value };
109 110 };
110 111
111 112 const handleNewRecord = () => {
... ...