"use strict";(self["webpackChunkscui"]=self["webpackChunkscui"]||[]).push([[766],{39816:function(e,a,t){t.r(a),t.d(a,{default:function(){return b}});var s=t(66252),i=t(3577);const l={key:0,class:"scTableSearch"},o={class:"searchItem searchBtn"},n=(0,s.Uk)("查询"),c=(0,s.Uk)("重置"),r={class:"left-panel"},d=(0,s.Uk)("查看"),p=(0,s.Uk)("编辑"),h=(0,s.Uk)("删除");function u(e,a,t,u,m,f){const w=(0,s.up)("el-button"),g=(0,s.up)("scTableHerderListSearch"),k=(0,s.up)("el-header"),b=(0,s.up)("el-table-column"),C=(0,s.up)("el-dropdown-item"),y=(0,s.up)("el-dropdown-menu"),_=(0,s.up)("el-dropdown"),v=(0,s.up)("scNewTable"),D=(0,s.up)("el-main"),S=(0,s.up)("el-container"),W=(0,s.up)("save-dialog");return(0,s.wg)(),(0,s.iD)(s.HY,null,[(0,s.Wm)(S,{class:"mainBox mainBoxHeaderNoBorder"},{default:(0,s.w5)((()=>[m.list.column.length>0?((0,s.wg)(),(0,s.iD)("div",l,[(0,s.Wm)(g,{ref:"scSearch",searchList:m.list.column,paramsData:m.params,onFetchSelectData:f.getSelectData,onChangeHeaderData:f.getHeaderData},{default:(0,s.w5)((()=>[(0,s._)("div",o,[(0,s.Wm)(w,{size:m.size,type:"primary",icon:"el-icon-search",onClick:f.upSearch},{default:(0,s.w5)((()=>[n])),_:1},8,["size","onClick"]),(0,s.Wm)(w,{size:m.size,type:"info",icon:"el-icon-RefreshRight",onClick:f.reset},{default:(0,s.w5)((()=>[c])),_:1},8,["size","onClick"])])])),_:1},8,["searchList","paramsData","onFetchSelectData","onChangeHeaderData"])])):(0,s.kq)("",!0),(0,s.Wm)(k,null,{default:(0,s.w5)((()=>[(0,s._)("div",r,[(0,s.Wm)(w,{size:m.size,type:"primary",icon:"el-icon-plus",onClick:f.add},null,8,["size","onClick"])])])),_:1}),(0,s.Wm)(D,{class:"nopadding"},{default:(0,s.w5)((()=>[(0,s.Wm)(v,{ref:"table",size:m.size,onColumnBack:f.columnBack,tableName:"listCustomColumn",apiObj:m.list.apiObj,column:m.list.column,"row-key":"id",stripe:"",border:"",params:m.params},{created_at:(0,s.w5)((e=>[(0,s.Uk)((0,i.toDisplayString)(f.dateFormat(e.row.created_at,"yyyy-MM-dd")),1)])),default:(0,s.w5)((()=>[(0,s.Wm)(b,{type:"selection",align:"center",width:"50"}),(0,s.Wm)(b,{label:"序号",align:"center",type:"index",width:"50"}),(0,s.Wm)(b,{label:"操作",fixed:"right",align:"center",width:"160"},{default:(0,s.w5)((e=>[(0,s.Wm)(_,null,{dropdown:(0,s.w5)((()=>[(0,s.Wm)(y,null,{default:(0,s.w5)((()=>[(0,s.Wm)(C,{onClick:a=>f.handlerCommand(e.row,"show"),icon:"sc-icon-See"},{default:(0,s.w5)((()=>[d])),_:2},1032,["onClick"]),(0,s.Wm)(C,{onClick:a=>f.handlerCommand(e.row,"edit"),icon:"sc-icon-Edit"},{default:(0,s.w5)((()=>[p])),_:2},1032,["onClick"]),(0,s.Wm)(C,{onClick:a=>f.handlerCommand(e.row,"delete"),divided:"",icon:"sc-icon-Delete"},{default:(0,s.w5)((()=>[h])),_:2},1032,["onClick"])])),_:2},1024)])),default:(0,s.w5)((()=>[(0,s.Wm)(w,{icon:"el-icon-more",size:m.size},null,8,["size"])])),_:2},1024)])),_:1})])),_:1},8,["size","onColumnBack","apiObj","column","params"])])),_:1})])),_:1}),m.dialog.save?((0,s.wg)(),(0,s.j4)(W,{key:0,ref:"saveDialog",onSuccess:f.handleSaveSuccess,onClosed:a[0]||(a[0]=e=>m.dialog.save=!1)},null,8,["onSuccess"])):(0,s.kq)("",!0)],64)}var m=t(74452),f=t(558),w={name:"dept",components:{saveDialog:m["default"]},data(){return{size:"small",showPagination:!1,dialog:{save:!1},list:{apiObj:this.$API.system.product.list,column:[]},selection:[],filterMap:{data:{}},params:{url:"product/list"}}},methods:{columnBack(e){this.list.column=e},getHeaderData(e){this.params=e,this.filterMap.data=e},async getSelectData(e){let{data:a,params:t}=e;this.params=t,this.filterMap.data=t;let s=this.$TOOL.objCopy(t);s.field="","string"===typeof a.prop?s.field=a.prop:s.field=a.prop[0],"select"!=a.search_type&&"checkbox"!=a.search_type||await this.getField(a,s)},async getField(e,a){const t=await this.$API.system.product.field.post(a);200===t.code&&(t.data&&t.data.length>0&&t.data.forEach((a=>{a.label=a[e.prop],a.value=a[e.prop]})),this.list.column.forEach((a=>{a.prop==e.prop&&(a.data=t.data)})))},dateFormat(e){return f.Z.getStartTime(e)},add(){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open()}))},table_edit(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("edit").setData(e)}))},table_show(e){this.dialog.save=!0,this.$nextTick((()=>{this.$refs.saveDialog.open("show").setData(e)}))},async table_del(e){const a={ids:[e.id]},t=await this.$API.system.product.delete.post(a);200===t.code&&(this.$refs.table.refresh(),this.$message.success("删除成功"))},handlerCommand(e,a){"show"==a?this.table_show(e):"edit"==a?this.table_edit(e):"delete"==a&&this.table_del(e)},selectionChange(e){this.selection=e},upSearch(){this.$refs.table.upData(this.params)},reset(){this.params={url:"product/list"},this.$refs.scSearch.reload(this.params),this.$refs.table.reload(this.params)},handleSaveSuccess(e,a){("add"===a||"edit"===a)&&this.$refs.table.refresh()}}},g=t(83744);const k=(0,g.Z)(w,[["render",u]]);var b=k}}]);