pull/1/head
xiaozhiyong 2 years ago
parent 83887bdd1f
commit c856bb5318
  1. 18
      src/components/autocomplete/index.vue
  2. 5
      src/utils/index.js
  3. 5
      src/views/product/components/add.vue

@ -59,12 +59,18 @@ export default {
if (query !== "") {
this.loading = true;
let params = {};
// if() {
// }
this.config.autocompleteKey
? (params[this.config.autocompleteKey] = query)
: (params["queryTypeGet"] = query);
if (
this.$utils
.typeJudgment(this.config.autocompleteKey)
.includes("Object")
) {
params[this.config.autocompleteKey.key] = query;
params["enableMark"] = this.config.autocompleteKey.enableMark;
} else {
this.config.autocompleteKey
? (params[this.config.autocompleteKey] = query)
: (params["queryTypeGet"] = query);
}
this.config.serveTarget(params).then((res) => {
let timeInstance = setTimeout(() => {
this.loading = false;

@ -55,3 +55,8 @@ export function isLicensePlate(no) {
export function cellStyle() {
return "text-align:center";
}
export function typeJudgment(object) {
let res = {}.__proto__.toString.call(object);
return res ? res : "";
}

@ -110,7 +110,10 @@ export default {
refineryList: [],
configAutocomplete: {
serveTarget: refineryInfoServe.findByEntity,
autocompleteKey: "refineryName",
autocompleteKey: {
key: "refineryName",
enableMark: "ENABLE",
},
labelKey: "refineryName",
valueKey: "id",
placeholder: "炼厂名称",

Loading…
Cancel
Save