chunk-4b044f07.5e04e735.js 12 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4b044f07"],{"0c51":function(t,e,a){"use strict";var r=a("a76c");a.n(r).a},"33b8":function(t,e,a){"use strict";a.r(e);var r=a("a34a"),i=a.n(r),o=a("2f62"),n=a("8593");function s(t,e,a,r,i,o,n){try{var s=t[o](n),l=s.value}catch(t){return void a(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function l(t){return function(){var e=this,a=arguments;return new Promise((function(r,i){var o=t.apply(e,a);function n(t){s(o,r,i,n,l,"next",t)}function l(t){s(o,r,i,n,l,"throw",t)}n(void 0)}))}}var u={name:"menusFrom",props:{groupId:{type:Number,default:0},titleFrom:{type:String,default:""},addId:{type:String,default:""}},data:function(){return{iconVal:"",grid:{xl:7,lg:7,md:12,sm:24,xs:24},modals:!1,modal12:!1,ruleValidate:{name:[{required:!0,message:"请输入数据组名称",trigger:"blur"}],config_name:[{required:!0,message:"请输入数据字段",trigger:"blur"}],info:[{required:!0,message:"请输入数据简介",trigger:"blur"}],names:[{required:!0,message:"请输入字段名称",trigger:"blur"}]},FromData:[],valids:!1,list2:[],formValidate:{name:"",config_name:"",info:"",typelist:[],cate_id:0}}},watch:{addId:function(t){"addId"===t&&(this.formValidate.typelist=[])}},methods:{addType:function(){this.formValidate.typelist.push({name:{value:""},title:{value:""},type:{value:""},param:{placeholder:"参数方式例如:\n1=>白色\n2=>红色\n3=>黑色",value:""}})},delGroup:function(t){this.formValidate.typelist.splice(t,1)},fromData:function(t){var e=this;Object(n.F)(t).then(function(){var t=l(i.a.mark((function t(a){return i.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.formValidate=a.data.info;case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},handleSubmit:function(t){var e=this,a={url:this.groupId?"/setting/group/".concat(this.groupId):"setting/group",method:this.groupId?"put":"post",datas:this.formValidate};this.$refs[t].validate((function(r){if(r){if(0===e.formValidate.typelist.length)return e.$Message.error("请添加字段名称:姓名!");Object(n.y)(a).then(function(){var a=l(i.a.mark((function a(r){return i.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:e.$Message.success(r.msg),e.modals=!1,e.$refs[t].resetFields(),e.formValidate.typelist=[],e.$emit("getList");case 5:case"end":return a.stop()}}),a)})));return function(t){return a.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))}else{if(!e.formValidate.name)return e.$Message.error("请添加数据组名称!");if(!e.formValidate.config_name)return e.$Message.error("请添加数据字段!");if(!e.formValidate.info)return e.$Message.error("请添加数据简介!")}}))},handleReset:function(){this.modals=!1,this.$refs.formValidate.resetFields(),this.$emit("clearFrom")}},created:function(){},mounted:function(){}},c=(a("0c51"),a("2877")),d=Object(c.a)(u,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Modal",{attrs:{width:"850","class-name":"vertical-center-modal",scrollable:"","footer-hide":"",closable:"",title:t.titleFrom,"mask-closable":!1,"z-index":1},on:{"on-cancel":t.handleReset},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[a("Form",{ref:"formValidate",attrs:{model:t.formValidate,"label-width":100,rules:t.ruleValidate},nativeOn:{submit:function(t){t.preventDefault()}}},[a("Row",{staticClass:"maxH",attrs:{type:"flex",gutter:24}},[a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"数据组名称:",prop:"name"}},[a("Input",{staticClass:"input-add",attrs:{placeholder:"请输入数据组名称"},model:{value:t.formValidate.name,callback:function(e){t.$set(t.formValidate,"name",e)},expression:"formValidate.name"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"数据字段:",prop:"config_name"}},[a("Input",{staticClass:"input-add",attrs:{placeholder:"请输入数据字段"},model:{value:t.formValidate.config_name,callback:function(e){t.$set(t.formValidate,"config_name",e)},expression:"formValidate.config_name"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"数据简介:",prop:"info"}},[a("Input",{staticClass:"input-add",attrs:{placeholder:"请输入数据简介"},model:{value:t.formValidate.info,callback:function(e){t.$set(t.formValidate,"info",e)},expression:"formValidate.info"}})],1)],1),a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{label:"数类型:",prop:"cate_id"}},[a("RadioGroup",{model:{value:t.formValidate.cate_id,callback:function(e){t.$set(t.formValidate,"cate_id",e)},expression:"formValidate.cate_id"}},[a("Radio",{attrs:{label:0}},[t._v("默认")]),a("Radio",{attrs:{label:1}},[t._v("数据")])],1)],1)],1),t._l(t.formValidate.typelist,(function(e,r){return a("Col",{key:r,attrs:{span:"24"}},[a("Col",t._b({},"Col",t.grid,!1),[a("FormItem",{attrs:{label:"字段"+(r+1)+":",prop:"typelist."+r+".name.value",rules:{required:!0,message:"请输入字段名称:姓名",trigger:"blur"}}},[a("Input",{attrs:{placeholder:"字段名称:姓名"},model:{value:e.name.value,callback:function(a){t.$set(e.name,"value",a)},expression:"item.name.value"}})],1)],1),a("Col",t._b({staticClass:"goupBox"},"Col",t.grid,!1),[a("FormItem",{attrs:{prop:"typelist."+r+".title.value",rules:{required:!0,message:"请输入字段配置名",trigger:"blur"}}},[a("Input",{attrs:{placeholder:"字段配置名:name"},model:{value:e.title.value,callback:function(a){t.$set(e.title,"value",a)},expression:"item.title.value"}})],1)],1),a("Col",t._b({staticClass:"goupBox mr15",attrs:{prop:"type"}},"Col",t.grid,!1),[a("FormItem",{attrs:{prop:"typelist."+r+".type.value",rules:{required:!0,message:"请选择字段类型",trigger:"change"}}},[a("i-select",{attrs:{placeholder:"字段类型"},model:{value:e.type.value,callback:function(a){t.$set(e.type,"value",a)},expression:"item.type.value"}},[a("i-option",{attrs:{value:"input"}},[t._v("文本框")]),a("i-option",{attrs:{value:"textarea"}},[t._v("多行文本框")]),a("i-option",{attrs:{value:"radio"}},[t._v("单选框")]),a("i-option",{attrs:{value:"checkbox"}},[t._v("多选框")]),a("i-option",{attrs:{value:"select"}},[t._v("下拉选择")]),a("i-option",{attrs:{value:"upload"}},[t._v("单图")]),a("i-option",{attrs:{value:"uploads"}},[t._v("多图")])],1)],1)],1),a("Col",{attrs:{span:"1"}},[a("Icon",{staticClass:"cur",attrs:{type:"ios-close-circle-outline"},on:{click:function(e){return t.delGroup(r)}}})],1),"radio"===e.type.value||"checkbox"===e.type.value||"select"===e.type.value?a("Col",{attrs:{span:"24"}},[a("FormItem",{attrs:{prop:"typelist."+r+".param.value",rules:{required:!0,message:"请输入参数方式",trigger:"blur"}}},[a("Input",{staticClass:"input-add",attrs:{type:"textarea",rows:4,placeholder:e.param.placeholder},model:{value:e.param.value,callback:function(a){t.$set(e.param,"value",a)},expression:"item.param.value"}})],1)],1):t._e()],1)})),a("Col",[a("FormItem",[a("Button",{attrs:{type:"primary"},on:{click:t.addType}},[t._v("添加字段")])],1)],1)],2),a("div",[a("Button",{attrs:{type:"primary",long:"",disabled:t.valids},on:{click:function(e){return t.handleSubmit("formValidate")}}},[t._v("提交")])],1)],1)],1)],1)}),[],!1,null,"58a24c68",null).exports,m=a("d708");function p(t,e,a,r,i,o,n){try{var s=t[o](n),l=s.value}catch(t){return void a(t)}s.done?e(l):Promise.resolve(l).then(r,i)}function f(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,r)}return a}function g(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var v={name:"group",components:{groupFrom:d},data:function(){return{roterPre:m.a.roterPre,grid:{xl:7,lg:7,md:12,sm:24,xs:24},formValidate:{page:1,limit:20,title:""},loading:!1,tabList:[],total:0,columns1:[{title:"ID",key:"id",width:80},{title:"KEY",key:"config_name",minWidth:130},{title:"数据组名称",key:"name",minWidth:130},{title:"简介",key:"info",minWidth:130},{title:"操作",slot:"action",fixed:"right",width:180}],FromData:null,titleFrom:"",groupId:0,addId:""}},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?f(a,!0).forEach((function(e){g(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):f(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(o.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:75},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){this.getList()},methods:{goList:function(t){this.$router.push({path:this.roterPre+"/system/config/system_group/list/"+t.id})},getList:function(){var t=this;this.loading=!0,Object(n.G)(this.formValidate).then(function(){var e,a=(e=i.a.mark((function e(a){var r;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.data,t.tabList=r.list,t.total=r.count,t.loading=!1;case 4:case"end":return e.stop()}}),e)})),function(){var t=this,a=arguments;return new Promise((function(r,i){var o=e.apply(t,a);function n(t){p(o,r,i,n,s,"next",t)}function s(t){p(o,r,i,n,s,"throw",t)}n(void 0)}))});return function(t){return a.apply(this,arguments)}}()).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.formValidate.page=t,this.getList()},userSearchs:function(){this.formValidate.page=1,this.getList()},groupAdd:function(t){this.$refs.groupfroms.modals=!0,this.titleFrom=t,this.addId="addId"},del:function(t,e,a){var r=this,i={title:e,num:a,url:"setting/group/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(i).then((function(t){r.$Message.success(t.msg),r.tabList.splice(a,1),r.tabList.length||(r.formValidate.page=1==r.formValidate.page?1:r.formValidate.page-1),r.getList()})).catch((function(t){r.$Message.error(t.msg)}))},edit:function(t,e){this.titleFrom=e,this.groupId=t.id,this.$refs.groupfroms.fromData(t.id),this.$refs.groupfroms.modals=!0,this.addId=""}}},h=Object(c.a)(v,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[a("div",{staticClass:"new_card_pd"},[a("Form",{ref:"formValidate",attrs:{model:t.formValidate,inline:"","label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[a("FormItem",{attrs:{label:"数据搜索:","label-for":"status2"}},[a("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入ID,KEY,数据组名称,简介"},model:{value:t.formValidate.title,callback:function(e){t.$set(t.formValidate,"title",e)},expression:"formValidate.title"}}),a("Button",{attrs:{type:"primary"},on:{click:t.userSearchs}},[t._v("查询")])],1)],1)],1)]),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("Button",{staticClass:"mr20",attrs:{type:"primary"},on:{click:function(e){return t.groupAdd("添加数据组")}}},[t._v("添加数据组")]),a("Table",{ref:"table",staticClass:"mt25",attrs:{columns:t.columns1,data:t.tabList,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"statuss",fn:function(e){var r=e.row;return e.index,[a("i-switch",{attrs:{value:r.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(r)}},model:{value:r.status,callback:function(e){t.$set(r,"status",e)},expression:"row.status"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("显示")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("隐藏")])])]}},{key:"action",fn:function(e){var r=e.row,i=e.index;return[a("a",{on:{click:function(e){return t.goList(r)}}},[t._v("数据列表")]),a("Divider",{attrs:{type:"vertical"}}),a("a",{on:{click:function(e){return t.edit(r,"编辑")}}},[t._v("编辑")]),a("Divider",{attrs:{type:"vertical"}}),a("a",{on:{click:function(e){return t.del(r,"删除数据组",i)}}},[t._v("删除")])]}}])}),a("div",{staticClass:"acea-row row-right page"},[a("Page",{attrs:{total:t.total,current:t.formValidate.page,"show-elevator":"","show-total":"","page-size":t.formValidate.limit},on:{"on-change":t.pageChange}})],1)],1),a("group-from",{ref:"groupfroms",attrs:{titleFrom:t.titleFrom,groupId:t.groupId,addId:t.addId},on:{getList:t.getList}})],1)}),[],!1,null,"f3779702",null);e.default=h.exports},a76c:function(t,e,a){}}]);