(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0f009b"],{"9b51":function(e,t,n){"use strict";n.r(t);var o=n("7a23"),i=Object(o["withScopeId"])("data-v-74f713d3");Object(o["pushScopeId"])("data-v-74f713d3");var c=Object(o["createTextVNode"])("上移"),a=Object(o["createTextVNode"])("下移"),s=Object(o["createTextVNode"])("调出"),r=Object(o["createTextVNode"])("调入");Object(o["popScopeId"])();var l=i((function(e,t,n,l,d,u){var h=Object(o["resolveComponent"])("ele-pro-table"),f=Object(o["resolveComponent"])("a-col"),p=Object(o["resolveComponent"])("arrow-up-outlined"),b=Object(o["resolveComponent"])("a-button"),m=Object(o["resolveComponent"])("arrow-down-outlined"),O=Object(o["resolveComponent"])("arrow-right-outlined"),v=Object(o["resolveComponent"])("a-space"),g=Object(o["resolveComponent"])("arrow-left-outlined"),j=Object(o["resolveComponent"])("a-row"),_=Object(o["resolveComponent"])("a-modal");return Object(o["openBlock"])(),Object(o["createBlock"])(_,{width:1200,visible:n.visible,title:"卷内文件调整","onUpdate:visible":u.updateVisible,onCancel:u.close,onOk:u.save},{default:i((function(){return[Object(o["createVNode"])(j,{gutter:16},{default:i((function(){return[Object(o["createVNode"])(f,{lg:8,md:24,sm:24,xs:24},{default:i((function(){return[Object(o["createVNode"])(h,{bordered:"",ref:"docTable","row-key":"piece_no","sub-title":"案卷列表",columns:d.columns1,datasource:n.documents,current:d.current,"onUpdate:current":t[1]||(t[1]=function(e){return d.current=e}),scroll:{x:"max-content"},"row-selection":{columnWidth:48},"tool-style":{padding:"7px 14px"},"tools-theme":"default","need-page":!1,toolkit:[]},null,8,["columns","datasource","current"])]})),_:1}),Object(o["createVNode"])(f,{lg:8,md:24,sm:24,xs:24},{default:i((function(){return[Object(o["createVNode"])(h,{bordered:"",ref:"fileTable",loading:d.loading,"sub-title":"卷内列表",datasource:u.data1,columns:d.columns2,"row-key":"archive_no","tools-theme":"default",scroll:{x:"max-content"},selection:d.selection1,"onUpdate:selection":t[2]||(t[2]=function(e){return d.selection1=e}),"row-selection":{columnWidth:48},"need-page":!1,toolkit:[]},{toolkit:i((function(){return[Object(o["createVNode"])(v,null,{default:i((function(){return[Object(o["createVNode"])(b,{onClick:u.moveUp,type:"primary",class:"ele-btn-icon"},{default:i((function(){return[Object(o["createVNode"])("span",null,[Object(o["createVNode"])(p),c])]})),_:1},8,["onClick"]),Object(o["createVNode"])(b,{type:"primary",class:"ele-btn-icon",onClick:u.moveDown},{default:i((function(){return[Object(o["createVNode"])("span",null,[Object(o["createVNode"])(m),a])]})),_:1},8,["onClick"]),Object(o["createVNode"])(b,{type:"primary",class:"ele-btn-icon",onClick:u.moveOut},{default:i((function(){return[Object(o["createVNode"])("span",null,[s,Object(o["createVNode"])(O)])]})),_:1},8,["onClick"])]})),_:1})]})),_:1},8,["loading","datasource","columns","selection"])]})),_:1}),Object(o["createVNode"])(f,{lg:8,md:24,sm:24,xs:24},{default:i((function(){return[Object(o["createVNode"])(h,{bordered:"",loading:d.loading,datasource:u.data2,columns:d.columns2,"sub-title":"未归档列表","row-key":"archive_no","tools-theme":"default",scroll:{x:"max-content"},selection:d.selection2,"onUpdate:selection":t[3]||(t[3]=function(e){return d.selection2=e}),"row-selection":{columnWidth:48},"need-page":!1,toolkit:[]},{toolkit:i((function(){return[Object(o["createVNode"])(b,{type:"primary",class:"ele-btn-icon",onClick:u.moveIn},{default:i((function(){return[Object(o["createVNode"])("span",null,[Object(o["createVNode"])(g),r])]})),_:1},8,["onClick"])]})),_:1},8,["loading","datasource","columns","selection"])]})),_:1})]})),_:1})]})),_:1},8,["visible","onUpdate:visible","onCancel","onOk"])})),d=(n("4de4"),n("159b"),n("d81d"),n("e180")),u=n("9af8"),h=n("1cd4"),f=n("083e"),p={name:"FileSort",components:{ArrowUpOutlined:d["a"],ArrowDownOutlined:u["a"],ArrowLeftOutlined:h["a"],ArrowRightOutlined:f["a"]},props:{visible:Boolean,documents:{type:Array,required:!0}},emits:["update:visible"],data:function(){return{columns1:[{title:"案卷题名",dataIndex:"title"},{title:"案卷档号",dataIndex:"piece_no"}],columns2:[{title:"文件题名",dataIndex:"title"},{title:"文件档号",dataIndex:"archive_no"}],data:[],current:null,loading:!0,selection1:[],selection2:[]}},computed:{data1:function(){var e=this;return this.current?this.data.filter((function(t){return t.piece_no===e.current.piece_no})):[]},data2:function(){return this.data.filter((function(e){return!e.piece_no}))}},methods:{query:function(){var e=this;this.loading=!0,this.$http.get("https://cdn.eleadmin.com/20200610/archive.json").then((function(t){e.loading=!1,0===t.data.code?(e.data=t.data.data,e.current=e.documents[0]):e.$message.error(t.data.msg)})).catch((function(t){e.loading=!1,e.$message.error(t.message)}))},moveUp:function(){if(this.selection1.length){if(this.selection1.length>1)this.$message.error("只能选择一条数据");else if(0!==this.data1.indexOf(this.selection1[0])){var e=this.data.indexOf(this.selection1[0]),t=this.data[e-1];this.data[e-1]=this.selection1[0],this.data[e]=t,this.selection1=[this.data[e-1]]}}else this.$message.error("请选择一条数据")},moveDown:function(){if(this.selection1.length){if(this.selection1.length>1)this.$message.error("只能选择一条数据");else if(this.data1.indexOf(this.selection1[0])!==this.data1.length-1){var e=this.data.indexOf(this.selection1[0]),t=this.data[e+1];this.data[e+1]=this.selection1[0],this.data[e]=t,this.selection1=[this.data[e+1]]}}else this.$message.error("请选择一条数据")},moveOut:function(){this.selection1.length?(this.selection1.forEach((function(e){e.piece_no=""})),this.selection1=[]):this.$message.error("请至少选择一条数据")},moveIn:function(){var e=this;this.current&&(this.selection2.length?(this.selection2.forEach((function(t){t.piece_no=e.current.piece_no})),this.selection2=[]):this.$message.error("请至少选择一条数据"))},save:function(){var e=this.data.map((function(e){return{archive_no:e.archive_no,piece_no:e.piece_no}}));console.log(e),this.$message.success("调整成功"),this.close()},close:function(){this.data=[],this.selection1=[],this.selection2=[],this.updateVisible(!1)},updateVisible:function(e){this.$emit("update:visible",e)}},watch:{visible:function(){this.visible&&this.query()},current:function(){this.selection1=[]}}},b=n("6b0d"),m=n.n(b);const O=m()(p,[["render",l],["__scopeId","data-v-74f713d3"]]);t["default"]=O}}]);