hd-idevvue3 3.0.5 → 3.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/dist/static/css/index-DRHIlcVU.css +1 -0
  2. package/dist/static/js/index-DbUA6jg0.js +184 -0
  3. package/dist/static/js/index-Dl4O91nB.js +73768 -0
  4. package/package.json +16 -16
  5. package/.env.development +0 -5
  6. package/.env.production +0 -5
  7. package/.eslintrc.js +0 -151
  8. package/dist/assets/index.431f21ca.css +0 -1
  9. package/dist/hd-idevvue3.mjs +0 -45878
  10. package/dist/hd-idevvue3.umd.js +0 -153
  11. package/index.html +0 -18
  12. package/npminstall-debug.log +0 -200
  13. package/pnpm-lock.yaml +0 -2813
  14. package/src/App.vue +0 -11
  15. package/src/assets/sound/notify.wav +0 -0
  16. package/src/demo/demo.vue +0 -42
  17. package/src/demo/dropdemo.vue +0 -42
  18. package/src/demo/extsets.vue +0 -208
  19. package/src/demo/formedit.vue +0 -157
  20. package/src/demo/hightquery.vue +0 -366
  21. package/src/demo/inlineedit.vue +0 -182
  22. package/src/demo/selfdrop.vue +0 -58
  23. package/src/demo//350/241/214/345/206/205/347/272/247/350/201/224.txt +0 -2
  24. package/src/directive/el-dragDialog/drag.js +0 -124
  25. package/src/directive/el-dragDialog/index.js +0 -13
  26. package/src/errorLog.js +0 -16
  27. package/src/hdcom/BigGrid.js +0 -179
  28. package/src/hdcom/BillShow.vue +0 -111
  29. package/src/hdcom/BillUpload.vue +0 -311
  30. package/src/hdcom/BtnRight.vue +0 -101
  31. package/src/hdcom/ErrHint.vue +0 -42
  32. package/src/hdcom/ExtendColumn.vue +0 -115
  33. package/src/hdcom/ExtendCommon.js +0 -40
  34. package/src/hdcom/ExtendForm.vue +0 -141
  35. package/src/hdcom/FacePicUpload.vue +0 -80
  36. package/src/hdcom/FaceRecTest.vue +0 -114
  37. package/src/hdcom/GridChart.vue +0 -207
  38. package/src/hdcom/GridExField.vue +0 -375
  39. package/src/hdcom/GridShow.vue +0 -288
  40. package/src/hdcom/HdAside.vue +0 -225
  41. package/src/hdcom/HdBtn.vue +0 -125
  42. package/src/hdcom/HdButton.vue +0 -161
  43. package/src/hdcom/HdComFaceRec.vue +0 -106
  44. package/src/hdcom/HdComGrid.vue +0 -876
  45. package/src/hdcom/HdComQuery.vue +0 -362
  46. package/src/hdcom/HdComQueryDetail.vue +0 -205
  47. package/src/hdcom/HdComSortDetail.vue +0 -161
  48. package/src/hdcom/HdDatePicker.vue +0 -94
  49. package/src/hdcom/HdDialog.vue +0 -81
  50. package/src/hdcom/HdDrop.vue +0 -188
  51. package/src/hdcom/HdFileUpload.vue +0 -167
  52. package/src/hdcom/HdFilterBox.vue +0 -90
  53. package/src/hdcom/HdFooter.vue +0 -182
  54. package/src/hdcom/HdForm.vue +0 -351
  55. package/src/hdcom/HdFormBtn.vue +0 -131
  56. package/src/hdcom/HdFormItem.vue +0 -39
  57. package/src/hdcom/HdGctosGrid +0 -0
  58. package/src/hdcom/HdGrid.vue +0 -1022
  59. package/src/hdcom/HdGridEditBtn.vue +0 -58
  60. package/src/hdcom/HdGridExt.js +0 -250
  61. package/src/hdcom/HdGridSel.vue +0 -257
  62. package/src/hdcom/HdHeader.vue +0 -180
  63. package/src/hdcom/HdHotKey.vue +0 -84
  64. package/src/hdcom/HdInputHint.vue +0 -53
  65. package/src/hdcom/HdMain.vue +0 -41
  66. package/src/hdcom/HdMessage.vue +0 -201
  67. package/src/hdcom/HdNum.vue +0 -79
  68. package/src/hdcom/HdPopSel.vue +0 -80
  69. package/src/hdcom/HdRightMenu.vue +0 -63
  70. package/src/hdcom/HdSel/SelGridFieldcod.vue +0 -54
  71. package/src/hdcom/HdTableColumn.vue +0 -381
  72. package/src/hdcom/HdTempSave.vue +0 -162
  73. package/src/hdcom/HdTree.vue +0 -103
  74. package/src/hdcom/HdTreeTable/eval.js +0 -39
  75. package/src/hdcom/HdTreeTable/index.vue +0 -229
  76. package/src/hdcom/ImportExcel.vue +0 -178
  77. package/src/hdcom/index.js +0 -75
  78. package/src/idev.common.js +0 -79
  79. package/src/index.js +0 -11
  80. package/src/utils/HdQuery.js +0 -65
  81. package/src/utils/comutils.js +0 -120
  82. package/src/utils/gogocodeTransfer.js +0 -59
  83. package/src/utils/utils.js +0 -116
  84. package/src/vendor/Blob.js +0 -187
  85. package/src/vendor/Export2Excel.js +0 -231
  86. package/src/vendor/Export2Zip.js +0 -25
  87. package/src/views/layout/AppMain.vue +0 -34
  88. package/src/views/layout/HdLayout.vue +0 -90
  89. package/src/views/layout/header/ElasticSearch.vue +0 -262
  90. package/src/views/layout/header/HZRecorder.js +0 -259
  91. package/src/views/layout/header/HeaderSearch.vue +0 -218
  92. package/src/views/layout/header/Levelbar.vue +0 -55
  93. package/src/views/layout/header/MainHeader.vue +0 -315
  94. package/src/views/layout/header/Navbar.vue +0 -101
  95. package/src/views/layout/header/ScrollPane.vue +0 -103
  96. package/src/views/layout/header/TagsView.vue +0 -215
  97. package/src/views/layout/header/VocRec.vue +0 -105
  98. package/src/views/layout/header/changepswform.vue +0 -130
  99. package/src/views/layout/index.js +0 -10
  100. package/src/views/layout/menu/Hamburger.vue +0 -63
  101. package/src/views/layout/menu/HdMenu.vue +0 -204
  102. package/src/views/layout/menu/css/menu.css +0 -288
  103. package/src/views/layout/menu/index.vue +0 -27
  104. package/src/views/privilege/commsg/commsg.vue +0 -152
  105. package/src/views/privilege/commsg/commsgOrgn.vue +0 -51
  106. package/src/views/privilege/commsg/commsgRole.vue +0 -220
  107. package/src/views/privilege/commsg/commsgform.vue +0 -184
  108. package/src/views/privilege/commsg/commsgiframe.vue +0 -40
  109. package/src/views/privilege/commsg/commsgto.vue +0 -199
  110. package/src/views/privilege/commsg/commsgtoform.vue +0 -114
  111. package/src/views/privilege/commsg/commsgtrans.vue +0 -227
  112. package/src/views/privilege/exfield/comexcolumn.vue +0 -161
  113. package/src/views/privilege/exfield/comexcolumnform.vue +0 -128
  114. package/src/views/privilege/exfield/comexfield.vue +0 -29
  115. package/src/views/privilege/exfield/comexfieldform.vue +0 -112
  116. package/src/views/privilege/exfield/comexfieldsub.vue +0 -163
  117. package/src/views/privilege/index.js +0 -41
  118. package/src/views/privilege/menu/comMenu.vue +0 -49
  119. package/src/views/privilege/menu/menu.vue +0 -250
  120. package/src/views/privilege/menu/menuinfo.vue +0 -63
  121. package/src/views/privilege/menu/rolelist.vue +0 -92
  122. package/src/views/privilege/menu/userlist.vue +0 -92
  123. package/src/views/privilege/mobile/authmobileupdate.vue +0 -145
  124. package/src/views/privilege/mobile/authmobileupdateform.vue +0 -120
  125. package/src/views/privilege/orgDept/authOrgn.vue +0 -188
  126. package/src/views/privilege/orgDept/authorgnform.vue +0 -157
  127. package/src/views/privilege/orgDept/orgDept.vue +0 -38
  128. package/src/views/privilege/orgDept/orgTree.vue +0 -99
  129. package/src/views/privilege/orgDept/orgnselect.vue +0 -155
  130. package/src/views/privilege/personDept/authuser.vue +0 -229
  131. package/src/views/privilege/personDept/authuserform.vue +0 -206
  132. package/src/views/privilege/personDept/facerec.vue +0 -162
  133. package/src/views/privilege/personDept/orgncascader.vue +0 -144
  134. package/src/views/privilege/personDept/personDept.vue +0 -33
  135. package/src/views/privilege/quartz/comquartzjob.vue +0 -150
  136. package/src/views/privilege/quartz/comquartzjobform.vue +0 -115
  137. package/src/views/privilege/quartz/comquartzlog.vue +0 -143
  138. package/src/views/privilege/role/btnRole.vue +0 -173
  139. package/src/views/privilege/role/menuRole.vue +0 -84
  140. package/src/views/privilege/role/orgnRole.vue +0 -78
  141. package/src/views/privilege/role/role.vue +0 -84
  142. package/src/views/privilege/role/rolelist.vue +0 -136
  143. package/src/views/privilege/role/roleselect.vue +0 -74
  144. package/src/views/privilege/search/comsearch.vue +0 -196
  145. package/src/views/privilege/search/menu.vue +0 -68
  146. package/src/views/privilege/syscode/syscode.vue +0 -191
  147. package/src/views/privilege/syscode/sysfield.vue +0 -119
  148. package/src/views/privilege/syscode/sysfieldframe.vue +0 -30
  149. package/src/views/privilege/syslog/menulog.vue +0 -68
  150. package/src/views/privilege/syslog/syslog.vue +0 -182
  151. package/src/views/privilege/syslog/syslogconfig.vue +0 -128
  152. package/src/views/privilege/syslog/syslogform.vue +0 -85
  153. package/src/views/privilege/syslog/syslogframe.vue +0 -26
  154. package/src/views/privilege/userRole/userRole.vue +0 -220
  155. package/vite.config.js +0 -103
