daikun1@bosssoft.com.cn
12 months ago
19 changed files with 2388 additions and 2 deletions
@ -0,0 +1,51 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface AsyncOprLogVO { |
|||
id: number |
|||
busType: string |
|||
oprType: string |
|||
oprResult: string |
|||
oprMsg: string |
|||
busDate: string |
|||
} |
|||
|
|||
// 查询实验室-主动同步日志列表
|
|||
export const getAsyncOprLogPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/asyncoprlog/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/asyncoprlog/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-主动同步日志详情
|
|||
export const getAsyncOprLog = async (id: number) => { |
|||
return await request.get({ url: `/lab/asyncoprlog/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-主动同步日志
|
|||
export const createAsyncOprLog = async (data: AsyncOprLogVO) => { |
|||
return await request.post({ url: `/lab/asyncoprlog/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-主动同步日志
|
|||
export const updateAsyncOprLog = async (data: AsyncOprLogVO) => { |
|||
return await request.put({ url: `/lab/asyncoprlog/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-主动同步日志
|
|||
export const deleteAsyncOprLog = async (id: number) => { |
|||
return await request.delete({ url: `/lab/asyncoprlog/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-主动同步日志 Excel
|
|||
export const exportAsyncOprLog = async (params) => { |
|||
return await request.download({ url: `/lab/asyncoprlog/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/asyncoprlog/get-import-template' }) |
|||
} |
@ -0,0 +1,57 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface HardnessThreeVO { |
|||
id: number |
|||
batchNo: string |
|||
sydw: string |
|||
standard: string |
|||
cz: string |
|||
guig: string |
|||
testUser: string |
|||
testDate: string |
|||
syl: string |
|||
ytcc: string |
|||
yhzj: string |
|||
testYd: string |
|||
} |
|||
|
|||
// 查询实验室-布氏硬度列表
|
|||
export const getHardnessThreePage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/hardnessthree/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/hardnessthree/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-布氏硬度详情
|
|||
export const getHardnessThree = async (id: number) => { |
|||
return await request.get({ url: `/lab/hardnessthree/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-布氏硬度
|
|||
export const createHardnessThree = async (data: HardnessThreeVO) => { |
|||
return await request.post({ url: `/lab/hardnessthree/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-布氏硬度
|
|||
export const updateHardnessThree = async (data: HardnessThreeVO) => { |
|||
return await request.put({ url: `/lab/hardnessthree/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-布氏硬度
|
|||
export const deleteHardnessThree = async (id: number) => { |
|||
return await request.delete({ url: `/lab/hardnessthree/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-布氏硬度 Excel
|
|||
export const exportHardnessThree = async (params) => { |
|||
return await request.download({ url: `/lab/hardnessthree/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/hardnessthree/get-import-template' }) |
|||
} |
@ -0,0 +1,58 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface HardnessTwoVO { |
|||
id: number |
|||
batchNo: string |
|||
sydw: string |
|||
standard: string |
|||
cz: string |
|||
guig: string |
|||
testUser: string |
|||
testDate: string |
|||
testType: string |
|||
dfirst: string |
|||
dtwo: string |
|||
davg: string |
|||
testYd: string |
|||
} |
|||
|
|||
// 查询实验室-韦氏硬度2列表
|
|||
export const getHardnessTwoPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/lab/hardnesstwo/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/lab/hardnesstwo/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询实验室-韦氏硬度2详情
|
|||
export const getHardnessTwo = async (id: number) => { |
|||
return await request.get({ url: `/lab/hardnesstwo/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增实验室-韦氏硬度2
|
|||
export const createHardnessTwo = async (data: HardnessTwoVO) => { |
|||
return await request.post({ url: `/lab/hardnesstwo/create`, data }) |
|||
} |
|||
|
|||
// 修改实验室-韦氏硬度2
|
|||
export const updateHardnessTwo = async (data: HardnessTwoVO) => { |
|||
return await request.put({ url: `/lab/hardnesstwo/update`, data }) |
|||
} |
|||
|
|||
// 删除实验室-韦氏硬度2
|
|||
export const deleteHardnessTwo = async (id: number) => { |
|||
return await request.delete({ url: `/lab/hardnesstwo/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出实验室-韦氏硬度2 Excel
|
|||
export const exportHardnessTwo = async (params) => { |
|||
return await request.download({ url: `/lab/hardnesstwo/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/lab/hardnesstwo/get-import-template' }) |
|||
} |
@ -0,0 +1,51 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PsElectricdataVO { |
|||
id: number |
|||
icode: string |
|||
iname: string |
|||
ivalue: string |
|||
mcode: string |
|||
mname: string |
|||
} |
|||
|
|||
// 查询变电所-智能电列表
|
|||
export const getPsElectricdataPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/pszc/pselectricdata/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/pszc/pselectricdata/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询变电所-智能电详情
|
|||
export const getPsElectricdata = async (id: number) => { |
|||
return await request.get({ url: `/pszc/pselectricdata/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增变电所-智能电
|
|||
export const createPsElectricdata = async (data: PsElectricdataVO) => { |
|||
return await request.post({ url: `/pszc/pselectricdata/create`, data }) |
|||
} |
|||
|
|||
// 修改变电所-智能电
|
|||
export const updatePsElectricdata = async (data: PsElectricdataVO) => { |
|||
return await request.put({ url: `/pszc/pselectricdata/update`, data }) |
|||
} |
|||
|
|||
// 删除变电所-智能电
|
|||
export const deletePsElectricdata = async (id: number) => { |
|||
return await request.delete({ url: `/pszc/pselectricdata/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出变电所-智能电 Excel
|
|||
export const exportPsElectricdata = async (params) => { |
|||
return await request.download({ url: `/pszc/pselectricdata/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/pszc/pselectricdata/get-import-template' }) |
|||
} |
@ -0,0 +1,57 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PsIrealdataVO { |
|||
id: number |
|||
ikey: string |
|||
icode: string |
|||
idesc: string |
|||
icls: string |
|||
ino: number |
|||
ivalue: string |
|||
irtuno: number |
|||
irtuname: string |
|||
irtudesc: string |
|||
irtutype: number |
|||
iupdatetime: Date |
|||
} |
|||
|
|||
// 查询变电所-一次主表列表
|
|||
export const getPsIrealdataPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/pszc/psirealdata/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/pszc/psirealdata/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询变电所-一次主表详情
|
|||
export const getPsIrealdata = async (id: number) => { |
|||
return await request.get({ url: `/pszc/psirealdata/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增变电所-一次主表
|
|||
export const createPsIrealdata = async (data: PsIrealdataVO) => { |
|||
return await request.post({ url: `/pszc/psirealdata/create`, data }) |
|||
} |
|||
|
|||
// 修改变电所-一次主表
|
|||
export const updatePsIrealdata = async (data: PsIrealdataVO) => { |
|||
return await request.put({ url: `/pszc/psirealdata/update`, data }) |
|||
} |
|||
|
|||
// 删除变电所-一次主表
|
|||
export const deletePsIrealdata = async (id: number) => { |
|||
return await request.delete({ url: `/pszc/psirealdata/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出变电所-一次主表 Excel
|
|||
export const exportPsIrealdata = async (params) => { |
|||
return await request.download({ url: `/pszc/psirealdata/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/pszc/psirealdata/get-import-template' }) |
|||
} |
@ -0,0 +1,51 @@ |
|||
import request from '@/config/axios' |
|||
|
|||
export interface PsPumpdataVO { |
|||
id: number |
|||
icode: string |
|||
iname: string |
|||
ivalue: string |
|||
mcode: string |
|||
mname: string |
|||
} |
|||
|
|||
// 查询变电所-泵站列表
|
|||
export const getPsPumpdataPage = async (params) => { |
|||
if (params.isSearch) { |
|||
delete params.isSearch |
|||
const data = {...params} |
|||
return await request.post({ url: '/pszc/pspumpdata/senior', data }) |
|||
} else { |
|||
return await request.get({ url: `/pszc/pspumpdata/page`, params }) |
|||
} |
|||
} |
|||
|
|||
// 查询变电所-泵站详情
|
|||
export const getPsPumpdata = async (id: number) => { |
|||
return await request.get({ url: `/pszc/pspumpdata/get?id=` + id }) |
|||
} |
|||
|
|||
// 新增变电所-泵站
|
|||
export const createPsPumpdata = async (data: PsPumpdataVO) => { |
|||
return await request.post({ url: `/pszc/pspumpdata/create`, data }) |
|||
} |
|||
|
|||
// 修改变电所-泵站
|
|||
export const updatePsPumpdata = async (data: PsPumpdataVO) => { |
|||
return await request.put({ url: `/pszc/pspumpdata/update`, data }) |
|||
} |
|||
|
|||
// 删除变电所-泵站
|
|||
export const deletePsPumpdata = async (id: number) => { |
|||
return await request.delete({ url: `/pszc/pspumpdata/delete?id=` + id }) |
|||
} |
|||
|
|||
// 导出变电所-泵站 Excel
|
|||
export const exportPsPumpdata = async (params) => { |
|||
return await request.download({ url: `/pszc/pspumpdata/export-excel`, params }) |
|||
} |
|||
|
|||
// 下载导入模板
|
|||
export const importTemplate = () => { |
|||
return request.download({ url: '/pszc/pspumpdata/get-import-template' }) |
|||
} |
@ -0,0 +1,89 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const AsyncOprLogRules = reactive({ |
|||
}) |
|||
|
|||
export const AsyncOprLog = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '业务类型', |
|||
field: 'busType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.LAB_ASYNC_BUS_TYPE, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '操作类型', |
|||
field: 'oprType', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
dictType: DICT_TYPE.LAB_OPR_TYPE, |
|||
dictClass: 'number' |
|||
}, |
|||
{ |
|||
label: '操作结果', |
|||
field: 'oprResult', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '描述', |
|||
field: 'oprMsg', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '业务日期', |
|||
field: 'busDate', |
|||
sort: 'custom', |
|||
formatter: dateFormatter2, |
|||
isSearch: true, |
|||
search: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
valueFormat: 'YYYY-MM-DD', |
|||
type: 'date' |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'date', |
|||
valueFormat: 'YYYY-MM-DD' |
|||
} |
|||
}, |
|||
}, |
|||
{ |
|||
label: '执行时间', |
|||
field: 'createTime', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
isSearch: false, |
|||
isForm: false, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'date', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
} |
|||
// ,
|
|||
// {
|
|||
// label: '操作',
|
|||
// field: 'action',
|
|||
// isForm: false,
|
|||
// table: {
|
|||
// width: 150,
|
|||
// fixed: 'right'
|
|||
// }
|
|||
// }
|
|||
])) |
@ -0,0 +1,215 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="AsyncOprLog.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="AsyncOprLog.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="AsyncOprLogRules" |
|||
:formAllSchemas="AsyncOprLog.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="AsyncOprLogApi.updateAsyncOprLog" |
|||
:apiCreate="AsyncOprLogApi.createAsyncOprLog" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { AsyncOprLog,AsyncOprLogRules } from './asyncOprLog.data' |
|||
import * as AsyncOprLogApi from '@/api/lab/asyncoprlog' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'AsyncOprLog' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(AsyncOprLog.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: AsyncOprLogApi.getAsyncOprLogPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
// defaultButtons.defaultAddBtn(null), // 新增 |
|||
// defaultButtons.defaultImportBtn({hasPermi:'wms:asyncOprLog:import'}), // 导入 |
|||
// defaultButtons.defaultExportBtn({hasPermi:'wms:asyncOprLog:export'}), // 导出 |
|||
// defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
// defaultButtons.defaultFilterBtn(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({hasPermi:'wms:asyncOprLog:update'}), // 编辑 |
|||
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:asyncOprLog:delete'}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
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, 'basicAsyncOprLog') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await AsyncOprLogApi.deleteAsyncOprLog(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 AsyncOprLogApi.exportAsyncOprLog(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 AsyncOprLogApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,173 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const HardnessThreeRules = reactive({ |
|||
}) |
|||
|
|||
export const HardnessThree = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '批次号', |
|||
field: 'batchNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '送样单位', |
|||
field: 'sydw', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '标准', |
|||
field: 'standard', |
|||
sort: 'false', |
|||
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: 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: 'date', |
|||
valueFormat: 'YYYY-MM-DD' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '实验力(KN)', |
|||
field: 'syl', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '压头尺寸(mm)', |
|||
field: 'ytcc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '压痕直径(mm)', |
|||
field: 'yhzj', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '硬度', |
|||
field: 'testYd', |
|||
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')] |
|||
} |
|||
}, |
|||
table: { |
|||
width: 180, |
|||
fixed: 'right' |
|||
}, |
|||
isForm: false, |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,225 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="HardnessThree.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="HardnessThree.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="HardnessThreeRules" |
|||
:formAllSchemas="HardnessThree.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="HardnessThreeApi.updateHardnessThree" |
|||
:apiCreate="HardnessThreeApi.createHardnessThree" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { HardnessThree,HardnessThreeRules } from './hardnessThree.data' |
|||
import * as HardnessThreeApi from '@/api/lab/hardness/three' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'HardnessThree' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(HardnessThree.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: HardnessThreeApi.getHardnessThreePage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
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 == '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 auditStatus = async (row) => { |
|||
let data = {id: row.id , auditStatus: '1'} |
|||
// 确认 |
|||
await message.confirm('确认?') |
|||
// 修改 |
|||
await HardnessThreeApi.updateHardnessThree(data) |
|||
message.success('操作成功') |
|||
// 刷新列表 |
|||
await getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicHardnessThree') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await HardnessThreeApi.deleteHardnessThree(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 HardnessThreeApi.exportHardnessThree(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 HardnessThreeApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,182 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const HardnessTwoRules = reactive({ |
|||
}) |
|||
|
|||
export const HardnessTwo = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '批次号', |
|||
field: 'batchNo', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
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: false, |
|||
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: 'YYYY-MM-DD' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '类别', |
|||
field: 'testType', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'd1(um)', |
|||
field: 'dfirst', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: 'd2(um)', |
|||
field: 'dtwo', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '平均(um)', |
|||
field: 'davg', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '硬度', |
|||
field: 'testYd', |
|||
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: 180, |
|||
fixed: 'right' |
|||
} |
|||
}, |
|||
{ |
|||
label: '操作', |
|||
field: 'action', |
|||
isForm: false, |
|||
table: { |
|||
width: 150, |
|||
fixed: 'right' |
|||
} |
|||
} |
|||
])) |
@ -0,0 +1,218 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="HardnessTwo.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="HardnessTwo.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="HardnessTwoRules" |
|||
:formAllSchemas="HardnessTwo.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="HardnessTwoApi.updateHardnessTwo" |
|||
:apiCreate="HardnessTwoApi.createHardnessTwo" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { HardnessTwo,HardnessTwoRules } from './hardnessTwo.data' |
|||
import * as HardnessTwoApi from '@/api/lab/hardness/two' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'HardnessTwo' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(HardnessTwo.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: HardnessTwoApi.getHardnessTwoPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
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 == '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 auditStatus = async (row) => { |
|||
let data = {id: row.id , auditStatus: '1'} |
|||
// 确认 |
|||
await message.confirm('确认?') |
|||
// 修改 |
|||
await HardnessTwoApi.updateHardnessTwo(data) |
|||
message.success('操作成功') |
|||
// 刷新列表 |
|||
await getList() |
|||
} |
|||
|
|||
/** 详情操作 */ |
|||
const detailRef = ref() |
|||
const openDetail = (row: any, titleName: any, titleValue: any) => { |
|||
detailRef.value.openDetail(row, titleName, titleValue, 'basicHardnessTwo') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await HardnessTwoApi.deleteHardnessTwo(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 HardnessTwoApi.exportHardnessTwo(setSearchParams) |
|||
download.excel(data, '实验室-韦氏硬度2.xls') |
|||
} catch { |
|||
} finally { |
|||
exportLoading.value = false |
|||
} |
|||
} |
|||
|
|||
/** 导入 */ |
|||
const importFormRef = ref() |
|||
const handleImport = () => { |
|||
importFormRef.value.open() |
|||
} |
|||
// 导入附件弹窗所需的参数 |
|||
const importTemplateData = reactive({ |
|||
templateUrl: '', |
|||
templateTitle: '实验室-韦氏硬度2导入模版.xls' |
|||
}) |
|||
// 导入成功之后 |
|||
const importSuccess = () => { |
|||
getList() |
|||
} |
|||
|
|||
// 筛选提交 |
|||
const searchFormClick = (searchData) => { |
|||
tableObject.params = { |
|||
isSearch: true, |
|||
filters: searchData.filters |
|||
} |
|||
getList() // 刷新当前列表 |
|||
} |
|||
|
|||
/** 初始化 **/ |
|||
onMounted(async () => { |
|||
getList() |
|||
importTemplateData.templateUrl = await HardnessTwoApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,212 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="PsElectricdata.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PsElectricdata.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="PsElectricdataRules" |
|||
:formAllSchemas="PsElectricdata.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="PsElectricdataApi.updatePsElectricdata" |
|||
:apiCreate="PsElectricdataApi.createPsElectricdata" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { PsElectricdata,PsElectricdataRules } from './psElectricdata.data' |
|||
import * as PsElectricdataApi from '@/api/pszc/pselectricdata' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'PsElectricdata' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(PsElectricdata.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: PsElectricdataApi.getPsElectricdataPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
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 == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
// defaultButtons.mainListEditBtn({hasPermi:'wms:psElectricdata:update'}), // 编辑 |
|||
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:psElectricdata:delete'}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
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, 'basicPsElectricdata') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await PsElectricdataApi.deletePsElectricdata(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 PsElectricdataApi.exportPsElectricdata(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 PsElectricdataApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,76 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const PsElectricdataRules = reactive({ |
|||
icode: [required], |
|||
iname: [required], |
|||
ivalue: [required], |
|||
mcode: [required], |
|||
mname: [required], |
|||
}) |
|||
|
|||
export const PsElectricdata = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '数据点编号', |
|||
field: 'icode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '数据点名称', |
|||
field: 'iname', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '采集值', |
|||
field: 'ivalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '仪表的编号', |
|||
field: 'mcode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '仪表的名称', |
|||
field: 'mname', |
|||
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,205 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="PsIrealdata.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PsIrealdata.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="PsIrealdataRules" |
|||
:formAllSchemas="PsIrealdata.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="PsIrealdataApi.updatePsIrealdata" |
|||
:apiCreate="PsIrealdataApi.createPsIrealdata" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { PsIrealdata,PsIrealdataRules } from './psIrealdata.data' |
|||
import * as PsIrealdataApi from '@/api/pszc/psireaidata' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'PsIrealdata' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(PsIrealdata.allSchemas.tableColumns) |
|||
|
|||
// 字段设置 更新主列表字段 |
|||
const updataTableColumns = (val) => { |
|||
tableColumns.value = val |
|||
} |
|||
|
|||
// 查询列表页面参数设置 |
|||
const searchTableParams = ref([]) |
|||
|
|||
const { tableObject, tableMethods } = useTable({ |
|||
getListApi: PsIrealdataApi.getPsIrealdataPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
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 == 'import') { // 导入 |
|||
handleImport() |
|||
} else if (val == 'export') { // 导出 |
|||
handleExport() |
|||
} else if (val == 'refresh') { // 刷新 |
|||
getList() |
|||
} else if (val == 'filtrate') { // 筛选 |
|||
} else { // 其他按钮 |
|||
console.log('其他按钮', item) |
|||
} |
|||
} |
|||
|
|||
// 列表-操作按钮 |
|||
const butttondata = [ |
|||
// defaultButtons.mainListEditBtn({hasPermi:'wms:psIrealdata:update'}), // 编辑 |
|||
// defaultButtons.mainListDeleteBtn({hasPermi:'wms:psIrealdata:delete'}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
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, 'basicPsIrealdata') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await PsIrealdataApi.deletePsIrealdata(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 PsIrealdataApi.exportPsIrealdata(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 PsIrealdataApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,168 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const PsIrealdataRules = reactive({ |
|||
icode: [required], |
|||
idesc: [required], |
|||
ino: [required], |
|||
ivalue: [required], |
|||
irtuno: [required], |
|||
irtuname: [required], |
|||
irtudesc: [required], |
|||
irtutype: [required], |
|||
iupdatetime: [required], |
|||
}) |
|||
|
|||
export const PsIrealdata = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '原始表key', |
|||
field: 'ikey', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '数据点编号', |
|||
field: 'icode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '数据点描述', |
|||
field: 'idesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '内部编号', |
|||
field: 'icls', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '索引号', |
|||
field: 'ino', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '采集值', |
|||
field: 'ivalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 120 |
|||
} |
|||
}, |
|||
{ |
|||
label: '编号(系统内)', |
|||
field: 'irtuno', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '编号(Meter01)', |
|||
field: 'irtuname', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '仪表描述', |
|||
field: 'irtudesc', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 200 |
|||
} |
|||
}, |
|||
{ |
|||
label: '仪表编号', |
|||
field: 'irtutype', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
table: { |
|||
width: 150 |
|||
} |
|||
}, |
|||
{ |
|||
label: '采集更新时间', |
|||
field: 'iupdatetime', |
|||
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')] |
|||
} |
|||
}, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
}, |
|||
table: { |
|||
width: 180 |
|||
} |
|||
}, |
|||
{ |
|||
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: 180 |
|||
} |
|||
} |
|||
// ,
|
|||
// {
|
|||
// label: '操作',
|
|||
// field: 'action',
|
|||
// isForm: false,
|
|||
// table: {
|
|||
// width: 150,
|
|||
// fixed: 'right'
|
|||
// }
|
|||
// }
|
|||
])) |
@ -0,0 +1,221 @@ |
|||
<template> |
|||
<ContentWrap> |
|||
<!-- 搜索工作栏 --> |
|||
<Search :schema="PsPumpdata.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" /> |
|||
</ContentWrap> |
|||
|
|||
<!-- 列表头部 --> |
|||
<TableHead |
|||
:HeadButttondata="HeadButttondata" |
|||
@button-base-click="buttonBaseClick" |
|||
:routeName="routeName" |
|||
@updataTableColumns="updataTableColumns" |
|||
@searchFormClick="searchFormClick" |
|||
:allSchemas="PsPumpdata.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="PsPumpdataRules" |
|||
:formAllSchemas="PsPumpdata.allSchemas" |
|||
:searchTableParams="searchTableParams" |
|||
:apiUpdate="PsPumpdataApi.updatePsPumpdata" |
|||
:apiCreate="PsPumpdataApi.createPsPumpdata" |
|||
@searchTableSuccess="searchTableSuccess" |
|||
:isBusiness="false" |
|||
/> |
|||
|
|||
</template> |
|||
|
|||
<script setup lang="ts"> |
|||
import download from '@/utils/download' |
|||
import { PsPumpdata,PsPumpdataRules } from './psPumpdata.data' |
|||
import * as PsPumpdataApi from '@/api/pszc/pspumpdata' |
|||
import * as defaultButtons from '@/utils/disposition/defaultButtons' |
|||
|
|||
defineOptions({ name: 'PsPumpdata' }) |
|||
|
|||
const message = useMessage() // 消息弹窗 |
|||
const { t } = useI18n() // 国际化 |
|||
|
|||
const route = useRoute() // 路由信息 |
|||
const routeName = ref() |
|||
routeName.value = route.name |
|||
const tableColumns = ref(PsPumpdata.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: PsPumpdataApi.getPsPumpdataPage // 分页接口 |
|||
}) |
|||
|
|||
// 获得表格的各种操作 |
|||
const { getList, setSearchParams } = tableMethods |
|||
|
|||
// 列表头部按钮 |
|||
const HeadButttondata = [ |
|||
// defaultButtons.defaultAddBtn(null), // 新增 |
|||
// defaultButtons.defaultFreshBtn(null), // 刷新 |
|||
// defaultButtons.defaultFilterBtn(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({hasPermi:'wms:psPumpdata:update'}), // 编辑 |
|||
defaultButtons.mainListDeleteBtn({hasPermi:'wms:psPumpdata:delete'}), // 删除 |
|||
] |
|||
|
|||
// 列表-操作按钮事件 |
|||
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, 'basicPsPumpdata') |
|||
} |
|||
|
|||
/** 删除按钮操作 */ |
|||
const handleDelete = async (id: number) => { |
|||
try { |
|||
// 删除的二次确认 |
|||
await message.delConfirm() |
|||
// 发起删除 |
|||
await PsPumpdataApi.deletePsPumpdata(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 PsPumpdataApi.exportPsPumpdata(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 PsPumpdataApi.importTemplate() |
|||
}) |
|||
|
|||
</script> |
@ -0,0 +1,76 @@ |
|||
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' |
|||
import { dateFormatter } from '@/utils/formatTime' |
|||
|
|||
// 表单校验
|
|||
export const PsPumpdataRules = reactive({ |
|||
icode: [required], |
|||
iname: [required], |
|||
ivalue: [required], |
|||
mcode: [required], |
|||
mname: [required], |
|||
}) |
|||
|
|||
export const PsPumpdata = useCrudSchemas(reactive<CrudSchema[]>([ |
|||
// {
|
|||
// label: '主键、自增',
|
|||
// field: 'id',
|
|||
// sort: 'custom',
|
|||
// isForm: false,
|
|||
// },
|
|||
{ |
|||
label: '数据点编号', |
|||
field: 'icode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '数据点名称', |
|||
field: 'iname', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '采集值', |
|||
field: 'ivalue', |
|||
sort: 'custom', |
|||
isSearch: false, |
|||
}, |
|||
{ |
|||
label: '仪表的编号', |
|||
field: 'mcode', |
|||
sort: 'custom', |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '仪表的名称', |
|||
field: 'mname', |
|||
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'
|
|||
// }
|
|||
// }
|
|||
])) |
Loading…
Reference in new issue