bri-components 1.3.82 → 1.3.83

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.3.82",
3
+ "version": "1.3.83",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -199,7 +199,7 @@
199
199
 
200
200
  forceValidateTypes: [
201
201
  "select", "region", "cascader", "regions", "cascaders", "file", "coordinates", "editor",
202
- "users", "departments", "labels", "flatTable", "reference", "referenceBy"
202
+ "users", "departments", "labels", "flatTable", "cascaderTable", "reference", "referenceBy"
203
203
  ],
204
204
  ignoreProperties: [
205
205
  "_name", "_key", "_default", "_required", "_regStr", "_regMessage", "_span", "_br", "_line", "_noLabel", "_clearable",
@@ -189,11 +189,11 @@
189
189
  methods: {
190
190
  // hidden columns
191
191
  hideColumnsByKeys (keys = []) {
192
- this.$refs["briTable"].hideColumnsByKeys(keys);
192
+ this.$refs.briTable.hideColumnsByKeys(keys);
193
193
  },
194
194
  // show cloumns
195
195
  showColumnsByKeys (keys = []) {
196
- this.$refs["briTable"].showColumnsByKeys(keys);
196
+ this.$refs.briTable.showColumnsByKeys(keys);
197
197
  }
198
198
  }
199
199
  };
@@ -9,29 +9,62 @@
9
9
  :render="topSearchRender"
10
10
  ></dsh-render>
11
11
 
12
- <!-- 表格 -->
13
- <bri-table
14
- v-show="showListData.length"
15
- ref="briTable"
16
- class="DshFlatTable-main"
17
- :columns="showColumns"
18
- :data="renderedListData"
19
- :footer-data="footerData"
20
- :propsObj="tablePropsObj"
21
- @changeSelect="changeSelect"
22
- @selectAll="changeSelect"
23
- ></bri-table>
24
- <bri-table
25
- v-show="!showListData.length"
26
- ref="briTable"
27
- class="DshFlatTable-main"
28
- :columns="showColumns"
29
- :data="showListData"
30
- :footer-data="footerData"
31
- :propsObj="tablePropsObj"
32
- @changeSelect="changeSelect"
33
- @selectAll="changeSelect"
34
- ></bri-table>
12
+ <!-- 表单展示模式 -->
13
+ <div
14
+ v-if="showMode === 'form'"
15
+ class="DshFlatTable-form"
16
+ >
17
+ <div
18
+ v-for="(row, rowIndex) in showListData"
19
+ :key="row._id"
20
+ class="item"
21
+ >
22
+ <dsh-form
23
+ :canEdit="getRowCanEdit(row)"
24
+ :formData="row"
25
+ :formList="getRowFormList(row)"
26
+ :allFormList="columns"
27
+ :inTableType="inTableType"
28
+ :allListRows="allListData"
29
+ :rowIndex="rowIndex"
30
+ :parentFormList="allFormList"
31
+ :parentObj="parentObj"
32
+ ></dsh-form>
33
+
34
+ <dsh-icons
35
+ v-if="$getOperationList(['canCreate', 'canDelete']).length"
36
+ class="item-icons"
37
+ itemClass="item-icons-item"
38
+ :list="$getOperationList(['canCreate', 'canDelete'])"
39
+ @click="$dispatchEvent($event, row, rowIndex)"
40
+ ></dsh-icons>
41
+ </div>
42
+ </div>
43
+
44
+ <!-- 表格展示模式 -->
45
+ <template v-else>
46
+ <bri-table
47
+ v-show="showListData.length"
48
+ ref="briTable"
49
+ class="DshFlatTable-main"
50
+ :columns="showColumns"
51
+ :data="renderedListData"
52
+ :footer-data="footerData"
53
+ :propsObj="tablePropsObj"
54
+ @changeSelect="changeSelect"
55
+ @selectAll="changeSelect"
56
+ ></bri-table>
57
+ <bri-table
58
+ v-show="!showListData.length"
59
+ class="DshFlatTable-main"
60
+ :columns="showColumns"
61
+ :data="showListData"
62
+ :footer-data="footerData"
63
+ :propsObj="tablePropsObj"
64
+ @changeSelect="changeSelect"
65
+ @selectAll="changeSelect"
66
+ ></bri-table>
67
+ </template>
35
68
 
36
69
  <!-- 添加行 -->
37
70
  <dsh-render :render="createOperationRender"></dsh-render>
@@ -58,6 +91,7 @@
58
91
 
59
92
  <!-- 表格 -->
60
93
  <bri-table
94
+ v-show="showListData.length"
61
95
  class="DshFlatTable-main"
62
96
  :columns="showColumns"
63
97
  :data="renderedListData"
@@ -66,6 +100,16 @@
66
100
  @changeSelect="changeSelect"
67
101
  @selectAll="changeSelect"
68
102
  ></bri-table>
103
+ <bri-table
104
+ v-show="!showListData.length"
105
+ class="DshFlatTable-main"
106
+ :columns="showColumns"
107
+ :data="showListData"
108
+ :footer-data="footerData"
109
+ :propsObj="tablePropsObj"
110
+ @changeSelect="changeSelect"
111
+ @selectAll="changeSelect"
112
+ ></bri-table>
69
113
 
