1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-71d4a90e","chunk-2d0cc660"],{"4e81":function(e,t,l){"use strict";l.r(t),l.d(t,"urlPrefix",(function(){return r})),l.d(t,"GetList",(function(){return n})),l.d(t,"saveContent",(function(){return i})),l.d(t,"createObj",(function(){return o})),l.d(t,"UpdateObj",(function(){return s})),l.d(t,"DelObj",(function(){return c})),l.d(t,"GetAssociationTable",(function(){return u}));var a=l("22ce"),r="/api/system/system_config/";function n(e){return Object(a["c"])({url:r,method:"get",params:e})}function i(e,t){return Object(a["c"])({url:r+"save_content/",method:"put",data:t})}function o(e){return Object(a["c"])({url:r,method:"post",data:e})}function s(e){return Object(a["c"])({url:r+e.id+"/",method:"put",data:e})}function c(e){return Object(a["c"])({url:r+e+"/",method:"delete",data:{id:e}})}function u(){return Object(a["c"])({url:r+"get_association_table/",method:"get",params:{}})}},f4b9:function(e,t,l){"use strict";l.r(t);var a=function(){var e=this,t=e._self._c;return t("div",[t("el-form",{ref:"association",attrs:{model:e.formObj}},[t("el-form-item",{attrs:{label:"关联表",prop:"table",rules:[{required:!0,message:"必填项",trigger:"blur"}]}},[t("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择"},on:{change:e.handleChange},model:{value:e.formObj.table,callback:function(t){e.$set(e.formObj,"table",t)},expression:"formObj.table"}},e._l(e.tableOptions,(function(l){return t("el-option",{key:l.table,attrs:{label:l.tableName,value:l.table}},[t("span",{staticStyle:{float:"left"}},[e._v(e._s(l.tableName))]),t("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v(e._s(l.table))])])})),1)],1),t("el-form-item",{attrs:{label:"显示字段",prop:"field",rules:[{required:!0,message:"必填项",trigger:"blur"}]}},[t("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择"},model:{value:e.formObj.field,callback:function(t){e.$set(e.formObj,"field",t)},expression:"formObj.field"}},e._l(e.labelOptions,(function(l){return t("el-option",{key:l.table,attrs:{label:l.title,value:l.field}},[t("span",{staticStyle:{float:"left"}},[e._v(e._s(l.field))]),t("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v(e._s(l.title))])])})),1)],1),t("el-form-item",{attrs:{label:"储存字段",prop:"primarykey",rules:[{required:!0,message:"必填项",trigger:"blur"}]}},[t("el-select",{attrs:{filterable:"",clearable:"",placeholder:"请选择"},model:{value:e.formObj.primarykey,callback:function(t){e.$set(e.formObj,"primarykey",t)},expression:"formObj.primarykey"}},e._l(e.labelOptions,(function(l,a){return t("el-option",{key:a,attrs:{label:l.title,value:l.field}},[t("span",{staticStyle:{float:"left"}},[e._v(e._s(l.field))]),t("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v(e._s(l.title))])])})),1)],1),t("el-form-item",{attrs:{label:"过滤条件",prop:"oldSearchField",rules:[{required:!0,message:"必填项",trigger:"blur"}]}},[t("el-select",{attrs:{multiple:"",filterable:"",clearable:"",placeholder:"请选择"},on:{change:e.handleSearch},model:{value:e.formObj.oldSearchField,callback:function(t){e.$set(e.formObj,"oldSearchField",t)},expression:"formObj.oldSearchField"}},e._l(e.labelOptions,(function(l,a){return t("el-option",{key:a,attrs:{label:l.title,value:l.field}},[t("span",{staticStyle:{float:"left"}},[e._v(e._s(l.field))]),t("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[e._v(e._s(l.title))])])})),1)],1)],1)],1)},r=[],n=(l("4de4"),l("7db0"),l("e9f5"),l("910d"),l("f665"),l("d3b7"),l("4e81")),i={name:"associationTable",props:{value:{type:Object}},model:{prop:"value",event:"updateVal"},data:function(){return{formObj:{table:null,primarykey:null,field:null,searchField:null,oldSearchField:null},searchField:null,tableOptions:[],labelOptions:[]}},methods:{init:function(){var e=this;n["GetAssociationTable"]().then((function(t){var l=t.data;e.tableOptions=l,e.formObj.table=l[0].table,e.labelOptions=l[0].tableFields,e.formObj.primarykey="id",e.formObj.field="id"}))},handleChange:function(e){var t=this,l=t.tableOptions.find((function(t){return t.table===e})),a=l.tableFields;t.labelOptions=a},handleSearch:function(e){var t=this,l=t.labelOptions.filter((function(t){return e.indexOf(t.field)>-1}));t.formObj.searchField=l},handleUpdate:function(){this.$emit("updateVal",this.formObj)},onSubmit:function(){var e=!1;return this.$refs.association.validate((function(t){if(!t)return!1;e=!0})),e}},created:function(){this.init()}},o=i,s=l("2877"),c=Object(s["a"])(o,a,r,!1,null,"c040acbe",null);t["default"]=c.exports}}]);
|