Browse Source

Add VbForm组件添加tips功能

Yue 8 months ago
parent
commit
6fb0538495

+ 8 - 9
UI/VAP_V3.VUE/src/components/form/VbFormItem.vue

@@ -123,13 +123,12 @@ function isDisable(item: any) {
 	return item.disabled
 }
 
-const hasTip = computed(() => {
-	return item.value.tip
+const hasTips = computed(() => {
+	return item.value.tips
 })
-const tipIconClass = computed(() => {
-	let str = item.value.tipIcon ? item.value.tipIcon : "bi bi-question-circle-fill "
-	str += item.value.tipIconClass ? item.value.tipIconClass : " text-muted ms-1"
-	console.log("tipIconClass", str)
+const tipsIconClass = computed(() => {
+	let str = item.value.tipsIcon ? item.value.tipsIcon : "bi bi-question-circle-fill "
+	str += item.value.tipsIconClass ? item.value.tipsIconClass : " text-muted ms-1"
 	return str
 })
 
@@ -156,10 +155,10 @@ onMounted(() => {
 					: item.labelWidth || labelWidth
 			"
 			v-bind="item.itemProps">
-			<template #label v-if="hasTip">
+			<template #label v-if="hasTips">
 				<span class="fw-bold text-dark" :style="item.labelStyle ?? ''">{{ item.label }}</span>
-				<vb-tooltip :content="item.tip ?? ''" placement="top">
-					<span :class="tipIconClass" style="cursor: pointer"></span>
+				<vb-tooltip :content="item.tips ?? ''" placement="top">
+					<span :class="tipsIconClass" style="cursor: pointer"></span>
 				</vb-tooltip>
 			</template>
 			<slot v-if="checkComponent('slot')" :name="item.field"></slot>

+ 3 - 3
UI/VAP_V3.VUE/src/components/form/models.ts

@@ -63,10 +63,10 @@ export interface VbFormItem {
 	itemProps?: any // 注入到 el-form-item 的属性
 	props?: any // 当 component 为渲染组件时,注入到渲染组件当中的属性
 	listeners?: any // 当 component 为渲染组件时,注入到渲染组件当中的事件
-	tip?: string
+	tips?: string
 	labelStyle?: string // label样式 tip有值生效
-	tipIcon?: string // 默认值  bi bi-question-circle-fill
-	tipIconClass?: string // 默认值  text-muted
+	tipsIcon?: string // 默认值  bi bi-question-circle-fill
+	tipsIconClass?: string // 默认值  text-muted
 }
 
 export interface VbFormRowItem {

+ 5 - 1
UI/VAP_V3.VUE/src/views/system/user/index.vue

@@ -101,7 +101,11 @@ const tableOpts = reactive({
 			handleDelete(rows)
 		},
 		handleImport,
-		handleExport
+		handleExport,
+		handleResetPwd: () => {
+			const row = tableRef.value.getSelected()
+			handleResetPwd(row)
+		}
 	}
 })
 const { permission, columns, queryParams, searchFormItems, handleFuns } = toRefs(tableOpts)