Browse Source

首页提交

master
songguoqiang 12 months ago
parent
commit
be0f972168
  1. 32
      src/api/home/shouye/index.ts
  2. 96
      src/api/home/shouye/index.ts.bak
  3. 4
      src/api/spc/templateItemDetails/index.ts
  4. 258
      src/views/Home/Index.vue
  5. 24
      src/views/Home/echarts-data.ts
  6. 1
      src/views/detection/recordsDetails/recordsDetails.data.ts
  7. 40
      src/views/tjanalysis/zlanalysis/index.vue

32
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`})
}

96
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 })
}

4
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
// 查询检测项列表用于下拉选择

258
src/views/Home/Index.vue

@ -15,11 +15,11 @@
<div class="title font-size-18px font-bold mb-10px">项目物料检测类型次数清单</div>
<el-table :data="tableData" style="width: 100%">
<el-table-column label="序号" width="80" type="index" align="center" />
<el-table-column prop="project" label="项目" align="center" />
<el-table-column prop="code" label="物料代码" align="center" />
<el-table-column prop="name" label="名称" align="center" />
<el-table-column prop="type" label="检查类型" align="center" />
<el-table-column prop="num" label="次数" align="center" />
<el-table-column prop="projectName" label="项目" align="center" />
<el-table-column prop="itemCode" label="物料代码" align="center" />
<el-table-column prop="itemName" label="物料名称" align="center" />
<el-table-column prop="itemTypeName" label="检查类型" align="center" />
<el-table-column prop="cishu" label="次数" align="center" />
</el-table>
</el-card>
</el-col>
@ -28,11 +28,11 @@
<div class="title font-size-18px font-bold mb-10px">项目物料检测类型时间清单</div>
<el-table :data="tableData1" style="width: 100%">
<el-table-column label="序号" width="80" type="index" align="center" />
<el-table-column prop="code" label="物料代码" align="center" />
<el-table-column prop="name" label="物料名称" align="center" />
<el-table-column prop="type" label="检测类型" align="center" />
<el-table-column prop="time" label="导入时间" align="center" />
<el-table-column prop="people" label="操作人" align="center" />
<el-table-column prop="itemCode" label="物料代码" align="center" />
<el-table-column prop="itemName" label="物料名称" align="center" />
<el-table-column prop="itemTypeName" label="检测类型" align="center" />
<el-table-column prop="times" label="导入时间" align="center" />
<el-table-column prop="createName" label="操作人" align="center" />
</el-table>
</el-card>
</el-col>
@ -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<EChartsOption>(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<EChartsOption>(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()
})
</script>
<style lang="scss" scoped>

24
src/views/Home/echarts-data.ts

@ -9,18 +9,18 @@ export const lineOptions: EChartsOption = {
},
xAxis: {
data: [
t('analysis.january'),
t('analysis.february'),
t('analysis.march'),
t('analysis.april'),
t('analysis.may'),
t('analysis.june'),
t('analysis.july'),
t('analysis.august'),
t('analysis.september'),
t('analysis.october'),
t('analysis.november'),
t('analysis.december')
// t('analysis.january'),
// t('analysis.february'),
// t('analysis.march'),
// t('analysis.april'),
// t('analysis.may'),
// t('analysis.june'),
// t('analysis.july'),
// t('analysis.august'),
// t('analysis.september'),
// t('analysis.october'),
// t('analysis.november'),
// t('analysis.december')
],
boundaryGap: false,
axisTick: {

1
src/views/detection/recordsDetails/recordsDetails.data.ts

@ -104,7 +104,6 @@ export const RecordsDetails = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
isTable:true,

40
src/views/tjanalysis/zlanalysis/index.vue

@ -52,10 +52,24 @@
<el-option v-for=" (item) in detectionItemList" :key="item" :label="item.name" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="检测日期" style="width: calc(20% - 32px)">
<el-form-item label="行号" style="width: calc(20% - 32px)" v-if="isShow">
<el-select
v-model="queryParams.lineNumber"
placeholder="请选择行号类型"
clearable
style="width: 100%"
>
<el-option v-for="lines in lineNumberList" :key="lines.lineNumber" :label="lines.name" :value="lines.lineNumber" />
</el-select>
</el-form-item>
<el-form-item label="检测日期" style="width: calc(35% - 32px)">
<el-date-picker
v-model="queryParams.detectionDate"
type="date"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
placeholder="请选择日期"
clearable
value-format="YYYY-MM-DD"
@ -202,6 +216,10 @@ const projectList = ref()
const itemList = ref()
//
const detectionItemList = ref()
//
const lineNumberList = ref()
const isShow = ref(false);
const pnaLoading = ref(true)
const tabLoading = ref(true)
const ec1Loading = ref(true)
@ -216,8 +234,10 @@ const queryParams = reactive({
itemCode: '',
detectionType: '',
detectionItemContentId: null,
detectionDate: formatDate(new Date() , 'YYYY-MM-DD'),
ecTab: '1'
detectionDate: [formatDate(new Date() , 'YYYY-MM-DD'),formatDate(new Date() , 'YYYY-MM-DD')],
//detectionDate: [],
ecTab: '1',
lineNumber:''
})
const datas = reactive({
@ -483,10 +503,16 @@ const detectionProjectChange = async()=> {
const detectionItemChange = async()=> {
detectionItemList.value = null
queryParams.detectionItemContentId = null
isShow.value=false
const _detectionItemList = await TemplateItemDetailsApi.selectDetectionItems(queryParams.itemCode , queryParams.detectionType)
if (_detectionItemList != null && _detectionItemList.length != 0) {
detectionItemList.value = _detectionItemList
queryParams.detectionItemContentId = _detectionItemList[0].value
if(queryParams.detectionType =='CHROMATIC_ABERRATION'){//
lineNumberList.value = await TemplateItemDetailsApi.selectDetectionLineNumber(queryParams.itemCode , queryParams.detectionType)
queryParams.lineNumber = lineNumberList.value[0].lineNumber
isShow.value = true;
}
}
initData()
}
@ -567,6 +593,12 @@ const initQuerys = async () => {
detectionItemList.value = _detectionItemList
queryParams.detectionItemContentId = _detectionItemList[0].value
}
if(queryParams.detectionType =='CHROMATIC_ABERRATION'){//
lineNumberList.value = await TemplateItemDetailsApi.selectDetectionLineNumber(queryParams.itemCode , queryParams.detectionType)
queryParams.lineNumber = lineNumberList.value[0].lineNumber
isShow.value = true;
}
initData()
}

Loading…
Cancel
Save