bri-components 1.5.22 → 1.6.1

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.
Files changed (154) hide show
  1. package/README.md +83 -83
  2. package/lib/styles/bundle.css +12 -12
  3. package/lib/styles/font/fontello.svg +31 -31
  4. package/package.json +127 -125
  5. package/src/components/Error/Error403.vue +42 -42
  6. package/src/components/Error/Error404.vue +40 -40
  7. package/src/components/Error/Error500.vue +51 -51
  8. package/src/components/Error/error.less +162 -162
  9. package/src/components/Error/errorBack.vue +40 -40
  10. package/src/components/controls/DshControlInput.vue +195 -195
  11. package/src/components/controls/base/BriUpload/BriUpload.vue +435 -434
  12. package/src/components/controls/base/BriUpload/BriUploadImage.vue +430 -377
  13. package/src/components/controls/base/BriUpload/uploadList.vue +738 -727
  14. package/src/components/controls/base/BriUpload/uploadMixin.js +453 -446
  15. package/src/components/controls/base/DshCascader/DshCascader.vue +215 -215
  16. package/src/components/controls/base/DshCascader/components/cascaderModal.vue +366 -366
  17. package/src/components/controls/base/DshCascader/components/cascaderPicker.vue +416 -416
  18. package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +141 -141
  19. package/src/components/controls/base/DshCascader/components/cascaderTree.vue +151 -151
  20. package/src/components/controls/base/DshCoordinates.vue +587 -585
  21. package/src/components/controls/base/DshDate/DshDate.vue +191 -191
  22. package/src/components/controls/base/DshDate/DshDaterange.vue +186 -186
  23. package/src/components/controls/base/DshDivider.vue +201 -201
  24. package/src/components/controls/base/DshEditor.vue +274 -274
  25. package/src/components/controls/base/DshInput/BriInputs.vue +166 -166
  26. package/src/components/controls/base/DshInput/DshInput.vue +260 -260
  27. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +435 -435
  28. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/emitter.js +34 -34
  29. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/form.js +14 -14
  30. package/src/components/controls/base/DshNumber/BriInputNumber/utils/assist.js +322 -322
  31. package/src/components/controls/base/DshNumber/DshNumber.vue +143 -143
  32. package/src/components/controls/base/DshNumber/DshNumberange.vue +109 -109
  33. package/src/components/controls/base/DshSelect/DshCheckbox.vue +168 -168
  34. package/src/components/controls/base/DshSelect/DshSelect.vue +180 -180
  35. package/src/components/controls/base/DshSelect/DshSelectAll.vue +269 -269
  36. package/src/components/controls/base/DshSwitch/DshSwitch.vue +115 -115
  37. package/src/components/controls/control.less +324 -324
  38. package/src/components/controls/controlMap.js +117 -117
  39. package/src/components/controls/extra/DshColor.vue +81 -81
  40. package/src/components/controls/extra/DshThemeColor.vue +100 -100
  41. package/src/components/controls/extra/DshThemeIcon.vue +122 -122
  42. package/src/components/controls/mixins/cascaderMixin.js +325 -325
  43. package/src/components/controls/mixins/cascaderPickerMixin.js +227 -227
  44. package/src/components/controls/mixins/cascaderTableMixin.js +130 -130
  45. package/src/components/controls/mixins/controlMixin.js +393 -393
  46. package/src/components/controls/mixins/dateMixin.js +149 -149
  47. package/src/components/controls/mixins/flatTableMixin.js +111 -111
  48. package/src/components/controls/mixins/numberMixin.js +112 -112
  49. package/src/components/controls/mixins/selectMixin.js +233 -233
  50. package/src/components/controls/mixins/switchMixin.js +87 -87
  51. package/src/components/controls/mixins/userAndDepartMixin.js +260 -260
  52. package/src/components/controls/senior/DshLabels.vue +333 -333
  53. package/src/components/controls/senior/DshPackage.vue +57 -57
  54. package/src/components/controls/senior/cascaderTable.vue +213 -213
  55. package/src/components/controls/senior/correlation.vue +135 -135
  56. package/src/components/controls/senior/flatTable.vue +138 -138
  57. package/src/components/controls/senior/selectDepartments.vue +397 -399
  58. package/src/components/controls/senior/selectUsers/departMenu.vue +296 -293
  59. package/src/components/controls/senior/selectUsers/selectUsers.vue +712 -712
  60. package/src/components/controls/special/DshBack.vue +42 -42
  61. package/src/components/controls/special/DshUndeveloped.vue +41 -41
  62. package/src/components/form/DshAdvSearch.vue +510 -510
  63. package/src/components/form/DshDefaultSearch.vue +260 -260
  64. package/src/components/form/DshForm.vue +494 -494
  65. package/src/components/form/searchMixin.js +376 -376
  66. package/src/components/list/BriCard.vue +95 -95
  67. package/src/components/list/BriTable.vue +205 -205
  68. package/src/components/list/BriTree.vue +529 -529
  69. package/src/components/list/BriTreeItem.vue +163 -163
  70. package/src/components/list/DshBox/DshBox.vue +219 -219
  71. package/src/components/list/DshBox/DshCard.vue +446 -446
  72. package/src/components/list/DshBox/DshCrossTable.vue +827 -827
  73. package/src/components/list/DshBox/DshList.vue +404 -404
  74. package/src/components/list/DshBox/DshPanel.vue +669 -669
  75. package/src/components/list/DshBox/DshSingleData.vue +119 -119
  76. package/src/components/list/DshBox/DshTable.vue +239 -239
  77. package/src/components/list/DshCascaderTable.vue +115 -115
  78. package/src/components/list/DshFlatTable.vue +334 -337
  79. package/src/components/list/DshPage.vue +194 -194
  80. package/src/components/list/DshTreeTable.vue +113 -113
  81. package/src/components/list/common/importModal.vue +243 -243
  82. package/src/components/list/common/quoteListModal.vue +206 -206
  83. package/src/components/list/mixins/DshCascaderTableMixin.js +278 -278
  84. package/src/components/list/mixins/DshFlatTableMixin.js +509 -509
  85. package/src/components/list/mixins/DshTreeTableMixin.js +286 -286
  86. package/src/components/list/mixins/tableBaseMixin.js +1653 -1653
  87. package/src/components/list/mixins/treeTableBaseMixin.js +145 -145
  88. package/src/components/other/BriAvatar.vue +166 -166
  89. package/src/components/other/BriCode.vue +125 -125
  90. package/src/components/other/BriCollapseTree.vue +207 -207
  91. package/src/components/other/BriGantt.vue +1087 -1087
  92. package/src/components/other/BriIframe.vue +116 -116
  93. package/src/components/other/BriLoading.vue +171 -171
  94. package/src/components/other/BriSvg.vue +27 -27
  95. package/src/components/other/DshColorPanel.vue +128 -128
  96. package/src/components/other/DshMenuNav.vue +188 -188
  97. package/src/components/other/DshVideoPlayer.vue +184 -0
  98. package/src/components/small/BriButton.vue +71 -71
  99. package/src/components/small/BriDrawer.vue +169 -169
  100. package/src/components/small/BriTooltip.vue +87 -87
  101. package/src/components/small/DshBtnModal.vue +68 -68
  102. package/src/components/small/DshButtons.vue +324 -324
  103. package/src/components/small/DshDropdown.vue +225 -225
  104. package/src/components/small/DshIcons.vue +59 -59
  105. package/src/components/small/DshListRender.js +21 -21
  106. package/src/components/small/DshModal.vue +160 -160
  107. package/src/components/small/DshSteps.vue +141 -141
  108. package/src/components/small/DshTabs.vue +598 -598
  109. package/src/components/small/DshTabsSet.vue +309 -309
  110. package/src/components/small/DshTags.vue +251 -251
  111. package/src/components/small/DshTitle.vue +50 -50
  112. package/src/components/small/render.js +20 -20
  113. package/src/components/unit/DshFormUnit.vue +398 -398
  114. package/src/components/unit/DshListUnit.vue +115 -115
  115. package/src/components/unit/unitMixin.js +86 -86
  116. package/src/data/index.js +4 -4
  117. package/src/index.js +287 -285
  118. package/src/styles/bundle.css +12 -12
  119. package/src/styles/components/BriButton.less +307 -307
  120. package/src/styles/components/BriTable.less +344 -344
  121. package/src/styles/components/DshModal.less +257 -257
  122. package/src/styles/components/index.less +3 -3
  123. package/src/styles/global/animate.less +11 -11
  124. package/src/styles/global/base.less +45 -45
  125. package/src/styles/global/box.less +186 -186
  126. package/src/styles/global/control.less +122 -122
  127. package/src/styles/global/flex.less +282 -282
  128. package/src/styles/global/global.less +8 -8
  129. package/src/styles/global/text.less +59 -59
  130. package/src/styles/global/variables.less +85 -85
  131. package/src/styles/iconfont/iconfont.css +254 -254
  132. package/src/styles/iconfont/iconfont.json +422 -422
  133. package/src/styles/iconfont/iconfont.svg +137 -137
  134. package/src/styles/index.less +26 -26
  135. package/src/styles/reset-easytable.less +21 -21
  136. package/src/styles/reset-iview-controls.less +145 -145
  137. package/src/styles/reset-iview-other.less +49 -49
  138. package/src/styles/reset-iview-variables.less +43 -43
  139. package/src/styles/reset.less +45 -45
  140. package/src/utils/index.js +3 -5
  141. package/lib/0.bri-components.min.js +0 -1
  142. package/lib/1.bri-components.min.js +0 -1
  143. package/lib/10.bri-components.min.js +0 -1
  144. package/lib/11.bri-components.min.js +0 -1
  145. package/lib/2.bri-components.min.js +0 -1
  146. package/lib/3.bri-components.min.js +0 -1
  147. package/lib/4.bri-components.min.js +0 -1
  148. package/lib/5.bri-components.min.js +0 -1
  149. package/lib/6.bri-components.min.js +0 -1
  150. package/lib/7.bri-components.min.js +0 -1
  151. package/lib/8.bri-components.min.js +0 -1
  152. package/lib/9.bri-components.min.js +0 -1
  153. package/lib/bri-components.min.js +0 -18
  154. package/src/utils/table.js +0 -175
