hd-idevvue3 3.0.0 → 3.0.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 (226) hide show
  1. package/README.md +22 -191
  2. package/dist/index.html +17 -0
  3. package/package.json +13 -9
  4. package/pnpm-lock.yaml +5593 -0
  5. package/src/App.vue +15 -0
  6. package/src/assets/sound/notify.wav +0 -0
  7. package/src/demo/demo.vue +43 -0
  8. package/src/demo/dropdemo.vue +43 -0
  9. package/src/demo/extsets.vue +107 -0
  10. package/src/demo/formedit.vue +145 -0
  11. package/src/demo/hightquery.vue +169 -0
  12. package/src/demo/inlineedit.vue +88 -0
  13. package/src/demo/selfdrop.vue +41 -0
  14. package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +2 -0
  15. package/src/directive/el-dragDialog/drag.js +124 -0
  16. package/src/directive/el-dragDialog/index.js +13 -0
  17. package/src/errorLog.js +14 -0
  18. package/src/hdcom/BigGrid.js +173 -0
  19. package/src/hdcom/BillShow.vue +90 -0
  20. package/src/hdcom/BillUpload.vue +253 -0
  21. package/src/hdcom/BtnRight.vue +98 -0
  22. package/src/hdcom/ErrHint.vue +30 -0
  23. package/src/hdcom/ExtendColumn.vue +108 -0
  24. package/src/hdcom/ExtendCommon.js +29 -0
  25. package/src/hdcom/ExtendForm.vue +114 -0
  26. package/src/hdcom/FacePicUpload.vue +71 -0
  27. package/src/hdcom/FaceRecTest.vue +104 -0
  28. package/src/hdcom/GridChart.vue +194 -0
  29. package/src/hdcom/GridExField.vue +281 -0
  30. package/src/hdcom/GridShow.vue +238 -0
  31. package/src/hdcom/HdAside.vue +178 -0
  32. package/src/hdcom/HdBtn.vue +113 -0
  33. package/src/hdcom/HdButton.vue +137 -0
  34. package/src/hdcom/HdComFaceRec.vue +58 -0
  35. package/src/hdcom/HdComGrid.vue +776 -0
  36. package/src/hdcom/HdComQuery.vue +273 -0
  37. package/src/hdcom/HdComQueryDetail.vue +161 -0
  38. package/src/hdcom/HdComSortDetail.vue +155 -0
  39. package/src/hdcom/HdDatePicker.vue +78 -0
  40. package/src/hdcom/HdDialog.vue +63 -0
  41. package/src/hdcom/HdDrop.vue +163 -0
  42. package/src/hdcom/HdFileUpload.vue +148 -0
  43. package/src/hdcom/HdFilterBox.vue +90 -0
  44. package/src/hdcom/HdFooter.vue +149 -0
  45. package/src/hdcom/HdForm.vue +278 -0
  46. package/src/hdcom/HdFormBtn.vue +89 -0
  47. package/src/hdcom/HdFormItem.vue +35 -0
  48. package/src/hdcom/HdGctosGrid +0 -0
  49. package/src/hdcom/HdGrid.vue +825 -0
  50. package/src/hdcom/HdGridEditBtn.vue +44 -0
  51. package/src/hdcom/HdGridExt.js +219 -0
  52. package/src/hdcom/HdGridSel.vue +223 -0
  53. package/src/hdcom/HdHeader.vue +148 -0
  54. package/src/hdcom/HdHotKey.vue +81 -0
  55. package/src/hdcom/HdInputHint.vue +49 -0
  56. package/src/hdcom/HdMain.vue +43 -0
  57. package/src/hdcom/HdMessage.vue +192 -0
  58. package/src/hdcom/HdNum.vue +69 -0
  59. package/src/hdcom/HdPopSel.vue +58 -0
  60. package/src/hdcom/HdRightMenu.vue +61 -0
  61. package/src/hdcom/HdSel/SelGridFieldcod.vue +36 -0
  62. package/src/hdcom/HdTableColumn.vue +334 -0
  63. package/src/hdcom/HdTempSave.vue +140 -0
  64. package/src/hdcom/HdTree.vue +86 -0
  65. package/src/hdcom/HdTreeTable/eval.js +32 -0
  66. package/src/hdcom/HdTreeTable/index.vue +174 -0
  67. package/src/hdcom/ImportExcel.vue +143 -0
  68. package/src/hdcom/PdfShow.vue +266 -0
  69. package/src/hdcom/index.js +80 -0
  70. package/src/idev.common.js +72 -0
  71. package/src/index.js +13 -0
  72. package/src/utils/HdQuery.js +54 -0
  73. package/src/utils/comutils.js +98 -0
  74. package/src/utils/utils.js +105 -0
  75. package/src/vendor/Blob.js +179 -0
  76. package/src/vendor/Export2Excel.js +220 -0
  77. package/src/vendor/Export2Zip.js +22 -0
  78. package/src/views/layout/AppMain.vue +32 -0
  79. package/src/views/layout/HdLayout.vue +78 -0
  80. package/src/views/layout/header/ElasticSearch.vue +225 -0
  81. package/src/views/layout/header/HZRecorder.js +231 -0
  82. package/src/views/layout/header/HeaderSearch.vue +198 -0
  83. package/src/views/layout/header/Levelbar.vue +49 -0
  84. package/src/views/layout/header/MainHeader.vue +271 -0
  85. package/src/views/layout/header/Navbar.vue +105 -0
  86. package/src/views/layout/header/ScrollPane.vue +81 -0
  87. package/src/views/layout/header/TagsView.vue +210 -0
  88. package/src/views/layout/header/VocRec.vue +97 -0
  89. package/src/views/layout/header/changepswform.vue +96 -0
  90. package/src/views/layout/index.js +12 -0
  91. package/src/views/layout/menu/Hamburger.vue +45 -0
  92. package/src/views/layout/menu/HdMenu.vue +167 -0
  93. package/src/views/layout/menu/css/menu.css +288 -0
  94. package/src/views/layout/menu/index.vue +25 -0
  95. package/src/views/privilege/commsg/commsg.vue +78 -0
  96. package/src/views/privilege/commsg/commsgOrgn.vue +42 -0
  97. package/src/views/privilege/commsg/commsgRole.vue +149 -0
  98. package/src/views/privilege/commsg/commsgform.vue +160 -0
  99. package/src/views/privilege/commsg/commsgiframe.vue +33 -0
  100. package/src/views/privilege/commsg/commsgto.vue +120 -0
  101. package/src/views/privilege/commsg/commsgtoform.vue +108 -0
  102. package/src/views/privilege/commsg/commsgtrans.vue +155 -0
  103. package/src/views/privilege/exfield/comexcolumn.vue +71 -0
  104. package/src/views/privilege/exfield/comexcolumnform.vue +101 -0
  105. package/src/views/privilege/exfield/comexfield.vue +31 -0
  106. package/src/views/privilege/exfield/comexfieldform.vue +94 -0
  107. package/src/views/privilege/exfield/comexfieldsub.vue +72 -0
  108. package/src/views/privilege/index.js +42 -0
  109. package/src/views/privilege/menu/comMenu.vue +41 -0
  110. package/src/views/privilege/menu/menu.vue +133 -0
  111. package/src/views/privilege/menu/menuinfo.vue +56 -0
  112. package/src/views/privilege/menu/rolelist.vue +47 -0
  113. package/src/views/privilege/menu/userlist.vue +49 -0
  114. package/src/views/privilege/mobile/authmobileupdate.vue +69 -0
  115. package/src/views/privilege/mobile/authmobileupdateform.vue +90 -0
  116. package/src/views/privilege/orgDept/authOrgn.vue +96 -0
  117. package/src/views/privilege/orgDept/authorgnform.vue +145 -0
  118. package/src/views/privilege/orgDept/orgDept.vue +37 -0
  119. package/src/views/privilege/orgDept/orgTree.vue +88 -0
  120. package/src/views/privilege/orgDept/orgnselect.vue +134 -0
  121. package/src/views/privilege/personDept/authuser.vue +123 -0
  122. package/src/views/privilege/personDept/authuserform.vue +154 -0
  123. package/src/views/privilege/personDept/facerec.vue +117 -0
  124. package/src/views/privilege/personDept/orgncascader.vue +125 -0
  125. package/src/views/privilege/personDept/personDept.vue +31 -0
  126. package/src/views/privilege/quartz/comquartzjob.vue +65 -0
  127. package/src/views/privilege/quartz/comquartzjobform.vue +99 -0
  128. package/src/views/privilege/quartz/comquartzlog.vue +59 -0
  129. package/src/views/privilege/role/btnRole.vue +117 -0
  130. package/src/views/privilege/role/menuRole.vue +64 -0
  131. package/src/views/privilege/role/orgnRole.vue +56 -0
  132. package/src/views/privilege/role/role.vue +67 -0
  133. package/src/views/privilege/role/rolelist.vue +67 -0
  134. package/src/views/privilege/role/roleselect.vue +57 -0
  135. package/src/views/privilege/search/comsearch.vue +105 -0
  136. package/src/views/privilege/search/menu.vue +52 -0
  137. package/src/views/privilege/syscode/syscode.vue +103 -0
  138. package/src/views/privilege/syscode/sysfield.vue +66 -0
  139. package/src/views/privilege/syscode/sysfieldframe.vue +30 -0
  140. package/src/views/privilege/syslog/menulog.vue +52 -0
  141. package/src/views/privilege/syslog/syslog.vue +115 -0
  142. package/src/views/privilege/syslog/syslogconfig.vue +61 -0
  143. package/src/views/privilege/syslog/syslogform.vue +83 -0
  144. package/src/views/privilege/syslog/syslogframe.vue +26 -0
  145. package/src/views/privilege/userRole/userRole.vue +122 -0
  146. package/src/views/privilege.zip +0 -0
  147. package/vite.config.js +118 -0
  148. package/.babelrc +0 -17
  149. package/.editorconfig +0 -14
  150. package/.eslintignore +0 -3
  151. package/.npminstall.done +0 -1
  152. package/.postcssrc.js +0 -8
  153. package/LICENSE +0 -21
  154. package/Listening +0 -28
  155. package/build/build.js +0 -70
  156. package/build/check-versions.js +0 -45
  157. package/build/config.js +0 -81
  158. package/build/dev-client.js +0 -9
  159. package/build/dev-server.js +0 -93
  160. package/build/utils.js +0 -78
  161. package/build/vue-loader.conf.js +0 -12
  162. package/build/webpack.common.js +0 -37
  163. package/build/webpack.component.js +0 -36
  164. package/build/webpack.prod.conf.js +0 -38
  165. package/components.json +0 -8
  166. package/conf.js +0 -42
  167. package/config/dev.env.js +0 -6
  168. package/config/index.js +0 -43
  169. package/config/prod.env.js +0 -6
  170. package/config/sit.env.js +0 -6
  171. package/favicon.ico +0 -0
  172. package/jsdoc-vue.js +0 -12
  173. package/lib/0.index.js +0 -12573
  174. package/lib/1.index.js +0 -6
  175. package/lib/2.index.js +0 -2
  176. package/lib/idev.common.js +0 -1
  177. package/lib/idv8.common.js +0 -1
  178. package/lib/index.js +0 -49170
  179. package/lib/js/ErrHint.js +0 -1
  180. package/lib/js/HdAside.js +0 -1
  181. package/lib/js/HdBtn.js +0 -1
  182. package/lib/js/HdButton.js +0 -1
  183. package/lib/js/HdComFaceRec.js +0 -1
  184. package/lib/js/HdComGrid.js +0 -1
  185. package/lib/js/HdDatePicker.js +0 -1
  186. package/lib/js/HdDialog.js +0 -1
  187. package/lib/js/HdDrop.js +0 -1
  188. package/lib/js/HdFileUpload.js +0 -1
  189. package/lib/js/HdFooter.js +0 -1
  190. package/lib/js/HdForm.js +0 -1
  191. package/lib/js/HdFormBtn.js +0 -1
  192. package/lib/js/HdFormItem.js +0 -1
  193. package/lib/js/HdGrid.js +0 -1
  194. package/lib/js/HdGridEditBtn.js +0 -1
  195. package/lib/js/HdGridSel.js +0 -1
  196. package/lib/js/HdHeader.js +0 -1
  197. package/lib/js/HdHotkey.js +0 -1
  198. package/lib/js/HdLayout.js +0 -1
  199. package/lib/js/HdMain.js +0 -1
  200. package/lib/js/HdMessage.js +0 -1
  201. package/lib/js/HdNum.js +0 -1
  202. package/lib/js/HdPopSel.js +0 -1
  203. package/lib/js/HdSearch.js +0 -1
  204. package/lib/js/HdTableColumn.js +0 -1
  205. package/lib/js/HdTempSave.js +0 -1
  206. package/lib/js/HdTree.js +0 -1
  207. package/lib/js/HdTreeTable.js +0 -1
  208. package/lib/js/authmobileupdate.js +0 -1
  209. package/lib/js/comexfield.js +0 -1
  210. package/lib/js/commsg.js +0 -1
  211. package/lib/js/commsgto.js +0 -1
  212. package/lib/js/comquartzjob.js +0 -1
  213. package/lib/js/comquartzlog.js +0 -1
  214. package/lib/js/comsearch.js +0 -1
  215. package/lib/js/menu.js +0 -1
  216. package/lib/js/menuinfo.js +0 -1
  217. package/lib/js/orgDept.js +0 -1
  218. package/lib/js/orgTree.js +0 -1
  219. package/lib/js/personDept.js +0 -1
  220. package/lib/js/role.js +0 -1
  221. package/lib/js/sysfieldframe.js +0 -1
  222. package/lib/js/syslog.js +0 -1
  223. package/lib/js/syslogframe.js +0 -1
  224. package/lib/js/userRole.js +0 -1
  225. package/npminstall-debug.log +0 -200
  226. package/ytgvue.rar +0 -0
