bri-components 1.2.73 → 1.2.75

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": "bri-components",
3
- "version": "1.2.73",
3
+ "version": "1.2.75",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -48,17 +48,6 @@
48
48
  },
49
49
  themeColorMap () {
50
50
  return this.$appData.themeColors || {};
51
- },
52
-
53
- // 值为不是[]类型用的
54
- curVal: {
55
- get () {
56
- return this.value[this.controlKey];
57
- },
58
- set (val) {
59
- this.value[this.controlKey] = val;
60
- this.change();
61
- }
62
51
  }
63
52
  },
64
53
  created () {
@@ -59,17 +59,6 @@
59
59
  },
60
60
  bgColor () {
61
61
  return (this.themeColorMap[this.value[this.relateColorkey]] || {}).bgColor;
62
- },
63
-
64
- // 值为不是[]类型用的
65
- curVal: {
66
- get () {
67
- return this.value[this.controlKey];
68
- },
69
- set (val) {
70
- this.value[this.controlKey] = val;
71
- this.change();
72
- }
73
62
  }
74
63
  },
75
64
  created () {
@@ -163,9 +163,13 @@ export default {
163
163
  // isShare () {
164
164
  // return !!this.propsObj.isShare;
165
165
  // },
166
- // 单元格状态
166
+ // 在单元格内
167
167
  isInTable () {
168
- return !!this.propsObj.isInTable;
168
+ return !!this.propsObj.inTable;
169
+ },
170
+ // 单条关联内 使用详情模式的
171
+ isInRefDetail () {
172
+ return !!this.propsObj.inRefDetail;
169
173
  },
170
174
  // 高级搜索状态
171
175
  isOnSearch () {
@@ -8,7 +8,7 @@
8
8
  :columns="columns"
9
9
  :fixTitle="fixTitle"
10
10
  :ownColumns="ownColumns"
11
- :operationList="operationList"
11
+ :operationList="dropdownOperationList"
12
12
  :extraOperationList="extraOperationList"
13
13
  :propsObj="listPropsObj"
14
14
  :changedFields="changedFields"
@@ -23,6 +23,12 @@
23
23
  @groupLoad="groupLoad"
24
24
  @dsh="dshEmit"
25
25
  >
26
+ <slot
27
+ name="list"
28
+ slot-scope="{ data }"
29
+ :data="data"
30
+ ></slot>
31
+
26
32
  <slot
27
33
  name="col"
28
34
  slot="col"
@@ -78,6 +84,10 @@
78
84
  }
79
85
  },
80
86
 
87
+ fixTitle: {
88
+ type: Boolean,
89
+ default: true
90
+ },
81
91
  data: Array,
82
92
  columns: Array,
83
93
  changedFields: {
@@ -86,13 +96,12 @@
86
96
  return [];
87
97
  }
88
98
  },
