bfg-common 1.4.685 → 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.
@@ -15,7 +15,7 @@
15
15
  <span
16
16
  :data-id="`rtask-${item.data.testId}`"
17
17
  :class="item.data.isLink && 'target-link'"
18
- @click="onSelectNodeOfTree(item.data)"
18
+ @click.stop="onSelectNodeOfTree(item.data)"
19
19
  >
20
20
  {{ item.text }}
21
21
  </span>
@@ -34,8 +34,9 @@
34
34
  </ui-chip>
35
35
 
36
36
  <common-pages-tasks-table-error-info
37
+ v-if="item.data.error"
37
38
  :id="item.data.testId"
38
- error="item.data.error"
39
+ :error="item.data.error"
39
40
  />
40
41
  </template>
41
42
 
@@ -88,17 +89,20 @@ import type {
88
89
  UI_I_DataTableHeader,
89
90
  UI_I_DataTableBody,
90
91
  } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
92
+ import type { UI_T_Project } from '~/lib/models/types'
91
93
  import type { UI_I_Localization } from '~/lib/models/interfaces'
92
94
  import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
93
95
  import type { T_TypeNodes } from '~/lib/models/types'
94
96
 
95
97
  import {
96
98
  options,
99
+ getTargetActionsFunc,
97
100
  getHeaderDataFunc,
98
101
  getBodyDataFunc,
99
102
  } from '~/components/common/pages/tasks/table/lib/config/config'
100
103
 
101
104
  const props = defineProps<{
105
+ project: UI_T_Project
102
106
  tableData: UI_I_RecentTaskItem<T_TypeNodes>[]
103
107
  loading: boolean
104
108
  }>()
@@ -138,20 +142,9 @@ const onSorting = (value: string): void => {
138
142
  emits('sort', value)
139
143
  }
140
144
 
141
- const actions = computed<UI_I_Dropdown[]>(() => [
142
- {
143
- value: 'view-target',
144
- text: localization.value.common.viewTarget,
145
- iconName: 'hide',
146
- selected: false,
147
- },
148
- {
149
- value: 'view-zone',
150
- text: localization.value.common.viewZone,
151
- iconName: 'hide',
152
- selected: false,
153
- },
154
- ])
145
+ const actions = computed<UI_I_Dropdown[]>(() =>
146
+ getTargetActionsFunc(localization.value, props.project)
147
+ )
155
148
  const onToggleActions = (id: number): void => {
156
149
  actionsIsShow.value[id] = !actionsIsShow.value[id]
157
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.685",
4
+ "version": "1.4.687",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",