|
@@ -4,6 +4,7 @@ import XEUtils from 'xe-utils'
|
|
|
import {PulldownMethods} from "vxe-table/types/pulldown";
|
|
|
import {useVModel} from "@vueuse/core";
|
|
|
import {VxeTableInstance} from "vxe-table";
|
|
|
+import {$ref} from "vue/macros";
|
|
|
|
|
|
const props = defineProps({
|
|
|
modelValue: {
|
|
@@ -27,7 +28,7 @@ const props = defineProps({
|
|
|
},
|
|
|
code: String,
|
|
|
name: String,
|
|
|
- // 绑定对象的 code 自动在拼接name在字段的后面
|
|
|
+ // 绑定对象的 code 自动在后面 拼接 Name
|
|
|
codeName: String,
|
|
|
clearable: {
|
|
|
type: Boolean,
|
|
@@ -68,8 +69,9 @@ const emits = defineEmits([
|
|
|
const modVal = useVModel(props, 'modelValue', emits)
|
|
|
const modData = useVModel(props, 'data', emits)
|
|
|
|
|
|
-let modCode = ''
|
|
|
-let modName = ''
|
|
|
+let modCode = $ref('')
|
|
|
+let modName = $ref('')
|
|
|
+
|
|
|
let selectName = ''
|
|
|
let scrollTopRecording = 0
|
|
|
|
|
@@ -289,16 +291,7 @@ const handleClear = () => {
|
|
|
|
|
|
const scroll = (val) => {
|
|
|
let {
|
|
|
- type,
|
|
|
scrollTop,
|
|
|
- scrollLeft,
|
|
|
- scrollHeight,
|
|
|
- scrollWidth,
|
|
|
- bodyWidth,
|
|
|
- bodyHeight,
|
|
|
- isX,
|
|
|
- isY,
|
|
|
- $event
|
|
|
} = val;
|
|
|
scrollTopRecording = scrollTop;
|
|
|
}
|
|
@@ -313,7 +306,10 @@ onMounted(async () => {
|
|
|
modName = props.codeName + 'Name';
|
|
|
} else {
|
|
|
if (!props.code || !props.name) {
|
|
|
- console.error('绑定是对象,要填写 code 和 name');
|
|
|
+ console.error('绑定是对象,要填写 code 和 name 或者填写codeName');
|
|
|
+ } else {
|
|
|
+ modCode = props.code
|
|
|
+ modName = props.name
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -364,7 +360,7 @@ onMounted(async () => {
|
|
|
transfer>
|
|
|
<template #default>
|
|
|
<el-input v-model="inputData"
|
|
|
- :title="isObj ? props.modelValue[props.name] : props.modelValue"
|
|
|
+ :title="isObj ? props.modelValue[modName] : props.modelValue"
|
|
|
@clear="handleClear"
|
|
|
:disabled="props.disabled"
|
|
|
ref="inputRef"
|