vue2-client 1.8.248 → 1.8.249
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/package.json
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
<script>
|
|
70
70
|
import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
|
|
71
71
|
import dayjs from 'dayjs'
|
|
72
|
+
import { mapState } from 'vuex'
|
|
72
73
|
|
|
73
74
|
export default {
|
|
74
75
|
name: 'XForm',
|
|
@@ -104,6 +105,7 @@ export default {
|
|
|
104
105
|
}
|
|
105
106
|
},
|
|
106
107
|
computed: {
|
|
108
|
+
...mapState('account', { currUser: 'user' }),
|
|
107
109
|
// 过滤掉仅用于新增/修改场景的表单项
|
|
108
110
|
realJsonData: function () {
|
|
109
111
|
return this.formItems.filter(item => (!item.isOnlyAddOrEdit && item.type !== 'group') || (item.type === 'group' && item.groupItems.some(groupItem => !groupItem.isOnlyAddOrEdit)))
|
|
@@ -178,6 +180,16 @@ export default {
|
|
|
178
180
|
if (item.queryFormDefault) {
|
|
179
181
|
if (['datePicker', 'rangePicker', 'yearPicker', 'monthPicker'].includes(item.type)) {
|
|
180
182
|
formData[item.model] = this.getDateRange(item.type, item.queryFormDefault)
|
|
183
|
+
} else if (['treeSelect'].includes(item.type) && ['curOrgId', 'curDepId', 'curUserId'].includes(item.queryFormDefault)) {
|
|
184
|
+
if (item.queryFormDefault === 'curOrgId') {
|
|
185
|
+
formData[item.model] = [this.currUser.orgid]
|
|
186
|
+
}
|
|
187
|
+
if (item.queryFormDefault === 'curDepId') {
|
|
188
|
+
formData[item.model] = [this.currUser.depids]
|
|
189
|
+
}
|
|
190
|
+
if (item.queryFormDefault === 'curUserId') {
|
|
191
|
+
formData[item.model] = [this.currUser.id]
|
|
192
|
+
}
|
|
181
193
|
} else {
|
|
182
194
|
formData[item.model] = item.queryFormDefault
|
|
183
195
|
}
|