jufubao-base 1.0.8 → 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.8",
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>
@@ -6,6 +6,10 @@ import Attr from "./Attr";
6
6
 
7
7
  export default {
8
8
  props: {
9
+ cid:{
10
+ type: null|String|Number,
11
+ default: null,
12
+ },
9
13
  layoutInfo: {
10
14
  type: Object,
11
15
  default() {
@@ -19,13 +23,13 @@ export default {
19
23
  }
20
24
  },
21
25
  componentAtrr: {
22
- type: Object,
26
+ type: Object|Array,
23
27
  default() {
24
28
  return {}
25
29
  }
26
30
  },
27
31
  appAtrr: {
28
- type: Object,
32
+ type: Object|Array,
29
33
  default() {
30
34
  return {}
31
35
  }
@@ -39,39 +43,33 @@ export default {
39
43
  },
40
44
  data() {
41
45
  return {
46
+ containerId: null, //容器ID
42
47
  //#ifdef H5
43
-
48
+
44
49
  //@AttrData
45
50
  Attr, //对外开发编辑属性
46
51
  //@EndAttrData
47
-
52
+
48
53
  active: false, //是否选择当前状态
49
54
  isEditx: true, //当前为Editx模式
50
55
  edit: false, //是否开启编辑模式
51
- containerId: null, //容器ID
52
56
  // #endif
53
57
  }
54
58
  },
55
59
  created() {
56
- //#ifdef H5
57
-
58
- //设置插件ID
59
- if (this.componentAtrr.id) {
60
- this.containerId = this.componentAtrr.id;
60
+ //设置插件cid
61
+ if (this.cid) {
62
+ this.containerId = this.cid;
61
63
  } else {
62
64
  this.containerId = this.$xdUniHelper.randomChar(20);
63
65
  }
66
+ console.log('created',this.containerId, this.cid)
64
67
 
68
+ //#ifdef H5
65
69
  //监听用户点击状态显示虚框
66
70
  XdBus.addEvent('select', ({containerId}) => {
67
71
  this.active = containerId === this.containerId;
68
72
  });
69
-
70
- //监听用户点击编辑按钮进行编辑状态显示
71
- XdBus.addEvent('useEditx', ({containerId}) => {
72
- this.edit = containerId === this.containerId;
73
- });
74
-
75
73
  // #endif
76
74
  },
77
75
  methods: {
@@ -84,21 +82,13 @@ export default {
84
82
 
85
83
  //#ifdef H5
86
84
  /**
87
- * @description 点击视图编辑按钮发送Editx属性编辑面板
85
+ * @description 点击删除操作按钮
88
86
  */
89
- showEdit() {
90
- if (this.edit) return;
91
- this.edit = true;
92
-
93
- //往控制面板传递事件
94
- XdBus.send('attrViewChange', {
95
- Attr: this.$xdUniHelper.cloneDeep(Attr),
96
- containerId: this.containerId,
97
- }, false, 'xd-iframe');
98
-
99
- //是否对当前控制面板进行编辑操作
100
- XdBus.message('useEditx', {
87
+ delEdit(){
88
+ XdBus.send('onDelPackage', {
101
89
  containerId: this.containerId,
90
+ componentAtrr: this.componentAtrr,
91
+ cid: this.cid
102
92
  })
103
93
  },
104
94
  //#endif
@@ -107,14 +97,18 @@ export default {
107
97
  * @description 点击选择插件显示边框
108
98
  */
109
99
  handleSelect() {
110
-
111
100
  //#ifdef H5
112
101
  if (this.active) return;
113
102
  this.active = true;
103
+ console.log('handleSelect', Attr);
104
+ XdBus.send('onSelectPackage', {
105
+ containerId: this.containerId,
106
+ Attr: Attr,
107
+ });
108
+
114
109
  XdBus.message('select', {
115
110
  containerId: this.containerId,
116
111
  })
117
-
118
112
  //#endif
119
113
  },
120
114
 
@@ -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>
@@ -6,6 +6,10 @@ import Attr from "./Attr";
6
6
 
7
7
  export default {
8
8
  props: {
9
+ cid:{
10
+ type: null|String|Number,
11
+ default: null,
12
+ },
9
13
  layoutInfo: {
10
14
  type: Object,
11
15
  default() {
@@ -19,13 +23,13 @@ export default {
19
23
  }
20
24
  },
21
25
  componentAtrr: {
22
- type: Object,
26
+ type: Object|Array,
23
27
  default() {
24
28
  return {}
25
29
  }
26
30
  },
27
31
  appAtrr: {
28
- type: Object,
32
+ type: Object|Array,
29
33
  default() {
30
34
  return {}
31
35
  }
@@ -39,39 +43,33 @@ export default {
39
43
  },
40
44
  data() {
41
45
  return {
46
+ containerId: null, //容器ID
42
47
  //#ifdef H5
43
-
48
+
44
49
  //@AttrData
45
50
  Attr, //对外开发编辑属性
46
51
  //@EndAttrData
47
-
52
+
48
53
  active: false, //是否选择当前状态
49
54
  isEditx: true, //当前为Editx模式
50
55
  edit: false, //是否开启编辑模式
51
- containerId: null, //容器ID
52
56
  // #endif
53
57
  }
54
58
  },
55
59
  created() {
56
- //#ifdef H5
57
-
58
- //设置插件ID
59
- if (this.componentAtrr.id) {
60
- this.containerId = this.componentAtrr.id;
60
+ //设置插件cid
61
+ if (this.cid) {
62
+ this.containerId = this.cid;
61
63
  } else {
62
64
  this.containerId = this.$xdUniHelper.randomChar(20);
63
65
  }
66
+ console.log('created',this.containerId, this.cid)
64
67
 
68
+ //#ifdef H5
65
69
  //监听用户点击状态显示虚框
66
70
  XdBus.addEvent('select', ({containerId}) => {
67
71
  this.active = containerId === this.containerId;
68
72
  });
69
-
70
- //监听用户点击编辑按钮进行编辑状态显示
71
- XdBus.addEvent('useEditx', ({containerId}) => {
72
- this.edit = containerId === this.containerId;
73
- });
74
-
75
73
  // #endif
76
74
  },
77
75
  methods: {
@@ -84,21 +82,13 @@ export default {
84
82
 
85
83
  //#ifdef H5
86
84
  /**
87
- * @description 点击视图编辑按钮发送Editx属性编辑面板
85
+ * @description 点击删除操作按钮
88
86
  */
89
- showEdit() {
90
- if (this.edit) return;
91
- this.edit = true;
92
-
93
- //往控制面板传递事件
94
- XdBus.send('attrViewChange', {
95
- Attr: this.$xdUniHelper.cloneDeep(Attr),
96
- containerId: this.containerId,
97
- }, false, 'xd-iframe');
98
-
99
- //是否对当前控制面板进行编辑操作
100
- XdBus.message('useEditx', {
87
+ delEdit(){
88
+ XdBus.send('onDelPackage', {
101
89
  containerId: this.containerId,
90
+ componentAtrr: this.componentAtrr,
91
+ cid: this.cid
102
92
  })
103
93
  },
104
94
  //#endif
@@ -107,14 +97,18 @@ export default {
107
97
  * @description 点击选择插件显示边框
108
98
  */
109
99
  handleSelect() {
110
-
111
100
  //#ifdef H5
112
101
  if (this.active) return;
113
102
  this.active = true;
103
+ console.log('handleSelect', Attr);
104
+ XdBus.send('onSelectPackage', {
105
+ containerId: this.containerId,
106
+ Attr: Attr,
107
+ });
108
+
114
109
  XdBus.message('select', {
115
110
  containerId: this.containerId,
116
111
  })
117
-
118
112
  //#endif
119
113
  },
120
114