Compare commits
10 Commits
6cc2ba28a0
...
930202a6b6
| Author | SHA1 | Date | |
|---|---|---|---|
| 930202a6b6 | |||
| 2e81e57774 | |||
| f60d78fe8b | |||
| f3c86b9775 | |||
| 38e25bf88a | |||
| ee9943f618 | |||
| d8e823f165 | |||
| b4e0d8ebc2 | |||
| b9c18375f5 | |||
| e5ff5608a8 |
@@ -1,6 +1,6 @@
|
|||||||
FROM docker-0.unsee.tech/nginx:1.27.0
|
FROM nginx:1.27.0
|
||||||
COPY dist/ /usr/share/nginx/html/
|
COPY dist/ /usr/share/nginx/html/
|
||||||
COPY nginx.conf /etc/nginx/conf.d/
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||||
RUN echo 'Asia/Shanghai' > /etc/timezone
|
RUN echo 'Asia/Shanghai' > /etc/timezone
|
||||||
RUN chmod -R 755 /usr/share/nginx/html/
|
RUN chmod -R 755 /usr/share/nginx/html/
|
||||||
|
|||||||
97
nginx.conf
97
nginx.conf
@@ -1,106 +1,27 @@
|
|||||||
##
|
|
||||||
# You should look at the following URL's in order to grasp a solid understanding
|
|
||||||
# of Nginx configuration files in order to fully unleash the power of Nginx.
|
|
||||||
# https://www.nginx.com/resources/wiki/start/
|
|
||||||
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
|
|
||||||
# https://wiki.debian.org/Nginx/DirectoryStructure
|
|
||||||
#
|
|
||||||
# In most cases, administrators will remove this file from sites-enabled/ and
|
|
||||||
# leave it as reference inside of sites-available where it will continue to be
|
|
||||||
# updated by the nginx packaging team.
|
|
||||||
#
|
|
||||||
# This file will automatically load configuration files provided by other
|
|
||||||
# applications, such as Drupal or Wordpress. These applications will be made
|
|
||||||
# available underneath a path with that package name, such as /drupal8.
|
|
||||||
#
|
|
||||||
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
|
|
||||||
##
|
|
||||||
|
|
||||||
# Default server configuration
|
|
||||||
#
|
|
||||||
server {
|
server {
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
listen [::]:80 default_server;
|
listen [::]:80 default_server;
|
||||||
|
|
||||||
# SSL configuration
|
|
||||||
#
|
|
||||||
# listen 443 ssl default_server;
|
|
||||||
# listen [::]:443 ssl default_server;
|
|
||||||
#
|
|
||||||
# Note: You should disable gzip for SSL traffic.
|
|
||||||
# See: https://bugs.debian.org/773332
|
|
||||||
#
|
|
||||||
# Read up on ssl_ciphers to ensure a secure configuration.
|
|
||||||
# See: https://bugs.debian.org/765782
|
|
||||||
#
|
|
||||||
# Self signed certs generated by the ssl-cert package
|
|
||||||
# Don't use them in a production server!
|
|
||||||
#
|
|
||||||
# include snippets/snakeoil.conf;
|
|
||||||
|
|
||||||
#root /var/www/html;
|
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
# Add index.php to the list if you are using PHP
|
|
||||||
#index index.html index.htm index.nginx-debian.html;
|
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
location /admin-service/ {
|
location /sweet-hut/ {
|
||||||
proxy_pass http://admin-service:8080/;
|
alias /usr/share/nginx/html/;
|
||||||
|
try_files $uri $uri/ /sweet-hut/index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /home-api/ {
|
||||||
|
proxy_pass http://host.docker.internal:8081/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /home-service/ {
|
location /blog-api/ {
|
||||||
proxy_pass http://home-service:8081/;
|
proxy_pass http://host.docker.internal:8082/;
|
||||||
}
|
|
||||||
|
|
||||||
location /blog-service/ {
|
|
||||||
proxy_pass http://blog-service:8082/;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
# First attempt to serve request as file, then
|
|
||||||
# as directory, then fall back to displaying a 404.
|
|
||||||
try_files $uri $uri/ =404;
|
try_files $uri $uri/ =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
# pass PHP scripts to FastCGI server
|
|
||||||
#
|
|
||||||
#location ~ \.php$ {
|
|
||||||
# include snippets/fastcgi-php.conf;
|
|
||||||
#
|
|
||||||
# # With php-fpm (or other unix sockets):
|
|
||||||
# fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
|
|
||||||
# # With php-cgi (or other tcp sockets):
|
|
||||||
# fastcgi_pass 127.0.0.1:9000;
|
|
||||||
#}
|
|
||||||
|
|
||||||
# deny access to .htaccess files, if Apache's document root
|
|
||||||
# concurs with nginx's one
|
|
||||||
#
|
|
||||||
#location ~ /\.ht {
|
|
||||||
# deny all;
|
|
||||||
#}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Virtual Host configuration for example.com
|
|
||||||
#
|
|
||||||
# You can move that to a different file under sites-available/ and symlink that
|
|
||||||
# to sites-enabled/ to enable it.
|
|
||||||
#
|
|
||||||
#server {
|
|
||||||
# listen 80;
|
|
||||||
# listen [::]:80;
|
|
||||||
#
|
|
||||||
# server_name example.com;
|
|
||||||
#
|
|
||||||
# root /var/www/example.com;
|
|
||||||
# index index.html;
|
|
||||||
#
|
|
||||||
# location / {
|
|
||||||
# try_files $uri $uri/ =404;
|
|
||||||
# }
|
|
||||||
#}
|
|
||||||
|
|
||||||
|
|||||||
177
package-lock.json
generated
177
package-lock.json
generated
@@ -29,9 +29,11 @@
|
|||||||
"lunar-javascript": "^1.7.2",
|
"lunar-javascript": "^1.7.2",
|
||||||
"md-editor-v3": "^4.21.3",
|
"md-editor-v3": "^4.21.3",
|
||||||
"pinia": "^2.3.1",
|
"pinia": "^2.3.1",
|
||||||
|
"ua-parser-js": "^2.0.3",
|
||||||
"v-calendar": "^3.1.2",
|
"v-calendar": "^3.1.2",
|
||||||
"vue": "3.5.12",
|
"vue": "3.5.12",
|
||||||
"vue3-common": "git+https://gitee.com/Cxx0822/vue3-common",
|
"vue3-common": "git+https://gitee.com/Cxx0822/vue3-common",
|
||||||
|
"vue3-emoji-picker": "^1.1.8",
|
||||||
"vue3-eslint": "git+https://gitee.com/Cxx0822/vue3-eslint"
|
"vue3-eslint": "git+https://gitee.com/Cxx0822/vue3-eslint"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -2737,12 +2739,21 @@
|
|||||||
"version": "18.19.86",
|
"version": "18.19.86",
|
||||||
"resolved": "https://registry.npmmirror.com/@types/node/-/node-18.19.86.tgz",
|
"resolved": "https://registry.npmmirror.com/@types/node/-/node-18.19.86.tgz",
|
||||||
"integrity": "sha512-fifKayi175wLyKyc5qUfyENhQ1dCNI1UNjp653d8kuYcPQN5JhX3dGuP/XmvPTg/xRBn1VTLpbmi+H/Mr7tLfQ==",
|
"integrity": "sha512-fifKayi175wLyKyc5qUfyENhQ1dCNI1UNjp653d8kuYcPQN5JhX3dGuP/XmvPTg/xRBn1VTLpbmi+H/Mr7tLfQ==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~5.26.4"
|
"undici-types": "~5.26.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/node-fetch": {
|
||||||
|
"version": "2.6.12",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@types/node-fetch/-/node-fetch-2.6.12.tgz",
|
||||||
|
"integrity": "sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*",
|
||||||
|
"form-data": "^4.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@types/resize-observer-browser": {
|
"node_modules/@types/resize-observer-browser": {
|
||||||
"version": "0.1.11",
|
"version": "0.1.11",
|
||||||
"resolved": "https://registry.npmmirror.com/@types/resize-observer-browser/-/resize-observer-browser-0.1.11.tgz",
|
"resolved": "https://registry.npmmirror.com/@types/resize-observer-browser/-/resize-observer-browser-0.1.11.tgz",
|
||||||
@@ -3519,8 +3530,7 @@
|
|||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
|
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
|
||||||
"license": "MIT",
|
"license": "MIT"
|
||||||
"peer": true
|
|
||||||
},
|
},
|
||||||
"node_modules/atob": {
|
"node_modules/atob": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
@@ -4019,7 +4029,6 @@
|
|||||||
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"delayed-stream": "~1.0.0"
|
"delayed-stream": "~1.0.0"
|
||||||
},
|
},
|
||||||
@@ -4488,11 +4497,30 @@
|
|||||||
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/detect-europe-js": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/detect-europe-js/-/detect-europe-js-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-lgdERlL3u0aUdHocoouzT10d9I89VVhk0qNRmll7mXdGfJT1/wqZ2ZLA4oJAjeACPY5fT1wsbq2AT+GkuInsow==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/faisalman"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/ua-parser-js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "paypal",
|
||||||
|
"url": "https://paypal.me/faisalman"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/detect-libc": {
|
"node_modules/detect-libc": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.3",
|
||||||
"resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-1.0.3.tgz",
|
"resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-1.0.3.tgz",
|
||||||
@@ -5848,7 +5876,6 @@
|
|||||||
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.2.tgz",
|
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.2.tgz",
|
||||||
"integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==",
|
"integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"asynckit": "^0.4.0",
|
"asynckit": "^0.4.0",
|
||||||
"combined-stream": "^1.0.8",
|
"combined-stream": "^1.0.8",
|
||||||
@@ -6372,6 +6399,12 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-2-Clause"
|
"license": "BSD-2-Clause"
|
||||||
},
|
},
|
||||||
|
"node_modules/idb": {
|
||||||
|
"version": "7.1.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/idb/-/idb-7.1.1.tgz",
|
||||||
|
"integrity": "sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/ignore": {
|
"node_modules/ignore": {
|
||||||
"version": "5.3.2",
|
"version": "5.3.2",
|
||||||
"resolved": "https://registry.npmmirror.com/ignore/-/ignore-5.3.2.tgz",
|
"resolved": "https://registry.npmmirror.com/ignore/-/ignore-5.3.2.tgz",
|
||||||
@@ -6844,6 +6877,26 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-standalone-pwa": {
|
||||||
|
"version": "0.1.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/is-standalone-pwa/-/is-standalone-pwa-0.1.1.tgz",
|
||||||
|
"integrity": "sha512-9Cbovsa52vNQCjdXOzeQq5CnCbAcRk05aU62K20WO372NrTv0NxibLFCK6lQ4/iZEFdEA3p3t2VNOn8AJ53F5g==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/faisalman"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/ua-parser-js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "paypal",
|
||||||
|
"url": "https://paypal.me/faisalman"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/is-string": {
|
"node_modules/is-string": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmmirror.com/is-string/-/is-string-1.1.1.tgz",
|
"resolved": "https://registry.npmmirror.com/is-string/-/is-string-1.1.1.tgz",
|
||||||
@@ -7400,7 +7453,6 @@
|
|||||||
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
|
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
|
||||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
@@ -7410,7 +7462,6 @@
|
|||||||
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
|
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
|
||||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"peer": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mime-db": "1.52.0"
|
"mime-db": "1.52.0"
|
||||||
},
|
},
|
||||||
@@ -7636,6 +7687,26 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"node_modules/node-fetch": {
|
||||||
|
"version": "2.7.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||||
|
"integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"whatwg-url": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "4.x || >=6.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"encoding": "^0.1.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"encoding": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/node-releases": {
|
"node_modules/node-releases": {
|
||||||
"version": "2.0.19",
|
"version": "2.0.19",
|
||||||
"resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.19.tgz",
|
"resolved": "https://registry.npmmirror.com/node-releases/-/node-releases-2.0.19.tgz",
|
||||||
@@ -10207,6 +10278,12 @@
|
|||||||
"integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==",
|
"integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/tr46": {
|
||||||
|
"version": "0.0.3",
|
||||||
|
"resolved": "https://registry.npmmirror.com/tr46/-/tr46-0.0.3.tgz",
|
||||||
|
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/traverse": {
|
"node_modules/traverse": {
|
||||||
"version": "0.6.11",
|
"version": "0.6.11",
|
||||||
"resolved": "https://registry.npmmirror.com/traverse/-/traverse-0.6.11.tgz",
|
"resolved": "https://registry.npmmirror.com/traverse/-/traverse-0.6.11.tgz",
|
||||||
@@ -10406,6 +10483,59 @@
|
|||||||
"node": ">=14.17"
|
"node": ">=14.17"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ua-is-frozen": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/ua-is-frozen/-/ua-is-frozen-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-RwKDW2p3iyWn4UbaxpP2+VxwqXh0jpvdxsYpZ5j/MLLiQOfbsV5shpgQiw93+KMYQPcteeMQ289MaAFzs3G9pw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/faisalman"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/ua-parser-js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "paypal",
|
||||||
|
"url": "https://paypal.me/faisalman"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/ua-parser-js": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmmirror.com/ua-parser-js/-/ua-parser-js-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-LZyXZdNttONW8LjzEH3Z8+6TE7RfrEiJqDKyh0R11p/kxvrV2o9DrT2FGZO+KVNs3k+drcIQ6C3En6wLnzJGpw==",
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/ua-parser-js"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "paypal",
|
||||||
|
"url": "https://paypal.me/faisalman"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/faisalman"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"license": "AGPL-3.0-or-later",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node-fetch": "^2.6.12",
|
||||||
|
"detect-europe-js": "^0.1.2",
|
||||||
|
"is-standalone-pwa": "^0.1.1",
|
||||||
|
"node-fetch": "^2.7.0",
|
||||||
|
"ua-is-frozen": "^0.1.2"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"ua-parser-js": "script/cli.js"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/uc.micro": {
|
"node_modules/uc.micro": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmmirror.com/uc.micro/-/uc.micro-2.1.0.tgz",
|
"resolved": "https://registry.npmmirror.com/uc.micro/-/uc.micro-2.1.0.tgz",
|
||||||
@@ -10434,7 +10564,6 @@
|
|||||||
"version": "5.26.5",
|
"version": "5.26.5",
|
||||||
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz",
|
"resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-5.26.5.tgz",
|
||||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/union-value": {
|
"node_modules/union-value": {
|
||||||
@@ -11406,6 +11535,20 @@
|
|||||||
"vue-router": "^4.2.2"
|
"vue-router": "^4.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/vue3-emoji-picker": {
|
||||||
|
"version": "1.1.8",
|
||||||
|
"resolved": "https://registry.npmmirror.com/vue3-emoji-picker/-/vue3-emoji-picker-1.1.8.tgz",
|
||||||
|
"integrity": "sha512-k9tVHeQEBVLzVCLYAkFaI1nib3FJFQwdPhWD5khJkhks3ktg3g12z5wPGOSDpIuSLNtelRGvq1qdmZuJu5khfA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@popperjs/core": "^2.11.0",
|
||||||
|
"idb": "^7.1.0",
|
||||||
|
"vue": "^3.2.23"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/vue3-eslint": {
|
"node_modules/vue3-eslint": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "git+https://gitee.com/Cxx0822/vue3-eslint#849a4e0e783d3ecc57035fb2f92950998b6b2e41",
|
"resolved": "git+https://gitee.com/Cxx0822/vue3-eslint#849a4e0e783d3ecc57035fb2f92950998b6b2e41",
|
||||||
@@ -11444,6 +11587,22 @@
|
|||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/whatwg-url": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"tr46": "~0.0.3",
|
||||||
|
"webidl-conversions": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/whatwg-url/node_modules/webidl-conversions": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
|
||||||
|
"license": "BSD-2-Clause"
|
||||||
|
},
|
||||||
"node_modules/which": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz",
|
"resolved": "https://registry.npmmirror.com/which/-/which-2.0.2.tgz",
|
||||||
|
|||||||
@@ -29,9 +29,11 @@
|
|||||||
"lunar-javascript": "^1.7.2",
|
"lunar-javascript": "^1.7.2",
|
||||||
"md-editor-v3": "^4.21.3",
|
"md-editor-v3": "^4.21.3",
|
||||||
"pinia": "^2.3.1",
|
"pinia": "^2.3.1",
|
||||||
|
"ua-parser-js": "^2.0.3",
|
||||||
"v-calendar": "^3.1.2",
|
"v-calendar": "^3.1.2",
|
||||||
"vue": "3.5.12",
|
"vue": "3.5.12",
|
||||||
"vue3-common": "git+https://gitee.com/Cxx0822/vue3-common",
|
"vue3-common": "git+https://gitee.com/Cxx0822/vue3-common",
|
||||||
|
"vue3-emoji-picker": "^1.1.8",
|
||||||
"vue3-eslint": "git+https://gitee.com/Cxx0822/vue3-eslint"
|
"vue3-eslint": "git+https://gitee.com/Cxx0822/vue3-eslint"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
20
pnpm-lock.yaml
generated
20
pnpm-lock.yaml
generated
@@ -80,6 +80,9 @@ importers:
|
|||||||
vue3-common:
|
vue3-common:
|
||||||
specifier: git+https://gitee.com/Cxx0822/vue3-common
|
specifier: git+https://gitee.com/Cxx0822/vue3-common
|
||||||
version: git+https://gitee.com/Cxx0822/vue3-common#ba7c8a0b1a20a714f0bf09b10d9486b5fd518ca0(axios@1.9.0)(crypto-js@4.2.0)(echarts@5.6.0)(element-plus@2.9.7(vue@3.5.12(typescript@5.8.3)))(font-awesome@4.7.0)(js-cookie@3.0.5)(path-browserify@1.0.1)(pinia@2.3.1(typescript@5.8.3)(vue@3.5.12(typescript@5.8.3)))(qs@6.14.0)(vue-router@4.5.1(vue@3.5.12(typescript@5.8.3)))(vue@3.5.12(typescript@5.8.3))
|
version: git+https://gitee.com/Cxx0822/vue3-common#ba7c8a0b1a20a714f0bf09b10d9486b5fd518ca0(axios@1.9.0)(crypto-js@4.2.0)(echarts@5.6.0)(element-plus@2.9.7(vue@3.5.12(typescript@5.8.3)))(font-awesome@4.7.0)(js-cookie@3.0.5)(path-browserify@1.0.1)(pinia@2.3.1(typescript@5.8.3)(vue@3.5.12(typescript@5.8.3)))(qs@6.14.0)(vue-router@4.5.1(vue@3.5.12(typescript@5.8.3)))(vue@3.5.12(typescript@5.8.3))
|
||||||
|
vue3-emoji-picker:
|
||||||
|
specifier: ^1.1.8
|
||||||
|
version: 1.1.8(typescript@5.8.3)
|
||||||
vue3-eslint:
|
vue3-eslint:
|
||||||
specifier: git+https://gitee.com/Cxx0822/vue3-eslint
|
specifier: git+https://gitee.com/Cxx0822/vue3-eslint
|
||||||
version: git+https://gitee.com/Cxx0822/vue3-eslint#849a4e0e783d3ecc57035fb2f92950998b6b2e41(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0)(typescript@5.8.3))(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint-config-standard@16.0.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint@7.32.0))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint-plugin-vue@8.7.1(eslint@7.32.0))(eslint@7.32.0)
|
version: git+https://gitee.com/Cxx0822/vue3-eslint#849a4e0e783d3ecc57035fb2f92950998b6b2e41(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0)(typescript@5.8.3))(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint-config-standard@16.0.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint@7.32.0))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint-plugin-vue@8.7.1(eslint@7.32.0))(eslint@7.32.0)
|
||||||
@@ -2064,6 +2067,9 @@ packages:
|
|||||||
htmlparser2@3.10.1:
|
htmlparser2@3.10.1:
|
||||||
resolution: {integrity: sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==}
|
resolution: {integrity: sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==}
|
||||||
|
|
||||||
|
idb@7.1.1:
|
||||||
|
resolution: {integrity: sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==}
|
||||||
|
|
||||||
ignore@4.0.6:
|
ignore@4.0.6:
|
||||||
resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==}
|
resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==}
|
||||||
engines: {node: '>= 4'}
|
engines: {node: '>= 4'}
|
||||||
@@ -3301,6 +3307,10 @@ packages:
|
|||||||
vue: ^3.5.12
|
vue: ^3.5.12
|
||||||
vue-router: ^4.2.2
|
vue-router: ^4.2.2
|
||||||
|
|
||||||
|
vue3-emoji-picker@1.1.8:
|
||||||
|
resolution: {integrity: sha512-k9tVHeQEBVLzVCLYAkFaI1nib3FJFQwdPhWD5khJkhks3ktg3g12z5wPGOSDpIuSLNtelRGvq1qdmZuJu5khfA==}
|
||||||
|
engines: {node: '>=16.0.0'}
|
||||||
|
|
||||||
vue3-eslint@git+https://gitee.com/Cxx0822/vue3-eslint#849a4e0e783d3ecc57035fb2f92950998b6b2e41:
|
vue3-eslint@git+https://gitee.com/Cxx0822/vue3-eslint#849a4e0e783d3ecc57035fb2f92950998b6b2e41:
|
||||||
resolution: {commit: 849a4e0e783d3ecc57035fb2f92950998b6b2e41, repo: https://gitee.com/Cxx0822/vue3-eslint, type: git}
|
resolution: {commit: 849a4e0e783d3ecc57035fb2f92950998b6b2e41, repo: https://gitee.com/Cxx0822/vue3-eslint, type: git}
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
@@ -5684,6 +5694,8 @@ snapshots:
|
|||||||
inherits: 2.0.4
|
inherits: 2.0.4
|
||||||
readable-stream: 3.6.2
|
readable-stream: 3.6.2
|
||||||
|
|
||||||
|
idb@7.1.1: {}
|
||||||
|
|
||||||
ignore@4.0.6: {}
|
ignore@4.0.6: {}
|
||||||
|
|
||||||
ignore@5.3.2: {}
|
ignore@5.3.2: {}
|
||||||
@@ -7027,6 +7039,14 @@ snapshots:
|
|||||||
vue: 3.5.12(typescript@5.8.3)
|
vue: 3.5.12(typescript@5.8.3)
|
||||||
vue-router: 4.5.1(vue@3.5.12(typescript@5.8.3))
|
vue-router: 4.5.1(vue@3.5.12(typescript@5.8.3))
|
||||||
|
|
||||||
|
vue3-emoji-picker@1.1.8(typescript@5.8.3):
|
||||||
|
dependencies:
|
||||||
|
'@popperjs/core': 2.11.8
|
||||||
|
idb: 7.1.1
|
||||||
|
vue: 3.5.12(typescript@5.8.3)
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- typescript
|
||||||
|
|
||||||
vue3-eslint@git+https://gitee.com/Cxx0822/vue3-eslint#849a4e0e783d3ecc57035fb2f92950998b6b2e41(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0)(typescript@5.8.3))(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint-config-standard@16.0.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint@7.32.0))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint-plugin-vue@8.7.1(eslint@7.32.0))(eslint@7.32.0):
|
vue3-eslint@git+https://gitee.com/Cxx0822/vue3-eslint#849a4e0e783d3ecc57035fb2f92950998b6b2e41(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0)(typescript@5.8.3))(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint-config-standard@16.0.3(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint@7.32.0))(eslint-plugin-import@2.31.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0))(eslint-plugin-node@11.1.0(eslint@7.32.0))(eslint-plugin-promise@5.2.0(eslint@7.32.0))(eslint-plugin-vue@8.7.1(eslint@7.32.0))(eslint@7.32.0):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0)(typescript@5.8.3)
|
'@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@7.32.0)(typescript@5.8.3))(eslint@7.32.0)(typescript@5.8.3)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import AppLoading from '@/components/AppLoading.vue'
|
import AppLoading from '@/components/Common/AppLoading.vue'
|
||||||
import { useAppStore } from '@/store/app.ts'
|
import { useAppStore } from '@/store/app.ts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
import { cloudService } from './index'
|
|
||||||
import { IAccount } from '@/types/auth.ts'
|
|
||||||
|
|
||||||
export const queryAccountApi = (): Promise<IAccount[]> =>
|
|
||||||
cloudService({
|
|
||||||
url: '/admin-service/account',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
|
|
||||||
export const registerAccountApi = (account: IAccount): Promise<boolean> =>
|
|
||||||
cloudService({
|
|
||||||
url: '/admin-service/account',
|
|
||||||
method: 'post',
|
|
||||||
data: account
|
|
||||||
})
|
|
||||||
|
|
||||||
export const deleteAccountApi = (id: number): Promise<boolean> =>
|
|
||||||
cloudService({
|
|
||||||
url: `/admin-service/account/${id}`,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
|
|
||||||
export const updateAccountPasswordApi = (id: number,
|
|
||||||
oldPassword: string, newPassword: string): Promise<boolean> =>
|
|
||||||
cloudService({
|
|
||||||
url: `/admin-service/account/password/${id}`,
|
|
||||||
method: 'put',
|
|
||||||
params: { oldPassword, newPassword }
|
|
||||||
})
|
|
||||||
@@ -4,33 +4,33 @@ import { IStatsChart } from 'vue3-common/types'
|
|||||||
|
|
||||||
export const addAnniversaryApi = (anniversary: IAnniversary): Promise<boolean> =>
|
export const addAnniversaryApi = (anniversary: IAnniversary): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/anniversary',
|
url: '/home-api/anniversary',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: anniversary
|
data: anniversary
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateAnniversaryApi = (id: number, anniversary: IAnniversary): Promise<boolean> =>
|
export const updateAnniversaryApi = (id: number, anniversary: IAnniversary): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/anniversary/${id}`,
|
url: `/home-api/anniversary/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: anniversary
|
data: anniversary
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteAnniversaryApi = (id: number): Promise<boolean> =>
|
export const deleteAnniversaryApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/anniversary/${id}`,
|
url: `/home-api/anniversary/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryAnniversaryApi = (category: string): Promise<IAnniversary[]> =>
|
export const queryAnniversaryApi = (category: string): Promise<IAnniversary[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/anniversary',
|
url: '/home-api/anniversary',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { category }
|
params: { category }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryAnniversaryCategoryApi = (): Promise<IStatsChart[]> =>
|
export const queryAnniversaryCategoryApi = (): Promise<IStatsChart[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/anniversary/category',
|
url: '/home-api/anniversary/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,33 +3,33 @@ import { IAssetRecord } from '@/types/asset'
|
|||||||
|
|
||||||
export const addAssetApi = (asset: IAssetRecord): Promise<boolean> =>
|
export const addAssetApi = (asset: IAssetRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/asset',
|
url: '/home-api/asset',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: asset
|
data: asset
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateAssetApi = (id: number, asset: IAssetRecord): Promise<boolean> =>
|
export const updateAssetApi = (id: number, asset: IAssetRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/asset/${id}`,
|
url: `/home-api/asset/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: asset
|
data: asset
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteAssetApi = (id: number): Promise<boolean> =>
|
export const deleteAssetApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/asset/${id}`,
|
url: `/home-api/asset/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryAssetApi = (category: string): Promise<IAssetRecord[]> =>
|
export const queryAssetApi = (category: string): Promise<IAssetRecord[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/asset',
|
url: '/home-api/asset',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { category }
|
params: { category }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryAssetCategoryApi = (): Promise<string[]> =>
|
export const queryAssetCategoryApi = (): Promise<string[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/asset/category',
|
url: '/home-api/asset/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,106 +4,106 @@ import {
|
|||||||
IBillCategory,
|
IBillCategory,
|
||||||
IBillPay,
|
IBillPay,
|
||||||
IBillQuery,
|
IBillQuery,
|
||||||
IBillRecord,
|
IBillRecord
|
||||||
} from '@/types/bill'
|
} from '@/types/bill'
|
||||||
import { IStatsChart } from 'vue3-common/dist/types'
|
import { IStatsChart } from 'vue3-common/dist/types'
|
||||||
|
|
||||||
export const addBillRecordApi = (billRecord: IBillRecord): Promise<boolean> =>
|
export const addBillRecordApi = (billRecord: IBillRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/bill',
|
url: '/home-api/bill',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: billRecord
|
data: billRecord
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateBillRecordApi = (id: number, billRecord: IBillRecord): Promise<boolean> =>
|
export const updateBillRecordApi = (id: number, billRecord: IBillRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/bill/${id}`,
|
url: `/home-api/bill/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: billRecord
|
data: billRecord
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteBillRecordApi = (id: number): Promise<boolean> =>
|
export const deleteBillRecordApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/bill/${id}`,
|
url: `/home-api/bill/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBillRecordApi = (id: number): Promise<IBillRecord> =>
|
export const queryBillRecordApi = (id: number): Promise<IBillRecord> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/bill/${id}`,
|
url: `/home-api/bill/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBillSummaryApi = (query: IBillQuery): Promise<IBillRecord[]> =>
|
export const queryBillSummaryApi = (query: IBillQuery): Promise<IBillRecord[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/bill/summary',
|
url: '/home-api/bill/summary',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBillStatsApi = (type: string, query: IBillQuery): Promise<IStatsChart[]> =>
|
export const queryBillStatsApi = (type: string, query: IBillQuery): Promise<IStatsChart[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/bill/stats/${type}`,
|
url: `/home-api/bill/stats/${type}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBillPayApi = (): Promise<IBillPay[]> =>
|
export const queryBillPayApi = (): Promise<IBillPay[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/bill/pay',
|
url: '/home-api/bill/pay',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBillBookApi = (): Promise<IBillBook[]> =>
|
export const queryBillBookApi = (): Promise<IBillBook[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/bill/book',
|
url: '/home-api/bill/book',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBillCategoryApi = (): Promise<IBillCategory[]> =>
|
export const queryBillCategoryApi = (): Promise<IBillCategory[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/bill/category',
|
url: '/home-api/bill/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const addBillPayApi = (billPay: IBillPay): Promise<boolean> =>
|
export const addBillPayApi = (billPay: IBillPay): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/bill-manage/pay',
|
url: '/home-api/bill-manage/pay',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: billPay
|
data: billPay
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateBillPayApi = (id: number, billPay: IBillPay): Promise<boolean> =>
|
export const updateBillPayApi = (id: number, billPay: IBillPay): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/bill-manage/pay/${id}`,
|
url: `/home-api/bill-manage/pay/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: billPay
|
data: billPay
|
||||||
})
|
})
|
||||||
|
|
||||||
export const addBillBookApi = (billBook: IBillBook): Promise<boolean> =>
|
export const addBillBookApi = (billBook: IBillBook): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/bill-manage/book',
|
url: '/home-api/bill-manage/book',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: billBook
|
data: billBook
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateBillBookApi = (id: number, billBook: IBillBook): Promise<boolean> =>
|
export const updateBillBookApi = (id: number, billBook: IBillBook): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/bill-manage/book/${id}`,
|
url: `/home-api/bill-manage/book/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: billBook
|
data: billBook
|
||||||
})
|
})
|
||||||
|
|
||||||
export const addBillCategoryApi = (billCategory: IBillCategory): Promise<boolean> =>
|
export const addBillCategoryApi = (billCategory: IBillCategory): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/bill-manage/category',
|
url: '/home-api/bill-manage/category',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: billCategory
|
data: billCategory
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateBillCategoryApi = (id: number, billCategory: IBillCategory): Promise<boolean> =>
|
export const updateBillCategoryApi = (id: number, billCategory: IBillCategory): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/bill-manage/category/${id}`,
|
url: `/home-api/bill-manage/category/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: billCategory
|
data: billCategory
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,18 +1,19 @@
|
|||||||
import { cloudService } from './index'
|
import { cloudService } from './index'
|
||||||
import { IBlog, IBlogCategory, IBlogStats, INewBlog, IQueryBlog } from '@/types/blog'
|
import { IBlog, IBlogCategory, IBlogComment, IBlogStats, INewBlog, IQueryBlog } from '@/types/blog'
|
||||||
|
|
||||||
import qs from 'qs'
|
import qs from 'qs'
|
||||||
|
import { IPageRecord } from '@/types'
|
||||||
|
|
||||||
export const queryBlogApi = (currentPage: number, pageSize: number): Promise<any> =>
|
export const queryBlogApi = (currentPage: number, pageSize: number): Promise<IPageRecord<IBlog>> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/blog-service/blog/page',
|
url: '/blog-api/blog/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { currentPage, pageSize }
|
params: { currentPage, pageSize }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBlogByConditionApi = (query: IQueryBlog): Promise<IBlog[]> =>
|
export const queryBlogByConditionApi = (query: IQueryBlog): Promise<IBlog[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/blog-service/blog/condition',
|
url: '/blog-api/blog/condition',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query,
|
params: query,
|
||||||
paramsSerializer: (params) => {
|
paramsSerializer: (params) => {
|
||||||
@@ -22,70 +23,57 @@ export const queryBlogByConditionApi = (query: IQueryBlog): Promise<IBlog[]> =>
|
|||||||
|
|
||||||
export const queryBlogByIdApi = (id: number): Promise<IBlog> =>
|
export const queryBlogByIdApi = (id: number): Promise<IBlog> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/blog-service/blog/content/${id}`,
|
url: `/blog-api/blog/content/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBlogCategoryApi = (): Promise<IBlogCategory[]> =>
|
export const queryBlogCategoryApi = (): Promise<IBlogCategory[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/blog-service/blog/category',
|
url: '/blog-api/blog/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBlogStatsApi = (): Promise<IBlogStats> =>
|
export const queryBlogStatsApi = (): Promise<IBlogStats> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/blog-service/blog/stats',
|
url: '/blog-api/blog/stats',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryLatestBlogApi = (): Promise<IBlog[]> =>
|
export const queryLatestBlogApi = (): Promise<IBlog[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/blog-service/blog/latest',
|
url: '/blog-api/blog/latest',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryAdminBlogApi = (currentPage: number, pageSize: number): Promise<any> =>
|
export const queryBlogCommentApi = (blogId: number): Promise<IBlogComment[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/admin-service/blog-manage/page',
|
url: `/blog-api/blog/comment/${blogId}`,
|
||||||
method: 'get',
|
|
||||||
params: { currentPage, pageSize }
|
|
||||||
})
|
|
||||||
|
|
||||||
export const queryAdminBlogByIdApi = (id: number): Promise<IBlog> =>
|
|
||||||
cloudService({
|
|
||||||
url: `/admin-service/blog-manage/content/${id}`,
|
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryAdminBlogCategoryApi = (): Promise<IBlogCategory[]> =>
|
export const addBlogCommentApi = (blogComment: IBlogComment): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/admin-service/blog-manage/category',
|
url: '/blog-api/blog/comment',
|
||||||
method: 'get'
|
method: 'put',
|
||||||
|
data: blogComment
|
||||||
})
|
})
|
||||||
|
|
||||||
export const addBlogApi = (blog: INewBlog): Promise<boolean> =>
|
export const addBlogApi = (blog: INewBlog): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/admin-service/blog-manage',
|
url: '/admin-api/blog-manage',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: blog
|
data: blog
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateBlogApi = (id: number, blog: INewBlog): Promise<boolean> =>
|
export const updateBlogApi = (id: number, blog: INewBlog): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/admin-service/blog-manage/${id}`,
|
url: `/admin-api/blog-manage/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: blog
|
data: blog
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteBlogApi = (id: number): Promise<boolean> =>
|
export const deleteBlogApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/admin-service/blog-manage/${id}`,
|
url: `/admin-api/blog-manage/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBlogVisitApi = (currentPage: number, pageSize: number): Promise<any> =>
|
|
||||||
cloudService({
|
|
||||||
url: '/admin-service/blog-manage/visit',
|
|
||||||
method: 'get',
|
|
||||||
params: { currentPage, pageSize }
|
|
||||||
})
|
|
||||||
|
|||||||
@@ -3,47 +3,47 @@ import { IBudgetInfo } from '@/types/budget'
|
|||||||
|
|
||||||
export const addBudgetApi = (budget: IBudgetInfo): Promise<any> =>
|
export const addBudgetApi = (budget: IBudgetInfo): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/budget',
|
url: '/home-api/budget',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: budget
|
data: budget
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateBudgetApi = (id: number, budget: IBudgetInfo): Promise<any> =>
|
export const updateBudgetApi = (id: number, budget: IBudgetInfo): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/budget/${id}`,
|
url: `/home-api/budget/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: budget
|
data: budget
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteBudgetApi = (id: number): Promise<any> =>
|
export const deleteBudgetApi = (id: number): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/budget/${id}`,
|
url: `/home-api/budget/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBudgetApi = (category: string): Promise<any> =>
|
export const queryBudgetApi = (category: string): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/budget',
|
url: '/home-api/budget',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { category }
|
params: { category }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBudgetCategory = (): Promise<any> =>
|
export const queryBudgetCategory = (): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/budget/category',
|
url: '/home-api/budget/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBudgetRankStats = (category: string): Promise<any> =>
|
export const queryBudgetRankStats = (category: string): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/budget/stats/rank',
|
url: '/home-api/budget/stats/rank',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { category }
|
params: { category }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryBudgetProjectStats = (category: string): Promise<any> =>
|
export const queryBudgetProjectStats = (category: string): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/budget/stats/project',
|
url: '/home-api/budget/stats/project',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { category }
|
params: { category }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { IFileInfo } from '@/types/file'
|
|||||||
|
|
||||||
export const uploadFileApi = (form: FormData, path: string, md5: string): Promise<any> =>
|
export const uploadFileApi = (form: FormData, path: string, md5: string): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/file',
|
url: '/home-api/file',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'multipart/form-data'
|
'Content-Type': 'multipart/form-data'
|
||||||
},
|
},
|
||||||
@@ -12,38 +12,9 @@ export const uploadFileApi = (form: FormData, path: string, md5: string): Promis
|
|||||||
data: form
|
data: form
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传图片到Hello图床
|
|
||||||
* @param form 表单
|
|
||||||
* @param token token
|
|
||||||
*/
|
|
||||||
export const uploadHelloImageApi = (form: FormData, token: string): Promise<any> =>
|
|
||||||
cloudService({
|
|
||||||
url: '/hello-service/upload',
|
|
||||||
headers: {
|
|
||||||
Authorization: token,
|
|
||||||
'Content-Type': 'multipart/form-data'
|
|
||||||
},
|
|
||||||
method: 'post',
|
|
||||||
data: form
|
|
||||||
})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取Hello图床相册
|
|
||||||
* @param token token
|
|
||||||
*/
|
|
||||||
export const getHelloAlbumsApi = (token: string): Promise<any> =>
|
|
||||||
cloudService({
|
|
||||||
url: '/hello-service/albums',
|
|
||||||
headers: {
|
|
||||||
Authorization: token
|
|
||||||
},
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
|
|
||||||
export const getFolderInfoApi = (folderName: string): Promise<IFileInfo[]> =>
|
export const getFolderInfoApi = (folderName: string): Promise<IFileInfo[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/file/catalog',
|
url: '/home-api/file/catalog',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { folderName }
|
params: { folderName }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,79 +3,79 @@ import { IFoodQuery, IFoodRecipe, IFoodRecord, IFoodStats } from '@/types/food'
|
|||||||
|
|
||||||
export const addFoodRecipeApi = (foodRecipe: IFoodRecipe): Promise<boolean> =>
|
export const addFoodRecipeApi = (foodRecipe: IFoodRecipe): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/food/recipe',
|
url: '/home-api/food/recipe',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: foodRecipe
|
data: foodRecipe
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateFoodRecipeApi = (id: number, foodRecipe: IFoodRecipe): Promise<boolean> =>
|
export const updateFoodRecipeApi = (id: number, foodRecipe: IFoodRecipe): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/food/recipe/${id}`,
|
url: `/home-api/food/recipe/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: foodRecipe
|
data: foodRecipe
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteFoodRecipeApi = (id: number): Promise<boolean> =>
|
export const deleteFoodRecipeApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/food/recipe/${id}`,
|
url: `/home-api/food/recipe/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryFoodRecipeByIdApi = (id: number): Promise<any> =>
|
export const queryFoodRecipeByIdApi = (id: number): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/food/recipe/${id}`,
|
url: `/home-api/food/recipe/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryFoodRecipeApi = (currentPage: number, pageSize: number,
|
export const queryFoodRecipeApi = (currentPage: number, pageSize: number,
|
||||||
query: IFoodQuery): Promise<any> =>
|
query: IFoodQuery): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/food/recipe/page',
|
url: '/home-api/food/recipe/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { currentPage, pageSize, ...query }
|
params: { currentPage, pageSize, ...query }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryFoodNameListApi = (): Promise<string[]> =>
|
export const queryFoodNameListApi = (): Promise<string[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/food/recipe/name',
|
url: '/home-api/food/recipe/name',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const addFoodRecordApi = (foodRecord: IFoodRecord): Promise<boolean> =>
|
export const addFoodRecordApi = (foodRecord: IFoodRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/food/record',
|
url: '/home-api/food/record',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: foodRecord
|
data: foodRecord
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateFoodRecordApi = (id: number, foodRecord: IFoodRecord): Promise<boolean> =>
|
export const updateFoodRecordApi = (id: number, foodRecord: IFoodRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/food/record/${id}`,
|
url: `/home-api/food/record/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: foodRecord
|
data: foodRecord
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteFoodRecordApi = (id: number): Promise<boolean> =>
|
export const deleteFoodRecordApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/food/record/${id}`,
|
url: `/home-api/food/record/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryFoodRecordApi = (startDate: string, endDate: string): Promise<IFoodRecord[]> =>
|
export const queryFoodRecordApi = (startDate: string, endDate: string): Promise<IFoodRecord[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/food/record',
|
url: '/home-api/food/record',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { startDate, endDate }
|
params: { startDate, endDate }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryFoodCategoryApi = (): Promise<string[]> =>
|
export const queryFoodCategoryApi = (): Promise<string[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/food/category',
|
url: '/home-api/food/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryFoodStatsApi = (): Promise<IFoodStats> =>
|
export const queryFoodStatsApi = (): Promise<IFoodStats> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/food/stats',
|
url: '/home-api/food/stats',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,33 +4,33 @@ import { IJournal, IJournalQuery } from '@/types/journal.ts'
|
|||||||
|
|
||||||
export const addJournalApi = (journal: IJournal): Promise<boolean> =>
|
export const addJournalApi = (journal: IJournal): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/journal',
|
url: '/home-api/journal',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: journal
|
data: journal
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateJournalApi = (id: number, journal: IJournal): Promise<boolean> =>
|
export const updateJournalApi = (id: number, journal: IJournal): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/journal/${id}`,
|
url: `/home-api/journal/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: journal
|
data: journal
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteJournalApi = (id: number): Promise<boolean> =>
|
export const deleteJournalApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/journal/${id}`,
|
url: `/home-api/journal/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryJournalApi = (query: IJournalQuery): Promise<IJournal[]> =>
|
export const queryJournalApi = (query: IJournalQuery): Promise<IJournal[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/journal',
|
url: '/home-api/journal',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { ...query }
|
params: { ...query }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryJournalCategoryApi = (): Promise<IStatsChart[]> =>
|
export const queryJournalCategoryApi = (): Promise<IStatsChart[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/journal/category',
|
url: '/home-api/journal/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,27 +3,27 @@ import { IKpi, IKpiQuery } from '@/types/kpi'
|
|||||||
|
|
||||||
export const addKpiApi = (kpi: IKpi): Promise<boolean> =>
|
export const addKpiApi = (kpi: IKpi): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/kpi',
|
url: '/home-api/kpi',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: kpi
|
data: kpi
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateKpiApi = (id: number, kpi: IKpi): Promise<boolean> =>
|
export const updateKpiApi = (id: number, kpi: IKpi): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/kpi/${id}`,
|
url: `/home-api/kpi/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: kpi
|
data: kpi
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteKpiApi = (id: number): Promise<boolean> =>
|
export const deleteKpiApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/kpi/${id}`,
|
url: `/home-api/kpi/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryKpiApi = (query: IKpiQuery): Promise<IKpi[]> =>
|
export const queryKpiApi = (query: IKpiQuery): Promise<IKpi[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/kpi',
|
url: '/home-api/kpi',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { ...query }
|
params: { ...query }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,33 +3,33 @@ import { ILedgerRecord } from '@/types/ledger'
|
|||||||
|
|
||||||
export const addLedgerApi = (ledger: ILedgerRecord): Promise<boolean> =>
|
export const addLedgerApi = (ledger: ILedgerRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/ledger',
|
url: '/home-api/ledger',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ledger
|
data: ledger
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateLedgerApi = (id: number, ledger: ILedgerRecord): Promise<boolean> =>
|
export const updateLedgerApi = (id: number, ledger: ILedgerRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/ledger/${id}`,
|
url: `/home-api/ledger/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: ledger
|
data: ledger
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteLedgerApi = (id: number): Promise<boolean> =>
|
export const deleteLedgerApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/ledger/${id}`,
|
url: `/home-api/ledger/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryLedgerApi = (book: string): Promise<ILedgerRecord[]> =>
|
export const queryLedgerApi = (book: string): Promise<ILedgerRecord[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/ledger',
|
url: '/home-api/ledger',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { book }
|
params: { book }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryLedgerBookApi = (): Promise<string[]> =>
|
export const queryLedgerBookApi = (): Promise<string[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/ledger/book',
|
url: '/home-api/ledger/book',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,33 +3,33 @@ import { IPassword, IQueryPassword } from '@/types/password'
|
|||||||
|
|
||||||
export const addPasswordApi = (password: IPassword): Promise<boolean> =>
|
export const addPasswordApi = (password: IPassword): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/password',
|
url: '/home-api/password',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: password
|
data: password
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updatePasswordApi = (id: number, password: IPassword): Promise<boolean> =>
|
export const updatePasswordApi = (id: number, password: IPassword): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/password/${id}`,
|
url: `/home-api/password/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: password
|
data: password
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deletePasswordApi = (id: number): Promise<boolean> =>
|
export const deletePasswordApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/password/${id}`,
|
url: `/home-api/password/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryPasswordApi = (query: IQueryPassword): Promise<IPassword[]> =>
|
export const queryPasswordApi = (query: IQueryPassword): Promise<IPassword[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/password',
|
url: '/home-api/password',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryPasswordCategoryApi = (): Promise<string[]> =>
|
export const queryPasswordCategoryApi = (): Promise<string[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/password/category',
|
url: '/home-api/password/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -4,34 +4,34 @@ import { IPeriodDay, IPeriodSetting } from '@/types/period.ts'
|
|||||||
|
|
||||||
export const updatePeriodDayApi = (id: number, periodDay: IPeriodDay): Promise<boolean> =>
|
export const updatePeriodDayApi = (id: number, periodDay: IPeriodDay): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/period/day/${id}`,
|
url: `/home-api/period/day/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: periodDay
|
data: periodDay
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryPeriodDayApi = (month: string): Promise<IPeriodDay[]> =>
|
export const queryPeriodDayApi = (month: string): Promise<IPeriodDay[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/period/day',
|
url: '/home-api/period/day',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { month }
|
params: { month }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const getMenstruateFirstDateApi = (month: string): Promise<string> =>
|
export const getMenstruateFirstDateApi = (month: string): Promise<string> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/period/menstruate',
|
url: '/home-api/period/menstruate',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { month }
|
params: { month }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updatePeriodSettingApi = (id: number, setting: IPeriodSetting): Promise<boolean> =>
|
export const updatePeriodSettingApi = (id: number, setting: IPeriodSetting): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/period/setting/${id}`,
|
url: `/home-api/period/setting/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: setting
|
data: setting
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryPeriodSettingApi = (): Promise<IPeriodSetting> =>
|
export const queryPeriodSettingApi = (): Promise<IPeriodSetting> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/period/setting',
|
url: '/home-api/period/setting',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,40 +3,40 @@ import { IPlanInfo, IPlanQuery } from '@/types/plan.ts'
|
|||||||
|
|
||||||
export const addPlanApi = (plan: IPlanInfo): Promise<any> =>
|
export const addPlanApi = (plan: IPlanInfo): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/plan',
|
url: '/home-api/plan',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: plan
|
data: plan
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updatePlanApi = (id: number, plan: IPlanInfo): Promise<any> =>
|
export const updatePlanApi = (id: number, plan: IPlanInfo): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/plan/${id}`,
|
url: `/home-api/plan/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: plan
|
data: plan
|
||||||
})
|
})
|
||||||
|
|
||||||
export const setPlanStatusApi = (id: number, status: boolean): Promise<any> =>
|
export const setPlanStatusApi = (id: number, status: boolean): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/plan/${id}/status`,
|
url: `/home-api/plan/${id}/status`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
params: { status }
|
params: { status }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deletePlanApi = (id: number): Promise<any> =>
|
export const deletePlanApi = (id: number): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/plan/${id}`,
|
url: `/home-api/plan/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryPlanApi = (query: IPlanQuery): Promise<any> =>
|
export const queryPlanApi = (query: IPlanQuery): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/plan',
|
url: '/home-api/plan',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryPlanStatsApi = (): Promise<any> =>
|
export const queryPlanStatsApi = (): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/plan/stats',
|
url: '/home-api/plan/stats',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,39 +3,39 @@ import { IProduct, IQueryProduct } from '@/types/product.ts'
|
|||||||
|
|
||||||
export const addProductApi = (product: IProduct): Promise<boolean> =>
|
export const addProductApi = (product: IProduct): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/product',
|
url: '/home-api/product',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: product
|
data: product
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateProductApi = (id: number, product: IProduct): Promise<boolean> =>
|
export const updateProductApi = (id: number, product: IProduct): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/product/${id}`,
|
url: `/home-api/product/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: product
|
data: product
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteProductApi = (id: number): Promise<boolean> =>
|
export const deleteProductApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/product/${id}`,
|
url: `/home-api/product/${id}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryProductApi = (id: number): Promise<IProduct> =>
|
export const queryProductApi = (id: number): Promise<IProduct> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/product/${id}`,
|
url: `/home-api/product/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryProductListApi = (query: IQueryProduct): Promise<IProduct[]> =>
|
export const queryProductListApi = (query: IQueryProduct): Promise<IProduct[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/product',
|
url: '/home-api/product',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryProductCategoryApi = (): Promise<string[]> =>
|
export const queryProductCategoryApi = (): Promise<string[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/product/category',
|
url: '/home-api/product/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ import { IQuartzInfo } from '@/types/quartz'
|
|||||||
|
|
||||||
export const queryQuartzApi = (): Promise<IQuartzInfo[]> =>
|
export const queryQuartzApi = (): Promise<IQuartzInfo[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/quartz',
|
url: '/home-api/quartz',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { ISession } from '@/types/auth'
|
|||||||
|
|
||||||
export const loginHomeApi = (name: string, password: string): Promise<ISession> =>
|
export const loginHomeApi = (name: string, password: string): Promise<ISession> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/session',
|
url: '/home-api/session',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: { name, password }
|
params: { name, password }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const loginAdminApi = (name: string, password: string): Promise<ISession> =>
|
export const loginAdminApi = (name: string, password: string): Promise<ISession> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/admin-service/session',
|
url: '/admin-api/session',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
params: { name, password }
|
params: { name, password }
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,80 +3,80 @@ import { ITravelQuery, ITravelRecord, ITravelSpot, ITravelStats } from '@/types/
|
|||||||
|
|
||||||
export const addTravelSpotApi = (travelSpot: ITravelSpot): Promise<boolean> =>
|
export const addTravelSpotApi = (travelSpot: ITravelSpot): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/travel/spot',
|
url: '/home-api/travel/spot',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: travelSpot
|
data: travelSpot
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateTravelSpotApi = (id: number, travelSpot: ITravelSpot): Promise<boolean> =>
|
export const updateTravelSpotApi = (id: number, travelSpot: ITravelSpot): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/travel/spot/${id}`,
|
url: `/home-api/travel/spot/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: travelSpot
|
data: travelSpot
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteTravelSpotApi = (id: number): Promise<boolean> =>
|
export const deleteTravelSpotApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/travel/spot/${id}`,
|
url: `/home-api/travel/spot/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryTravelSpotApi = (id: number): Promise<ITravelSpot> =>
|
export const queryTravelSpotApi = (id: number): Promise<ITravelSpot> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/travel/spot/${id}`,
|
url: `/home-api/travel/spot/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryTravelSpotListApi = (currentPage: number, pageSize: number,
|
export const queryTravelSpotListApi = (currentPage: number, pageSize: number,
|
||||||
query: ITravelQuery): Promise<any> =>
|
query: ITravelQuery): Promise<any> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/travel/spot/page',
|
url: '/home-api/travel/spot/page',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { currentPage, pageSize, ...query }
|
params: { currentPage, pageSize, ...query }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryTravelSpotNameListApi = (): Promise<string[]> =>
|
export const queryTravelSpotNameListApi = (): Promise<string[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/travel/spot/name',
|
url: '/home-api/travel/spot/name',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const addTravelRecordApi = (travelRecord: ITravelRecord): Promise<boolean> =>
|
export const addTravelRecordApi = (travelRecord: ITravelRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/travel/record',
|
url: '/home-api/travel/record',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: travelRecord
|
data: travelRecord
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateTravelRecordApi = (id: number, travelRecord: ITravelRecord): Promise<boolean> =>
|
export const updateTravelRecordApi = (id: number, travelRecord: ITravelRecord): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/travel/record/${id}`,
|
url: `/home-api/travel/record/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: travelRecord
|
data: travelRecord
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteTravelRecordApi = (id: number): Promise<boolean> =>
|
export const deleteTravelRecordApi = (id: number): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/travel/record/${id}`,
|
url: `/home-api/travel/record/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryTravelRecordApi = (startDate: string, endDate: string):
|
export const queryTravelRecordApi = (startDate: string, endDate: string):
|
||||||
Promise<ITravelRecord[]> =>
|
Promise<ITravelRecord[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/travel/record',
|
url: '/home-api/travel/record',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
params: { startDate, endDate }
|
params: { startDate, endDate }
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryTravelCategoryApi = (): Promise<string[]> =>
|
export const queryTravelCategoryApi = (): Promise<string[]> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/travel/category',
|
url: '/home-api/travel/category',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const queryTravelStatsApi = (): Promise<ITravelStats> =>
|
export const queryTravelStatsApi = (): Promise<ITravelStats> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: '/home-service/travel/stats',
|
url: '/home-api/travel/stats',
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
import { cloudService } from './index'
|
|
||||||
|
|
||||||
export const getAllTravelRecord = (): any =>
|
|
||||||
cloudService({
|
|
||||||
url: '/travelRecord/getAllTravelRecord',
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
|
|
||||||
export const getAllTravelRecordByPage = (currentPage: number, pageSize: number): any =>
|
|
||||||
cloudService({
|
|
||||||
url: '/travelRecord/getAllTravelRecordByPage',
|
|
||||||
method: 'get',
|
|
||||||
params: { currentPage, pageSize }
|
|
||||||
})
|
|
||||||
|
|
||||||
export const addTravelRecord = (travelJournal): any =>
|
|
||||||
cloudService({
|
|
||||||
url: '/travelRecord/addTravelRecord',
|
|
||||||
method: 'post',
|
|
||||||
data: travelJournal
|
|
||||||
})
|
|
||||||
|
|
||||||
export const addTravelRecordImage = (imageList, date, place): any =>
|
|
||||||
cloudService({
|
|
||||||
url: '/travelRecord/addTravelRecordImage',
|
|
||||||
method: 'post',
|
|
||||||
headers: { 'Content-Type': 'multipart/form-data' },
|
|
||||||
params: { date, place },
|
|
||||||
data: imageList
|
|
||||||
})
|
|
||||||
|
|
||||||
@@ -3,13 +3,13 @@ import { IUser } from '@/types/auth.ts'
|
|||||||
|
|
||||||
export const queryUserApi = (id: number): Promise<IUser> =>
|
export const queryUserApi = (id: number): Promise<IUser> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/user/${id}`,
|
url: `/home-api/user/${id}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
|
|
||||||
export const updateUserApi = (id: number, user: IUser): Promise<boolean> =>
|
export const updateUserApi = (id: number, user: IUser): Promise<boolean> =>
|
||||||
cloudService({
|
cloudService({
|
||||||
url: `/home-service/user/${id}`,
|
url: `/home-api/user/${id}`,
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: user
|
data: user
|
||||||
})
|
})
|
||||||
|
|||||||
BIN
src/assets/font/custom.woff2
Normal file
BIN
src/assets/font/custom.woff2
Normal file
Binary file not shown.
Binary file not shown.
@@ -29,8 +29,7 @@ import { defineProps, PropType } from 'vue'
|
|||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { useAnniversaryStore } from '@/store/anniversary.ts'
|
import { useAnniversaryStore } from '@/store/anniversary.ts'
|
||||||
import { IAnniversary } from '@/types/anniversary.ts'
|
import { IAnniversary } from '@/types/anniversary.ts'
|
||||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
import { getAnniversaryRemainDays } from '@/utils/home/anniversaryUtil.ts'
|
||||||
import { getAnniversaryRemainDays } from '@/utils/home/anniversaryUtil'
|
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const anniversaryStore = useAnniversaryStore()
|
const anniversaryStore = useAnniversaryStore()
|
||||||
@@ -45,10 +44,10 @@ const props = defineProps({
|
|||||||
const selectDateCardClick = async () => {
|
const selectDateCardClick = async () => {
|
||||||
anniversaryStore.anniversaryApiType = 'UPDATE'
|
anniversaryStore.anniversaryApiType = 'UPDATE'
|
||||||
|
|
||||||
if (isMobile() && props.dateItem?.category !== '节假日') {
|
if (props.dateItem?.category !== '节假日') {
|
||||||
anniversaryStore.currentAnniversary = props.dateItem as IAnniversary
|
anniversaryStore.currentAnniversary = props.dateItem as IAnniversary
|
||||||
const { id } = anniversaryStore.currentAnniversary
|
const { id } = anniversaryStore.currentAnniversary
|
||||||
await router.push({ name: 'MobileHomeAnniversaryDetailId', params: { id } })
|
await router.push({ name: 'AnniversaryDetailId', params: { id } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -9,9 +9,8 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { defineProps, PropType } from 'vue'
|
import { defineProps, PropType } from 'vue'
|
||||||
import { IAnniversaryCategory } from '@/types/anniversary'
|
import { IAnniversaryCategory } from '@/types/anniversary.ts'
|
||||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
import { useAnniversaryStore } from '@/store/anniversary.ts'
|
||||||
import { useAnniversaryStore } from '@/store/anniversary'
|
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -29,10 +28,8 @@ const router = useRouter()
|
|||||||
const anniversaryStore = useAnniversaryStore()
|
const anniversaryStore = useAnniversaryStore()
|
||||||
|
|
||||||
const selectCategoryClick = () => {
|
const selectCategoryClick = () => {
|
||||||
if (isMobile()) {
|
anniversaryStore.queryInfo.category = props.categoryItem?.name as string
|
||||||
anniversaryStore.queryInfo.category = props.categoryItem?.name as string
|
router.push({ name: 'AnniversaryList' })
|
||||||
router.push({ name: 'MobileHomeAnniversaryList' })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -33,11 +33,9 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { SvgIcon } from 'vue3-common'
|
import { SvgIcon } from 'vue3-common'
|
||||||
import { defineProps, PropType } from 'vue'
|
import { defineProps, PropType } from 'vue'
|
||||||
import { IAsset, IAssetItem } from '@/types/asset'
|
import { IAsset, IAssetItem } from '@/types/asset.ts'
|
||||||
import { formatAmount } from 'vue3-common/utils/numberUtil'
|
import { formatAmount } from 'vue3-common/utils/numberUtil'
|
||||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
import { useAssetStore } from '@/store/asset.ts'
|
||||||
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
|
||||||
import { useAssetStore } from '@/store/asset'
|
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -62,15 +60,7 @@ const editClick = async (asset: IAssetItem) => {
|
|||||||
assetStore.assetApiType = 'UPDATE'
|
assetStore.assetApiType = 'UPDATE'
|
||||||
assetStore.currentAssetRecord = assetStore.assetRecordList.find((item) => item.id === asset.id)
|
assetStore.currentAssetRecord = assetStore.assetRecordList.find((item) => item.id === asset.id)
|
||||||
|
|
||||||
if (isMobile()) {
|
await router.push({ name: 'AssetDetailId', params: { id: asset.id } })
|
||||||
await router.push({ name: 'MobileHomeAssetDetailId', params: { id: asset.id } })
|
|
||||||
} else {
|
|
||||||
assetStore.assetDialog = {
|
|
||||||
title: '编辑资产',
|
|
||||||
visible: true,
|
|
||||||
data: deepCopyObject(assetStore.currentAssetRecord)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -62,13 +62,13 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||||
import { useBillStore } from '@/store/bill'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { ElMessage, FormRules } from 'element-plus'
|
import { ElMessage, FormRules } from 'element-plus'
|
||||||
import { IBillBook } from '@/types/bill'
|
import { IBillBook } from '@/types/bill.ts'
|
||||||
import { billBookRules } from '@/utils/element/elRules'
|
import { billBookRules } from '@/utils/element/elRules.ts'
|
||||||
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
||||||
import type { IDialog, IHandleApi } from 'vue3-common/types'
|
import type { IDialog, IHandleApi } from 'vue3-common/types'
|
||||||
import { addBillBookApi, updateBillBookApi } from '@/apis/bill'
|
import { addBillBookApi, updateBillBookApi } from '@/apis/bill.ts'
|
||||||
import { tableCellStyle, tableHeaderStyle, tableRowStyle } from 'vue3-common/utils/elUtil'
|
import { tableCellStyle, tableHeaderStyle, tableRowStyle } from 'vue3-common/utils/elUtil'
|
||||||
|
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
@@ -12,13 +12,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import BillDailyItem from '@/components/Home/Bill/BillDailyItem.vue'
|
import BillDailyItem from '@/components/Bill/BillDailyItem.vue'
|
||||||
import { reactive, watch, ref, onMounted } from 'vue'
|
import { reactive, watch, ref, onMounted } from 'vue'
|
||||||
import { useBillStore } from '@/store/bill.ts'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { formatDate } from 'vue3-common/utils/dateUtil'
|
import { formatDate } from 'vue3-common/utils/dateUtil'
|
||||||
import { CalendarDay, Page } from 'v-calendar/dist/types/src/utils/page'
|
import { CalendarDay, Page } from 'v-calendar/dist/types/src/utils/page'
|
||||||
import { getCalendarDateList } from '@/utils/home/billUtil.ts'
|
import { getCalendarDateList } from '@/utils/home/billUtil.ts'
|
||||||
import { useAppStore } from '@/store/app'
|
import { useAppStore } from '@/store/app.ts'
|
||||||
|
|
||||||
const calendarRef = ref()
|
const calendarRef = ref()
|
||||||
const billStore = useBillStore()
|
const billStore = useBillStore()
|
||||||
@@ -96,11 +96,11 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||||
import { useBillStore } from '@/store/bill'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { IBillBook, IBillCategory } from '@/types/bill'
|
import { IBillBook, IBillCategory } from '@/types/bill.ts'
|
||||||
import { ElMessage, FormRules } from 'element-plus'
|
import { ElMessage, FormRules } from 'element-plus'
|
||||||
import { billCategoryRules } from '@/utils/element/elRules'
|
import { billCategoryRules } from '@/utils/element/elRules.ts'
|
||||||
import { addBillCategoryApi, updateBillCategoryApi } from '@/apis/bill'
|
import { addBillCategoryApi, updateBillCategoryApi } from '@/apis/bill.ts'
|
||||||
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
||||||
import { tableHeaderStyle, tableRowStyle, tableCellStyle } from 'vue3-common/utils/elUtil'
|
import { tableHeaderStyle, tableRowStyle, tableCellStyle } from 'vue3-common/utils/elUtil'
|
||||||
import type { IDialog, IHandleApi } from 'vue3-common/types'
|
import type { IDialog, IHandleApi } from 'vue3-common/types'
|
||||||
@@ -38,11 +38,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import BillRank from '@/components/Home/Bill/BillRank.vue'
|
import BillRank from '@/components/Bill/BillRank.vue'
|
||||||
import { onMounted, ref, watch } from 'vue'
|
import { onMounted, ref, watch } from 'vue'
|
||||||
import * as echarts from 'echarts'
|
import * as echarts from 'echarts'
|
||||||
import { lineChartOptions, barChartOptions, pieChartOptions } from 'vue3-common/utils/eChartsUtil'
|
import { lineChartOptions, barChartOptions, pieChartOptions } from 'vue3-common/utils/eChartsUtil'
|
||||||
import { useBillStore } from '@/store/bill'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { useAppStore } from '@/store/app.ts'
|
import { useAppStore } from '@/store/app.ts'
|
||||||
import type { IStatsChart } from 'vue3-common/types'
|
import type { IStatsChart } from 'vue3-common/types'
|
||||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
||||||
@@ -91,6 +91,9 @@ const updateChart = () => {
|
|||||||
label: {
|
label: {
|
||||||
color: '#FFFFFF'
|
color: '#FFFFFF'
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
label: {
|
||||||
|
show: false
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
@@ -36,8 +36,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import DailySummary from '@/components/Home/DailySummary.vue'
|
import DailySummary from '@/components/DailySummary.vue'
|
||||||
import DailyCard from '@/components/Home/DailyCard.vue'
|
import DailyCard from '@/components/DailyCard.vue'
|
||||||
import { defineProps, onMounted, reactive, watch } from 'vue'
|
import { defineProps, onMounted, reactive, watch } from 'vue'
|
||||||
import { useBillStore } from '@/store/bill.ts'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
@@ -104,7 +104,7 @@ const selectBillRecordClick = async (billRecord: IBillRecord) => {
|
|||||||
|
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
await router.push({
|
await router.push({
|
||||||
name: 'MobileHomeBillDetailId',
|
name: 'BillDetailId',
|
||||||
params: { id: billStore.currentBillRecord.id }
|
params: { id: billStore.currentBillRecord.id }
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import BillDailyItem from '@/components/Home/Bill/BillDailyItem.vue'
|
import BillDailyItem from '@/components/Bill/BillDailyItem.vue'
|
||||||
import { reactive, watch } from 'vue'
|
import { reactive, watch } from 'vue'
|
||||||
import { useBillStore } from '@/store/bill.ts'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
|
|
||||||
@@ -118,12 +118,12 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { UploadImage, AmountInput } from 'vue3-common'
|
import { UploadImage, AmountInput } from 'vue3-common'
|
||||||
import { useBillStore } from '@/store/bill'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { Location, Document } from '@element-plus/icons-vue'
|
import { Location, Document } from '@element-plus/icons-vue'
|
||||||
import { FormRules } from 'element-plus'
|
import { FormRules } from 'element-plus'
|
||||||
import { billRecordRules } from '@/utils/element/elRules'
|
import { billRecordRules } from '@/utils/element/elRules.ts'
|
||||||
import { nextTick, reactive, ref } from 'vue'
|
import { nextTick, reactive, ref } from 'vue'
|
||||||
import { IBillCategory } from '@/types/bill'
|
import { IBillCategory } from '@/types/bill.ts'
|
||||||
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
|
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
|
||||||
import { fileServiceUrl, serviceFileRootPath } from '@/utils'
|
import { fileServiceUrl, serviceFileRootPath } from '@/utils'
|
||||||
|
|
||||||
@@ -62,12 +62,12 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { nextTick, onMounted, reactive, ref } from 'vue'
|
import { nextTick, onMounted, reactive, ref } from 'vue'
|
||||||
import { useBillStore } from '@/store/bill'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { ElMessage, FormRules } from 'element-plus'
|
import { ElMessage, FormRules } from 'element-plus'
|
||||||
import { IBillPay } from '@/types/bill'
|
import { IBillPay } from '@/types/bill.ts'
|
||||||
import { billPayRules } from '@/utils/element/elRules'
|
import { billPayRules } from '@/utils/element/elRules.ts'
|
||||||
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
||||||
import { addBillPayApi, updateBillPayApi } from '@/apis/bill'
|
import { addBillPayApi, updateBillPayApi } from '@/apis/bill.ts'
|
||||||
import { tableCellStyle, tableHeaderStyle, tableRowStyle } from 'vue3-common/utils/elUtil'
|
import { tableCellStyle, tableHeaderStyle, tableRowStyle } from 'vue3-common/utils/elUtil'
|
||||||
import type { IDialog, IHandleApi } from 'vue3-common/types'
|
import type { IDialog, IHandleApi } from 'vue3-common/types'
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useBillStore } from '@/store/bill'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { getBillSortByAmount } from '@/utils/home/billUtil.ts'
|
import { getBillSortByAmount } from '@/utils/home/billUtil.ts'
|
||||||
import { computed } from 'vue'
|
import { computed } from 'vue'
|
||||||
|
|
||||||
@@ -19,11 +19,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import StatsCard from '@/components/Home/StatsCard.vue'
|
import StatsCard from '@/components/StatsCard.vue'
|
||||||
import { useBillStore } from '@/store/bill'
|
import { useBillStore } from '@/store/bill.ts'
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
import { getBillSummaryStats } from '@/utils/home/billUtil'
|
import { getBillSummaryStats } from '@/utils/home/billUtil.ts'
|
||||||
import { IBillSummaryStats } from '@/types/bill'
|
import { IBillSummaryStats } from '@/types/bill.ts'
|
||||||
import { formatAmount } from 'vue3-common/utils/numberUtil'
|
import { formatAmount } from 'vue3-common/utils/numberUtil'
|
||||||
|
|
||||||
const billStore = useBillStore()
|
const billStore = useBillStore()
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="blog-archive blog-section">
|
<div class="blog-archive blog-section card-item">
|
||||||
<h4 class="module-title">文章归档</h4>
|
<h4 class="module-title">文章归档</h4>
|
||||||
|
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -53,10 +53,10 @@ const changeDateEvent = async (value: Date) => {
|
|||||||
*/
|
*/
|
||||||
const viewBlogClick = async (index: number) => {
|
const viewBlogClick = async (index: number) => {
|
||||||
const blogId = blogStore.blogList[index].id
|
const blogId = blogStore.blogList[index].id
|
||||||
await router.push({ name: 'BlogDetail', params: { id: blogId } })
|
await router.push({ name: 'DetailId', params: { id: blogId } })
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@use "@/styles/blog/blog.archive.module.scss";
|
@use "@/styles/blog/blog.archive.module";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="blog-category blog-section">
|
<div class="blog-category blog-section card-item">
|
||||||
<h4 class="module-title">文章分类</h4>
|
<h4 class="module-title">文章分类</h4>
|
||||||
|
|
||||||
<span class="total">目前共计{{ blogStore.blogCategoryList.length }}个分类</span>
|
<span class="total">目前共计{{ blogStore.blogCategoryList.length }}个分类</span>
|
||||||
@@ -31,10 +31,10 @@ onMounted(() => {
|
|||||||
* @param name 类别名称
|
* @param name 类别名称
|
||||||
*/
|
*/
|
||||||
const viewBlogCategoryClick = async (name: string) => {
|
const viewBlogCategoryClick = async (name: string) => {
|
||||||
await router.push({ name: 'BlogCategoryName', params: { name } })
|
await router.push({ name: 'CategoryName', params: { name } })
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@use "@/styles/blog/blog.category.module.scss";
|
@use "@/styles/blog/blog.category.module";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="blog-category-detail blog-section">
|
<div class="blog-category-detail blog-section card-item">
|
||||||
<span class="name">{{ route.params?.name }}</span>
|
<span class="name">{{ route.params?.name }}</span>
|
||||||
|
|
||||||
<div class="category-detail-list">
|
<div class="category-detail-list">
|
||||||
@@ -32,10 +32,10 @@ onMounted(async () => {
|
|||||||
|
|
||||||
const viewBlogClick = async (index: number) => {
|
const viewBlogClick = async (index: number) => {
|
||||||
const blogId = blogStore.blogList[index].id
|
const blogId = blogStore.blogList[index].id
|
||||||
await router.push({ name: 'BlogDetailId', params: { id: blogId } })
|
await router.push({ name: 'DetailId', params: { id: blogId } })
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@use "@/styles/blog/blog.category.detail.module.scss";
|
@use "@/styles/blog/blog.category.detail.module";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
30
src/components/Blog/Comment/BlogComment.vue
Normal file
30
src/components/Blog/Comment/BlogComment.vue
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<template>
|
||||||
|
<div class="blog-comment card-item">
|
||||||
|
<div class="comment-total">
|
||||||
|
<span>共 {{ blogStore.blogNestedCommentList.length }} 条评论</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="comment-list">
|
||||||
|
<blog-comment-item v-for="(item, index) in blogStore.blogNestedCommentList" :key="index"
|
||||||
|
:comment="item.comment" :replyList="item.replies"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import BlogCommentItem from '@/components/Comment/BlogCommentItem.vue'
|
||||||
|
import { useBlogStore } from '@/store/blog.ts'
|
||||||
|
|
||||||
|
const blogStore = useBlogStore()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.blog-comment {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
121
src/components/Blog/Comment/BlogCommentEdit.vue
Normal file
121
src/components/Blog/Comment/BlogCommentEdit.vue
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
<template>
|
||||||
|
<div class="blog-comment-edit card-item">
|
||||||
|
<div class="comment-title">
|
||||||
|
<el-input v-model="blogComment.name"
|
||||||
|
:maxlength="10" show-word-limit
|
||||||
|
placeholder="请输入昵称"/>
|
||||||
|
<el-input v-model="blogComment.website"
|
||||||
|
:maxlength="50" show-word-limit
|
||||||
|
placeholder="请输入个人博客网站"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-input v-model="blogComment.content"
|
||||||
|
placeholder="有什么想和我说的呢" :maxlength="500"
|
||||||
|
:rows="7" show-word-limit type="textarea"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div class="comment-button">
|
||||||
|
<el-popover ref="emojiPopoverRef" placement="top" :width="300" trigger="hover">
|
||||||
|
<template #default>
|
||||||
|
<div class="emoji-panel">
|
||||||
|
<EmojiPicker :native="true" @select="onSelectEmoji" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #reference>
|
||||||
|
<el-button circle>
|
||||||
|
<i class="fa-regular fa-face-smile"></i>
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-popover>
|
||||||
|
|
||||||
|
<el-button type="primary"
|
||||||
|
:disabled="blogComment.content.length === 0"
|
||||||
|
@click="sendCommentClick"
|
||||||
|
class="send-button">发送</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import EmojiPicker from 'vue3-emoji-picker'
|
||||||
|
import 'vue3-emoji-picker/css'
|
||||||
|
import { defineProps, ref, onMounted } from 'vue'
|
||||||
|
import { useBlogStore } from '@/store/blog.ts'
|
||||||
|
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
||||||
|
import { IBlogComment } from '@/types/blog.ts'
|
||||||
|
|
||||||
|
const blogStore = useBlogStore()
|
||||||
|
const emojiPopoverRef = ref()
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
parentId: {
|
||||||
|
required: true,
|
||||||
|
type: Number,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const blogComment = ref<IBlogComment>({
|
||||||
|
id: 0,
|
||||||
|
blogId: 0,
|
||||||
|
name: '',
|
||||||
|
website: '',
|
||||||
|
content: '',
|
||||||
|
ipAddress: '',
|
||||||
|
userAgent: '',
|
||||||
|
parentId: 0,
|
||||||
|
isApproved: true,
|
||||||
|
createTime: ''
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
blogComment.value = deepCopyObject(blogStore.getEmptyBlogComment())
|
||||||
|
})
|
||||||
|
|
||||||
|
const onSelectEmoji = (emoji) => {
|
||||||
|
if (blogComment.value.content.length <= 498) {
|
||||||
|
blogComment.value.content += emoji.i
|
||||||
|
}
|
||||||
|
|
||||||
|
emojiPopoverRef.value.hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
const sendCommentClick = async () => {
|
||||||
|
blogComment.value.parentId = props.parentId
|
||||||
|
blogComment.value.blogId = blogStore.currentBlogId
|
||||||
|
|
||||||
|
if (!blogComment.value.name) {
|
||||||
|
blogComment.value.name = 'Anonymous'
|
||||||
|
}
|
||||||
|
|
||||||
|
await blogStore.addBlogComment(blogComment.value)
|
||||||
|
blogComment.value = deepCopyObject(blogStore.getEmptyBlogComment())
|
||||||
|
blogStore.isShowBlogCommentEdit = false
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.blog-comment-edit {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 10px;
|
||||||
|
|
||||||
|
.comment-title {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.comment-button {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.send-button {
|
||||||
|
margin-left: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
127
src/components/Blog/Comment/BlogCommentItem.vue
Normal file
127
src/components/Blog/Comment/BlogCommentItem.vue
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<div class="blog-comment-card">
|
||||||
|
<el-avatar :src="`https://api.dicebear.com/6.x/adventurer/svg?seed=${props.comment.name}`"
|
||||||
|
:size="50" alt="未加载"/>
|
||||||
|
|
||||||
|
<div class="blog-comment-content">
|
||||||
|
<div class="basic-info">
|
||||||
|
<span>{{ props.comment.name }}</span>
|
||||||
|
<span class="content">{{ getBrowser(props.comment.userAgent) }}</span>
|
||||||
|
<span class="content">{{ getOsInfo(props.comment.userAgent) }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sub-info">
|
||||||
|
<span class="content">{{ props.comment.createTime }}</span>
|
||||||
|
<el-button v-if="!blogComment.isShowEdit"
|
||||||
|
type="primary" text @click="replyClick">回复</el-button>
|
||||||
|
<el-button v-else type="primary"
|
||||||
|
text @click="cancelClick">取消</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>{{ props.comment.content }}</p>
|
||||||
|
|
||||||
|
<blog-comment-edit v-if="blogComment.isShowEdit"
|
||||||
|
:parent-id="props.comment.id"/>
|
||||||
|
|
||||||
|
<div class="reply-list">
|
||||||
|
<div class="blog-comment-card" v-for="(item, index) in props.replyList" :key="index">
|
||||||
|
<el-avatar :src="`https://api.dicebear.com/6.x/adventurer/svg?seed=${item.name}`"
|
||||||
|
:size="50" alt="未加载"/>
|
||||||
|
|
||||||
|
<div class="blog-comment-content">
|
||||||
|
<div class="basic-info">
|
||||||
|
<span>{{ item.name }}</span>
|
||||||
|
<span class="content">{{ getBrowser(props.comment.userAgent) }}</span>
|
||||||
|
<span class="content">{{ getOsInfo(props.comment.userAgent) }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="sub-info">
|
||||||
|
<span class="content">{{ item.createTime }}</span>
|
||||||
|
</div>
|
||||||
|
<p>{{ item.content }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import BlogCommentEdit from '@/components/Comment/BlogCommentEdit.vue'
|
||||||
|
import 'vue3-emoji-picker/css'
|
||||||
|
import { defineProps, PropType, reactive } from 'vue'
|
||||||
|
import { IBlogComment } from '@/types/blog.ts'
|
||||||
|
import { useBlogStore } from '@/store/blog.ts'
|
||||||
|
import { UAParser } from 'ua-parser-js'
|
||||||
|
|
||||||
|
const blogStore = useBlogStore()
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
comment: {
|
||||||
|
required: true,
|
||||||
|
type: Object as PropType<IBlogComment>
|
||||||
|
},
|
||||||
|
replyList: {
|
||||||
|
required: true,
|
||||||
|
type: Object as PropType<IBlogComment[]>
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const blogComment = reactive({
|
||||||
|
isShowEdit: false
|
||||||
|
})
|
||||||
|
|
||||||
|
const replyClick = () => {
|
||||||
|
blogStore.currentBlogComment = blogStore.getEmptyBlogComment()
|
||||||
|
blogComment.isShowEdit = true
|
||||||
|
}
|
||||||
|
|
||||||
|
const cancelClick = () => {
|
||||||
|
blogComment.isShowEdit = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const getOsInfo = (userAgent: string) => {
|
||||||
|
const uaParse = new UAParser(userAgent)
|
||||||
|
return `${uaParse.getOS().name} ${uaParse.getOS().version}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const getBrowser = (userAgent: string) => {
|
||||||
|
const uaParse = new UAParser(userAgent)
|
||||||
|
return `${uaParse.getBrowser().name} ${uaParse.getBrowser().version}`
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.blog-comment-card {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 60px 1fr;
|
||||||
|
gap: 5px;
|
||||||
|
|
||||||
|
.blog-comment-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 5px;
|
||||||
|
|
||||||
|
.basic-info {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
font-size: small;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sub-info {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
font-size: small;
|
||||||
|
color: #666666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,12 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="blog-detail blog-section" id="blog-section">
|
<div class="blog-detail blog-section card-item" id="blog-section">
|
||||||
<div class="blog-title">
|
<div class="blog-title">
|
||||||
<span class="title">{{ blogStore.currentBlog.title }}</span>
|
<span class="title">{{ blogStore.currentBlog.title }}</span>
|
||||||
<blog-label :basic-blog="getBasicBlog(blogStore.currentBlog)"/>
|
<blog-label :basic-blog="getBasicBlog(blogStore.currentBlog)"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="blog-md">
|
<div class="blog-md card-item">
|
||||||
<MdPreview editorId="blog-id" v-model="blogStore.currentBlog.content" />
|
<MdPreview editorId="blog-id"
|
||||||
|
v-model="blogStore.currentBlog.content"
|
||||||
|
:theme="appStore.isDark ? 'dark' : 'light'"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="blog-copyright">
|
<div class="blog-copyright">
|
||||||
@@ -28,28 +30,38 @@
|
|||||||
<div class="blog-ending">
|
<div class="blog-ending">
|
||||||
<span>-------------本文结束♥感谢您的阅读♥给个五星好评吧~~-------------</span>
|
<span>-------------本文结束♥感谢您的阅读♥给个五星好评吧~~-------------</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<blog-comment-edit :parent-id="0"/>
|
||||||
|
|
||||||
|
<blog-comment />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import BlogLabel from '@/components/Blog/Content/BlogLabel.vue'
|
import BlogLabel from '@/components/Content/BlogLabel.vue'
|
||||||
|
import BlogCommentEdit from '@/components/Comment/BlogCommentEdit.vue'
|
||||||
|
import BlogComment from '@/components/Comment/BlogComment.vue'
|
||||||
import { MdPreview } from 'md-editor-v3'
|
import { MdPreview } from 'md-editor-v3'
|
||||||
import 'md-editor-v3/lib/style.css'
|
import 'md-editor-v3/lib/style.css'
|
||||||
import { useBlogStore } from '@/store/blog.ts'
|
import { useBlogStore } from '@/store/blog.ts'
|
||||||
|
import { useAppStore } from '@/store/app.ts'
|
||||||
import { getBasicBlog } from '@/utils/blog/blogUtil.ts'
|
import { getBasicBlog } from '@/utils/blog/blogUtil.ts'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
|
|
||||||
const blogStore = useBlogStore()
|
const blogStore = useBlogStore()
|
||||||
|
const appStore = useAppStore()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const currentUrl = new URL(window.location.href)
|
const currentUrl = new URL(window.location.href)
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await blogStore.queryBlogById(route.params.id as number)
|
const blogId = route.params.id as number
|
||||||
|
blogStore.currentBlogId = blogId
|
||||||
|
await blogStore.queryBlogById(blogId)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@use "@/styles/blog/blog.detail.module.scss";
|
@use "@/styles/blog/blog.detail.module";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -88,5 +88,5 @@ const viewBlogCategoryClick = async () => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
@use "@/styles/blog/blog.label.module.scss";
|
@use "@/styles/blog/blog.label.module";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="blog-content-list blog-section">
|
<div class="blog-content-list blog-section card-item">
|
||||||
<div v-if="blogStore.blogList.length === 0"
|
<div v-if="blogStore.blogList.length === 0"
|
||||||
class="blog-content blog-content-empty" >
|
class="blog-content blog-content-empty" >
|
||||||
</div>
|
</div>
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import BlogLabel from '@/components/Blog/Content/BlogLabel.vue'
|
import BlogLabel from '@/components/Content/BlogLabel.vue'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { useBlogStore } from '@/store/blog.ts'
|
import { useBlogStore } from '@/store/blog.ts'
|
||||||
@@ -48,21 +48,19 @@ onMounted(async () => {
|
|||||||
*/
|
*/
|
||||||
const readBlogClick = async (index: number) => {
|
const readBlogClick = async (index: number) => {
|
||||||
const blogId = blogStore.blogList[index].id
|
const blogId = blogStore.blogList[index].id
|
||||||
await router.push({ name: 'BlogDetailId', params: { id: blogId } })
|
await router.push({ name: 'DetailId', params: { id: blogId } })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 点击切换博客页数按钮
|
* 点击切换博客页数按钮
|
||||||
* @param page 页码
|
* @param page 页码
|
||||||
* @param pageSize 每页大小
|
|
||||||
*/
|
*/
|
||||||
const changePageClick = async (page: number, pageSize: number) => {
|
const changePageClick = async (page: number) => {
|
||||||
blogStore.pageInfo.currentPage = page
|
blogStore.pageInfo.currentPage = page
|
||||||
blogStore.pageInfo.pageSize = pageSize
|
|
||||||
await blogStore.queryBlog()
|
await blogStore.queryBlog()
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "@/styles/blog/blog.overview.module.scss";
|
@use "@/styles/blog/blog.overview.module";
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -16,5 +16,5 @@ const appStore = useAppStore()
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "@/styles/app.loading.module.scss";
|
@use "@/styles/app.loading.module";
|
||||||
</style>
|
</style>
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import WeatherIcon from '@/components/Mobile/WeatherIcon.vue'
|
import WeatherIcon from '@/components/Common/WeatherIcon.vue'
|
||||||
import { onMounted, onUnmounted, reactive } from 'vue'
|
import { onMounted, onUnmounted, reactive } from 'vue'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { Solar } from 'lunar-javascript'
|
import { Solar } from 'lunar-javascript'
|
||||||
@@ -10,12 +10,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import FoodDailyItem from '@/components/Home/Food/FoodDailyItem.vue'
|
import FoodDailyItem from '@/components/Food/FoodDailyItem.vue'
|
||||||
import { reactive, watch, ref, onMounted } from 'vue'
|
import { reactive, watch, ref, onMounted } from 'vue'
|
||||||
import { useFoodStore } from '@/store/food.ts'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { formatDate } from 'vue3-common/utils/dateUtil'
|
import { formatDate } from 'vue3-common/utils/dateUtil'
|
||||||
import { CalendarDay } from 'v-calendar/dist/types/src/utils/page'
|
import { CalendarDay } from 'v-calendar/dist/types/src/utils/page'
|
||||||
import { useAppStore } from '@/store/app'
|
import { useAppStore } from '@/store/app.ts'
|
||||||
|
|
||||||
const calendarRef = ref()
|
const calendarRef = ref()
|
||||||
const foodStore = useFoodStore()
|
const foodStore = useFoodStore()
|
||||||
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Edit, MoreFilled, DeleteFilled } from '@element-plus/icons-vue'
|
import { Edit, MoreFilled, DeleteFilled } from '@element-plus/icons-vue'
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { defineProps, onMounted, PropType, reactive } from 'vue'
|
import { defineProps, onMounted, PropType, reactive } from 'vue'
|
||||||
import { IFoodRecipe, IFoodRecord } from '@/types/food.ts'
|
import { IFoodRecipe, IFoodRecord } from '@/types/food.ts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
@@ -110,11 +110,7 @@ const editFoodRecipeClick = async () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const viewFoodRecipeClick = async () => {
|
const viewFoodRecipeClick = async () => {
|
||||||
if (isMobile()) {
|
await router.push({ name: 'FoodDetailId', params: { id: props.foodItem?.id } })
|
||||||
await router.push({ name: 'MobileHomeFoodDetailId', params: { id: props.foodItem?.id } })
|
|
||||||
} else {
|
|
||||||
await router.push({ name: 'HomeLifeFoodId', params: { id: props.foodItem?.id } })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteFoodRecipeClick = () => {
|
const deleteFoodRecipeClick = () => {
|
||||||
@@ -130,5 +126,5 @@ const changeFoodEvent = (current: number) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@use "@/styles/home/life.record.module.scss";
|
@use "@/styles/home/life.record.module";
|
||||||
</style>
|
</style>
|
||||||
@@ -22,8 +22,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import DailySummary from '@/components/Home/DailySummary.vue'
|
import DailySummary from '@/components/DailySummary.vue'
|
||||||
import DailyCard from '@/components/Home/DailyCard.vue'
|
import DailyCard from '@/components/DailyCard.vue'
|
||||||
import { defineProps, onMounted, reactive, watch } from 'vue'
|
import { defineProps, onMounted, reactive, watch } from 'vue'
|
||||||
import { useFoodStore } from '@/store/food.ts'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
@@ -89,7 +89,7 @@ const selectFoodRecordClick = async (foodRecord: IFoodRecord) => {
|
|||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
appStore.isShowMobileBack = true
|
appStore.isShowMobileBack = true
|
||||||
foodStore.currentFoodRecord = foodRecord
|
foodStore.currentFoodRecord = foodRecord
|
||||||
await router.push({ name: 'MobileHomeFoodRecordForm' })
|
await router.push({ name: 'FoodRecordForm' })
|
||||||
} else {
|
} else {
|
||||||
foodStore.foodRecordDialog = {
|
foodStore.foodRecordDialog = {
|
||||||
title: '编辑记录',
|
title: '编辑记录',
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import FoodDailyItem from '@/components/Home/Food/FoodDailyItem.vue'
|
import FoodDailyItem from '@/components/Food/FoodDailyItem.vue'
|
||||||
import { reactive, watch } from 'vue'
|
import { reactive, watch } from 'vue'
|
||||||
import { useFoodStore } from '@/store/food.ts'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
|
|
||||||
@@ -54,12 +54,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import FoodMaterialForm from '@/components/Home/Food/Form/FoodMaterialForm.vue'
|
import FoodMaterialForm from '@/components/Food/Form/FoodMaterialForm.vue'
|
||||||
import FoodStepForm from '@/components/Home/Food/Form/FoodStepForm.vue'
|
import FoodStepForm from '@/components/Food/Form/FoodStepForm.vue'
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { FormInstance, FormRules } from 'element-plus'
|
import { FormInstance, FormRules } from 'element-plus'
|
||||||
import { computed, nextTick, ref, reactive } from 'vue'
|
import { computed, nextTick, ref, reactive } from 'vue'
|
||||||
import { foodRules } from '@/utils/element/elRules'
|
import { foodRules } from '@/utils/element/elRules.ts'
|
||||||
|
|
||||||
const rules = reactive<FormRules>(foodRules)
|
const rules = reactive<FormRules>(foodRules)
|
||||||
const formRef = ref<FormInstance>()
|
const formRef = ref<FormInstance>()
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
import { ICategory } from '@/types'
|
import { ICategory } from '@/types'
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
import FoodCard from '@/components/Home/Food/FoodCard.vue'
|
import FoodCard from '@/components/Food/FoodCard.vue'
|
||||||
import { useFoodStore } from '@/store/food.ts'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { isLargeScreen } from '@/utils'
|
import { isLargeScreen } from '@/utils'
|
||||||
|
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import StatsCard from '@/components/Home/StatsCard.vue'
|
import StatsCard from '@/components/StatsCard.vue'
|
||||||
import { onMounted } from 'vue'
|
import { onMounted } from 'vue'
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
|
|
||||||
const foodStore = useFoodStore()
|
const foodStore = useFoodStore()
|
||||||
|
|
||||||
@@ -41,10 +41,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { nextTick, reactive, ref } from 'vue'
|
import { nextTick, reactive, ref } from 'vue'
|
||||||
import { FormRules } from 'element-plus'
|
import { FormRules } from 'element-plus'
|
||||||
import { foodMaterialRules } from '@/utils/element/elRules'
|
import { foodMaterialRules } from '@/utils/element/elRules.ts'
|
||||||
const rules = reactive<FormRules>(foodMaterialRules)
|
const rules = reactive<FormRules>(foodMaterialRules)
|
||||||
|
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { IFoodMaterial } from '@/types/food'
|
import { IFoodMaterial } from '@/types/food.ts'
|
||||||
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
||||||
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
|
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
|
||||||
|
|
||||||
@@ -56,10 +56,10 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { UploadImage } from 'vue3-common'
|
import { UploadImage } from 'vue3-common'
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { computed, ref, reactive, nextTick } from 'vue'
|
import { computed, ref, reactive, nextTick } from 'vue'
|
||||||
import { FormInstance, FormRules } from 'element-plus'
|
import { FormInstance, FormRules } from 'element-plus'
|
||||||
import { foodRecordRules } from '@/utils/element/elRules'
|
import { foodRecordRules } from '@/utils/element/elRules.ts'
|
||||||
import { fileServiceUrl, serviceFileRootPath } from '@/utils'
|
import { fileServiceUrl, serviceFileRootPath } from '@/utils'
|
||||||
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
|
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
|
||||||
|
|
||||||
@@ -32,10 +32,10 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { UploadImage } from 'vue3-common'
|
import { UploadImage } from 'vue3-common'
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { ref, reactive, nextTick } from 'vue'
|
import { ref, reactive, nextTick } from 'vue'
|
||||||
import { FormRules } from 'element-plus'
|
import { FormRules } from 'element-plus'
|
||||||
import { foodStepRules } from '@/utils/element/elRules'
|
import { foodStepRules } from '@/utils/element/elRules.ts'
|
||||||
import { fileServiceUrl, serviceFileRootPath } from '@/utils'
|
import { fileServiceUrl, serviceFileRootPath } from '@/utils'
|
||||||
|
|
||||||
const rules = reactive<FormRules>(foodStepRules)
|
const rules = reactive<FormRules>(foodStepRules)
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useFoodStore } from '@/store/food'
|
import { useFoodStore } from '@/store/food.ts'
|
||||||
import { IFoodStep } from '@/types/food'
|
import { IFoodStep } from '@/types/food.ts'
|
||||||
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
||||||
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
|
import { commonElMessageBox } from 'vue3-common/utils/elUtil'
|
||||||
import { serviceFileRootPath } from '@/utils'
|
import { serviceFileRootPath } from '@/utils'
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="date-list">
|
|
||||||
<!-- <el-empty v-if="planStore.planList.length === 0" />-->
|
|
||||||
|
|
||||||
<el-scrollbar>
|
|
||||||
<date-card v-for="(item, index) in 4"
|
|
||||||
:key="index" :plan="item">
|
|
||||||
</date-card>
|
|
||||||
</el-scrollbar>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import DateCard from '@/components/Home/Anniversary/AnniversaryCard.vue'
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
|
||||||
@use "@/styles/home.variable.module.scss";
|
|
||||||
|
|
||||||
.date-list {
|
|
||||||
height: calc(100vh - 120px);
|
|
||||||
|
|
||||||
.el-scrollbar {
|
|
||||||
.el-scrollbar__view {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 2vh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="budget-chart">
|
|
||||||
<div class="budget-rank-chart card-item" ref="budgetRankChartRef"/>
|
|
||||||
<div class="budget-project-chart card-item" ref="budgetProjectChartRef"/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { onMounted, ref, watch } from 'vue'
|
|
||||||
import * as echarts from 'echarts'
|
|
||||||
import { useBudgetStore } from '@/store/budget'
|
|
||||||
import { barChartOptions, pieChartOptions } from 'vue3-common/utils/eChartsUtil'
|
|
||||||
|
|
||||||
const budgetStore = useBudgetStore()
|
|
||||||
|
|
||||||
const budgetRankChartRef = ref<HTMLElement>()
|
|
||||||
const budgetProjectChartRef = ref<HTMLElement>()
|
|
||||||
|
|
||||||
let budgetRankChart: echarts.ECharts
|
|
||||||
let budgetProjectChart: echarts.ECharts
|
|
||||||
|
|
||||||
watch(() => budgetStore.isRefresh, () => {
|
|
||||||
updateChart()
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(() => {
|
|
||||||
budgetRankChart = echarts.init(budgetRankChartRef.value as HTMLElement)
|
|
||||||
budgetProjectChart = echarts.init(budgetProjectChartRef.value as HTMLElement)
|
|
||||||
})
|
|
||||||
|
|
||||||
const updateChart = () => {
|
|
||||||
// 预算排行统计图
|
|
||||||
const rankNameList = budgetStore.budgetRankStatsList.map((item) => item.name)
|
|
||||||
const rankValueList = budgetStore.budgetRankStatsList.map((item) => item.value)
|
|
||||||
budgetRankChart.setOption(barChartOptions('📊预算排行', '项目', rankNameList, '金额', rankValueList))
|
|
||||||
|
|
||||||
// 预算项目统计图
|
|
||||||
budgetProjectChart.setOption(pieChartOptions('📊预算项目', '项目', '', budgetStore.budgetProjectStatsList))
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-dialog v-model="budgetStore.budgetDialog.visible"
|
|
||||||
:title="budgetStore.budgetDialog.title"
|
|
||||||
center @open="openDialogEvent"
|
|
||||||
width="50%" class="budget-dialog">
|
|
||||||
<el-form ref="formRef" :model="budgetStore.budgetDialog.data"
|
|
||||||
:rules="rules" label-width="100px">
|
|
||||||
<el-form-item label="预算类别" prop="category">
|
|
||||||
<el-select
|
|
||||||
v-model="budgetStore.budgetDialog.data.category"
|
|
||||||
allow-create filterable placeholder="请输入或选择预算类别">
|
|
||||||
<el-option
|
|
||||||
v-for="(item, index) in budgetStore.budgetCategoryList"
|
|
||||||
:key="index" :label="item" :value="item"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="预算项目" prop="project">
|
|
||||||
<el-input v-model="budgetStore.budgetDialog.data.project" autocomplete="off"
|
|
||||||
placeholder="请输入预算项目" clearable
|
|
||||||
show-word-limit maxlength="20">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="预算内容" prop="content">
|
|
||||||
<el-input v-model="budgetStore.budgetDialog.data.content" autocomplete="off"
|
|
||||||
placeholder="请输入预算内容" clearable
|
|
||||||
show-word-limit maxlength="20">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="供应商" prop="vendor">
|
|
||||||
<el-input v-model="budgetStore.budgetDialog.data.vendor" autocomplete="off"
|
|
||||||
placeholder="请输入预算供应商" clearable
|
|
||||||
show-word-limit maxlength="20">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="预算支出" prop="budget">
|
|
||||||
<el-input
|
|
||||||
v-model="budgetStore.budgetDialog.data.budget"
|
|
||||||
placeholder="请输入预算支出" clearable
|
|
||||||
:formatter="(value: string) => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
|
|
||||||
:parser="(value: string) => value.replace(/\$\s?|(,*)/g, '')"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="实际支出" prop="actual">
|
|
||||||
<el-input
|
|
||||||
v-model="budgetStore.budgetDialog.data.actual"
|
|
||||||
placeholder="请输入实际支出" clearable
|
|
||||||
:formatter="(value: string) => `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
|
|
||||||
:parser="(value: string) => value.replace(/\$\s?|(,*)/g, '')"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="支付时间">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="budgetStore.budgetDialog.data.payTime"
|
|
||||||
type="datetime" placeholder="请选择支付时间"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"/>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="备注" prop="remake">
|
|
||||||
<el-input v-model="budgetStore.budgetDialog.data.remake" autocomplete="off"
|
|
||||||
placeholder="请输入备注" clearable
|
|
||||||
show-word-limit maxlength="20">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button @click="cancelClick">取消</el-button>
|
|
||||||
<el-button type="primary" @click="confirmClick">确认</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { useBudgetStore } from '@/store/budget'
|
|
||||||
import { FormRules } from 'element-plus'
|
|
||||||
import { budgetRules } from '@/utils/element/elRules'
|
|
||||||
import { nextTick, reactive, ref } from 'vue'
|
|
||||||
|
|
||||||
const formRef = ref()
|
|
||||||
const rules = reactive<FormRules>(budgetRules)
|
|
||||||
const budgetStore = useBudgetStore()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打开对话框事件
|
|
||||||
*/
|
|
||||||
const openDialogEvent = async () => {
|
|
||||||
await nextTick(() => {
|
|
||||||
formRef.value.clearValidate()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点击确认按钮
|
|
||||||
*/
|
|
||||||
const confirmClick = () => {
|
|
||||||
formRef.value.validate().then(async () => {
|
|
||||||
await budgetStore.handleBlogApi(budgetStore.budgetDialog.data.id)
|
|
||||||
budgetStore.queryInfo.category = budgetStore.budgetDialog.data.category
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const cancelClick = () => {
|
|
||||||
budgetStore.budgetDialog.visible = false
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="budget-query common-query">
|
|
||||||
<el-switch
|
|
||||||
v-model="budgetStore.showDataType"
|
|
||||||
inline-prompt
|
|
||||||
style="--el-switch-on-color: #CA6C65; --el-switch-off-color: #009FA8"
|
|
||||||
active-value="CHART" inactive-value="DATA"
|
|
||||||
active-text="图表统计" inactive-text="数据显示"
|
|
||||||
@change="changeShowDataTypeEvent"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<el-select
|
|
||||||
v-model="budgetStore.queryInfo.category"
|
|
||||||
placeholder="请选择类别" style="width: 120px"
|
|
||||||
@focus="focusCategoryEvent" @change="changeCategoryEvent">
|
|
||||||
<el-option
|
|
||||||
v-for="(item, index) in budgetStore.budgetCategoryList"
|
|
||||||
:key="index" :label="item" :value="item"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
|
|
||||||
<el-button v-if="budgetStore.showDataType === 'DATA'"
|
|
||||||
type="primary" @click="addBudgeClick">新增预算
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { useBudgetStore } from '@/store/budget'
|
|
||||||
|
|
||||||
const budgetStore = useBudgetStore()
|
|
||||||
|
|
||||||
const focusCategoryEvent = async () => {
|
|
||||||
await budgetStore.queryBudgetCategory()
|
|
||||||
}
|
|
||||||
|
|
||||||
const changeCategoryEvent = async () => {
|
|
||||||
await budgetStore.refreshInfo()
|
|
||||||
}
|
|
||||||
|
|
||||||
const addBudgeClick = () => {
|
|
||||||
budgetStore.budgetApiType = 'ADD'
|
|
||||||
budgetStore.budgetDialog = {
|
|
||||||
title: '新增预算',
|
|
||||||
visible: true,
|
|
||||||
data: budgetStore.getEmptyBudget()
|
|
||||||
}
|
|
||||||
budgetStore.budgetDialog.data.category = budgetStore.queryInfo.category
|
|
||||||
}
|
|
||||||
|
|
||||||
const changeShowDataTypeEvent = async () => {
|
|
||||||
await budgetStore.refreshInfo()
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
<template>
|
|
||||||
<el-table :data="budgetStore.budgetList"
|
|
||||||
border stripe show-summary
|
|
||||||
:span-method="spanMethod" :summary-method="summaryMethod"
|
|
||||||
:header-cell-style="tableHeaderStyle()"
|
|
||||||
:row-style="tableRowStyle()" :cell-style="tableCellStyle()"
|
|
||||||
class="budget-table card-item">
|
|
||||||
<el-table-column type="index" align="center" width="80"/>
|
|
||||||
<el-table-column prop="project" label="项目" align="center" min-width="5%"/>
|
|
||||||
<el-table-column prop="content" label="内容" align="center" min-width="10%"/>
|
|
||||||
<el-table-column prop="vendor" label="供应商" align="center" min-width="10%"/>
|
|
||||||
<el-table-column prop="budget" label="预算支出(元)" align="center" min-width="10%">
|
|
||||||
<template #default="scope">
|
|
||||||
{{ formatAmount(scope.row.budget) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column prop="actual" label="实际支出(元)" align="center" min-width="10%">
|
|
||||||
<template #default="scope">
|
|
||||||
{{ formatAmount(scope.row.actual) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column prop="save" label="节省预算(元)" align="center" min-width="10%">
|
|
||||||
<template #default="scope">
|
|
||||||
{{ formatAmount(scope.row.budget - scope.row.actual) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column prop="percent" label="支出占比" align="center" min-width="10%">
|
|
||||||
<template #default="scope">
|
|
||||||
{{ `${((scope.row.actual / totalActual) * 100).toFixed(2)}%` }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="remake" label="备注" align="center" min-width="10%"/>
|
|
||||||
<el-table-column fixed="right" label="操作" align="center" width="250">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button type="primary" @click="editBudget(scope.row)">编辑</el-button>
|
|
||||||
<el-button type="primary" @click="editBudget(scope.row)">账单</el-button>
|
|
||||||
<el-button type="danger" @click="deleteBudget(scope.row)">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
import { useBudgetStore } from '@/store/budget'
|
|
||||||
import { IBudgetInfo } from '@/types/budget.ts'
|
|
||||||
import { computed } from 'vue'
|
|
||||||
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
|
||||||
import { formatAmount } from 'vue3-common/utils/numberUtil'
|
|
||||||
import { getRowspan, getSummaryData } from 'vue3-common/utils/elUtil'
|
|
||||||
import { commonElMessageBox, tableHeaderStyle, tableCellStyle, tableRowStyle } from 'vue3-common/utils/elUtil'
|
|
||||||
|
|
||||||
const budgetStore = useBudgetStore()
|
|
||||||
|
|
||||||
const spanIndex = 1
|
|
||||||
const summaryColumnList = ['budget', 'actual', 'save']
|
|
||||||
|
|
||||||
const totalActual = computed(() => {
|
|
||||||
return budgetStore.budgetList.reduce((sum, item: IBudgetInfo) => {
|
|
||||||
return sum + Number(item.actual || 0)
|
|
||||||
}, 0)
|
|
||||||
})
|
|
||||||
|
|
||||||
const spanMethod = (data: { row: any; column: any; rowIndex: number; columnIndex: number }) => {
|
|
||||||
// 需要合并的列索引
|
|
||||||
if (data.columnIndex === spanIndex) {
|
|
||||||
return getRowspan(budgetStore.budgetList, data.column.property, data.rowIndex, data.row)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const summaryMethod = (data: { columns: any[]; data: any[] }) => {
|
|
||||||
const sums = getSummaryData(data.columns, data.data, summaryColumnList)
|
|
||||||
// 格式化输出
|
|
||||||
sums[6] = formatAmount(parseFloat(sums[4] as string) - parseFloat(sums[5] as string))
|
|
||||||
sums[4] = formatAmount(parseFloat(sums[4] as string))
|
|
||||||
sums[5] = formatAmount(parseFloat(sums[5] as string))
|
|
||||||
sums[7] = '100%'
|
|
||||||
return sums
|
|
||||||
}
|
|
||||||
|
|
||||||
const editBudget = (budget: IBudgetInfo) => {
|
|
||||||
budgetStore.budgetApiType = 'UPDATE'
|
|
||||||
budgetStore.budgetDialog = {
|
|
||||||
title: '编辑预算',
|
|
||||||
visible: true,
|
|
||||||
data: deepCopyObject(budget)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const deleteBudget = (budget: IBudgetInfo) => {
|
|
||||||
budgetStore.budgetApiType = 'DELETE'
|
|
||||||
commonElMessageBox('是否删除该预算?').then(() => {
|
|
||||||
budgetStore.handleBlogApi(budget.id as number)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -13,11 +13,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import JournalCard from '@/components/Home/Journal/JournalCard.vue'
|
import JournalCard from '@/components/Journal/JournalCard.vue'
|
||||||
import { reactive, watch, ref } from 'vue'
|
import { reactive, watch, ref } from 'vue'
|
||||||
import { formatDate, getStartEndDate } from 'vue3-common/utils/dateUtil'
|
import { formatDate, getStartEndDate } from 'vue3-common/utils/dateUtil'
|
||||||
import { CalendarDay } from 'v-calendar/dist/types/src/utils/page'
|
import { CalendarDay } from 'v-calendar/dist/types/src/utils/page'
|
||||||
import { useAppStore } from '@/store/app'
|
import { useAppStore } from '@/store/app.ts'
|
||||||
import { useJournalStore } from '@/store/journal.ts'
|
import { useJournalStore } from '@/store/journal.ts'
|
||||||
import { IJournal } from '@/types/journal.ts'
|
import { IJournal } from '@/types/journal.ts'
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ const editClick = async () => {
|
|||||||
|
|
||||||
if (isMobile()) {
|
if (isMobile()) {
|
||||||
appStore.isShowMobileBack = true
|
appStore.isShowMobileBack = true
|
||||||
await router.push({ name: 'MobileHomeJournalDetailId', params: { id } })
|
await router.push({ name: 'JournalDetailId', params: { id } })
|
||||||
} else {
|
} else {
|
||||||
journalStore.journalDialog = {
|
journalStore.journalDialog = {
|
||||||
title: '编辑日记',
|
title: '编辑日记',
|
||||||
@@ -21,15 +21,14 @@
|
|||||||
<span>({{ legerItem.unit }})</span>
|
<span>({{ legerItem.unit }})</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ledger-amount">
|
<div class="ledger-payer" style="color: #4169E1;">
|
||||||
<div class="item" style="color: #4169E1;">
|
<i class="fa-solid fa-flag"></i>
|
||||||
<i class="fa-solid fa-flag"></i>
|
<span>{{ legerItem.payer }}</span>
|
||||||
<span>{{ legerItem.payer }}</span>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="item" style="color: #DAA520;">
|
<div class="ledger-amount" style="color: #DAA520;">
|
||||||
<i class="fa-solid fa-cny"></i>
|
<i class="fa-solid fa-cny"></i>
|
||||||
<span>{{ formatAmount(legerItem.totalPrice) }}</span>
|
<span>{{ formatAmount(legerItem.totalPrice) }}</span>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -41,9 +40,9 @@ import { defineProps, PropType } from 'vue'
|
|||||||
import { formatAmount } from 'vue3-common/utils/numberUtil'
|
import { formatAmount } from 'vue3-common/utils/numberUtil'
|
||||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
||||||
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
import { deepCopyObject } from 'vue3-common/utils/dataUtil'
|
||||||
import { useLedgerStore } from '@/store/ledger'
|
import { useLedgerStore } from '@/store/ledger.ts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { ILedger, ILegerItem } from '@/types/ledger'
|
import { ILedger, ILegerItem } from '@/types/ledger.ts'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
@@ -59,15 +58,7 @@ const editClick = async (leger: ILegerItem) => {
|
|||||||
ledgerStore.ledgerApiType = 'UPDATE'
|
ledgerStore.ledgerApiType = 'UPDATE'
|
||||||
ledgerStore.currentLedgerRecord = ledgerStore.ledgerRecordList.find((item) => item.id === leger.id)
|
ledgerStore.currentLedgerRecord = ledgerStore.ledgerRecordList.find((item) => item.id === leger.id)
|
||||||
|
|
||||||
if (isMobile()) {
|
await router.push({ name: 'LedgerDetailId', params: { id: leger.id } })
|
||||||
await router.push({ name: 'MobileHomeLedgerDetailId', params: { id: leger.id } })
|
|
||||||
} else {
|
|
||||||
ledgerStore.ledgerDialog = {
|
|
||||||
title: '编辑账本内容',
|
|
||||||
visible: true,
|
|
||||||
data: deepCopyObject(ledgerStore.currentLedgerRecord)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -96,7 +87,7 @@ const editClick = async (leger: ILegerItem) => {
|
|||||||
|
|
||||||
.ledger-item {
|
.ledger-item {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 130px 60px 60px 1fr;
|
grid-template-columns: 1fr 60px 50px 50px 60px;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
color: #4F4F4F;
|
color: #4F4F4F;
|
||||||
|
|
||||||
@@ -106,18 +97,10 @@ const editClick = async (leger: ILegerItem) => {
|
|||||||
gap: 2px;
|
gap: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ledger-amount {
|
.ledger-payer, .ledger-amount {
|
||||||
justify-self: right;
|
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
gap: 5px;
|
||||||
|
|
||||||
.item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 5px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,12 +45,6 @@
|
|||||||
:loading="authStore.loginLoading"
|
:loading="authStore.loginLoading"
|
||||||
@click.prevent="handleLogin('common')">登录
|
@click.prevent="handleLogin('common')">登录
|
||||||
</el-button>
|
</el-button>
|
||||||
<div />
|
|
||||||
<el-button type="primary" style="width: 100%;"
|
|
||||||
:disabled="!authStore.isVerified"
|
|
||||||
:loading="authStore.loginAdminLoading"
|
|
||||||
@click.prevent="handleLogin('admin')">登录管理系统
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
<div class="login-type">
|
<div class="login-type">
|
||||||
<el-button @click="authStore.changeLoginType('phone')">手机号登录</el-button>
|
<el-button @click="authStore.changeLoginType('phone')">手机号登录</el-button>
|
||||||
@@ -76,15 +70,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import LoginAuth from '@/components/Home/Login/LoginAuth.vue'
|
import LoginAuth from '@/components/Login/LoginAuth.vue'
|
||||||
import { useAuthStore } from '@/store/auth'
|
import { useAuthStore } from '@/store/auth.ts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { useUserStore } from '@/store/user'
|
import { useUserStore } from '@/store/user.ts'
|
||||||
import { ElMessage, FormRules } from 'element-plus'
|
import { ElMessage, FormRules } from 'element-plus'
|
||||||
import { onMounted, reactive, ref } from 'vue'
|
import { onMounted, reactive, ref } from 'vue'
|
||||||
import { loginRules } from '@/utils/element/elRules'
|
import { loginRules } from '@/utils/element/elRules.ts'
|
||||||
import { getLocalStorage, setLocalStorage } from 'vue3-common/utils/storageUtil'
|
import { getLocalStorage, setLocalStorage } from 'vue3-common/utils/storageUtil'
|
||||||
import { ILoginType } from '@/types/auth'
|
import { ILoginType } from '@/types/auth.ts'
|
||||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
||||||
|
|
||||||
const rules = reactive<FormRules>(loginRules)
|
const rules = reactive<FormRules>(loginRules)
|
||||||
@@ -130,7 +124,7 @@ const handleLogin = async (type: ILoginType) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'common') {
|
if (type === 'common') {
|
||||||
await router.push('/mobile-home')
|
await router.push('/home')
|
||||||
} else {
|
} else {
|
||||||
await router.push('/admin')
|
await router.push('/admin')
|
||||||
}
|
}
|
||||||
@@ -46,11 +46,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useAuthStore } from '@/store/auth'
|
import { useAuthStore } from '@/store/auth.ts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { ElMessage, FormRules } from 'element-plus'
|
import { ElMessage, FormRules } from 'element-plus'
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { loginRules } from '@/utils/element/elRules'
|
import { loginRules } from '@/utils/element/elRules.ts'
|
||||||
|
|
||||||
const rules = reactive<FormRules>(loginRules)
|
const rules = reactive<FormRules>(loginRules)
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
@@ -46,11 +46,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useAuthStore } from '@/store/auth'
|
import { useAuthStore } from '@/store/auth.ts'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { ElMessage, FormRules } from 'element-plus'
|
import { ElMessage, FormRules } from 'element-plus'
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { loginRules } from '@/utils/element/elRules'
|
import { loginRules } from '@/utils/element/elRules.ts'
|
||||||
|
|
||||||
const rules = reactive<FormRules>(loginRules)
|
const rules = reactive<FormRules>(loginRules)
|
||||||
const authStore = useAuthStore()
|
const authStore = useAuthStore()
|
||||||
@@ -43,7 +43,7 @@ const editClick = async () => {
|
|||||||
passwordStore.passwordApiType = 'UPDATE'
|
passwordStore.passwordApiType = 'UPDATE'
|
||||||
|
|
||||||
passwordStore.currentPassword = props.passwordItem as IPassword
|
passwordStore.currentPassword = props.passwordItem as IPassword
|
||||||
await router.push({ name: 'MobileHomePasswordDetailId', params: { id } })
|
await router.push({ name: 'PasswordDetailId', params: { id } })
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteClick = () => {
|
const deleteClick = () => {
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, watch } from 'vue'
|
import { onMounted, watch } from 'vue'
|
||||||
import { Calendar, DateSelectArg, EventClickArg } from '@fullcalendar/core'
|
import { Calendar, DateSelectArg, EventClickArg } from '@fullcalendar/core'
|
||||||
import { initCommonCalendar, initMobileCalendar } from '@/utils/home/planUtil'
|
import { initCommonCalendar, initMobileCalendar } from '@/utils/home/planUtil.ts'
|
||||||
import { usePlanStore } from '@/store/plan.ts'
|
import { usePlanStore } from '@/store/plan.ts'
|
||||||
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
import { isMobile } from 'vue3-common/utils/layoutUtil'
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ const eventClickEvent = (eventClick: EventClickArg) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@/styles/home.variable.module.scss";
|
@import "@/styles/home.variable.module";
|
||||||
|
|
||||||
$cell-height: 3.8vh;
|
$cell-height: 3.8vh;
|
||||||
$time-slot-width: 70px;
|
$time-slot-width: 70px;
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user