合并冲突
This commit is contained in:
commit
35a6ee3cfe
|
|
@ -1,42 +1,44 @@
|
|||
{
|
||||
"files": {
|
||||
"static/js/0.73ffc961.chunk.js": "/web/static/js/0.73ffc961.chunk.js",
|
||||
"static/js/1.d0ed5d67.chunk.js": "/web/static/js/1.d0ed5d67.chunk.js",
|
||||
"static/js/2.67af6c13.chunk.js": "/web/static/js/2.67af6c13.chunk.js",
|
||||
"static/js/3.e0d84ca9.chunk.js": "/web/static/js/3.e0d84ca9.chunk.js",
|
||||
"static/js/4.20db91cc.chunk.js": "/web/static/js/4.20db91cc.chunk.js",
|
||||
"static/js/0.435e7a2e.chunk.js": "/web/static/js/0.435e7a2e.chunk.js",
|
||||
"static/js/1.9dae1a02.chunk.js": "/web/static/js/1.9dae1a02.chunk.js",
|
||||
"static/js/2.3dca96b0.chunk.js": "/web/static/js/2.3dca96b0.chunk.js",
|
||||
"static/js/3.dbc9ff13.chunk.js": "/web/static/js/3.dbc9ff13.chunk.js",
|
||||
"static/js/4.e31ce94a.chunk.js": "/web/static/js/4.e31ce94a.chunk.js",
|
||||
"main.css": "/web/static/css/main.c42e041b.chunk.css",
|
||||
"main.js": "/web/static/js/main.6c752f2f.chunk.js",
|
||||
"runtime-main.js": "/web/static/js/runtime-main.82b55ac7.js",
|
||||
"main.js": "/web/static/js/main.f50e7271.chunk.js",
|
||||
"runtime-main.js": "/web/static/js/runtime-main.a133c472.js",
|
||||
"static/css/7.b9d59b33.chunk.css": "/web/static/css/7.b9d59b33.chunk.css",
|
||||
"static/js/7.20a26e9d.chunk.js": "/web/static/js/7.20a26e9d.chunk.js",
|
||||
"static/js/8.a48d84dc.chunk.js": "/web/static/js/8.a48d84dc.chunk.js",
|
||||
"static/js/7.062bc73c.chunk.js": "/web/static/js/7.062bc73c.chunk.js",
|
||||
"static/js/8.0c73dfa2.chunk.js": "/web/static/js/8.0c73dfa2.chunk.js",
|
||||
"static/css/9.3964a2f9.chunk.css": "/web/static/css/9.3964a2f9.chunk.css",
|
||||
"static/js/9.d162ffe3.chunk.js": "/web/static/js/9.d162ffe3.chunk.js",
|
||||
"static/js/10.4b6ce2b8.chunk.js": "/web/static/js/10.4b6ce2b8.chunk.js",
|
||||
"static/js/9.e871c06f.chunk.js": "/web/static/js/9.e871c06f.chunk.js",
|
||||
"static/js/10.e7a7ba9e.chunk.js": "/web/static/js/10.e7a7ba9e.chunk.js",
|
||||
"static/css/11.f0a90ddf.chunk.css": "/web/static/css/11.f0a90ddf.chunk.css",
|
||||
"static/js/11.4b3ef3ac.chunk.js": "/web/static/js/11.4b3ef3ac.chunk.js",
|
||||
"static/js/12.b35af812.chunk.js": "/web/static/js/12.b35af812.chunk.js",
|
||||
"static/js/13.bfc4126b.chunk.js": "/web/static/js/13.bfc4126b.chunk.js",
|
||||
"static/js/11.3aeea2d0.chunk.js": "/web/static/js/11.3aeea2d0.chunk.js",
|
||||
"static/js/12.46e48fa4.chunk.js": "/web/static/js/12.46e48fa4.chunk.js",
|
||||
"static/js/13.9179a6ab.chunk.js": "/web/static/js/13.9179a6ab.chunk.js",
|
||||
"static/css/14.d211b268.chunk.css": "/web/static/css/14.d211b268.chunk.css",
|
||||
"static/js/14.fb39311d.chunk.js": "/web/static/js/14.fb39311d.chunk.js",
|
||||
"static/css/15.bed844be.chunk.css": "/web/static/css/15.bed844be.chunk.css",
|
||||
"static/js/15.bb2f9d20.chunk.js": "/web/static/js/15.bb2f9d20.chunk.js",
|
||||
"static/js/16.c880a77e.chunk.js": "/web/static/js/16.c880a77e.chunk.js",
|
||||
"static/css/17.0e433876.chunk.css": "/web/static/css/17.0e433876.chunk.css",
|
||||
"static/js/17.b66d0ef2.chunk.js": "/web/static/js/17.b66d0ef2.chunk.js",
|
||||
"static/js/18.f89ab81a.chunk.js": "/web/static/js/18.f89ab81a.chunk.js",
|
||||
"static/js/19.51a2de13.chunk.js": "/web/static/js/19.51a2de13.chunk.js",
|
||||
"static/js/14.aa25c99d.chunk.js": "/web/static/js/14.aa25c99d.chunk.js",
|
||||
"static/css/15.dca2368b.chunk.css": "/web/static/css/15.dca2368b.chunk.css",
|
||||
"static/js/15.ec6515ee.chunk.js": "/web/static/js/15.ec6515ee.chunk.js",
|
||||
"static/css/16.bed844be.chunk.css": "/web/static/css/16.bed844be.chunk.css",
|
||||
"static/js/16.4b1ecff6.chunk.js": "/web/static/js/16.4b1ecff6.chunk.js",
|
||||
"static/js/17.e7b1a82e.chunk.js": "/web/static/js/17.e7b1a82e.chunk.js",
|
||||
"static/css/18.0e433876.chunk.css": "/web/static/css/18.0e433876.chunk.css",
|
||||
"static/js/18.1248bb5d.chunk.js": "/web/static/js/18.1248bb5d.chunk.js",
|
||||
"static/js/19.494f900a.chunk.js": "/web/static/js/19.494f900a.chunk.js",
|
||||
"static/js/20.a258893a.chunk.js": "/web/static/js/20.a258893a.chunk.js",
|
||||
"index.html": "/web/index.html",
|
||||
"static/js/10.4b6ce2b8.chunk.js.LICENSE.txt": "/web/static/js/10.4b6ce2b8.chunk.js.LICENSE.txt",
|
||||
"static/js/11.4b3ef3ac.chunk.js.LICENSE.txt": "/web/static/js/11.4b3ef3ac.chunk.js.LICENSE.txt",
|
||||
"static/js/8.a48d84dc.chunk.js.LICENSE.txt": "/web/static/js/8.a48d84dc.chunk.js.LICENSE.txt",
|
||||
"static/js/9.d162ffe3.chunk.js.LICENSE.txt": "/web/static/js/9.d162ffe3.chunk.js.LICENSE.txt"
|
||||
"static/js/10.e7a7ba9e.chunk.js.LICENSE.txt": "/web/static/js/10.e7a7ba9e.chunk.js.LICENSE.txt",
|
||||
"static/js/11.3aeea2d0.chunk.js.LICENSE.txt": "/web/static/js/11.3aeea2d0.chunk.js.LICENSE.txt",
|
||||
"static/js/8.0c73dfa2.chunk.js.LICENSE.txt": "/web/static/js/8.0c73dfa2.chunk.js.LICENSE.txt",
|
||||
"static/js/9.e871c06f.chunk.js.LICENSE.txt": "/web/static/js/9.e871c06f.chunk.js.LICENSE.txt"
|
||||
},
|
||||
"entrypoints": [
|
||||
"static/js/runtime-main.82b55ac7.js",
|
||||
"static/js/8.a48d84dc.chunk.js",
|
||||
"static/js/runtime-main.a133c472.js",
|
||||
"static/js/8.0c73dfa2.chunk.js",
|
||||
"static/css/main.c42e041b.chunk.css",
|
||||
"static/js/main.6c752f2f.chunk.js"
|
||||
"static/js/main.f50e7271.chunk.js"
|
||||
]
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang="zh"><head><meta charset="utf-8"/><link rel="icon" href="/web/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/web/logo192.png"/><link rel="manifest" href="/web/manifest.json"/><title>我的账本</title><link href="/web/static/css/main.c42e041b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,o,f=t[0],u=t[1],i=t[2],d=0,s=[];d<f.length;d++)o=f[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&s.push(a[o][0]),a[o]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(l&&l(t);s.length;)s.shift()();return c.push.apply(c,i||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var u=r[o];0!==a[u]&&(n=!1)}n&&(c.splice(t--,1),e=f(f.s=r[0]))}return e}var n={},o={6:0},a={6:0},c=[];function f(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{7:1,9:1,11:1,14:1,15:1,17:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="static/css/"+({}[e]||e)+"."+{0:"31d6cfe0",1:"31d6cfe0",2:"31d6cfe0",3:"31d6cfe0",4:"31d6cfe0",7:"b9d59b33",9:"3964a2f9",10:"31d6cfe0",11:"f0a90ddf",12:"31d6cfe0",13:"31d6cfe0",14:"d211b268",15:"bed844be",16:"31d6cfe0",17:"0e433876",18:"31d6cfe0",19:"31d6cfe0"}[e]+".chunk.css",a=f.p+n,c=document.getElementsByTagName("link"),u=0;u<c.length;u++){var i=(l=c[u]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(i===n||i===a))return t()}var d=document.getElementsByTagName("style");for(u=0;u<d.length;u++){var l;if((i=(l=d[u]).getAttribute("data-href"))===n||i===a)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],s.parentNode.removeChild(s),r(c)},s.href=a,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=n);var c,u=document.createElement("script");u.charset="utf-8",u.timeout=120,f.nc&&u.setAttribute("nonce",f.nc),u.src=function(e){return f.p+"static/js/"+({}[e]||e)+"."+{0:"73ffc961",1:"d0ed5d67",2:"67af6c13",3:"e0d84ca9",4:"20db91cc",7:"20a26e9d",9:"d162ffe3",10:"4b6ce2b8",11:"4b3ef3ac",12:"b35af812",13:"bfc4126b",14:"fb39311d",15:"bb2f9d20",16:"c880a77e",17:"b66d0ef2",18:"f89ab81a",19:"51a2de13"}[e]+".chunk.js"}(e);var i=new Error;c=function(t){u.onerror=u.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:u})}),12e4);u.onerror=u.onload=c,document.head.appendChild(u)}return Promise.all(t)},f.m=e,f.c=n,f.d=function(e,t,r){f.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,t){if(1&t&&(e=f(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(f.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)f.d(r,n,function(t){return e[t]}.bind(null,n));return r},f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="/web/",f.oe=function(e){throw console.error(e),e};var u=this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[],i=u.push.bind(u);u.push=t,u=u.slice();for(var d=0;d<u.length;d++)t(u[d]);var l=i;r()}([])</script><script src="/web/static/js/8.a48d84dc.chunk.js"></script><script src="/web/static/js/main.6c752f2f.chunk.js"></script></body></html>
|
||||
<!doctype html><html lang="zh"><head><meta charset="utf-8"/><link rel="icon" href="/web/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/web/logo192.png"/><link rel="manifest" href="/web/manifest.json"/><title>我的账本</title><link href="/web/static/css/main.c42e041b.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,o,u=t[0],f=t[1],i=t[2],d=0,s=[];d<u.length;d++)o=u[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&s.push(a[o][0]),a[o]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(l&&l(t);s.length;)s.shift()();return c.push.apply(c,i||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var f=r[o];0!==a[f]&&(n=!1)}n&&(c.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={6:0},a={6:0},c=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{7:1,9:1,11:1,14:1,15:1,16:1,18:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="static/css/"+({}[e]||e)+"."+{0:"31d6cfe0",1:"31d6cfe0",2:"31d6cfe0",3:"31d6cfe0",4:"31d6cfe0",7:"b9d59b33",9:"3964a2f9",10:"31d6cfe0",11:"f0a90ddf",12:"31d6cfe0",13:"31d6cfe0",14:"d211b268",15:"dca2368b",16:"bed844be",17:"31d6cfe0",18:"0e433876",19:"31d6cfe0",20:"31d6cfe0"}[e]+".chunk.css",a=u.p+n,c=document.getElementsByTagName("link"),f=0;f<c.length;f++){var i=(l=c[f]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(i===n||i===a))return t()}var d=document.getElementsByTagName("style");for(f=0;f<d.length;f++){var l;if((i=(l=d[f]).getAttribute("data-href"))===n||i===a)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],s.parentNode.removeChild(s),r(c)},s.href=a,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=n);var c,f=document.createElement("script");f.charset="utf-8",f.timeout=120,u.nc&&f.setAttribute("nonce",u.nc),f.src=function(e){return u.p+"static/js/"+({}[e]||e)+"."+{0:"435e7a2e",1:"9dae1a02",2:"3dca96b0",3:"dbc9ff13",4:"e31ce94a",7:"062bc73c",9:"e871c06f",10:"e7a7ba9e",11:"3aeea2d0",12:"46e48fa4",13:"9179a6ab",14:"aa25c99d",15:"ec6515ee",16:"4b1ecff6",17:"e7b1a82e",18:"1248bb5d",19:"494f900a",20:"a258893a"}[e]+".chunk.js"}(e);var i=new Error;c=function(t){f.onerror=f.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:f})}),12e4);f.onerror=f.onload=c,document.head.appendChild(f)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/web/",u.oe=function(e){throw console.error(e),e};var f=this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[],i=f.push.bind(f);f.push=t,f=f.slice();for(var d=0;d<f.length;d++)t(f[d]);var l=i;r()}([])</script><script src="/web/static/js/8.0c73dfa2.chunk.js"></script><script src="/web/static/js/main.f50e7271.chunk.js"></script></body></html>
|
||||
|
|
@ -0,0 +1 @@
|
|||
.event-page .top-wrapper{margin-bottom:2rem;display:flex;justify-content:space-between}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
(this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[]).push([[17],{146:function(t,e,n){"use strict";var r=n(1),c=n(14),a=n(15),o=n(19),i=n(20),u=n(0),s=n(5);e.a=function(t){return function(e){Object(o.a)(u,e);var n=Object(i.a)(u);function u(){var t;Object(c.a)(this,u);for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return(t=n.call.apply(n,[this].concat(r))).defaultCommodity={currency:"CNY",symbol:"\uffe5"},t.currentCommodity=window.localStorage.getItem("ledgerCurrency"),t}return Object(a.a)(u,[{key:"render",value:function(){return Object(s.jsx)(t,Object(r.a)(Object(r.a)({},this.props),{},{commodity:this.currentCommodity?JSON.parse(this.currentCommodity):this.defaultCommodity}))}}]),u}(u.Component)}},313:function(t,e,n){},431:function(t,e,n){"use strict";n.r(e);var r=n(14),c=n(15),a=n(19),o=n(20),i=n(0),u=n(146),s=n(67),h=(n(313),n(5)),m=function(t){Object(a.a)(n,t);var e=Object(o.a)(n);function n(){var t;Object(r.a)(this,n);for(var c=arguments.length,a=new Array(c),o=0;o<c;o++)a[o]=arguments[o];return(t=e.call.apply(e,[this].concat(a))).theme=t.context.theme,t}return Object(c.a)(n,[{key:"render",value:function(){return this.context.theme!==this.theme&&(this.theme=this.context.theme),Object(h.jsx)("div",{className:"about-page",children:"\u5173\u4e8e"})}}]),n}(i.Component);m.contextType=s.a,e.default=Object(u.a)(m)}}]);
|
||||
(this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[]).push([[18],{147:function(t,e,n){"use strict";var r=n(1),c=n(14),a=n(15),o=n(19),i=n(20),u=n(0),s=n(5);e.a=function(t){return function(e){Object(o.a)(u,e);var n=Object(i.a)(u);function u(){var t;Object(c.a)(this,u);for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return(t=n.call.apply(n,[this].concat(r))).defaultCommodity={currency:"CNY",symbol:"\uffe5"},t.currentCommodity=window.localStorage.getItem("ledgerCurrency"),t}return Object(a.a)(u,[{key:"render",value:function(){return Object(s.jsx)(t,Object(r.a)(Object(r.a)({},this.props),{},{commodity:this.currentCommodity?JSON.parse(this.currentCommodity):this.defaultCommodity}))}}]),u}(u.Component)}},315:function(t,e,n){},433:function(t,e,n){"use strict";n.r(e);var r=n(14),c=n(15),a=n(19),o=n(20),i=n(0),u=n(147),s=n(68),h=(n(315),n(5)),m=function(t){Object(a.a)(n,t);var e=Object(o.a)(n);function n(){var t;Object(r.a)(this,n);for(var c=arguments.length,a=new Array(c),o=0;o<c;o++)a[o]=arguments[o];return(t=e.call.apply(e,[this].concat(a))).theme=t.context.theme,t}return Object(c.a)(n,[{key:"render",value:function(){return this.context.theme!==this.theme&&(this.theme=this.context.theme),Object(h.jsx)("div",{className:"about-page",children:"\u5173\u4e8e"})}}]),n}(i.Component);m.contextType=s.a,e.default=Object(u.a)(m)}}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +1 @@
|
|||
(this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[]).push([[19],{146:function(t,e,n){"use strict";var a=n(1),i=n(14),o=n(15),c=n(19),r=n(20),s=n(0),h=n(5);e.a=function(t){return function(e){Object(c.a)(s,e);var n=Object(r.a)(s);function s(){var t;Object(i.a)(this,s);for(var e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];return(t=n.call.apply(n,[this].concat(a))).defaultCommodity={currency:"CNY",symbol:"\uffe5"},t.currentCommodity=window.localStorage.getItem("ledgerCurrency"),t}return Object(o.a)(s,[{key:"render",value:function(){return Object(h.jsx)(t,Object(a.a)(Object(a.a)({},this.props),{},{commodity:this.currentCommodity?JSON.parse(this.currentCommodity):this.defaultCommodity}))}}]),s}(s.Component)}},432:function(t,e,n){"use strict";n.r(e);var a=n(14),i=n(15),o=n(19),c=n(20),r=n(445),s=n(25),h=n(192),l=n(56),d=n(317),u=(n(413),n(0)),f=n(82),p=n(67),b=n(146),j=n(5),m=function(t){Object(o.a)(n,t);var e=Object(c.a)(n);function n(){var t;Object(a.a)(this,n);for(var i=arguments.length,o=new Array(i),c=0;c<i;c++)o[c]=arguments[c];return(t=e.call.apply(e,[this].concat(o))).theme=t.context.theme,t.state={loading:!1,path:null,files:[],rawContent:"",content:"",editorState:d.EditorState.createEmpty()},t.fetchFileDir=function(){t.setState({loading:!0}),Object(f.c)("/api/auth/file/dir").then((function(e){t.setState({files:e})})).finally((function(){t.setState({loading:!1})}))},t.handldEditContent=function(e){t.setState({editorState:e,content:e.getCurrentContent().getPlainText()})},t.handleChangeFile=function(e){t.setState({path:e},(function(){t.fetchFileContent(e)}))},t.fetchFileContent=function(){t.setState({loading:!0}),Object(f.c)("/api/auth/file/content?path=".concat(t.state.path)).then((function(e){t.setState({rawContent:e,content:e,editorState:d.EditorState.createWithContent(d.ContentState.createFromText(e))})})).finally((function(){t.setState({loading:!1})}))},t.saveFileContent=function(){var e=t.state,n=e.path,a=e.content;t.setState({loading:!0}),Object(f.c)("/api/auth/file",{method:"POST",body:{path:n,content:a}}).then((function(){t.setState({rawContent:a}),s.b.success("\u4fdd\u5b58\u6210\u529f")})).finally((function(){t.setState({loading:!1})}))},t}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.fetchFileDir()}},{key:"render",value:function(){return this.context.theme!==this.theme&&(this.theme=this.context.theme),Object(j.jsxs)("div",{className:"edit-page",children:[Object(j.jsxs)("div",{children:[Object(j.jsx)(h.a,{showSearch:!0,placeholder:"\u8bf7\u9009\u62e9\u6e90\u6587\u4ef6",style:{width:"200px"},onChange:this.handleChangeFile,children:this.state.files.map((function(t){return Object(j.jsx)(h.a.Option,{value:t,children:t},t)}))}),"\xa0\xa0",Object(j.jsx)(l.a,{type:"primary",icon:Object(j.jsx)(r.a,{}),disabled:this.state.rawContent===this.state.content||!this.state.path,loading:this.state.loading,onClick:this.saveFileContent,children:"\u4fdd\u5b58"})]}),Object(j.jsx)("div",{style:{marginTop:"1rem"},children:Object(j.jsx)(d.Editor,{placeholder:this.state.path?"\u8be5\u6587\u4ef6\u5185\u5bb9\u4e3a\u7a7a":"\u672a\u9009\u62e9\u6e90\u6587\u4ef6",editorState:this.state.editorState,onChange:this.handldEditContent})})]})}}]),n}(u.Component);m.contextType=p.a,e.default=Object(b.a)(m)}}]);
|
||||
(this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[]).push([[20],{147:function(t,e,n){"use strict";var a=n(1),i=n(14),o=n(15),c=n(19),r=n(20),s=n(0),h=n(5);e.a=function(t){return function(e){Object(c.a)(s,e);var n=Object(r.a)(s);function s(){var t;Object(i.a)(this,s);for(var e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];return(t=n.call.apply(n,[this].concat(a))).defaultCommodity={currency:"CNY",symbol:"\uffe5"},t.currentCommodity=window.localStorage.getItem("ledgerCurrency"),t}return Object(o.a)(s,[{key:"render",value:function(){return Object(h.jsx)(t,Object(a.a)(Object(a.a)({},this.props),{},{commodity:this.currentCommodity?JSON.parse(this.currentCommodity):this.defaultCommodity}))}}]),s}(s.Component)}},434:function(t,e,n){"use strict";n.r(e);var a=n(14),i=n(15),o=n(19),c=n(20),r=n(448),s=n(27),h=n(194),l=n(57),d=n(319),u=(n(415),n(0)),f=n(83),p=n(68),b=n(147),j=n(5),m=function(t){Object(o.a)(n,t);var e=Object(c.a)(n);function n(){var t;Object(a.a)(this,n);for(var i=arguments.length,o=new Array(i),c=0;c<i;c++)o[c]=arguments[c];return(t=e.call.apply(e,[this].concat(o))).theme=t.context.theme,t.state={loading:!1,path:null,files:[],rawContent:"",content:"",editorState:d.EditorState.createEmpty()},t.fetchFileDir=function(){t.setState({loading:!0}),Object(f.c)("/api/auth/file/dir").then((function(e){t.setState({files:e})})).finally((function(){t.setState({loading:!1})}))},t.handldEditContent=function(e){t.setState({editorState:e,content:e.getCurrentContent().getPlainText()})},t.handleChangeFile=function(e){t.setState({path:e},(function(){t.fetchFileContent(e)}))},t.fetchFileContent=function(){t.setState({loading:!0}),Object(f.c)("/api/auth/file/content?path=".concat(t.state.path)).then((function(e){t.setState({rawContent:e,content:e,editorState:d.EditorState.createWithContent(d.ContentState.createFromText(e))})})).finally((function(){t.setState({loading:!1})}))},t.saveFileContent=function(){var e=t.state,n=e.path,a=e.content;t.setState({loading:!0}),Object(f.c)("/api/auth/file",{method:"POST",body:{path:n,content:a}}).then((function(){t.setState({rawContent:a}),s.b.success("\u4fdd\u5b58\u6210\u529f")})).finally((function(){t.setState({loading:!1})}))},t}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.fetchFileDir()}},{key:"render",value:function(){return this.context.theme!==this.theme&&(this.theme=this.context.theme),Object(j.jsxs)("div",{className:"edit-page",children:[Object(j.jsxs)("div",{children:[Object(j.jsx)(h.a,{showSearch:!0,placeholder:"\u8bf7\u9009\u62e9\u6e90\u6587\u4ef6",style:{width:"200px"},onChange:this.handleChangeFile,children:this.state.files.map((function(t){return Object(j.jsx)(h.a.Option,{value:t,children:t},t)}))}),"\xa0\xa0",Object(j.jsx)(l.a,{type:"primary",icon:Object(j.jsx)(r.a,{}),disabled:this.state.rawContent===this.state.content||!this.state.path,loading:this.state.loading,onClick:this.saveFileContent,children:"\u4fdd\u5b58"})]}),Object(j.jsx)("div",{style:{marginTop:"1rem"},children:Object(j.jsx)(d.Editor,{placeholder:this.state.path?"\u8be5\u6587\u4ef6\u5185\u5bb9\u4e3a\u7a7a":"\u672a\u9009\u62e9\u6e90\u6587\u4ef6",editorState:this.state.editorState,onChange:this.handldEditContent})})]})}}]),n}(u.Component);m.contextType=p.a,e.default=Object(b.a)(m)}}]);
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
|||
!function(e){function t(t){for(var n,o,f=t[0],u=t[1],i=t[2],d=0,s=[];d<f.length;d++)o=f[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&s.push(a[o][0]),a[o]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(l&&l(t);s.length;)s.shift()();return c.push.apply(c,i||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var u=r[o];0!==a[u]&&(n=!1)}n&&(c.splice(t--,1),e=f(f.s=r[0]))}return e}var n={},o={6:0},a={6:0},c=[];function f(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{7:1,9:1,11:1,14:1,15:1,17:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="static/css/"+({}[e]||e)+"."+{0:"31d6cfe0",1:"31d6cfe0",2:"31d6cfe0",3:"31d6cfe0",4:"31d6cfe0",7:"b9d59b33",9:"3964a2f9",10:"31d6cfe0",11:"f0a90ddf",12:"31d6cfe0",13:"31d6cfe0",14:"d211b268",15:"bed844be",16:"31d6cfe0",17:"0e433876",18:"31d6cfe0",19:"31d6cfe0"}[e]+".chunk.css",a=f.p+n,c=document.getElementsByTagName("link"),u=0;u<c.length;u++){var i=(l=c[u]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(i===n||i===a))return t()}var d=document.getElementsByTagName("style");for(u=0;u<d.length;u++){var l;if((i=(l=d[u]).getAttribute("data-href"))===n||i===a)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],s.parentNode.removeChild(s),r(c)},s.href=a,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=n);var c,u=document.createElement("script");u.charset="utf-8",u.timeout=120,f.nc&&u.setAttribute("nonce",f.nc),u.src=function(e){return f.p+"static/js/"+({}[e]||e)+"."+{0:"73ffc961",1:"d0ed5d67",2:"67af6c13",3:"e0d84ca9",4:"20db91cc",7:"20a26e9d",9:"d162ffe3",10:"4b6ce2b8",11:"4b3ef3ac",12:"b35af812",13:"bfc4126b",14:"fb39311d",15:"bb2f9d20",16:"c880a77e",17:"b66d0ef2",18:"f89ab81a",19:"51a2de13"}[e]+".chunk.js"}(e);var i=new Error;c=function(t){u.onerror=u.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:u})}),12e4);u.onerror=u.onload=c,document.head.appendChild(u)}return Promise.all(t)},f.m=e,f.c=n,f.d=function(e,t,r){f.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,t){if(1&t&&(e=f(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(f.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)f.d(r,n,function(t){return e[t]}.bind(null,n));return r},f.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(t,"a",t),t},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.p="/web/",f.oe=function(e){throw console.error(e),e};var u=this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[],i=u.push.bind(u);u.push=t,u=u.slice();for(var d=0;d<u.length;d++)t(u[d]);var l=i;r()}([]);
|
||||
|
|
@ -0,0 +1 @@
|
|||
!function(e){function t(t){for(var n,o,u=t[0],f=t[1],i=t[2],d=0,s=[];d<u.length;d++)o=u[d],Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&s.push(a[o][0]),a[o]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(l&&l(t);s.length;)s.shift()();return c.push.apply(c,i||[]),r()}function r(){for(var e,t=0;t<c.length;t++){for(var r=c[t],n=!0,o=1;o<r.length;o++){var f=r[o];0!==a[f]&&(n=!1)}n&&(c.splice(t--,1),e=u(u.s=r[0]))}return e}var n={},o={6:0},a={6:0},c=[];function u(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,u),r.l=!0,r.exports}u.e=function(e){var t=[];o[e]?t.push(o[e]):0!==o[e]&&{7:1,9:1,11:1,14:1,15:1,16:1,18:1}[e]&&t.push(o[e]=new Promise((function(t,r){for(var n="static/css/"+({}[e]||e)+"."+{0:"31d6cfe0",1:"31d6cfe0",2:"31d6cfe0",3:"31d6cfe0",4:"31d6cfe0",7:"b9d59b33",9:"3964a2f9",10:"31d6cfe0",11:"f0a90ddf",12:"31d6cfe0",13:"31d6cfe0",14:"d211b268",15:"dca2368b",16:"bed844be",17:"31d6cfe0",18:"0e433876",19:"31d6cfe0",20:"31d6cfe0"}[e]+".chunk.css",a=u.p+n,c=document.getElementsByTagName("link"),f=0;f<c.length;f++){var i=(l=c[f]).getAttribute("data-href")||l.getAttribute("href");if("stylesheet"===l.rel&&(i===n||i===a))return t()}var d=document.getElementsByTagName("style");for(f=0;f<d.length;f++){var l;if((i=(l=d[f]).getAttribute("data-href"))===n||i===a)return t()}var s=document.createElement("link");s.rel="stylesheet",s.type="text/css",s.onload=t,s.onerror=function(t){var n=t&&t.target&&t.target.src||a,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.code="CSS_CHUNK_LOAD_FAILED",c.request=n,delete o[e],s.parentNode.removeChild(s),r(c)},s.href=a,document.getElementsByTagName("head")[0].appendChild(s)})).then((function(){o[e]=0})));var r=a[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=a[e]=[t,n]}));t.push(r[2]=n);var c,f=document.createElement("script");f.charset="utf-8",f.timeout=120,u.nc&&f.setAttribute("nonce",u.nc),f.src=function(e){return u.p+"static/js/"+({}[e]||e)+"."+{0:"435e7a2e",1:"9dae1a02",2:"3dca96b0",3:"dbc9ff13",4:"e31ce94a",7:"062bc73c",9:"e871c06f",10:"e7a7ba9e",11:"3aeea2d0",12:"46e48fa4",13:"9179a6ab",14:"aa25c99d",15:"ec6515ee",16:"4b1ecff6",17:"e7b1a82e",18:"1248bb5d",19:"494f900a",20:"a258893a"}[e]+".chunk.js"}(e);var i=new Error;c=function(t){f.onerror=f.onload=null,clearTimeout(d);var r=a[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",i.name="ChunkLoadError",i.type=n,i.request=o,r[1](i)}a[e]=void 0}};var d=setTimeout((function(){c({type:"timeout",target:f})}),12e4);f.onerror=f.onload=c,document.head.appendChild(f)}return Promise.all(t)},u.m=e,u.c=n,u.d=function(e,t,r){u.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},u.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,t){if(1&t&&(e=u(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(u.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)u.d(r,n,function(t){return e[t]}.bind(null,n));return r},u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,"a",t),t},u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.p="/web/",u.oe=function(e){throw console.error(e),e};var f=this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[],i=f.push.bind(f);f.push=t,f=f.slice();for(var d=0;d<f.length;d++)t(f[d]);var l=i;r()}([]);
|
||||
|
|
@ -113,15 +113,6 @@ func BeanReportAllPrices(ledgerConfig *Config) string {
|
|||
return string(output)
|
||||
}
|
||||
|
||||
func BeanReportAllEvents(ledgerConfig *Config) string {
|
||||
beanFilePath := GetLedgerEventsFilePath(ledgerConfig.DataPath)
|
||||
|
||||
LogInfo(ledgerConfig.Mail, "bean-report "+beanFilePath+" events")
|
||||
cmd := exec.Command("bean-report", beanFilePath, "events")
|
||||
output, _ := cmd.Output()
|
||||
return string(output)
|
||||
}
|
||||
|
||||
func bqlRawQuery(ledgerConfig *Config, selectBql string, queryParamsPtr *QueryParams, queryResultPtr interface{}) (string, error) {
|
||||
var bql string
|
||||
if selectBql == "" {
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ type Account struct {
|
|||
MarketCurrencySymbol string `json:"marketCurrencySymbol,omitempty"`
|
||||
EndDate string `json:"endDate,omitempty"`
|
||||
Type *AccountType `json:"type,omitempty"`
|
||||
Status bool `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
type AccountCurrency struct {
|
||||
|
|
@ -322,34 +323,48 @@ func LoadLedgerAccounts(ledgerId string) error {
|
|||
lines := strings.Split(string(bytes), "\n")
|
||||
var temp Account
|
||||
for _, line := range lines {
|
||||
line = strings.TrimSpace(line) //去除文本前后空白
|
||||
if line != "" {
|
||||
words := strings.Fields(line)
|
||||
if len(words) >= 3 {
|
||||
key := words[2]
|
||||
temp = accountMap[key]
|
||||
account := Account{Acc: key, Type: nil}
|
||||
// 货币单位
|
||||
if len(words) >= 4 {
|
||||
account.Currency = words[3]
|
||||
if line[0] == ';' {
|
||||
// 跳过注释行
|
||||
continue
|
||||
} else {
|
||||
//非注释行
|
||||
words := strings.Fields(line)
|
||||
if len(words) >= 3 {
|
||||
key := words[2]
|
||||
temp = accountMap[key]
|
||||
account := Account{Acc: key, Type: nil, StartDate: "", EndDate: ""}
|
||||
if words[1] == "open" {
|
||||
// 最晚的开户日期设置为账户开户日期
|
||||
account.StartDate = getMaxDate(words[0], temp.StartDate)
|
||||
// 货币单位
|
||||
if len(words) >= 4 {
|
||||
account.Currency = words[3]
|
||||
}
|
||||
} else if words[1] == "close" {
|
||||
//账户最晚的关闭日期设置为账户关闭日期
|
||||
account.EndDate = getMaxDate(words[0], temp.EndDate)
|
||||
}
|
||||
if account.EndDate != "" && account.StartDate == getMaxDate(account.StartDate, account.EndDate) {
|
||||
// 如果结束时间非空,且 开户日期>关闭日期,则清空账户结束日期,设置此账户为有效账户
|
||||
account.EndDate = ""
|
||||
account.Status = true
|
||||
}
|
||||
// 现在如果结束日期非空,肯定满足有开始时间<结束时间
|
||||
if account.EndDate != "" {
|
||||
account.Status = false
|
||||
}
|
||||
if account.Currency == "" {
|
||||
account.Currency = temp.Currency
|
||||
}
|
||||
accountMap[key] = account
|
||||
}
|
||||
if words[1] == "open" {
|
||||
account.StartDate = words[0]
|
||||
// fix: 处理已关闭又打开的账户
|
||||
account.EndDate = ""
|
||||
} else if words[1] == "close" {
|
||||
account.EndDate = words[0]
|
||||
}
|
||||
if temp.StartDate != "" {
|
||||
account.StartDate = temp.StartDate
|
||||
}
|
||||
if temp.EndDate != "" {
|
||||
account.EndDate = temp.EndDate
|
||||
}
|
||||
accountMap[key] = account
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
accounts := make([]Account, 0)
|
||||
for _, account := range accountMap {
|
||||
accounts = append(accounts, account)
|
||||
|
|
|
|||
|
|
@ -29,3 +29,78 @@ func RandChar(size int) string {
|
|||
}
|
||||
return s.String()
|
||||
}
|
||||
|
||||
type Timestamp int64
|
||||
|
||||
const time_layout string = "2006-01-02 15:04:05"
|
||||
|
||||
// 日期字符串转为时间戳 工具函数
|
||||
func getTimeStamp(str_date string) Timestamp {
|
||||
if len(str_date) == 10 {
|
||||
str_date = str_date + " 00:00:00"
|
||||
}
|
||||
// 获取时区
|
||||
loc, err := time.LoadLocation("Local")
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
// 转换为时间戳
|
||||
the_time, err := time.ParseInLocation(time_layout, str_date, loc)
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
// 返回时间戳
|
||||
return Timestamp(the_time.Unix())
|
||||
}
|
||||
|
||||
//获取1到2个日期字符串中更大的日期
|
||||
func getMaxDate(str_date1 string, str_date2 string) string {
|
||||
var max_date string
|
||||
if str_date1 != "" && str_date2 == "" {
|
||||
// 只定义了第一个账户,取第一个账户的日期为准
|
||||
max_date = str_date1
|
||||
} else if str_date1 == "" && str_date2 != "" {
|
||||
// 只定义了第二个账户,取第二个账户的日期为准
|
||||
max_date = str_date2
|
||||
} else if str_date1 != "" && str_date2 != "" {
|
||||
// 重复定义的账户,取最晚的时间为准
|
||||
t1 := getTimeStamp(str_date1)
|
||||
t2 := getTimeStamp(str_date2)
|
||||
if t1 > t2 {
|
||||
max_date = str_date1
|
||||
} else {
|
||||
max_date = str_date2
|
||||
}
|
||||
} else if str_date1 == "" && str_date2 == "" {
|
||||
// 没有定义账户,取当前日期为准
|
||||
max_date = time.Now().Format(time_layout)
|
||||
}
|
||||
return max_date
|
||||
}
|
||||
|
||||
// 获取1-2个日期字符串中最小的日期值
|
||||
// 如果双参数均为空,则返回账簿开始记账日期
|
||||
func getMinDate(str_date1 string, str_date2 string) string {
|
||||
//time_layout := "2006-01-02 15:04:05"
|
||||
var min_date string
|
||||
if str_date1 != "" && str_date2 == "" {
|
||||
// 只定义了第一个账户,取第一个账户的日期为准
|
||||
min_date = str_date1
|
||||
} else if str_date1 == "" && str_date2 != "" {
|
||||
// 只定义了第二个账户,取第二个账户的日期为准
|
||||
min_date = str_date2
|
||||
} else if str_date1 != "" && str_date2 != "" {
|
||||
// 重复定义的账户,取最早的时间
|
||||
t1 := getTimeStamp(str_date1)
|
||||
t2 := getTimeStamp(str_date2)
|
||||
if t1 < t2 {
|
||||
min_date = str_date1
|
||||
} else {
|
||||
min_date = str_date2
|
||||
}
|
||||
} else if str_date1 == "" && str_date2 == "" {
|
||||
// 没有定义账户,取固定日期"1970-01-01"
|
||||
min_date = "1970-01-01"
|
||||
}
|
||||
return min_date
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,40 +2,70 @@ package service
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/beancount-gs/script"
|
||||
"github.com/gin-gonic/gin"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Event struct {
|
||||
Date string `form:"date" binding:"required" json:"date"`
|
||||
Type string `form:"type" binding:"required" json:"type"`
|
||||
Description string `form:"description" binding:"required" json:"description"`
|
||||
Date string `form:"date" binding:"required" json:"date"`
|
||||
Stage string `form:"stage" json:"stage"`
|
||||
Type string `form:"type" json:"type"`
|
||||
Types []string `form:"types" json:"types"`
|
||||
Description string `form:"description" binding:"required" json:"description"`
|
||||
}
|
||||
|
||||
// Events 切片包含多个事件
|
||||
type Events []Event
|
||||
|
||||
func (e Events) Len() int {
|
||||
return len(e)
|
||||
}
|
||||
|
||||
func (e Events) Less(i, j int) bool {
|
||||
return strings.Compare(e[i].Date, e[j].Date) < 0
|
||||
}
|
||||
|
||||
func (e Events) Swap(i, j int) {
|
||||
e[i], e[j] = e[j], e[i]
|
||||
}
|
||||
|
||||
func GetAllEvents(c *gin.Context) {
|
||||
ledgerConfig := script.GetLedgerConfigFromContext(c)
|
||||
output := script.BeanReportAllEvents(ledgerConfig)
|
||||
script.LogInfo(ledgerConfig.Mail, output)
|
||||
|
||||
events := make([]Event, 0)
|
||||
lines := strings.Split(output, "\n")
|
||||
beanFilePath := script.GetLedgerEventsFilePath(ledgerConfig.DataPath)
|
||||
bytes, err := script.ReadFile(beanFilePath)
|
||||
if err != nil {
|
||||
InternalError(c, err.Error())
|
||||
return
|
||||
}
|
||||
lines := strings.Split(string(bytes), "\n")
|
||||
events := Events{}
|
||||
// foreach lines
|
||||
for idx, line := range lines {
|
||||
if idx < 2 || idx > len(lines)-3 {
|
||||
continue
|
||||
}
|
||||
for _, line := range lines {
|
||||
if strings.Trim(line, " ") == "" {
|
||||
continue
|
||||
}
|
||||
// split line by " "
|
||||
words := strings.Fields(line)
|
||||
if len(words) < 4 {
|
||||
continue
|
||||
}
|
||||
if words[1] != "event" {
|
||||
continue
|
||||
}
|
||||
events = append(events, Event{
|
||||
Date: words[0],
|
||||
Type: words[1],
|
||||
Description: words[2],
|
||||
Type: strings.ReplaceAll(words[2], "\"", ""),
|
||||
Description: strings.ReplaceAll(words[3], "\"", ""),
|
||||
})
|
||||
}
|
||||
if len(events) > 0 {
|
||||
// events 按时间倒序排列
|
||||
sort.Sort(sort.Reverse(events))
|
||||
}
|
||||
OK(c, events)
|
||||
}
|
||||
|
||||
|
|
@ -49,14 +79,31 @@ func AddEvent(c *gin.Context) {
|
|||
ledgerConfig := script.GetLedgerConfigFromContext(c)
|
||||
filePath := script.GetLedgerEventsFilePath(ledgerConfig.DataPath)
|
||||
|
||||
line := fmt.Sprintf("%s event \"%s\" \"%s\"", event.Date, event.Type, event.Description)
|
||||
// 写入文件
|
||||
err := script.AppendFileInNewLine(filePath, line)
|
||||
if err != nil {
|
||||
InternalError(c, err.Error())
|
||||
return
|
||||
if event.Type != "" {
|
||||
event.Types = []string{event.Type}
|
||||
}
|
||||
OK(c, event)
|
||||
|
||||
// 定义Event类型的数组
|
||||
events := make([]Event, 0)
|
||||
|
||||
if event.Types != nil {
|
||||
for _, t := range event.Types {
|
||||
events = append(events, Event{
|
||||
Date: event.Date,
|
||||
Type: t,
|
||||
Description: event.Description,
|
||||
})
|
||||
line := fmt.Sprintf("%s event \"%s\" \"%s\"", event.Date, t, event.Description)
|
||||
// 写入文件
|
||||
err := script.AppendFileInNewLine(filePath, line)
|
||||
if err != nil {
|
||||
InternalError(c, err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OK(c, events)
|
||||
}
|
||||
|
||||
func DeleteEvent(c *gin.Context) {
|
||||
|
|
|
|||
|
|
@ -442,23 +442,35 @@ func StatsPayee(c *gin.Context) {
|
|||
|
||||
result := make([]StatsPayeeResult, 0)
|
||||
for _, l := range statsPayeeQueryResultList {
|
||||
// 交易账户名称非空
|
||||
if l.Payee != "" {
|
||||
payee := StatsPayeeResult{
|
||||
Payee: l.Payee,
|
||||
Currency: ledgerConfig.OperatingCurrency,
|
||||
}
|
||||
//查询交易次数
|
||||
if statsQuery.Type == "cot" {
|
||||
payee.Value = json.Number(decimal.NewFromInt32(l.Count).String())
|
||||
} else {
|
||||
fields := strings.Fields(l.Position)
|
||||
total, err := decimal.NewFromString(fields[0])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if statsQuery.Type == "avg" {
|
||||
payee.Value = json.Number(total.Div(decimal.NewFromInt32(l.Count)).Round(2).String())
|
||||
} else {
|
||||
payee.Value = json.Number(fields[0])
|
||||
//查询交易金额,要过滤掉空白交易金额的科目,
|
||||
// 比如 记账购买后又全额退款导致科目交易条目数>0但是累计金额=0
|
||||
if l.Position != "" {
|
||||
// 读取交易金额相关信息
|
||||
fields := strings.Fields(l.Position)
|
||||
// 交易金额
|
||||
total, err := decimal.NewFromString(fields[0])
|
||||
// 错误处理
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
if statsQuery.Type == "avg" {
|
||||
// 如果是查询平均交易金额
|
||||
payee.Value = json.Number(total.Div(decimal.NewFromInt32(l.Count)).Round(2).String())
|
||||
} else {
|
||||
// 如果是查询总交易金额
|
||||
payee.Value = json.Number(fields[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
result = append(result, payee)
|
||||
|
|
|
|||
|
|
@ -83,7 +83,8 @@ func sum(entries []AddTransactionEntryForm, openingBalances string) decimal.Deci
|
|||
if entry.Account == openingBalances {
|
||||
return decimal.NewFromInt(0)
|
||||
}
|
||||
if entry.Price.Exponent() == 0 {
|
||||
pVal, _ := entry.Price.Float64()
|
||||
if pVal == 0 {
|
||||
sumVal = entry.Number.Add(sumVal)
|
||||
} else {
|
||||
sumVal = entry.Number.Mul(entry.Price).Add(sumVal)
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@ package service
|
|||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func QueryVersion(c *gin.Context) {
|
||||
OK(c, "v1.1.14")
|
||||
OK(c, "v1.1.15")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue