chunk-168540e9.51d35be9.js 13 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-168540e9","chunk-ca61e3fe"],{"3e3e":function(e,t,a){"use strict";a.d(t,"d",(function(){return l})),a.d(t,"a",(function(){return n})),a.d(t,"e",(function(){return r})),a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return s}));var o=a("b775");function l(e){return Object(o["a"])({url:"/params/search",method:"post",data:e})}function n(e){return Object(o["a"])({url:"/params/create",method:"post",data:e})}function r(e){return Object(o["a"])({url:"/params/update",method:"post",data:e})}function i(e){return Object(o["a"])({url:"/params/delete",method:"post",data:e})}function s(e){return Object(o["a"])({url:"/params/info",method:"post",data:e})}},"595f":function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"com-formual"},[1==e.type?a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.queryForm}},[a("el-form-item",{attrs:{label:"类型:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型",size:"large"},model:{value:e.queryForm.type,callback:function(t){e.$set(e.queryForm,"type",t)},expression:"queryForm.type"}},e._l(e.typeList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"变名称:"}},[a("el-input",{attrs:{placeholder:"请填写变量名称"},model:{value:e.queryForm.name,callback:function(t){e.$set(e.queryForm,"name",t)},expression:"queryForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onBtnSearch}},[a("svg-icon",{attrs:{"icon-class":"search"}}),e._v(" 搜索")],1),a("el-button",{attrs:{type:"primary"},on:{click:e.onBtnCreate}},[a("svg-icon",{attrs:{"icon-class":"plus"}}),e._v(" 新增变量")],1)],1)],1):e._e(),2==e.type?a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.queryForm}},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onBtnConst}},[a("svg-icon",{attrs:{"icon-class":"plus"}}),e._v(" 新增常量")],1)],1)],1):e._e(),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.dataList,"header-row-class-name":"headerBg","empty-text":"没有数据信息"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center"}}),a("el-table-column",{attrs:{prop:"code",label:"编码",align:"left"}}),a("el-table-column",{attrs:{prop:"name",label:"名称",align:"left"}}),1==e.type?a("el-table-column",{attrs:{prop:"value",label:"取值","show-overflow-tooltip":"",align:"left","min-width":"150"}}):e._e(),a("el-table-column",{attrs:{label:"操作",align:"center",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"btns"},[a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.btnPicked(t.row)}}},[a("svg-icon",{attrs:{"icon-class":"confirm"}}),e._v("使用")],1),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(a){return e.btnOnEdit(t.row.id,t.row)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),e._v("编辑")],1),a("el-button",{attrs:{type:"danger",size:"mini"},on:{click:function(a){return e.btnOnDelete(t.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),e._v("删除")],1)],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("el-pagination",{attrs:{currentPage:e.queryForm.page,"page-size":e.queryForm.pageSize,total:e.recordCount,"page-count":e.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":e.ChangePage}})],1),a("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:e.dialogVisible,"append-to-body":"",width:"300","close-on-click-modal":!1,"custom-class":"prod-verify",title:e.title},on:{"update:visible":function(t){e.dialogVisible=t},closed:e.handleDialogClosed}},[a("dataInfo",{ref:"dataInfoRef",attrs:{id:e.dataId,type:e.type},on:{onClose:e.onClose}})],1)],1)},l=[],n=(a("e9c4"),a("a9e3"),a("d3b7"),a("ac1f"),a("841c"),a("0643"),a("4e3e"),a("159b"),a("3e3e")),r=a("a888"),i=a("6242"),s={name:"searchParams",emits:["onPicked","onData"],directives:{elDragDialog:r["a"]},components:{dataInfo:i["default"]},props:{type:{type:Number,default:1}},watch:{type:{handler:function(e){console.log(e),this.queryForm.type=e,this.onBtnSearch()},immediate:!0,deep:!0},dataList:{handler:function(e,t){var a=this;e.forEach((function(e,o){JSON.stringify(e)!==JSON.stringify(t[o])&&a.$emit("onData",e)}))},deep:!0}},data:function(){return{dataId:0,dialogVisible:!1,title:"创建变量",queryForm:{page:1,pageSize:10,name:"",status:5,type:1},typeList:[{value:1,name:"变量"},{value:2,name:"常量"}],recordCount:0,pageTotal:1,dataList:[]}},mounted:function(){},methods:{handleDialogClosed:function(){this.$refs.dataInfoRef&&this.$refs.dataInfoRef.resetForm(),this.dataId=0},onClose:function(e){this.dialogVisible=!1,this.onBtnSearch(),this.handleDialogClosed()},btnOnEdit:function(e,t){var a=this;this.title=1==t.type?"修改变量":"修改常量",this.$nextTick((function(){a.dataId=e,a.dialogVisible=!0}))},btnOnDelete:function(e){var t=this,a={id:e};t.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(e){Object(n["b"])(a).then((function(e){t.search()}))})).catch((function(){}))},onBtnCreate:function(e){var t=this;t.dataId=0,t.title="创建变量",t.dialogVisible=!0},onBtnSearch:function(e){var t=this;t.queryForm.page=1,t.search()},btnPicked:function(e){this.$emit("onPicked",e)},search:function(){var e=this;Object(n["d"])(e.queryForm).then((function(t){t&&(e.dataList=t.data.dataList,e.recordCount=t.data.totalRecord,e.pageTotal=t.data.pageTotal)}))},ChangePage:function(e){var t=this;t.queryForm.page=e,t.search()},onBtnConst:function(){var e=this;e.dataId=0,e.type=2,e.title="创建常量",e.dialogVisible=!0}}},u=s,c=(a("f471"),a("2877")),d=Object(c["a"])(u,o,l,!1,null,null,null);t["default"]=d.exports},"5aaf":function(e,t,a){},6242:function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"data-info"},[a("el-card",[a("el-form",{ref:"dataFormRef",attrs:{model:e.dataForm,rules:e.dataRule,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"名称 :"}},[a("el-input",{model:{value:e.dataForm.name,callback:function(t){e.$set(e.dataForm,"name",t)},expression:"dataForm.name"}})],1),a("el-form-item",{attrs:{label:"取值类型:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择取值类型",size:"large",clearable:""},model:{value:e.dataForm.value_type,callback:function(t){e.$set(e.dataForm,"value_type",t)},expression:"dataForm.value_type"}},e._l(e.valueTypeList,(function(e){return a("el-option",{key:e.value,attrs:{label:e.name,value:e.value}})})),1)],1),1==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1):e._e(),2==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1):e._e(),3==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:",prop:"value"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1):e._e(),4==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:",prop:"value"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}},[a("template",{slot:"append"},[e._v("%")])],2)],1):e._e(),5==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值:",prop:"value"}},[a("el-input",{model:{value:e.dataForm.value,callback:function(t){e.$set(e.dataForm,"value",t)},expression:"dataForm.value"}})],1):e._e(),2==e.dataForm.value_type?a("el-form-item",{attrs:{label:"取值范围:"}},[a("el-select",{ref:"categorySelect",staticStyle:{width:"100%"},attrs:{multiple:"",filterable:"","allow-create":"","default-first-option":"",placeholder:"点击enter创建选择标签","popper-class":"custom-select-dropdown"},model:{value:e.dataForm.value_item,callback:function(t){e.$set(e.dataForm,"value_item",t)},expression:"dataForm.value_item"}})],1):e._e(),a("el-form-item",{attrs:{label:"介绍:"}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.dataForm.intro,callback:function(t){e.$set(e.dataForm,"intro",t)},expression:"dataForm.intro"}})],1),a("el-form-item",{attrs:{label:"状态:"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择状态",size:"large"},model:{value:e.dataForm.status,callback:function(t){e.$set(e.dataForm,"status",t)},expression:"dataForm.status"}},e._l(e.statusOptions,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:e.btnSave}},[e._v("确认保存")])],1)],1)},l=[],n=(a("d9e2"),a("a15b"),a("14d9"),a("b0c0"),a("a9e3"),a("b680"),a("ac1f"),a("00b4"),a("498a"),a("3e3e")),r=(a("323e"),{emits:["onClose"],props:{id:{type:Number,default:0},type:{type:Number,default:1}},watch:{type:{handler:function(e){null==e&&e<=0||(this.dataForm.type=e)},immediate:!0,deep:!0},id:{handler:function(e){console.log(e);var t=this;null==e||e<=0||t.getInfo(e)},immediate:!0,deep:!0},hideDropdown:function(e){var t=document.querySelector(".custom-select-dropdown");t&&(t.style.display=e?"none":"")}},data:function(){var e=this,t=function(t,a,o){if(5==e.dataForm.value_type){var l=/^\d+$/;l.test(a)?o():o(new Error("请输入整数"))}else if(4==e.dataForm.value_type){var n=/^(?:100|\d{1,2}(?:\.\d+)?)$/;n.test(a)?o():o(new Error("请输入有效的百分数(0-100%)"))}else if(3==e.dataForm.value_type){var r=/^\d+(\.\d+)?$/;r.test(a)?o():o(new Error("请输入有效的小数"))}};return{activeName:"base",currentCategory:[],valueTypeList:[{value:0,name:"请选择取值类型"},{value:1,name:"输入框"},{value:2,name:"下拉选择"},{value:3,name:"小数"},{value:4,name:"百分比"},{value:5,name:"整数"}],allCategories:[],typeList:[{value:1,name:"变量"},{value:2,name:"常量"}],dataForm:{id:0,type:1,name:"",value:"",value_type:0,value_item:" ",intro:"",status:5},statusOptions:[{value:"",label:"请选择状态"},{value:5,label:"使用中"},{value:6,label:"已停用"}],dataRule:{value:[{required:!0,message:"请输入取值",trigger:"blur"},{validator:t,trigger:"blur"}]},tags:[],shouldPreventDropdown:!0,hideDropdown:!1}},mounted:function(){},methods:{handleSelectFocus:function(e){this.$refs.categorySelect.blur()},createTag:function(){console.log("Enter key pressed, create a tag with:",this.dataForm.value_item),""!==this.dataForm.value_item.trim()&&(this.tags.push(this.dataForm.value_item.trim()),this.dataForm.value_item=""),console.log(this.tags)},resetForm:function(){var e=this;this.dataForm={id:0,type:this.type,name:"",value:"",value_type:0,value_item:"",intro:"",status:5},this.$nextTick((function(){e.$refs.dataFormRef&&e.$refs.dataFormRef.resetFields()}))},btnSave:function(e){var t=this;t.$refs.dataFormRef.validate((function(e){if(e){if(1==t.dataForm.value_type)t.dataForm.value_item=t.dataForm.value;else if(4==t.dataForm.value_type){var a=parseFloat(t.dataForm.value),o=a.toFixed(2)+"%";t.dataForm.value=o}else 2==t.dataForm.value_type&&(t.dataForm.value_item=t.dataForm.value_item.join(","));t.dataForm.code=t.dataForm.name,t.dataForm.id>0?Object(n["e"])(t.dataForm).then((function(e){200==e.status&&(t.resetForm(),t.$alert("信息更新成功"),t.$emit("onClose"))})):Object(n["a"])(t.dataForm).then((function(e){200==e.status&&(t.resetForm(),t.$alert("信息创建成功"),t.$emit("onClose"))})),t.$emit("onClose")}else console.log("错误")}))},getInfo:function(e){var t=this,a={id:e};Object(n["c"])(a).then((function(e){e&&200==e.status&&(t.dataForm=e.data,2==t.dataForm.value_type&&t.dataForm.value_item&&(t.dataForm.value_item=t.dataForm.value_item.split(",")))}))},onChangeStatus:function(e){this.dataForm.status=e},onChangeCategory:function(e){var t=this;t.dataForm.categoryId=e}}}),i=r,s=(a("89a9"),a("2877")),u=Object(s["a"])(i,o,l,!1,null,null,null);t["default"]=u.exports},"675b":function(e,t,a){},"89a9":function(e,t,a){"use strict";a("675b")},a888:function(e,t,a){"use strict";a("99af"),a("caad"),a("ac1f"),a("2532"),a("5319");var o={bind:function(e,t,a){var o=e.querySelector(".el-dialog__header"),l=e.querySelector(".el-dialog");o.style.cssText+=";cursor:move;",l.style.cssText+=";top:0px;";var n=function(){return window.document.currentStyle?function(e,t){return e.currentStyle[t]}:function(e,t){return getComputedStyle(e,!1)[t]}}();o.onmousedown=function(e){var t=e.clientX-o.offsetLeft,r=e.clientY-o.offsetTop,i=l.offsetWidth,s=l.offsetHeight,u=document.body.clientWidth,c=document.body.clientHeight,d=l.offsetLeft,m=u-l.offsetLeft-i,p=l.offsetTop,f=c-l.offsetTop-s,v=n(l,"left"),h=n(l,"top");v.includes("%")?(v=+document.body.clientWidth*(+v.replace(/\%/g,"")/100),h=+document.body.clientHeight*(+h.replace(/\%/g,"")/100)):(v=+v.replace(/\px/g,""),h=+h.replace(/\px/g,"")),document.onmousemove=function(e){var o=e.clientX-t,n=e.clientY-r;-o>d?o=-d:o>m&&(o=m),-n>p?n=-p:n>f&&(n=f),l.style.cssText+=";left:".concat(o+v,"px;top:").concat(n+h,"px;"),a.child.$emit("dragDialog")},document.onmouseup=function(e){document.onmousemove=null,document.onmouseup=null}}}},l=function(e){e.directive("el-drag-dialog",o)};window.Vue&&(window["el-drag-dialog"]=o,Vue.use(l)),o.install=l;t["a"]=o},f471:function(e,t,a){"use strict";a("5aaf")}}]);