hd-idevvue3 3.0.5 → 3.0.8

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 (155) hide show
  1. package/dist/static/css/index-DRHIlcVU.css +1 -0
  2. package/dist/static/js/index-DbUA6jg0.js +184 -0
  3. package/dist/static/js/index-Dl4O91nB.js +73768 -0
  4. package/package.json +16 -16
  5. package/.env.development +0 -5
  6. package/.env.production +0 -5
  7. package/.eslintrc.js +0 -151
  8. package/dist/assets/index.431f21ca.css +0 -1
  9. package/dist/hd-idevvue3.mjs +0 -45878
  10. package/dist/hd-idevvue3.umd.js +0 -153
  11. package/index.html +0 -18
  12. package/npminstall-debug.log +0 -200
  13. package/pnpm-lock.yaml +0 -2813
  14. package/src/App.vue +0 -11
  15. package/src/assets/sound/notify.wav +0 -0
  16. package/src/demo/demo.vue +0 -42
  17. package/src/demo/dropdemo.vue +0 -42
  18. package/src/demo/extsets.vue +0 -208
  19. package/src/demo/formedit.vue +0 -157
  20. package/src/demo/hightquery.vue +0 -366
  21. package/src/demo/inlineedit.vue +0 -182
  22. package/src/demo/selfdrop.vue +0 -58
  23. package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +0 -2
  24. package/src/directive/el-dragDialog/drag.js +0 -124
  25. package/src/directive/el-dragDialog/index.js +0 -13
  26. package/src/errorLog.js +0 -16
  27. package/src/hdcom/BigGrid.js +0 -179
  28. package/src/hdcom/BillShow.vue +0 -111
  29. package/src/hdcom/BillUpload.vue +0 -311
  30. package/src/hdcom/BtnRight.vue +0 -101
  31. package/src/hdcom/ErrHint.vue +0 -42
  32. package/src/hdcom/ExtendColumn.vue +0 -115
  33. package/src/hdcom/ExtendCommon.js +0 -40
  34. package/src/hdcom/ExtendForm.vue +0 -141
  35. package/src/hdcom/FacePicUpload.vue +0 -80
  36. package/src/hdcom/FaceRecTest.vue +0 -114
  37. package/src/hdcom/GridChart.vue +0 -207
  38. package/src/hdcom/GridExField.vue +0 -375
  39. package/src/hdcom/GridShow.vue +0 -288
  40. package/src/hdcom/HdAside.vue +0 -225
  41. package/src/hdcom/HdBtn.vue +0 -125
  42. package/src/hdcom/HdButton.vue +0 -161
  43. package/src/hdcom/HdComFaceRec.vue +0 -106
  44. package/src/hdcom/HdComGrid.vue +0 -876
  45. package/src/hdcom/HdComQuery.vue +0 -362
  46. package/src/hdcom/HdComQueryDetail.vue +0 -205
  47. package/src/hdcom/HdComSortDetail.vue +0 -161
  48. package/src/hdcom/HdDatePicker.vue +0 -94
  49. package/src/hdcom/HdDialog.vue +0 -81
  50. package/src/hdcom/HdDrop.vue +0 -188
  51. package/src/hdcom/HdFileUpload.vue +0 -167
  52. package/src/hdcom/HdFilterBox.vue +0 -90
  53. package/src/hdcom/HdFooter.vue +0 -182
  54. package/src/hdcom/HdForm.vue +0 -351
  55. package/src/hdcom/HdFormBtn.vue +0 -131
  56. package/src/hdcom/HdFormItem.vue +0 -39
  57. package/src/hdcom/HdGctosGrid +0 -0
  58. package/src/hdcom/HdGrid.vue +0 -1022
  59. package/src/hdcom/HdGridEditBtn.vue +0 -58
  60. package/src/hdcom/HdGridExt.js +0 -250
  61. package/src/hdcom/HdGridSel.vue +0 -257
  62. package/src/hdcom/HdHeader.vue +0 -180
  63. package/src/hdcom/HdHotKey.vue +0 -84
  64. package/src/hdcom/HdInputHint.vue +0 -53
  65. package/src/hdcom/HdMain.vue +0 -41
  66. package/src/hdcom/HdMessage.vue +0 -201
  67. package/src/hdcom/HdNum.vue +0 -79
  68. package/src/hdcom/HdPopSel.vue +0 -80
  69. package/src/hdcom/HdRightMenu.vue +0 -63
  70. package/src/hdcom/HdSel/SelGridFieldcod.vue +0 -54
  71. package/src/hdcom/HdTableColumn.vue +0 -381
  72. package/src/hdcom/HdTempSave.vue +0 -162
  73. package/src/hdcom/HdTree.vue +0 -103
  74. package/src/hdcom/HdTreeTable/eval.js +0 -39
  75. package/src/hdcom/HdTreeTable/index.vue +0 -229
  76. package/src/hdcom/ImportExcel.vue +0 -178
  77. package/src/hdcom/index.js +0 -75
  78. package/src/idev.common.js +0 -79
  79. package/src/index.js +0 -11
  80. package/src/utils/HdQuery.js +0 -65
  81. package/src/utils/comutils.js +0 -120
  82. package/src/utils/gogocodeTransfer.js +0 -59
  83. package/src/utils/utils.js +0 -116
  84. package/src/vendor/Blob.js +0 -187
  85. package/src/vendor/Export2Excel.js +0 -231
  86. package/src/vendor/Export2Zip.js +0 -25
  87. package/src/views/layout/AppMain.vue +0 -34
  88. package/src/views/layout/HdLayout.vue +0 -90
  89. package/src/views/layout/header/ElasticSearch.vue +0 -262
  90. package/src/views/layout/header/HZRecorder.js +0 -259
  91. package/src/views/layout/header/HeaderSearch.vue +0 -218
  92. package/src/views/layout/header/Levelbar.vue +0 -55
  93. package/src/views/layout/header/MainHeader.vue +0 -315
  94. package/src/views/layout/header/Navbar.vue +0 -101
  95. package/src/views/layout/header/ScrollPane.vue +0 -103
  96. package/src/views/layout/header/TagsView.vue +0 -215
  97. package/src/views/layout/header/VocRec.vue +0 -105
  98. package/src/views/layout/header/changepswform.vue +0 -130
  99. package/src/views/layout/index.js +0 -10
  100. package/src/views/layout/menu/Hamburger.vue +0 -63
  101. package/src/views/layout/menu/HdMenu.vue +0 -204
  102. package/src/views/layout/menu/css/menu.css +0 -288
  103. package/src/views/layout/menu/index.vue +0 -27
  104. package/src/views/privilege/commsg/commsg.vue +0 -152
  105. package/src/views/privilege/commsg/commsgOrgn.vue +0 -51
  106. package/src/views/privilege/commsg/commsgRole.vue +0 -220
  107. package/src/views/privilege/commsg/commsgform.vue +0 -184
  108. package/src/views/privilege/commsg/commsgiframe.vue +0 -40
  109. package/src/views/privilege/commsg/commsgto.vue +0 -199
  110. package/src/views/privilege/commsg/commsgtoform.vue +0 -114
  111. package/src/views/privilege/commsg/commsgtrans.vue +0 -227
  112. package/src/views/privilege/exfield/comexcolumn.vue +0 -161
  113. package/src/views/privilege/exfield/comexcolumnform.vue +0 -128
  114. package/src/views/privilege/exfield/comexfield.vue +0 -29
  115. package/src/views/privilege/exfield/comexfieldform.vue +0 -112
  116. package/src/views/privilege/exfield/comexfieldsub.vue +0 -163
  117. package/src/views/privilege/index.js +0 -41
  118. package/src/views/privilege/menu/comMenu.vue +0 -49
  119. package/src/views/privilege/menu/menu.vue +0 -250
  120. package/src/views/privilege/menu/menuinfo.vue +0 -63
  121. package/src/views/privilege/menu/rolelist.vue +0 -92
  122. package/src/views/privilege/menu/userlist.vue +0 -92
  123. package/src/views/privilege/mobile/authmobileupdate.vue +0 -145
  124. package/src/views/privilege/mobile/authmobileupdateform.vue +0 -120
  125. package/src/views/privilege/orgDept/authOrgn.vue +0 -188
  126. package/src/views/privilege/orgDept/authorgnform.vue +0 -157
  127. package/src/views/privilege/orgDept/orgDept.vue +0 -38
  128. package/src/views/privilege/orgDept/orgTree.vue +0 -99
  129. package/src/views/privilege/orgDept/orgnselect.vue +0 -155
  130. package/src/views/privilege/personDept/authuser.vue +0 -229
  131. package/src/views/privilege/personDept/authuserform.vue +0 -206
  132. package/src/views/privilege/personDept/facerec.vue +0 -162
  133. package/src/views/privilege/personDept/orgncascader.vue +0 -144
  134. package/src/views/privilege/personDept/personDept.vue +0 -33
  135. package/src/views/privilege/quartz/comquartzjob.vue +0 -150
  136. package/src/views/privilege/quartz/comquartzjobform.vue +0 -115
  137. package/src/views/privilege/quartz/comquartzlog.vue +0 -143
  138. package/src/views/privilege/role/btnRole.vue +0 -173
  139. package/src/views/privilege/role/menuRole.vue +0 -84
  140. package/src/views/privilege/role/orgnRole.vue +0 -78
  141. package/src/views/privilege/role/role.vue +0 -84
  142. package/src/views/privilege/role/rolelist.vue +0 -136
  143. package/src/views/privilege/role/roleselect.vue +0 -74
  144. package/src/views/privilege/search/comsearch.vue +0 -196
  145. package/src/views/privilege/search/menu.vue +0 -68
  146. package/src/views/privilege/syscode/syscode.vue +0 -191
  147. package/src/views/privilege/syscode/sysfield.vue +0 -119
  148. package/src/views/privilege/syscode/sysfieldframe.vue +0 -30
  149. package/src/views/privilege/syslog/menulog.vue +0 -68
  150. package/src/views/privilege/syslog/syslog.vue +0 -182
  151. package/src/views/privilege/syslog/syslogconfig.vue +0 -128
  152. package/src/views/privilege/syslog/syslogform.vue +0 -85
  153. package/src/views/privilege/syslog/syslogframe.vue +0 -26
  154. package/src/views/privilege/userRole/userRole.vue +0 -220
  155. package/vite.config.js +0 -103