89
-
90
- fixTitle: {
91
- type: Boolean,
92
- default: true
99
+ operationList: {
100
+ type: Array,
101
+ default () {
102
+ return [];
103
+ }
93
104
  },
94
- operationList: Array,
95
- extraOperationList: Array,
96
105
  listPropsObj: Object,
97
106
  pageMode: String,
98
107
  total: Number,
@@ -102,9 +111,25 @@
102
111
  data () {
103
112
  return {};
104
113
  },
105
- computed: {},
106
- created () {
114
+ computed: {
115
+ dropdownOperationList () {
116
+ return this.operationList.filter(item =>
117
+ !(
118
+ ["canCreate", "canCustomCreate", "canDrag", "canCustomDrag"].includes(item.type) ||
119
+ item.type.includes("canCustomCreate") ||
120
+ item.type.includes("canCustomDrag")
121
+ )
122
+ );
123
+ },
124
+ extraOperationList () {
125
+ return this.operationList.filter(item =>
126
+ ["canCreate", "canCustomCreate", "canDrag", "canCustomDrag"].includes(item.type) ||
127
+ item.type.includes("canCustomCreate") ||
128
+ item.type.includes("canCustomDrag")
129
+ );
130
+ }
107
131
  },
132
+ created () {},
108
133
  methods: {
109
134
  // 点击某行
110
135
  clickRow (...params) {
@@ -151,3 +176,26 @@
151
176
  }
152
177
  };
153
178
  </script>
179
+
180
+ <style lang="less" scoped>
181
+ .DshBox {
182
+ width: 100%;
183
+ height: 100%;
184
+ display: flex;
185
+ flex-direction: column;
186
+
187
+ &-list {
188
+ width: 100%;
189
+ flex: 1;
190
+ min-height: 60px;
191
+ background: #fff;
192
+ overflow: auto;
193
+ }
194
+
195
+ &-page {
196
+ margin-top: 10px;
197
+ width: 100%;
198
+ height: 30px;
199
+ }
200
+ }
201
+ </style>
@@ -4,132 +4,129 @@
4
4
  <bri-loading
5
5
  v-if="isLoading"
6
6
  class="DshPanel-loading"
7
- >
8
- {{ loadingText }}
9
- </bri-loading>
7
+ ></bri-loading>
10
8
  <template>
11
9
  <!-- 有数据 -->
12
- <template v-if="data.length">
13
- <CheckboxGroup
14
- class="DshCard-list"
15
- v-model="selectIds"
16
- @on-change="selectRow"
17
- >
18
- <Row :gutter="16">
19
- <i-col
20
- v-for="(row, dataIndex) in data"
21
- :key="dataIndex"
22
- :xs="24"
23
- :sm="12"
24
- :md="12"
25
- :lg="8"
26
- :xl="6"
27
- :xxl="4"
10
+ <CheckboxGroup
11
+ v-if="data.length"
12
+ class="DshCard-list"
13
+ v-model="selectIds"
14
+ @on-change="selectRow"
15
+ >
16
+ <Row :gutter="16">
17
+ <i-col
18
+ v-for="(row, dataIndex) in data"
19
+ :key="dataIndex"
20
+ :xs="24"
21
+ :sm="12"
22
+ :md="12"
23
+ :lg="8"
24
+ :xl="6"
25
+ :xxl="4"
26
+ >
27
+ <div
28
+ class="row-item"
29
+ @click="clickRow(row)"
28
30
  >
29
- <div
30
- class="row-item"
31
- @click="clickRow(row)"
31
+ <!-- 复选框 -->
32
+ <Checkbox
33
+ v-if="multiple"
34
+ class="row-item-checkbox"
35
+ :label="row._id"
36
+ @click.native.stop="clickRowCheckbox(row)"
32
37
  >
33
- <!-- 复选框 -->
34
- <Checkbox
35
- v-if="multiple"
36
- class="row-item-checkbox"
37
- :label="row._id"
38
- @click.native.stop="clickRowCheckbox(row)"
38
+ {{ "" }}
39
+ </Checkbox>
40
+
41
+ <!-- 下拉操作(定位css) -->
42
+ <dsh-dropdown
43
+ v-if="operationList.length"
44
+ class="row-item-dropdown"
45
+ :dropdownObj="dropdownObj"
46
+ :list="operationList"
47
+ @click="$dshEmit($event, row, dataIndex)"
48
+ @click.native.stop="0"
49
+ ></dsh-dropdown>
50
+
51
+ <!-- 背景图 -->
52
+ <div class="row-item-image">
53
+ <img
54
+ :src="getCardBgImgSrc(row)"
55
+ alt=""
39
56
  >
40
- {{ "" }}
41
- </Checkbox>
42
-
43
- <!-- 下拉操作(定位css) -->
44
- <dsh-dropdown
45
- v-if="operationList.length"
46
- class="row-item-dropdown"
47
- :dropdownObj="dropdownObj"
48
- :list="operationList"
49
- @click="$dshEmit($event, row, dataIndex)"
50
- @click.native.stop="0"
51
- ></dsh-dropdown>
52
-
53
- <!-- 背景图 -->
54
- <div class="row-item-image">
55
- <img
56
- :src="getCardBgImgSrc(row)"
57
- alt=""
58
- >
59
- </div>
57
+ </div>
58
+
59
+ <!-- 内容 -->
60
+ <div class="row-item-info">
61
+ <!-- 标题 -->
62
+ <bri-tooltip
63
+ class="title"
64
+ :content="row[propsObj.titleField]"
65
+ placement="top"
66
+ :transfer="true"
67
+ >
68
+ <div class="title-name">
69
+ {{ row[propsObj.titleField] }}
70
+ </div>
71
+ </bri-tooltip>
60
72
 
61
- <!-- 内容 -->
62
- <div class="row-item-info">
63
- <!-- 标题 -->
73
+ <!-- 显示字段 -->
74
+ <div
75
+ v-for="colItem in selfColumns"
76
+ :key="colItem._key"
77
+ class="unit"
78
+ >
79
+ <!-- 左 label -->
64
80
  <bri-tooltip
65
- class="title"
66
- :content="row[propsObj.titleField]"
67
- placement="top"
81
+ class="unit-label-tooltip"
82
+ :content="colItem._name"
68
83
  :transfer="true"
69
84
  >
70
- <div class="title-name">
71
- {{ row[propsObj.titleField] }}
85
+ <div class="unit-label">
86
+ <span class="unit-label-name">
87
+ {{ colItem._name }}
88
+ </span>
89
+ <span class="unit-label-colon">
90
+
91
+ </span>
72
92
  </div>
73
93
  </bri-tooltip>
74
94
 
75
- <!-- 显示字段 -->
76
- <div
77
- v-for="colItem in selfColumns"
78
- :key="colItem._key"
79
- class="unit"
80
- >
81
- <!-- 左 label -->
82
- <bri-tooltip
83
- class="unit-label-tooltip"
84
- :content="colItem._name"
85
- :transfer="true"
95
+ <!-- val -->
96
+ <div class="unit-control">
97
+ <dsh-list-render
98
+ v-if="colItem.renderBodyCell"
99
+ :row="row"
100
+ :column="colItem"
101
+ :index="0"
102
+ :render="colItem.renderBodyCell"
103
+ ></dsh-list-render>
104
+
105
+ <div
106
+ v-else-if="colItem.formatter"
107
+ v-html="colItem.formatter(row, 0)"
108
+ ></div>
109
+
110
+ <span
111
+ v-else
112
+ class="unit-control-text"
86
113
  >
87
- <div class="unit-label">
88
- <span class="unit-label-name">
89
- {{ colItem._name }}
90
- </span>
91
- <span class="unit-label-colon">
92
-
93
- </span>
94
- </div>
95
- </bri-tooltip>
96
-
97
- <!-- 右 val -->
98
- <div class="unit-control">
99
- <dsh-list-render
100
- v-if="colItem.renderBodyCell"
101
- :row="row"
102
- :column="colItem"
103
- :index="0"
104
- :render="colItem.renderBodyCell"
105
- ></dsh-list-render>
106
-
107
- <div
108
- v-else-if="colItem.formatter"
109
- v-html="colItem.formatter(row, 0)"
110
- ></div>
111
-
112
- <span
113
- v-else
114
- class="unit-control-text"
115
- >
116
- {{ row[colItem._key] }}
117
- </span>
118
- </div>
114
+ {{ row[colItem._key] }}
115
+ </span>
119
116
  </div>
120
117
  </div>
121
118
  </div>
122
- </i-col>
123
- </Row>
124
- </CheckboxGroup>
125
- </template>
119
+ </div>
120
+ </i-col>
121
+ </Row>
122
+ </CheckboxGroup>
126
123
 
127
124
  <!-- 无数据 -->
128
125
  <div
129
126
  v-else
130
127
  class="DshCard-nodata"
131
128
  >
132
- {{ noDataText }}
129
+ <img :src="$imageSrcMap.app.nodata" />
133
130
  </div>
134
131
  </template>
135
132
  </div>
@@ -283,8 +280,11 @@
283
280
 
284
281
  <style lang="less" scoped>
285
282
  .DshCard {
283
+ width: 100%;
284
+ height: 100%;
286
285
  padding: 10px;
287
286
  background-color: #ffffff;
287
+ overflow: auto;
288
288
 
289
289
  &-list {
290
290
  .row-item {
@@ -343,6 +343,7 @@
343
343
  }
344
344
 
345
345
  .unit {
346
+ height: 32px;
346
347
  display: flex;
347
348
  flex-direction: row;
348
349
  align-items: center;
@@ -121,9 +121,9 @@
121
121
  </bri-tooltip>
122
122
 
123
123
  <Tooltip
124
- v-if="colItem._comment"
124
+ v-if="colItem._description"
125
125
  style="width:16px"
126
- :content="colItem._comment"
126
+ :content="colItem._description"
127
127
  placement="top-start"
128
128
  max-width="200"
129
129
  :transfer="true"
@@ -4,9 +4,7 @@
4
4
  <bri-loading
5
5
  v-if="isLoading"
6
6
  class="DshPanel-loading"
7
- >
8
- {{ loadingText }}
9
- </bri-loading>
7
+ ></bri-loading>
10
8
  <template>
11
9
  <!-- 有数据 -->
12
10
  <template v-if="data.length">
@@ -1,28 +1,35 @@
1
1
  <template>
2
2
  <div class="DshSingleData">
3
- <dsh-form
4
- v-if="formData"
5
- class="DshSingleData-form"
6
- :canEdit="canEdit"
7
- :formData="formData"
8
- :formList="columns"
9
- ></dsh-form>
3
+ <!-- 加载 -->
4
+ <template v-if="isLoading"></template>
5
+ <template v-else>
6
+ <template v-if="data.length">
7
+ <div class="DshSingleData-form">
8
+ <slot :data="formData">
9
+ <dsh-form
10
+ :canEdit="false"
11
+ :formData="formData"
12
+ :formList="columns"
13
+ ></dsh-form>
14
+ </slot>
15
+ </div>
10
16
 
11
- <!-- 暂无内容 -->
12
- <div
13
- v-else
14
- class="DshSingleData-nodata"
15
- >
16
- <img :src="$imageSrcMap.app.nodata" />
17
- </div>
17
+ <!-- 底部编辑按钮 -->
18
+ <dsh-buttons
19
+ class="DshSingleData-btns"
20
+ :list="operationList"
21
+ @click="$dshEmit($event, formData)"
22
+ ></dsh-buttons>
23
+ </template>
18
24
 
19
- <!-- 底部编辑按钮 -->
20
- <dsh-buttons
21
- v-if="btnList.length && formData"
22
- class="DshSingleData-footer"
23
- :list="btnList"
24
- @click="$dshEmit($event, formData)"
25
- ></dsh-buttons>
25
+ <!-- 暂无内容 -->
26
+ <div
27
+ v-else
28
+ class="DshSingleData-nodata"
29
+ >
30
+ <img :src="$imageSrcMap.app.nodata" />
31
+ </div>
32
+ </template>
26
33
  </div>
27
34
  </template>
28
35
 
@@ -31,6 +38,10 @@
31
38
  name: "DshSingleData",
32
39
  components: {},
33
40
  props: {
41
+ isLoading: {
42
+ type: Boolean,
43
+ default: false
44
+ },
34
45
  data: {
35
46
  type: Array,
36
47
  default () {
@@ -43,33 +54,54 @@
43
54
  return [];
44
55
  }
45
56
  },
46
- propsObj: {
47
- type: Object,
48
- default () {
49
- return {};
50
- }
51
- },
52
57
  operationList: {
53
58
  type: Array,
54
59
  default () {
55
60
  return [];
56
61
  }
62
+ },
63
+ propsObj: {
64
+ type: Object,
65
+ default () {
66
+ return {};
67
+ }
57
68
  }
58
69
  },
70
+ data () {
71
+ return {};
72
+ },
59
73
  computed: {
60
74
  formData () {
61
- return this.data[0] || undefined;
62
- },
63
- btnList () {
64
- return this.operationList.filter(btnItem => btnItem.type !== "canShow");
75
+ return this.data[0];
65
76
  }
66
77
  },
67
- data () {
68
- return {
69
- canEdit: false
70
- };
71
- },
72
78
  created () {},
73
79
  methods: {}
74
80
  };
75
81
  </script>
82
+
83
+ <style lang="less" scoped>
84
+ .DshSingleData {
85
+ width: 100%;
86
+ height: 100%;
87
+ background: #fff;
88
+ display: flex;
89
+ flex-direction: column;
90
+
91
+ &-form {
92
+ flex: 1;
93
+ min-height: 0px;
94
+ overflow: auto;
95
+ }
96
+
97
+ &-btns {
98
+ padding: 10px 0px;
99
+ border-radius: 0px 0px 6px 6px;
100
+ text-align: right;
101
+ }
102
+
103
+ &-nodata {
104
+ #dsh-nodata();
105
+ }
106
+ }
107
+ </style>
@@ -68,7 +68,9 @@
68
68
  <slot>
69
69
  <component
70
70
  class="DshFormUnit-control-component"
71
- :style="{ 'text-align': formItem._lineAlign }"
71
+ :style="{
72
+ 'text-align': formItem._lineAlign
73
+ }"
72
74
  ref="control"
73
75
  :is="curComponentName"
74
76
  :canEdit="canEdit"
@@ -136,7 +138,7 @@
136
138
  unitStyle () {
137
139
  return {
138
140
  width: `calc(${(this.formItem._br && this.formItem._span ? this.formItem._span / 24 : 1) * 100}% - 12px)`,
139
- height: [undefined, 0, 24].includes(this.formItem._span)
141
+ height: this.formItem._br || [undefined, 0, 24].includes(this.formItem._span)
140
142
  ? undefined
141
143
  : `${this.height - (this.canEdit ? 0 : 10)}px`, // 去掉下padding
142
144
  minHeight: "42px",
@@ -21,7 +21,7 @@
21
21
  :propsObj="{
22
22
  ...formItem,
23
23
  size: 'default',
24
- isInTable: true
24
+ inTable: true
25
25
  }"
26
26
  :rowIndex="rowIndex"
27
27
  :parentData="parentData"
@@ -1,8 +1,6 @@
1
1
  // list
2
- @import "./list/DshBox/DshBox.less";
3
2
  @import "./list/DshBox/DshTable.less";
4
3
  @import "./list/DshBox/DshCrossTable.less";
5
- @import "./list/DshBox/DshSingleData.less";
6
4
  @import "./list/DshBox/DshList.less";
7
5
  @import "./list/BriTable.less";
8
6
  @import "./list/DshPage.less";
@@ -8,6 +8,7 @@
8
8
 
9
9
  #dsh-nodata {
10
10
  width: 100%;
11
+ margin: auto;
11
12
  padding: 20px 10px;
12
13
  text-align: center;
13
14
  font-size: 14px;
@@ -16,6 +17,7 @@
16
17
  }
17
18
  #dsh-nodata-large {
18
19
  width: 100%;
20
+ margin: auto;
19
21
  padding: 20px 10px;
20
22
  text-align: center;
21
23
  font-size: 16px;
@@ -1,20 +0,0 @@
1
- .DshBox {
2
- width: 100%;
3
- height: 100%;
4
- display: flex;
5
- flex-direction: column;
6
-
7
- &-list {
8
- width: 100%;
9
- flex: 1;
10
- min-height: 60px;
11
- margin-bottom: 10px;
12
- background: #fff;
13
- overflow: auto;
14
- }
15
-
16
- &-page {
17
- width: 100%;
18
- height: 30px;
19
- }
20
- }
@@ -1,30 +0,0 @@
1
- .DshSingleData {
2
- height: 100%;
3
- display: flex;
4
- flex-direction: column;
5
- &-form {
6
- flex: 1;
7
- overflow: auto;
8
- background: #fff;
9
- border-radius: 6px 6px 0px 0px;
10
- }
11
- &-footer {
12
- margin-top: 10px;
13
- text-align: right;
14
- background: #fff;
15
- padding: 10px;
16
- border-radius: 0px 0px 6px 6px;
17
- }
18
- &-nodata {
19
- max-width: 500px;
20
- height: auto;
21
- margin: auto;
22
- text-align: center;
23
- font-size: @textSize;
24
- color: @textColor;
25
- }
26
- }
27
-
28
- .DshSingleData {
29
-
30
- }