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,278 @@
1
+ <template>
2
+ <div style="height: 100%;">
3
+ <el-form v-bind="$attrs" v-on="$listeners" ref="hdform">
4
+ <slot>
5
+ </slot>
6
+ <extend-form v-if="exFieldCode" :gridCode="exFieldCode" :hdformThis="()=>$refs.hdform"></extend-form>
7
+ </el-form>
8
+ </div>
9
+ </template>
10
+
11
+ <script>
12
+ import ExtendForm from "./ExtendForm";
13
+
14
+ /**
15
+ * 实现上一条下一条翻页等整合的form 使用参照AuthOrgnForm.vue
16
+ * @module HdForm
17
+ */
18
+ export default {
19
+ name: 'HdForm',
20
+ components: {ExtendForm},
21
+ inheritAttrs: false,
22
+ data() {
23
+ return {
24
+ tsLoading: false,
25
+ loading: false,
26
+ hdResult: {},
27
+ index: -1, // 当前位置
28
+ formThis: {}, // 外层form
29
+ gridThis: {hdQuery: {}, hdResult: {rows: []}},// hdcomgrid对应的列表
30
+ }
31
+ },
32
+ /**
33
+ * Props
34
+ * @prop {String} findoneUrl 单值查询的url,与hdcomgrid的一致,非标准格式需要写
35
+ * @prop {String} saveoneUrl form的ref
36
+ * @prop {String} removeUrl form的ref
37
+ * @prop {Array} 或String,noCopy 复制时,不拷贝的,主键必然要加
38
+ * @prop {Boolean} readForm 是否只显示关闭按钮 默认为false
39
+ */
40
+ props: {
41
+ findoneUrl: String,
42
+ saveoneUrl: String,
43
+ removeUrl: String,
44
+ noCopy: [Array, String], // 不拷贝的主键,请确保第一位是主键 //:noCopy="['codeId']"或者noCopy="codeId"
45
+ readForm: {type: Boolean, default: false},
46
+ exFieldCode: String,
47
+ customeChooseUpdateFn: {
48
+ type: Function,
49
+ default: null,
50
+ }
51
+ },
52
+ mounted() {
53
+ },
54
+ methods: {
55
+ show: function (row, gridThis, customeChooseUpdateFn) {
56
+ this.$nextTick(() => {
57
+ this.gridThis = gridThis || this.gridThis;
58
+ this.choose(row)
59
+ if (row) {
60
+ for (let i = 0; i < this.gridThis.hdResult.rows.length; i++) { // 给index赋初值
61
+ if (row == this.gridThis.hdResult.rows[i]) {
62
+ this.index = i
63
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
64
+ }
65
+ }
66
+ }
67
+ })
68
+ },
69
+ choose: function (row) { // row为''是增加
70
+ // 弹窗重复使用时,清除校验项目
71
+ if (row) { // 列表的数据
72
+ if (this.customeChooseUpdateFn && this.customeChooseUpdateFn instanceof Function) {
73
+ this.customeChooseUpdateFn(row);
74
+ return true
75
+ } else {
76
+ const newRow = Object.assign({}, row)
77
+ newRow._oldRow = row
78
+ this.$emit('update:model', newRow)// 不能影响列表
79
+ return true
80
+ }
81
+ }
82
+ this.$http.post(this.findoneUrl ? this.findoneUrl : this.gridThis.findoneUrl, this.gridThis.hdQuery).then(response => { // 增加的
83
+ const data = response.data
84
+ data._isAdd = true// 新增标志
85
+ this.$emit('update:model', data)
86
+ this.$nextTick(() => {
87
+ if (this.$refs.hdform) {
88
+ this.$refs.hdform.clearValidate()
89
+ }
90
+ })
91
+ })
92
+ // for (let index = 0; index < this.hdQuery.rows; index++) {
93
+ // let tempId = eval("this.hdResult.rows[index]." + this.hdParam.idName);
94
+ // if (tempId === id) {
95
+ // this.index = index;
96
+ // break;
97
+ // }
98
+ // }
99
+ },
100
+ goBack() {
101
+ if (this.index <= 0) {
102
+ if (this.gridThis.hdQuery.page <= 1) { // 开头不能上一条
103
+ return true
104
+ }
105
+ this.gridThis.hdQuery._noLoadingOnce = true
106
+ this.gridThis.hdQuery.doCurPageChange(this.gridThis.hdQuery.page - 1).then(() => { // 异步
107
+ this.index = this.gridThis.hdResult.rows.length - 1
108
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
109
+ this.choose(this.gridThis.hdQuery.selRow)
110
+ return true
111
+ })
112
+ } else {
113
+ this.index--
114
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
115
+ this.choose(this.gridThis.hdQuery.selRow)
116
+ }
117
+ },
118
+ goNext() {
119
+ if (this.index >= this.gridThis.hdResult.rows.length - 1) { // 需要翻页
120
+ console.log('2', this.gridThis.hdQuery.page, this.gridThis.hdResult.total / this.gridThis.hdResult.rows)
121
+ if (this.gridThis.hdQuery.page >= this.gridThis.hdResult.total / this.gridThis.hdQuery.rows) { // 开头不能上一条
122
+ return true
123
+ }
124
+ this.gridThis.hdQuery._noLoadingOnce = true
125
+ this.gridThis.hdQuery.doCurPageChange(this.gridThis.hdQuery.page + 1).then(() => { // 翻页成功才能执行
126
+ this.index = 0
127
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
128
+ this.choose(this.gridThis.$refs.hdgrid.hdQuery.selRow)
129
+ return true
130
+ })
131
+ } else {
132
+ console.log('1', this.index + (this.gridThis.hdQuery.page - 1) * this.gridThis.hdQuery.rows, this.gridThis.hdResult.total)
133
+ if (this.index + (this.gridThis.hdQuery.page - 1) * this.gridThis.hdQuery.rows >= this.gridThis.hdResult.total) {
134
+ return true
135
+ }
136
+ this.index++
137
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
138
+ this.choose(this.gridThis.$refs.hdgrid.hdQuery.selRow)
139
+ }
140
+ },
141
+ pageBack() {
142
+ if (this.gridThis.hdQuery.page <= 1) { // 开头不能上一条
143
+ return true
144
+ }
145
+ this.gridThis.hdQuery._noLoadingOnce = true
146
+ this.gridThis.hdQuery.doCurPageChange(this.gridThis.hdQuery.page - 1).then(() => {
147
+ this.index = 0
148
+ this.gridThis.$refs.hdgrid.setCurrentRow(0)
149
+ this.choose(this.gridThis.hdQuery.selRow)
150
+ })
151
+ },
152
+ pageNext() {
153
+ if (this.gridThis.hdQuery.page >= this.gridThis.hdResult.total / this.gridThis.hdQuery.rows) { // 开头不能上一条
154
+ return true
155
+ }
156
+ this.gridThis.hdQuery._noLoadingOnce = true
157
+ this.gridThis.hdQuery.doCurPageChange(this.gridThis.hdQuery.page + 1).then(() => {
158
+ this.index = 0
159
+ this.gridThis.$refs.hdgrid.setCurrentRow(0)
160
+ this.choose(this.gridThis.hdQuery.selRow)
161
+ })
162
+ },
163
+ /**
164
+ * @function doCopy 支持深度复制(对象中嵌套对象)
165
+ * */
166
+ doCopy() {
167
+ const one = JSON.parse(JSON.stringify(this.gridThis.hdQuery.selRow))
168
+ let noCpLs = ['recNam', 'recTim', 'updNam', 'updNam', 'updTim', 'idevVersionUse']
169
+ if (this.noCopy) {
170
+ if (typeof this.noCopy == 'string') { // 可以是字符串或者数组
171
+ noCpLs.push(this.noCopy)
172
+ } else {
173
+ noCpLs = noCpLs.concat(this.noCopy)
174
+ }
175
+ for (let j = 0; j < noCpLs.length; j++) { // 不需要复制的属性给null
176
+ eval('one.' + noCpLs[j] + ' = null')
177
+ }
178
+ }
179
+ this.$message({
180
+ type: 'success',
181
+ message: this.$t('复制完成'),
182
+ duration: 1500
183
+ })
184
+ one._isAdd = true
185
+ this.index = 0
186
+ this.choose(one)
187
+ },
188
+ /**
189
+ * @function doSave 触发事件:this.$emit('saveCall', data.data, this.$attrs.model._isAdd)
190
+ * */
191
+ doSave() {
192
+ const promise = new Promise((resolve, reject) => {
193
+ this.$refs.hdform.validate((valid) => {
194
+ if (!valid) {
195
+ reject()
196
+ return false
197
+ }
198
+ this.loading = true
199
+ this.$http.post(this.saveoneUrl ? this.saveoneUrl : this.gridThis.saveoneUrl, this.$attrs.model).then(response => {
200
+ this.loading = false
201
+ const data = response.data
202
+ this.$message({
203
+ type: data.code == '-1' ? 'error' : 'success',
204
+ message: data.message,
205
+ duration: 1500
206
+ })
207
+ if (data.code == '-1') {
208
+ reject(data)
209
+ return
210
+ }
211
+ this.$emit('saveCall', data.data, this.$attrs.model._isAdd)
212
+ if (this.$attrs.model._isAdd) {
213
+ // this.index++ // 插入的index+1
214
+ // this.gridThis.hdResult.rows.splice(this.index, 0, data.data)
215
+ // this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
216
+
217
+ // this.index = 0 // 插入的index+1
218
+ console.log(this.gridThis.hdResult.rows);
219
+ this.gridThis.hdResult.rows.unshift(data.data)
220
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
221
+ } else {
222
+ Object.assign(this.gridThis.hdResult.rows[this.index], data.data)
223
+ }
224
+ this.$emit('update:model', Object.assign({}, data.data))
225
+ resolve(data)
226
+ }).catch(() => {
227
+ this.loading = false
228
+ reject()
229
+ })
230
+ })
231
+ })
232
+ return promise
233
+ },
234
+ /**
235
+ * @function doDel 触发事件: this.$emit('delCall', this.gridThis.hdQuery.selRow)
236
+ * */
237
+ doDel() {
238
+ const promise = new Promise((resolve, reject) => {
239
+ this.$confirm(this.$t('确定删除本数据?'), this.$t('提示'), {}).then(() => {
240
+ this.$http.post(this.removeUrl ? this.removeUrl : this.gridThis.removeUrl, this.$attrs.model).then(response => {
241
+ const data = response.data
242
+ this.$emit('delCall', this.gridThis.hdQuery.selRow)
243
+ this.$message({
244
+ type: data.code == '-1' ? 'error' : 'success',
245
+ showClose: true,
246
+ duration: 1500,
247
+ message: data.message
248
+ })
249
+ if (data.code == '-1') {
250
+ reject(data)
251
+ return
252
+ }
253
+ this.gridThis.hdResult.rows.remove(this.gridThis.hdQuery.selRow)
254
+ if (this.gridThis.hdResult.rows.length != 0) {
255
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
256
+ this.choose(this.gridThis.hdQuery.selRow)
257
+ } else {
258
+ this.doAdd()// 删除最后一条时增加
259
+ }
260
+ resolve(data)
261
+ // this.hdQuery.doCurPageChange(1);
262
+ }).catch(() => {
263
+ reject()
264
+ })
265
+ }).catch(() => {
266
+ reject()
267
+ })
268
+ })
269
+ return promise
270
+ },
271
+ doAdd() {
272
+ this.index = 0
273
+ this.choose('')
274
+ }
275
+ }
276
+ }
277
+ </script>
278
+
@@ -0,0 +1,89 @@
1
+ <template>
2
+ <span style="height: 100%;">
3
+ <span style="width:110px; display:inline-block;">
4
+ {{pageMessage}}
5
+ </span>
6
+ <span>
7
+ <!--<el-button type="" icon="fa fa-fast-backward" @click="goStart()"></el-button>-->
8
+ <ExButton type="default" icon="fa fa-step-backward" @click="pageBack"></ExButton>
9
+ <ExButton type="default" icon="fa fa-caret-left" @click="hdForm.goBack()"></ExButton>
10
+ <ExButton type="default" icon="fa fa-caret-right" @click="hdForm.goNext()"></ExButton>
11
+ <ExButton type="default" icon="fa fa-step-forward" @click="hdForm.pageNext()"></ExButton>
12
+ <!--<el-button type="" icon="fa fa-fast-forward" @click="goEnd()"></el-button>-->
13
+ </span>
14
+ <span v-if="!hdForm.readForm">
15
+ <el-button type="primary" @click="hdForm.doCopy()" keyType="copy"
16
+ :hotKeyRange="$vnode.context.$options._componentTag">{{$t('复制')}}
17
+ </el-button>
18
+ <el-button type="primary" @click="hdForm.doAdd()" keyType="add"
19
+ :hotKeyRange="$vnode.context.$options._componentTag" v-if="!hdForm.readForm">{{$t('增加')}}
20
+ </el-button>
21
+ <el-button type="danger" @click="doDel()" keyType="del" :disabled="delLoading"
22
+ :hotKeyRange="$vnode.context.$options._componentTag">{{$t('删除')}}
23
+ </el-button>
24
+ <el-button type="primary" @click="doSave()"keyType="save" :disabled="saveLoading"
25
+ :hotKeyRange="$vnode.context.$options._componentTag">{{$t('保存')}}
26
+ </el-button>
27
+ </span>
28
+ <!-- <el-button @click="visible = false">取 消</el-button>
29
+ <el-button type="primary" @click="submit" :loading="loading"> 确 定</el-button>-->
30
+ </span>
31
+ </template>
32
+
33
+ <script>
34
+ /**
35
+ * form按钮组,必须与HdForm联合使用,使用参照AuthOrgnForm.vue
36
+ * @module HdFormBtn
37
+ */
38
+ export default {
39
+ name: 'HdFormBtn',
40
+ inheritAttrs: false,
41
+ data() {
42
+ return {
43
+ tsLoading: false,
44
+ loading: false,
45
+ hdResult: {},
46
+ index: 0, // 当前位置
47
+ hdForm: {}, // 外层form
48
+ gridThis: { hdQuery: {}, hdResult: {}}, // hdcomgrid对应的列表
49
+ saveLoading: false,
50
+ delLoading: false
51
+ }
52
+ },
53
+ props: {},
54
+ mounted() {
55
+ },
56
+ methods: {
57
+ pageBack() {
58
+ // console.log(this.gridThis.hdQuery.page);
59
+ this.hdForm.pageBack()
60
+ },
61
+ show(gridThis, hdForm) {
62
+ this.gridThis = gridThis
63
+ this.hdForm = hdForm
64
+ },
65
+ doSave() {
66
+ this.saveLoading = true
67
+ this.hdForm.doSave().then(() => {
68
+ this.saveLoading = false
69
+ }).catch(() => {
70
+ this.saveLoading = false
71
+ })
72
+ },
73
+ doDel() {
74
+ this.delLoading = true
75
+ this.hdForm.doDel().then(() => {
76
+ this.delLoading = false
77
+ }).catch(() => {
78
+ this.delLoading = false
79
+ })
80
+ }
81
+ },
82
+ computed:{
83
+ pageMessage() {
84
+ return this.$t(`第{page}页,第{index}条`, {page:this.gridThis.hdQuery.page, index:this.hdForm.index + 1})
85
+ }
86
+ }
87
+ }
88
+ </script>
89
+
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <ExFormItem ref="elformitem" v-bind="$attrs" v-on="$listeners" :label="$t($attrs.label)">
3
+ <!-- <slot name="label">-->
4
+ <!-- {{ $t($attrs.label) }}-->
5
+ <!-- </slot>-->
6
+ <ErrHint :err-msg="getVaildMessage()"/>
7
+ <slot/>
8
+ </ExFormItem>
9
+ </template>
10
+ <script>
11
+
12
+ /**
13
+ * 覆写ElFormItem,校验有下方文字改为图标+pop
14
+ * @module HdFormItem
15
+ */
16
+ export default {
17
+ name: 'HdFormItem',
18
+ components: {},
19
+ inheritAttrs: false,
20
+ methods: {
21
+ check() {
22
+ if (this.$refs.elformitem) {
23
+ return this.$refs.elformitem.validateState === 'error'
24
+ }
25
+ },
26
+ getVaildMessage() {
27
+ if (this.$refs.elformitem) {
28
+ return this.$refs.elformitem.validateMessage
29
+ }
30
+ return ''
31
+ }
32
+ }
33
+ }
34
+ </script>
35
+
File without changes