eztech-core-components 1.0.48 → 1.0.50

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.
@@ -47,6 +47,7 @@ export default {
47
47
  value: { type: [String, Array, Number, Object], default: null },
48
48
  table_name: { type: String, default: null },
49
49
  ref_column: { type: String, default: null },
50
+ col_field: { type: String, default: null },
50
51
  projectId: { type: [String, Number], default: null },
51
52
  col_multiple: { type: [Boolean, Number, String], default: false },
52
53
  trigger_fields: { type: String, default: '' },
@@ -203,7 +203,7 @@ export default {
203
203
  },
204
204
  val0: {
205
205
  get () {
206
- const val1 = get(this.value, '[1]')
206
+ const val1 = get(this.value, '[0]')
207
207
  const val = ['', undefined].includes(val1) ? null : val1
208
208
  if (['number', 'decimal'].includes(this.colType) && val && !this.col?.col_field?.includes('year')) {
209
209
  return val.$format()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eztech-core-components",
3
- "version": "1.0.48",
3
+ "version": "1.0.50",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -17,7 +17,9 @@ export const getFormComponent = ({
17
17
  }) => {
18
18
  let name = 'ElInput'
19
19
  let props = { disabled: formReadonly || getFormBoolean(col_readonly) }
20
- if (col_field.endsWith('duration_justified')) {
20
+ if (col_field === 'year' && col_default === 'current_reg_year') {
21
+ name = 'RegYear'
22
+ } else if (col_field.endsWith('duration_justified')) {
21
23
  name = 'CoreDurationJustified'
22
24
  } else if (col_field === 'app_password') {
23
25
  name = 'CoreAppPassword'
@@ -124,11 +126,6 @@ export const getFormComponent = ({
124
126
  }
125
127
  }
126
128
  } else if (['date'].includes(col_type)) {
127
- // if (col_field.endsWith('start_date')) {
128
- // name = 'CoreDateRange'
129
- // } else {
130
- // name = 'CoreDate'
131
- // }
132
129
  if (col_field.endsWith('end_date')) {
133
130
  props = { ...props, col_field }
134
131
  } else if (col_field.endsWith('_month')) {
@@ -185,6 +182,8 @@ export const getFormComponent = ({
185
182
  name = 'CustomUserSelect'
186
183
  } else if (['organization_id', 'parent_id'].some(c => col_field.includes(c)) && !['other_organization_id', 'rest_organization_id'].some(c => col_field.includes(c))) {
187
184
  name = 'CoreSelectTree'
185
+ } else if (ref_table === 'hrm_employees') {
186
+ name = 'HrmEmployeeSelect'
188
187
  } else {
189
188
  name = 'CoreSelect'
190
189
  }
@@ -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']),
38
+ ...mapGetters(['user_position_id', 'refs', 'regYear']),
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)
@@ -499,7 +499,10 @@ export const tableMethods = {
499
499
  set(defaultTemp, col.col_field, null)
500
500
  continue
501
501
  }
502
- if (col.form.col_default === 'now') {
502
+ if (col.form.col_default === 'current_reg_year') {
503
+ set(defaultTemp, col.col_field, this.regYear)
504
+ ruleType = 'number'
505
+ } else if (col.form.col_default === 'now') {
503
506
  set(defaultTemp, col.col_field, this.$moment().format('YYYY-MM-DD'))
504
507
  } else if (['decimal', 'number'].includes(col.col_type)) {
505
508
  ruleType = 'number'