pull/3/head^2
xiaozhiyong 2 years ago
parent 1d0e1bd34e
commit dee2e346bc
  1. 56
      src/components/autocomplete/index.vue
  2. 3
      src/utils/index.js
  3. 2
      src/views/customerManagement/companyManagement/index.vue
  4. 0
      src/views/customerManagement/position.html
  5. 2
      src/views/financialCenter/accountManagement/index.vue
  6. 2
      src/views/financialCenter/enterpriseRecharge/index.vue
  7. 2
      src/views/financialCenter/enterpriseRechargeDetails/index.vue

@ -11,13 +11,31 @@
:disabled="isDisabled"
@change="change"
>
<el-option
v-for="(item, index) in list"
:key="item.id + index"
:label="item[config.labelKey]"
:value="item[config.valueKey]"
>
</el-option>
<template v-if="labelIsMore">
<el-option
v-for="(item, index) in list"
:key="item.id + index"
:label="
item[config.labelKey[0]] +
'(' +
item[config.labelKey[1]] +
'-' +
item[config.labelKey[2]] +
')'
"
:value="item[config.valueKey]"
>
</el-option>
</template>
<template>
<el-option
v-for="(item, index) in list"
:key="item.id + index"
:label="item[config.labelKey]"
:value="item[config.valueKey]"
>
</el-option>
</template>
</el-select>
</template>
@ -37,6 +55,8 @@ export default {
data() {
return {
text: "",
labelIsMore: false,
// labelKeyArr:[],
list: [],
isDisabled: false,
};
@ -58,8 +78,7 @@ export default {
"config.isDisabled": {
handler(nval, oval) {
let type = this.$utils.typeJudgment(nval);
console.log("type", type);
if (type.includes("Boolean") || type.includes("String")) {
if (["Boolean", "String"].includes(type)) {
this.isDisabled = !!this.config.isDisabled;
}
},
@ -67,6 +86,16 @@ export default {
immediate: true,
},
},
created() {
let { labelKey } = this.config;
let type = this.$utils.typeJudgment(labelKey);
// console.log(type);
if (type === "Array") {
// let
this.labelIsMore = true;
// console.log(this.labelIsMore);
}
},
methods: {
//
remoteMethod(query) {
@ -79,17 +108,12 @@ export default {
// return;
// }
let params = {};
if (type.includes("Object")) {
if (["Object"].includes(type)) {
params[this.config.autocompleteKey.key] = query;
params["enableMark"] = this.config.autocompleteKey.enableMark;
}
if (
type.includes("String") ||
type.includes("Undefined") ||
type.includes("Null")
) {
if (["String", "Undefined", "Null"].includes(type)) {
// getautocompleteKey
console.log();
this.config.autocompleteKey
? (params[this.config.autocompleteKey] = query)
: (params = query);

@ -58,5 +58,6 @@ export function cellStyle() {
// 类型判断
export function typeJudgment(object) {
let res = {}.__proto__.toString.call(object);
return res || "";
let type = /(?<= ).+(?=\])/.exec(res);
return type.length ? type[0] : "";
}

@ -509,7 +509,7 @@ export default {
},
configAutocompleteLeader: {
serveTarget: commonServe.liekQuery,
labelKey: "nickName",
labelKey: ["id", "nickName", "phone"],
valueKey: "id",
placeholder: "企业负责人姓名或联系方式",
querykey: "businessLeader",

@ -275,7 +275,7 @@ export default {
configAutocompleteBusinessLeader: {
serveTarget: commonServe.liekQuery,
autocompleteKey: "",
labelKey: "nickName",
labelKey: ["id", "nickName", "phone"],
valueKey: "id",
placeholder: "业务负责人",
querykey: "businessLeader",

@ -395,7 +395,7 @@ export default {
configAutocompleteSec: {
serveTarget: commonServe.liekQuery,
autocompleteKey: "",
labelKey: "nickName",
labelKey: ["id", "nickName", "phone"],
valueKey: "id",
placeholder: "业务负责人",
querykey: "businessLeader",

@ -257,7 +257,7 @@ export default {
configAutocompleteSec: {
serveTarget: commonServe.liekQuery,
autocompleteKey: "",
labelKey: "nickName",
labelKey: ["id", "nickName", "phone"],
valueKey: "id",
placeholder: "业务负责人",
querykey: "businessLeader",

Loading…
Cancel
Save