From e257ecef7fd22761495f08770550c7b3dec7ac2a Mon Sep 17 00:00:00 2001 From: "382696293@qq.com" <382696293@qq.com> Date: Wed, 10 Jan 2024 11:45:40 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=8F=AF=E8=A7=81=E6=A0=87=E7=AD=BE=E5=92=8C=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=BC=81=E5=BE=AE=E5=8F=AF=E8=A7=81=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/WxInstrumentServiceImpl.java | 31 +++++ flossom-ui/src/api/system/instrument.js | 22 +++ .../src/views/system/instrument/index.vue | 128 ++++++++++++++++-- 3 files changed, 170 insertions(+), 11 deletions(-) diff --git a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java index 28ec5fb..5d545ff 100644 --- a/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java +++ b/flossom-modules/flossom-system/src/main/java/com/flossom/system/service/impl/WxInstrumentServiceImpl.java @@ -1,9 +1,12 @@ package com.flossom.system.service.impl; +import java.util.Arrays; import java.util.List; +import com.flossom.common.core.domain.entity.SysTag; import com.flossom.common.core.domain.entity.WxInstrument; import com.flossom.common.core.domain.req.WxInstrumentReq; +import com.flossom.common.core.mapper.SysTagMapper; import com.flossom.common.core.mapper.WxInstrumentMapper; import com.flossom.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -22,6 +25,9 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { @Autowired private WxInstrumentMapper wxInstrumentMapper; + @Autowired + private SysTagMapper sysTagMapper; + /** * 查询仪器列 * @@ -69,6 +75,31 @@ public class WxInstrumentServiceImpl implements IWxInstrumentService { */ @Override public int updateWxInstrument(WxInstrument wxInstrument) { + // 处理小程序标签和企微标签 + if (wxInstrument.getMiniTagIds() != null) { + List tagIdList = Arrays.asList(wxInstrument.getMiniTagIds().split(",")); + StringBuilder tagNames = new StringBuilder(); + for (int i = 0; i < tagIdList.size(); i++) { + SysTag sysTag = sysTagMapper.selectDeptById(Long.valueOf(tagIdList.get(i))); + tagNames.append(sysTag.getTagName()); + if (i < tagIdList.size() - 1) { + tagNames.append(","); + } + } + wxInstrument.setMiniTagNames(tagNames.toString()); + } + if (wxInstrument.getWecomTagIds() != null) { + List tagIdList = Arrays.asList(wxInstrument.getWecomTagIds().split(",")); + StringBuilder tagNames = new StringBuilder(); + for (int i = 0; i < tagIdList.size(); i++) { + SysTag sysTag = sysTagMapper.selectDeptById(Long.valueOf(tagIdList.get(i))); + tagNames.append(sysTag.getTagName()); + if (i < tagIdList.size() - 1) { + tagNames.append(","); + } + } + wxInstrument.setWecomTagNames(tagNames.toString()); + } wxInstrument.setUpdateTime(DateUtils.getNowDate()); return wxInstrumentMapper.updateWxInstrument(wxInstrument); } diff --git a/flossom-ui/src/api/system/instrument.js b/flossom-ui/src/api/system/instrument.js index ef515ff..7cda1b4 100644 --- a/flossom-ui/src/api/system/instrument.js +++ b/flossom-ui/src/api/system/instrument.js @@ -42,3 +42,25 @@ export function delInstrument(id) { method: 'delete' }) } + +/* 获取小程序标签树 */ +export function getMiniProgramTagTree() { + return request({ + url: '/system/tagInfo/tagTree', + method: 'get', + params: { + type: 1 + } + }) +} + +/* 获取企微标签树 */ +export function getWecomTagTree() { + return request({ + url: '/system/tagInfo/tagTree', + method: 'get', + params: { + type: 2 + } + }) +} diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index eb8160d..d768114 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -102,13 +102,15 @@ size="mini" type="text" icon="el-icon-edit" + @click="editMiniProgramTags(scope.row)" >设置小程序可见标签 设置微信可见标签 + @click="editWecomTags(scope.row)" + >设置企微可见标签 - @@ -421,15 +423,61 @@ 取 消 + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b0cb6631bced0411468b6fa289c362b3973e3fb7 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 10 Jan 2024 12:19:12 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BB=AA=E5=99=A8?= =?UTF-8?q?=EF=BC=9A=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=E6=88=96=E8=A7=86?= =?UTF-8?q?=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flossom-ui/package.json | 2 + flossom-ui/src/api/upload.js | 11 + .../src/components/ImagePreview/index.vue | 4 +- .../src/components/VideoPreview/index.vue | 129 + flossom-ui/src/main.js | 112 +- .../src/views/system/instrument/index.vue | 2125 ++++++++++------- flossom-ui/vue.config.js | 7 +- 7 files changed, 1496 insertions(+), 894 deletions(-) create mode 100644 flossom-ui/src/api/upload.js create mode 100644 flossom-ui/src/components/VideoPreview/index.vue diff --git a/flossom-ui/package.json b/flossom-ui/package.json index 5324c46..9a1075e 100644 --- a/flossom-ui/package.json +++ b/flossom-ui/package.json @@ -61,6 +61,7 @@ "vue-cropper": "0.5.5", "vue-meta": "2.4.0", "vue-router": "3.4.9", + "vue-video-player": "^4.0.6", "vuedraggable": "2.24.3", "vuex": "3.6.0" }, @@ -75,6 +76,7 @@ "connect": "3.6.6", "eslint": "7.15.0", "eslint-plugin-vue": "7.2.0", + "less-loader": "^5.0.0", "lint-staged": "10.5.3", "runjs": "4.4.2", "sass": "1.32.13", diff --git a/flossom-ui/src/api/upload.js b/flossom-ui/src/api/upload.js new file mode 100644 index 0000000..22003e2 --- /dev/null +++ b/flossom-ui/src/api/upload.js @@ -0,0 +1,11 @@ +import request from '@/utils/request' + + +// 文件上传 +export function upload(data) { + return request({ + url: "/file/upload", + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/flossom-ui/src/components/ImagePreview/index.vue b/flossom-ui/src/components/ImagePreview/index.vue index 2fa02d7..c3b5bae 100644 --- a/flossom-ui/src/components/ImagePreview/index.vue +++ b/flossom-ui/src/components/ImagePreview/index.vue @@ -21,11 +21,11 @@ export default { }, width: { type: [Number, String], - default: "" + default: "80px" }, height: { type: [Number, String], - default: "" + default: "80px" } }, computed: { diff --git a/flossom-ui/src/components/VideoPreview/index.vue b/flossom-ui/src/components/VideoPreview/index.vue new file mode 100644 index 0000000..5dca5bb --- /dev/null +++ b/flossom-ui/src/components/VideoPreview/index.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/flossom-ui/src/main.js b/flossom-ui/src/main.js index 13c6cf2..205ab09 100644 --- a/flossom-ui/src/main.js +++ b/flossom-ui/src/main.js @@ -1,67 +1,81 @@ -import Vue from 'vue' +import Vue from "vue"; -import Cookies from 'js-cookie' +import Cookies from "js-cookie"; -import Element from 'element-ui' -import './assets/styles/element-variables.scss' +import Element from "element-ui"; +import "./assets/styles/element-variables.scss"; -import '@/assets/styles/index.scss' // global css -import '@/assets/styles/ruoyi.scss' // ruoyi css -import App from './App' -import store from './store' -import router from './router' -import directive from './directive' // directive -import plugins from './plugins' // plugins -import { download } from '@/utils/request' +import "@/assets/styles/index.scss"; // global css +import "@/assets/styles/ruoyi.scss"; // ruoyi css +import App from "./App"; +import store from "./store"; +import router from "./router"; +import directive from "./directive"; // directive +import plugins from "./plugins"; // plugins +import { download } from "@/utils/request"; -import './assets/icons' // icon -import './permission' // permission control +import "./assets/icons"; // icon +import "./permission"; // permission control import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; -import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; +import { + parseTime, + resetForm, + addDateRange, + selectDictLabel, + selectDictLabels, + handleTree, +} from "@/utils/ruoyi"; // 分页组件 import Pagination from "@/components/Pagination"; // 自定义表格工具组件 -import RightToolbar from "@/components/RightToolbar" +import RightToolbar from "@/components/RightToolbar"; // 富文本组件 -import Editor from "@/components/Editor" +import Editor from "@/components/Editor"; // 文件上传组件 -import FileUpload from "@/components/FileUpload" +import FileUpload from "@/components/FileUpload"; // 图片上传组件 -import ImageUpload from "@/components/ImageUpload" +import ImageUpload from "@/components/ImageUpload"; // 图片预览组件 -import ImagePreview from "@/components/ImagePreview" +import ImagePreview from "@/components/ImagePreview"; // 字典标签组件 -import DictTag from '@/components/DictTag' +import DictTag from "@/components/DictTag"; // 头部标签组件 -import VueMeta from 'vue-meta' +import VueMeta from "vue-meta"; // 字典数据组件 -import DictData from '@/components/DictData' +import DictData from "@/components/DictData"; +// 视频播放器 +import VideoPlayer from "vue-video-player"; + +// 视频组件 +import VideoPreview from "@/components/VideoPreview"; // 全局方法挂载 -Vue.prototype.getDicts = getDicts -Vue.prototype.getConfigKey = getConfigKey -Vue.prototype.parseTime = parseTime -Vue.prototype.resetForm = resetForm -Vue.prototype.addDateRange = addDateRange -Vue.prototype.selectDictLabel = selectDictLabel -Vue.prototype.selectDictLabels = selectDictLabels -Vue.prototype.download = download -Vue.prototype.handleTree = handleTree +Vue.prototype.getDicts = getDicts; +Vue.prototype.getConfigKey = getConfigKey; +Vue.prototype.parseTime = parseTime; +Vue.prototype.resetForm = resetForm; +Vue.prototype.addDateRange = addDateRange; +Vue.prototype.selectDictLabel = selectDictLabel; +Vue.prototype.selectDictLabels = selectDictLabels; +Vue.prototype.download = download; +Vue.prototype.handleTree = handleTree; // 全局组件挂载 -Vue.component('DictTag', DictTag) -Vue.component('Pagination', Pagination) -Vue.component('RightToolbar', RightToolbar) -Vue.component('Editor', Editor) -Vue.component('FileUpload', FileUpload) -Vue.component('ImageUpload', ImageUpload) -Vue.component('ImagePreview', ImagePreview) +Vue.component("DictTag", DictTag); +Vue.component("Pagination", Pagination); +Vue.component("RightToolbar", RightToolbar); +Vue.component("Editor", Editor); +Vue.component("FileUpload", FileUpload); +Vue.component("ImageUpload", ImageUpload); +Vue.component("ImagePreview", ImagePreview); +Vue.component("VideoPreview", VideoPreview); -Vue.use(directive) -Vue.use(plugins) -Vue.use(VueMeta) -DictData.install() +Vue.use(directive); +Vue.use(plugins); +Vue.use(VueMeta); +Vue.use(VideoPlayer); +DictData.install(); /** * If you don't want to use mock-server @@ -73,14 +87,14 @@ DictData.install() */ Vue.use(Element, { - size: Cookies.get('size') || 'medium' // set element-ui default size -}) + size: Cookies.get("size") || "medium", // set element-ui default size +}); -Vue.config.productionTip = false +Vue.config.productionTip = false; new Vue({ - el: '#app', + el: "#app", router, store, - render: h => h(App) -}) + render: (h) => h(App), +}); diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index e51e292..8aa30e3 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -1,859 +1,1306 @@ diff --git a/flossom-ui/vue.config.js b/flossom-ui/vue.config.js index f86123f..c89e41a 100644 --- a/flossom-ui/vue.config.js +++ b/flossom-ui/vue.config.js @@ -13,7 +13,7 @@ const port = process.env.port || process.env.npm_config_port || 80; // 端口 function getTargetUrl() { if (process.env.NODE_ENV === "local") { - return "http://110.41.134.131:8080"; + return "http://110.41.134.131:8080"; // 纯前端代理地址 } else { return `http://localhost:8080`; } @@ -43,9 +43,8 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - // target: `http://110.41.134.131:8080`, - target: `http://192.168.10.147:8080`, - + target: `http://110.41.134.131:8080`, + // target: `http://192.168.10.147:8080`, changeOrigin: true, pathRewrite: { ["^" + process.env.VUE_APP_BASE_API]: "", From 95c47b55656ce5c06e47a2807460fa7c0609aca3 Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 10 Jan 2024 13:36:30 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flossom-ui/src/views/system/instrument/index.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flossom-ui/src/views/system/instrument/index.vue b/flossom-ui/src/views/system/instrument/index.vue index a6865c8..d9246fa 100644 --- a/flossom-ui/src/views/system/instrument/index.vue +++ b/flossom-ui/src/views/system/instrument/index.vue @@ -834,6 +834,8 @@ import { getToken } from '@/utils/auth' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' +import { upload } from "@/api/upload"; + export default { name: 'Instrument', components: { Treeselect }, From 2e834acce8c42bfe2f38dd638b106f063ed6052c Mon Sep 17 00:00:00 2001 From: blak-kong <546598185@qq.com> Date: Wed, 10 Jan 2024 14:10:13 +0800 Subject: [PATCH 4/5] =?UTF-8?q?less=E6=9B=BF=E6=8D=A2=E4=B8=BAscss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flossom-ui/package.json | 2 -- flossom-ui/src/components/VideoPreview/index.vue | 4 ++-- flossom-ui/src/views/system/instrument/index.vue | 8 ++++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/flossom-ui/package.json b/flossom-ui/package.json index 9a1075e..40416b8 100644 --- a/flossom-ui/package.json +++ b/flossom-ui/package.json @@ -46,11 +46,9 @@ "file-saver": "2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", - "i": "^0.3.7", "js-beautify": "1.13.0", "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", - "npm": "^10.2.5", "nprogress": "0.2.0", "quill": "^2.0.0-dev.3", "quill-better-table": "^1.2.10", diff --git a/flossom-ui/src/components/VideoPreview/index.vue b/flossom-ui/src/components/VideoPreview/index.vue index 5dca5bb..42e3940 100644 --- a/flossom-ui/src/components/VideoPreview/index.vue +++ b/flossom-ui/src/components/VideoPreview/index.vue @@ -112,13 +112,13 @@ export default { } -