1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4d7588d0"],{"025d":function(t,e,a){},"09f4":function(t,e,a){"use strict";a.d(e,"a",(function(){return s})),Math.easeInOutQuad=function(t,e,a,i){return t/=i/2,t<1?a/2*t*t+e:(t--,-a/2*(t*(t-2)-1)+e)};var i=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)}}();function n(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function l(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function s(t,e,a){var s=l(),o=t-s,r=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=r;var l=Math.easeInOutQuad(c,s,o,e);n(l),c<e?i(t):a&&"function"===typeof a&&a()};u()}},"1c8c":function(t,e,a){"use strict";a("025d")},"4c7f":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"标题"},model:{value:t.listQuery.title,callback:function(e){t.$set(t.listQuery,"title",e)},expression:"listQuery.title"}}),a("el-select",{staticClass:"filter-item",staticStyle:{width:"120px"},attrs:{filterable:"",placeholder:"状态"},model:{value:t.listQuery.status,callback:function(e){t.$set(t.listQuery,"status",e)},expression:"listQuery.status"}},[a("el-option",{key:"",attrs:{label:"请选择",value:""}}),t._l(t.statusArr,(function(t,e){return a("el-option",{key:e,attrs:{label:t,value:e}})}))],2),a("el-button",{staticClass:"filter-item search",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getQa}},[t._v("搜索")]),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-circle-plus"},on:{click:t.onAdd}},[t._v("添加")])],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.list,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{align:"center",fixed:"",label:"ID",width:"80",prop:"id"}}),a("el-table-column",{attrs:{align:"center",fixed:"",label:"城市",width:"80",prop:"qaCitys.city_name"}}),a("el-table-column",{attrs:{align:"center",fixed:"",label:"标题",width:"280",prop:"title"}}),a("el-table-column",{attrs:{align:"center",fixed:"",label:"内容",width:"380",prop:"content"}}),a("el-table-column",{attrs:{align:"center",label:"状态",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(a){return t.updateStatus(e.row)}},model:{value:e.row.status,callback:function(a){t.$set(e.row,"status",a)},expression:"scope.row.status"}})]}}])}),a("el-table-column",{attrs:{align:"center",width:"220",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(a){return t.onEdit(e.row)}}},[t._v("编辑")]),a("el-button",{attrs:{type:"danger",size:"small",icon:"el-icon-delete"},on:{click:function(a){return t.onDel(e.row)}}},[t._v("删除")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total > 0"}],attrs:{total:t.total,page:t.listQuery.page,limit:t.listQuery.limit},on:{"update:page":function(e){return t.$set(t.listQuery,"page",e)},"update:limit":function(e){return t.$set(t.listQuery,"limit",e)},pagination:t.getShortcutContent}}),a("el-dialog",{attrs:{title:"添加QA",visible:t.dialogCreate},on:{"update:visible":function(e){t.dialogCreate=e}}},[a("el-form",{attrs:{"label-width":"120px",model:t.anchors}},[a("el-form-item",{attrs:{label:"城市"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.anchors.city_id,callback:function(e){t.$set(t.anchors,"city_id",e)},expression:"anchors.city_id"}},[a("el-form-item",{staticStyle:{display:"inline-flex","text-align":"left",width:"770px"}},t._l(t.getQaCitys,(function(t){return a("el-option",{key:t.city_id,staticStyle:{display:"inline-flex","word-break":"break-all"},attrs:{label:t.city_name,value:t.city_id}})})),1)],1)],1),a("el-form-item",{attrs:{label:"旅游路线"}},[a("el-input",{attrs:{type:"text",placeholder:"请输入旅游路线"},model:{value:t.anchors.title,callback:function(e){t.$set(t.anchors,"title",e)},expression:"anchors.title"}})],1),a("el-form-item",{attrs:{label:"QA内容"}},[a("el-input",{staticStyle:{height:"120px"},attrs:{rows:6,type:"textarea",placeholder:"QA内容"},model:{value:t.anchors.content,callback:function(e){t.$set(t.anchors,"content",e)},expression:"anchors.content"}})],1),a("el-form-item",{attrs:{label:"状态"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:t.anchors.status,callback:function(e){t.$set(t.anchors,"status",e)},expression:"anchors.status"}})],1),a("el-form-item",{attrs:{label:"上传图片"}},[a("el-upload",{staticClass:"avatar-uploader",attrs:{action:"admin/index/avatar","show-file-list":!1,"on-success":t.handleAvatarSuccess}},[t.imageUrl?a("img",{staticClass:"avatar",attrs:{src:t.imageUrl,alt:""}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),a("el-form-item",{attrs:{label:"上传行程"}},[a("el-upload",{staticClass:"avatar-uploader",attrs:{action:"admin/index/avatar","show-file-list":!1,"on-success":t.handleSuccess}},[t.imageUrls?a("img",{staticClass:"avatar",attrs:{src:t.imageUrls,alt:""}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"primary"},on:{click:t.onSave}},[t._v("保 存")])],1)],1),a("el-dialog",{attrs:{title:"编辑内容",visible:t.dialogEdit},on:{"update:visible":function(e){t.dialogEdit=e}}},[a("el-form",{attrs:{"label-width":"120px",model:t.anchors}},[a("el-form-item",{attrs:{label:"城市"}},[a("el-select",{attrs:{placeholder:"请选择"},model:{value:t.anchors.city_id,callback:function(e){t.$set(t.anchors,"city_id",e)},expression:"anchors.city_id"}},[a("el-form-item",{staticStyle:{display:"inline-flex","text-align":"left",width:"770px"}},t._l(t.getQaCitys,(function(t){return a("el-option",{key:t.city_id,staticStyle:{width:"250px",display:"inline-flex","word-break":"break-all"},attrs:{label:t.city_name,value:t.city_id}})})),1)],1)],1),a("el-form-item",{attrs:{label:"旅游路线"}},[a("el-input",{attrs:{type:"text",placeholder:"请输入旅游路线"},model:{value:t.anchors.title,callback:function(e){t.$set(t.anchors,"title",e)},expression:"anchors.title"}})],1),a("el-form-item",{attrs:{label:"QA内容"}},[a("el-input",{staticStyle:{height:"120px"},attrs:{rows:6,type:"textarea",placeholder:"QA内容"},model:{value:t.anchors.content,callback:function(e){t.$set(t.anchors,"content",e)},expression:"anchors.content"}})],1),a("el-form-item",{attrs:{label:"状态"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:t.anchors.status,callback:function(e){t.$set(t.anchors,"status",e)},expression:"anchors.status"}})],1),a("el-form-item",{attrs:{label:"上传图片"}},[a("el-upload",{staticClass:"avatar-uploader",attrs:{action:"admin/index/avatar","show-file-list":!1,"on-success":t.handleAvatarSuccess}},[t.imageUrl?a("img",{staticClass:"avatar",attrs:{src:t.imageUrl,alt:""}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1),a("el-form-item",{attrs:{label:"上传行程"}},[a("el-upload",{staticClass:"avatar-uploader",attrs:{action:"admin/index/avatar","show-file-list":!1,"on-success":t.handleSuccess}},[t.imageUrls?a("img",{staticClass:"avatar",attrs:{src:t.imageUrls,alt:""}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})])],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"primary"},on:{click:t.onSave}},[t._v("保 存")])],1)],1)],1)},n=[],l=a("5530"),s=(a("4e82"),a("d3b7"),a("3ca3"),a("ddb0"),a("2b3d"),a("bf19"),a("9861"),a("67f2")),o={name:"GetQa",components:{Pagination:s["a"]},data:function(){return{statusArr:{0:"禁用",1:"启用"},list:[],total:0,loading:!1,listLoading:!0,listQuery:{page:1,limit:10,status:null,city_name:"",title:"",content:"",img_zip:"",trip_zip:""},dialogCreate:!1,dialogEdit:!1,item:{},imageUrl:"",imageUrls:"",anchors:{},getQaCitys:{}}},created:function(){this.listQuery.status=this.$route.query.status||null,this.listQuery.content=this.$route.query.content||null,this.getQa(),this.getQaCity()},methods:{getQa:function(){var t=this;this.listLoading=!0,this.$axios.get("/admin/qa/getQa",{params:this.listQuery}).then((function(e){t.list=e.data.data,t.total=e.data.total,t.listLoading=!1})).catch((function(){t.listLoading=!1}))},handleAvatarSuccess:function(t,e){this.imageUrl=URL.createObjectURL(e.raw),this.anchors.img_zip=this.imageUrl,console.log(this.imageUrl)},handleSuccess:function(t,e){this.imageUrls=URL.createObjectURL(e.raw),this.anchors.trip_zip=this.imageUrls},onAdd:function(){this.anchors={},this.dialogCreate=!0},onEdit:function(t){this.anchors=Object(l["a"])({},t),this.dialogEdit=!0},onSave:function(){var t=this;if(!this.loading){this.loading=!0;var e=this.dialogCreate?"/admin/qa/addQa":"/admin/qa/editQa";this.$axios.post(e,this.anchors).then((function(){t.dialogCreate=!1,t.dialogEdit=!1,t.loading=!1,t.getQa()})).catch((function(){t.loading=!1}))}},onDel:function(t){var e=this;this.$axios.post("/admin/qa/delQa",{id:t.id}).then((function(){e.getQa()})).catch((function(){}))},getQaCity:function(){var t=this;this.$axios.post("/admin/qacity/getQaCity").then((function(e){t.getQaCitys=e.data,t.getQa()})).catch((function(){}))},updateSort:function(t){var e=this;this.$axios.post("/admin/qa/editQa",{id:t.id,sort:t.sort}).then((function(){e.getQa()})).catch((function(){}))},updateStatus:function(t){var e=this;this.$axios.post("/admin/qa/editQa",{id:t.id,status:t.status}).then((function(){e.getQa()})).catch((function(){}))}}},r=o,c=(a("1c8c"),a("2877")),u=Object(c["a"])(r,i,n,!1,null,"f87be822",null);e["default"]=u.exports},"67f2":function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[a("el-pagination",t._b({attrs:{background:t.background,"current-page":t.currentPage,"page-size":t.pageSize,layout:t.layout,"page-sizes":t.pageSizes,total:t.total},on:{"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.pageSize=e},"update:page-size":function(e){t.pageSize=e},"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}},"el-pagination",t.$attrs,!1))],1)},n=[],l=(a("a9e3"),a("09f4")),s={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(t){this.$emit("update:page",t)}},pageSize:{get:function(){return this.limit},set:function(t){this.$emit("update:limit",t)}}},methods:{handleSizeChange:function(t){this.$emit("pagination",{page:this.currentPage,limit:t}),this.autoScroll&&Object(l["a"])(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&Object(l["a"])(0,800)}}},o=s,r=(a("7d30"),a("2877")),c=Object(r["a"])(o,i,n,!1,null,"28fdfbeb",null);e["a"]=c.exports},"7a17":function(t,e,a){},"7d30":function(t,e,a){"use strict";a("7a17")}}]); |