1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2574bc12"],{"1c18":function(e,t,n){},"1d8f":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("div",{staticClass:"filter-container"},[n("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"城市名"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleFilter(t)}},model:{value:e.listQuery.city_name,callback:function(t){e.$set(e.listQuery,"city_name",t)},expression:"listQuery.city_name"}}),n("el-button",{directives:[{name:"waves",rawName:"v-waves"}],staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.handleFilter}},[e._v(" 搜索 ")])],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.list,border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{align:"center",label:"ID",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.id))])]}}])}),n("el-table-column",{attrs:{align:"center",label:"城市"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",[e._v(e._s(t.row.sname))])]}}])}),n("el-table-column",{attrs:{"class-name":"status-col",label:"状态",width:"80ß"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("el-tag",{attrs:{type:e._f("statusFilter")(a.status)}},[e._v(" "+e._s("1"==a.status?"正常":"隐藏")+" ")])]}}])}),n("el-table-column",{attrs:{"class-name":"status-col",label:"排序",width:"80ß"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("el-tag",{attrs:{type:"success"}},[e._v(" "+e._s(a.sort)+" ")])]}}])}),n("el-table-column",{attrs:{align:"center",label:"Actions",width:"190","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"primary",size:"mini",icon:"el-icon-edit"},on:{click:function(n){return e.handleUpdate(t)}}},[e._v(" 修改 ")]),n("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"1"==t.row.status?"danger":"success",size:"mini",icon:"el-icon-turn-off"},on:{click:function(n){return e.handleDelete(t)}}},[e._v(" "+e._s("1"==t.row.status?"隐藏":"开启")+" ")])]}}])})],1),n("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.listQuery.page,limit:e.listQuery.pageSize},on:{"update:page":function(t){return e.$set(e.listQuery,"page",t)},"update:limit":function(t){return e.$set(e.listQuery,"pageSize",t)},pagination:e.getList}}),n("el-dialog",{attrs:{title:e.textMap[e.dialogStatus],visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[n("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{model:e.temp,"label-position":"left","label-width":"70px"}},[n("el-form-item",{attrs:{label:"城市",prop:"sname"}},[n("el-input",{model:{value:e.temp.sname,callback:function(t){e.$set(e.temp,"sname",t)},expression:"temp.sname"}})],1),n("el-form-item",{attrs:{label:"排序",prop:"sort"}},[n("el-input",{attrs:{placeholder:"倒序"},model:{value:e.temp.sort,callback:function(t){e.$set(e.temp,"sort",t)},expression:"temp.sort"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v(" 取消 ")]),n("el-button",{attrs:{type:"primary"},on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v(" 确定 ")])],1)],1)],1)},i=[],r=(n("c740"),n("4160"),n("a434"),n("b0c0"),n("159b"),n("96cf"),n("1da1")),o=n("b775");function s(e){return Object(o["a"])({url:"/OpenArea/index",method:"get",params:e})}function l(e){return Object(o["a"])({url:"/OpenArea/read",method:"get",params:{id:e}})}function c(e){return Object(o["a"])({url:"/OpenArea/save",method:"post",data:e})}function u(e){return Object(o["a"])({url:"/OpenArea/update?id="+e.id,method:"post",data:e})}function d(e){return Object(o["a"])({url:"/OpenArea/delete?id="+e,method:"get"})}var f=n("333d"),p=n("6724"),m={name:"ArticleList",components:{Pagination:f["a"]},directives:{waves:p["a"]},filters:{statusFilter:function(e){var t={1:"success",draft:"info",2:"danger"};return t[e]}},data:function(){return{list:null,total:0,listLoading:!0,listQuery:{page:1,pageSize:10},temp:{id:void 0,sname:"",sort:0},dialogFormVisible:!1,dialogStatus:"",textMap:{update:"修改",create:"创建"},props:{lazy:!0,checkStrictly:!0,lazyLoad:function(e,t){var n=e.level,a={page:1,pageSize:100};console.log(e),a.pid=e.value?e.value:1e5,s(a).then((function(e){var a=[];e.data.list.forEach((function(e){a.push({value:e.id,label:e.name,leaf:n>=2})})),t(a)}))}}}},created:function(){this.getList()},methods:{getCityList:function(){console.log(222)},getList:function(){var e=this;this.listLoading=!0,s(this.listQuery).then((function(t){e.list=t.data.list,e.total=t.data.count,e.listLoading=!1}))},handleFilter:function(){var e=this;this.listLoading=!0,s(this.listQuery).then((function(t){e.list=t.data.list,e.total=t.data.count,e.listLoading=!1}))},handleDelete:function(e){var t=this,n=e.$index,a=e.row;console.log(a.id);var i=1===a.status?"隐藏":"开启";this.$confirm("您确定要"+i+"吗","警告",{confirmButtonText:"是的",cancelButtonText:"取消",type:"warning"}).then(Object(r["a"])(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,d(a.id);case 2:return e.next=4,l(a.id);case 4:r=e.sent,t.list.splice(n,1,r.data.info),t.$message({type:"success",message:i+"成功"});case 7:case"end":return e.stop()}}),e)}))))},handleUpdate:function(e){var t=this,n=(e.$index,e.row);this.temp=Object.assign({},n),this.dialogStatus="update",this.dialogFormVisible=!0,this.$nextTick((function(){t.$refs["dataForm"].clearValidate()}))},handleCreate:function(){var e=this;this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},createData:function(){var e=this;c(this.temp).then((function(t){l(t.data.addId).then((function(t){e.list.unshift(t.data.info),e.dialogFormVisible=!1,e.$notify({title:"成功",message:"创建成功",type:"success",duration:2e3})}))}))},updateData:function(){var e=this,t=Object.assign({},this.temp);t.name?u(t).then((function(){var t=e.list.findIndex((function(t){return t.id===e.temp.id}));e.list.splice(t,1,e.temp),e.dialogFormVisible=!1,e.$notify({title:"成功",message:"更新成功",type:"success",duration:2e3})})):this.$notify({title:"警告",message:"城市名不能为空",type:"error",duration:2e3})}}},g=m,h=(n("4817"),n("2877")),v=Object(h["a"])(g,a,i,!1,null,"1592141f",null);t["default"]=v.exports},"333d":function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[n("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},i=[];n("a9e3");Math.easeInOutQuad=function(e,t,n,a){return e/=a/2,e<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function o(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(e,t,n){var a=s(),i=e-a,l=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=l;var s=Math.easeInOutQuad(c,a,i,t);o(s),c<t?r(e):n&&"function"===typeof n&&n()};u()}var c={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&l(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&l(0,800)}}},u=c,d=(n("e498"),n("2877")),f=Object(d["a"])(u,a,i,!1,null,"6af373ef",null);t["a"]=f.exports},4817:function(e,t,n){"use strict";var a=n("f2f2"),i=n.n(a);i.a},6724:function(e,t,n){"use strict";n("8d41");var a="@@wavesContext";function i(e,t){function n(n){var a=Object.assign({},t.value),i=Object.assign({ele:e,type:"hit",color:"rgba(0, 0, 0, 0.15)"},a),r=i.ele;if(r){r.style.position="relative",r.style.overflow="hidden";var o=r.getBoundingClientRect(),s=r.querySelector(".waves-ripple");switch(s?s.className="waves-ripple":(s=document.createElement("span"),s.className="waves-ripple",s.style.height=s.style.width=Math.max(o.width,o.height)+"px",r.appendChild(s)),i.type){case"center":s.style.top=o.height/2-s.offsetHeight/2+"px",s.style.left=o.width/2-s.offsetWidth/2+"px";break;default:s.style.top=(n.pageY-o.top-s.offsetHeight/2-document.documentElement.scrollTop||document.body.scrollTop)+"px",s.style.left=(n.pageX-o.left-s.offsetWidth/2-document.documentElement.scrollLeft||document.body.scrollLeft)+"px"}return s.style.backgroundColor=i.color,s.className="waves-ripple z-active",!1}}return e[a]?e[a].removeHandle=n:e[a]={removeHandle:n},n}var r={bind:function(e,t){e.addEventListener("click",i(e,t),!1)},update:function(e,t){e.removeEventListener("click",e[a].removeHandle,!1),e.addEventListener("click",i(e,t),!1)},unbind:function(e){e.removeEventListener("click",e[a].removeHandle,!1),e[a]=null,delete e[a]}},o=function(e){e.directive("waves",r)};window.Vue&&(window.waves=r,Vue.use(o)),r.install=o;t["a"]=r},"8d41":function(e,t,n){},a434:function(e,t,n){"use strict";var a=n("23e7"),i=n("23cb"),r=n("a691"),o=n("50c4"),s=n("7b0b"),l=n("65f0"),c=n("8418"),u=n("1dde"),d=n("ae40"),f=u("splice"),p=d("splice",{ACCESSORS:!0,0:0,1:2}),m=Math.max,g=Math.min,h=9007199254740991,v="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!f||!p},{splice:function(e,t){var n,a,u,d,f,p,y=s(this),b=o(y.length),w=i(e,b),x=arguments.length;if(0===x?n=a=0:1===x?(n=0,a=b-w):(n=x-2,a=g(m(r(t),0),b-w)),b+n-a>h)throw TypeError(v);for(u=l(y,a),d=0;d<a;d++)f=w+d,f in y&&c(u,d,y[f]);if(u.length=a,n<a){for(d=w;d<b-a;d++)f=d+a,p=d+n,f in y?y[p]=y[f]:delete y[p];for(d=b;d>b-a+n;d--)delete y[d-1]}else if(n>a)for(d=b-a;d>w;d--)f=d+a-1,p=d+n-1,f in y?y[p]=y[f]:delete y[p];for(d=0;d<n;d++)y[d+w]=arguments[d+2];return y.length=b-a+n,u}})},a9e3:function(e,t,n){"use strict";var a=n("83ab"),i=n("da84"),r=n("94ca"),o=n("6eeb"),s=n("5135"),l=n("c6b6"),c=n("7156"),u=n("c04e"),d=n("d039"),f=n("7c73"),p=n("241c").f,m=n("06cf").f,g=n("9bf2").f,h=n("58a8").trim,v="Number",y=i[v],b=y.prototype,w=l(f(b))==v,x=function(e){var t,n,a,i,r,o,s,l,c=u(e,!1);if("string"==typeof c&&c.length>2)if(c=h(c),t=c.charCodeAt(0),43===t||45===t){if(n=c.charCodeAt(2),88===n||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:a=2,i=49;break;case 79:case 111:a=8,i=55;break;default:return+c}for(r=c.slice(2),o=r.length,s=0;s<o;s++)if(l=r.charCodeAt(s),l<48||l>i)return NaN;return parseInt(r,a)}return+c};if(r(v,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var S,k=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof k&&(w?d((function(){b.valueOf.call(n)})):l(n)!=v)?c(new y(x(t)),n,k):x(t)},_=a?p(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),N=0;_.length>N;N++)s(y,S=_[N])&&!s(k,S)&&g(k,S,m(y,S));k.prototype=b,b.constructor=k,o(i,v,k)}},c740:function(e,t,n){"use strict";var a=n("23e7"),i=n("b727").findIndex,r=n("44d2"),o=n("ae40"),s="findIndex",l=!0,c=o(s);s in[]&&Array(1)[s]((function(){l=!1})),a({target:"Array",proto:!0,forced:l||!c},{findIndex:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),r(s)},e498:function(e,t,n){"use strict";var a=n("1c18"),i=n.n(a);i.a},f2f2:function(e,t,n){}}]);
|