tianheng-ui 0.0.94 → 0.0.96

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.94",
4
+ "version": "0.0.96",
5
5
  "author": "shu lang <403732931@qq.com>",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -96,7 +96,7 @@ export default {
96
96
  return [];
97
97
  }
98
98
  },
99
- client: String,
99
+ client: String
100
100
  },
101
101
  data() {
102
102
  return {
@@ -116,7 +116,7 @@ export default {
116
116
  },
117
117
  watch: {
118
118
  data(val) {
119
- this.formJson = val;
119
+ this.setJSON(val);
120
120
  },
121
121
  formJson: {
122
122
  handler(val) {
@@ -372,12 +372,29 @@
372
372
  </template>
373
373
 
374
374
  <template v-if="widget.type == 'image'">
375
- <th-image
375
+ <!-- <el-image
376
+ :style="{
377
+ width: widget.options.width,
378
+ height: widget.options.height
379
+ }"
376
380
  :src="widget.options.defaultValue"
377
- :height="widget.options.height"
378
- :width="widget.options.width"
379
381
  :fit="widget.options.fit"
380
- ></th-image>
382
+ :preview-src-list="[widget.options.defaultValue]"
383
+ :lazy="widget.options.isLazy"
384
+ ></el-image> -->
385
+ <el-image
386
+ v-for="(item, index) in widget.options.defaultValue"
387
+ :key="index"
388
+ :style="{
389
+ width: widget.options.width,
390
+ height: widget.options.height,
391
+ borderRadius: widget.options.borderRadius
392
+ }"
393
+ :src="item.url"
394
+ :fit="widget.options.fit"
395
+ :preview-src-list="imagePreviewList"
396
+ :lazy="widget.options.isLazy"
397
+ ></el-image>
381
398
  </template>
382
399
 
383
400
  <template v-if="widget.type == 'upload'">
@@ -740,6 +757,13 @@ export default {
740
757
  } else {
741
758
  return this.widget.options.action;
742
759
  }
760
+ },
761
+ imagePreviewList() {
762
+ const list = [];
763
+ this.widget.options.defaultValue.forEach(item => {
764
+ list.push(item.url);
765
+ });
766
+ return list;
743
767
  }
744
768
  },
745
769
  created() {},
@@ -856,8 +880,7 @@ export default {
856
880
  // 获取数据,仅支持获取当前组件节点下的数据
857
881
  getData() {
858
882
  return this.models;
859
- },
860
-
883
+ }
861
884
  }
862
885
  };
863
886
  </script>
