daikun1@bosssoft.com.cn
1 year ago
67 changed files with 9107 additions and 794 deletions
@ -0,0 +1,50 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface DeviceVO { |
|||
id: number |
|||
deviceNo: string |
|||
deviceName: string |
|||
deviceDesc: string |
|||
gxId: number |
|||
} |
|||
|
|||
// 查询设备信息列表
|
|||
export const getDevicePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basedata/device/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basedata/device/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询设备信息详情
|
|||
export const getDevice = async (id: number) => { |
|||
return await request.get({ url: `/basedata/device/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增设备信息
|
|||
export const createDevice = async (data: DeviceVO) => { |
|||
return await request.post({ url: `/basedata/device/create`, data }) |
|||
} |
|||
|
|||
// 修改设备信息
|
|||
export const updateDevice = async (data: DeviceVO) => { |
|||
return await request.put({ url: `/basedata/device/update`, data }) |
|||
} |
|||
|
|||
// 删除设备信息
|
|||
export const deleteDevice = async (id: number) => { |
|||
return await request.delete({ url: `/basedata/device/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出设备信息 Excel
|
|||
export const exportDevice = async (params) => { |
|||
return await request.download({ url: `/basedata/device/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basedata/device/get-import-template' }) |
|||
} |
@ -0,0 +1,54 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface FactoryVO { |
|||
id: number |
|||
facNo: string |
|||
facName: string |
|||
facDesc: string |
|||
groupId: number |
|||
} |
|||
|
|||
// 查询工厂信息列表
|
|||
export const getFactoryPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basedata/factory/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basedata/factory/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询工厂信息详情
|
|||
export const getFactory = async (id: number) => { |
|||
return await request.get({ url: `/basedata/factory/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增工厂信息
|
|||
export const createFactory = async (data: FactoryVO) => { |
|||
return await request.post({ url: `/basedata/factory/create`, data }) |
|||
} |
|||
|
|||
// 修改工厂信息
|
|||
export const updateFactory = async (data: FactoryVO) => { |
|||
return await request.put({ url: `/basedata/factory/update`, data }) |
|||
} |
|||
|
|||
// 删除工厂信息
|
|||
export const deleteFactory = async (id: number) => { |
|||
return await request.delete({ url: `/basedata/factory/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出工厂信息 Excel
|
|||
export const exportFactory = async (params) => { |
|||
return await request.download({ url: `/basedata/factory/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basedata/factory/get-import-template' }) |
|||
} |
|||
|
|||
export const selectAllFactorys = async () => { |
|||
return await request.get({ url: `/basedata/factory/selectAllFactorys`}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface GroupVO { |
|||
id: number |
|||
groupNo: string |
|||
groupName: string |
|||
groupDesc: string |
|||
} |
|||
|
|||
// 查询集团信息列表
|
|||
export const getGroupPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basedata/group/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basedata/group/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询集团信息详情
|
|||
export const getGroup = async (id: number) => { |
|||
return await request.get({ url: `/basedata/group/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增集团信息
|
|||
export const createGroup = async (data: GroupVO) => { |
|||
return await request.post({ url: `/basedata/group/create`, data }) |
|||
} |
|||
|
|||
// 修改集团信息
|
|||
export const updateGroup = async (data: GroupVO) => { |
|||
return await request.put({ url: `/basedata/group/update`, data }) |
|||
} |
|||
|
|||
// 删除集团信息
|
|||
export const deleteGroup = async (id: number) => { |
|||
return await request.delete({ url: `/basedata/group/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出集团信息 Excel
|
|||
export const exportGroup = async (params) => { |
|||
return await request.download({ url: `/basedata/group/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basedata/group/get-import-template' }) |
|||
} |
|||
|
|||
export const getAllGroupList = async () => { |
|||
return request.get({ url: '/basedata/group/getAllGroupList'}) |
|||
} |
@ -0,0 +1,54 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ProgxVO { |
|||
id: number |
|||
gxNo: string |
|||
gxName: string |
|||
gxDesc: string |
|||
lineId: number |
|||
} |
|||
|
|||
// 查询工序信息列表
|
|||
export const getProgxPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basedata/progx/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basedata/progx/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询工序信息详情
|
|||
export const getProgx = async (id: number) => { |
|||
return await request.get({ url: `/basedata/progx/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增工序信息
|
|||
export const createProgx = async (data: ProgxVO) => { |
|||
return await request.post({ url: `/basedata/progx/create`, data }) |
|||
} |
|||
|
|||
// 修改工序信息
|
|||
export const updateProgx = async (data: ProgxVO) => { |
|||
return await request.put({ url: `/basedata/progx/update`, data }) |
|||
} |
|||
|
|||
// 删除工序信息
|
|||
export const deleteProgx = async (id: number) => { |
|||
return await request.delete({ url: `/basedata/progx/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出工序信息 Excel
|
|||
export const exportProgx = async (params) => { |
|||
return await request.download({ url: `/basedata/progx/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basedata/progx/get-import-template' }) |
|||
} |
|||
|
|||
export const getAllGxs = async () => { |
|||
return await request.get({ url: `/basedata/progx/getAllGxs`}) |
|||
} |
@ -0,0 +1,54 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ProlineVO { |
|||
id: number |
|||
lineNo: string |
|||
lineName: string |
|||
lineDesc: string |
|||
shopId: number |
|||
} |
|||
|
|||
// 查询产线信息列表
|
|||
export const getProlinePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basedata/proline/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basedata/proline/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询产线信息详情
|
|||
export const getProline = async (id: number) => { |
|||
return await request.get({ url: `/basedata/proline/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增产线信息
|
|||
export const createProline = async (data: ProlineVO) => { |
|||
return await request.post({ url: `/basedata/proline/create`, data }) |
|||
} |
|||
|
|||
// 修改产线信息
|
|||
export const updateProline = async (data: ProlineVO) => { |
|||
return await request.put({ url: `/basedata/proline/update`, data }) |
|||
} |
|||
|
|||
// 删除产线信息
|
|||
export const deleteProline = async (id: number) => { |
|||
return await request.delete({ url: `/basedata/proline/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出产线信息 Excel
|
|||
export const exportProline = async (params) => { |
|||
return await request.download({ url: `/basedata/proline/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basedata/proline/get-import-template' }) |
|||
} |
|||
|
|||
export const selectAllLines = async () => { |
|||
return await request.get({ url: `/basedata/proline/selectAllLines`}) |
|||
} |
@ -0,0 +1,54 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface WorkshopVO { |
|||
id: number |
|||
shopNo: string |
|||
shopName: string |
|||
shopDesc: string |
|||
facId: number |
|||
} |
|||
|
|||
// 查询车间信息列表
|
|||
export const getWorkshopPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/basedata/workshop/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/basedata/workshop/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询车间信息详情
|
|||
export const getWorkshop = async (id: number) => { |
|||
return await request.get({ url: `/basedata/workshop/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增车间信息
|
|||
export const createWorkshop = async (data: WorkshopVO) => { |
|||
return await request.post({ url: `/basedata/workshop/create`, data }) |
|||
} |
|||
|
|||
// 修改车间信息
|
|||
export const updateWorkshop = async (data: WorkshopVO) => { |
|||
return await request.put({ url: `/basedata/workshop/update`, data }) |
|||
} |
|||
|
|||
// 删除车间信息
|
|||
export const deleteWorkshop = async (id: number) => { |
|||
return await request.delete({ url: `/basedata/workshop/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出车间信息 Excel
|
|||
export const exportWorkshop = async (params) => { |
|||
return await request.download({ url: `/basedata/workshop/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/basedata/workshop/get-import-template' }) |
|||
} |
|||
|
|||
export const selectAllShops = async () => { |
|||
return await request.get({ url: `/basedata/workshop/selectAllShops`}) |
|||
} |
@ -0,0 +1,53 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface HardnessOneVO { |
|||
id: number |
|||
fileName: string |
|||
fileType: string |
|||
fileNewName: string |
|||
} |
|||
|
|||
// 查询实验室-硬度-文档数据列表
|
|||
export const getHardnessOnePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/hardnessone/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/hardnessone/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-硬度-文档数据详情
|
|||
export const getHardnessOne = async (id: number) => { |
|||
return await request.get({ url: `/lab/hardnessone/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-硬度-文档数据
|
|||
export const createHardnessOne = async (data: HardnessOneVO) => { |
|||
return await request.post({ url: `/lab/hardnessone/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-硬度-文档数据
|
|||
export const updateHardnessOne = async (data: HardnessOneVO) => { |
|||
return await request.put({ url: `/lab/hardnessone/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-硬度-文档数据
|
|||
export const deleteHardnessOne = async (id: number) => { |
|||
return await request.delete({ url: `/lab/hardnessone/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-硬度-文档数据 Excel
|
|||
export const exportHardnessOne = async (params) => { |
|||
return await request.download({ url: `/lab/hardnessone/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/hardnessone/get-import-template' }) |
|||
} |
|||
|
|||
export const downLoadForHardOne = (id: number) => { |
|||
return request.download({ url: `/lab/hardnessone/downLoadForHardOne?id=` + id}) |
|||
} |
@ -0,0 +1,68 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface ImpactVO { |
|||
id: number |
|||
dataId: string |
|||
fineshed: string |
|||
batchNo: string |
|||
sampleNo: string |
|||
energy: string |
|||
toughness: string |
|||
standard: string |
|||
testDate: string |
|||
operator: string |
|||
material: string |
|||
temperature: string |
|||
style: string |
|||
length: string |
|||
width: string |
|||
height: string |
|||
deep: string |
|||
area: string |
|||
sydw: string |
|||
cz: string |
|||
guig: string |
|||
testUser: string |
|||
auditStatus: string |
|||
} |
|||
|
|||
// 查询实验室-冲击数据列表
|
|||
export const getImpactPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/impact/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/impact/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-冲击数据详情
|
|||
export const getImpact = async (id: number) => { |
|||
return await request.get({ url: `/lab/impact/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-冲击数据
|
|||
export const createImpact = async (data: ImpactVO) => { |
|||
return await request.post({ url: `/lab/impact/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-冲击数据
|
|||
export const updateImpact = async (data: ImpactVO) => { |
|||
return await request.put({ url: `/lab/impact/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-冲击数据
|
|||
export const deleteImpact = async (id: number) => { |
|||
return await request.delete({ url: `/lab/impact/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-冲击数据 Excel
|
|||
export const exportImpact = async (params) => { |
|||
return await request.download({ url: `/lab/impact/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/impact/get-import-template' }) |
|||
} |
@ -0,0 +1,75 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PlatscaleVO { |
|||
id: number |
|||
ch: string |
|||
cx: string |
|||
pz: string |
|||
ghdw: string |
|||
ysdw: string |
|||
crk: string |
|||
mz: string |
|||
pzh: string |
|||
jz: string |
|||
jjy: string |
|||
rq: string |
|||
jlsjOne: string |
|||
jlsjTwo: string |
|||
bh: string |
|||
shdw: string |
|||
xz: string |
|||
fwm: string |
|||
cysj: string |
|||
cybh: string |
|||
cyjg: string |
|||
bgdbh: string |
|||
sfcj: string |
|||
batchNo: string |
|||
sydw: string |
|||
standard: string |
|||
cz: string |
|||
guig: string |
|||
testUser: string |
|||
auditStatus: string |
|||
} |
|||
|
|||
// 查询实验室-地衡列表
|
|||
export const getPlatscalePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/platscale/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/platscale/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-地衡详情
|
|||
export const getPlatscale = async (id: number) => { |
|||
return await request.get({ url: `/lab/platscale/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-地衡
|
|||
export const createPlatscale = async (data: PlatscaleVO) => { |
|||
return await request.post({ url: `/lab/platscale/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-地衡
|
|||
export const updatePlatscale = async (data: PlatscaleVO) => { |
|||
return await request.put({ url: `/lab/platscale/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-地衡
|
|||
export const deletePlatscale = async (id: number) => { |
|||
return await request.delete({ url: `/lab/platscale/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-地衡 Excel
|
|||
export const exportPlatscale = async (params) => { |
|||
return await request.download({ url: `/lab/platscale/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/platscale/get-import-template' }) |
|||
} |
@ -0,0 +1,72 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface SpectrumVO { |
|||
id: number |
|||
batchNo: string |
|||
oprDate: string |
|||
syCompany: string |
|||
yclSupplier: string |
|||
deviceNo: string |
|||
specsNo: string |
|||
task: string |
|||
taskType: string |
|||
sid1: string |
|||
type: string |
|||
cfC: string |
|||
cfSi: string |
|||
cfMn: string |
|||
cfP: string |
|||
cfS: string |
|||
cfCr: string |
|||
cfMo: string |
|||
cfNi: string |
|||
cfV: string |
|||
cfAl: string |
|||
cfCu: string |
|||
cfTi: string |
|||
cfW: string |
|||
cfB: string |
|||
cfFe: string |
|||
cfNb: string |
|||
} |
|||
|
|||
// 查询实验室-光谱数据列表
|
|||
export const getSpectrumPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/spectrum/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/spectrum/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-光谱数据详情
|
|||
export const getSpectrum = async (id: number) => { |
|||
return await request.get({ url: `/lab/spectrum/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-光谱数据
|
|||
export const createSpectrum = async (data: SpectrumVO) => { |
|||
return await request.post({ url: `/lab/spectrum/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-光谱数据
|
|||
export const updateSpectrum = async (data: SpectrumVO) => { |
|||
return await request.put({ url: `/lab/spectrum/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-光谱数据
|
|||
export const deleteSpectrum = async (id: number) => { |
|||
return await request.delete({ url: `/lab/spectrum/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-光谱数据 Excel
|
|||
export const exportSpectrum = async (params) => { |
|||
return await request.download({ url: `/lab/spectrum/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/spectrum/get-import-template' }) |
|||
} |
@ -0,0 +1,96 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface StretchThousandnewVO { |
|||
id: number |
|||
qxId: string |
|||
batchNo: string |
|||
bhNo: string |
|||
testDate: string |
|||
testUser: string |
|||
deviceXz: string |
|||
deviceCc: string |
|||
deviceArea: string |
|||
deviceBjbl: string |
|||
deviceGauge: string |
|||
deviceLu: string |
|||
deviceA: string |
|||
deviceDmcc: string |
|||
deviceSu: string |
|||
deviceZ: string |
|||
deviceFm: string |
|||
deviceRm: string |
|||
deviceFeh: string |
|||
deviceReh: string |
|||
deviceFel: string |
|||
deviceRel: string |
|||
deviceFp: string |
|||
deviceRp: string |
|||
deviceFt: string |
|||
deviceRt: string |
|||
deviceE: string |
|||
deviceQqb: string |
|||
deviceQqbb: string |
|||
deviceAt: string |
|||
deviceAgt: string |
|||
deviceAg: string |
|||
deviceAe: string |
|||
deviceGdfh: string |
|||
deviceGdfhXsc: string |
|||
deviceGdfhXscl: string |
|||
deviceGdsc: string |
|||
deviceGdscXfh: string |
|||
slope: string |
|||
testFlag: string |
|||
deviceDhsc: string |
|||
deviceGdssc: string |
|||
deviceZdlsc: string |
|||
deviceRpXb: string |
|||
deviceRtXb: string |
|||
deviceQfjsx: string |
|||
} |
|||
|
|||
// 查询实验室-拉伸1000列表
|
|||
export const getStretchThousandnewPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/stretchthousandnew/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/stretchthousandnew/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-拉伸1000详情
|
|||
export const getStretchThousandnew = async (id: number) => { |
|||
return await request.get({ url: `/lab/stretchthousandnew/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-拉伸1000
|
|||
export const createStretchThousandnew = async (data: StretchThousandnewVO) => { |
|||
return await request.post({ url: `/lab/stretchthousandnew/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-拉伸1000
|
|||
export const updateStretchThousandnew = async (data: StretchThousandnewVO) => { |
|||
return await request.put({ url: `/lab/stretchthousandnew/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-拉伸1000
|
|||
export const deleteStretchThousandnew = async (id: number) => { |
|||
return await request.delete({ url: `/lab/stretchthousandnew/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-拉伸1000 Excel
|
|||
export const exportStretchThousandnew = async (params) => { |
|||
return await request.download({ url: `/lab/stretchthousandnew/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/stretchthousandnew/get-import-template' }) |
|||
} |
|||
|
|||
// 查询曲线数据
|
|||
export const getStretchQxInfo = async (id: number) => { |
|||
return await request.get({ url: `/lab/stretchthousandnew/getStretchQxInfo?id=` + id}) |
|||
} |
@ -0,0 +1,74 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface Stretch1000VO { |
|||
id: number |
|||
qxId: string |
|||
batchNo: string |
|||
bhNo: string |
|||
testDate: string |
|||
testUser: string |
|||
deviceXz: string |
|||
deviceCc: string |
|||
deviceArea: string |
|||
deviceLo: string |
|||
deviceFmc: string |
|||
deviceRmc: string |
|||
deviceFehc: string |
|||
deviceRehc: string |
|||
deviceFelc: string |
|||
deviceRelc: string |
|||
deviceFpc: string |
|||
deviceRpc: string |
|||
deviceFtc: string |
|||
deviceRtc: string |
|||
deviceEc: string |
|||
slope: string |
|||
testFlag: string |
|||
} |
|||
|
|||
// 查询实验室-拉伸1000列表
|
|||
export const getStretch1000Page = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/stretchthousand/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/stretchthousand/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-拉伸1000详情
|
|||
export const getStretch1000 = async (id: number) => { |
|||
return await request.get({ url: `/lab/stretchthousand/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-拉伸1000
|
|||
export const createStretch1000 = async (data: Stretch1000VO) => { |
|||
return await request.post({ url: `/lab/stretchthousand/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-拉伸1000
|
|||
export const updateStretch1000 = async (data: Stretch1000VO) => { |
|||
return await request.put({ url: `/lab/stretchthousand/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-拉伸1000
|
|||
export const deleteStretch1000 = async (id: number) => { |
|||
return await request.delete({ url: `/lab/stretchthousand/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-拉伸1000 Excel
|
|||
export const exportStretch1000 = async (params) => { |
|||
return await request.download({ url: `/lab/stretchthousand/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/stretchthousand/get-import-template' }) |
|||
} |
|||
|
|||
// 查询曲线数据
|
|||
export const getStretchQxInfo = async (id: number) => { |
|||
return await request.get({ url: `/lab/stretchthousand/getStretchQxInfo?id=` + id}) |
|||
} |
|||
|
@ -0,0 +1,54 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface Stretch1000QxVO { |
|||
id: number |
|||
qxId: string |
|||
dedviceType: string |
|||
deviceX: string |
|||
deviceY: string |
|||
} |
|||
|
|||
// 查询实验室-拉伸1000--曲线数据列表
|
|||
export const getStretch1000QxPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/stretchthousandqx/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/stretchthousandqx/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-拉伸1000--曲线数据详情
|
|||
export const getStretch1000Qx = async (id: number) => { |
|||
return await request.get({ url: `/lab/stretchthousandqx/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-拉伸1000--曲线数据
|
|||
export const createStretch1000Qx = async (data: Stretch1000QxVO) => { |
|||
return await request.post({ url: `/lab/stretchthousandqx/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-拉伸1000--曲线数据
|
|||
export const updateStretch1000Qx = async (data: Stretch1000QxVO) => { |
|||
return await request.put({ url: `/lab/stretchthousandqx/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-拉伸1000--曲线数据
|
|||
export const deleteStretch1000Qx = async (id: number) => { |
|||
return await request.delete({ url: `/lab/stretchthousandqx/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-拉伸1000--曲线数据 Excel
|
|||
export const exportStretch1000Qx = async (params) => { |
|||
return await request.download({ url: `/lab/stretchthousandqx/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/stretchthousandqx/get-import-template' }) |
|||
} |
|||
|
|||
export const getQxTypeList = async () => { |
|||
return await request.get({ url: `/lab/stretchthousandqx/getQxTypeList`}) |
|||
} |
@ -0,0 +1,119 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface Stretch300VO { |
|||
id: number |
|||
syid: string |
|||
syzbh: string |
|||
flag: string |
|||
jfb: string |
|||
jb: string |
|||
jsu: string |
|||
js: string |
|||
jt: string |
|||
je: string |
|||
jp: string |
|||
jdl: string |
|||
jdm: string |
|||
jsuf: string |
|||
jsf: string |
|||
jpf: string |
|||
jag: string |
|||
jagt: string |
|||
jrt: string |
|||
jae: string |
|||
sorbWork: string |
|||
jr: string |
|||
jn: string |
|||
jbsb: string |
|||
jrf: string |
|||
jdlStartvalue: string |
|||
jdlEndvalue: string |
|||
jbsbStartvalue: string |
|||
jbsbEndvalue: string |
|||
jrSpecon: string |
|||
jnStartvalue: string |
|||
jnEndvalue: string |
|||
jnSpecon: string |
|||
jfbInx: string |
|||
jsufInx: string |
|||
jsfInx: string |
|||
jpfInx: string |
|||
jeStartvalue: string |
|||
jeEndvalue: string |
|||
jeSpemath: string |
|||
jpStartvalue: string |
|||
jpEndvalue: string |
|||
jpSpecon: string |
|||
jpSpemath: string |
|||
jpfStartvalue: string |
|||
jpfEndvalue: string |
|||
jpfSpecon: string |
|||
jpfSpemath: string |
|||
jagStartvalue: string |
|||
jagEndvalue: string |
|||
jagSpemath: string |
|||
jrtSpecon: string |
|||
jrfSpecon: string |
|||
jaeStartvalue: string |
|||
jaeEndvalue: string |
|||
jaeSpemath: string |
|||
isExtension: string |
|||
lot: string |
|||
dt: string |
|||
bt: string |
|||
at1: string |
|||
extensionType: string |
|||
extensionName: string |
|||
vld: string |
|||
testDate: string |
|||
hlSd: string |
|||
dlbfbV: string |
|||
isBhkz: string |
|||
userId: string |
|||
} |
|||
|
|||
// 查询实验室-拉伸300列表
|
|||
export const getStretch300Page = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/stretchthreehundred/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/stretchthreehundred/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-拉伸300详情
|
|||
export const getStretch300 = async (id: number) => { |
|||
return await request.get({ url: `/lab/stretchthreehundred/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-拉伸300
|
|||
export const createStretch300 = async (data: Stretch300VO) => { |
|||
return await request.post({ url: `/lab/stretchthreehundred/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-拉伸300
|
|||
export const updateStretch300 = async (data: Stretch300VO) => { |
|||
return await request.put({ url: `/lab/stretchthreehundred/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-拉伸300
|
|||
export const deleteStretch300 = async (id: number) => { |
|||
return await request.delete({ url: `/lab/stretchthreehundred/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-拉伸300 Excel
|
|||
export const exportStretch300 = async (params) => { |
|||
return await request.download({ url: `/lab/stretchthreehundred/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/stretchthreehundred/get-import-template' }) |
|||
} |
|||
|
|||
// 查询曲线图数据
|
|||
export const getStretchThreeQxInfo = async (syzbh: String) => { |
|||
return await request.get({ url: `/lab/stretchthreehundred/getStretchThreeQxInfo?syzbh=` + syzbh }) |
|||
} |
@ -0,0 +1,54 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface Stretch300QxVO { |
|||
id: number |
|||
syl: string |
|||
zxbx: string |
|||
hxbx: string |
|||
wy: string |
|||
hlsd: string |
|||
sj: string |
|||
zyl: string |
|||
zyb: string |
|||
} |
|||
|
|||
// 查询实验室-拉伸300-曲线图数据列表
|
|||
export const getStretch300QxPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/StretchThreeHundredqx/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/StretchThreeHundredqx/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-拉伸300-曲线图数据详情
|
|||
export const getStretch300Qx = async (id: number) => { |
|||
return await request.get({ url: `/lab/StretchThreeHundredqx/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-拉伸300-曲线图数据
|
|||
export const createStretch300Qx = async (data: Stretch300QxVO) => { |
|||
return await request.post({ url: `/lab/StretchThreeHundredqx/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-拉伸300-曲线图数据
|
|||
export const updateStretch300Qx = async (data: Stretch300QxVO) => { |
|||
return await request.put({ url: `/lab/StretchThreeHundredqx/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-拉伸300-曲线图数据
|
|||
export const deleteStretch300Qx = async (id: number) => { |
|||
return await request.delete({ url: `/lab/StretchThreeHundredqx/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-拉伸300-曲线图数据 Excel
|
|||
export const exportStretch300Qx = async (params) => { |
|||
return await request.download({ url: `/lab/StretchThreeHundredqx/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/StretchThreeHundredqx/get-import-template' }) |
|||
} |
After Width: | Height: | Size: 52 KiB |
@ -0,0 +1,3 @@ |
|||
import ImportSimpleForm from './src/ImportSimpleForm.vue' |
|||
|
|||
export { ImportSimpleForm } |
@ -0,0 +1,278 @@ |
|||
<!-- 导入组件 --> |
|||
<template> |
|||
<Dialog v-model="dialogVisible" title="导入" width="600"> |
|||
<el-upload |
|||
ref="uploadRef" v-model:file-list="fileList" :action="importUrl + '?mode=' + mode + '&file=' + file + '&updatePart=' + updatePart + '&outFile=' + outFile" |
|||
:auto-upload="false" :disabled="formLoading" :headers="uploadHeaders" :limit="1" :on-error="submitFormError" |
|||
:on-exceed="handleExceed" :on-success="submitFormSuccess" :accept="accept" drag |
|||
style="width:300px;margin:0 auto"> |
|||
<Icon icon="ep:upload-filled" color="#c0c4cc" size="60" /> |
|||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div> |
|||
<!-- <template #tip> |
|||
<div class="el-upload__tip ml--126px mr--80px"> |
|||
<div class="flex"> |
|||
<div class="label mr-26px h-32px w-100px text-right font-size-14px color-#acaeb3" style="line-height:32px">导入模式</div> |
|||
<div class=""> |
|||
<div class="radio"> |
|||
<el-radio-group v-model="mode"> |
|||
<el-radio :label="1" :disabled="updateIsDisable">更新</el-radio> |
|||
<el-radio :label="2" :disabled="appendIsDisable">追加</el-radio> |
|||
<el-radio :label="3" :disabled="coverIsDisable">覆盖</el-radio> |
|||
</el-radio-group> |
|||
</div> |
|||
|
|||
<div class="tips font-size-14px color-#acaeb3"> |
|||
<div class="mt-2">更新:新增并修改</div> |
|||
<div class="mt-2">追加:只新增,不修改</div> |
|||
<div class="mt-2">覆盖:只修改不新增</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="mt-16px flex"> |
|||
<div class="label mr-26px h-32px w-100px text-right font-size-14px color-#acaeb3" style="line-height:32px">部分保存</div> |
|||
<div class=""> |
|||
<div class="switch"> |
|||
<el-switch v-model="updatePart" /> |
|||
</div> |
|||
<div class="tips font-size-14px color-#acaeb3"> |
|||
<div class="mt-2">部分保存:如存在错误数据,正确数据正常导入</div> |
|||
<div class="mt-2">全部保存:全部数据正确,才能导入</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="mt-16px flex" v-if="isShowOut"> |
|||
<div class="label mr-26px h-32px w-100px text-right font-size-14px color-#acaeb3" style="line-height:32px">是否外部资源</div> |
|||
<div class=""> |
|||
<div class="switch"> |
|||
<el-switch v-model="outFile" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> --> |
|||
</el-upload> |
|||
<template #footer> |
|||
<div class="flex items-center"> |
|||
<div class="flex-1 text-left"> |
|||
<!-- <el-button type="primary" plain @click="importTemplate"> |
|||
<Icon icon="ep:download" /> |
|||
下载模板 |
|||
</el-button> --> |
|||
</div> |
|||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button> |
|||
<el-button @click="dialogVisible = false">取 消</el-button> |
|||
</div> |
|||
</template> |
|||
</Dialog> |
|||
</template> |
|||
<script lang="ts" setup> |
|||
import { getAccessToken, getTenantId } from '@/utils/auth' |
|||
import download from '@/utils/download' |
|||
|
|||
defineOptions({ name: 'ImportSimpleForm' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
|
|||
const dialogVisible = ref(false) // 弹窗的是否展示 |
|||
const formLoading = ref(false) // 表单的加载中 |
|||
const uploadRef = ref() |
|||
const uploadHeaders = ref() // 上传 Header 头 |
|||
const fileList = ref([]) // 文件列表 |
|||
const file = ref('') |
|||
|
|||
|
|||
|
|||
const props = defineProps({ |
|||
importTemplateData: { |
|||
type: Object, |
|||
required: true |
|||
}, |
|||
// 可以导入的文件类型 |
|||
accept: { |
|||
type: String, |
|||
required: false, |
|||
default:'.docx, .doc' |
|||
}, |
|||
// 是否更新已经存在的用户数据.默认值是1 |
|||
mode: { |
|||
type: Number, |
|||
required: false, |
|||
default: 1 |
|||
}, |
|||
// 更新是否禁用,默认值不禁用 |
|||
updateIsDisable: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
// 追加是否禁用,默认值不禁用 |
|||
appendIsDisable: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
// 覆盖是否禁用,默认值不禁用 |
|||
coverIsDisable: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
// 是否部门保存,默认是 |
|||
updatePart: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
url:{ |
|||
type: String, |
|||
required: false, |
|||
}, |
|||
// 显示是否外部资源 |
|||
isShowOut: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
outFile: { |
|||
type: Boolean, |
|||
required: false, |
|||
default: false |
|||
}, |
|||
}) |
|||
const importTemplateData= ref(props.importTemplateData) |
|||
const accept= ref(props.accept) |
|||
const mode = ref(props.mode)//是否更新已经存在的用户数据.默认值是1 |
|||
const updateIsDisable = ref(props.updateIsDisable)//更新是否禁用,默认值不禁用 |
|||
const appendIsDisable = ref(props.appendIsDisable)//追加是否禁用,默认值不禁用 |
|||
const coverIsDisable = ref(props.coverIsDisable)//覆盖是否禁用,默认值不禁用 |
|||
const updatePart = ref(props.updatePart)//是否部门保存 |
|||
const outFile = ref(props.outFile)//是否引入外部资源 |
|||
|
|||
const importUrl = |
|||
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url |
|||
|
|||
/** 打开弹窗 */ |
|||
const open = () => { |
|||
dialogVisible.value = true |
|||
resetForm() |
|||
} |
|||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
/** 提交表单 */ |
|||
const submitForm = async () => { |
|||
|
|||
if (fileList.value.length == 0) { |
|||
message.error('请上传文件') |
|||
return |
|||
} |
|||
file.value = fileList.value[0].name |
|||
// 提交请求 |
|||
uploadHeaders.value = { |
|||
Authorization: 'Bearer ' + getAccessToken(), |
|||
'tenant-id': getTenantId(), |
|||
} |
|||
formLoading.value = true |
|||
uploadRef.value!.submit() |
|||
} |
|||
|
|||
/** 文件上传成功 */ |
|||
const emits = defineEmits(['success']) |
|||
const submitFormSuccess = (response: any) => { |
|||
formLoading.value = true |
|||
if(response){ |
|||
if(response.code == 500){ |
|||
message.error('导入失败') |
|||
return; |
|||
} else if (response.data.errorCount > 0) { |
|||
message.confirm('文件中有部分数据导入失败,是否下载失败数据?').then(() => { |
|||
// download.excel(file, 'file_' + new Date().getTime()) |
|||
// 通过url下载文件 |
|||
// const downloadElement = document.createElement('a') |
|||
// console.log(172, import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/' + response.data.errorFile) |
|||
// console.log(172, import.meta.env.VITE_BASE_URL + '/admin-api/opt/profile/' + response.data.errorFile) |
|||
window.open(import.meta.env.VITE_BASE_URL + '/admin-api/profile/' + response.data.errorFile ,'222') |
|||
// downloadElement.setAttribute('href', import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + response.data.errorFile ) |
|||
// 点击下载 |
|||
// downloadElement.click() |
|||
}) |
|||
} |
|||
}else{ |
|||
message.success('导入成功') |
|||
} |
|||
|
|||
// if (response.code !== 0) { |
|||
// message.error(response.msg) |
|||
// formLoading.value = false |
|||
// return |
|||
// } |
|||
// // 拼接提示语 |
|||
// const data = response.data |
|||
// const create = response.data.importResult[0] |
|||
// const update = response.data.importResult[1] |
|||
// const failure = response.data.importResult[2] |
|||
// let text = '上传成功数量:' + data[create].length + ';' |
|||
// for (let name of data[create]) { |
|||
// text += '< ' + name + ' >' |
|||
// } |
|||
// text += '更新成功数量:' + data[update].length + ';' |
|||
// for (const name of data[update]) { |
|||
// text += '< ' + name + ' >' |
|||
// } |
|||
// text += '更新失败数量:' + Object.keys(data[failure]).length + ';' |
|||
// for (const name in data[failure]) { |
|||
// text += '< ' + name + ': ' + data[failure][name] + ' >' |
|||
// } |
|||
// message.alert(text) |
|||
|
|||
// 发送操作成功的事件 |
|||
|
|||
formLoading.value = false |
|||
emits('success') |
|||
dialogVisible.value = false |
|||
} |
|||
/** 上传错误提示 */ |
|||
const submitFormError = (): void => { |
|||
message.error('上传失败,请您重新上传!') |
|||
formLoading.value = false |
|||
} |
|||
|
|||
/** 重置表单 */ |
|||
const resetForm = () => { |
|||
// 重置上传状态和文件 |
|||
formLoading.value = false |
|||
uploadRef.value?.clearFiles() |
|||
fileList.value = [] |
|||
} |
|||
|
|||
/** 文件数超出提示 */ |
|||
const handleExceed = (): void => { |
|||
message.error('最多只能上传一个文件!') |
|||
} |
|||
|
|||
/** 下载模板操作 */ |
|||
const importTemplate = () => { |
|||
const res = importTemplateData.value.templateUrl |
|||
download.excel(res, importTemplateData.value.templateTitle) |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.tips { |
|||
div { |
|||
position: relative; |
|||
padding-left: 22px; |
|||
|
|||
&::before { |
|||
width: 4px; |
|||
height: 4px; |
|||
border-radius: 50%; |
|||
content: ''; |
|||
background: #c2c2c2; |
|||
position: absolute; |
|||
top: 50%; |
|||
margin-top: -2px; |
|||
left: 4px; |
|||
} |
|||
} |
|||
} |
|||
</style> |
@ -0,0 +1,4 @@ |
|||
import Qxview from './src/Qxview.vue' |
|||
import QxviewThree from './src/QxviewThree.vue' |
|||
|
|||
export { Qxview , QxviewThree} |
@ -0,0 +1,116 @@ |
|||
<template> |
|||
<Dialog v-model="dialogVisible" title="曲线明细" width="1080"> |
|||
<el-row class="mt-5px" :gutter="20" justify="space-between"> |
|||
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-10px"> |
|||
<el-card shadow="never"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row :gutter="20" justify="space-between"> |
|||
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<Echart :options="lineOptionsData" :width="650" :height="470" /> |
|||
</el-skeleton> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-10px"> |
|||
<el-card shadow="never"> |
|||
<template #header> |
|||
<div class="h-3 flex justify-between"> |
|||
<span>曲线类别</span> |
|||
</div> |
|||
</template> |
|||
<el-skeleton :loading="loading" animated> |
|||
<div v-for="(item, index) in deviceTypeList" :key="`dynamics-${index}`"> |
|||
<div style="height: 20px"> |
|||
<el-button type="text" @click="changeData(item)"> |
|||
{{ item.value }} : {{ item.name }} |
|||
</el-button> |
|||
</div> |
|||
<el-divider /> |
|||
</div> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
</Dialog> |
|||
</template> |
|||
<script lang="ts" setup> |
|||
import { set } from 'lodash-es' |
|||
import { EChartsOption } from 'echarts' |
|||
import { formatTime } from '@/utils' |
|||
|
|||
import { useUserStore } from '@/store/modules/user' |
|||
import { useWatermark } from '@/hooks/web/useWatermark' |
|||
import { pieOptions, barOptions , lineOptions } from './echarts-data' |
|||
defineOptions({ name: 'Qxview' }) |
|||
|
|||
const { t } = useI18n() |
|||
const userStore = useUserStore() |
|||
const { setWatermark } = useWatermark() |
|||
const loading = ref(false) |
|||
const dialogVisible = ref(false) // 弹窗的是否展示 |
|||
const viewData = ref() |
|||
const deviceTypeList = ref([]) |
|||
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption |
|||
const barOptionsData = reactive<EChartsOption>(barOptions) as EChartsOption |
|||
|
|||
const open = (typeList , vData) => { |
|||
deviceTypeList.value = typeList |
|||
viewData.value = vData |
|||
changeQxData(viewData.value.tt , '2倍变形-力') |
|||
loading.value = false |
|||
dialogVisible.value = true |
|||
} |
|||
|
|||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
const changeData = (item) => { |
|||
switch (item.value) { |
|||
case 'lb': |
|||
changeQxData(viewData.value.lb, item.name) |
|||
break |
|||
case 'ld': |
|||
changeQxData(viewData.value.ld, item.name) |
|||
break |
|||
case 'le': |
|||
changeQxData(viewData.value.le, item.name) |
|||
break |
|||
case 'lt': |
|||
changeQxData(viewData.value.lt, item.name) |
|||
break |
|||
case 'et': |
|||
changeQxData(viewData.value.et, item.name) |
|||
break |
|||
case '1t': |
|||
changeQxData(viewData.value.tt, item.name) |
|||
break |
|||
default: |
|||
changeQxData(viewData.value.lb, item.name) |
|||
} |
|||
} |
|||
|
|||
// 初始化曲线数据 |
|||
const changeQxData = async (viewData , title) => { |
|||
if (viewData != null) { |
|||
set( |
|||
lineOptionsData, |
|||
'title.text', |
|||
title |
|||
) |
|||
set( |
|||
lineOptionsData, |
|||
'xAxis.data', |
|||
viewData.map((v) => t(v.name)) |
|||
) |
|||
set(lineOptionsData, 'series', [ |
|||
{ |
|||
name: title, |
|||
data: viewData.map((v) => v.value), |
|||
type: 'line' |
|||
} |
|||
]) |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,67 @@ |
|||
<template> |
|||
<Dialog v-model="dialogVisible" title="曲线明细" width="700"> |
|||
<el-row class="mt-5px" :gutter="20" justify="space-between"> |
|||
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24" class="mb-10px"> |
|||
<el-card shadow="never"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row :gutter="20" justify="space-between"> |
|||
<el-col :xl="24" :lg="24" :md="24" :sm="24" :xs="24"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<Echart :options="lineOptionsData" :width="650" :height="400" /> |
|||
</el-skeleton> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
</Dialog> |
|||
</template> |
|||
<script lang="ts" setup> |
|||
import { set } from 'lodash-es' |
|||
import { EChartsOption } from 'echarts' |
|||
import { formatTime } from '@/utils' |
|||
import { useUserStore } from '@/store/modules/user' |
|||
import { useWatermark } from '@/hooks/web/useWatermark' |
|||
import { pieOptions, barOptions , lineOptions } from './echarts-data' |
|||
defineOptions({ name: 'QxviewThree' }) |
|||
|
|||
const { t } = useI18n() |
|||
const userStore = useUserStore() |
|||
const { setWatermark } = useWatermark() |
|||
const loading = ref(false) |
|||
const dialogVisible = ref(false) // 弹窗的是否展示 |
|||
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption |
|||
|
|||
const open = (vData , title) => { |
|||
console.log(vData) |
|||
initData(vData , title) |
|||
loading.value = false |
|||
dialogVisible.value = true |
|||
} |
|||
|
|||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|||
|
|||
// 初始化曲线数据 |
|||
const initData = async (datas , title) => { |
|||
if (datas != null) { |
|||
set( |
|||
lineOptionsData, |
|||
'title.text', |
|||
title |
|||
) |
|||
set( |
|||
lineOptionsData, |
|||
'xAxis.data', |
|||
datas.map((v) => t(v.syl)) |
|||
) |
|||
set(lineOptionsData, 'series', [ |
|||
{ |
|||
name: title, |
|||
data: datas.map((v) => v.wy), |
|||
type: 'line' |
|||
} |
|||
]) |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,286 @@ |
|||
import { EChartsOption } from 'echarts' |
|||
|
|||
const { t } = useI18n() |
|||
|
|||
export const lineOptions: EChartsOption = { |
|||
title: { |
|||
text: '', |
|||
left: 'center' |
|||
}, |
|||
xAxis: { |
|||
data: [], |
|||
boundaryGap: false, |
|||
axisTick: { |
|||
show: false |
|||
} |
|||
}, |
|||
grid: { |
|||
left: 20, |
|||
right: 20, |
|||
bottom: 20, |
|||
top: 80, |
|||
containLabel: true |
|||
}, |
|||
tooltip: { |
|||
trigger: 'axis', |
|||
axisPointer: { |
|||
type: 'cross' |
|||
}, |
|||
padding: [5, 10] |
|||
}, |
|||
yAxis: { |
|||
axisTick: { |
|||
show: false |
|||
} |
|||
}, |
|||
// legend: {
|
|||
// data: [t('analysis.estimate'), t('analysis.actual')],
|
|||
// top: 50
|
|||
// },
|
|||
series: [ |
|||
{ |
|||
name: '', |
|||
smooth: true, |
|||
type: 'line', |
|||
data: [], |
|||
animationDuration: 2800, |
|||
animationEasing: 'cubicInOut' |
|||
} |
|||
] |
|||
} |
|||
|
|||
export const pieOptions: EChartsOption = { |
|||
title: { |
|||
text: t('analysis.userAccessSource'), |
|||
left: 'center' |
|||
}, |
|||
tooltip: { |
|||
trigger: 'item', |
|||
formatter: '{a} <br/>{b} : {c} ({d}%)' |
|||
}, |
|||
legend: { |
|||
orient: 'vertical', |
|||
left: 'left', |
|||
data: [ |
|||
t('analysis.directAccess'), |
|||
t('analysis.mailMarketing'), |
|||
t('analysis.allianceAdvertising'), |
|||
t('analysis.videoAdvertising'), |
|||
t('analysis.searchEngines') |
|||
] |
|||
}, |
|||
series: [ |
|||
{ |
|||
name: t('analysis.userAccessSource'), |
|||
type: 'pie', |
|||
radius: '55%', |
|||
center: ['50%', '60%'], |
|||
data: [ |
|||
{ value: 335, name: t('analysis.directAccess') }, |
|||
{ value: 310, name: t('analysis.mailMarketing') }, |
|||
{ value: 234, name: t('analysis.allianceAdvertising') }, |
|||
{ value: 135, name: t('analysis.videoAdvertising') }, |
|||
{ value: 1548, name: t('analysis.searchEngines') } |
|||
] |
|||
} |
|||
] |
|||
} |
|||
|
|||
export const barOptions: EChartsOption = { |
|||
title: { |
|||
text: t('analysis.weeklyUserActivity'), |
|||
left: 'center' |
|||
}, |
|||
tooltip: { |
|||
trigger: 'axis', |
|||
axisPointer: { |
|||
type: 'shadow' |
|||
} |
|||
}, |
|||
grid: { |
|||
left: 50, |
|||
right: 20, |
|||
bottom: 20 |
|||
}, |
|||
xAxis: { |
|||
type: 'category', |
|||
data: [ |
|||
t('analysis.monday'), |
|||
t('analysis.tuesday'), |
|||
t('analysis.wednesday'), |
|||
t('analysis.thursday'), |
|||
t('analysis.friday'), |
|||
t('analysis.saturday'), |
|||
t('analysis.sunday') |
|||
], |
|||
axisTick: { |
|||
alignWithLabel: true |
|||
} |
|||
}, |
|||
yAxis: { |
|||
type: 'value' |
|||
}, |
|||
series: [ |
|||
{ |
|||
name: t('analysis.activeQuantity'), |
|||
data: [13253, 34235, 26321, 12340, 24643, 1322, 1324], |
|||
type: 'bar' |
|||
} |
|||
] |
|||
} |
|||
|
|||
export const radarOption: EChartsOption = { |
|||
legend: { |
|||
data: [t('workplace.personal'), t('workplace.team')] |
|||
}, |
|||
radar: { |
|||
// shape: 'circle',
|
|||
indicator: [ |
|||
{ name: t('workplace.quote'), max: 65 }, |
|||
{ name: t('workplace.contribution'), max: 160 }, |
|||
{ name: t('workplace.hot'), max: 300 }, |
|||
{ name: t('workplace.yield'), max: 130 }, |
|||
{ name: t('workplace.follow'), max: 100 } |
|||
] |
|||
}, |
|||
series: [ |
|||
{ |
|||
name: `xxx${t('workplace.index')}`, |
|||
type: 'radar', |
|||
data: [ |
|||
{ |
|||
value: [42, 30, 20, 35, 80], |
|||
name: t('workplace.personal') |
|||
}, |
|||
{ |
|||
value: [50, 140, 290, 100, 90], |
|||
name: t('workplace.team') |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
|||
|
|||
export const wordOptions = { |
|||
series: [ |
|||
{ |
|||
type: 'wordCloud', |
|||
gridSize: 2, |
|||
sizeRange: [12, 50], |
|||
rotationRange: [-90, 90], |
|||
shape: 'pentagon', |
|||
width: 600, |
|||
height: 400, |
|||
drawOutOfBound: true, |
|||
textStyle: { |
|||
color: function () { |
|||
return ( |
|||
'rgb(' + |
|||
[ |
|||
Math.round(Math.random() * 160), |
|||
Math.round(Math.random() * 160), |
|||
Math.round(Math.random() * 160) |
|||
].join(',') + |
|||
')' |
|||
) |
|||
} |
|||
}, |
|||
emphasis: { |
|||
textStyle: { |
|||
shadowBlur: 10, |
|||
shadowColor: '#333' |
|||
} |
|||
}, |
|||
data: [ |
|||
{ |
|||
name: 'Sam S Club', |
|||
value: 10000, |
|||
textStyle: { |
|||
color: 'black' |
|||
}, |
|||
emphasis: { |
|||
textStyle: { |
|||
color: 'red' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
name: 'Macys', |
|||
value: 6181 |
|||
}, |
|||
{ |
|||
name: 'Amy Schumer', |
|||
value: 4386 |
|||
}, |
|||
{ |
|||
name: 'Jurassic World', |
|||
value: 4055 |
|||
}, |
|||
{ |
|||
name: 'Charter Communications', |
|||
value: 2467 |
|||
}, |
|||
{ |
|||
name: 'Chick Fil A', |
|||
value: 2244 |
|||
}, |
|||
{ |
|||
name: 'Planet Fitness', |
|||
value: 1898 |
|||
}, |
|||
{ |
|||
name: 'Pitch Perfect', |
|||
value: 1484 |
|||
}, |
|||
{ |
|||
name: 'Express', |
|||
value: 1112 |
|||
}, |
|||
{ |
|||
name: 'Home', |
|||
value: 965 |
|||
}, |
|||
{ |
|||
name: 'Johnny Depp', |
|||
value: 847 |
|||
}, |
|||
{ |
|||
name: 'Lena Dunham', |
|||
value: 582 |
|||
}, |
|||
{ |
|||
name: 'Lewis Hamilton', |
|||
value: 555 |
|||
}, |
|||
{ |
|||
name: 'KXAN', |
|||
value: 550 |
|||
}, |
|||
{ |
|||
name: 'Mary Ellen Mark', |
|||
value: 462 |
|||
}, |
|||
{ |
|||
name: 'Farrah Abraham', |
|||
value: 366 |
|||
}, |
|||
{ |
|||
name: 'Rita Ora', |
|||
value: 360 |
|||
}, |
|||
{ |
|||
name: 'Serena Williams', |
|||
value: 282 |
|||
}, |
|||
{ |
|||
name: 'NCAA baseball tournament', |
|||
value: 273 |
|||
}, |
|||
{ |
|||
name: 'Point Break', |
|||
value: 265 |
|||
} |
|||
] |
|||
} |
|||
] |
|||
} |
@ -1,38 +1,95 @@ |
|||
<template> |
|||
<div v-for="(item, index) in Butttondata" :key="index" class="btn-div"> |
|||
<el-button |
|||
v-for="(item, index) in Butttondata" :key="index" |
|||
v-show="!item.hide" |
|||
:type="item.type" |
|||
:color="item.color" |
|||
:link = "item.link ? item.link : false" |
|||
:link="item.link ? item.link : false" |
|||
v-hasPermi="[item.hasPermi] || []" |
|||
@click="buttonBaseClick(item.name,item,$event)" |
|||
v-if="item.name != 'set'" |
|||
@click="buttonBaseClick(item.name, item, $event)" |
|||
> |
|||
<Icon v-if="item.icon" :icon="item.icon" class="mr-1px" /> |
|||
{{ item.label }} |
|||
</el-button> |
|||
<!-- 设置按钮 --> |
|||
<el-popover |
|||
:visible="popoverVisible" |
|||
placement="bottom" |
|||
:width="300" |
|||
trigger="click" |
|||
v-if="item.name == 'set'&&!item.hide" |
|||
> |
|||
<rowDrop |
|||
ref="rowDropRef" |
|||
@updata-table-columns="updataTableColumns" |
|||
:allSchemas="allSchemas" |
|||
@closeRowDrop="closeRowDrop" |
|||
@updataTableColumns="updataTableColumns" |
|||
/> |
|||
<template #reference> |
|||
<el-button |
|||
v-show="!item.hide" |
|||
:type="item.type" |
|||
:color="item.color" |
|||
:link="item.link ? item.link : false" |
|||
v-hasPermi="[item.hasPermi] || []" |
|||
@click="buttonBaseClick(item.name, item, $event)" |
|||
> |
|||
<Icon v-if="item.icon" :icon="item.icon" class="mr-1px" /> |
|||
{{ item.label }} |
|||
</el-button> |
|||
</template> |
|||
</el-popover> |
|||
</div> |
|||
<slot></slot> |
|||
</template> |
|||
<script setup> |
|||
import { Plus } from '@element-plus/icons-vue' |
|||
import { clearButtonBlurHandle } from '@/utils/index' |
|||
const props = defineProps({ |
|||
import { Plus } from '@element-plus/icons-vue' |
|||
import { clearButtonBlurHandle } from '@/utils/index' |
|||
import rowDrop from '@/components/rowDrop/index.vue' |
|||
const props = defineProps({ |
|||
Butttondata: { |
|||
type: Array, |
|||
default: () => { |
|||
return [] |
|||
} |
|||
}, |
|||
}) |
|||
allSchemas: { |
|||
type: Object, |
|||
default: null |
|||
} |
|||
}) |
|||
|
|||
// 传递给父类 |
|||
const emit = defineEmits([ |
|||
'buttonBaseClick', |
|||
]) |
|||
// 传递给父类 |
|||
const emit = defineEmits(['buttonBaseClick', 'updataTableColumns']) |
|||
|
|||
const buttonBaseClick = (val, item, $event) => { |
|||
clearButtonBlurHandle($event)//解决el-button点击后颜色不恢复问题 |
|||
const buttonBaseClick = (val, item, $event) => { |
|||
clearButtonBlurHandle($event) //解决el-button点击后颜色不恢复问题 |
|||
emit('buttonBaseClick', val, item, $event) |
|||
} |
|||
|
|||
} |
|||
const popoverVisible = ref(false) |
|||
// 关闭页面 |
|||
const closeRowDrop = () => { |
|||
popoverVisible.value = false |
|||
} |
|||
defineExpose({ |
|||
popoverVisible |
|||
}) |
|||
// 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
emit('updataTableColumns', val) |
|||
} |
|||
</script> |
|||
<style scoped lang="scss"> |
|||
.btn-div{ |
|||
display: inline; |
|||
|
|||
::v-deep(.el-button){ |
|||
margin: 0px 5px; |
|||
} |
|||
::v-deep(.el-button.is-link){ |
|||
margin: 0px; |
|||
} |
|||
} |
|||
</style> |
@ -1,381 +1,16 @@ |
|||
<template> |
|||
<div> |
|||
<el-card shadow="never"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row :gutter="20" justify="space-between"> |
|||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24"> |
|||
<div class="flex items-center"> |
|||
<img :src="avatar" alt="" class="mr-20px h-70px w-70px rounded-[50%]" /> |
|||
<div> |
|||
<div class="text-20px"> |
|||
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }} |
|||
</div> |
|||
<div class="mt-10px text-14px text-gray-500"> |
|||
{{ t('workplace.toady') }},20℃ - 32℃! |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</el-col> |
|||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24"> |
|||
<div class="h-70px flex items-center justify-end lt-sm:mt-10px"> |
|||
<div class="px-8px text-right"> |
|||
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.project') }}</div> |
|||
<CountTo |
|||
class="text-20px" |
|||
:start-val="0" |
|||
:end-val="totalSate.project" |
|||
:duration="2600" |
|||
/> |
|||
</div> |
|||
<el-divider direction="vertical" /> |
|||
<div class="px-8px text-right"> |
|||
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.toDo') }}</div> |
|||
<CountTo |
|||
class="text-20px" |
|||
:start-val="0" |
|||
:end-val="totalSate.todo" |
|||
:duration="2600" |
|||
/> |
|||
</div> |
|||
<el-divider direction="vertical" border-style="dashed" /> |
|||
<div class="px-8px text-right"> |
|||
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.access') }}</div> |
|||
<CountTo |
|||
class="text-20px" |
|||
:start-val="0" |
|||
:end-val="totalSate.access" |
|||
:duration="2600" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</div> |
|||
|
|||
<el-row class="mt-5px" :gutter="20" justify="space-between"> |
|||
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-10px"> |
|||
<el-card shadow="never"> |
|||
<template #header> |
|||
<div class="h-3 flex justify-between"> |
|||
<span>{{ t('workplace.project') }}</span> |
|||
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link> |
|||
</div> |
|||
</template> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row> |
|||
<el-col |
|||
v-for="(item, index) in projects" |
|||
:key="`card-${index}`" |
|||
:xl="8" |
|||
:lg="8" |
|||
:md="8" |
|||
:sm="24" |
|||
:xs="24" |
|||
> |
|||
<el-card shadow="hover"> |
|||
<div class="flex items-center"> |
|||
<Icon :icon="item.icon" :size="25" class="mr-10px" /> |
|||
<span class="text-16px">{{ item.name }}</span> |
|||
</div> |
|||
<div class="mt-15px text-14px text-gray-400">{{ t(item.message) }}</div> |
|||
<div class="mt-20px flex justify-between text-12px text-gray-400"> |
|||
<span>{{ item.personal }}</span> |
|||
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span> |
|||
</div> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
|
|||
<el-card shadow="never" class="mt-5px"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row :gutter="20" justify="space-between"> |
|||
<el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24"> |
|||
<el-card shadow="hover" class="mb-10px"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<Echart :options="pieOptionsData" :height="280" /> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
<el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24"> |
|||
<el-card shadow="hover" class="mb-10px"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<Echart :options="barOptionsData" :height="280" /> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-10px"> |
|||
<el-card shadow="never"> |
|||
<template #header> |
|||
<div class="h-3 flex justify-between"> |
|||
<span>{{ t('workplace.shortcutOperation') }}</span> |
|||
</div> |
|||
</template> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row> |
|||
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-10px"> |
|||
<div class="flex items-center"> |
|||
<Icon :icon="item.icon" class="mr-10px" /> |
|||
<el-link type="default" :underline="false" @click="setWatermark(item.name)"> |
|||
{{ item.name }} |
|||
</el-link> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
<el-card shadow="never" class="mt-10px"> |
|||
<template #header> |
|||
<div class="h-3 flex justify-between"> |
|||
<span>{{ t('workplace.notice') }}</span> |
|||
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link> |
|||
</div> |
|||
</template> |
|||
<el-skeleton :loading="loading" animated> |
|||
<div v-for="(item, index) in notice" :key="`dynamics-${index}`"> |
|||
<div class="flex items-center"> |
|||
<img :src="avatar" alt="" class="mr-20px h-35px w-35px rounded-[50%]" /> |
|||
<div> |
|||
<div class="text-14px"> |
|||
<Highlight :keys="item.keys.map((v) => t(v))"> |
|||
{{ item.type }} : {{ item.title }} |
|||
</Highlight> |
|||
</div> |
|||
<div class="mt-15px text-12px text-gray-400"> |
|||
{{ formatTime(item.date, 'yyyy-MM-dd') }} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<el-divider /> |
|||
</div> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
<!-- <img class="homebg" src="@/assets/imgs/bgnew.jpg" /> --> |
|||
<div></div> |
|||
</template> |
|||
<script lang="ts" setup> |
|||
import { set } from 'lodash-es' |
|||
import { EChartsOption } from 'echarts' |
|||
import { formatTime } from '@/utils' |
|||
|
|||
import { useUserStore } from '@/store/modules/user' |
|||
import { useWatermark } from '@/hooks/web/useWatermark' |
|||
import avatarImg from '@/assets/imgs/avatar.gif' |
|||
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types' |
|||
import { pieOptions, barOptions } from './echarts-data' |
|||
|
|||
defineOptions({ name: 'Home' }) |
|||
<style lang="scss"> |
|||
|
|||
const { t } = useI18n() |
|||
const userStore = useUserStore() |
|||
const { setWatermark } = useWatermark() |
|||
const loading = ref(true) |
|||
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg |
|||
const username = userStore.getUser.nickname |
|||
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption |
|||
// 获取统计数 |
|||
let totalSate = reactive<WorkplaceTotal>({ |
|||
project: 0, |
|||
access: 0, |
|||
todo: 0 |
|||
}) |
|||
|
|||
const getCount = async () => { |
|||
const data = { |
|||
project: 40, |
|||
access: 2340, |
|||
todo: 10 |
|||
} |
|||
totalSate = Object.assign(totalSate, data) |
|||
} |
|||
|
|||
// 获取项目数 |
|||
let projects = reactive<Project[]>([]) |
|||
const getProject = async () => { |
|||
const data = [ |
|||
{ |
|||
name: 'Github', |
|||
icon: 'akar-icons:github-fill', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'Vue', |
|||
icon: 'logos:vue', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'Angular', |
|||
icon: 'logos:angular-icon', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'React', |
|||
icon: 'logos:react', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'Webpack', |
|||
icon: 'logos:webpack', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'Vite', |
|||
icon: 'vscode-icons:file-type-vite', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
.homebg { |
|||
padding: 0px; |
|||
width: 100%; |
|||
height: 100%; |
|||
// background-size: cover; |
|||
} |
|||
] |
|||
projects = Object.assign(projects, data) |
|||
} |
|||
|
|||
// 获取通知公告 |
|||
let notice = reactive<Notice[]>([]) |
|||
const getNotice = async () => { |
|||
const data = [ |
|||
{ |
|||
title: '系统升级版本', |
|||
type: '通知', |
|||
keys: ['通知', '升级'], |
|||
date: new Date() |
|||
}, |
|||
{ |
|||
title: '系统凌晨维护', |
|||
type: '公告', |
|||
keys: ['公告', '维护'], |
|||
date: new Date() |
|||
}, |
|||
{ |
|||
title: '系统升级版本', |
|||
type: '通知', |
|||
keys: ['通知', '升级'], |
|||
date: new Date() |
|||
}, |
|||
{ |
|||
title: '系统凌晨维护', |
|||
type: '公告', |
|||
keys: ['公告', '维护'], |
|||
date: new Date() |
|||
} |
|||
] |
|||
notice = Object.assign(notice, data) |
|||
} |
|||
|
|||
// 获取快捷入口 |
|||
let shortcut = reactive<Shortcut[]>([]) |
|||
|
|||
const getShortcut = async () => { |
|||
const data = [ |
|||
{ |
|||
name: 'Github', |
|||
icon: 'akar-icons:github-fill', |
|||
url: 'github.io' |
|||
}, |
|||
{ |
|||
name: 'Vue', |
|||
icon: 'logos:vue', |
|||
url: 'vuejs.org' |
|||
}, |
|||
{ |
|||
name: 'Vite', |
|||
icon: 'vscode-icons:file-type-vite', |
|||
url: 'https://vitejs.dev/' |
|||
}, |
|||
{ |
|||
name: 'Angular', |
|||
icon: 'logos:angular-icon', |
|||
url: 'github.io' |
|||
}, |
|||
{ |
|||
name: 'React', |
|||
icon: 'logos:react', |
|||
url: 'github.io' |
|||
}, |
|||
{ |
|||
name: 'Webpack', |
|||
icon: 'logos:webpack', |
|||
url: 'github.io' |
|||
} |
|||
] |
|||
shortcut = Object.assign(shortcut, data) |
|||
} |
|||
|
|||
// 用户来源 |
|||
const getUserAccessSource = async () => { |
|||
const data = [ |
|||
{ value: 335, name: 'analysis.directAccess' }, |
|||
{ value: 310, name: 'analysis.mailMarketing' }, |
|||
{ value: 234, name: 'analysis.allianceAdvertising' }, |
|||
{ value: 135, name: 'analysis.videoAdvertising' }, |
|||
{ value: 1548, name: 'analysis.searchEngines' } |
|||
] |
|||
set( |
|||
pieOptionsData, |
|||
'legend.data', |
|||
data.map((v) => t(v.name)) |
|||
) |
|||
pieOptionsData!.series![0].data = data.map((v) => { |
|||
return { |
|||
name: t(v.name), |
|||
value: v.value |
|||
} |
|||
}) |
|||
} |
|||
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' } |
|||
] |
|||
set( |
|||
barOptionsData, |
|||
'xAxis.data', |
|||
data.map((v) => t(v.name)) |
|||
) |
|||
set(barOptionsData, 'series', [ |
|||
{ |
|||
name: t('analysis.activeQuantity'), |
|||
data: data.map((v) => v.value), |
|||
type: 'bar' |
|||
} |
|||
]) |
|||
} |
|||
|
|||
const getAllApi = async () => { |
|||
await Promise.all([ |
|||
getCount(), |
|||
getProject(), |
|||
getNotice(), |
|||
getShortcut(), |
|||
getUserAccessSource(), |
|||
getWeeklyUserActivity() |
|||
]) |
|||
loading.value = false |
|||
} |
|||
|
|||
getAllApi() |
|||
</script> |
|||
</style> |
|||
|
@ -0,0 +1,381 @@ |
|||
<template> |
|||
<div> |
|||
<el-card shadow="never"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row :gutter="20" justify="space-between"> |
|||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24"> |
|||
<div class="flex items-center"> |
|||
<img :src="avatar" alt="" class="mr-20px h-70px w-70px rounded-[50%]" /> |
|||
<div> |
|||
<div class="text-20px"> |
|||
{{ t('workplace.welcome') }} {{ username }} {{ t('workplace.happyDay') }} |
|||
</div> |
|||
<div class="mt-10px text-14px text-gray-500"> |
|||
{{ t('workplace.toady') }},20℃ - 32℃! |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</el-col> |
|||
<el-col :xl="12" :lg="12" :md="12" :sm="24" :xs="24"> |
|||
<div class="h-70px flex items-center justify-end lt-sm:mt-10px"> |
|||
<div class="px-8px text-right"> |
|||
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.project') }}</div> |
|||
<CountTo |
|||
class="text-20px" |
|||
:start-val="0" |
|||
:end-val="totalSate.project" |
|||
:duration="2600" |
|||
/> |
|||
</div> |
|||
<el-divider direction="vertical" /> |
|||
<div class="px-8px text-right"> |
|||
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.toDo') }}</div> |
|||
<CountTo |
|||
class="text-20px" |
|||
:start-val="0" |
|||
:end-val="totalSate.todo" |
|||
:duration="2600" |
|||
/> |
|||
</div> |
|||
<el-divider direction="vertical" border-style="dashed" /> |
|||
<div class="px-8px text-right"> |
|||
<div class="mb-20px text-14px text-gray-400">{{ t('workplace.access') }}</div> |
|||
<CountTo |
|||
class="text-20px" |
|||
:start-val="0" |
|||
:end-val="totalSate.access" |
|||
:duration="2600" |
|||
/> |
|||
</div> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</div> |
|||
|
|||
<el-row class="mt-5px" :gutter="20" justify="space-between"> |
|||
<el-col :xl="16" :lg="16" :md="24" :sm="24" :xs="24" class="mb-10px"> |
|||
<el-card shadow="never"> |
|||
<template #header> |
|||
<div class="h-3 flex justify-between"> |
|||
<span>{{ t('workplace.project') }}</span> |
|||
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link> |
|||
</div> |
|||
</template> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row> |
|||
<el-col |
|||
v-for="(item, index) in projects" |
|||
:key="`card-${index}`" |
|||
:xl="8" |
|||
:lg="8" |
|||
:md="8" |
|||
:sm="24" |
|||
:xs="24" |
|||
> |
|||
<el-card shadow="hover"> |
|||
<div class="flex items-center"> |
|||
<Icon :icon="item.icon" :size="25" class="mr-10px" /> |
|||
<span class="text-16px">{{ item.name }}</span> |
|||
</div> |
|||
<div class="mt-15px text-14px text-gray-400">{{ t(item.message) }}</div> |
|||
<div class="mt-20px flex justify-between text-12px text-gray-400"> |
|||
<span>{{ item.personal }}</span> |
|||
<span>{{ formatTime(item.time, 'yyyy-MM-dd') }}</span> |
|||
</div> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
|
|||
<el-card shadow="never" class="mt-5px"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row :gutter="20" justify="space-between"> |
|||
<el-col :xl="10" :lg="10" :md="24" :sm="24" :xs="24"> |
|||
<el-card shadow="hover" class="mb-10px"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<Echart :options="pieOptionsData" :height="280" /> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
<el-col :xl="14" :lg="14" :md="24" :sm="24" :xs="24"> |
|||
<el-card shadow="hover" class="mb-10px"> |
|||
<el-skeleton :loading="loading" animated> |
|||
<Echart :options="barOptionsData" :height="280" /> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24" class="mb-10px"> |
|||
<el-card shadow="never"> |
|||
<template #header> |
|||
<div class="h-3 flex justify-between"> |
|||
<span>{{ t('workplace.shortcutOperation') }}</span> |
|||
</div> |
|||
</template> |
|||
<el-skeleton :loading="loading" animated> |
|||
<el-row> |
|||
<el-col v-for="item in shortcut" :key="`team-${item.name}`" :span="8" class="mb-10px"> |
|||
<div class="flex items-center"> |
|||
<Icon :icon="item.icon" class="mr-10px" /> |
|||
<el-link type="default" :underline="false" @click="setWatermark(item.name)"> |
|||
{{ item.name }} |
|||
</el-link> |
|||
</div> |
|||
</el-col> |
|||
</el-row> |
|||
</el-skeleton> |
|||
</el-card> |
|||
<el-card shadow="never" class="mt-10px"> |
|||
<template #header> |
|||
<div class="h-3 flex justify-between"> |
|||
<span>{{ t('workplace.notice') }}</span> |
|||
<el-link type="primary" :underline="false">{{ t('action.more') }}</el-link> |
|||
</div> |
|||
</template> |
|||
<el-skeleton :loading="loading" animated> |
|||
<div v-for="(item, index) in notice" :key="`dynamics-${index}`"> |
|||
<div class="flex items-center"> |
|||
<img :src="avatar" alt="" class="mr-20px h-35px w-35px rounded-[50%]" /> |
|||
<div> |
|||
<div class="text-14px"> |
|||
<Highlight :keys="item.keys.map((v) => t(v))"> |
|||
{{ item.type }} : {{ item.title }} |
|||
</Highlight> |
|||
</div> |
|||
<div class="mt-15px text-12px text-gray-400"> |
|||
{{ formatTime(item.date, 'yyyy-MM-dd') }} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<el-divider /> |
|||
</div> |
|||
</el-skeleton> |
|||
</el-card> |
|||
</el-col> |
|||
</el-row> |
|||
</template> |
|||
<script lang="ts" setup> |
|||
import { set } from 'lodash-es' |
|||
import { EChartsOption } from 'echarts' |
|||
import { formatTime } from '@/utils' |
|||
|
|||
import { useUserStore } from '@/store/modules/user' |
|||
import { useWatermark } from '@/hooks/web/useWatermark' |
|||
import avatarImg from '@/assets/imgs/avatar.gif' |
|||
import type { WorkplaceTotal, Project, Notice, Shortcut } from './types' |
|||
import { pieOptions, barOptions } from './echarts-data' |
|||
|
|||
defineOptions({ name: 'Home' }) |
|||
|
|||
const { t } = useI18n() |
|||
const userStore = useUserStore() |
|||
const { setWatermark } = useWatermark() |
|||
const loading = ref(true) |
|||
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg |
|||
const username = userStore.getUser.nickname |
|||
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption |
|||
// 获取统计数 |
|||
let totalSate = reactive<WorkplaceTotal>({ |
|||
project: 0, |
|||
access: 0, |
|||
todo: 0 |
|||
}) |
|||
|
|||
const getCount = async () => { |
|||
const data = { |
|||
project: 40, |
|||
access: 2340, |
|||
todo: 10 |
|||
} |
|||
totalSate = Object.assign(totalSate, data) |
|||
} |
|||
|
|||
// 获取项目数 |
|||
let projects = reactive<Project[]>([]) |
|||
const getProject = async () => { |
|||
const data = [ |
|||
{ |
|||
name: 'Github', |
|||
icon: 'akar-icons:github-fill', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'Vue', |
|||
icon: 'logos:vue', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'Angular', |
|||
icon: 'logos:angular-icon', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'React', |
|||
icon: 'logos:react', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'Webpack', |
|||
icon: 'logos:webpack', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
}, |
|||
{ |
|||
name: 'Vite', |
|||
icon: 'vscode-icons:file-type-vite', |
|||
message: 'workplace.introduction', |
|||
personal: 'Archer', |
|||
time: new Date() |
|||
} |
|||
] |
|||
projects = Object.assign(projects, data) |
|||
} |
|||
|
|||
// 获取通知公告 |
|||
let notice = reactive<Notice[]>([]) |
|||
const getNotice = async () => { |
|||
const data = [ |
|||
{ |
|||
title: '系统升级版本', |
|||
type: '通知', |
|||
keys: ['通知', '升级'], |
|||
date: new Date() |
|||
}, |
|||
{ |
|||
title: '系统凌晨维护', |
|||
type: '公告', |
|||
keys: ['公告', '维护'], |
|||
date: new Date() |
|||
}, |
|||
{ |
|||
title: '系统升级版本', |
|||
type: '通知', |
|||
keys: ['通知', '升级'], |
|||
date: new Date() |
|||
}, |
|||
{ |
|||
title: '系统凌晨维护', |
|||
type: '公告', |
|||
keys: ['公告', '维护'], |
|||
date: new Date() |
|||
} |
|||
] |
|||
notice = Object.assign(notice, data) |
|||
} |
|||
|
|||
// 获取快捷入口 |
|||
let shortcut = reactive<Shortcut[]>([]) |
|||
|
|||
const getShortcut = async () => { |
|||
const data = [ |
|||
{ |
|||
name: 'Github', |
|||
icon: 'akar-icons:github-fill', |
|||
url: 'github.io' |
|||
}, |
|||
{ |
|||
name: 'Vue', |
|||
icon: 'logos:vue', |
|||
url: 'vuejs.org' |
|||
}, |
|||
{ |
|||
name: 'Vite', |
|||
icon: 'vscode-icons:file-type-vite', |
|||
url: 'https://vitejs.dev/' |
|||
}, |
|||
{ |
|||
name: 'Angular', |
|||
icon: 'logos:angular-icon', |
|||
url: 'github.io' |
|||
}, |
|||
{ |
|||
name: 'React', |
|||
icon: 'logos:react', |
|||
url: 'github.io' |
|||
}, |
|||
{ |
|||
name: 'Webpack', |
|||
icon: 'logos:webpack', |
|||
url: 'github.io' |
|||
} |
|||
] |
|||
shortcut = Object.assign(shortcut, data) |
|||
} |
|||
|
|||
// 用户来源 |
|||
const getUserAccessSource = async () => { |
|||
const data = [ |
|||
{ value: 335, name: 'analysis.directAccess' }, |
|||
{ value: 310, name: 'analysis.mailMarketing' }, |
|||
{ value: 234, name: 'analysis.allianceAdvertising' }, |
|||
{ value: 135, name: 'analysis.videoAdvertising' }, |
|||
{ value: 1548, name: 'analysis.searchEngines' } |
|||
] |
|||
set( |
|||
pieOptionsData, |
|||
'legend.data', |
|||
data.map((v) => t(v.name)) |
|||
) |
|||
pieOptionsData!.series![0].data = data.map((v) => { |
|||
return { |
|||
name: t(v.name), |
|||
value: v.value |
|||
} |
|||
}) |
|||
} |
|||
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' } |
|||
] |
|||
set( |
|||
barOptionsData, |
|||
'xAxis.data', |
|||
data.map((v) => t(v.name)) |
|||
) |
|||
set(barOptionsData, 'series', [ |
|||
{ |
|||
name: t('analysis.activeQuantity'), |
|||
data: data.map((v) => v.value), |
|||
type: 'bar' |
|||
} |
|||
]) |
|||
} |
|||
|
|||
const getAllApi = async () => { |
|||
await Promise.all([ |
|||
getCount(), |
|||
getProject(), |
|||
getNotice(), |
|||
getShortcut(), |
|||
getUserAccessSource(), |
|||
getWeeklyUserActivity() |
|||
]) |
|||
loading.value = false |
|||
} |
|||
|
|||
getAllApi() |
|||
</script> |
@ -0,0 +1,94 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { TableColumn } from '@/types/table' |
|||
import * as GxApi from '@/api/basedata/progx' |
|||
|
|||
const gxList = await GxApi.getAllGxs() |
|||
|
|||
|
|||
// 表单校验
|
|||
export const DeviceRules = reactive({ |
|||
deviceNo: [required], |
|||
deviceName: [required], |
|||
gxId: [required] |
|||
}) |
|||
|
|||
export const Device = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '设备编号', |
|||
field: 'deviceNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '设备名称', |
|||
field: 'deviceName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '设备描述', |
|||
field: 'deviceDesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '所属工序', |
|||
field: 'gxId', |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return gxList.find((obj) => obj.id === cellValue)?.gxName |
|||
}, |
|||
search: { |
|||
show: true, |
|||
component: 'Select', |
|||
api: () => gxList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'gxName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => gxList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'gxName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,220 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Device.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Device.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="DeviceRules" |
|||
:formAllSchemas="Device.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="DeviceApi.updateDevice" |
|||
:apiCreate="DeviceApi.createDevice" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Device,DeviceRules } from './device.data' |
|||
import * as DeviceApi from '@/api/basedata/device' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Device' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Device.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: DeviceApi.getDevicePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicDevice') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await DeviceApi.deleteDevice(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await DeviceApi.exportDevice(setSearchParams) |
|||
download.excel(data, '设备信息.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '设备信息导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await DeviceApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,96 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { TableColumn } from '@/types/table' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import * as GroupApi from '@/api/basedata/group' |
|||
|
|||
const groupList = await GroupApi.getAllGroupList() |
|||
|
|||
// 表单校验
|
|||
export const FactoryRules = reactive({ |
|||
facNo: [required], |
|||
facName: [required], |
|||
groupId: [required] |
|||
}) |
|||
|
|||
const crudSchemas = reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '工厂编号', |
|||
field: 'facNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '工厂名称', |
|||
field: 'facName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '工厂描述', |
|||
field: 'facDesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '所属集团', |
|||
field: 'groupId', |
|||
isTable: true, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return groupList.find((group) => group.id === cellValue)?.groupName |
|||
}, |
|||
search: { |
|||
show: true, |
|||
component: 'Select', |
|||
api: () => groupList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'groupName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => groupList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'groupName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
]) |
|||
|
|||
export const { allSchemas } = useCrudSchemas(crudSchemas) |
@ -0,0 +1,220 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="FactoryRules" |
|||
:formAllSchemas="allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="FactoryApi.updateFactory" |
|||
:apiCreate="FactoryApi.createFactory" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { allSchemas , FactoryRules } from './factory.data' |
|||
import * as FactoryApi from '@/api/basedata/factory' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Factory' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: FactoryApi.getFactoryPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicFactory') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await FactoryApi.deleteFactory(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await FactoryApi.exportFactory(setSearchParams) |
|||
download.excel(data, '工厂信息.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '工厂信息导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await FactoryApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,60 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const GroupRules = reactive({ |
|||
groupNo: [required], |
|||
groupName: [required] |
|||
}) |
|||
|
|||
export const Group = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '集团编号', |
|||
field: 'groupNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '集团名称', |
|||
field: 'groupName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'groupDesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,220 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Group.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Group.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="GroupRules" |
|||
:formAllSchemas="Group.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="GroupApi.updateGroup" |
|||
:apiCreate="GroupApi.createGroup" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Group,GroupRules } from './group.data' |
|||
import * as GroupApi from '@/api/basedata/group' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Group' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Group.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: GroupApi.getGroupPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicGroup') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await GroupApi.deleteGroup(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await GroupApi.exportGroup(setSearchParams) |
|||
download.excel(data, '集团信息.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '集团信息导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await GroupApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,220 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Progx.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Progx.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="ProgxRules" |
|||
:formAllSchemas="Progx.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="ProgxApi.updateProgx" |
|||
:apiCreate="ProgxApi.createProgx" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Progx,ProgxRules } from './progx.data' |
|||
import * as ProgxApi from '@/api/basedata/progx' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Progx' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Progx.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: ProgxApi.getProgxPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicProgx') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await ProgxApi.deleteProgx(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await ProgxApi.exportProgx(setSearchParams) |
|||
download.excel(data, '工序信息.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '工序信息导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await ProgxApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,93 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { TableColumn } from '@/types/table' |
|||
import * as LineApi from '@/api/basedata/proline' |
|||
|
|||
const lineList = await LineApi.selectAllLines() |
|||
|
|||
// 表单校验
|
|||
export const ProgxRules = reactive({ |
|||
gxNo: [required], |
|||
gxName: [required], |
|||
lineId: [required] |
|||
}) |
|||
|
|||
export const Progx = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '工序编号', |
|||
field: 'gxNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '工序名称', |
|||
field: 'gxName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '工序描述', |
|||
field: 'gxDesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '所属产线', |
|||
field: 'lineId', |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return lineList.find((obj) => obj.id === cellValue)?.lineName |
|||
}, |
|||
search: { |
|||
show: true, |
|||
component: 'Select', |
|||
api: () => lineList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'lineName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => lineList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'lineName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,220 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Proline.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Proline.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="ProlineRules" |
|||
:formAllSchemas="Proline.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="ProlineApi.updateProline" |
|||
:apiCreate="ProlineApi.createProline" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Proline,ProlineRules } from './proline.data' |
|||
import * as ProlineApi from '@/api/basedata/proline' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Proline' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Proline.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: ProlineApi.getProlinePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicProline') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await ProlineApi.deleteProline(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await ProlineApi.exportProline(setSearchParams) |
|||
download.excel(data, '产线信息.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '产线信息导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await ProlineApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,93 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { TableColumn } from '@/types/table' |
|||
import * as ShopApi from '@/api/basedata/workshop' |
|||
|
|||
const shopList = await ShopApi.selectAllShops() |
|||
|
|||
// 表单校验
|
|||
export const ProlineRules = reactive({ |
|||
lineNo: [required], |
|||
lineName: [required], |
|||
shopId: [required] |
|||
}) |
|||
|
|||
export const Proline = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '产线编号', |
|||
field: 'lineNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '产线名称', |
|||
field: 'lineName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '产线描述', |
|||
field: 'lineDesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '所属车间', |
|||
field: 'shopId', |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return shopList.find((obj) => obj.id === cellValue)?.shopName |
|||
}, |
|||
search: { |
|||
show: true, |
|||
component: 'Select', |
|||
api: () => shopList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'shopName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => shopList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'shopName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,220 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Workshop.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Workshop.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="WorkshopRules" |
|||
:formAllSchemas="Workshop.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="WorkshopApi.updateWorkshop" |
|||
:apiCreate="WorkshopApi.createWorkshop" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Workshop,WorkshopRules } from './workshop.data' |
|||
import * as WorkshopApi from '@/api/basedata/workshop' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Workshop' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Workshop.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: WorkshopApi.getWorkshopPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicWorkshop') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await WorkshopApi.deleteWorkshop(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await WorkshopApi.exportWorkshop(setSearchParams) |
|||
download.excel(data, '车间信息.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '车间信息导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await WorkshopApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,93 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { TableColumn } from '@/types/table' |
|||
import * as FactoryApi from '@/api/basedata/factory' |
|||
|
|||
const facList = await FactoryApi.selectAllFactorys() |
|||
|
|||
// 表单校验
|
|||
export const WorkshopRules = reactive({ |
|||
shopNo: [required], |
|||
shopName: [required], |
|||
facId: [required] |
|||
}) |
|||
|
|||
export const Workshop = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '车间编号', |
|||
field: 'shopNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '车间名称', |
|||
field: 'shopName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '车间描述', |
|||
field: 'shopDesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '所属工厂', |
|||
field: 'facId', |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { |
|||
return facList.find((obj) => obj.id === cellValue)?.facName |
|||
}, |
|||
search: { |
|||
show: true, |
|||
component: 'Select', |
|||
api: () => facList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'facName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => facList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'facName', |
|||
valueField: 'id' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,58 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const HardnessOneRules = reactive({ |
|||
}) |
|||
|
|||
export const HardnessOne = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
{ |
|||
label: '批次号', |
|||
field: 'fileName', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '文件类型', |
|||
field: 'fileType', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'SelectV2' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '系统生成的文件名称', |
|||
field: 'fileNewName', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 400 |
|||
} |
|||
}, |
|||
{ |
|||
label: '创建时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,227 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="HardnessOne.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="HardnessOne.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<el-button type="text" @click="viewHardOne(row)">预览</el-button> |
|||
<el-button type="text" @click="downloadHardOne(row)">下载</el-button> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="HardnessOneRules" |
|||
:formAllSchemas="HardnessOne.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="HardnessOneApi.updateHardnessOne" |
|||
:apiCreate="HardnessOneApi.createHardnessOne" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<!-- 导入 --> |
|||
<ImportSimpleForm ref="importFormRef" url="/lab/hardnessone/import" :importTemplateData="importTemplateData" @success="importSuccess" /> |
|||
|
|||
<Dialog v-model="viewVisible" title="预览" width="850" :close-on-click-modal="false"> |
|||
<div style="width: 820px; height: 600px ; overflow-y: auto"> |
|||
<div ref="fileRef"></div> |
|||
</div> |
|||
</Dialog> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { HardnessOne,HardnessOneRules } from './hardnessOne.data' |
|||
import {renderAsync} from 'docx-preview' |
|||
import * as HardnessOneApi from '@/api/lab/hardness/one' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'HardnessOne' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const viewVisible = ref(false) |
|||
|
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(HardnessOne.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: HardnessOneApi.getHardnessOnePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultImportBtn({}), // 导入 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
// defaultButtons.defaultSetBtn(null), // 设置 |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
|
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListDeleteBtn({}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicHardnessOne') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await HardnessOneApi.deleteHardnessOne(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
const fileRef = ref() |
|||
const viewHardOne = async (row) => { |
|||
viewVisible.value = true |
|||
const res = await HardnessOneApi.downLoadForHardOne(row.id) |
|||
renderAsync(res, fileRef.value) |
|||
} |
|||
|
|||
const downloadHardOne = async (row) => { |
|||
const res = await HardnessOneApi.downLoadForHardOne(row.id) |
|||
let url = window.URL.createObjectURL(new Blob([res])); |
|||
let link = document.createElement("a"); |
|||
link.style.display = "none"; |
|||
link.href = url; |
|||
link.setAttribute("download", row.fileName + ".docx"); |
|||
document.body.appendChild(link); |
|||
link.click(); |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-硬度-文档数据导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
// importTemplateData.templateUrl = await HardnessOneApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,248 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const ImpactRules = reactive({ |
|||
}) |
|||
|
|||
export const Impact = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '批次号', |
|||
field: 'batchNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '送样单位', |
|||
field: 'sydw', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '材质', |
|||
field: 'cz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规格', |
|||
field: 'guig', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验人', |
|||
field: 'operator', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
dictType: DICT_TYPE.LAB_USER_TEST_TYPE, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '实验日期', |
|||
field: 'testDate', |
|||
sort: 'custom', |
|||
// formatter: dateFormatter,
|
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
type: 'daterange', |
|||
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'date', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 250 |
|||
} |
|||
}, |
|||
{ |
|||
label: '采集来源ID', |
|||
field: 'dataId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否完成', |
|||
field: 'fineshed', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '序号(一般3次)', |
|||
field: 'sampleNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 250 |
|||
} |
|||
}, |
|||
{ |
|||
label: '冲击能量', |
|||
field: 'energy', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '冲击韧度', |
|||
field: 'toughness', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检测标准', |
|||
field: 'standard', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '实验操作者',
|
|||
// field: 'operator',
|
|||
// sort: 'custom',
|
|||
// isSearch: false,
|
|||
// table: {
|
|||
// width: 150
|
|||
// }
|
|||
// },
|
|||
{ |
|||
label: '物料号', |
|||
field: 'material', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '温度', |
|||
field: 'temperature', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '缺口类型', |
|||
field: 'style', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '长度', |
|||
field: 'length', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '宽度', |
|||
field: 'width', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '厚度', |
|||
field: 'height', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '缺口深度', |
|||
field: 'deep', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '面积', |
|||
field: 'area', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '审核状态', |
|||
field: 'auditStatus', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 120, |
|||
fixed: 'right' |
|||
}, |
|||
dictType: DICT_TYPE.LAB_AUDIT_STATUS, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '数据采集时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'right' |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 180, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,225 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Impact.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Impact.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<el-button type="text" @click="auditStatus(row)">确认</el-button> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="ImpactRules" |
|||
:formAllSchemas="Impact.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="ImpactApi.updateImpact" |
|||
:apiCreate="ImpactApi.createImpact" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Impact,ImpactRules } from './impact.data' |
|||
import * as ImpactApi from '@/api/lab/impact' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Impact' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Impact.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: ImpactApi.getImpactPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({}), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn({}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 确认审核操作事件 |
|||
const auditStatus = async (row) => { |
|||
let data = {id: row.id , auditStatus: '1'} |
|||
// 确认 |
|||
await message.confirm('确认?') |
|||
// 修改 |
|||
await ImpactApi.updateImpact(data) |
|||
message.success('操作成功') |
|||
// 刷新列表 |
|||
await getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicImpact') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await ImpactApi.deleteImpact(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await ImpactApi.exportImpact(setSearchParams) |
|||
download.excel(data, '实验室-冲击数据.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-冲击数据导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await ImpactApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,227 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Platscale.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Platscale.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<el-button type="text" @click="auditStatus(row)">确认</el-button> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="PlatscaleRules" |
|||
:formAllSchemas="Platscale.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="PlatscaleApi.updatePlatscale" |
|||
:apiCreate="PlatscaleApi.createPlatscale" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Platscale,PlatscaleRules } from './platscale.data' |
|||
import * as PlatscaleApi from '@/api/lab/platscale' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Platscale' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Platscale.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: PlatscaleApi.getPlatscalePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
// 确认审核操作事件 |
|||
const auditStatus = async (row) => { |
|||
let data = {id: row.id , auditStatus: '1'} |
|||
// 确认 |
|||
await message.confirm('确认?') |
|||
// 修改 |
|||
await PlatscaleApi.updatePlatscale(data) |
|||
message.success('操作成功') |
|||
// 刷新列表 |
|||
await getList() |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await PlatscaleApi.deletePlatscale(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await PlatscaleApi.exportPlatscale(setSearchParams) |
|||
download.excel(data, '实验室-地衡.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-地衡导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
// importTemplateData.templateUrl = await PlatscaleApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,332 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const PlatscaleRules = reactive({ |
|||
}) |
|||
|
|||
export const Platscale = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '批号', |
|||
field: 'batchNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '送样单位', |
|||
field: 'sydw', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '标准', |
|||
field: 'standard', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '材质', |
|||
field: 'cz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规格', |
|||
field: 'guig', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验人', |
|||
field: 'testUser', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
dictType: DICT_TYPE.LAB_USER_TEST_TYPE, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '车号', |
|||
field: 'ch', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '车型', |
|||
field: 'cx', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '品种', |
|||
field: 'pz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '供货单位', |
|||
field: 'ghdw', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '运输单位', |
|||
field: 'ysdw', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '出入库', |
|||
field: 'crk', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '毛重', |
|||
field: 'mz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '皮重', |
|||
field: 'pzh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '净重', |
|||
field: 'jz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '检斤员', |
|||
field: 'jjy', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '日期', |
|||
field: 'rq', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
formatter: dateFormatter2, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
type: 'date' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '一次计量时间', |
|||
field: 'jlsjOne', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'TimePicker', |
|||
componentProps: { |
|||
valueFormat: 'HH:mm:ss', |
|||
type: 'time' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '二次计量时间', |
|||
field: 'jlsjTwo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
form: { |
|||
component: 'TimePicker', |
|||
componentProps: { |
|||
valueFormat: 'HH:mm:ss', |
|||
type: 'time' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '编号', |
|||
field: 'bh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '送货单位', |
|||
field: 'shdw', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '性质', |
|||
field: 'xz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '防伪码', |
|||
field: 'fwm', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '抽样时间', |
|||
field: 'cysj', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '抽样编号', |
|||
field: 'cybh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '抽样结果', |
|||
field: 'cyjg', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '报告单编号', |
|||
field: 'bgdbh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否抽检', |
|||
field: 'sfcj', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '审核状态', |
|||
field: 'auditStatus', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 120, |
|||
fixed: 'right' |
|||
}, |
|||
dictType: DICT_TYPE.LAB_AUDIT_STATUS, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '采集时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'right' |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 180, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,233 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Spectrum.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Spectrum.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<el-button type="text" @click="auditStatus(row)">确认</el-button> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="SpectrumRules" |
|||
:formAllSchemas="Spectrum.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:apiUpdate="SpectrumApi.updateSpectrum" |
|||
:apiCreate="SpectrumApi.createSpectrum" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Spectrum,SpectrumRules } from './spectrum.data' |
|||
import * as SpectrumApi from '@/api/lab/spectrum' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Spectrum' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Spectrum.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: SpectrumApi.getSpectrumPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn({}), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn({}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
// 确认审核操作事件 |
|||
const auditStatus = async (row) => { |
|||
let data = {id: row.id , auditStatus: '1'} |
|||
// 确认 |
|||
await message.confirm('确认?') |
|||
// 修改 |
|||
await SpectrumApi.updateSpectrum(data) |
|||
message.success('操作成功') |
|||
// 刷新列表 |
|||
await getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicSpectrum') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await SpectrumApi.deleteSpectrum(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await SpectrumApi.exportSpectrum(setSearchParams) |
|||
download.excel(data, '实验室-光谱数据.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-光谱数据导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await SpectrumApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,281 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const SpectrumRules = reactive({ |
|||
}) |
|||
|
|||
export const Spectrum = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '批次号', |
|||
field: 'batchNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '送样单位', |
|||
field: 'syCompany', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '标准', |
|||
field: 'standard', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '材质', |
|||
field: 'cz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规格', |
|||
field: 'specsNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验人', |
|||
field: 'testUser', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
dictType: DICT_TYPE.LAB_USER_TEST_TYPE, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '实验日期', |
|||
field: 'oprDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '原材料厂家', |
|||
field: 'yclSupplier', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
// {
|
|||
// label: '炉号',
|
|||
// field: 'deviceNo',
|
|||
// sort: 'custom',
|
|||
// isSearch: false,
|
|||
// },
|
|||
{ |
|||
label: '任务', |
|||
field: 'task', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '任务类型', |
|||
field: 'taskType', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '预留', |
|||
field: 'sid1', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '类型', |
|||
field: 'type', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'C', |
|||
field: 'cfC', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Si', |
|||
field: 'cfSi', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Mn', |
|||
field: 'cfMn', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'P', |
|||
field: 'cfP', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'S', |
|||
field: 'cfS', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Cr', |
|||
field: 'cfCr', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Mo', |
|||
field: 'cfMo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Ni', |
|||
field: 'cfNi', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'V', |
|||
field: 'cfV', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Al', |
|||
field: 'cfAl', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Cu', |
|||
field: 'cfCu', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Ti', |
|||
field: 'cfTi', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'W', |
|||
field: 'cfW', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'B', |
|||
field: 'cfB', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'Fe', |
|||
field: 'cfFe', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'Nb', |
|||
field: 'cfNb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '审核状态', |
|||
field: 'auditStatus', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 120, |
|||
fixed: 'right' |
|||
}, |
|||
dictType: DICT_TYPE.LAB_AUDIT_STATUS, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '数据采集时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'right' |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,211 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Stretch1000.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Stretch1000.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<el-button type="text" @click="openQxView(row)">曲线视图</el-button> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="Stretch1000Rules" |
|||
:formAllSchemas="Stretch1000.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="Stretch1000Api.updateStretch1000" |
|||
:apiCreate="Stretch1000Api.createStretch1000" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<Qxview ref="qxviewRef" /> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Stretch1000,Stretch1000Rules } from './stretchthousand.data' |
|||
import * as Stretch1000Api from '@/api/lab/stretch/stretchthousand' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Stretch1000' }) |
|||
|
|||
const deviceTypeList = ref([]) |
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Stretch1000.allSchemas.tableColumns) |
|||
const qxviewRef = ref() |
|||
|
|||
const openQxView = async (row) => { |
|||
const data = await Stretch1000Api.getStretchQxInfo(row.id) |
|||
if (data != null && data.deviceTypeList != null && data.dataList != null) { |
|||
qxviewRef.value.open(data.deviceTypeList , data.dataList) |
|||
} |
|||
} |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: Stretch1000Api.getStretch1000Page // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
}else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
// console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretch1000') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await Stretch1000Api.deleteStretch1000(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await Stretch1000Api.exportStretch1000(setSearchParams) |
|||
download.excel(data, '实验室-拉伸1000.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-拉伸1000导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,257 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const Stretch1000Rules = reactive({ |
|||
}) |
|||
|
|||
export const Stretch1000 = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '曲线id', |
|||
field: 'qxId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '批号', |
|||
field: 'batchNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '编号', |
|||
field: 'bhNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验日期', |
|||
field: 'testDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter2, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
type: 'daterange', |
|||
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'date', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验人', |
|||
field: 'testUser', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '形状', |
|||
field: 'deviceXz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '尺寸', |
|||
field: 'deviceCc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '面积', |
|||
field: 'deviceArea', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'lo', |
|||
field: 'deviceLo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'fmc', |
|||
field: 'deviceFmc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rmc', |
|||
field: 'deviceRmc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'fehc', |
|||
field: 'deviceFehc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rehc', |
|||
field: 'deviceRehc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'felc', |
|||
field: 'deviceFelc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'relc', |
|||
field: 'deviceRelc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'fpc', |
|||
field: 'deviceFpc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rpc', |
|||
field: 'deviceRpc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'ftc', |
|||
field: 'deviceFtc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rtc', |
|||
field: 'deviceRtc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'ec', |
|||
field: 'deviceEc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'slope', |
|||
field: 'slope', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'test_flag', |
|||
field: 'testFlag', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '采集时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 250, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,238 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="StretchThousandnew.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="StretchThousandnew.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<el-button type="text" @click="auditStatus(row)">确认</el-button> |
|||
<el-button type="text" @click="openQxView(row)">曲线视图</el-button> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="StretchThousandnewRules" |
|||
:formAllSchemas="StretchThousandnew.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="StretchThousandnewApi.updateStretchThousandnew" |
|||
:apiCreate="StretchThousandnewApi.createStretchThousandnew" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<Qxview ref="qxviewRef" /> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { StretchThousandnew,StretchThousandnewRules } from './stretchThousandnew.data' |
|||
import * as StretchThousandnewApi from '@/api/lab/stretch/stretchThousandnew' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'StretchThousandnew' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(StretchThousandnew.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
const qxviewRef = ref() |
|||
|
|||
const openQxView = async (row) => { |
|||
const data = await StretchThousandnewApi.getStretchQxInfo(row.id) |
|||
if (data != null && data.deviceTypeList != null && data.dataList != null) { |
|||
qxviewRef.value.open(data.deviceTypeList , data.dataList) |
|||
} else { |
|||
message.success('未获取到对应的数据') |
|||
} |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: StretchThousandnewApi.getStretchThousandnewPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
// 确认审核操作事件 |
|||
const auditStatus = async (row) => { |
|||
let data = {id: row.id , auditStatus: '1'} |
|||
// 确认 |
|||
await message.confirm('确认?') |
|||
// 修改 |
|||
await StretchThousandnewApi.updateStretchThousandnew(data) |
|||
message.success('操作成功') |
|||
// 刷新列表 |
|||
await getList() |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretchThousandnew') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await StretchThousandnewApi.deleteStretchThousandnew(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await StretchThousandnewApi.exportStretchThousandnew(setSearchParams) |
|||
download.excel(data, '实验室-拉伸1000.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-拉伸1000导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,515 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const StretchThousandnewRules = reactive({ |
|||
}) |
|||
|
|||
export const StretchThousandnew = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '曲线ID', |
|||
field: 'qxId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '批次号', |
|||
field: 'batchNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '编号', |
|||
field: 'bhNo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '送样单位', |
|||
field: 'sydw', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '标准', |
|||
field: 'standard', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '材质', |
|||
field: 'cz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规格', |
|||
field: 'guig', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验人', |
|||
field: 'testUser', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
dictType: DICT_TYPE.LAB_USER_TEST_TYPE, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '实验日期', |
|||
field: 'testDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter2, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
type: 'daterange', |
|||
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'date', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '形状', |
|||
field: 'deviceXz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '尺寸', |
|||
field: 'deviceCc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '面积', |
|||
field: 'deviceArea', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: '标距倍率', |
|||
field: 'deviceBjbl', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'Gauge', |
|||
field: 'deviceGauge', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'lu', |
|||
field: 'deviceLu', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'A', |
|||
field: 'deviceA', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断面尺寸', |
|||
field: 'deviceDmcc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'su', |
|||
field: 'deviceSu', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'z', |
|||
field: 'deviceZ', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'fm', |
|||
field: 'deviceFm', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rm', |
|||
field: 'deviceRm', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'feh', |
|||
field: 'deviceFeh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'reh', |
|||
field: 'deviceReh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'fel', |
|||
field: 'deviceFel', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rel', |
|||
field: 'deviceRel', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'fp', |
|||
field: 'deviceFp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rp', |
|||
field: 'deviceRp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'ft', |
|||
field: 'deviceFt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rt', |
|||
field: 'deviceRt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'e', |
|||
field: 'deviceE', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: '屈强比', |
|||
field: 'deviceQqb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: '强屈比', |
|||
field: 'deviceQqbb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'At', |
|||
field: 'deviceAt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'agt', |
|||
field: 'deviceAgt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'ag', |
|||
field: 'deviceAg', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'ae', |
|||
field: 'deviceAe', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定负荷', |
|||
field: 'deviceGdfh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定负荷下伸长', |
|||
field: 'deviceGdfhXsc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定负荷下伸长率', |
|||
field: 'deviceGdfhXscl', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定伸长', |
|||
field: 'deviceGdsc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定伸长下负荷', |
|||
field: 'deviceGdscXfh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'slope', |
|||
field: 'slope', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验完成', |
|||
field: 'testFlag', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断后伸长', |
|||
field: 'deviceDhsc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '拐点伸长', |
|||
field: 'deviceGdssc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大力伸长', |
|||
field: 'deviceZdlsc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rp下标', |
|||
field: 'deviceRpXb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'rt下标', |
|||
field: 'deviceRtXb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 100 |
|||
} |
|||
}, |
|||
{ |
|||
label: '屈服结束X', |
|||
field: 'deviceQfjsx', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '审核状态', |
|||
field: 'auditStatus', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 120, |
|||
fixed: 'right' |
|||
}, |
|||
dictType: DICT_TYPE.LAB_AUDIT_STATUS, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '采集时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'right' |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 250, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,221 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Stretch1000Qx.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Stretch1000Qx.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="Stretch1000QxRules" |
|||
:formAllSchemas="Stretch1000Qx.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="Stretch1000QxApi.updateStretch1000Qx" |
|||
:apiCreate="Stretch1000QxApi.createStretch1000Qx" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Stretch1000Qx,Stretch1000QxRules } from './stretch1000Qx.data' |
|||
import * as Stretch1000QxApi from '@/api/lab/stretch/stretchthousandqx' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
|
|||
defineOptions({ name: 'Stretch1000Qx' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Stretch1000Qx.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: Stretch1000QxApi.getStretch1000QxPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretch1000Qx') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await Stretch1000QxApi.deleteStretch1000Qx(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await Stretch1000QxApi.exportStretch1000Qx(setSearchParams) |
|||
download.excel(data, '实验室-拉伸1000--曲线数据.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-拉伸1000--曲线数据导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await Stretch1000QxApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,92 @@ |
|||
import { isObject } from './../../../../utils/is'; |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
import { TableColumn } from '@/types/table' |
|||
import * as Stretch1000QxApi from '@/api/lab/stretch/stretchthousandqx' |
|||
|
|||
const typeList = await Stretch1000QxApi.getQxTypeList() |
|||
|
|||
// 表单校验
|
|||
export const Stretch1000QxRules = reactive({ |
|||
}) |
|||
|
|||
export const Stretch1000Qx = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '曲线id', |
|||
field: 'qxId', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '曲线类型', |
|||
field: 'dedviceType', |
|||
isTable: true, |
|||
formatter: (_: Recordable, __: TableColumn, cellValue: String) => { |
|||
return typeList.find((obj) => obj.value === cellValue)?.name |
|||
}, |
|||
search: { |
|||
show: true, |
|||
component: 'Select', |
|||
api: () => typeList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'value' |
|||
} |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'Select', |
|||
api: () => typeList, |
|||
componentProps: { |
|||
optionsAlias: { |
|||
labelField: 'name', |
|||
valueField: 'value' |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '横轴值', |
|||
field: 'deviceX', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: 'y轴值', |
|||
field: 'deviceY', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '采集时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,246 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Stretch300.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Stretch300.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<el-button type="text" @click="auditStatus(row)">确认</el-button> |
|||
<el-button type="text" @click="openQxView(row)">曲线视图</el-button> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="Stretch300Rules" |
|||
:formAllSchemas="Stretch300.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="Stretch300Api.updateStretch300" |
|||
:apiCreate="Stretch300Api.createStretch300" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
<QxviewThree ref="qxviewThreeRef" /> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Stretch300,Stretch300Rules } from './stretchthreehundred.data' |
|||
import * as Stretch300Api from '@/api/lab/stretch/stretchthreehundred' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Stretch300' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Stretch300.allSchemas.tableColumns) |
|||
const qxviewThreeRef = ref() |
|||
|
|||
const openQxView = async (row) => { |
|||
const data = await Stretch300Api.getStretchThreeQxInfo(row.syzbh) |
|||
if (data != null && data.dataList != null) { |
|||
qxviewThreeRef.value.open(data.dataList , '实验力-位移') |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: Stretch300Api.getStretch300Page // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
// 确认审核操作事件 |
|||
const auditStatus = async (row) => { |
|||
let data = {id: row.id , auditStatus: '1'} |
|||
// 确认 |
|||
await message.confirm('确认?') |
|||
// 修改 |
|||
await Stretch300Api.updateStretch300(data) |
|||
message.success('操作成功') |
|||
// 刷新列表 |
|||
await getList() |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretch300') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await Stretch300Api.deleteStretch300(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await Stretch300Api.exportStretch300(setSearchParams) |
|||
download.excel(data, '实验室-拉伸300.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-拉伸300导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await Stretch300Api.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,734 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter , dateFormatter2} from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const Stretch300Rules = reactive({ |
|||
}) |
|||
|
|||
export const Stretch300 = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '试样序号', |
|||
field: 'syid', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '试样编号', |
|||
field: 'syzbh', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '送样单位', |
|||
field: 'sydw', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '标准', |
|||
field: 'standard', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '材质', |
|||
field: 'cz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规格', |
|||
field: 'guig', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验人', |
|||
field: 'testUser', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
dictType: DICT_TYPE.LAB_USER_TEST_TYPE, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '试验日期', |
|||
field: 'testDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter2, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
type: 'daterange', |
|||
// defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
|
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'date', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否完成标识', |
|||
field: 'flag', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大力', |
|||
field: 'jfb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大强度', |
|||
field: 'jb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '上屈服强度', |
|||
field: 'jsu', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '下屈服强度', |
|||
field: 'js', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断裂强度', |
|||
field: 'jt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '弹性模量', |
|||
field: 'je', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例应力', |
|||
field: 'jp', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断裂伸长率', |
|||
field: 'jdl', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断面收缩率', |
|||
field: 'jdm', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '上屈服力', |
|||
field: 'jsuf', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '下屈服力', |
|||
field: 'jsf', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例伸长力', |
|||
field: 'jpf', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大力非比例伸长率(%)', |
|||
field: 'jag', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大力总伸长率(%)', |
|||
field: 'jagt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定总延伸强度(%)', |
|||
field: 'jrt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '屈服点延伸率(%)', |
|||
field: 'jae', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '吸收功(N.m)', |
|||
field: 'sorbWork', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'R值', |
|||
field: 'jr', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'N值', |
|||
field: 'jn', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '泊松比', |
|||
field: 'jbsb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定总延伸力(N)', |
|||
field: 'jrf', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '弹性之起点值', |
|||
field: 'jdlStartvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '弹性之未点值', |
|||
field: 'jdlEndvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '泊松比的起点变形值', |
|||
field: 'jbsbStartvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '泊松比的末点变形值', |
|||
field: 'jbsbEndvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定应变值', |
|||
field: 'jrSpecon', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'N值的起点应变', |
|||
field: 'jnStartvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'N值的末点应变', |
|||
field: 'jnEndvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'N值的规定点数', |
|||
field: 'jnSpecon', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大力之索引点', |
|||
field: 'jfbInx', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '上屈服力之索引点', |
|||
field: 'jsufInx', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '下屈服力之索引点', |
|||
field: 'jsfInx', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例伸长力之索引点', |
|||
field: 'jpfInx', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '弹性模量之起点值', |
|||
field: 'jeStartvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '弹性模量之未点值', |
|||
field: 'jeEndvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '弹性模量之算法', |
|||
field: 'jeSpemath', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例应力之起点值', |
|||
field: 'jpStartvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例应力之未点值', |
|||
field: 'jpEndvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例应力之n%之值', |
|||
field: 'jpSpecon', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例应力之算法', |
|||
field: 'jpSpemath', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例伸长力之起点值', |
|||
field: 'jpfStartvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例伸长力之未点值', |
|||
field: 'jpfEndvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例伸长力之n%之值', |
|||
field: 'jpfSpecon', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '非比例伸长力之算法', |
|||
field: 'jpfSpemath', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大力非比例伸长率(%)', |
|||
field: 'jagStartvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大力非比例伸长率(%)', |
|||
field: 'jagEndvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '最大力非比例伸长率(%)之算法', |
|||
field: 'jagSpemath', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 250 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定总延伸强度(%)', |
|||
field: 'jrtSpecon', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '规定总延伸力(N)', |
|||
field: 'jrfSpecon', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '屈服点延伸率(%)', |
|||
field: 'jaeStartvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '屈服点延伸率(%)', |
|||
field: 'jaeEndvalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '屈服点延伸率(%)之算法', |
|||
field: 'jaeSpemath', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否使用引伸计', |
|||
field: 'isExtension', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断后标距', |
|||
field: 'lot', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断后直径', |
|||
field: 'dt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断后宽度', |
|||
field: 'bt', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断后厚度', |
|||
field: 'at1', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '引伸计类型', |
|||
field: 'extensionType', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
// form: {
|
|||
// component: 'SelectV2'
|
|||
// },
|
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '引伸计的名称', |
|||
field: 'extensionName', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '试样是否有效的标志', |
|||
field: 'vld', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '横梁速度', |
|||
field: 'hlSd', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '断裂百分比之值', |
|||
field: 'dlbfbV', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '是否闭环控制', |
|||
field: 'isBhkz', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '用户代号(采集的数据)', |
|||
field: 'userId', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '审核状态', |
|||
field: 'auditStatus', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 120, |
|||
fixed: 'right' |
|||
}, |
|||
dictType: DICT_TYPE.LAB_AUDIT_STATUS, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '采集时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
table: { |
|||
width: 200, |
|||
fixed: 'right' |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 250, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,220 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="Stretch300Qx.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="Stretch300Qx.allSchemas" |
|||
/> |
|||
|
|||
<!-- 列表 --> |
|||
<ContentWrap> |
|||
<Table |
|||
:columns="tableColumns" |
|||
:data="tableObject.tableList" |
|||
:loading="tableObject.loading" |
|||
:pagination="{ |
|||
total: tableObject.total |
|||
}" |
|||
v-model:pageSize="tableObject.pageSize" |
|||
v-model:currentPage="tableObject.currentPage" |
|||
v-model:sort="tableObject.sort" |
|||
> |
|||
<template #code="{row}"> |
|||
<el-button type="primary" link @click="openDetail(row, '代码', row.code)"> |
|||
<span>{{ row.code }}</span> |
|||
</el-button> |
|||
</template> |
|||
<template #action="{ row }"> |
|||
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|||
</template> |
|||
</Table> |
|||
</ContentWrap> |
|||
|
|||
<!-- 表单弹窗:添加/修改 --> |
|||
<BasicForm |
|||
ref="basicFormRef" |
|||
@success="getList" |
|||
:rules="Stretch300QxRules" |
|||
:formAllSchemas="Stretch300Qx.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="Stretch300QxApi.updateStretch300Qx" |
|||
:apiCreate="Stretch300QxApi.createStretch300Qx" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { Stretch300Qx,Stretch300QxRules } from './stretch300Qx.data' |
|||
import * as Stretch300QxApi from '@/api/lab/stretch/stretchthreehundredqx' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'Stretch300Qx' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(Stretch300Qx.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([ |
|||
//{ |
|||
// formField: 'productItemCode', |
|||
// searchTableTitle: '物料信息', |
|||
// searchTableAllSchemas: Itembasic.allSchemas, |
|||
// searchTablePage: ItembasicApi.getItembasicPage |
|||
//} |
|||
]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: Stretch300QxApi.getStretch300QxPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
defaultButtons.defaultAddBtn(null), // 新增 |
|||
defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
defaultButtons.defaultSetBtn(null), // 设置 |
|||
// { |
|||
// label: '自定义扩展按钮', |
|||
// name: 'zdy', |
|||
// hide: false, |
|||
// type: 'primary', |
|||
// icon: 'Select', |
|||
// color: '' |
|||
// }, |
|||
] |
|||
|
|||
// 头部按钮事件 |
|||
const buttonBaseClick = (val, item) => { |
|||
if (val == 'add') { // 新增 |
|||
openForm('create') |
|||
} else if (val == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
defaultButtons.mainListEditBtn(null), // 编辑 |
|||
defaultButtons.mainListDeleteBtn(null), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
const buttonTableClick = async (val, row) => { |
|||
if (val == 'edit') { // 编辑 |
|||
openForm('update', row) |
|||
} else if (val == 'delete') { // 删除 |
|||
handleDelete(row.id) |
|||
} |
|||
} |
|||
|
|||
/** 添加/修改操作 */ |
|||
const basicFormRef = ref() |
|||
const openForm = (type: string, row?: any) => { |
|||
basicFormRef.value.open(type, row) |
|||
} |
|||
|
|||
// 查询页面返回 |
|||
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|||
nextTick(() => { |
|||
const setV = {} |
|||
setV[formField] = val[0][searchField] |
|||
formRef.setValues(setV) |
|||
}) |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicStretch300Qx') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await Stretch300QxApi.deleteStretch300Qx(id) |
|||
message.success(t('common.delSuccess')) |
|||
// 刷新列表 |
|||
await getList() |
|||
} catch {} |
|||
} |
|||
|
|||
/** 导出按钮操作 */ |
|||
const exportLoading = ref(false) // 导出的加载中 |
|||
const handleExport = async () => { |
|||
try { |
|||
// 导出的二次确认 |
|||
await message.exportConfirm() |
|||
// 发起导出 |
|||
exportLoading.value = true |
|||
const data = await Stretch300QxApi.exportStretch300Qx(setSearchParams) |
|||
download.excel(data, '实验室-拉伸300-曲线图数据.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-拉伸300-曲线图数据导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await Stretch300QxApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,106 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const Stretch300QxRules = reactive({ |
|||
}) |
|||
|
|||
export const Stretch300Qx = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '试样编号', |
|||
field: 'syzbh', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '实验力(N)', |
|||
field: 'syl', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '轴向变形(mm)', |
|||
field: 'zxbx', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '横向变形(mm)', |
|||
field: 'hxbx', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '位移(mm)', |
|||
field: 'wy', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '横梁速度(mm/min)', |
|||
field: 'hlsd', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '时间(s)', |
|||
field: 'sj', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '真应力', |
|||
field: 'zyl', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '真应变', |
|||
field: 'zyb', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '采集时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD HH:mm:ss', |
|||
type: 'daterange', |
|||
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] |
|||
} |
|||
}, |
|||
isForm: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
Loading…
Reference in new issue