Commit d8bbc71543d41747230e9037121248c805a17b46
1 parent
167692b0
乱改下 bpmnProcessDesigner 的样式
Showing
4 changed files
with
30 additions
and
313 deletions
yudao-admin-ui/src/components/bpmnProcessDesigner/src/App.vue deleted
| 1 | -<template> | ||
| 2 | - <div id="app"> | ||
| 3 | - <my-process-palette /> | ||
| 4 | - <my-process-designer | ||
| 5 | - :key="`designer-${reloadIndex}`" | ||
| 6 | - v-model="xmlString" | ||
| 7 | - v-bind="controlForm" | ||
| 8 | - keyboard | ||
| 9 | - ref="processDesigner" | ||
| 10 | - @element-click="elementClick" | ||
| 11 | - @init-finished="initModeler" | ||
| 12 | - /> | ||
| 13 | - <my-properties-panel :key="`penal-${reloadIndex}`" :bpmn-modeler="modeler" :prefix="controlForm.prefix" class="process-panel" /> | ||
| 14 | - | ||
| 15 | - <!-- demo config --> | ||
| 16 | - <div class="demo-control-bar"> | ||
| 17 | - <div class="open-control-dialog" @click="controlDrawerVisible = true"><i class="el-icon-setting"></i></div> | ||
| 18 | - </div> | ||
| 19 | - <el-drawer :visible.sync="controlDrawerVisible" size="400px" title="偏好设置" append-to-body destroy-on-close> | ||
| 20 | - <el-form :model="controlForm" size="small" label-width="100px" class="control-form" @submit.native.prevent> | ||
| 21 | - <el-form-item label="流程ID"> | ||
| 22 | - <el-input v-model="controlForm.processId" @change="reloadProcessDesigner" /> | ||
| 23 | - </el-form-item> | ||
| 24 | - <el-form-item label="流程名称"> | ||
| 25 | - <el-input v-model="controlForm.processName" @change="reloadProcessDesigner" /> | ||
| 26 | - </el-form-item> | ||
| 27 | - <el-form-item label="流转模拟"> | ||
| 28 | - <el-switch v-model="controlForm.simulation" inactive-text="停用" active-text="启用" @change="reloadProcessDesigner" /> | ||
| 29 | - </el-form-item> | ||
| 30 | - <el-form-item label="禁用双击"> | ||
| 31 | - <el-switch v-model="controlForm.labelEditing" inactive-text="停用" active-text="启用" @change="changeLabelEditingStatus" /> | ||
| 32 | - </el-form-item> | ||
| 33 | - <el-form-item label="隐藏label"> | ||
| 34 | - <el-switch v-model="controlForm.labelVisible" inactive-text="停用" active-text="启用" @change="changeLabelVisibleStatus" /> | ||
| 35 | - </el-form-item> | ||
| 36 | - <el-form-item label="流程引擎"> | ||
| 37 | - <el-radio-group v-model="controlForm.prefix" @change="reloadProcessDesigner(true)"> | ||
| 38 | - <el-radio label="camunda">camunda</el-radio> | ||
| 39 | - <el-radio label="flowable">flowable</el-radio> | ||
| 40 | - <el-radio label="activiti">activiti</el-radio> | ||
| 41 | - </el-radio-group> | ||
| 42 | - </el-form-item> | ||
| 43 | - <el-form-item label="工具栏"> | ||
| 44 | - <el-radio-group v-model="controlForm.headerButtonSize"> | ||
| 45 | - <el-radio label="mini">mini</el-radio> | ||
| 46 | - <el-radio label="small">small</el-radio> | ||
| 47 | - <el-radio label="medium">medium</el-radio> | ||
| 48 | - </el-radio-group> | ||
| 49 | - </el-form-item> | ||
| 50 | - </el-form> | ||
| 51 | - </el-drawer> | ||
| 52 | - | ||
| 53 | - <div class="info-tip"> | ||
| 54 | - <p>注:activiti 好像不支持表单配置,控制台可能会报错</p> | ||
| 55 | - <p>更多配置请查看源码:<a href="https://github.com/miyuesc/bpmn-process-designer">MiyueSC/bpmn-process-designer</a></p> | ||
| 56 | - <p>疑问请在此留言:<a href="https://github.com/miyuesc/bpmn-process-designer/issues/16">MiyueSC/bpmn-process-designer/issues</a></p> | ||
| 57 | - </div> | ||
| 58 | - </div> | ||
| 59 | -</template> | ||
| 60 | - | ||
| 61 | -<script> | ||
| 62 | -import translations from "@/translations"; | ||
| 63 | -// 自定义渲染(隐藏了 label 标签) | ||
| 64 | -import CustomRenderer from "@/modules/custom-renderer"; | ||
| 65 | -// 自定义元素选中时的弹出菜单(修改 默认任务 为 用户任务) | ||
| 66 | -import CustomContentPadProvider from "../package/designer/plugins/content-pad"; | ||
| 67 | -// 自定义左侧菜单(修改 默认任务 为 用户任务) | ||
| 68 | -import CustomPaletteProvider from "../package/designer/plugins/palette"; | ||
| 69 | -import xmlObj2json from "./utils/xml2json"; | ||
| 70 | -import MyProcessPalette from "../package/palette/ProcessPalette"; | ||
| 71 | -// 自定义侧边栏 | ||
| 72 | -// import MyProcessPanel from "../package/process-panel/ProcessPanel"; | ||
| 73 | - | ||
| 74 | -export default { | ||
| 75 | - name: "App", | ||
| 76 | - components: { MyProcessPalette }, | ||
| 77 | - data() { | ||
| 78 | - return { | ||
| 79 | - xmlString: "", | ||
| 80 | - modeler: null, | ||
| 81 | - reloadIndex: 0, | ||
| 82 | - controlDrawerVisible: false, | ||
| 83 | - translationsSelf: translations, | ||
| 84 | - controlForm: { | ||
| 85 | - processId: "", | ||
| 86 | - processName: "", | ||
| 87 | - simulation: true, | ||
| 88 | - labelEditing: false, | ||
| 89 | - labelVisible: false, | ||
| 90 | - prefix: "flowable", | ||
| 91 | - headerButtonSize: "mini", | ||
| 92 | - // additionalModel: [] | ||
| 93 | - additionalModel: [CustomContentPadProvider, CustomPaletteProvider] | ||
| 94 | - }, | ||
| 95 | - addis: { | ||
| 96 | - CustomContentPadProvider, | ||
| 97 | - CustomPaletteProvider | ||
| 98 | - } | ||
| 99 | - }; | ||
| 100 | - }, | ||
| 101 | - created() {}, | ||
| 102 | - methods: { | ||
| 103 | - initModeler(modeler) { | ||
| 104 | - setTimeout(() => { | ||
| 105 | - this.modeler = modeler; | ||
| 106 | - console.log(modeler); | ||
| 107 | - }, 10); | ||
| 108 | - }, | ||
| 109 | - reloadProcessDesigner(deep) { | ||
| 110 | - this.controlForm.additionalModel = []; | ||
| 111 | - for (let key in this.addis) { | ||
| 112 | - if (this.addis[key]) { | ||
| 113 | - this.controlForm.additionalModel.push(this.addis[key]); | ||
| 114 | - } | ||
| 115 | - } | ||
| 116 | - deep && (this.xmlString = undefined); | ||
| 117 | - this.reloadIndex += 1; | ||
| 118 | - this.modeler = null; // 避免 panel 异常 | ||
| 119 | - // if (deep) { | ||
| 120 | - // this.xmlString = undefined; | ||
| 121 | - // this.$refs.processDesigner.processRestart(); | ||
| 122 | - // } | ||
| 123 | - }, | ||
| 124 | - changeLabelEditingStatus(status) { | ||
| 125 | - this.addis.labelEditing = status ? { labelEditingProvider: ["value", ""] } : false; | ||
| 126 | - this.reloadProcessDesigner(); | ||
| 127 | - }, | ||
| 128 | - changeLabelVisibleStatus(status) { | ||
| 129 | - this.addis.customRenderer = status ? CustomRenderer : false; | ||
| 130 | - this.reloadProcessDesigner(); | ||
| 131 | - }, | ||
| 132 | - elementClick(element) { | ||
| 133 | - this.element = element; | ||
| 134 | - | ||
| 135 | - !this.elementOverlayIds && (this.elementOverlayIds = {}); | ||
| 136 | - | ||
| 137 | - !this.overlays && (this.overlays = this.modeler.get("overlays")); | ||
| 138 | - !this.contextPad && (this.contextPad = this.modeler.get("contextPad")); | ||
| 139 | - | ||
| 140 | - this.modeler.on("element.hover", ({ element }) => { | ||
| 141 | - if (!this.elementOverlayIds[element.id] && element.type !== "bpmn:Process") { | ||
| 142 | - this.elementOverlayIds[element.id] = this.overlays.add(element, { | ||
| 143 | - position: { left: 0, bottom: 0 }, | ||
| 144 | - html: `<div class="element-overlays"> | ||
| 145 | - <p>Elemet id: ${element.id}</p> | ||
| 146 | - <p>Elemet type: ${element.type}</p> | ||
| 147 | - </div>` | ||
| 148 | - }); | ||
| 149 | - } | ||
| 150 | - }); | ||
| 151 | - | ||
| 152 | - this.modeler.on("element.out", ({ element }) => { | ||
| 153 | - if (element) { | ||
| 154 | - this.overlays.remove({ element }); | ||
| 155 | - this.elementOverlayIds[element.id] = null; | ||
| 156 | - } | ||
| 157 | - }); | ||
| 158 | - } | ||
| 159 | - } | ||
| 160 | -}; | ||
| 161 | -</script> | ||
| 162 | - | ||
| 163 | -<style lang="scss"> | ||
| 164 | -body { | ||
| 165 | - overflow: hidden; | ||
| 166 | - margin: 0; | ||
| 167 | - box-sizing: border-box; | ||
| 168 | -} | ||
| 169 | -#app { | ||
| 170 | - width: 100%; | ||
| 171 | - height: 100%; | ||
| 172 | - box-sizing: border-box; | ||
| 173 | - display: inline-grid; | ||
| 174 | - grid-template-columns: 100px auto max-content; | ||
| 175 | -} | ||
| 176 | -.demo-control-bar { | ||
| 177 | - position: fixed; | ||
| 178 | - right: 8px; | ||
| 179 | - bottom: 8px; | ||
| 180 | - z-index: 1; | ||
| 181 | - .open-control-dialog { | ||
| 182 | - width: 48px; | ||
| 183 | - height: 48px; | ||
| 184 | - display: flex; | ||
| 185 | - align-items: center; | ||
| 186 | - justify-content: center; | ||
| 187 | - border-radius: 4px; | ||
| 188 | - font-size: 32px; | ||
| 189 | - background: rgba(64, 158, 255, 1); | ||
| 190 | - color: #ffffff; | ||
| 191 | - cursor: pointer; | ||
| 192 | - } | ||
| 193 | -} | ||
| 194 | -.info-tip { | ||
| 195 | - position: fixed; | ||
| 196 | - top: 40px; | ||
| 197 | - right: 500px; | ||
| 198 | - z-index: 10; | ||
| 199 | - color: #999999; | ||
| 200 | -} | ||
| 201 | -.control-form { | ||
| 202 | - .el-radio { | ||
| 203 | - width: 100%; | ||
| 204 | - line-height: 32px; | ||
| 205 | - } | ||
| 206 | -} | ||
| 207 | -.element-overlays { | ||
| 208 | - box-sizing: border-box; | ||
| 209 | - padding: 8px; | ||
| 210 | - background: rgba(0, 0, 0, 0.6); | ||
| 211 | - border-radius: 4px; | ||
| 212 | - color: #fafafa; | ||
| 213 | -} | ||
| 214 | - | ||
| 215 | -body, | ||
| 216 | -body * { | ||
| 217 | - /* 滚动条 */ | ||
| 218 | - &::-webkit-scrollbar-track-piece { | ||
| 219 | - background-color: #fff; /*滚动条的背景颜色*/ | ||
| 220 | - -webkit-border-radius: 0; /*滚动条的圆角宽度*/ | ||
| 221 | - } | ||
| 222 | - &::-webkit-scrollbar { | ||
| 223 | - width: 10px; /*滚动条的宽度*/ | ||
| 224 | - height: 8px; /*滚动条的高度*/ | ||
| 225 | - } | ||
| 226 | - &::-webkit-scrollbar-thumb:vertical { | ||
| 227 | - /*垂直滚动条的样式*/ | ||
| 228 | - height: 50px; | ||
| 229 | - background-color: rgba(153, 153, 153, 0.5); | ||
| 230 | - -webkit-border-radius: 4px; | ||
| 231 | - outline: 2px solid #fff; | ||
| 232 | - outline-offset: -2px; | ||
| 233 | - border: 2px solid #fff; | ||
| 234 | - } | ||
| 235 | - &::-webkit-scrollbar-thumb { | ||
| 236 | - /*滚动条的hover样式*/ | ||
| 237 | - background-color: rgba(159, 159, 159, 0.3); | ||
| 238 | - -webkit-border-radius: 4px; | ||
| 239 | - } | ||
| 240 | - &::-webkit-scrollbar-thumb:hover { | ||
| 241 | - /*滚动条的hover样式*/ | ||
| 242 | - background-color: rgba(159, 159, 159, 0.5); | ||
| 243 | - -webkit-border-radius: 4px; | ||
| 244 | - } | ||
| 245 | -} | ||
| 246 | -</style> |
yudao-admin-ui/src/components/bpmnProcessDesigner/src/main.js deleted
| 1 | -import Vue from "vue"; | ||
| 2 | -import App from "./App.vue"; | ||
| 3 | - | ||
| 4 | -import axios from "axios"; | ||
| 5 | -Vue.prototype.$axios = axios; | ||
| 6 | - | ||
| 7 | -// 加载基础ElementUI | ||
| 8 | -import ElementUI from "element-ui"; | ||
| 9 | -Vue.use(ElementUI); | ||
| 10 | -import "../package/theme/element-variables.scss"; | ||
| 11 | - | ||
| 12 | -import { vuePlugin } from "@/highlight"; | ||
| 13 | -import "highlight.js/styles/atom-one-dark-reasonable.css"; | ||
| 14 | -Vue.use(vuePlugin); | ||
| 15 | - | ||
| 16 | -import MyPD from "../package/index.js"; | ||
| 17 | -Vue.use(MyPD); | ||
| 18 | -import "../package/theme/index.scss"; | ||
| 19 | - | ||
| 20 | -import "bpmn-js/dist/assets/diagram-js.css"; | ||
| 21 | -import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css"; | ||
| 22 | -import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css"; | ||
| 23 | - | ||
| 24 | -// import "bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css"; // 右边工具栏样式 | ||
| 25 | - | ||
| 26 | -new Vue({ | ||
| 27 | - render: h => h(App) | ||
| 28 | -}).$mount("#app"); |
yudao-admin-ui/src/views/bpm/model/modelEditor.vue
| @@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
| 2 | <!-- <div id="app">--> | 2 | <!-- <div id="app">--> |
| 3 | <div class="app-container"> | 3 | <div class="app-container"> |
| 4 | 4 | ||
| 5 | - <my-process-palette /> | 5 | + <!-- TODO 芋艿:去除测试任务 --> |
| 6 | +<!-- <my-process-palette />--> | ||
| 7 | + | ||
| 6 | <my-process-designer | 8 | <my-process-designer |
| 7 | :key="`designer-${reloadIndex}`" | 9 | :key="`designer-${reloadIndex}`" |
| 8 | v-model="xmlString" | 10 | v-model="xmlString" |
| @@ -53,16 +55,17 @@ | @@ -53,16 +55,17 @@ | ||
| 53 | </el-form> | 55 | </el-form> |
| 54 | </el-drawer> | 56 | </el-drawer> |
| 55 | 57 | ||
| 56 | - <div class="info-tip"> | ||
| 57 | - <p>注:activiti 好像不支持表单配置,控制台可能会报错</p> | ||
| 58 | - <p>更多配置请查看源码:<a href="https://github.com/miyuesc/bpmn-process-designer">MiyueSC/bpmn-process-designer</a></p> | ||
| 59 | - <p>疑问请在此留言:<a href="https://github.com/miyuesc/bpmn-process-designer/issues/16">MiyueSC/bpmn-process-designer/issues</a></p> | ||
| 60 | - </div> | 58 | + <!-- TODO 芋艿:去掉多余的 faq --> |
| 59 | +<!-- <div class="info-tip">--> | ||
| 60 | +<!-- <p>注:activiti 好像不支持表单配置,控制台可能会报错</p>--> | ||
| 61 | +<!-- <p>更多配置请查看源码:<a href="https://github.com/miyuesc/bpmn-process-designer">MiyueSC/bpmn-process-designer</a></p>--> | ||
| 62 | +<!-- <p>疑问请在此留言:<a href="https://github.com/miyuesc/bpmn-process-designer/issues/16">MiyueSC/bpmn-process-designer/issues</a></p>--> | ||
| 63 | +<!-- </div>--> | ||
| 61 | </div> | 64 | </div> |
| 62 | </template> | 65 | </template> |
| 63 | 66 | ||
| 64 | <script> | 67 | <script> |
| 65 | -import translations from "./translations"; | 68 | +import translations from "@/components/bpmnProcessDesigner/src/translations"; |
| 66 | // 自定义渲染(隐藏了 label 标签) | 69 | // 自定义渲染(隐藏了 label 标签) |
| 67 | // TODO 芋艿:custom render 依赖报错 | 70 | // TODO 芋艿:custom render 依赖报错 |
| 68 | // import CustomRenderer from "@/modules/custom-renderer"; | 71 | // import CustomRenderer from "@/modules/custom-renderer"; |
| @@ -197,13 +200,16 @@ body { | @@ -197,13 +200,16 @@ body { | ||
| 197 | cursor: pointer; | 200 | cursor: pointer; |
| 198 | } | 201 | } |
| 199 | } | 202 | } |
| 200 | -.info-tip { | ||
| 201 | - position: fixed; | ||
| 202 | - top: 40px; | ||
| 203 | - right: 500px; | ||
| 204 | - z-index: 10; | ||
| 205 | - color: #999999; | ||
| 206 | -} | 203 | + |
| 204 | +// TODO 芋艿:去掉多余的 faq | ||
| 205 | +//.info-tip { | ||
| 206 | +// position: fixed; | ||
| 207 | +// top: 40px; | ||
| 208 | +// right: 500px; | ||
| 209 | +// z-index: 10; | ||
| 210 | +// color: #999999; | ||
| 211 | +//} | ||
| 212 | + | ||
| 207 | .control-form { | 213 | .control-form { |
| 208 | .el-radio { | 214 | .el-radio { |
| 209 | width: 100%; | 215 | width: 100%; |
| @@ -218,6 +224,16 @@ body { | @@ -218,6 +224,16 @@ body { | ||
| 218 | color: #fafafa; | 224 | color: #fafafa; |
| 219 | } | 225 | } |
| 220 | 226 | ||
| 227 | +.bjs-container { | ||
| 228 | + height: 400px !important; // TODO 芋艿:bjs 容器的高度不对,临时改下 | ||
| 229 | +} | ||
| 230 | +.process-panel__container { // TODO 芋艿:右边的位置不对,临时改下 | ||
| 231 | + margin-top: -200px; | ||
| 232 | + float: right; | ||
| 233 | + height: 800px; | ||
| 234 | + z-index: 2147483647 !important; | ||
| 235 | +} | ||
| 236 | + | ||
| 221 | body, | 237 | body, |
| 222 | body * { | 238 | body * { |
| 223 | /* 滚动条 */ | 239 | /* 滚动条 */ |
yudao-admin-ui/src/views/bpm/model/translations.js deleted
| 1 | -/** | ||
| 2 | - * This is a sample file that should be replaced with the actual translation. | ||
| 3 | - * | ||
| 4 | - * Checkout https://github.com/bpmn-io/bpmn-js-i18n for a list of available | ||
| 5 | - * translations and labels to translate. | ||
| 6 | - */ | ||
| 7 | -export default { | ||
| 8 | - "Exclusive Gateway": "Exklusives Gateway", | ||
| 9 | - "Parallel Gateway": "Paralleles Gateway", | ||
| 10 | - "Inclusive Gateway": "Inklusives Gateway", | ||
| 11 | - "Complex Gateway": "Komplexes Gateway", | ||
| 12 | - "Event based Gateway": "Ereignis-basiertes Gateway", | ||
| 13 | - "Message Start Event": "消息启动事件", | ||
| 14 | - "Timer Start Event": "定时启动事件", | ||
| 15 | - "Conditional Start Event": "条件启动事件", | ||
| 16 | - "Signal Start Event": "信号启动事件", | ||
| 17 | - "Error Start Event": "错误启动事件", | ||
| 18 | - "Escalation Start Event": "升级启动事件", | ||
| 19 | - "Compensation Start Event": "补偿启动事件", | ||
| 20 | - "Message Start Event (non-interrupting)": "消息启动事件 (非中断)", | ||
| 21 | - "Timer Start Event (non-interrupting)": "定时启动事件 (非中断)", | ||
| 22 | - "Conditional Start Event (non-interrupting)": "条件启动事件 (非中断)", | ||
| 23 | - "Signal Start Event (non-interrupting)": "信号启动事件 (非中断)", | ||
| 24 | - "Escalation Start Event (non-interrupting)": "升级启动事件 (非中断)" | ||
| 25 | -}; |