eztech-core-components 1.0.68 → 1.0.73

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
- if (this.isAdmin) {
86
- return null
85
+ let val = 'is_active:true:boolean:eq'
86
+ if (!this.isAdmin) {
87
+ val += ',is_admin:false:boolean:eq'
87
88
  }
88
- return 'is_admin:false:boolean:eq'
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.isRoleUsers) {
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,6 +1,6 @@
1
1
  {
2
2
  "name": "eztech-core-components",
3
- "version": "1.0.68",
3
+ "version": "1.0.73",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,10 +1,17 @@
1
1
  import { getFormBoolean } from './data-helper'
2
2
 
3
3
  export const getFormComponent = ({
4
- col_field, col_type, col_readonly,
5
- col_multiple, col_length, ref_table,
6
- ref_column, trigger_fields, enum_values,
7
- col_default, is_file_secret
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,
@@ -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)
@@ -1346,6 +1346,7 @@ export const tableMethods = {
1346
1346
 
1347
1347
  export const getAsyncData = async ({
1348
1348
  $axios,
1349
+ store,
1349
1350
  projectId,
1350
1351
  tableName,
1351
1352
  apiName,
@@ -1551,8 +1552,18 @@ export const getAsyncData = async ({
1551
1552
  }
1552
1553
  }
1553
1554
  if (col.columns && col.columns.length > 0 && !conf.tableHidden) {
1554
- const searchStringTables = ['firearm_gun', 'cstm_crime_places']
1555
- const searchStringFields = ['model_id', 'calibre_id', 'expert_id']
1555
+ const searchStringTables = [
1556
+ 'firearm_gun',
1557
+ 'cstm_crime_places'
1558
+ ]
1559
+ const searchStringFields = [
1560
+ 'model_id',
1561
+ 'calibre_id',
1562
+ 'expert_id'
1563
+ ]
1564
+ const searchAllStringFields = [
1565
+ 'position_id'
1566
+ ]
1556
1567
  conf.columns = getColumns(col.columns, parentKeys.concat(col.col_field), parentFields[col.col_field] || {})
1557
1568
  const showChildColumn = conf.columns?.filter(c => !c.tableHidden && !['color', 'is_ping', 'code'].includes(c.col_field))
1558
1569
  conf.hasChildren = showChildColumn.length > 1
@@ -1577,11 +1588,12 @@ export const getAsyncData = async ({
1577
1588
  conf.props.width = get(confChild, 'props.width')
1578
1589
  conf.props['min-width'] = get(confChild, 'props.min-width')
1579
1590
  }
1580
- if (searchStringTables.includes(table?.name) && searchStringFields.includes(col.col_field)) {
1591
+ if ((searchStringTables.includes(table?.name) && searchStringFields.includes(col.col_field)) || searchAllStringFields.includes(col.col_field)) {
1581
1592
  conf.search_type = confChild?.col_type
1582
1593
  conf.search_key = confChild?.col_key
1583
1594
  conf.search_op = 'start'
1584
1595
  }
1596
+
1585
1597
  // if (['created_by'].includes(conf.col_key)) {
1586
1598
  // conf.child_key = `${conf.col_key}.full_name`
1587
1599
  // conf.search_type = 'string'
@@ -1612,6 +1624,9 @@ export const getAsyncData = async ({
1612
1624
  if (c.col_type === 'pkid') {
1613
1625
  return true
1614
1626
  }
1627
+ if (c.col_field === 'year' && c.col_default === 'current_reg_year' && store?.getters?.isClosedRegYear) {
1628
+ return false
1629
+ }
1615
1630
  return true
1616
1631
  })
1617
1632
  return showColumns