hd-idevvue3 3.0.3 → 3.0.4

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 (147) hide show
  1. package/dist/assets/index.9c127719.css +1 -0
  2. package/dist/hd-idevvue3.mjs +3521 -3305
  3. package/dist/hd-idevvue3.umd.js +29 -29
  4. package/npminstall-debug.log +2 -10
  5. package/package.json +3 -1
  6. package/pnpm-lock.yaml +37 -4
  7. package/src/App.vue +11 -15
  8. package/src/assets/sound/notify.wav +0 -0
  9. package/src/demo/demo.vue +9 -10
  10. package/src/demo/dropdemo.vue +42 -43
  11. package/src/demo/extsets.vue +140 -39
  12. package/src/demo/formedit.vue +157 -145
  13. package/src/demo/hightquery.vue +263 -66
  14. package/src/demo/inlineedit.vue +129 -35
  15. package/src/demo/selfdrop.vue +32 -15
  16. package/src/directive/el-dragDialog/drag.js +13 -13
  17. package/src/directive/el-dragDialog/index.js +13 -13
  18. package/src/errorLog.js +3 -3
  19. package/src/hdcom/BigGrid.js +54 -48
  20. package/src/hdcom/BillShow.vue +84 -63
  21. package/src/hdcom/BillUpload.vue +144 -86
  22. package/src/hdcom/BtnRight.vue +26 -23
  23. package/src/hdcom/ErrHint.vue +36 -24
  24. package/src/hdcom/ExtendColumn.vue +97 -90
  25. package/src/hdcom/ExtendCommon.js +24 -13
  26. package/src/hdcom/ExtendForm.vue +107 -80
  27. package/src/hdcom/FacePicUpload.vue +59 -50
  28. package/src/hdcom/FaceRecTest.vue +87 -77
  29. package/src/hdcom/GridChart.vue +175 -162
  30. package/src/hdcom/GridExField.vue +328 -234
  31. package/src/hdcom/GridShow.vue +89 -39
  32. package/src/hdcom/HdAside.vue +192 -145
  33. package/src/hdcom/HdBtn.vue +44 -32
  34. package/src/hdcom/HdButton.vue +141 -117
  35. package/src/hdcom/HdComFaceRec.vue +80 -32
  36. package/src/hdcom/HdComGrid.vue +329 -229
  37. package/src/hdcom/HdComQuery.vue +179 -90
  38. package/src/hdcom/HdComQueryDetail.vue +159 -115
  39. package/src/hdcom/HdComSortDetail.vue +136 -130
  40. package/src/hdcom/HdDatePicker.vue +32 -16
  41. package/src/hdcom/HdDialog.vue +62 -44
  42. package/src/hdcom/HdDrop.vue +163 -138
  43. package/src/hdcom/HdFileUpload.vue +138 -119
  44. package/src/hdcom/HdFilterBox.vue +62 -62
  45. package/src/hdcom/HdFooter.vue +152 -119
  46. package/src/hdcom/HdForm.vue +276 -203
  47. package/src/hdcom/HdFormBtn.vue +81 -39
  48. package/src/hdcom/HdFormItem.vue +14 -10
  49. package/src/hdcom/HdGrid.vue +353 -156
  50. package/src/hdcom/HdGridEditBtn.vue +34 -20
  51. package/src/hdcom/HdGridExt.js +78 -47
  52. package/src/hdcom/HdGridSel.vue +227 -193
  53. package/src/hdcom/HdHeader.vue +149 -117
  54. package/src/hdcom/HdHotKey.vue +70 -67
  55. package/src/hdcom/HdInputHint.vue +40 -36
  56. package/src/hdcom/HdMain.vue +25 -27
  57. package/src/hdcom/HdMessage.vue +180 -171
  58. package/src/hdcom/HdNum.vue +67 -57
  59. package/src/hdcom/HdPopSel.vue +46 -24
  60. package/src/hdcom/HdRightMenu.vue +63 -61
  61. package/src/hdcom/HdSel/SelGridFieldcod.vue +46 -28
  62. package/src/hdcom/HdTableColumn.vue +156 -109
  63. package/src/hdcom/HdTempSave.vue +138 -116
  64. package/src/hdcom/HdTree.vue +89 -72
  65. package/src/hdcom/HdTreeTable/eval.js +8 -3
  66. package/src/hdcom/HdTreeTable/index.vue +229 -174
  67. package/src/hdcom/ImportExcel.vue +69 -34
  68. package/src/hdcom/index.js +39 -44
  69. package/src/idev.common.js +54 -47
  70. package/src/index.js +3 -6
  71. package/src/utils/HdQuery.js +25 -14
  72. package/src/utils/comutils.js +50 -28
  73. package/src/utils/gogocodeTransfer.js +59 -0
  74. package/src/utils/utils.js +30 -19
  75. package/src/vendor/Blob.js +187 -179
  76. package/src/vendor/Export2Excel.js +231 -220
  77. package/src/vendor/Export2Zip.js +25 -22
  78. package/src/views/layout/AppMain.vue +34 -32
  79. package/src/views/layout/HdLayout.vue +64 -52
  80. package/src/views/layout/header/ElasticSearch.vue +196 -159
  81. package/src/views/layout/header/HZRecorder.js +163 -135
  82. package/src/views/layout/header/HeaderSearch.vue +165 -145
  83. package/src/views/layout/header/Levelbar.vue +55 -49
  84. package/src/views/layout/header/MainHeader.vue +233 -189
  85. package/src/views/layout/header/Navbar.vue +74 -78
  86. package/src/views/layout/header/ScrollPane.vue +103 -81
  87. package/src/views/layout/header/TagsView.vue +169 -164
  88. package/src/views/layout/header/VocRec.vue +86 -78
  89. package/src/views/layout/header/changepswform.vue +98 -64
  90. package/src/views/layout/index.js +5 -7
  91. package/src/views/layout/menu/Hamburger.vue +63 -45
  92. package/src/views/layout/menu/HdMenu.vue +155 -118
  93. package/src/views/layout/menu/index.vue +21 -19
  94. package/src/views/privilege/commsg/commsg.vue +115 -41
  95. package/src/views/privilege/commsg/commsgOrgn.vue +40 -31
  96. package/src/views/privilege/commsg/commsgRole.vue +180 -109
  97. package/src/views/privilege/commsg/commsgform.vue +125 -101
  98. package/src/views/privilege/commsg/commsgiframe.vue +30 -23
  99. package/src/views/privilege/commsg/commsgto.vue +163 -84
  100. package/src/views/privilege/commsg/commsgtoform.vue +64 -58
  101. package/src/views/privilege/commsg/commsgtrans.vue +187 -115
  102. package/src/views/privilege/exfield/comexcolumn.vue +133 -43
  103. package/src/views/privilege/exfield/comexcolumnform.vue +85 -58
  104. package/src/views/privilege/exfield/comexfield.vue +15 -17
  105. package/src/views/privilege/exfield/comexfieldform.vue +71 -53
  106. package/src/views/privilege/exfield/comexfieldsub.vue +137 -46
  107. package/src/views/privilege/index.js +19 -20
  108. package/src/views/privilege/menu/comMenu.vue +49 -41
  109. package/src/views/privilege/menu/menu.vue +166 -49
  110. package/src/views/privilege/menu/menuinfo.vue +41 -34
  111. package/src/views/privilege/menu/rolelist.vue +78 -33
  112. package/src/views/privilege/menu/userlist.vue +76 -33
  113. package/src/views/privilege/mobile/authmobileupdate.vue +119 -43
  114. package/src/views/privilege/mobile/authmobileupdateform.vue +76 -46
  115. package/src/views/privilege/orgDept/authOrgn.vue +157 -65
  116. package/src/views/privilege/orgDept/authorgnform.vue +50 -38
  117. package/src/views/privilege/orgDept/orgDept.vue +38 -37
  118. package/src/views/privilege/orgDept/orgTree.vue +99 -88
  119. package/src/views/privilege/orgDept/orgnselect.vue +132 -111
  120. package/src/views/privilege/personDept/authuser.vue +197 -91
  121. package/src/views/privilege/personDept/authuserform.vue +123 -71
  122. package/src/views/privilege/personDept/facerec.vue +128 -83
  123. package/src/views/privilege/personDept/orgncascader.vue +134 -115
  124. package/src/views/privilege/personDept/personDept.vue +9 -7
  125. package/src/views/privilege/quartz/comquartzjob.vue +123 -38
  126. package/src/views/privilege/quartz/comquartzjobform.vue +67 -51
  127. package/src/views/privilege/quartz/comquartzlog.vue +116 -32
  128. package/src/views/privilege/role/btnRole.vue +123 -67
  129. package/src/views/privilege/role/menuRole.vue +65 -45
  130. package/src/views/privilege/role/orgnRole.vue +63 -41
  131. package/src/views/privilege/role/role.vue +26 -9
  132. package/src/views/privilege/role/rolelist.vue +114 -45
  133. package/src/views/privilege/role/roleselect.vue +34 -17
  134. package/src/views/privilege/search/comsearch.vue +164 -73
  135. package/src/views/privilege/search/menu.vue +38 -22
  136. package/src/views/privilege/syscode/syscode.vue +157 -69
  137. package/src/views/privilege/syscode/sysfield.vue +96 -43
  138. package/src/views/privilege/syscode/sysfieldframe.vue +30 -30
  139. package/src/views/privilege/syslog/menulog.vue +38 -22
  140. package/src/views/privilege/syslog/syslog.vue +145 -78
  141. package/src/views/privilege/syslog/syslogconfig.vue +91 -24
  142. package/src/views/privilege/syslog/syslogform.vue +45 -43
  143. package/src/views/privilege/syslog/syslogframe.vue +26 -26
  144. package/src/views/privilege/userRole/userRole.vue +187 -89
  145. package/vite.config.js +7 -0
  146. package/dist/assets/index.774ef40e.css +0 -1
  147. package/src/views/privilege.zip +0 -0
