bri-components 1.3.30 → 1.3.32
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/lib/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/10.bri-components.min.js +1 -0
- package/lib/11.bri-components.min.js +1 -0
- package/lib/2.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/7.bri-components.min.js +1 -0
- package/lib/8.bri-components.min.js +1 -0
- package/lib/9.bri-components.min.js +1 -0
- package/lib/bri-components.min.js +16 -16
- package/package.json +1 -1
- package/src/components/controls/base/BriUpload/BriUpload.vue +2 -12
- package/src/components/controls/base/BriUpload/uploadList.vue +35 -31
- package/src/components/controls/senior/cascaderTable.vue +29 -173
- package/src/components/controls/senior/flatTable/flatTable.vue +55 -242
- package/src/components/controls/senior/selectUsers/selectUsers.vue +16 -13
- package/src/components/form/DshDefaultSearch.vue +1 -2
- package/src/components/list/DshCascaderTable.vue +231 -34
- package/src/components/list/DshFlatTable.vue +59 -1
- package/src/components/list/DshTreeTable.vue +263 -87
- package/src/components/{controls/senior/flatTable → list/common}/flatTableImportModal.vue +1 -9
- package/src/components/list/mixins/flatTableMixin.js +16 -48
- package/src/components/list/mixins/quoteListModal.vue +215 -0
- package/src/components/list/mixins/tableBaseMixin.js +349 -12
- package/src/styles/components/list/BriTable.less +26 -7
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="quoteListModal">
|
|
3
|
+
<Drawer
|
|
4
|
+
v-model="showModal"
|
|
5
|
+
class="quoteListModal-drawer"
|
|
6
|
+
width="400"
|
|
7
|
+
:title="'引用列表'"
|
|
8
|
+
:mask-closable="true"
|
|
9
|
+
:closable="true"
|
|
10
|
+
:draggable="true"
|
|
11
|
+
>
|
|
12
|
+
<div class="quoteListModal-drawer-body">
|
|
13
|
+
<div class="list">
|
|
14
|
+
<template v-if="listData.length">
|
|
15
|
+
<div
|
|
16
|
+
v-for="dataItem in listData"
|
|
17
|
+
:key="dataItem._id"
|
|
18
|
+
:class="{
|
|
19
|
+
'list-item': true,
|
|
20
|
+
'list-item-active': curDataItem && curDataItem._id === dataItem._id
|
|
21
|
+
}"
|
|
22
|
+
@click="clickItem(dataItem)"
|
|
23
|
+
>
|
|
24
|
+
{{ listFields.length ? dataItem[listFields[0]] : dataItem.createdAt }}
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<div
|
|
29
|
+
v-else
|
|
30
|
+
class="list-nodata"
|
|
31
|
+
>
|
|
32
|
+
暂无数据…
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<dsh-buttons
|
|
37
|
+
class="quoteListModal-drawer-body-btns"
|
|
38
|
+
itemClass="quoteListModal-drawer-body-btns-item"
|
|
39
|
+
:list="$getOperationList()"
|
|
40
|
+
@click="$dispatchEvent($event)"
|
|
41
|
+
></dsh-buttons>
|
|
42
|
+
</div>
|
|
43
|
+
</Drawer>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script>
|
|
48
|
+
export default {
|
|
49
|
+
name: "quoteListModal",
|
|
50
|
+
props: {
|
|
51
|
+
value: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false
|
|
54
|
+
},
|
|
55
|
+
propsObj: {
|
|
56
|
+
type: Object,
|
|
57
|
+
default () {
|
|
58
|
+
return {};
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
listParams: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default () {
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
data () {
|
|
69
|
+
return {
|
|
70
|
+
listData: [],
|
|
71
|
+
listPropsObj: {
|
|
72
|
+
isLoading: false
|
|
73
|
+
},
|
|
74
|
+
curDataItem: undefined,
|
|
75
|
+
|
|
76
|
+
operationMap: {
|
|
77
|
+
canReset: {
|
|
78
|
+
name: "重 置",
|
|
79
|
+
type: "canReset",
|
|
80
|
+
size: "small",
|
|
81
|
+
event: "clickReset"
|
|
82
|
+
},
|
|
83
|
+
confirm: {
|
|
84
|
+
name: "确 认",
|
|
85
|
+
type: "confirm",
|
|
86
|
+
btnType: "primary",
|
|
87
|
+
size: "small",
|
|
88
|
+
event: "clickConfirm"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
computed: {
|
|
94
|
+
showModal: {
|
|
95
|
+
get () {
|
|
96
|
+
return this.value;
|
|
97
|
+
},
|
|
98
|
+
set (val) {
|
|
99
|
+
this.$emit("input", val);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
modKey () {
|
|
104
|
+
return this.propsObj.modKey;
|
|
105
|
+
},
|
|
106
|
+
screenKey () {
|
|
107
|
+
return this.propsObj.screenKey;
|
|
108
|
+
},
|
|
109
|
+
listFields () {
|
|
110
|
+
return this.propsObj._quoteListFields || [];
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
created () {
|
|
114
|
+
this.init();
|
|
115
|
+
},
|
|
116
|
+
methods: {
|
|
117
|
+
init () {
|
|
118
|
+
this.getListData();
|
|
119
|
+
},
|
|
120
|
+
clickItem (dataItem) {
|
|
121
|
+
if (this.curDataItem && this.curDataItem._id === dataItem._id) {
|
|
122
|
+
this.curDataItem = undefined;
|
|
123
|
+
} else {
|
|
124
|
+
this.curDataItem = dataItem;
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
// 点击重置
|
|
128
|
+
clickReset () {
|
|
129
|
+
|
|
130
|
+
},
|
|
131
|
+
// 点击确认
|
|
132
|
+
clickConfirm () {
|
|
133
|
+
this.showModal = false;
|
|
134
|
+
this.$emit("confirm", this.curDataItem);
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
getListData () {
|
|
138
|
+
this.$https({
|
|
139
|
+
url: {
|
|
140
|
+
module: "sheet",
|
|
141
|
+
name: "index"
|
|
142
|
+
},
|
|
143
|
+
params: this.listParams,
|
|
144
|
+
loadingName: "listPropsObj.isLoading",
|
|
145
|
+
callback: data => {
|
|
146
|
+
this.listData = data.list;
|
|
147
|
+
this.curDataItem = this.listData[0];
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
</script>
|
|
154
|
+
|
|
155
|
+
<style lang="less">
|
|
156
|
+
.quoteListModal {
|
|
157
|
+
&-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
|
+
background-color: @theme-hover;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&-nodata {
|
|
177
|
+
#dsh-nodata();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&-btns {
|
|
182
|
+
position: absolute;
|
|
183
|
+
bottom: 0px;
|
|
184
|
+
left: 0px;
|
|
185
|
+
.dsh-flex-row-start-stretch();
|
|
186
|
+
width: calc(100% - 48px);
|
|
187
|
+
height: 51px;
|
|
188
|
+
margin: 25px 20px 25px 28px;
|
|
189
|
+
|
|
190
|
+
&-item {
|
|
191
|
+
flex: 1;
|
|
192
|
+
margin: 5px;
|
|
193
|
+
height: 40px;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.ivu-drawer-mask,
|
|
199
|
+
.ivu-drawer-wrap {
|
|
200
|
+
// z-index: 88888888;
|
|
201
|
+
}
|
|
202
|
+
.ivu-drawer-body {
|
|
203
|
+
padding: 0px;
|
|
204
|
+
padding-bottom: 50px;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
}
|
|
207
|
+
.ivu-drawer-header-inner {
|
|
208
|
+
font-size: @titleSize;
|
|
209
|
+
font-family: @titleFontFamily;
|
|
210
|
+
color: #333;
|
|
211
|
+
font-weight: bold;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
</style>
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import DshListUnit from "../../unit/DshListUnit.vue";
|
|
2
|
+
import quoteListModal from "./quoteListModal.vue";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
4
5
|
mixins: [],
|
|
5
6
|
components: {
|
|
6
|
-
DshListUnit
|
|
7
|
+
DshListUnit,
|
|
8
|
+
quoteListModal
|
|
7
9
|
},
|
|
8
10
|
props: {
|
|
9
11
|
canEdit: {
|
|
@@ -38,11 +40,104 @@ export default {
|
|
|
38
40
|
},
|
|
39
41
|
data () {
|
|
40
42
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
initFlag: true,
|
|
44
|
+
showRuleMessage: false, // 进行全体校验
|
|
45
|
+
ruleRecordMap: {}, // 单元格是否发生校验的记录映射
|
|
46
|
+
|
|
47
|
+
dshRenderName: undefined,
|
|
48
|
+
showQuoteModal: false,
|
|
49
|
+
showImportModal: false,
|
|
50
|
+
exportTimer: null,
|
|
51
|
+
isEnlarge: false,
|
|
52
|
+
isEnlargeFlag: true, // 为重渲染膜态框内容而用
|
|
53
|
+
|
|
54
|
+
topOperationMap: {
|
|
55
|
+
canQuote: {
|
|
56
|
+
name: "引用",
|
|
57
|
+
type: "canQuote",
|
|
58
|
+
icon: "ios-copy",
|
|
59
|
+
size: "small",
|
|
60
|
+
btnType: "text",
|
|
61
|
+
event: "clickQuote"
|
|
62
|
+
},
|
|
63
|
+
canImport: {
|
|
64
|
+
name: "导入",
|
|
65
|
+
type: "canImport",
|
|
66
|
+
icon: "ios-create-outline",
|
|
67
|
+
size: "small",
|
|
68
|
+
btnType: "text",
|
|
69
|
+
event: "clickImport"
|
|
70
|
+
},
|
|
71
|
+
canExport: {
|
|
72
|
+
name: "导出",
|
|
73
|
+
type: "canExport",
|
|
74
|
+
icon: "md-share-alt",
|
|
75
|
+
size: "small",
|
|
76
|
+
btnType: "text",
|
|
77
|
+
event: "clickExport"
|
|
78
|
+
},
|
|
79
|
+
canEnlarge: {
|
|
80
|
+
name: "全屏展示",
|
|
81
|
+
type: "canEnlarge",
|
|
82
|
+
icon: "md-expand",
|
|
83
|
+
size: "small",
|
|
84
|
+
btnType: "text",
|
|
85
|
+
event: "clickEnlarge"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
baseOperationMap: {
|
|
89
|
+
canCreate: {
|
|
90
|
+
name: "添加一行",
|
|
91
|
+
type: "canCreate",
|
|
92
|
+
size: "default",
|
|
93
|
+
long: true,
|
|
94
|
+
disabled: false,
|
|
95
|
+
event: "clickCreate",
|
|
96
|
+
btnType: "default"
|
|
97
|
+
},
|
|
98
|
+
canDelete: {
|
|
99
|
+
name: "删除",
|
|
100
|
+
type: "canDelete",
|
|
101
|
+
btnType: "errorText",
|
|
102
|
+
icon: "ios-trash-outline",
|
|
103
|
+
size: "small",
|
|
104
|
+
disabled: false,
|
|
105
|
+
event: "clickDelete"
|
|
106
|
+
},
|
|
107
|
+
changeVal: {
|
|
108
|
+
name: "改变输入框值",
|
|
109
|
+
type: "changeVal",
|
|
110
|
+
event: "changeVal"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
43
113
|
};
|
|
44
114
|
},
|
|
45
115
|
computed: {
|
|
116
|
+
dshRender () {
|
|
117
|
+
return this[this.dshRenderName];
|
|
118
|
+
},
|
|
119
|
+
parentDataId () {
|
|
120
|
+
return this.parentObj._id;
|
|
121
|
+
},
|
|
122
|
+
selfRowDefault () {
|
|
123
|
+
return this.$filterObj(this.filterColumns, this.rowDefault);
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
controlKey () {
|
|
127
|
+
return this.propsObj._key;
|
|
128
|
+
},
|
|
129
|
+
controlType () {
|
|
130
|
+
return this.propsObj._type;
|
|
131
|
+
},
|
|
132
|
+
controlName () {
|
|
133
|
+
return this.propsObj._name;
|
|
134
|
+
},
|
|
135
|
+
modKey () {
|
|
136
|
+
return this.propsObj.modKey;
|
|
137
|
+
},
|
|
138
|
+
screenKey () {
|
|
139
|
+
return this.propsObj.screenKey;
|
|
140
|
+
},
|
|
46
141
|
commonPropsObj () {
|
|
47
142
|
return {
|
|
48
143
|
// isShare: false, // 是否是分享页在用
|
|
@@ -57,6 +152,10 @@ export default {
|
|
|
57
152
|
_disabledBtns: false, // 禁用增删按钮
|
|
58
153
|
_disabledCreateBtn: false, // 置灰新增按钮,目前只内部使用,comp_web数据表配置页那块
|
|
59
154
|
_disabledOldDataRow: false, // 置灰老数据行包含删除
|
|
155
|
+
_isImport: false, // 导入
|
|
156
|
+
_isExport: false, // 导出
|
|
157
|
+
_isQuote: false, // 引用
|
|
158
|
+
_quoteListFields: [], // 引用列表的显示字段
|
|
60
159
|
...this.propsObj,
|
|
61
160
|
|
|
62
161
|
_contentHeight: this.propsObj._contentHeight || 500 // 表格最大高度
|
|
@@ -98,9 +197,92 @@ export default {
|
|
|
98
197
|
disabledOldDataRow () {
|
|
99
198
|
return this.selfPropsObj._disabledOldDataRow;
|
|
100
199
|
},
|
|
200
|
+
isQuote () {
|
|
201
|
+
return this.selfPropsObj._isQuote;
|
|
202
|
+
},
|
|
203
|
+
quoteListFields () {
|
|
204
|
+
return this.selfPropsObj._quoteListFields;
|
|
205
|
+
},
|
|
206
|
+
isImport () {
|
|
207
|
+
return this.selfPropsObj._isImport;
|
|
208
|
+
},
|
|
209
|
+
isExport () {
|
|
210
|
+
return this.selfPropsObj._isExport;
|
|
211
|
+
},
|
|
101
212
|
|
|
102
|
-
|
|
103
|
-
return
|
|
213
|
+
modalPropsObj () {
|
|
214
|
+
return {
|
|
215
|
+
title: this.controlName,
|
|
216
|
+
fullscreen: true,
|
|
217
|
+
showSlotClose: false,
|
|
218
|
+
closable: true
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
quoteParams () {
|
|
222
|
+
return {
|
|
223
|
+
screenKey: this.screenKey,
|
|
224
|
+
fields: [...this.quoteListFields, this.controlKey, "createdAt"],
|
|
225
|
+
advSearch: {
|
|
226
|
+
logic: "and",
|
|
227
|
+
conditions: [
|
|
228
|
+
{
|
|
229
|
+
fieldKey: "_id",
|
|
230
|
+
fieldOperator: "ne",
|
|
231
|
+
fieldValue: [this.parentDataId]
|
|
232
|
+
}
|
|
233
|
+
]
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
importParams () {
|
|
238
|
+
return {
|
|
239
|
+
_id: this.parentDataId,
|
|
240
|
+
_key: this.controlKey
|
|
241
|
+
};
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
topOperationBtns () {
|
|
245
|
+
return Object.keys(this.topOperationMap);
|
|
246
|
+
},
|
|
247
|
+
baseOperationBtns () {
|
|
248
|
+
return Object.keys(this.baseOperationMap);
|
|
249
|
+
},
|
|
250
|
+
allOperationMap () {
|
|
251
|
+
return {
|
|
252
|
+
...(this.topOperationMap || {}),
|
|
253
|
+
...(this.baseOperationMap || {}),
|
|
254
|
+
|
|
255
|
+
canCreate: {
|
|
256
|
+
...this.baseOperationMap.canCreate,
|
|
257
|
+
disabled: !!this.disabledCreateBtn
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
},
|
|
261
|
+
operationMap () {
|
|
262
|
+
return this.$categoryMapToMap(
|
|
263
|
+
this.allOperationMap,
|
|
264
|
+
undefined,
|
|
265
|
+
undefined,
|
|
266
|
+
this.canEdit
|
|
267
|
+
? [
|
|
268
|
+
...(this.isQuote ? ["canQuote"] : []),
|
|
269
|
+
...(this.isImport ? ["canImport"] : []),
|
|
270
|
+
...(this.isExport ? ["canExport"] : []),
|
|
271
|
+
"canEnlarge",
|
|
272
|
+
...(this.disabledBtns ? ["changeVal"] : this.baseOperationBtns)
|
|
273
|
+
]
|
|
274
|
+
: [
|
|
275
|
+
...(this.isExport ? ["canExport"] : []),
|
|
276
|
+
"canEnlarge"
|
|
277
|
+
]
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
watch: {
|
|
282
|
+
isEnlarge (bool) {
|
|
283
|
+
setTimeout(() => {
|
|
284
|
+
this.isEnlargeFlag = bool;
|
|
285
|
+
}, 0);
|
|
104
286
|
}
|
|
105
287
|
},
|
|
106
288
|
created () { },
|
|
@@ -111,6 +293,162 @@ export default {
|
|
|
111
293
|
|
|
112
294
|
return this.listData.every((row, rowIndex) => this.getRowRuleResult(row, rowIndex));
|
|
113
295
|
},
|
|
296
|
+
// 重置
|
|
297
|
+
reset () {
|
|
298
|
+
this.initFlag = true;
|
|
299
|
+
this.showRuleMessage = false;
|
|
300
|
+
this.ruleRecordMap = {};
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
// 点击引用
|
|
304
|
+
clickQuote () {
|
|
305
|
+
this.dshRenderName = "quoteModalRender";
|
|
306
|
+
this.showQuoteModal = true;
|
|
307
|
+
},
|
|
308
|
+
// 点击导入
|
|
309
|
+
clickImport () {
|
|
310
|
+
this.showImportModal = true;
|
|
311
|
+
},
|
|
312
|
+
// 点击导出
|
|
313
|
+
clickExport (operationItem) {
|
|
314
|
+
this.handleExport(operationItem);
|
|
315
|
+
},
|
|
316
|
+
// 打开全屏模态框
|
|
317
|
+
clickEnlarge (operationItem) {
|
|
318
|
+
this.isEnlarge = true;
|
|
319
|
+
},
|
|
320
|
+
|
|
321
|
+
// 引用模态框渲染函数
|
|
322
|
+
quoteModalRender (h, params) {
|
|
323
|
+
return this.showQuoteModal
|
|
324
|
+
? h("quote-list-modal", {
|
|
325
|
+
props: {
|
|
326
|
+
value: this.showQuoteModal,
|
|
327
|
+
propsObj: this.propsObj,
|
|
328
|
+
listParams: this.quoteParams
|
|
329
|
+
},
|
|
330
|
+
on: {
|
|
331
|
+
input: bool => {
|
|
332
|
+
this.showQuoteModal = bool;
|
|
333
|
+
},
|
|
334
|
+
confirm: this.quoteCb
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
: undefined;
|
|
338
|
+
},
|
|
339
|
+
// 引用回调
|
|
340
|
+
quoteCb (dataObj) {
|
|
341
|
+
if (dataObj) {
|
|
342
|
+
const cb = () => {
|
|
343
|
+
this.$Message.success("引用成功!");
|
|
344
|
+
this.reset();
|
|
345
|
+
this.selfReset && this.selfReset();
|
|
346
|
+
|
|
347
|
+
if (["flatTable"].includes(this.controlType)) {
|
|
348
|
+
this.parentObj[this.controlKey] = {
|
|
349
|
+
...dataObj[this.controlKey],
|
|
350
|
+
list: dataObj[this.controlKey].list.map(item => ({
|
|
351
|
+
...item,
|
|
352
|
+
__readonly__: true
|
|
353
|
+
}))
|
|
354
|
+
};
|
|
355
|
+
} else if (["cascaderTable"].includes(this.controlType)) {
|
|
356
|
+
const transformData = (data = []) => {
|
|
357
|
+
const loop = (list = []) =>
|
|
358
|
+
list.map(item => ({
|
|
359
|
+
...item,
|
|
360
|
+
children: item.children && item.children.length ? loop(item.children) : item.children,
|
|
361
|
+
__readonly__: true
|
|
362
|
+
}));
|
|
363
|
+
|
|
364
|
+
return loop(data);
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
this.parentObj[this.controlKey] = {
|
|
368
|
+
...dataObj[this.controlKey],
|
|
369
|
+
tree: transformData(dataObj[this.controlKey].tree)
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
this.change("quote");
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
const isEmpty = this.$isEmptyData(dataObj[this.controlKey]) ||
|
|
377
|
+
(["flatTable"].includes(this.controlType)
|
|
378
|
+
? !dataObj[this.controlKey].list || !dataObj[this.controlKey].list.length
|
|
379
|
+
: ["cascaderTable"].includes(this.controlType)
|
|
380
|
+
? !dataObj[this.controlKey].tree || !dataObj[this.controlKey].tree.length
|
|
381
|
+
: false);
|
|
382
|
+
if (isEmpty) {
|
|
383
|
+
this.$Modal.confirm({
|
|
384
|
+
title: "提示",
|
|
385
|
+
content: "该数据下此内容为空,无法引用!",
|
|
386
|
+
onOk: () => { }
|
|
387
|
+
});
|
|
388
|
+
} else {
|
|
389
|
+
cb();
|
|
390
|
+
}
|
|
391
|
+
} else {
|
|
392
|
+
this.$Message.error("未选择引用数据!");
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
// 导入回调
|
|
396
|
+
importCb (data) {
|
|
397
|
+
this.parentObj[this.controlKey] = data;
|
|
398
|
+
this.change("import");
|
|
399
|
+
},
|
|
400
|
+
// 接口 -导出
|
|
401
|
+
handleExport (operationItem) {
|
|
402
|
+
operationItem.disabled = true;
|
|
403
|
+
|
|
404
|
+
this.$https({
|
|
405
|
+
url: {
|
|
406
|
+
module: "sheet",
|
|
407
|
+
name: ["flatTable"].includes(this.controlType) ? "exportFlatTableExcel" : "exportCascaderTableExcel"
|
|
408
|
+
},
|
|
409
|
+
params: {
|
|
410
|
+
screenKey: this.screenKey,
|
|
411
|
+
_id: this.parentObj._id,
|
|
412
|
+
_key: this.controlKey
|
|
413
|
+
},
|
|
414
|
+
callback: data => {
|
|
415
|
+
this.getJobStatus(operationItem, data.jobId, data.excel_url);
|
|
416
|
+
this.exportTimer = setInterval(() => {
|
|
417
|
+
this.getJobStatus(operationItem, data.jobId, data.excel_url);
|
|
418
|
+
}, 1000);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
},
|
|
422
|
+
// 接口 -获取导出地址
|
|
423
|
+
getJobStatus (operationItem, id, url) {
|
|
424
|
+
this.$https({
|
|
425
|
+
url: {
|
|
426
|
+
module: "sheet",
|
|
427
|
+
name: "getJobStatus"
|
|
428
|
+
},
|
|
429
|
+
params: {
|
|
430
|
+
jobId: id
|
|
431
|
+
},
|
|
432
|
+
callback: data => {
|
|
433
|
+
operationItem.disabled = false;
|
|
434
|
+
clearInterval(this.exportTimer);
|
|
435
|
+
|
|
436
|
+
if (data.status === "completed") {
|
|
437
|
+
window.location.href = data.url;
|
|
438
|
+
} else if (data.status === "failed") {
|
|
439
|
+
this.$Message.info({
|
|
440
|
+
content: "操作失败,请稍后再试"
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
error: data => {
|
|
445
|
+
operationItem.disabled = false;
|
|
446
|
+
this.exportTimer = null;
|
|
447
|
+
}
|
|
448
|
+
});
|
|
449
|
+
},
|
|
450
|
+
|
|
451
|
+
/* --------------- 工具方法 ------------- */
|
|
114
452
|
// 整行校验结果
|
|
115
453
|
getRowRuleResult (row, rowIndex) {
|
|
116
454
|
return this.filterColumns.every(column => this.getColRuleResult(column, row, rowIndex).bool);
|
|
@@ -126,17 +464,16 @@ export default {
|
|
|
126
464
|
};
|
|
127
465
|
}
|
|
128
466
|
},
|
|
129
|
-
|
|
130
|
-
/* --------------- 工具方法 ------------- */
|
|
131
467
|
getRowCanEdit (row) {
|
|
132
|
-
return this.canEdit &&
|
|
133
|
-
this.disabledOldDataRow ?
|
|
468
|
+
return this.canEdit && // 是编辑状态
|
|
469
|
+
(this.disabledOldDataRow ? !row.__old__ : true) && // 老数据行不置灰/置灰时是新增数据
|
|
470
|
+
!row.__readonly__; // 不能为只读数据
|
|
134
471
|
},
|
|
135
472
|
getColCanEdit (col, row) {
|
|
136
|
-
return (col.
|
|
473
|
+
return (col._oldReadonly ? !row.__old__ : true) && // 老数据行里某些列不可编辑
|
|
474
|
+
(["number"].includes(col._type) && ![undefined, null, "", "no"].includes(col._summaryType) ? row.isLeaf !== false : true) && // 级联表格 -“需要计的数字列 且 不是叶子行的”不可编辑(必须用isLeaf !== false判断,因为牵扯内部表格也在用)
|
|
137
475
|
col._enterType !== "calculate" && // 计算的不可编辑
|
|
138
|
-
col._readonly !== true
|
|
139
|
-
(["number"].includes(col._type) && ![undefined, null, "", "no"].includes(col._summaryType) ? row.isLeaf !== false : true); // 级联表格 -“需要计的数字列 且 不是叶子行的”不可编辑(必须用isLeaf !== false判断,因为牵扯内部表格也在用)
|
|
476
|
+
col._readonly !== true; // 不能为只读
|
|
140
477
|
},
|
|
141
478
|
getUnitCanEdit (col, row) {
|
|
142
479
|
return this.getRowCanEdit(row) &&
|
|
@@ -68,8 +68,10 @@
|
|
|
68
68
|
tr.ve-table-body-tr,
|
|
69
69
|
tr.ve-table-expand-tr {
|
|
70
70
|
height: auto;
|
|
71
|
+
// position: relative;
|
|
71
72
|
|
|
72
73
|
td.ve-table-body-td {
|
|
74
|
+
height: 40px;
|
|
73
75
|
padding: 4px 16px;
|
|
74
76
|
}
|
|
75
77
|
}
|
|
@@ -122,7 +124,7 @@
|
|
|
122
124
|
|
|
123
125
|
&-td {
|
|
124
126
|
position: relative;
|
|
125
|
-
|
|
127
|
+
|
|
126
128
|
&-tip {
|
|
127
129
|
padding: 0px 0px 0px 16px;
|
|
128
130
|
font-size: 12px;
|
|
@@ -138,27 +140,44 @@
|
|
|
138
140
|
padding: 0px;
|
|
139
141
|
margin-left: 16px;
|
|
140
142
|
}
|
|
141
|
-
|
|
143
|
+
|
|
142
144
|
&-btn {
|
|
143
145
|
margin-left: 16px;
|
|
144
146
|
padding: 0px;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
+
|
|
147
148
|
&:first-of-type {
|
|
148
149
|
margin: 0px;
|
|
149
150
|
}
|
|
150
151
|
}
|
|
151
152
|
}
|
|
152
|
-
|
|
153
|
+
|
|
154
|
+
&-show { // 级联表格会生效 自己写的table
|
|
155
|
+
height: 40px;
|
|
156
|
+
padding: 4px 16px;
|
|
157
|
+
}
|
|
153
158
|
&-edit {
|
|
154
159
|
padding: 4px 16px 12px 16px!important;
|
|
155
160
|
}
|
|
156
|
-
|
|
157
|
-
|
|
161
|
+
|
|
162
|
+
&-visible {
|
|
163
|
+
@keyframes slideDown {
|
|
164
|
+
from {
|
|
165
|
+
top: -49px;
|
|
166
|
+
opacity: 0.9;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
to {
|
|
170
|
+
top: 0px;
|
|
171
|
+
opacity: 1;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
animation: slideDown .2s linear;
|
|
158
176
|
}
|
|
159
177
|
&-hide {
|
|
160
178
|
display: none!important;
|
|
161
179
|
}
|
|
180
|
+
|
|
162
181
|
&-index {
|
|
163
182
|
padding: 4px 16px 4px 12px!important;
|
|
164
183
|
}
|