@@ -1,90 +0,0 @@
1
- <template>
2
- <el-row>
3
- <el-col :span="10" align="left">
4
- <div class="icon" @click.stop.prevent="doShrink" v-show="shrinkVisable">
5
- <i :class="[fa, arrowClass]" style="cursor: pointer" />
6
- </div>
7
- <div
8
- ref="searchBox"
9
- class="filter-item-box"
10
- :style="{ height: nowHeight }"
11
- >
12
- <slot> </slot>
13
- </div>
14
- </el-col>
15
- <el-col :span="4" align="left">
16
- <div class="filter-btn-search">
17
- <slot name="searchBtn"> </slot>
18
- </div>
19
- </el-col>
20
- <el-col :span="10" align="right">
21
- <div class="filter-btn-otheritem">
22
- <slot name="otherBtn"></slot>
23
- </div>
24
- </el-col>
25
- </el-row>
26
- </template>
27
-
28
- <script>
29
- export default {
30
- name: 'HdFilterBoxTmp',
31
- data() {
32
- return {
33
- arrowClass: 'fa-chevron-down',
34
- fa: 'fa',
35
- isShrink: false,
36
- nowHeight: '28px',
37
- nowWidth: null,
38
- shrinkVisable: false,
39
- }
40
- },
41
- mounted() {
42
- let elementResizeDetectorMaker = require('element-resize-detector')
43
- let erd = elementResizeDetectorMaker()
44
- // console.log('this.$refs.searchBox.$el', this.$refs.searchBox)
45
- erd.listenTo(this.$refs.searchBox, (element) => {
46
- if (element.scrollHeight < 40) {
47
- this.shrinkVisable = false
48
- } else {
49
- this.shrinkVisable = true
50
- }
51
- })
52
- },
53
- methods: {
54
- doShrink() {
55
- if (this.isShrink) {
56
- this.nowHeight = '28px'
57
- this.arrowClass = 'fa-chevron-down'
58
- } else {
59
- this.nowHeight = '100%'
60
- this.arrowClass = 'fa-chevron-up'
61
- }
62
- this.isShrink = !this.isShrink
63
- },
64
- },
65
- computed: {
66
- searchBoxWidth() {
67
- // return this.nowWidth ? this.nowWidth%180 + 'px' : 'auto';
68
- return 'auto'
69
- },
70
- },
71
- }
72
- </script>
73
-
74
- <style scoped>
75
- .filter-item-box {
76
- overflow: hidden;
77
- display: flex;
78
- flex-wrap: wrap;
79
- /*height: 28px;*/
80
- }
81
-
82
- .icon {
83
- margin-top: 0px;
84
- /*margin-right: 10px;*/
85
- line-height: 28px;
86
- font-size: 14px;
87
- color: #bbbbbb;
88
- float: right;
89
- }
90
- </style>
@@ -1,182 +0,0 @@
1
- <template>
2
- <ExFooter
3
- :height="nowHeight"
4
- ref="footer"
5
- style="display: flex; flex-direction: column"
6
- >
7
- <div
8
- class="asideDrag"
9
- @mousedown="mousedown($event)"
10
- v-if="!noDrag"
11
- :class="{ dragShowCls: dragShow }"
12
- @mouseover="dragShow = true"
13
- @mouseout="dragShow = false"
14
- ></div>
15
- <div ref="moveline" class="moveline" v-show="dragFrom != null"></div>
16
- <div class="hdFooter">
17
- <template v-if="title">
18
- <div class="hd-title">
19
- <div align="left" style="float: left">{{ $t(title) }}</div>
20
- <slot name="title"></slot>
21
- <div align="right" v-if="arrowShow">
22
- <i
23
- v-bind:class="[fa, arrowClass]"
24
- @click="isShrink ? doShrink(false) : doShrink(true)"
25
- style="cursor: pointer"
26
- >
27
- </i>
28
- </div>
29
- </div>
30
- </template>
31
- <div style="flex: 1; height: 100%; position: relative">
32
- <div
33
- style="position: absolute; width: 100%; height: 100%"
34
- v-show="!isShrink"
35
- >
36
- <slot></slot>
37
- </div>
38
- </div>
39
- </div>
40
- </ExFooter>
41
- </template>
42
-
43
- <script>
44
- /**
45
- * 覆写ElFooter,增加拖动和title
46
- * 插槽:<slot name="title"></slot> title进行额外扩展如增加按钮等
47
- * @module HdFooter
48
- */
49
- export default {
50
- name: 'HdFooter',
51
- component: {},
52
- /**
53
- * Props 继承ElFooter属性和事件,,如果仅需要elementui的ElFooter请使用ExFooter
54
- * @prop {String} title 标题
55
- * @prop {Boolen} arrowShow 是否显示一键收缩
56
- * @prop {Boolen} noDrag 是否可拖动,默认否
57
- */
58
- props: {
59
- height: String,
60
- title: String,
61
- arrowShow: { type: Boolean, default: true },
62
- noDrag: { type: Boolean, default: false },
63
- },
64
- inheritAttrs: false,
65
- data() {
66
- return {
67
- isShrink: false, // 收缩还是展开
68
- dragFrom: null,
69
- iconCls: 'el-icon-d-caret',
70
- arrowClass: 'fa-chevron-down',
71
- fa: 'fa',
72
- inputHeight: 0,
73
- nowHeight: '100px',
74
- dragShow: false,
75
- }
76
- },
77
- mounted() {
78
- if (this.height) {
79
- this.nowHeight = this.height
80
- }
81
- this.inputHeight = this.nowHeight
82
- },
83
- methods: {
84
- doShrink(isShrink) {
85
- if (isShrink) {
86
- if (this.title) {
87
- this.nowHeight = '30px'
88
- } else {
89
- this.nowHeight = '15px'
90
- }
91
- this.arrowClass = 'fa-chevron-up'
92
- } else {
93
- this.nowHeight = this.inputHeight
94
- this.arrowClass = 'fa-chevron-down'
95
- }
96
- this.isShrink = isShrink
97
- },
98
- mousedown: function (event) {
99
- this.$set(this.$store.state, 'hotKey', '-1') //避免热键样式影响体验
100
- this.dragFrom = event.y
101
- this.$refs.moveline.style.top = this.dragFrom + 'px'
102
- document.documentElement.addEventListener(
103
- 'mousemove',
104
- this.handleMove,
105
- true
106
- )
107
- document.documentElement.addEventListener(
108
- 'mouseup',
109
- this.handleMouseup,
110
- true
111
- )
112
- },
113
- handleMove: function (event) {
114
- this.$refs.moveline.style.top = event.y + 'px'
115
- },
116
- handleMouseup: function (event) {
117
- document.documentElement.removeEventListener(
118
- 'mousemove',
119
- this.handleMove,
120
- true
121
- )
122
- document.documentElement.removeEventListener(
123
- 'mouseup',
124
- this.handleMouseup,
125
- true
126
- )
127
- let newHeight =
128
- this.$refs.footer.$el.offsetHeight - event.y + this.dragFrom
129
- this.nowHeight = newHeight + 'px'
130
- this.dragFrom = null
131
- this.$set(this.$store.state, 'hotKey', null) //避免热键样式影响体验
132
- if (newHeight <= 70) {
133
- // 少于一定宽度自动收缩
134
- this.doShrink(true)
135
- }
136
- if (newHeight >= 100) {
137
- // 少于一定宽度自动收缩
138
- this.isShrink = false
139
- }
140
- },
141
- },
142
- watch: {
143
- nowHeight(val) {
144
- this.$emit('update:height', val)
145
- },
146
- width(val) {
147
- this.nowHeight = val
148
- },
149
- },
150
- }
151
- </script>
152
-
153
- <style lang="scss" rel="stylesheet/scss" scoped>
154
- .hdFooter {
155
- display: flex;
156
- flex-direction: column;
157
- flex: 1;
158
- }
159
-
160
- .asideDrag {
161
- width: 100%;
162
- height: 5px;
163
- overflow: hidden;
164
- cursor: ns-resize;
165
- user-select: none;
166
- }
167
-
168
- .moveline {
169
- width: 100%;
170
- height: 5px;
171
- overflow: hidden;
172
- position: fixed;
173
- cursor: ns-resize;
174
- background-color: red;
175
- z-index: 9999;
176
- user-select: none;
177
- }
178
-
179
- .dragShowCls {
180
- background-color: #409eff;
181
- }
182
- </style>
@@ -1,351 +0,0 @@
1
- <template>
2
- <div style="height: 100%">
3
- <el-form v-bind="$attrs" v-on="$listeners" ref="hdform">
4
- <slot> </slot>
5
- <extend-form
6
- v-if="exFieldCode"
7
- :gridCode="exFieldCode"
8
- :hdformThis="() => $refs.hdform"
9
- ></extend-form>
10
- </el-form>
11
- </div>
12
- </template>
13
-
14
- <script>
15
- import ExtendForm from './ExtendForm'
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
- },
35
- /**
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
42
- */
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
- },
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)
67
- }
68
- }
69
- }
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
- // 增加的
97
- const data = response.data
98
- data._isAdd = true // 新增标志
99
- this.$emit('update:model', data)
100
- this.$nextTick(() => {
101
- if (this.$refs.hdform) {
102
- this.$refs.hdform.clearValidate()
103
- }
104
- })
105
- })
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
- // 异步
125
- this.index = this.gridThis.hdResult.rows.length - 1
126
- this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
127
- this.choose(this.gridThis.hdQuery.selRow)
128
- return true
129
- })
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
150
- }
151
- this.gridThis.hdQuery._noLoadingOnce = true
152
- this.gridThis.hdQuery
153
- .doCurPageChange(this.gridThis.hdQuery.page + 1)
154
- .then(() => {
155
- // 翻页成功才能执行
156
- this.index = 0
157
- this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
158
- this.choose(this.gridThis.$refs.hdgrid.hdQuery.selRow)
159
- return true
160
- })
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
- ) {
173
- return true
174
- }
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(() => {
189
- this.index = 0
190
- this.gridThis.$refs.hdgrid.setCurrentRow(0)
191
- this.choose(this.gridThis.hdQuery.selRow)
192
- })
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(() => {
206
- this.index = 0
207
- this.gridThis.$refs.hdgrid.setCurrentRow(0)
208
- this.choose(this.gridThis.hdQuery.selRow)
209
- })
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)
230
- }
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) => {
262
- this.loading = false
263
- const data = response.data
264
- this.$message({
265
- type: data.code == '-1' ? 'error' : 'success',
266
- message: data.message,
267
- duration: 1500,
268
- })
269
- if (data.code == '-1') {
270
- reject(data)
271
- return
272
- }
273
- this.$emit('saveCall', data.data, this.$attrs.model._isAdd)
274
- if (this.$attrs.model._isAdd) {
275
- // this.index++ // 插入的index+1
276
- // this.gridThis.hdResult.rows.splice(this.index, 0, data.data)
277
- // this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
278
-
279
- // this.index = 0 // 插入的index+1
280
- console.log(this.gridThis.hdResult.rows)
281
- this.gridThis.hdResult.rows.unshift(data.data)
282
- this.gridThis.$refs.hdgrid.setCurrentRow(this.index)
283
- } else {
284
- Object.assign(
285
- this.gridThis.hdResult.rows[this.index],
286
- data.data
287
- )
288
- }
289
- this.$emit('update:model', Object.assign({}, data.data))
290
- resolve(data)
291
- })
292
- .catch(() => {
293
- this.loading = false
294
- reject()
295
- })
296
- })
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);
334
- })
335
- .catch(() => {
336
- reject()
337
- })
338
- })
339
- .catch(() => {
340
- reject()
341
- })
342
- })
343
- return promise
344
- },
345
- doAdd() {
346
- this.index = 0
347
- this.choose('')
348
- },
349
- },
350
- }
351
- </script>