1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-60ccbd56"],{"09f4":function(t,e,a){"use strict";a.d(e,"a",(function(){return l})),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 s(t){document.documentElement.scrollTop=t,document.body.parentNode.scrollTop=t,document.body.scrollTop=t}function n(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function l(t,e,a){var l=n(),o=t-l,r=20,c=0;e="undefined"===typeof e?500:e;var u=function t(){c+=r;var n=Math.easeInOutQuad(c,l,o,e);s(n),c<e?i(t):a&&"function"===typeof a&&a()};u()}},"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",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.getList}}),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内容"}},[t._l(t.anchors.qaQuestions,(function(e,i){return a("div",{staticClass:"mistake-content"},[a("div",{staticClass:"mistake-left"},[a("div",[t._v("副标题")]),a("div",{staticClass:"qa-desc"},[a("el-input",{staticStyle:{width:"100px","margin-right":"10px"},attrs:{type:"text",placeholder:"序号"},model:{value:e.sort,callback:function(a){t.$set(e,"sort",a)},expression:"item.sort"}}),a("el-input",{attrs:{type:"text",placeholder:"请输入副标题"},model:{value:e.title,callback:function(a){t.$set(e,"title",a)},expression:"item.title"}})],1),a("div",[t._v("内容")]),a("el-input",{attrs:{rows:4,type:"textarea",placeholder:"内容"},model:{value:e.content,callback:function(a){t.$set(e,"content",a)},expression:"item.content"}})],1),a("div",{staticClass:"mistake-right"},[a("el-button",{attrs:{type:"danger"},on:{click:function(e){return t.handleDel(i)}}},[t._v("删除")])],1)])})),a("div",{staticClass:"mistake-btn"},[a("el-button",{attrs:{type:"primary"},on:{click:t.handleAdd}},[t._v("添加")])],1)],2),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",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.imageUrl,alt:""}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),a("span",{staticStyle:{color:"red"}},[t._v("(请上传zip格式的文件图片)")])],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",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.imageUrls,alt:""}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),a("span",{staticStyle:{color:"red"}},[t._v("(本行程请上传,ppt,word,pdf格式的文件)")])],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内容"}},[t._l(t.anchors.qaQuestions,(function(e,i){return a("div",{staticClass:"mistake-content"},[a("div",{staticClass:"mistake-left"},[a("div",[t._v("副标题")]),a("div",{staticClass:"qa-desc"},[a("el-input",{staticStyle:{width:"100px","margin-right":"10px"},attrs:{type:"text",placeholder:"序号"},model:{value:e.sort,callback:function(a){t.$set(e,"sort",a)},expression:"item.sort"}}),a("el-input",{attrs:{type:"text",placeholder:"请输入副标题"},model:{value:e.title,callback:function(a){t.$set(e,"title",a)},expression:"item.title"}})],1),a("div",[t._v("内容")]),a("el-input",{attrs:{rows:4,type:"textarea",placeholder:"内容"},model:{value:e.content,callback:function(a){t.$set(e,"content",a)},expression:"item.content"}})],1),a("div",{staticClass:"mistake-right"},[a("el-button",{attrs:{type:"danger"},on:{click:function(e){return t.handleDel(i)}}},[t._v("删除")])],1)])})),a("div",{staticClass:"mistake-btn"},[a("el-button",{attrs:{type:"primary"},on:{click:t.handleAdd}},[t._v("添加")])],1)],2),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",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.imageUrl,alt:""}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),a("span",{staticStyle:{color:"red"}},[t._v("(请上传zip格式的文件图片)")])],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",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.imageUrls,alt:""}}):a("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),a("span",{staticStyle:{color:"red"}},[t._v("(本行程请上传,ppt,word,pdf格式的文件)")])],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)},s=[],n=a("5530"),l=(a("4de4"),a("4e82"),a("d3b7"),a("3ca3"),a("ddb0"),a("2b3d"),a("bf19"),a("9861"),a("67f2")),o={name:"GetQa",components:{Pagination:l["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:{qaQuestions:[]},getQaCitys:{}}},created:function(){this.listQuery.status=this.$route.query.status||null,this.listQuery.content=this.$route.query.content||null,this.getList(),this.getQaCity()},methods:{handleAdd:function(){this.anchors.qaQuestions.push({sort:this.anchors.qaQuestions[this.anchors.qaQuestions.length-1].sort+1,title:"",content:""})},handleDel:function(t){1!=this.anchors.qaQuestions.length?this.anchors.qaQuestions=this.anchors.qaQuestions.filter((function(e,a){return a!==t})):this.$message({message:"至少保留一条",type:"warning"})},getList: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={qaQuestions:[{sort:1,title:"",content:""}]},this.dialogCreate=!0},onEdit:function(t){t.qaQuestions.length?this.anchors=Object(n["a"])({},t):this.anchors=Object(n["a"])(Object(n["a"])({},t),{},{qaQuestions:[{sort:1,title:"",content:""}]}),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.getList()})).catch((function(){t.loading=!1}))}},onDel:function(t){var e=this;this.$axios.post("/admin/qa/delQa",{id:t.id}).then((function(){e.getList()})).catch((function(){}))},getQaCity:function(){var t=this;this.$axios.post("/admin/qacity/getQaCity").then((function(e){t.getQaCitys=e.data,t.getList()})).catch((function(){}))},updateSort:function(t){var e=this;this.$axios.post("/admin/qa/editQa",{id:t.id,sort:t.sort}).then((function(){e.getList()})).catch((function(){}))},updateStatus:function(t){var e=this;this.$axios.post("/admin/qa/editQa",{id:t.id,status:t.status}).then((function(){e.getList()})).catch((function(){}))}}},r=o,c=(a("9d18"),a("2877")),u=Object(c["a"])(r,i,s,!1,null,"6804571e",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)},s=[],n=(a("a9e3"),a("09f4")),l={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(n["a"])(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&Object(n["a"])(0,800)}}},o=l,r=(a("7d30"),a("2877")),c=Object(r["a"])(o,i,s,!1,null,"28fdfbeb",null);e["a"]=c.exports},"7a17":function(t,e,a){},"7d30":function(t,e,a){"use strict";a("7a17")},"9d18":function(t,e,a){"use strict";a("f7b2")},f7b2:function(t,e,a){}}]); |