(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77d7f355"],{"0558":function(t,a,e){"use strict";e.r(a);var r=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("el-dialog",{attrs:{title:this.dataList[0].propId?"修改":"新增","close-on-click-modal":!1,visible:t.visible},on:{"update:visible":function(a){t.visible=a}}},[e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.dataList,border:""}},[e("el-table-column",{attrs:{prop:"propName","header-align":"center",align:"center",label:"属性名称"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-input",{attrs:{placeholder:"请输入内容",maxlength:"10","show-word-limit":"",clearable:""},model:{value:a.row.propName,callback:function(e){t.$set(a.row,"propName",e)},expression:"scope.row.propName"}})]}}])}),e("el-table-column",{attrs:{prop:"prodPropValues","header-align":"center",align:"center",label:"属性值"},scopedSlots:t._u([{key:"default",fn:function(a){return[t._l(a.row.prodPropValues,(function(a){return e("el-col",{key:a.valueId,attrs:{span:12}},[e("el-input",{staticClass:"prop-value-input",attrs:{placeholder:"请输入内容",maxlength:"20","show-word-limit":"",clearable:""},on:{clear:t.clearProdPropValues},model:{value:a.propValue,callback:function(e){t.$set(a,"propValue",e)},expression:"item.propValue"}})],1)})),e("el-col",{attrs:{span:4}},[e("el-button",{staticClass:"add-input",attrs:{type:"primary",icon:"el-icon-circle-plus"},on:{click:function(a){return t.addInput()}}})],1)]}}])})],1),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(a){t.visible=!1}}},[t._v("取消")]),e("el-button",{attrs:{type:"primary"},on:{click:function(a){return t.dataFormSubmit()}}},[t._v("确定")])],1)],1)},s=[],o=(e("14d9"),e("20ca")),i={data(){return{visible:!1,dataList:[{propId:0,propName:"",prodPropValues:[{valueId:0}]}],dataRule:{propName:[{required:!0,message:"属性名称不能为空",trigger:"blur"}]},page:{total:0,currentPage:1,pageSize:10}}},methods:{init(t){this.dataList=t?[JSON.parse(JSON.stringify(t))]:[{propId:0,propName:"",prodPropValues:[{valueId:0}]}],this.visible=!0},dataFormSubmit:Object(o["a"])((function(){if(this.dataList[0].prodPropValues){let t=[];for(const a in this.dataList[0].prodPropValues)if(this.dataList[0].prodPropValues.hasOwnProperty(a)){const e=this.dataList[0].prodPropValues[a];e.propValue&&t.push(this.dataList[0].prodPropValues[a])}this.dataList[0].prodPropValues=t}return this.dataList[0].propName.trim()?this.dataList[0].prodPropValues.length<1?(this.dataList[0].prodPropValues=[{valueId:0}],void this.$message.error("规格项不能为空")):void(this.dataList[0].propName.length>10?this.$message.error("属性名称长度不能大于10"):this.dataList[0].prodPropValues.find(t=>!t.propValue.trim())?this.$message.error("属性值不能为空"):this.dataList[0].prodPropValues.find(t=>t.propValue.length>20)?this.$message.error("属性值长度不能大于20"):this.$http({url:this.$http.adornUrl("/prod/spec"),method:this.dataList[0].propId?"put":"post",data:this.$http.adornData({propId:this.dataList[0].propId||void 0,propName:this.dataList[0].propName,prodPropValues:this.dataList[0].prodPropValues})}).then(({data:t})=>{this.$message({message:"操作成功",type:"success",duration:1500,onClose:()=>{this.visible=!1,this.$emit("refreshDataList",this.page)}})})):(this.dataList[0].propName="",void this.$message.error("属性名不能为空"))})),clearProdPropValues(){if(1!==this.dataList[0].prodPropValues.length)for(let t=0;t{let e,r=a||300;return function(){let a=arguments;e&&clearTimeout(e);let s=!e;e=setTimeout(()=>{e=null},r),s&&t.apply(this,a)}}},"7dff":function(t,a,e){},a649:function(t,a,e){"use strict";e("7dff")}}]);