tianheng-ui 0.0.41 → 0.0.44

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.41",
4
+ "version": "0.0.44",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -29,6 +29,7 @@
29
29
  "not ie <= 8"
30
30
  ],
31
31
  "devDependencies": {
32
+ "@types/ace": "0.0.42",
32
33
  "babel-core": "^6.26.0",
33
34
  "babel-loader": "^7.1.2",
34
35
  "babel-preset-env": "^1.6.0",
@@ -7,7 +7,7 @@
7
7
  <div class="components-list">
8
8
  <template v-if="basicFields.length">
9
9
  <div class="widget-cate">
10
- {{ $t("fm.components.basic.title") }}
10
+ 基础字段
11
11
  </div>
12
12
  <draggable
13
13
  tag="ul"
@@ -38,7 +38,7 @@
38
38
  </template>
39
39
  <template v-if="advanceFields.length">
40
40
  <div class="widget-cate">
41
- {{ $t("fm.components.advance.title") }}
41
+ 高级字段
42
42
  </div>
43
43
  <draggable
44
44
  tag="ul"
@@ -70,7 +70,7 @@
70
70
 
71
71
  <template v-if="layoutFields.length">
72
72
  <div class="widget-cate">
73
- {{ $t("fm.components.layout.title") }}
73
+ 布局字段
74
74
  </div>
75
75
  <draggable
76
76
  tag="ul"
@@ -109,7 +109,7 @@
109
109
  size="medium"
110
110
  icon="el-icon-upload2"
111
111
  @click="handleUpload"
112
- >{{ $t("fm.actions.import") }}</el-button
112
+ >导入JSON</el-button
113
113
  >
114
114
  <el-button
115
115
  v-if="clearable"
@@ -117,7 +117,7 @@
117
117
  size="medium"
118
118
  icon="el-icon-delete"
119
119
  @click="handleClear"
120
- >{{ $t("fm.actions.clear") }}</el-button
120
+ >清空</el-button
121
121
  >
122
122
  <el-button
123
123
  v-if="preview"
@@ -125,7 +125,7 @@
125
125
  size="medium"
126
126
  icon="el-icon-view"
127
127
  @click="handlePreview"
128
- >{{ $t("fm.actions.preview") }}</el-button
128
+ >预览</el-button
129
129
  >
130
130
  <el-button
131
131
  v-if="generateJson"
@@ -133,7 +133,7 @@
133
133
  size="medium"
134
134
  icon="el-icon-tickets"
135
135
  @click="handleGenerateJson"
136
- >{{ $t("fm.actions.json") }}</el-button
136
+ >生成JSON</el-button
137
137
  >
138
138
  <el-button
139
139
  v-if="generateCode"
@@ -141,7 +141,7 @@
141
141
  size="medium"
142
142
  icon="el-icon-document"
143
143
  @click="handleGenerateCode"
144
- >{{ $t("fm.actions.code") }}</el-button
144
+ >生成代码</el-button
145
145
  >
146
146
  </el-header>
147
147
  <el-main :class="{ 'widget-empty': widgetForm.list.length == 0 }">
@@ -162,14 +162,14 @@
162
162
  :class="{ active: configTab == 'widget' }"
163
163
  @click="handleConfigSelect('widget')"
164
164
  >
165
- {{ $t("fm.config.widget.title") }}
165
+ 字段属性
166
166
  </div>
167
167
  <div
168
168
  class="config-tab"
169
169
  :class="{ active: configTab == 'form' }"
170
170
  @click="handleConfigSelect('form')"
171
171
  >
172
- {{ $t("fm.config.form.title") }}
172
+ 表单属性
173
173
  </div>
174
174
  </el-header>
175
175
  <el-main class="config-content">
@@ -216,12 +216,8 @@
216
216
  </generate-form>
217
217
 
218
218
  <template slot="action">
219
- <el-button type="primary" @click="handleTest">{{
220
- $t("fm.actions.getData")
221
- }}</el-button>
222
- <el-button @click="handleReset">{{
223
- $t("fm.actions.reset")
224
- }}</el-button>
219
+ <el-button type="primary" @click="handleTest">获取数据</el-button>
220
+ <el-button @click="handleReset">重置</el-button>
225
221
  </template>
226
222
  </cus-dialog>
227
223
 
@@ -235,7 +231,7 @@
235
231
  >
236
232
  <el-alert
237
233
  type="info"
238
- :title="$t('fm.description.uploadJsonInfo')"
234
+ title="JSON格式如下,直接复制生成的json覆盖此处代码点击确定即可"
239
235
  ></el-alert>
240
236
  <div id="uploadeditor" style="height: 400px;width: 100%;">
241
237
  {{ jsonEg }}
@@ -258,7 +254,7 @@
258
254
  type="primary"
259
255
  class="json-btn"
260
256
  :data-clipboard-text="jsonCopyValue"
261
- >{{ $t("fm.actions.copyData") }}</el-button
257
+ >复制数据</el-button
262
258
  >
263
259
  </template>
264
260
  </cus-dialog>
@@ -439,29 +435,29 @@ export default {
439
435
  };
440
436
  },
441
437
  mounted() {
442
- this._loadComponents();
438
+ // this._loadComponents();
443
439
  },
