travel/service/public/static/js/chunk-55c2cffb.d557a9da.js

1 line
18 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-55c2cffb"],{"058d":function(t,e,i){"use strict";i("34d8")},"09f4":function(t,e,i){"use strict";i.d(e,"a",(function(){return o})),Math.easeInOutQuad=function(t,e,i,a){return t/=a/2,t<1?i/2*t*t+e:(t--,-i/2*(t*(t-2)-1)+e)};var a=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 s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(t,e,i){var o=s(),l=t-o,c=20,r=0;e="undefined"===typeof e?500:e;var d=function(){r+=c;var t=Math.easeInOutQuad(r,o,l,e);n(t),r<e?a(d):i&&"function"===typeof i&&i()};d()}},"22d3":function(t,e,i){"use strict";i("2c26")},"2c26":function(t,e,i){},"34d8":function(t,e,i){},"4c7f":function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("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"}}),i("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"}},[i("el-option",{key:"",attrs:{label:"请选择",value:""}}),t._l(t.statusArr,(function(t,e){return i("el-option",{key:e,attrs:{label:t,value:e}})}))],2),i("el-button",{staticClass:"filter-item search",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getList}},[t._v("搜索")]),i("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-circle-plus"},on:{click:t.onAdd}},[t._v("添加")])],1),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%","padding-bottom":"60px !important"},attrs:{data:t.list,border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{align:"center",label:"ID",width:"80",prop:"id"}}),i("el-table-column",{attrs:{align:"center",label:"城市",width:"80",prop:"qaCitys.city_name"}}),i("el-table-column",{staticStyle:{overflow:"hidden"},attrs:{align:"center",label:"标题",width:"280"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("div",{staticClass:"ellipsis-text"},[t._v(t._s(e.row.title))])]}}])}),i("el-table-column",{attrs:{align:"center",label:"状态",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(i){return t.updateStatus(e.row)}},model:{value:e.row.status,callback:function(i){t.$set(e.row,"status",i)},expression:"scope.row.status"}})]}}])}),i("el-table-column",{attrs:{align:"center",width:"220",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(i){return t.onEdit(e.row)}}},[t._v("编辑")]),i("el-button",{attrs:{type:"danger",size:"small",icon:"el-icon-delete"},on:{click:function(i){return t.onDel(e.row)}}},[t._v("删除")])]}}])})],1),i("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}}),i("el-dialog",{attrs:{title:"添加QA",visible:t.dialogCreate},on:{"update:visible":function(e){t.dialogCreate=e}}},[i("el-form",{attrs:{"label-width":"120px",model:t.anchors}},[i("el-form-item",{attrs:{label:"城市"}},[i("el-select",{attrs:{placeholder:"请选择"},model:{value:t.anchors.city_id,callback:function(e){t.$set(t.anchors,"city_id",e)},expression:"anchors.city_id"}},[i("el-form-item",{staticStyle:{display:"inline-flex","text-align":"left",width:"770px"}},t._l(t.getQaCitys,(function(t){return i("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),i("el-form-item",{attrs:{label:"旅游路线"}},[i("el-input",{attrs:{type:"text",placeholder:"请输入旅游路线"},model:{value:t.anchors.title,callback:function(e){t.$set(t.anchors,"title",e)},expression:"anchors.title"}})],1),i("el-form-item",{attrs:{label:"QA内容"}},[t._l(t.anchors.qaQuestions,(function(e,a){return i("div",{staticClass:"mistake-content"},[i("div",{staticClass:"mistake-left"},[i("div",[t._v("副标题")]),i("div",{staticClass:"qa-desc"},[i("el-input",{staticStyle:{width:"100px","margin-right":"10px"},attrs:{type:"text",placeholder:"序号"},model:{value:e.sort,callback:function(i){t.$set(e,"sort",i)},expression:"item.sort"}}),i("el-input",{attrs:{type:"text",placeholder:"请输入副标题"},model:{value:e.title,callback:function(i){t.$set(e,"title",i)},expression:"item.title"}})],1),i("div",[t._v("内容")]),i("div",{staticStyle:{border:"1px solid #ccc"}},[i("myEditor",{model:{value:e.content,callback:function(i){t.$set(e,"content",i)},expression:"item.content"}})],1)]),i("div",{staticClass:"mistake-right"},[i("el-button",{attrs:{type:"danger"},on:{click:function(e){return t.handleDel(a)}}},[t._v("删除")])],1)])})),i("div",{staticClass:"mistake-btn"},[i("el-button",{attrs:{type:"primary"},on:{click:t.handleAdd}},[t._v("添加")])],1)],2),i("el-form-item",{attrs:{label:"状态"}},[i("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),i("el-form-item",{attrs:{label:"上传图片"}},[i("el-upload",{staticClass:"avatar-uploader",attrs:{action:"admin/upload/index","show-file-list":!1,"on-success":t.handleAvatarSuccess}},[t.anchors.img_zip?i("div",{staticClass:"img-box"},[i("i",{staticClass:"close el-icon-close",on:{click:function(e){return e.stopPropagation(),t.handleClose("img_zip")}}}),t.checkIfUrlContainsImage(t.anchors.img_zip)?i("img",{staticClass:"avatar",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.anchors.img_zip,alt:""}}):i("i",{staticClass:"el-icon-folder"})]):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),i("span",[t._v(t._s(t.anchors.img_zip))]),i("div",{staticStyle:{color:"red"}},[t._v("(请上传zip格式的文件图片)")])],1),i("el-form-item",{attrs:{label:"上传行程"}},[i("el-upload",{staticClass:"avatar-uploader",attrs:{action:"admin/upload/index","show-file-list":!1,"on-success":t.handleSuccess}},[t.anchors.trip_zip?i("div",{staticClass:"img-box"},[i("i",{staticClass:"close el-icon-close",on:{click:function(e){return e.stopPropagation(),t.handleClose("trip_zip")}}}),t.checkIfUrlContainsImage(t.anchors.trip_zip)?i("img",{staticClass:"avatar",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.anchors.trip_zip,alt:""}}):i("i",{staticClass:"el-icon-folder"})]):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),i("span",[t._v(t._s(t.anchors.trip_zip))]),i("span",{staticStyle:{color:"red"}},[t._v("(本行程请上传,ppt,word,pdf格式的文件)")])],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{type:"primary"},on:{click:t.onSave}},[t._v("保 存")])],1)],1),i("el-dialog",{attrs:{title:"编辑内容",visible:t.dialogEdit},on:{"update:visible":function(e){t.dialogEdit=e}}},[i("el-form",{attrs:{"label-width":"120px",model:t.anchors}},[i("el-form-item",{attrs:{label:"城市"}},[i("el-select",{attrs:{placeholder:"请选择"},model:{value:t.anchors.city_id,callback:function(e){t.$set(t.anchors,"city_id",e)},expression:"anchors.city_id"}},[i("el-form-item",{staticStyle:{display:"inline-flex","text-align":"left",width:"770px"}},t._l(t.getQaCitys,(function(t){return i("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),i("el-form-item",{attrs:{label:"旅游路线"}},[i("el-input",{attrs:{type:"text",placeholder:"请输入旅游路线"},model:{value:t.anchors.title,callback:function(e){t.$set(t.anchors,"title",e)},expression:"anchors.title"}})],1),i("el-form-item",{attrs:{label:"QA内容"}},[t._l(t.anchors.qaQuestions,(function(e,a){return i("div",{staticClass:"mistake-content"},[i("div",{staticClass:"mistake-left"},[i("div",[t._v("副标题")]),i("div",{staticClass:"qa-desc"},[i("el-input",{staticStyle:{width:"100px","margin-right":"10px"},attrs:{type:"text",placeholder:"序号"},model:{value:e.sort,callback:function(i){t.$set(e,"sort",i)},expression:"item.sort"}}),i("el-input",{attrs:{type:"text",placeholder:"请输入副标题"},model:{value:e.title,callback:function(i){t.$set(e,"title",i)},expression:"item.title"}})],1),i("div",[t._v("内容")]),i("div",{staticStyle:{border:"1px solid #ccc"}},[i("myEditor",{model:{value:e.content,callback:function(i){t.$set(e,"content",i)},expression:"item.content"}})],1)]),i("div",{staticClass:"mistake-right"},[i("el-button",{attrs:{type:"danger"},on:{click:function(e){return t.handleDel(a)}}},[t._v("删除")])],1)])})),i("div",{staticClass:"mistake-btn"},[i("el-button",{attrs:{type:"primary"},on:{click:t.handleAdd}},[t._v("添加")])],1)],2),i("el-form-item",{attrs:{label:"状态"}},[i("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),i("el-form-item",{attrs:{label:"上传图片"}},[i("el-upload",{staticClass:"avatar-uploader",attrs:{action:"admin/upload/index","show-file-list":!1,"on-success":t.handleAvatarSuccess}},[t.anchors.img_zip?i("div",{staticClass:"img-box"},[i("i",{staticClass:"close el-icon-close",on:{click:function(e){return e.stopPropagation(),t.handleClose("img_zip")}}}),t.checkIfUrlContainsImage(t.anchors.img_zip)?i("img",{staticClass:"avatar",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.anchors.img_zip,alt:""}}):i("i",{staticClass:"el-icon-folder"})]):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),i("span",[t._v(t._s(t.anchors.img_zip))]),i("div",{staticStyle:{color:"red"}},[t._v("(请上传zip格式的文件图片)")])],1),i("el-form-item",{attrs:{label:"上传行程"}},[i("el-upload",{staticClass:"avatar-uploader",attrs:{action:"admin/upload/index","show-file-list":!1,"on-success":t.handleSuccess}},[t.anchors.trip_zip?i("div",{staticClass:"img-box"},[i("i",{staticClass:"close el-icon-close",on:{click:function(e){return e.stopPropagation(),t.handleClose("trip_zip")}}}),t.checkIfUrlContainsImage(t.anchors.trip_zip)?i("img",{staticClass:"avatar",staticStyle:{width:"100px",height:"100px"},attrs:{src:t.anchors.trip_zip,alt:""}}):i("i",{staticClass:"el-icon-folder"})]):i("i",{staticClass:"el-icon-plus avatar-uploader-icon"})]),i("span",[t._v(t._s(t.anchors.trip_zip))]),i("div",{staticStyle:{color:"red"}},[t._v("(本行程请上传,ppt,word,pdf格式的文件)")])],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("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=[],s=i("5530"),o=(i("99af"),i("4de4"),i("4e82"),i("d3b7"),i("8a79"),i("67f2")),l=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"relative",staticStyle:{border:"1px solid #ccc"}},[t.disabled?i("div",{staticClass:"disable-layer"}):t._e(),i("Toolbar",{ref:"toolbar",staticStyle:{"border-bottom":"1px solid #ccc"},attrs:{editor:t.editor,"default-config":t.toolbarConfig,mode:t.mode}}),i("Editor",{staticStyle:{height:"300px","overflow-y":"hidden"},attrs:{value:t.value,"default-config":t.editorConfig,mode:t.mode},on:{input:t.handleInput,onCreated:t.onCreated}})],1)},c=[],r=(i("af93"),i("4e15")),d=(i("560e"),{name:"WangEditor",components:{Editor:r["a"],Toolbar:r["b"]},props:{value:String,disabled:Boolean,cusHeight:{type:String,default:"250px"}},data:function(){return{editor:null,html:"",toolbarConfig:{toolbarKeys:["headerSelect","blockquote","header1","header2","header3","|","bold","underline","italic","through","color","bgColor","clearStyle","|","bulletedList","numberedList","todo","justifyLeft","justifyRight","justifyCenter","|","insertLink","insertTable"]},editorConfig:{placeholder:"请输入内容..."},mode:"default"}},mounted:function(){},created:function(){},beforeDestroy:function(){var t=this.editor;null!=t&&t.destroy()},methods:{onCreated:function(t){this.editor=Object.seal(t)},handleInput:function(t){this.$emit("input",t)}}}),u=d,p=(i("058d"),i("2877")),h=Object(p["a"])(u,l,c,!1,null,"25113710",null),f=h.exports,m={name:"getQa",components:{Pagination:o["a"],myEditor:f},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:{},anchors:{qaQuestions:[],img_zip:"",trip_zip:""},getQaCitys:{}}},created:function(){this.listQuery.status=this.$route.query.status||null,this.listQuery.content=this.$route.query.content||null,this.getList(),this.getQaCity()},methods:{checkIfUrlContainsImage:function(t){var e=[".jpg",".jpeg",".png",".gif",".bmp",".svg",".webp"];return console.log("========fffff===="+e.some((function(e){return t.toLowerCase().endsWith(e)}))),e.some((function(e){return t.toLowerCase().endsWith(e)}))},handleClose:function(t){this.anchors[t]=""},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,i){return i!==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){console.log("====1111==="+t),this.anchors.img_zip="".concat(window.location.protocol,"//").concat(window.location.host).concat(t.data),console.log("====111122222==="+this.anchors.img_zip)},handleSuccess:function(t,e){console.log("====222222==="+t),this.anchors.trip_zip="".concat(window.location.protocol,"//").concat(window.location.host).concat(t.data),console.log("====111122222==="+this.anchors.trip_zip)},onAdd:function(){this.anchors.qaQuestions=[{sort:1,title:"",content:""}],this.anchors.img_zip="",this.anchors.trip_zip="",this.dialogCreate=!0},onEdit:function(t){t.qaQuestions.length?this.anchors=Object(s["a"])({},t):this.anchors=Object(s["a"])(Object(s["a"])({},t),{},{qaQuestions:[{sort:1,title:"",content:""}]}),this.anchors.img_zip=t.img_zip,this.anchors.trip_zip=t.trip_zip,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(){}))}},mounted:function(){var t=this;setTimeout((function(){t.html="<p>模拟 Ajax 异步设置内容 HTML</p>"}),1500)},beforeDestroy:function(){var t=this.editor;null!=t&&t.destroy()}},g=m,v=(i("22d3"),i("593b"),Object(p["a"])(g,a,n,!1,null,"14eba1da",null));e["default"]=v.exports},"67f2":function(t,e,i){"use strict";var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"pagination-container",class:{hidden:t.hidden}},[i("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=[],s=(i("a9e3"),i("09f4")),o={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(s["a"])(0,800)},handleCurrentChange:function(t){this.$emit("pagination",{page:t,limit:this.pageSize}),this.autoScroll&&Object(s["a"])(0,800)}}},l=o,c=(i("7d30"),i("2877")),r=Object(c["a"])(l,a,n,!1,null,"28fdfbeb",null);e["a"]=r.exports},"7a17":function(t,e,i){},"7d30":function(t,e,i){"use strict";i("7a17")}}]);