{"remainingRequest":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js??ref--0-0!D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\yhxt-web\\src\\views\\resourceApply\\components\\applyDetailForm.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\yhxt-web\\src\\views\\resourceApply\\components\\applyDetailForm.vue","mtime":1724436823385},{"path":"D:\\jenkins\\workspace\\yhxt-web\\babel.config.js","mtime":1667326389982},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\babel-loader\\lib\\index.js","mtime":456789000000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\yhxt-web\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.object.get-own-property-descriptors\";\nimport \"core-js/modules/web.dom.iterable\";\nimport \"core-js/modules/es6.object.keys\";\nimport _defineProperty from \"D:/jenkins/workspace/yhxt-web/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\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//\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//\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//\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 utils from '@/utils';\nimport _ from 'lodash';\nimport moment from 'moment';\nimport api from \"./../js/api.js\";\nexport default {\n name: 'applyDetailForm',\n components: {},\n data: function data() {\n return {\n dialogVisible: false,\n activeNames: ['1', '2'],\n type: '',\n saving: false,\n applyform: {\n cloudType: null,\n intranetIp: '172.16.200.',\n cloudApplyDetailPorts: []\n },\n applyformRules: {\n cloudType: [{\n required: true,\n message: '请选择资源所属云平台',\n trigger: ['blur', 'change']\n }],\n system: [{\n required: true,\n message: '请输入操作系统版本',\n trigger: ['blur', 'change']\n }],\n virtualMachineName: [{\n required: true,\n message: '请输入虚拟机名称',\n trigger: ['blur', 'change']\n }],\n externalIp: [{\n required: true,\n message: '请选择外网IP',\n trigger: ['blur', 'change']\n }],\n intranetIp: [{\n required: true,\n message: '请输入内网IP',\n trigger: ['blur', 'change']\n }\n // {\n // pattern:\n // /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/,\n // message: 'IP格式不正确',\n // trigger: ['blur', 'change'],\n // },\n ],\n\n cpuNum: [{\n required: true,\n message: '请输入CPU核心数',\n trigger: ['blur', 'change']\n }],\n memoryCapacity: [{\n required: true,\n message: '请输入内存容量',\n trigger: ['blur', 'change']\n }],\n sysCapacity: [{\n required: true,\n message: '请输入数据盘容量',\n trigger: ['blur', 'change']\n }],\n dataCapacity: [{\n required: true,\n message: '请输入数据盘存储容量',\n trigger: ['blur', 'change']\n }],\n intranetAgreement: [{\n required: true,\n message: '请选择协议类型',\n trigger: ['blur', 'change']\n }],\n intranetPort: [{\n required: true,\n message: '请输入内网端口',\n trigger: ['blur', 'change']\n }],\n networkPort: [{\n required: true,\n message: '请输入外网端口',\n trigger: ['blur', 'change']\n }],\n portPurpose: [{\n required: true,\n message: '请输入端口用途',\n trigger: ['blur', 'change']\n }]\n },\n cloudType: [],\n id: '',\n privateCloudApplyId: '',\n pageType: '',\n editType: '',\n detailPortData: []\n };\n },\n created: function created() {},\n methods: {\n handleInitDict: function handleInitDict() {\n this.cloudType = utils.getDictItemsFromCache('cloud_type');\n if (this.cloudType.length) {\n this.applyform.cloudType = parseInt(this.cloudType[0].value);\n }\n },\n handleOpen: function handleOpen(pageType, type, privateCloudApplyId, applyData) {\n this.pageType = pageType;\n this.type = type;\n this.privateCloudApplyId = privateCloudApplyId;\n this.applyform.privateCloudApplyId = privateCloudApplyId;\n this.handleInitDict();\n if (this.pageType === 'apply') {\n if (this.type === 'excute' || this.type === 'readOnly') {\n this.editType = '';\n } else if (this.type === 'edit' || this.type === 'add') {\n this.editType = 'edit';\n }\n } else if (this.pageType === 'excute') {\n this.editType = 'excute';\n } else if (this.pageType === 'audit') {\n this.editType = '';\n }\n if (type === 'add') {\n this.applyform.cloudType = applyData.cloudType;\n this.dialogVisible = true;\n } else {\n this.id = applyData.cloudApplyDetail.id;\n var cloudApplyDetailPorts = [{\n uuid: utils.uuid(),\n intranetAgreement: '1',\n intranetPort: '',\n networkPort: '',\n portPurpose: '',\n remarks: ''\n }];\n if (applyData.cloudApplyDetailPorts && applyData.cloudApplyDetailPorts.length) {\n cloudApplyDetailPorts = applyData.cloudApplyDetailPorts.map(function (item) {\n item.uuid = utils.uuid();\n return item;\n });\n }\n var data = _objectSpread(_objectSpread({}, applyData.cloudApplyDetail), {}, {\n cloudApplyDetailPorts: cloudApplyDetailPorts\n });\n this.applyform = data;\n this.dialogVisible = true;\n }\n },\n handleQueryDetail: function handleQueryDetail() {},\n handleSaveBasic: function handleSaveBasic() {\n var _this = this;\n this.saving = true;\n this.$refs.applyform.validate(function (bool, object) {\n if (bool) {\n var API = _this.type === 'add' ? api.addApplyDetail : api.editApplyDetail;\n\n //端口映射删除uuid字段\n var cloudApplyDetailPorts = _this.applyform.cloudApplyDetailPorts.map(function (item) {\n delete item.uuid;\n return item;\n });\n\n //详情信息删除端口映射arr\n var cloudApplyDetail = _.cloneDeep(_this.applyform);\n delete cloudApplyDetail.cloudApplyDetailPorts;\n var submitData = {\n cloudApplyDetailPorts: cloudApplyDetailPorts,\n cloudApplyDetail: cloudApplyDetail\n };\n API(submitData).then(function (res) {\n if (res.state) {\n _this.id = res.value;\n _this.$message.success('云资源明细保存成功!');\n _this.$emit('save');\n _this.handleClose();\n } else {\n _this.$message.warning(res.message);\n }\n }).finally(function () {\n _this.saving = false;\n });\n } else {\n _this.$message.warning(\"\\u6709\".concat(Object.keys(object).length, \"\\u4E2A\\u5B57\\u6BB5\\u672A\\u901A\\u8FC7\\u6821\\u9A8C\\uFF0C\\u8BF7\\u6B63\\u786E\\u586B\\u5199\\u8868\\u5355\\u5185\\u5BB9\\u3002\"));\n _this.saving = false;\n }\n });\n },\n handleClose: function handleClose() {\n this.id = '';\n this.type = '';\n this.privateCloudApplyId = '';\n this.applyform = {\n cloudType: null,\n intranetIp: '172.16.200.',\n cloudApplyDetailPorts: []\n };\n this.pageType = '';\n this.editType = '';\n this.activeNames = ['1', '2'];\n this.dialogVisible = false;\n },\n handleAddPort: function handleAddPort() {\n var newData = {\n uuid: utils.uuid(),\n intranetAgreement: '1',\n intranetPort: '',\n networkPort: '',\n portPurpose: '',\n remarks: ''\n };\n var length = this.applyform.cloudApplyDetailPorts.length;\n this.applyform.cloudApplyDetailPorts.splice(length + 1, 0, newData);\n },\n handleDelPort: function handleDelPort(row, $index) {\n var _this2 = this;\n if (row.id) {\n api.deleteDetailPorts(row.id).then(function (res) {\n if (res.state) {\n _this2.$message.success('删除成功!');\n _this2.applyform.cloudApplyDetailPorts.splice($index, 1);\n } else {\n _this2.$message.warning(res.message || '删除失败');\n }\n }).catch(function (err) {\n _this2.$message.warning(err);\n });\n } else {\n this.applyform.cloudApplyDetailPorts.splice($index, 1);\n this.$message.success('删除成功!');\n }\n },\n handleSelectionChange: function handleSelectionChange(selection) {\n this.detailPortData = selection;\n }\n }\n};",null]}