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.
- package/dist/static/css/index-DRHIlcVU.css +1 -0
- package/dist/static/js/index-DbUA6jg0.js +184 -0
- package/dist/static/js/index-Dl4O91nB.js +73768 -0
- package/package.json +16 -16
- package/.env.development +0 -5
- package/.env.production +0 -5
- package/.eslintrc.js +0 -151
- package/dist/assets/index.431f21ca.css +0 -1
- package/dist/hd-idevvue3.mjs +0 -45878
- package/dist/hd-idevvue3.umd.js +0 -153
- package/index.html +0 -18
- package/npminstall-debug.log +0 -200
- package/pnpm-lock.yaml +0 -2813
- package/src/App.vue +0 -11
- package/src/assets/sound/notify.wav +0 -0
- package/src/demo/demo.vue +0 -42
- package/src/demo/dropdemo.vue +0 -42
- package/src/demo/extsets.vue +0 -208
- package/src/demo/formedit.vue +0 -157
- package/src/demo/hightquery.vue +0 -366
- package/src/demo/inlineedit.vue +0 -182
- package/src/demo/selfdrop.vue +0 -58
- package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +0 -2
- package/src/directive/el-dragDialog/drag.js +0 -124
- package/src/directive/el-dragDialog/index.js +0 -13
- package/src/errorLog.js +0 -16
- package/src/hdcom/BigGrid.js +0 -179
- package/src/hdcom/BillShow.vue +0 -111
- package/src/hdcom/BillUpload.vue +0 -311
- package/src/hdcom/BtnRight.vue +0 -101
- package/src/hdcom/ErrHint.vue +0 -42
- package/src/hdcom/ExtendColumn.vue +0 -115
- package/src/hdcom/ExtendCommon.js +0 -40
- package/src/hdcom/ExtendForm.vue +0 -141
- package/src/hdcom/FacePicUpload.vue +0 -80
- package/src/hdcom/FaceRecTest.vue +0 -114
- package/src/hdcom/GridChart.vue +0 -207
- package/src/hdcom/GridExField.vue +0 -375
- package/src/hdcom/GridShow.vue +0 -288
- package/src/hdcom/HdAside.vue +0 -225
- package/src/hdcom/HdBtn.vue +0 -125
- package/src/hdcom/HdButton.vue +0 -161
- package/src/hdcom/HdComFaceRec.vue +0 -106
- package/src/hdcom/HdComGrid.vue +0 -876
- package/src/hdcom/HdComQuery.vue +0 -362
- package/src/hdcom/HdComQueryDetail.vue +0 -205
- package/src/hdcom/HdComSortDetail.vue +0 -161
- package/src/hdcom/HdDatePicker.vue +0 -94
- package/src/hdcom/HdDialog.vue +0 -81
- package/src/hdcom/HdDrop.vue +0 -188
- package/src/hdcom/HdFileUpload.vue +0 -167
- package/src/hdcom/HdFilterBox.vue +0 -90
- package/src/hdcom/HdFooter.vue +0 -182
- package/src/hdcom/HdForm.vue +0 -351
- package/src/hdcom/HdFormBtn.vue +0 -131
- package/src/hdcom/HdFormItem.vue +0 -39
- package/src/hdcom/HdGctosGrid +0 -0
- package/src/hdcom/HdGrid.vue +0 -1022
- package/src/hdcom/HdGridEditBtn.vue +0 -58
- package/src/hdcom/HdGridExt.js +0 -250
- package/src/hdcom/HdGridSel.vue +0 -257
- package/src/hdcom/HdHeader.vue +0 -180
- package/src/hdcom/HdHotKey.vue +0 -84
- package/src/hdcom/HdInputHint.vue +0 -53
- package/src/hdcom/HdMain.vue +0 -41
- package/src/hdcom/HdMessage.vue +0 -201
- package/src/hdcom/HdNum.vue +0 -79
- package/src/hdcom/HdPopSel.vue +0 -80
- package/src/hdcom/HdRightMenu.vue +0 -63
- package/src/hdcom/HdSel/SelGridFieldcod.vue +0 -54
- package/src/hdcom/HdTableColumn.vue +0 -381
- package/src/hdcom/HdTempSave.vue +0 -162
- package/src/hdcom/HdTree.vue +0 -103
- package/src/hdcom/HdTreeTable/eval.js +0 -39
- package/src/hdcom/HdTreeTable/index.vue +0 -229
- package/src/hdcom/ImportExcel.vue +0 -178
- package/src/hdcom/index.js +0 -75
- package/src/idev.common.js +0 -79
- package/src/index.js +0 -11
- package/src/utils/HdQuery.js +0 -65
- package/src/utils/comutils.js +0 -120
- package/src/utils/gogocodeTransfer.js +0 -59
- package/src/utils/utils.js +0 -116
- package/src/vendor/Blob.js +0 -187
- package/src/vendor/Export2Excel.js +0 -231
- package/src/vendor/Export2Zip.js +0 -25
- package/src/views/layout/AppMain.vue +0 -34
- package/src/views/layout/HdLayout.vue +0 -90
- package/src/views/layout/header/ElasticSearch.vue +0 -262
- package/src/views/layout/header/HZRecorder.js +0 -259
- package/src/views/layout/header/HeaderSearch.vue +0 -218
- package/src/views/layout/header/Levelbar.vue +0 -55
- package/src/views/layout/header/MainHeader.vue +0 -315
- package/src/views/layout/header/Navbar.vue +0 -101
- package/src/views/layout/header/ScrollPane.vue +0 -103
- package/src/views/layout/header/TagsView.vue +0 -215
- package/src/views/layout/header/VocRec.vue +0 -105
- package/src/views/layout/header/changepswform.vue +0 -130
- package/src/views/layout/index.js +0 -10
- package/src/views/layout/menu/Hamburger.vue +0 -63
- package/src/views/layout/menu/HdMenu.vue +0 -204
- package/src/views/layout/menu/css/menu.css +0 -288
- package/src/views/layout/menu/index.vue +0 -27
- package/src/views/privilege/commsg/commsg.vue +0 -152
- package/src/views/privilege/commsg/commsgOrgn.vue +0 -51
- package/src/views/privilege/commsg/commsgRole.vue +0 -220
- package/src/views/privilege/commsg/commsgform.vue +0 -184
- package/src/views/privilege/commsg/commsgiframe.vue +0 -40
- package/src/views/privilege/commsg/commsgto.vue +0 -199
- package/src/views/privilege/commsg/commsgtoform.vue +0 -114
- package/src/views/privilege/commsg/commsgtrans.vue +0 -227
- package/src/views/privilege/exfield/comexcolumn.vue +0 -161
- package/src/views/privilege/exfield/comexcolumnform.vue +0 -128
- package/src/views/privilege/exfield/comexfield.vue +0 -29
- package/src/views/privilege/exfield/comexfieldform.vue +0 -112
- package/src/views/privilege/exfield/comexfieldsub.vue +0 -163
- package/src/views/privilege/index.js +0 -41
- package/src/views/privilege/menu/comMenu.vue +0 -49
- package/src/views/privilege/menu/menu.vue +0 -250
- package/src/views/privilege/menu/menuinfo.vue +0 -63
- package/src/views/privilege/menu/rolelist.vue +0 -92
- package/src/views/privilege/menu/userlist.vue +0 -92
- package/src/views/privilege/mobile/authmobileupdate.vue +0 -145
- package/src/views/privilege/mobile/authmobileupdateform.vue +0 -120
- package/src/views/privilege/orgDept/authOrgn.vue +0 -188
- package/src/views/privilege/orgDept/authorgnform.vue +0 -157
- package/src/views/privilege/orgDept/orgDept.vue +0 -38
- package/src/views/privilege/orgDept/orgTree.vue +0 -99
- package/src/views/privilege/orgDept/orgnselect.vue +0 -155
- package/src/views/privilege/personDept/authuser.vue +0 -229
- package/src/views/privilege/personDept/authuserform.vue +0 -206
- package/src/views/privilege/personDept/facerec.vue +0 -162
- package/src/views/privilege/personDept/orgncascader.vue +0 -144
- package/src/views/privilege/personDept/personDept.vue +0 -33
- package/src/views/privilege/quartz/comquartzjob.vue +0 -150
- package/src/views/privilege/quartz/comquartzjobform.vue +0 -115
- package/src/views/privilege/quartz/comquartzlog.vue +0 -143
- package/src/views/privilege/role/btnRole.vue +0 -173
- package/src/views/privilege/role/menuRole.vue +0 -84
- package/src/views/privilege/role/orgnRole.vue +0 -78
- package/src/views/privilege/role/role.vue +0 -84
- package/src/views/privilege/role/rolelist.vue +0 -136
- package/src/views/privilege/role/roleselect.vue +0 -74
- package/src/views/privilege/search/comsearch.vue +0 -196
- package/src/views/privilege/search/menu.vue +0 -68
- package/src/views/privilege/syscode/syscode.vue +0 -191
- package/src/views/privilege/syscode/sysfield.vue +0 -119
- package/src/views/privilege/syscode/sysfieldframe.vue +0 -30
- package/src/views/privilege/syslog/menulog.vue +0 -68
- package/src/views/privilege/syslog/syslog.vue +0 -182
- package/src/views/privilege/syslog/syslogconfig.vue +0 -128
- package/src/views/privilege/syslog/syslogform.vue +0 -85
- package/src/views/privilege/syslog/syslogframe.vue +0 -26
- package/src/views/privilege/userRole/userRole.vue +0 -220
- package/vite.config.js +0 -103
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<hd-btn
|
|
4
|
-
icon="el-icon-edit"
|
|
5
|
-
hint="编辑"
|
|
6
|
-
@click.stop="$vnode.context.$refs[gridRef].doEdit(row)"
|
|
7
|
-
v-if="!row.isEdit"
|
|
8
|
-
>
|
|
9
|
-
</hd-btn>
|
|
10
|
-
<hd-btn
|
|
11
|
-
hint="撤销"
|
|
12
|
-
@click.stop="$vnode.context.$refs[gridRef].doCancel(row)"
|
|
13
|
-
v-if="row.isEdit"
|
|
14
|
-
>
|
|
15
|
-
<svg-icon icon-class="undo" />
|
|
16
|
-
</hd-btn>
|
|
17
|
-
<hd-btn
|
|
18
|
-
icon="el-icon-check"
|
|
19
|
-
hint="保存"
|
|
20
|
-
@click.stop="$vnode.context.$refs[gridRef].doSave(row)"
|
|
21
|
-
v-if="row.isEdit"
|
|
22
|
-
>
|
|
23
|
-
</hd-btn>
|
|
24
|
-
<hd-btn
|
|
25
|
-
icon="el-icon-delete"
|
|
26
|
-
hint="删除"
|
|
27
|
-
@click.stop="$vnode.context.$refs[gridRef].doRemove(row)"
|
|
28
|
-
v-if="!row.isEdit"
|
|
29
|
-
>
|
|
30
|
-
</hd-btn>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
/**
|
|
36
|
-
* GridEditBtn 列表内的增删改按钮
|
|
37
|
-
* @module HdGridEditBtn
|
|
38
|
-
*/
|
|
39
|
-
export default {
|
|
40
|
-
name: 'HdGridEditBtn',
|
|
41
|
-
inheritAttrs: false,
|
|
42
|
-
/**
|
|
43
|
-
* Props
|
|
44
|
-
* @prop {String} gridRef 默认为grid
|
|
45
|
-
* @prop {Object} row 行对象
|
|
46
|
-
*/
|
|
47
|
-
props: {
|
|
48
|
-
gridRef: {
|
|
49
|
-
type: String,
|
|
50
|
-
default: 'grid',
|
|
51
|
-
},
|
|
52
|
-
row: Object,
|
|
53
|
-
},
|
|
54
|
-
data() {
|
|
55
|
-
return {}
|
|
56
|
-
},
|
|
57
|
-
}
|
|
58
|
-
</script>
|
package/src/hdcom/HdGridExt.js
DELETED
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
// 快捷键实现及导出excel和pdf
|
|
2
|
-
export default {
|
|
3
|
-
data() {
|
|
4
|
-
return {
|
|
5
|
-
rowSelNum: -1, // 选中行
|
|
6
|
-
}
|
|
7
|
-
},
|
|
8
|
-
methods: {
|
|
9
|
-
addHotKey() {
|
|
10
|
-
document.body.addEventListener('keydown', this.handleKeydown)
|
|
11
|
-
},
|
|
12
|
-
removeHotKey() {
|
|
13
|
-
document.body.removeEventListener('keydown', this.handleKeydown)
|
|
14
|
-
},
|
|
15
|
-
handleKeydown(event) {
|
|
16
|
-
const keyCode = event.keyCode
|
|
17
|
-
const list = [38, 40, 37, 39]
|
|
18
|
-
if (list.indexOf(keyCode) !== -1) {
|
|
19
|
-
if (keyCode === 38) {
|
|
20
|
-
// up
|
|
21
|
-
this.rowSelNum -= 1
|
|
22
|
-
}
|
|
23
|
-
if (keyCode === 40) {
|
|
24
|
-
this.rowSelNum += 1
|
|
25
|
-
}
|
|
26
|
-
if (keyCode === 37) {
|
|
27
|
-
// left
|
|
28
|
-
this.hdQuery.doCurPageChange(
|
|
29
|
-
this.hdQuery.page - 1 < 1 ? 1 : this.hdQuery.page - 1
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
if (keyCode === 39) {
|
|
33
|
-
let totalPageSize = (this.hdResult.total - 1) / this.hdQuery.rows + 1
|
|
34
|
-
this.hdQuery.doCurPageChange(
|
|
35
|
-
this.hdQuery.page + 1 > totalPageSize
|
|
36
|
-
? totalPageSize
|
|
37
|
-
: this.hdQuery.page + 1
|
|
38
|
-
)
|
|
39
|
-
}
|
|
40
|
-
event.stopPropagation()
|
|
41
|
-
event.preventDefault()
|
|
42
|
-
}
|
|
43
|
-
if (keyCode === 13) {
|
|
44
|
-
// Enter
|
|
45
|
-
if (this.hdQuery.selRow) {
|
|
46
|
-
this.$emit('enterClick', this.hdQuery.selRow)
|
|
47
|
-
this.hdQuery.selRow = null
|
|
48
|
-
} else if (this.hdResultComRows.length > 0) {
|
|
49
|
-
this.hdQuery.selRow = this.hdResultComRows[0] // 这里必须这样赋值
|
|
50
|
-
this.$emit('enterClick', this.hdResultComRows[0])
|
|
51
|
-
this.hdQuery.selRow = null
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (event.altKey && keyCode === 13) {
|
|
55
|
-
// alt+Enter
|
|
56
|
-
this.$emit('altEnterClick', this.hdQuery.selRow)
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
setCurrentRow(i, isDown) {
|
|
60
|
-
this.rowSelNum = i
|
|
61
|
-
this.$refs.ingrid.setCurrentRow(this.hdResultComRows[i])
|
|
62
|
-
if (this.hdQuery) {
|
|
63
|
-
this.hdQuery.selRow = this.hdResultComRows[this.rowSelNum]
|
|
64
|
-
}
|
|
65
|
-
const trSel =
|
|
66
|
-
this.$refs.ingrid.$el.querySelectorAll('.el-table__body tr')[i]
|
|
67
|
-
if (!trSel) {
|
|
68
|
-
return true
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const scrollParent = this.$refs.ingrid.$el.querySelector(
|
|
72
|
-
'.el-table__body-wrapper'
|
|
73
|
-
)
|
|
74
|
-
const conHeigh = scrollParent.getBoundingClientRect().height
|
|
75
|
-
// const cellNumPage = conHeigh / cellHeigh //当前页面有多少行
|
|
76
|
-
|
|
77
|
-
const top = trSel.offsetTop
|
|
78
|
-
const bottom = trSel.offsetTop + trSel.offsetHeight
|
|
79
|
-
const viewRectTop = scrollParent.scrollTop
|
|
80
|
-
const viewRectBottom =
|
|
81
|
-
viewRectTop + scrollParent.clientHeight + trSel.clientHeight / 3 // trSel.clientHeight/3确保滚出屏幕后才触发
|
|
82
|
-
if (top < viewRectTop) {
|
|
83
|
-
scrollParent.scrollTop = top
|
|
84
|
-
} else if (bottom > viewRectBottom) {
|
|
85
|
-
// 向下移动触发
|
|
86
|
-
scrollParent.scrollTop = scrollParent.scrollTop + trSel.clientHeight
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
findLeafCol(col, leafCol, header, filterVal, par) {
|
|
90
|
-
//获得叶子节点,并且返回叶子节点父类
|
|
91
|
-
if (!col.children) {
|
|
92
|
-
leafCol.push(col)
|
|
93
|
-
if (par) {
|
|
94
|
-
header.push(par.label + '-' + col.label)
|
|
95
|
-
} else {
|
|
96
|
-
header.push(col.label)
|
|
97
|
-
}
|
|
98
|
-
filterVal.push(col.property)
|
|
99
|
-
} else {
|
|
100
|
-
for (let i = 0; i < col.children.length; i++) {
|
|
101
|
-
this.findLeafCol(col.children[i], leafCol, header, filterVal, col)
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
comExport(exportdata) {
|
|
106
|
-
const header = []
|
|
107
|
-
const filterVal = []
|
|
108
|
-
// const filterFt = [] // 与filterVal1对1,导出的excel值进行转换
|
|
109
|
-
const disColWithProp = [] //统计表头时判断
|
|
110
|
-
for (let i = 0; i < this.disCol.length; i++) {
|
|
111
|
-
const oneCol = this.disCol[i]
|
|
112
|
-
if (
|
|
113
|
-
!oneCol ||
|
|
114
|
-
(!oneCol.property && !oneCol.children) ||
|
|
115
|
-
!oneCol.showFlg ||
|
|
116
|
-
oneCol.showFlg == '0'
|
|
117
|
-
) {
|
|
118
|
-
continue
|
|
119
|
-
}
|
|
120
|
-
this.findLeafCol(oneCol, disColWithProp, header, filterVal) //将所有的叶子节点
|
|
121
|
-
}
|
|
122
|
-
const data = this.formatJson(filterVal, exportdata, header)
|
|
123
|
-
const merdata = [header].concat(data) // 中文+数据
|
|
124
|
-
this.summaryAdd(merdata, filterVal.length)
|
|
125
|
-
const title =
|
|
126
|
-
this.$route.meta.title + new Date().format('yyyy-MM-dd HH:mm:ss')
|
|
127
|
-
return { header, filterVal, merdata, title }
|
|
128
|
-
},
|
|
129
|
-
excelExport(exportdata) {
|
|
130
|
-
let excelData = this.comExport(exportdata)
|
|
131
|
-
let exportData = {}
|
|
132
|
-
if (this.excelFormatter) {
|
|
133
|
-
exportData = this.excelFormatter(excelData)
|
|
134
|
-
} else {
|
|
135
|
-
let merdata = excelData.merdata
|
|
136
|
-
if (this.excelPropHeader) {
|
|
137
|
-
merdata = this.formatJson(excelData.filterVal, merdata)
|
|
138
|
-
}
|
|
139
|
-
exportData = {
|
|
140
|
-
header: merdata[0],
|
|
141
|
-
data: merdata.slice(1),
|
|
142
|
-
filename: excelData.title,
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
const excel = require('../vendor/Export2Excel')
|
|
146
|
-
excel.export_json_to_excel(exportData) // excelPropHeader:是否导出prop头
|
|
147
|
-
},
|
|
148
|
-
pdfExport(exportdata) {
|
|
149
|
-
let { header, filterVal, merdata, title } = this.comExport(exportdata)
|
|
150
|
-
this.$refs.pdfshow.genPdf(header, merdata, title)
|
|
151
|
-
},
|
|
152
|
-
summaryAdd(merdata, size) {
|
|
153
|
-
//如果导出有合计项
|
|
154
|
-
if (
|
|
155
|
-
this.$attrs.showSummary == undefined &&
|
|
156
|
-
this.$attrs['show-summary'] == undefined
|
|
157
|
-
) {
|
|
158
|
-
return
|
|
159
|
-
}
|
|
160
|
-
const disColWithProp = [] //获取表头
|
|
161
|
-
for (let i = 0; i < this.disCol.length; i++) {
|
|
162
|
-
const oneCol = this.disCol[i]
|
|
163
|
-
if (!oneCol || !oneCol.property || !oneCol.showFlg) {
|
|
164
|
-
continue
|
|
165
|
-
}
|
|
166
|
-
disColWithProp.push(oneCol)
|
|
167
|
-
}
|
|
168
|
-
let sum = new Array(size)
|
|
169
|
-
let sumMethod = this.$attrs.summaryMethod || this.$attrs['summary-method']
|
|
170
|
-
let sumVal = sumMethod({ columns: disColWithProp })
|
|
171
|
-
for (let i = 0; i < sum.length; i++) {
|
|
172
|
-
if (sumVal[i]) {
|
|
173
|
-
sum[i] = sumVal[i]
|
|
174
|
-
} else {
|
|
175
|
-
sum[i] = ''
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
merdata.push(sum)
|
|
179
|
-
},
|
|
180
|
-
|
|
181
|
-
formatJson(filterVal, jsonData, header) {
|
|
182
|
-
if (!jsonData || jsonData.length == 0) {
|
|
183
|
-
return []
|
|
184
|
-
}
|
|
185
|
-
if (this.excelPropHeader) {
|
|
186
|
-
// 导出所有头
|
|
187
|
-
for (const data in jsonData[0]) {
|
|
188
|
-
let isHas = false
|
|
189
|
-
for (const val in filterVal) {
|
|
190
|
-
if (filterVal[val] == data) {
|
|
191
|
-
isHas = true
|
|
192
|
-
break
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
if (!isHas) {
|
|
196
|
-
// 所有json属性在filterval都要有
|
|
197
|
-
filterVal.push(data)
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
let noExLs = ['_obj', 'idevVersionUse', '_map']
|
|
202
|
-
if (this.noExcelExport) {
|
|
203
|
-
noExLs = noExLs.concat(this.noExcelExport)
|
|
204
|
-
}
|
|
205
|
-
for (let j = 0; j < noExLs.length; j++) {
|
|
206
|
-
// 不需要导出的属性,header也需要删除
|
|
207
|
-
const index = filterVal.removeone(noExLs[j])
|
|
208
|
-
if (index != -1) {
|
|
209
|
-
header.splice(index, 1)
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
return jsonData.map((v) =>
|
|
213
|
-
filterVal.map((j) => {
|
|
214
|
-
try {
|
|
215
|
-
const inFt = this.getInputFormat(j) //支持多级prop如果有inutFormat会使用inputFormt
|
|
216
|
-
if (inFt) {
|
|
217
|
-
return inFt(v, j)
|
|
218
|
-
} else {
|
|
219
|
-
return v[j] + '' // 数字变为字符串
|
|
220
|
-
}
|
|
221
|
-
} catch (err) {
|
|
222
|
-
//不存在时,直接返回空
|
|
223
|
-
console.info(err)
|
|
224
|
-
return null
|
|
225
|
-
}
|
|
226
|
-
})
|
|
227
|
-
)
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
watch: {
|
|
231
|
-
rowSelNum: function (val, oldVal) {
|
|
232
|
-
if (val < 0) {
|
|
233
|
-
if (this.hdResult.rows.length == 0) {
|
|
234
|
-
// 没有数据时不选中
|
|
235
|
-
this.rowSelNum = -1
|
|
236
|
-
return false
|
|
237
|
-
} else {
|
|
238
|
-
this.rowSelNum = 0
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
if (val > this.hdResult.rows.length - 1) {
|
|
242
|
-
this.rowSelNum = this.hdResult.rows.length - 1
|
|
243
|
-
}
|
|
244
|
-
if (this.hdQuery) {
|
|
245
|
-
this.hdQuery.selRow = this.hdResult.rows[this.rowSelNum]
|
|
246
|
-
}
|
|
247
|
-
this.setCurrentRow(this.rowSelNum, val - oldVal > 0) // >0是下移动,<0是上移
|
|
248
|
-
},
|
|
249
|
-
},
|
|
250
|
-
}
|
package/src/hdcom/HdGridSel.vue
DELETED
|
@@ -1,257 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-popover
|
|
4
|
-
:disabled="disabled"
|
|
5
|
-
placement="bottom-start"
|
|
6
|
-
popperClass="hd-grid-sel"
|
|
7
|
-
ref="popSel"
|
|
8
|
-
v-model="visible"
|
|
9
|
-
>
|
|
10
|
-
<div :style="{ height: height, width: width }">
|
|
11
|
-
<hd-com-grid
|
|
12
|
-
:findUrl="url"
|
|
13
|
-
:hdQuery="hdQuery"
|
|
14
|
-
@enterClick="rowClick(hdQuery.selRow)"
|
|
15
|
-
@row-click="rowClick"
|
|
16
|
-
ckHide
|
|
17
|
-
indexHide
|
|
18
|
-
noSets
|
|
19
|
-
notInit
|
|
20
|
-
recHide
|
|
21
|
-
ref="grid"
|
|
22
|
-
v-bind="$attrs"
|
|
23
|
-
v-on="$listeners"
|
|
24
|
-
:hd-btn-tool="false"
|
|
25
|
-
is-not-db-edit
|
|
26
|
-
>
|
|
27
|
-
<slot name="query" slot="query"></slot>
|
|
28
|
-
<slot></slot>
|
|
29
|
-
</hd-com-grid>
|
|
30
|
-
</div>
|
|
31
|
-
</el-popover>
|
|
32
|
-
<div>
|
|
33
|
-
<!--readonly 在选择区隐藏时,不能输入-->
|
|
34
|
-
<el-input
|
|
35
|
-
:clearable="false"
|
|
36
|
-
:disabled="disabled"
|
|
37
|
-
:placeholder="placeholder ? $t(placeholder) : $t('请选择')"
|
|
38
|
-
:readonly="!visible"
|
|
39
|
-
@blur="blur"
|
|
40
|
-
@focus="focus"
|
|
41
|
-
@mouseenter.native="doMouseEnter"
|
|
42
|
-
@mouseleave.native="doMouseLeave"
|
|
43
|
-
ref="sel"
|
|
44
|
-
v-model="searchVal"
|
|
45
|
-
v-popover:popSel
|
|
46
|
-
>
|
|
47
|
-
<el-icon class="el-input__icon" style="cursor: pointer"
|
|
48
|
-
><el-icon-circle-close
|
|
49
|
-
/></el-icon>
|
|
50
|
-
<el-icon class="el-input__icon" style="cursor: pointer"
|
|
51
|
-
><el-icon-more
|
|
52
|
-
/></el-icon>
|
|
53
|
-
</el-input>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</template>
|
|
57
|
-
|
|
58
|
-
<script>
|
|
59
|
-
import {
|
|
60
|
-
CircleClose as ElIconCircleClose,
|
|
61
|
-
More as ElIconMore,
|
|
62
|
-
} from '@element-plus/icons-vue'
|
|
63
|
-
export default {
|
|
64
|
-
components: {
|
|
65
|
-
ElIconCircleClose,
|
|
66
|
-
ElIconMore,
|
|
67
|
-
},
|
|
68
|
-
name: 'HdGridSel',
|
|
69
|
-
data() {
|
|
70
|
-
return {
|
|
71
|
-
openHandler: null, //快速切换焦点,避免出现很多下拉类别
|
|
72
|
-
threePointShow: true,
|
|
73
|
-
searchVal: this.txtVal,
|
|
74
|
-
// isFocus: false,
|
|
75
|
-
visible: false,
|
|
76
|
-
isFirst: true, // 是否第一次打开
|
|
77
|
-
searchHandler: Object,
|
|
78
|
-
isSoftFocus: false, // 点击弹窗内容时,input重新获得焦点,但是不能触发focus
|
|
79
|
-
// focusTime: 0
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
inheritAttrs: false,
|
|
83
|
-
/**
|
|
84
|
-
* Props 继承hd-com-grid的属性和事件
|
|
85
|
-
* @prop {String} txtVal 双向绑定 这里是为了clear清空用
|
|
86
|
-
* @prop {String} idVal 双向绑定 这里是为了clear清空用
|
|
87
|
-
* @prop {String} placeholder
|
|
88
|
-
* @prop {Boolean} disabled 只读
|
|
89
|
-
* @prop {Object} hdQuery 查询封装类
|
|
90
|
-
* @prop {String} height 默认为40vh
|
|
91
|
-
* @prop {String} width 弹出选择框的宽度,非输入框的!!!
|
|
92
|
-
* @prop {Function} beforeQuery 查询前的事件,通常需要绑定anyQuery
|
|
93
|
-
* @prop {String} url 查询的url,hdGrid中的findUrl
|
|
94
|
-
*/
|
|
95
|
-
// 设置value为props属性-必须
|
|
96
|
-
props: {
|
|
97
|
-
txtVal: String,
|
|
98
|
-
idVal: String,
|
|
99
|
-
placeholder: String,
|
|
100
|
-
disabled: Boolean,
|
|
101
|
-
hdQuery: Object,
|
|
102
|
-
url: String, // 全路径
|
|
103
|
-
height: {
|
|
104
|
-
// 弹出选择框的高度,非输入框的!!!
|
|
105
|
-
type: String,
|
|
106
|
-
default: '40vh',
|
|
107
|
-
},
|
|
108
|
-
width: {
|
|
109
|
-
// 弹出选择框的宽度,非输入框的!!!
|
|
110
|
-
type: String,
|
|
111
|
-
default: '100%',
|
|
112
|
-
},
|
|
113
|
-
beforeQuery: Function,
|
|
114
|
-
},
|
|
115
|
-
mounted() {
|
|
116
|
-
this.$nextTick(() => {
|
|
117
|
-
if (this.$refs.popSel)
|
|
118
|
-
this.$refs.popSel.referenceElm.setAttribute('tabindex', -1) // 不可通过tab切换到popsel,因为有input存在
|
|
119
|
-
})
|
|
120
|
-
},
|
|
121
|
-
methods: {
|
|
122
|
-
focus() {
|
|
123
|
-
// this.focusTime = new Date().getTime()
|
|
124
|
-
this.$emit('focus')
|
|
125
|
-
if (this.isSoftFocus) {
|
|
126
|
-
// click时
|
|
127
|
-
this.isSoftFocus = false // 点击时,防止焦点触发
|
|
128
|
-
return false
|
|
129
|
-
}
|
|
130
|
-
this.openHandler = setTimeout(() => {
|
|
131
|
-
// 否则会和默认的冲突
|
|
132
|
-
this.visible = true
|
|
133
|
-
this.openHandler = null
|
|
134
|
-
}, 150)
|
|
135
|
-
// this.isFocus = true
|
|
136
|
-
},
|
|
137
|
-
blur() {
|
|
138
|
-
if (this.openHandler) {
|
|
139
|
-
clearTimeout(this.openHandler)
|
|
140
|
-
this.openHandler = null
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
// visibleChg() {
|
|
144
|
-
// setTimeout(() => {
|
|
145
|
-
// let nowClickTime = new Date().getTime()
|
|
146
|
-
// if (nowClickTime - focusTime > 500)//只有焦点时才可点击
|
|
147
|
-
// this.visible = !this.visible
|
|
148
|
-
// }, 150)
|
|
149
|
-
// },
|
|
150
|
-
// blur() {
|
|
151
|
-
// // setTimeout(() => {
|
|
152
|
-
// // console.info('blur' + this.isSoftFocus)
|
|
153
|
-
// // if (this.isSoftFocus) {
|
|
154
|
-
// // this.isSoftFocus = false;
|
|
155
|
-
// // } else {
|
|
156
|
-
// // this.$emit('blur', event);
|
|
157
|
-
// // this.isFocus = false
|
|
158
|
-
// // this.searchVal = this.txtVal //焦点切换,还原
|
|
159
|
-
// // this.visible = false
|
|
160
|
-
// // }
|
|
161
|
-
// // }, 150);
|
|
162
|
-
// },
|
|
163
|
-
doClear() {
|
|
164
|
-
this.$parent.$emit('update:txtVal', '')
|
|
165
|
-
this.$parent.$emit('update:idVal', '')
|
|
166
|
-
this.$emit('clear')
|
|
167
|
-
this.$nextTick(() => {
|
|
168
|
-
this.$refs.sel.focus() // 确保input已渲染后再设置焦点
|
|
169
|
-
})
|
|
170
|
-
},
|
|
171
|
-
doMouseEnter() {
|
|
172
|
-
if (this.disabled) {
|
|
173
|
-
return false
|
|
174
|
-
}
|
|
175
|
-
if (this.idVal) {
|
|
176
|
-
this.threePointShow = false
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
doMouseLeave() {
|
|
180
|
-
this.threePointShow = true
|
|
181
|
-
},
|
|
182
|
-
/**
|
|
183
|
-
* @function 触发rowClick(row)事件
|
|
184
|
-
* */
|
|
185
|
-
rowClick(row) {
|
|
186
|
-
this.$emit('rowClick', row)
|
|
187
|
-
this.isSoftFocus = true
|
|
188
|
-
this.$refs.sel.focus()
|
|
189
|
-
this.visible = false
|
|
190
|
-
},
|
|
191
|
-
visbileKeyAdd() {
|
|
192
|
-
document.onkeydown = (e) => {
|
|
193
|
-
var key = window.event.keyCode
|
|
194
|
-
if (key == 9 || key == 27) {
|
|
195
|
-
// 9 tab 27 esc
|
|
196
|
-
this.visible = false
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
},
|
|
200
|
-
visbileKeyRemove() {
|
|
201
|
-
document.onkeydown = function (e) {}
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
watch: {
|
|
205
|
-
searchVal: function (newVal) {
|
|
206
|
-
if (!this.visible) {
|
|
207
|
-
return false
|
|
208
|
-
}
|
|
209
|
-
if (this.searchTimeHandler) {
|
|
210
|
-
clearTimeout(this.searchTimeHandler)
|
|
211
|
-
}
|
|
212
|
-
this.searchTimeHandler = setTimeout(() => {
|
|
213
|
-
// 延迟300ms查询
|
|
214
|
-
this.searchTimeHandler = null
|
|
215
|
-
if (this.beforeQuery) {
|
|
216
|
-
this.beforeQuery(newVal)
|
|
217
|
-
}
|
|
218
|
-
// for(var key in this.hdQuery.query) {
|
|
219
|
-
// this.hdQuery.query[key]=this.hdQuery.query[key].toUpperCase();
|
|
220
|
-
// }
|
|
221
|
-
this.$refs.grid.doQuery().then(() => {
|
|
222
|
-
// 默认选中第一行
|
|
223
|
-
this.$refs.grid.$refs.hdgrid.setCurrentRow(0)
|
|
224
|
-
})
|
|
225
|
-
}, 600)
|
|
226
|
-
// this.visible = true
|
|
227
|
-
},
|
|
228
|
-
txtVal: function (newVal) {
|
|
229
|
-
this.searchVal = this.txtVal
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
visible: function (newVal) {
|
|
233
|
-
if (newVal) {
|
|
234
|
-
//虚拟滚动时,防止页面空白
|
|
235
|
-
this.$refs.grid.$refs.hdgrid.scroller = 0
|
|
236
|
-
this.$refs.grid.addHotKey()
|
|
237
|
-
this.visbileKeyAdd()
|
|
238
|
-
} else {
|
|
239
|
-
this.$refs.grid.removeHotKey()
|
|
240
|
-
this.visbileKeyRemove()
|
|
241
|
-
this.searchVal = this.txtVal
|
|
242
|
-
}
|
|
243
|
-
if (newVal) {
|
|
244
|
-
if (this.beforeQuery) {
|
|
245
|
-
this.beforeQuery()
|
|
246
|
-
}
|
|
247
|
-
// for(var key in this.hdQuery.query) {
|
|
248
|
-
// this.hdQuery.query[key]=this.hdQuery.query[key].toUpperCase();
|
|
249
|
-
// }
|
|
250
|
-
this.$refs.grid.doQuery(null).then(() => {
|
|
251
|
-
this.$refs.grid.$refs.hdgrid.setCurrentRow(0)
|
|
252
|
-
})
|
|
253
|
-
}
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
}
|
|
257
|
-
</script>
|