hd-idevvue3 3.0.2 → 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.
- package/dist/assets/index.9c127719.css +1 -0
- package/dist/hd-idevvue3.mjs +3521 -3305
- package/dist/hd-idevvue3.umd.js +29 -29
- package/npminstall-debug.log +2 -10
- package/package.json +4 -2
- package/pnpm-lock.yaml +37 -4
- package/src/App.vue +11 -15
- package/src/assets/sound/notify.wav +0 -0
- package/src/demo/demo.vue +9 -10
- package/src/demo/dropdemo.vue +42 -43
- package/src/demo/extsets.vue +140 -39
- package/src/demo/formedit.vue +157 -145
- package/src/demo/hightquery.vue +263 -66
- package/src/demo/inlineedit.vue +129 -35
- package/src/demo/selfdrop.vue +32 -15
- package/src/directive/el-dragDialog/drag.js +13 -13
- package/src/directive/el-dragDialog/index.js +13 -13
- package/src/errorLog.js +3 -3
- package/src/hdcom/BigGrid.js +54 -48
- package/src/hdcom/BillShow.vue +84 -63
- package/src/hdcom/BillUpload.vue +144 -86
- package/src/hdcom/BtnRight.vue +26 -23
- package/src/hdcom/ErrHint.vue +36 -24
- package/src/hdcom/ExtendColumn.vue +97 -90
- package/src/hdcom/ExtendCommon.js +24 -13
- package/src/hdcom/ExtendForm.vue +107 -80
- package/src/hdcom/FacePicUpload.vue +59 -50
- package/src/hdcom/FaceRecTest.vue +87 -77
- package/src/hdcom/GridChart.vue +175 -162
- package/src/hdcom/GridExField.vue +328 -234
- package/src/hdcom/GridShow.vue +89 -39
- package/src/hdcom/HdAside.vue +192 -145
- package/src/hdcom/HdBtn.vue +44 -32
- package/src/hdcom/HdButton.vue +141 -117
- package/src/hdcom/HdComFaceRec.vue +80 -32
- package/src/hdcom/HdComGrid.vue +329 -229
- package/src/hdcom/HdComQuery.vue +179 -90
- package/src/hdcom/HdComQueryDetail.vue +159 -115
- package/src/hdcom/HdComSortDetail.vue +136 -130
- package/src/hdcom/HdDatePicker.vue +32 -16
- package/src/hdcom/HdDialog.vue +62 -44
- package/src/hdcom/HdDrop.vue +163 -138
- package/src/hdcom/HdFileUpload.vue +138 -119
- package/src/hdcom/HdFilterBox.vue +62 -62
- package/src/hdcom/HdFooter.vue +152 -119
- package/src/hdcom/HdForm.vue +276 -203
- package/src/hdcom/HdFormBtn.vue +81 -39
- package/src/hdcom/HdFormItem.vue +14 -10
- package/src/hdcom/HdGrid.vue +353 -156
- package/src/hdcom/HdGridEditBtn.vue +34 -20
- package/src/hdcom/HdGridExt.js +78 -47
- package/src/hdcom/HdGridSel.vue +227 -193
- package/src/hdcom/HdHeader.vue +149 -117
- package/src/hdcom/HdHotKey.vue +70 -67
- package/src/hdcom/HdInputHint.vue +40 -36
- package/src/hdcom/HdMain.vue +25 -27
- package/src/hdcom/HdMessage.vue +180 -171
- package/src/hdcom/HdNum.vue +67 -57
- package/src/hdcom/HdPopSel.vue +46 -24
- package/src/hdcom/HdRightMenu.vue +63 -61
- package/src/hdcom/HdSel/SelGridFieldcod.vue +46 -28
- package/src/hdcom/HdTableColumn.vue +156 -109
- package/src/hdcom/HdTempSave.vue +138 -116
- package/src/hdcom/HdTree.vue +89 -72
- package/src/hdcom/HdTreeTable/eval.js +8 -3
- package/src/hdcom/HdTreeTable/index.vue +229 -174
- package/src/hdcom/ImportExcel.vue +69 -34
- package/src/hdcom/index.js +39 -44
- package/src/idev.common.js +54 -47
- package/src/index.js +3 -6
- package/src/utils/HdQuery.js +25 -14
- package/src/utils/comutils.js +50 -28
- package/src/utils/gogocodeTransfer.js +59 -0
- package/src/utils/utils.js +30 -19
- package/src/vendor/Blob.js +187 -179
- package/src/vendor/Export2Excel.js +231 -220
- package/src/vendor/Export2Zip.js +25 -22
- package/src/views/layout/AppMain.vue +34 -32
- package/src/views/layout/HdLayout.vue +64 -52
- package/src/views/layout/header/ElasticSearch.vue +196 -159
- package/src/views/layout/header/HZRecorder.js +163 -135
- package/src/views/layout/header/HeaderSearch.vue +165 -145
- package/src/views/layout/header/Levelbar.vue +55 -49
- package/src/views/layout/header/MainHeader.vue +233 -189
- package/src/views/layout/header/Navbar.vue +74 -78
- package/src/views/layout/header/ScrollPane.vue +103 -81
- package/src/views/layout/header/TagsView.vue +169 -164
- package/src/views/layout/header/VocRec.vue +86 -78
- package/src/views/layout/header/changepswform.vue +98 -64
- package/src/views/layout/index.js +5 -7
- package/src/views/layout/menu/Hamburger.vue +63 -45
- package/src/views/layout/menu/HdMenu.vue +155 -118
- package/src/views/layout/menu/index.vue +21 -19
- package/src/views/privilege/commsg/commsg.vue +115 -41
- package/src/views/privilege/commsg/commsgOrgn.vue +40 -31
- package/src/views/privilege/commsg/commsgRole.vue +180 -109
- package/src/views/privilege/commsg/commsgform.vue +125 -101
- package/src/views/privilege/commsg/commsgiframe.vue +30 -23
- package/src/views/privilege/commsg/commsgto.vue +163 -84
- package/src/views/privilege/commsg/commsgtoform.vue +64 -58
- package/src/views/privilege/commsg/commsgtrans.vue +187 -115
- package/src/views/privilege/exfield/comexcolumn.vue +133 -43
- package/src/views/privilege/exfield/comexcolumnform.vue +85 -58
- package/src/views/privilege/exfield/comexfield.vue +15 -17
- package/src/views/privilege/exfield/comexfieldform.vue +71 -53
- package/src/views/privilege/exfield/comexfieldsub.vue +137 -46
- package/src/views/privilege/index.js +19 -20
- package/src/views/privilege/menu/comMenu.vue +49 -41
- package/src/views/privilege/menu/menu.vue +166 -49
- package/src/views/privilege/menu/menuinfo.vue +41 -34
- package/src/views/privilege/menu/rolelist.vue +78 -33
- package/src/views/privilege/menu/userlist.vue +76 -33
- package/src/views/privilege/mobile/authmobileupdate.vue +119 -43
- package/src/views/privilege/mobile/authmobileupdateform.vue +76 -46
- package/src/views/privilege/orgDept/authOrgn.vue +157 -65
- package/src/views/privilege/orgDept/authorgnform.vue +50 -38
- package/src/views/privilege/orgDept/orgDept.vue +38 -37
- package/src/views/privilege/orgDept/orgTree.vue +99 -88
- package/src/views/privilege/orgDept/orgnselect.vue +132 -111
- package/src/views/privilege/personDept/authuser.vue +197 -91
- package/src/views/privilege/personDept/authuserform.vue +123 -71
- package/src/views/privilege/personDept/facerec.vue +128 -83
- package/src/views/privilege/personDept/orgncascader.vue +134 -115
- package/src/views/privilege/personDept/personDept.vue +9 -7
- package/src/views/privilege/quartz/comquartzjob.vue +123 -38
- package/src/views/privilege/quartz/comquartzjobform.vue +67 -51
- package/src/views/privilege/quartz/comquartzlog.vue +116 -32
- package/src/views/privilege/role/btnRole.vue +123 -67
- package/src/views/privilege/role/menuRole.vue +65 -45
- package/src/views/privilege/role/orgnRole.vue +63 -41
- package/src/views/privilege/role/role.vue +26 -9
- package/src/views/privilege/role/rolelist.vue +114 -45
- package/src/views/privilege/role/roleselect.vue +34 -17
- package/src/views/privilege/search/comsearch.vue +164 -73
- package/src/views/privilege/search/menu.vue +38 -22
- package/src/views/privilege/syscode/syscode.vue +157 -69
- package/src/views/privilege/syscode/sysfield.vue +96 -43
- package/src/views/privilege/syscode/sysfieldframe.vue +30 -30
- package/src/views/privilege/syslog/menulog.vue +38 -22
- package/src/views/privilege/syslog/syslog.vue +145 -78
- package/src/views/privilege/syslog/syslogconfig.vue +91 -24
- package/src/views/privilege/syslog/syslogform.vue +45 -43
- package/src/views/privilege/syslog/syslogframe.vue +26 -26
- package/src/views/privilege/userRole/userRole.vue +187 -89
- package/vite.config.js +7 -0
- package/dist/assets/index.774ef40e.css +0 -1
- package/src/views/privilege.zip +0 -0
package/src/hdcom/HdForm.vue
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
16
|
-
* @
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
this.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
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.
|
|
146
|
-
this.gridThis.
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
this
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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(
|
|
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
|
-
})
|
|
291
|
+
})
|
|
292
|
+
.catch(() => {
|
|
227
293
|
this.loading = false
|
|
228
294
|
reject()
|
|
229
295
|
})
|
|
230
|
-
})
|
|
231
296
|
})
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
|
|
250
|
-
reject(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
342
|
+
})
|
|
343
|
+
return promise
|
|
344
|
+
},
|
|
345
|
+
doAdd() {
|
|
346
|
+
this.index = 0
|
|
347
|
+
this.choose('')
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
}
|
|
277
351
|
</script>
|
|
278
|
-
|