var VUE = null
window.addEventListener("load", function() {
	VUE = new Vue({
		// 在原有Vue实例中添加
		el: '#app',
		data() {
			return {
				shanghuName: '',
				// 新增子Tab数据
				subActiveTab: 0,
				hazardList: [{
						id: 1,
						description: '消防通道被货物堵塞，存在严重安全隐患',
						status: '待审核',
						date: '2024-03-15',
						shop: 'XX餐饮店',
						type: 2
					},
					{
						id: 2,
						description: '消防通道被货物堵塞，存在严重安全隐患',
						status: '待整改',
						date: '2024-03-15',
						shop: 'XX餐饮店',
						type: 2
					},
					// 更多示例数据...
				],
				activeTab: 0,
			}
		},
		computed: {
			filteredHazards() {
				const statusMap = ['全部', '待审核', '待整改', '已整改'];
				return this.hazardList.filter(item =>
					this.subActiveTab === 0 ? true : item.status === statusMap[this.subActiveTab]
				);
			}
		},
		methods: {
			onSearch() {
				console.log('xxxx')
			},
			// 新增选择确认方法
			onConfirmType(value) {
				this.formData.type = value;
				this.showTypePicker = false;
			},
			onConfirmTime(time) {
				this.formData.businessHours = time;
				this.showTimePicker = false;
			},
			statusTagType(status) {
				const types = {
					'待审核': 'warning',
					'待整改': 'primary',
					'已整改': 'success',
					'整改逾期': 'danger',
				};
				return types[status] || '';
			},
			viewDetail(id) {
				console.log('查看详情:', id);
				// 这里添加跳转逻辑
			}
		}
	});
})