2 lines
34 KiB
JavaScript
2 lines
34 KiB
JavaScript
webpackJsonp([3],{AfI0:function(e,t){},BFa7:function(e,t){},HMVn:function(e,t){},"P+qo":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=a("mvHQ"),s=a.n(n),i={data:function(){return{loading:!1,basicInfo:{id:"",itemId:"",caseId:"",ipPath:"",port:"",interfacePath:"",interfaceName:"",requestHeader:"",requestParams:"",requestBody:"",relationValues:"",assertField:"",expectResult:"",comments:"",protocolType:"",requestType:""},requestOptions:[],protocolOptions:[],basicInfoRules:{protocolType:[{required:!0,message:"请选择协议类型",trigger:"blur"}],requestType:[{required:!0,message:"请选择请求方式",trigger:"blur"}],ipPath:[{required:!0,message:"请输入IP/域名地址",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}]},requestBodyObj:{requestHeadersList:{items:[{keys:"",value:""}]},requestParamsList:{items:[{keys:"",value:""}]}},assertInfo:{assertField:"",expectResult:""},relationValues:"",scriptInfo:{preScript_textarea:"",posScript_textarea:"",preSql_textarea:"",posSql_textarea:""},activeScriptName:"preScript",activeParamName:"requestHeader",activeOtherName:"comments",activeRequestName:"raw"}},created:function(){this.getRequestTypeAndProtocol()},methods:{getRequestTypeAndProtocol:function(){var e=this;this.$api.dict.queryAllDataDict().then(function(t){e.requestOptions=t.data.data.requestType,e.protocolOptions=t.data.data.protocolType}).catch(function(){})},changeInterfaceDataBasicInfo:function(e){var t=this;if(e){this.basicInfo=e,this.basicInfo.caseId=e.caseId,this.basicInfo.requestBody=e.requestBody;var a=e.requestHeader,n=e.requestParams;if(a)this.requestBodyObj.requestHeadersList.items=[],a.slice(1,a.length-1).replace(/"/g,"").replace(",",",").replace(/,\s*/g,",").split(",").forEach(function(e){var a=e.split(":");t.requestBodyObj.requestHeadersList.items.push({key:Math.random(),keys:a[0],value:a[1]})});else this.requestBodyObj.requestHeadersList.items=[],this.addRequestHeadersList();if(n)this.requestBodyObj.requestParamsList.items=[],"?"==n.slice(0,1)&&(n=n.slice(1)),n.replace(/"/g,"").split("&").forEach(function(e){var a=e.split("=");t.requestBodyObj.requestParamsList.items.push({key:Math.random(),keys:a[0],value:a[1]})});else this.requestBodyObj.requestParamsList.items=[],this.addRequestParamsList()}else this.basicInfo={},this.assertInfo={},this.relationValues="",this.scriptInfo={},this.requestBodyObj.requestHeadersList.items=[],this.requestBodyObj.requestParamsList.items=[],this.addRequestHeadersList(),this.addRequestParamsList();e.interfaceName?this.basicInfo.interfaceName=e.interfaceName:this.basicInfo.interfaceName=this.$common.getSessionStorage("currentInterfaceName")},saveInterfaceData:function(){var e=this;this.$refs.basicInfoRef.validate(function(t){t&&(e.basicInfo.itemId=e.$common.getSessionStorage("currentItemId"),e.basicInfo.envCode=e.$common.getSessionStorage("currentEnvCode"),e.basicInfo.caseId=e.basicInfo.caseId?e.basicInfo.caseId:e.$common.getSessionStorage("currentCaseId"),e.basicInfo.requestHeader=e.getCurrentRequestHeader(),e.basicInfo.requestParams=e.getCurrentRequestParam(),e.loading=!0,e.basicInfo.id?(e.basicInfo.updatePerson=JSON.parse(localStorage.getItem("userInfo")).nick,e.basicInfo.updateTime=Date.now(),e.$api.testdata.updateInterfaceTestData(s()(e.basicInfo)).then(function(t){e.$notify({type:"success",message:t.data.msg}),e.loading=!1}).catch(function(){e.loading=!1})):(e.basicInfo.createPerson=JSON.parse(localStorage.getItem("userInfo")).nick,e.basicInfo.createTime=Date.now(),e.$api.testdata.insertInterfaceTestData(s()(e.basicInfo)).then(function(t){e.$notify({type:"success",message:t.data.msg}),e.loading=!1}).catch(function(){e.loading=!1})))})},getCurrentRequestHeader:function(){var e=this.requestBodyObj.requestHeadersList.items;return""!=e[0].keys?this.parseListItemsBackJsonString(e):""},getCurrentRequestParam:function(){var e=this.requestBodyObj.requestParamsList.items;if(""!=e[0].keys){var t=this.parseListItemsBackJsonString(e).replace(/,/g,"&").replace(/:/g,"=").replace(/"/g,"");return"?"!=(t=t.slice(1,t.length-1)).slice(0,1)&&(t="?"+t),t}return""},parseListItemsBackJsonString:function(e){var t="{";return e.forEach(function(e){t+='"',t+=e.keys,t+='":"',t+=e.value,t+='",'}),(t+="}").replace(/,}/g,"}")},addRequestHeadersList:function(){this.requestBodyObj.requestHeadersList.items.push({keys:"",value:"",key:Math.random()})},addRequestParamsList:function(){this.requestBodyObj.requestParamsList.items.push({keys:"",value:"",key:Math.random()})},removeRequestHeadersList:function(e){var t=this.requestBodyObj.requestHeadersList.items.indexOf(e);-1!==t&&this.requestBodyObj.requestHeadersList.items.splice(t,1)},removeRequestParamsList:function(e){var t=this.requestBodyObj.requestParamsList.items.indexOf(e);-1!==t&&this.requestBodyObj.requestParamsList.items.splice(t,1)},handleScriptClick:function(){},handleParamClick:function(){},handleOtherClick:function(){},handleRequestBodyClick:function(){}}},r={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"interface-define-base-info"},[a("div",{staticClass:"define-base-info interface-define base-body"},[e._m(0),e._v(" "),a("div",{staticClass:"interface-define-body"},[a("el-form",{ref:"basicInfoRef",attrs:{model:e.basicInfo,rules:e.basicInfoRules,"label-width":"100px"}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"协议类型",prop:"protocolType"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.basicInfo.protocolType,callback:function(t){e.$set(e.basicInfo,"protocolType",t)},expression:"basicInfo.protocolType"}},e._l(e.protocolOptions,function(e){return a("el-option",{key:e.id,attrs:{label:e.dictValue,value:e.dictCode}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"请求方式",prop:"requestType"}},[a("el-select",{attrs:{placeholder:"请选择",clearable:""},model:{value:e.basicInfo.requestType,callback:function(t){e.$set(e.basicInfo,"requestType",t)},expression:"basicInfo.requestType"}},e._l(e.requestOptions,function(e){return a("el-option",{key:e.id,attrs:{label:e.dictValue,value:e.dictCode}})}),1)],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"IP/域名",prop:"ipPath"}},[a("el-input",{attrs:{type:"text",placeholder:"请输入IP/域名地址",clearable:""},model:{value:e.basicInfo.ipPath,callback:function(t){e.$set(e.basicInfo,"ipPath",t)},expression:"basicInfo.ipPath"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"端口号"}},[a("el-input",{staticClass:"port-class",attrs:{type:"text",placeholder:"请输入端口号",clearable:""},model:{value:e.basicInfo.port,callback:function(t){e.$set(e.basicInfo,"port",t)},expression:"basicInfo.port"}})],1)],1)],1),e._v(" "),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{label:"接口名称"}},[a("el-input",{attrs:{type:"text",placeholder:"请输入接口名称",disabled:""},model:{value:e.basicInfo.interfaceName,callback:function(t){e.$set(e.basicInfo,"interfaceName",t)},expression:"basicInfo.interfaceName"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"接口地址"}},[a("el-input",{attrs:{type:"text",placeholder:"请输入接口地址",clearable:""},model:{value:e.basicInfo.interfacePath,callback:function(t){e.$set(e.basicInfo,"interfacePath",t)},expression:"basicInfo.interfacePath"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:6}},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.saveInterfaceData}},[e._v("保存")])],1)],1)],1)],1)],1)]),e._v(" "),a("div",{staticClass:"define-base-info interface-define base-body"},[e._m(1),e._v(" "),a("div",{staticClass:"interface-define-body"},[a("el-tabs",{on:{"tab-click":e.handleParamClick},model:{value:e.activeParamName,callback:function(t){e.activeParamName=t},expression:"activeParamName"}},[a("el-tab-pane",{attrs:{label:"请求头",name:"requestHeader"}},[a("el-form",{ref:"requestHeadersFormRef",attrs:{model:e.requestBodyObj.requestHeadersList}},e._l(e.requestBodyObj.requestHeadersList.items,function(t,n){return a("el-row",{key:t.key,attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{prop:"items."+n+".keys"}},[a("el-input",{attrs:{placeholder:"请输入key",clearable:""},model:{value:t.keys,callback:function(a){e.$set(t,"keys",a)},expression:"item.keys"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:16}},[a("el-form-item",{attrs:{prop:"items."+n+".value"}},[a("el-input",{attrs:{placeholder:"请输入value",clearable:""},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:2}},[a("div",{staticClass:"add-del-param-btn"},[1!==e.requestBodyObj.requestHeadersList.items.length?a("el-tag",{staticClass:"line-add-del",attrs:{type:"danger"},on:{click:function(a){return e.removeRequestHeadersList(t)}}},[e._v("-")]):e._e(),e._v(" "),a("el-tag",{staticClass:"line-add-del",attrs:{type:"danger"},on:{click:e.addRequestHeadersList}},[e._v("+")])],1)])],1)}),1)],1),e._v(" "),a("el-tab-pane",{attrs:{label:"请求体",name:"body"}},[a("el-tabs",{on:{"tab-click":e.handleRequestBodyClick},model:{value:e.activeRequestName,callback:function(t){e.activeRequestName=t},expression:"activeRequestName"}},[a("el-tab-pane",{attrs:{label:"raw",name:"raw"}},[a("div",{staticClass:"raw-area"},[a("el-input",{attrs:{type:"textarea",rows:10,placeholder:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.formatJsonData(t)}},model:{value:e.basicInfo.requestBody,callback:function(t){e.$set(e.basicInfo,"requestBody",t)},expression:"basicInfo.requestBody"}})],1)]),e._v(" "),a("el-tab-pane",{attrs:{label:"param",name:"params"}},[a("el-form",{ref:"requestParamsFormRef",attrs:{model:e.requestBodyObj.requestParamsList}},e._l(e.requestBodyObj.requestParamsList.items,function(t,n){return a("el-row",{key:t.key,attrs:{gutter:20}},[a("el-col",{attrs:{span:6}},[a("el-form-item",{attrs:{prop:"items."+n+".keys"}},[a("el-input",{attrs:{placeholder:"请输入key",clearable:""},model:{value:t.keys,callback:function(a){e.$set(t,"keys",a)},expression:"item.keys"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:16}},[a("el-form-item",{attrs:{prop:"items."+n+".value"}},[a("el-input",{attrs:{placeholder:"请输入value",clearable:""},model:{value:t.value,callback:function(a){e.$set(t,"value",a)},expression:"item.value"}})],1)],1),e._v(" "),a("el-col",{attrs:{span:2}},[a("div",{staticClass:"add-del-param-btn"},[1!==e.requestBodyObj.requestParamsList.items.length?a("el-tag",{staticClass:"line-add-del",attrs:{type:"danger"},on:{click:function(a){return e.removeRequestParamsList(t)}}},[e._v("-")]):e._e(),e._v(" "),a("el-tag",{staticClass:"line-add-del",attrs:{type:"danger"},on:{click:e.addRequestParamsList}},[e._v("+")])],1)])],1)}),1)],1)],1)],1),e._v(" "),a("el-tab-pane",{attrs:{label:"断言",name:"assert"}},[a("div",[a("el-input",{attrs:{placeholder:"多个以逗号隔开",clearable:""},model:{value:e.basicInfo.assertField,callback:function(t){e.$set(e.basicInfo,"assertField",t)},expression:"basicInfo.assertField"}},[a("template",{slot:"prepend"},[e._v("断言字段")])],2)],1),e._v(" "),a("br"),e._v(" "),a("div",[a("el-input",{attrs:{placeholder:"多个以逗号隔开",clearable:""},model:{value:e.basicInfo.expectResult,callback:function(t){e.$set(e.basicInfo,"expectResult",t)},expression:"basicInfo.expectResult"}},[a("template",{slot:"prepend"},[e._v("预期结果")])],2)],1)]),e._v(" "),a("el-tab-pane",{attrs:{label:"关联",name:"relation"}},[a("div",{staticClass:"relation-field-area"},[a("el-input",{attrs:{type:"textarea",rows:10,placeholder:"多个以逗号隔开"},model:{value:e.basicInfo.relationValues,callback:function(t){e.$set(e.basicInfo,"relationValues",t)},expression:"basicInfo.relationValues"}})],1)])],1)],1)]),e._v(" "),a("div",{staticClass:"define-base-info interface-define base-body"},[e._m(2),e._v(" "),a("div",{staticClass:"interface-define-body"},[a("el-tabs",{on:{"tab-click":e.handleOtherClick},model:{value:e.activeOtherName,callback:function(t){e.activeOtherName=t},expression:"activeOtherName"}},[a("el-tab-pane",{attrs:{label:"备注",name:"comments"}},[a("div",{staticClass:"relation-field-area"},[a("el-input",{attrs:{type:"textarea",rows:10,placeholder:"请输入备注信息"},model:{value:e.basicInfo.comments,callback:function(t){e.$set(e.basicInfo,"comments",t)},expression:"basicInfo.comments"}})],1)])],1)],1)])])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"interface-define-title base-info-title"},[t("span",[this._v("|")]),this._v("\n 基本信息\n ")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"interface-define-title"},[t("span",[this._v("|")]),this._v("\n 参数信息\n ")])},function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"interface-define-title"},[t("span",[this._v("|")]),this._v("\n 其他信息\n ")])}]};var o={components:{InterfaceDataDefineBasicInfo:a("VU/8")(i,r,!1,function(e){a("BFa7")},"data-v-3722ee2e",null).exports,UploadFile:a("hx1z").a},data:function(){return{loading:!1,fileType:["xlsx","xls"],addDialogVisible:!1,importDialogVisible:!1,editForm:{},queryInfo:{pageNum:1,pageSize:10,itemId:"",envCode:this.$common.getSessionStorage("currentEnvCode"),interfaceName:"",interfacePath:"",createPerson:"",comments:""},operatorPerson:JSON.parse(localStorage.getItem("userInfo")).nick,testDataList:[],currpage:1,total:0,addForm:{caseId:"",itemId:this.$common.getSessionStorage("currentItemId"),envCode:this.$common.getSessionStorage("currentEnvCode"),interfaceName:"",interfacePath:"",port:"",requestHeader:"",requestBody:"",requestParams:"",relationValues:"",assertField:"",expectResult:"",createPerson:"",createTime:(new Date).getTime(),comments:""},basicInfoShowFlag:!1,listShowFlag:!0,addFormRules:{interfaceName:[{required:!0,message:"请输入接口名称",trigger:"blur"},{min:1,max:50,message:"长度在 1 到 50 个字符",trigger:"blur"}],interfacePath:[{required:!0,message:"请输入接口地址",trigger:"blur"},{min:1,max:200,message:"长度在 1 到 200 个字符",trigger:"blur"}],relationValues:[{required:!1,message:"请输入关联参数(多个值以逗号隔开)",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],ipPath:[{required:!0,message:"请输入IP/域名地址",trigger:"blur"},{min:1,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}],port:[{required:!1,message:"请输入端口号",trigger:"blur"},{min:0,max:6,message:"长度在 0 到 6 个字符",trigger:"blur"}],assertField:[{required:!1,message:"请输入断言字段(多个值以逗号隔开)",trigger:"blur"},{min:0,max:50,message:"长度在 0 到 50 个字符",trigger:"blur"}],requestHeader:[{required:!1,message:"请输入请求头",trigger:"blur"}],requestParams:[{required:!1,message:"请输入请求参数",trigger:"blur"}],expectResult:[{required:!1,message:"请输入预期结果(多个值以逗号隔开)",trigger:"blur"},{min:0,max:100,message:"长度在 0 到 100 个字符",trigger:"blur"}],comments:[{required:!1,message:"请输入备注",trigger:"blur"},{min:0,max:200,message:"长度在 0 到 200 个字符",trigger:"blur"}]}}},mounted:function(){},created:function(){var e=this;this.selectInterfaceTestDataList(),window.addEventListener("beforeunload",function(t){return e.refreshEvent(t)})},methods:{refreshEvent:function(e){this.$common.setSessionStorage("currentEnvCode","testEnv")},uploadSuccessStartImport:function(e){var t=this,a={dataType:"2",envCode:this.$common.getSessionStorage("currentEnvCode"),fileName:e,operatorPerson:this.operatorPerson};this.$api.testdata.importTestCaseDataByExcel(s()(a)).then(function(a){t.$notify({type:"success",message:a.data.msg}),t.loading=!1,t.selectInterfaceTestDataList(),t.$api.comm.deleteFile(e)}).catch(function(){t.loading=!1,t.$api.comm.deleteFile(e)})},importInterfaceTestCase:function(){this.uploadComplatedFlag=!1,this.$refs.uploadFile.uploadSectionFile(),this.importDialogVisible=!1,this.loading=!0},cancelImportDialogVisible:function(){this.loading=!1,this.importDialogVisible=!1,this.$refs.uploadFile.cancel()},editInterfaceDataInfo:function(e){var t={id:e.caseId,flag:!0};this.selectInterfaceDataInfo(t)},selectInterfaceDataInfo:function(e){var t=this;e.flag?(this.listShowFlag=!1,this.basicInfoShowFlag=!0,this.$api.testdata.queryInterfaceTestDataById(e.id+"/"+this.$common.getSessionStorage("currentEnvCode")).then(function(e){e.data.data||t.$notify({type:"warning",message:"暂无数据"}),t.$refs.interfaceDataDefineBasicInfoRef.changeInterfaceDataBasicInfo(e.data.data)}).catch(function(){})):(this.basicInfoShowFlag=!1,this.listShowFlag=!0,0==e.id?this.queryInfo.itemId="":this.queryInfo.itemId=e.id,this.getInterfaceTestDataList())},addInterfaceTestData:function(){var e=this;this.$refs.addFormRef.validate(function(t){t&&(e.addForm.createPerson=e.operatorPerson,e.$api.testdata.insertInterfaceTestData(s()(e.addForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.addDialogVisible=!1,e.selectInterfaceTestDataList(),e.loading=!1}).catch(function(){e.loading=!0}))})},cancelAddDialogVisible:function(){this.addDialogVisible=!1,this.$refs.addFormRef.resetFields()},editInterfaceTestData:function(){var e=this;this.$refs.editFormRef.validate(function(t){t&&(e.editForm.updateTime=(new Date).getTime(),e.editForm.updatePerson=e.operatorPerson,e.$api.testdata.updateInterfaceTestData(s()(e.editForm)).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.editDialogVisible=!1,e.selectInterfaceTestDataList()}).catch(function(){}))})},delInterfaceTestData:function(e){var t=this;this.$confirm("确定删除吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){t.$api.testdata.delInterfaceTestDataById(e+"/"+t.queryInfo.envCode).then(function(e){t.$notify({type:"success",message:e.data.msg}),t.loading=!1,t.selectInterfaceTestDataList()}).catch(function(){t.loading=!1})}).catch(function(){})},selectInterfaceTestDataList:function(){var e=this;this.queryInfo.pageNum=1,this.total=0,this.queryInfo.envCode=this.$common.getSessionStorage("currentEnvCode"),this.queryInfo.envCode?this.getInterfaceTestDataList():this.$api.dict.queryAllDataDict().then(function(t){e.environmentList=t.data.data.environment,e.environmentList.forEach(function(t){"测试环境"==t.dictValue&&(e.queryInfo.envCode=t.dictCode)}),e.getInterfaceTestDataList()}).catch(function(){})},getInterfaceTestDataList:function(){var e=this;this.loading=!0,this.$api.testdata.queryAllInterfaceTestData(s()(this.queryInfo)).then(function(t){e.testDataList=t.data.data,e.total=t.data.count,e.loading=!1}).catch(function(){e.loading=!1})},handleSizeChange:function(e){this.queryInfo.pageSize=e,this.getInterfaceTestDataList()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.getInterfaceTestDataList()},getRowKeys:function(e){return e.id}}},l={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"interface-data-Info-box"},[e.listShowFlag?a("div",{staticClass:"interface-data-info-table"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0}},[a("el-form-item",{attrs:{label:"接口名称"}},[a("el-input",{attrs:{placeholder:"请输入接口名称",clearable:""},model:{value:e.queryInfo.interfaceName,callback:function(t){e.$set(e.queryInfo,"interfaceName",t)},expression:"queryInfo.interfaceName"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"接口地址"}},[a("el-input",{attrs:{placeholder:"请输入接口地址",clearable:""},model:{value:e.queryInfo.interfacePath,callback:function(t){e.$set(e.queryInfo,"interfacePath",t)},expression:"queryInfo.interfacePath"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"添加人员"}},[a("el-input",{staticClass:"input-with-select",attrs:{placeholder:"请输入添加人员",clearable:""},model:{value:e.queryInfo.createPerson,callback:function(t){e.$set(e.queryInfo,"createPerson",t)},expression:"queryInfo.createPerson"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"备注信息"}},[a("el-input",{attrs:{placeholder:"请输入备注信息",clearable:""},model:{value:e.queryInfo.comments,callback:function(t){e.$set(e.queryInfo,"comments",t)},expression:"queryInfo.comments"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.selectInterfaceTestDataList}},[e._v("查询")])],1)],1),e._v(" "),a("el-row",[a("el-col",[a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.importDialogVisible=!0}}},[e._v("导入")])],1)],1),e._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{"tooltip-effect":"dark",data:e.testDataList.slice((e.currpage-1)*e.queryInfo.pageSize,e.currpage*e.queryInfo.pageSize),border:"",fit:!0},on:{"cell-dblclick":e.editInterfaceDataInfo}},[a("el-table-column",{attrs:{"reserve-selection":!0,label:"序号",type:"index",align:"center",width:"50",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"接口名称",prop:"interfaceName",width:"200","show-overflow-tooltip":"",fixed:""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"请求协议",prop:"protocolType",width:"100"}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"请求类型",prop:"requestType",width:"100"}}),e._v(" "),a("el-table-column",{attrs:{label:"IP/域名地址",prop:"ipPath",width:"250","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{label:"端口号",prop:"port",width:"110","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"接口地址",prop:"interfacePath",width:"200","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"请求头",prop:"requestHeader",width:"200","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"请求参数",prop:"requestParams",width:"200","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"请求体",prop:"requestBody",width:"200","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"关联参数",prop:"relationValues",width:"200","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"断言字段",prop:"assertField",width:"200","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"预期结果",prop:"expectResult",width:"200","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"添加人员",prop:"createPerson","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"添加时间",prop:"createTime",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"更新人员",prop:"updatePerson",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"更新时间",prop:"updateTime",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{"reserve-selection":!0,label:"备注",prop:"comments",width:"250","show-overflow-tooltip":""}}),e._v(" "),a("el-table-column",{attrs:{label:"操作",fixed:"right",width:"200",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.editInterfaceDataInfo(t.row)}}},[e._v("编辑")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.delInterfaceTestData(t.row.id)}}},[e._v("删除")])]}}],null,!1,3370482297)})],1),e._v(" "),a("el-pagination",{attrs:{"page-sizes":[5,10,20,30],"page-size":e.queryInfo.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1):e._e(),e._v(" "),a("el-dialog",{attrs:{title:"导入用例",visible:e.importDialogVisible,width:"40%"},on:{"update:visible":function(t){e.importDialogVisible=t},close:e.cancelImportDialogVisible}},[a("upload-file",{ref:"uploadFile",attrs:{fileType:e.fileType},on:{"upload-file-event":e.uploadSuccessStartImport}}),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.cancelImportDialogVisible}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.importInterfaceTestCase}},[e._v("确 定")])],1)],1),e._v(" "),e.basicInfoShowFlag?a("div",{staticClass:"right-interface-info-single-page"},[a("interface-data-define-basic-info",{ref:"interfaceDataDefineBasicInfoRef"})],1):e._e()],1)},staticRenderFns:[]};var c={data:function(){return{menuTreeList:[],defaultShowNodes:[],defaultExpandNodes:[],defaultProps:{children:"children",label:"label"},notDataText:"暂无数据",loadDataText:"加载中...",loading:!0,iconCloseStyle:"el-icon-folder",iconOpenStyle:"el-icon-folder-opened"}},created:function(){this.getAllInterfaceTestItem()},mounted:function(){},methods:{getAllInterfaceTestItem:function(){var e=this;this.$api.test.queryAllInterfaceTestItem().then(function(t){e.menuTreeList=t.data.data,e.$nextTick(function(){e.$refs.menuTreeRef.setCurrentKey(e.menuTreeList[0].id)}),e.defaultExpandNodes.push(e.menuTreeList[0].id),e.loading=!1}).catch(function(){e.loading=!1})},changeFolderStyle:function(e){if(!e.itemName){var t=document.getElementById(this.iconCloseStyle+e.id);t.className=t.className==this.iconCloseStyle?this.iconOpenStyle:this.iconCloseStyle}},clickCurrentNode:function(e){var t={id:"",flag:!1};0==e.id?(t.id=e.id,this.$emit("interface-data-menu-event",t)):e.itemName?(this.$common.setSessionStorage("currentInterfaceName",e.label),this.$common.setSessionStorage("currentItemId",e.itemId),this.$common.setSessionStorage("currentCaseId",e.id),t.id=e.id,t.flag=!0,this.$emit("interface-data-menu-event",t)):(this.$common.setSessionStorage("currentItemId",e.id),t.id=e.id,this.$emit("interface-data-menu-event",t))}},watch:{menuTreeList:{handler:function(){var e=this;this.menuTreeList.forEach(function(t){e.defaultShowNodes.push(t.id)})},deep:!0}}},d={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"interface-menu-list"},[a("div",{staticClass:"custom-tree-container"},[a("div",{staticClass:"tree-menu"},[a("el-tree",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],ref:"menuTreeRef",attrs:{data:e.menuTreeList,props:e.defaultProps,"highlight-current":!0,"expand-on-click-node":!0,"default-checked-keys":e.defaultShowNodes,"empty-text":e.notDataText,"element-loading-text":e.loadDataText,"default-expanded-keys":e.defaultExpandNodes,accordion:!1,"node-key":"id","render-after-expand":""},on:{"node-click":e.clickCurrentNode,"node-expand":e.changeFolderStyle,"node-collapse":e.changeFolderStyle},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.node,s=t.data;return a("div",{staticClass:"label-name custom-tree-node"},[a("div",{staticClass:"label-name-left"},["所有用例"==n.label?a("i",{class:e.iconOpenStyle,attrs:{id:e.iconCloseStyle+s.id}},[e._v("\n "+e._s(n.label)+"\n ")]):"所有用例"!=n.label&&void 0==s.itemName?a("i",{class:e.iconCloseStyle,attrs:{id:e.iconCloseStyle+s.id}},[e._v("\n "+e._s(n.label)+"\n ")]):a("i",{staticClass:"el-icon-position interface-name-icon"},[e._v("\n "+e._s(n.label)+"\n ")])])])}}])})],1)])])},staticRenderFns:[]};var u={components:{InterfaceDataInfoList:a("VU/8")(o,l,!1,function(e){a("fNzw")},"data-v-e4f58878",null).exports,TestEnvInterfaceDataMenuList:a("VU/8")(c,d,!1,function(e){a("wLuF")},"data-v-5db5121e",null).exports},created:function(){},mounted:function(){var e=this;window.onresize=function(){e.autoFitResolution()},this.autoFitResolution()},data:function(){return{environmentList:[]}},methods:{autoFitWindowWidth:function(e){for(var t=this.$refs.envInterfaceDataRef.clientWidth,a=document.getElementsByClassName("left-menu"),n=document.getElementsByClassName("right-interface-info"),s=0;s<a.length;s++)a[s].style.width=.15*t-10+"px",n[s].style.width=.835*t+"px"},autoFitResolution:function(){var e=document.getElementsByClassName("env-interface-data-box"),t=document.getElementById("middle"),a=document.getElementsByClassName("left-menu"),n=document.getElementsByClassName("middle-resize"),s=document.getElementsByClassName("right-interface-info");t.style.lineHeight=window.document.body.clientHeight+"px";for(var i=function(t){n[t].onmousedown=function(i){var r=i.clientX;return n[t].left=n[t].offsetLeft,document.onmousemove=function(i){var o=i.clientX,l=n[t].left+(o-r),c=e[t].clientWidth-n[t].offsetWidth;l<32&&(l=32),l>c-150&&(l=c-150),n[t].style.left=l;for(var d=0;d<a.length;d++)a[d].style.width=l+"px",s[d].style.width=e[t].clientWidth-l-20+"px"},document.onmouseup=function(e){document.onmousemove=null,document.onmouseup=null,n[t].releaseCapture&&n[t].releaseCapture()},!1}},r=0;r<n.length;r++)i(r)},changeLeftMenuRightTableWidth:function(e){var t=document.querySelector(".left-menu"),a=document.querySelector(".right-interface-info");e?(t.style.width="14.5%",a.style.width="83.5%"):(t.style.width="2.5%",a.style.width="95.5%")},changeRightShowFlag:function(e){this.$refs.interfaceDataInfoListRef.selectInterfaceDataInfo(e)}}},f={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{ref:"envInterfaceDataRef",staticClass:"env-interface-data-box"},[t("div",{staticClass:"left-menu"},[t("test-env-interface-data-menu-list",{ref:"interfaceDataMenuListRef",on:{"interface-data-menu-event":this.changeRightShowFlag,"interface-menu-expand-fold-event":this.changeLeftMenuRightTableWidth}})],1),this._v(" "),this._m(0),this._v(" "),t("div",{staticClass:"right-interface-info"},[t("interface-data-info-list",{ref:"interfaceDataInfoListRef"})],1)])},staticRenderFns:[function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"middle",attrs:{id:"middle"}},[t("div",{staticClass:"middle-resize",attrs:{id:"interfaceMiddleResize"}},[this._v("⋮")])])}]};var m=a("VU/8")(u,f,!1,function(e){a("Q5JM")},"data-v-29543e7f",null).exports,v={components:{TestEnvInterfaceData:m},data:function(){return{}},methods:{invokeTestEnvInterfaceData:function(){this.$refs.testEnvInterfaceDataRef.autoFitWindowWidth()}}},p={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"dev-env-interface-data-box"},[t("test-env-interface-data",{ref:"testEnvInterfaceDataRef"})],1)},staticRenderFns:[]};var h={components:{TestEnvInterfaceData:m},data:function(){return{}},methods:{invokeTestEnvInterfaceData:function(){this.$refs.testEnvInterfaceDataRef.autoFitWindowWidth()}}},b={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"dev-env-interface-data-box"},[t("test-env-interface-data",{ref:"testEnvInterfaceDataRef"})],1)},staticRenderFns:[]};var g={components:{TestEnvInterfaceData:m},data:function(){return{}},methods:{invokeTestEnvInterfaceData:function(){this.$refs.testEnvInterfaceDataRef.autoFitWindowWidth()}}},I={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"dev-env-interface-data-box"},[t("test-env-interface-data",{ref:"testEnvInterfaceDataRef"})],1)},staticRenderFns:[]};var y={data:function(){return{activeName:"",load:{testEnv:!0,devEnv:!1,preEnv:!1,prodEnv:!1}}},mounted:function(){},beforeMount:function(){var e=this.$common.getSessionStorage("currentActiveName");if(e)for(var t in this.activeName=e,this.load)this.load[t]=t==e;else this.activeName="testEnv"},created:function(){this.getDataDictForEnv()},beforeDestroy:function(){this.changeActiveNameAndEnvCode("testEnv","测试环境")},methods:{invokeInterfaceData:function(){"testEnv"==this.activeName?this.$refs.testEnvRef.autoFitWindowWidth():"devEnv"==this.activeName?this.$refs.devEnvRef.invokeTestEnvInterfaceData():"preEnv"==this.activeName?this.$refs.preEnvRef.invokeTestEnvInterfaceData():this.$refs.prodEnvRef.invokeTestEnvInterfaceData()},getDataDictForEnv:function(){var e=this;this.$api.dict.queryAllDataDict().then(function(t){e.environmentList=t.data.data.environment,e.environmentList.forEach(function(t){"测试环境"==t.dictValue&&e.$common.setSessionStorage("currentEnvCode",t.dictCode)})}).catch(function(){})},changeActiveNameAndEnvCode:function(e,t){var a=this;switch(this.activeName=e,this.environmentList.forEach(function(e){t==e.dictValue&&(a.envCode=e.dictCode)}),this.activeName){case"testEnv":this.switchClickTab("testEnv");break;case"devEnv":this.switchClickTab("devEnv");break;case"preEnv":this.switchClickTab("preEnv");break;case"prodEnv":this.switchClickTab("prodEnv")}},handleClick:function(e){this.changeActiveNameAndEnvCode(e.name,e.label)},switchClickTab:function(e){for(var t in this.load)this.load[t]=t==e;this.$common.setSessionStorage("currentEnvCode",this.envCode),this.$common.setSessionStorage("currentActiveName",e)}},components:{TestEnvInterfaceData:m,DevEnvInterfaceData:a("VU/8")(v,p,!1,function(e){a("kO3i")},"data-v-0386463c",null).exports,PreEnvInterfaceData:a("VU/8")(h,b,!1,function(e){a("HMVn")},"data-v-29ec0a94",null).exports,ProdEnvInterfaceData:a("VU/8")(g,I,!1,function(e){a("AfI0")},"data-v-94f47164",null).exports}},q={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"interface-data-info-box"},[a("el-tabs",{on:{"tab-click":e.handleClick},model:{value:e.activeName,callback:function(t){e.activeName=t},expression:"activeName"}},[a("el-tab-pane",{attrs:{label:"测试环境",name:"testEnv"}},[e.load.testEnv?a("TestEnvInterfaceData",{ref:"testEnvRef"}):e._e()],1),e._v(" "),a("el-tab-pane",{attrs:{label:"开发环境",name:"devEnv"}},[e.load.devEnv?a("DevEnvInterfaceData",{ref:"devEnvRef"}):e._e()],1),e._v(" "),a("el-tab-pane",{attrs:{label:"预发环境",name:"preEnv"}},[e.load.preEnv?a("PreEnvInterfaceData",{ref:"preEnvRef"}):e._e()],1),e._v(" "),a("el-tab-pane",{attrs:{label:"生产环境",name:"prodEnv"}},[e.load.prodEnv?a("ProdEnvInterfaceData",{ref:"prodEnvRef"}):e._e()],1)],1)],1)},staticRenderFns:[]};var _={data:function(){return{pageName:"interfaceData"}},components:{InterfaceDataInfo:a("VU/8")(y,q,!1,function(e){a("RFs5")},"data-v-d751d452",null).exports},methods:{invokeInterfaceData:function(){this.$refs.interfaceDataInfoRef.invokeInterfaceData()}}},k={render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"box"},[t("interface-data-info",{ref:"interfaceDataInfoRef"})],1)},staticRenderFns:[]};var C=a("VU/8")(_,k,!1,function(e){a("YyWp")},"data-v-a969273c",null);t.default=C.exports},Q5JM:function(e,t){},RFs5:function(e,t){},YyWp:function(e,t){},fNzw:function(e,t){},kO3i:function(e,t){},wLuF:function(e,t){}});
|
||
//# sourceMappingURL=3.c1c7a79f6998c191a587.js.map
|