"use strict";(self["webpackChunklin_cms_vue"]=self["webpackChunklin_cms_vue"]||[]).push([[1946,2047],{82047:function(e,t,a){a.r(t);var n=a(91114),s=a(96557);class o{constructor({uPage:e=0,uCount:t=5,lPage:a=0,lCount:s=10,sPage:o=0,sCount:i=10}){(0,n.A)(this,"name",null),(0,n.A)(this,"start",null),(0,n.A)(this,"end",null),(0,n.A)(this,"keyword",null),(0,n.A)(this,"relationId",null),0===e&&(this.uPage=e),t&&(this.uCount=t),0===a&&(this.lPage=a),s&&(this.lCount=s),0===o&&(this.sPage=o),i&&(this.sCount=i)}async increaseUpage(){this.uPage+=1}async increaseLpage(){this.lPage+=1}increaseSpage(){this.sPage+=1}init(){this.lPage=0,this.uPage=0,this.sPage=0}setBaseInfo(e,t,a){this.name=e,this.start=t,this.end=a}setBaseInfo2(e,t,a){this.relationId=e,this.start=t,this.end=a}setKeyword(e){this.keyword=e}async addTestLog(){const e=await(0,s.get)("cms/test/info");return e}async getLoggedUsers({count:e,page:t}){const a=await(0,s.get)("cms/log/users",{count:e||this.uCount,page:t||this.uPage});return a}async getLogs({count:e,page:t,name:a,start:n,end:o,next:i=!1}){i||this.setBaseInfo(a,n,o),0===t&&(this.lPage=0);const r=await(0,s["default"])({url:"cms/log",params:{count:e||this.lCount,page:t||this.lPage,name:a||this.name,start:n||this.start,end:o||this.end},handleError:!0});return r}async searchLogs({count:e,page:t,keyword:a,name:n,start:o,end:i,next:r=!1}){r||(this.setBaseInfo(n,o,i),this.setKeyword(a)),0===t&&(this.sPage=0);try{const r=await(0,s.get)("cms/log/search",{count:e||this.sCount,page:t||this.sPage,keyword:a||this.keyword,name:n||this.name,start:o||this.start,end:i||this.end});return r}catch(l){console.log(l)}}async moreUserPage(){return await this.increaseUpage(),this.getLoggedUsers({})}async moreLogPage(){return await this.increaseLpage(),this.getLogs({next:!0})}async moreSearchPage(){return this.increaseSpage(),this.searchLogs({next:!0})}async relationLogs({count:e,page:t,keyword:a,relationId:n,start:o,end:i,next:r=!1}){r||(this.setBaseInfo2(n,o,i),this.setKeyword(a)),0===t&&(this.sPage=0);try{const r=await(0,s.get)(`cms/log/relation_log/${n}`,{count:e||this.sCount,page:t||this.sPage,keyword:a||this.keyword,relationId:n||this.relationId,start:o||this.start,end:i||this.end});return r}catch(l){console.log(l)}}}t["default"]=new o({})},71946:function(e,t,a){a.r(t),a.d(t,{default:function(){return I}});var n=a(20641),s=a(90033),o=a(53751);const i=e=>((0,n.Qi)("data-v-6a53128e"),e=e(),(0,n.jt)(),e),r={class:"container"},l={key:0,class:"title"},u=i((()=>(0,n.Lk)("span",null,"项目日志",-1))),c=i((()=>(0,n.Lk)("i",{class:"iconfont icon-fanhui"},null,-1))),d={class:"things"},g={key:1},h={key:0},y={key:0,class:"iconfont icon-loading"},m=i((()=>(0,n.Lk)("span",null,"查看更多",-1))),f=i((()=>(0,n.Lk)("i",{class:"iconfont icon-gengduo",style:{"font-size":"14px"}},null,-1))),v={key:1},p={key:1,class:"nothing"};function k(e,t,a,i,k,w){var C;const P=(0,n.g2)("el-card"),b=(0,n.g2)("el-timeline-item"),L=(0,n.g2)("el-timeline"),I=(0,n.g2)("el-divider"),K=(0,n.gN)("loading");return(0,n.bo)(((0,n.uX)(),(0,n.CE)("div",r,[a.showTitle?((0,n.uX)(),(0,n.CE)("div",l,[u,(0,n.eW)(),(0,n.Lk)("span",{class:"back",onClick:t[0]||(t[0]=(...e)=>i.back&&i.back(...e))},[c,(0,n.eW)(" 返回 ")])])):(0,n.Q3)("",!0),(0,n.bF)(L,{class:"content"},{default:(0,n.k6)((()=>[((0,n.uX)(!0),(0,n.CE)(n.FK,null,(0,n.pI)(i.logs,(e=>((0,n.uX)(),(0,n.Wv)(b,{key:e.id,timestamp:e.update_time,placement:"top"},{default:(0,n.k6)((()=>[(0,n.bF)(P,null,{default:(0,n.k6)((()=>[(0,n.Lk)("h4",null,(0,s.v_)(e.module)+"-"+(0,s.v_)(e.permission),1),(0,n.Lk)("p",d,(0,s.v_)(e.message),1)])),_:2},1024)])),_:2},1032,["timestamp"])))),128))])),_:1}),i.totalCount>i.count||0===i.totalCount?((0,n.uX)(),(0,n.CE)("div",g,[null!==(C=i.logs)&&void 0!==C&&C.length?((0,n.uX)(),(0,n.CE)("div",h,[(0,n.bF)(I),(0,n.Lk)("div",{class:(0,s.C4)(["more",{nothing:i.finished}])},[i.more?((0,n.uX)(),(0,n.CE)("i",y)):(0,n.Q3)("",!0),(0,n.bo)((0,n.Lk)("div",{onClick:t[1]||(t[1]=(...e)=>i.nextPage&&i.nextPage(...e))},[m,(0,n.eW)(),f],512),[[o.aG,!i.more&&!i.finished]]),i.finished?((0,n.uX)(),(0,n.CE)("div",v,[(0,n.Lk)("span",null,(0,s.v_)(0===i.totalCount?"暂无数据":"没有更多数据了"),1)])):(0,n.Q3)("",!0)],2)])):((0,n.uX)(),(0,n.CE)("div",p,"暂无日志信息"))])):(0,n.Q3)("",!0)])),[[K,e.loading]])}var w=a(82047),C=a(50953),P={props:{editId:{type:String,default:null},showTitle:{type:Boolean,default:!1}},setup(e,t){const a=(0,C.KR)(null),s=(0,C.KR)(!1),o=(0,C.KR)(10),i=(0,C.KR)(0),r=(0,C.KR)([]),l=(0,C.KR)(!1),u=(0,C.KR)(""),c=(0,C.Kh)({keyword:"",relationId:e.editId,searchUser:"",searchKeyword:"",searchDate:[],totalCount:0,count:10,page:0}),d=(0,C.KR)(!1),g=async()=>{d.value=!0;try{c.page+=1,c.relationId=u.value;const e=await w["default"].relationLogs(c),t=e.items;r.value=r.value.concat(t),d.value=!1,o.value=r.value.length}catch(e){console.error("error",e),10020===e.data.code&&(l.value=!0),d.value=!1}};(0,n.sV)((()=>{h()}));const h=async()=>{e.editId&&(u.value=e.editId,y())},y=async()=>{r.value=[],s.value=!0,c.totalCount=0,i.value=0,o.value=0;const t=await w["default"].relationLogs({page:0,keyword:c.searchKeyword,relationId:e.editId,start:c.searchDate[0],end:c.searchDate[1]});if(t){t.items;c.totalCount=t.total,r.value=t.items,i.value=t.total,o.value=r.value.length}else l.value=!0;s.value=!1},m=()=>{a.value.resetFields()},f=()=>{t.emit("editClose")};return{back:f,totalCount:i,count:o,logs:r,finished:l,more:d,nextPage:g,form:a,resetForm:m}}},b=a(66262);const L=(0,b.A)(P,[["render",k],["__scopeId","data-v-6a53128e"]]);var I=L},91114:function(e,t,a){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function s(e,t){if("object"!=n(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var s=a.call(e,t||"default");if("object"!=n(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function o(e){var t=s(e,"string");return"symbol"==n(t)?t:t+""}function i(e,t,a){return(t=o(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}a.d(t,{A:function(){return i}})}}]);
|