fix(datasource): data type icon invisible #312 (#332)

* fix(datasource): data type icon invisible

* fix(common): #325 reduce unnecessary network requests.

* style(datasource): remove unnecessary comment

---------

Co-authored-by: zeyong.cai <zeyong.cai@xquant.com>
This commit is contained in:
zeyong tsai 2024-03-19 18:50:30 +08:00 committed by GitHub
parent 68637db8db
commit 030497fbad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 27 additions and 22 deletions

View File

@ -6,6 +6,7 @@
</slot>
<tiny-dialog-box
v-if="dialogShouldInitialize"
:visible="state.isVisible"
title="变量绑定"
width="48%"
@ -181,6 +182,10 @@ export default {
modelValue: {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
},
lazyLoad: {
type: Boolean,
default: true
}
},
setup(props, { emit }) {
@ -442,7 +447,9 @@ export default {
return ''
}
const dialogShouldInitialize = ref(!props.lazyLoad)
const open = () => {
dialogShouldInitialize.value = true
state.isVisible = true
state.variableName = bindKey.value
state.variable = getInitVariable()
@ -527,6 +534,7 @@ export default {
remove,
cancel,
confirm,
dialogShouldInitialize,
open,
selectItem,
state,

View File

@ -15,7 +15,7 @@
</div>
<div class="field-content type-list">
<a v-for="fieldType in state.fieldTypes" :key="fieldType.name" class="type-item" @click="selectType(fieldType)">
<component :is="fieldType.icon" class="type-icon"></component>
<svg-icon :name="fieldType.icon" class="type-icon" />
<span>{{ fieldType.name }}</span>
</a>
</div>
@ -25,7 +25,7 @@
<script>
import { reactive, ref } from 'vue'
import { iconArrowDown } from '@opentiny/vue-icon'
import { Button, Input, FormItem, Tooltip } from '@opentiny/vue'
import { Button } from '@opentiny/vue'
import fieldTypes from './config'
let isOpen = ref(false)
@ -41,10 +41,7 @@ export const close = () => {
export default {
components: {
TinyButton: Button,
TinyInput: Input,
TinyFormItem: FormItem,
iconArrowDown: iconArrowDown(),
TinyTooltip: Tooltip
iconArrowDown: iconArrowDown()
},
emits: ['cancel', 'select'],
setup(props, { emit }) {

View File

@ -1,49 +1,49 @@
/**
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
* Copyright (c) 2023 - present TinyEngine Authors.
* Copyright (c) 2023 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/
export default [
{
name: '字符串',
icon: 'icon-text',
icon: 'text',
type: 'string',
value: ''
},
{
name: '日期',
icon: 'icon-calendar',
icon: 'datepick',
type: 'date',
value: ''
},
{
name: '计数器',
icon: 'icon-export',
icon: 'numeric',
type: 'number',
value: ''
},
{
name: '文字链接',
icon: 'icon-link',
icon: 'link',
type: 'link',
value: ''
},
{
name: '开关',
icon: 'icon-text',
icon: 'switch',
type: 'switch',
value: ''
},
{
name: '滑块',
icon: 'icon-text',
icon: 'dragger',
type: 'slider',
value: ''
}