eztech-core-components 1.0.69 → 1.0.74
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.
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
project-id="5"
|
|
47
47
|
:col_multiple="true"
|
|
48
48
|
:disabled="!isSetRole"
|
|
49
|
-
ref_column="name"
|
|
49
|
+
ref_column="name,is_active"
|
|
50
50
|
:trigger_fields="roleTriggerFields"
|
|
51
51
|
@input="($event) => handleChangeRole(scope.row._id, $event)"
|
|
52
52
|
/>
|
|
@@ -82,10 +82,11 @@ export default {
|
|
|
82
82
|
return this.level?.is_admin
|
|
83
83
|
},
|
|
84
84
|
roleTriggerFields () {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
let val = 'is_active:true:boolean:eq'
|
|
86
|
+
if (!this.isAdmin) {
|
|
87
|
+
val += ',is_admin:false:boolean:eq'
|
|
87
88
|
}
|
|
88
|
-
return
|
|
89
|
+
return val
|
|
89
90
|
}
|
|
90
91
|
},
|
|
91
92
|
watch: {
|
|
@@ -182,8 +182,11 @@ export default {
|
|
|
182
182
|
isRegConfirmUser () {
|
|
183
183
|
return this.col_field?.includes('reg_confirm_user_id')
|
|
184
184
|
},
|
|
185
|
+
isDriver () {
|
|
186
|
+
return this.col_field === 'driver_id'
|
|
187
|
+
},
|
|
185
188
|
isRoleUsers () {
|
|
186
|
-
return this.isRegUsers || this.isExpertUsers || this.isPsychologists || this.isFirearmExpert || this.isGrantExpert || this.isRegConfirmUser
|
|
189
|
+
return this.isDriver || this.isRegUsers || this.isExpertUsers || this.isPsychologists || this.isFirearmExpert || this.isGrantExpert || this.isRegConfirmUser
|
|
187
190
|
},
|
|
188
191
|
isMultiple () {
|
|
189
192
|
return getFormBoolean(this.col_multiple)
|
|
@@ -381,7 +384,19 @@ export default {
|
|
|
381
384
|
triggerSearch[localKey] = { val: localVal, t: type, op: operation }
|
|
382
385
|
}
|
|
383
386
|
}
|
|
384
|
-
if (this.
|
|
387
|
+
if (this.isDriver) {
|
|
388
|
+
const { data: list } = await this.$axios.get('forensic/driver/users', {
|
|
389
|
+
process: false,
|
|
390
|
+
cancelToken: new CancelToken(function executor (c) {
|
|
391
|
+
that.cancel = c
|
|
392
|
+
}),
|
|
393
|
+
params: {
|
|
394
|
+
searchText: this.searchText,
|
|
395
|
+
search: JSON.stringify(triggerSearch)
|
|
396
|
+
}
|
|
397
|
+
})
|
|
398
|
+
this.list = list
|
|
399
|
+
} else if (this.isRoleUsers) {
|
|
385
400
|
const { data: list } = await this.$axios.get('forensic/role/users', {
|
|
386
401
|
process: false,
|
|
387
402
|
cancelToken: new CancelToken(function executor (c) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { getFormBoolean } from './data-helper'
|
|
2
2
|
|
|
3
3
|
export const getFormComponent = ({
|
|
4
|
-
col_field,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
col_field,
|
|
5
|
+
col_type,
|
|
6
|
+
col_readonly,
|
|
7
|
+
col_multiple,
|
|
8
|
+
col_length,
|
|
9
|
+
ref_table,
|
|
10
|
+
ref_column,
|
|
11
|
+
trigger_fields,
|
|
12
|
+
enum_values,
|
|
13
|
+
col_default,
|
|
14
|
+
is_file_secret
|
|
8
15
|
}, {
|
|
9
16
|
isInline = false,
|
|
10
17
|
formReadonly = false,
|
|
@@ -182,7 +189,7 @@ export const getFormComponent = ({
|
|
|
182
189
|
name = 'CustomUserSelect'
|
|
183
190
|
} else if (['organization_id', 'parent_id'].some(c => col_field.includes(c)) && !['other_organization_id', 'rest_organization_id'].some(c => col_field.includes(c))) {
|
|
184
191
|
name = 'CoreSelectTree'
|
|
185
|
-
} else if (ref_table === 'hrm_employees') {
|
|
192
|
+
} else if (ref_table === 'hrm_employees' && col_multiple) {
|
|
186
193
|
name = 'HrmEmployeeSelect'
|
|
187
194
|
} else {
|
|
188
195
|
name = 'CoreSelect'
|
|
@@ -305,11 +312,15 @@ export const getColWidth = ({ col_type, col_multiple, col_length, col_key, col_f
|
|
|
305
312
|
}
|
|
306
313
|
return valWidth
|
|
307
314
|
}
|
|
308
|
-
export const isHidden = ({ col_field, col_hidden }, subColumn) => {
|
|
309
|
-
|
|
315
|
+
export const isHidden = ({ col_field, col_hidden }, subColumn, apiName) => {
|
|
316
|
+
const isColHidden = getFormBoolean(col_hidden)
|
|
317
|
+
if (isColHidden && apiName?.includes('vw_rprt') && ['current_user_id'].includes(col_field)) {
|
|
318
|
+
return false
|
|
319
|
+
}
|
|
320
|
+
if (!isColHidden && ['oid', 'xyp_log_id', 'created_user_id'].includes(col_field)) {
|
|
310
321
|
return true
|
|
311
322
|
}
|
|
312
|
-
if (
|
|
323
|
+
if (isColHidden) {
|
|
313
324
|
return true
|
|
314
325
|
}
|
|
315
326
|
if (subColumn) {
|
package/utils/table-helper.js
CHANGED
|
@@ -35,7 +35,7 @@ export const tableWatch = {
|
|
|
35
35
|
}
|
|
36
36
|
export const tableComputed = {
|
|
37
37
|
...mapGetters('settings', ['unsavedChanges', 'loadingWindow', 'env']),
|
|
38
|
-
...mapGetters(['user_position_id', 'refs', 'regYear']),
|
|
38
|
+
...mapGetters(['user_position_id', 'refs', 'regYear', 'isClosedRegYear']),
|
|
39
39
|
...mapGetters('user', ['token', 'authType']),
|
|
40
40
|
localeId () {
|
|
41
41
|
return this.tempLocaleId || this.locale?._id || (this.locales?.length ? this.locales[0]._id : null)
|
|
@@ -535,7 +535,12 @@ export const tableMethods = {
|
|
|
535
535
|
if (['decimal', 'number'].includes(col.col_type)) {
|
|
536
536
|
trigger = 'blur'
|
|
537
537
|
}
|
|
538
|
-
rules[col.col_field].push({
|
|
538
|
+
rules[col.col_field].push({
|
|
539
|
+
type: ruleType,
|
|
540
|
+
required: true,
|
|
541
|
+
trigger,
|
|
542
|
+
message: options?.noMessage ? ' ' : `"${col.form.label || (col.props && col.props.label) || 'no label'}" утга шаардана.`
|
|
543
|
+
})
|
|
539
544
|
} else if (trigger_required) {
|
|
540
545
|
let trigger = 'change'
|
|
541
546
|
if (['decimal', 'number'].includes(col.col_type)) {
|
|
@@ -551,11 +556,19 @@ export const tableMethods = {
|
|
|
551
556
|
})
|
|
552
557
|
}
|
|
553
558
|
if (col.col_field && col.col_field.toLowerCase().endsWith('mail')) {
|
|
554
|
-
rules[col.col_field].push({
|
|
559
|
+
rules[col.col_field].push({
|
|
560
|
+
type: 'email',
|
|
561
|
+
trigger: 'change',
|
|
562
|
+
message: options?.noMessage ? ' ' : `"${col.form.label || (col.props && col.props.label) || 'no label'}" буруу байна.`
|
|
563
|
+
})
|
|
555
564
|
} else {
|
|
556
565
|
const { pattern, patternMessage } = getRegexp(col.col_field, col.form.pattern)
|
|
557
566
|
if (pattern) {
|
|
558
|
-
rules[col.col_field].push({
|
|
567
|
+
rules[col.col_field].push({
|
|
568
|
+
type: 'regexp',
|
|
569
|
+
pattern, trigger: 'change',
|
|
570
|
+
message: options?.noMessage ? ' ' : `${patternMessage || 'Утга буруу байна.'}`
|
|
571
|
+
})
|
|
559
572
|
}
|
|
560
573
|
}
|
|
561
574
|
if (col.form.min) {
|
|
@@ -1346,6 +1359,7 @@ export const tableMethods = {
|
|
|
1346
1359
|
|
|
1347
1360
|
export const getAsyncData = async ({
|
|
1348
1361
|
$axios,
|
|
1362
|
+
store,
|
|
1349
1363
|
projectId,
|
|
1350
1364
|
tableName,
|
|
1351
1365
|
apiName,
|
|
@@ -1458,7 +1472,7 @@ export const getAsyncData = async ({
|
|
|
1458
1472
|
ref_table: col.ref_table,
|
|
1459
1473
|
ref_column: col.ref_column,
|
|
1460
1474
|
trigger_fields: col.trigger_fields,
|
|
1461
|
-
col_hidden: isHidden(col, subColumn),
|
|
1475
|
+
col_hidden: isHidden(col, subColumn, apiName),
|
|
1462
1476
|
col_length: col.col_length,
|
|
1463
1477
|
col_nullable: col.col_nullable,
|
|
1464
1478
|
col_multiple: col.col_multiple,
|
|
@@ -1623,6 +1637,9 @@ export const getAsyncData = async ({
|
|
|
1623
1637
|
if (c.col_type === 'pkid') {
|
|
1624
1638
|
return true
|
|
1625
1639
|
}
|
|
1640
|
+
if (c.col_field === 'year' && c.col_default === 'current_reg_year' && store?.getters?.isClosedRegYear) {
|
|
1641
|
+
return false
|
|
1642
|
+
}
|
|
1626
1643
|
return true
|
|
1627
1644
|
})
|
|
1628
1645
|
return showColumns
|