30 Commits
Author SHA1 Message Date
ilhamtahir 717c09a293 feat: 更新用户和产品模型,添加ME值字段,优化角色设置逻辑 2026-02-02 00:28:35 +08:00
ilhamtahir 16365ceb29 feat: 添加产品总能量字段及更新环境配置 2026-01-15 07:01:02 +08:00
ilhamtahir 90fc98fa6a feat: 布兰德 2025-04-28 13:14:12 +08:00
ilhamtahir b17d62fbed feat: 添加产品营养成分字段 2025-02-17 05:28:29 +08:00
ilhamtahir 57dcbe2d37 feat: 产品管理 2025-01-19 22:05:15 +08:00
ilhamtahir b0dbad17fe feat: 后台管理增加咨询管理 2024-12-25 17:14:55 +08:00
ilhamtahir 5fc0e7a334 feat: 富文本添加 2024-12-19 23:07:14 +08:00
ilhamtahir 4959e402b7 feat: 富文本添加 2024-12-19 23:07:06 +08:00
ilhamtahir aed501d308 feat: 咨询管理代码审查 2024-12-19 22:13:37 +08:00
ilhamtahir de50ca5f66 feat: 咨询管理代码审查 2024-12-19 22:03:31 +08:00
ilhamtahir f2db16447d fix: 咨询管理 2024-12-19 21:44:45 +08:00
ilhamtahir e08155d2cc Merge branch 'feature/31-carousal' of 1-bright/admin into main 2024-12-09 20:35:53 +08:00
zlong c59a2587dd fix: 轮播图CarousalDialog组件将delete对象改为赋值null形式 2024-12-08 17:35:08 +08:00
zlong cda60022be refactor: 轮播图类型改造100% 2024-12-08 17:28:33 +08:00
zlong f0f2d2b8ed refactor: 类型问题改造80% 2024-12-07 17:41:23 +08:00
zlong d4b7f659a1 fix: 将switch函数转换成三目运算符形式 2024-12-05 16:28:33 +08:00
ilhamtahir 024eef682e fix: 引用错误 2024-12-04 21:02:24 +08:00
ilhamtahir 73fb136b91 refactor: 轮播图模态框 2024-12-04 21:00:21 +08:00
ilhamtahir 0558261ba7 refactor: 重构录播图管理页面、图片预览组件抽离、useSearchable 组合式函数使用 2024-12-04 20:41:51 +08:00
ilhamtahir f8fc42dfec Merge branch 'feature/31-carousal' into feature/code-review-sprint1 2024-12-04 20:05:20 +08:00
ilhamtahir 21b59e8272 fix: refactoring 2024-11-26 11:05:18 +08:00
zlong 3e12b596b2 fix 2024-11-25 23:11:51 +08:00
zlong 0e521db11e add:添加类型 2024-11-25 23:05:49 +08:00
zlong df4d5848a2 Merge branch 'main' into feature/31-carousal 2024-11-25 22:35:59 +08:00
zlong 7e407f68a6 add 2024-11-25 22:34:27 +08:00
ilhamtahir c827568088 Merge branch 'feature/24-article' of 1-bright/admin into main 2024-11-22 11:18:26 +08:00
ilhamtahir 35039e1b09 fix: 解决冲突 2024-11-22 11:17:25 +08:00
ilhamtahir 7ae38cb277 Merge branch 'feature/BRT-23-classify' of 1-bright/admin into main 2024-11-22 11:15:18 +08:00
chen 2e38fdff5f Merge branch 'feature/BRT-23-classify' of http://git.yilibili.com/1-bright/admin into feature/24-article 2024-11-21 23:19:47 +08:00
chen 5b078fa607 feature:咨询管理页面开发及接口对接 2024-11-21 23:18:42 +08:00
41 changed files with 1994 additions and 340 deletions

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
VITE_ENABLE_MOCK=false
VITE_API_PREFIX=/api
VITE_PROXY_ENDPOINT=http://localhost:8000
VITE_PROXY_ENDPOINT=https://bright.yilibili.com/api
+1 -2
View File
@@ -1,4 +1,3 @@
VITE_ENABLE_MOCK=false
VITE_API_PREFIX=/api
VITE_PROXY_ENDPOINT=https://bright.yilibili.com
VITE_PROXY_ENDPOINT=http://localhost:3000
+9 -1
View File
@@ -8,6 +8,8 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
Copyright: typeof import('./src/components/Copyright.vue')['default']
Editor: typeof import('./src/components/Editor.vue')['default']
ImagePreviewer: typeof import('./src/components/ImagePreviewer.vue')['default']
ImageUpload: typeof import('./src/components/ImageUpload.vue')['default']
RegularPage: typeof import('./src/components/RegularPage.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
@@ -16,8 +18,11 @@ declare module 'vue' {
TAvatar: typeof import('tdesign-vue-next')['Avatar']
TButton: typeof import('tdesign-vue-next')['Button']
TCard: typeof import('tdesign-vue-next')['Card']
TCol: typeof import('tdesign-vue-next')['Col']
TDialog: typeof import('tdesign-vue-next')['Dialog']
TDropdown: typeof import('tdesign-vue-next')['Dropdown']
TForm: typeof import('tdesign-vue-next')['Form']
TFormItem: typeof import('tdesign-vue-next')['FormItem']
THeader: typeof import('tdesign-vue-next')['Header']
TIcon: typeof import('tdesign-vue-next')['Icon']
TImageViewer: typeof import('tdesign-vue-next')['ImageViewer']
@@ -26,13 +31,16 @@ declare module 'vue' {
TLayout: typeof import('tdesign-vue-next')['Layout']
TMenu: typeof import('tdesign-vue-next')['Menu']
TMenuItem: typeof import('tdesign-vue-next')['MenuItem']
TSelectInput: typeof import('tdesign-vue-next')['SelectInput']
TPopconfirm: typeof import('tdesign-vue-next')['Popconfirm']
TRadioButton: typeof import('tdesign-vue-next')['RadioButton']
TRadioGroup: typeof import('tdesign-vue-next')['RadioGroup']
TRow: typeof import('tdesign-vue-next')['Row']
TSelect: typeof import('tdesign-vue-next')['Select']
TSpace: typeof import('tdesign-vue-next')['Space']
TTable: typeof import('tdesign-vue-next')['Table']
TTag: typeof import('tdesign-vue-next')['Tag']
TTagInput: typeof import('tdesign-vue-next')['TagInput']
TTextarea: typeof import('tdesign-vue-next')['Textarea']
TUpload: typeof import('tdesign-vue-next')['Upload']
}
}
Vendored
+14
View File
@@ -1 +1,15 @@
/// <reference types="vite/client" />
import { SlateDescendant, SlateElement, SlateText, Toolbar } from '@wangeditor/editor'
declare module '@wangeditor/editor' {
// 扩展 Text
interface SlateText {
text: string
}
// 扩展 Element
interface SlateElement {
type: string
children: SlateDescendant[]
}
}
+2
View File
@@ -18,6 +18,8 @@
"@tiptap/pm": "^2.8.0",
"@tiptap/starter-kit": "^2.8.0",
"@tiptap/vue-3": "^2.8.0",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"axios": "^1.7.7",
"mockjs": "^1.1.0",
"pinia": "^2.2.2",
+481
View File
@@ -20,6 +20,12 @@ importers:
'@tiptap/vue-3':
specifier: ^2.8.0
version: 2.8.0(@tiptap/core@2.8.0(@tiptap/pm@2.8.0))(@tiptap/pm@2.8.0)(vue@3.5.8(typescript@5.4.5))
'@wangeditor/editor':
specifier: ^5.1.23
version: 5.1.23
'@wangeditor/editor-for-vue':
specifier: ^5.1.12
version: 5.1.12(@wangeditor/editor@5.1.23)(vue@3.5.8(typescript@5.4.5))
axios:
specifier: ^1.7.7
version: 1.7.7
@@ -771,6 +777,9 @@ packages:
'@tiptap/pm': ^2.7.0
vue: ^3.0.0
'@transloadit/prettier-bytes@0.0.7':
resolution: {integrity: sha512-VeJbUb0wEKbcwaSlj5n+LscBl9IPgLPkHVGBkh00cztv6X4L/TJXK58LzFuBKX7/GAfiGhIwH67YTLTlzvIzBA==}
'@tsconfig/node20@20.1.4':
resolution: {integrity: sha512-sqgsT69YFeLWf5NtJ4Xq/xAF8p4ZQHlmGW74Nu2tD4+g5fAsposc4ZfaaPixVu4y01BEiDCWLRDCvDM5JOsRxg==}
@@ -780,6 +789,9 @@ packages:
'@types/estree@1.0.6':
resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==}
'@types/event-emitter@0.3.5':
resolution: {integrity: sha512-zx2/Gg0Eg7gwEiOIIh5w9TrhKKTeQh7CPCOPNc0el4pLSwzebA8SmnHwZs2dWlLONvyulykSwGSQxQHLhjGLvQ==}
'@types/jsdom@21.1.7':
resolution: {integrity: sha512-yOriVnggzrnQ3a9OKOCxaVuSug3w3/SbOj5i7VwXWZEyUNl3bLF9V3MfxGbZKuwqJOQyRfqXyROBB1CoZLFWzA==}
@@ -871,6 +883,23 @@ packages:
'@ungap/structured-clone@1.2.0':
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
'@uppy/companion-client@2.2.2':
resolution: {integrity: sha512-5mTp2iq97/mYSisMaBtFRry6PTgZA6SIL7LePteOV5x0/DxKfrZW3DEiQERJmYpHzy7k8johpm2gHnEKto56Og==}
'@uppy/core@2.3.4':
resolution: {integrity: sha512-iWAqppC8FD8mMVqewavCz+TNaet6HPXitmGXpGGREGrakZ4FeuWytVdrelydzTdXx6vVKkOmI2FLztGg73sENQ==}
'@uppy/store-default@2.1.1':
resolution: {integrity: sha512-xnpTxvot2SeAwGwbvmJ899ASk5tYXhmZzD/aCFsXePh/v8rNvR2pKlcQUH7cF/y4baUGq3FHO/daKCok/mpKqQ==}
'@uppy/utils@4.1.3':
resolution: {integrity: sha512-nTuMvwWYobnJcytDO3t+D6IkVq/Qs4Xv3vyoEZ+Iaf8gegZP+rEyoaFT2CK5XLRMienPyqRqNbIfRuFaOWSIFw==}
'@uppy/xhr-upload@2.1.3':
resolution: {integrity: sha512-YWOQ6myBVPs+mhNjfdWsQyMRWUlrDLMoaG7nvf/G6Y3GKZf8AyjFDjvvJ49XWQ+DaZOftGkHmF1uh/DBeGivJQ==}
peerDependencies:
'@uppy/core': ^2.3.3
'@vitejs/plugin-vue@5.1.4':
resolution: {integrity: sha512-N2XSI2n3sQqp5w7Y/AN/L2XDjBIRGqXko+eDp42sydYSBeJuSm5a1sLf8zakmo8u7tA8NmBgoDLA1HeOESjp9A==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -995,6 +1024,93 @@ packages:
'@vue/tsconfig@0.5.1':
resolution: {integrity: sha512-VcZK7MvpjuTPx2w6blwnwZAu5/LgBUtejFOi3pPGQFXQN5Ela03FUtd2Qtg4yWGGissVL0dr6Ro1LfOFh+PCuQ==}
'@wangeditor/basic-modules@1.1.7':
resolution: {integrity: sha512-cY9CPkLJaqF05STqfpZKWG4LpxTMeGSIIF1fHvfm/mz+JXatCagjdkbxdikOuKYlxDdeqvOeBmsUBItufDLXZg==}
peerDependencies:
'@wangeditor/core': 1.x
dom7: ^3.0.0
lodash.throttle: ^4.1.1
nanoid: ^3.2.0
slate: ^0.72.0
snabbdom: ^3.1.0
'@wangeditor/code-highlight@1.0.3':
resolution: {integrity: sha512-iazHwO14XpCuIWJNTQTikqUhGKyqj+dUNWJ9288Oym9M2xMVHvnsOmDU2sgUDWVy+pOLojReMPgXCsvvNlOOhw==}
peerDependencies:
'@wangeditor/core': 1.x
dom7: ^3.0.0
slate: ^0.72.0
snabbdom: ^3.1.0
'@wangeditor/core@1.1.19':
resolution: {integrity: sha512-KevkB47+7GhVszyYF2pKGKtCSj/YzmClsD03C3zTt+9SR2XWT5T0e3yQqg8baZpcMvkjs1D8Dv4fk8ok/UaS2Q==}
peerDependencies:
'@uppy/core': ^2.1.1
'@uppy/xhr-upload': ^2.0.3
dom7: ^3.0.0
is-hotkey: ^0.2.0
lodash.camelcase: ^4.3.0
lodash.clonedeep: ^4.5.0
lodash.debounce: ^4.0.8
lodash.foreach: ^4.5.0
lodash.isequal: ^4.5.0
lodash.throttle: ^4.1.1
lodash.toarray: ^4.4.0
nanoid: ^3.2.0
slate: ^0.72.0
snabbdom: ^3.1.0
'@wangeditor/editor-for-vue@5.1.12':
resolution: {integrity: sha512-0Ds3D8I+xnpNWezAeO7HmPRgTfUxHLMd9JKcIw+QzvSmhC5xUHbpCcLU+KLmeBKTR/zffnS5GQo6qi3GhTMJWQ==}
peerDependencies:
'@wangeditor/editor': '>=5.1.0'
vue: ^3.0.5
'@wangeditor/editor@5.1.23':
resolution: {integrity: sha512-0RxfeVTuK1tktUaPROnCoFfaHVJpRAIE2zdS0mpP+vq1axVQpLjM8+fCvKzqYIkH0Pg+C+44hJpe3VVroSkEuQ==}
'@wangeditor/list-module@1.0.5':
resolution: {integrity: sha512-uDuYTP6DVhcYf7mF1pTlmNn5jOb4QtcVhYwSSAkyg09zqxI1qBqsfUnveeDeDqIuptSJhkh81cyxi+MF8sEPOQ==}
peerDependencies:
'@wangeditor/core': 1.x
dom7: ^3.0.0
slate: ^0.72.0
snabbdom: ^3.1.0
'@wangeditor/table-module@1.1.4':
resolution: {integrity: sha512-5saanU9xuEocxaemGdNi9t8MCDSucnykEC6jtuiT72kt+/Hhh4nERYx1J20OPsTCCdVr7hIyQenFD1iSRkIQ6w==}
peerDependencies:
'@wangeditor/core': 1.x
dom7: ^3.0.0
lodash.isequal: ^4.5.0
lodash.throttle: ^4.1.1
nanoid: ^3.2.0
slate: ^0.72.0
snabbdom: ^3.1.0
'@wangeditor/upload-image-module@1.0.2':
resolution: {integrity: sha512-z81lk/v71OwPDYeQDxj6cVr81aDP90aFuywb8nPD6eQeECtOymrqRODjpO6VGvCVxVck8nUxBHtbxKtjgcwyiA==}
peerDependencies:
'@uppy/core': ^2.0.3
'@uppy/xhr-upload': ^2.0.3
'@wangeditor/basic-modules': 1.x
'@wangeditor/core': 1.x
dom7: ^3.0.0
lodash.foreach: ^4.5.0
slate: ^0.72.0
snabbdom: ^3.1.0
'@wangeditor/video-module@1.1.4':
resolution: {integrity: sha512-ZdodDPqKQrgx3IwWu4ZiQmXI8EXZ3hm2/fM6E3t5dB8tCaIGWQZhmqd6P5knfkRAd3z2+YRSRbxOGfoRSp/rLg==}
peerDependencies:
'@uppy/core': ^2.1.4
'@uppy/xhr-upload': ^2.0.7
'@wangeditor/core': 1.x
dom7: ^3.0.0
nanoid: ^3.2.0
slate: ^0.72.0
snabbdom: ^3.1.0
abbrev@2.0.0:
resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
@@ -1199,6 +1315,9 @@ packages:
compatx@0.1.8:
resolution: {integrity: sha512-jcbsEAR81Bt5s1qOFymBufmCbXCXbk0Ql+K5ouj6gCyx2yHlu6AgmGIi9HxfKixpUDO5bCFJUHQ5uM6ecbTebw==}
compute-scroll-into-view@1.0.20:
resolution: {integrity: sha512-UCB0ioiyj8CRjtrvaceBLqqhZCVP+1B8+NWQhmdsm0VXOJtobBCf1dBQmebCCo34qZmUwZfIH2MZLqNHazrfjg==}
computeds@0.0.1:
resolution: {integrity: sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==}
@@ -1245,6 +1364,10 @@ packages:
csstype@3.1.3:
resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
d@1.0.2:
resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==}
engines: {node: '>=0.12'}
data-urls@5.0.0:
resolution: {integrity: sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==}
engines: {node: '>=18'}
@@ -1328,6 +1451,9 @@ packages:
resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==}
engines: {node: '>=6.0.0'}
dom7@3.0.0:
resolution: {integrity: sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==}
dotenv@16.4.5:
resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==}
engines: {node: '>=12'}
@@ -1363,6 +1489,17 @@ packages:
error-stack-parser-es@0.1.5:
resolution: {integrity: sha512-xHku1X40RO+fO8yJ8Wh2f2rZWVjqyhb1zgq1yZ8aZRQkv6OOKhKWRUaht3eSCUbAOBaKIgM+ykwFLE+QUxgGeg==}
es5-ext@0.10.64:
resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==}
engines: {node: '>=0.10'}
es6-iterator@2.0.3:
resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==}
es6-symbol@3.1.4:
resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==}
engines: {node: '>=0.12'}
esbuild@0.21.5:
resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==}
engines: {node: '>=12'}
@@ -1426,6 +1563,10 @@ packages:
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
hasBin: true
esniff@2.0.1:
resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==}
engines: {node: '>=0.10'}
espree@9.6.1:
resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@@ -1452,10 +1593,16 @@ packages:
resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==}
engines: {node: '>=0.10.0'}
event-emitter@0.3.5:
resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==}
execa@8.0.1:
resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==}
engines: {node: '>=16.17'}
ext@1.7.0:
resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==}
fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
@@ -1623,6 +1770,9 @@ packages:
resolution: {integrity: sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ==}
engines: {node: '>=8'}
html-void-elements@2.0.1:
resolution: {integrity: sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==}
http-proxy-agent@7.0.2:
resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==}
engines: {node: '>= 14'}
@@ -1635,6 +1785,9 @@ packages:
resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==}
engines: {node: '>=16.17.0'}
i18next@20.6.1:
resolution: {integrity: sha512-yCMYTMEJ9ihCwEQQ3phLo7I/Pwycf8uAx+sRHwwk5U9Aui/IZYgQRyMqXafQOw5QQ7DM1Z+WyEXWIqSuJHhG2A==}
iconv-lite@0.6.3:
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}
@@ -1643,6 +1796,9 @@ packages:
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
engines: {node: '>= 4'}
immer@9.0.21:
resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==}
import-fresh@3.3.0:
resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==}
engines: {node: '>=6'}
@@ -1686,6 +1842,9 @@ packages:
resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}
engines: {node: '>=0.10.0'}
is-hotkey@0.2.0:
resolution: {integrity: sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw==}
is-inside-container@1.0.0:
resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==}
engines: {node: '>=14.16'}
@@ -1699,6 +1858,10 @@ packages:
resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
engines: {node: '>=8'}
is-plain-object@5.0.0:
resolution: {integrity: sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==}
engines: {node: '>=0.10.0'}
is-potential-custom-element-name@1.0.1:
resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==}
@@ -1706,6 +1869,9 @@ packages:
resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
is-url@1.2.4:
resolution: {integrity: sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==}
is-what@4.1.16:
resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==}
engines: {node: '>=12.13'}
@@ -1821,15 +1987,36 @@ packages:
resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==}
engines: {node: '>=10'}
lodash.camelcase@4.3.0:
resolution: {integrity: sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==}
lodash.castarray@4.4.0:
resolution: {integrity: sha512-aVx8ztPv7/2ULbArGJ2Y42bG1mEQ5mGjpdvrbJcJFU3TbYybe+QlLS4pst9zV52ymy2in1KpFPiZnAOATxD4+Q==}
lodash.clonedeep@4.5.0:
resolution: {integrity: sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==}
lodash.debounce@4.0.8:
resolution: {integrity: sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==}
lodash.foreach@4.5.0:
resolution: {integrity: sha512-aEXTF4d+m05rVOAUG3z4vZZ4xVexLKZGF0lIxuHZ1Hplpk/3B6Z1+/ICICYRLm7c41Z2xiejbkCkJoTlypoXhQ==}
lodash.isequal@4.5.0:
resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==}
lodash.isplainobject@4.0.6:
resolution: {integrity: sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==}
lodash.merge@4.6.2:
resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==}
lodash.throttle@4.1.1:
resolution: {integrity: sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==}
lodash.toarray@4.4.0:
resolution: {integrity: sha512-QyffEA3i5dma5q2490+SgCvDN0pXLmRGSyAANuVi0HQ01Pkfr9fuoKQW8wm1wGBnJITs/mS7wQvS6VshUEBFCw==}
lodash@4.17.21:
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
@@ -1871,6 +2058,9 @@ packages:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
mime-match@1.0.2:
resolution: {integrity: sha512-VXp/ugGDVh3eCLOBCiHZMYWQaTNUHv2IJrut+yXA6+JbLPXHglHwfS/5A5L0ll+jkCY7fIzRJcH6OIunF+c6Cg==}
mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
@@ -1941,6 +2131,9 @@ packages:
mz@2.7.0:
resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==}
namespace-emitter@2.0.1:
resolution: {integrity: sha512-N/sMKHniSDJBjfrkbS/tpkPj4RAbvW3mr8UAzvlMHyun93XEm83IAvhWtJVHo+RHn/oO8Job5YN4b+wRjSVp5g==}
nanoid@3.3.7:
resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==}
engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -1949,6 +2142,9 @@ packages:
natural-compare@1.4.0:
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
next-tick@1.1.0:
resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==}
node-fetch-native@1.6.4:
resolution: {integrity: sha512-IhOigYzAKHd244OC0JIMIUrjzctirCmPkaIfhDeGcEETWof5zKYUW7e7MYvChGWh/4CJeXEgsRyGzuF334rOOQ==}
@@ -2188,6 +2384,9 @@ packages:
resolution: {integrity: sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==}
engines: {node: ^10 || ^12 || >=14}
preact@10.24.3:
resolution: {integrity: sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==}
prelude-ls@1.2.1:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'}
@@ -2205,6 +2404,10 @@ packages:
resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
prismjs@1.29.0:
resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==}
engines: {node: '>=6'}
prosemirror-changeset@2.2.1:
resolution: {integrity: sha512-J7msc6wbxB4ekDFj+n9gTW/jav/p53kdlivvuppHsrZXCaQdVgRghoZbSS3kwrRyAstRVQ4/+u5k7YfLgkkQvQ==}
@@ -2354,6 +2557,9 @@ packages:
resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==}
engines: {node: '>=v12.22.7'}
scroll-into-view-if-needed@2.2.31:
resolution: {integrity: sha512-dGCXy99wZQivjmjIqihaBQNjryrz5rueJY7eHfTdyWEiR4ttYpsajb14rn9s5d4DY4EcY6+4+U/maARBXJedkA==}
scule@1.3.0:
resolution: {integrity: sha512-6FtHJEvt+pVMIB9IBY+IcCJ6Z5f1iQnytgyfKMhDKgmzYG+TeH/wx1y3l27rshSbLiSanrR9ffZDrEsmjlQF2g==}
@@ -2399,6 +2605,18 @@ packages:
resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==}
engines: {node: '>=14.16'}
slate-history@0.66.0:
resolution: {integrity: sha512-6MWpxGQZiMvSINlCbMW43E2YBSVMCMCIwQfBzGssjWw4kb0qfvj0pIdblWNRQZD0hR6WHP+dHHgGSeVdMWzfng==}
peerDependencies:
slate: '>=0.65.3'
slate@0.72.8:
resolution: {integrity: sha512-/nJwTswQgnRurpK+bGJFH1oM7naD5qDmHd89JyiKNT2oOKD8marW0QSBtuFnwEbL5aGCS8AmrhXQgNOsn4osAw==}
snabbdom@3.6.2:
resolution: {integrity: sha512-ig5qOnCDbugFntKi6c7Xlib8bA6xiJVk8O+WdFrV3wxbMqeHO0hXFQC4nAhPVWfZfi8255lcZkNhtIBINCc4+Q==}
engines: {node: '>=12.17.0'}
sortablejs@1.15.3:
resolution: {integrity: sha512-zdK3/kwwAK1cJgy1rwl1YtNTbRmc8qW/+vgXf75A7NHag5of4pyI6uK86ktmQETyWRH7IGaE73uZOOBcGxgqZg==}
@@ -2410,6 +2628,9 @@ packages:
resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==}
engines: {node: '>=0.10.0'}
ssr-window@3.0.0:
resolution: {integrity: sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA==}
stackback@0.0.2:
resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==}
@@ -2510,6 +2731,9 @@ packages:
tiny-emitter@2.1.0:
resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==}
tiny-warning@1.0.3:
resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==}
tinybench@2.9.0:
resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==}
@@ -2571,6 +2795,9 @@ packages:
resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==}
engines: {node: '>=10'}
type@2.7.3:
resolution: {integrity: sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==}
typescript@5.4.5:
resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==}
engines: {node: '>=14.17'}
@@ -2849,6 +3076,9 @@ packages:
engines: {node: '>=8'}
hasBin: true
wildcard@1.1.2:
resolution: {integrity: sha512-DXukZJxpHA8LuotRwL0pP1+rS6CS7FF2qStDDE1C7DDg2rLud2PXRMuEDYIPhgEezwnlHNL4c+N6MfMTjCGTng==}
word-wrap@1.2.5:
resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==}
engines: {node: '>=0.10.0'}
@@ -3557,12 +3787,16 @@ snapshots:
'@tiptap/pm': 2.8.0
vue: 3.5.8(typescript@5.4.5)
'@transloadit/prettier-bytes@0.0.7': {}
'@tsconfig/node20@20.1.4': {}
'@types/estree@1.0.5': {}
'@types/estree@1.0.6': {}
'@types/event-emitter@0.3.5': {}
'@types/jsdom@21.1.7':
dependencies:
'@types/node': 20.16.5
@@ -3675,6 +3909,35 @@ snapshots:
'@ungap/structured-clone@1.2.0': {}
'@uppy/companion-client@2.2.2':
dependencies:
'@uppy/utils': 4.1.3
namespace-emitter: 2.0.1
'@uppy/core@2.3.4':
dependencies:
'@transloadit/prettier-bytes': 0.0.7
'@uppy/store-default': 2.1.1
'@uppy/utils': 4.1.3
lodash.throttle: 4.1.1
mime-match: 1.0.2
namespace-emitter: 2.0.1
nanoid: 3.3.7
preact: 10.24.3
'@uppy/store-default@2.1.1': {}
'@uppy/utils@4.1.3':
dependencies:
lodash.throttle: 4.1.1
'@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4)':
dependencies:
'@uppy/companion-client': 2.2.2
'@uppy/core': 2.3.4
'@uppy/utils': 4.1.3
nanoid: 3.3.7
'@vitejs/plugin-vue@5.1.4(vite@5.4.7(@types/node@20.16.5))(vue@3.5.8(typescript@5.4.5))':
dependencies:
vite: 5.4.7(@types/node@20.16.5)
@@ -3879,6 +4142,114 @@ snapshots:
'@vue/tsconfig@0.5.1': {}
'@wangeditor/basic-modules@1.1.7(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.throttle@4.1.1)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)':
dependencies:
'@wangeditor/core': 1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
dom7: 3.0.0
is-url: 1.2.4
lodash.throttle: 4.1.1
nanoid: 3.3.7
slate: 0.72.8
snabbdom: 3.6.2
'@wangeditor/code-highlight@1.0.3(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(slate@0.72.8)(snabbdom@3.6.2)':
dependencies:
'@wangeditor/core': 1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
dom7: 3.0.0
prismjs: 1.29.0
slate: 0.72.8
snabbdom: 3.6.2
'@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)':
dependencies:
'@types/event-emitter': 0.3.5
'@uppy/core': 2.3.4
'@uppy/xhr-upload': 2.1.3(@uppy/core@2.3.4)
dom7: 3.0.0
event-emitter: 0.3.5
html-void-elements: 2.0.1
i18next: 20.6.1
is-hotkey: 0.2.0
lodash.camelcase: 4.3.0
lodash.clonedeep: 4.5.0
lodash.debounce: 4.0.8
lodash.foreach: 4.5.0
lodash.isequal: 4.5.0
lodash.throttle: 4.1.1
lodash.toarray: 4.4.0
nanoid: 3.3.7
scroll-into-view-if-needed: 2.2.31
slate: 0.72.8
slate-history: 0.66.0(slate@0.72.8)
snabbdom: 3.6.2
'@wangeditor/editor-for-vue@5.1.12(@wangeditor/editor@5.1.23)(vue@3.5.8(typescript@5.4.5))':
dependencies:
'@wangeditor/editor': 5.1.23
vue: 3.5.8(typescript@5.4.5)
'@wangeditor/editor@5.1.23':
dependencies:
'@uppy/core': 2.3.4
'@uppy/xhr-upload': 2.1.3(@uppy/core@2.3.4)
'@wangeditor/basic-modules': 1.1.7(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.throttle@4.1.1)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
'@wangeditor/code-highlight': 1.0.3(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(slate@0.72.8)(snabbdom@3.6.2)
'@wangeditor/core': 1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
'@wangeditor/list-module': 1.0.5(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(slate@0.72.8)(snabbdom@3.6.2)
'@wangeditor/table-module': 1.1.4(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
'@wangeditor/upload-image-module': 1.0.2(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(@wangeditor/basic-modules@1.1.7(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.throttle@4.1.1)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.foreach@4.5.0)(slate@0.72.8)(snabbdom@3.6.2)
'@wangeditor/video-module': 1.1.4(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
dom7: 3.0.0
is-hotkey: 0.2.0
lodash.camelcase: 4.3.0
lodash.clonedeep: 4.5.0
lodash.debounce: 4.0.8
lodash.foreach: 4.5.0
lodash.isequal: 4.5.0
lodash.throttle: 4.1.1
lodash.toarray: 4.4.0
nanoid: 3.3.7
slate: 0.72.8
snabbdom: 3.6.2
'@wangeditor/list-module@1.0.5(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(slate@0.72.8)(snabbdom@3.6.2)':
dependencies:
'@wangeditor/core': 1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
dom7: 3.0.0
slate: 0.72.8
snabbdom: 3.6.2
'@wangeditor/table-module@1.1.4(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)':
dependencies:
'@wangeditor/core': 1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
dom7: 3.0.0
lodash.isequal: 4.5.0
lodash.throttle: 4.1.1
nanoid: 3.3.7
slate: 0.72.8
snabbdom: 3.6.2
'@wangeditor/upload-image-module@1.0.2(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(@wangeditor/basic-modules@1.1.7(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.throttle@4.1.1)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.foreach@4.5.0)(slate@0.72.8)(snabbdom@3.6.2)':
dependencies:
'@uppy/core': 2.3.4
'@uppy/xhr-upload': 2.1.3(@uppy/core@2.3.4)
'@wangeditor/basic-modules': 1.1.7(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(lodash.throttle@4.1.1)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
'@wangeditor/core': 1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
dom7: 3.0.0
lodash.foreach: 4.5.0
slate: 0.72.8
snabbdom: 3.6.2
'@wangeditor/video-module@1.1.4(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(@wangeditor/core@1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2))(dom7@3.0.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)':
dependencies:
'@uppy/core': 2.3.4
'@uppy/xhr-upload': 2.1.3(@uppy/core@2.3.4)
'@wangeditor/core': 1.1.19(@uppy/core@2.3.4)(@uppy/xhr-upload@2.1.3(@uppy/core@2.3.4))(dom7@3.0.0)(is-hotkey@0.2.0)(lodash.camelcase@4.3.0)(lodash.clonedeep@4.5.0)(lodash.debounce@4.0.8)(lodash.foreach@4.5.0)(lodash.isequal@4.5.0)(lodash.throttle@4.1.1)(lodash.toarray@4.4.0)(nanoid@3.3.7)(slate@0.72.8)(snabbdom@3.6.2)
dom7: 3.0.0
nanoid: 3.3.7
slate: 0.72.8
snabbdom: 3.6.2
abbrev@2.0.0: {}
acorn-jsx@5.3.2(acorn@8.12.1):
@@ -4088,6 +4459,8 @@ snapshots:
compatx@0.1.8: {}
compute-scroll-into-view@1.0.20: {}
computeds@0.0.1: {}
concat-map@0.0.1: {}
@@ -4132,6 +4505,11 @@ snapshots:
csstype@3.1.3: {}
d@1.0.2:
dependencies:
es5-ext: 0.10.64
type: 2.7.3
data-urls@5.0.0:
dependencies:
whatwg-mimetype: 4.0.0
@@ -4190,6 +4568,10 @@ snapshots:
dependencies:
esutils: 2.0.3
dom7@3.0.0:
dependencies:
ssr-window: 3.0.0
dotenv@16.4.5: {}
eastasianwidth@0.2.0: {}
@@ -4215,6 +4597,24 @@ snapshots:
error-stack-parser-es@0.1.5: {}
es5-ext@0.10.64:
dependencies:
es6-iterator: 2.0.3
es6-symbol: 3.1.4
esniff: 2.0.1
next-tick: 1.1.0
es6-iterator@2.0.3:
dependencies:
d: 1.0.2
es5-ext: 0.10.64
es6-symbol: 3.1.4
es6-symbol@3.1.4:
dependencies:
d: 1.0.2
ext: 1.7.0
esbuild@0.21.5:
optionalDependencies:
'@esbuild/aix-ppc64': 0.21.5
@@ -4328,6 +4728,13 @@ snapshots:
transitivePeerDependencies:
- supports-color
esniff@2.0.1:
dependencies:
d: 1.0.2
es5-ext: 0.10.64
event-emitter: 0.3.5
type: 2.7.3
espree@9.6.1:
dependencies:
acorn: 8.12.1
@@ -4352,6 +4759,11 @@ snapshots:
esutils@2.0.3: {}
event-emitter@0.3.5:
dependencies:
d: 1.0.2
es5-ext: 0.10.64
execa@8.0.1:
dependencies:
cross-spawn: 7.0.3
@@ -4364,6 +4776,10 @@ snapshots:
signal-exit: 4.1.0
strip-final-newline: 3.0.0
ext@1.7.0:
dependencies:
type: 2.7.3
fast-deep-equal@3.1.3: {}
fast-diff@1.3.0: {}
@@ -4544,6 +4960,8 @@ snapshots:
html-tags@3.3.1: {}
html-void-elements@2.0.1: {}
http-proxy-agent@7.0.2:
dependencies:
agent-base: 7.1.1
@@ -4560,12 +4978,18 @@ snapshots:
human-signals@5.0.0: {}
i18next@20.6.1:
dependencies:
'@babel/runtime': 7.25.6
iconv-lite@0.6.3:
dependencies:
safer-buffer: 2.1.2
ignore@5.3.2: {}
immer@9.0.21: {}
import-fresh@3.3.0:
dependencies:
parent-module: 1.0.1
@@ -4600,6 +5024,8 @@ snapshots:
dependencies:
is-extglob: 2.1.1
is-hotkey@0.2.0: {}
is-inside-container@1.0.0:
dependencies:
is-docker: 3.0.0
@@ -4608,10 +5034,14 @@ snapshots:
is-path-inside@3.0.3: {}
is-plain-object@5.0.0: {}
is-potential-custom-element-name@1.0.1: {}
is-stream@3.0.0: {}
is-url@1.2.4: {}
is-what@4.1.16: {}
is-wsl@3.1.0:
@@ -4728,12 +5158,26 @@ snapshots:
dependencies:
p-locate: 5.0.0
lodash.camelcase@4.3.0: {}
lodash.castarray@4.4.0: {}
lodash.clonedeep@4.5.0: {}
lodash.debounce@4.0.8: {}
lodash.foreach@4.5.0: {}
lodash.isequal@4.5.0: {}
lodash.isplainobject@4.0.6: {}
lodash.merge@4.6.2: {}
lodash.throttle@4.1.1: {}
lodash.toarray@4.4.0: {}
lodash@4.17.21: {}
loupe@2.3.7:
@@ -4774,6 +5218,10 @@ snapshots:
mime-db@1.52.0: {}
mime-match@1.0.2:
dependencies:
wildcard: 1.1.2
mime-types@2.1.35:
dependencies:
mime-db: 1.52.0
@@ -4836,10 +5284,14 @@ snapshots:
object-assign: 4.1.1
thenify-all: 1.6.0
namespace-emitter@2.0.1: {}
nanoid@3.3.7: {}
natural-compare@1.4.0: {}
next-tick@1.1.0: {}
node-fetch-native@1.6.4: {}
node-releases@2.0.18: {}
@@ -5052,6 +5504,8 @@ snapshots:
picocolors: 1.1.0
source-map-js: 1.2.1
preact@10.24.3: {}
prelude-ls@1.2.1: {}
prettier-linter-helpers@1.0.0:
@@ -5066,6 +5520,8 @@ snapshots:
ansi-styles: 5.2.0
react-is: 18.3.1
prismjs@1.29.0: {}
prosemirror-changeset@2.2.1:
dependencies:
prosemirror-transform: 1.10.0
@@ -5261,6 +5717,10 @@ snapshots:
dependencies:
xmlchars: 2.2.0
scroll-into-view-if-needed@2.2.31:
dependencies:
compute-scroll-into-view: 1.0.20
scule@1.3.0: {}
select@1.1.2: {}
@@ -5291,12 +5751,27 @@ snapshots:
slash@5.1.0: {}
slate-history@0.66.0(slate@0.72.8):
dependencies:
is-plain-object: 5.0.0
slate: 0.72.8
slate@0.72.8:
dependencies:
immer: 9.0.21
is-plain-object: 5.0.0
tiny-warning: 1.0.3
snabbdom@3.6.2: {}
sortablejs@1.15.3: {}
source-map-js@1.2.1: {}
speakingurl@14.0.1: {}
ssr-window@3.0.0: {}
stackback@0.0.2: {}
statuses@1.5.0: {}
@@ -5434,6 +5909,8 @@ snapshots:
tiny-emitter@2.1.0: {}
tiny-warning@1.0.3: {}
tinybench@2.9.0: {}
tinycolor2@1.6.0: {}
@@ -5481,6 +5958,8 @@ snapshots:
type-fest@0.20.2: {}
type@2.7.3: {}
typescript@5.4.5: {}
uc.micro@2.1.0: {}
@@ -5810,6 +6289,8 @@ snapshots:
siginfo: 2.0.0
stackback: 0.0.2
wildcard@1.1.2: {}
word-wrap@1.2.5: {}
wrap-ansi@7.0.0:
+31
View File
@@ -0,0 +1,31 @@
import httpClient from '@/api/httpClient'
import type { PageResult } from '@/model/base'
import type { Article,ArticleSearchFilter,CreateArticleRequest } from '@/model/article'
export const searchArticlesRequest = (articleFilterParam:ArticleSearchFilter ) => {
return httpClient.get<PageResult<Article>>('/articles',articleFilterParam)
}
export const createArticle = (article: CreateArticleRequest) => {
return httpClient.post<Article>('/articles',article)
}
export const deleteArticlesRequest = (id:string) => {
return httpClient.delete(`/articles/${id}`,)
}
export const searchArticlesByIdRequest = (id: string) => {
return httpClient.get<Article>(`/articles/${id}`)
}
export const updateArticle = (id: string, article:CreateArticleRequest) => {
return httpClient.put<Article>(`/articles/${id}`,article)
}
export const publishArticlesByIdRequest = (id: string,) => {
return httpClient.put<Article>(`/articles/${id}/publish`,)
}
export const closeArticlesByIdRequest = (id: string,) => {
return httpClient.put<Article>(`/articles/${id}/close`,)
}
+17 -10
View File
@@ -1,19 +1,26 @@
import httpClient from './httpClient'
import type { CreateCarousalsRequest, GetCarousalsRequest } from '@/model/carousals'
import type {
CarousalResult, Carousals,
CreateCarousalsRequest,
SearchCarousalsFilter,
UpdateCarousalsRequest
} from '@/model/carousals'
import type { PageResult } from '@/model/base'
import type {UnwrapRef} from "vue";
export const createCarousal = (createCarousalsRequest: CreateCarousalsRequest) => {
return httpClient.post('/carousals', createCarousalsRequest)
return httpClient.post<PageResult<CarousalResult>>('/carousals', createCarousalsRequest)
}
export const getCarousalList = (getCarousalsRequest:GetCarousalsRequest) => {
return httpClient.get('/carousals',getCarousalsRequest)
export const searchCarousals = (searchCarousalsFilter: SearchCarousalsFilter) => {
return httpClient.get<PageResult<Carousals>>('/carousals',searchCarousalsFilter)
}
export const getCarousalItem = (id:string) => {
return httpClient.get(`/carousals/${id}`)
return httpClient.get<CarousalResult>(`/carousals/${id}`)
}
export const updateCarousalItem = (id:number,updateCarousalsRequest: CreateCarousalsRequest) => {
return httpClient.put(`/carousals/${id}`,updateCarousalsRequest)
export const updateCarousalItem = (id: UnwrapRef<UpdateCarousalsRequest["id"]> | undefined, updateCarousalsRequest: CreateCarousalsRequest) => {
return httpClient.put<CarousalResult>(`/carousals/${id}`,updateCarousalsRequest)
}
export const deleteCarousal = (id:string | number) => {
@@ -21,9 +28,9 @@ export const deleteCarousal = (id:string | number) => {
}
export const activeCarousal = (id: string | number) => {
return httpClient.put(`/carousals/${id}/active`)
return httpClient.put<CarousalResult>(`/carousals/${id}/active`)
}
export const inactiveCarousal = (id: string | number ) => {
return httpClient.put(`/carousals/${id}/inactive`)
}
return httpClient.put<CarousalResult>(`/carousals/${id}/inactive`)
}
+6 -3
View File
@@ -2,8 +2,11 @@ import httpClient from '@/api/httpClient'
import type { PageResult } from '@/model/base'
import type { Category,CategorySearchFilter, } from '@/model/category'
export const searchCategoryRequest = (categoryFilterParam:CategorySearchFilter ) => {
return httpClient.get<PageResult<Category>>('/categories',categoryFilterParam)
export const searchCategories = (categoryFilterParam :CategorySearchFilter ) => {
return httpClient.get<PageResult<Category>>('/categories', categoryFilterParam)
}
export const searchCategoryListRequest = ( ) => {
return httpClient.get<Category[]>('/categories/list',)
}
export const createCategoryRequest = (category: Pick<Category,'name'|'code'|'order'>) => {
@@ -20,4 +23,4 @@ export const searchCategoryByIdRequest = (id: string) => {
export const updateCategoryByIdRequest = (id: string,category: Pick<Category,'name'|'code'|'order'>) => {
return httpClient.put<Category>(`/categories/${id}`,category)
}
}
+6 -1
View File
@@ -1,7 +1,7 @@
import type { RequestMethodResponse, UploadFile } from 'tdesign-vue-next'
import httpClient from '@/api/httpClient'
export const uploadFile = async (files: UploadFile): Promise<RequestMethodResponse> => {
export const uploadFileOld = async (files: UploadFile): Promise<RequestMethodResponse> => {
return new Promise((resolve, reject) => {
httpClient.uploadFile<{
url: string
@@ -22,3 +22,8 @@ export const uploadFile = async (files: UploadFile): Promise<RequestMethodRespon
})
}
export const uploadFile = async (file: File) => {
return httpClient.uploadFile<{ url: string }>('/files/upload', file)
}
+7 -2
View File
@@ -9,8 +9,13 @@ const client: AxiosInstance = axios.create({
})
const handleError = (errorResponse: ErrorResponse) => {
MessagePlugin.error(errorResponse.message)
if (errorResponse.code === 401) {
useAppStore().logout()
MessagePlugin.error('登录信息失效,请重新登录')
} else {
MessagePlugin.error(errorResponse.message)
}
}
client.interceptors.response.use(
(response) => {
+22
View File
@@ -0,0 +1,22 @@
import httpClient from '@/api/httpClient'
import type { PageResult } from '@/model/base'
import type { PetVariety, SearchPetVarietyFilter } from '@/model/pet-variety'
export const searchPetVarieties = async (searchPetVarietyFilter: SearchPetVarietyFilter) => {
return httpClient.get<PageResult<PetVariety>>('/pet-varieties', searchPetVarietyFilter)
}
export const createPetVariety = async (name: string) => {
return httpClient.post<PetVariety>('/pet-varieties', { name })
}
export const editPetVariety = async (id: string, name: string) => {
return httpClient.put<PetVariety>(`/pet-varieties/${id}`, { name })
}
export const deletePetVariety = async (id: string) => {
return httpClient.delete(`/pet-varieties/${id}`)
}
+22
View File
@@ -0,0 +1,22 @@
import type { CreateProductRequest, Product, SearchProductFilter, UpdateProductRequest } from '@/model/product'
import httpClient from '@/api/httpClient'
import type { PageResult } from '@/model/base'
export const searchProducts = async (searchProductFilter: SearchProductFilter) => {
return httpClient.get<PageResult<Product>>('/products', searchProductFilter)
}
export const createProduct = async (createProductRequest: CreateProductRequest) => {
return httpClient.post<Product>('/products', createProductRequest)
}
export const editProduct = async (id: string, updateProductRequest: UpdateProductRequest) => {
return httpClient.put<Product>(`/products/${id}`, updateProductRequest)
}
export const deleteProduct = async (id: string) => {
return httpClient.delete(`/products/${id}`)
}
+1 -1
View File
@@ -10,6 +10,6 @@ export const searchUsers = (userSearchFilter: UserSearchFilter) => {
return httpClient.get<PageResult<User>>('/users', userSearchFilter)
}
export const setUserRoles = (id: number, roles: string[]) => {
export const setUserRoles = (id: string, roles: string[]) => {
return httpClient.put<User>(`/users/${id}/roles`, { roles })
}
+82
View File
@@ -0,0 +1,82 @@
<script setup lang="ts">
import '@wangeditor/editor/dist/css/style.css'
// @ts-ignore
import { Editor, Toolbar } from '@wangeditor/editor-for-vue'
import { useAppStore } from '@/stores/app'
import type { IEditorConfig } from '@wangeditor/editor'
import { uploadFile, uploadFileOld } from '@/api/file'
const props = withDefaults(defineProps<{
modelValue: string
mode?: 'default' | 'simple'
}>(), {
mode: 'default'
})
const emit = defineEmits<{
'update:modelValue': [string]
}>()
const editorRef = shallowRef()
const valueHtml = computed({
get: () => props.modelValue,
set: (value) => emit('update:modelValue', value)
})
const editorConfig: Partial<IEditorConfig> = {
placeholder: '请输入内容...',
MENU_CONF: {
uploadImage: {
async customUpload(file: File, insertFn: (url: string) => void) {
const result = await uploadFile(file)
insertFn(result.url)
}
}
}
}
const toolbarConfig = {}
const handleCreated = (editor: typeof Editor) => {
editorRef.value = editor // 记录 editor 实例,重要!
}
// 组件销毁时,也及时销毁编辑器
//
onBeforeUnmount(() => {
const editor = editorRef.value
if (editor == null) return
editor.destroy()
})
</script>
<template>
<div class="w-full border-2">
<Toolbar
style="border-bottom: 1px solid #ccc"
:editor="editorRef"
:defaultConfig="toolbarConfig"
:mode="mode"
/>
<Editor
style="height: 500px; overflow-y: hidden;"
v-model="valueHtml"
:defaultConfig="editorConfig"
:mode="mode"
@onCreated="handleCreated"
/>
</div>
</template>
<style scoped>
</style>
+25
View File
@@ -0,0 +1,25 @@
<template>
<TImageViewer :images="[url]">
<template #trigger="{ open }">
<div class="w-[100px] h-[100px] relative flex justify-center items-center rounded overflow-hidden">
<img alt="test" :src="url" class="w-full h-full object-contain" />
<div class="transition-all hover:opacity-100 opacity-0 w-full h-full absolute top-0 left-0 bg-[#00000099] text-white flex items-center justify-center" @click="open">
<span><BrowseIcon size="1.4em" /> 预览</span>
</div>
</div>
</template>
</TImageViewer>
</template>
<script setup lang="ts">
import { BrowseIcon } from 'tdesign-icons-vue-next'
defineProps<{
url: string,
}>()
</script>
<style scoped>
</style>
+27 -29
View File
@@ -9,18 +9,17 @@ const sizeLimit = ref<UploadProps['sizeLimit']>({
size: 2,
unit: 'MB',
});
const file1 = ref<UploadProps['value']>([]);
const disabled = ref(false);
const autoUpload = ref(true);
const showImageFileName = ref(true);
const uploadAllFilesInOneRequest = ref(false);
const fileList = ref<UploadProps['value']>([]);
const disabled = ref<boolean>(false);
const autoUpload = ref<boolean>(true);
const showImageFileName = ref<boolean>(true);
const uploadAllFilesInOneRequest = ref<boolean>(false);
const handleFail: UploadProps['onFail'] = ({ file }) => {
MessagePlugin.error(`文件 ${file.name} 上传失败`);
};
const handleSuccess: UploadProps['onSuccess'] = ({ file }) => {
if(file?.url){
console.log(file1.value,'file1')
emits('on-success',file.url)
emits('update:modelValue',file.url)
}
}
const appStore = useAppStore()
@@ -28,34 +27,36 @@ const appStore = useAppStore()
const uploadHeaders = ref<UploadProps['headers']>({
Authorization: `Bearer ${appStore.token}`
})
const props = defineProps({
imageUrl:{
type:Object,
default:() => {
return { url: '' }
}
}
const props = withDefaults(defineProps<{
modelValue: string
}>(), {
modelValue: ''
})
const emits = defineEmits(['on-success'])
watch(() => props.imageUrl,(newVal) => {
if(newVal){
if(newVal.url !== ''){
file1.value = [{ ...newVal }]
}else{
file1.value = []
}
const emits = defineEmits<{
'update:modelValue': [string]
}>()
watch(() => props.modelValue,(newVal) => {
if (newVal) {
fileList.value = [{url: newVal}]
} else {
fileList.value = []
}
},{
deep:true,
immediate:true
})
</script>
<template>
<div>
<t-upload
ref="uploadRef1"
v-model="file1"
v-model="fileList"
:image-viewer-props="imageViewerProps"
:size-limit="sizeLimit"
action="/api/files/upload"
@@ -75,14 +76,11 @@ watch(() => props.imageUrl,(newVal) => {
@fail="handleFail"
@success="handleSuccess"
>
<!-- custom UI -->
<!-- <template #fileListDisplay="{ files }">
<div>{{ JSON.stringify(files) }}</div>
</template> -->
</t-upload>
</div>
</template>
<style scoped>
</style>
</style>
+6 -1
View File
@@ -42,4 +42,9 @@ const slots = defineSlots<{
</TCard>
</template>
<style scoped></style>
<style scoped>
:deep(.t-card__body) {
flex: 1;
min-height: 0;
}
</style>
+2 -3
View File
@@ -2,9 +2,8 @@
import { ChevronDownIcon } from 'tdesign-icons-vue-next'
import type { DropdownOption } from 'tdesign-vue-next'
import { useAppStore } from '@/stores/app'
import type { User } from '@/models/user'
const appStore = useAppStore()
const currentUser: User = appStore.currentUser
const currentUser = appStore.currentUser
const options: DropdownOption[] = [
{
content: '退出登录',
@@ -21,7 +20,7 @@ const options: DropdownOption[] = [
<TButton variant="text">
<div class="flex gap-2 items-center">
<TAvatar size="24px" image="https://tdesign.gtimg.com/site/avatar.jpg"></TAvatar>
{{ currentUser.username }}
{{ currentUser?.username }}
<ChevronDownIcon />
</div>
</TButton>
+33
View File
@@ -0,0 +1,33 @@
import type { AuditBaseModel,Paging } from '@/model/base'
import type { Category } from './category'
export enum ArticleStatus {
DRAFT = 'draft',
PUBLISHED = 'published',
Closed = 'closed'
}
export interface Article extends AuditBaseModel{
title: string
content:string
category: Category
status: ArticleStatus
thumbnail: string
description: string
}
export interface ArticleSearchFilter extends Partial<Paging>{
order?: string
title?: string
content?:string
categoryId?:string
}
export interface CreateArticleRequest{
categoryId: string
title: string
content: string
thumbnail: string
description:string
}
+2 -2
View File
@@ -7,7 +7,7 @@ export interface ErrorResponse {
export interface BaseModel {
id: string
createdTime: string
updateTime: string
updatedTime: string
}
export interface AuditBaseModel extends BaseModel {
@@ -29,4 +29,4 @@ export interface PageResult<T> {
data: T[]
}
export interface ErrorResponseList extends Array<ErrorResponse> {}
export interface ErrorResponseList extends Array<ErrorResponse> {}
+21 -8
View File
@@ -1,12 +1,25 @@
import type { AuditBaseModel, BaseModel, Paging } from '@/model/base'
export interface CreateCarousalsRequest {
imageUrl:string,
targetType:string,
targetUrl?:string,
targetId?:string
imageUrl:string
targetType:string
targetUrl?:string | null
targetId?:string | null
}
export interface GetCarousalsRequest {
page:number,
size:number,
order?:[string]
export interface Carousals extends AuditBaseModel,CreateCarousalsRequest {
}
export interface UpdateCarousalsRequest extends CreateCarousalsRequest{
createBy?:null
createdTime?:string
id?:string
updateBy?:null
updateTime?:string
}
export interface SearchCarousalsFilter extends Partial<Paging> {
order?:string
}
export interface CarousalResult extends BaseModel,CreateCarousalsRequest{
status:string
}
+1
View File
@@ -10,6 +10,7 @@ export interface Category extends AuditBaseModel{
export interface CategorySearchFilter extends Partial<Paging>{
order?: string
name?: string
}
+7
View File
@@ -0,0 +1,7 @@
import type { BaseFilterRequest, BaseModel } from '@/model/base'
export interface PetVariety extends BaseModel{
name: string
}
export interface SearchPetVarietyFilter extends BaseFilterRequest {}
+41
View File
@@ -0,0 +1,41 @@
import type { BaseFilterRequest, BaseModel } from '@/model/base'
export interface Product extends BaseModel{
name: string;
category: ProductCategory
photo: string;
tags: string[];
totalWeight: number;
protein: number;
fat: number;
fiber: number;
ash: number;
moisture: number;
meValue: number | null; // ME值(kcal/g),直接配置的代谢能
totalCalories: number; // 产品总能量(kcal),由后端基于ME算法计算或直接配置
}
export interface CreateProductRequest extends Pick<Product, "name" | 'photo' | 'tags' | 'totalWeight' | 'category' | 'protein' | 'fat' | 'fiber' | 'ash' | 'moisture'> {
meValue?: number; // ME值(kcal/g),可选
}
export interface SearchProductFilter extends BaseFilterRequest{
}
export interface UpdateProductRequest extends CreateProductRequest {}
export enum ProductCategory {
DRY_FOOD,
WET_FOOD,
}
export const productCategoryOptions: {
label: string
value: ProductCategory
}[] = [
{ label: '干粮', value: ProductCategory.DRY_FOOD },
{ label: '湿粮', value: ProductCategory.WET_FOOD },
]
+3
View File
@@ -1,9 +1,12 @@
import type { BaseFilterRequest, AuditBaseModel } from '@/model/base'
import type { Role } from '@/model/role'
export interface User extends AuditBaseModel{
username: string
locked: boolean
enabled: boolean
name?: string
roles?: Role[]
}
@@ -0,0 +1,189 @@
<script lang="ts" setup>
import type { Category } from '@/model/category'
import type { Article, CreateArticleRequest } from '@/model/article'
import { computed, ref, reactive, watch } from 'vue'
import type {
FormInstanceFunctions,
FormRules,
TdSelectProps
} from 'tdesign-vue-next'
import { MessagePlugin } from 'tdesign-vue-next'
import { updateArticle, createArticle } from '@/api/article'
import { searchCategories } from '@/api/category'
import Editor from '@/components/Editor.vue'
import ImageUpload from '@/components/ImageUpload.vue'
const props = defineProps<{
headerTitle?: String | null
article: Article | null
categoryList: Category[]
}>()
const formRef = ref<FormInstanceFunctions | null>(null)
const headerText = computed(() => `${props.article ? '编辑' : '创建'}${props.headerTitle || ''}`)
const confirmBtnText = computed(() => (props.article ? '保存' : '确定'))
const articleData = reactive<CreateArticleRequest>({ title: '', categoryId: '', content: '', thumbnail: '', description: ''})
const rules: FormRules<CreateArticleRequest> = {
title: [
{
required: true,
message: '咨询标题不能为空',
type: 'error',
trigger: 'blur'
},
{
required: true,
message: '咨询标题不能为空',
type: 'error',
trigger: 'change'
},
{
whitespace: true,
message: '咨询标题不能为空'
},
{
min: 4,
message: '输入汉字长度应在2到120之间',
type: 'error',
trigger: 'blur'
},
{
max: 240,
message: '输入汉字长度应在2到120之间',
type: 'error',
trigger: 'blur'
}
],
categoryId: [
{
required: true,
message: '咨询分类不能为空',
type: 'error',
trigger: 'blur'
},
{
required: true,
message: '咨询分类不能为空',
type: 'error',
trigger: 'change'
},
{
whitespace: true,
message: '咨询分类不能为空'
}
],
content: [
{
max: 20000,
message: '内容不超过10000字',
type: 'error',
trigger: 'blur'
}
],
thumbnail: [
{
required: true,
message: '请上传封面图',
type: 'error',
trigger: 'blur'
},
{
whitespace: true,
message: '请上传封面图'
}
],
description: [
{
max: 500,
message: '描述不超过500字',
type: 'error',
trigger: 'blur'
}
]
}
watch(
() => props.article,
(newArticleData) => {
articleData.categoryId = newArticleData?.category.id || ''
articleData.title = newArticleData?.title || ''
articleData.content = newArticleData?.content || ''
articleData.thumbnail = newArticleData?.thumbnail || ''
},
{ deep: true }
)
const emit = defineEmits<{
success: [void]
onInputChange: [void]
}>()
const handleSave = async () => {
if (!formRef.value) return
const valid = await formRef.value.validate()
if (valid === true) {
if (props.article) {
await updateArticle(props.article.id, articleData)
} else {
await createArticle(articleData)
}
MessagePlugin.success(`${props.article ? '编辑' : '创建'}咨询成功`)
emit('success')
}
}
const handleCloseDialog = () => {
// 数据&&规则校验结果重置
if (!formRef.value) return
formRef.value.reset()
formRef.value.clearValidate()
}
const categoryOptions = ref<TdSelectProps['options']>([])
const fetchCategories = async (search: string) => {
const { data } = await searchCategories({ name: search })
categoryOptions.value = data.map((category) => {
return {
label: category.name,
value: category.id
}
})
}
fetchCategories('')
</script>
<template>
<t-dialog
width="60%"
:header="headerText"
:confirmBtn="confirmBtnText"
:closeOnOverlayClick="false"
@close="handleCloseDialog"
destroy-on-close
@confirm="handleSave"
>
<t-space direction="vertical" style="width: 100%">
<TForm ref="formRef" :data="articleData" :rules="rules" resetType="initial">
<TFormItem label="咨询标题:" name="title" help="名称长度大于2个汉字,小于120个汉字">
<t-input v-model.trim="articleData.title" clearable placeholder="请输入咨询标题" />
</TFormItem>
<TFormItem label="咨询描述:" name="description" help="描述长度小于500字符">
<TTextarea v-model.trim="articleData.description" clearable placeholder="请输入咨询标题" :maxcharacter="500"/>
</TFormItem>
<TFormItem label="咨询分类:" name="categoryId">
<TSelect
v-model="articleData.categoryId"
:options="categoryOptions"
placeholder="请选择咨询分类"
filterable
@search="fetchCategories"
/>
</TFormItem>
<TFormItem label="轮播图:" name="thumbnail">
<ImageUpload v-model="articleData.thumbnail"/>
</TFormItem>
<TFormItem label="内容:" name="content">
<Editor v-model="articleData.content"></Editor>
</TFormItem>
</TForm>
</t-space>
</t-dialog>
</template>
+164
View File
@@ -0,0 +1,164 @@
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue'
import type { Article, ArticleSearchFilter } from '@/model/article'
import RegularPage from '@/components/RegularPage.vue'
import {
searchArticlesRequest,
deleteArticlesRequest,
publishArticlesByIdRequest,
closeArticlesByIdRequest
} from '@/api/article'
import { searchCategoryListRequest } from '@/api/category'
import type { Category } from '@/model/category'
import type { BaseTableColumns } from 'tdesign-vue-next'
import { useSearchable } from '@/composables/useSearchable'
import ArticleDialog from '@/pages/article/components/ArticleDialog.vue'
import { MessagePlugin } from 'tdesign-vue-next'
const { data, loading, pagination, onPageChange, fetchData } = useSearchable<
ArticleSearchFilter,
Article
>(searchArticlesRequest)
const statusArticleListMap = {
draft: { label: '草稿', theme: 'default' },
published: { label: '已发布', theme: 'success' },
closed: { label: '已关闭', theme: 'danger' }
}
const columns: BaseTableColumns = [
{
title: '咨询标题',
colKey: 'title',
width: 100
},
{
title: '分类',
colKey: 'categoryName',
width: 100
},
{
title: '状态',
colKey: 'status',
width: 100
},
{
title: '创建时间',
colKey: 'createdTime',
width: 100
},
{
title: '操作',
colKey: 'operation',
width: 100
}
]
const articleDialogVisble = ref(false)
const isEdit = ref(false)
const currentTableData = ref<Article | null>(null)
const categoryList = ref<Category[]>([])
onMounted(fetchData)
watch(articleDialogVisble, (newValue) => {
if (newValue) {
searchCategoryList()
}
})
const searchCategoryList = async () => {
try {
const res = await searchCategoryListRequest()
categoryList.value = res
} catch (error) {
categoryList.value = []
}
}
const editClick = (article: Article) => {
isEdit.value = true
currentTableData.value = article
articleDialogVisble.value = true
}
const handleArticleDialogSuccess = () => {
fetchData()
articleDialogVisble.value = false
}
const handleArticleDialogClosed = () => {
isEdit.value = false
currentTableData.value = null
}
const toggleArticleStatus = async (article: Article) => {
if (article.status === 'published') {
await closeArticlesByIdRequest(article.id)
} else {
await publishArticlesByIdRequest(article.id)
}
fetchData()
MessagePlugin.success(`${article.status === 'published' ? '关闭' : '发布'}咨询成功`)
}
const deleteCategoryClick = async (article: Article) => {
await deleteArticlesRequest(article.id)
fetchData()
MessagePlugin.success('删除咨询成功')
}
</script>
<template>
<RegularPage title="咨询管理">
<template #right-area>
<TButton @click="articleDialogVisble = true">创建咨询</TButton>
</template>
<TTable
class="w-full h-full"
row-key="id"
height="92%"
table-layout="auto"
:data="data"
:loading="loading"
:columns="columns"
cell-empty-content="-"
:paginationAffixedBottom="true"
:pagination="{
total: pagination.total,
current: pagination.page,
pageSize: pagination.size,
onChange: onPageChange
}"
>
<template #categoryName="{ row }">
{{ row.category.name }}
</template>
<template #status="{ row }">
<t-tag :theme="statusArticleListMap[row.status as keyof typeof statusArticleListMap].theme">
{{ statusArticleListMap[row.status as keyof typeof statusArticleListMap].label }}
</t-tag>
</template>
<template #operation="{ row }">
<TSpace :size="1">
<TButton variant="text" size="small" theme="primary" @click="editClick(row)"
>编辑</TButton
>
<TButton variant="text" size="small" theme="warning" @click="toggleArticleStatus(row)">{{
row.status === 'published' ? '关闭' : '发布'
}}</TButton>
<t-popconfirm
theme="default"
content="确认删除此项分类吗"
@confirm="deleteCategoryClick(row)"
>
<TButton variant="text" size="small" theme="danger">删除</TButton>
</t-popconfirm>
</TSpace>
</template>
</TTable>
<ArticleDialog
headerTitle="咨询"
:article="currentTableData"
:categoryList="categoryList"
v-model:visible="articleDialogVisble"
@closed="handleArticleDialogClosed"
@success="handleArticleDialogSuccess"
></ArticleDialog>
</RegularPage>
</template>
<style scoped>
:deep(.t-card__body) {
flex: 1;
min-height: 0;
}
</style>
@@ -1,16 +1,15 @@
<template>
<t-dialog
width="70%"
:header="header"
:confirmBtn="confirmBtn"
<TDialog
width="980px"
:header="headerText"
:confirmBtn="confirmBtnText"
:closeOnOverlayClick="false"
@close="handleCloseDialog"
@confirm="fetchSaveCarousalData"
>
<t-space direction="vertical" style="width: 100%">
<TForm ref="form" :data="carousalData" :rules="rules" resetType="initial" label-width="100">
<TForm v-if="carousalData" ref="formRef" :data="carousalData" :rules="rules" resetType="initial" label-width="100">
<TFormItem label="轮播图:" name="imageUrl">
<ImageUpload @on-success="handleSuccessImg" :image-url="imgUrl"/>
<ImageUpload v-model="carousalData.imageUrl" />
</TFormItem>
<TFormItem label="跳转类型:" name="targetType" >
<t-radio-group :default-value="carousalData.targetType" v-model="carousalData.targetType">
@@ -24,26 +23,35 @@
<t-input v-model.trim="carousalData.targetUrl" clearable placeholder="请输入网址路径" />
</TFormItem>
</TForm>
</t-space>
</t-dialog>
</TDialog>
</template>
<script lang="ts" setup>
import { computed, ref, reactive, watch } from 'vue'
import type { FormInstanceFunctions, FormProps } from 'tdesign-vue-next'
import type { FormInstanceFunctions } from 'tdesign-vue-next'
import ImageUpload from '@/components/ImageUpload.vue'
import { createCarousal, updateCarousalItem } from '@/api/carousal'
const props = defineProps<{
isEdit?: Boolean | null
headerTitle?: String | null
carousal: {} | number
import type {CreateCarousalsRequest, UpdateCarousalsRequest} from "@/model/carousals";
const props = withDefaults(defineProps<{
isEdit?: boolean | null
headerTitle?: string | null
carousal: CreateCarousalsRequest
}>(),{
headerTitle:''
})
const emit = defineEmits<{
success: [void]
}>()
const emit = defineEmits(['success'])
const form = ref<FormInstanceFunctions | null>(null)
const header = computed(() => `${props.isEdit ? '编辑' : '创建'}${props.headerTitle || ''}`)
const formRef = ref<FormInstanceFunctions | null>(null)
const headerText = computed(() => `${props.isEdit ? '编辑' : '创建'}${props.headerTitle || ''}`)
const confirmBtnText = computed(() => (props.isEdit ? '保存' : '确定'))
const formType = computed(() => `${props.isEdit ? 'update' : 'add'}`)
const confirmBtn = computed(() => (props.isEdit ? '保存' : '确定'))
const carousalData: FormProps['data'] = ref({})
const imgUrl = ref({})
const carousalData = ref<UpdateCarousalsRequest>({
imageUrl: '',
targetType: 'article',
targetId: '',
targetUrl: '',
})
const rules = computed(() => {
const commonRules = {
imageUrl: [
@@ -73,29 +81,22 @@ const rules = computed(() => {
? {...commonRules, targetId: [{ required: true, message: '文章 id 不能为空', type: 'error', trigger: 'blur' }, { required: true, message: '文章 id 不能为空', type: 'error', trigger: 'change' }, { whitespace: true, message: '网址路径不能为空' }] }
: {...commonRules, targetUrl: [{ required: true, message: '网址路径不能为空', type: 'error', trigger: 'blur' }, { required: true, message: '网址路径不能为空', type: 'error', trigger: 'change' }, { whitespace: true, message: '网址路径不能为空' }] };
});
const handleSuccessImg = (res:string) => {
console.log(res,'图片地址')
carousalData.value.imageUrl = res
}
const typeOption = reactive([
{ value: 'article', label: '文章' },
{ value: 'url', label: '地址' },
])
const handleFormTypeData = () => {
if (carousalData.value.targetType === 'article') {
delete carousalData.value.targetUrl
carousalData.value.targetUrl = null
} else if (carousalData.value.targetType === 'url') {
delete carousalData.value.targetId
carousalData.value.targetId = null
}
}
watch(
() => props.carousal,
(newClassify) => {
(newClassify: CreateCarousalsRequest) => {
carousalData.value = Object.assign({}, newClassify)
const carousalObj = Object.assign({},newClassify)
// imgUrl.value.url = carousalObj.imageUrl || ''
imgUrl.value = { url: carousalObj.imageUrl || '' }
},
{
deep: true,
@@ -104,48 +105,31 @@ watch(
)
const fetchSaveCarousalData = async () => {
/* TODO: 保存分类数据 */
if (form.value) {
const valid = await form.value.validate()
// console.log(valid,'valid')
if (formRef.value) {
const valid = await formRef.value.validate()
if (valid && typeof valid === 'boolean') {
/* TODO: 校验通过保存分类数据 */
handleFormTypeData()
// console.log(formType.value,'formType')
let res
switch (formType.value){
case 'create':
res = await createCarousal(carousalData.value)
emit('success')
break;
case 'update':
const fieldsToKeep = ["imageUrl", "targetType", "targetUrl", "targetId"];
const requestObj = {};
for (const field of fieldsToKeep) {
if (carousalData.value[field]!== null && carousalData.value[field]!== undefined) {
requestObj[field] = carousalData.value[field];
}
}
handleFormTypeData()
res = await updateCarousalItem(carousalData.value.id,requestObj)
emit('success')
break;
default:
res = await createCarousal(carousalData.value)
emit('success')
break;
}
// const createCarousalApi = createCarousal(carousalData.value)
// console.log(createCarousalApi,'createCarousalApi')
formType.value === 'add' ? await createCarousalData() : await updateCarousalData()
return
}
}
}
const createCarousalData = async () => {
await createCarousal(carousalData.value)
emit('success')
}
const updateCarousalData = async () => {
handleFormTypeData()
const requestObj: CreateCarousalsRequest = {imageUrl: carousalData.value.imageUrl,targetType:carousalData.value.targetType,targetUrl:carousalData.value.targetUrl,targetId:carousalData.value.targetId}
await updateCarousalItem(carousalData.value.id, requestObj)
emit('success')
}
const handleCloseDialog = () => {
// 数据&&规则校验结果重置
if (form.value) {
form.value.reset()
form.value.clearValidate()
if (formRef.value) {
formRef.value.reset()
formRef.value.clearValidate()
}
}
</script>
+52 -119
View File
@@ -1,84 +1,79 @@
<script setup lang="ts">
import RegularPage from '@/components/RegularPage.vue'
import { onMounted, ref, reactive } from 'vue'
import { onMounted, ref } from 'vue'
import type { BaseTableColumns } from 'tdesign-vue-next'
import CarousalDialog from '@/pages/carousal/components/CarousalDialog.vue'
import { activeCarousal, deleteCarousal, getCarousalList, inactiveCarousal } from '@/api/carousal'
import { BrowseIcon } from 'tdesign-icons-vue-next'
import { activeCarousal, deleteCarousal, searchCarousals, inactiveCarousal } from '@/api/carousal'
import type {
CarousalResult, Carousals,
CreateCarousalsRequest,
SearchCarousalsFilter,
} from '@/model/carousals'
import ImagePreviewer from '@/components/ImagePreviewer.vue'
import { useSearchable } from '@/composables/useSearchable'
const columns: BaseTableColumns = [
{
title: 'ID',
colKey: 'id',
width: 100,
width: 100
},
{
title: '轮播图',
colKey: 'imageUrl',
width: 100,
width: 100
},
{
title: '显示状态',
colKey: 'status',
width: 100,
width: 100
},
{
title: '操作',
colKey: 'operation',
width: 100,
width: 100
}
]
const loading = ref(false)
const data = ref([])
const pagination = reactive({
page: 1,
size: 10,
total:0
const { loading, data, pagination, fetchData, onPageChange } = useSearchable<SearchCarousalsFilter,Carousals>(searchCarousals)
onMounted(fetchData)
const carousalDialogVisible = ref<boolean>(false)
const isEdit = ref<boolean>(false)
const currentTableData = ref<CreateCarousalsRequest>({
imageUrl: '',
targetType: ''
})
const query = reactive({
page:1,
size:10,
})
const carousalDialogVisible = ref(false)
const isEdit = ref(false)
const currentTableData = ref<{}>({})
const fetchSaveCarousalData = async () => {
/* TODO: 获取轮播图表格数据 */
query.page = pagination.page
query.size = pagination.size
const getCarousalListApi = await getCarousalList(query)
data.value = getCarousalListApi.data
pagination.total = getCarousalListApi.pagination.total
}
onMounted(fetchSaveCarousalData)
const editClick = (row:object) => {
const handleEdit = (row: CarousalResult): void => {
isEdit.value = true
currentTableData.value = Object.assign({}, row)
carousalDialogVisible.value = true
}
const showClick = async (res:object) => {
if (res.status === 'active'){
const handleShow = async (res: CarousalResult): Promise<void> => {
if (res.status === 'active') {
await inactiveCarousal(res.id)
} else {
await activeCarousal(res.id)
}
await fetchSaveCarousalData()
await fetchData()
}
const delClick = async (row:object) => {
console.log(row,'删除')
const handleDelete = async (row: CarousalResult): Promise<void> => {
await deleteCarousal(row.id)
await fetchSaveCarousalData()
await fetchData()
}
const handleCreateCarousal = () => {
const handleCreateCarousal = (): void => {
isEdit.value = false
carousalDialogVisible.value = true
currentTableData.value = {}
currentTableData.value = {
imageUrl: '',
targetId: '',
targetType: '',
targetUrl: '',
}
}
const onPageChange = () => {
/* TODO: 分页切换 */
}
const handleSuccessDialog = async () => {
await fetchSaveCarousalData()
const handleSuccessDialog = async (): Promise<void> => {
await fetchData()
carousalDialogVisible.value = false
}
</script>
@@ -91,8 +86,8 @@ const handleSuccessDialog = async () => {
<TTable
class="w-full h-full"
row-key="id"
height="92%"
table-layout="auto"
height="92%"
:data="data"
:loading="loading"
:columns="columns"
@@ -105,36 +100,29 @@ const handleSuccessDialog = async () => {
onChange: onPageChange
}"
>
<template #imageUrl="{row}">
<div class="tdesign-demo-image-viewer__base">
<t-image-viewer :images="[row.imageUrl]">
<template #trigger="{ open }">
<div class="tdesign-demo-image-viewer__ui-image">
<img alt="test" :src="row.imageUrl" class="tdesign-demo-image-viewer__ui-image--img" />
<div class="tdesign-demo-image-viewer__ui-image--hover" @click="open">
<span><BrowseIcon size="1.4em" /> 预览</span>
</div>
</div>
</template>
</t-image-viewer>
</div>
<template #imageUrl="{ row }">
<ImagePreviewer :url="row.imageUrl"/>
</template>
<template #status="{row}">
<template #status="{ row }">
<TSpace>
<TTag :theme="row.status === 'active' ? 'success' : 'danger'" variant="light">{{row.status === 'active' ? '显示中' : '已关闭'}}</TTag>
<TTag :theme="row.status === 'active' ? 'success' : 'danger'" variant="light">{{
row.status === 'active' ? '显示中' : '已关闭'
}}</TTag>
</TSpace>
</template>
<template #roles="{ row }">
<TSpace>
<TTag v-for="role in row.roles" :key="role.id" theme="success" variant="light">{{
role.label
}}</TTag>
role.label
}}</TTag>
</TSpace>
</template>
<template #operation="{ row }">
<TButton variant="text" size="small" theme="primary" @click="editClick(row)">编辑</TButton>
<TButton variant="text" size="small" theme="primary" @click="showClick(row)">{{ row.status === 'active' ? '关闭显示' : '开启显示'}}</TButton>
<TButton variant="text" size="small" theme="danger" @click="delClick(row)">删除</TButton>
<TButton variant="text" size="small" theme="primary" @click="handleEdit(row)">编辑</TButton>
<TButton variant="text" size="small" theme="primary" @click="handleShow(row)">{{
row.status === 'active' ? '关闭显示' : '开启显示'
}}</TButton>
<TButton variant="text" size="small" theme="danger" @click="handleDelete(row)">删除</TButton>
</template>
</TTable>
<CarousalDialog
@@ -148,60 +136,5 @@ const handleSuccessDialog = async () => {
</template>
<style scoped>
:deep(.t-card__body) {
flex: 1;
min-height: 0;
}
.tdesign-demo-image-viewer__ui-image {
width: 100%;
height: 100%;
display: inline-flex;
position: relative;
justify-content: center;
align-items: center;
border-radius: var(--td-radius-small);
overflow: hidden;
}
.tdesign-demo-image-viewer__ui-image--hover {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
left: 0;
top: 0;
opacity: 0;
background-color: rgba(0, 0, 0, 0.6);
color: var(--td-text-color-anti);
line-height: 22px;
transition: 0.2s;
}
.tdesign-demo-image-viewer__ui-image:hover .tdesign-demo-image-viewer__ui-image--hover {
opacity: 1;
cursor: pointer;
}
.tdesign-demo-image-viewer__ui-image--img {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
cursor: pointer;
position: absolute;
}
.tdesign-demo-image-viewer__ui-image--icons .tdesign-demo-icon {
cursor: pointer;
}
.tdesign-demo-image-viewer__base {
width: 100px;
height: 100px;
border: 4px solid var(--td-bg-color-secondarycontainer);
border-radius: var(--td-radius-medium);
}
</style>
@@ -1,33 +1,31 @@
<template>
<t-dialog
<TDialog
width="40%"
:header="header"
:confirmBtn="confirmBtn"
:header="headerText"
:confirmBtn="confirmBtnText"
:closeOnOverlayClick="false"
@close="handleCloseDialog"
@confirm="SaveCategoryData"
@close="handleClose"
@confirm="handleSave"
>
<t-space direction="vertical" style="width: 100%">
<TForm ref="form" :data="categoryData" :rules="rules" resetType="initial">
<TFormItem label="分类名称:" name="name" help="名称长度小于5个汉字,大于2个汉字">
<t-input v-model.trim="categoryData.name" clearable placeholder="请输入分类名称" />
</TFormItem>
<TFormItem label="分类编号:" name="code" help="编号由大于4个字符的英文字母组成">
<t-input v-model.trim="categoryData.code" clearable placeholder="请输入分类编号" />
</TFormItem>
<TFormItem label="排序级别:" name="order" help="排序级别由正整数组成">
<t-input-number
:min="0"
name="order"
theme="normal"
class="!w-full"
placeholder="请输入排序级别"
v-model.trim="categoryData.order"
></t-input-number>
</TFormItem>
</TForm>
</t-space>
</t-dialog>
<TForm ref="formRef" :data="categoryData" :rules="rules" resetType="initial">
<TFormItem label="分类名称:" name="name" help="名称长度小于5个汉字,大于2个汉字">
<t-input v-model.trim="categoryData.name" clearable placeholder="请输入分类名称" />
</TFormItem>
<TFormItem label="分类编号:" name="code" help="编号由大于4个字符的英文字母组成">
<t-input v-model.trim="categoryData.code" clearable placeholder="请输入分类编号" />
</TFormItem>
<TFormItem label="排序级别:" name="order" help="排序级别由正整数组成">
<t-input-number
:min="0"
name="order"
theme="normal"
class="!w-full"
placeholder="请输入排序级别"
v-model.trim="categoryData.order"
></t-input-number>
</TFormItem>
</TForm>
</TDialog>
</template>
<script lang="ts" setup>
import type { Category } from '@/model/category'
@@ -36,13 +34,12 @@ import { createCategoryRequest, updateCategoryByIdRequest } from '@/api/category
import type { FormInstanceFunctions, FormProps } from 'tdesign-vue-next'
import { MessagePlugin } from 'tdesign-vue-next'
const props = defineProps<{
isEdit?: Boolean | null
headerTitle?: String | null
category: Category | {}
headerTitle?: string
category: Category | null
}>()
const form = ref<FormInstanceFunctions | null>(null)
const header = computed(() => `${props.isEdit ? '编辑' : '创建'}${props.headerTitle || ''}`)
const confirmBtn = computed(() => (props.isEdit ? '保存' : '确定'))
const formRef = ref<FormInstanceFunctions | null>(null)
const headerText = computed(() => `${props.category ? '编辑' : '创建'}${props.headerTitle || ''}`)
const confirmBtnText = computed(() => (props.category ? '保存' : '确定'))
const categoryData: FormProps['data'] = reactive({ name: '', order: 1 })
const rules: FormProps['rules'] = {
name: [
@@ -52,16 +49,6 @@ const rules: FormProps['rules'] = {
type: 'error',
trigger: 'blur'
},
{
required: true,
message: '分类名称不能为空',
type: 'error',
trigger: 'change'
},
{
whitespace: true,
message: '分类名称不能为空'
},
{
min: 4,
message: '输入汉字长度应在2到5之间',
@@ -82,16 +69,6 @@ const rules: FormProps['rules'] = {
type: 'error',
trigger: 'blur'
},
{
required: true,
message: '分类编号不能为空',
type: 'error',
trigger: 'change'
},
{
whitespace: true,
message: '分类编号不能为空'
},
{
min: 4,
message: '输入字符应大于4个字符长度',
@@ -112,16 +89,6 @@ const rules: FormProps['rules'] = {
type: 'error',
trigger: 'blur'
},
{
required: true,
message: '排序级别不能为空',
type: 'error',
trigger: 'change'
},
{
whitespace: true,
message: '排序级别不能为空'
},
{
pattern: /^[1-9]\d*$/,
message: '排序级别必须为正整数',
@@ -140,27 +107,26 @@ watch(
const emit = defineEmits<{
success: [void]
}>()
const SaveCategoryData = async () => {
if (form.value) {
const valid = await form.value.validate()
if (valid && typeof valid === 'boolean') {
const { code, name, order, id } = categoryData
if (!props.isEdit) {
await createCategoryRequest({ code, name, order })
} else {
await updateCategoryByIdRequest(id, { code, name, order })
}
MessagePlugin.success(`${props.isEdit ? '编辑' : '创建'}分类成功`)
emit('success')
return
const handleSave = async () => {
if (!formRef.value) return
const valid = await formRef.value.validate()
if (valid === true) {
const { code, name, order, id } = categoryData
if (!props.category) {
await createCategoryRequest({ code, name, order })
} else {
await updateCategoryByIdRequest(id, { code, name, order })
}
MessagePlugin.success(`${props.category ? '编辑' : '创建'}分类成功`)
emit('success')
}
}
const handleCloseDialog = () => {
// 数据&&规则校验结果重置
if (form.value) {
form.value.reset()
form.value.clearValidate()
}
const handleClose = () => {
if (!formRef.value) return
formRef.value.reset()
formRef.value.clearValidate()
}
</script>
+5 -5
View File
@@ -2,7 +2,7 @@
import { onMounted, ref } from 'vue'
import type { Category, CategorySearchFilter } from '@/model/category'
import RegularPage from '@/components/RegularPage.vue'
import { searchCategoryRequest, deleteCategoryRequest } from '@/api/category'
import { searchCategories, deleteCategoryRequest } from '@/api/category'
import type { BaseTableColumns } from 'tdesign-vue-next'
import { useSearchable } from '@/composables/useSearchable'
import CategoryDialog from '@/pages/category/components/CategoryDialog.vue'
@@ -11,7 +11,7 @@ import { MessagePlugin } from 'tdesign-vue-next'
const { data, loading, pagination, onPageChange, fetchData } = useSearchable<
CategorySearchFilter,
Category
>(searchCategoryRequest)
>(searchCategories)
const columns: BaseTableColumns = [
{
title: '分类名称',
@@ -36,7 +36,7 @@ const columns: BaseTableColumns = [
]
const categoryDialogVisible = ref(false)
const isEdit = ref(false)
const currentTableData = ref<Category | {}>({})
const currentTableData = ref<Category | null>(null)
onMounted(fetchData)
const editClick = (category: Category) => {
isEdit.value = true
@@ -49,8 +49,9 @@ const handleCategoryDialogSuccess = () => {
}
const handleCategoryDialogClosed = () => {
isEdit.value = false
currentTableData.value = {}
currentTableData.value = null
}
const deleteCategoryClick = async (id: string) => {
await deleteCategoryRequest(id)
fetchData()
@@ -97,7 +98,6 @@ const deleteCategoryClick = async (id: string) => {
</TTable>
<CategoryDialog
headerTitle="分类"
:isEdit="isEdit"
:category="currentTableData"
v-model:visible="categoryDialogVisible"
@closed="handleCategoryDialogClosed"
+2 -2
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { uploadFile } from '@/api/file'
import { uploadFileOld } from '@/api/file'
import { ref, watch } from 'vue'
import type { UploadFile } from 'tdesign-vue-next'
@@ -37,7 +37,7 @@ watch(() => props.modelValue, (value) => {
</script>
<template>
<TUpload theme="image" accept="image/jpeg,image/png" :request-method="uploadFile" v-model="fileList">
<TUpload theme="image" accept="image/jpeg,image/png" :request-method="uploadFileOld" v-model="fileList">
</TUpload>
</template>
@@ -0,0 +1,72 @@
<script setup lang="ts">
import type { PetVariety } from '@/model/pet-variety'
import { type FormInstanceFunctions, type FormRules, MessagePlugin } from 'tdesign-vue-next'
import { createPetVariety, editPetVariety } from '@/api/petVariety'
const props = defineProps<{
data: PetVariety | null
}>()
const formData = ref<{
name: string
}>({
name: ''
})
watch(
() => props.data,
(newData) => {
if (newData) {
formData.value = newData
}
}
)
const rules: FormRules<{ name: string }> = {
name: [
{
required: true,
message: '品种名称不能为空'
}
],
}
const formRef = ref<FormInstanceFunctions | null>(null)
const emits = defineEmits<{
success: [void]
}>()
const editId = computed(() => props.data?.id)
const handleSave = async () => {
const validate = await formRef.value?.validate()
if (validate !== true) return
try {
editId.value
? await editPetVariety(editId.value, formData.value.name)
: await createPetVariety(formData.value.name)
await MessagePlugin.success(`${editId.value ? '编辑' : '创建'}成功`)
emits('success')
} finally {
formRef.value?.reset()
}
}
</script>
<template>
<TDialog @confirm="handleSave">
<TForm ref="formRef" :data="formData" :rules="rules" resetType="initial">
<TFormItem label="宠物品种名称" name="name">
<TInput v-model.trim="formData.name" clearable placeholder="请输入宠物品种名称" />
</TFormItem>
</TForm>
</TDialog>
</template>
<style scoped></style>
+118
View File
@@ -0,0 +1,118 @@
<script setup lang="ts">
import { onMounted } from 'vue'
import RegularPage from '@/components/RegularPage.vue'
import { type BaseTableColumns, MessagePlugin } from 'tdesign-vue-next'
import { useSearchable } from '@/composables/useSearchable'
import { deleteProduct } from '@/api/product'
import type { Product } from '@/model/product'
import ProductDialog from '@/pages/product/components/ProductDialog.vue'
import ImagePreviewer from '@/components/ImagePreviewer.vue'
import type { PetVariety, SearchPetVarietyFilter } from '@/model/pet-variety'
import { deletePetVariety, searchPetVarieties } from '@/api/petVariety'
import PetVarietyDialog from '@/pages/pet-variety/components/PetVarietyDialog.vue'
const { data, loading, pagination, onPageChange, fetchData } = useSearchable<
SearchPetVarietyFilter,
PetVariety
>(searchPetVarieties)
const columns: BaseTableColumns = [
{
title: '品种名称',
colKey: 'name',
},
{
title: '创建时间',
colKey: 'createdTime',
},
{
title: '操作',
colKey: 'operation',
}
]
onMounted(fetchData)
const productDialogVisible = ref(false)
const editData = ref<PetVariety | null>(null)
const handleEdit = (data: PetVariety) => {
editData.value = data
productDialogVisible.value = true
}
const handleDelete = async (id: string) => {
loading.value = true
try {
await deletePetVariety(id)
await fetchData()
await MessagePlugin.success('删除成功')
} catch (e) {
await MessagePlugin.error('删除失败')
}finally {
loading.value = false
}
}
const handleSuccess = async () => {
await fetchData()
productDialogVisible.value = false
editData.value = null
}
const handleClose = () => {
editData.value = null
}
</script>
<template>
<RegularPage title="宠物品种">
<template #right-area>
<TButton @click="productDialogVisible = true">添加品种</TButton>
</template>
<TTable
class="w-full h-full"
row-key="id"
height="92%"
table-layout="auto"
:data="data"
:loading="loading"
:columns="columns"
cell-empty-content="-"
:paginationAffixedBottom="true"
:pagination="{
total: pagination.total,
current: pagination.page,
pageSize: pagination.size,
onChange: onPageChange
}"
>
<template #operation="{ row }">
<TSpace :size="1">
<TButton variant="text" size="small" theme="primary" @click="() => handleEdit(row)"
>编辑</TButton
>
<t-popconfirm
theme="default"
content="确定删除此品种吗?"
@confirm="() => handleDelete(row.id)"
>
<TButton variant="text" size="small" theme="danger">删除</TButton>
</t-popconfirm>
</TSpace>
</template>
</TTable>
<PetVarietyDialog v-model:visible="productDialogVisible" :data="editData" @success="handleSuccess" @close="handleClose"></PetVarietyDialog>
</RegularPage>
</template>
<style scoped>
</style>
@@ -0,0 +1,217 @@
<script setup lang="ts">
import { type CreateProductRequest, type Product, ProductCategory, productCategoryOptions } from '@/model/product'
import { type FormInstanceFunctions, type FormRules, MessagePlugin } from 'tdesign-vue-next'
import ImageUpload from '@/components/ImageUpload.vue'
import { createProduct, editProduct } from '@/api/product'
const props = defineProps<{
data: Product | null
}>()
const defaultData: CreateProductRequest = {
name: '',
photo: '',
category: ProductCategory.DRY_FOOD,
tags: [],
totalWeight: 0,
protein: 0,
fat: 0,
fiber: 0,
ash: 0,
moisture: 0,
meValue: undefined
}
const formData = ref<CreateProductRequest>(defaultData)
watch(
() => props.data,
(newData) => {
if (newData) {
// @ts-ignore
const existCategory = productCategoryOptions.find((item) => item.label === newData.category)
formData.value = {
name: newData.name,
category: existCategory ? existCategory.value : ProductCategory.DRY_FOOD,
photo: newData.photo,
tags: newData.tags,
protein: newData.protein,
fat: newData.fat,
fiber: newData.fiber,
ash: newData.ash,
moisture: newData.moisture,
totalWeight: newData.totalWeight,
meValue: newData.meValue ?? undefined,
}
} else {
formData.value = defaultData
}
}
)
const rules: FormRules<CreateProductRequest> = {
name: [
{
required: true,
message: '产品名称不能为空'
}
],
photo: [
{
required: true,
message: '产品图片不能为空'
}
],
totalWeight: [
{
required: true,
message: '净重量不能为空'
}
],
protein: [
{
required: true,
message: '蛋白质不能为空'
}
],
fat: [
{
required: true,
message: '脂肪不能为空'
}
],
fiber: [
{
required: true,
message: '纤维不能为空'
}
],
ash: [
{
required: true,
message: '粗灰分不能为空'
}
],
moisture: [
{
required: true,
message: '水分不能为空'
}
]
}
const formRef = ref<FormInstanceFunctions | null>(null)
const emits = defineEmits<{
success: [void]
}>()
const editId = computed(() => props.data?.id)
const handleSave = async () => {
const validate = await formRef.value?.validate()
if (validate !== true) return
try {
editId.value
? await editProduct(editId.value, formData.value)
: await createProduct(formData.value)
await MessagePlugin.success(`${editId.value ? '编辑' : '创建'}成功`)
emits('success')
} finally {
formRef.value?.reset()
}
}
</script>
<template>
<TDialog @confirm="handleSave">
<TForm ref="formRef" :data="formData" :rules="rules" resetType="initial">
<TFormItem label="产品名称" name="name">
<TInput v-model.trim="formData.name" clearable placeholder="请输入产品名称" />
</TFormItem>
<TFormItem label="产品分类" name="category">
<TSelect v-model="formData.category" :options="productCategoryOptions" />
</TFormItem>
<TFormItem label="产品名称" name="photo">
<ImageUpload v-model="formData.photo" />
</TFormItem>
<TFormItem label="产品标签" name="tags">
<TTagInput v-model="formData.tags" clearable placeholder="请输入产品标签" />
</TFormItem>
<TFormItem label="净重量" name="totalWeight">
<TInputNumber
v-model="formData.totalWeight"
clearable
placeholder="请输入净重量"
theme="normal"
align="right"
suffix="g"
></TInputNumber>
</TFormItem>
<TFormItem label="蛋白质" name="protein">
<TInputNumber
v-model="formData.protein"
clearable
placeholder="请输入蛋白质含比"
theme="normal"
align="right"
suffix="%"
></TInputNumber>
</TFormItem>
<TFormItem label="脂肪" name="fat">
<TInputNumber
v-model="formData.fat"
clearable
placeholder="请输入脂肪含比"
theme="normal"
align="right"
suffix="%"
></TInputNumber>
</TFormItem>
<TFormItem label="纤维" name="fiber">
<TInputNumber
v-model="formData.fiber"
clearable
placeholder="请输入纤维含比"
theme="normal"
align="right"
suffix="%"
></TInputNumber>
</TFormItem>
<TFormItem label="粗灰分" name="ash">
<TInputNumber
v-model="formData.ash"
clearable
placeholder="请输入粗灰分含比"
theme="normal"
align="right"
suffix="%"
></TInputNumber>
</TFormItem>
<TFormItem label="水分" name="moisture">
<TInputNumber
v-model="formData.moisture"
clearable
placeholder="请输入水分含比"
theme="normal"
align="right"
suffix="%"
></TInputNumber>
</TFormItem>
<TFormItem label="ME值" name="meValue" help="可选项,直接配置每克产品的代谢能(kcal/g)。如果填写则优先使用此值,否则通过营养成分自动计算">
<TInputNumber
v-model="formData.meValue"
clearable
placeholder="请输入ME值(可选)"
theme="normal"
align="right"
suffix="kcal/g"
:decimalPlaces="2"
:min="0"
></TInputNumber>
</TFormItem>
</TForm>
</TDialog>
</template>
<style scoped></style>
+179
View File
@@ -0,0 +1,179 @@
<script setup lang="ts">
import { onMounted } from 'vue'
import RegularPage from '@/components/RegularPage.vue'
import { type BaseTableColumns, MessagePlugin } from 'tdesign-vue-next'
import { useSearchable } from '@/composables/useSearchable'
import { deleteProduct, searchProducts } from '@/api/product'
import type { Product, SearchProductFilter } from '@/model/product'
import ProductDialog from '@/pages/product/components/ProductDialog.vue'
import ImagePreviewer from '@/components/ImagePreviewer.vue'
const { data, loading, pagination, onPageChange, fetchData } = useSearchable<
SearchProductFilter,
Product
>(searchProducts)
const columns: BaseTableColumns = [
{
title: '产品名称',
colKey: 'name',
},
{
title: '产品分类',
colKey: 'category',
},
{
title: '产品图片',
colKey: 'photo',
},
{
title: '产品标签',
colKey: 'tags',
},
{
title: '净重',
colKey: 'totalWeight',
},
{
title: 'ME值',
colKey: 'meValue',
},
{
title: '总能量',
colKey: 'totalCalories',
},
{
title: '蛋白质',
colKey: 'protein',
},
{
title: '脂肪',
colKey: 'fat',
},
{
title: '纤维',
colKey: 'fiber',
},
{
title: '粗灰分',
colKey: 'ash',
},
{
title: '水分',
colKey: 'moisture',
},
{
title: '创建时间',
colKey: 'createdTime',
},
{
title: '操作',
colKey: 'operation',
}
]
onMounted(fetchData)
const productDialogVisible = ref(false)
const editData = ref<Product | null>(null)
const handleEdit = (data: Product) => {
editData.value = data
productDialogVisible.value = true
}
const handleDelete = async (id: string) => {
loading.value = true
try {
await deleteProduct(id)
await fetchData()
await MessagePlugin.success('删除成功')
} catch (e) {
await MessagePlugin.error('删除失败')
}finally {
loading.value = false
}
}
const handleSuccess = async () => {
await fetchData()
productDialogVisible.value = false
editData.value = null
}
const handleClose = () => {
editData.value = null
}
</script>
<template>
<RegularPage title="产品管理">
<template #right-area>
<TButton @click="productDialogVisible = true">创建产品</TButton>
</template>
<TTable
class="w-full h-full"
row-key="id"
height="92%"
table-layout="auto"
:data="data"
:loading="loading"
:columns="columns"
cell-empty-content="-"
:paginationAffixedBottom="true"
:pagination="{
total: pagination.total,
current: pagination.page,
pageSize: pagination.size,
onChange: onPageChange
}"
>
<template #photo="{ row }">
<ImagePreviewer :url="row.photo"/>
</template>
<template #tags="{ row }">
<TSpace>
<TTag v-for="tag in row.tags" :key="tag">{{ tag }}</TTag>
</TSpace>
</template>
<template #totalWeight="{ row }">
{{ row.totalWeight }}g
</template>
<template #meValue="{ row }">
<span v-if="row.meValue">{{ row.meValue }} kcal/g</span>
<span v-else class="text-gray-400">自动计算</span>
</template>
<template #totalCalories="{ row }">
{{ row.totalCalories }}kcal
</template>
<template #operation="{ row }">
<TSpace :size="1">
<TButton variant="text" size="small" theme="primary" @click="() => handleEdit(row)"
>编辑</TButton
>
<t-popconfirm
theme="default"
content="确定删除此产品吗?"
@confirm="() => handleDelete(row.id)"
>
<TButton variant="text" size="small" theme="danger">删除</TButton>
</t-popconfirm>
</TSpace>
</template>
</TTable>
<ProductDialog v-model:visible="productDialogVisible" :data="editData" @success="handleSuccess" @close="handleClose"></ProductDialog>
</RegularPage>
</template>
<style scoped>
</style>
@@ -13,8 +13,8 @@ const props = defineProps<{
const roles = ref<string[]>([])
watch(() => props.user, (user) => {
if (user) {
roles.value = user.roles.map(role => role.name)
if (user && user.roles) {
roles.value = user.roles.map((role: Role) => role.name)
}
})
@@ -52,7 +52,7 @@ const handleConfirm = async () => {
<TDialog>
<TForm v-if="user">
<TFormItem label="用户">
<div>{{ user.name }}</div>
<div>{{ user.name || user.username }}</div>
</TFormItem>
<TFormItem label="角色">
<TSelect v-model="roles" :options="options" multiple></TSelect>
+1 -1
View File
@@ -79,7 +79,7 @@ const handleRoleSettingSuccess = () => {
<TFormItem label="手机号码">
<TInput placeholder="请输入需要搜索的用户姓名"></TInput>
</TFormItem>
</TCol>
</TCol>7
<TCol :span="3">
<TFormItem label="手机号码">
<TInput placeholder="请输入需要搜索的用户姓名"></TInput>
+28 -1
View File
@@ -14,15 +14,42 @@ export const asyncRoutes: RouteRecordRaw[] = [
icon: 'system-3'
}
},
{
name: 'article',
path: 'article',
component: () => import('@/pages/article/index.vue'),
meta: {
title: '咨询管理',
icon: 'collection'
}
},
{
name: 'carousal',
path: 'carousal',
component: () => import('@/pages/carousal/index.vue'),
meta: {
title: '轮播图管理',
icon: 'system-3'
icon: 'image'
}
},
{
name: 'product',
path: 'product',
meta: {
title: '产品管理',
icon: 'shop'
},
component: () => import('@/pages/product/index.vue')
},
{
name: 'pet-variety',
path: 'pet-variety',
meta: {
title: '宠物品种',
icon: 'cat'
},
component: () => import('@/pages/pet-variety/index.vue')
}
]
const router = createRouter({
-1
View File
@@ -11,7 +11,6 @@
"composite": true,
"noEmit": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"module": "ESNext",
"moduleResolution": "Bundler",
"types": ["node"]