hd-idevvue3 3.0.0 → 3.0.2

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 (230) hide show
  1. package/.env.development +5 -0
  2. package/.env.production +5 -0
  3. package/README.md +22 -191
  4. package/dist/assets/index.774ef40e.css +1 -0
  5. package/dist/hd-idevvue3.mjs +45697 -0
  6. package/dist/hd-idevvue3.umd.js +153 -0
  7. package/index.html +1 -0
  8. package/npminstall-debug.log +10 -2
  9. package/package.json +35 -40
  10. package/pnpm-lock.yaml +2631 -0
  11. package/src/App.vue +15 -0
  12. package/src/assets/sound/notify.wav +0 -0
  13. package/src/demo/demo.vue +43 -0
  14. package/src/demo/dropdemo.vue +43 -0
  15. package/src/demo/extsets.vue +107 -0
  16. package/src/demo/formedit.vue +145 -0
  17. package/src/demo/hightquery.vue +169 -0
  18. package/src/demo/inlineedit.vue +88 -0
  19. package/src/demo/selfdrop.vue +41 -0
  20. package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +2 -0
  21. package/src/directive/el-dragDialog/drag.js +124 -0
  22. package/src/directive/el-dragDialog/index.js +13 -0
  23. package/src/errorLog.js +16 -0
  24. package/src/hdcom/BigGrid.js +173 -0
  25. package/src/hdcom/BillShow.vue +90 -0
  26. package/src/hdcom/BillUpload.vue +253 -0
  27. package/src/hdcom/BtnRight.vue +98 -0
  28. package/src/hdcom/ErrHint.vue +30 -0
  29. package/src/hdcom/ExtendColumn.vue +108 -0
  30. package/src/hdcom/ExtendCommon.js +29 -0
  31. package/src/hdcom/ExtendForm.vue +114 -0
  32. package/src/hdcom/FacePicUpload.vue +71 -0
  33. package/src/hdcom/FaceRecTest.vue +104 -0
  34. package/src/hdcom/GridChart.vue +194 -0
  35. package/src/hdcom/GridExField.vue +281 -0
  36. package/src/hdcom/GridShow.vue +238 -0
  37. package/src/hdcom/HdAside.vue +178 -0
  38. package/src/hdcom/HdBtn.vue +113 -0
  39. package/src/hdcom/HdButton.vue +137 -0
  40. package/src/hdcom/HdComFaceRec.vue +58 -0
  41. package/src/hdcom/HdComGrid.vue +776 -0
  42. package/src/hdcom/HdComQuery.vue +273 -0
  43. package/src/hdcom/HdComQueryDetail.vue +161 -0
  44. package/src/hdcom/HdComSortDetail.vue +155 -0
  45. package/src/hdcom/HdDatePicker.vue +78 -0
  46. package/src/hdcom/HdDialog.vue +63 -0
  47. package/src/hdcom/HdDrop.vue +163 -0
  48. package/src/hdcom/HdFileUpload.vue +148 -0
  49. package/src/hdcom/HdFilterBox.vue +90 -0
  50. package/src/hdcom/HdFooter.vue +149 -0
  51. package/src/hdcom/HdForm.vue +278 -0
  52. package/src/hdcom/HdFormBtn.vue +89 -0
  53. package/src/hdcom/HdFormItem.vue +35 -0
  54. package/src/hdcom/HdGctosGrid +0 -0
  55. package/src/hdcom/HdGrid.vue +825 -0
  56. package/src/hdcom/HdGridEditBtn.vue +44 -0
  57. package/src/hdcom/HdGridExt.js +219 -0
  58. package/src/hdcom/HdGridSel.vue +223 -0
  59. package/src/hdcom/HdHeader.vue +148 -0
  60. package/src/hdcom/HdHotKey.vue +81 -0
  61. package/src/hdcom/HdInputHint.vue +49 -0
  62. package/src/hdcom/HdMain.vue +43 -0
  63. package/src/hdcom/HdMessage.vue +192 -0
  64. package/src/hdcom/HdNum.vue +69 -0
  65. package/src/hdcom/HdPopSel.vue +58 -0
  66. package/src/hdcom/HdRightMenu.vue +61 -0
  67. package/src/hdcom/HdSel/SelGridFieldcod.vue +36 -0
  68. package/src/hdcom/HdTableColumn.vue +334 -0
  69. package/src/hdcom/HdTempSave.vue +140 -0
  70. package/src/hdcom/HdTree.vue +86 -0
  71. package/src/hdcom/HdTreeTable/eval.js +34 -0
  72. package/src/hdcom/HdTreeTable/index.vue +174 -0
  73. package/src/hdcom/ImportExcel.vue +143 -0
  74. package/src/hdcom/index.js +80 -0
  75. package/src/idev.common.js +72 -0
  76. package/src/index.js +14 -0
  77. package/src/utils/HdQuery.js +54 -0
  78. package/src/utils/comutils.js +98 -0
  79. package/src/utils/utils.js +105 -0
  80. package/src/vendor/Blob.js +179 -0
  81. package/src/vendor/Export2Excel.js +220 -0
  82. package/src/vendor/Export2Zip.js +22 -0
  83. package/src/views/layout/AppMain.vue +32 -0
  84. package/src/views/layout/HdLayout.vue +78 -0
  85. package/src/views/layout/header/ElasticSearch.vue +225 -0
  86. package/src/views/layout/header/HZRecorder.js +231 -0
  87. package/src/views/layout/header/HeaderSearch.vue +198 -0
  88. package/src/views/layout/header/Levelbar.vue +49 -0
  89. package/src/views/layout/header/MainHeader.vue +271 -0
  90. package/src/views/layout/header/Navbar.vue +105 -0
  91. package/src/views/layout/header/ScrollPane.vue +81 -0
  92. package/src/views/layout/header/TagsView.vue +210 -0
  93. package/src/views/layout/header/VocRec.vue +97 -0
  94. package/src/views/layout/header/changepswform.vue +96 -0
  95. package/src/views/layout/index.js +12 -0
  96. package/src/views/layout/menu/Hamburger.vue +45 -0
  97. package/src/views/layout/menu/HdMenu.vue +167 -0
  98. package/src/views/layout/menu/css/menu.css +288 -0
  99. package/src/views/layout/menu/index.vue +25 -0
  100. package/src/views/privilege/commsg/commsg.vue +78 -0
  101. package/src/views/privilege/commsg/commsgOrgn.vue +42 -0
  102. package/src/views/privilege/commsg/commsgRole.vue +149 -0
  103. package/src/views/privilege/commsg/commsgform.vue +160 -0
  104. package/src/views/privilege/commsg/commsgiframe.vue +33 -0
  105. package/src/views/privilege/commsg/commsgto.vue +120 -0
  106. package/src/views/privilege/commsg/commsgtoform.vue +108 -0
  107. package/src/views/privilege/commsg/commsgtrans.vue +155 -0
  108. package/src/views/privilege/exfield/comexcolumn.vue +71 -0
  109. package/src/views/privilege/exfield/comexcolumnform.vue +101 -0
  110. package/src/views/privilege/exfield/comexfield.vue +31 -0
  111. package/src/views/privilege/exfield/comexfieldform.vue +94 -0
  112. package/src/views/privilege/exfield/comexfieldsub.vue +72 -0
  113. package/src/views/privilege/index.js +42 -0
  114. package/src/views/privilege/menu/comMenu.vue +41 -0
  115. package/src/views/privilege/menu/menu.vue +133 -0
  116. package/src/views/privilege/menu/menuinfo.vue +56 -0
  117. package/src/views/privilege/menu/rolelist.vue +47 -0
  118. package/src/views/privilege/menu/userlist.vue +49 -0
  119. package/src/views/privilege/mobile/authmobileupdate.vue +69 -0
  120. package/src/views/privilege/mobile/authmobileupdateform.vue +90 -0
  121. package/src/views/privilege/orgDept/authOrgn.vue +96 -0
  122. package/src/views/privilege/orgDept/authorgnform.vue +145 -0
  123. package/src/views/privilege/orgDept/orgDept.vue +37 -0
  124. package/src/views/privilege/orgDept/orgTree.vue +88 -0
  125. package/src/views/privilege/orgDept/orgnselect.vue +134 -0
  126. package/src/views/privilege/personDept/authuser.vue +123 -0
  127. package/src/views/privilege/personDept/authuserform.vue +154 -0
  128. package/src/views/privilege/personDept/facerec.vue +117 -0
  129. package/src/views/privilege/personDept/orgncascader.vue +125 -0
  130. package/src/views/privilege/personDept/personDept.vue +31 -0
  131. package/src/views/privilege/quartz/comquartzjob.vue +65 -0
  132. package/src/views/privilege/quartz/comquartzjobform.vue +99 -0
  133. package/src/views/privilege/quartz/comquartzlog.vue +59 -0
  134. package/src/views/privilege/role/btnRole.vue +117 -0
  135. package/src/views/privilege/role/menuRole.vue +64 -0
  136. package/src/views/privilege/role/orgnRole.vue +56 -0
  137. package/src/views/privilege/role/role.vue +67 -0
  138. package/src/views/privilege/role/rolelist.vue +67 -0
  139. package/src/views/privilege/role/roleselect.vue +57 -0
  140. package/src/views/privilege/search/comsearch.vue +105 -0
  141. package/src/views/privilege/search/menu.vue +52 -0
  142. package/src/views/privilege/syscode/syscode.vue +103 -0
  143. package/src/views/privilege/syscode/sysfield.vue +66 -0
  144. package/src/views/privilege/syscode/sysfieldframe.vue +30 -0
  145. package/src/views/privilege/syslog/menulog.vue +52 -0
  146. package/src/views/privilege/syslog/syslog.vue +115 -0
  147. package/src/views/privilege/syslog/syslogconfig.vue +61 -0
  148. package/src/views/privilege/syslog/syslogform.vue +83 -0
  149. package/src/views/privilege/syslog/syslogframe.vue +26 -0
  150. package/src/views/privilege/userRole/userRole.vue +122 -0
  151. package/src/views/privilege.zip +0 -0
  152. package/vite.config.js +93 -0
  153. package/.babelrc +0 -17
  154. package/.editorconfig +0 -14
  155. package/.eslintignore +0 -3
  156. package/.npminstall.done +0 -1
  157. package/.postcssrc.js +0 -8
  158. package/LICENSE +0 -21
  159. package/Listening +0 -28
  160. package/build/build.js +0 -70
  161. package/build/check-versions.js +0 -45
  162. package/build/config.js +0 -81
  163. package/build/dev-client.js +0 -9
  164. package/build/dev-server.js +0 -93
  165. package/build/utils.js +0 -78
  166. package/build/vue-loader.conf.js +0 -12
  167. package/build/webpack.common.js +0 -37
  168. package/build/webpack.component.js +0 -36
  169. package/build/webpack.prod.conf.js +0 -38
  170. package/components.json +0 -8
  171. package/conf.js +0 -42
  172. package/config/dev.env.js +0 -6
  173. package/config/index.js +0 -43
  174. package/config/prod.env.js +0 -6
  175. package/config/sit.env.js +0 -6
  176. package/favicon.ico +0 -0
  177. package/jsdoc-vue.js +0 -12
  178. package/lib/0.index.js +0 -12573
  179. package/lib/1.index.js +0 -6
  180. package/lib/2.index.js +0 -2
  181. package/lib/idev.common.js +0 -1
  182. package/lib/idv8.common.js +0 -1
  183. package/lib/index.js +0 -49170
  184. package/lib/js/ErrHint.js +0 -1
  185. package/lib/js/HdAside.js +0 -1
  186. package/lib/js/HdBtn.js +0 -1
  187. package/lib/js/HdButton.js +0 -1
  188. package/lib/js/HdComFaceRec.js +0 -1
  189. package/lib/js/HdComGrid.js +0 -1
  190. package/lib/js/HdDatePicker.js +0 -1
  191. package/lib/js/HdDialog.js +0 -1
  192. package/lib/js/HdDrop.js +0 -1
  193. package/lib/js/HdFileUpload.js +0 -1
  194. package/lib/js/HdFooter.js +0 -1
  195. package/lib/js/HdForm.js +0 -1
  196. package/lib/js/HdFormBtn.js +0 -1
  197. package/lib/js/HdFormItem.js +0 -1
  198. package/lib/js/HdGrid.js +0 -1
  199. package/lib/js/HdGridEditBtn.js +0 -1
  200. package/lib/js/HdGridSel.js +0 -1
  201. package/lib/js/HdHeader.js +0 -1
  202. package/lib/js/HdHotkey.js +0 -1
  203. package/lib/js/HdLayout.js +0 -1
  204. package/lib/js/HdMain.js +0 -1
  205. package/lib/js/HdMessage.js +0 -1
  206. package/lib/js/HdNum.js +0 -1
  207. package/lib/js/HdPopSel.js +0 -1
  208. package/lib/js/HdSearch.js +0 -1
  209. package/lib/js/HdTableColumn.js +0 -1
  210. package/lib/js/HdTempSave.js +0 -1
  211. package/lib/js/HdTree.js +0 -1
  212. package/lib/js/HdTreeTable.js +0 -1
  213. package/lib/js/authmobileupdate.js +0 -1
  214. package/lib/js/comexfield.js +0 -1
  215. package/lib/js/commsg.js +0 -1
  216. package/lib/js/commsgto.js +0 -1
  217. package/lib/js/comquartzjob.js +0 -1
  218. package/lib/js/comquartzlog.js +0 -1
  219. package/lib/js/comsearch.js +0 -1
  220. package/lib/js/menu.js +0 -1
  221. package/lib/js/menuinfo.js +0 -1
  222. package/lib/js/orgDept.js +0 -1
  223. package/lib/js/orgTree.js +0 -1
  224. package/lib/js/personDept.js +0 -1
  225. package/lib/js/role.js +0 -1
  226. package/lib/js/sysfieldframe.js +0 -1
  227. package/lib/js/syslog.js +0 -1
  228. package/lib/js/syslogframe.js +0 -1
  229. package/lib/js/userRole.js +0 -1
  230. package/ytgvue.rar +0 -0