@@ -1,1022 +0,0 @@
1
- <template>
2
- <div :style="{ width: '100%', height: height }" class="hdgrid" ref="grid">
3
- <div v-show="queryShow">
4
- <slot name="query"></slot>
5
- </div>
6
- <div style="height: 0px" v-if="!noSets">
7
- <el-dropdown
8
- @command="extSets"
9
- style="
10
- float: right;
11
- height: 0;
12
- width: 20px;
13
- position: relative;
14
- right: 0px;
15
- text-align: center;
16
- z-index: 100;
17
- cursor: pointer;
18
- font-size: 25px;
19
- "
20
- >
21
- <span class="el-dropdown-link">
22
- <i
23
- :style="{
24
- 'font-size': '13px',
25
- color: isGridCustom ? 'red !important' : '',
26
- }"
27
- class="fa fa-cogs"
28
- ></i>
29
- </span>
30
- <el-dropdown-menu slot="dropdown">
31
- <el-dropdown-item command="gridSets">{{
32
- $t('自定义展示')
33
- }}</el-dropdown-item>
34
- <el-dropdown-item command="pageExcel"
35
- >{{ $t('导出当页excel') }}
36
- </el-dropdown-item>
37
- <el-dropdown-item :disabled="excelAllExporting" command="allExcel">
38
- {{ excelAllExporting ? $t('正在导出') : $t('导出全部excel') }}
39
- </el-dropdown-item>
40
- <el-dropdown-item :disabled="pdfAllExporting" command="allPdf">
41
- {{ pdfAllExporting ? $t('正在生成') : $t('pdf打印') }}
42
- </el-dropdown-item>
43
- <el-dropdown-item command="queryToggle">{{
44
- queryShow ? $t('隐藏查询区') : $t('显示查询区')
45
- }}</el-dropdown-item>
46
- <el-dropdown-item command="exFieldSets" v-if="exField.open">{{
47
- $t('添加扩展字段')
48
- }}</el-dropdown-item>
49
- <slot name="extSets"></slot>
50
- </el-dropdown-menu>
51
- </el-dropdown>
52
- <!--<el-button @click="gridSets"-->
53
- <!--&gt;表格功能-->
54
- <!--</el-button>-->
55
- </div>
56
-
57
- <el-table
58
- :data="hdResultComRows"
59
- :default-sort="defaultSort"
60
- :row-class-name="rowClassName"
61
- :stripe="$attrs.stripe == undefined ? true : $attrs.stripe"
62
- @row-click="myrowClick"
63
- @row-dblclick="myrowDblClick"
64
- @row-contextmenu="myrowContextmenu"
65
- @selection-change="myselectionChange"
66
- @sort-change="dodefaultSort"
67
- border
68
- element-loading-text="加载中..."
69
- height="100%"
70
- highlight-current-row
71
- ref="ingrid"
72
- v-bind="$attrs"
73
- v-if="gridCanReload"
74
- v-on="$listeners"
75
- @filter-change="filterChange"
76
- >
77
- <template v-if="!visualScroll">
78
- <ExTableColumn
79
- :showOverflowTooltip="false"
80
- align="center"
81
- class-name="backFF"
82
- noEdit
83
- noSlot
84
- type="selection"
85
- v-if="!ckHide"
86
- width="30"
87
- @click.native="selectClick"
88
- ></ExTableColumn>
89
- <ex-table-column
90
- :showOverflowTooltip="false"
91
- align="center"
92
- noEdit
93
- noSlot
94
- type="index"
95
- v-if="!indexHide"
96
- width="40"
97
- >
98
- <template slot="header" slot-scope="scope">
99
- <span>#</span>
100
- </template>
101
- </ex-table-column>
102
- </template>
103
- <template v-else>
104
- <ex-table-column
105
- :showOverflowTooltip="true"
106
- align="center"
107
- class-name="checkBox"
108
- noEdit
109
- noSlot
110
- v-if="!ckHide"
111
- width="30"
112
- >
113
- <template slot="header" slot-scope="scope">
114
- <el-checkbox
115
- :indeterminate="isSubChecked"
116
- :model-value="isAllChecked"
117
- @change="checkAllChange"
118
- />
119
- </template>
120
- <template slot-scope="scope">
121
- <el-checkbox v-model="scope.row._isCK" />
122
- </template>
123
- </ex-table-column>
124
- <ex-table-column
125
- :index="getIndex"
126
- :showOverflowTooltip="true"
127
- align="center"
128
- noEdit
129
- noSlot
130
- type="index"
131
- v-if="!indexHide"
132
- width="40"
133
- >
134
- <template slot="header" slot-scope="scope">
135
- <span>#</span>
136
- </template>
137
- <template slot-scope="scope">
138
- {{ scope.$index + startIndex + 1 }}
139
- </template>
140
- </ex-table-column>
141
- </template>
142
-
143
- <slot></slot>
144
-
145
- <template v-if="exField.gridCode">
146
- <template v-for="exFieldRow in exFieldRows">
147
- <ExtendColumn :exFieldRow="exFieldRow"></ExtendColumn>
148
- </template>
149
- </template>
150
-
151
- <template v-if="!recHide">
152
- <el-table-column
153
- align="left"
154
- header-align="center"
155
- label="创建人"
156
- noEdit
157
- prop="recNam"
158
- sortable
159
- width="auto"
160
- >
161
- </el-table-column>
162
- <el-table-column
163
- :inputProp="$date"
164
- align="center"
165
- input="el-date-picker"
166
- label="创建时间"
167
- noEdit
168
- prop="recTim"
169
- sortable
170
- width="135px"
171
- >
172
- </el-table-column>
173
- <el-table-column
174
- align="left"
175
- header-align="center"
176
- label="更新人"
177
- noEdit
178
- prop="updNam"
179
- sortable
180
- width="auto"
181
- >
182
- </el-table-column>
183
- <el-table-column
184
- :inputProp="$date"
185
- align="center"
186
- input="el-date-picker"
187
- label="更新时间"
188
- noEdit
189
- prop="updTim"
190
- sortable
191
- width="135px"
192
- >
193
- </el-table-column>
194
- </template>
195
- </el-table>
196
- <!--虚拟滚动条支持1w条 -->
197
- <div
198
- class="pagination-container"
199
- ref="pagecon"
200
- style="height: 26px; overflow: hidden"
201
- v-if="!pageHide || showBtnTool"
202
- >
203
- <div style="float: left" v-if="showBtnTool">
204
- <slot name="btnTool">
205
- <hd-btn
206
- icon="el-icon-plus"
207
- hint="增加"
208
- @click="doAdd"
209
- vid="doAdd"
210
- class="hdBtnTool"
211
- v-if="!addHide"
212
- keyType="add"
213
- ></hd-btn>
214
- <hd-btn
215
- icon="el-icon-minus"
216
- hint="删除"
217
- @click="doRemove"
218
- class="hdBtnTool"
219
- v-if="!delHide"
220
- keyType="del"
221
- >
222
- </hd-btn>
223
- <hd-btn
224
- icon="el-icon-check"
225
- hint="保存"
226
- @click="doSave"
227
- class="hdBtnTool"
228
- v-if="!saveHide"
229
- keyType="save"
230
- >
231
- </hd-btn>
232
- </slot>
233
- <!-- <hd-btn icon="el-icon-copy-document" hint="复制" @click="doCopy" class="hdBtnTool" style="color:#409EFF;"-->
234
- <!-- v-if="!copyHide" keyType="copy"></hd-btn>-->
235
- </div>
236
- <el-pagination
237
- :current-page.sync="hdQuery.page"
238
- :page-size="hdQuery.rows"
239
- :page-sizes="pageSizeArray"
240
- :total="hdResult.total"
241
- @current-change="hdQuery.doCurPageChange"
242
- @size-change="rowSizeChg"
243
- layout=" total, slot, prev, pager, next,sizes"
244
- small
245
- style="float: right"
246
- v-if="!pageHide"
247
- >
248
- </el-pagination>
249
- </div>
250
- <GridShow @save-ok="gridShow()" ref="gridShow" v-if="gridShowIs"></GridShow>
251
- <GridExField
252
- :columnList="exField.columnList"
253
- :gridCode="exField.gridCode"
254
- :table="exField.table"
255
- @save-ok="exFieldShow()"
256
- ref="exFieldShow"
257
- v-if="exField.open && exFieldShowIs"
258
- ></GridExField>
259
- <!-- <GridExFieldBak @save-ok="exFieldShow()" ref="exFieldShow" v-if="exField.open && exFieldShowIs" :table="exField.table"
260
- :columnList="exField.columnList" :gridCode="exField.gridCode"></GridExFieldBak>
261
- -->
262
- <!-- <PdfShow :gening="pdfAllExporting" @close="pdfShowIs=false" ref="pdfshow" v-if="pdfShowIs"></PdfShow> -->
263
- <hd-right-menu
264
- ref="rightMenu"
265
- @do-add="doAdd"
266
- @do-update="doUpdateOne"
267
- @do-remove="doRemoveOne"
268
- @do-copy="doCopyOne"
269
- v-if="rightMenuOpen"
270
- v-show="rightMenuVisable"
271
- >
272
- <template slot="rightMenu">
273
- <slot name="rightMenu"></slot>
274
- </template>
275
- <template slot="rightMenuExt">
276
- <slot name="rightMenuExt"></slot>
277
- </template>
278
- </hd-right-menu>
279
- </div>
280
- </template>
281
-
282
- <script>
283
- import GridShow from './GridShow'
284
- import GridExField from './GridExField'
285
- import HdGridExt from './HdGridExt.js'
286
- // import PdfShow from './PdfShow'
287
- import BigGrid from './BigGrid.js'
288
- import ExtendColumn from './ExtendColumn'
289
- import HdBtn from './HdBtn'
290
- import HdRightMenu from './HdRightMenu'
291
-
292
- /**
293
- * 通常不需要直接调用,HdComGrid中已经封装
294
- * @module HdGrid
295
- */
296
- export default {
297
- name: 'HdGrid',
298
- components: { HdRightMenu, GridShow, GridExField, ExtendColumn, HdBtn }, // ElTableColumn已被改写,但是select ck不好使,需要有原来的
299
- mixins: [HdGridExt, BigGrid],
300
- data() {
301
- return {
302
- disCol: [], // 配置的列,包括展示和未展示
303
- oriCol: [], // 原始列,由column组件赋值
304
- chiCol: [], // 存在嵌套列时
305
- colThis: [], // column this对象
306
- menuId: '',
307
- gridId: '', //唯一标识
308
- queryShow: true,
309
- excelAllExporting: false, // true为正在导出的loading
310
- pdfAllExporting: false,
311
- gridShowIs: false,
312
- exFieldShowIs: false,
313
- pdfShowIs: false, //pdf组件是否显示,因为不常用直接v-if
314
- gridCanReload: true, // 组件失效重新生成用的,相当于局部刷新
315
- isGridCustom: false,
316
- exFieldRows: [],
317
- rightMenuVisable: false,
318
- rightMenuRow: [],
319
- lastSelectRow: null,
320
- }
321
- },
322
- inheritAttrs: false,
323
- /**
324
- * @prop {boolean} noSets: 是否显示列表右上角的按钮(自定义列和导出excel)默认显示
325
- * @prop {Object} defaultSort 默认{prop: 'updTim', order: 'descending'}
326
- * @prop {boolean} pageHide: 是否隐藏分页,默认显示
327
- * @prop {boolean} ckHide: Boolean,是否显示checkbox默认显示
328
- * @prop {boolean} indexHide: Boolean,是否显示index 默认显示
329
- * @prop {boolean} recHide: Boolean,是否显示创建人 默认显示
330
- * @prop {boolean} rowClassName: Function,
331
- * @prop {Array} noExcelExport:,导出excel时不导出的字段
332
- * @prop {boolean} excelPropHeader: 导出excel是否包含英文属性头及主键等(适合导入excel当模板使用)
333
- * @prop {boolean} visualScroll: 开启虚拟滚动条,可大幅度提升页面容量(上万条列表),但是依然推荐写好分页
334
- * @prop {boolean} pageSizes: 页码默认visualScroll?[20,50,100,200,500,1000]:[20,50,100,200]
335
- * @prop {Object} exField 是否有扩展字段 open开启,table扩展字段所在表,field扩展字段使用字段
336
- * @prop {Function} excelFormatter 自定义导出excel
337
- * @prop {Boolean} rightMenuOpen 是否打开右击菜单,默认关闭
338
- */
339
- props: {
340
- // doallPage是事件,导出全部excel
341
- hdResult: {
342
- rows: [],
343
- total: 0,
344
- }, // 可能是列表数据,或者导出的excel数据
345
- hdAllResult: Object, // 可能是列表数据,或者导出的excel数据
346
- hdQuery: {
347
- type: Object,
348
- default: function () {
349
- // updTimFirst是因为会触发HdQuery的排序及查询,默认不让查询
350
- return {}
351
- },
352
- },
353
- height: {
354
- type: String,
355
- default: function () {
356
- // 默认空对象,防止出错
357
- return '100%'
358
- },
359
- },
360
- noSets: {
361
- // 是否显示自定义列和导出excel,默认显示
362
- type: Boolean,
363
- default: function () {
364
- return false
365
- },
366
- },
367
- defaultSort: {
368
- type: Object,
369
- default: function () {
370
- // updTimFirst是因为会触发HdQuery的排序及查询,默认不让查询
371
- return { prop: 'updTim', order: 'descending' }
372
- },
373
- },
374
- pageHide: Boolean,
375
- ckHide: Boolean, // 是否显示checkbox默认显示
376
- indexHide: Boolean, // 是否显示index 默认显示
377
- recHide: Boolean, // 是否显示创建人 默认显示
378
- rowClassName: Function,
379
- noExcelExport: [Array], // 导出excel时不处理的字段
380
- excelPropHeader: Boolean, // 导出excel是否包含属性头,默认false,导入excel如果需要模板,可以开启,并且会导出所有属性
381
- visualScroll: Boolean, //启动虚拟滚动条,默认false
382
- pageSizes: [Array],
383
- exField: {
384
- type: Object,
385
- default: function () {
386
- return {
387
- open: false,
388
- table: null,
389
- columnList: null,
390
- }
391
- },
392
- },
393
- excelFormatter: Function,
394
- addHide: Boolean, //隐藏grid列表底部的按钮工具栏里的增加按钮
395
- delHide: Boolean, //隐藏grid列表底部的按钮工具栏里的删除按钮
396
- saveHide: Boolean, //隐藏grid列表底部的按钮工具栏里的保存按钮
397
- copyHide: Boolean, //隐藏grid列表底部的按钮工具栏里的复制按钮
398
- hdBtnTool: {
399
- type: Boolean,
400
- default: true,
401
- }, //显示、隐藏grid列表底部的整个按钮工具栏
402
- rightMenuOpen: {
403
- type: Boolean,
404
- default: false,
405
- },
406
- },
407
- created() {
408
- //自定义列表展示:vue界面的组件名+parent的组件(调用该组件的组件名+上级组件(如el-main)
409
- //当vue界面是菜单入口时_componentTag是undefined,此时name替代(name自动注入)
410
- if (this.$parent.$vnode.context.$options._componentTag) {
411
- this.gridId =
412
- this.$parent.$vnode.context.$options._componentTag +
413
- '_' +
414
- this.$parent.$parent.$options._componentTag
415
- } else {
416
- this.gridId =
417
- this.$parent.$vnode.context.$options.name +
418
- '_' +
419
- this.$parent.$parent.$options._componentTag
420
- }
421
- },
422
- mounted() {
423
- this.hdQuery.doSort(this.defaultSort, true)
424
- //每页显示多少条
425
- let selPageSize = localStorage.getItem('page_' + this.gridId)
426
- if (selPageSize) {
427
- this.hdQuery.rows = parseInt(selPageSize)
428
- } else {
429
- // this.rowSizeChg(100)
430
- }
431
- if (this.pageHide) {
432
- // 无分页时
433
- this.hdQuery.page = null
434
- this.hdQuery.rows = 2000
435
- console.log('隐藏分页展示数据,最多展现2000条')
436
- }
437
- if (this.visualScroll) {
438
- this.initVisual()
439
- }
440
- // this.disCol.push(1)
441
- if (this.exField.gridCode) {
442
- this.initExFieldRows()
443
- }
444
- this.$nextTick(function () {
445
- // 等渲染完成后执行
446
- if (!this.noSets) {
447
- this.gridShow(true)
448
- }
449
- })
450
- },
451
- methods: {
452
- doAdd() {
453
- this.$emit('sel-ok', 'doAdd')
454
- },
455
- doRemove() {
456
- this.$emit('sel-ok', 'doRemove')
457
- },
458
- doSave() {
459
- this.$emit('sel-ok', 'doSave')
460
- },
461
- doCopy() {
462
- this.$emit('sel-ok', 'doCopy')
463
- },
464
- doUpdateOne() {
465
- this.$emit('sel-ok', 'doUpdateOne', this.rightMenuRow)
466
- },
467
- doRemoveOne() {
468
- this.$emit('sel-ok', 'doRemoveOne', this.rightMenuRow)
469
- },
470
- doCopyOne() {
471
- this.$emit('sel-ok', 'doCopyOne', this.rightMenuRow)
472
- },
473
- gridShow(notReload) {
474
- if (!notReload) {
475
- //首次不刷新组件.自定义组件,避免再次查询(分页事件)
476
- this.gridCanReload = false
477
- // this.isFirstSort = true
478
- }
479
- this.$nextTick(function () {
480
- this.gridCanReload = true
481
- this.$nextTick(function () {
482
- if (!notReload && this.visualScroll) {
483
- this.initVisual()
484
- this.initTableHeight()
485
- }
486
- this.oriCol = this.$refs.ingrid.store.states._columns // 此处是未进行展示控制的原始数据
487
- this.menuId = this.$route.name
488
- const url =
489
- '/webresources/login/com/ComGridShow/find?menuId=' +
490
- this.menuId +
491
- '&gridId=' +
492
- this.gridId
493
- this.$http.post(url).then((response) => {
494
- this.isGridCustom = response.data.length != 0
495
- this.disCol = this.gridCompute(this.oriCol, response.data)
496
-
497
- this.$refs.ingrid.store.states._columns = this.disCol.filter(
498
- (v) => v.showFlg != '0'
499
- )
500
-
501
- console.log(
502
- '显示序列条数',
503
- this.$refs.ingrid.store.states._columns.length
504
- )
505
- // console.log(JSON.stringify(this.$refs.ingrid.store.states._columns));
506
- this.$refs.ingrid.store.updateColumns()
507
- this.$nextTick(function () {
508
- this.$refs.ingrid.doLayout()
509
- })
510
- })
511
- // for (let i = 0; i < this.colThis.length; i++) {
512
- // this.colThis[i].gridShow(true)
513
- // }
514
- })
515
- })
516
- },
517
- exFieldShow() {
518
- window.location.reload()
519
- // console.log(this.$store.state.app.selectedView)
520
- // this.$nextTick(()=>{
521
- // this.$store.dispatch('refreshView', this.$store.state.app.selectedView);
522
- // })
523
- },
524
- gridSets() {
525
- this.gridShowIs = true
526
- this.$nextTick(() => {
527
- this.$refs.gridShow.show(this.disCol, this.menuId, this.gridId)
528
- })
529
- },
530
- exFieldSets() {
531
- this.exFieldShowIs = true
532
- this.$nextTick(() => {
533
- this.$refs.exFieldShow.show()
534
- })
535
- },
536
- gridCompute(oriCol, setCol) {
537
- // 全部设置展示
538
- let result = []
539
- const lastResult = []
540
- for (let i = 0; i < oriCol.length; i++) {
541
- const oneOri = oriCol[i]
542
- oneOri.showFlg = '1' // 默认展示
543
- oneOri._ori_label = oneOri.label
544
- oneOri.label = oneOri._ori_label
545
- let isFind = false
546
- if (oneOri && !oneOri.property) {
547
- // 没有prop的默认显示,checkbox和index
548
- if (oneOri.fixed == 'right') {
549
- // 隐藏行按钮,单独,否则无法控制
550
- result.push(oriCol[i])
551
- } else {
552
- result.push(oneOri)
553
- }
554
- continue
555
- }
556
- for (let j = 0; j < setCol.length; j++) {
557
- // 后来新增的
558
- if (oneOri.property == setCol[j].property) {
559
- isFind = true
560
- break
561
- }
562
- }
563
- if (!isFind) {
564
- lastResult.push(oneOri)
565
- }
566
- }
567
- for (let i = 0; i < setCol.length; i++) {
568
- const oneSet = setCol[i]
569
- if (
570
- result.some((v) => {
571
- return v.property == oneSet.property
572
- })
573
- ) {
574
- console.log('已经重复' + oneSet.property)
575
- continue
576
- }
577
- for (let j = 0; j < oriCol.length; j++) {
578
- const oneOri = oriCol[j]
579
- if (oneOri.className == 'checkBox') {
580
- this.$set(oneOri, 'fixed', 'left')
581
- this.$set(oneOri, 'className', 'checkBox backFF')
582
- }
583
- if (oneOri.type == 'selection' || oneOri.type == 'index') {
584
- //ck和index都要居左
585
- this.$set(oneOri, 'fixed', 'left')
586
- this.$set(oneOri, 'className', 'backFF')
587
- }
588
- if (oneOri.property && oneSet.property == oneOri.property) {
589
- this.$set(oneOri, 'showFlg', oneSet.showFlg)
590
- this.$set(oneOri, 'freezeFlg', oneSet.freezeFlg)
591
- if (oneSet.freezeFlg == '1') {
592
- this.$set(oneOri, 'fixed', 'left')
593
- this.$set(oneOri, 'className', 'backFF' + oneOri.className)
594
- }
595
- oneOri.width = oneSet.width
596
- result.push(oneOri)
597
- break
598
- }
599
- }
600
- }
601
- result = [...result, ...lastResult]
602
- return result
603
- },
604
- extSets(command) {
605
- if (command == 'gridSets') {
606
- this.gridSets()
607
- }
608
- if (command == 'exFieldSets') {
609
- this.exFieldSets()
610
- } else if (command == 'pageExcel') {
611
- this.doPageExcel()
612
- } else if (command == 'allExcel') {
613
- this.doAllExcel()
614
- } else if (command == 'allPdf') {
615
- this.doAllPdf()
616
- } else if (command == 'queryToggle') {
617
- this.queryShow = !this.queryShow
618
- }
619
- this.$emit('extSets', command)
620
- },
621
- getHdComGrid() {
622
- let par = this.$parent
623
- while (par) {
624
- if (par.$options.name == 'HdComGrid') {
625
- return par
626
- }
627
- par = par.$parent
628
- }
629
- return null
630
- },
631
- myselectionChange(select) {
632
- if (this.hdQuery) {
633
- //
634
- this.hdQuery.selObj = select
635
- } //selection-change事件会触发2次,加个第3参数区分是el-table的还是hdgrid的
636
- this.$emit('selection-change', select, true)
637
- },
638
- // selectRow(select, row) {
639
- // if (this.$listeners['select']) {
640
- // return
641
- // }
642
- // console.log(select)
643
- // if (this.lastSelectRow) {
644
- // // this.selectPart(this.lastSelectRow, row)
645
- // } else {
646
- // this.lastSelectRow = row;
647
- // }
648
- // //
649
- // },
650
- // selectClick(e) {
651
- // console.log(e)
652
- // },
653
- myrowClick(row, column, event) {
654
- if (event.shiftKey) {
655
- let index1 = this.hdResult.rows.indexOf(this.hdQuery.selRow)
656
- let index2 = this.hdResult.rows.indexOf(row)
657
-
658
- this.selectRowCube(index1, index2, false)
659
- } else {
660
- this.hdQuery.selRow = row
661
- }
662
- console.log('row-click', row, event, column)
663
- // this.$emit('row-click', row, event, column);
664
- },
665
-
666
- myrowDblClick(row, event, column) {
667
- if (this.$listeners['row-dblclick']) {
668
- return
669
- }
670
- if (this.$route.path.indexOf('privilege') == 1) {
671
- return
672
- }
673
- this.$emit('sel-ok', 'doUpdateOne', row)
674
- if (this.hdQuery) {
675
- this.hdQuery.selRow = row
676
- }
677
- },
678
- myrowContextmenu(row, column, event) {
679
- // const menuMinWidth = 105
680
- // const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
681
- // const offsetWidth = this.$el.offsetWidth // container width
682
- // const maxLeft = offsetWidth - menuMinWidth // left boundary
683
- // const left = e.clientX - offsetLeft + 15 // 15: margin right
684
- // if (left > maxLeft) {
685
- // this.left = maxLeft
686
- // } else {
687
- // this.left = left
688
- // }
689
- // this.top = e.clientY - 40
690
- // this.visible = true
691
- // this.$store.state.app.selectedView = tag
692
- // console.log(this.$store.state.app.selectedView)
693
-
694
- if (this.hdQuery) {
695
- this.rightMenuRow = row
696
- }
697
- this.rightMenuVisable = false // 先把模态框关死,目的是 第二次或者第n次右键鼠标的时候 它默认的是true
698
- event.preventDefault() //关闭浏览器右键默认事件
699
-
700
- if (this.rightMenuOpen) {
701
- let menu = this.$refs.rightMenu.$el
702
-
703
- // if (event.clientX > 900) {
704
- // menu.style.left = event.clientX - 265 + 'px'
705
- // } else {
706
- // menu.style.left = event.clientX - 175 + 'px'
707
- // }
708
- document.addEventListener('click', this.foo) // 给整个document新增监听鼠标事件,点击任何位置执行foo方法
709
- // if (event.clientY > 500) {
710
- // menu.style.top = event.clientY - 185 + 'px'
711
- // } else {
712
- // menu.style.top = event.clientY - 105 + 'px'
713
- // }
714
- menu.style.left = event.clientX + 'px'
715
- menu.style.top = event.clientY + 'px'
716
- // console.log(menu,event)
717
- this.rightMenuVisable = true // 显示模态窗口,跳出自定义菜单栏
718
- }
719
- },
720
-
721
- foo() {
722
- // 取消鼠标监听事件 菜单栏
723
- this.rightMenuVisable = false
724
- document.removeEventListener('click', this.foo) // 关掉监听,
725
- },
726
- dodefaultSort(val, v1, v2) {
727
- let sortProp = val.column.sortable
728
- if (!sortProp) {
729
- return
730
- }
731
- // if (typeof (sortProp) != 'boolean' && sortProp != '') {
732
- // console.log('compare hdResult')
733
- // this.hdResult.rows.sort((a, b) => {
734
- // if (val.column.order == 'ascending') {
735
- // return this.localeCompare(a[sortProp], b[sortProp])
736
- // } else if (val.column.order == 'descending') {
737
- // return this.localeCompare(b[sortProp], a[sortProp])
738
- // }
739
- // })
740
- // return;
741
- // }
742
- let hasAddData = false
743
- for (let i = 0; i < this.hdResultComRows.length; i++) {
744
- if (this.hdResultComRows[i].isEdit) {
745
- hasAddData = true
746
- break
747
- }
748
- }
749
- // if (!this.defaultSort || !this.defaultSort.prop) { // 没有默认排序时,不会立即执行该方法
750
- // this.isFirstSort = false
751
- // }
752
- // 列表会默认执行此方法,所以需要防止排序调用doquery
753
- if (hasAddData) {
754
- this.$confirm(
755
- this.$t('存在未保存数据,是否继续?'),
756
- this.$t('提示'),
757
- {}
758
- ).then(() => {
759
- this.hdQuery.doSort(val, false)
760
- })
761
- } else {
762
- this.hdQuery.doSort(val, false)
763
- }
764
- },
765
- localeCompare(a, b) {
766
- if (!a) {
767
- return 1
768
- }
769
- if (!b) {
770
- return -1
771
- }
772
- return a.localeCompare(b)
773
- },
774
- doPageExcel() {
775
- this.excelExport(this.hdResult.rows)
776
- },
777
- doAllExcel() {
778
- let res = null
779
- this.$emit('allExcel', function (call) {
780
- res = call
781
- })
782
- this.excelAllExporting = true
783
- res.then((response) => {
784
- this.excelExport(response.data.rows)
785
- this.excelAllExporting = false
786
- // this.downloadLoading = false
787
- })
788
- },
789
- doAllPdf() {
790
- let res = null
791
- this.pdfShowIs = true
792
- this.$emit('allExcel', function (call) {
793
- //pdf也是这名字allExcel
794
- res = call
795
- })
796
- this.pdfAllExporting = true
797
- res.then((response) => {
798
- this.pdfExport(response.data.rows)
799
- this.pdfAllExporting = false
800
- // this.downloadLoading = false
801
- })
802
- },
803
- getInputFormat(prop) {
804
- for (let i = 0; i < this.colThis.length; i++) {
805
- const one = this.colThis[i]
806
- if (one.$attrs.prop == prop) {
807
- return one.getValueByPath //支持多级prop如果有inutFormat会使用inputFormt
808
- }
809
- }
810
- },
811
- rowSizeChg(val) {
812
- localStorage.setItem('page_' + this.gridId, val)
813
- this.hdQuery.doSizeChg(val)
814
- },
815
- getCkRows() {
816
- if (this.visualScroll) {
817
- return this.hdResult.rows.filter((v) => v._isCK == true)
818
- } else {
819
- return this.hdQuery.selObj
820
- }
821
- },
822
- initExFieldRows() {
823
- let hdFielddQuery = new HdQuery(this)
824
- hdFielddQuery.query.gridCode = this.exField.gridCode
825
- hdFielddQuery.sort = 'sortNo'
826
- hdFielddQuery.order = 'asc'
827
- this.$http
828
- .post(`/webresources/login/tech/ComExField/detail/find`, hdFielddQuery)
829
- .then((response) => {
830
- this.exFieldRows = response.data.rows
831
- this.exFieldRows.forEach((row) => {
832
- row.fieldName = row.columnName
833
- .toLowerCase()
834
- .replace(/\_+[a-zA-Z]/g, (str, index) =>
835
- index ? str.substr(-1).toUpperCase() : str
836
- )
837
- })
838
- this.$nextTick(function () {
839
- this.$refs.ingrid.doLayout()
840
- })
841
- })
842
- },
843
- filterChange(filters) {
844
- // this.hdResult.filterValue.
845
- this.hdResult.filters = Object.assign(
846
- this.hdResult.filters || {},
847
- filters
848
- )
849
-
850
- this.filterHdResult()
851
- },
852
- filterHdResult() {
853
- let keys = Object.keys(this.hdResult.filters || {})
854
- // console.log(this.$refs.ingrid.store.states._columns, this.hdResult.filters)
855
- this.hdResult.rows = this.hdResult._rows.filter((row) => {
856
- return !keys.some((value) => {
857
- let prop = (
858
- this.$refs.ingrid.store.states._columns.find((v) => {
859
- return v.id == value
860
- }) || ''
861
- ).property
862
- // console.log(value, prop, row[prop], this.hdResult.filters[value])
863
- return (
864
- this.hdResult.filters[value].length > 0 &&
865
- this.hdResult.filters[value].indexOf(row[prop]) == -1
866
- )
867
- })
868
- })
869
- },
870
-
871
- selectPart(e, isUnSelect) {
872
- let index1 = this.hdResult.rows.indexOf(this.hdQuery.selRow)
873
- let index2 = this.hdResult.rows.indexOf(this.rightMenuRow)
874
-
875
- this.selectRowCube(index1, index2, isUnSelect)
876
- },
877
- selectRowCube(index1, index2, isUnSelect) {
878
- if (index1 > index2) {
879
- let tmpIndex = index1
880
- index1 = index2
881
- index2 = tmpIndex
882
- }
883
- this.hdResult.rows.forEach((v, i) => {
884
- if (i >= index1 && i <= index2) {
885
- this.$refs.ingrid.toggleRowSelection(v, !isUnSelect)
886
- }
887
- })
888
- },
889
-
890
- unSelectPart(e) {
891
- this.selectPart(e, true)
892
- },
893
- },
894
- computed: {
895
- hdResultComRows() {
896
- if (this.visualScroll) {
897
- return this.gridDataRows
898
- } else {
899
- return this.hdResult.rows
900
- }
901
- },
902
- pageSizeArray() {
903
- if (this.pageSizes == null) {
904
- return this.visualScroll
905
- ? [20, 50, 100, 200, 500, 1000, 2000]
906
- : [20, 50, 100, 200, 500]
907
- } else {
908
- return this.pageSizes
909
- }
910
- },
911
- showBtnTool() {
912
- return this.hdBtnTool && this.$route.path.indexOf('privilege') != 1
913
- },
914
- },
915
-
916
- watch: {},
917
- }
918
- </script>
919
-
920
- <style lang="scss" rel="stylesheet/scss" scoped>
921
- .hdgrid {
922
- display: flex;
923
- flex-direction: column;
924
-
925
- :deep(.el-table) {
926
- //deep内的不会加随机数
927
- height: 100%;
928
- width: 100%;
929
- flex: 1;
930
-
931
- th.gutter {
932
- //浏览器缩放,表格错行解决
933
- display: table-cell !important;
934
- }
935
-
936
- .el-table__header-wrapper th {
937
- //列表标题
938
- background-color: #f6f6f6;
939
- }
940
-
941
- .el-table__fixed-header-wrapper th {
942
- //固定的列表标题
943
- background-color: #f6f6f6;
944
- }
945
-
946
- td,
947
- th {
948
- //列表标题及内容
949
- padding: 1px 0;
950
- }
951
-
952
- .cell,
953
- .el-table th div,
954
- .el-table--border th:first-child .cell,
955
- .el-table--border td:first-child .cell {
956
- //列表的margin
957
- padding-left: 4px !important;
958
- padding-right: 0px !important;
959
- padding-top: 1.5px !important;
960
- padding-bottom: 1.5px !important;
961
- }
962
-
963
- .el-table__empty-block {
964
- position: static;
965
- text-align: center;
966
- width: 100%;
967
- height: 80%;
968
- }
969
-
970
- .el-table__body {
971
- //列表下面加了空白
972
- margin-bottom: 10px;
973
- }
974
-
975
- .el-table__body-wrapper {
976
- height: 100%;
977
- overflow: auto;
978
- }
979
-
980
- .el-input__inner {
981
- height: 27px;
982
- margin-bottom: 0px;
983
- line-height: 27px;
984
- }
985
-
986
- .el-input,
987
- .el-form-item__content,
988
- .el-form-item__label,
989
- .el-input__icon {
990
- line-height: 30px;
991
- }
992
-
993
- .el-input__inner {
994
- padding: 5px;
995
- }
996
-
997
- .el-input--prefix .el-input__inner {
998
- //日期的有logo不一样
999
- padding-left: 30px;
1000
- }
1001
-
1002
- .cell {
1003
- min-width: 20px;
1004
- }
1005
-
1006
- .checkBox .cell {
1007
- overflow: inherit;
1008
-
1009
- .el-checkbox,
1010
- .el-checkbox__input {
1011
- position: inherit;
1012
- }
1013
- }
1014
- }
1015
- }
1016
-
1017
- .hdBtnTool {
1018
- font-weight: bold;
1019
- vertical-align: middle;
1020
- margin-left: 20px;
1021
- }
1022
- </style>