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