(window["webpackJsonp_direwolf"]=window["webpackJsonp_direwolf"]||[]).push([["sWsWidgetsList"],{5747:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"wrapper-cont"},[s("el-card",{staticClass:"box-card search-content",attrs:{shadow:"never"}},[s("el-form",{attrs:{"label-position":"right",size:"small","label-width":"100px",id:"sWsWidgetsSearchForm",model:e.searchParams}},[s("el-row",{attrs:{gutter:15}},[s("el-col",{attrs:{span:6}},[s("el-form-item",{attrs:{label:"标题"}},[s("el-input",{attrs:{placeholder:"请输入标题"},model:{value:e.searchParams.title,callback:function(t){e.$set(e.searchParams,"title",t)},expression:"searchParams.title"}})],1)],1),s("el-col",{attrs:{span:6}},[s("el-form-item",{attrs:{label:"组件类型"}},[s("el-select",{attrs:{placeholder:"请选择组件类型"},model:{value:e.searchParams.vizType,callback:function(t){e.$set(e.searchParams,"vizType",t)},expression:"searchParams.vizType"}},e._l(e.vizTypes,(function(t){return s("el-option",{key:t.key,attrs:{label:t.name,value:t.key,disabled:e.inViewMode}})})),1)],1)],1),s("el-col",{attrs:{span:6}},[s("el-form-item",{attrs:{label:"业务前缀"}},[s("el-input",{attrs:{placeholder:"请输入业务前缀"},model:{value:e.searchParams.businessPrefix,callback:function(t){e.$set(e.searchParams,"businessPrefix",t)},expression:"searchParams.businessPrefix"}})],1)],1),s("el-col",{attrs:{span:6}},[s("el-form-item",{staticClass:"search-content-button-container"},[s("el-button-group",[s("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-search"},on:{click:e.search}},[e._v("查询\n ")]),s("el-button",{attrs:{size:"small",icon:"el-icon-refresh"},on:{click:e.resetSearchParam}},[e._v("重置\n ")])],1)],1)],1)],1)],1)],1),s("el-card",{staticClass:"box-card",attrs:{shadow:"hover"}},[e.inViewMode?e._e():s("el-button-group",[e.hasPermission("add")?s("el-button",{attrs:{size:"mini",icon:"el-icon-plus"},on:{click:e.addNewSWsWidgets}},[e._v("新增\n ")]):e._e(),e.hasPermission("del")?s("el-button",{attrs:{type:"danger",size:"mini",icon:"el-icon-delete"},on:{click:e.deleteSelectedSWsWidgets}},[e._v("删除\n ")]):e._e(),e.hasPermission("view")?s("el-button",{attrs:{size:"mini",icon:"el-icon-tickets"},on:{click:e.viewSelectedSWsWidgets}},[e._v("查看\n ")]):e._e()],1),s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.sWsWidgetsTableLoading,expression:"sWsWidgetsTableLoading"}],ref:"sWsWidgetsTable",staticStyle:{width:"100%","margin-top":"15px","margin-bottom":"15px"},attrs:{size:"medium",stripe:"",border:"","tooltip-effect":"dark",data:e.sWsWidgetsTablePage.list},on:{"row-click":e.handleRowClick,"sort-change":e.handleSortChange}},[s("el-table-column",{attrs:{type:"selection",width:"55"}}),s("el-table-column",{attrs:{prop:"title",label:"标题",sortable:"custom","show-overflow-tooltip":""}}),s("el-table-column",{attrs:{prop:"vizType",label:"组件类型",sortable:"custom","show-overflow-tooltip":""}}),s("el-table-column",{attrs:{prop:"businessPrefix",label:"业务前缀",sortable:"custom","show-overflow-tooltip":""}}),e.inViewMode?e._e():s("el-table-column",{attrs:{label:"操作","min-width":100},scopedSlots:e._u([{key:"default",fn:function(t){return[s("el-tooltip",{attrs:{content:"编辑",placement:"top"}},[s("el-button",{attrs:{size:"mini",icon:"el-icon-edit"},on:{click:function(s){return e.sWsWidgetsRecordEdit(t)}}})],1),s("el-tooltip",{attrs:{content:"删除",placement:"top"}},[s("el-button",{attrs:{size:"mini",type:"danger",icon:"el-icon-delete"},on:{click:function(s){return e.sWsWidgetsRecordRemove(t)}}})],1)]}}],null,!1,2354421341)})],1),s("el-pagination",{attrs:{layout:"total, sizes, ->, prev, pager, next, jumper",total:e.sWsWidgetsTablePage.count,"page-sizes":[5,10,15,20],"page-size":e.searchParams.limit,background:"","hide-on-single-page":""},on:{"size-change":e.handleTableSizeChange,"current-change":e.handleTableCurrentChange}})],1)],1)},n=[],a=s("a8db"),o=(s("7f7f"),s("7514"),s("ac6a"),s("28a5"),s("cebc")),r=s("722d"),l=s("5b77"),c=s("a43d"),d=s("2caa"),h={title:"",vizType:"",businessPrefix:"",createdUserId:"",limit:5,offset:0,order:"",sort:""},u={name:"sWsWidgetsList",components:{},data:function(){return{searchParams:Object(o["a"])({},h),editType:this.$$utils.getQueryString("editType"),sWsWidgetsTablePage:{},sWsWidgetsTableLoading:!1,vizTypes:c["a"]}},computed:{inViewMode:function(){return"view"===this.editType||!this.hasPermission("add")&&!this.hasPermission("edit")&&!this.hasPermission("del")}},methods:{hasPermission:function(e){return this.$$utils.permission.hasPermission("".concat(l["b"]).concat(e))},search:function(){this.searchParams.offset=0,this.refreshTable()},refreshTable:function(){var e=this;e.sWsWidgetsTableLoading=!0,r["a"].widget.getSWsWidgetsList(e.searchParams).then((function(t){e.sWsWidgetsTablePage=t,e.sWsWidgetsTableLoading=!1}))},resetSearchParam:function(){this.searchParams=Object(o["a"])({},h),this.refreshTable()},handleRowClick:function(e,t,s){this.$$utils.eleTableClickSelection(this.$refs.sWsWidgetsTable,e,s)},handleTableSizeChange:function(e){this.searchParams.limit=e,this.refreshTable()},handleTableCurrentChange:function(e){this.searchParams.offset=this.searchParams.limit*(e-1),this.refreshTable()},handleSortChange:function(e){null===e.prop?(this.searchParams.sort=h.sort,this.searchParams.order=h.order):(this.searchParams.sort=e.prop,this.searchParams.order=e.order.split("ending")[0]),this.refreshTable()},importFromComponents:function(){var e=this,t={componentList:e.$$utils.getInstance().$$widgetUtils.componentRegistry.getComponentList()};e.$$utils.openLayerDialog({title:"导入组件",width:"565px",height:"410px",el:"componentSelector",url:"/dashboard/ComponentSelector",onConfirm:function(s,i){var n=s.$children[0],l=[];n.value.length>0&&n.value.forEach((function(e){var s=t.componentList.find((function(t){return t.name===e})),i=s.title,n=s.description,r=s.businessPrefix,c=(s.instance,Object(a["a"])(s,["title","description","businessPrefix","instance"]));l.push({isNewRecord:!0,title:i,description:n,businessPrefix:r,vizType:"vNode",parameters:JSON.stringify(Object(o["a"])({title:i,description:n,businessPrefix:r},c))})})),l.length>0&&r["a"].widget.saveAll(l).then((function(t){i(),e.refreshTable()}))}})},addNewSWsWidgets:function(){this.showFormDialog({editType:"add"})},viewSelectedSWsWidgets:function(){var e=this,t=e.$refs.sWsWidgetsTable.selection;1===t.length?e.showFormDialog({editType:"view",id:t[0].id}):e.$$utils.direwolfCommonTips("warning","仅能选择一条记录进行查看")},showFormDialog:function(e){var t=this;t.$$utils.openElementDialog({options:d["default"],title:"".concat(t.$$utils.getEditTypeName(e.editType),"Widget信息"),props:Object(o["a"])({},e,{winWidth:window.innerWidth}),width:"60%",height:"410px",onConfirmClick:function(e,s){e.save((function(){t.refreshTable(),s()}))}})},deleteSelectedSWsWidgets:function(){var e=this,t=e.$refs.sWsWidgetsTable.selection;0!==t.length?e.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"数据删除后不可恢复,确定继续删除吗?"},(function(){var s=[];t.forEach((function(e){e.id&&s.push(e.id)})),s.length>0&&r["a"].widget.deleteAllSWsWidgets(s).then((function(t){e.refreshTable(),e.$$utils.direwolfCommonTips("success","删除Widget信息成功")}))})):e.$$utils.direwolfCommonTips("warning","请选择要删除的记录")},editSelectedSWsWidgets:function(){var e=this,t=this.$refs.sWsWidgetsTable.selection;1===t.length?e.showFormDialog({editType:"edit",id:t[0].id}):e.$$utils.direwolfCommonTips("warning","仅能选择一条记录进行修改")},sWsWidgetsRecordEdit:function(e){this.showFormDialog({editType:"edit",id:e.row.id})},sWsWidgetsRecordRemove:function(e){var t=this;t.$$utils.direwolfCommonConfirm({title:"删除提醒",message:"数据删除后不可恢复,确定继续删除吗?"},(function(){var s="删除Widget信息";r["a"].widget.deleteSWsWidgets(e.row.id).then((function(e){t.refreshTable(),t.$$utils.direwolfCommonTips("success","".concat(s,"成功"))}))}))},handleSelectionChange:function(e){}},created:function(){var e=this;e.refreshTable(),sessionStorage.setItem("path_config","1234")}},m=u,p=s("2877"),f=Object(p["a"])(m,i,n,!1,null,"18375c3a",null);t["default"]=f.exports},e078:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("component-selector",{attrs:{id:"componentSelector","component-list":e.componentList}})},n=[],a=s("1c10"),o={name:"WidgetComponentSelector",components:{ComponentSelector:a["default"]},data:function(){return{componentList:this.$$utils.getInstance().$$widgetUtils.componentRegistry.getComponentList()}}},r=o,l=s("2877"),c=Object(l["a"])(r,i,n,!1,null,"a00b2f16",null);t["default"]=c.exports}}]);