Commit 16b3f501 by 张立顺

feat 内容推送功能管理

1 parent 18a791fa
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"vue-router": "3.0.5", "vue-router": "3.0.5",
"vuedraggable": "^2.24.3", "vuedraggable": "^2.24.3",
"vuex": "^3.0.1", "vuex": "^3.0.1",
"wangeditor": "4.7.15",
"webpack-theme-color-replacer": "^1.4.2", "webpack-theme-color-replacer": "^1.4.2",
"webpack5-svg-sprite-loader": "^5.1.1", "webpack5-svg-sprite-loader": "^5.1.1",
"xlsx": "^0.16.9", "xlsx": "^0.16.9",
......
...@@ -65,3 +65,9 @@ export function getBrandList(data) { ...@@ -65,3 +65,9 @@ export function getBrandList(data) {
data.method = `dj.api.smartcarlife.common.car.brand.page` data.method = `dj.api.smartcarlife.common.car.brand.page`
return request(data) return request(data)
} }
// 分页查询标签员工
export function getListLabelStaffPage(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.listLabelStaffPage`
return request(data)
}
...@@ -5,20 +5,21 @@ ...@@ -5,20 +5,21 @@
</template> </template>
<script> <script>
import E from 'wangeditor' import { uploadImg, syncUploadVideo, uploadVideo } from "@/api/sys.base"
import E from "wangeditor"
export default { export default {
name: 'TextBox', name: "TextBox",
data() { data() {
return { return {
editor: '', editor: "",
content: '', content: "",
editorOption: {} editorOption: {}
} }
}, },
props: { props: {
excludeMenus: { excludeMenus: {
type: Array, type: Array,
default: () => ['code'] default: () => ["code"]
}, },
boxHeight: { boxHeight: {
type: Number, type: Number,
...@@ -31,37 +32,41 @@ export default { ...@@ -31,37 +32,41 @@ export default {
methods: { methods: {
getEdit() { getEdit() {
const _this = this const _this = this
this.editor = new E('#div-demo') this.editor = new E("#div-demo")
this.editor.config.uploadImgShowBase64 = true this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = 'down' this.editor.config.menuTooltipPosition = "down"
this.editor.config.height = this.boxHeight this.editor.config.height = this.boxHeight
this.editor.config.width = 500 this.editor.config.width = "500px"
this.editor.config.excludeMenus = this.excludeMenus this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = html => { this.editor.config.onchange = (html) => {
// console.log(html); // console.log(html);
this.content = html // 绑定当前逐渐地值 this.content = html // 绑定当前逐渐地值
this.$emit('change', this.content) // 将内容同步到父组件中 this.$emit("change", this.content) // 将内容同步到父组件中
} }
this.editor.config.onfocus = () => { this.editor.config.onfocus = () => {
this.$emit('focus') this.$emit("focus")
} }
// 上传图片 // 上传图片
this.editor.config.customUploadImg = function(resultFiles, insertImgFn) { this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0] var file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
const limitSize = 10 const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) { if (!isLt) {
_this.$message.error('上传图片大小不能超过' + limitSize + 'MB!') _this.$message.error("上传图片大小不能超过" + limitSize + "MB!")
return true return true
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = (e) => {
const imgFile = e.target.result const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1] const base64 =
_this.$apis.common.pictureUpload({ file: base64 }).then(res => { file.name.split(".")[file.name.split(".").length - 1] +
"@" +
imgFile.split(",")[1]
// _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
uploadImg({ file: base64, compress: 0 }).then((res) => {
if (res) { if (res) {
// console.log(res) // console.log(res)
insertImgFn(res) insertImgFn(res)
...@@ -73,21 +78,27 @@ export default { ...@@ -73,21 +78,27 @@ export default {
} }
} }
// 上传视频 // 上传视频
this.editor.config.customUploadVideo = function(resultFiles, insertVideoFn) { this.editor.config.customUploadVideo = function (
resultFiles,
insertVideoFn
) {
var file = resultFiles[0] var file = resultFiles[0]
var reader = new FileReader() var reader = new FileReader()
// 默认1MB // 默认1MB
const limitSize = 10 const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) { if (!isLt) {
_this.$message.error('上传视频大小不能超过' + limitSize + 'MB!') _this.$message.error("上传视频大小不能超过" + limitSize + "MB!")
return true return true
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
reader.onload = e => { reader.onload = (e) => {
const videoFile = e.target.result const videoFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + videoFile.split(',')[1] const base64 =
_this.$apis.common.pictureUpload({ file: base64 }).then(res => { file.name.split(".")[file.name.split(".").length - 1] +
"@" +
videoFile.split(",")[1]
_this.$apis.common.pictureUpload({ file: base64 }).then((res) => {
if (res) { if (res) {
// console.log(res) // console.log(res)
insertVideoFn(res) insertVideoFn(res)
...@@ -116,6 +127,7 @@ export default { ...@@ -116,6 +127,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
#div-demo { #div-demo {
width: 575px;
// margin: 16px 300px 0 0; // margin: 16px 300px 0 0;
} }
.el-form .editor { .el-form .editor {
......
...@@ -106,7 +106,7 @@ export const routerName = { ...@@ -106,7 +106,7 @@ export const routerName = {
1: "停用" 1: "停用"
} }
} }
}, }
], ],
component: _import("contentManager/contentManagerList") component: _import("contentManager/contentManagerList")
}, },
...@@ -120,7 +120,8 @@ export const routerName = { ...@@ -120,7 +120,8 @@ export const routerName = {
cache: false, cache: false,
activePath: "/contentManagerList" activePath: "/contentManagerList"
}, },
component: _import("contentManager/contentAdd") // component: _import("contentManager/contentAdd")
component: _import("contentManager/SopContentAdd")
}, },
91303: { 91303: {
path: "/contentDetail", path: "/contentDetail",
......
...@@ -961,6 +961,21 @@ ...@@ -961,6 +961,21 @@
resolved "https://registry.npmmirror.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" resolved "https://registry.npmmirror.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310"
integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==
"@babel/runtime-corejs3@^7.11.2":
version "7.24.8"
resolved "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.24.8.tgz#c0ae5a1c380f8442920866d0cc51de8024507e28"
integrity sha512-DXG/BhegtMHhnN7YPIvxWd303/9aXvYFD1TjNL3CD6tUrhI2LVsg3Lck0aql5TRH29n4sj3emcROypkZVUfSuA==
dependencies:
core-js-pure "^3.30.2"
regenerator-runtime "^0.14.0"
"@babel/runtime@^7.11.2":
version "7.24.8"
resolved "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.8.tgz#5d958c3827b13cc6d05e038c07fb2e5e3420d82e"
integrity sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==
dependencies:
regenerator-runtime "^0.14.0"
"@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.0", "@babel/runtime@^7.8.4": "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.14.0", "@babel/runtime@^7.8.4":
version "7.21.0" version "7.21.0"
resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673" resolved "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.21.0.tgz#5b55c9d394e5fcf304909a8b00c07dc217b56673"
...@@ -3727,6 +3742,11 @@ core-js-compat@^3.25.1, core-js-compat@^3.8.3: ...@@ -3727,6 +3742,11 @@ core-js-compat@^3.25.1, core-js-compat@^3.8.3:
dependencies: dependencies:
browserslist "^4.21.5" browserslist "^4.21.5"
core-js-pure@^3.30.2:
version "3.37.1"
resolved "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.37.1.tgz#2b4b34281f54db06c9a9a5bd60105046900553bd"
integrity sha512-J/r5JTHSmzTxbiYYrzXg9w1VpqrYt+gexenBE9pugeyhwPZTAEJddyiReJWsLO6uNQ8xJZFbod6XC7KKwatCiA==
core-js@^2.4.0: core-js@^2.4.0:
version "2.6.12" version "2.6.12"
resolved "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" resolved "https://registry.npmmirror.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
...@@ -9144,6 +9164,11 @@ regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.7: ...@@ -9144,6 +9164,11 @@ regenerator-runtime@^0.13.11, regenerator-runtime@^0.13.7:
resolved "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" resolved "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
regenerator-runtime@^0.14.0:
version "0.14.1"
resolved "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==
regenerator-transform@^0.15.1: regenerator-transform@^0.15.1:
version "0.15.1" version "0.15.1"
resolved "https://registry.npmmirror.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" resolved "https://registry.npmmirror.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56"
...@@ -10457,6 +10482,11 @@ tslib@^2.0.3: ...@@ -10457,6 +10482,11 @@ tslib@^2.0.3:
resolved "https://registry.npmmirror.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" resolved "https://registry.npmmirror.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf"
integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==
tslib@^2.1.0:
version "2.6.3"
resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0"
integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==
type-check@^0.4.0, type-check@~0.4.0: type-check@^0.4.0, type-check@~0.4.0:
version "0.4.0" version "0.4.0"
resolved "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" resolved "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1"
...@@ -10843,6 +10873,15 @@ walker@^1.0.7: ...@@ -10843,6 +10873,15 @@ walker@^1.0.7:
dependencies: dependencies:
makeerror "1.0.12" makeerror "1.0.12"
wangeditor@4.7.15:
version "4.7.15"
resolved "https://registry.npmjs.org/wangeditor/-/wangeditor-4.7.15.tgz#38c5e279a79d0428e4fd77ae5be46367e9c819e5"
integrity sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==
dependencies:
"@babel/runtime" "^7.11.2"
"@babel/runtime-corejs3" "^7.11.2"
tslib "^2.1.0"
watchpack@^2.4.0: watchpack@^2.4.0:
version "2.4.0" version "2.4.0"
resolved "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" resolved "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!