@@ -0,0 +1,238 @@
1
+ <template>
2
+ <el-dialog title="展示设置" :visible.sync="visible" width='50%' append-to-body top="2vh">
3
+ <el-container style="height: 80vh; border: 1px solid #eee">
4
+ <el-main class="gridShow">
5
+ <el-table :data="list" row-key="property">
6
+ <el-table-column align="center" label="名称" prop="label" width="150" noQuery>
7
+ </el-table-column>
8
+ <el-table-column align="center" label="宽度(px)" prop="width" width="150" noQuery>
9
+ <template slot-scope="scope">
10
+ <hd-num v-model.number="scope.row.width" :step="10"></hd-num>
11
+ </template>
12
+ </el-table-column>
13
+ <el-table-column align="center" label="展示" prop="showFlg" noQuery>
14
+ <template slot-scope="scope">
15
+ <el-switch v-model="scope.row.showFlg" active-value="1" inactive-value="0"></el-switch>
16
+ </template>
17
+ </el-table-column>
18
+ <el-table-column align="center" label="冻结" prop="freezeFlg" noQuery>
19
+ <template slot-scope="scope">
20
+ <el-switch v-model="scope.row.freezeFlg" active-value="1" inactive-value="0"></el-switch>
21
+ </template>
22
+ </el-table-column>
23
+ <el-table-column align="center" label="排序" width="80" noQuery>
24
+ <template slot-scope="scope">
25
+ <svg-icon class='drag-handler' icon-class="drag"></svg-icon>
26
+ </template>
27
+ </el-table-column>
28
+ </el-table>
29
+
30
+ </el-main>
31
+ </el-container>
32
+ <div slot="footer" class="dialog-footer">
33
+ <el-button @click="reset">{{ $t('重置') }}</el-button>
34
+ <el-button @click="visible = false">{{ $t('取 消') }}</el-button>
35
+ <el-button type="primary" @click="submit" :loading="loading"> {{ $t('确 定') }}</el-button>
36
+ </div>
37
+ </el-dialog>
38
+ </template>
39
+ <script>
40
+
41
+ import Sortable from 'sortablejs'
42
+
43
+ export default {
44
+ name: 'gridshow',
45
+ components: {},
46
+ data() {
47
+ return {
48
+ hdQuery: new HdQuery(this),
49
+ list: [],
50
+ oldList: [],
51
+ newList: [],
52
+ visible: false,
53
+ loading: false,
54
+ menuId: '',
55
+ gridId: '',
56
+ specCkForGrid: true // HdTableColumn判断是否来自HdGrid用
57
+ // shipId: ""
58
+
59
+ }
60
+ },
61
+ mounted() {
62
+ this.loading = false
63
+ },
64
+ methods: {
65
+ show(disCol, menuId, gridId) {
66
+ this.menuId = menuId
67
+ this.gridId = gridId
68
+ this.visible = true
69
+ this.list = JSON.parse(JSON.stringify(disCol.filter(item => item.property)))// 判断有property的展示,使用复制采用新对象(否则chrome有问题)
70
+ // console.log('list',this.list)
71
+ //过滤掉子序列
72
+ this.list.forEach(v => v.children = []);
73
+ this.oldList = this.list.map(v => v.property)
74
+ this.newList = this.oldList.slice() //清空
75
+ this.$nextTick(() => {
76
+ this.setSort()
77
+ })
78
+ },
79
+ setSort() {
80
+ const elAll = document.querySelectorAll('.gridShow .el-table__body-wrapper > table > tbody')
81
+ for (let i = 0; i < elAll.length; i++) {
82
+ const el = elAll[i]
83
+ this.sortable = Sortable.create(el, {
84
+ ghostClass: 'sortable-ghost', // Class name for the drop placeholder,
85
+ onEnd: evt => {
86
+ const targetRow = this.list.splice(evt.oldIndex, 1)[0]
87
+ this.list.splice(evt.newIndex, 0, targetRow)
88
+
89
+ // for show the changes, you can delete in you code
90
+ const tempIndex = this.newList.splice(evt.oldIndex, 1)[0]
91
+ this.newList.splice(evt.newIndex, 0, tempIndex)
92
+ }
93
+ })
94
+ }
95
+ },
96
+ submit() {
97
+ const url = '/webresources/login/com/ComGridShow/save?menuId=' + this.menuId + '&gridId=' + this.gridId
98
+ this.loading = true
99
+ this.$http.post(url, this.list).then(response => {
100
+ this.loading = false
101
+ const data = response.data
102
+ this.$message({
103
+ type: data.code == '-1' ? 'error' : 'success',
104
+ message: data.message
105
+ })
106
+ if (data.code == '-1') {
107
+ return
108
+ }
109
+ this.visible = false
110
+ this.$emit('save-ok')
111
+ })
112
+ },
113
+ reset() {
114
+ //江阴港特色,重置需要弹窗确认框,确认后方可重置
115
+ let resetFlag = this.$store.state.app.sysParam.JYG_CONTROL.RESET_BUTTON_CONFIRM
116
+ if (resetFlag && resetFlag == '1') {
117
+ this.$confirm('是否确认重置?', '提示', {
118
+ confirmButtonText: '确定',
119
+ cancelButtonText: '取消',
120
+ type: 'warning'
121
+ }).then(() => {
122
+ // 确定
123
+ this.resetColumn()
124
+ })
125
+ } else {
126
+ this.resetColumn()
127
+ }
128
+ },
129
+ resetColumn() {
130
+ const url = '/webresources/login/com/ComGridShow/reset?menuId=' + this.menuId + '&gridId=' + this.gridId
131
+ this.$http.post(url, this.list).then(response => {
132
+ const data = response.data
133
+ this.$message({
134
+ type: data.code == '-1' ? 'error' : 'success',
135
+ message: data.message
136
+ })
137
+ if (data.code == '-1') {
138
+ return
139
+ }
140
+ this.visible = false
141
+ this.$emit('save-ok')
142
+ })
143
+ }
144
+
145
+ }
146
+ }
147
+ </script>
148
+
149
+ <style rel="stylesheet/scss" lang="scss">
150
+ .sortable-ghost {
151
+ opacity: .8;
152
+ color: #fff !important;
153
+ background: #42b983 !important;
154
+ }
155
+
156
+ .gridShow {
157
+ display: flex;
158
+ flex-direction: column;
159
+
160
+ .el-table {
161
+ height: 100%;
162
+ width: 100%;
163
+ flex: 1;
164
+
165
+ .el-table__body-wrapper {
166
+ width: 100%;
167
+ padding-bottom: 30px;
168
+ }
169
+
170
+ .el-table__header-wrapper th { //列表标题
171
+ background-color: #f6f6f6;
172
+ }
173
+
174
+ .el-table__fixed-header-wrapper th { //固定的列表标题
175
+ background-color: #8cbda4;
176
+ }
177
+
178
+ td, th { //列表标题及内容
179
+ padding: 2px 0;
180
+ }
181
+
182
+ .cell, .el-table th div, .el-table--border th:first-child .cell, .el-table--border td:first-child .cell { //列表的margin
183
+ padding-left: 2px !important;
184
+ padding-right: 2px !important;
185
+ }
186
+
187
+ .el-table__empty-block {
188
+ position: static;
189
+ text-align: center;
190
+ width: 100%;
191
+ height: 80%
192
+ }
193
+
194
+ .el-table__body { //列表下面加了空白
195
+ margin-bottom: 10px;
196
+ }
197
+
198
+ .el-table__body-wrapper {
199
+ height: 100%;
200
+ overflow-y: auto;
201
+ }
202
+
203
+ .el-input__inner {
204
+ height: 27px;
205
+ margin-bottom: 0px;
206
+ }
207
+
208
+ .el-input, .el-form-item__content, .el-form-item__label, .el-input__icon {
209
+ line-height: 30px;
210
+ }
211
+
212
+ .el-input__inner {
213
+ padding: 5px;
214
+ }
215
+
216
+ .el-input--prefix .el-input__inner { //日期的有logo不一样
217
+ padding-left: 30px;
218
+ }
219
+ }
220
+ }
221
+
222
+ </style>
223
+
224
+ <style scoped>
225
+ .icon-star {
226
+ margin-right: 2px;
227
+ }
228
+
229
+ .drag-handler {
230
+ width: 20px;
231
+ height: 20px;
232
+ cursor: pointer;
233
+ }
234
+
235
+ .show-d {
236
+ margin-top: 15px;
237
+ }
238
+ </style>
@@ -0,0 +1,178 @@
1
+ <template>
2
+ <ExAside :width="nowWidth" ref="aside" style="display: flex;">
3
+ <div class="hdAside">
4
+ <template v-if="title">
5
+ <div class="hd-title" v-show="!isShrink">{{$t(title)}}
6
+ <slot name="title"></slot>
7
+ <div align="right" style="margin: -15px 10px 0px 0px;" v-if="arrowShow">
8
+ <i @click="isShrink?doShrink(false):doShrink(true)"
9
+ style="cursor:pointer;" v-bind:class="['fa', isShrink?'fa-chevron-right':'fa-chevron-left']">
10
+ </i>
11
+ </div>
12
+ </div>
13
+ </template>
14
+ <div class="hd-title" v-show="isShrink">
15
+ <i @click="isShrink?doShrink(false):doShrink(true)"
16
+ style="cursor:pointer;" v-bind:class="['fa', isShrink?'fa-chevron-right':'fa-chevron-left']">
17
+ </i>
18
+ </div>
19
+ <div style="flex:1;position: relative;height:100%; width: 100%" v-show="!isShrink">
20
+ <div style="position: absolute; width: 100%;height: 100%;">
21
+ <slot></slot>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ <div :class="{asideDrag:true,dragShowCls:dragShow}" @mousedown="mousedown($event)" @mouseout="dragShow=false"
26
+ @mouseover="dragShow=true" v-if="!noDrag"></div>
27
+ <div class="moveline" ref="moveline" v-show="dragFrom!=null"></div>
28
+ </ExAside>
29
+ </template>
30
+
31
+ <script>
32
+ /**
33
+ * 覆写ElAside,增加拖动和title
34
+ * @module HdAside
35
+ */
36
+ export default {
37
+ name: 'HdAside',
38
+ component: {},
39
+ inheritAttrs: false,
40
+ /**
41
+ * Props 继承ELAside属性和事件,如果仅需要elementui的ElAside请使用ExAside
42
+ * 插槽:<slot name="title"></slot> title进行额外扩展如增加按钮等
43
+ * @prop {String} title 标题
44
+ * @prop {String} width 禁止在style中写width
45
+ * @prop {Boolen} arrowShow 是否显示一键收缩
46
+ * @prop {Boolen} noDrag 是否可拖动,默认否
47
+ * @prop {String} showType 字符串:"1" 普通 2 收缩 3 全屏
48
+ *
49
+ */
50
+ props: {
51
+ width: String,
52
+ title: String, arrowShow: {type: Boolean, default: true},
53
+ noDrag: {type: Boolean, default: false},
54
+ showType: {type: String, default: '1'} // 注意是字符串:"1" 普通 2 收缩 3 全屏
55
+ },
56
+ data() {
57
+ return {
58
+ isShrink: false, // 收缩还是展开
59
+ isFull: false,// 是否全屏
60
+ differ: 0,//鼠标点击的位置与元素上级位置的差
61
+ dragFrom: null, //开始点击的点
62
+ inputWidth: 0, //第一次进来时的,宽度
63
+ nowWidth: '300px',//无设置默认300px
64
+ dragShow: false
65
+
66
+ }
67
+ },
68
+ mounted() {
69
+ if (this.width) {
70
+ this.nowWidth = this.width
71
+ }
72
+ this.inputWidth = this.nowWidth
73
+ },
74
+ methods: {
75
+ doShrink(isShrink) {
76
+ this.isShrink = isShrink
77
+ this.isFull = false // 收缩时,全屏还原
78
+ if (isShrink) {
79
+ this.$emit('update:showType', '2')
80
+ this.nowWidth = '15px'
81
+ } else {//点还原按钮
82
+ this.$emit('update:showType', '1')
83
+ this.nowWidth = this.inputWidth
84
+ }
85
+ },
86
+ doFullScreen(isFull) { // 全屏
87
+ this.isFull = isFull
88
+ this.isShrink = false //
89
+ if (isFull) {
90
+ this.$emit('update:showType', '3')
91
+ this.nowWidth = "100%"
92
+ } else {
93
+ this.$emit('update:showType', '1')
94
+ this.nowWidth = this.inputWidth
95
+ }
96
+ },
97
+ mousedown: function (event) {
98
+ this.$set(this.$store.state, 'hotKey', "-1") //避免热键样式影响体验
99
+ this.dragFrom = event.x
100
+ this.$refs.moveline.style.left = this.dragFrom + "px"
101
+ document.documentElement.addEventListener('mousemove', this.handleMove, true)
102
+ document.documentElement.addEventListener('mouseup', this.handleMouseup, true)
103
+ },
104
+ handleMove: function (event) {
105
+ this.$refs.moveline.style.left = event.x + "px"
106
+ },
107
+ handleMouseup: function (event) {
108
+ document.documentElement.removeEventListener('mousemove', this.handleMove, true)
109
+ document.documentElement.removeEventListener('mouseup', this.handleMouseup, true)
110
+ let newWidth = this.$refs.aside.$el.offsetWidth + event.x - this.dragFrom
111
+ this.nowWidth = newWidth + 'px';
112
+ this.dragFrom = null
113
+ this.$set(this.$store.state, 'hotKey', null) //避免热键样式影响体验
114
+ if (newWidth <= 100) { // 少于一定宽度自动收缩
115
+ this.doShrink(true)
116
+ }
117
+ if (newWidth >= 150) { // 少于一定宽度自动收缩
118
+ this.isShrink = false
119
+ }
120
+ },
121
+ },
122
+ watch: {
123
+ // 如果 `activeName` 发生改变,这个函数就会运行
124
+ showType: {
125
+ immediate: true,
126
+ handler:
127
+ function (newVal) {
128
+ this.$nextTick(() => {
129
+ if (newVal == '1') { // 第一次显示查询,以后不查询
130
+ this.doShrink(false)
131
+ } else if (newVal == '2') { // 第一次显示查询,以后不查询
132
+ this.doShrink(true)
133
+ } else if (newVal == '3') { // 第一次显示查询,以后不查询
134
+ this.doFullScreen(true)
135
+ }
136
+ })
137
+ }
138
+ },
139
+ nowWidth(val) {
140
+ this.$emit('update:width', val);
141
+ },
142
+ width(val) {
143
+ this.nowWidth = val
144
+ }
145
+ }
146
+ }
147
+
148
+ </script>
149
+ <style rel="stylesheet/scss" lang="scss" scoped>
150
+ .hdAside {
151
+ display: flex;
152
+ flex-direction: column;
153
+ flex: 1;
154
+ }
155
+
156
+ .asideDrag {
157
+ width: 5px;
158
+ height: 100%;
159
+ overflow: hidden;
160
+ cursor: ew-resize;
161
+ user-select: none;
162
+ }
163
+
164
+ .moveline {
165
+ width: 5px;
166
+ height: 100%;
167
+ overflow: hidden;
168
+ position: fixed;
169
+ cursor: ew-resize;
170
+ background-color: red;
171
+ z-index: 9999;
172
+ user-select: none;
173
+ }
174
+
175
+ .dragShowCls {
176
+ background-color: #409EFF;
177
+ }
178
+ </style>
@@ -0,0 +1,113 @@
1
+ <template>
2
+ <el-tooltip
3
+ v-if="btnRight"
4
+ ref="hdbtn"
5
+ :content="$t(hint+addTextProp)"
6
+ :hide-after="2"
7
+ :enterable="true"
8
+ :open-delay="500"
9
+ placement="bottom"
10
+ effect="light"
11
+ transition="">
12
+ <i :class="'hdBtn '+icon" @click="handleClick">
13
+ <slot v-if="!icon"/>
14
+ <hd-hot-key v-if="nowKeyMap" :hot-key-range="hotKeyRange" :key-map="nowKeyMap" @do="click('hotkey')"/>
15
+ </i>
16
+
17
+ </el-tooltip>
18
+ </template>
19
+
20
+ <script>
21
+ import BtnRight from './BtnRight'
22
+ /**
23
+ * 通常为列表内用的按钮图标
24
+ * @module HdBtn
25
+ */
26
+ export default {
27
+ name: 'HdBtn',
28
+ mixins: [BtnRight],
29
+ /**
30
+ * Props slot或者icon方式传入图标
31
+ * @prop {String} icon svgicon的名称,或者以slot形式传入
32
+ * @prop {String} hint 图标提示文字
33
+ * @prop {String} vid 按钮授权时,必须指定按钮id
34
+ */
35
+ /* props: ['icon', 'hint', 'vid'],*/
36
+ props: {
37
+ noRoleManage: Boolean, // 设置不受角色控制
38
+ keyMap: Array,
39
+ keyType: String,
40
+ hotKeyRange: { type: String, default: 'hd-com-grid' },
41
+ icon: String, // svgicon的名称,或者以slot形式传入
42
+ hint: String, // hint 图标提示文字
43
+ vid: String // 按钮指定id时,授权用不指定默认生成
44
+ },
45
+ data() {
46
+ return {}
47
+ },
48
+ computed: {
49
+ addTextProp() {
50
+ let append = ''
51
+ if (this.$store.getters.isSuperAdmin && this.vid) {
52
+ append = '[' + this.vid + ']'
53
+ }
54
+
55
+ if (this.nowKeyMap && this.nowKeyMap.length == 2) {
56
+ return '(' + this.nowKeyMap[1].toUpperCase() + ')' + append
57
+ }
58
+ return '' + append
59
+ },
60
+ nowKeyMap() {
61
+ if (this.keyMap) {
62
+ return this.keyMap
63
+ } else if (this.keyType && this.$keyMap) { // $keyMap是在keymap.js配置的对象
64
+ return this.$keyMap[this.keyType]
65
+ }
66
+ }
67
+ },
68
+ created() { // 列表内循环,数量无法控制,需要手工加入
69
+ if (!this.noRoleManage) {
70
+ if (this.$route && this.$route.meta.btnRoleCheck) { // 角色管理下激活
71
+ this.addBtnMetaToParent()
72
+ }
73
+ }
74
+ },
75
+ mounted() {
76
+ this.$nextTick(() => {
77
+ if (this.$refs.hdbtn && this.$refs.hdbtn.referenceElm) { this.$refs.hdbtn.referenceElm.setAttribute('tabindex', -1) }
78
+ })
79
+ this.checkRight()
80
+ },
81
+ methods: {
82
+ getName() {
83
+ const parentName = this.$parent.$parent.$options.name
84
+ if (parentName == 'ElTable') {
85
+ return '[表格]_' + this.hint
86
+ }
87
+ return this.hint
88
+ },
89
+ getClass() {
90
+ return 'hdBtn ' + this.icon
91
+ },
92
+ getType() {
93
+ return 'hdBtn'
94
+ },
95
+ handleClick(evt) {
96
+ this.$emit('click', evt)
97
+ },
98
+ handleTooltipClick() {
99
+ },
100
+ click(evt) {
101
+ if (this.$attrs.disabled === undefined || this.$attrs.disabled === false) {
102
+ this.handleClick(evt)
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ </script>
109
+ <style rel="stylesheet/scss" lang="scss">
110
+ .hdBtn {
111
+ cursor: pointer;
112
+ }
113
+ </style>
@@ -0,0 +1,137 @@
1
+ <template>
2
+ <ExButton ref="elbtn"
3
+ v-bind="$attrs" v-if="btnRight" v-on="$listeners" :class="buttonClass">
4
+ {{nowText()}}
5
+ <hd-hot-key :hotKeyRange="hotKeyRange" :keyMap="nowKeyMap" @do="click('hotkey')" v-if="nowKeyMap"></hd-hot-key>
6
+ </ExButton>
7
+ </template>
8
+
9
+ <script>
10
+ import BtnRight from './BtnRight'
11
+
12
+ /**
13
+ * 继承之 ElButton 直接用ElButton
14
+ * HdButton和HdBtn覆写是为了进行按钮权限,校验形式:(name_按钮文字),没有name也行,但是如果一个菜单下多个同名按钮要分别控制就需要加name
15
+ * @module HdButton
16
+ */
17
+ export default {
18
+ name: 'HdButton',
19
+ mixins: [BtnRight],
20
+ data() {
21
+ return {
22
+ classmap: [
23
+ {name: "增加", value: "hd-bn bn-add"},
24
+ {name: "新增", value: "hd-bn bn-add"},
25
+ {name: "删除", value: "hd-bn bn-del"},
26
+ {name: "保存", value: "hd-bn bn-save"},
27
+ {name: "搜索", value: "hd-bn bn-search"},
28
+ {name: "查询", value: "hd-bn bn-search"},
29
+ {name: "复制", value: "hd-bn bn-copy"},
30
+ {name: "粘贴", value: "hd-bn bn-paste"},
31
+ {name: "作废", value: "hd-bn bn-docdel"},
32
+ {name: "新建文件夹", value: "hd-bn bn-folde"},
33
+ {name: "上传", value: "hd-bn bn-upload"},
34
+ {name: "下载", value: "hd-bn bn-download"},
35
+ {name: "切换查看模式", value: "hd-bn bn-sort"},
36
+ {name: "发起", value: "hd-bn bn-start"},
37
+ {name: "刷新", value: "hd-bn bn-refresh"},
38
+ {name: "导入", value: "hd-bn bn-import"},
39
+ {name: "设置", value: "hd-bn bn-setting"},
40
+ {name: "更新", value: "hd-bn bn-renew"},
41
+ {name: "选择", value: "hd-bn bn-selected"},
42
+ {name: "读取", value: "hd-bn bn-finished"},
43
+ {name: "预览", value: "hd-bn bn-view"},
44
+ {name: "生成", value: "hd-bn bn-create"},
45
+ {name: "确定", value: "hd-bn bn-fix"},
46
+ {name: "取消", value: "hd-bn bn-cancel"}]
47
+ }
48
+ },
49
+ inheritAttrs: false,
50
+ /**
51
+ * Props 继承ElButton的属性和事件
52
+ * @prop {Boolean} noRoleManage 设置是否按钮授权时,该按钮被扫描到
53
+ * @prop {Array} keyMap 绑定快捷键
54
+ * @prop {String} keyType 绑定快捷键类型,keyType='del'可在keymap.js中修改匹配,keyMap有值时,此无效
55
+ * @prop {String} hotKeyRange 快捷键的鼠标有效区域
56
+ * @prop {String} vid 按钮授权时,按钮id,此处可以不指定会根据页面名_title生成
57
+ */
58
+ props: {
59
+ noRoleManage: Boolean, // 设置不受角色控制
60
+ keyMap: Array,
61
+ keyType: String,
62
+ hotKeyRange: {type: String, default: 'hd-com-grid'},
63
+ vid: String, // 按钮指定id时,授权用不指定默认生成
64
+ customClass : {
65
+ type: String
66
+ }
67
+ },
68
+
69
+ components: {},
70
+ created() {
71
+ if (!this.noRoleManage) {
72
+ if (this.$route && this.$route.meta.btnRoleCheck) { // 角色管理下激活
73
+ this.addBtnMetaToParent()
74
+ }
75
+ }
76
+ },
77
+ mounted() {
78
+ this.checkRight()
79
+ },
80
+
81
+ computed: {
82
+ addTextProp() {
83
+ if (this.nowKeyMap && this.nowKeyMap.length == 2) {
84
+ return '(' + this.nowKeyMap[1].toUpperCase() + ')'
85
+ }
86
+ return ''
87
+ },
88
+ nowKeyMap() {
89
+ if (this.keyMap) {
90
+ return this.keyMap
91
+ } else if (this.keyType && this.$keyMap) {//$keyMap是在keymap.js配置的对象
92
+ return this.$keyMap[this.keyType]
93
+ }
94
+ },
95
+ buttonClass() {
96
+ let classObj = this.classmap.find(v => v.name == this.$slots.default[0].text.replace(/\s/g, ""));
97
+ // console.log(this.$slots.default[0].text.replace(/\s/g,""), classObj, 'buttonClass')
98
+ // console.log(this.customClass)
99
+ return classObj ? `${classObj.value} ${this.customClass}` : `hd-bn bn-finished ${this.customClass}`;
100
+ }
101
+ },
102
+ methods: {
103
+ nowText() {
104
+ if (!this.$slots.default || this.$slots.default.length == 0) {
105
+ return ''
106
+ }
107
+ if (this.$i18n) { // 国际化
108
+ //去掉2边空格
109
+ return this.$t(this.$slots.default[0].text.replace(/(^\s*)|(\s*$)/g, "")) + this.addTextProp
110
+ } else {
111
+ return this.$slots.default[0].text + this.addTextProp
112
+ }
113
+ },
114
+ addText(text) { // 快捷键自动增加(a)等
115
+ this.addTextProp = text
116
+ },
117
+ getName() {
118
+ if (!this.$slots.default || this.$slots.default.length == 0) {
119
+ return ''
120
+ }
121
+ return this.$slots.default[0].text.trim()
122
+ },
123
+ getClass(){
124
+ return this.buttonClass
125
+ },
126
+ getType(){
127
+ return 'hdButton'
128
+ },
129
+ click(evt) {
130
+ if (this.$attrs.disabled === undefined || this.$attrs.disabled === false) {
131
+ this.$refs.elbtn.handleClick(evt)
132
+ }
133
+ }
134
+ }
135
+ }
136
+
137
+ </script>