import{h as i}from"./index-cf27e902.js";import{n}from"./index-b54f5418.js";import"./three-dc46505d.js";var s=function(){var e=this,o=e.$createElement,t=e._self._c||o;return t("el-dialog",{attrs:{visible:e.visible,width:"600px",center:""},on:{"update:visible":function(a){e.visible=a}}},[t("div",{staticClass:"dialog-title",attrs:{slot:"title"},slot:"title"},[t("vis-icon",{attrs:{code:"#iconjiaohu"}}),e._v(" 应用历史 ")],1),t("div",{staticClass:"dialog-filter"},[t("span",[e._v("模式筛选：")]),t("el-select",{attrs:{placeholder:"请选择"},on:{change:e.modeChange},model:{value:e.mode,callback:function(a){e.mode=a},expression:"mode"}},e._l(e.modeOptions,function(a){return t("el-option",{key:a.value,attrs:{label:a.label,value:a.value,size:"mini"}})}),1)],1),t("el-table",{attrs:{data:e.tableData,height:"50vh"}},[t("el-table-column",{attrs:{prop:"id",label:"ID"}}),t("el-table-column",{attrs:{prop:"name",label:"项目名"}}),t("el-table-column",{attrs:{prop:"mode",label:"模式"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",[e._v(e._s(a.row.mode==="auto"?"自动保存":"手动保存"))])]}}])}),t("el-table-column",{attrs:{prop:"date",width:"160px",label:"保存时间"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("span",[e._v(e._s(e.getDate(a.row.date)))])]}}])}),t("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(d){return e.applyHistory(a.row)}}},[e._v(" 应用 ")])]}}])})],1),t("el-pagination",{attrs:{layout:"prev, pager, next",total:e.total,"page-size":e.pageSize,"current-page":e.page},on:{"current-change":e.change}})],1)},r=[];const p={data(){return{visible:!1,tableData:[],page:1,pageSize:10,total:0,mode:"",modeOptions:[{label:"全部",value:""},{label:"手动",value:"manual"},{label:"自动",value:"auto"}]}},mounted(){this.queryList()},methods:{getDate(e){return new Date(e).toLocaleString()},async queryList(){const e=await i.getListByMode({mode:this.mode,page:this.page,pageSize:this.pageSize,appId:this.$store.getters.id}).catch(o=>{this.$message.error("接口有误：historyApi/getListByMode"),console.error(o)});this.tableData=e.list,this.total=e.total},change(e){this.page=e,this.queryList()},modeChange(){this.page=1,this.queryList()},applyHistory(e){window.location.href=`${window.location.origin}${window.location.pathname}?id=${e.appId}&history=${e.id}`}}},l={};var u=n(p,s,r,!1,c,"39fbefaf",null,null);function c(e){for(let o in l)this[o]=l[o]}const g=function(){return u.exports}();export{g as default};
