{"version":3,"sources":["webpack:///./src/components/task/edit/components/specials/asset/flatChooser/index.vue","webpack:///src/components/task/edit/components/specials/asset/flatChooser/index.vue","webpack:///./src/components/task/edit/components/specials/asset/flatChooser/index.vue?3780","webpack:///./src/components/task/edit/components/specials/asset/flatChooser/index.vue?d0fc"],"names":["render","_vm","this","_c","_self","staticStyle","attrs","list","checkStrictly","on","cascaderOnChange","model","value","cascaderSelected","callback","$$v","expression","electricInfo","staticClass","_v","_s","ownerInfo","typeName","htpNum","_e","staticRenderFns","LTT","require","props","locationId","type","Number","default","assetId","mode","components","CascaderPanel","Cascader","data","listFlat","options","label","children","selectedLocationId","mounted","init","methods","_this","request","params","siteId","getAllAsset","api","url","method","store","$store","then","res","dataTypes","ltt","key_id","key_parent","key_child","GetTree","cascaderModelRecursive","reverse","cid","push","pid","filter","d","id","parentId","getSiteId","findedData","_this2","_id","undefined","length","_cur","x","$emit","info","$bvToast","toast","title","autoHideDelay","appendToast","variant","toaster","component"],"mappings":"uHAAA,IAAIA,EAAS,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACA,EAAG,WAAW,CAACE,YAAY,CAAC,MAAQ,OAAOC,MAAM,CAAC,QAAUL,EAAIM,KAAK,MAAQ,CAAEC,eAAe,GAAO,YAAa,EAAK,WAAY,GAAMC,GAAG,CAAC,OAASR,EAAIS,kBAAkBC,MAAM,CAACC,MAAOX,EAAIY,iBAAkBC,SAAS,SAAUC,GAAMd,EAAIY,iBAAiBE,GAAKC,WAAW,sBAAsBb,EAAG,MAAM,CAAsB,MAApBF,EAAIgB,aAAsBd,EAAG,QAAQ,CAACe,YAAY,wDAAwD,CAACf,EAAG,QAAQ,CAACA,EAAG,KAAK,CAACA,EAAG,KAAK,CAACG,MAAM,CAAC,MAAQ,QAAQ,CAACL,EAAIkB,GAAG,+CAA+ChB,EAAG,KAAK,CAACA,EAAG,KAAK,CAACF,EAAIkB,GAAGlB,EAAImB,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mD,SAAAC,MAAA,gCACAC,MAAA,WACAC,cAAA,IACAC,aAAA,EACAC,QAAA,UACAC,QAAA,8BCnLwa,I,YCOpaC,EAAY,eACd,EACA3F,EACAyB,GACA,EACA,KACA,KACA,MAIa,aAAAkE,E","file":"js/chunk-2d20e808.7773c3cd.js","sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',[_c('Cascader',{staticStyle:{\"width\":\"99%\"},attrs:{\"options\":_vm.list,\"props\":{ checkStrictly: true },\"filterable\":true,\"clearable\":true},on:{\"change\":_vm.cascaderOnChange},model:{value:(_vm.cascaderSelected),callback:function ($$v) {_vm.cascaderSelected=$$v},expression:\"cascaderSelected\"}}),_c('div',[(_vm.electricInfo != null)?_c('table',{staticClass:\"table tabl-bordered table-striped mg-t-10-f mg-b-0-f\"},[_c('tbody',[_c('tr',[_c('td',{attrs:{\"width\":\"40%\"}},[_vm._v(\"Цахилгааны ÑÑ… Ò¯Ò¯ÑвÑÑ€ ÑзÑмшигчийн мÑдÑÑлÑл\")]),_c('td',[_c('h6',[_vm._v(_vm._s(_vm.electricInfo.ownerInfo))])])]),_c('tr',[_c('td',{attrs:{\"width\":\"40%\"}},[_vm._v(\"Цахилгааны ÑÑ… Ò¯Ò¯ÑвÑÑ€ ÑзÑмшигч\")]),_c('td',[_c('h6',[_vm._v(_vm._s(_vm.electricInfo.typeName))])])]),_c('tr',[_c('td',{attrs:{\"width\":\"40%\"}},[_vm._v(\"Цахилгааний ХТП дугаар\")]),_c('td',{},[_c('h6',[_vm._v(_vm._s(_vm.electricInfo.htpNum))])])])])]):_vm._e()])],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n <div>\n <Cascader\n :options=\"list\"\n @change=\"cascaderOnChange\"\n :props=\"{ checkStrictly: true }\"\n v-model=\"cascaderSelected\"\n :filterable=\"true\"\n :clearable=\"true\"\n style=\"width:99%\"\n ></Cascader>\n <div>\n <table\n v-if=\"electricInfo != null\"\n class=\"table tabl-bordered table-striped mg-t-10-f mg-b-0-f\"\n >\n <tbody>\n <tr>\n <td width=\"40%\">Цахилгааны ÑÑ… Ò¯Ò¯ÑвÑÑ€ ÑзÑмшигчийн мÑдÑÑлÑл</td>\n <td>\n <h6>{{ electricInfo.ownerInfo }}</h6>\n </td>\n </tr>\n <tr>\n <td width=\"40%\">Цахилгааны ÑÑ… Ò¯Ò¯ÑвÑÑ€ ÑзÑмшигч</td>\n <td>\n <h6>{{ electricInfo.typeName }}</h6>\n </td>\n </tr>\n <tr>\n <td width=\"40%\">Цахилгааний ХТП дугаар</td>\n <td class=\"\">\n <h6>{{ electricInfo.htpNum }}</h6>\n </td>\n </tr>\n </tbody>\n </table>\n <!-- {{ electricInfo }} -->\n </div>\n </div>\n</template>\n\n<script>\nimport \"element-ui/lib/theme-chalk/index.css\";\nimport { CascaderPanel, Cascader } from \"element-ui\";\n\nvar LTT = require(\"list-to-tree\");\n\nimport { request } from \"@/api/all\";\n\nexport default {\n props: {\n locationId: {\n type: Number,\n default: () => 0\n },\n assetId: {\n type: Number,\n default: () => 0\n },\n mode: {\n type: Number,\n default: () => 1\n }\n },\n components: {\n CascaderPanel,\n Cascader\n },\n data() {\n return {\n listFlat: [],\n list: [],\n cascaderSelected: [],\n\n options: [\n {\n value: \"s1\",\n label: \"songolt 1\",\n children: [\n {\n value: \"d1\",\n label: \"ded 1\"\n }\n ]\n }\n ],\n selectedLocationId: null,\n electricInfo: null\n };\n },\n mounted() {\n this.init();\n },\n methods: {\n init() {\n request({\n params: {\n siteId: this.locationId > 0 ? this.locationId : null,\n getAllAsset: this.mode == 2 ? true : false\n },\n api: { url: \"asset/AssetFlatListWithSite\", method: \"GET\" },\n store: this.$store\n }).then(res => {\n if (res != false) {\n //console.log(res);\n let dataTypes = res.data.list;\n this.listFlat = dataTypes;\n //console.log(\"get tree before\");\n var ltt = new LTT(dataTypes, {\n key_id: \"id\",\n key_parent: \"parentId\",\n key_child: \"children\"\n });\n this.list = ltt.GetTree();\n //this.list=res.data.tree;\n //console.log(\"get tree after\", this.list);\n\n if (this.locationId > 0 && this.assetId > 0) {\n this.cascaderModelRecursive(this.listFlat, this.assetId);\n this.cascaderSelected = this.cascaderSelected.reverse();\n } else if (this.locationId > 0) {\n this.cascaderModelRecursive(this.listFlat, this.locationId);\n this.cascaderSelected = this.cascaderSelected.reverse();\n } else this.cascaderSelected = [];\n }\n });\n },\n\n cascaderModelRecursive(data, cid) {\n this.cascaderSelected.push(cid);\n let pid = data.filter(d => d.id == cid)[0].parentId;\n if (pid > 0) {\n this.cascaderModelRecursive(data, pid);\n }\n },\n\n getSiteId(data, cid) {\n let findedData = data.filter(d => d.id == cid)[0];\n if (findedData.parentId == 0) {\n this.selectedLocationId = findedData.id;\n } else {\n this.getSiteId(data, findedData.parentId);\n }\n },\n\n cascaderOnChange(value) {\n let _id =\n value[value.length - 1] != undefined ? value[value.length - 1] : null;\n let _cur = this.listFlat.filter(x => x.id == _id);\n\n if (_cur.length > 0 && _cur[0].parentId > 0) {\n this.getSiteId(this.listFlat, _id);\n this.$emit(\"on-asset-changed\", {\n locationId: this.selectedLocationId,\n assetId: _id\n });\n if (this.mode == 1) {\n request({\n params: { assetId: _id },\n api: { url: \"asset/AssetElectricInfo\", method: \"GET\" },\n store: this.$store\n }).then(res => {\n if (res != false) {\n this.electricInfo = res.data.info;\n } else this.electricInfo = null;\n });\n }\n } else {\n if (_cur.length > 0) {\n //console.log(_id);\n this.$emit(\"on-asset-changed\", { locationId: _id, assetId: null });\n }\n\n this.$bvToast.toast(\"Тоног төхөөрөмж Ñонгоно уу !\", {\n title: \"ÐœÑдÑгдÑл\",\n autoHideDelay: 5000,\n appendToast: true,\n variant: \"warning\",\n toaster: \"b-toaster-bottom-left\"\n });\n }\n }\n }\n};\n</script>\n\n<style></style>\n","import mod from \"-!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../../../../../../node_modules/thread-loader/dist/cjs.js!../../../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./index.vue?vue&type=script&lang=js\"","import { render, staticRenderFns } from \"./index.vue?vue&type=template&id=0914810d\"\nimport script from \"./index.vue?vue&type=script&lang=js\"\nexport * from \"./index.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}