70
114
  <!-- 添加行 -->
71
115
  <dsh-render :render="createOperationRender"></dsh-render>
@@ -97,6 +141,13 @@
97
141
 
98
142
  <style lang="less" scoped>
99
143
  .DshFlatTable {
144
+ &-form {
145
+ .item {
146
+ border: 1px solid #E5E5E6;
147
+ margin-bottom: 5px;
148
+ position: relative;
149
+ }
150
+ }
100
151
 
101
152
  &-main {
102
153
  width: 100%;
@@ -110,3 +161,25 @@
110
161
  }
111
162
  }
112
163
  </style>
164
+ <style lang="less">
165
+ .DshFlatTable {
166
+ &-form {
167
+ .item {
168
+ &-icons {
169
+ position: absolute;
170
+ top: -10px;
171
+ right: -10px;
172
+ line-height: 18px;
173
+ z-index: 2;
174
+ display: none;
175
+ }
176
+
177
+ &:hover {
178
+ .item-icons {
179
+ display: block !important;
180
+ }
181
+ }
182
+ }
183
+ }
184
+ }
185
+ </style>
@@ -23,10 +23,9 @@
23
23
  ></bri-table>
24
24
  <bri-table
25
25
  v-show="!showListData.length"
26
- ref="briTable"
27
26
  class="DshTreeTable-main"
28
27
  :columns="showColumns"
29
- :data="renderedListData"
28
+ :data="showListData"
30
29
  :footer-data="footerData"
31
30
  :propsObj="tablePropsObj"
32
31
  @changeSelect="changeSelect"
@@ -58,6 +57,7 @@
58
57
 
59
58
  <!-- 表格 -->
60
59
  <bri-table
60
+ v-show="showListData.length"
61
61
  class="DshTreeTable-main"
62
62
  :columns="showColumns"
63
63
  :data="renderedListData"
@@ -66,6 +66,16 @@
66
66
  @changeSelect="changeSelect"
67
67
  @selectAll="changeSelect"
68
68
  ></bri-table>
69
+ <bri-table
70
+ v-show="!showListData.length"
71
+ class="DshTreeTable-main"
72
+ :columns="showColumns"
73
+ :data="showListData"
74
+ :footer-data="footerData"
75
+ :propsObj="tablePropsObj"
76
+ @changeSelect="changeSelect"
77
+ @selectAll="changeSelect"
78
+ ></bri-table>
69
79
 
70
80
  <!-- 添加行 -->
71
81
  <dsh-render :render="createOperationRender"></dsh-render>
@@ -9,7 +9,7 @@
9
9
  :closable="true"
10
10
  :draggable="true"
11
11
  >
12
- <div class="quoteListModal-drawer-body">
12
+ <div class="quoteListModal-body">
13
13
  <div class="list">
14
14
  <template v-if="listData.length">
15
15
  <div
@@ -34,8 +34,8 @@
34
34
  </div>
35
35
 
36
36
  <dsh-buttons
37
- class="quoteListModal-drawer-body-btns"
38
- itemClass="quoteListModal-drawer-body-btns-item"
37
+ class="quoteListModal-body-btns"
38
+ itemClass="btns-item"
39
39
  :list="$getOperationList()"
40
40
  @click="$dispatchEvent($event)"
41
41
  ></dsh-buttons>
@@ -74,12 +74,6 @@
74
74
  curDataItem: undefined,
75
75
 
76
76
  operationMap: {
77
- canReset: {
78
- name: "重 置",
79
- type: "canReset",
80
- size: "small",
81
- event: "clickReset"
82
- },
83
77
  confirm: {
84
78
  name: "确 认",
85
79
  type: "confirm",
@@ -123,10 +117,6 @@
123
117
  } else {
124
118
  this.curDataItem = dataItem;
125
119
  }
126
- },
127
- // 点击重置
128
- clickReset () {
129
-
130
120
  },
131
121
  // 点击确认
