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