|
@@ -109,6 +109,19 @@ export default {
|
|
|
return multiple ? "" : value;
|
|
|
},
|
|
|
set(val) {
|
|
|
+ const {
|
|
|
+ $props: { source, dataMapping, multiple },
|
|
|
+ } = this;
|
|
|
+ if (!multiple) {
|
|
|
+ for (let key in dataMapping) {
|
|
|
+ if (dataMapping[key] === "id" || dataMapping[key] === "code") {
|
|
|
+ if (source[key] && source[key] !== "") {
|
|
|
+ source[key] = undefined;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
this.$emit("input", val);
|
|
|
},
|
|
|
},
|
|
@@ -127,10 +140,10 @@ export default {
|
|
|
},
|
|
|
innerValue: {
|
|
|
handler: function (newValue) {
|
|
|
+ const {
|
|
|
+ $props: { source, dataMapping, multiple },
|
|
|
+ } = this;
|
|
|
if (!newValue) {
|
|
|
- const {
|
|
|
- $props: { source, dataMapping },
|
|
|
- } = this;
|
|
|
for (let key in dataMapping) {
|
|
|
source[key] = undefined;
|
|
|
}
|
|
@@ -312,20 +325,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- handleKeyupDel() {
|
|
|
- console.log("focus");
|
|
|
- const {
|
|
|
- $props: { source, dataMapping },
|
|
|
- } = this;
|
|
|
-
|
|
|
- for (let key in dataMapping) {
|
|
|
- if (dataMapping[key] === "id" || dataMapping[key] === "code") {
|
|
|
- if (source[key] && source[key] !== "") {
|
|
|
- source[key] = undefined;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {},
|
|
@@ -359,7 +358,6 @@ export default {
|
|
|
:fetch-suggestions="useAutocomplete"
|
|
|
@blur="useBlur"
|
|
|
@select="useConfirm([$event])"
|
|
|
- @keyup.delete.native="handleKeyupDel"
|
|
|
style="width: 100%"
|
|
|
>
|
|
|
<i :size="size" class="el-icon-search" slot="suffix" @click="open"> </i>
|