tianheng-ui 0.0.60 → 0.0.63

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,15 +1,15 @@
1
1
  {
2
2
  "name": "tianheng-ui",
3
3
  "description": "A Vue.js project",
4
- "version": "0.0.60",
4
+ "version": "0.0.63",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
8
8
  "main": "./lib/tianheng-ui.js",
9
9
  "scripts": {
10
10
  "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
11
- "build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
12
- "build:npm": "cross-env NODE_ENV=npm webpack --progress --hide-modules"
11
+ "build": "cross-env NODE_ENV=preview webpack --progress --hide-modules --mode=production",
12
+ "build:npm": "cross-env NODE_ENV=production webpack --progress --hide-modules --mode=production"
13
13
  },
14
14
  "dependencies": {
15
15
  "ace-builds": "^1.4.13",
@@ -22,10 +22,9 @@
22
22
  "element-ui": "^2.15.6",
23
23
  "highlight.js": "^10.5.0",
24
24
  "min-dash": "^3.5.2",
25
- "mini-css-extract-plugin": "^2.6.1",
25
+ "mini-css-extract-plugin": "^1.6.2",
26
26
  "normalize.css": "^8.0.1",
27
27
  "nprogress": "^0.2.0",
28
- "vant": "^2.12.50",
29
28
  "viewerjs": "^1.10.5",
30
29
  "vue": "^2.5.11",
31
30
  "vue-i18n": "^5.0.3",
@@ -52,6 +51,7 @@
52
51
  "@types/ace": "0.0.42",
53
52
  "@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
54
53
  "@vue/babel-preset-jsx": "^1.4.0",
54
+ "autoprefixer": "^10.4.13",
55
55
  "babel-loader": "^8.2.5",
56
56
  "babel-plugin-import": "^1.13.5",
57
57
  "bpmn-js": "^8.8.3",
@@ -63,8 +63,10 @@
63
63
  "html-webpack-plugin": "^4.5.0",
64
64
  "less": "^3.9.0",
65
65
  "less-loader": "^4.1.0",
66
+ "postcss-loader": "^4.3.0",
66
67
  "sass": "^1.55.0",
67
68
  "sass-loader": "^7.3.1",
69
+ "style-loader": "^2.0.0",
68
70
  "uglifyjs-webpack-plugin": "^2.2.0",
69
71
  "vue-loader": "^14.2.4",
70
72
  "vue-template-compiler": "^2.4.4",
@@ -20,7 +20,7 @@
20
20
  export default {
21
21
  name: "ThEmpty",
22
22
  props: {
23
- image: { type: String, default: require("./images/notData.png") },
23
+ image: { type: String, default: "" },
24
24
  imageSize: { type: Number, default: 300 },
25
25
  description: { type: String, default: "暂无数据" }
26
26
  },
@@ -1,24 +1,24 @@
1
1
  <template>
2
- <div>
2
+ <div v-if="formJson.config">
3
3
  <el-form
4
4
  class="generateForm"
5
- :class="{ 'form-hideLabel': data.config.hideLabel }"
5
+ :class="{ 'form-hideLabel': formJson.config.hideLabel }"
6
6
  :style="{ width: formWidth }"
7
- :label-suffix="data.config.labelSuffix"
8
- :size="data.config.size"
7
+ :label-suffix="formJson.config.labelSuffix"
8
+ :size="formJson.config.size"
9
9
  :model="models"
10
- :label-position="data.config.labelPosition"
11
- :label-width="data.config.labelWidth + 'px'"
10
+ :label-position="formJson.config.labelPosition"
11
+ :label-width="formJson.config.labelWidth + 'px'"
12
12
  ref="generateForm"
13
13
  >
14
14
  <genetate-form-item
15
- v-for="item in data.list"
15
+ v-for="item in formJson.list"
16
16
  :key="item.key"
17
17
  :models.sync="models"
18
18
  :widget="item"
19
19
  :slotKeys="slotKeys"
20
20
  :remote="remote"
21
- :config="data.config"
21
+ :config="formJson.config"
22
22
  :prop="item.type === 'grid' ? '' : item.model"
23
23
  :componentsData="componentsData"
24
24
  @input-change="onInputChange"
@@ -31,21 +31,21 @@
31
31
  <!-- <van-form
32
32
  v-else
33
33
  class="generateForm"
34
- :class="{ 'form-hideLabel': data.config.hideLabel }"
34
+ :class="{ 'form-hideLabel': formJson.config.hideLabel }"
35
35
  :style="{ width: formWidth }"
36
36
  style="margin: 0 auto;"
37
- :label-align="data.config.labelPosition"
38
- :label-width="data.config.labelWidth + 'px'"
37
+ :label-align="formJson.config.labelPosition"
38
+ :label-width="formJson.config.labelWidth + 'px'"
39
39
  ref="generateForm"
40
40
  >
41
41
  <genetate-form-item-h5
42
- v-for="item in data.list"
42
+ v-for="item in formJson.list"
43
43
  :key="item.key"
44
44
  :models.sync="models"
45
45
  :widget="item"
46
46
  :slotKeys="slotKeys"
47
47
  :remote="remote"
48
- :config="data.config"
48
+ :config="formJson.config"
49
49
  :prop="item.type === 'grid' ? '' : item.model"
50
50
  :componentsData="componentsData"
51
51
  @input-change="onInputChange"
@@ -60,35 +60,80 @@
60
60
 
61
61
  <script>
62
62
  import GenetateFormItem from "./GenerateFormItem";
63
- import GenetateFormItemH5 from "./GenerateFormItemH5";
64
- import Vue from "vue";
65
- import { Form } from "vant";
66
- Vue.use(Form);
63
+ // import GenetateFormItemH5 from "./GenerateFormItemH5";
64
+ // import Vue from "vue";
65
+ // import { Form } from "vant";
66
+ // Vue.use(Form);
67
67
 
68
68
  export default {
69
69
  name: "th-generate-form",
70
- components: { GenetateFormItem, GenetateFormItemH5 },
71
- props: ["data", "remote", "value", "insite", "slotKeys", "client"],
70
+ components: { GenetateFormItem },
71
+ props: {
72
+ data: {
73
+ type: Object,
74
+ default: () => {
75
+ return {};
76
+ }
77
+ },
78
+ remote: {
79
+ type: Object,
80
+ default: () => {
81
+ return {};
82
+ }
83
+ },
84
+ value: {
85
+ type: Object,
86
+ default: () => {
87
+ return {};
88
+ }
89
+ },
90
+ slotKeys: {
91
+ type: Array,
92
+ default: () => {
93
+ return [];
94
+ }
95
+ },
96
+ client: String
97
+ },
72
98
  data() {
73
99
  return {
100
+ formJson: this.data,
74
101
  models: {},
75
102
  componentsData: []
76
103
  };
77
104
  },
78
105
  computed: {
79
106
  formWidth() {
80
- if (this.data.config.width) return this.data.config.width;
107
+ if (this.formJson.config.width) return this.formJson.config.width;
81
108
  if (this.client === "mobile") return "375px";
82
109
 
83
110
  return "";
84
111
  }
85
112
  },
113
+ watch: {
114
+ data(val) {
115
+ this.formJson = val;
116
+ },
117
+ formJson: {
118
+ handler(val) {
119
+ this.$emit("update:data", val);
120
+ },
121
+ deep: true
122
+ },
123
+ value: {
124
+ deep: true,
125
+ handler(val) {
126
+ this.models = { ...this.models, ...val };
127
+ }
128
+ }
129
+ },
86
130
  created() {
87
- this.generateModle(this.data.list);
131
+ this.generateModle(this.formJson.list);
88
132
  },
89
133
  mounted() {},
90
134
  methods: {
91
135
  generateModle(genList, modelObj) {
136
+ if (!genList) return;
92
137
  genList.map(item => {
93
138
  if (item.type === "grid") {
94
139
  item.columns.forEach(item => {
@@ -185,20 +230,9 @@ export default {
185
230
  onInputChange(value, field) {
186
231
  this.$emit("on-change", field, value, this.models);
187
232
  },
188
- refresh() {}
189
- },
190
- watch: {
191
- data: {
192
- deep: true,
193
- handler(val) {
194
- // this.generateModle(val.list);
195
- }
196
- },
197
- value: {
198
- deep: true,
199
- handler(val) {
200
- this.models = { ...this.models, ...val };
201
- }
233
+ setJSON(json) {
234
+ this.formJson = json;
235
+ this.generateModle(this.formJson.list);
202
236
  }
203
237
  }
204
238
  };
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <el-button
2
+ <th-button
3
3
  :style="{
4
4
  width: widget.options.width,
5
5
  height: widget.options.height
@@ -14,7 +14,7 @@
14
14
  :icon="widget.options.buttonIcon"
15
15
  >
16
16
  {{ widget.options.defaultValue }}
17
- </el-button>
17
+ </th-button>
18
18
  </template>
19
19
 
20
20
  <script>
@@ -25,9 +25,6 @@
25
25
 
26
26
  <script>
27
27
  import { itemsComponent } from "../mixins/index";
28
- import Vue from "vue";
29
- import { Field } from "vant";
30
- Vue.use(Field);
31
28
  export default {
32
29
  mixins: [itemsComponent]
33
30
  };
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Cell : 单元格
3
+ * Icons : 图标选择器
4
+ * Table : 表格
5
+ * TableAction : 表格行操作
6
+ * TableSearch :表格搜索
7
+ * TableTools :表格公共操作
8
+ * Empty : 空状态
9
+ * Dialog : 对话框
10
+ * Card : 卡片
11
+ * CodeEditor : 编辑器
12
+ * Button : 按钮
13
+ * Image : 图片
14
+ * ImagePreview : 大图预览
15
+ * Row : loyout行
16
+ * Col : loyout列
17
+ * Upload : 上传
18
+ * MakingForm : 表单设计器
19
+ * GenerateForm : 表单渲染器
20
+ * Workflow : 工作流设计
21
+ */
22
+
23
+ import Cell from "./cell/index.js";
24
+ import Icons from "./icons/index.js";
25
+ import Table from "./table/index.js";
26
+ import TableAction from "./table/action.js";
27
+ import TableSearch from "./table/search.js";
28
+ import TableTools from "./table/tools.js";
29
+ import Empty from "./empty/index.js";
30
+ import Dialog from "./dialog/index.js";
31
+ import Card from "./card/index.js";
32
+ import CodeEditor from "./CodeEditor/index.js";
33
+ import Button from "./Button/index.js";
34
+ import Image from "./Image/index.js";
35
+ import ImagePreview from "./ImagePreview/index.js";
36
+ import Row from "./Row/index.js";
37
+ import Col from "./Col/index.js";
38
+ import Upload from "./Upload/index.js";
39
+ import { MakingForm, GenerateForm } from "./formMaking/index.js";
40
+ // import Workflow from "../workflow/index.js";
41
+
42
+ const components = [
43
+ Cell,
44
+ Icons,
45
+ Table,
46
+ TableAction,
47
+ TableSearch,
48
+ TableTools,
49
+ Empty,
50
+ Dialog,
51
+ Card,
52
+ CodeEditor,
53
+ Button,
54
+ Image,
55
+ ImagePreview,
56
+ Row,
57
+ Col,
58
+ Upload,
59
+ MakingForm,
60
+ GenerateForm
61
+ // Workflow
62
+ ];
63
+
64
+ const install = function(Vue, opts = {}) {
65
+ components.forEach(component => {
66
+ Vue.component(component.name, component);
67
+ });
68
+
69
+ Vue.prototype.$TIANHENG = {
70
+ size: opts.size || '',
71
+ zIndex: opts.zIndex || 2000
72
+ };
73
+ };
74
+
75
+ if (typeof window !== "undefined" && window.Vue) {
76
+ install(window.Vue);
77
+ }
78
+
79
+ export default {
80
+ version: "0.0.63",
81
+ install,
82
+ ...components
83
+ };
package/lib/index.js DELETED
@@ -1,78 +0,0 @@
1
- /**
2
- * Cell : 单元格
3
- * Icons : 图标选择器
4
- * Table : 表格
5
- * TableAction : 表格行操作
6
- * TableSearch :表格搜索
7
- * TableTools :表格公共操作
8
- * Empty : 空状态
9
- * Dialog : 对话框
10
- * Card : 卡片
11
- * CodeEditor : 编辑器
12
- * Button : 按钮
13
- * Image : 图片
14
- * ImagePreview : 大图预览
15
- * Row : loyout行
16
- * Col : loyout列
17
- * Upload : 上传
18
- * MakingForm : 表单设计器
19
- * GenerateForm : 表单渲染器
20
- * Workflow : 工作流设计
21
- */
22
-
23
- import Cell from "../packages/cell/index.js";
24
- import Icons from "../packages/icons/index.js";
25
- import Table from "../packages/table/index.js";
26
- import TableAction from "../packages/table/action.js";
27
- import TableSearch from "../packages/table/search.js";
28
- import TableTools from "../packages/table/tools.js";
29
- import Empty from "../packages/empty/index.js";
30
- import Dialog from "../packages/dialog/index.js";
31
- import Card from "../packages/card/index.js";
32
- import CodeEditor from "../packages/CodeEditor/index.js";
33
- import Button from "../packages/Button/index.js";
34
- import Image from "../packages/Image/index.js";
35
- import ImagePreview from "../packages/ImagePreview/index.js";
36
- import Row from "../packages/Row/index.js";
37
- import Col from "../packages/Col/index.js";
38
- import Upload from "../packages/Upload/index.js";
39
- import { MakingForm, GenerateForm } from "../packages/formMaking/index.js";
40
- // import Workflow from "../packages/workflow/index.js";
41
-
42
- const components = [
43
- Cell,
44
- Icons,
45
- Table,
46
- TableAction,
47
- TableSearch,
48
- TableTools,
49
- Empty,
50
- Dialog,
51
- Card,
52
- CodeEditor,
53
- Button,
54
- Image,
55
- ImagePreview,
56
- Row,
57
- Col,
58
- Upload,
59
- MakingForm,
60
- GenerateForm,
61
- // Workflow
62
- ];
63
-
64
- const install = function(Vue) {
65
- components.forEach(component => {
66
- Vue.component(component.name, component);
67
- });
68
- };
69
-
70
- if (typeof window !== "undefined" && window.Vue) {
71
- install(window.Vue);
72
- }
73
-
74
- export default {
75
- version: "0.0.60",
76
- install,
77
- ...components
78
- };
Binary file