@@ -1,510 +1,510 @@
1
- <template>
2
- <div class="DshAdvSearch">
3
- <!-- 有可选择字段 -->
4
- <template v-if="canSearchFormList.length">
5
- <!-- 逻辑 -->
6
- <div class="DshAdvSearch-logic">
7
- <div class="DshAdvSearch-logic-title">{{ logicStr }}</div>
8
- <dsh-select
9
- class="DshAdvSearch-logic-option"
10
- :value="advSearchObj"
11
- :propsObj="selfLogicPropsObj"
12
- @change="change"
13
- ></dsh-select>
14
- </div>
15
-
16
- <!-- 条件 -->
17
- <div class="DshAdvSearch-title">{{ conditionStr }}</div>
18
- <div class="DshAdvSearch-conditions">
19
- <template v-for="(conditionItem, conditionIndex) in advSearchObj.conditions">
20
- <!-- 'and', 'or' 循环模式 -->
21
- <div
22
- v-if="['and', 'or'].includes(conditionItem.logic)"
23
- :key="`${conditionItem._id}andor`"
24
- class="DshAdvSearch-conditions-loop"
25
- >
26
- <dsh-adv-search
27
- :mode="mode"
28
- :isSimpleSearch="isSimpleSearch"
29
- :themeWord="themeWord"
30
- :useLoop="useLoop"
31
- :isInner="true"
32
- :value="conditionItem"
33
- :formList="canSearchFormList"
34
- :useChainField="useChainField"
35
- :dynamicFormList="dynamicFormList"
36
- @change="change('loopSearch', conditionItem, ...arguments)"
37
- >
38
- <slot
39
- slot-scope="{ conditionItem }"
40
- :conditionItem="conditionItem"
41
- ></slot>
42
- </dsh-adv-search>
43
-
44
- <!-- 删除 -->
45
- <dsh-icons
46
- slot="corner"
47
- class="DshAdvSearch-conditions-delete"
48
- :list="$getOperationList(['deleteCondition'])"
49
- @click="$dispatchEvent($event, conditionItem, conditionIndex, advSearchObj.conditions)"
50
- />
51
- </div>
52
-
53
- <!-- field 正常模式 -->
54
- <dsh-form-unit
55
- v-else-if="['field', undefined].includes(conditionItem.logic)"
56
- :key="`${conditionItem._id}field`"
57
- :class="{
58
- 'DshAdvSearch-conditions-item': true,
59
- 'DshAdvSearch-conditions-item-dynamic': conditionItem.dynamicList && conditionItem.dynamicList.length
60
- }"
61
- :formData="conditionItem"
62
- :formItem="conditionItem.formItem"
63
- height="80"
64
- @change="change('control', conditionItem, ...arguments)"
65
- >
66
- <template v-if="!conditionItem.__isDelete__">
67
- <slot :conditionItem="conditionItem">
68
- <!-- 为空和不为空时 啥内容也不显示 -->
69
- <div
70
- v-if="['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator)"
71
- class="DshAdvSearch-conditions-item-blank"
72
- >请选择右上角条件</div>
73
-
74
- <!-- 子表的筛选,递归 -->
75
- <template v-else-if="['subSearch', 'subTableSearch', 'cascaderTableSearch', 'treeTableSearch'].includes(conditionItem.fieldOperator)">
76
- <!-- 出现是有条件的 -->
77
- <dsh-adv-search
78
- v-if="conditionItem.finished === true"
79
- style="padding: 0px 0px 0px 8px;"
80
- :mode="mode"
81
- :isSimpleSearch="isSimpleSearch"
82
- :themeWord="themeWord"
83
- :useLoop="useLoop"
84
- :isInner="true"
85
- :value="conditionItem.fieldSearch"
86
- :formList="conditionItem.subFormList"
87
- :useChainField="useChainField"
88
- :dynamicFormList="dynamicFormList"
89
- @change="change('subSearch', conditionItem, ...arguments)"
90
- ></dsh-adv-search>
91
-
92
- <div
93
- v-else
94
- class="DshAdvSearch-conditions-item-loading"
95
- >加载中……</div>
96
- </template>
97
-
98
- <!-- 其他 -->
99
- <template v-else>
100
- <!-- 动态文本 -匹配的动态字段 -->
101
- <template v-if="conditionItem.parameterType === 'dynamicText'">
102
- <dsh-select
103
- v-if="useChainField"
104
- class="DshAdvSearch-conditions-item-control"
105
- :value="conditionItem"
106
- :propsObj="{
107
- _name: `${conditionItem.formItem._name}的联动字段`,
108
- _key: 'chainFieldKey',
109
- _data: conditionItem.dynamicList
110
- }"
111
- @change="change('parameterTypeControl', conditionItem, ...arguments)"
112
- ></dsh-select>
113
-
114
- <dsh-checkbox
115
- v-else
116
- class="DshAdvSearch-conditions-item-control"
117
- :value="conditionItem"
118
- :propsObj="{
119
- _name: `${conditionItem.formItem._name}的动态参数`,
120
- _key: 'fieldParams',
121
- _data: conditionItem.dynamicList
122
- }"
123
- @change="change('parameterTypeControl', conditionItem, ...arguments)"
124
- ></dsh-checkbox>
125
- </template>
126
-
127
- <!-- 固定文本 -->
128
- </template>
129
- </slot>
130
- </template>
131
-
132
- <!-- 右上角 -->
133
- <div
134
- v-if="!conditionItem.__isDelete__"
135
- slot="extra"
136
- class="DshAdvSearch-conditions-item-extra"
137
- >
138
- <!-- 动态类型 or 固定类型 -->
139
- <dsh-dropdown
140
- v-if="
141
- conditionItem.dynamicList.length &&
142
- !['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator) &&
143
- !['subSearch', 'subTableSearch', 'cascaderTableSearch', 'treeTableSearch'].includes(conditionItem.fieldOperator)
144
- "
145
- class="extra-dynamic"
146
- :list="getParameterData(conditionItem)"
147
- @click="$dispatchEvent(operationMap.selectParameterType, conditionItem, conditionIndex, advSearchObj.conditions, $event)"
148
- >
149
- <span class="extra-operator-wrap">
150
- <span class="extra-operator-name">
151
- {{ conditionItem.parameterTypeName }}
152
- </span>
153
- <Icon
154
- v-if="getParameterData(conditionItem).length"
155
- class="extra-operator-icon"
156
- type="ios-arrow-down"
157
- />
158
- </span>
159
- </dsh-dropdown>
160
-
161
- <!-- operators 操作类型 -->
162
- <dsh-dropdown
163
- v-if="!isSimpleSearch && conditionItem.operators.length"
164
- class="extra-operator"
165
- :list="conditionItem.operators"
166
- @click="$dispatchEvent(operationMap.selectOperator, conditionItem, conditionIndex, advSearchObj.conditions, $event)"
167
- >
168
- <span class="extra-operator-wrap">
169
- <span class="extra-operator-name">
170
- {{ conditionItem.fieldOperatorName }}
171
- </span>
172
- <Icon
173
- class="extra-operator-icon"
174
- type="ios-arrow-down"
175
- />
176
- </span>
177
- </dsh-dropdown>
178
- </div>
179
-
180
- <!-- 删除 -->
181
- <dsh-icons
182
- slot="corner"
183
- class="DshAdvSearch-conditions-delete"
184
- :list="$getOperationList(['deleteCondition'])"
185
- @click="$dispatchEvent($event, conditionItem, conditionIndex, advSearchObj.conditions)"
186
- />
187
- </dsh-form-unit>
188
-
189
- <!-- text 关键字的模式 -->
190
- <div
191
- v-else-if="['text'].includes(conditionItem.logic)"
192
- :key="`${conditionItem._id}text`"
193
- >
194
- {{ conditionItem.logic }}模式暂未开发
195
- </div>
196
-
197
- <!-- native 以及以后可能增加的模式 -->
198
- <div
199
- v-else
200
- :key="`${conditionItem._id}other`"
201
- >
202
- {{ conditionItem.logic }}模式未开发
203
- </div>
204
- </template>
205
- </div>
206
-
207
- <!-- 按钮s -->
208
- <div class="DshAdvSearch-btns">
209
- <!-- 添加条件项 -->
210
- <dsh-dropdown
211
- class="DshAdvSearch-btns-field"
212
- menuClass="DshAdvSearch-btns-field-list"
213
- :list="canSearchFormList"
214
- :useSearch="true"
215
- trigger="click"
216
- @click="$dispatchEvent(operationMap.createCondition, false, $event, advSearchObj.conditions)"
217
- >
218
- <dsh-buttons
219
- itemClass="DshAdvSearch-btns-item"
220
- :list="$getOperationList(['createCondition'])"
221
- ></dsh-buttons>
222
- </dsh-dropdown>
223
-
224
- <!-- 添加循环层 -->
225
- <dsh-buttons
226
- class="DshAdvSearch-btns-loop"
227
- :list="$getOperationList(['createLoopContion'])"
228
- @click="$dispatchEvent($event, true, undefined, advSearchObj.conditions)"
229
- ></dsh-buttons>
230
- </div>
231
- </template>
232
-
233
- <!-- 无可选择字段 -->
234
- <div
235
- v-else
236
- :class="{
237
- 'DshAdvSearch-nodata': !isInner,
238
- 'DshAdvSearch-nodata-small': isInner
239
- }"
240
- >
241
- {{ noFormListStr }}
242
- </div>
243
- </div>
244
- </template>
245
-
246
- <script>
247
- import searchMixin from "./searchMixin.js";
248
-
249
- export default {
250
- name: "DshAdvSearch",
251
- mixins: [
252
- searchMixin
253
- ],
254
- components: {},
255
- props: {
256
- mode: {
257
- type: String,
258
- default: "default",
259
- validator (val) {
260
- // 用户态、 配置端、高级依赖、以及仪表盘乱用的地方
261
- return ["default", "set"].includes(val);
262
- }
263
- },
264
- // 用高级筛选 但简单的像默认筛选那样使用(不要逻辑条件,筛选层,右上筛选条件)
265
- isSimpleSearch: {
266
- type: Boolean,
267
- default: false
268
- },
269
- themeWord: {
270
- type: String,
271
- default: "筛选"
272
- },
273
- useLoop: {
274
- type: Boolean,
275
- default: true
276
- },
277
- isInner: {
278
- type: Boolean,
279
- default: false
280
- }
281
- },
282
- data () {
283
- return {
284
- selfLogicPropsObj: {
285
- _name: `添加${this.themeWord}逻辑`,
286
- _key: "logic",
287
- _optionKind: "flat",
288
- _clearable: false,
289
- // _disabled: this.isSimpleSearch,
290
- _data: [
291
- { _key: "and", name: "且" },
292
- { _key: "or", name: "或" }
293
- ]
294
- },
295
-
296
- allOperationMap: {
297
- createCondition: {
298
- name: `添加${this.themeWord}条件`,
299
- type: "createCondition",
300
- icon: "md-add",
301
- size: this.isInner ? "small" : "default",
302
- long: true,
303
- event: "createCondition"
304
- },
305
- createLoopContion: {
306
- name: `添加${this.themeWord === "筛选" ? this.themeWord : "逻辑"}层`,
307
- type: "createLoopContion",
308
- icon: "md-add",
309
- size: this.isInner ? "small" : "default",
310
- long: true,
311
- event: "createCondition"
312
- },
313
- deleteCondition: {
314
- name: `删除${this.themeWord}条件`,
315
- type: "deleteCondition",
316
- customIcon: "bico-delete",
317
- size: "16",
318
- event: "deleteCondition"
319
- },
320
- selectOperator: {
321
- name: `选择${this.themeWord}类型`,
322
- type: "selectOperator",
323
- event: "changeOperator"
324
- },
325
- selectParameterType: {
326
- name: `选择${this.themeWord}方式`,
327
- type: "selectParameterType",
328
- event: "changeParameterType"
329
- }
330
- }
331
- };
332
- },
333
- computed: {
334
- logicStr () {
335
- return `${this.themeWord}逻辑`;
336
- },
337
- conditionStr () {
338
- return `${this.themeWord}条件`;
339
- },
340
- noFormListStr () {
341
- return "当前无可选择的字段";
342
- },
343
-
344
- operationMap () {
345
- return this.$categoryMapToMap(
346
- this.allOperationMap,
347
- undefined,
348
- this.isSimpleSearch === true || this.useLoop === false ? ["createLoopContion"] : []
349
- );
350
- }
351
- },
352
- created () {},
353
- methods: {}
354
- };
355
- </script>
356
-
357
- <style lang="less" scoped>
358
- .DshAdvSearch {
359
- #title {
360
- font-weight: 400;
361
- font-size: 14px;
362
- color: #999999;
363
- }
364
-
365
- &-title {
366
- #title();
367
- }
368
-
369
- &-logic {
370
- margin: 0px 0px 10px;
371
- .dsh-flex-row-start-center();
372
-
373
- &-title {
374
- #title();
375
- }
376
-
377
- &-option {
378
- flex: 1;
379
- min-width: 100px;
380
- margin-left: 20px;
381
- }
382
- }
383
-
384
- &-conditions {
385
- &-delete {
386
- position: absolute;
387
- top: 3px;
388
- right: -3px;
389
- padding: 3px;
390
- color: red;
391
- display: none;
392
- }
393
-
394
- &-loop,
395
- &-item {
396
- position: relative;
397
-
398
- &:hover,
399
- &-active {
400
- .DshAdvSearch-conditions-delete {
401
- display: inline-block;
402
- }
403
- }
404
- }
405
-
406
- &-loop {
407
- padding: 10px;
408
- margin: 6px;
409
- border: 1px solid @placeholderColor;
410
- background-color: #F4F8FF;
411
- }
412
-
413
- &-item {
414
- padding: 0!important;
415
- margin-bottom: 8px!important;
416
- cursor: pointer;
417
-
418
- &-loading {
419
- margin: 5px 0px;
420
- text-align: center;
421
- font-size: 16px;
422
- color: @textColor;
423
- }
424
-
425
- &-control {
426
- margin-bottom: 5px;
427
- }
428
-
429
- &-blank {
430
- text-align: center;
431
- line-height: 30px;
432
- color: @placeholderColor;
433
- }
434
-
435
- &-extra {
436
- text-align: right;
437
-
438
- .extra {
439
- &-dynamic,
440
- &-operator {
441
- &-wrap {
442
- display: inline-block;
443
- padding: 3px 5px;
444
- border-radius: 3px;
445
-
446
- &:hover {
447
- background-color: #e9f2f9;
448
- }
449
- }
450
-
451
- &-name {
452
- display: inline-block;
453
- min-width: 24px;
454
- }
455
-
456
- &-icon {
457
-
458
- }
459
- }
460
- }
461
- }
462
- }
463
- }
464
-
465
- &-btns {
466
- width: 100%;
467
- margin-top: 15px;
468
- .dsh-flex-row-start-center();
469
-
470
- &-field {
471
- flex: 3;
472
-
473
- &-list {
474
- width: 330px;
475
- }
476
- }
477
-
478
- &-loop {
479
- flex: 1;
480
- margin-left: 12px;
481
- }
482
- }
483
-
484
- &-nodata {
485
- #dsh-nodata();
486
-
487
- &-small {
488
- #dsh-nodata-small();
489
- }
490
- }
491
- }
492
- </style>
493
- <style lang="less">
494
- .DshAdvSearch {
495
- &-conditions {
496
- &-item {
497
- .DshFormUnit-label-right {
498
- flex: 3;
499
- margin-right: 10px;
500
- }
501
-
502
- &-dynamic {
503
- .DshFormUnit-label-right {
504
- flex: 4;
505
- }
506
- }
507
- }
508
- }
509
- }
510
- </style>
1
+ <template>
2
+ <div class="DshAdvSearch">
3
+ <!-- 有可选择字段 -->
4
+ <template v-if="canSearchFormList.length">
5
+ <!-- 逻辑 -->
6
+ <div class="DshAdvSearch-logic">
7
+ <div class="DshAdvSearch-logic-title">{{ logicStr }}</div>
8
+ <dsh-select
9
+ class="DshAdvSearch-logic-option"
10
+ :value="advSearchObj"
11
+ :propsObj="selfLogicPropsObj"
12
+ @change="change"
13
+ ></dsh-select>
14
+ </div>
15
+
16
+ <!-- 条件 -->
17
+ <div class="DshAdvSearch-title">{{ conditionStr }}</div>
18
+ <div class="DshAdvSearch-conditions">
19
+ <template v-for="(conditionItem, conditionIndex) in advSearchObj.conditions">
20
+ <!-- 'and', 'or' 循环模式 -->
21
+ <div
22
+ v-if="['and', 'or'].includes(conditionItem.logic)"
23
+ :key="`${conditionItem._id}andor`"
24
+ class="DshAdvSearch-conditions-loop"
25
+ >
26
+ <dsh-adv-search
27
+ :mode="mode"
28
+ :isSimpleSearch="isSimpleSearch"
29
+ :themeWord="themeWord"
30
+ :useLoop="useLoop"
31
+ :isInner="true"
32
+ :value="conditionItem"
33
+ :formList="canSearchFormList"
34
+ :useChainField="useChainField"
35
+ :dynamicFormList="dynamicFormList"
36
+ @change="change('loopSearch', conditionItem, ...arguments)"
37
+ >
38
+ <slot
39
+ slot-scope="{ conditionItem }"
40
+ :conditionItem="conditionItem"
41
+ ></slot>
42
+ </dsh-adv-search>
43
+
44
+ <!-- 删除 -->
45
+ <dsh-icons
46
+ slot="corner"
47
+ class="DshAdvSearch-conditions-delete"
48
+ :list="$getOperationList(['deleteCondition'])"
49
+ @click="$dispatchEvent($event, conditionItem, conditionIndex, advSearchObj.conditions)"
50
+ />
51
+ </div>
52
+
53
+ <!-- field 正常模式 -->
54
+ <dsh-form-unit
55
+ v-else-if="['field', undefined].includes(conditionItem.logic)"
56
+ :key="`${conditionItem._id}field`"
57
+ :class="{
58
+ 'DshAdvSearch-conditions-item': true,
59
+ 'DshAdvSearch-conditions-item-dynamic': conditionItem.dynamicList && conditionItem.dynamicList.length
60
+ }"
61
+ :formData="conditionItem"
62
+ :formItem="conditionItem.formItem"
63
+ height="80"
64
+ @change="change('control', conditionItem, ...arguments)"
65
+ >
66
+ <template v-if="!conditionItem.__isDelete__">
67
+ <slot :conditionItem="conditionItem">
68
+ <!-- 为空和不为空时 啥内容也不显示 -->
69
+ <div
70
+ v-if="['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator)"
71
+ class="DshAdvSearch-conditions-item-blank"
72
+ >请选择右上角条件</div>
73
+
74
+ <!-- 子表的筛选,递归 -->
75
+ <template v-else-if="['subSearch', 'subTableSearch', 'cascaderTableSearch', 'treeTableSearch'].includes(conditionItem.fieldOperator)">
76
+ <!-- 出现是有条件的 -->
77
+ <dsh-adv-search
78
+ v-if="conditionItem.finished === true"
79
+ style="padding: 0px 0px 0px 8px;"
80
+ :mode="mode"
81
+ :isSimpleSearch="isSimpleSearch"
82
+ :themeWord="themeWord"
83
+ :useLoop="useLoop"
84
+ :isInner="true"
85
+ :value="conditionItem.fieldSearch"
86
+ :formList="conditionItem.subFormList"
87
+ :useChainField="useChainField"
88
+ :dynamicFormList="dynamicFormList"
89
+ @change="change('subSearch', conditionItem, ...arguments)"
90
+ ></dsh-adv-search>
91
+
92
+ <div
93
+ v-else
94
+ class="DshAdvSearch-conditions-item-loading"
95
+ >加载中……</div>
96
+ </template>
97
+
98
+ <!-- 其他 -->
99
+ <template v-else>
100
+ <!-- 动态文本 -匹配的动态字段 -->
101
+ <template v-if="conditionItem.parameterType === 'dynamicText'">
102
+ <dsh-select
103
+ v-if="useChainField"
104
+ class="DshAdvSearch-conditions-item-control"
105
+ :value="conditionItem"
106
+ :propsObj="{
107
+ _name: `${conditionItem.formItem._name}的联动字段`,
108
+ _key: 'chainFieldKey',
109
+ _data: conditionItem.dynamicList
110
+ }"
111
+ @change="change('parameterTypeControl', conditionItem, ...arguments)"
112
+ ></dsh-select>
113
+
114
+ <dsh-checkbox
115
+ v-else
116
+ class="DshAdvSearch-conditions-item-control"
117
+ :value="conditionItem"
118
+ :propsObj="{
119
+ _name: `${conditionItem.formItem._name}的动态参数`,
120
+ _key: 'fieldParams',
121
+ _data: conditionItem.dynamicList
122
+ }"
123
+ @change="change('parameterTypeControl', conditionItem, ...arguments)"
124
+ ></dsh-checkbox>
125
+ </template>
126
+
127
+ <!-- 固定文本 -->
128
+ </template>
129
+ </slot>
130
+ </template>
131
+
132
+ <!-- 右上角 -->
133
+ <div
134
+ v-if="!conditionItem.__isDelete__"
135
+ slot="extra"
136
+ class="DshAdvSearch-conditions-item-extra"
137
+ >
138
+ <!-- 动态类型 or 固定类型 -->
139
+ <dsh-dropdown
140
+ v-if="
141
+ conditionItem.dynamicList.length &&
142
+ !['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator) &&
143
+ !['subSearch', 'subTableSearch', 'cascaderTableSearch', 'treeTableSearch'].includes(conditionItem.fieldOperator)
144
+ "
145
+ class="extra-dynamic"
146
+ :list="getParameterData(conditionItem)"
147
+ @click="$dispatchEvent(operationMap.selectParameterType, conditionItem, conditionIndex, advSearchObj.conditions, $event)"
148
+ >
149
+ <span class="extra-operator-wrap">
150
+ <span class="extra-operator-name">
151
+ {{ conditionItem.parameterTypeName }}
152
+ </span>
153
+ <Icon
154
+ v-if="getParameterData(conditionItem).length"
155
+ class="extra-operator-icon"
156
+ type="ios-arrow-down"
157
+ />
158
+ </span>
159
+ </dsh-dropdown>
160
+
161
+ <!-- operators 操作类型 -->
162
+ <dsh-dropdown
163
+ v-if="!isSimpleSearch && conditionItem.operators.length"
164
+ class="extra-operator"
165
+ :list="conditionItem.operators"
166
+ @click="$dispatchEvent(operationMap.selectOperator, conditionItem, conditionIndex, advSearchObj.conditions, $event)"
167
+ >
168
+ <span class="extra-operator-wrap">
169
+ <span class="extra-operator-name">
170
+ {{ conditionItem.fieldOperatorName }}
171
+ </span>
172
+ <Icon
173
+ class="extra-operator-icon"
174
+ type="ios-arrow-down"
175
+ />
176
+ </span>
177
+ </dsh-dropdown>
178
+ </div>
179
+
180
+ <!-- 删除 -->
181
+ <dsh-icons
182
+ slot="corner"
183
+ class="DshAdvSearch-conditions-delete"
184
+ :list="$getOperationList(['deleteCondition'])"
185
+ @click="$dispatchEvent($event, conditionItem, conditionIndex, advSearchObj.conditions)"
186
+ />
187
+ </dsh-form-unit>
188
+
189
+ <!-- text 关键字的模式 -->
190
+ <div
191
+ v-else-if="['text'].includes(conditionItem.logic)"
192
+ :key="`${conditionItem._id}text`"
193
+ >
194
+ {{ conditionItem.logic }}模式暂未开发
195
+ </div>
196
+
197
+ <!-- native 以及以后可能增加的模式 -->
198
+ <div
199
+ v-else
200
+ :key="`${conditionItem._id}other`"
201
+ >
202
+ {{ conditionItem.logic }}模式未开发
203
+ </div>
204
+ </template>
205
+ </div>
206
+
207
+ <!-- 按钮s -->
208
+ <div class="DshAdvSearch-btns">
209
+ <!-- 添加条件项 -->
210
+ <dsh-dropdown
211
+ class="DshAdvSearch-btns-field"
212
+ menuClass="DshAdvSearch-btns-field-list"
213
+ :list="canSearchFormList"
214
+ :useSearch="true"
215
+ trigger="click"
216
+ @click="$dispatchEvent(operationMap.createCondition, false, $event, advSearchObj.conditions)"
217
+ >
218
+ <dsh-buttons
219
+ itemClass="DshAdvSearch-btns-item"
220
+ :list="$getOperationList(['createCondition'])"
221
+ ></dsh-buttons>
222
+ </dsh-dropdown>
223
+
224
+ <!-- 添加循环层 -->
225
+ <dsh-buttons
226
+ class="DshAdvSearch-btns-loop"
227
+ :list="$getOperationList(['createLoopContion'])"
228
+ @click="$dispatchEvent($event, true, undefined, advSearchObj.conditions)"
229
+ ></dsh-buttons>
230
+ </div>
231
+ </template>
232
+
233
+ <!-- 无可选择字段 -->
234
+ <div
235
+ v-else
236
+ :class="{
237
+ 'DshAdvSearch-nodata': !isInner,
238
+ 'DshAdvSearch-nodata-small': isInner
239
+ }"
240
+ >
241
+ {{ noFormListStr }}
242
+ </div>
243
+ </div>
244
+ </template>
245
+
246
+ <script>
247
+ import searchMixin from "./searchMixin.js";
248
+
249
+ export default {
250
+ name: "DshAdvSearch",
251
+ mixins: [
252
+ searchMixin
253
+ ],
254
+ components: {},
255
+ props: {
256
+ mode: {
257
+ type: String,
258
+ default: "default",
259
+ validator (val) {
260
+ // 用户态、 配置端、高级依赖、以及仪表盘乱用的地方
261
+ return ["default", "set"].includes(val);
262
+ }
263
+ },
264
+ // 用高级筛选 但简单的像默认筛选那样使用(不要逻辑条件,筛选层,右上筛选条件)
265
+ isSimpleSearch: {
266
+ type: Boolean,
267
+ default: false
268
+ },
269
+ themeWord: {
270
+ type: String,
271
+ default: "筛选"
272
+ },
273
+ useLoop: {
274
+ type: Boolean,
275
+ default: true
276
+ },
277
+ isInner: {
278
+ type: Boolean,
279
+ default: false
280
+ }
281
+ },
282
+ data () {
283
+ return {
284
+ selfLogicPropsObj: {
285
+ _name: `添加${this.themeWord}逻辑`,
286
+ _key: "logic",
287
+ _optionKind: "flat",
288
+ _clearable: false,
289
+ // _disabled: this.isSimpleSearch,
290
+ _data: [
291
+ { _key: "and", name: "且" },
292
+ { _key: "or", name: "或" }
293
+ ]
294
+ },
295
+
296
+ allOperationMap: {
297
+ createCondition: {
298
+ name: `添加${this.themeWord}条件`,
299
+ type: "createCondition",
300
+ icon: "md-add",
301
+ size: this.isInner ? "small" : "default",
302
+ long: true,
303
+ event: "createCondition"
304
+ },
305
+ createLoopContion: {
306
+ name: `添加${this.themeWord === "筛选" ? this.themeWord : "逻辑"}层`,
307
+ type: "createLoopContion",
308
+ icon: "md-add",
309
+ size: this.isInner ? "small" : "default",
310
+ long: true,
311
+ event: "createCondition"
312
+ },
313
+ deleteCondition: {
314
+ name: `删除${this.themeWord}条件`,
315
+ type: "deleteCondition",
316
+ customIcon: "bico-delete",
317
+ size: "16",
318
+ event: "deleteCondition"
319
+ },
320
+ selectOperator: {
321
+ name: `选择${this.themeWord}类型`,
322
+ type: "selectOperator",
323
+ event: "changeOperator"
324
+ },
325
+ selectParameterType: {
326
+ name: `选择${this.themeWord}方式`,
327
+ type: "selectParameterType",
328
+ event: "changeParameterType"
329
+ }
330
+ }
331
+ };
332
+ },
333
+ computed: {
334
+ logicStr () {
335
+ return `${this.themeWord}逻辑`;
336
+ },
337
+ conditionStr () {
338
+ return `${this.themeWord}条件`;
339
+ },
340
+ noFormListStr () {
341
+ return "当前无可选择的字段";
342
+ },
343
+
344
+ operationMap () {
345
+ return this.$categoryMapToMap(
346
+ this.allOperationMap,
347
+ undefined,
348
+ this.isSimpleSearch === true || this.useLoop === false ? ["createLoopContion"] : []
349
+ );
350
+ }
351
+ },
352
+ created () {},
353
+ methods: {}
354
+ };
355
+ </script>
356
+
357
+ <style lang="less" scoped>
358
+ .DshAdvSearch {
359
+ #title {
360
+ font-weight: 400;
361
+ font-size: 14px;
362
+ color: #999999;
363
+ }
364
+
365
+ &-title {
366
+ #title();
367
+ }
368
+
369
+ &-logic {
370
+ margin: 0px 0px 10px;
371
+ .dsh-flex-row-start-center();
372
+
373
+ &-title {
374
+ #title();
375
+ }
376
+
377
+ &-option {
378
+ flex: 1;
379
+ min-width: 100px;
380
+ margin-left: 20px;
381
+ }
382
+ }
383
+
384
+ &-conditions {
385
+ &-delete {
386
+ position: absolute;
387
+ top: 3px;
388
+ right: -3px;
389
+ padding: 3px;
390
+ color: red;
391
+ display: none;
392
+ }
393
+
394
+ &-loop,
395
+ &-item {
396
+ position: relative;
397
+
398
+ &:hover,
399
+ &-active {
400
+ .DshAdvSearch-conditions-delete {
401
+ display: inline-block;
402
+ }
403
+ }
404
+ }
405
+
406
+ &-loop {
407
+ padding: 10px;
408
+ margin: 6px;
409
+ border: 1px solid @placeholderColor;
410
+ background-color: #F4F8FF;
411
+ }
412
+
413
+ &-item {
414
+ padding: 0!important;
415
+ margin-bottom: 8px!important;
416
+ cursor: pointer;
417
+
418
+ &-loading {
419
+ margin: 5px 0px;
420
+ text-align: center;
421
+ font-size: 16px;
422
+ color: @textColor;
423
+ }
424
+
425
+ &-control {
426
+ margin-bottom: 5px;
427
+ }
428
+
429
+ &-blank {
430
+ text-align: center;
431
+ line-height: 30px;
432
+ color: @placeholderColor;
433
+ }
434
+
435
+ &-extra {
436
+ text-align: right;
437
+
438
+ .extra {
439
+ &-dynamic,
440
+ &-operator {
441
+ &-wrap {
442
+ display: inline-block;
443
+ padding: 3px 5px;
444
+ border-radius: 3px;
445
+
446
+ &:hover {
447
+ background-color: #e9f2f9;
448
+ }
449
+ }
450
+
451
+ &-name {
452
+ display: inline-block;
453
+ min-width: 24px;
454
+ }
455
+
456
+ &-icon {
457
+
458
+ }
459
+ }
460
+ }
461
+ }
462
+ }
463
+ }
464
+
465
+ &-btns {
466
+ width: 100%;
467
+ margin-top: 15px;
468
+ .dsh-flex-row-start-center();
469
+
470
+ &-field {
471
+ flex: 3;
472
+
473
+ &-list {
474
+ width: 330px;
475
+ }
476
+ }
477
+
478
+ &-loop {
479
+ flex: 1;
480
+ margin-left: 12px;
481
+ }
482
+ }
483
+
484
+ &-nodata {
485
+ #dsh-nodata();
486
+
487
+ &-small {
488
+ #dsh-nodata-small();
489
+ }
490
+ }
491
+ }
492
+ </style>
493
+ <style lang="less">
494
+ .DshAdvSearch {
495
+ &-conditions {
496
+ &-item {
497
+ .DshFormUnit-label-right {
498
+ flex: 3;
499
+ margin-right: 10px;
500
+ }
501
+
502
+ &-dynamic {
503
+ .DshFormUnit-label-right {
504
+ flex: 4;
505
+ }
506
+ }
507
+ }
508
+ }
509
+ }
510
+ </style>