update
This commit is contained in:
parent
db936079bb
commit
004726f422
472
package-lock.json
generated
472
package-lock.json
generated
@ -10,8 +10,6 @@
|
||||
"dependencies": {
|
||||
"@ant-design/icons-vue": "^7.0.1",
|
||||
"@vue/cli-service": "^5.0.8",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"ant-design-vue": "^3.2.20",
|
||||
"axios": "^1.7.9",
|
||||
"marked": "^15.0.7",
|
||||
@ -931,11 +929,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@transloadit/prettier-bytes": {
|
||||
"version": "0.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@transloadit/prettier-bytes/-/prettier-bytes-0.0.7.tgz",
|
||||
"integrity": "sha512-VeJbUb0wEKbcwaSlj5n+LscBl9IPgLPkHVGBkh00cztv6X4L/TJXK58LzFuBKX7/GAfiGhIwH67YTLTlzvIzBA=="
|
||||
},
|
||||
"node_modules/@trysound/sax": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",
|
||||
@ -1017,11 +1010,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/event-emitter": {
|
||||
"version": "0.3.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/event-emitter/-/event-emitter-0.3.5.tgz",
|
||||
"integrity": "sha512-zx2/Gg0Eg7gwEiOIIh5w9TrhKKTeQh7CPCOPNc0el4pLSwzebA8SmnHwZs2dWlLONvyulykSwGSQxQHLhjGLvQ=="
|
||||
},
|
||||
"node_modules/@types/express": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz",
|
||||
@ -1233,56 +1221,6 @@
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@uppy/companion-client": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/@uppy/companion-client/-/companion-client-2.2.2.tgz",
|
||||
"integrity": "sha512-5mTp2iq97/mYSisMaBtFRry6PTgZA6SIL7LePteOV5x0/DxKfrZW3DEiQERJmYpHzy7k8johpm2gHnEKto56Og==",
|
||||
"dependencies": {
|
||||
"@uppy/utils": "^4.1.2",
|
||||
"namespace-emitter": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@uppy/core": {
|
||||
"version": "2.3.4",
|
||||
"resolved": "https://registry.npmjs.org/@uppy/core/-/core-2.3.4.tgz",
|
||||
"integrity": "sha512-iWAqppC8FD8mMVqewavCz+TNaet6HPXitmGXpGGREGrakZ4FeuWytVdrelydzTdXx6vVKkOmI2FLztGg73sENQ==",
|
||||
"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.1.25",
|
||||
"preact": "^10.5.13"
|
||||
}
|
||||
},
|
||||
"node_modules/@uppy/store-default": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@uppy/store-default/-/store-default-2.1.1.tgz",
|
||||
"integrity": "sha512-xnpTxvot2SeAwGwbvmJ899ASk5tYXhmZzD/aCFsXePh/v8rNvR2pKlcQUH7cF/y4baUGq3FHO/daKCok/mpKqQ=="
|
||||
},
|
||||
"node_modules/@uppy/utils": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-4.1.3.tgz",
|
||||
"integrity": "sha512-nTuMvwWYobnJcytDO3t+D6IkVq/Qs4Xv3vyoEZ+Iaf8gegZP+rEyoaFT2CK5XLRMienPyqRqNbIfRuFaOWSIFw==",
|
||||
"dependencies": {
|
||||
"lodash.throttle": "^4.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@uppy/xhr-upload": {
|
||||
"version": "2.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@uppy/xhr-upload/-/xhr-upload-2.1.3.tgz",
|
||||
"integrity": "sha512-YWOQ6myBVPs+mhNjfdWsQyMRWUlrDLMoaG7nvf/G6Y3GKZf8AyjFDjvvJ49XWQ+DaZOftGkHmF1uh/DBeGivJQ==",
|
||||
"dependencies": {
|
||||
"@uppy/companion-client": "^2.2.2",
|
||||
"@uppy/utils": "^4.1.2",
|
||||
"nanoid": "^3.1.25"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "^2.3.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@vavt/util": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vavt/util/-/util-2.1.0.tgz",
|
||||
@ -1709,156 +1647,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@wangeditor/basic-modules": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/basic-modules/-/basic-modules-1.1.7.tgz",
|
||||
"integrity": "sha512-cY9CPkLJaqF05STqfpZKWG4LpxTMeGSIIF1fHvfm/mz+JXatCagjdkbxdikOuKYlxDdeqvOeBmsUBItufDLXZg==",
|
||||
"dependencies": {
|
||||
"is-url": "^1.2.4"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"node_modules/@wangeditor/code-highlight": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/code-highlight/-/code-highlight-1.0.3.tgz",
|
||||
"integrity": "sha512-iazHwO14XpCuIWJNTQTikqUhGKyqj+dUNWJ9288Oym9M2xMVHvnsOmDU2sgUDWVy+pOLojReMPgXCsvvNlOOhw==",
|
||||
"dependencies": {
|
||||
"prismjs": "^1.23.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@wangeditor/core": "1.x",
|
||||
"dom7": "^3.0.0",
|
||||
"slate": "^0.72.0",
|
||||
"snabbdom": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@wangeditor/core": {
|
||||
"version": "1.1.19",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/core/-/core-1.1.19.tgz",
|
||||
"integrity": "sha512-KevkB47+7GhVszyYF2pKGKtCSj/YzmClsD03C3zTt+9SR2XWT5T0e3yQqg8baZpcMvkjs1D8Dv4fk8ok/UaS2Q==",
|
||||
"dependencies": {
|
||||
"@types/event-emitter": "^0.3.3",
|
||||
"event-emitter": "^0.3.5",
|
||||
"html-void-elements": "^2.0.0",
|
||||
"i18next": "^20.4.0",
|
||||
"scroll-into-view-if-needed": "^2.2.28",
|
||||
"slate-history": "^0.66.0"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"node_modules/@wangeditor/editor": {
|
||||
"version": "5.1.23",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/editor/-/editor-5.1.23.tgz",
|
||||
"integrity": "sha512-0RxfeVTuK1tktUaPROnCoFfaHVJpRAIE2zdS0mpP+vq1axVQpLjM8+fCvKzqYIkH0Pg+C+44hJpe3VVroSkEuQ==",
|
||||
"dependencies": {
|
||||
"@uppy/core": "^2.1.1",
|
||||
"@uppy/xhr-upload": "^2.0.3",
|
||||
"@wangeditor/basic-modules": "^1.1.7",
|
||||
"@wangeditor/code-highlight": "^1.0.3",
|
||||
"@wangeditor/core": "^1.1.19",
|
||||
"@wangeditor/list-module": "^1.0.5",
|
||||
"@wangeditor/table-module": "^1.1.4",
|
||||
"@wangeditor/upload-image-module": "^1.0.2",
|
||||
"@wangeditor/video-module": "^1.1.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.2.0",
|
||||
"slate": "^0.72.0",
|
||||
"snabbdom": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@wangeditor/editor-for-vue": {
|
||||
"version": "5.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/editor-for-vue/-/editor-for-vue-5.1.12.tgz",
|
||||
"integrity": "sha512-0Ds3D8I+xnpNWezAeO7HmPRgTfUxHLMd9JKcIw+QzvSmhC5xUHbpCcLU+KLmeBKTR/zffnS5GQo6qi3GhTMJWQ==",
|
||||
"peerDependencies": {
|
||||
"@wangeditor/editor": ">=5.1.0",
|
||||
"vue": "^3.0.5"
|
||||
}
|
||||
},
|
||||
"node_modules/@wangeditor/list-module": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/list-module/-/list-module-1.0.5.tgz",
|
||||
"integrity": "sha512-uDuYTP6DVhcYf7mF1pTlmNn5jOb4QtcVhYwSSAkyg09zqxI1qBqsfUnveeDeDqIuptSJhkh81cyxi+MF8sEPOQ==",
|
||||
"peerDependencies": {
|
||||
"@wangeditor/core": "1.x",
|
||||
"dom7": "^3.0.0",
|
||||
"slate": "^0.72.0",
|
||||
"snabbdom": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@wangeditor/table-module": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/table-module/-/table-module-1.1.4.tgz",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"node_modules/@wangeditor/upload-image-module": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/upload-image-module/-/upload-image-module-1.0.2.tgz",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"node_modules/@wangeditor/video-module": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@wangeditor/video-module/-/video-module-1.1.4.tgz",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"node_modules/@webassemblyjs/ast": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz",
|
||||
@ -3574,18 +3362,6 @@
|
||||
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/d": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/d/-/d-1.0.2.tgz",
|
||||
"integrity": "sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==",
|
||||
"dependencies": {
|
||||
"es5-ext": "^0.10.64",
|
||||
"type": "^2.7.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
}
|
||||
},
|
||||
"node_modules/dayjs": {
|
||||
"version": "1.11.13",
|
||||
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz",
|
||||
@ -3900,14 +3676,6 @@
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/dom7": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dom7/-/dom7-3.0.0.tgz",
|
||||
"integrity": "sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==",
|
||||
"dependencies": {
|
||||
"ssr-window": "^3.0.0-alpha.1"
|
||||
}
|
||||
},
|
||||
"node_modules/domelementtype": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz",
|
||||
@ -4163,43 +3931,6 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/es5-ext": {
|
||||
"version": "0.10.64",
|
||||
"resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz",
|
||||
"integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"es6-iterator": "^2.0.3",
|
||||
"es6-symbol": "^3.1.3",
|
||||
"esniff": "^2.0.1",
|
||||
"next-tick": "^1.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/es6-iterator": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
|
||||
"integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
|
||||
"dependencies": {
|
||||
"d": "1",
|
||||
"es5-ext": "^0.10.35",
|
||||
"es6-symbol": "^3.1.1"
|
||||
}
|
||||
},
|
||||
"node_modules/es6-symbol": {
|
||||
"version": "3.1.4",
|
||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.4.tgz",
|
||||
"integrity": "sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==",
|
||||
"dependencies": {
|
||||
"d": "^1.0.2",
|
||||
"ext": "^1.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
|
||||
@ -4241,20 +3972,6 @@
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/esniff": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz",
|
||||
"integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==",
|
||||
"dependencies": {
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.62",
|
||||
"event-emitter": "^0.3.5",
|
||||
"type": "^2.7.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/esrecurse": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
|
||||
@ -4304,15 +4021,6 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/event-emitter": {
|
||||
"version": "0.3.5",
|
||||
"resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
|
||||
"integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
|
||||
"dependencies": {
|
||||
"d": "1",
|
||||
"es5-ext": "~0.10.14"
|
||||
}
|
||||
},
|
||||
"node_modules/event-pubsub": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/event-pubsub/-/event-pubsub-4.3.0.tgz",
|
||||
@ -4423,14 +4131,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/ext": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
|
||||
"integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
|
||||
"dependencies": {
|
||||
"type": "^2.7.2"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-deep-equal": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
|
||||
@ -5054,15 +4754,6 @@
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/html-void-elements": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-2.0.1.tgz",
|
||||
"integrity": "sha512-0quDb7s97CfemeJAnW9wC0hw78MtW7NU3hqtCD75g2vFlDLt36llsYD7uB7SUzojLMP24N5IatXf7ylGXiGG9A==",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/html-webpack-plugin": {
|
||||
"version": "5.6.3",
|
||||
"resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.3.tgz",
|
||||
@ -5207,14 +4898,6 @@
|
||||
"node": ">=10.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/i18next": {
|
||||
"version": "20.6.1",
|
||||
"resolved": "https://registry.npmjs.org/i18next/-/i18next-20.6.1.tgz",
|
||||
"integrity": "sha512-yCMYTMEJ9ihCwEQQ3phLo7I/Pwycf8uAx+sRHwwk5U9Aui/IZYgQRyMqXafQOw5QQ7DM1Z+WyEXWIqSuJHhG2A==",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.4.24",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
||||
@ -5286,15 +4969,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/immer": {
|
||||
"version": "9.0.21",
|
||||
"resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz",
|
||||
"integrity": "sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/immer"
|
||||
}
|
||||
},
|
||||
"node_modules/import-fresh": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
|
||||
@ -5436,11 +5110,6 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/is-hotkey": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/is-hotkey/-/is-hotkey-0.2.0.tgz",
|
||||
"integrity": "sha512-UknnZK4RakDmTgz4PI1wIph5yxSs/mvChWs9ifnlXsKuXgWmOkY/hAE0H/k2MIqH0RlRye0i1oC07MCRSD28Mw=="
|
||||
},
|
||||
"node_modules/is-interactive": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz",
|
||||
@ -5506,11 +5175,6 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-url": {
|
||||
"version": "1.2.4",
|
||||
"resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz",
|
||||
"integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww=="
|
||||
},
|
||||
"node_modules/is-what": {
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmjs.org/is-what/-/is-what-3.14.1.tgz",
|
||||
@ -5864,21 +5528,6 @@
|
||||
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.camelcase": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
|
||||
"integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA=="
|
||||
},
|
||||
"node_modules/lodash.clonedeep": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
|
||||
"integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ=="
|
||||
},
|
||||
"node_modules/lodash.debounce": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz",
|
||||
"integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow=="
|
||||
},
|
||||
"node_modules/lodash.defaultsdeep": {
|
||||
"version": "4.6.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash.defaultsdeep/-/lodash.defaultsdeep-4.6.1.tgz",
|
||||
@ -5886,17 +5535,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.foreach": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-4.5.0.tgz",
|
||||
"integrity": "sha512-aEXTF4d+m05rVOAUG3z4vZZ4xVexLKZGF0lIxuHZ1Hplpk/3B6Z1+/ICICYRLm7c41Z2xiejbkCkJoTlypoXhQ=="
|
||||
},
|
||||
"node_modules/lodash.isequal": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
||||
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
|
||||
"deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead."
|
||||
},
|
||||
"node_modules/lodash.mapvalues": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz",
|
||||
@ -5911,16 +5549,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/lodash.throttle": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz",
|
||||
"integrity": "sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ=="
|
||||
},
|
||||
"node_modules/lodash.toarray": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz",
|
||||
"integrity": "sha512-QyffEA3i5dma5q2490+SgCvDN0pXLmRGSyAANuVi0HQ01Pkfr9fuoKQW8wm1wGBnJITs/mS7wQvS6VshUEBFCw=="
|
||||
},
|
||||
"node_modules/lodash.uniq": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz",
|
||||
@ -6364,19 +5992,6 @@
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/mime-match/-/mime-match-1.0.2.tgz",
|
||||
"integrity": "sha512-VXp/ugGDVh3eCLOBCiHZMYWQaTNUHv2IJrut+yXA6+JbLPXHglHwfS/5A5L0ll+jkCY7fIzRJcH6OIunF+c6Cg==",
|
||||
"dependencies": {
|
||||
"wildcard": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-match/node_modules/wildcard": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/wildcard/-/wildcard-1.1.2.tgz",
|
||||
"integrity": "sha512-DXukZJxpHA8LuotRwL0pP1+rS6CS7FF2qStDDE1C7DDg2rLud2PXRMuEDYIPhgEezwnlHNL4c+N6MfMTjCGTng=="
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
|
||||
@ -6590,11 +6205,6 @@
|
||||
"thenify-all": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/namespace-emitter": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/namespace-emitter/-/namespace-emitter-2.0.1.tgz",
|
||||
"integrity": "sha512-N/sMKHniSDJBjfrkbS/tpkPj4RAbvW3mr8UAzvlMHyun93XEm83IAvhWtJVHo+RHn/oO8Job5YN4b+wRjSVp5g=="
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.8",
|
||||
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz",
|
||||
@ -6668,11 +6278,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/next-tick": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
|
||||
"integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ=="
|
||||
},
|
||||
"node_modules/nice-try": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||
@ -7843,15 +7448,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/preact": {
|
||||
"version": "10.26.4",
|
||||
"resolved": "https://registry.npmjs.org/preact/-/preact-10.26.4.tgz",
|
||||
"integrity": "sha512-KJhO7LBFTjP71d83trW+Ilnjbo+ySsaAgCfXOXUlmGzJ4ygYPWmysm77yg4emwfmoz3b22yvH5IsVFHbhUaH5w==",
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/preact"
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "2.8.8",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
|
||||
@ -7880,14 +7476,6 @@
|
||||
"renderkid": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/prismjs": {
|
||||
"version": "1.30.0",
|
||||
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz",
|
||||
"integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/process-nextick-args": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
@ -8807,51 +8395,6 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/slate": {
|
||||
"version": "0.72.8",
|
||||
"resolved": "https://registry.npmjs.org/slate/-/slate-0.72.8.tgz",
|
||||
"integrity": "sha512-/nJwTswQgnRurpK+bGJFH1oM7naD5qDmHd89JyiKNT2oOKD8marW0QSBtuFnwEbL5aGCS8AmrhXQgNOsn4osAw==",
|
||||
"dependencies": {
|
||||
"immer": "^9.0.6",
|
||||
"is-plain-object": "^5.0.0",
|
||||
"tiny-warning": "^1.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/slate-history": {
|
||||
"version": "0.66.0",
|
||||
"resolved": "https://registry.npmjs.org/slate-history/-/slate-history-0.66.0.tgz",
|
||||
"integrity": "sha512-6MWpxGQZiMvSINlCbMW43E2YBSVMCMCIwQfBzGssjWw4kb0qfvj0pIdblWNRQZD0hR6WHP+dHHgGSeVdMWzfng==",
|
||||
"dependencies": {
|
||||
"is-plain-object": "^5.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"slate": ">=0.65.3"
|
||||
}
|
||||
},
|
||||
"node_modules/slate-history/node_modules/is-plain-object": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/slate/node_modules/is-plain-object": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz",
|
||||
"integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/snabbdom": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/snabbdom/-/snabbdom-3.6.2.tgz",
|
||||
"integrity": "sha512-ig5qOnCDbugFntKi6c7Xlib8bA6xiJVk8O+WdFrV3wxbMqeHO0hXFQC4nAhPVWfZfi8255lcZkNhtIBINCc4+Q==",
|
||||
"engines": {
|
||||
"node": ">=12.17.0"
|
||||
}
|
||||
},
|
||||
"node_modules/sockjs": {
|
||||
"version": "0.3.24",
|
||||
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz",
|
||||
@ -8968,11 +8511,6 @@
|
||||
"wbuf": "^1.7.3"
|
||||
}
|
||||
},
|
||||
"node_modules/ssr-window": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-3.0.0.tgz",
|
||||
"integrity": "sha512-q+8UfWDg9Itrg0yWK7oe5p/XRCJpJF9OBtXfOPgSJl+u3Xd5KI328RUEvUqSMVM9CiQUEf1QdBzJMkYGErj9QA=="
|
||||
},
|
||||
"node_modules/ssri": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
|
||||
@ -9359,11 +8897,6 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tiny-warning": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
|
||||
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
|
||||
},
|
||||
"node_modules/to-regex-range": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||
@ -9424,11 +8957,6 @@
|
||||
"@mixmark-io/domino": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/type": {
|
||||
"version": "2.7.3",
|
||||
"resolved": "https://registry.npmjs.org/type/-/type-2.7.3.tgz",
|
||||
"integrity": "sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ=="
|
||||
},
|
||||
"node_modules/type-fest": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",
|
||||
|
||||
@ -5,8 +5,6 @@
|
||||
"dependencies": {
|
||||
"@ant-design/icons-vue": "^7.0.1",
|
||||
"@vue/cli-service": "^5.0.8",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
"ant-design-vue": "^3.2.20",
|
||||
"axios": "^1.7.9",
|
||||
"marked": "^15.0.7",
|
||||
|
||||
@ -309,10 +309,13 @@
|
||||
:label-col="{ span: 0 }"
|
||||
:wrapper-col="{ span: 24 }"
|
||||
>
|
||||
<div class="rich-editor-container" id="add-editor-container">
|
||||
<!-- wangEditor容器 -->
|
||||
</div>
|
||||
<div class="form-item-help">支持富文本编辑的商品详情介绍,最终将以Markdown格式保存</div>
|
||||
<md-editor
|
||||
v-model="formState.product_detail"
|
||||
:toolbars="toolbars"
|
||||
:height="450"
|
||||
previewTheme="github"
|
||||
:onUploadImg="editorConfig.onUploadImg"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
@ -547,10 +550,13 @@
|
||||
:label-col="{ span: 0 }"
|
||||
:wrapper-col="{ span: 24 }"
|
||||
>
|
||||
<div class="rich-editor-container" id="edit-editor-container">
|
||||
<!-- wangEditor容器 -->
|
||||
</div>
|
||||
<div class="form-item-help">支持富文本编辑的商品详情介绍,最终将以Markdown格式保存</div>
|
||||
<md-editor
|
||||
v-model="editFormState.product_detail"
|
||||
:toolbars="toolbars"
|
||||
:height="450"
|
||||
previewTheme="github"
|
||||
:onUploadImg="editorConfig.onUploadImg"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
@ -568,25 +574,53 @@ import PageContainer from '@/components/PageContainer.vue'
|
||||
import { getMerchantProducts, updateProductStatus } from '@/api/merchant'
|
||||
import request from '@/utils/request'
|
||||
import { PlusOutlined } from '@ant-design/icons-vue'
|
||||
// 导入wangEditor富文本编辑器
|
||||
import '@wangeditor/editor/dist/css/style.css'
|
||||
import { createEditor, createToolbar } from '@wangeditor/editor'
|
||||
import { markRaw } from 'vue'
|
||||
// 导入html-to-markdown转换工具
|
||||
import TurndownService from 'turndown'
|
||||
// 导入markdown-to-html转换工具
|
||||
import { marked } from 'marked'
|
||||
import { MdEditor } from 'md-editor-v3'
|
||||
import 'md-editor-v3/lib/style.css'
|
||||
import dayjs from 'dayjs'
|
||||
import 'dayjs/locale/zh-cn'
|
||||
|
||||
// 设置 dayjs 的默认语言为中文
|
||||
dayjs.locale('zh-cn')
|
||||
|
||||
// 创建turndown实例
|
||||
const turndownService = new TurndownService({
|
||||
headingStyle: 'atx',
|
||||
codeBlockStyle: 'fenced'
|
||||
})
|
||||
// 编辑器工具栏配置
|
||||
const toolbars = [
|
||||
'bold', 'underline', 'italic', 'strikethrough', 'title', 'quote', 'unordered-list', 'ordered-list',
|
||||
'task-list', 'indent', 'outdent', 'code', 'code-block', 'table', 'link', 'image', 'preview', 'full-screen'
|
||||
]
|
||||
|
||||
// 编辑器配置
|
||||
const editorConfig = {
|
||||
uploadImgUrl: '/api/upload/image',
|
||||
uploadImgName: 'file',
|
||||
uploadImgHeaders: {
|
||||
Authorization: localStorage.getItem('token') || ''
|
||||
},
|
||||
uploadImgAccept: 'image/*',
|
||||
uploadImgMaxSize: 10 * 1024 * 1024, // 10M
|
||||
uploadImgMaxLength: 1,
|
||||
onUploadImg: async (files, callback) => {
|
||||
try {
|
||||
const formData = new FormData()
|
||||
formData.append('file', files[0])
|
||||
|
||||
const res = await request.post('/api/upload/image', formData, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
}
|
||||
})
|
||||
|
||||
if (res.code === 200 && res.data && res.data.url) {
|
||||
callback([res.data.url])
|
||||
message.success('上传成功')
|
||||
} else {
|
||||
message.error('上传失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('上传图片失败:', error)
|
||||
message.error('上传失败')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ProductList',
|
||||
@ -607,7 +641,8 @@ export default defineComponent({
|
||||
ARadioGroup: Radio.Group,
|
||||
ARadioButton: Radio.Button,
|
||||
PlusOutlined,
|
||||
UploadOutlined
|
||||
UploadOutlined,
|
||||
MdEditor
|
||||
},
|
||||
setup() {
|
||||
const loading = ref(false)
|
||||
@ -677,7 +712,7 @@ export default defineComponent({
|
||||
pickup_time_to: '',
|
||||
delivery_date: null, // 自提日期
|
||||
delivery_time_type: 'IMMEDIATE', // 默认及时达
|
||||
product_detail: '<h1>商品详情</h1><p>这里是商品的详细描述,支持<strong>富文本</strong>格式。</p><ul><li>特点一</li><li>特点二</li><li>特点三</li></ul>',
|
||||
product_detail: '',
|
||||
purchase_note: ''
|
||||
})
|
||||
|
||||
@ -799,209 +834,33 @@ export default defineComponent({
|
||||
const editEditorRef = ref(null)
|
||||
|
||||
// 编辑器内容
|
||||
const editorContent = ref('<h1>商品详情</h1><p>这里是商品的详细描述,支持<strong>富文本</strong>格式。</p><ul><li>特点一</li><li>特点二</li><li>特点三</li></ul>')
|
||||
const editorContent = ref('')
|
||||
const editEditorContent = ref('')
|
||||
|
||||
// 编辑器配置
|
||||
const editorConfig = {
|
||||
placeholder: '请输入商品详情...',
|
||||
autoFocus: false,
|
||||
MENU_CONF: {
|
||||
uploadImage: {
|
||||
server: '/api/upload/images',
|
||||
fieldName: 'files',
|
||||
headers: {
|
||||
Authorization: localStorage.getItem('token') || ''
|
||||
},
|
||||
maxFileSize: 10 * 1024 * 1024, // 10M
|
||||
allowedFileTypes: ['image/*'],
|
||||
customInsert(res, insertFn) {
|
||||
if (res.code === 200 && res.data && res.data.urls && res.data.urls.length > 0) {
|
||||
insertFn(res.data.urls[0], '图片', res.data.urls[0])
|
||||
message.success('上传成功')
|
||||
} else {
|
||||
message.error('上传失败')
|
||||
}
|
||||
},
|
||||
onError(file, err, res) {
|
||||
console.error('上传图片失败:', err, res)
|
||||
message.error('上传图片失败')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 工具栏配置
|
||||
const toolbarConfig = {};
|
||||
|
||||
// 初始化编辑器的函数
|
||||
const initEditor = () => {
|
||||
// 创建添加商品的编辑器
|
||||
const addEditorContainer = document.getElementById('add-editor-container');
|
||||
if (addEditorContainer && !editorRef.value) {
|
||||
// 确保容器中没有子元素
|
||||
while (addEditorContainer.firstChild) {
|
||||
addEditorContainer.removeChild(addEditorContainer.firstChild);
|
||||
}
|
||||
|
||||
// 创建DOM元素
|
||||
const toolbarContainer = document.createElement('div');
|
||||
toolbarContainer.style.borderBottom = '1px solid #ccc';
|
||||
|
||||
const editorContainer = document.createElement('div');
|
||||
editorContainer.style.height = '450px';
|
||||
editorContainer.style.overflowY = 'auto';
|
||||
|
||||
addEditorContainer.appendChild(toolbarContainer);
|
||||
addEditorContainer.appendChild(editorContainer);
|
||||
|
||||
// 创建编辑器
|
||||
const editor = createEditor({
|
||||
selector: editorContainer,
|
||||
html: editorContent.value,
|
||||
config: editorConfig,
|
||||
mode: 'default'
|
||||
});
|
||||
|
||||
// 创建工具栏
|
||||
const toolbar = createToolbar({
|
||||
editor,
|
||||
selector: toolbarContainer,
|
||||
config: toolbarConfig,
|
||||
mode: 'default'
|
||||
});
|
||||
|
||||
// 存储编辑器实例
|
||||
editorRef.value = editor;
|
||||
|
||||
// 监听编辑器内容变化
|
||||
editor.on('change', () => {
|
||||
formState.value.product_detail = editor.getHtml();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化编辑模式的编辑器函数
|
||||
const initEditEditor = () => {
|
||||
// 创建编辑商品的编辑器
|
||||
const editEditorContainer = document.getElementById('edit-editor-container');
|
||||
if (editEditorContainer && !editEditorRef.value) {
|
||||
// 确保容器中没有子元素
|
||||
while (editEditorContainer.firstChild) {
|
||||
editEditorContainer.removeChild(editEditorContainer.firstChild);
|
||||
}
|
||||
|
||||
// 创建DOM元素
|
||||
const toolbarContainer = document.createElement('div');
|
||||
toolbarContainer.style.borderBottom = '1px solid #ccc';
|
||||
|
||||
const editorContainer = document.createElement('div');
|
||||
editorContainer.style.height = '450px';
|
||||
editorContainer.style.overflowY = 'auto';
|
||||
|
||||
editEditorContainer.appendChild(toolbarContainer);
|
||||
editEditorContainer.appendChild(editorContainer);
|
||||
|
||||
// 创建编辑器
|
||||
const editor = createEditor({
|
||||
selector: editorContainer,
|
||||
html: editFormState.value.product_detail || editEditorContent.value,
|
||||
config: editorConfig,
|
||||
mode: 'default'
|
||||
});
|
||||
|
||||
// 创建工具栏
|
||||
const toolbar = createToolbar({
|
||||
editor,
|
||||
selector: toolbarContainer,
|
||||
config: toolbarConfig,
|
||||
mode: 'default'
|
||||
});
|
||||
|
||||
// 存储编辑器实例
|
||||
editEditorRef.value = editor;
|
||||
|
||||
// 监听编辑器内容变化
|
||||
editor.on('change', () => {
|
||||
editFormState.value.product_detail = editor.getHtml();
|
||||
});
|
||||
}
|
||||
};
|
||||
const initEditor = () => {}
|
||||
const initEditEditor = () => {}
|
||||
|
||||
// HTML转换为Markdown的函数
|
||||
const htmlToMarkdown = (html) => {
|
||||
if (!html) return '';
|
||||
try {
|
||||
return turndownService.turndown(html);
|
||||
} catch (error) {
|
||||
console.error('HTML转Markdown失败:', error);
|
||||
return html; // 失败时返回原HTML
|
||||
}
|
||||
}
|
||||
|
||||
// Markdown转换为HTML的函数
|
||||
const markdownToHtml = (markdown) => {
|
||||
if (!markdown) return '';
|
||||
try {
|
||||
// 判断内容是否已经是HTML格式
|
||||
const isHTML = /<[a-z][\s\S]*>/i.test(markdown);
|
||||
if (isHTML) {
|
||||
return markdown; // 已经是HTML格式则直接返回
|
||||
}
|
||||
return marked(markdown);
|
||||
} catch (error) {
|
||||
console.error('Markdown转HTML失败:', error);
|
||||
return markdown; // 失败时返回原Markdown
|
||||
}
|
||||
}
|
||||
const htmlToMarkdown = (html) => html
|
||||
const markdownToHtml = (markdown) => markdown
|
||||
|
||||
// 监听模态框的显示状态
|
||||
watch(addModalVisible, (visible) => {
|
||||
if (visible) {
|
||||
// 模态框显示时重置为基本信息选项卡
|
||||
activeTabKey.value = 'basic';
|
||||
} else {
|
||||
// 模态框关闭时重置编辑器实例
|
||||
if (editorRef.value) {
|
||||
editorRef.value.destroy();
|
||||
editorRef.value = null;
|
||||
}
|
||||
activeTabKey.value = 'basic'
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// 监听编辑模态框的显示状态
|
||||
watch(editModalVisible, (visible) => {
|
||||
if (visible) {
|
||||
// 模态框显示时重置为基本信息选项卡
|
||||
editActiveTabKey.value = 'basic';
|
||||
} else {
|
||||
// 模态框关闭时重置编辑器实例
|
||||
if (editEditorRef.value) {
|
||||
editEditorRef.value.destroy();
|
||||
editEditorRef.value = null;
|
||||
}
|
||||
editActiveTabKey.value = 'basic'
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
// 确保在编辑器所在的选项卡激活时初始化编辑器
|
||||
watch([activeTabKey, editActiveTabKey], ([newActiveKey, newEditActiveKey]) => {
|
||||
// 添加模态框中,当切换到商品详情选项卡时
|
||||
if (newActiveKey === 'detail' && addModalVisible.value) {
|
||||
nextTick(() => {
|
||||
console.log('初始化添加模态框编辑器');
|
||||
initEditor();
|
||||
});
|
||||
}
|
||||
|
||||
// 编辑模态框中,当切换到商品详情选项卡时
|
||||
if (newEditActiveKey === 'detail' && editModalVisible.value) {
|
||||
nextTick(() => {
|
||||
console.log('初始化编辑模态框编辑器');
|
||||
initEditEditor();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 显示添加模态框
|
||||
const showAddModal = () => {
|
||||
addModalVisible.value = true
|
||||
@ -1012,61 +871,51 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
// 显示修改模态框时解析已有的pickup_time_from和pickup_time_to
|
||||
const handleEdit = (record) => {
|
||||
currentEditId.value = record.id
|
||||
|
||||
// 将后端返回的Markdown格式内容转换为HTML
|
||||
const productDetailHtml = record.product_detail ?
|
||||
markdownToHtml(record.product_detail) :
|
||||
'<h1>商品详情</h1><p>这里是商品的详细描述,支持<strong>富文本</strong>格式。</p><ul><li>特点一</li><li>特点二</li><li>特点三</li></ul>';
|
||||
|
||||
// 将时间字符串转换为dayjs对象
|
||||
console.log('原始自提时间数据:', record.pickup_time_from, record.pickup_time_to, record.delivery_time_type);
|
||||
|
||||
// 重置时间选择器
|
||||
editPickupTimeFrom.value = null;
|
||||
editPickupTimeTo.value = null;
|
||||
|
||||
editFormState.value = {
|
||||
operation_type: record.operation_type || 'MERCHANT',
|
||||
name: record.name,
|
||||
image_url: record.image_url,
|
||||
product_price: record.product_price,
|
||||
sale_price: record.sale_price,
|
||||
settlement_amount: record.settlement_amount,
|
||||
gift_points_rate: record.gift_points_rate,
|
||||
qty: record.qty || 0,
|
||||
delivery_time_type: record.delivery_time_type || 'IMMEDIATE',
|
||||
delivery_date: record.delivery_date ? dayjs(record.delivery_date) : null,
|
||||
product_detail: productDetailHtml,
|
||||
purchase_note: record.purchase_note || '',
|
||||
// 添加自提相关字段
|
||||
pickup_place: record.pickup_place || '',
|
||||
pickup_time_from: record.pickup_time_from || '',
|
||||
pickup_time_to: record.pickup_time_to || ''
|
||||
const handleEdit = async (record) => {
|
||||
try {
|
||||
currentEditId.value = record.id
|
||||
|
||||
// 获取商品详情
|
||||
const res = await request.get(`/api/merchant/product/${record.id}`)
|
||||
if (res.code === 200) {
|
||||
const productData = res.data
|
||||
|
||||
// 设置表单数据
|
||||
editFormState.value = {
|
||||
merchant_id: productData.merchant_id,
|
||||
operation_type: productData.operation_type,
|
||||
name: productData.name,
|
||||
image_url: productData.image_url,
|
||||
product_price: productData.product_price,
|
||||
sale_price: productData.sale_price,
|
||||
settlement_amount: productData.settlement_amount,
|
||||
gift_points_rate: productData.gift_points_rate,
|
||||
qty: productData.qty,
|
||||
delivery_time_type: productData.delivery_time_type,
|
||||
delivery_date: productData.delivery_date ? dayjs(productData.delivery_date) : null,
|
||||
pickup_place: productData.pickup_place || '',
|
||||
pickup_time_from: productData.pickup_time_from || '',
|
||||
pickup_time_to: productData.pickup_time_to || '',
|
||||
product_detail: productData.product_detail || '',
|
||||
purchase_note: productData.purchase_note || ''
|
||||
}
|
||||
|
||||
// 设置自提时间
|
||||
if (productData.pickup_time_from) {
|
||||
editPickupTimeFrom.value = dayjs(productData.pickup_time_from, 'HH:mm:ss')
|
||||
}
|
||||
if (productData.pickup_time_to) {
|
||||
editPickupTimeTo.value = dayjs(productData.pickup_time_to, 'HH:mm:ss')
|
||||
}
|
||||
|
||||
editModalVisible.value = true
|
||||
} else {
|
||||
message.error('获取商品详情失败')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载商品数据失败:', error)
|
||||
message.error('加载数据失败')
|
||||
}
|
||||
|
||||
// 更新编辑器内容
|
||||
editEditorContent.value = productDetailHtml;
|
||||
|
||||
editModalVisible.value = true
|
||||
|
||||
// 确保在显示模态框后,使用 nextTick 设置时间选择器的值
|
||||
nextTick(() => {
|
||||
// 设置基本选项卡
|
||||
editActiveTabKey.value = 'basic'
|
||||
|
||||
// 如果有时间数据,设置时间选择器的值
|
||||
if (record.pickup_time_from) {
|
||||
editPickupTimeFrom.value = dayjs(record.pickup_time_from, 'HH:mm:ss');
|
||||
console.log('设置自提开始时间:', editPickupTimeFrom.value);
|
||||
}
|
||||
|
||||
if (record.pickup_time_to) {
|
||||
editPickupTimeTo.value = dayjs(record.pickup_time_to, 'HH:mm:ss');
|
||||
console.log('设置自提结束时间:', editPickupTimeTo.value);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 组件销毁时,也销毁编辑器
|
||||
@ -1316,11 +1165,6 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
// 将HTML转换为Markdown
|
||||
if (editorRef.value) {
|
||||
formData.product_detail = turndownService.turndown(editorRef.value.getHTML())
|
||||
}
|
||||
|
||||
const res = await request.post('/api/merchant/product', formData)
|
||||
|
||||
if (res.code === 200) {
|
||||
@ -1516,11 +1360,6 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
// 将HTML转换为Markdown
|
||||
if (editEditorRef.value) {
|
||||
formData.product_detail = turndownService.turndown(editEditorRef.value.getHTML())
|
||||
}
|
||||
|
||||
const res = await request.put(`/api/merchant/product/${currentEditId.value}`, formData)
|
||||
|
||||
if (res.code === 200) {
|
||||
@ -1657,15 +1496,15 @@ export default defineComponent({
|
||||
editEditorRef,
|
||||
editorContent,
|
||||
editEditorContent,
|
||||
editorConfig,
|
||||
toolbarConfig,
|
||||
initEditor,
|
||||
initEditEditor,
|
||||
htmlToMarkdown,
|
||||
markdownToHtml,
|
||||
mode,
|
||||
handleDeliveryTimeTypeChange,
|
||||
handleEditDeliveryTimeTypeChange
|
||||
handleEditDeliveryTimeTypeChange,
|
||||
toolbars,
|
||||
editorConfig
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1888,39 +1727,16 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
/* 编辑器相关样式 */
|
||||
:deep(.w-e-toolbar) {
|
||||
border: none !important;
|
||||
border-bottom: 1px solid #d9d9d9 !important;
|
||||
z-index: 2001 !important;
|
||||
flex-wrap: wrap;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
:deep(.w-e-text-container) {
|
||||
border: none !important;
|
||||
z-index: 2000 !important;
|
||||
height: 450px !important;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
:deep(.w-e-text) {
|
||||
height: 450px !important;
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
:deep(.w-e-menu) {
|
||||
z-index: 2001 !important;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
:deep(.w-e-drop-list) {
|
||||
z-index: 2100 !important;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
:deep(.w-e-panel-container) {
|
||||
z-index: 2100 !important;
|
||||
position: absolute;
|
||||
:deep(.w-e-toolbar),
|
||||
:deep(.w-e-text-container),
|
||||
:deep(.w-e-text),
|
||||
:deep(.w-e-menu),
|
||||
:deep(.w-e-drop-list),
|
||||
:deep(.w-e-panel-container),
|
||||
:deep(.w-e-select-list),
|
||||
:deep(.w-e-menu-tooltip),
|
||||
:deep(.w-e-modal) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 防止编辑器被模态框层级覆盖 */
|
||||
@ -1931,21 +1747,4 @@ export default defineComponent({
|
||||
:deep(.ant-modal-wrap) {
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
/* 解决编辑器工具栏显示问题 */
|
||||
:deep(.w-e-select-list) {
|
||||
z-index: 2100 !important;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
:deep(.w-e-menu-tooltip) {
|
||||
z-index: 2200 !important;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
:deep(.w-e-modal) {
|
||||
z-index: 2300 !important;
|
||||
position: absolute;
|
||||
top: 2em;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user