1 line
31 KiB
JavaScript
1 line
31 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["q"],{"1f3d":function(e,t,l){"use strict";l("55ae")},"21fd":function(e,t,l){},"23f7":function(e,t,l){"use strict";var s=function(){var e=this,t=e._self._c;return t("el-popover",{ref:"nodTree",staticClass:"nodTree"},[t("el-input",{attrs:{slot:"reference",placeholder:e.placeholder,readonly:""},nativeOn:{keydown:function(t){return e.inputEvent.apply(null,arguments)}},slot:"reference",model:{value:e.label,callback:function(t){e.label=t},expression:"label"}},[t("template",{slot:"suffix"},[t("i",{class:["el-input__icon",""!=e.label?"el-icon-circle-close":"el-icon-arrow-down"],on:{click:function(t){return t.stopPropagation(),e.delModel.apply(null,arguments)}}})])],2),t("el-tree",{ref:"tree",attrs:{data:e.treeData,props:e.treeProps,"node-key":e.treeKey,"current-node-key":e.checked,"show-checkbox":e.checkbox,"check-strictly":e.checkStrictly,"default-checked-keys":e.checkeds,"default-expanded-keys":e.expanded,"highlight-current":!0},on:{check:e.setTree,"node-click":e.setTree}})],1)},i=[],a=l("b85c"),o=(l("7db0"),l("a15b"),l("14d9"),l("b0c0"),l("d3b7"),{name:"NodTree",props:{value:{required:!0},treeData:{required:!0,type:Array},treeKey:{default:"id"},treeProps:{default:function(){return{label:"name",children:"sub"}}},placeholder:{default:"请点击选择数据"},checkStrictly:{default:!1}},data:function(){return{label:"",checked:null,checkeds:[],expanded:[],checkbox:!1}},created:function(){this.init()},computed:{flatTree:function(){var e=this.$lib.flatten(this.treeData);return e}},watch:{value:{handler:function(e){this.checkbox?this.$lib.comparison(e,this.checkeds)&&(this.checkeds=e,this.$refs.tree.setCheckedKeys(e,!0)):e!=this.checked&&(this.checked=e,this.$refs.tree.setCurrentKey(e))},deep:!0},checked:function(){this.setInput()},checkeds:{handler:function(){this.setInput()},deep:!0}},methods:{init:function(){var e=this;if(null!=this.value){Array.isArray(this.value)?(this.checkbox=!0,this.checkeds=this.value):(this.checkbox=!1,this.checked=this.value);var t,l=Object(a["a"])(this.checkbox?this.checkeds:[this.checked]);try{var s=function(){var l=t.value,s=e.flatTree.find((function(e){return e.id==l}));void 0!=s&&s.hasOwnProperty("pid")&&e.expanded.push(s.pid)};for(l.s();!(t=l.n()).done;)s()}catch(i){l.e(i)}finally{l.f()}}},setInput:function(){var e,t=this,l=[],s=Object(a["a"])(this.checkbox?this.checkeds:[this.checked]);try{var i=function(){var s=e.value,i=t.flatTree.find((function(e){return e.id==s}));void 0==i||l.push(i.name)};for(s.s();!(e=s.n()).done;)i()}catch(o){s.e(o)}finally{s.f()}this.label=l.join(",")},setTree:function(e){this.checkbox?(this.checkeds=this.$refs.tree.getCheckedKeys(),this.$emit("input",this.checkeds)):(this.checked=e.id,this.$emit("input",this.checked),this.$refs["nodTree"].showPopper=!1)},delModel:function(){this.label="",this.checkbox?(this.checkeds=[],this.$refs.tree.setCheckedKeys([])):(this.checked=null,this.$refs.tree.setCurrentKey(null)),this.$emit("input",this.checkbox?[]:null),this.$refs["nodTree"].showPopper=!1},inputEvent:function(e){this.$refs["nodTree"].showPopper&&27==e.keyCode&&e.stopPropagation()}}}),r=o,n=(l("d683"),l("2877")),c=Object(n["a"])(r,s,i,!1,null,"9f20837e",null);t["a"]=c.exports},5549:function(e,t,l){"use strict";l("b0c0");var s=function(){var e=this,t=e._self._c;return t("el-dropdown",{staticClass:"nodUpload",attrs:{"split-button":"",placement:"bottom-start"}},[t("el-upload",{attrs:{action:e.action,headers:{Token:e.$store.state.token},"show-file-list":!1,"on-success":e.uploadSuccess}},[t("i",{staticClass:"text el-icon-upload"},[e._v(" 点击上传")])]),t("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[e.files.length>0?[e._l(e.files,(function(l,s){return[t("li",[t("el-row",[t("el-col",{attrs:{span:22}},[t("p",{staticClass:"file",on:{click:function(t){return e.preview(l)}}},[e._v(e._s(l.name))])]),t("el-col",{attrs:{span:2}},[t("i",{staticClass:"el-icon-delete",on:{click:function(t){return e.remove(s)}}})])],1)],1)]}))]:[t("li",{staticClass:"empty"},[e._v("暂无文件信息")])]],2)],1)},i=[],a=(l("99af"),l("14d9"),l("a434"),{name:"NodUpload",props:{value:{required:!0,type:Array},action:{required:!0}},data:function(){return{files:[]}},created:function(){this.files=[].concat(this.value)},watch:{value:{handler:function(e){this.$lib.comparison(e,this.files)||(this.files=[].concat(e))},deep:!0}},methods:{uploadSuccess:function(e,t){"success"==e.state?(this.files.push({name:t.name,url:e.info}),this.incident(),this.$message({type:"success",message:"[ "+t.name+" ] 上传成功!"})):"error"==e.state?this.$message({type:"warning",message:"[ "+t.name+" ]"+e.info}):this.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})},remove:function(e){this.files.splice(e,1),this.incident()},incident:function(){this.$emit("input",this.files),this.$emit("change",this.files)},preview:function(e){this.$message({type:"success",message:"[ "+e.name+" ] 下载请求中..."}),setTimeout((function(){window.open(e.url)}),1e3)}}}),o=a,r=(l("fbb4"),l("2877")),n=Object(r["a"])(o,s,i,!1,null,"7b62d576",null);t["a"]=n.exports},"55ae":function(e,t,l){},"5fb4":function(e,t,l){"use strict";var s=function(){var e=this,t=e._self._c;return e.fields.length>0?t("draggable",{staticClass:"fieldForm",attrs:{list:e.fields,disabled:!e.drag,tag:"div"},on:{choose:e.dragChoose,end:e.dragEnd}},[e._l(e.fields,(function(l,s){return[t("el-form-item",{key:s,attrs:{label:l.label,prop:e.prefix+l.prop,rules:l.rules}},["text"==l.type?[t("el-input",{attrs:{type:"text",placeholder:l.placeholder},model:{value:e.source[l.model],callback:function(t){e.$set(e.source,l.model,t)},expression:"source[field.model]"}})]:e._e(),"time"==l.type?[t("el-date-picker",{attrs:{type:"date",placeholder:l.placeholder,"value-format":"yyyy-MM-dd"},model:{value:e.source[l.model],callback:function(t){e.$set(e.source,l.model,t)},expression:"source[field.model]"}})]:e._e(),"textarea"==l.type?[t("el-input",{attrs:{type:"textarea",placeholder:l.placeholder},model:{value:e.source[l.model],callback:function(t){e.$set(e.source,l.model,t)},expression:"source[field.model]"}})]:e._e(),"select"==l.type?[t("el-select",{attrs:{placeholder:l.placeholder,clearable:""},model:{value:e.source[l.model],callback:function(t){e.$set(e.source,l.model,t)},expression:"source[field.model]"}},e._l(l.options,(function(e){return t("el-option",{key:e,attrs:{label:e,value:e}})})),1)]:e._e(),"checkbox"==l.type?[t("el-checkbox-group",{model:{value:e.source[l.model],callback:function(t){e.$set(e.source,l.model,t)},expression:"source[field.model]"}},e._l(l.checkboxs,(function(e){return t("el-checkbox",{key:e,attrs:{label:e}})})),1)]:e._e(),"upload"==l.type?[t("NodUpload",{attrs:{action:e.$base.web+"service/fieldUpload"},model:{value:e.source[l.model],callback:function(t){e.$set(e.source,l.model,t)},expression:"source[field.model]"}})]:e._e()],2)]}))],2):e._e()},i=[],a=l("b85c"),o=l("b76a"),r=l.n(o),n=l("5549"),c={name:"FieldForm",components:{draggable:r.a,NodUpload:n["a"]},props:{value:{required:!0,type:Object},prefix:{default:""},rule:{required:!0},drag:{default:!1}},data:function(){return{source:{},fields:[]}},computed:{store:function(){return this.$store.state}},watch:{value:{handler:function(e){this.$lib.comparison(e,this.source)||this.init()},deep:!0},source:{handler:function(e){this.$emit("input",this.$lib.extend(!0,{},this.source))},deep:!0}},created:function(){Array.isArray(this.rule)?(this.fields=this.rule,this.init()):this.store.fields.hasOwnProperty(this.rule)&&(this.fields=this.store.fields[this.rule],this.init())},methods:{init:function(){var e,t={},l={},s=Object(a["a"])(this.fields);try{for(s.s();!(e=s.n()).done;){var i=e.value;t[i.model]=i.value,this.value.hasOwnProperty(i.model)&&!this.$lib.VariableEqual(i.value,this.value[i.model])&&(l[i.model]=i.value)}}catch(o){s.e(o)}finally{s.f()}this.source=this.$lib.extend(!0,{},t,this.value,l)},dragChoose:function(e){this.$emit("dragChoose",e.oldIndex)},dragEnd:function(e){this.$emit("dragEnd",e.newIndex)}}},u=c,d=l("2877"),f=Object(d["a"])(u,s,i,!1,null,null,null);t["a"]=f.exports},"8fe5":function(e,t,l){"use strict";l.r(t);l("4e82"),l("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"menu area"},[t("div",{staticClass:"layout"},[t("el-button-group",[t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")]),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],1)],1),t("el-divider"),t("el-table",{attrs:{data:e.tableData,height:"calc(100% - 60px)","tree-props":{children:"sub"},"row-key":"id",border:""}},[t("el-table-column",{attrs:{prop:"name",label:"菜单名称",width:"220px"}}),t("el-table-column",{attrs:{prop:"key",label:"菜单标识",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.model",label:"菜单类型",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"extension.type",label:"菜单类型",align:"center",width:"120px"}}),t("el-table-column",{attrs:{prop:"resource",label:"菜单地址",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"sort",label:"菜单排序",align:"center",width:"90px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(l){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(l.row.id)}}},[e._v("详情")]),t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del(l.row.id)}}},[e._v("删除")])],1)]}}])})],1),t("el-dialog",{directives:[{name:"madeDialog",rawName:"v-madeDialog"}],attrs:{visible:e.dialog,title:"详情",width:"420px"},on:{"update:visible":function(t){e.dialog=t}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog?[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"菜单名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入菜单名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"菜单标识",prop:"key"}},[t("el-input",{attrs:{placeholder:"请输入菜单标识"},model:{value:e.form.key,callback:function(t){e.$set(e.form,"key",t)},expression:"form.key"}})],1),t("el-form-item",{attrs:{label:"所属菜单",prop:"pid"}},[t("nodTree",{attrs:{treeData:e.treeData,placeholder:"请选择所属菜单"},model:{value:e.form.pid,callback:function(t){e.$set(e.form,"pid",t)},expression:"form.pid"}})],1),t("el-form-item",{attrs:{label:"菜单模式"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择菜单模式"},model:{value:e.form.model,callback:function(t){e.$set(e.form,"model",t)},expression:"form.model"}},[t("el-option",{attrs:{label:"标签模式",value:0}}),t("el-option",{attrs:{label:"新页模式",value:1}})],1)],1),t("el-form-item",{attrs:{label:"菜单类型"}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择菜单类型"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},[t("el-option",{attrs:{label:"独立菜单",value:0}}),t("el-option",{attrs:{label:"附属菜单",value:1}})],1)],1),t("el-form-item",{attrs:{label:"菜单地址"}},[t("el-input",{attrs:{placeholder:"请输入菜单地址"},model:{value:e.form.resource,callback:function(t){e.$set(e.form,"resource",t)},expression:"form.resource"}})],1),t("el-form-item",{attrs:{label:"菜单排序",prop:"sort"}},[t("el-input",{attrs:{placeholder:"请输入菜单排序"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),t("el-form-item",{attrs:{label:"菜单图标"}},[t("el-input",{attrs:{placeholder:"请输入菜单图标"},model:{value:e.form.ico,callback:function(t){e.$set(e.form,"ico",t)},expression:"form.ico"}})],1),t("el-form-item",{attrs:{label:"权限标识"}},[t("el-input",{attrs:{placeholder:"请输入权限标识"},model:{value:e.form.root,callback:function(t){e.$set(e.form,"root",t)},expression:"form.root"}})],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息"},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])],1)],1)],1)},i=[],a=(l("d9e2"),l("23f7")),o={name:"Menu",components:{NodTree:a["a"]},data:function(){var e=this;return{tableData:[],dialog:!1,form:{id:0,name:"",key:"",pid:null,model:0,type:0,resource:"",sort:0,ico:"",root:"",data:""},rules:{name:{required:!0,message:"请输入菜单名称",trigger:"blur"},key:{required:!0,message:"请输入菜单标识",trigger:"blur"},pid:{required:!0,message:"请选择所属菜单",trigger:"change"},sort:[{required:!0,message:"请输入菜单排序",trigger:"blur"},{validator:function(t,l,s){e.$lib.validate("number",l)?s():s(new Error("菜单排序不正确"))},trigger:"blur"}]}}},created:function(){this.record()},computed:{treeData:function(){return[{id:0,name:"默认菜单",sub:this.tableData}]}},methods:{record:function(){var e=this;this.$axios.post("menu/record").then((function(t){"success"==t.state?e.tableData=t.info:"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=Object.assign({},this.$options.data().form),e>0?this.$axios.post("menu/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){t&&e.$axios.post("menu/save",e.form).then((function(t){"success"==t.state?(e.record(),e.dialog=!1,e.$lib.updateStore(e),e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}))},del:function(e){var t=this;this.$confirm("您确定要删除该数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("menu/del",{id:e}).then((function(e){"success"==e.state?(t.record(),t.$lib.updateStore(t),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},r=o,n=(l("c33f"),l("2877")),c=Object(n["a"])(r,s,i,!1,null,"0c7ba82f",null);t["default"]=c.exports},a4ff:function(e,t,l){"use strict";l.r(t);l("b0c0");var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"field area"},[t("div",{staticClass:"layout"},[t("el-popover",{ref:"searchPopover",attrs:{"popper-class":"searchPopover",placement:"bottom-start"}},[t("el-form",{ref:"searchFrom",staticClass:"searchFrom",attrs:{inline:""}},[t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入模块名称",clearable:""},model:{value:e.searchFrom.name,callback:function(t){e.$set(e.searchFrom,"name",t)},expression:"searchFrom.name"}})],1),t("el-form-item",[t("el-input",{attrs:{placeholder:"请输入模块标识",clearable:""},model:{value:e.searchFrom.key,callback:function(t){e.$set(e.searchFrom,"key",t)},expression:"searchFrom.key"}})],1),t("el-divider"),t("el-button",{staticClass:"searchBtn",attrs:{icon:"el-icon-search"},on:{click:function(t){return e.record(1)}}})],1),t("el-button",{attrs:{slot:"reference",icon:"el-icon-more"},slot:"reference"})],1),t("el-button-group",[0!=e.tableSelection.length?t("el-button",{attrs:{type:"info"},on:{click:function(t){return e.del(e.tableSelection)}}},[e._v("删除")]):e._e(),t("el-button",{on:{click:function(t){return e.set(0)}}},[e._v("新增")]),t("el-button",{on:{click:e.reload}},[e._v("刷新")])],1)],1),t("el-divider"),t("el-table",{directives:[{name:"madeTable",rawName:"v-madeTable"}],attrs:{data:e.tableData,height:"calc(100% - 90px)",border:""},on:{"selection-change":e.selectionChange}},[t("el-table-column",{attrs:{type:"selection",align:"center",width:"39px",fixed:"left"}}),t("el-table-column",{attrs:{prop:"name",label:"模块名称",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"extension.key",label:"模块标识",align:"center",width:"160px"}}),t("el-table-column",{attrs:{prop:"data",label:"备注信息",align:"center",width:"200px"}}),t("el-table-column",{attrs:{prop:"set",label:"相关操作",align:"center",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(l){return[t("el-button-group",[t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.set(l.row.id)}}},[e._v("详情")]),t("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.del([l.row.id])}}},[e._v("删除")])],1)]}}])})],1),t("el-pagination",{staticClass:"tablePagination",attrs:{"current-page":e.page.current,total:e.page.total,"page-size":e.page.size,"page-sizes":e.page.sizes,"pager-count":e.page.count,layout:"prev,pager,next,jumper,sizes,total"},on:{"update:currentPage":function(t){return e.$set(e.page,"current",t)},"update:current-page":function(t){return e.$set(e.page,"current",t)},"update:pageSize":function(t){return e.$set(e.page,"size",t)},"update:page-size":function(t){return e.$set(e.page,"size",t)},"size-change":function(t){return e.record(1)},"current-change":function(t){return e.record(0)}}}),t("el-dialog",{attrs:{visible:e.dialog,title:"详情",fullscreen:!0},on:{"update:visible":function(t){e.dialog=t}}},[t("transition",{attrs:{name:"el-fade-in"}},[e.dialog?[t("el-row",{attrs:{gutter:12}},[t("el-col",{attrs:{md:6}},[t("el-card",[t("div",{attrs:{slot:"header"},slot:"header"},[t("span",[e._v("模块信息")])]),t("div",{staticClass:"cardMain"},[t("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[t("el-form-item",{attrs:{label:"模块名称",prop:"name"}},[t("el-input",{attrs:{placeholder:"请输入模块名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("el-form-item",{attrs:{label:"模块标识",prop:"key"}},[t("el-select",{attrs:{placeholder:"模块标识"},model:{value:e.form.key,callback:function(t){e.$set(e.form,"key",t)},expression:"form.key"}},[t("el-option",{attrs:{label:"用户管理",value:"user"}}),t("el-option",{attrs:{label:"人员管理",value:"people"}}),t("el-option",{attrs:{label:"客户管理",value:"customer"}}),t("el-option",{attrs:{label:"供应商管理",value:"supplier"}}),t("el-option",{attrs:{label:"商品管理",value:"goods"}}),t("el-option",{attrs:{label:"采购订单",value:"bor"}}),t("el-option",{attrs:{label:"采购单",value:"buy"}}),t("el-option",{attrs:{label:"采购退货单",value:"bre"}}),t("el-option",{attrs:{label:"销售订单",value:"sor"}}),t("el-option",{attrs:{label:"销售单",value:"sell"}}),t("el-option",{attrs:{label:"销售退货单",value:"sre"}}),t("el-option",{attrs:{label:"调拨单",value:"swap"}}),t("el-option",{attrs:{label:"其它入库单",value:"entry"}}),t("el-option",{attrs:{label:"其它出库单",value:"extry"}}),t("el-option",{attrs:{label:"收款单",value:"imy"}}),t("el-option",{attrs:{label:"付款单",value:"omy"}}),t("el-option",{attrs:{label:"核销单",value:"bill"}}),t("el-option",{attrs:{label:"转账单",value:"allot"}}),t("el-option",{attrs:{label:"其它收入单",value:"ice"}}),t("el-option",{attrs:{label:"其它支出单",value:"oce"}})],1)],1),t("el-form-item",{attrs:{label:"备注信息"}},[t("el-input",{attrs:{placeholder:"请输入备注信息"},model:{value:e.form.data,callback:function(t){e.$set(e.form,"data",t)},expression:"form.data"}})],1)],1),t("el-divider",{attrs:{"content-position":"left"}},[e._v("字段类型")]),t("el-tag",{on:{click:function(t){return e.addField("text")}}},[e._v("普通文本")]),t("el-tag",{on:{click:function(t){return e.addField("time")}}},[e._v("时间文本")]),t("el-tag",{on:{click:function(t){return e.addField("textarea")}}},[e._v("多行文本")]),t("el-tag",{on:{click:function(t){return e.addField("select")}}},[e._v("单选菜单")]),t("el-tag",{on:{click:function(t){return e.addField("checkbox")}}},[e._v("多选菜单")]),t("el-tag",{on:{click:function(t){return e.addField("upload")}}},[e._v("附件数据")])],1)])],1),t("el-col",{attrs:{md:10}},[t("el-card",{staticClass:"fieldList"},[t("div",{attrs:{slot:"header"},slot:"header"},[t("span",[e._v("字段列表")])]),t("div",{staticClass:"cardMain fieldMain"},[t("el-form",{ref:"diyFrom",attrs:{model:e.more,"label-width":"80px",disabled:""}},[t("FieldForm",{attrs:{rule:e.form.fields,drag:!0},on:{dragChoose:e.itemChoice,dragEnd:e.itemChoice},model:{value:e.more,callback:function(t){e.more=t},expression:"more"}})],1)],1)])],1),t("el-col",{attrs:{md:8}},[t("el-card",[t("div",{attrs:{slot:"header"},slot:"header"},[t("span",[e._v("字段属性")])]),t("div",{staticClass:"cardMain"},[null==e.field.index?t("p",{staticClass:"fieldTip"},[e._v(" Yo.选择字段后即可显示配置信息 ")]):t("el-form",{attrs:{"label-width":"80px"}},[t("el-form-item",{attrs:{label:"标题名称"}},[t("el-input",{attrs:{placeholder:"请输入标题名称"},on:{input:e.validateChange},model:{value:e.field.source.label,callback:function(t){e.$set(e.field.source,"label",t)},expression:"field.source.label"}})],1),t("el-form-item",{attrs:{label:"数据标识"}},[t("el-input",{attrs:{placeholder:"请输入数据标识",value:e.field.source.model},on:{input:e.modelValue}})],1),-1!=["text","time","textarea"].indexOf(e.field.source.type)?t("el-form-item",{attrs:{label:"默认内容"}},[t("el-input",{attrs:{placeholder:"请输入默认内容"},on:{input:e.inputChange},model:{value:e.field.source.value,callback:function(t){e.$set(e.field.source,"value",t)},expression:"field.source.value"}})],1):e._e(),"select"==e.field.source.type?t("el-form-item",{staticClass:"chooseGroup",attrs:{label:"选项数据"}},[t("i",{staticClass:"el-icon-circle-plus-outline",staticStyle:{width:"100%"},on:{click:e.selectAdd}},[e._v(" 新增选项")]),t("el-radio-group",{model:{value:e.field.source.value,callback:function(t){e.$set(e.field.source,"value",t)},expression:"field.source.value"}},[e._l(e.field.source.options,(function(l,s){return[t("div",{staticClass:"choose"},[t("el-radio",{attrs:{label:l},nativeOn:{click:function(t){return t.preventDefault(),e.selectChoice(l)}}},[t("b")]),t("el-input",{attrs:{placeholder:"请输入选项名称",value:l,size:"mini"},on:{input:function(t){return e.selectValue(t,s)}},nativeOn:{keydown:function(e){e.stopPropagation()}}},[t("template",{slot:"append"},[t("i",{staticClass:"el-icon-remove-outline",on:{click:function(t){return e.selectDel(s)}}})])],2)],1)]}))],2)],1):e._e(),"checkbox"==e.field.source.type?t("el-form-item",{staticClass:"chooseGroup",attrs:{label:"选项数据"}},[t("i",{staticClass:"el-icon-circle-plus-outline",staticStyle:{width:"100%"},on:{click:e.checkboxAdd}},[e._v(" 新增选项")]),t("el-checkbox-group",{on:{change:e.checkboxChange},model:{value:e.field.source.value,callback:function(t){e.$set(e.field.source,"value",t)},expression:"field.source.value"}},[e._l(e.field.source.checkboxs,(function(l,s){return[t("div",{staticClass:"choose"},[t("el-checkbox",{attrs:{label:l}},[t("b")]),t("el-input",{attrs:{placeholder:"请输入选项名称",value:l,size:"mini"},on:{input:function(t){return e.checkboxValue(t,s)}}},[t("template",{slot:"append"},[t("i",{staticClass:"el-icon-remove-outline",on:{click:function(t){return e.checkboxDel(s)}}})])],2)],1)]}))],2)],1):e._e(),-1!=["text","time","textarea","select"].indexOf(e.field.source.type)?t("el-form-item",{attrs:{label:"提示信息"}},[t("el-input",{attrs:{placeholder:"请输入提示信息"},model:{value:e.field.source.placeholder,callback:function(t){e.$set(e.field.source,"placeholder",t)},expression:"field.source.placeholder"}})],1):e._e(),t("el-form-item",{attrs:{label:"是否必填"}},[t("el-checkbox",{on:{change:e.validateChange},model:{value:e.field.source.validate,callback:function(t){e.$set(e.field.source,"validate",t)},expression:"field.source.validate"}})],1),t("el-button",{attrs:{icon:"el-icon-delete"},on:{click:e.delField}},[e._v("删除")])],1)],1)])],1)],1)]:e._e()],2),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialog=!1}}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])],1)],1)],1)},i=[],a=l("b85c"),o=(l("c740"),l("14d9"),l("a434"),l("d3b7"),l("159b"),l("5fb4")),r={name:"Field",components:{FieldForm:o["a"]},data:function(){return{searchFrom:{name:"",key:""},tableData:[],tableSelection:[],page:{current:1,total:0,size:30,sizes:[30,60,90,150,300],count:5},dialog:!1,form:{id:0,name:"",key:"",data:"",fields:[]},rules:{name:{required:!0,message:"请输入模块名称",trigger:"blur"},key:{required:!0,message:"请输入模块标识",trigger:"blur"}},field:{index:null,source:{}},more:{}}},created:function(){this.record(1)},methods:{record:function(e){var t=this;0==e||(this.page.current=e);var l=Object.assign({page:this.page.current,limit:this.page.size},this.searchFrom);this.$axios.post("field/record",l).then((function(e){"success"==e.state?(t.page.total=e.count,t.tableData=e.info,t.$refs["searchPopover"].showPopper=!1):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))},set:function(e){var t=this;this.form=this.$lib.extend(!0,{},this.$options.data().form),this.field={index:null,source:{}},this.more={},e>0?this.$axios.post("field/get",{id:e}).then((function(e){"success"==e.state?(t.form=e.info,t.dialog=!0):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})})):this.dialog=!0},save:function(){var e=this;this.$refs["form"].validate((function(t){t&&e.$axios.post("field/save",e.form).then((function(t){"success"==t.state?(e.record(0),e.dialog=!1,e.$lib.updateStore(e),e.$message({type:"success",message:"详情保存成功!"})):"error"==t.state?e.$message({type:"warning",message:t.info}):e.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))}))},del:function(e){var t=this;this.$confirm("您确定要删除选中数据吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.$axios.post("field/del",{parm:e}).then((function(e){"success"==e.state?(t.record(0),t.$message({type:"success",message:"删除成功!"})):"error"==e.state?t.$message({type:"warning",message:e.info}):t.$message({type:"error",message:"[ ERROR ] 服务器响应超时!"})}))})).catch((function(){}))},selectionChange:function(e){var t,l=[],s=Object(a["a"])(e);try{for(s.s();!(t=s.n()).done;){var i=t.value;l.push(i.id)}}catch(o){s.e(o)}finally{s.f()}this.tableSelection=l},addField:function(e){var t=this,l={},s=1;while(this.more.hasOwnProperty("key"+s))s++;var i="key"+s;"text"==e?l={type:"text",model:i,label:"普通文本",value:"",placeholder:"",prop:i,validate:!1,rules:[]}:"time"==e?l={type:"time",model:i,label:"时间文本",value:"",placeholder:"",prop:i,validate:!1,rules:[]}:"textarea"==e?l={type:"textarea",model:i,label:"多行文本",value:"",placeholder:"",prop:i,validate:!1,rules:[]}:"select"==e?l={type:"select",model:i,label:"单选菜单",value:"",placeholder:"",options:["选项1","选项2"],prop:i,validate:!1,rules:[]}:"checkbox"==e?l={type:"checkbox",model:i,label:"多选菜单",value:[],checkboxs:["选项1","选项2"],prop:i,validate:!1,rules:[]}:"upload"==e&&(l={type:"upload",model:i,label:"附件数据",value:[],prop:i,validate:!1,rules:[]}),this.$set(this.more,l.model,l.value),this.form.fields.push(l),this.$nextTick((function(){t.itemChoice(t.form.fields.length-1)}))},delField:function(){delete this.more[this.field.source.model],this.form.fields.splice(this.field.index,1),this.field={index:null,source:{}},document.querySelectorAll(".fieldList .el-form-item").forEach((function(e){e.classList.remove("isItem")}))},itemChoice:function(e){this.field.index=e,this.field.source=this.$lib.extend(!0,{},this.form.fields[e]);var t=document.querySelectorAll(".fieldList .el-form-item");t.forEach((function(e){e.classList.remove("isItem")})),t[e].classList.add("isItem")},modelValue:function(e){if(this.$lib.validate("variable",e)){var t=this.form.fields.findIndex((function(t){return t.model==e}));-1==t?(delete this.more[this.field.source.model],this.$set(this.more,e,this.field.source.value),this.field.source.model=e,this.field.source.prop=e,this.$set(this.form.fields,this.field.index,this.field.source)):this.$message({type:"warning",message:"数据标识重复,修改已撤销!"})}else this.$message({type:"warning",message:"数据标识错误,修改已撤销!"})},validateChange:function(){var e=this.field.source;e.validate?-1!=["text","time","textarea"].indexOf(e.type)?e.rules={required:!0,message:"请输入"+e.label,trigger:"blur"}:-1!=["select","checkbox"].indexOf(e.type)?e.rules={required:!0,message:"请选择"+e.label,trigger:"change"}:"upload"==e.type?e.rules={required:!0,message:"请上传"+e.label}:e.rules=[]:e.rules=[],this.$set(this.form.fields,this.field.index,e)},inputChange:function(){this.more[this.field.source.model]=this.field.source.value,this.$set(this.form.fields,this.field.index,this.field.source)},selectAdd:function(){var e=1;while(-1!=this.field.source.options.indexOf("选项"+e))e++;this.field.source.options.push("选项"+e),this.$set(this.form.fields,this.field.index,this.field.source)},selectDel:function(e){var t=this.field.source;t.options[e]==t.value&&(t.value="",this.more[t.model]=""),t.options.splice(e,1),this.$set(this.form.fields,this.field.index,t)},selectChoice:function(e){var t=this.field.source;t.value=t.value==e?"":e,this.more[t.model]=t.value,this.$set(this.form.fields,this.field.index,t)},selectValue:function(e,t){var l=this.field.source;-1==l.options.indexOf(e)?(l.value==l.options[t]&&(l.value=e,this.more[l.model]=e),this.$set(l.options,t,e),this.$set(this.form.fields,this.field.index,l)):this.$message({type:"warning",message:"选项内容重复,修改已撤销!"})},checkboxAdd:function(){var e=1;while(-1!=this.field.source.checkboxs.indexOf("选项"+e))e++;this.field.source.checkboxs.push("选项"+e),this.$set(this.form.fields,this.field.index,this.field.source)},checkboxDel:function(e){var t=this.field.source,l=t.value.indexOf(t.checkboxs[e]);-1!=l&&(t.value.splice(l,1),this.more[t.model]=t.value),t.checkboxs.splice(e,1),this.$set(this.form.fields,this.field.index,t)},checkboxChange:function(e){var t=this.field.source;this.more[t.model]=e,this.$set(this.form.fields,this.field.index,t)},checkboxValue:function(e,t){var l=this.field.source;if(-1==l.checkboxs.indexOf(e)){var s=l.value.indexOf(l.checkboxs[t]);-1!=s&&(this.$set(l.value,s,e),this.more[l.model]=l.value),this.$set(l.checkboxs,t,e),this.$set(this.form.fields,this.field.index,l)}else this.$message({type:"warning",message:"选项内容重复,修改已撤销!"})},reload:function(){this.$bus.emit("homeReload",this.$options.name),this.$message({type:"success",message:"页面刷新成功!"})}}},n=r,c=(l("1f3d"),l("2877")),u=Object(c["a"])(n,s,i,!1,null,"9d808796",null);t["default"]=u.exports},c33f:function(e,t,l){"use strict";l("f72f")},d297:function(e,t,l){},d683:function(e,t,l){"use strict";l("d297")},f72f:function(e,t,l){},fbb4:function(e,t,l){"use strict";l("21fd")}}]); |