{"remainingRequest":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/src/components/Common/transfer_select.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/src/components/Common/transfer_select.vue","mtime":1701674859499},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/babel-loader/lib/index.js","mtime":1701674874357},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/cache-loader/dist/cjs.js","mtime":1701674874584},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/vue-loader/lib/index.js","mtime":1701674874903}],"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//\n//\n//\n//\n//\n\nexport default {\n data () {\n return {\n formOptions: {},\n selectValue: \"\", // 被选中的值\n rightData: [], // 右侧被选中的值\n rightSelectItem: [], // 右侧复选框选中项,值为leftData的key\n rightSelectIndex: \"\", // 右侧列表被选中项的下标值\n };\n },\n mounted(){\n this.formOptions = this.$store.state.currentDataSourcesOption\n },\n methods: {\n // 右侧选中的复选框\n chooseRightBox (value) {\n this.rightSelectItem = value;\n },\n // 弹框关闭的回调和取消\n handleClose () {\n this.$emit(\"closeTransferDialog\");\n // 清空操作\n this.leftData = this.leftData;\n this.rightData = [];\n },\n // 右侧复选框上移\n handleUp () {\n if (this.rightSelectItem.length == 1) {\n this.rightData.find((val, indexs) => {\n if (val == this.rightSelectItem) {\n this.rightSelectIndex = indexs; // 数组项的下标就是我当前选中项的下标\n }\n });\n if (this.rightSelectIndex == 0) {\n return this.$message.info(this.$t('msg.no_space'));\n }\n // 上移-改变的数组(项和下标同时改变)\n let changeItem = JSON.parse(JSON.stringify(this.rightData[this.rightSelectIndex - 1]));\n this.rightData.splice(this.rightSelectIndex - 1, 1);\n this.rightData.splice(this.rightSelectIndex, 0, changeItem);\n this.rightSelectIndex = this.rightSelectIndex - 1;\n } else {\n return this.$message.error(this.$t('msg.choose_one'));\n }\n },\n // 右侧复选框下移\n handleDown () {\n if (this.rightSelectItem.length == 1) {\n this.rightData.find((val, indexs) => {\n if (val == this.rightSelectItem) {\n this.rightSelectIndex = indexs;\n }\n });\n if (this.rightSelectIndex == this.rightData.length - 1) {\n // 这里是length-1,因为下标值从0开始\n return this.$message.info(this.$t('msg.no_space'));\n }\n let changeItem = JSON.parse(JSON.stringify(this.rightData[this.rightSelectIndex]));\n this.rightData.splice(this.rightSelectIndex, 1);\n this.rightData.splice(this.rightSelectIndex + 1, 0, changeItem);\n this.rightSelectIndex = this.rightSelectIndex + 1;\n } else {\n return this.$message.error(this.$t('msg.choose_one'));\n }\n },\n\n // 批量保存\n addBatch () {\n let arr = [];\n if(this.rightData.length == 1){\n this.leftData.map(item => {\n if(item.id == this.rightData[0]){\n arr.push(item)\n }\n })\n }else if(this.rightData.length > 1){\n this.leftData.map(lItem => {//lLtem\n this.rightData.map(rItem => {\n if(lItem.id == rItem){\n arr.push(lItem)\n }\n })\n })\n }else{\n return this.$message.error(this.$t('msg.choose_data'))\n }\n // 提交给父组件批量保存\n this.$emit(\"addBatchColumnsView\", arr);\n // this.$emit(\"closeTransferDialog\");\n },\n },\n props: {\n transferVisible: Boolean,\n leftData: {\n type: Array,\n default: function () {\n return [];\n },\n },\n },\n watch: {\n formOptions () {\n this.selectValue = this.formOptions.id\n }\n },\n};\n",null]}