{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\eipControl\\EipSelectDia.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\src\\components\\eipControl\\EipSelectDia.vue","mtime":1667327529247},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n    import utils from \"@/utils.js\";\n    import hotentUtils from \"@/hotent-ui-util.js\";\n\n    export default {\n  name: \"eip-select-dia\",\n  props: [\n    \"validate\",\n    \"value\",\n    \"name\",\n    \"permission\",\n    \"multiple\",\n    \"selectlist\",\n    \"linkage\",\n    \"ganged\",\n    \"filterable\",\n    \"allowCreate\",\n    \"placeholder\",\n    \"customQuery\",\n    \"relatedQuery\",\n    \"queryParams\"\n  ],\n  data() {\n    return {\n      options: [],\n      newValidate: null,\n      queryParamData:this.queryParams\n    };\n  },\n  computed: {\n    inputVal: {\n      get: function() {\n        if (this.value || this.value === 0) {\n          return this.value + \"\";\n        }\n        return this.value;\n      },\n      set: function(val) {\n        this.$emit(\"input\", val);\n        this.relatedQueryLoad();\n      }\n    },\n    inputWriteable: function() {\n      return utils.getWriteable(this.permission);\n    },\n    inputValidate: function() {\n      if (this.newValidate) {\n        return this.newValidate;\n      }\n      var validateObj = this.$store.state.index.validate;\n      return utils.addRequiredOrNot(\n        this.permission,\n        this.validate,\n        validateObj,\n        this\n      );\n    },\n    inputName: function() {\n      let labeldesc = \"\";\n      if (\n        this.$slots &&\n        this.$slots.labeldesc &&\n        this.$slots.labeldesc[0].children &&\n        this.$slots.labeldesc[0].children[0].text\n      ) {\n        labeldesc = this.$slots.labeldesc[0].children[0].text;\n        return this.name ? this.name : utils.getName() + \"-\" + labeldesc;\n      } else {\n        return this.name ? this.name : utils.getName();\n      }\n    }\n  },\n  mounted() {\n    this.loadOption(true);\n  },\n  created() {\n    // 动态选项所绑定的关联查询返回了查询结果\n    this.$on(\"dynamic-options:update\", this.dynamicOptionResponse);\n    this.$validator = this.$root.$validator;\n  },\n  methods: {\n    selectBlur: function() {\n      this.$emit(\"blur\");\n    },\n    selectFocus: function() {\n      this.loadOption();\n      this.$emit(\"focus\");\n    },\n    //加载选项\n    loadOption: function(isMounted) {\n      // 动态选项\n      if (this.ganged && this.ganged.alias) {\n        // 如果是初始化，且该动态选项配置了初始化不加载数据，则跳过动态选项的加载\n        if (isMounted && this.ganged.noInit && this.ganged.noInit == \"true\") {\n          return;\n        }\n        this.dynamicLoadOption();\n      } else {\n        // 静态选项\n        this.options = [...this.selectlist] || [];\n      }\n    },\n    // 准备查询参数\n    prepareLoadParams: function(condition) {\n      let params = {};\n      if(this.queryParamData){\n        condition.forEach(fieldPathItem => {\n          this.queryParamData.forEach(paramObj => {\n            for(let key in paramObj){ \n                if(fieldPathItem.fieldPath==key){\n                  params[fieldPathItem.field]=this.queryParamData[key];\n                }\n            }\n          });\n        });\n      }\n      return params;\n    },\n    // 动态加载选项\n    dynamicLoadOption: function() {\n      const params = this.prepareLoadParams(this.ganged.bind);\n      this.$emit(\"dynamic-options:load\", this.ganged.alias, params);\n    },\n    // 动态加载选项返回值处理\n    dynamicOptionResponse: function(alias, data) {\n      if (\n        this.ganged &&\n        this.ganged.alias == alias &&\n        this.ganged.valueBind &&\n        this.ganged.labelBind\n      ) {\n        this.options = [];\n        if (data && data.constructor == Array && data.length > 0) {\n          data.forEach(d => {\n            this.options.push({\n              key: d[this.ganged.valueBind] + \"\",\n              value: d[this.ganged.labelBind] + \"\"\n            });\n          });\n        }\n      } else if (\n        this.ganged &&\n        this.ganged.alias &&\n        (!this.ganged.valueBind || !this.ganged.labelBind)\n      ) {\n        let name = this.inputName;\n        this.$message.error(\n          `下拉框【${name.split(\"-\")[1]}】配置了动态选项，但是没有正确的配置选项绑定关系。`\n        );\n      }\n    },\n    // 触发绑定的关联查询\n    relatedQueryLoad: function() {\n      if (\n        this.relatedQuery &&\n        this.relatedQuery.constructor == Array &&\n        this.relatedQuery.length > 0\n      ) {\n        // 遍历所有的关联查询，逐个触发\n        this.relatedQuery.forEach(q => {\n          const params = this.prepareLoadParams(q.condition);\n          this.$emit(\"related-query:load\", q.alias, params, q.result);\n        });\n      }\n    }\n  }\n};\n",null]}