(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0842f9ee"],{"1edf":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],staticClass:"avue-dialog",attrs:{"append-to-body":!0,"close-on-click-modal":!1,"destroy-on-close":!0,title:e.dialog.title,visible:e.dialog.showDialog,width:"1620px"},on:{"update:visible":function(t){return e.$set(e.dialog,"showDialog",t)},close:e.cancelDialog}},[t("div",{staticStyle:{"min-height":"665px","max-height":"85vh","padding-bottom":"50px"}},[t("basic-form",{key:"linkQueryForm",ref:"form",staticStyle:{"margin-bottom":"0"},attrs:{formData:e.form,formItems:e.formItems,span:4},on:{getFormData:e.getFormData}}),t("avue-crud",{ref:"crud",attrs:{data:e.orderInfoList,option:e.crudOption,title:"设置排序"},scopedSlots:e._u([{key:"menuLeft",fn:function(r){return[t("el-button",{attrs:{icon:"el-icon-plus",size:"small",type:"primary"},on:{click:e.addRow}},[e._v("创建")])]}},{key:"menu",fn:function(r){return[t("el-button",{attrs:{icon:"el-icon-delete",size:"small",type:"text"},on:{click:function(t){return e.rowDeleteHandler(r)}}},[e._v("删除\n ")])]}}])}),t("el-dialog",{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],staticClass:"avue-dialog",attrs:{"append-to-body":!0,"close-on-click-modal":!1,"destroy-on-close":!0,visible:e.crudDialog.showDialog,title:"创建",width:"500px"},on:{"update:visible":function(t){return e.$set(e.crudDialog,"showDialog",t)},close:function(t){e.crudDialog.showDialog=!1}}},[t("avue-form",{ref:"tableForm",attrs:{option:e.tableFormOption},model:{value:e.tableForm,callback:function(t){e.tableForm=t},expression:"tableForm"}}),t("div",{staticClass:"dialog-footer avue-dialog__footer"},[t("el-button",{attrs:{plain:"",size:"small",type:"primary"},on:{click:e.rowSave}},[e._v("保 存")])],1)],1),t("el-container",{staticStyle:{"margin-top":"10px"}},[t("el-aside",{staticStyle:{width:"350px"}},[t("fieldset",[t("legend",[e._v(" 候选条件 ")]),t("div",[e._v("\n 查询模板定义\n "),t("avue-select",{staticClass:"el-input--small",staticStyle:{width:"245px"},attrs:{dic:e.businessQueryDefineDic,placeholder:"请选择内容",type:"tree"},on:{change:e.businessQueryDefineChange},model:{value:e.businessQueryDefineForm,callback:function(t){e.businessQueryDefineForm=t},expression:"businessQueryDefineForm"}}),t("avue-tree",{staticStyle:{width:"335px",height:"268px"},attrs:{data:e.businessTreeData,option:e.treeOption},on:{"node-drag-start":e.handleDragStart,"node-drag-end":e.handleDragEnd}})],1)])]),t("el-main",[t("fieldset",{staticStyle:{margin:"0 0 0 10px"}},[t("legend",[e._v(" 查询条件 ")]),t("form-query-dialog",{ref:"formQuery",staticStyle:{height:"300px"},attrs:{levelFlag:e.form.levelFlag,queryCondition:e.queryCondition,queryTree:e.queryTree,searchColumn:e.searchColumn},on:{"update:levelFlag":function(t){return e.$set(e.form,"levelFlag",t)},"update:level-flag":function(t){return e.$set(e.form,"levelFlag",t)},queryHandler:e.queryHandler}})],1)])],1)],1),t("div",{staticClass:"dialog-footer avue-dialog__footer"},[t("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.submitDialog}},[e._v("保 存")]),t("el-button",{attrs:{size:"small"},on:{click:e.cancelDialog}},[e._v("取 消")])],1)])},i=[],o=(r("8e6e"),r("456d"),r("7f7f"),r("ac6a"),r("ade3")),l=r("7828"),n=r("9935"),s=r("527d"),u=r("4b9e");function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function c(e){for(var t=1;t0)},props:{label:"name",value:"name",children:"attrs"}},businessQueryDefineForm:"",businessQueryDefineDic:[],businessTreeData:[],queryTree:{},queryCondition:[]}},watch:{},methods:{openDialog:function(e,t,r,a){this.dialog.title=t,this.dialog.type=r,this.form.btmName=e,this.treeData=a.treeData,a.selectData?(this.selectData=a.selectData,this.form.qtName=this.selectData.qtName,a.selectData.queryTemplate.orderInfoList&&a.selectData.queryTemplate.orderInfoList.length>0&&(this.orderInfoList=JSON.parse(JSON.stringify(a.selectData.queryTemplate.orderInfoList))),this.queryCondition=this.selectData.queryTemplate.condition,this.queryTree=this.selectData.tree,this.form.levelFlag=this.selectData.levelFlag):(this.selectData={},this.orderInfoList=[],this.queryCondition=[],this.queryTree={connector:"并且",child:[]}),this.dialog.showDialog=!0,this.treeOption.defaultExpandedKeys=[a.treeData.label],this.getTemp(a.treeData.label),this.getAllAttr()},cancelDialog:function(){var e=this;this.dialog.loading=!1,this.dialog.showDialog=!1,this.$nextTick((function(){e.form={btmName:"",qtName:"",levelFlag:0,queryTemplate:{}},e.orderInfoList=[],e.businessQueryDefineForm="",e.linkQueryDefineForm="",e.$refs.form.clearValidate()}))},submitDialog:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;var r=e.initFormData();console.log(r),Object(l["btmSave"])(r).then((function(t){t.data.success?(e.$message.success("保存成功"),e.cancelDialog(),e.$emit("refresh")):e.$refs.form.clearValidate()}))}))},initFormData:function(){var e={btmName:this.form.btmName,qtName:this.form.qtName,levelFlag:this.form.levelFlag,queryTemplate:{orderInfoList:this.orderInfoList}};if(1==e.levelFlag){var t=function e(t){var r=[];return t&&t.forEach((function(t,a){"并且"!=t.label&&"或者"!=t.label?r.push(t.label):r.push({connector:t.label,child:e(t.children)})})),r},r={connector:this.$refs.formQuery.treeData[0].label};this.$refs.formQuery.treeData[0].children&&(r.child=t(this.$refs.formQuery.treeData[0].children)),e.tree=r}return e.condition=this.$refs.formQuery.conditionList,e},getFormData:function(e){this.form=e},addRow:function(){this.crudDialog.showDialog=!0},rowDeleteHandler:function(e){this.orderInfoList.splice(e.index,1),this.orderFieldList.unshift({id:e.row.orderField}),this.tableFormOption.column[0].dicData=this.orderFieldList},getAllAttr:function(){var e=this;Object(l["getBizTypeQTDs"])({btmName:this.treeData.label}).then((function(t){var r=JSON.stringify(e.orderInfoList),a=[];t.data.data.forEach((function(e){-1==r.indexOf('"orderField":"'+e.id+'"')&&a.push(e)})),e.tableFormOption.column[0].dicData=a,e.orderFieldList=a}))},rowSave:function(){var e=this;this.$refs.tableForm.validate((function(t){if(t){e.orderInfoList.push(JSON.parse(JSON.stringify(e.tableForm))),e.crudDialog.showDialog=!1;var r=JSON.stringify(e.orderInfoList),a=[];e.orderFieldList.forEach((function(e){-1==r.indexOf('"orderField":"'+e.id+'"')&&a.push(e)})),e.tableFormOption.column[0].dicData=a,e.orderFieldList=a,e.tableForm={orderField:"",orderMode:"ASC",level:""}}}))},getTemp:function(e){var t=this;e&&Object(s["queryTemplateListByAttr"])({btmName:e,linkFlag:!1}).then((function(e){var r=e.data.data.map((function(e){return e.label=e.name+"-"+e.btmName,e.value=e.name,e}));t.businessQueryDefineDic=r,r.length>0&&(t.businessQueryDefineForm=r[0].value)}))},businessQueryDefineChange:function(e){e.value&&(this.businessTreeData=[{name:e.value,attrs:e.item.attrs}])},handleDragStart:function(e,t){t.dataTransfer.setData("item",JSON.stringify(e.data)),1==this.form.levelFlag&&this.$refs.formQuery.$refs.tree.$emit("tree-node-drag-start",t,{node:this.$refs.formQuery.initItem(e)})},handleDragEnd:function(e,t,r,a){1==this.form.levelFlag&&this.$refs.formQuery.$refs.tree.$emit("tree-node-drag-end",a)},queryHandler:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;e.$refs.formQuery.queryResultDialog.loading=!0;var r=e.initFormData();Object(l["getCriteriaBtm"])(r).then((function(t){if(t.data.success){var r=t.data.data,a=r.map((function(e){var t=e.hisAttrValList.filter((function(e){return"OID"===e.attrName||"REVISIONOID"===e.attrName||"BTMNAME"===e.attrName||"NAMEOID"===e.attrName})),r=t.reduce((function(e,t){return e[t.attrName]=t.attrVal,e}),{});return r}));e.$refs.formQuery.resultData=a,e.$refs.formQuery.queryResultDialog.showDialog=!0,e.$refs.formQuery.queryResultDialog.loading=!1}}))}))}}},m=f,g=(r("ed1a"),r("2877")),p=Object(g["a"])(m,a,i,!1,null,"76fb51a1",null);t["default"]=p.exports},bf12:function(e,t,r){},ed1a:function(e,t,r){"use strict";r("bf12")}}]);