@@ -0,0 +1,174 @@
1
+ <template>
2
+ <el-table :data="formatData" :row-style="showRow" v-bind="$attrs">
3
+ <el-table-column v-if="columns.length===0" width="150">
4
+ <template slot-scope="scope">
5
+ <span v-for="space in scope.row._level" class="ms-tree-space" :key="space"></span>
6
+ <span class="tree-ctrl" v-if="iconShow(0,scope.row)" @click="toggleExpanded(scope.$index)">
7
+ <i v-if="!scope.row._expanded" class="el-icon-plus"></i>
8
+ <i v-else class="el-icon-minus"></i>
9
+ </span>
10
+ {{scope.$index}}
11
+ </template>
12
+ </el-table-column>
13
+ <el-table-column v-else v-for="(column, index) in columns" :key="column.value" :label="column.text" :width="column.width">
14
+ <template slot-scope="scope">
15
+ <span v-if="index === 0" v-for="space in scope.row._level" class="ms-tree-space" :key="space"></span>
16
+ <span class="tree-ctrl" v-if="iconShow(index,scope.row)" @click="toggleExpanded(scope.$index)">
17
+ <i v-if="!scope.row._expanded" class="el-icon-plus"></i>
18
+ <i v-else class="el-icon-minus"></i>
19
+ </span>
20
+ {{scope.row[column.value]}}
21
+ </template>
22
+ </el-table-column>
23
+ <slot></slot>
24
+ </el-table>
25
+ </template>
26
+
27
+ <script>
28
+ /**
29
+ Auth: Lei.j1ang
30
+ Created: 2018/1/19-13:59
31
+ */
32
+ import treeToArray from './eval'
33
+ export default {
34
+ name: 'treeTable',
35
+ props: {
36
+ data: {
37
+ type: [Array, Object],
38
+ required: true
39
+ },
40
+ columns: {
41
+ type: Array,
42
+ default: () => []
43
+ },
44
+ evalFunc: Function,
45
+ evalArgs: Array,
46
+ expandAll: {
47
+ type: Boolean,
48
+ default: false
49
+ }
50
+ },
51
+ computed: {
52
+ // 格式化数据源
53
+ formatData: function() {
54
+ let tmp
55
+ if (!Array.isArray(this.data)) {
56
+ tmp = [this.data]
57
+ } else {
58
+ tmp = this.data
59
+ }
60
+ const func = this.evalFunc || treeToArray
61
+ const args = this.evalArgs ? Array.concat([tmp, this.expandAll], this.evalArgs) : [tmp, this.expandAll]
62
+ return func.apply(null, args)
63
+ }
64
+ },
65
+ methods: {
66
+ showRow: function(row) {
67
+ const show = (row.row.parent ? (row.row.parent._expanded && row.row.parent._show) : true)
68
+ row.row._show = show
69
+ return show ? 'animation:treeTableShow 1s;-webkit-animation:treeTableShow 1s;' : 'display:none;'
70
+ },
71
+ // 切换下级是否展开
72
+ toggleExpanded: function(trIndex) {
73
+ const record = this.formatData[trIndex]
74
+ record._expanded = !record._expanded
75
+ },
76
+ // 图标显示
77
+ iconShow(index, record) {
78
+ return (index === 0 && record.children && record.children.length > 0)
79
+ }
80
+ }
81
+ }
82
+ </script>
83
+ <style rel="stylesheet/css">
84
+ @keyframes treeTableShow {
85
+ from {opacity: 0;}
86
+ to {opacity: 1;}
87
+ }
88
+ @-webkit-keyframes treeTableShow {
89
+ from {opacity: 0;}
90
+ to {opacity: 1;}
91
+ }
92
+ </style>
93
+
94
+ <style lang="scss" rel="stylesheet/scss" scoped>
95
+ $color-blue: #2196F3;
96
+ $space-width: 8px;
97
+ .ms-tree-space {
98
+ position: relative;
99
+ top: 1px;
100
+ display: inline-block;
101
+ font-style: normal;
102
+ font-weight: 400;
103
+ line-height: 1;
104
+ width: $space-width;
105
+ height: 14px;
106
+ &::before {
107
+ content: ""
108
+ }
109
+ }
110
+ .processContainer{
111
+ width: 100%;
112
+ height: 100%;
113
+ }
114
+ table td {
115
+ line-height: 26px;
116
+ }
117
+ .tree-ctrl{
118
+ position: relative;
119
+ cursor: pointer;
120
+ color: $color-blue;
121
+ margin-left: -$space-width;
122
+ }
123
+ .el-table {
124
+ height: 100%;
125
+ width: 100%;
126
+ flex: 1;
127
+ .el-table__body-wrapper {
128
+ width: 100%;
129
+ }
130
+ .el-table__header-wrapper th { //列表标题
131
+ background-color: #f6f6f6;
132
+ }
133
+
134
+ .el-table__fixed-header-wrapper th { //固定的列表标题
135
+ background-color: #f6f6f6;
136
+ }
137
+ td, th { //列表标题及内容
138
+ padding: 1px 0;
139
+ }
140
+ .cell, .el-table th div, .el-table--border th:first-child .cell, .el-table--border td:first-child .cell { //列表的margin
141
+ padding-left: 5px !important;
142
+ padding-right: 1px !important;
143
+ padding-top:1.5px !important;
144
+ padding-bottom: 1.5px !important;
145
+ }
146
+ .el-table__empty-block {
147
+ position: static;
148
+ text-align: center;
149
+ width: 100%;
150
+ height: 80%
151
+ }
152
+ .el-table__body { //列表下面加了空白
153
+ margin-bottom: 10px;
154
+ }
155
+ .el-table__body-wrapper {
156
+ height: 100%;
157
+ overflow-y: auto;
158
+ }
159
+ .el-input__inner {
160
+ height: 27px;
161
+ margin-bottom: 0px;
162
+ }
163
+ .el-input, .el-form-item__content, .el-form-item__label, .el-input__icon {
164
+ line-height: 30px;
165
+ }
166
+ .el-input__inner {
167
+ padding: 5px;
168
+ }
169
+ .el-input--prefix .el-input__inner { //日期的有logo不一样
170
+ padding-left: 30px;
171
+ }
172
+
173
+ }
174
+ </style>
@@ -0,0 +1,143 @@
1
+ <template>
2
+ <el-dialog title="Excel上传" :visible.sync="visible" width='65%' top="10vh">
3
+ <input id="excel-upload-input" ref="excel-upload-input" type="file" accept=".xlsx, .xls" class="c-hide"
4
+ @change="handkeFileChange">
5
+ <div class="excelSel" @drop="handleDrop" @dragover="handleDragover" @dragenter="handleDragover">
6
+ {{$t('Excel导入,需要以导出的Excel为模板')}}<br/>
7
+ {{$t('Excel文件拖动到或点击按钮上传')}}
8
+ <el-button style="margin-left:16px;" type="primary" @click="handleUpload">{{$t('浏览')}}</el-button>
9
+ </div>
10
+ <el-dialog title="sheet选择" :visible.sync="sheetVisible" width='55%' top="15vh">
11
+ <div style="margin: 10px">{{$t('发现excel中存在多个sheet,请选择一个')}}</div>
12
+ <el-radio-group v-model="selSheet">
13
+ <el-radio v-for="(name,index) in allSheet" :label="name" :key="index">{{name}}</el-radio>
14
+ </el-radio-group>
15
+ <el-button style="margin-left:16px;" type="primary" @click="sheetSure">{{$t('确定')}}</el-button>
16
+ </el-dialog>
17
+ </el-dialog>
18
+ </template>
19
+
20
+ <script>
21
+ import * as XLSX from 'xlsx'
22
+
23
+ export default {
24
+ data() {
25
+ return {
26
+ loading: false,
27
+ excelData: {
28
+ header: null,
29
+ results: null
30
+ },
31
+ visible: false,
32
+ allSheet: [],
33
+ selSheet: '',
34
+ workbook: null,
35
+ sheetVisible: false
36
+ }
37
+ },
38
+ methods: {
39
+ show() {
40
+ this.visible = true
41
+ },
42
+ generateDate({ header, results }) {
43
+ this.excelData.header = header
44
+ this.excelData.results = results
45
+ this.$emit('on-selected-file', this.excelData)
46
+ },
47
+ handleDrop(e) {
48
+ e.stopPropagation()
49
+ e.preventDefault()
50
+ const files = e.dataTransfer.files
51
+ if (files.length !== 1) {
52
+ this.$message.error(this.$t('只支持单文件!'))
53
+ return
54
+ }
55
+ const itemFile = files[0] // only use files[0]
56
+ this.readerData(itemFile)
57
+ e.stopPropagation()
58
+ e.preventDefault()
59
+ },
60
+ handleDragover(e) {
61
+ e.stopPropagation()
62
+ e.preventDefault()
63
+ e.dataTransfer.dropEffect = 'copy'
64
+ },
65
+ handleUpload() {
66
+ document.getElementById('excel-upload-input').click()
67
+ },
68
+ handkeFileChange(e) {
69
+ const files = e.target.files
70
+ const itemFile = files[0] // only use files[0]
71
+ if (!itemFile) return
72
+ this.readerData(itemFile)
73
+ this.$refs['excel-upload-input'].value = null // fix can't select the same excel
74
+ },
75
+ readerData(itemFile) {
76
+ const reader = new FileReader()
77
+ reader.onload = e => {
78
+ const data = e.target.result
79
+ const fixedData = this.fixdata(data)
80
+ this.workbook = XLSX.read(btoa(fixedData), { type: 'base64' })
81
+ this.allSheet = this.workbook.SheetNames
82
+ this.selSheet = this.workbook.SheetNames[0]
83
+ if (this.allSheet.length == 1) {
84
+ this.sheetSure()
85
+ } else {
86
+ this.sheetVisible = true
87
+ }
88
+ }
89
+ reader.readAsArrayBuffer(itemFile)
90
+ },
91
+ sheetSure() {
92
+ // this.sheetVisible = false
93
+ const worksheet = this.workbook.Sheets[this.selSheet]
94
+ const header = this.get_header_row(worksheet)
95
+ const results = XLSX.utils.sheet_to_json(worksheet)
96
+ this.generateDate({ header, results })
97
+ },
98
+ fixdata(data) {
99
+ let o = ''
100
+ let l = 0
101
+ const w = 10240
102
+ for (; l < data.byteLength / w; ++l) o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w, l * w + w)))
103
+ o += String.fromCharCode.apply(null, new Uint8Array(data.slice(l * w)))
104
+ return o
105
+ },
106
+ get_header_row(sheet) {
107
+ const headers = []
108
+ const range = XLSX.utils.decode_range(sheet['!ref'])
109
+ let C
110
+ const R = range.s.r
111
+ /* start in the first row */
112
+ for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */
113
+ var cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
114
+ /* find the cell in the first row */
115
+ var hdr = 'UNKNOWN ' + C // <-- replace with your desired default
116
+ if (cell && cell.t) hdr = XLSX.utils.format_cell(cell)
117
+ headers.push(hdr)
118
+ }
119
+ return headers
120
+ }
121
+ }
122
+ }
123
+ </script>
124
+
125
+ <style scoped>
126
+ #excel-upload-input {
127
+ display: none;
128
+ z-index: -9999;
129
+ }
130
+
131
+ .excelSel {
132
+ border: 2px dashed #bbb;
133
+ width: 600px;
134
+ height: 160px;
135
+ line-height: 80px;
136
+ margin: 0 auto;
137
+ font-size: 24px;
138
+ border-radius: 5px;
139
+ text-align: center;
140
+ color: #bbb;
141
+ position: relative;
142
+ }
143
+ </style>
@@ -0,0 +1,80 @@
1
+ import HdDrop from './HdDrop'
2
+ import HdGrid from './HdGrid'
3
+ import HdBtn from './HdBtn'
4
+ import HdButton from './HdButton'
5
+ import HdNum from './HdNum'
6
+ import HdDatePicker from './HdDatePicker'
7
+ import HdTreeTable from './HdTreeTable/index.vue'
8
+ import HdDialog from './HdDialog'
9
+ import HdAside from './HdAside.vue'
10
+ import HdFooter from './HdFooter'
11
+ import HdHeader from './HdHeader'
12
+ import HdMain from './HdMain'
13
+ import HdTree from './HdTree'
14
+ import HdPopSel from './HdPopSel'
15
+ import '../utils/utils.js'
16
+ import HdHotkey from './HdHotkey' // 实际为shortkey组件
17
+ import HdComGrid from './HdComGrid'
18
+ import HdForm from './HdForm'
19
+ import HdFormBtn from './HdFormBtn'
20
+ import HdFormItem from './HdFormItem.vue'
21
+ import HdTableColumn from './HdTableColumn.vue'
22
+ import ErrHint from './ErrHint.vue'
23
+ import HdMessage from './HdMessage.vue'
24
+ import HdFileUpload from './HdFileUpload.vue'
25
+ import HdGridSel from './HdGridSel.vue'
26
+ import HdGridEditBtn from './HdGridEditBtn'
27
+ import HdTempSave from './HdTempSave'
28
+ import HdComFaceRec from './HdComFaceRec.vue'
29
+ import HdInputHint from './HdInputHint'
30
+
31
+
32
+
33
+ export default {
34
+ install(Vue) {
35
+ Vue.use(require('vue-shortkey'))
36
+ Vue._window = window
37
+ Vue.component('HdDrop', HdDrop)
38
+ Vue.component('HdGrid', HdGrid)
39
+ Vue.component('HdBtn', HdBtn)
40
+ Vue.component('HdNum', HdNum)
41
+ Vue.component('elTreeTable', HdTreeTable)
42
+ Vue.component('elButton', HdButton) // 替换element ui
43
+ Vue.component('elDialog', HdDialog)
44
+ Vue.component('elAside', HdAside)
45
+ Vue.component('elFooter', HdFooter)
46
+ Vue.component('elHeader', HdHeader)
47
+ Vue.component('elMain', HdMain)
48
+ Vue.component('HdTreeTable', HdTreeTable)
49
+ Vue.component('HdButton', HdButton) // 替换element ui
50
+ Vue.component('HdDialog', HdDialog)
51
+ Vue.component('HdAside', HdAside)
52
+ Vue.component('HdFooter', HdFooter)
53
+ Vue.component('HdHeader', HdHeader)
54
+ Vue.component('HdMain', HdMain)
55
+ Vue.component('HdInputHint', HdInputHint)
56
+
57
+
58
+ // Vue.component('el-popover', HdPopover)
59
+ Vue.component('elFormItem', HdFormItem)
60
+ Vue.component('HdFormItem', HdFormItem)
61
+ Vue.component('HdTree', HdTree)
62
+ Vue.component('HdDatePicker', HdDatePicker)
63
+ Vue.component('HdHotKey', HdHotkey)
64
+ Vue.component('HdComGrid', HdComGrid)
65
+ Vue.component('HdForm', HdForm)
66
+ Vue.component('HdFormBtn', HdFormBtn)
67
+ Vue.component('HdPopSel', HdPopSel)
68
+ Vue.component('elTableColumn', HdTableColumn)
69
+ Vue.component('HdTableColumn', HdTableColumn)
70
+ Vue.component('ErrHint', ErrHint)
71
+ Vue.component('HdMessage', HdMessage)
72
+ Vue.component('HdFileUpload', HdFileUpload)
73
+ Vue.component('HdGridSel', HdGridSel)
74
+ Vue.component('HdGridEditBtn', HdGridEditBtn)
75
+ Vue.component('HdTempSave', HdTempSave)
76
+ Vue.component('HdComFaceRec', HdComFaceRec)
77
+
78
+ }
79
+ }
80
+
@@ -0,0 +1,72 @@
1
+ import hdcom from './hdcom'
2
+ import comutils from './utils/comutils'
3
+
4
+ export default {
5
+
6
+ install(Vue, options, inElement) {
7
+
8
+ try {
9
+ let ver = require('../package.json').version
10
+ console.info('您现在使用的是hd-idevvue2:' + ver)
11
+ } catch (e) {
12
+ }
13
+
14
+ //滚动去掉高亮事件,提升虚拟滚动条性能
15
+ inElement.Table.components.TableBody.methods.handleMouseEnter = function handleMouseEnter(index) {//去掉eltable的hover事件
16
+ if(this.store.states.hoverRow != 'locked') {
17
+ this.store.commit('setHoverRow', index);
18
+ }
19
+ },
20
+ inElement.Table.components.TableBody.methods.handleMouseLeave = function handleMouseLeave(index) {//去掉eltable的hover事件
21
+ if(this.store.states.hoverRow != 'locked') {
22
+ this.store.commit('setHoverRow', null);
23
+ }
24
+ },
25
+ inElement.Table.components.TableBody.methods.getColspanRealWidth = function getColspanRealWidth(columns, colspan, index) {
26
+ if (colspan < 1) {
27
+ return columns[index].realWidth;
28
+ }
29
+ const widthArr = columns.map(({ realWidth }) => realWidth).slice(index, index + colspan);
30
+ return widthArr.reduce((acc, width) => acc + width, 0);
31
+ },
32
+
33
+ inElement.Input.props.clearable = {// clearable默认生效
34
+ type: Boolean,
35
+ default: true
36
+ }
37
+ inElement.Input.props.value = {// 不写会出现undefined
38
+ type: [String, Number],
39
+ default: ''
40
+ }
41
+ //element ui自身组件进行了扩展,如果使用纯原生的可以使用Ex***,或者自己import
42
+ Vue.component('ExFooter', inElement.Footer)
43
+ Vue.component('ExMain', inElement.Main)
44
+ Vue.component('ExAside', inElement.Aside)
45
+ Vue.component('ExHeader', inElement.Header)
46
+ Vue.component('ExDialog', inElement.Dialog) //这里引入,然后HdDialog调用,保证了一个vue对象,zIndex才能正常
47
+ Vue.component('ExFormItem', inElement.FormItem)
48
+ Vue.component('ExFormItem', inElement.FormItem)
49
+ Vue.component('ExButton', inElement.Button)
50
+ Vue.component('ExTableColumn', inElement.TableColumn)
51
+ Vue.component('ExDatePicker', inElement.DatePicker)
52
+ Vue.use(inElement, options)
53
+ Vue.use(comutils)
54
+ Vue.use(hdcom)
55
+ Vue.prototype.$message = function (options) { // 消息默认值
56
+ if (!options.duration) {
57
+ if(options.type=="error") {
58
+ options.duration = 3000
59
+ } else {
60
+ options.duration = 5000
61
+ }
62
+ }
63
+ if (!options.showClose) {
64
+ options.showClose = true
65
+ }
66
+ inElement.Message(options)
67
+ }
68
+ Vue.prototype.$message.closeAll = inElement.Message.closeAll
69
+ Vue.prototype.$message.close = inElement.Message.close
70
+ }
71
+ }
72
+
package/src/index.js ADDED
@@ -0,0 +1,14 @@
1
+
2
+ import common from './idev.common'
3
+ import privilege from './views/privilege'
4
+ import layout from './views/layout'
5
+
6
+ export default {
7
+
8
+ install(Vue, options, inElement) {
9
+ common.install(Vue, options, inElement)
10
+ Vue.use(privilege)
11
+ Vue.use(layout)
12
+ }
13
+ }
14
+
@@ -0,0 +1,54 @@
1
+ export default (st, pageRows, queryMethod) => {//st页面this对象,pageRows,每页显示行数,queryMethod如果默认查询不是doQuery需要指定字符串
2
+ let _thisst = st
3
+ let query = {}
4
+ let page = 1
5
+ let rows = 20
6
+ if (pageRows) {
7
+ rows = pageRows
8
+ }
9
+ let q = ''
10
+ let sort = ''
11
+ let order = 'desc'
12
+ let selObj = []//checkbox勾选的对象
13
+ let doQueryMethod = queryMethod ? '_thisst.' + queryMethod + '()' : '_thisst.doQuery()'
14
+
15
+ let outObj = {
16
+
17
+ query, page, rows, q, sort, order, selObj, doQueryMethod,
18
+
19
+ add:
20
+ (key, value) => {//没啥用
21
+ query[key] = value
22
+ },
23
+ setThis(st) {
24
+ _thisst = st
25
+ },
26
+ doSizeChg(val) {//显示行数切换
27
+ outObj.rows = val
28
+ return eval(doQueryMethod)
29
+
30
+ //st.doQuery()
31
+ },
32
+ doCurPageChange(val) {//页码切换
33
+ outObj.page = val
34
+
35
+ return eval(doQueryMethod)
36
+ },
37
+ doSort(val, noQuery) {
38
+ outObj.sort = val.prop
39
+ if (val.order == 'ascending') {
40
+ outObj.order = 'asc'
41
+ } else if (val.order == 'descending') {
42
+ outObj.order = 'desc'
43
+ } else {
44
+ outObj.sort = ''
45
+ outObj.order = ''
46
+ }
47
+ if (!noQuery) {//true 不查询,适合列表一加载时
48
+ return eval(doQueryMethod)
49
+ }
50
+ }
51
+ }
52
+ return outObj
53
+ }
54
+
@@ -0,0 +1,98 @@
1
+ function genRules(isRequired, minLength, maxLength, type = 'string', decimalNum) { // decimalNum=0是整数
2
+ const result = []
3
+ if (isRequired) {
4
+ const msg = {message: this.$t('此处必填'), required: true}
5
+ result.push(msg)
6
+ }
7
+ if (type == 'string') {
8
+ if (minLength) {
9
+ result.push({min: minLength, message: this.$t('字符长度不能小于x个字符', [minLength])})
10
+ }
11
+ if (maxLength) {
12
+ result.push({max: maxLength, message: this.$t('字符长度不能大于x个字符', [maxLength])})
13
+ }
14
+ } else if (type == 'number') {
15
+ result.push({type: 'number', message: this.$t('必须为数字')})
16
+ if (minLength != null) {
17
+ result.push({type: 'number', min: minLength, message: this.$t('数字不能小于') + minLength})
18
+ }
19
+ if (maxLength) {
20
+ result.push({type: 'number', max: maxLength, message: this.$t('数字不能大于') + maxLength})
21
+ }
22
+ if (decimalNum) { // 非0时,有小数
23
+ const reg = new RegExp('^(\\-|\\+?)\\d+(\\.\\d{0,' + decimalNum + '})?$')
24
+ result.push({pattern: reg, message: this.$t('小数最多x位', [decimalNum])}
25
+ )
26
+ }
27
+ if (decimalNum === 0) {
28
+ const reg = new RegExp('(^-?\\d+$)')
29
+ result.push({pattern: reg, message: this.$t('请输入整数')}
30
+ )
31
+ }
32
+ }
33
+
34
+ return result
35
+ }
36
+
37
+ function ckFt(value) { // checkbox展示用
38
+ if (value == '1') {
39
+ return '√'
40
+ } else {
41
+ return '×'
42
+ }
43
+ }
44
+
45
+
46
+ function date() {
47
+ return
48
+ }
49
+
50
+ export default {
51
+
52
+ install(Vue) {
53
+ Vue.prototype.$r = genRules
54
+ Vue.prototype.$ckFt = ckFt
55
+ Vue.prototype.$date = {
56
+ type: 'date',
57
+ placeholder: '选择日期',
58
+ format: 'yyyy-MM-dd',
59
+ valueFormat: 'yyyy-MM-dd',
60
+ style: {width: '100%'}
61
+ }
62
+ Vue.prototype.$time = {
63
+ type: 'datetime',
64
+ placeholder: '选择时间',
65
+ format: 'yyyy-MM-dd HH:mm',
66
+ valueFormat: 'yyyy-MM-dd HH:mm',
67
+ style: {width: '100%'}
68
+ }
69
+ Vue.prototype.$simdate = {
70
+ type: 'date',
71
+ placeholder: '选择日期',
72
+ format: 'yy-MM-dd',
73
+ valueFormat: 'yyyy-MM-dd',
74
+ style: {width: '100%'}
75
+ }
76
+ Vue.prototype.$simtime = {
77
+ type: 'datetime',
78
+ placeholder: '选择时间',
79
+ format: 'yy-MM-dd HH:mm',
80
+ valueFormat: 'yyyy-MM-dd HH:mm',
81
+ style: {width: '100%'}
82
+ }
83
+ Vue.prototype.$simdateshow = (v) => {
84
+ if (v) {
85
+ return v.substring(2, 10)
86
+ } else {
87
+ return ''
88
+ }
89
+ }
90
+ Vue.prototype.$simtimeshow = (v) => {
91
+ if (v) {
92
+ return v.substring(2)
93
+ } else {
94
+ return ''
95
+ }
96
+ }
97
+ }
98
+ }