tianheng-ui 0.0.66 → 0.0.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.0.66",
4
+ "version": "0.0.68",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -8,7 +8,7 @@
8
8
  export default {
9
9
  name: "ThCol",
10
10
  props: {
11
- span: { type: Number, default: 24 },
11
+ span: { type: Number | String, default: 24 },
12
12
  offset: Number
13
13
  },
14
14
  computed: {
@@ -39,5 +39,5 @@ export default {
39
39
  </script>
40
40
 
41
41
  <style lang="scss">
42
- @import "../../lib/theme-chalk/styles/col.scss"
42
+ @import "../../lib/theme-chalk/styles/col.scss";
43
43
  </style>
@@ -0,0 +1,8 @@
1
+ import Grid from "./index.vue";
2
+
3
+ /* istanbul ignore next */
4
+ Grid.install = function(Vue) {
5
+ Vue.component(Grid.name, Grid);
6
+ };
7
+
8
+ export default Grid;
@@ -0,0 +1,19 @@
1
+ <template>
2
+ <div class="th-grid">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ name: "ThGrid",
10
+ props: {
11
+ column: Number | String
12
+ },
13
+ data() {
14
+ return {};
15
+ },
16
+ mounted() {},
17
+ methods: {}
18
+ };
19
+ </script>
@@ -0,0 +1,8 @@
1
+ import GridItem from "./index.vue";
2
+
3
+ /* istanbul ignore next */
4
+ GridItem.install = function(Vue) {
5
+ Vue.component(GridItem.name, Grid);
6
+ };
7
+
8
+ export default GridItem;
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div class="th-grid-item" :style="selfStyle">
3
+ <slot v-if="$slots.default"></slot>
4
+ <div v-else class="th-grid-item-content">
5
+ <i v-if="isIcon" :class="['th-icon',icon]"></i>
6
+ <img v-else class="th-grid-item-img" src="" alt="" />
7
+ <p class="th-grid-item-title">{{ title }}</p>
8
+ <p class="th-grid-item-label">{{ label }}</p>
9
+ </div>
10
+ </div>
11
+ </template>
12
+
13
+ <script>
14
+ export default {
15
+ name: "ThGridItem",
16
+ props: {
17
+ title: String,
18
+ label: String,
19
+ icon: String
20
+ },
21
+ data() {
22
+ return {};
23
+ },
24
+ computed: {
25
+ isIcon() {
26
+ if (this.icon && this.icon.substring(0, 4) === "http") return false;
27
+ else return true;
28
+ },
29
+ selfStyle() {
30
+ let parent = this.$parent;
31
+ while (parent && parent.$options.name !== "ThGrid") {
32
+ parent = parent.$parent;
33
+ }
34
+
35
+ let column = 0;
36
+ if (parent) column = parent.column;
37
+
38
+ const style = {};
39
+ if (column) {
40
+ style.flex = 'none'
41
+ style.flexBasis = `${100 / column}%`;
42
+ }
43
+ return style;
44
+ }
45
+ },
46
+ mounted() {},
47
+ methods: {}
48
+ };
49
+ </script>
@@ -216,7 +216,7 @@ export default {
216
216
  handleSizeChange(val) {
217
217
  this.pageInfo.pageSize = val;
218
218
  this.$emit(
219
- "page-number-change",
219
+ "pagination-change",
220
220
  this.pageInfo.currentPage,
221
221
  this.pageInfo.pageSize
222
222
  );
@@ -225,7 +225,7 @@ export default {
225
225
  handleCurrentChange(val) {
226
226
  this.pageInfo.currentPage = val;
227
227
  this.$emit(
228
- "page-number-change",
228
+ "pagination-change",
229
229
  this.pageInfo.currentPage,
230
230
  this.pageInfo.pageSize
231
231
  );
@@ -235,7 +235,7 @@ export default {
235
235
  if (this.pageInfo.currentPage === 1) return;
236
236
  this.pageInfo.currentPage -= 1;
237
237
  this.$emit(
238
- "page-number-change",
238
+ "pagination-change",
239
239
  this.pageInfo.currentPage,
240
240
  this.pageInfo.pageSize
241
241
  );
@@ -245,7 +245,7 @@ export default {
245
245
  if (this.pageInfo.currentPage === this.pageInfo.pageCount) return;
246
246
  this.pageInfo.currentPage += 1;
247
247
  this.$emit(
248
- "page-number-change",
248
+ "pagination-change",
249
249
  this.pageInfo.currentPage,
250
250
  this.pageInfo.pageSize
251
251
  );
@@ -0,0 +1,8 @@
1
+ import VueEditor from "./index.vue";
2
+
3
+ /* istanbul ignore next */
4
+ VueEditor.install = function(Vue) {
5
+ Vue.component(VueEditor.name, VueEditor);
6
+ };
7
+
8
+ export default VueEditor;
@@ -0,0 +1,31 @@
1
+ <template>
2
+ <vue-editor v-model="data" :disabled="disabled"> </vue-editor>
3
+ </template>
4
+
5
+ <script>
6
+ import { VueEditor } from "vue2-editor";
7
+ export default {
8
+ name: "ThVueEditor",
9
+ components: { VueEditor },
10
+ model: {
11
+ prop: "value",
12
+ event: "uploadValue"
13
+ },
14
+ props: {
15
+ value: String,
16
+ disabled: String
17
+ },
18
+ data() {
19
+ return {
20
+ data: this.value
21
+ };
22
+ },
23
+ watch: {
24
+ data(val) {
25
+ this.$emit("uploadValue", val);
26
+ }
27
+ }
28
+ };
29
+ </script>
30
+
31
+ <style></style>
@@ -3,24 +3,32 @@ import "bpmn-js/dist/assets/diagram-js.css";
3
3
  import "bpmn-js/dist/assets/bpmn-font/css/bpmn.css";
4
4
  import "bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css";
5
5
 
6
- import MyProcessDesigner from "./designer";
7
- import MyProcessPalette from "./palette";
8
- import MyProcessPenal from "./penal";
6
+ // import MyProcessDesigner from "./designer";
7
+ // import MyProcessPalette from "./palette";
8
+ // import MyProcessPenal from "./penal";
9
9
 
10
- const components = [MyProcessDesigner, MyProcessPenal, MyProcessPalette];
10
+ // const components = [MyProcessDesigner, MyProcessPenal, MyProcessPalette];
11
11
 
12
- const install = function(Vue) {
13
- components.forEach(component => {
14
- Vue.component(component.name, component);
15
- });
16
- };
12
+ // const install = function(Vue) {
13
+ // components.forEach(component => {
14
+ // Vue.component(component.name, component);
15
+ // });
16
+ // };
17
+
18
+ // if (typeof window !== "undefined" && window.Vue) {
19
+ // install(window.Vue);
20
+ // }
17
21
 
18
- if (typeof window !== "undefined" && window.Vue) {
19
- install(window.Vue);
20
- }
22
+ // export default {
23
+ // version: "0.0.1",
24
+ // install,
25
+ // ...components
26
+ // };
21
27
 
22
- export default {
23
- version: "0.0.1",
24
- install,
25
- ...components
28
+ import Workflow from "./index.vue";
29
+
30
+ Workflow.install = function(Vue) {
31
+ Vue.component(Workflow.name, Workflow);
26
32
  };
33
+
34
+ export default Workflow;
@@ -21,7 +21,7 @@
21
21
  }
22
22
  "
23
23
  />
24
- <my-properties-panel
24
+ <my-process-panel
25
25
  :key="`penal-${reloadIndex}`"
26
26
  :bpmn-modeler="modeler"
27
27
  :prefix="controlForm.prefix"
@@ -167,9 +167,13 @@ import minimapModule from "diagram-js-minimap";
167
167
  // clickoutside
168
168
  import clickoutside from "element-ui/lib/utils/clickoutside";
169
169
 
170
+ import MyProcessDesigner from "./designer/ProcessDesigner.vue";
171
+ import MyProcessPalette from "./palette/ProcessPalette.vue";
172
+ import MyProcessPanel from "./penal/PropertiesPanel.vue";
173
+
170
174
  export default {
171
175
  name: "th-workflow",
172
- components: {},
176
+ components: { MyProcessDesigner, MyProcessPalette, MyProcessPanel },
173
177
  directives: {
174
178
  clickoutside: clickoutside
175
179
  },
@@ -113,7 +113,6 @@ import Log from "../Log";
113
113
  * @Date 2021年3月31日18:57:51
114
114
  */
115
115
  export default {
116
- name: "MyPropertiesPanel",
117
116
  components: {
118
117
  // UserTaskListeners,
119
118
  // ElementForm,
@@ -124,28 +123,27 @@ export default {
124
123
  // ElementMultiInstance,
125
124
  ElementTask,
126
125
  // ElementOtherConfig,
127
- ElementBaseInfo,
126
+ ElementBaseInfo
128
127
  },
129
- componentName: "MyPropertiesPanel",
130
128
  props: {
131
129
  bpmnModeler: Object,
132
130
  prefix: {
133
131
  type: String,
134
- default: "camunda",
132
+ default: "camunda"
135
133
  },
136
134
  width: {
137
135
  type: Number,
138
- default: 400,
136
+ default: 400
139
137
  },
140
138
  idEditDisabled: {
141
139
  type: Boolean,
142
- default: false,
143
- },
140
+ default: false
141
+ }
144
142
  },
145
143
  provide() {
146
144
  return {
147
145
  prefix: this.prefix,
148
- width: this.width,
146
+ width: this.width
149
147
  };
150
148
  },
151
149
  data() {
@@ -155,15 +153,15 @@ export default {
155
153
  elementType: "",
156
154
  elementBusinessObject: {}, // 元素 businessObject 镜像,提供给需要做判断的组件使用
157
155
  conditionFormVisible: false, // 流转条件设置
158
- formVisible: false, // 表单配置
156
+ formVisible: false // 表单配置
159
157
  };
160
158
  },
161
159
  watch: {
162
160
  elementId: {
163
161
  handler() {
164
162
  this.activeTab = "base";
165
- },
166
- },
163
+ }
164
+ }
167
165
  },
168
166
  created() {
169
167
  this.initModels();
@@ -186,14 +184,14 @@ export default {
186
184
  elementFactory: this.bpmnModeler.get("elementFactory"),
187
185
  elementRegistry: this.bpmnModeler.get("elementRegistry"),
188
186
  replace: this.bpmnModeler.get("replace"),
189
- selection: this.bpmnModeler.get("selection"),
187
+ selection: this.bpmnModeler.get("selection")
190
188
  };
191
189
  this.getActiveElement();
192
190
  },
193
191
  getActiveElement() {
194
192
  // 初始第一个选中元素 bpmn:Process
195
193
  this.initFormOnChanged(null);
196
- this.bpmnModeler.on("import.done", (e) => {
194
+ this.bpmnModeler.on("import.done", e => {
197
195
  this.initFormOnChanged(null);
198
196
  });
199
197
  // 监听选择事件,修改当前激活的元素以及表单
@@ -213,10 +211,10 @@ export default {
213
211
  if (!activatedElement) {
214
212
  activatedElement =
215
213
  window.bpmnInstances.elementRegistry.find(
216
- (el) => el.type === "bpmn:Process"
214
+ el => el.type === "bpmn:Process"
217
215
  ) ??
218
216
  window.bpmnInstances.elementRegistry.find(
219
- (el) => el.type === "bpmn:Collaboration"
217
+ el => el.type === "bpmn:Collaboration"
220
218
  );
221
219
  }
222
220
  if (!activatedElement) return;
@@ -241,7 +239,7 @@ export default {
241
239
  },
242
240
  beforeDestroy() {
243
241
  window.bpmnInstances = null;
244
- },
245
- },
242
+ }
243
+ }
246
244
  };
247
245
  </script>
package/packages/index.js CHANGED
@@ -29,7 +29,10 @@ import TableTools from "./Table/tools.js";
29
29
  import Empty from "./Empty/index.js";
30
30
  import Dialog from "./Dialog/index.js";
31
31
  import Card from "./Card/index.js";
32
+ import Grid from "./Grid/index.js";
33
+ import GridItem from "./GridItem/index.js";
32
34
  import CodeEditor from "./CodeEditor/index.js";
35
+ import VueEditor from "./VueEditor/index.js";
33
36
  import Button from "./Button/index.js";
34
37
  import Image from "./Image/index.js";
35
38
  import ImagePreview from "./ImagePreview/index.js";
@@ -38,7 +41,7 @@ import Col from "./Col/index.js";
38
41
  import Upload from "./Upload/index.js";
39
42
  import FormMaking from "./FormMaking/making.js";
40
43
  import FormGenerate from "./FormMaking/generate.js";
41
- // import Workflow from "../packages/Workflow/index.js";
44
+ import Workflow from "../packages/Workflow/index.js";
42
45
 
43
46
  const components = [
44
47
  Cell,
@@ -50,7 +53,10 @@ const components = [
50
53
  Empty,
51
54
  Dialog,
52
55
  Card,
56
+ Grid,
57
+ GridItem,
53
58
  CodeEditor,
59
+ VueEditor,
54
60
  Button,
55
61
  Image,
56
62
  ImagePreview,
@@ -58,8 +64,8 @@ const components = [
58
64
  Col,
59
65
  Upload,
60
66
  FormMaking,
61
- FormGenerate
62
- // Workflow
67
+ FormGenerate,
68
+ Workflow
63
69
  ];
64
70
 
65
71
  const install = function(Vue, opts = {}) {
@@ -90,7 +96,10 @@ export default {
90
96
  Empty,
91
97
  Dialog,
92
98
  Card,
99
+ Grid,
100
+ GridItem,
93
101
  CodeEditor,
102
+ VueEditor,
94
103
  Button,
95
104
  Image,
96
105
  ImagePreview,
@@ -98,7 +107,8 @@ export default {
98
107
  Col,
99
108
  Upload,
100
109
  FormMaking,
101
- FormGenerate
110
+ FormGenerate,
111
+ Workflow
102
112
  };
103
113
 
104
114
  export {
@@ -112,7 +122,10 @@ export {
112
122
  Empty,
113
123
  Dialog,
114
124
  Card,
125
+ Grid,
126
+ GridItem,
115
127
  CodeEditor,
128
+ VueEditor,
116
129
  Button,
117
130
  Image,
118
131
  ImagePreview,
@@ -120,5 +133,6 @@ export {
120
133
  Col,
121
134
  Upload,
122
135
  FormMaking,
123
- FormGenerate
136
+ FormGenerate,
137
+ Workflow
124
138
  };