update
This commit is contained in:
@@ -1,40 +1,26 @@
|
||||
// export const tabList = [
|
||||
// {
|
||||
// name: '所有资源',
|
||||
// type: TabType.all,
|
||||
// },
|
||||
// {
|
||||
// name: '油田医院',
|
||||
// type: TabType.youTianYiYuan,
|
||||
// },
|
||||
// {
|
||||
// name: '医疗点',
|
||||
// type: TabType.yiLiaoDian,
|
||||
// },
|
||||
// ];
|
||||
import {cloneDeep} from 'lodash-es';
|
||||
import {nextTick, onMounted, ref} from "vue";
|
||||
import {allSecondaryDeparts} from "/@/components/secondaryScreen/commonApi";
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { allSecondaryDeparts } from '/@/components/secondaryScreen/commonApi';
|
||||
|
||||
export const watchIcon = new URL('/@/assets/img/watch.png', import.meta.url).href;
|
||||
|
||||
export function useDepart() {
|
||||
const orgCode = ref();
|
||||
const option = ref([]);
|
||||
const fieldNames = {label: 'departName', value: 'orgCode',}
|
||||
const fieldNames = { label: 'departName', value: 'orgCode' };
|
||||
onMounted(() => {
|
||||
getOptionData();
|
||||
});
|
||||
|
||||
function setOption(data) {
|
||||
option.value = data;
|
||||
orgCode.value = data[0]?.orgCode
|
||||
orgCode.value = data[0]?.orgCode;
|
||||
}
|
||||
|
||||
async function getOptionData() {
|
||||
const {result, code} = await allSecondaryDeparts();
|
||||
const { result, code } = await allSecondaryDeparts();
|
||||
if (code == 200) {
|
||||
setOption(result)
|
||||
setOption(result);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,112 +28,177 @@ export function useDepart() {
|
||||
orgCode,
|
||||
option,
|
||||
setOption,
|
||||
fieldNames
|
||||
fieldNames,
|
||||
};
|
||||
}
|
||||
|
||||
export function useTimeType(t) {
|
||||
const type = ref(t || '')
|
||||
const type = ref(t || '');
|
||||
const timeRangeOption = [
|
||||
{
|
||||
label: '近一周',
|
||||
value: 'week'
|
||||
value: 'week',
|
||||
},
|
||||
{
|
||||
label: '近一月',
|
||||
value: 'month'
|
||||
value: 'month',
|
||||
},
|
||||
{
|
||||
label: '近一年',
|
||||
value: 'year'
|
||||
}
|
||||
]
|
||||
value: 'year',
|
||||
},
|
||||
];
|
||||
return {
|
||||
type,
|
||||
timeRangeOption
|
||||
}
|
||||
timeRangeOption,
|
||||
};
|
||||
}
|
||||
|
||||
export function useFooterTable() {
|
||||
const isShowAlarm = ref(false)
|
||||
const isShowAlarm = ref(false);
|
||||
|
||||
function setIsShowAlarm(type: boolean) {
|
||||
isShowAlarm.value = type
|
||||
isShowAlarm.value = type;
|
||||
}
|
||||
|
||||
const footerList = ref([
|
||||
{
|
||||
name: '单位名称',
|
||||
value: '',
|
||||
key: 'orgName'
|
||||
key: 'orgName',
|
||||
extData: {},
|
||||
},
|
||||
{
|
||||
name: '单位人数',
|
||||
value: '',
|
||||
key: 'userCount'
|
||||
key: 'userCount',
|
||||
extData: {},
|
||||
},
|
||||
{
|
||||
name: '入库设备数量',
|
||||
value: '',
|
||||
key: 'deviceNum'
|
||||
key: 'deviceNum',
|
||||
extData: {},
|
||||
},
|
||||
{
|
||||
name: '佩戴手表人数',
|
||||
value: '',
|
||||
key: 'allotDeviceNum',
|
||||
extData: {},
|
||||
},
|
||||
{
|
||||
name: '近一周活跃人数',
|
||||
value: '',
|
||||
key: 'sevenDayNum'
|
||||
key: 'sevenDayNum',
|
||||
extData: {},
|
||||
},
|
||||
{
|
||||
name: '近一月活跃人数',
|
||||
value: '',
|
||||
key: 'a'
|
||||
key: 'thirtyDayNum',
|
||||
extData: {},
|
||||
},
|
||||
{
|
||||
name: '近一年活跃人数',
|
||||
value: '',
|
||||
key: 'b'
|
||||
}
|
||||
])
|
||||
key: 'yearDayNum',
|
||||
extData: {},
|
||||
},
|
||||
]);
|
||||
|
||||
function setFooterList(res: any) {
|
||||
|
||||
const arrList = cloneDeep(footerList.value)
|
||||
const arrList = cloneDeep(footerList.value);
|
||||
if (res) {
|
||||
arrList.forEach(item => {
|
||||
item.value = res[item.key] || ''
|
||||
})
|
||||
console.log('resssss', res);
|
||||
arrList.forEach((item) => {
|
||||
item.value = res[item.key];
|
||||
item.extData = res;
|
||||
});
|
||||
}
|
||||
footerList.value = arrList
|
||||
|
||||
footerList.value = arrList;
|
||||
}
|
||||
|
||||
return {
|
||||
footerList,
|
||||
setFooterList,
|
||||
setIsShowAlarm,
|
||||
isShowAlarm
|
||||
isShowAlarm,
|
||||
};
|
||||
}
|
||||
|
||||
export function useAlarmDetail() {
|
||||
const detailLeft = ref([
|
||||
{
|
||||
name: '员工姓名',
|
||||
value: '',
|
||||
key: 'realName',
|
||||
},
|
||||
{
|
||||
name: '工具编码',
|
||||
value: '',
|
||||
key: 'watchNo',
|
||||
},
|
||||
{
|
||||
name: '单位名称',
|
||||
value: '',
|
||||
key: 'orgName2',
|
||||
},
|
||||
]);
|
||||
const detailRight = ref([
|
||||
{
|
||||
name: '部门名称',
|
||||
value: '',
|
||||
key: 'orgName',
|
||||
},
|
||||
{
|
||||
name: '事件类型',
|
||||
value: '',
|
||||
key: 'eventType_dictText',
|
||||
},
|
||||
{
|
||||
name: '异常数据',
|
||||
value: '',
|
||||
key: 'dataValue',
|
||||
},
|
||||
{
|
||||
name: '报警时间',
|
||||
value: '',
|
||||
key: 'warnTime',
|
||||
},
|
||||
]);
|
||||
|
||||
function setDetail(res) {
|
||||
if (res) {
|
||||
detailLeft.value.forEach((item) => {
|
||||
item.value = res[item.key];
|
||||
});
|
||||
detailRight.value.forEach((item) => {
|
||||
item.value = res[item.key];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
detailLeft,
|
||||
detailRight,
|
||||
setDetail,
|
||||
};
|
||||
}
|
||||
|
||||
export function useMoveClass() {
|
||||
const isShow = ref(false)
|
||||
const className = ref('slide-bottom')
|
||||
const isShow = ref(false);
|
||||
const className = ref('slide-bottom');
|
||||
|
||||
function setIsShow(type: boolean) {
|
||||
isShow.value = type
|
||||
className.value = type ? 'slide-top' : 'slide-bottom'
|
||||
isShow.value = type;
|
||||
className.value = type ? 'slide-top' : 'slide-bottom';
|
||||
}
|
||||
|
||||
return {
|
||||
isShow,
|
||||
className,
|
||||
setIsShow
|
||||
}
|
||||
|
||||
setIsShow,
|
||||
};
|
||||
}
|
||||
|
||||
export function useTree() {
|
||||
@@ -172,10 +223,79 @@ export function useTree() {
|
||||
},
|
||||
],
|
||||
},
|
||||
]
|
||||
const orgCode = ref([])
|
||||
];
|
||||
const orgCode = ref([]);
|
||||
return {
|
||||
orgCode,
|
||||
treeOption
|
||||
}
|
||||
}
|
||||
treeOption,
|
||||
};
|
||||
}
|
||||
|
||||
export const columns = [
|
||||
{
|
||||
title: '员工名称',
|
||||
dataIndex: 'realName',
|
||||
align: 'center',
|
||||
key: 'realName',
|
||||
},
|
||||
{
|
||||
title: '单位名称',
|
||||
dataIndex: 'orgName',
|
||||
align: 'center',
|
||||
key: 'orgName',
|
||||
},
|
||||
{
|
||||
title: '部门名称',
|
||||
dataIndex: 'orgName1',
|
||||
align: 'center',
|
||||
key: 'orgName1',
|
||||
},
|
||||
{
|
||||
title: '工具编码',
|
||||
dataIndex: 'watchNo',
|
||||
align: 'center',
|
||||
key: 'watchNo',
|
||||
},
|
||||
{
|
||||
title: '心率(次/分)',
|
||||
dataIndex: 'heartRate',
|
||||
align: 'center',
|
||||
key: 'heartRate',
|
||||
},
|
||||
{
|
||||
title: '血氧(%)',
|
||||
dataIndex: 'spo2',
|
||||
align: 'center',
|
||||
key: 'spo2',
|
||||
},
|
||||
{
|
||||
title: '压力',
|
||||
dataIndex: 'stress',
|
||||
align: 'center',
|
||||
key: 'stress',
|
||||
},
|
||||
{
|
||||
title: '睡眠',
|
||||
dataIndex: 'sleep',
|
||||
align: 'center',
|
||||
key: 'sleep',
|
||||
},
|
||||
{
|
||||
title: '体温(℃)',
|
||||
dataIndex: 'temp',
|
||||
align: 'center',
|
||||
key: 'temp',
|
||||
},
|
||||
{
|
||||
title: '锻炼(千卡)',
|
||||
dataIndex: 'exercise',
|
||||
align: 'center',
|
||||
key: 'exercise',
|
||||
},
|
||||
{
|
||||
title: '步数(米)',
|
||||
dataIndex: 'workout',
|
||||
align: 'center',
|
||||
key: 'workout',
|
||||
},
|
||||
];
|
||||
Reference in New Issue
Block a user