@@ -457,9 +457,7 @@ export const basicComponents = [
457
457
  type: "image",
458
458
  icon: "icon-ic",
459
459
  options: {
460
- defaultValue:
461
- "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
462
- defaultValueArr: [
460
+ defaultValue: [
463
461
  {
464
462
  url:
465
463
  "https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg"
@@ -473,7 +471,6 @@ export const basicComponents = [
473
471
  "https://fuss10.elemecdn.com/0/6f/e35ff375812e6b0020b6b4e8f9583jpeg.jpeg"
474
472
  }
475
473
  ],
476
- remote: false,
477
474
  width: "",
478
475
  height: "200px",
479
476
  fit: "fill",
@@ -482,7 +479,8 @@ export const basicComponents = [
482
479
  errorSrc: "",
483
480
  isLoding: false,
484
481
  hidden: false,
485
- hideLabel: false
482
+ hideLabel: false,
483
+ isLazy: true
486
484
  }
487
485
  },
488
486
  {
@@ -25,39 +25,26 @@
25
25
  </el-form-item>
26
26
 
27
27
  <el-form-item label="图片路径">
28
- <div style="marginBottom:10px">
29
- <el-radio-group v-model="widget.options.remote" size="mini">
30
- <el-radio-button :label="false">图片路径</el-radio-button>
31
- <el-radio-button :label="true">大图预览</el-radio-button>
32
- </el-radio-group>
28
+ <div
29
+ style="display: flex;"
30
+ v-for="(item, index) in widget.options.defaultValue"
31
+ :key="item.url"
32
+ >
33
+ <div style="width:80px;">地址{{ index + 1 }}:</div>
34
+ <el-input v-model="item.url"></el-input>
35
+ <el-button
36
+ style="padding: 8px;margin-left: 5px;"
37
+ type="danger"
38
+ icon="el-icon-minus"
39
+ size="mini"
40
+ circle
41
+ plain
42
+ @click="handleImageRemove(index)"
43
+ ></el-button>
33
44
  </div>
34
- <div style="display: flex;" v-if="!widget.options.remote">
35
- <div style="width:80px;">地址:</div>
36
- <el-input v-model="widget.options.defaultValue"></el-input>
37
- </div>
38
-
39
- <div v-if="widget.options.remote">
40
- <div
41
- style="display: flex;"
42
- v-for="(item, index) in widget.options.defaultValueArr"
43
- :key="item.url"
44
- >
45
- <div style="width:80px;">地址:{{ index + 1 }}</div>
46
- <el-input v-model="item.url"></el-input>
47
-
48
- <el-button
49
- style="padding: 8px;margin-left: 5px;"
50
- type="danger"
51
- icon="el-icon-minus"
52
- circle
53
- plain
54
- @click="handleImageRemove(index)"
55
- ></el-button>
56
- </div>
57
45
 
58
- <div style="margin-left: 22px;">
59
- <el-button type="text" @click="handleAddImage">添加选项</el-button>
60
- </div>
46
+ <div style="margin-left: 22px;">
47
+ <el-button type="text" @click="handleAddImage">添加选项</el-button>
61
48
  </div>
62
49
  </el-form-item>
63
50
 
@@ -111,7 +98,10 @@
111
98
  <el-form-item label="操作属性">
112
99
  <el-checkbox v-model="widget.options.hidden">隐藏组件</el-checkbox>
113
100
  <el-checkbox v-model="widget.options.hideLabel">隐藏标签</el-checkbox>
114
- <el-checkbox v-model="widget.options.isLoding">加载中</el-checkbox>
101
+ <el-checkbox v-model="widget.options.isLoding"
102
+ >开启加载动画</el-checkbox
103
+ >
104
+ <el-checkbox v-model="widget.options.isLazy">开启懒加载</el-checkbox>
115
105
  </el-form-item>
116
106
  </el-form>
117
107
  </div>
@@ -136,10 +126,10 @@ export default {
136
126
  const obj = {
137
127
  url: ""
138
128
  };
139
- this.widget.options.defaultValueArr.push(obj);
129
+ this.widget.options.defaultValue.push(obj);
140
130
  },
141
131
  handleImageRemove(index) {
142
- this.widget.options.defaultValueArr.splice(index, 1);
132
+ this.widget.options.defaultValue.splice(index, 1);
143
133
  }
144
134
  }
145
135
  };
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div>
2
+ <!-- <div>
3
3
  <th-image
4
4
  v-if="!widget.options.remote"
5
5
  :src="widget.options.defaultValue"
@@ -26,6 +26,17 @@
26
26
  :is-loding="widget.options.isLoding"
27
27
  ></th-image>
28
28
  </div>
29
+ </div> -->
30
+ <div>
31
+ <el-image
32
+ v-for="(item, index) in widget.options.defaultValue"
33
+ :key="index"
34
+ :style="selfStyle"
35
+ :src="item.url"
36
+ :fit="widget.options.fit"
37
+ :preview-src-list="widget.options.defaultValue"
38
+ :lazy="widget.options.isLazy"
39
+ ></el-image>
29
40
  </div>
30
41
  </template>
31
42
 
@@ -35,7 +46,16 @@ import ThImage from "ui/Image/index.vue";
35
46
 
36
47
  export default {
37
48
  components: { ThImage },
38
- mixins: [itemsComponent]
49
+ mixins: [itemsComponent],
50
+ computed: {
51
+ selfStyle() {
52
+ const style = { display: "inline-block" };
53
+ style.width = this.widget.options.width;
54
+ style.height = this.widget.options.height;
55
+ style.borderRadius = `${this.widget.options.borderRadius || 0}`;
56
+ return style;
57
+ }
58
+ }
39
59
  };
40
60
  </script>
41
61
 
@@ -113,7 +113,7 @@ export default {
113
113
  default: () => {
114
114
  return {
115
115
  page: {
116
- url: "/viewManage/getViewManageDetailById",
116
+ url: "/preview/getViewManageDetailById",
117
117
  method: "POST",
118
118
  params: {}
119
119
  },
@@ -218,15 +218,17 @@ export default {
218
218
  // 初始化组件配置
219
219
  initConfig() {
220
220
  this.initData();
221
- const info = sessionStorage.getItem("th_oauth_info");
222
- if (info) {
223
- this.requestConfigData();
224
- } else if (this.oauthConfig.token) {
221
+
222
+ if (this.oauthConfig.token) {
225
223
  const oauthInfo = {
226
224
  token: this.oauthConfig.token,
227
225
  baseUrl: this.oauthConfig.baseUrl
228
226
  };
229
227
  sessionStorage.setItem("th_oauth_info", JSON.stringify(oauthInfo));
228
+ }
229
+
230
+ const info = sessionStorage.getItem("th_oauth_info");
231
+ if (info) {
230
232
  this.requestConfigData();
231
233
  } else if (this.oauthConfig.oauth) {
232
234
  // 模拟授权认证流程
@@ -261,7 +263,7 @@ export default {
261
263
  data: { ...this.network.page.params, moduleId: this.id }
262
264
  })
263
265
  .then(res => {
264
- const resultData = res.data.viewManage;
266
+ const resultData = res.data;
265
267
  if (!resultData) {
266
268
  this.tableJson = null;
267
269
  return;