132
122
  clickConfirm () {
@@ -155,47 +145,6 @@
155
145
  <style lang="less">
156
146
  .quoteListModal {
157
147
  &-drawer {
158
- &-body {
159
- width: 100%;
160
- height: 100%;
161
- padding: 20px;
162
- overflow: auto;
163
-
164
- .list {
165
- &-item {
166
- padding: 8px 12px;
167
- margin-bottom: 8px;
168
- border-radius: 4px;
169
- cursor: pointer;
170
-
171
- &-active {
172
- color: #ffffff;
173
- background-color: @theme-hover;
174
- }
175
- }
176
-
177
- &-nodata {
178
- #dsh-nodata();
179
- }
180
- }
181
-
182
- &-btns {
183
- position: absolute;
184
- bottom: 0px;
185
- left: 0px;
186
- .dsh-flex-row-start-stretch();
187
- width: calc(100% - 48px);
188
- height: 51px;
189
- margin: 25px 20px 25px 28px;
190
-
191
- &-item {
192
- flex: 1;
193
- margin: 5px;
194
- height: 40px;
195
- }
196
- }
197
- }
198
-
199
148
  .ivu-drawer-mask,
200
149
  .ivu-drawer-wrap {
201
150
  z-index: 88888888;
@@ -212,5 +161,46 @@
212
161
  font-weight: bold;
213
162
  }
214
163
  }
164
+
165
+ &-body {
166
+ width: 100%;
167
+ height: 100%;
168
+ padding: 20px;
169
+ overflow: auto;
170
+
171
+ .list {
172
+ &-item {
173
+ padding: 8px 12px;
174
+ margin-bottom: 8px;
175
+ border-radius: 4px;
176
+ cursor: pointer;
177
+
178
+ &-active {
179
+ color: #ffffff;
180
+ background-color: @theme-hover;
181
+ }
182
+ }
183
+
184
+ &-nodata {
185
+ #dsh-nodata();
186
+ }
187
+ }
188
+
189
+ &-btns {
190
+ position: absolute;
191
+ bottom: 0px;
192
+ left: 0px;
193
+ .dsh-flex-row-start-stretch();
194
+ width: calc(100% - 48px);
195
+ height: 51px;
196
+ margin: 25px 20px 25px 28px;
197
+
198
+ .btns-item {
199
+ flex: 1;
200
+ min-width: 0px;
201
+ height: 40px;
202
+ }
203
+ }
204
+ }
215
205
  }
216
206
  </style>
@@ -186,7 +186,7 @@ export default {
186
186
  color: "#3DB8C5"
187
187
  },
188
188
  props: {
189
- type: "md-add-circle", // "ios-add"
189
+ type: "md-add-circle",
190
190
  size: "14"
191
191
  },
192
192
  on: {
@@ -224,7 +224,7 @@ export default {
224
224
  color: "#3DB8C5"
225
225
  },
226
226
  props: {
227
- type: "ios-add", // "md-add-circle"
227
+ type: "ios-add",
228
228
  size: "14"
229
229
  },
230
230
  on: {
@@ -137,6 +137,7 @@ export default {
137
137
  name: "添加一行",
138
138
  type: "canCreate",
139
139
  btnType: "default",
140
+ icon: "md-add-circle",
140
141
  size: "default",
141
142
  long: true,
142
143
  disabled: false,
@@ -673,6 +674,7 @@ export default {
673
674
  this.initFlag = true;
674
675
  this.showRuleMessage = false;
675
676
  this.ruleRecordMap = {};
677
+ this.selfReset && this.selfReset();
676
678
  },
677
679
  // 共外部使用
678
680
  validate () {
@@ -704,15 +706,15 @@ export default {
704
706
 
705
707
  /* ----------- 隐藏/显示字段 ---------- */
706
708
  toggleHideOrShow () {
707
- if (this.$refs["briTable"]) {
709
+ if (this.$refs.briTable) {
708
710
  if (this.hideStatus === true) {
709
- this.$refs["briTable"].showColumnsByKeys(this.hideColKeys);
711
+ this.$refs.briTable.showColumnsByKeys(this.hideColKeys);
710
712
  } else {
711
- this.$refs["briTable"].hideColumnsByKeys(this.hideColKeys);
713
+ this.$refs.briTable.hideColumnsByKeys(this.hideColKeys);
712
714
  }
713
- }
714
715
 
715
- this.hideStatus = !this.hideStatus;
716
+ this.hideStatus = !this.hideStatus;
717
+ }
716
718
  },
717
719
 
718
720
  /* ----------- 全屏 ---------- */
@@ -769,7 +771,8 @@ export default {
769
771
  ...fieldVal,
770
772
  list: fieldVal.list.map(item => ({
771
773
  ...item,
772
- __isQuote__: true
774
+ __isQuote__: true,
775
+ __old__: false
773
776
  }))
774
777
  };
775
778
  } else if (["cascaderTable"].includes(this.controlType)) {
@@ -778,7 +781,8 @@ export default {
778
781
  list.map(item => ({
779
782
  ...item,
780
783
  children: item.children ? loop(item.children) : item.children,
781
- __isQuote__: true
784
+ __isQuote__: true,
785
+ __old__: false
782
786
  }));
783
787
 
784
788
  return loop(list);
@@ -792,7 +796,6 @@ export default {
792
796
 
793
797
  this.$Message.success("引用成功!");
794
798
  this.reset();
795
- this.selfReset && this.selfReset();
796
799
  this.change("quote");
797
800
  }
798
801
  } else {
@@ -1076,6 +1079,17 @@ export default {
1076
1079
  return this.getRowCanEdit(row) &&
1077
1080
  this.getColCanEdit(col, row) &&
1078
1081
  this.$isAdvRelyShow(col, row, this.parentObj, true);
1082
+ },
1083
+ getRowFormList (row) {
1084
+ return this.columns.map(column => {
1085
+ column = this.$transformDynamicProperty(column, row, this.parentObj);
1086
+ const unitCanEdit = this.getColCanEdit(column, row);
1087
+
1088
+ return {
1089
+ ...column,
1090
+ canEdit: unitCanEdit
1091
+ };
1092
+ });
1079
1093
  }
1080
1094
  }
1081
1095
  };