|
@@ -131,11 +131,57 @@ const tipsIconClass = computed(() => {
|
|
|
str += item.value.tipsIconClass ? item.value.tipsIconClass : " text-muted ms-1"
|
|
str += item.value.tipsIconClass ? item.value.tipsIconClass : " text-muted ms-1"
|
|
|
return str
|
|
return str
|
|
|
})
|
|
})
|
|
|
|
|
+const hasPrepend = computed(() => {
|
|
|
|
|
+ return !!(item.value.prepend || item.value.prependIcon || item.value.prependClickFunc)
|
|
|
|
|
+})
|
|
|
|
|
+const hasPrependSlot = computed(() => {
|
|
|
|
|
+ return item.value.prepend === "slot" || item.value.prepend === "Slot"
|
|
|
|
|
+})
|
|
|
|
|
+const prependIcon = computed(() => {
|
|
|
|
|
+ if (item.value.prependIcon) {
|
|
|
|
|
+ return item.value.prependIcon
|
|
|
|
|
+ } else if (item.value.prepend && item.value.prepend !== "icon" && item.value.prepend !== "Icon") {
|
|
|
|
|
+ return ""
|
|
|
|
|
+ } else if (
|
|
|
|
|
+ item.value.prependClickFunc ||
|
|
|
|
|
+ item.value.prepend === "icon" ||
|
|
|
|
|
+ item.value.prepend === "Icon"
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return "bi bi-search text-primary"
|
|
|
|
|
+ }
|
|
|
|
|
+ return ""
|
|
|
|
|
+})
|
|
|
|
|
+function prependClickFunc() {
|
|
|
|
|
+ item.value.prependClickFunc && item.value.prependClickFunc(data.value)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const hasAppend = computed(() => {
|
|
|
|
|
+ return !!(item.value.append || item.value.appendIcon || item.value.appendClickFunc)
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
|
|
+const hasAppendSlot = computed(() => {
|
|
|
|
|
+ return item.value.append === "slot" || item.value.append === "Slot"
|
|
|
|
|
+})
|
|
|
|
|
+const appendIcon = computed(() => {
|
|
|
|
|
+ if (item.value.appendIcon) {
|
|
|
|
|
+ return item.value.appendIcon
|
|
|
|
|
+ } else if (item.value.append && item.value.append !== "icon" && item.value.append !== "Icon") {
|
|
|
|
|
+ return ""
|
|
|
|
|
+ } else if (
|
|
|
|
|
+ item.value.appendClickFunc ||
|
|
|
|
|
+ item.value.append === "icon" ||
|
|
|
|
|
+ item.value.append === "Icon"
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return "bi bi-search text-primary"
|
|
|
|
|
+ }
|
|
|
|
|
+ return ""
|
|
|
|
|
+})
|
|
|
|
|
+function appendClickFunc() {
|
|
|
|
|
+ item.value.appendClickFunc && item.value.appendClickFunc(data.value)
|
|
|
|
|
+}
|
|
|
function init() {
|
|
function init() {
|
|
|
//
|
|
//
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
init()
|
|
init()
|
|
|
})
|
|
})
|
|
@@ -183,7 +229,22 @@ onMounted(() => {
|
|
|
:disabled="isDisabled()"
|
|
:disabled="isDisabled()"
|
|
|
:readonly="isReadonly()"
|
|
:readonly="isReadonly()"
|
|
|
v-bind="item.props"
|
|
v-bind="item.props"
|
|
|
- v-on="item.listeners"></el-input>
|
|
|
|
|
|
|
+ v-on="item.listeners">
|
|
|
|
|
+ <template #prepend v-if="hasPrepend">
|
|
|
|
|
+ <slot v-if="hasPrependSlot" :name="`${item.field}_prepend`"></slot>
|
|
|
|
|
+ <el-button v-else-if="prependIcon" @click="prependClickFunc">
|
|
|
|
|
+ <i :class="prependIcon"></i>
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <span v-else @click="prependClickFunc">{{ item.prepend }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #append v-if="hasAppend">
|
|
|
|
|
+ <slot v-if="hasAppendSlot" :name="`${item.field}_append`"></slot>
|
|
|
|
|
+ <el-button v-else-if="appendIcon" @click="appendClickFunc">
|
|
|
|
|
+ <i :class="appendIcon"></i>
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <span v-else @click="appendClickFunc">{{ item.append }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-input>
|
|
|
<el-input
|
|
<el-input
|
|
|
v-else
|
|
v-else
|
|
|
v-model="data[item.field]"
|
|
v-model="data[item.field]"
|
|
@@ -197,7 +258,22 @@ onMounted(() => {
|
|
|
:disabled="isDisabled()"
|
|
:disabled="isDisabled()"
|
|
|
:readonly="isReadonly()"
|
|
:readonly="isReadonly()"
|
|
|
v-bind="item.props"
|
|
v-bind="item.props"
|
|
|
- v-on="item.listeners"></el-input>
|
|
|
|
|
|
|
+ v-on="item.listeners">
|
|
|
|
|
+ <template #prepend v-if="hasPrepend">
|
|
|
|
|
+ <slot v-if="hasPrependSlot" :name="`${item.field}_prepend`"></slot>
|
|
|
|
|
+ <el-button v-else-if="prependIcon" @click="prependClickFunc">
|
|
|
|
|
+ <i :class="prependIcon"></i>
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <span v-else @click="prependClickFunc">{{ item.prepend }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #append v-if="hasAppend">
|
|
|
|
|
+ <slot v-if="hasAppendSlot" :name="`${item.field}_append`"></slot>
|
|
|
|
|
+ <el-button v-else-if="appendIcon" @click="appendClickFunc">
|
|
|
|
|
+ <i :class="appendIcon"></i>
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <span v-else @click="appendClickFunc">{{ item.append }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-input>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="checkComponent('VS') || checkComponent('VbSelect')">
|
|
<template v-else-if="checkComponent('VS') || checkComponent('VbSelect')">
|
|
|
<vb-select
|
|
<vb-select
|