jufubao-base 1.0.6 → 1.0.9

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,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.6",
3
+ "version": "1.0.9",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -25,9 +25,9 @@
25
25
  "coder": "node ./build/commands/coder.js",
26
26
  "coder:page": "node ./build/commands/coder.page.js",
27
27
  "init.editx": "node ./build/commands/editx.init.js",
28
+ "publish": "node ./commands/npmignore && npm publish",
28
29
  "update.package": "node ./commands/update.pack.js",
29
- "publish.package": "node ./commands/npmignore && npm publish",
30
- "create.pack": "node ./commands/create.pack.js"
30
+ "create.package": "node ./commands/create.pack.js"
31
31
  },
32
32
  "dependencies": {
33
33
  "@dcloudio/uni-app-plus": "2.0.1-33920220208001",
@@ -49,7 +49,7 @@
49
49
  "core-js": "^2.6.5",
50
50
  "flyio": "^0.6.2",
51
51
  "gxd-uni-commands": "1.0.21",
52
- "gxd-uni-library": "1.0.22",
52
+ "gxd-uni-library": "1.0.34",
53
53
  "jweixin-module": "^1.6.0",
54
54
  "md5": "^2.3.0",
55
55
  "qs": "^6.9.6",
@@ -0,0 +1,48 @@
1
+ 'use strict';
2
+
3
+ export default [
4
+ {
5
+ label: '颜色:', //label
6
+ ele: 'el-input', //package 名称
7
+ type: 'text',
8
+ valueKey: 'color', //form[valueKey]
9
+ value: '#fff', //v-model
10
+ placeholder: '请输入占位框颜色',
11
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
12
+ disabled: true,
13
+ rules: [
14
+ {
15
+ required: true,
16
+ message: '请输入占位框颜色',
17
+ trigger: 'blur'
18
+ },
19
+ ]
20
+ },
21
+ {
22
+ label: '高度:', //label
23
+ ele: 'el-input', //package 名称
24
+ type: 'number',
25
+ valueKey: 'height', //form[valueKey]
26
+ value: 1, //v-model
27
+ placeholder: '请输入占位框高度,单位像素',
28
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
29
+ disabled: true,
30
+ rules: [
31
+ {
32
+ required: true,
33
+ message: '请输入占位框高度',
34
+ trigger: 'blur'
35
+ },
36
+ ]
37
+ },
38
+ {
39
+ label: '设置引用:', //label
40
+ ele: 'xd-switch', //package 名称
41
+ valueKey: 'is_reference', //form[valueKey]
42
+ value: false, //v-model
43
+ list: ['', ''], //左右文本
44
+ showTips: false, //是否显示文本
45
+ disabled: true,
46
+ backValueType: 2,
47
+ },
48
+ ]
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-block"
4
+ @click="handleSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-block__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-block__edit-icon" @click="delEdit">删除</view>
14
+ </view>
15
+ <!-- #endif -->
16
+ <view class="jfb-base-block__body">
17
+ <view :style="{height: height * 2 + 'rpx', background: color}"></view>
18
+ </view>
19
+ </view>
20
+ </template>
21
+
22
+ <script>
23
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
24
+ import { jfbRootExec } from "@/utils/xd.event";
25
+ import JfbBaseBlockMixin from "./JfbBaseBlockMixin";
26
+ export default {
27
+ name: "JfbBaseBlock",
28
+ components: {
29
+ XdFontIcon
30
+ },
31
+ mixins: [
32
+ JfbBaseBlockMixin
33
+ ],
34
+ data() {
35
+ return {
36
+ height: 20,
37
+ color: '#fff'
38
+ }
39
+ },
40
+ created() {
41
+ },
42
+ methods: {
43
+ }
44
+ }
45
+
46
+ </script>
47
+
48
+ <style scoped lang="less">
49
+ .jfb-base-block {
50
+ border: 1px dashed rgba(0,0,0,0);
51
+ box-sizing: border-box;
52
+
53
+ &.editx {
54
+ position: relative;
55
+ border: 1px dashed red;
56
+ box-sizing: border-box;
57
+ }
58
+
59
+ &__edit {
60
+ position: absolute;
61
+ right: unit(0, rpx);
62
+ top: unit(-52, rpx);
63
+ height: unit(50, rpx);
64
+ line-height: unit(50, rpx);
65
+ padding: 0 unit(20,rpx);
66
+ display: flex;
67
+ justify-content: center;
68
+ align-items: center;
69
+ background: rgba(0,0,0,.6);
70
+ border-radius: unit(10,rpx);
71
+ box-shadow: 0 0 10px rbga(0,0,0,0.3);
72
+ color: #fff;
73
+ font-size: unit(22,rpx);
74
+
75
+
76
+ &.editx {
77
+ box-sizing: border-box;
78
+
79
+ }
80
+ }
81
+
82
+ &__body{
83
+
84
+ }
85
+ }
86
+ </style>
@@ -1,14 +1,15 @@
1
1
  'use strict';
2
2
 
3
- // #ifdef H5
4
3
  //@AttrImport
5
4
  import Attr from "./Attr";
6
5
  //@EndAttrImport
7
- // #endif
8
-
9
6
 
10
7
  export default {
11
8
  props: {
9
+ cid:{
10
+ type: null|String|Number,
11
+ default: null,
12
+ },
12
13
  layoutInfo: {
13
14
  type: Object,
14
15
  default() {
@@ -22,13 +23,13 @@ export default {
22
23
  }
23
24
  },
24
25
  componentAtrr: {
25
- type: Object,
26
+ type: Object|Array,
26
27
  default() {
27
28
  return {}
28
29
  }
29
30
  },
30
31
  appAtrr: {
31
- type: Object,
32
+ type: Object|Array,
32
33
  default() {
33
34
  return {}
34
35
  }
@@ -42,40 +43,33 @@ export default {
42
43
  },
43
44
  data() {
44
45
  return {
45
-
46
+ containerId: null, //容器ID
46
47
  //#ifdef H5
48
+
47
49
  //@AttrData
48
50
  Attr, //对外开发编辑属性
49
51
  //@EndAttrData
52
+
50
53
  active: false, //是否选择当前状态
51
54
  isEditx: true, //当前为Editx模式
52
55
  edit: false, //是否开启编辑模式
53
- containerId: null, //容器ID
54
56
  // #endif
55
57
  }
56
58
  },
57
59
  created() {
58
- //console.log(this.layoutInfo)
59
-
60
- //#ifdef H5
61
-
62
- //设置插件ID
63
- if (this.componentAtrr.id) {
64
- this.containerId = this.componentAtrr.id;
60
+ //设置插件cid
61
+ if (this.cid) {
62
+ this.containerId = this.cid;
65
63
  } else {
66
64
  this.containerId = this.$xdUniHelper.randomChar(20);
67
65
  }
66
+ console.log('created',this.containerId, this.cid)
68
67
 
68
+ //#ifdef H5
69
69
  //监听用户点击状态显示虚框
70
70
  XdBus.addEvent('select', ({containerId}) => {
71
71
  this.active = containerId === this.containerId;
72
72
  });
73
-
74
- //监听用户点击编辑按钮进行编辑状态显示
75
- XdBus.addEvent('useEditx', ({containerId}) => {
76
- this.edit = containerId === this.containerId;
77
- });
78
-
79
73
  // #endif
80
74
  },
81
75
  methods: {
@@ -88,21 +82,13 @@ export default {
88
82
 
89
83
  //#ifdef H5
90
84
  /**
91
- * @description 点击视图编辑按钮发送Editx属性编辑面板
85
+ * @description 点击删除操作按钮
92
86
  */
93
- showEdit() {
94
- if (this.edit) return;
95
- this.edit = true;
96
-
97
- //往控制面板传递事件
98
- XdBus.send('attrViewChange', {
99
- Attr: this.$xdUniHelper.cloneDeep(Attr),
100
- containerId: this.containerId,
101
- }, false, 'xd-iframe');
102
-
103
- //是否对当前控制面板进行编辑操作
104
- XdBus.message('useEditx', {
87
+ delEdit(){
88
+ XdBus.send('onDelPackage', {
105
89
  containerId: this.containerId,
90
+ componentAtrr: this.componentAtrr,
91
+ cid: this.cid
106
92
  })
107
93
  },
108
94
  //#endif
@@ -111,17 +97,21 @@ export default {
111
97
  * @description 点击选择插件显示边框
112
98
  */
113
99
  handleSelect() {
114
-
115
100
  //#ifdef H5
116
101
  if (this.active) return;
117
102
  this.active = true;
103
+ console.log('handleSelect', Attr);
104
+ XdBus.send('onSelectPackage', {
105
+ containerId: this.containerId,
106
+ Attr: Attr,
107
+ });
108
+
118
109
  XdBus.message('select', {
119
110
  containerId: this.containerId,
120
111
  })
121
-
122
112
  //#endif
123
113
  },
124
114
 
125
-
115
+
126
116
  }
127
117
  }
@@ -0,0 +1,116 @@
1
+ 'use strict';
2
+
3
+ export default [
4
+ {
5
+ label: '颜色:', //label
6
+ ele: 'el-input', //package 名称
7
+ type: 'text',
8
+ valueKey: 'color', //form[valueKey]
9
+ value: '#ececec', //v-model
10
+ placeholder: '请输入分割线颜色',
11
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
12
+ disabled: true,
13
+ rules: [
14
+ {
15
+ required: true,
16
+ message: '请输入分割线颜色',
17
+ trigger: 'blur'
18
+ },
19
+ ]
20
+ },
21
+ {
22
+ label: '大小:', //label
23
+ ele: 'el-input', //package 名称
24
+ type: 'number',
25
+ valueKey: 'size', //form[valueKey]
26
+ value: 1, //v-model
27
+ placeholder: '请输入分割线大小,单位像素',
28
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
29
+ disabled: true,
30
+ rules: [
31
+ {
32
+ required: true,
33
+ message: '请输入分割线大小',
34
+ trigger: 'blur'
35
+ },
36
+ ]
37
+ },
38
+ {
39
+ label: '上边距:', //label
40
+ ele: 'el-input', //package 名称
41
+ type: 'number',
42
+ valueKey: 'topMargin', //form[valueKey]
43
+ value: 5, //v-model
44
+ placeholder: '请输入分割线上边距大小,单位像素',
45
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
46
+ disabled: true,
47
+ rules: [
48
+ {
49
+ required: true,
50
+ message: '请输入分割线上边距大小',
51
+ trigger: 'blur'
52
+ },
53
+ ]
54
+ },
55
+ {
56
+ label: '下边距:', //label
57
+ ele: 'el-input', //package 名称
58
+ type: 'number',
59
+ valueKey: 'bottomMargin', //form[valueKey]
60
+ value: 5, //v-model
61
+ placeholder: '请输入分割线下边距大小,单位像素',
62
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
63
+ disabled: true,
64
+ rules: [
65
+ {
66
+ required: true,
67
+ message: '请输入分割线下边距大小',
68
+ trigger: 'blur'
69
+ },
70
+ ]
71
+ },
72
+ {
73
+ label: '左边距:', //label
74
+ ele: 'el-input', //package 名称
75
+ type: 'number',
76
+ valueKey: 'leftMargin', //form[valueKey]
77
+ value: 5, //v-model
78
+ placeholder: '请输入分割线左边距大小,单位像素',
79
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
80
+ disabled: true,
81
+ rules: [
82
+ {
83
+ required: true,
84
+ message: '请输入分割线左边距大小',
85
+ trigger: 'blur'
86
+ },
87
+ ]
88
+ },
89
+ {
90
+ label: '右边距:', //label
91
+ ele: 'el-input', //package 名称
92
+ type: 'number',
93
+ valueKey: 'rightMargin', //form[valueKey]
94
+ value: 5, //v-model
95
+ placeholder: '请输入分割线右边距大小,单位像素',
96
+ classNmae: 'input40', //样式名称 //input100,input80,input70,input60,input50,input40,input30,input20,
97
+ disabled: true,
98
+ rules: [
99
+ {
100
+ required: true,
101
+ message: '请输入分割线右边距大小',
102
+ trigger: 'blur'
103
+ },
104
+ ]
105
+ },
106
+ {
107
+ label: '设置引用:', //label
108
+ ele: 'xd-switch', //package 名称
109
+ valueKey: 'is_reference', //form[valueKey]
110
+ value: false, //v-model
111
+ list: ['', ''], //左右文本
112
+ showTips: false, //是否显示文本
113
+ disabled: true,
114
+ backValueType: 2,
115
+ },
116
+ ]
@@ -0,0 +1,111 @@
1
+ <template>
2
+ <view
3
+ class="jfb-base-line"
4
+ @click="handleSelect"
5
+ :class="{ editx : isEditx && active }"
6
+ >
7
+ <!--#ifdef H5-->
8
+ <view
9
+ class="jfb-base-line__edit"
10
+ :class="{ editx : isEditx && active }"
11
+ v-if="isEditx && active"
12
+ >
13
+ <view class="jfb-base-line__edit-icon" @click="delEdit">删除</view>
14
+ </view>
15
+ <!-- #endif -->
16
+ <view class="jfb-base-line__body">
17
+ <view
18
+ :style="{
19
+ height: size * 2 + 'rpx',
20
+ background: color,
21
+ marginTop: topMargin * 2 + 'rpx',
22
+ marginBottom: bottomMargin * 2 + 'rpx',
23
+ marginLeft: leftMargin * 2 + 'rpx',
24
+ marginRight: rightMargin * 2 + 'rpx',
25
+ }"
26
+ ></view>
27
+ </view>
28
+ </view>
29
+ </template>
30
+
31
+ <script>
32
+ import XdFontIcon from "@/components/XdFontIcon/XdFontIcon";
33
+ import { jfbRootExec } from "@/utils/xd.event";
34
+ import JfbBaseLineMixin from "./JfbBaseLineMixin";
35
+ export default {
36
+ name: "JfbBaseLine",
37
+ components: {
38
+ XdFontIcon
39
+ },
40
+ mixins: [
41
+ JfbBaseLineMixin
42
+ ],
43
+ data() {
44
+ return {
45
+ size: 1, //px
46
+ color: '#ececec',
47
+ topMargin: 5, //px
48
+ bottomMargin: 5,//px
49
+ leftMargin: 20, //px
50
+ rightMargin: 20 //px
51
+ }
52
+ },
53
+ created() {
54
+
55
+ },
56
+ methods: {
57
+
58
+ }
59
+ }
60
+
61
+ </script>
62
+
63
+ <style scoped lang="less">
64
+ .jfb-base-line {
65
+ border: 1px dashed rgba(0,0,0,0);
66
+ box-sizing: border-box;
67
+
68
+ &.editx {
69
+ position: relative;
70
+ border: 1px dashed red;
71
+ box-sizing: border-box;
72
+ }
73
+
74
+ &__edit {
75
+ position: absolute;
76
+ right: unit(0, rpx);
77
+ top: unit(-52, rpx);
78
+ height: unit(50, rpx);
79
+ line-height: unit(50, rpx);
80
+ padding: 0 unit(20,rpx);
81
+ display: flex;
82
+ justify-content: center;
83
+ align-items: center;
84
+ background: rgba(0,0,0,.6);
85
+ border-radius: unit(10,rpx);
86
+ box-shadow: 0 0 10px rbga(0,0,0,0.3);
87
+ color: #fff;
88
+ font-size: unit(22,rpx);
89
+
90
+
91
+ &.editx {
92
+ box-sizing: border-box;
93
+
94
+ }
95
+ }
96
+
97
+ &__body{
98
+ display: flex;
99
+ justify-content: center;
100
+ align-items: center;
101
+
102
+ & > view {
103
+ overflow: hidden;
104
+ display: flex;
105
+ flex-flow: wrap;
106
+ width: 100%;
107
+ box-sizing: border-box;
108
+ }
109
+ }
110
+ }
111
+ </style>
@@ -1,14 +1,15 @@
1
1
  'use strict';
2
2
 
3
- // #ifdef H5
4
3
  //@AttrImport
5
4
  import Attr from "./Attr";
6
5
  //@EndAttrImport
7
- // #endif
8
-
9
6
 
10
7
  export default {
11
8
  props: {
9
+ cid:{
10
+ type: null|String|Number,
11
+ default: null,
12
+ },
12
13
  layoutInfo: {
13
14
  type: Object,
14
15
  default() {
@@ -22,13 +23,13 @@ export default {
22
23
  }
23
24
  },
24
25
  componentAtrr: {
25
- type: Object,
26
+ type: Object|Array,
26
27
  default() {
27
28
  return {}
28
29
  }
29
30
  },
30
31
  appAtrr: {
31
- type: Object,
32
+ type: Object|Array,
32
33
  default() {
33
34
  return {}
34
35
  }
@@ -42,40 +43,33 @@ export default {
42
43
  },
43
44
  data() {
44
45
  return {
45
-
46
+ containerId: null, //容器ID
46
47
  //#ifdef H5
48
+
47
49
  //@AttrData
48
50
  Attr, //对外开发编辑属性
49
51
  //@EndAttrData
52
+
50
53
  active: false, //是否选择当前状态
51
54
  isEditx: true, //当前为Editx模式
52
55
  edit: false, //是否开启编辑模式
53
- containerId: null, //容器ID
54
56
  // #endif
55
57
  }
56
58
  },
57
59
  created() {
58
- //console.log(this.layoutInfo)
59
-
60
- //#ifdef H5
61
-
62
- //设置插件ID
63
- if (this.componentAtrr.id) {
64
- this.containerId = this.componentAtrr.id;
60
+ //设置插件cid
61
+ if (this.cid) {
62
+ this.containerId = this.cid;
65
63
  } else {
66
64
  this.containerId = this.$xdUniHelper.randomChar(20);
67
65
  }
66
+ console.log('created',this.containerId, this.cid)
68
67
 
68
+ //#ifdef H5
69
69
  //监听用户点击状态显示虚框
70
70
  XdBus.addEvent('select', ({containerId}) => {
71
71
  this.active = containerId === this.containerId;
72
72
  });
73
-
74
- //监听用户点击编辑按钮进行编辑状态显示
75
- XdBus.addEvent('useEditx', ({containerId}) => {
76
- this.edit = containerId === this.containerId;
77
- });
78
-
79
73
  // #endif
80
74
  },
81
75
  methods: {
@@ -88,21 +82,13 @@ export default {
88
82
 
89
83
  //#ifdef H5
90
84
  /**
91
- * @description 点击视图编辑按钮发送Editx属性编辑面板
85
+ * @description 点击删除操作按钮
92
86
  */
93
- showEdit() {
94
- if (this.edit) return;
95
- this.edit = true;
96
-
97
- //往控制面板传递事件
98
- XdBus.send('attrViewChange', {
99
- Attr: this.$xdUniHelper.cloneDeep(Attr),
100
- containerId: this.containerId,
101
- }, false, 'xd-iframe');
102
-
103
- //是否对当前控制面板进行编辑操作
104
- XdBus.message('useEditx', {
87
+ delEdit(){
88
+ XdBus.send('onDelPackage', {
105
89
  containerId: this.containerId,
90
+ componentAtrr: this.componentAtrr,
91
+ cid: this.cid
106
92
  })
107
93
  },
108
94
  //#endif
@@ -111,17 +97,21 @@ export default {
111
97
  * @description 点击选择插件显示边框
112
98
  */
113
99
  handleSelect() {
114
-
115
100
  //#ifdef H5
116
101
  if (this.active) return;
117
102
  this.active = true;
103
+ console.log('handleSelect', Attr);
104
+ XdBus.send('onSelectPackage', {
105
+ containerId: this.containerId,
106
+ Attr: Attr,
107
+ });
108
+
118
109
  XdBus.message('select', {
119
110
  containerId: this.containerId,
120
111
  })
121
-
122
112
  //#endif
123
113
  },
124
114
 
125
-
115
+
126
116
  }
127
117
  }