bfg-common 1.4.686 → 1.4.687

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.
@@ -89,17 +89,20 @@ import type {
89
89
  UI_I_DataTableHeader,
90
90
  UI_I_DataTableBody,
91
91
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
92
+ import type { UI_T_Project } from '~/lib/models/types'
92
93
  import type { UI_I_Localization } from '~/lib/models/interfaces'
93
94
  import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
94
95
  import type { T_TypeNodes } from '~/lib/models/types'
95
96
 
96
97
  import {
97
98
  options,
99
+ getTargetActionsFunc,
98
100
  getHeaderDataFunc,
99
101
  getBodyDataFunc,
100
102
  } from '~/components/common/pages/tasks/table/lib/config/config'
101
103
 
102
104
  const props = defineProps<{
105
+ project: UI_T_Project
103
106
  tableData: UI_I_RecentTaskItem<T_TypeNodes>[]
104
107
  loading: boolean
105
108
  }>()
@@ -139,20 +142,9 @@ const onSorting = (value: string): void => {
139
142
  emits('sort', value)
140
143
  }
141
144
 
142
- const actions = computed<UI_I_Dropdown[]>(() => [
143
- {
144
- value: 'view-target',
145
- text: localization.value.common.viewTarget,
146
- iconName: 'hide',
147
- selected: false,
148
- },
149
- {
150
- value: 'view-zone',
151
- text: localization.value.common.viewZone,
152
- iconName: 'hide',
153
- selected: false,
154
- },
155
- ])
145
+ const actions = computed<UI_I_Dropdown[]>(() =>
146
+ getTargetActionsFunc(localization.value, props.project)
147
+ )
156
148
  const onToggleActions = (id: number): void => {
157
149
  actionsIsShow.value[id] = !actionsIsShow.value[id]
158
150
  }
@@ -3,6 +3,7 @@ import type {
3
3
  UI_I_DataTableOptions,
4
4
  UI_I_DataTableHeader,
5
5
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
6
+ import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
6
7
  import type { UI_I_Localization } from '~/lib/models/interfaces'
7
8
  import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
8
9
  import { UI_E_RecentTaskStatus } from '~/lib/models/store/tasks/enums'
@@ -10,6 +11,7 @@ import {
10
11
  UI_E_RTaskChipColor,
11
12
  UI_E_RTaskStatusIcon,
12
13
  } from '~/components/common/pages/tasks/table/lib/models/enums'
14
+ import type { UI_T_Project } from '~/lib/models/types'
13
15
  import type { T_TypeNodes } from '~/lib/models/types'
14
16
  import * as taskConfig from '~/components/templates/tasks/lib/config/taskConfig' // url из ( sphere, procurator )
15
17
 
@@ -135,6 +137,31 @@ export const getHeaderDataFunc = (
135
137
  },
136
138
  ]
137
139
 
140
+ export const getTargetActionsFunc = (
141
+ localization: UI_I_Localization,
142
+ project: UI_T_Project
143
+ ): UI_I_Dropdown[] => {
144
+ const actions: UI_I_Dropdown[] = [
145
+ {
146
+ value: 'view-target',
147
+ text: localization.common.viewTarget,
148
+ iconName: 'hide',
149
+ selected: false,
150
+ },
151
+ ]
152
+
153
+ if (project === 'sphere') {
154
+ actions.push({
155
+ value: 'view-zone',
156
+ text: localization.common.viewZone,
157
+ iconName: 'hide',
158
+ selected: false,
159
+ })
160
+ }
161
+
162
+ return actions
163
+ }
164
+
138
165
  export const options: UI_I_DataTableOptions = {
139
166
  perPageOptions: [
140
167
  { text: '10', value: 10 },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.686",
4
+ "version": "1.4.687",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",