|
@@ -109,18 +109,18 @@ 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;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // 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);
|
|
|
},
|
|
@@ -325,6 +325,20 @@ 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() {},
|
|
@@ -344,6 +358,7 @@ export default {
|
|
|
@clear="handleClear"
|
|
|
@change="handleChange"
|
|
|
@keyup.enter.native="handleChange"
|
|
|
+ @keyup.delete.native="handleKeyupDel"
|
|
|
>
|
|
|
<i :size="size" class="el-icon-search" slot="suffix" @click="open"> </i>
|
|
|
</el-input>
|