fix: style
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import ProductsView from '@/views/customer/ProductsView.vue';
|
||||
import LangSwitch from './inner/langSwitch.vue'
|
||||
import ThemeSwitch from './inner/themeSwitch.vue'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
|
||||
@@ -26,10 +26,10 @@ export interface PagingParams {
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export async function getRepos(): Promise<any> {
|
||||
const result = await useFetchJson<number[]>(`${API_PREFIX}/get-repos`)
|
||||
return result
|
||||
}
|
||||
// export async function getRepos(): Promise<any> {
|
||||
// const result = await useFetchJson<number[]>(`${API_PREFIX}/get-repos`)
|
||||
// return result
|
||||
// }
|
||||
|
||||
// export async function getYears(repoID: number): Promise<any> {
|
||||
// return useFetchJson<number[]>(`${API_PREFIX}/get-years?repoID=${repoID}`)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch, onMounted, type Ref } from 'vue'
|
||||
import { ref, computed, watch, type Ref } from 'vue'
|
||||
import { Bar } from 'vue-chartjs'
|
||||
import {
|
||||
Chart as ChartJS,
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
CategoryScale,
|
||||
LinearScale,
|
||||
} from 'chart.js'
|
||||
import { getRepos, getYears, getQuarters, getIssues, type QuarterData, type IssueTimeSummary } from '@/composable/useRepoApi'
|
||||
import { getYears, getQuarters, getIssues, type QuarterData, type IssueTimeSummary } from '@/composable/useRepoApi'
|
||||
import { useAuthStore } from '@/stores/auth'
|
||||
import { i18n } from '@/plugins/02_i18n'
|
||||
import type { TableColumn } from '@nuxt/ui'
|
||||
@@ -49,7 +49,7 @@ async function loadData<T>(fetchFn: () => Promise<any>, target: Ref<T[]>, errorM
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => loadData(() => getRepos(), repos, t('repo_chart.failed_to_load_repositories')))
|
||||
// onMounted(() => loadData(() => getRepos(), repos, t('repo_chart.failed_to_load_repositories')))
|
||||
|
||||
watch(selectedRepo, async (newRepo) => {
|
||||
selectedYear.value = null
|
||||
|
||||
@@ -83,6 +83,14 @@ const columns = computed<TableColumn<Product>[]>(() => [
|
||||
accessorKey: 'code',
|
||||
header: t('products.product_code'),
|
||||
},
|
||||
{
|
||||
accessorKey: 'description',
|
||||
header: t('products.description'),
|
||||
cell: ({ row }) => {
|
||||
const desc = row.getValue('description') as string
|
||||
return h('span', { class: 'text-sm text-gray-500 dark:text-gray-400' }, desc?.substring(0, 50) + (desc && desc.length > 50 ? '...' : ''))
|
||||
}
|
||||
},
|
||||
{
|
||||
accessorKey: 'inStock',
|
||||
header: t('products.in_stock'),
|
||||
@@ -99,7 +107,7 @@ const columns = computed<TableColumn<Product>[]>(() => [
|
||||
cell: ({ row }) => {
|
||||
const priceFromVal = row.original.priceFrom
|
||||
const priceToVal = row.original.priceTo
|
||||
return `$${priceFromVal} - $${priceToVal}`
|
||||
return `${priceFromVal} - ${priceToVal}`
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user