{"remainingRequest":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\examine-fvue\\src\\components\\ImportExportData\\AddFields.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\examine-fvue\\src\\components\\ImportExportData\\AddFields.vue","mtime":1667280203686},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\examine-fvue\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.array.includes\";\nimport \"core-js/modules/es6.string.includes\";\nimport \"core-js/modules/web.dom.iterable\";\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//\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//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport portal from '@/api/portal';\nexport default {\n name: 'AddFields',\n props: {\n // 页面组件别名\n bizCode: {\n type: String,\n default: '',\n required: true\n },\n type: {\n type: String,\n default: 'import',\n required: true\n },\n originAPIOptions: {\n type: Object,\n default: function _default() {},\n required: true\n },\n dataBaseOptions: {\n type: Object,\n default: function _default() {},\n required: true\n }\n },\n data: function data() {\n return {\n dialogShow: false,\n tableHeight: 300,\n currentPage: 1,\n total: 0,\n multipleSelection: [],\n data: [],\n selectFields: [],\n selectData: [],\n data1: [],\n data2: [],\n loading: false\n };\n },\n mounted: function mounted() {\n var _this = this;\n\n this.calcTableHeight();\n this.$root.$on('resize', function () {\n _this.calcTableHeight(500);\n });\n },\n computed: {\n title: function title() {\n if (this.type == 'import') {\n return '导入模板添加字段';\n } else {\n return '导出模板添加字段';\n }\n }\n },\n methods: {\n // tableData.slice((currentPage - 1) * pageSize,currentPage * pageSize)\n handleCurrentChange: function handleCurrentChange(current) {\n var _this2 = this;\n\n console.log(current, 'current');\n this.data = this[\"data\".concat(current)];\n this.$nextTick(function () {\n _this2.$refs.allFieldsTable.clearSelection();\n\n _this2.data.forEach(function (element) {\n if (_this2.selectFields.includes(element.fieldName)) {\n console.log(element);\n console.log(_this2.$refs);\n\n _this2.$nextTick(function () {\n _this2.$refs.allFieldsTable.toggleRowSelection(element, true);\n });\n }\n });\n });\n },\n loadData: function loadData() {\n var _this3 = this;\n\n this.loading = true;\n\n if (this.type == 'import') {\n var data = {\n dataBaseId: this.dataBaseOptions.dataBaseId,\n tableName: this.dataBaseOptions.tableName,\n tableSchema: this.dataBaseOptions.tableSchema\n };\n var params = this.qs.stringify(data);\n portal.getAllImportFields(params).then(function (res) {\n res.forEach(function (item) {\n item.fieldName = item.columnName;\n item.fieldComments = item.columnComment;\n });\n _this3.data = res;\n console.log(res);\n }).finally(function () {\n _this3.loading = false;\n });\n } else if (this.type == 'export') {\n var _params = {\n originAPIOptions: this.originAPIOptions,\n bizCode: this.bizCode\n };\n console.log(_params, 'params');\n portal.getAllExportFields(_params).then(function (res) {\n var index = res.indexOf(']');\n var resData = JSON.parse(res.slice(0, index + 2)).fields;\n\n if (Array.isArray(resData)) {\n resData.forEach(function (item) {\n item.fieldName = item.fieldName;\n item.fieldComments = item.fieldDesc;\n });\n _this3.data = resData;\n }\n }).finally(function () {\n _this3.loading = false;\n });\n }\n },\n openDialog: function openDialog() {\n this.dialogShow = true;\n this.loadData();\n },\n closeDialog: function closeDialog() {\n this.dialogShow = false;\n this.data = [];\n this.selectFields = [];\n this.selectData = [];\n },\n handleOk: function handleOk() {\n this.$emit('addFiedls', this.selectData);\n this.closeDialog();\n },\n handleSelectionChange: function handleSelectionChange(selection) {\n var _this4 = this;\n\n selection.forEach(function (element) {\n if (!_this4.selectFields.includes(element.fieldName)) {\n _this4.selectFields.push(element.fieldName);\n\n _this4.selectData.push(element);\n }\n });\n },\n handleDelFields: function handleDelFields(row) {\n this.selectData = this.selectData.filter(function (item) {\n return item.fieldName !== row.fieldName;\n });\n this.selectFields = this.selectFields.filter(function (item) {\n return item !== row.fieldName;\n });\n },\n // 动态计算表格的高度,自适应当前容器\n calcTableHeight: function calcTableHeight(delay) {\n var _this5 = this;\n\n // let gap = this.type == 'import' ? 206 : 236\n var gap = 200;\n setTimeout(function () {\n _this5.tableHeight = document.documentElement.clientHeight * 0.9 - gap;\n }, delay || 0);\n }\n }\n};",null]}