8
import com.ai.ipu.server.connect.ps.EventChannelTool.PublisherEvent;
5 9
import com.ai.ipu.server.connect.ps.ISubscriber;
@ -11,18 +15,12 @@ import com.ai.ipu.server.connect.ps.impl.Publisher;
11 15
 * 2020-10-21
12 16
 */
13 17
public class JingPingSendDateUtil {
14
	
15
	// 人员定位topic(正常)
16
	public static final String topic_personnel = "personnel";
17 18
18
	// 救援定位topic(SOS)
19
	public static final String topic_alarm = "alarm";
20
21
	// 离线topic(离线)
22
	public static final String topic_offline = "offline";
19
	// 人员定位topic
20
	public static final String topic_personnel = "personnel";
23 21
24
	// 违规topic(违规)
25
	public static final String topic_violation = "violation";
22
	// 救援定位topic
23
	//public static final String topic_alarm = "alarm";
26 24
27 25
	public static void sendData(String topic, String msg) {
28 26
		if (!EventChannelTool.isExistSubscriber(topic)) {
@ -41,4 +39,27 @@ public class JingPingSendDateUtil {
41 39
		publisher.publish(topic, publisherEvent);
42 40
	}
43 41
42
	/**
43
	 * 计算两个时间相隔的分钟数(endDate-beginDate)
44
	 * @param beginDate
45
	 * @param endDate
46
	 * @return
47
	 * @throws ParseException 
48
	 */
49
	public static int getBetweenMinuteValue(String beginDate, String endDate) throws ParseException {
50
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
51
		long endDateLong = simpleDateFormat.parse(endDate).getTime();
52
		long beginDateLong = simpleDateFormat.parse(beginDate).getTime();
53
		long alarmLong = endDateLong - beginDateLong;
54
		if (alarmLong>0) {
55
			BigDecimal alarmLongBigDecimal = new BigDecimal(alarmLong);
56
			// 单位为分,四舍五入不保留小数
57
			alarmLongBigDecimal = alarmLongBigDecimal.divide(new BigDecimal("60000L"), 0, BigDecimal.ROUND_HALF_UP);
58
			return alarmLongBigDecimal.intValue();
59
		}else {
60
			return 0;
61
		}
62
		
63
	}
64
44 65
}

common-ui - Nuosi Git Service

AIoT前端公共UI

CardDemo.vue 3.8KB

    <!-- * @Author: Devin * @Date: 2023-02-07 14:24:35 * @LastEditors: Devin * @LastEditTime: 2023-02-17 14:55:46 * @Description: card-demo --> <template> <div class="demo"> <common-card-group :card-numbers="cardNumbers" :card-infos="cardInfos" :span="6" :btns="btns" :cards="cards" @handel-click-create-card="handelClickCreateCard" ></common-card-group> </div> </template> <script setup lang="ts"> import { ElMessage } from 'element-plus'; import { ref } from 'vue'; function edit() { ElMessage('编辑'); } function start() {} // const cardNumbers = ref<any>([ { label: '信息1', name: 'name1' }, { label: '信息2', name: 'name2' }, { label: '信息3', name: 'name3' } ]); function deleteFn(data: any) { console.log(data); console.log('点击删除'); } const cardInfos = ref<any>([{ label: '厂商', name: 'name' }]); const btns = ref<any>([ { label: '启用', name: 'start', icon: 'common-bianji', color: '#7b93a7', onClick: start }, { label: '编辑', name: 'edit', icon: '', onClick: edit }, { label: '删除', name: 'delete', icon: 'tool-baocun', color: '#7b93a7', onClick: deleteFn }, { label: '发布', name: 'publish', icon: 'tool-baocun', color: '#7b93a7', onClick: edit }, { label: '查看', name: 'view', icon: 'tool-baocun', color: '#7b93a7', onClick: edit } ]); const cards = ref<any>([ { url: '', title: '大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题', subTitle: '2022-12-24c12:12:12', tags: [ { label: '成功', type: 'success' }, { label: '失败', type: 'danger' } ], desc: '这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行', infos: { name: '海康威视' }, name1: 1, name2: 2, name3: 3 }, { url: '', title: '大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题', subTitle: '2022-12-24c12:12:12', tags: [ { label: '成功', type: 'success' }, { label: '失败', type: 'danger' } ], desc: '这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行', infos: { name: '海康威视' }, name1: 1, name2: 2, name3: 3 }, { url: '', title: '大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题大标题', subTitle: '2022-12-24c12:12:12', tags: [ { label: '成功', type: 'success' }, { label: '失败', type: 'danger' } ], desc: '这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行这个是描述信息,可以有最多三行', infos: { name: '海康威视' }, name1: 1, name2: 2, name3: 3 } ]); // 添加新卡片 function handelClickCreateCard() { ElMessage('123131233'); } </script> <style scoped lang="scss"></style>