@@ -1,87 +1,101 @@
1
1
  <template>
2
- <div style="height: 100%;">
2
+ <div style="height: 100%">
3
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>
4
+ <slot> </slot>
5
+ <extend-form
6
+ v-if="exFieldCode"
7
+ :gridCode="exFieldCode"
8
+ :hdformThis="() => $refs.hdform"
9
+ ></extend-form>
7
10
  </el-form>
8
11
  </div>
9
12
  </template>
10
13
 
11
14
  <script>
12
- import ExtendForm from "./ExtendForm";
15
+ import ExtendForm from './ExtendForm'
13
16
 
17
+ /**
18
+ * 实现上一条下一条翻页等整合的form 使用参照AuthOrgnForm.vue
19
+ * @module HdForm
20
+ */
21
+ export default {
22
+ name: 'HdForm',
23
+ components: { ExtendForm },
24
+ inheritAttrs: false,
25
+ data() {
26
+ return {
27
+ tsLoading: false,
28
+ loading: false,
29
+ hdResult: {},
30
+ index: -1, // 当前位置
31
+ formThis: {}, // 外层form
32
+ gridThis: { hdQuery: {}, hdResult: { rows: [] } }, // hdcomgrid对应的列表
33
+ }
34
+ },
14
35
  /**
15
- * 实现上一条下一条翻页等整合的form 使用参照AuthOrgnForm.vue
16
- * @module HdForm
36
+ * Props
37
+ * @prop {String} findoneUrl 单值查询的url,与hdcomgrid的一致,非标准格式需要写
38
+ * @prop {String} saveoneUrl form的ref
39
+ * @prop {String} removeUrl form的ref
40
+ * @prop {Array} 或String,noCopy 复制时,不拷贝的,主键必然要加
41
+ * @prop {Boolean} readForm 是否只显示关闭按钮 默认为false
17
42
  */
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() {
43
+ props: {
44
+ findoneUrl: String,
45
+ saveoneUrl: String,
46
+ removeUrl: String,
47
+ noCopy: [Array, String], // 不拷贝的主键,请确保第一位是主键 //:noCopy="['codeId']"或者noCopy="codeId"
48
+ readForm: { type: Boolean, default: false },
49
+ exFieldCode: String,
50
+ customeChooseUpdateFn: {
51
+ type: Function,
52
+ default: null,
53
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
- }
54
+ },
55
+ mounted() {},
56
+ methods: {
57
+ show: function (row, gridThis, customeChooseUpdateFn) {
58
+ this.$nextTick(() => {
59
+ this.gridThis = gridThis || this.gridThis
60
+ this.choose(row)
61
+ if (row) {
62
+ for (let i = 0; i < this.gridThis.hdResult.rows.length; i++) {
63
+ // 给index赋初值
64
+ if (row == this.gridThis.hdResult.rows[i]) {
65
+ this.index = i
66
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
65
67
  }
66
68
  }
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
69
  }
82
- this.$http.post(this.findoneUrl ? this.findoneUrl : this.gridThis.findoneUrl, this.gridThis.hdQuery).then(response => { // 增加的
70
+ })
71
+ },
72
+ choose: function (row) {
73
+ // row为''是增加
74
+ // 弹窗重复使用时,清除校验项目
75
+ if (row) {
76
+ // 列表的数据
77
+ if (
78
+ this.customeChooseUpdateFn &&
79
+ this.customeChooseUpdateFn instanceof Function
80
+ ) {
81
+ this.customeChooseUpdateFn(row)
82
+ return true
83
+ } else {
84
+ const newRow = Object.assign({}, row)
85
+ newRow._oldRow = row
86
+ this.$emit('update:model', newRow) // 不能影响列表
87
+ return true
88
+ }
89
+ }
90
+ this.$http
91
+ .post(
92
+ this.findoneUrl ? this.findoneUrl : this.gridThis.findoneUrl,
93
+ this.gridThis.hdQuery
94
+ )
95
+ .then((response) => {
96
+ // 增加的
83
97
  const data = response.data
84
- data._isAdd = true// 新增标志
98
+ data._isAdd = true // 新增标志
85
99
  this.$emit('update:model', data)
86
100
  this.$nextTick(() => {
87
101
  if (this.$refs.hdform) {
@@ -89,120 +103,168 @@
89
103
  }
90
104
  })
91
105
  })
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(() => { // 异步
106
+ // for (let index = 0; index < this.hdQuery.rows; index++) {
107
+ // let tempId = eval("this.hdResult.rows[index]." + this.hdParam.idName);
108
+ // if (tempId === id) {
109
+ // this.index = index;
110
+ // break;
111
+ // }
112
+ // }
113
+ },
114
+ goBack() {
115
+ if (this.index <= 0) {
116
+ if (this.gridThis.hdQuery.page <= 1) {
117
+ // 开头不能上一条
118
+ return true
119
+ }
120
+ this.gridThis.hdQuery._noLoadingOnce = true
121
+ this.gridThis.hdQuery
122
+ .doCurPageChange(this.gridThis.hdQuery.page - 1)
123
+ .then(() => {
124
+ // 异步
107
125
  this.index = this.gridThis.hdResult.rows.length - 1
108
126
  this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
109
127
  this.choose(this.gridThis.hdQuery.selRow)
110
128
  return true
111
129
  })
112
- } else {
113
- this.index--
114
- this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
115
- this.choose(this.gridThis.hdQuery.selRow)
130
+ } else {
131
+ this.index--
132
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
133
+ this.choose(this.gridThis.hdQuery.selRow)
134
+ }
135
+ },
136
+ goNext() {
137
+ if (this.index >= this.gridThis.hdResult.rows.length - 1) {
138
+ // 需要翻页
139
+ console.log(
140
+ '2',
141
+ this.gridThis.hdQuery.page,
142
+ this.gridThis.hdResult.total / this.gridThis.hdResult.rows
143
+ )
144
+ if (
145
+ this.gridThis.hdQuery.page >=
146
+ this.gridThis.hdResult.total / this.gridThis.hdQuery.rows
147
+ ) {
148
+ // 开头不能上一条
149
+ return true
116
150
  }
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(() => { // 翻页成功才能执行
151
+ this.gridThis.hdQuery._noLoadingOnce = true
152
+ this.gridThis.hdQuery
153
+ .doCurPageChange(this.gridThis.hdQuery.page + 1)
154
+ .then(() => {
155
+ // 翻页成功才能执行
126
156
  this.index = 0
127
157
  this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
128
158
  this.choose(this.gridThis.$refs.hdgrid.hdQuery.selRow)
129
159
  return true
130
160
  })
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) { // 开头不能上一条
161
+ } else {
162
+ console.log(
163
+ '1',
164
+ this.index +
165
+ (this.gridThis.hdQuery.page - 1) * this.gridThis.hdQuery.rows,
166
+ this.gridThis.hdResult.total
167
+ )
168
+ if (
169
+ this.index +
170
+ (this.gridThis.hdQuery.page - 1) * this.gridThis.hdQuery.rows >=
171
+ this.gridThis.hdResult.total
172
+ ) {
143
173
  return true
144
174
  }
145
- this.gridThis.hdQuery._noLoadingOnce = true
146
- this.gridThis.hdQuery.doCurPageChange(this.gridThis.hdQuery.page - 1).then(() => {
175
+ this.index++
176
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
177
+ this.choose(this.gridThis.$refs.hdgrid.hdQuery.selRow)
178
+ }
179
+ },
180
+ pageBack() {
181
+ if (this.gridThis.hdQuery.page <= 1) {
182
+ // 开头不能上一条
183
+ return true
184
+ }
185
+ this.gridThis.hdQuery._noLoadingOnce = true
186
+ this.gridThis.hdQuery
187
+ .doCurPageChange(this.gridThis.hdQuery.page - 1)
188
+ .then(() => {
147
189
  this.index = 0
148
190
  this.gridThis.$refs.hdgrid.setCurrentRow(0)
149
191
  this.choose(this.gridThis.hdQuery.selRow)
150
192
  })
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(() => {
193
+ },
194
+ pageNext() {
195
+ if (
196
+ this.gridThis.hdQuery.page >=
197
+ this.gridThis.hdResult.total / this.gridThis.hdQuery.rows
198
+ ) {
199
+ // 开头不能上一条
200
+ return true
201
+ }
202
+ this.gridThis.hdQuery._noLoadingOnce = true
203
+ this.gridThis.hdQuery
204
+ .doCurPageChange(this.gridThis.hdQuery.page + 1)
205
+ .then(() => {
158
206
  this.index = 0
159
207
  this.gridThis.$refs.hdgrid.setCurrentRow(0)
160
208
  this.choose(this.gridThis.hdQuery.selRow)
161
209
  })
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
- }
210
+ },
211
+ /**
212
+ * @function doCopy 支持深度复制(对象中嵌套对象)
213
+ * */
214
+ doCopy() {
215
+ const one = JSON.parse(JSON.stringify(this.gridThis.hdQuery.selRow))
216
+ let noCpLs = [
217
+ 'recNam',
218
+ 'recTim',
219
+ 'updNam',
220
+ 'updNam',
221
+ 'updTim',
222
+ 'idevVersionUse',
223
+ ]
224
+ if (this.noCopy) {
225
+ if (typeof this.noCopy == 'string') {
226
+ // 可以是字符串或者数组
227
+ noCpLs.push(this.noCopy)
228
+ } else {
229
+ noCpLs = noCpLs.concat(this.noCopy)
178
230
  }
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 => {
231
+ for (let j = 0; j < noCpLs.length; j++) {
232
+ // 不需要复制的属性给null
233
+ eval('one.' + noCpLs[j] + ' = null')
234
+ }
235
+ }
236
+ this.$message({
237
+ type: 'success',
238
+ message: this.$t('复制完成'),
239
+ duration: 1500,
240
+ })
241
+ one._isAdd = true
242
+ this.index = 0
243
+ this.choose(one)
244
+ },
245
+ /**
246
+ * @function doSave 触发事件:this.$emit('saveCall', data.data, this.$attrs.model._isAdd)
247
+ * */
248
+ doSave() {
249
+ const promise = new Promise((resolve, reject) => {
250
+ this.$refs.hdform.validate((valid) => {
251
+ if (!valid) {
252
+ reject()
253
+ return false
254
+ }
255
+ this.loading = true
256
+ this.$http
257
+ .post(
258
+ this.saveoneUrl ? this.saveoneUrl : this.gridThis.saveoneUrl,
259
+ this.$attrs.model
260
+ )
261
+ .then((response) => {
200
262
  this.loading = false
201
263
  const data = response.data
202
264
  this.$message({
203
265
  type: data.code == '-1' ? 'error' : 'success',
204
266
  message: data.message,
205
- duration: 1500
267
+ duration: 1500,
206
268
  })
207
269
  if (data.code == '-1') {
208
270
  reject(data)
@@ -215,64 +277,75 @@
215
277
  // this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
216
278
 
217
279
  // this.index = 0 // 插入的index+1
218
- console.log(this.gridThis.hdResult.rows);
280
+ console.log(this.gridThis.hdResult.rows)
219
281
  this.gridThis.hdResult.rows.unshift(data.data)
220
282
  this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
221
283
  } else {
222
- Object.assign(this.gridThis.hdResult.rows[this.index], data.data)
284
+ Object.assign(
285
+ this.gridThis.hdResult.rows[this.index],
286
+ data.data
287
+ )
223
288
  }
224
289
  this.$emit('update:model', Object.assign({}, data.data))
225
290
  resolve(data)
226
- }).catch(() => {
291
+ })
292
+ .catch(() => {
227
293
  this.loading = false
228
294
  reject()
229
295
  })
230
- })
231
296
  })
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
297
+ })
298
+ return promise
299
+ },
300
+ /**
301
+ * @function doDel 触发事件: this.$emit('delCall', this.gridThis.hdQuery.selRow)
302
+ * */
303
+ doDel() {
304
+ const promise = new Promise((resolve, reject) => {
305
+ this.$confirm(this.$t('确定删除本数据?'), this.$t('提示'), {})
306
+ .then(() => {
307
+ this.$http
308
+ .post(
309
+ this.removeUrl ? this.removeUrl : this.gridThis.removeUrl,
310
+ this.$attrs.model
311
+ )
312
+ .then((response) => {
313
+ const data = response.data
314
+ this.$emit('delCall', this.gridThis.hdQuery.selRow)
315
+ this.$message({
316
+ type: data.code == '-1' ? 'error' : 'success',
317
+ showClose: true,
318
+ duration: 1500,
319
+ message: data.message,
320
+ })
321
+ if (data.code == '-1') {
322
+ reject(data)
323
+ return
324
+ }
325
+ this.gridThis.hdResult.rows.remove(this.gridThis.hdQuery.selRow)
326
+ if (this.gridThis.hdResult.rows.length != 0) {
327
+ this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
328
+ this.choose(this.gridThis.hdQuery.selRow)
329
+ } else {
330
+ this.doAdd() // 删除最后一条时增加
331
+ }
332
+ resolve(data)
333
+ // this.hdQuery.doCurPageChange(1);
248
334
  })
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(() => {
335
+ .catch(() => {
336
+ reject()
337
+ })
338
+ })
339
+ .catch(() => {
266
340
  reject()
267
341
  })
268
- })
269
- return promise
270
- },
271
- doAdd() {
272
- this.index = 0
273
- this.choose('')
274
- }
275
- }
276
- }
342
+ })
343
+ return promise
344
+ },
345
+ doAdd() {
346
+ this.index = 0
347
+ this.choose('')
348
+ },
349
+ },
350
+ }
277
351
  </script>
278
-