eztech-core-components 1.0.69 → 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.69",
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,
@@ -1623,6 +1624,9 @@ export const getAsyncData = async ({
1623
1624
  if (c.col_type === 'pkid') {
1624
1625
  return true
1625
1626
  }
1627
+ if (c.col_field === 'year' && c.col_default === 'current_reg_year' && store?.getters?.isClosedRegYear) {
1628
+ return false
1629
+ }
1626
1630
  return true
1627
1631
  })
1628
1632
  return showColumns