You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
8.1 KiB
1 lines
8.1 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3c68bca3","chunk-2d0b5d27"],{"1b11":function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{attrs:{title:e.isUpdate?"修改广告位":"添加广告位",visible:e.visible,width:"600px","destroy-on-close":!0,"lock-scroll":!1,"custom-class":"ele-dialog-form"},on:{"update:visible":e.updateVisible}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"82px"}},[a("el-row",{attrs:{gutter:15}},[a("el-col",[a("el-form-item",{attrs:{label:"名称:",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入广告位名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"广告标识:",prop:"name"}},[a("el-input",{attrs:{disabled:!!e.isUpdate,placeholder:"请输入广告位前台调用标识",clearable:""},model:{value:e.form.idf,callback:function(t){e.$set(e.form,"idf",t)},expression:"form.idf"}})],1),a("el-form-item",{attrs:{label:"分类:"}},[a("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择广告位分类"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.tagLists,(function(t){return a("el-option",{key:t.id,attrs:{label:t.name,value:t.id}},[a("span",{staticStyle:{"padding-left":"8px"}},[e._v(e._s(t.name))])])})),1)],1),a("el-form-item",{attrs:{label:"排序号:",prop:"sortNumber"}},[a("el-input-number",{staticClass:"ele-fluid ele-text-left",attrs:{"controls-position":"right",min:0,placeholder:"请输入排序号"},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),a("el-form-item",{attrs:{label:"描述:"}},[a("el-input",{attrs:{placeholder:"请输入描述",clearable:""},model:{value:e.form.desc,callback:function(t){e.$set(e.form,"desc",t)},expression:"form.desc"}})],1)],1)],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){return e.updateVisible(!1)}}},[e._v("取消 ")]),a("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:e.save}},[e._v("保存 ")])],1)],1)},o=[],l={name:"AdEdit",props:{visible:Boolean,data:Object},data:function(){return{form:Object.assign({},this.data),rules:{name:[{required:!0,message:"请输入广告位名称",trigger:"blur"}],sort:[{required:!0,message:"请输入广告位排序",trigger:"blur"}]},loading:!1,isUpdate:!1,tagLists:[]}},watch:{data:function(){this.data?(this.form=Object.assign({},this.data),console.log(this.form),this.isUpdate=!0):(this.form={},this.isUpdate=!1)}},mounted:function(){this.getTagLists()},methods:{afterUploadImage:function(e){0!=e.code||""==e.url?this.$message.error(e.msg):this.$set(this.form,"url",e.url)},save:function(){var e=this;this.$refs["form"].validate((function(t){if(!t)return!1;e.loading=!0,e.$http.post("/Ad/"+(e.isUpdate?"edit":"add"),e.form).then((function(t){e.loading=!1,0===t.data.code?(e.$message({type:"success",message:t.data.msg}),e.isUpdate||(e.form={}),e.updateVisible(!1),e.$emit("done")):e.$message.error(t.data.msg)})).catch((function(t){e.loading=!1,e.$message.error(t.message)}))}))},updateVisible:function(e){this.$emit("update:visible",e)},getTagLists:function(){var e=this;this.$http.get("/Ad/getType").then((function(t){0===t.data.code&&(e.tagLists=t.data.data)}))}}},i=l,n=a("2877"),r=Object(n["a"])(i,s,o,!1,null,"1c6526ba",null);t["default"]=r.exports},"83d4":function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ele-body"},[a("el-card",{attrs:{shadow:"never"}},[a("el-form",{staticClass:"ele-form-search",attrs:{model:e.where,"label-width":"77px"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.reload(t)},submit:function(e){e.preventDefault()}}},[a("el-row",{attrs:{gutter:15}},[a("el-col",{attrs:{md:5,sm:12}},[a("el-form-item",{attrs:{label:"名称:"}},[a("el-input",{attrs:{placeholder:"请输入名称",clearable:""},model:{value:e.where.name,callback:function(t){e.$set(e.where,"name",t)},expression:"where.name"}})],1)],1),a("el-col",{attrs:{md:4,sm:12}},[a("el-form-item",{attrs:{label:"分类:"}},[a("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择",clearable:""},model:{value:e.where.type,callback:function(t){e.$set(e.where,"type",t)},expression:"where.type"}},e._l(e.tagLists,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)],1),a("el-col",{attrs:{md:6,sm:12}},[a("div",{staticClass:"ele-form-actions"},[a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.reload}},[e._v("查询 ")]),a("el-button",{on:{click:e.reset}},[e._v("重置")])],1)])],1)],1),a("ele-pro-table",{ref:"table",attrs:{datasource:e.url,columns:e.columns,where:e.where,selection:e.selection},on:{"update:selection":function(t){e.selection=t}},scopedSlots:e._u([{key:"action",fn:function(t){var s=t.row;return[a("el-link",{attrs:{icon:"el-icon-_nav",type:"primary",underline:!1},on:{click:function(t){return e.openAdLists(s)}}},[e._v("查看广告 ")]),a("el-link",{attrs:{icon:"el-icon-edit",type:"primary",underline:!1},on:{click:function(t){return e.openEdit(s)}}},[e._v("修改 ")]),a("el-popconfirm",{staticClass:"ele-action",attrs:{title:"确定要删除广告位吗?"},on:{confirm:function(t){return e.remove(s)}}},[a("el-link",{attrs:{slot:"reference",icon:"el-icon-delete",type:"danger",underline:!1},slot:"reference"},[e._v("删除 ")])],1)]}}])},[a("template",{slot:"toolbar"},[a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:function(t){return e.openEdit(null)}}},[e._v("添加 ")]),a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:e.removeBatch}},[e._v("删除 ")])],1)],2)],1),a("ad-edit",{attrs:{visible:e.showEdit,data:e.current},on:{"update:visible":function(t){e.showEdit=t},done:e.reload}})],1)},o=[],l=(a("d81d"),a("1b11")),i={name:"ad",components:{AdEdit:l["default"]},data:function(){return{url:"/Ad/index",columns:[{columnKey:"selection",type:"selection",width:45,align:"center",fixed:"left"},{columnKey:"id",type:"index",width:45,align:"center",fixed:"left",showOverflowTooltip:!0},{prop:"name",label:"广告位名称",sortable:!1,showOverflowTooltip:!0,minWidth:80},{prop:"sort",label:"排序",width:80,sortable:!0,align:"center",fixed:"left"},{prop:"desc",label:"备注",sortable:!1,showOverflowTooltip:!0,minWidth:100},{prop:"type_str",label:"分类",sortable:!1,showOverflowTooltip:!0,minWidth:60},{columnKey:"action",label:"操作",width:220,align:"center",resizable:!1,slot:"action"}],where:{},selection:[],current:null,showEdit:!1,showImport:!1,tagLists:[]}},mounted:function(){this.getTagLists()},methods:{getTagLists:function(){var e=this;this.$http.get("/Ad/getType").then((function(t){0===t.data.code&&(e.tagLists=t.data.data)}))},reload:function(){this.$refs.table.reload({page:1})},reset:function(){var e=this;this.where={},this.$nextTick((function(){e.reload()}))},openEdit:function(e){this.current=e,this.showEdit=!0},remove:function(e){var t=this,a=this.$loading({lock:!0}),s=new FormData;s.append("id",e.id),this.$http.post("/Ad/delete/",s).then((function(e){a.close(),0===e.data.code?(t.$message({type:"success",message:e.data.msg}),t.reload()):t.$message.error(e.data.msg)})).catch((function(e){a.close(),t.$message.error(e.message)}))},removeBatch:function(){var e=this;this.selection.length?this.$confirm("确定要删除选中的广告位吗?","提示",{type:"warning"}).then((function(){var t=e.$loading({lock:!0}),a=new FormData;a.append("id",e.selection.map((function(e){return e.id}))),e.$http.post("/Ad/delete/",a).then((function(a){t.close(),0===a.data.code?(e.$message({type:"success",message:a.data.msg}),e.reload()):e.$message.error(a.data.msg)})).catch((function(a){t.close(),e.$message.error(a.message)}))})).catch((function(){})):this.$message.error("请至少选择一条数据")},openAdLists:function(e){this.$router.push({path:"/ad/ad-data",query:{ad_id:e.id}})}}},n=i,r=a("2877"),c=Object(r["a"])(n,s,o,!1,null,"4586ece9",null);t["default"]=c.exports}}]);
|