444
440
  methods: {
445
- _loadComponents() {
446
- this.basicComponents = this.basicComponents.map(item => {
447
- return {
448
- ...item,
449
- name: this.$t(`fm.components.fields.${item.type}`)
450
- };
451
- });
452
- this.advanceComponents = this.advanceComponents.map(item => {
453
- return {
454
- ...item,
455
- name: this.$t(`fm.components.fields.${item.type}`)
456
- };
457
- });
458
- this.layoutComponents = this.layoutComponents.map(item => {
459
- return {
460
- ...item,
461
- name: this.$t(`fm.components.fields.${item.type}`)
462
- };
463
- });
464
- },
441
+ // _loadComponents() {
442
+ // this.basicComponents = this.basicComponents.map(item => {
443
+ // return {
444
+ // ...item,
445
+ // name: this.$t(`fm.components.fields.${item.type}`)
446
+ // };
447
+ // });
448
+ // this.advanceComponents = this.advanceComponents.map(item => {
449
+ // return {
450
+ // ...item,
451
+ // name: this.$t(`fm.components.fields.${item.type}`)
452
+ // };
453
+ // });
454
+ // this.layoutComponents = this.layoutComponents.map(item => {
455
+ // return {
456
+ // ...item,
457
+ // name: this.$t(`fm.components.fields.${item.type}`)
458
+ // };
459
+ // });
460
+ // },
465
461
  handleGoGithub() {
466
462
  window.location.href = "https://github.com/GavinZhuLei/vue-form-making";
467
463
  },
@@ -469,16 +465,16 @@ export default {
469
465
  this.configTab = value;
470
466
  },
471
467
  handleMoveEnd(evt) {
472
- console.log("end", evt);
468
+ // console.log("end", evt);
473
469
  },
474
470
  handleMoveStart({ oldIndex }) {
475
- console.log("start", oldIndex, this.basicComponents);
471
+ // console.log("start", oldIndex, this.basicComponents);
476
472
  },
477
473
  handleMove() {
478
474
  return true;
479
475
  },
480
476
  handlePreview() {
481
- console.log(this.widgetForm);
477
+ // console.log(this.widgetForm);
482
478
  this.previewVisible = true;
483
479
  },
484
480
  handleTest() {
@@ -506,7 +502,7 @@ export default {
506
502
  if (!this.jsonClipboard) {
507
503
  this.jsonClipboard = new Clipboard(".json-btn");
508
504
  this.jsonClipboard.on("success", e => {
509
- this.$message.success(this.$t("fm.message.copySuccess"));
505
+ this.$message.success("复制成功");
510
506
  });
511
507
  }
512
508
  this.jsonCopyValue = JSON.stringify(this.widgetForm);
@@ -570,18 +566,18 @@ export default {
570
566
  }
571
567
  },
572
568
  handleInput(val) {
573
- console.log(val);
569
+ // console.log(val);
574
570
  this.blank = val;
575
571
  },
576
572
  handleDataChange(field, value, data) {
577
- console.log(field, value, data);
573
+ // console.log(field, value, data);
578
574
  }
579
575
  },
580
576
  watch: {
581
577
  widgetForm: {
582
578
  deep: true,
583
579
  handler: function(val) {
584
- console.log(this.$refs.widgetForm);
580
+ // console.log(this.$refs.widgetForm);
585
581
  }
586
582
  },
587
583
  $lang: function(val) {
@@ -17,8 +17,8 @@
17
17
  <span v-if="action" slot="footer" class="dialog-footer" v-loading="loading"
18
18
  :element-loading-text="loadingText">
19
19
  <slot name="action">
20
- <el-button @click="close">{{$t('fm.actions.cancel')}}</el-button>
21
- <el-button type="primary" @click="submit" >{{$t('fm.actions.confirm')}}</el-button>
20
+ <el-button @click="close">取 消</el-button>
21
+ <el-button type="primary" @click="submit" >确 定</el-button>
22
22
  </slot>
23
23
  </span>
24
24
  </el-dialog>
@@ -1,19 +1,19 @@
1
1
  <template>
2
2
  <div class="form-config-container">
3
3
  <el-form label-position="top">
4
- <el-form-item :label="$t('fm.config.form.labelPosition.title')">
4
+ <el-form-item label="标签对齐方式">
5
5
  <el-radio-group v-model="data.labelPosition">
6
- <el-radio-button label="left">{{$t('fm.config.form.labelPosition.left')}}</el-radio-button>
7
- <el-radio-button label="right">{{$t('fm.config.form.labelPosition.right')}}</el-radio-button>
8
- <el-radio-button label="top">{{$t('fm.config.form.labelPosition.top')}}</el-radio-button>
6
+ <el-radio-button label="left">左对齐</el-radio-button>
7
+ <el-radio-button label="right">右对齐</el-radio-button>
8
+ <el-radio-button label="top">顶部对齐</el-radio-button>
9
9
  </el-radio-group>
10
10
  </el-form-item>
11
11
 
12
- <el-form-item :label="$t('fm.config.form.labelWidth')">
12
+ <el-form-item label="表单标签宽度">
13
13
  <el-input-number v-model="data.labelWidth" :min="0" :max="200" :step="10"></el-input-number>
14
14
  </el-form-item>
15
15
 
16
- <el-form-item :label="$t('fm.config.form.size')">
16
+ <el-form-item label="组件尺寸">
17
17
  <el-radio-group v-model="data.size">
18
18
  <el-radio-button label="medium">medium</el-radio-button>
19
19
  <el-radio-button label="small">small</el-radio-button>
@@ -148,7 +148,7 @@ export default {
148
148
  if (valid) {
149
149
  resolve(this.models);
150
150
  } else {
151
- reject(new Error(this.$t("fm.message.validError")).message);
151
+ reject(new Error('表单数据校验失败').message);
152
152
  }
153
153
  });
154
154
  });