Преглед изворни кода

Fix 撤回表格组件的部分字段的错误替换

Yue пре 2 година
родитељ
комит
6cd0f4eb5a

+ 3 - 3
UI/XYH.VUE/src/components/table/partials/body/BodyTd.vue

@@ -11,14 +11,14 @@ const props = withDefaults(
 		index?: number
 		rowspan?: string
 		isTree?: boolean
-		orgh?: number
+		depth?: number
 	}>(),
 	{
 		isTree: false,
 		iconField: "name",
 		leafField: "isLeaf",
 		intervalLeft: 10,
-		orgh: 0
+		depth: 0
 	}
 )
 const propsOpts = inject(symbolKeys.bodyTd, {
@@ -87,7 +87,7 @@ onMounted(init)
 			v-if="isTree && column.field == propsOpts.iconField"
 			@click="onToggle"
 			class="me-2"
-			:style="`margin-left: ${propsOpts.intervalLeft * props.orgh}px!important`">
+			:style="`margin-left: ${propsOpts.intervalLeft * props.depth}px!important`">
 			<template v-if="propsOpts.hasChildren || (!isLeaf && propsOpts.isLazy)">
 				<VbIcon
 					v-if="propsOpts.isLazy ? false : propsOpts.isExpand"

+ 3 - 3
UI/XYH.VUE/src/components/table/partials/body/BodyTds.vue

@@ -7,7 +7,7 @@ const props = defineProps<{
 	isExpand: boolean
 	hasChildren: boolean
 	index: number
-	orgh: number
+	depth: number
 }>()
 
 const propOpts = inject(symbolKeys.bodyTds, {
@@ -39,7 +39,7 @@ provide(
 				:column="column"
 				:index="index"
 				:is-tree="isTree"
-				:orgh="orgh"
+				:depth="depth"
 				:rowspan="`${
 					row[column.field + propOpts.rowSpanSuffix]
 						? row[column.field + propOpts.rowSpanSuffix]
@@ -51,7 +51,7 @@ provide(
 			</BodyTd>
 		</template>
 		<template v-else-if="row[column.field + propOpts.rowSpanSuffix] != 0">
-			<BodyTd :row="row" :column="column" :index="index" :is-tree="isTree" :orgh="orgh">
+			<BodyTd :row="row" :column="column" :index="index" :is-tree="isTree" :depth="depth">
 				<template v-for="(_, name) in $slots" #[name]="{ row }">
 					<slot :name="name" :row="row"></slot>
 				</template>

+ 4 - 4
UI/XYH.VUE/src/components/table/partials/body/BodyTr.vue

@@ -7,7 +7,7 @@ import BodyTds from "@@@/table/partials/body/BodyTds.vue"
 const props = defineProps<{
 	row: any
 	index: number
-	orgh: number
+	depth: number
 }>()
 
 const propOpts = inject(symbolKeys.bodyTr, {
@@ -30,7 +30,7 @@ const selectedIds = toRef(propOpts.selectedIds)
 const tableBox = inject(symbolKeys.tableBox) as Ref<HTMLElement>
 
 const isExpand = computed(() => {
-	return propOpts.isLazy ? true : propOpts.expandDepth > props.orgh
+	return propOpts.isLazy ? true : propOpts.expandDepth > props.depth
 })
 
 const hasChildren = computed(() => {
@@ -42,7 +42,7 @@ const getTrClass = computed(() => {
 	if (hasChildren.value) {
 		_trClass += `hasChildren ${isExpand.value ? "tr-expand" : "tr-collapse"} `
 	}
-	_trClass += !propOpts.isLazy && props.orgh > propOpts.expandDepth ? "hide" : "show"
+	_trClass += !propOpts.isLazy && props.depth > propOpts.expandDepth ? "hide" : "show"
 	return _trClass
 })
 function getParent(row: any) {
@@ -86,7 +86,7 @@ const onDbRowClick = () => {
 			:is-tree="propOpts.isTree"
 			:hasChildren="hasChildren"
 			:isExpand="isExpand"
-			:orgh="orgh">
+			:depth="depth">
 			<template v-for="(_, name) in $slots" #[name]="{ row }">
 				<slot :name="name" :row="Object.assign({}, row)" />
 			</template>

+ 3 - 3
UI/XYH.VUE/src/components/table/partials/body/BodyTreeTr.vue

@@ -6,7 +6,7 @@ const props = defineProps<{
 	rows: any[]
 	childrenField: string
 	index: number
-	orgh: number
+	depth: number
 }>()
 const hasChildren = (row: any) => {
 	return row[props.childrenField] && row[props.childrenField].length
@@ -14,7 +14,7 @@ const hasChildren = (row: any) => {
 </script>
 <template>
 	<template v-for="(v, i) in rows" :key="i">
-		<BodyTr :row="v" :orgh="orgh" :index="index">
+		<BodyTr :row="v" :depth="depth" :index="index">
 			<template v-for="(_, name) in $slots" #[name]="{ row }">
 				<slot :name="name" :row="row" />
 			</template>
@@ -24,7 +24,7 @@ const hasChildren = (row: any) => {
 				:index="index + 1"
 				:rows="v[childrenField]"
 				:childrenField="childrenField"
-				:orgh="orgh + 1">
+				:depth="depth + 1">
 				<template v-for="(_, name) in $slots" #[name]="{ row }">
 					<slot :name="name" :row="Object.assign({}, row)" />
 				</template>

+ 3 - 3
UI/XYH.VUE/src/components/table/partials/body/TableBody.vue

@@ -9,7 +9,7 @@ const propOpts = inject(symbolKeys.body, {
 	childrenField: "children",
 	bodyClass: "fw-semibold text-gray-600"
 })
-const orgh = 0
+const depth = 0
 const rows = inject(symbolKeys.displayData, ref([]))
 const tbody = ref<HTMLElement>()
 const hasChildren = (row: any) => {
@@ -19,7 +19,7 @@ const hasChildren = (row: any) => {
 <template>
 	<tbody v-if="rows?.length > 0" ref="tbody" :class="propOpts.bodyClass">
 		<template v-for="(row, i) in rows" :key="i">
-			<BodyTr :row="row" :orgh="orgh" :index="i + 1">
+			<BodyTr :row="row" :depth="depth" :index="i + 1">
 				<template v-for="(_, name) in $slots" #[name]="{ row }">
 					<slot :name="name" :row="row" />
 				</template>
@@ -29,7 +29,7 @@ const hasChildren = (row: any) => {
 					:index="i + 1"
 					:rows="row[propOpts.childrenField]"
 					:childrenField="propOpts.childrenField"
-					:orgh="orgh + 1">
+					:depth="depth + 1">
 					<template v-for="(_, name) in $slots" #[name]="{ row }">
 						<slot :name="name" :row="row" />
 					</template>