启程易购后端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
qicheng_shop_backend/public/system/js/chunk-7e8029c3.ad7a715f.js

1 lines
10 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7e8029c3"],{"0c7e":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-card",[a("el-form",{attrs:{model:e.basicsForm,"label-width":"120px"}},[a("el-row",{attrs:{gutter:24}},[a("el-col",{staticClass:"mt10",attrs:{span:24}},[a("el-form-item",{attrs:{label:"用户默认头像:"}},[a("div",{staticStyle:{display:"inline-block"},on:{click:function(t){return e.modalPicTap("1")}}},[e.authorizedPicture?a("div",{staticClass:"uploadPictrue"},[a("img",{attrs:{src:e.authorizedPicture}})]):a("div",{staticClass:"uploadPictrue"},[a("i",{staticClass:"iconfont iconshangpinshuliang-jia"})])]),e._v(" "),a("div",{staticClass:"upload-text"},[e._v("建议尺寸:120*120px")])])],1),e._v(" "),a("el-col",{staticClass:"mt10",attrs:{span:24}},[a("el-form-item",{attrs:{label:"用户信息设置:"}},[a("el-table",{ref:"table",staticClass:"goods",attrs:{data:e.listOne,"row-key":"id","highlight-current-row":"",draggable:!0}},[a("el-table-column",{attrs:{label:"#","min-width":"50"}},[[a("i",{staticClass:"iconfont-diy icondrag"})]],2),e._v(" "),a("el-table-column",{attrs:{label:"信息名称",prop:"title","min-width":"80"}}),e._v(" "),a("el-table-column",{attrs:{label:"使用","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-checkbox",{attrs:{"true-label":1,"false-label":0},model:{value:t.row.is_used,callback:function(a){e.$set(t.row,"is_used",a)},expression:"scope.row.is_used"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"必填","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-checkbox",{attrs:{"true-label":1,"false-label":0,disabled:0==t.row.is_used},model:{value:t.row.is_require,callback:function(a){e.$set(t.row,"is_require",a)},expression:"scope.row.is_require"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"用户端显示","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-checkbox",{attrs:{"true-label":1,"false-label":0,disabled:0==t.row.is_used},model:{value:t.row.is_show,callback:function(a){e.$set(t.row,"is_show",a)},expression:"scope.row.is_show"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"信息格式","min-width":"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",[e._v(e._s(t.row.type_name))])]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"提示信息",prop:"msg","min-width":"150"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"60",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[1!=t.row.is_default?a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.delInfo(t.row.id)}}},[e._v("删除")]):e._e()]}}])})],1),e._v(" "),a("div",{staticClass:"upload-text goods"},[e._v("\n 1.开启使用后,后台添加用户时可填写此信息;开启必填后,后台添加用户时此信息必须填写;开启用户端展示后,在商城用户个人信息中展示\n "),a("br"),e._v("\n 2.自定义添加日期和单选格式的字段,暂不支持用户列表搜索,如业务需要建议进一步开发;其它字段均支持用户列表搜索\n ")]),e._v(" "),a("el-button",{staticClass:"addInfo",attrs:{type:"default",size:"small"},on:{click:function(t){e.addModel=!0}}},[e._v("新增信息")]),e._v(" "),a("div",{staticClass:"mt20"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleSubmit()}}},[e._v("保存")])],1)],1)],1)],1)],1)],1),e._v(" "),a("el-dialog",{attrs:{visible:e.addModel,title:"新增信息","class-name":"vertical-center-modal",scrollable:"",width:"630px"},on:{"update:visible":function(t){e.addModel=t},close:e.cancelSubmit}},[a("el-form",{ref:"formValidate",attrs:{model:e.formItem,rules:e.ruleValidate,size:"small","label-width":"90px"}},[a("el-row",[a("el-col",[a("el-form-item",{attrs:{label:"字段名:",prop:"field"}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"以英文开头的字母、数字、下划线组合,用于代码中筛选信息名称,在后台前端不展示"},model:{value:e.formItem.field,callback:function(t){e.$set(e.formItem,"field",t)},expression:"formItem.field"}})],1)],1),e._v(" "),a("el-col",[a("el-form-item",{attrs:{label:"信息名称:",prop:"title"}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入信息名称"},model:{value:e.formItem.title,callback:function(t){e.$set(e.formItem,"title",t)},expression:"formItem.title"}})],1)],1),e._v(" "),a("el-col",[a("el-form-item",{attrs:{label:"信息格式 :",prop:"type"}},[a("el-select",{staticClass:"width100",model:{value:e.formItem.type,callback:function(t){e.$set(e.formItem,"type",t)},expression:"formItem.type"}},e._l(e.formatList,(function(t){return a("el-option",{key:t.value,attrs:{value:t.value,label:t.label}},[e._v("\n "+e._s(t.label)+"\n ")])})),1)],1)],1),e._v(" "),a("el-col",["radio"===e.formItem.type?a("el-form-item",{attrs:{label:"单选项 :",prop:"content"}},[a("div",{staticClass:"arrbox"},[e._l(e.formItem.content,(function(t,l){return a("el-tag",{key:l,attrs:{name:t,closable:!0},on:{close:e.handleClose}},[e._v("\n "+e._s(t)+"\n ")])})),e._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:e.single,expression:"single"}],staticClass:"arrbox_ip width100",attrs:{size:"small",placeholder:"请输入选项,回车确认"},domProps:{value:e.single},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.addlabel(t)},input:function(t){t.target.composing||(e.single=t.target.value)}}})],2)]):e._e()],1),e._v(" "),a("el-col",[a("el-form-item",{attrs:{label:"提示文案:",prop:"msg"}},[a("el-input",{staticClass:"width100",attrs:{placeholder:"请输入提示文案"},model:{value:e.formItem.msg,callback:function(t){e.$set(e.formItem,"msg",t)},expression:"formItem.msg"}})],1)],1)],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:e.cancelSubmit}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.addSubmit}},[e._v("确 定")])],1)],1)],1)},s=[],i=(a("ac6a"),a("db72")),r=(a("7f7f"),a("c24f")),n=a("53fe"),o=a.n(n),c={name:"setupUser",components:{},props:{},data:function(){var e=function(e,t,a){t.length<2?a(new Error("单选项最少输入2个")):a()},t=function(e,t,a){""===t||null==t||t<0?a(new Error("活动价不能为空")):a()},a=function(e,t,a){""!==t&&null!=t&&t?/^[a-z][a-z0-9_]*$/.test(t)?a():a(new Error("格式不正确!")):a(new Error("字段名不能为空"))};return{paySwitch:1,phoneSwitch:1,indexCoupon:0,val:"",formActive:{activeInput:0},basicsForm:{},selectArr:[],value:"",formItem:{title:"",type_name:"",msg:"",content:[]},single:"",activityShow:!1,isChoice:"单选",modalPic:!1,loading:!1,addModel:!1,authorizedPicture:"",isShow:!1,formatList:[{value:"input",label:"文本"},{value:"int",label:"数字"},{value:"date",label:"日期"},{value:"radio",label:"单选项"},{value:"id_card",label:"身份证"},{value:"email",label:"邮件"},{value:"phone",label:"手机号"},{value:"address",label:"地址"}],gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},listOne:[],tableData:[],ruleValidate:{field:[{required:!0,validator:a,trigger:"blur"}],title:[{required:!0,message:"信息名称不能为空",trigger:"blur"}],type:[{required:!0,message:"信息格式不能为空",trigger:"blur"}],msg:[{required:!0,message:"信息文案不能为空",trigger:"blur"}],content:[{required:!0,validator:e,type:"array",trigger:"blur"}]},ruleActive:{activeInput:[{required:!0,validator:t,trigger:"blur"}]},couponType:0,vipCopon:[]}},computed:{},created:function(){this.settingUser()},mounted:function(){var e=this;this.$nextTick((function(){e.setSort()}))},methods:{setSort:function(){var e=document.querySelector(".el-table__body-wrapper tbody"),t=this;o.a.create(e,{onEnd:function(e){var a=e.newIndex,l=e.oldIndex;console.log(a,l);var s=t.listOne.splice(l,1)[0];t.listOne.splice(a,0,s)}})},elChangeExForArray:function(e,t,a){var l=a[e];return a[e]=a[t],a[t]=l,a},settingUser:function(){var e=this;Object(r["gb"])().then((function(t){e.authorizedPicture=t.data.avatar,e.listOne=t.data.list}))},cancel:function(e){this.activityShow=!1,this.$refs[e].resetFields()},modalPicTap:function(){var e=this;this.$modalUpload((function(t){e.authorizedPicture=t[0]}),"")},cancelSubmit:function(){this.formItem={title:"",type_name:"",msg:"",content:[]},this.addModel=!1,this.$refs.formValidate.resetFields()},addSubmit:function(){var e=this;this.$refs.formValidate.validate((function(t){var a=Object(i["a"])(Object(i["a"])({},e.formItem),{},{is_required:0,is_used:0,is_show:0});switch(a.type){case"input":a.type_name="文本";break;case"int":a.type_name="数字";break;case"date":a.type_name="日期";break;case"radio":a.type_name="单选项";break;case"id_card":a.type_name="身份证";break;case"email":a.type_name="邮件";break;case"phone":a.type_name="手机号";break;case"address":a.type_name="地址";break}var l=[];e.listOne.forEach((function(e){l.push(e.info)})),t&&(-1==l.indexOf(a.title)?(Object(r["c"])(a).then((function(t){e.$message.success(t.message),e.settingUser()})).catch((function(t){e.$message.error(t.message)})),e.cancelSubmit()):e.$message.error("该信息已经添加过"))}))},delInfo:function(e){var t=this;this.$modalSure("确定删除该条数据").then((function(){Object(r["ub"])(e).then((function(e){t.$message.success(e.message),t.settingUser()})).catch((function(e){t.$message.error(e.message)}))}))},addlabel:function(){if(this.single){var e=this.formItem.content.indexOf(this.single);-1===e&&this.formItem.content.push(this.single),this.single=""}},handleSubmit:function(){var e=this,t={avatar:this.authorizedPicture,user_extend_info:this.listOne};Object(r["fb"])(t).then((function(t){e.$message.success(t.message)}))},handleClose:function(e,t){var a=this.formItem.content.indexOf(t);this.formItem.content.splice(a,1)}}},u=c,d=(a("424c"),a("2877")),m=Object(d["a"])(u,l,s,!1,null,"4af2ba1a",null);t["default"]=m.exports},"424c":function(e,t,a){"use strict";a("4419")},4419:function(e,t,a){}}]);