Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/common/component/MetaBindVariable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</slot>

<tiny-dialog-box
v-if="dialogShouldInitialize"
Comment thread
chilingling marked this conversation as resolved.
:visible="state.isVisible"
title="变量绑定"
width="48%"
Expand Down Expand Up @@ -181,6 +182,10 @@ export default {
modelValue: {
type: [String, Number, Boolean, Array, Object, Date],
default: ''
},
lazyLoad: {
type: Boolean,
default: true
}
},
setup(props, { emit }) {
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -527,6 +534,7 @@ export default {
remove,
cancel,
confirm,
dialogShouldInitialize,
open,
selectItem,
state,
Expand Down
9 changes: 3 additions & 6 deletions packages/plugins/datasource/src/DataSourceFieldType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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)
Expand All @@ -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 }) {
Expand Down
32 changes: 16 additions & 16 deletions packages/plugins/datasource/src/config.js
Original file line number Diff line number Diff line change
@@ -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: ''
}
Expand Down