You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
20 KiB

{"version":3,"sources":["webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/select-tree/select-tree.vue?4f2b","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/select-tree/select-tree.vue?7b17","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/select-tree/select-tree.vue?d9dc","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/select-tree/select-tree.vue?fe45","uni-app:///components/select-tree/select-tree.vue","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/select-tree/select-tree.vue?c02c","webpack:////Users/yanghao/Desktop/禅易云/zhaoshangMiniApp-uniapp/components/select-tree/select-tree.vue?2a39"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAoI;AACpI;AAC+D;AACL;AACsC;;;AAGhG;AACgN;AAChN,gBAAgB,iNAAU;AAC1B,EAAE,iFAAM;AACR,EAAE,kGAAM;AACR,EAAE,2GAAe;AACjB;AACA;AACA;AACA;AACA;AACA,EAAE,sGAAU;AACZ;AACA;;AAEA;AACe,gF;;;;;;;;;;;;ACvBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;;;;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACRA;AAAA;AAAA;AAAA;AAAy0B,CAAgB,yyBAAG,EAAC,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACyC71B;AACA,qBADA;AAEA,MAFA,kBAEA;AACA;AACA,mBADA;AAEA,gBAFA;AAGA,4BAHA;;AAKA,GARA;AASA;AACA;AACA;AACA,iBADA;AAEA;AACA;AACA;AACA,oBADA;AAEA,wBAFA;AAGA,oBAHA;AAIA;AACA;AACA,0BADA;AAEA,sBAFA,EADA;;AAKA;AACA,0BADA;AAEA,sBAFA,EALA,CAJA,EADA;;;;AAgBA;AACA,oBADA;AAEA,wBAFA;AAGA,qBAHA;AAIA;AACA;AACA,0BADA;AAEA,sBAFA,EADA;;AAKA;AACA,0BADA;AAEA,sBAFA,EALA,CAJA,EAhBA;;;;;AAgCA,OAnCA,EAFA;;AAuCA;AACA;AACA,mBAFA;AAGA,mBAHA,EAvCA;;AA4CA;AACA;AACA,mBAFA;AAGA,oBAHA,EA5CA;;AAiDA;AACA;AACA,mBAFA;AAGA,oBAHA,EAjDA,EATA;;;AAgEA,SAhEA,qBAgEA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAvEA;AAwEA;AACA,YADA,oBACA,KADA,EACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAJA,MAIA;AACA;AACA;AACA;AACA;AACA,KAbA;AAcA,cAdA,sBAcA,IAdA,EAcA,KAdA,EAcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAFA;AAGA;AACA,OAPA,MAOA;AACA;AACA;AACA;AACA,SAFA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,KAlCA;AAmCA,cAnCA,sBAmCA,EAnCA,EAmCA,EAnCA,EAmCA;AACA;AACA;AACA;AACA;AACA;AACA,+FADA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAdA,MAcA;AACA;AACA;AACA;AACA;AACA,8FADA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAhEA;AAiEA,sBAjEA,gCAiEA;AACA;AACA;AACA;AACA;AACA,iEADA,CACA;AACA;AACA,OAJA;AAKA;AACA;AACA;AACA;AACA;AACA,SAJA;AAKA,OANA;AAOA;AACA,KAjFA;AAkFA,aAlFA,uBAkFA;AACA;AACA;AACA;AACA;AACA;AACA,SAFA;AAGA,OALA;AAMA;AACA;AACA;AACA,KA7FA;AA8FA,aA9FA,uBA8FA;AACA;AACA;AACA;AACA;AACA;AACA,SAFA;AAGA,OALA;AAMA;AACA;AACA;AACA,KAzGA;AA0GA,cA1GA,sBA0GA,IA1GA,EA0GA;AACA;AACA;AACA;AACA,KA9GA,EAxEA;;AAwLA;AACA,SADA,iBACA,GADA,EACA;AACA;AACA;AACA;AACA,KALA,EAxLA,E;;;;;;;;;;;;ACzCA;AAAA;AAAA;AAAA;AAA0hD,CAAgB,25CAAG,EAAC,C;;;;;;;;;;;ACA9iD;AACA,OAAO,KAAU,EAAE,kBAKd","file":"components/select-tree/select-tree.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./select-tree.vue?vue&type=template&id=28ef90a4&scoped=true&\"\nvar renderjs\nimport script from \"./select-tree.vue?vue&type=script&lang=js&\"\nexport * from \"./select-tree.vue?vue&type=script&lang=js&\"\nimport style0 from \"./select-tree.vue?vue&type=style&index=0&id=28ef90a4&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"28ef90a4\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"components/select-tree/select-tree.vue\"\nexport default component.exports","export * from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--16-0!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./select-tree.vue?vue&type=template&id=28ef90a4&scoped=true&\"","var components\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./select-tree.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--12-1!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./select-tree.vue?vue&type=script&lang=js&\"","<template>\n <view id=\"section_ul\" class=\"selectTrees\">\n <!-- 一级分支 -->\n <view class=\"lv1list\" v-for=\"(item, index) in selectList\" :key=\"index\">\n <view class=\"tree-one\">\n <!-- 单选框组件 -->\n <checkbox-group v-if=\"showCheck\"\n style=\"position: absolute;height: 80rpx;line-height: 80rpx; left:20rpx;z-index: 1;\">\n <checkbox :checked=\"item.checked\" @click=\"_chooseAll(item,index)\" />\n </checkbox-group>\n <!-- 名字和iconfont -->\n <label\n style=\"height:80rpx;display: flex;align-items: center;padding: 20rpx;position: relative;border-bottom: 1px solid #e4e4e4;background: #f3f3f3;\"\n @click=\"_showlv2(index)\">\n <view class=\"itemT\">{{item.name}}</view>\n <view class=\"deleteBtn\" v-if=\"showDelete\" @click.stop=\"deleteItem(item)\">删除</view>\n <i class=\"iconfont iconshang\" v-if=\"item.show\"\n style=\"position: absolute;top: 18%;right: 2%;font-size: 48rpx;\"></i>\n <i class=\"iconfont iconxiala\" v-else\n style=\"position: absolute;top: 18%;right: 2%;font-size: 48rpx;\"></i>\n </label>\n </view>\n <!-- 二级分支 -->\n <view v-if='item.show && item.childrenList '>\n <view class=\"tree-two\" v-for=\"(item2, index2) in item.childrenList\" :key=\"index2\"\n style=\"display: flex;\">\n <view class=\"aui-list-item-inner flexIn\">\n <checkbox-group v-if=\"showCheck\">\n <checkbox v-if=\"!disableLv2Check\" :checked=\"item2.checked\"\n @click=\"_chooseOne(index,index2)\" />\n <checkbox :checked=\"item2.checked\" disabled=\"true\" v-else />\n </checkbox-group>\n <label style=\"font-size: 28rpx;\">{{item2.name}}</label>\n </view>\n </view>\n </view>\n </view>\n </view>\n</template>\n\n<script>\nexport default {\n name: \"select-tree\",\n data() {\n return {\n finalList: [],\n menuKey: 1,\n selectList: this.value\n };\n },\n props: {\n // selectList,\n value: {\n type: Array,\n default: function () {\n return [\n {\n name: \"水果\",\n checked: false,\n show: true,\n childrenList: [\n {\n checked: false,\n name: \"西瓜\"\n },\n {\n checked: false,\n name: \"桃子\"\n }\n ]\n },\n {\n name: \"工具\",\n checked: false,\n show: false,\n childrenList: [\n {\n checked: false,\n name: \"锄头\"\n },\n {\n checked: false,\n name: \"铲子\"\n }\n ]\n }\n ];\n }\n },\n showCheck: {\n //显示多选框\n type: Boolean,\n default: true\n },\n disableLv2Check: {\n //让二级标题不可选中\n type: Boolean,\n default: false\n },\n showDelete: {\n //显示删除按钮\n type: Boolean,\n default: false\n }\n },\n mounted() {\n // console.log(this.value)\n // setTimeout(()=>{\n // this.selectList = this.value\n // })\n\n // this.$forceUpdate()\n },\n methods: {\n _showlv2(index) {\n // console.log('showLv2............................', index)\n //展开二级目录\n if (this.selectList[index].show) {\n this.$set(this.selectList[index], \"show\", false);\n\t\t\t\tthis.$forceUpdate()\n this.$emit('input', this.selectList)\n } else {\n this.$set(this.selectList[index], \"show\", true);\n\t\t\t\tthis.$forceUpdate()\n this.$emit('input', this.selectList)\n }\n },\n _chooseAll(item, index) {\n //选中一级目录的所有\n if (this.selectList[index].checked) {\n //\n this.$set(this.selectList[index], \"checked\", false);\n this.selectList[index].childrenList.forEach(item => {\n item.checked = false;\n });\n this.$emit('input', this.selectList)\n } else {\n this.$set(this.selectList[index], \"checked\", true);\n this.selectList[index].childrenList.forEach(item => {\n item.checked = true;\n });\n this.$emit('input', this.selectList)\n }\n this.$set(this.selectList[index], \"show\", true);\n this.$emit('input', this.selectList)\n this.$forceUpdate();\n this._computedFinalList();\n },\n _chooseOne(i1, i2) {\n if (this.selectList[i1].childrenList[i2].checked) {\n //去掉勾选\n this.$set(this.selectList[i1], \"checked\", true);\n this.$set(this.selectList[i1].childrenList[i2], \"checked\", false);\n\t\t\t\tif (\n\t\t\t\t this.selectList[i1].childrenList.every(item => item.checked == false)\n\t\t\t\t) {\n\t\t\t\t //判断是否全部都是选中\n\t\t\t\t this.$set(this.selectList[i1], \"checked\", false);\n\t\t\t\t}\n this.$forceUpdate();\n this.$emit('input', this.selectList)\n this._computedFinalList();\n\n } else {\n //增加勾选\n this.$set(this.selectList[i1], \"checked\", true);\n this.$set(this.selectList[i1].childrenList[i2], \"checked\", true);\n if (\n this.selectList[i1].childrenList.every(item => item.checked == true)\n ) {\n //判断是否全部都是选中\n this.$set(this.selectList[i1], \"checked\", true);\n }\n this.$emit('input', this.selectList)\n this.$forceUpdate();\n this._computedFinalList();\n }\n },\n _computedFinalList() {\n //计算最终的值\n this.finalList = [];\n\t\t\tthis.selectList.forEach(item=>{\n\t\t\t\tif(item.checked){\n\t\t\t\t\tthis.finalList.push(JSON.parse(JSON.stringify(item))) //对象深拷贝 不然原数据会发生变化\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.finalList.forEach(item=>{\n\t\t\t\titem.childrenList.forEach((item2,index2)=>{\n\t\t\t\t\tif(!item2.checked){\n\t\t\t\t\t\titem.childrenList.splice(index2,1)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n this.$emit(\"choose\", this.finalList);\n },\n chooseAll() {\n //选中页面所有层级\n this.selectList.forEach(item => {\n this.$set(item, \"checked\", true);\n item.childrenList.forEach(item2 => {\n this.$set(item2, \"checked\", true);\n });\n });\n this.$emit('input', this.selectList)\n this.$forceUpdate();\n this._computedFinalList();\n },\n cancelAll() {\n //取消选中页面所有层级\n this.selectList.forEach(item => {\n this.$set(item, \"checked\", false);\n item.childrenList.forEach(item2 => {\n this.$set(item2, \"checked\", false);\n });\n });\n this.$emit('input', this.selectList)\n this.$forceUpdate();\n this._computedFinalList();\n },\n deleteItem(item) {\n //删除选中项目\n this.$emit('input', this.selectList)\n this.$emit(\"deleteItem\", item);\n }\n },\n watch: {\n value(res) {\n console.log(res)\n this.selectList = res\n this.$emit('input', this.selectList)\n }\n },\n};\n</script>\n\n<style lang=\"scss\" scoped>\n* {\n font-size: 32rpx;\n}\n\n/* #ifdef APP-PLUS*/\n.selectTrees{\n margin-bottom: 180rpx;\n}\n/* #endif */\n\n.deleteBtn {\n position: absolute;\n right: 10%;\n background: #f97979;\n padding: 2rpx 16rpx;\n color: white;\n border-radius: 4rpx;\n font-size: 28rpx;\n}\n\n.itemT {\n margin-left: 60rpx;\n font-size: 32rpx;\n width: 65%;\n text-overflow: -o-ellipsis-lastline;\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n}\n\n.tree-two {\n padding: 20rpx 68rpx;\n background: white;\n border-bottom: 2rpx solid #e2e2e2;\n font-size: 28rpx;\n}\n\n.flexIn {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n align-items: center;\n align-content: center;\n flex-wrap: nowrap;\n width: 100%;\n}\n</style>","import mod from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./select-tree.vue?vue&type=style&index=0&id=28ef90a4&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../../../../Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./select-tree.vue?vue&type=style&index=0&id=28ef90a4&lang=scss&scoped=true&\"","// extracted by mini-css-extract-plugin\n if(module.hot) {\n // 1635513141700\n var cssReload = require(\"/Applications/HBuilderX.app/Contents/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/hmr/hotModuleReplacement.js\")(module.id, {\"hmr\":true,\"publicPath\":\"../../\",\"locals\":false});\n module.hot.dispose(cssReload);\n module.hot.accept(undefined, cssReload);\n }\n "],"sourceRoot":""}