Browse Source

硬度数据、变电所数据模块

master
daikun1@bosssoft.com.cn 12 months ago
parent
commit
9ea564624f
  1. 51
      src/api/lab/asyncoprlog/index.ts
  2. 57
      src/api/lab/hardness/three/index.ts
  3. 58
      src/api/lab/hardness/two/index.ts
  4. 51
      src/api/pszc/pselectricdata/index.ts
  5. 57
      src/api/pszc/psireaidata/index.ts
  6. 51
      src/api/pszc/pspumpdata/index.ts
  7. 5
      src/utils/dict.ts
  8. 89
      src/views/lab/asyncoprlog/asyncOprLog.data.ts
  9. 215
      src/views/lab/asyncoprlog/index.vue
  10. 173
      src/views/lab/hardness/three/hardnessThree.data.ts
  11. 225
      src/views/lab/hardness/three/index.vue
  12. 182
      src/views/lab/hardness/two/hardnessTwo.data.ts
  13. 218
      src/views/lab/hardness/two/index.vue
  14. 212
      src/views/pszc/pselectricdata/index.vue
  15. 76
      src/views/pszc/pselectricdata/psElectricdata.data.ts
  16. 205
      src/views/pszc/psireaidata/index.vue
  17. 168
      src/views/pszc/psireaidata/psIrealdata.data.ts
  18. 221
      src/views/pszc/pspumpdata/index.vue
  19. 76
      src/views/pszc/pspumpdata/psPumpdata.data.ts

51
src/api/lab/asyncoprlog/index.ts

@ -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' })
}

57
src/api/lab/hardness/three/index.ts

@ -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' })
}

58
src/api/lab/hardness/two/index.ts

@ -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' })
}

51
src/api/pszc/pselectricdata/index.ts

@ -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' })
}

57
src/api/pszc/psireaidata/index.ts

@ -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' })
}

51
src/api/pszc/pspumpdata/index.ts

@ -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' })
}

5
src/utils/dict.ts

@ -184,6 +184,7 @@ export enum DICT_TYPE {
// ========== LAB - 实验室数据模块 ============ // ========== LAB - 实验室数据模块 ============
LAB_USER_TEST_TYPE = 'test_user_type', LAB_USER_TEST_TYPE = 'test_user_type',
LAB_AUDIT_STATUS = 'lab_audit_status' LAB_AUDIT_STATUS = 'lab_audit_status',
LAB_ASYNC_BUS_TYPE = 'lab_async_bus_type',
LAB_OPR_TYPE = 'lab_opr_type'
} }

89
src/views/lab/asyncoprlog/asyncOprLog.data.ts

@ -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'
// }
// }
]))

215
src/views/lab/asyncoprlog/index.vue

@ -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>

173
src/views/lab/hardness/three/hardnessThree.data.ts

@ -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'
}
}
]))

225
src/views/lab/hardness/three/index.vue

@ -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>

182
src/views/lab/hardness/two/hardnessTwo.data.ts

@ -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'
}
}
]))

218
src/views/lab/hardness/two/index.vue

@ -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>

212
src/views/pszc/pselectricdata/index.vue

@ -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>

76
src/views/pszc/pselectricdata/psElectricdata.data.ts

@ -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'
// }
// }
]))

205
src/views/pszc/psireaidata/index.vue

@ -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>

168
src/views/pszc/psireaidata/psIrealdata.data.ts

@ -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'
// }
// }
]))

221
src/views/pszc/pspumpdata/index.vue

@ -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>

76
src/views/pszc/pspumpdata/psPumpdata.data.ts

@ -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…
Cancel
Save