1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-07e00055"],{"16fc":function(t,e,i){"use strict";i.r(e);var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"components-container"},[t._m(0),i("div",{staticClass:"editor-container"},[i("dnd-list",{attrs:{list1:t.list1,list2:t.list2,"list1-title":"List","list2-title":"Article pool"}})],1)])},n=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("aside",[t._v("drag-list base on "),i("a",{attrs:{href:"https://github.com/SortableJS/Vue.Draggable",target:"_blank"}},[t._v("Vue.Draggable")])])}],a=(i("a434"),function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"dndList"},[i("div",{staticClass:"dndList-list",style:{width:t.width1}},[i("h3",[t._v(t._s(t.list1Title))]),i("draggable",{staticClass:"dragArea",attrs:{"set-data":t.setData,list:t.list1,group:"article"}},t._l(t.list1,(function(e){return i("div",{key:e.id,staticClass:"list-complete-item"},[i("div",{staticClass:"list-complete-item-handle"},[t._v(" "+t._s(e.id)+"["+t._s(e.author)+"] "+t._s(e.title)+" ")]),i("div",{staticStyle:{position:"absolute",right:"0px"}},[i("span",{staticStyle:{float:"right","margin-top":"-20px","margin-right":"5px"},on:{click:function(i){return t.deleteEle(e)}}},[i("i",{staticClass:"el-icon-delete",staticStyle:{color:"#ff4949"}})])])])})),0)],1),i("div",{staticClass:"dndList-list",style:{width:t.width2}},[i("h3",[t._v(t._s(t.list2Title))]),i("draggable",{staticClass:"dragArea",attrs:{list:t.list2,group:"article"}},t._l(t.list2,(function(e){return i("div",{key:e.id,staticClass:"list-complete-item"},[i("div",{staticClass:"list-complete-item-handle2",on:{click:function(i){return t.pushEle(e)}}},[t._v(" "+t._s(e.id)+" ["+t._s(e.author)+"] "+t._s(e.title)+" ")])])})),0)],1)])}),l=[],r=(i("a623"),i("c975"),i("b85c")),c=i("1980"),u=i.n(c),o={name:"DndList",components:{draggable:u.a},props:{list1:{type:Array,default:function(){return[]}},list2:{type:Array,default:function(){return[]}},list1Title:{type:String,default:"list1"},list2Title:{type:String,default:"list2"},width1:{type:String,default:"48%"},width2:{type:String,default:"48%"}},methods:{isNotInList1:function(t){return this.list1.every((function(e){return t.id!==e.id}))},isNotInList2:function(t){return this.list2.every((function(e){return t.id!==e.id}))},deleteEle:function(t){var e,i=Object(r["a"])(this.list1);try{for(i.s();!(e=i.n()).done;){var s=e.value;if(s.id===t.id){var n=this.list1.indexOf(s);this.list1.splice(n,1);break}}}catch(a){i.e(a)}finally{i.f()}this.isNotInList2(t)&&this.list2.unshift(t)},pushEle:function(t){var e,i=Object(r["a"])(this.list2);try{for(i.s();!(e=i.n()).done;){var s=e.value;if(s.id===t.id){var n=this.list2.indexOf(s);this.list2.splice(n,1);break}}}catch(a){i.e(a)}finally{i.f()}this.isNotInList1(t)&&this.list1.push(t)},setData:function(t){t.setData("Text","")}}},d=o,f=(i("7f49"),i("2877")),h=Object(f["a"])(d,a,l,!1,null,"005c1ad2",null),p=h.exports,v=i("2423"),m={name:"DndListDemo",components:{DndList:p},data:function(){return{list1:[],list2:[]}},created:function(){this.getData()},methods:{getData:function(){var t=this;this.listLoading=!0,Object(v["c"])().then((function(e){t.list1=e.data.items.splice(0,5),t.list2=e.data.items}))}}},g=m,b=Object(f["a"])(g,s,n,!1,null,null,null);e["default"]=b.exports},2423:function(t,e,i){"use strict";i.d(e,"c",(function(){return n})),i.d(e,"b",(function(){return a})),i.d(e,"d",(function(){return l})),i.d(e,"a",(function(){return r})),i.d(e,"e",(function(){return c}));var s=i("b775");function n(t){return Object(s["a"])({url:"/vue-element-admin/article/list",method:"get",params:t})}function a(t){return Object(s["a"])({url:"/vue-element-admin/article/detail",method:"get",params:{id:t}})}function l(t){return Object(s["a"])({url:"/vue-element-admin/article/pv",method:"get",params:{pv:t}})}function r(t){return Object(s["a"])({url:"/vue-element-admin/article/create",method:"post",data:t})}function c(t){return Object(s["a"])({url:"/vue-element-admin/article/update",method:"post",data:t})}},"7f49":function(t,e,i){"use strict";var s=i("b447"),n=i.n(s);n.a},a623:function(t,e,i){"use strict";var s=i("23e7"),n=i("b727").every,a=i("a640"),l=i("ae40"),r=a("every"),c=l("every");s({target:"Array",proto:!0,forced:!r||!c},{every:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},b447:function(t,e,i){}}]);
|