From be0f972168bad18e2c526472a1859943227fe569 Mon Sep 17 00:00:00 2001
From: songguoqiang <765017469@qq.com>
Date: Tue, 5 Dec 2023 13:49:59 +0800
Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/home/shouye/index.ts | 32 +++
src/api/home/shouye/index.ts.bak | 96 +++++++
src/api/spc/templateItemDetails/index.ts | 4 +
src/views/Home/Index.vue | 258 +++++++-----------
src/views/Home/echarts-data.ts | 24 +-
.../recordsDetails/recordsDetails.data.ts | 1 -
src/views/tjanalysis/zlanalysis/index.vue | 40 ++-
7 files changed, 280 insertions(+), 175 deletions(-)
create mode 100644 src/api/home/shouye/index.ts
create mode 100644 src/api/home/shouye/index.ts.bak
diff --git a/src/api/home/shouye/index.ts b/src/api/home/shouye/index.ts
new file mode 100644
index 0000000..ffc7117
--- /dev/null
+++ b/src/api/home/shouye/index.ts
@@ -0,0 +1,32 @@
+import request from '@/config/axios'
+
+export interface RecordsVO {
+ templateId: string
+ itemCode: string
+ projectName: string
+ projectCode: string
+ itemName: string
+ createName: string
+ itemType: string
+ itemTypeName: string
+ cishu: string
+ times: string
+}
+// 首页查询当日导入次数
+export const getSYFrequency = async () => {
+ return await request.get({ url: `/detection/records/getSYFrequency`})
+}
+
+// 首页查询当日导入次数
+export const getSYTime = async () => {
+ return await request.get({ url: `/detection/records/getSYTime`})
+}
+
+
+// 首页查询七日内导入次数的折线柱状图数据
+export const getSYEchartsData = async () => {
+ return await request.get({ url: `/detection/records/getSYEchartsData`})
+}
+
+
+
diff --git a/src/api/home/shouye/index.ts.bak b/src/api/home/shouye/index.ts.bak
new file mode 100644
index 0000000..eccdbb7
--- /dev/null
+++ b/src/api/home/shouye/index.ts.bak
@@ -0,0 +1,96 @@
+import request from '@/config/axios'
+
+export interface ItembasicVO {
+ code: string
+ name: string
+ desc1: string
+ desc2: string
+ status: string
+ uom: string
+ altUom: string
+ isStdPack: string
+ enableBuy: string
+ enableMake: string
+ enableOutsourcing: string
+ isRecycled: string
+ isPhantom: string
+ abcClass: string
+ type: string
+ category: string
+ itemGroup: string
+ color: string
+ configuration: string
+ project: string
+ eqLevel: string
+ validityDays: number
+ userGroupCode: string
+ available: string
+ activeTime: Date
+ expireTime: Date
+ remark: string
+ deletionTime: Date
+ deleterId: string
+ extraProperties: string
+ concurrencyStamp: string
+ siteId: string
+ projectCode?: string
+ projectName?: string
+ projectItemId?:string
+
+}
+
+// 查询物品基本信息列表
+export const getItembasicPage = async (params) => {
+ if (params.isSearch) {
+ const data = {...params}
+ delete params.isSearch
+
+ return await request.post({ url: '/spc/itembasic/senior', data })
+ } else {
+ return await request.get({ url: `/spc/itembasic/page`, params })
+ }
+}
+
+// 查询物品基本信息详情
+export const getItembasic = async (id: number) => {
+ return await request.get({ url: `/spc/itembasic/get?id=` + id })
+}
+
+// 新增物品基本信息
+export const createItembasic = async (data: ItembasicVO) => {
+
+ return await request.post({ url: `/spc/itembasic/create`, data })
+}
+
+// 修改物品基本信息
+export const updateItembasic = async (data: ItembasicVO) => {
+ return await request.put({ url: `/spc/itembasic/update`, data })
+}
+
+// 删除物品基本信息
+export const deleteItembasic = async (id: number) => {
+ return await request.delete({ url: `/spc/itembasic/delete?id=` + id })
+}
+
+// 导出物品基本信息 Excel
+export const exportItembasic = async (params) => {
+ return await request.download({ url: `/spc/itembasic/export-excel`, params })
+}
+
+// 下载导入模板
+export const importTemplate = () => {
+ return request.download({ url: '/spc/itembasic/get-import-template' })
+}
+
+export const selectItems = async () => {
+ return await request.get({ url: `/spc/itembasic/selectItems`})
+}
+
+export const selectItemsByProjectCode = async (code:String) => {
+ return await request.get({ url: `/spc/itembasic/selectItemsByProjectCode?code=` + code})
+}
+
+// 查询物品基本信息列表不分页用于下拉数据
+export const getList = async (params) => {
+ return await request.get({ url: `/spc/itembasic/getList`, params })
+}
diff --git a/src/api/spc/templateItemDetails/index.ts b/src/api/spc/templateItemDetails/index.ts
index cdc594e..80db589 100644
--- a/src/api/spc/templateItemDetails/index.ts
+++ b/src/api/spc/templateItemDetails/index.ts
@@ -67,6 +67,10 @@ export const importTemplate = () => {
export const selectDetectionItems = async (itemCode: String , detectionType: String) => {
return await request.get({ url: `/spc/template-item-details/selectDetectionItems?itemCode=` + itemCode + `&detectionType=` + detectionType })
}
+
+export const selectDetectionLineNumber = async (itemCode: String , detectionType: String) => {
+ return await request.get({ url: `/spc/template-item-details/selectDetectionLineNumber?itemCode=` + itemCode + `&detectionType=` + detectionType })
+}
let templateId=0
// 查询检测项列表用于下拉选择
diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue
index b6fd53f..2b727b8 100644
--- a/src/views/Home/Index.vue
+++ b/src/views/Home/Index.vue
@@ -15,11 +15,11 @@
项目物料检测类型次数清单
-
-
-
-
-
+
+
+
+
+
@@ -28,11 +28,11 @@
项目物料检测类型时间清单
-
-
-
-
-
+
+
+
+
+
@@ -42,146 +42,103 @@
import { set } from 'lodash-es'
import { EChartsOption } from 'echarts'
import { lineOptions, barOptions } from './echarts-data'
+import * as rescordAPI from '@/api/home/shouye'
defineOptions({ name: 'Home' })
const { t } = useI18n()
-const tableData = [
- {
- project: '项目1',
- code: 'jkhdkjgh',
- name: '名字1',
- type: '类型1',
- num: 30
- },
- {
- project: '项目1',
- code: 'jkhdkjgh',
- name: '名字1',
- type: '类型1',
- num: 30
- },
- {
- project: '项目1',
- code: 'jkhdkjgh',
- name: '名字1',
- type: '类型1',
- num: 30
- },
- {
- project: '项目1',
- code: 'jkhdkjgh',
- name: '名字1',
- type: '类型1',
- num: 30
- }
-]
-const tableData1 = [
- {
- code: 'jkhdkjgh',
- name: '名字1',
- type: '类型1',
- time: '2023-12-12 06:00:00',
- people:'小张'
- },
- {
- code: 'jkhdkjgh',
- name: '名字1',
- type: '类型1',
- time: '2023-12-12 06:00:00',
- people:'小张'
- },
- {
- code: 'jkhdkjgh',
- name: '名字1',
- type: '类型1',
- time: '2023-12-12 06:00:00',
- people:'小张'
- },
- {
- code: 'jkhdkjgh',
- name: '名字1',
- type: '类型1',
- time: '2023-12-12 06:00:00',
- people:'小张'
- }
-]
+const tableData = ref([]);
+const tableData1 = ref([]);
+const echartsData = ref();
const barOptionsData = reactive(barOptions) as EChartsOption
const getWeeklyUserActivity = async () => {
- const data = [
- { value: 13253, name: 'analysis.monday' },
- { value: 34235, name: 'analysis.tuesday' },
- { value: 26321, name: 'analysis.wednesday' },
- { value: 12340, name: 'analysis.thursday' },
- { value: 24643, name: 'analysis.friday' },
- { value: 1322, name: 'analysis.saturday' },
- { value: 1324, name: 'analysis.sunday' }
- ]
- const data1 = [
- { value: 23444, name: 'analysis.monday' },
- { value: 12344, name: 'analysis.tuesday' },
- { value: 34455, name: 'analysis.wednesday' },
- { value: 3434, name: 'analysis.thursday' },
- { value: 43333, name: 'analysis.friday' },
- { value: 45555, name: 'analysis.saturday' },
- { value: 1324, name: 'analysis.sunday' }
- ]
- const data2 = [
- { value: 4344, name: 'analysis.monday' },
- { value: 34454, name: 'analysis.tuesday' },
- { value: 4322, name: 'analysis.wednesday' },
- { value: 9897, name: 'analysis.thursday' },
- { value: 89076, name: 'analysis.friday' },
- { value: 5434, name: 'analysis.saturday' },
- { value: 67674, name: 'analysis.sunday' }
- ]
- const data3 = [
- { value: 4344, name: 'analysis.monday' },
- { value: 34454, name: 'analysis.tuesday' },
- { value: 4322, name: 'analysis.wednesday' },
- { value: 9897, name: 'analysis.thursday' },
- { value: 89076, name: 'analysis.friday' },
- { value: 5434, name: 'analysis.saturday' },
- { value: 67674, name: 'analysis.sunday' }
- ]
+
+ const xdata = echartsData.value.days.map(item=>item);
+ const data = echartsData.value.CHROMATIC_ABERRATION;
+ const data1 = echartsData.value.DIMENSION;//尺寸
+ const data2 = echartsData.value.GLOSS;//光泽桔皮
+ const data3 = echartsData.value.PROPERTY;//性能
+ // const data = [
+ // { value: 13253, name: 'analysis.monday' },
+ // { value: 34235, name: 'analysis.tuesday' },
+ // { value: 26321, name: 'analysis.wednesday' },
+ // { value: 12340, name: 'analysis.thursday' },
+ // { value: 24643, name: 'analysis.friday' },
+ // { value: 1322, name: 'analysis.saturday' },
+ // { value: 1324, name: 'analysis.sunday' }
+ // ]
+ // const data1 = [
+ // { value: 23444, name: 'analysis.monday' },
+ // { value: 12344, name: 'analysis.tuesday' },
+ // { value: 34455, name: 'analysis.wednesday' },
+ // { value: 3434, name: 'analysis.thursday' },
+ // { value: 43333, name: 'analysis.friday' },
+ // { value: 45555, name: 'analysis.saturday' },
+ // { value: 1324, name: 'analysis.sunday' }
+ // ]
+ // const data2 = [
+ // { value: 4344, name: 'analysis.monday' },
+ // { value: 34454, name: 'analysis.tuesday' },
+ // { value: 4322, name: 'analysis.wednesday' },
+ // { value: 9897, name: 'analysis.thursday' },
+ // { value: 89076, name: 'analysis.friday' },
+ // { value: 5434, name: 'analysis.saturday' },
+ // { value: 67674, name: 'analysis.sunday' }
+ // ]
+ // const data3 = [
+ // { value: 4344, name: 'analysis.monday' },
+ // { value: 34454, name: 'analysis.tuesday' },
+ // { value: 4322, name: 'analysis.wednesday' },
+ // { value: 9897, name: 'analysis.thursday' },
+ // { value: 89076, name: 'analysis.friday' },
+ // { value: 5434, name: 'analysis.saturday' },
+ // { value: 67674, name: 'analysis.sunday' }
+ // ]
set(barOptionsData, 'title', {
text: '检测类型导入次数(近7天)',
- left: 0
+ left: 0,
+ textStyle:{
+ fontSize:16,
+ }
+
})
set(
barOptionsData,
'xAxis.data',
- data.map((v) => t(v.name))
+ xdata
)
set(barOptionsData, 'legend', {
- data: [t('analysis.activeQuantity'), '11', '22', '23'],
+ data: ['色差', '尺寸', '光泽桔皮', '性能'],
top: 0,
right: 20
})
set(barOptionsData, 'series', [
{
- name: t('analysis.activeQuantity'),
- data: data.map((v) => v.value),
+ name: '色差',
+ data: data,
+ // data: data.map((v) => v.value),
type: 'bar',
animationDuration: 2000,
animationEasing: 'cubicInOut'
},
{
- name: '11',
- data: data1.map((v) => v.value),
+ name: '尺寸',
+ data: data1,
type: 'bar',
animationDuration: 2000,
animationEasing: 'cubicInOut'
},
{
- name: '22',
- data: data2.map((v) => v.value),
+ name: '光泽桔皮',
+ data: data2,
type: 'bar',
animationDuration: 2000,
animationEasing: 'cubicInOut'
},
{
- name: '23',
- data: data3.map((v) => v.value),
+ name: '性能',
+ data: data3.forEach(element => {
+ element
+ }),
type: 'bar',
animationDuration: 2000,
animationEasing: 'cubicInOut'
@@ -191,75 +148,57 @@ const getWeeklyUserActivity = async () => {
const lineOptionsData = reactive(lineOptions) as EChartsOption
const getWeeklyUserActivity1 = async () => {
- const data = [
- { value: 13253, name: 'analysis.monday' },
- { value: 34235, name: 'analysis.tuesday' },
- { value: 26321, name: 'analysis.wednesday' },
- { value: 12340, name: 'analysis.thursday' },
- { value: 24643, name: 'analysis.friday' },
- { value: 1322, name: 'analysis.saturday' },
- { value: 1324, name: 'analysis.sunday' }
- ]
- const data1 = [
- { value: 23444, name: 'analysis.monday' },
- { value: 12344, name: 'analysis.tuesday' },
- { value: 34455, name: 'analysis.wednesday' },
- { value: 3434, name: 'analysis.thursday' },
- { value: 43333, name: 'analysis.friday' },
- { value: 45555, name: 'analysis.saturday' },
- { value: 1324, name: 'analysis.sunday' }
- ]
- const data2 = [
- { value: 4344, name: 'analysis.monday' },
- { value: 34454, name: 'analysis.tuesday' },
- { value: 4322, name: 'analysis.wednesday' },
- { value: 9897, name: 'analysis.thursday' },
- { value: 89076, name: 'analysis.friday' },
- { value: 5434, name: 'analysis.saturday' },
- { value: 67674, name: 'analysis.sunday' }
- ]
+
+ const xdata = echartsData.value.days;
+ const data = echartsData.value.CHROMATIC_ABERRATION;//色差
+ const data1 = echartsData.value.DIMENSION;//尺寸
+ const data2 = echartsData.value.GLOSS;//光泽桔皮
+ const data3 = echartsData.value.PROPERTY;//性能
set(lineOptionsData, 'title', {
text: '检测类型导入次数(近7天)',
- left: 0
+ left: 0,
+ textStyle:{
+ fontSize:16,
+ }
})
set(
lineOptionsData,
'xAxis.data',
- data.map((v) => t(v.name))
+ xdata
)
set(lineOptionsData, 'legend', {
- data: [t('analysis.activeQuantity'), '11', '22', '23'],
+ data: ['色差', '尺寸', '光泽桔皮', '性能'],
top: 0,
right: 20
})
set(lineOptionsData, 'series', [
{
- name: t('analysis.activeQuantity'),
- data: data.map((v) => v.value),
+ name: '色差',
+ data:data,
smooth: true,
type: 'line',
animationDuration: 2000,
animationEasing: 'cubicInOut'
},
{
- name: '11',
- data: data1.map((v) => v.value),
+ name: '尺寸',
+ data:data1,
smooth: true,
type: 'line',
animationDuration: 2000,
animationEasing: 'cubicInOut'
},
{
- name: '22',
- data: data2.map((v) => v.value),
+ name: '光泽桔皮',
+ data:data2,
smooth: true,
type: 'line',
animationDuration: 2000,
animationEasing: 'cubicInOut'
},
{
- name: '23',
- data: data1.map((v) => v.value),
+ name: '性能',
+ data:data3,
smooth: true,
type: 'line',
animationDuration: 2000,
@@ -267,9 +206,12 @@ const getWeeklyUserActivity1 = async () => {
}
])
}
-onMounted(() => {
- getWeeklyUserActivity()
- getWeeklyUserActivity1()
+onMounted(async() => {//初始化方法
+ tableData.value = await rescordAPI.getSYFrequency();
+ tableData1.value = await rescordAPI.getSYTime();
+ echartsData.value = await rescordAPI.getSYEchartsData();
+ await getWeeklyUserActivity()
+ await getWeeklyUserActivity1()
})