Browse Source

穿孔机格式化数据值为时分秒

master
songguoqiang 1 year ago
parent
commit
d4b322a452
  1. 7
      src/views/pszc/hrpuncherdata108/operationtimedata108/hrPuncherdata108.data.ts
  2. 11
      src/views/pszc/hrpuncherdata108/operationtimedata108/index.vue

7
src/views/pszc/hrpuncherdata108/operationtimedata108/hrPuncherdata108.data.ts

@ -46,6 +46,13 @@ export const HrPuncherdata108 = useCrudSchemas(reactive<CrudSchema[]>([
field: 'ivalue',
sort: 'custom',
isSearch: false,
// formatter: (row,column, cellValue) => {
// const hourTime = parseInt(time.slice(0,2));
// const minuteTime = parseInt(time.slice(3,5));
// const secondTime = parseInt(time.slice(6,8));
// return hourTime*3600+minuteTime*60+secondTime;
// },
},
{
label: '仪表的编号',

11
src/views/pszc/hrpuncherdata108/operationtimedata108/index.vue

@ -33,6 +33,10 @@
</el-button>
</template>
<template #ivalue="{row}">
<span>{{ timesFormatter(row.ivalue)}}</span>
</template>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
@ -64,6 +68,9 @@ import download from '@/utils/download'
import { HrPuncherdata108,HrPuncherdata108Rules } from './hrPuncherdata108.data'
import * as HrPuncherdata108Api from '@/api/pszc/hrpuncherdata108'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
dayjs.extend(duration);
defineOptions({ name: 'OperationTimeData108' })
@ -218,6 +225,10 @@ const searchFormClick = (searchData) => {
setSearchParams(param); //
}
const timesFormatter=(s)=>{
return dayjs.duration(s, 'seconds').format('HH时mm分ss秒');
}
/** 初始化 **/
onMounted(async () => {
getList();

Loading…
Cancel
Save