检查表手动添加检查项时根据部门类型展示不一样

This commit is contained in:
王利强
2026-08-03 11:51:07 +08:00
parent 088ff356f2
commit ec76d588e2
50 changed files with 826 additions and 428 deletions

View File

@@ -104,7 +104,7 @@ const checkItems = ref([])
const typeMap = { 1: '日常检查', 2: '专项检查', 3: '设备检查' } const typeMap = { 1: '日常检查', 2: '专项检查', 3: '设备检查' }
const cycleMap = { 1: '每天一次', 2: '每周', 3: '每月', 4: '每季度' } const cycleMap = { 1: '每天一次', 2: '每周', 3: '每月', 4: '每季度' }
const runModeMap = { 1: '单人完成', 2: '全员', 3: '指定分组' } const runModeMap = { 1: '单人完成', 2: '全员', 3: '指定分组', 4: '排班模式' }
const weekendMap = { 1: '包含周末', 2: '不包含周末' } const weekendMap = { 1: '包含周末', 2: '不包含周末' }
const typeLabel = computed(() => detail.value.typeName || typeMap[detail.value.type] || '-') const typeLabel = computed(() => detail.value.typeName || typeMap[detail.value.type] || '-')
@@ -112,8 +112,16 @@ const cycleLabel = computed(() => detail.value.cycleName || cycleMap[detail.valu
const runModeLabel = computed(() => detail.value.runModeName || runModeMap[detail.value.runMode] || '-') const runModeLabel = computed(() => detail.value.runModeName || runModeMap[detail.value.runMode] || '-')
const weekendLabel = computed(() => detail.value.isWeekendName || weekendMap[detail.value.isWeekend] || '-') const weekendLabel = computed(() => detail.value.isWeekendName || weekendMap[detail.value.isWeekend] || '-')
const executorLabel = computed(() => { const executorLabel = computed(() => {
if (Number(detail.value.runMode) === 2) return '全员' const runMode = Number(detail.value.runMode)
return detail.value.executorName || '-' if (runMode === 2) return '全员'
if (runMode === 4) {
const rosterItems = detail.value.rosterItems || []
if (rosterItems.length > 0) {
return rosterItems.map((item) => item.identityName).filter(Boolean).join('、') || '-'
}
return '-'
}
return detail.value.executorIdentityName || detail.value.executorName || '-'
}) })
const formatDate = (value) => { const formatDate = (value) => {

View File

@@ -1,4 +1,5 @@
<template> <template>
<page-meta :page-style="pageScrollLockStyle" />
<view class="page"> <view class="page">
<view class="form-card"> <view class="form-card">
<!-- 检查表名称 --> <!-- 检查表名称 -->
@@ -72,8 +73,8 @@
></up-picker> ></up-picker>
</view> </view>
<!-- 执行人员单人完成模式 --> <!-- 执行人员单人完成 / 排班模式 -->
<view class="form-item" v-if="formData.modeName === '单人完成'"> <view class="form-item" v-if="formData.runMode === 1 || formData.runMode === 4">
<view class="form-label"> <view class="form-label">
<text>执行人员</text> <text>执行人员</text>
<text class="required">*</text> <text class="required">*</text>
@@ -263,23 +264,63 @@
</view> </view>
<view class="popup-body"> <view class="popup-body">
<view class="popup-form-item" v-if="showFullForm">
<view class="popup-form-label">行业类型<text class="required">*</text></view>
<view class="popup-select" @click="showIndustryPicker = true">
<text class="regulation-text" :class="checkForm.industryName ? '' : 'text-gray'">{{ checkForm.industryName || '请选择行业类型' }}</text>
<text class="cuIcon-unfold select-icon"></text>
</view>
<up-picker
:show="showIndustryPicker"
:columns="industryColumns"
@confirm="onIndustryConfirm"
@cancel="showIndustryPicker = false"
@close="showIndustryPicker = false"
></up-picker>
</view>
<view class="popup-form-item"> <view class="popup-form-item">
<view class="popup-form-label">检查名称<text class="required">*</text></view> <view class="popup-form-label">检查名称<text class="required">*</text></view>
<up-input v-model="checkForm.name" placeholder="请输入检查名称" border="surround"></up-input> <up-input v-model="checkForm.name" placeholder="请输入检查名称" border="surround"></up-input>
</view> </view>
<view class="popup-form-item" v-if="showFullForm">
<view class="popup-form-label">牵头部门<text class="required">*</text></view>
<up-input v-model="checkForm.leadDept" placeholder="请输入牵头部门名称" border="surround"></up-input>
</view>
<view class="popup-form-item"> <view class="popup-form-item">
<view class="popup-form-label">检查内容<text class="required">*</text></view> <view class="popup-form-label">检查内容<text class="required">*</text></view>
<up-textarea v-model="checkForm.point" placeholder="请输入检查内容" :height="150"></up-textarea> <up-textarea v-model="checkForm.point" placeholder="请输入检查内容" :height="150"></up-textarea>
</view> </view>
<view class="popup-form-item"> <view class="popup-form-item" v-if="showFullForm">
<view class="popup-form-label">参考法规</view> <view class="popup-form-label">参考法规</view>
<view class="popup-select regulation-select" @click="openLawPopup"> <view class="popup-select regulation-select" @click="openLawPopup">
<text class="regulation-text" :class="checkForm.regulationName ? '' : 'text-gray'">{{ checkForm.regulationName || '选择法规' }}</text> <text class="regulation-text" :class="checkForm.regulationName ? '' : 'text-gray'">{{ checkForm.regulationName || '选择法规' }}</text>
<text class="cuIcon-unfold select-icon"></text> <text class="cuIcon-unfold select-icon"></text>
</view> </view>
</view> </view>
<view class="popup-form-item" v-if="showFullForm">
<view class="popup-form-label">常见隐患</view>
<up-textarea v-model="checkForm.commonProblem" placeholder="请输入常见隐患" :height="120"></up-textarea>
</view>
<view class="popup-form-item" v-if="showFullForm">
<view class="popup-form-label">重大隐患</view>
<view class="popup-select" @click="showSeriousPicker = true">
<text class="regulation-text">{{ seriousName }}</text>
<text class="cuIcon-unfold select-icon"></text>
</view>
<up-picker
:show="showSeriousPicker"
:columns="seriousColumns"
@confirm="onSeriousConfirm"
@cancel="showSeriousPicker = false"
@close="showSeriousPicker = false"
></up-picker>
</view>
</view> </view>
<view class="popup-footer"> <view class="popup-footer">
@@ -418,10 +459,21 @@
v-else v-else
class="executor-item" class="executor-item"
v-for="item in executorList" v-for="item in executorList"
:key="item.userId" :key="item.identityId || item.userId"
@click="selectExecutor(item)" @click="formData.runMode === 4 ? toggleRosterExecutor(item) : selectExecutor(item)"
>
<view
v-if="formData.runMode === 4"
class="executor-checkbox"
:class="{ 'executor-checkbox-active': selectedRosterIdentityIds.includes(item.identityId) }"
>
<text v-if="selectedRosterIdentityIds.includes(item.identityId)" class="cuIcon-check"></text>
</view>
<view
v-else
class="executor-radio"
:class="{ 'executor-radio-active': selectedExecutorId === item.userId }"
> >
<view class="executor-radio" :class="{ 'executor-radio-active': selectedExecutorId === item.userId }">
<view v-if="selectedExecutorId === item.userId" class="executor-radio-dot"></view> <view v-if="selectedExecutorId === item.userId" class="executor-radio-dot"></view>
</view> </view>
<view class="executor-info"> <view class="executor-info">
@@ -440,8 +492,22 @@
</template> </template>
<script setup> <script setup>
import { ref, reactive, computed, onMounted, nextTick } from 'vue'; import { ref, reactive, computed, onMounted, nextTick, watch } from 'vue';
import { getRegulationList, addCheckPoint, detailcheckPoint, deleteCheckPoint, getCheckItemList, getCheckItemListDetail, getDeptUsers, getDeptChildren, addCheckTable } from '@/request/api.js'; import { getRegulationList, addCheckPoint, detailcheckPoint, deleteCheckPoint, getCheckItemList, getCheckItemListDetail, getDeptUsers, getDeptChildren, addCheckTable, getindustry } from '@/request/api.js';
import { getCurrentIdentityFromStorage } from '@/utils/userInfo.js';
// organizationEntityType: 0/1 机关单位展示全部2/3 企业仅展示检查名称和检查内容
const showFullForm = computed(() => {
const identity = getCurrentIdentityFromStorage();
const type = Number(identity?.organizationEntityType);
return type === 0 || type === 1;
});
const MODE_OPTIONS = [
{ label: '单人完成', value: 1 },
{ label: '全员', value: 2 },
{ label: '排班模式', value: 4 }
]
// 表单数据 // 表单数据
const formData = reactive({ const formData = reactive({
@@ -451,12 +517,13 @@ const formData = reactive({
remark: '', remark: '',
type: '', // 检查表类型1-日常检查2-专项检查3-设备检查 type: '', // 检查表类型1-日常检查2-专项检查3-设备检查
typeName: '', typeName: '',
modeId: '', runMode: undefined,
modeName: '', modeName: '',
selectDeptId: '', selectDeptId: '',
selectDeptName: '', selectDeptName: '',
executorId: '', executorId: '',
executorNames: '', executorNames: '',
rosterIdentityIds: [],
cycleId: '', cycleId: '',
cycleName: '', cycleName: '',
isWeekend: 1, isWeekend: 1,
@@ -592,13 +659,21 @@ const showEndDatePicker = ref(false);
// 选择器数据 // 选择器数据
const typeColumns = ref([['日常检查', '专项检查', '设备检查']]); const typeColumns = ref([['日常检查', '专项检查', '设备检查']]);
const modeColumns = ref([['单人完成', '全员']]); const modeColumns = ref([MODE_OPTIONS.map((item) => item.label)]);
const cycleColumns = ref([['每天一次', '每周一次', '每月一次', '每季度一次']]); const cycleColumns = ref([['每天一次', '每周一次', '每月一次', '每季度一次']]);
// 执行人员选择器 // 执行人员选择器
const showExecutorPopup = ref(false); const showExecutorPopup = ref(false);
const executorList = ref([]); const executorList = ref([]);
const selectedExecutorId = ref(null); const selectedExecutorId = ref(null);
const selectedRosterIdentityIds = ref([]);
const pageScrollLockStyle = computed(() => {
if (showDeptPicker.value || showExecutorPopup.value) {
return 'overflow: hidden; height: 100%;'
}
return ''
})
// 分派单位树形选择器 // 分派单位树形选择器
const deptTree = ref([]); const deptTree = ref([]);
@@ -695,11 +770,17 @@ const onTypeConfirm = (e) => {
}; };
const onModeConfirm = (e) => { const onModeConfirm = (e) => {
if (e.value && e.value.length > 0) { const index = Number(e.indexs?.[0] ?? 0)
formData.modeName = e.value[0] const option = MODE_OPTIONS[index]
if (e.value[0] === '全员') { if (!option) {
clearExecutorSelection() showModePicker.value = false
return
} }
formData.modeName = option.label
formData.runMode = option.value
clearExecutorSelection()
if (formData.deptId && option.value !== 2) {
fetchDeptUsers(formData.deptId)
} }
showModePicker.value = false showModePicker.value = false
} }
@@ -707,7 +788,9 @@ const onModeConfirm = (e) => {
const clearExecutorSelection = () => { const clearExecutorSelection = () => {
formData.executorId = '' formData.executorId = ''
formData.executorNames = '' formData.executorNames = ''
formData.rosterIdentityIds = []
selectedExecutorId.value = null selectedExecutorId.value = null
selectedRosterIdentityIds.value = []
} }
const fetchDeptUsers = async (deptId) => { const fetchDeptUsers = async (deptId) => {
@@ -716,7 +799,8 @@ const fetchDeptUsers = async (deptId) => {
return return
} }
try { try {
const res = await getDeptUsers(deptId) const params = formData.runMode === 4 ? { type: 4 } : {}
const res = await getDeptUsers(deptId, params)
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
executorList.value = res.data || [] executorList.value = res.data || []
} else { } else {
@@ -732,7 +816,31 @@ const selectExecutor = (item) => {
selectedExecutorId.value = item.userId selectedExecutorId.value = item.userId
} }
const toggleRosterExecutor = (item) => {
const identityId = item.identityId
if (identityId == null) return
const index = selectedRosterIdentityIds.value.indexOf(identityId)
if (index > -1) {
selectedRosterIdentityIds.value.splice(index, 1)
} else {
selectedRosterIdentityIds.value.push(identityId)
}
}
const confirmExecutorSelect = () => { const confirmExecutorSelect = () => {
if (formData.runMode === 4) {
if (selectedRosterIdentityIds.value.length === 0) {
uni.showToast({ title: '请选择执行人员', icon: 'none' })
return
}
formData.rosterIdentityIds = [...selectedRosterIdentityIds.value]
const names = executorList.value
.filter((user) => selectedRosterIdentityIds.value.includes(user.identityId))
.map((user) => user.nickName || user.nickname)
formData.executorNames = names.join('、')
showExecutorPopup.value = false
return
}
if (!selectedExecutorId.value) { if (!selectedExecutorId.value) {
uni.showToast({ title: '请选择执行人员', icon: 'none' }) uni.showToast({ title: '请选择执行人员', icon: 'none' })
return return
@@ -748,7 +856,11 @@ const openExecutorPopup = () => {
uni.showToast({ title: '请先选择分派单位', icon: 'none' }) uni.showToast({ title: '请先选择分派单位', icon: 'none' })
return return
} }
if (formData.runMode === 4) {
selectedRosterIdentityIds.value = [...(formData.rosterIdentityIds || [])]
} else {
selectedExecutorId.value = formData.executorId || null selectedExecutorId.value = formData.executorId || null
}
fetchDeptUsers(formData.deptId) fetchDeptUsers(formData.deptId)
showExecutorPopup.value = true showExecutorPopup.value = true
} }
@@ -920,12 +1032,70 @@ const deleteLibraryCheckItem = (index) => {
// 手动添加检查项弹窗 // 手动添加检查项弹窗
const showAddPopup = ref(false); const showAddPopup = ref(false);
const checkForm = reactive({ const checkForm = reactive({
name: '', // 检查名称 name: '',
point: '', // 检查内容 point: '',
regulationId: null, // 参考法规ID industryId: null,
regulationName: '' // 参考法规名称(显示用) industryName: '',
leadDept: '',
commonProblem: '',
isSerious: 2,
regulationId: null,
regulationName: ''
}); });
const industryOptions = ref([]);
const showIndustryPicker = ref(false);
const industryColumns = computed(() => [industryOptions.value.map((item) => item.name || item.industryName || '')]);
const showSeriousPicker = ref(false);
const seriousColumns = ref([['是', '否']]);
const seriousName = computed(() => (checkForm.isSerious === 1 ? '是' : '否'));
const resetCheckForm = () => {
checkForm.name = '';
checkForm.point = '';
checkForm.industryId = null;
checkForm.industryName = '';
checkForm.leadDept = '';
checkForm.commonProblem = '';
checkForm.isSerious = 2;
checkForm.regulationId = null;
checkForm.regulationName = '';
};
const fetchIndustryOptions = async () => {
try {
const res = await getindustry();
if (res.code === 0) {
industryOptions.value = res.data || [];
}
} catch (error) {
console.error('获取行业类型失败:', error);
}
};
watch(showAddPopup, (val) => {
if (val && showFullForm.value) {
fetchIndustryOptions();
}
});
const onIndustryConfirm = (e) => {
const selectedName = e.value?.[0];
const selected = industryOptions.value.find((item) => (item.name || item.industryName) === selectedName);
if (selected) {
checkForm.industryId = selected.id;
checkForm.industryName = selected.name || selected.industryName || '';
}
showIndustryPicker.value = false;
};
const onSeriousConfirm = (e) => {
const selectedName = e.value?.[0];
checkForm.isSerious = selectedName === '是' ? 1 : 2;
showSeriousPicker.value = false;
};
// 选择法规弹窗 // 选择法规弹窗
const showLawPopup = ref(false); const showLawPopup = ref(false);
const lawKeyword = ref(''); const lawKeyword = ref('');
@@ -939,6 +1109,9 @@ const hasMoreLaw = ref(true);
// 打开法规选择弹窗 // 打开法规选择弹窗
const openLawPopup = () => { const openLawPopup = () => {
if (!showFullForm.value) {
return;
}
showLawPopup.value = true; showLawPopup.value = true;
// 如果列表为空,加载数据 // 如果列表为空,加载数据
if (lawList.value.length === 0) { if (lawList.value.length === 0) {
@@ -1023,15 +1196,33 @@ const handleAddCheck = async () => {
uni.showToast({ title: '请输入检查内容', icon: 'none' }); uni.showToast({ title: '请输入检查内容', icon: 'none' });
return; return;
} }
if (showFullForm.value) {
if (!checkForm.industryId) {
uni.showToast({ title: '请选择行业类型', icon: 'none' });
return;
}
if (!checkForm.leadDept) {
uni.showToast({ title: '请输入牵头部门', icon: 'none' });
return;
}
}
try { try {
uni.showLoading({ title: '添加中...' }); uni.showLoading({ title: '添加中...' });
// 调用接口新增检查项 const params = showFullForm.value
const params = { ? {
name: checkForm.name, name: checkForm.name,
point: checkForm.point, point: checkForm.point,
regulationId: checkForm.regulationId || undefined industryId: checkForm.industryId,
leadDept: checkForm.leadDept,
regulationId: checkForm.regulationId || undefined,
commonProblem: checkForm.commonProblem || undefined,
isSerious: checkForm.isSerious
}
: {
name: checkForm.name,
point: checkForm.point
}; };
const res = await addCheckPoint(params); const res = await addCheckPoint(params);
@@ -1064,12 +1255,7 @@ const handleAddCheck = async () => {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ title: '添加成功', icon: 'success' }); uni.showToast({ title: '添加成功', icon: 'success' });
showAddPopup.value = false; showAddPopup.value = false;
resetCheckForm();
// 重置表单
checkForm.name = '';
checkForm.point = '';
checkForm.regulationId = null;
checkForm.regulationName = '';
} else { } else {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ title: res.msg || '添加失败', icon: 'none' }); uni.showToast({ title: res.msg || '添加失败', icon: 'none' });
@@ -1276,11 +1462,15 @@ const handleSave = async () => {
uni.showToast({ title: '请选择检查表类型', icon: 'none' }); uni.showToast({ title: '请选择检查表类型', icon: 'none' });
return; return;
} }
if (!formData.modeName) { if (!formData.runMode) {
uni.showToast({ title: '请选择模式', icon: 'none' }); uni.showToast({ title: '请选择模式', icon: 'none' });
return; return;
} }
if (formData.modeName === '单人完成' && !formData.executorId) { if (formData.runMode === 1 && !formData.executorId) {
uni.showToast({ title: '请选择执行人员', icon: 'none' });
return;
}
if (formData.runMode === 4 && (!formData.rosterIdentityIds || formData.rosterIdentityIds.length === 0)) {
uni.showToast({ title: '请选择执行人员', icon: 'none' }); uni.showToast({ title: '请选择执行人员', icon: 'none' });
return; return;
} }
@@ -1315,12 +1505,6 @@ const handleSave = async () => {
return; return;
} }
// 运行模式映射:单人完成=1全员=2
const runModeMap = {
'单人完成': 1,
'全员': 2
};
// 周期映射:每天=1每周=2每月=3每季度=4 // 周期映射:每天=1每周=2每月=3每季度=4
const cycleMap = { const cycleMap = {
'每天一次': 1, '每天一次': 1,
@@ -1343,7 +1527,7 @@ const handleSave = async () => {
deptId: formData.deptId, deptId: formData.deptId,
description: formData.remark || '', description: formData.remark || '',
type: formData.type, // 检查表类型1-日常检查2-专项检查3-设备检查 type: formData.type, // 检查表类型1-日常检查2-专项检查3-设备检查
runMode: runModeMap[formData.modeName] || 2, runMode: formData.runMode,
checkPointIds: items, checkPointIds: items,
itemIds: itemIds, // 从检查库选择的库id数组 itemIds: itemIds, // 从检查库选择的库id数组
cycle: cycleMap[formData.cycleName] || 1, cycle: cycleMap[formData.cycleName] || 1,
@@ -1352,10 +1536,14 @@ const handleSave = async () => {
planEndTime: `${formData.endDate} 00:00:00` planEndTime: `${formData.endDate} 00:00:00`
}; };
if (formData.modeName === '单人完成' && formData.executorId) { if (formData.runMode === 1 && formData.executorId) {
params.executorId = formData.executorId; params.executorId = formData.executorId;
} }
if (formData.runMode === 4 && formData.rosterIdentityIds?.length) {
params.rosterIdentityIds = formData.rosterIdentityIds;
}
try { try {
uni.showLoading({ title: '保存中...' }); uni.showLoading({ title: '保存中...' });
const res = await addCheckTable(params); const res = await addCheckTable(params);
@@ -1951,6 +2139,25 @@ onMounted(() => {
background: #2667E9; background: #2667E9;
} }
.executor-checkbox {
width: 40rpx;
height: 40rpx;
border: 2rpx solid #ccc;
border-radius: 8rpx;
margin-right: 20rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
font-size: 24rpx;
}
.executor-checkbox-active {
background: #2667E9;
border-color: #2667E9;
color: #fff;
}
.executor-info { .executor-info {
flex: 1; flex: 1;
} }

View File

@@ -37,6 +37,7 @@
</view> </view>
<view class="flex justify-end card-actions" style="gap: 10rpx;"> <view class="flex justify-end card-actions" style="gap: 10rpx;">
<button class="round cu-btn light bg-blue" @click="details(item)">查看详情</button> <button class="round cu-btn light bg-blue" @click="details(item)">查看详情</button>
<template v-if="!isApprovalRole">
<button v-if="item.statusName === '待整改' && item.canEdit" <button v-if="item.statusName === '待整改' && item.canEdit"
class="round cu-btn light bg-blue" @click="assignHazard(item)">隐患交办</button> class="round cu-btn light bg-blue" @click="assignHazard(item)">隐患交办</button>
<button v-if="item.statusName === '待整改' && item.canEdit" <button v-if="item.statusName === '待整改' && item.canEdit"
@@ -51,6 +52,7 @@
class="round cu-btn bg-blue" @click="goWriteoffApply(item)">销号申请</button> class="round cu-btn bg-blue" @click="goWriteoffApply(item)">销号申请</button>
<button v-if="canShowWriteoffApprovalButton(item, userRole)" <button v-if="canShowWriteoffApprovalButton(item, userRole)"
class="round cu-btn bg-blue" @click="goWriteoffApproval(item)">销号审批</button> class="round cu-btn bg-blue" @click="goWriteoffApproval(item)">销号审批</button>
</template>
</view> </view>
</view> </view>
@@ -60,7 +62,7 @@
style="margin-top: 20rpx; margin-bottom: 140rpx;" style="margin-top: 20rpx; margin-bottom: 140rpx;"
/> />
<view class="fixed-add-btn" @click="goToAdd"> <view v-if="!isApprovalRole" class="fixed-add-btn" @click="goToAdd">
<text class="cuIcon-add"></text> <text class="cuIcon-add"></text>
<text>新增</text> <text>新增</text>
</view> </view>
@@ -68,7 +70,7 @@
</template> </template>
<script setup> <script setup>
import { ref } from 'vue' import { ref, computed } from 'vue'
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app' import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app'
import { import {
enterCheckPlan, enterCheckPlan,
@@ -86,19 +88,20 @@
canShowWriteoffApplyButton, canShowWriteoffApplyButton,
canShowWriteoffApprovalButton canShowWriteoffApprovalButton
} from '@/utils/hazardNav.js' } from '@/utils/hazardNav.js'
import { resolveUserRoleKey } from '@/utils/userInfo.js' import { resolveUserIdentityRoleKey } from '@/utils/userInfo.js'
const taskId = ref('') const taskId = ref('')
const checkPointId = ref('') const checkPointId = ref('')
const oneTableId = ref('') const oneTableId = ref('')
const userRole = ref('') const userRole = ref('')
const isApprovalRole = computed(() => userRole.value === 'approval')
const getUserRole = () => { const getUserRole = () => {
try { try {
const userInfoStr = uni.getStorageSync('userInfo') const userInfoStr = uni.getStorageSync('userInfo')
if (userInfoStr) { if (userInfoStr) {
userRole.value = resolveUserRoleKey(JSON.parse(userInfoStr)) userRole.value = resolveUserIdentityRoleKey(JSON.parse(userInfoStr))
} }
} catch (error) { } catch (error) {
console.error('获取用户信息失败:', error) console.error('获取用户信息失败:', error)

View File

@@ -35,8 +35,8 @@
</view> </view>
<view class="padding page-content"> <view class="padding page-content">
<!-- 功能菜单approval 角色不展示 --> <!-- 功能菜单 -->
<view v-if="!isApprovalRole" class="menu-card"> <view v-if="infoList.length > 0" class="menu-card">
<view class="menu-grid"> <view class="menu-grid">
<view class="menu-item" v-for="(item, index) in infoList" :key="index" @click="handleMenuClick(item)"> <view class="menu-item" v-for="(item, index) in infoList" :key="index" @click="handleMenuClick(item)">
<image class="menu-icon" :src="item.src"></image> <image class="menu-icon" :src="item.src"></image>
@@ -266,7 +266,7 @@
import { getProfileDetail } from '@/request/three_one_api/info.js'; import { getProfileDetail } from '@/request/three_one_api/info.js';
import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app'; import { onLoad, onShow, onReachBottom } from '@dcloudio/uni-app';
import { toImageUrl } from '@/request/request.js'; import { toImageUrl } from '@/request/request.js';
import { applyProfileToUserInfo, applyStoredUserInfo, resolveIdentityName, resolveUserRoleKey } from '@/utils/userInfo.js'; import { applyProfileToUserInfo, applyStoredUserInfo, resolveIdentityName, resolveUserIdentityRoleKey } from '@/utils/userInfo.js';
import { import {
buildRectificationUrl, buildRectificationUrl,
buildEditRectificationUrl, buildEditRectificationUrl,
@@ -298,8 +298,8 @@
userIdentity: null userIdentity: null
}); });
// 当前身份角色(优先 userIdentity.roleKey // 当前身份角色(取 storage 中 userInfo.userIdentity.roleKey
const currentRoleKey = computed(() => resolveUserRoleKey(userInfo)); const currentRoleKey = computed(() => resolveUserIdentityRoleKey(userInfo));
const isApprovalRole = computed(() => currentRoleKey.value === 'approval'); const isApprovalRole = computed(() => currentRoleKey.value === 'approval');
@@ -379,7 +379,7 @@
// 根据角色动态展示菜单 // 根据角色动态展示菜单
const infoList = computed(() => { const infoList = computed(() => {
if (currentRoleKey.value === 'approval') { if (currentRoleKey.value === 'approval') {
return []; return allMenuList.filter(item => item.name === '隐患排查');
} }
if (currentRoleKey.value === 'common') { if (currentRoleKey.value === 'common') {
return allMenuList.filter(item => commonMenuNames.includes(item.name)); return allMenuList.filter(item => commonMenuNames.includes(item.name));

View File

@@ -2,9 +2,9 @@ import Request from './luch-request/index.js';
// 基础的url // 基础的url
const baseUrl = 'https://yingji.hexieapi.com/prod-api'; // const baseUrl = 'https://yingji.hexieapi.com/prod-api';
// const baseUrl = 'http://192.168.1.168:5004'; //廖哥本地 // const baseUrl = 'http://192.168.1.168:5004'; //廖哥本地
// const baseUrl = 'http://192.168.1.140:5004'; //超哥本地 const baseUrl = 'http://192.168.1.140:5004'; //超哥本地
// const baseUrl = 'http://192.168.1.158:7003/prod-api'; //测试环境 // const baseUrl = 'http://192.168.1.158:7003/prod-api'; //测试环境

View File

@@ -32,7 +32,6 @@
class="u-popup__content" class="u-popup__content"
:style="[contentStyle]" :style="[contentStyle]"
@click.stop="noop" @click.stop="noop"
@touchmove.stop.prevent="noop"
> >
<u-status-bar v-if="safeAreaInsetTop"></u-status-bar> <u-status-bar v-if="safeAreaInsetTop"></u-status-bar>
<!-- 增加触摸区域用于处理手势 --> <!-- 增加触摸区域用于处理手势 -->

View File

@@ -545,15 +545,35 @@ defineExpose({ getCheckedKeys, getCheckedNodes, setCheckedKeys, expandAll, colla
// 初始化勾选状态 // 初始化勾选状态
updateCheckedState() updateCheckedState()
const scrollStyle = computed(() => {
const style = {
width: '100%',
boxSizing: 'border-box'
}
if (props.height) {
style.height = `${props.height}rpx`
} else {
style.height = '100%'
}
return style
})
</script> </script>
<template> <template>
<scroll-view scroll-x scroll-y enable-flex class="tree-wrapper"> <scroll-view
scroll-x
scroll-y
enable-flex
:style="scrollStyle"
class="tree-wrapper"
>
<view class="xq-tree-scroll"> <view class="xq-tree-scroll">
<view <view
class="xq-tree" :style="{ class="xq-tree"
minWidth: `${width}rpx`, :style="{
minHeight: `${height}rpx`, minWidth: width ? `${width}rpx` : undefined,
minHeight: height ? `${height}rpx` : undefined
}" }"
> >
<!-- 空数据提示 --> <!-- 空数据提示 -->
@@ -572,21 +592,11 @@ updateCheckedState()
<view class="xq-tree-node-content" @click="handleNodeClick(node)"> <view class="xq-tree-node-content" @click="handleNodeClick(node)">
<!-- 展开/折叠图标 --> <!-- 展开/折叠图标 -->
<view class="xq-tree-node-icon" @click.stop="toggleExpand(node)"> <view class="xq-tree-node-icon" @click.stop="toggleExpand(node)">
<!-- #ifndef MP-WEIXIN --> <view
<text v-if="hasChildren(node)" class="uni-icon-warp"> v-if="hasChildren(node)"
<slot name="icon" :node="node"> class="icon-arrow"
<!-- <uni-icons type="right" size="18" class="icon-arrow" :class="{ 'is-expanded': node._expanded }" /> --> :class="{ 'is-expanded': node._expanded }"
<text class="icon-arrow" :class="{ 'is-expanded': node._expanded }"> />
</text>
</slot>
</text>
<!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<text v-if="hasChildren(node)" class="icon-arrow" :class="{ 'is-expanded': node._expanded }">
</text>
<!-- #endif -->
<view v-else class="leaf-icon-placeholder"></view> <view v-else class="leaf-icon-placeholder"></view>
</view> </view>
@@ -617,7 +627,6 @@ updateCheckedState()
</slot> </slot>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<!-- 微信的插槽真的浪费性能 -->
<slot <slot
v-if="labelSlot" name="node" :node="node" :data="node" :level="node._level" v-if="labelSlot" name="node" :node="node" :data="node" :level="node._level"
:expanded="node._expanded" :checked="node[checkedKey]" :indeterminate="node._indeterminate" :expanded="node._expanded" :checked="node[checkedKey]" :indeterminate="node._indeterminate"
@@ -637,60 +646,32 @@ updateCheckedState()
<style scoped lang="scss"> <style scoped lang="scss">
.xq-tree { .xq-tree {
display: inline-block; display: inline-block;
/* ⚠️ 关键:宽度由内容撑开,不继承父容器宽度 */
/* 内容不换行 */
/* 至少撑满容器 */
box-sizing: border-box; box-sizing: border-box;
width: max-content; width: max-content;
/* 宽度由内容决定,不换行 */
white-space: nowrap; white-space: nowrap;
} }
.tree-wrapper { .tree-wrapper {
width: 100%; width: 100%;
height: 100%; box-sizing: border-box;
// padding: 20rpx;
/* 确保节点不换行 */
} }
.xq-tree-scroll { .xq-tree-scroll {
display: inline-block; display: inline-block;
/* ⚠️ 关键:宽度由内容撑开,不继承父容器宽度 */
white-space: nowrap; white-space: nowrap;
/* 内容不换行 */
min-width: 100%; min-width: 100%;
/* 至少撑满容器 */
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
padding: 16rpx; padding: 16rpx;
} }
/* 小程序下 scroll-view 的滚动条样式由原生控制通常无法自定义H5 端同样可用 ::-webkit-scrollbar */
/* 下面的样式仅对 H5 端生效 */
.tree-wrapper::-webkit-scrollbar {
height: 8rpx;
width: 8rpx;
}
.tree-wrapper::-webkit-scrollbar-track {
background: #f1f1f1;
}
.tree-wrapper::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4rpx;
}
// 进入动画(直接使用之前的 keyframes但通过 TransitionGroup 自动触发)
.tree-node-enter-active { .tree-node-enter-active {
animation: treeExpandIn 0.3s ease-out both; animation: treeExpandIn 0.3s ease-out both;
// animation-delay 已通过内联 style 设置,不需要在这里写死
} }
// 离开动画:使用 transition 让 max-height、padding、opacity 平滑过渡
.tree-node-leave-active { .tree-node-leave-active {
animation: treeCollapseOut 0.3s ease-in both; animation: treeCollapseOut 0.3s ease-in both;
overflow: hidden; // 确保高度变化时内容不会溢出 overflow: hidden;
} }
.tree-node-leave-to { .tree-node-leave-to {
@@ -700,7 +681,6 @@ updateCheckedState()
opacity: 0; opacity: 0;
} }
// 需要的关键帧 remain unchanged (可以保留)
@keyframes treeExpandIn { @keyframes treeExpandIn {
0% { 0% {
max-height: 0; max-height: 0;
@@ -717,10 +697,9 @@ updateCheckedState()
} }
} }
// 新增离开关键帧
@keyframes treeCollapseOut { @keyframes treeCollapseOut {
0% { 0% {
max-height: 500px; // 开始时的实际高度,取一个足够大的值 max-height: 500px;
opacity: 1; opacity: 1;
padding-top: 8rpx; padding-top: 8rpx;
padding-bottom: 8rpx; padding-bottom: 8rpx;
@@ -734,27 +713,17 @@ updateCheckedState()
} }
} }
// 节点基本样式微调
.xq-tree-node { .xq-tree-node {
padding: 8rpx 0; padding: 8rpx 0;
overflow: hidden;
transform-origin: top; transform-origin: top;
} }
.xq-tree {
width: 100%;
}
.xq-tree-empty { .xq-tree-empty {
padding: 40rpx; padding: 40rpx;
text-align: center; text-align: center;
color: #999; color: #999;
} }
.xq-tree-node {
padding: 8rpx 0;
}
.xq-tree-node-content { .xq-tree-node-content {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -762,18 +731,38 @@ updateCheckedState()
.xq-tree-node-icon { .xq-tree-node-icon {
width: 40rpx; width: 40rpx;
text-align: center; height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0; flex-shrink: 0;
} }
.icon-arrow {
width: 0;
height: 0;
border-top: 8rpx solid transparent;
border-bottom: 8rpx solid transparent;
border-left: 10rpx solid #666;
transition: transform 0.2s ease;
transform-origin: 30% 50%;
}
.icon-arrow.is-expanded {
transform: rotate(90deg);
}
.xq-tree-node-checkbox { .xq-tree-node-checkbox {
margin-right: 12rpx; margin-right: 12rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.xq-tree-node-label { .xq-tree-node-label {
flex: 1; flex-shrink: 0;
white-space: nowrap; white-space: nowrap;
font-size: 28rpx;
color: #333;
line-height: 1.5;
} }
.checkbox-custom { .checkbox-custom {
@@ -799,25 +788,8 @@ updateCheckedState()
} }
.leaf-icon-placeholder { .leaf-icon-placeholder {
width: 100%; width: 16rpx;
height: 100%; height: 16rpx;
}
.uni-icon-warp {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40rpx;
height: 40rpx;
}
.icon-arrow.is-expanded {
transform: rotate(90deg);
}
.icon-arrow {
display: inline-block;
transition: transform 0.3s ease;
} }
// #ifdef H5 // #ifdef H5

View File

@@ -1 +1 @@
"use strict";const e=require("../../common/vendor.js"),a=require("../../common/assets.js"),t=require("../../request/api.js"),u={__name:"detail",setup(u){const l=e.ref(!0),n=e.ref(""),o=e.ref({}),i=e.ref([]),v={1:"日常检查",2:"专项检查",3:"设备检查"},r={1:"每天一次",2:"每周",3:"每月",4:"每季度"},s={1:"单人完成",2:"全员",3:"指定分组"},c={1:"包含周末",2:"不包含周末"},d=e.computed((()=>o.value.typeName||v[o.value.type]||"-")),m=e.computed((()=>o.value.cycleName||r[o.value.cycle]||"-")),p=e.computed((()=>o.value.runModeName||s[o.value.runMode]||"-")),f=e.computed((()=>o.value.isWeekendName||c[o.value.isWeekend]||"-")),N=e.computed((()=>2===Number(o.value.runMode)?"全员":o.value.executorName||"-")),y=e=>e?String(e).split(" ")[0]:"-";return e.onLoad((a=>{if(n.value=a.id||"",!n.value)return e.index.showToast({title:"缺少检查表ID",icon:"none"}),void(l.value=!1);(async()=>{if(n.value){l.value=!0;try{const a=await t.getOneTableInfo(n.value);if(0===a.code){const e=a.data||{};o.value=e,i.value=e.itemDetailList||[]}else e.index.showToast({title:a.msg||"获取详情失败",icon:"none"})}catch(a){console.error("获取检查计划详情失败:",a),e.index.showToast({title:"获取详情失败",icon:"none"})}finally{l.value=!1}}})()})),(t,u)=>e.e({a:l.value},l.value?{}:e.e({b:e.t(o.value.name||"-"),c:e.t(o.value.deptName||"-"),d:e.t(d.value),e:e.t(p.value),f:e.t(N.value),g:e.t(m.value),h:o.value.description},o.value.description?{i:o.value.description}:{},{j:a._imports_0$1,k:e.t(o.value.itemNames||"-"),l:e.t(i.value.length),m:0===i.value.length},0===i.value.length?{}:{n:e.f(i.value,((a,t,u)=>e.e({a:e.t(t+1),b:e.t(a.checkItemName||"-"),c:a.industryName},a.industryName?{d:e.t(a.industryName)}:{},{e:a.pointId||t})))},{o:e.t(f.value),p:e.t(y(o.value.planStartTime)),q:e.t(y(o.value.planEndTime))}),{r:e.gei(t,"")})}},l=e._export_sfc(u,[["__scopeId","data-v-311899fa"]]);wx.createPage(l); "use strict";const e=require("../../common/vendor.js"),t=require("../../common/assets.js"),a=require("../../request/api.js"),u={__name:"detail",setup(u){const l=e.ref(!0),n=e.ref(""),o=e.ref({}),i=e.ref([]),r={1:"日常检查",2:"专项检查",3:"设备检查"},v={1:"每天一次",2:"每周",3:"每月",4:"每季度"},s={1:"单人完成",2:"全员",3:"指定分组",4:"排班模式"},c={1:"包含周末",2:"不包含周末"},d=e.computed((()=>o.value.typeName||r[o.value.type]||"-")),m=e.computed((()=>o.value.cycleName||v[o.value.cycle]||"-")),p=e.computed((()=>o.value.runModeName||s[o.value.runMode]||"-")),f=e.computed((()=>o.value.isWeekendName||c[o.value.isWeekend]||"-")),N=e.computed((()=>{const e=Number(o.value.runMode);if(2===e)return"全员";if(4===e){const e=o.value.rosterItems||[];return e.length>0&&e.map((e=>e.identityName)).filter(Boolean).join("、")||"-"}return o.value.executorIdentityName||o.value.executorName||"-"})),y=e=>e?String(e).split(" ")[0]:"-";return e.onLoad((t=>{if(n.value=t.id||"",!n.value)return e.index.showToast({title:"缺少检查表ID",icon:"none"}),void(l.value=!1);(async()=>{if(n.value){l.value=!0;try{const t=await a.getOneTableInfo(n.value);if(0===t.code){const e=t.data||{};o.value=e,i.value=e.itemDetailList||[]}else e.index.showToast({title:t.msg||"获取详情失败",icon:"none"})}catch(t){console.error("获取检查计划详情失败:",t),e.index.showToast({title:"获取详情失败",icon:"none"})}finally{l.value=!1}}})()})),(a,u)=>e.e({a:l.value},l.value?{}:e.e({b:e.t(o.value.name||"-"),c:e.t(o.value.deptName||"-"),d:e.t(d.value),e:e.t(p.value),f:e.t(N.value),g:e.t(m.value),h:o.value.description},o.value.description?{i:o.value.description}:{},{j:t._imports_0$1,k:e.t(o.value.itemNames||"-"),l:e.t(i.value.length),m:0===i.value.length},0===i.value.length?{}:{n:e.f(i.value,((t,a,u)=>e.e({a:e.t(a+1),b:e.t(t.checkItemName||"-"),c:t.industryName},t.industryName?{d:e.t(t.industryName)}:{},{e:t.pointId||a})))},{o:e.t(f.value),p:e.t(y(o.value.planStartTime)),q:e.t(y(o.value.planEndTime))}),{r:e.gei(a,"")})}},l=e._export_sfc(u,[["__scopeId","data-v-ba1b4ca9"]]);wx.createPage(l);

View File

@@ -1 +1 @@
<view class="{{['page', 'data-v-311899fa', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{r}}"><view wx:if="{{a}}" class="loading-wrap data-v-311899fa"><text class="loading-text data-v-311899fa">加载中...</text></view><block wx:else><view class="section-card data-v-311899fa"><view class="section-title data-v-311899fa">基本信息</view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">检查表名称</text><text class="info-value data-v-311899fa">{{b}}</text></view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">分派单位</text><text class="info-value data-v-311899fa">{{c}}</text></view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">检查表类型</text><text class="info-value data-v-311899fa">{{d}}</text></view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">模式</text><text class="info-value data-v-311899fa">{{e}}</text></view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">执行人员</text><text class="info-value data-v-311899fa">{{f}}</text></view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">循环周期</text><text class="info-value data-v-311899fa">{{g}}</text></view><view class="info-row column data-v-311899fa"><text class="info-label data-v-311899fa">检查说明</text><view class="info-block data-v-311899fa"><rich-text wx:if="{{h}}" class="data-v-311899fa" nodes="{{i}}"></rich-text><text wx:else class="info-empty data-v-311899fa">-</text></view></view></view><view class="section-card data-v-311899fa"><view class="section-title data-v-311899fa">关联表项</view><view class="related-box data-v-311899fa"><image class="related-icon data-v-311899fa" src="{{j}}" mode="aspectFit"></image><text class="related-text data-v-311899fa">{{k}}</text></view></view><view class="section-card data-v-311899fa"><view class="section-title data-v-311899fa"> 检查项明细 <text class="item-count data-v-311899fa">{{l}}项)</text></view><view wx:if="{{m}}" class="empty-block data-v-311899fa">暂无检查项</view><view wx:else class="item-list data-v-311899fa"><view wx:for="{{n}}" wx:for-item="item" wx:key="e" class="item-row data-v-311899fa"><text class="item-no data-v-311899fa">{{item.a}}</text><view class="item-content data-v-311899fa"><text class="item-name data-v-311899fa">{{item.b}}</text><text wx:if="{{item.c}}" class="item-industry data-v-311899fa">{{item.d}}</text></view></view></view></view><view class="section-card data-v-311899fa"><view class="section-title data-v-311899fa">计划安排</view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">仅工作日</text><text class="info-value data-v-311899fa">{{o}}</text></view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">计划开始日期</text><text class="info-value data-v-311899fa">{{p}}</text></view><view class="info-row data-v-311899fa"><text class="info-label data-v-311899fa">计划结束日期</text><text class="info-value data-v-311899fa">{{q}}</text></view></view></block></view> <view class="{{['page', 'data-v-ba1b4ca9', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{r}}"><view wx:if="{{a}}" class="loading-wrap data-v-ba1b4ca9"><text class="loading-text data-v-ba1b4ca9">加载中...</text></view><block wx:else><view class="section-card data-v-ba1b4ca9"><view class="section-title data-v-ba1b4ca9">基本信息</view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">检查表名称</text><text class="info-value data-v-ba1b4ca9">{{b}}</text></view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">分派单位</text><text class="info-value data-v-ba1b4ca9">{{c}}</text></view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">检查表类型</text><text class="info-value data-v-ba1b4ca9">{{d}}</text></view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">模式</text><text class="info-value data-v-ba1b4ca9">{{e}}</text></view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">执行人员</text><text class="info-value data-v-ba1b4ca9">{{f}}</text></view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">循环周期</text><text class="info-value data-v-ba1b4ca9">{{g}}</text></view><view class="info-row column data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">检查说明</text><view class="info-block data-v-ba1b4ca9"><rich-text wx:if="{{h}}" class="data-v-ba1b4ca9" nodes="{{i}}"></rich-text><text wx:else class="info-empty data-v-ba1b4ca9">-</text></view></view></view><view class="section-card data-v-ba1b4ca9"><view class="section-title data-v-ba1b4ca9">关联表项</view><view class="related-box data-v-ba1b4ca9"><image class="related-icon data-v-ba1b4ca9" src="{{j}}" mode="aspectFit"></image><text class="related-text data-v-ba1b4ca9">{{k}}</text></view></view><view class="section-card data-v-ba1b4ca9"><view class="section-title data-v-ba1b4ca9"> 检查项明细 <text class="item-count data-v-ba1b4ca9">{{l}}项)</text></view><view wx:if="{{m}}" class="empty-block data-v-ba1b4ca9">暂无检查项</view><view wx:else class="item-list data-v-ba1b4ca9"><view wx:for="{{n}}" wx:for-item="item" wx:key="e" class="item-row data-v-ba1b4ca9"><text class="item-no data-v-ba1b4ca9">{{item.a}}</text><view class="item-content data-v-ba1b4ca9"><text class="item-name data-v-ba1b4ca9">{{item.b}}</text><text wx:if="{{item.c}}" class="item-industry data-v-ba1b4ca9">{{item.d}}</text></view></view></view></view><view class="section-card data-v-ba1b4ca9"><view class="section-title data-v-ba1b4ca9">计划安排</view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">仅工作日</text><text class="info-value data-v-ba1b4ca9">{{o}}</text></view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">计划开始日期</text><text class="info-value data-v-ba1b4ca9">{{p}}</text></view><view class="info-row data-v-ba1b4ca9"><text class="info-label data-v-ba1b4ca9">计划结束日期</text><text class="info-value data-v-ba1b4ca9">{{q}}</text></view></view></block></view>

View File

@@ -1 +1 @@
.page.data-v-311899fa{min-height:100vh;background:#ebf2fc;padding:24rpx 24rpx 40rpx;box-sizing:border-box}.loading-wrap.data-v-311899fa{padding:120rpx 0;text-align:center}.loading-text.data-v-311899fa{font-size:28rpx;color:#999}.section-card.data-v-311899fa{background:#fff;border-radius:16rpx;padding:28rpx;margin-bottom:20rpx;box-shadow:0 2rpx 10rpx rgba(0,0,0,.04)}.section-title.data-v-311899fa{font-size:30rpx;font-weight:600;color:#333;margin-bottom:20rpx;padding-left:16rpx;border-left:6rpx solid #2667E9}.item-count.data-v-311899fa{font-size:26rpx;font-weight:400;color:#999}.info-row.data-v-311899fa{display:flex;align-items:flex-start;padding:18rpx 0;border-bottom:1rpx solid #f0f0f0}.info-row.data-v-311899fa:last-child{border-bottom:none}.info-row.column.data-v-311899fa{flex-direction:column}.info-label.data-v-311899fa{width:180rpx;flex-shrink:0;font-size:26rpx;color:#999;line-height:1.5}.info-value.data-v-311899fa{flex:1;font-size:28rpx;color:#333;line-height:1.5;word-break:break-all}.info-block.data-v-311899fa{width:100%;margin-top:12rpx;padding:20rpx;background:#f8f9fb;border:1rpx solid #ebeef5;border-radius:8rpx;font-size:28rpx;color:#606266;line-height:1.6;box-sizing:border-box}.info-empty.data-v-311899fa{color:#c0c4cc}.related-box.data-v-311899fa{display:flex;align-items:flex-start;gap:12rpx;padding:20rpx;background:#f8f9fb;border:1rpx solid #ebeef5;border-radius:8rpx}.related-icon.data-v-311899fa{flex-shrink:0;width:36rpx;height:36rpx;margin-top:4rpx}.related-text.data-v-311899fa{flex:1;font-size:28rpx;color:#333;line-height:1.5;word-break:break-all}.empty-block.data-v-311899fa{text-align:center;padding:40rpx 0;font-size:26rpx;color:#999}.item-list.data-v-311899fa{border-top:1rpx solid #f0f0f0}.item-row.data-v-311899fa{display:flex;align-items:flex-start;gap:16rpx;padding:24rpx 0;border-bottom:1rpx solid #f0f0f0}.item-row.data-v-311899fa:last-child{border-bottom:none;padding-bottom:0}.item-no.data-v-311899fa{width:36rpx;font-size:26rpx;color:#999;line-height:1.5;flex-shrink:0}.item-content.data-v-311899fa{flex:1;min-width:0}.item-name.data-v-311899fa{display:block;font-size:28rpx;color:#333;line-height:1.5;word-break:break-all}.item-industry.data-v-311899fa{display:inline-block;margin-top:8rpx;font-size:24rpx;color:#999} .page.data-v-ba1b4ca9{min-height:100vh;background:#ebf2fc;padding:24rpx 24rpx 40rpx;box-sizing:border-box}.loading-wrap.data-v-ba1b4ca9{padding:120rpx 0;text-align:center}.loading-text.data-v-ba1b4ca9{font-size:28rpx;color:#999}.section-card.data-v-ba1b4ca9{background:#fff;border-radius:16rpx;padding:28rpx;margin-bottom:20rpx;box-shadow:0 2rpx 10rpx rgba(0,0,0,.04)}.section-title.data-v-ba1b4ca9{font-size:30rpx;font-weight:600;color:#333;margin-bottom:20rpx;padding-left:16rpx;border-left:6rpx solid #2667E9}.item-count.data-v-ba1b4ca9{font-size:26rpx;font-weight:400;color:#999}.info-row.data-v-ba1b4ca9{display:flex;align-items:flex-start;padding:18rpx 0;border-bottom:1rpx solid #f0f0f0}.info-row.data-v-ba1b4ca9:last-child{border-bottom:none}.info-row.column.data-v-ba1b4ca9{flex-direction:column}.info-label.data-v-ba1b4ca9{width:180rpx;flex-shrink:0;font-size:26rpx;color:#999;line-height:1.5}.info-value.data-v-ba1b4ca9{flex:1;font-size:28rpx;color:#333;line-height:1.5;word-break:break-all}.info-block.data-v-ba1b4ca9{width:100%;margin-top:12rpx;padding:20rpx;background:#f8f9fb;border:1rpx solid #ebeef5;border-radius:8rpx;font-size:28rpx;color:#606266;line-height:1.6;box-sizing:border-box}.info-empty.data-v-ba1b4ca9{color:#c0c4cc}.related-box.data-v-ba1b4ca9{display:flex;align-items:flex-start;gap:12rpx;padding:20rpx;background:#f8f9fb;border:1rpx solid #ebeef5;border-radius:8rpx}.related-icon.data-v-ba1b4ca9{flex-shrink:0;width:36rpx;height:36rpx;margin-top:4rpx}.related-text.data-v-ba1b4ca9{flex:1;font-size:28rpx;color:#333;line-height:1.5;word-break:break-all}.empty-block.data-v-ba1b4ca9{text-align:center;padding:40rpx 0;font-size:26rpx;color:#999}.item-list.data-v-ba1b4ca9{border-top:1rpx solid #f0f0f0}.item-row.data-v-ba1b4ca9{display:flex;align-items:flex-start;gap:16rpx;padding:24rpx 0;border-bottom:1rpx solid #f0f0f0}.item-row.data-v-ba1b4ca9:last-child{border-bottom:none;padding-bottom:0}.item-no.data-v-ba1b4ca9{width:36rpx;font-size:26rpx;color:#999;line-height:1.5;flex-shrink:0}.item-content.data-v-ba1b4ca9{flex:1;min-width:0}.item-name.data-v-ba1b4ca9{display:block;font-size:28rpx;color:#333;line-height:1.5;word-break:break-all}.item-industry.data-v-ba1b4ca9{display:inline-block;margin-top:8rpx;font-size:24rpx;color:#999}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
"use strict";const e=require("../../common/vendor.js"),a=require("../../request/api.js"),l=require("../../utils/hazardNav.js"),t=require("../../utils/userInfo.js");if(!Array){e.resolveComponent("u-loadmore")()}Math;const u={__name:"Inspection",setup(u){const o=e.ref(""),n=e.ref(""),r=e.ref(""),d=e.ref(""),v=()=>{try{const a=e.index.getStorageSync("userInfo");a&&(d.value=t.resolveUserRoleKey(JSON.parse(a)))}catch(a){console.error("获取用户信息失败:",a)}};e.onLoad((e=>{v(),e.id&&(r.value=e.id,(async e=>{try{const l=await a.enterCheckPlan(e);if(0===l.code&&l.data){const e=l.data.taskId,t=await a.getCheckTaskDetail(e);0===t.code&&t.data&&(o.value=t.data.taskId,n.value=t.data.checkPointId)}}catch(l){console.error("获取任务信息失败:",l)}})(e.id))}));const i=e.ref([]),s=e.ref(1),c=e.ref(!1),h=e.ref("loadmore"),f=e.ref([{label:"全部",value:null},{label:"待交办",value:1},{label:"待整改",value:2},{label:"待验收",value:3},{label:"待销号",value:4},{label:"已完成",value:5}]),g=e.ref(0),m=()=>{s.value=1,i.value=[],h.value="loadmore"},p=async()=>{var l,t;if(!(c.value||s.value>1&&"nomore"===h.value)){c.value=!0,s.value>1&&(h.value="loading");try{const u=await a.getMyHiddenDangerList((()=>{const e={pageNum:s.value,pageSize:10},a=f.value[g.value];return null!=(null==a?void 0:a.value)&&(e.status=a.value),e})());if(0===u.code){const e=(null==(l=u.data)?void 0:l.records)||[],a=Number((null==(t=u.data)?void 0:t.total)??0);1===s.value?i.value=e:i.value=[...i.value,...e],i.value.length>=a||e.length<10?h.value="nomore":h.value="loadmore"}else 1===s.value&&(i.value=[]),h.value="nomore",e.index.showToast({title:u.msg||"获取隐患列表失败",icon:"none"})}catch(u){console.error(u),s.value>1&&s.value--,h.value="loadmore",e.index.showToast({title:"请求失败",icon:"none"})}finally{c.value=!1}}};e.onShow((()=>{v(),m(),p()})),e.onReachBottom((()=>{"loadmore"!==h.value||c.value||(s.value++,p())}));const I=()=>{let a="/pages/hiddendanger/add";const l=[];r.value&&l.push(`id=${r.value}`),o.value&&l.push(`taskId=${o.value}`),n.value&&l.push(`checkPointId=${n.value}`),l.length&&(a+=`?${l.join("&")}`),e.index.navigateTo({url:a})},b=a=>{e.index.navigateTo({url:l.buildAssignmentUrl(a)})};return(a,t)=>e.e({a:e.f(f.value,((a,l,t)=>e.e({a:e.t(a.label),b:g.value===l},(g.value,{}),{c:l,d:g.value===l?1:"",e:e.o((e=>(e=>{g.value!==e&&(g.value=e,m(),p())})(l)),l)}))),b:0===i.value.length&&!c.value},(0!==i.value.length||c.value,{}),{c:e.f(i.value,((a,t,u)=>e.e({a:e.t(a.title),b:e.t(a.statusName),c:e.t(a.levelName),d:"轻微隐患"===a.levelName?1:"",e:"一般隐患"===a.levelName?1:"",f:"重大隐患"===a.levelName?1:"",g:e.t(a.address),h:e.t(a.createdAt),i:e.o((l=>(a=>{e.index.navigateTo({url:`/pages/hiddendanger/process-chain?hazardId=${a.hazardId}`})})(a)),a.hazardId),j:"待整改"===a.statusName&&a.canEdit},"待整改"===a.statusName&&a.canEdit?{k:e.o((e=>b(a)),a.hazardId)}:{},{l:"待整改"===a.statusName&&a.canEdit},"待整改"===a.statusName&&a.canEdit?{m:e.o((t=>(a=>{e.index.navigateTo({url:l.buildRectificationUrl(a)})})(a)),a.hazardId)}:{},{n:"待验收"===a.statusName&&a.canEdit},"待验收"===a.statusName&&a.canEdit?{o:e.o((t=>(a=>{e.index.navigateTo({url:l.buildEditRectificationUrl(a)})})(a)),a.hazardId)}:{},{p:e.unref(l.canShowAcceptanceButton)(a,d.value)},e.unref(l.canShowAcceptanceButton)(a,d.value)?{q:e.o((t=>(a=>{e.index.navigateTo({url:l.buildAcceptanceUrl(a)})})(a)),a.hazardId)}:{},{r:"待交办"===a.statusName},"待交办"===a.statusName?{s:e.o((e=>b(a)),a.hazardId)}:{},{t:e.unref(l.canShowWriteoffApplyButton)(a)},e.unref(l.canShowWriteoffApplyButton)(a)?{v:e.o((t=>(a=>{e.index.navigateTo({url:l.buildWriteoffApplyUrl(a)})})(a)),a.hazardId)}:{},{w:e.unref(l.canShowWriteoffApprovalButton)(a,d.value)},e.unref(l.canShowWriteoffApprovalButton)(a,d.value)?{x:e.o((t=>(a=>{e.index.navigateTo({url:l.buildWriteoffApprovalUrl(a)})})(a)),a.hazardId)}:{},{y:a.hazardId}))),d:i.value.length>0},i.value.length>0?{e:e.p({status:h.value})}:{},{f:e.o(I),g:e.gei(a,"")})}},o=e._export_sfc(u,[["__scopeId","data-v-f9c24575"]]);wx.createPage(o); "use strict";const e=require("../../common/vendor.js"),a=require("../../request/api.js"),l=require("../../utils/hazardNav.js"),t=require("../../utils/userInfo.js");if(!Array){e.resolveComponent("u-loadmore")()}Math;const u={__name:"Inspection",setup(u){const o=e.ref(""),n=e.ref(""),r=e.ref(""),d=e.ref(""),v=e.computed((()=>"approval"===d.value)),i=()=>{try{const a=e.index.getStorageSync("userInfo");a&&(d.value=t.resolveUserIdentityRoleKey(JSON.parse(a)))}catch(a){console.error("获取用户信息失败:",a)}};e.onLoad((e=>{i(),e.id&&(r.value=e.id,(async e=>{try{const l=await a.enterCheckPlan(e);if(0===l.code&&l.data){const e=l.data.taskId,t=await a.getCheckTaskDetail(e);0===t.code&&t.data&&(o.value=t.data.taskId,n.value=t.data.checkPointId)}}catch(l){console.error("获取任务信息失败:",l)}})(e.id))}));const s=e.ref([]),c=e.ref(1),h=e.ref(!1),f=e.ref("loadmore"),p=e.ref([{label:"全部",value:null},{label:"待交办",value:1},{label:"待整改",value:2},{label:"待验收",value:3},{label:"待销号",value:4},{label:"已完成",value:5}]),g=e.ref(0),m=()=>{c.value=1,s.value=[],f.value="loadmore"},I=async()=>{var l,t;if(!(h.value||c.value>1&&"nomore"===f.value)){h.value=!0,c.value>1&&(f.value="loading");try{const u=await a.getMyHiddenDangerList((()=>{const e={pageNum:c.value,pageSize:10},a=p.value[g.value];return null!=(null==a?void 0:a.value)&&(e.status=a.value),e})());if(0===u.code){const e=(null==(l=u.data)?void 0:l.records)||[],a=Number((null==(t=u.data)?void 0:t.total)??0);1===c.value?s.value=e:s.value=[...s.value,...e],s.value.length>=a||e.length<10?f.value="nomore":f.value="loadmore"}else 1===c.value&&(s.value=[]),f.value="nomore",e.index.showToast({title:u.msg||"获取隐患列表失败",icon:"none"})}catch(u){console.error(u),c.value>1&&c.value--,f.value="loadmore",e.index.showToast({title:"请求失败",icon:"none"})}finally{h.value=!1}}};e.onShow((()=>{i(),m(),I()})),e.onReachBottom((()=>{"loadmore"!==f.value||h.value||(c.value++,I())}));const b=()=>{let a="/pages/hiddendanger/add";const l=[];r.value&&l.push(`id=${r.value}`),o.value&&l.push(`taskId=${o.value}`),n.value&&l.push(`checkPointId=${n.value}`),l.length&&(a+=`?${l.join("&")}`),e.index.navigateTo({url:a})},N=a=>{e.index.navigateTo({url:l.buildAssignmentUrl(a)})};return(a,t)=>e.e({a:e.f(p.value,((a,l,t)=>e.e({a:e.t(a.label),b:g.value===l},(g.value,{}),{c:l,d:g.value===l?1:"",e:e.o((e=>(e=>{g.value!==e&&(g.value=e,m(),I())})(l)),l)}))),b:0===s.value.length&&!h.value},(0!==s.value.length||h.value,{}),{c:e.f(s.value,((a,t,u)=>e.e({a:e.t(a.title),b:e.t(a.statusName),c:e.t(a.levelName),d:"轻微隐患"===a.levelName?1:"",e:"一般隐患"===a.levelName?1:"",f:"重大隐患"===a.levelName?1:"",g:e.t(a.address),h:e.t(a.createdAt),i:e.o((l=>(a=>{e.index.navigateTo({url:`/pages/hiddendanger/process-chain?hazardId=${a.hazardId}`})})(a)),a.hazardId)},v.value?{}:e.e({j:"待整改"===a.statusName&&a.canEdit},"待整改"===a.statusName&&a.canEdit?{k:e.o((e=>N(a)),a.hazardId)}:{},{l:"待整改"===a.statusName&&a.canEdit},"待整改"===a.statusName&&a.canEdit?{m:e.o((t=>(a=>{e.index.navigateTo({url:l.buildRectificationUrl(a)})})(a)),a.hazardId)}:{},{n:"待验收"===a.statusName&&a.canEdit},"待验收"===a.statusName&&a.canEdit?{o:e.o((t=>(a=>{e.index.navigateTo({url:l.buildEditRectificationUrl(a)})})(a)),a.hazardId)}:{},{p:e.unref(l.canShowAcceptanceButton)(a,d.value)},e.unref(l.canShowAcceptanceButton)(a,d.value)?{q:e.o((t=>(a=>{e.index.navigateTo({url:l.buildAcceptanceUrl(a)})})(a)),a.hazardId)}:{},{r:"待交办"===a.statusName},"待交办"===a.statusName?{s:e.o((e=>N(a)),a.hazardId)}:{},{t:e.unref(l.canShowWriteoffApplyButton)(a)},e.unref(l.canShowWriteoffApplyButton)(a)?{v:e.o((t=>(a=>{e.index.navigateTo({url:l.buildWriteoffApplyUrl(a)})})(a)),a.hazardId)}:{},{w:e.unref(l.canShowWriteoffApprovalButton)(a,d.value)},e.unref(l.canShowWriteoffApprovalButton)(a,d.value)?{x:e.o((t=>(a=>{e.index.navigateTo({url:l.buildWriteoffApprovalUrl(a)})})(a)),a.hazardId)}:{}),{y:a.hazardId}))),d:!v.value,e:s.value.length>0},s.value.length>0?{f:e.p({status:f.value})}:{},{g:!v.value},v.value?{}:{h:e.o(b)},{i:e.gei(a,"")})}},o=e._export_sfc(u,[["__scopeId","data-v-dea7ab22"]]);wx.createPage(o);

View File

@@ -1 +1 @@
<view class="{{['page', 'padding', 'data-v-f9c24575', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{g}}"><scroll-view class="status-tabs data-v-f9c24575" scroll-x show-scrollbar="{{false}}"><view class="status-tabs-inner data-v-f9c24575"><view wx:for="{{a}}" wx:for-item="tab" wx:key="c" class="{{['status-tab-item', 'data-v-f9c24575', tab.d && 'status-tab-active']}}" bindtap="{{tab.e}}"><text class="status-tab-text data-v-f9c24575">{{tab.a}}</text><view wx:if="{{tab.b}}" class="status-tab-bar data-v-f9c24575"></view></view></view></scroll-view><view wx:if="{{b}}" class="empty-tip text-gray text-center padding data-v-f9c24575">暂无数据</view><view wx:for="{{c}}" wx:for-item="item" wx:key="y" class="padding radius bg-white list-list margin-bottom data-v-f9c24575"><view class="flex justify-between margin-bottom data-v-f9c24575"><view class="text-bold text-black data-v-f9c24575" style="word-break:break-all;flex:1">{{item.a}}</view><view class="text-blue data-v-f9c24575" style="white-space:nowrap;flex-shrink:0;margin-left:16rpx">{{item.b}}</view></view><view class="flex margin-bottom data-v-f9c24575"><view class="text-gray data-v-f9c24575">隐患等级:</view><view class="{{['level-tag', 'data-v-f9c24575', item.d && 'level-minor', item.e && 'level-normal', item.f && 'level-major']}}">{{item.c}}</view></view><view class="flex margin-bottom data-v-f9c24575"><view class="text-gray data-v-f9c24575" style="white-space:nowrap">隐患位置:</view><view class="text-black data-v-f9c24575">{{item.g}}</view></view><view class="flex margin-bottom data-v-f9c24575"><view class="text-gray data-v-f9c24575">创建时间:</view><view class="text-black data-v-f9c24575">{{item.h}}</view></view><view class="flex justify-end card-actions data-v-f9c24575" style="gap:10rpx"><button class="round cu-btn light bg-blue data-v-f9c24575" bindtap="{{item.i}}">查看详情</button><button wx:if="{{item.j}}" class="round cu-btn light bg-blue data-v-f9c24575" bindtap="{{item.k}}">隐患交办</button><button wx:if="{{item.l}}" class="round cu-btn bg-blue data-v-f9c24575" bindtap="{{item.m}}">立即整改</button><button wx:if="{{item.n}}" class="round cu-btn light bg-blue data-v-f9c24575" bindtap="{{item.o}}">编辑整改信息</button><button wx:if="{{item.p}}" class="round cu-btn bg-blue data-v-f9c24575" bindtap="{{item.q}}">立即验收</button><button wx:if="{{item.r}}" class="round cu-btn bg-blue data-v-f9c24575" bindtap="{{item.s}}">隐患交办</button><button wx:if="{{item.t}}" class="round cu-btn bg-blue data-v-f9c24575" bindtap="{{item.v}}">销号申请</button><button wx:if="{{item.w}}" class="round cu-btn bg-blue data-v-f9c24575" bindtap="{{item.x}}">销号审批</button></view></view><u-loadmore wx:if="{{d}}" class="data-v-f9c24575" virtualHostClass="data-v-f9c24575" style="margin-top:20rpx;margin-bottom:140rpx" virtualHostStyle="margin-top:20rpx;margin-bottom:140rpx" u-i="f9c24575-0" bind:__l="__l" u-p="{{e}}"/><view class="fixed-add-btn data-v-f9c24575" bindtap="{{f}}"><text class="cuIcon-add data-v-f9c24575"></text><text class="data-v-f9c24575">新增</text></view></view> <view class="{{['page', 'padding', 'data-v-dea7ab22', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{i}}"><scroll-view class="status-tabs data-v-dea7ab22" scroll-x show-scrollbar="{{false}}"><view class="status-tabs-inner data-v-dea7ab22"><view wx:for="{{a}}" wx:for-item="tab" wx:key="c" class="{{['status-tab-item', 'data-v-dea7ab22', tab.d && 'status-tab-active']}}" bindtap="{{tab.e}}"><text class="status-tab-text data-v-dea7ab22">{{tab.a}}</text><view wx:if="{{tab.b}}" class="status-tab-bar data-v-dea7ab22"></view></view></view></scroll-view><view wx:if="{{b}}" class="empty-tip text-gray text-center padding data-v-dea7ab22">暂无数据</view><view wx:for="{{c}}" wx:for-item="item" wx:key="y" class="padding radius bg-white list-list margin-bottom data-v-dea7ab22"><view class="flex justify-between margin-bottom data-v-dea7ab22"><view class="text-bold text-black data-v-dea7ab22" style="word-break:break-all;flex:1">{{item.a}}</view><view class="text-blue data-v-dea7ab22" style="white-space:nowrap;flex-shrink:0;margin-left:16rpx">{{item.b}}</view></view><view class="flex margin-bottom data-v-dea7ab22"><view class="text-gray data-v-dea7ab22">隐患等级:</view><view class="{{['level-tag', 'data-v-dea7ab22', item.d && 'level-minor', item.e && 'level-normal', item.f && 'level-major']}}">{{item.c}}</view></view><view class="flex margin-bottom data-v-dea7ab22"><view class="text-gray data-v-dea7ab22" style="white-space:nowrap">隐患位置:</view><view class="text-black data-v-dea7ab22">{{item.g}}</view></view><view class="flex margin-bottom data-v-dea7ab22"><view class="text-gray data-v-dea7ab22">创建时间:</view><view class="text-black data-v-dea7ab22">{{item.h}}</view></view><view class="flex justify-end card-actions data-v-dea7ab22" style="gap:10rpx"><button class="round cu-btn light bg-blue data-v-dea7ab22" bindtap="{{item.i}}">查看详情</button><block wx:if="{{d}}"><button wx:if="{{item.j}}" class="round cu-btn light bg-blue data-v-dea7ab22" bindtap="{{item.k}}">隐患交办</button><button wx:if="{{item.l}}" class="round cu-btn bg-blue data-v-dea7ab22" bindtap="{{item.m}}">立即整改</button><button wx:if="{{item.n}}" class="round cu-btn light bg-blue data-v-dea7ab22" bindtap="{{item.o}}">编辑整改信息</button><button wx:if="{{item.p}}" class="round cu-btn bg-blue data-v-dea7ab22" bindtap="{{item.q}}">立即验收</button><button wx:if="{{item.r}}" class="round cu-btn bg-blue data-v-dea7ab22" bindtap="{{item.s}}">隐患交办</button><button wx:if="{{item.t}}" class="round cu-btn bg-blue data-v-dea7ab22" bindtap="{{item.v}}">销号申请</button><button wx:if="{{item.w}}" class="round cu-btn bg-blue data-v-dea7ab22" bindtap="{{item.x}}">销号审批</button></block></view></view><u-loadmore wx:if="{{e}}" class="data-v-dea7ab22" virtualHostClass="data-v-dea7ab22" style="margin-top:20rpx;margin-bottom:140rpx" virtualHostStyle="margin-top:20rpx;margin-bottom:140rpx" u-i="dea7ab22-0" bind:__l="__l" u-p="{{f}}"/><view wx:if="{{g}}" class="fixed-add-btn data-v-dea7ab22" bindtap="{{h}}"><text class="cuIcon-add data-v-dea7ab22"></text><text class="data-v-dea7ab22">新增</text></view></view>

View File

@@ -1 +1 @@
.page.data-v-f9c24575{min-height:100vh;background:#ebf2fc;padding-top:100rpx;padding-bottom:120rpx}.fixed-add-btn.data-v-f9c24575{position:fixed;bottom:40rpx;left:30rpx;right:30rpx;height:88rpx;background:linear-gradient(135deg,#667eea,#2668ea);border-radius:44rpx;display:flex;align-items:center;justify-content:center;color:#fff;font-size:32rpx;font-weight:500;box-shadow:0 8rpx 24rpx rgba(38,104,234,.4);z-index:100}.fixed-add-btn .cuIcon-add.data-v-f9c24575{margin-right:10rpx;font-size:36rpx}.list-list.data-v-f9c24575{background:#fff;box-shadow:0 2rpx 6rpx 2rpx rgba(0,0,0,.08);border-left:5px solid #2667E9;border-radius:20rpx;padding:20rpx}.level-tag.data-v-f9c24575{padding:4rpx 16rpx;border-radius:8rpx;white-space:nowrap;flex-shrink:0}.level-minor.data-v-f9c24575{background:#f6ffed;border:2rpx solid #B7EB8F;color:#52c41a}.level-normal.data-v-f9c24575{background:#fff7e6;border:2rpx solid #FFD591;color:#fa8c16}.level-major.data-v-f9c24575{background:#fff1f0;border:2rpx solid #FFA39E;color:#f5222d}.status-tabs.data-v-f9c24575{position:fixed;top:0;left:0;right:0;z-index:99;white-space:nowrap;background:#fff;padding:0 10rpx;box-shadow:0 2rpx 10rpx rgba(0,0,0,.06)}.status-tabs-inner.data-v-f9c24575{display:inline-flex;align-items:center;height:88rpx}.status-tab-item.data-v-f9c24575{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;padding:0 28rpx;height:88rpx;position:relative}.status-tab-text.data-v-f9c24575{font-size:28rpx;color:#666}.status-tab-active .status-tab-text.data-v-f9c24575{color:#2667e9;font-weight:700}.status-tab-bar.data-v-f9c24575{position:absolute;bottom:8rpx;width:40rpx;height:6rpx;background:#2667e9;border-radius:3rpx}.card-actions{margin-top:20rpx}.card-actions .cu-btn{padding:0 24rpx!important;font-size:28rpx!important;height:64rpx!important;line-height:64rpx!important;white-space:nowrap!important;flex-shrink:0!important;width:auto!important} .page.data-v-dea7ab22{min-height:100vh;background:#ebf2fc;padding-top:100rpx;padding-bottom:120rpx}.fixed-add-btn.data-v-dea7ab22{position:fixed;bottom:40rpx;left:30rpx;right:30rpx;height:88rpx;background:linear-gradient(135deg,#667eea,#2668ea);border-radius:44rpx;display:flex;align-items:center;justify-content:center;color:#fff;font-size:32rpx;font-weight:500;box-shadow:0 8rpx 24rpx rgba(38,104,234,.4);z-index:100}.fixed-add-btn .cuIcon-add.data-v-dea7ab22{margin-right:10rpx;font-size:36rpx}.list-list.data-v-dea7ab22{background:#fff;box-shadow:0 2rpx 6rpx 2rpx rgba(0,0,0,.08);border-left:5px solid #2667E9;border-radius:20rpx;padding:20rpx}.level-tag.data-v-dea7ab22{padding:4rpx 16rpx;border-radius:8rpx;white-space:nowrap;flex-shrink:0}.level-minor.data-v-dea7ab22{background:#f6ffed;border:2rpx solid #B7EB8F;color:#52c41a}.level-normal.data-v-dea7ab22{background:#fff7e6;border:2rpx solid #FFD591;color:#fa8c16}.level-major.data-v-dea7ab22{background:#fff1f0;border:2rpx solid #FFA39E;color:#f5222d}.status-tabs.data-v-dea7ab22{position:fixed;top:0;left:0;right:0;z-index:99;white-space:nowrap;background:#fff;padding:0 10rpx;box-shadow:0 2rpx 10rpx rgba(0,0,0,.06)}.status-tabs-inner.data-v-dea7ab22{display:inline-flex;align-items:center;height:88rpx}.status-tab-item.data-v-dea7ab22{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;padding:0 28rpx;height:88rpx;position:relative}.status-tab-text.data-v-dea7ab22{font-size:28rpx;color:#666}.status-tab-active .status-tab-text.data-v-dea7ab22{color:#2667e9;font-weight:700}.status-tab-bar.data-v-dea7ab22{position:absolute;bottom:8rpx;width:40rpx;height:6rpx;background:#2667e9;border-radius:3rpx}.card-actions{margin-top:20rpx}.card-actions .cu-btn{padding:0 24rpx!important;font-size:28rpx!important;height:64rpx!important;line-height:64rpx!important;white-space:nowrap!important;flex-shrink:0!important;width:auto!important}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
<view class="{{['u-popup', 'data-v-a2df0d48', x, virtualHostClass]}}" style="{{'width:' + y + ';' + ('height:' + z) + ';' + virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{A}}"><view class="u-popup__trigger data-v-a2df0d48"><slot name="trigger"></slot><view bindtap="{{a}}" class="u-popup__trigger__cover data-v-a2df0d48"></view></view><u-overlay wx:if="{{b}}" class="data-v-a2df0d48" virtualHostClass="data-v-a2df0d48" bindclick="{{c}}" u-i="a2df0d48-0" bind:__l="__l" u-p="{{d}}"></u-overlay><u-transition wx:if="{{w}}" u-s="{{['d']}}" class="u-popup__content—transition data-v-a2df0d48" virtualHostClass="u-popup__content—transition data-v-a2df0d48" style="{{s}}" virtualHostStyle="{{s}}" bindafterEnter="{{t}}" bindclick="{{v}}" u-i="a2df0d48-1" bind:__l="__l" u-p="{{w}}"><view class="u-popup__content data-v-a2df0d48" style="{{p}}" catchtap="{{q}}" catchtouchmove="{{r}}"><u-status-bar wx:if="{{e}}" class="data-v-a2df0d48" virtualHostClass="data-v-a2df0d48" u-i="a2df0d48-2,a2df0d48-1" bind:__l="__l"></u-status-bar><view wx:if="{{f}}" class="u-popup__content__touch-area data-v-a2df0d48" bindtouchstart="{{g}}" bindtouchmove="{{h}}" bindtouchend="{{i}}" bindtouchcancel="{{j}}"><view class="u-popup__content__indicator data-v-a2df0d48"></view></view><slot></slot><view wx:if="{{k}}" catchtap="{{m}}" class="{{['u-popup__content__close', 'data-v-a2df0d48', n]}}" hover-class="u-popup__content__close--hover" hover-stay-time="150"><up-icon wx:if="{{l}}" class="data-v-a2df0d48" virtualHostClass="data-v-a2df0d48" u-i="a2df0d48-3,a2df0d48-1" bind:__l="__l" u-p="{{l}}"></up-icon></view><u-safe-bottom wx:if="{{o}}" class="data-v-a2df0d48" virtualHostClass="data-v-a2df0d48" u-i="a2df0d48-4,a2df0d48-1" bind:__l="__l"></u-safe-bottom></view><slot name="bottom"></slot></u-transition></view> <view class="{{['u-popup', 'data-v-2097774c', w, virtualHostClass]}}" style="{{'width:' + x + ';' + ('height:' + y) + ';' + virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{z}}"><view class="u-popup__trigger data-v-2097774c"><slot name="trigger"></slot><view bindtap="{{a}}" class="u-popup__trigger__cover data-v-2097774c"></view></view><u-overlay wx:if="{{b}}" class="data-v-2097774c" virtualHostClass="data-v-2097774c" bindclick="{{c}}" u-i="2097774c-0" bind:__l="__l" u-p="{{d}}"></u-overlay><u-transition wx:if="{{v}}" u-s="{{['d']}}" class="u-popup__content—transition data-v-2097774c" virtualHostClass="u-popup__content—transition data-v-2097774c" style="{{r}}" virtualHostStyle="{{r}}" bindafterEnter="{{s}}" bindclick="{{t}}" u-i="2097774c-1" bind:__l="__l" u-p="{{v}}"><view class="u-popup__content data-v-2097774c" style="{{p}}" catchtap="{{q}}"><u-status-bar wx:if="{{e}}" class="data-v-2097774c" virtualHostClass="data-v-2097774c" u-i="2097774c-2,2097774c-1" bind:__l="__l"></u-status-bar><view wx:if="{{f}}" class="u-popup__content__touch-area data-v-2097774c" bindtouchstart="{{g}}" bindtouchmove="{{h}}" bindtouchend="{{i}}" bindtouchcancel="{{j}}"><view class="u-popup__content__indicator data-v-2097774c"></view></view><slot></slot><view wx:if="{{k}}" catchtap="{{m}}" class="{{['u-popup__content__close', 'data-v-2097774c', n]}}" hover-class="u-popup__content__close--hover" hover-stay-time="150"><up-icon wx:if="{{l}}" class="data-v-2097774c" virtualHostClass="data-v-2097774c" u-i="2097774c-3,2097774c-1" bind:__l="__l" u-p="{{l}}"></up-icon></view><u-safe-bottom wx:if="{{o}}" class="data-v-2097774c" virtualHostClass="data-v-2097774c" u-i="2097774c-4,2097774c-1" bind:__l="__l"></u-safe-bottom></view><slot name="bottom"></slot></u-transition></view>

View File

@@ -1 +1 @@
.u-popup.data-v-a2df0d48{flex:1}.u-popup__trigger.data-v-a2df0d48{position:relative}.u-popup__trigger__cover.data-v-a2df0d48{position:absolute;top:0;left:0;right:0;bottom:0}.u-popup__content.data-v-a2df0d48{background-color:#fff;position:relative}.u-popup__content--round-top.data-v-a2df0d48{border-radius:0 0 10px 10px}.u-popup__content--round-left.data-v-a2df0d48{border-radius:0 10px 10px 0}.u-popup__content--round-right.data-v-a2df0d48{border-radius:10px 0 0 10px}.u-popup__content--round-bottom.data-v-a2df0d48{border-radius:10px 10px 0 0}.u-popup__content--round-center.data-v-a2df0d48{border-radius:10px}.u-popup__content__touch-area.data-v-a2df0d48{top:0;left:0;right:0;height:42rpx;z-index:10;display:flex;justify-content:center;align-items:center}.u-popup__content__indicator.data-v-a2df0d48{width:100px;height:5px;border-radius:100px;background-color:#c0c4cc}.u-popup__content__close.data-v-a2df0d48{position:absolute}.u-popup__content__close--hover.data-v-a2df0d48{opacity:.4}.u-popup__content__close--top-left.data-v-a2df0d48{top:15px;left:15px}.u-popup__content__close--top-right.data-v-a2df0d48{top:15px;right:15px}.u-popup__content__close--bottom-left.data-v-a2df0d48{bottom:15px;left:15px}.u-popup__content__close--bottom-right.data-v-a2df0d48{right:15px;bottom:15px} .u-popup.data-v-2097774c{flex:1}.u-popup__trigger.data-v-2097774c{position:relative}.u-popup__trigger__cover.data-v-2097774c{position:absolute;top:0;left:0;right:0;bottom:0}.u-popup__content.data-v-2097774c{background-color:#fff;position:relative}.u-popup__content--round-top.data-v-2097774c{border-radius:0 0 10px 10px}.u-popup__content--round-left.data-v-2097774c{border-radius:0 10px 10px 0}.u-popup__content--round-right.data-v-2097774c{border-radius:10px 0 0 10px}.u-popup__content--round-bottom.data-v-2097774c{border-radius:10px 10px 0 0}.u-popup__content--round-center.data-v-2097774c{border-radius:10px}.u-popup__content__touch-area.data-v-2097774c{top:0;left:0;right:0;height:42rpx;z-index:10;display:flex;justify-content:center;align-items:center}.u-popup__content__indicator.data-v-2097774c{width:100px;height:5px;border-radius:100px;background-color:#c0c4cc}.u-popup__content__close.data-v-2097774c{position:absolute}.u-popup__content__close--hover.data-v-2097774c{opacity:.4}.u-popup__content__close--top-left.data-v-2097774c{top:15px;left:15px}.u-popup__content__close--top-right.data-v-2097774c{top:15px;right:15px}.u-popup__content__close--bottom-left.data-v-2097774c{bottom:15px;left:15px}.u-popup__content__close--bottom-right.data-v-2097774c{right:15px;bottom:15px}

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
<scroll-view scroll-x scroll-y enable-flex class="{{['tree-wrapper', 'data-v-5d5e6f99', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{i}}"><view class="xq-tree-scroll data-v-5d5e6f99"><view class="xq-tree data-v-5d5e6f99" style="{{'min-width:' + g + ';' + ('min-height:' + h)}}"><view wx:if="{{a}}" class="xq-tree-empty data-v-5d5e6f99">{{b}}</view><transition-group wx:else u-s="{{['d']}}" class="xq-tree-list data-v-5d5e6f99" virtualHostClass="xq-tree-list data-v-5d5e6f99" u-i="5d5e6f99-0" bind:__l="__l" u-p="{{f||''}}"><view wx:for="{{c}}" wx:for-item="node" wx:key="l" class="{{['xq-tree-node', 'data-v-5d5e6f99', node.m]}}" style="{{'padding-left:' + node.n + ';' + ('animation-delay:' + node.o)}}"><view class="xq-tree-node-content data-v-5d5e6f99" bindtap="{{node.k}}"><view class="xq-tree-node-icon data-v-5d5e6f99" catchtap="{{node.c}}"><text wx:if="{{node.a}}" class="{{['icon-arrow', 'data-v-5d5e6f99', node.b && 'is-expanded']}}"> ▶ </text><view wx:else class="leaf-icon-placeholder data-v-5d5e6f99"></view></view><view wx:if="{{d}}" class="xq-tree-node-checkbox data-v-5d5e6f99" catchtap="{{node.g}}"><view class="{{['checkbox-custom', 'data-v-5d5e6f99', node.f]}}"><text wx:if="{{node.d}}" class="data-v-5d5e6f99"> ✓ </text><text wx:elif="{{node.e}}" class="data-v-5d5e6f99"> — </text></view></view><slot wx:if="{{e}}" name="{{node.h}}"/><text wx:else class="xq-tree-node-label data-v-5d5e6f99">{{node.j}}</text></view></view></transition-group></view></view></scroll-view> <scroll-view scroll-x scroll-y enable-flex style="{{i + ';' + virtualHostStyle}}" class="{{['tree-wrapper', 'data-v-559e7a26', virtualHostClass]}}" hidden="{{virtualHostHidden || false}}" id="{{j}}"><view class="xq-tree-scroll data-v-559e7a26"><view class="xq-tree data-v-559e7a26" style="{{'min-width:' + g + ';' + ('min-height:' + h)}}"><view wx:if="{{a}}" class="xq-tree-empty data-v-559e7a26">{{b}}</view><transition-group wx:else u-s="{{['d']}}" class="xq-tree-list data-v-559e7a26" virtualHostClass="xq-tree-list data-v-559e7a26" u-i="559e7a26-0" bind:__l="__l" u-p="{{f||''}}"><view wx:for="{{c}}" wx:for-item="node" wx:key="l" class="{{['xq-tree-node', 'data-v-559e7a26', node.m]}}" style="{{'padding-left:' + node.n + ';' + ('animation-delay:' + node.o)}}"><view class="xq-tree-node-content data-v-559e7a26" bindtap="{{node.k}}"><view class="xq-tree-node-icon data-v-559e7a26" catchtap="{{node.c}}"><view wx:if="{{node.a}}" class="{{['icon-arrow', 'data-v-559e7a26', node.b && 'is-expanded']}}"/><view wx:else class="leaf-icon-placeholder data-v-559e7a26"></view></view><view wx:if="{{d}}" class="xq-tree-node-checkbox data-v-559e7a26" catchtap="{{node.g}}"><view class="{{['checkbox-custom', 'data-v-559e7a26', node.f]}}"><text wx:if="{{node.d}}" class="data-v-559e7a26"> ✓ </text><text wx:elif="{{node.e}}" class="data-v-559e7a26"> — </text></view></view><slot wx:if="{{e}}" name="{{node.h}}"/><text wx:else class="xq-tree-node-label data-v-559e7a26">{{node.j}}</text></view></view></transition-group></view></view></scroll-view>

View File

@@ -1 +1 @@
.xq-tree.data-v-5d5e6f99{display:inline-block;box-sizing:border-box;width:-webkit-max-content;width:max-content;white-space:nowrap}.tree-wrapper.data-v-5d5e6f99{width:100%;height:100%}.xq-tree-scroll.data-v-5d5e6f99{display:inline-block;white-space:nowrap;min-width:100%;box-sizing:border-box;background-color:#fff;padding:16rpx}.tree-wrapper.data-v-5d5e6f99::-webkit-scrollbar{height:8rpx;width:8rpx}.tree-wrapper.data-v-5d5e6f99::-webkit-scrollbar-track{background:#f1f1f1}.tree-wrapper.data-v-5d5e6f99::-webkit-scrollbar-thumb{background:#888;border-radius:4rpx}.tree-node-enter-active.data-v-5d5e6f99{animation:treeExpandIn-5d5e6f99 .3s ease-out both}.tree-node-leave-active.data-v-5d5e6f99{animation:treeCollapseOut-5d5e6f99 .3s ease-in both;overflow:hidden}.tree-node-leave-to.data-v-5d5e6f99{max-height:0;padding-top:0;padding-bottom:0;opacity:0}@keyframes treeExpandIn-5d5e6f99{0%{max-height:0;opacity:0;padding-top:0;padding-bottom:0}to{max-height:500px;opacity:1;padding-top:8rpx;padding-bottom:8rpx}}@keyframes treeCollapseOut-5d5e6f99{0%{max-height:500px;opacity:1;padding-top:8rpx;padding-bottom:8rpx}to{max-height:0;opacity:0;padding-top:0;padding-bottom:0}}.xq-tree-node.data-v-5d5e6f99{padding:8rpx 0;overflow:hidden;transform-origin:top}.xq-tree.data-v-5d5e6f99{width:100%}.xq-tree-empty.data-v-5d5e6f99{padding:40rpx;text-align:center;color:#999}.xq-tree-node.data-v-5d5e6f99{padding:8rpx 0}.xq-tree-node-content.data-v-5d5e6f99{display:flex;align-items:center}.xq-tree-node-icon.data-v-5d5e6f99{width:40rpx;text-align:center;flex-shrink:0}.xq-tree-node-checkbox.data-v-5d5e6f99{margin-right:12rpx;flex-shrink:0}.xq-tree-node-label.data-v-5d5e6f99{flex:1;white-space:nowrap}.checkbox-custom.data-v-5d5e6f99{width:32rpx;height:32rpx;border:2rpx solid #ccc;display:flex;align-items:center;justify-content:center;border-radius:4rpx}.checkbox-custom.checked.data-v-5d5e6f99,.checkbox-custom.indeterminate.data-v-5d5e6f99{background-color:#007aff;border-color:#007aff;color:#fff}.leaf-icon-placeholder.data-v-5d5e6f99{width:100%;height:100%}.uni-icon-warp.data-v-5d5e6f99{display:inline-flex;align-items:center;justify-content:center;width:40rpx;height:40rpx}.icon-arrow.is-expanded.data-v-5d5e6f99{transform:rotate(90deg)}.icon-arrow.data-v-5d5e6f99{display:inline-block;transition:transform .3s ease}page.data-v-5d5e6f99{box-sizing:border-box}view.data-v-5d5e6f99,text.data-v-5d5e6f99,image.data-v-5d5e6f99,button.data-v-5d5e6f99,input.data-v-5d5e6f99,textarea.data-v-5d5e6f99,navigator.data-v-5d5e6f99,scroll-view.data-v-5d5e6f99{box-sizing:border-box} .xq-tree.data-v-559e7a26{display:inline-block;box-sizing:border-box;width:-webkit-max-content;width:max-content;white-space:nowrap}.tree-wrapper.data-v-559e7a26{width:100%;box-sizing:border-box}.xq-tree-scroll.data-v-559e7a26{display:inline-block;white-space:nowrap;min-width:100%;box-sizing:border-box;background-color:#fff;padding:16rpx}.tree-node-enter-active.data-v-559e7a26{animation:treeExpandIn-559e7a26 .3s ease-out both}.tree-node-leave-active.data-v-559e7a26{animation:treeCollapseOut-559e7a26 .3s ease-in both;overflow:hidden}.tree-node-leave-to.data-v-559e7a26{max-height:0;padding-top:0;padding-bottom:0;opacity:0}@keyframes treeExpandIn-559e7a26{0%{max-height:0;opacity:0;padding-top:0;padding-bottom:0}to{max-height:500px;opacity:1;padding-top:8rpx;padding-bottom:8rpx}}@keyframes treeCollapseOut-559e7a26{0%{max-height:500px;opacity:1;padding-top:8rpx;padding-bottom:8rpx}to{max-height:0;opacity:0;padding-top:0;padding-bottom:0}}.xq-tree-node.data-v-559e7a26{padding:8rpx 0;transform-origin:top}.xq-tree-empty.data-v-559e7a26{padding:40rpx;text-align:center;color:#999}.xq-tree-node-content.data-v-559e7a26{display:flex;align-items:center}.xq-tree-node-icon.data-v-559e7a26{width:40rpx;height:40rpx;display:flex;align-items:center;justify-content:center;flex-shrink:0}.icon-arrow.data-v-559e7a26{width:0;height:0;border-top:8rpx solid transparent;border-bottom:8rpx solid transparent;border-left:10rpx solid #666;transition:transform .2s ease;transform-origin:30% 50%}.icon-arrow.is-expanded.data-v-559e7a26{transform:rotate(90deg)}.xq-tree-node-checkbox.data-v-559e7a26{margin-right:12rpx;flex-shrink:0}.xq-tree-node-label.data-v-559e7a26{flex-shrink:0;white-space:nowrap;font-size:28rpx;color:#333;line-height:1.5}.checkbox-custom.data-v-559e7a26{width:32rpx;height:32rpx;border:2rpx solid #ccc;display:flex;align-items:center;justify-content:center;border-radius:4rpx}.checkbox-custom.checked.data-v-559e7a26,.checkbox-custom.indeterminate.data-v-559e7a26{background-color:#007aff;border-color:#007aff;color:#fff}.leaf-icon-placeholder.data-v-559e7a26{width:16rpx;height:16rpx}page.data-v-559e7a26{box-sizing:border-box}view.data-v-559e7a26,text.data-v-559e7a26,image.data-v-559e7a26,button.data-v-559e7a26,input.data-v-559e7a26,textarea.data-v-559e7a26,navigator.data-v-559e7a26,scroll-view.data-v-559e7a26{box-sizing:border-box}

View File

@@ -1 +1 @@
"use strict";const e=require("../common/vendor.js");function t(e){if(!e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch(t){return null}return e}function n(){try{const n=e.index.getStorageSync("currentIdentity");return n?t(n):null}catch(n){return null}}function r(e){return null==e||""===e?"":String(e).trim()}function o(e){if(!e)return"";const o=t(e.userIdentity),i=n(),u=r(null==o?void 0:o.roleKey);if(u)return u;const l=r(null==i?void 0:i.roleKey);if(l)return l;const d=r(e.role);if(d)return d;const a=[null==o?void 0:o.roleName,null==o?void 0:o.identityName,e.identityName,null==i?void 0:i.roleName,null==i?void 0:i.identityName].filter(Boolean).join(" ");return/审批|approval/i.test(a)?"approval":""}function i(e,n){const r=n||t(null==e?void 0:e.userIdentity);if(null==r?void 0:r.identityName)return r.identityName;if(null==e?void 0:e.identityName)return e.identityName;if(r){const e=[r.deptName,r.roleName,r.postName].filter(Boolean);if(e.length)return e.join("-")}return""}function u(e){if(!e)return{};const o=t(e.userIdentity),u=n(),l=r((null==o?void 0:o.roleKey)||(null==u?void 0:u.roleKey)||function(e,t=""){if(!(null==e?void 0:e.length))return r(t);const n=e[0];return r("string"==typeof n?n:n.roleKey||n.role||t)}(e.roles,""));return{userId:e.userId||"",username:e.userName||"",nickName:e.nickName||"",deptId:(null==o?void 0:o.deptId)??(null==u?void 0:u.deptId)??e.deptId??"",deptName:(null==o?void 0:o.deptName)??(null==u?void 0:u.deptName)??e.deptName??"",role:l,avatar:e.avatar||"",phone:e.phonenumber||e.phone||"",identityName:i(e,o),userIdentity:o||u}}exports.applyProfileToUserInfo=function(t,n){const r=u(n);return Object.keys(r).forEach((e=>{t[e]=r[e]})),e.index.setStorageSync("userInfo",JSON.stringify(r)),r},exports.applyStoredUserInfo=function(e,r){if(!r)return;const u=t(r.userIdentity),l=n(),d=u||l,a={userId:r.userId||"",username:r.username||"",nickName:r.nickName||"",deptId:r.deptId||(null==d?void 0:d.deptId)||"",deptName:r.deptName||(null==d?void 0:d.deptName)||"",role:o({role:r.role,userIdentity:d,identityName:r.identityName}),avatar:r.avatar||"",phone:r.phone||"",userIdentity:d,identityName:r.identityName||i(r,d)};return Object.keys(a).forEach((t=>{e[t]=a[t]})),a},exports.resolveIdentityName=i,exports.resolveUserRoleKey=o,exports.saveUserInfoToStorage=function(t){const n=u(t);return e.index.setStorageSync("userInfo",JSON.stringify(n)),n}; "use strict";const e=require("../common/vendor.js");function t(e){if(!e)return null;if("string"==typeof e)try{return JSON.parse(e)}catch(t){return null}return e}function n(){try{const n=e.index.getStorageSync("currentIdentity");return n?t(n):null}catch(n){return null}}function r(e){return null==e||""===e?"":String(e).trim()}function i(e){if(!e)return"";const i=t(e.userIdentity),o=n(),u=r(null==i?void 0:i.roleKey);if(u)return u;const l=r(null==o?void 0:o.roleKey);if(l)return l;const d=r(e.role);if(d)return d;const a=[null==i?void 0:i.roleName,null==i?void 0:i.identityName,e.identityName,null==o?void 0:o.roleName,null==o?void 0:o.identityName].filter(Boolean).join(" ");return/审批|approval/i.test(a)?"approval":""}function o(e,n){const r=n||t(null==e?void 0:e.userIdentity);if(null==r?void 0:r.identityName)return r.identityName;if(null==e?void 0:e.identityName)return e.identityName;if(r){const e=[r.deptName,r.roleName,r.postName].filter(Boolean);if(e.length)return e.join("-")}return""}function u(e){if(!e)return{};const i=t(e.userIdentity),u=n(),l=r((null==i?void 0:i.roleKey)||(null==u?void 0:u.roleKey)||function(e,t=""){if(!(null==e?void 0:e.length))return r(t);const n=e[0];return r("string"==typeof n?n:n.roleKey||n.role||t)}(e.roles,""));return{userId:e.userId||"",username:e.userName||"",nickName:e.nickName||"",deptId:(null==i?void 0:i.deptId)??(null==u?void 0:u.deptId)??e.deptId??"",deptName:(null==i?void 0:i.deptName)??(null==u?void 0:u.deptName)??e.deptName??"",role:l,avatar:e.avatar||"",phone:e.phonenumber||e.phone||"",identityName:o(e,i),userIdentity:i||u}}exports.applyProfileToUserInfo=function(t,n){const r=u(n);return Object.keys(r).forEach((e=>{t[e]=r[e]})),e.index.setStorageSync("userInfo",JSON.stringify(r)),r},exports.applyStoredUserInfo=function(e,r){if(!r)return;const u=t(r.userIdentity),l=n(),d=u||l,a={userId:r.userId||"",username:r.username||"",nickName:r.nickName||"",deptId:r.deptId||(null==d?void 0:d.deptId)||"",deptName:r.deptName||(null==d?void 0:d.deptName)||"",role:i({role:r.role,userIdentity:d,identityName:r.identityName}),avatar:r.avatar||"",phone:r.phone||"",userIdentity:d,identityName:r.identityName||o(r,d)};return Object.keys(a).forEach((t=>{e[t]=a[t]})),a},exports.resolveIdentityName=o,exports.resolveUserIdentityRoleKey=function(e){if(!e)return"";const n=t(e.userIdentity);return r(null==n?void 0:n.roleKey)},exports.saveUserInfoToStorage=function(t){const n=u(t);return e.index.setStorageSync("userInfo",JSON.stringify(n)),n};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -7141,7 +7141,7 @@ function isConsoleWritable() {
function initRuntimeSocketService() { function initRuntimeSocketService() {
const hosts = "172.30.48.1,192.168.1.144,127.0.0.1"; const hosts = "172.30.48.1,192.168.1.144,127.0.0.1";
const port = "8090"; const port = "8090";
const id = "mp-weixin_t1hX9E"; const id = "mp-weixin_6yA7g3";
const lazy = typeof swan !== "undefined"; const lazy = typeof swan !== "undefined";
let restoreError = lazy ? () => { let restoreError = lazy ? () => {
} : initOnError(); } : initOnError();

View File

@@ -11,16 +11,24 @@ const _sfc_main = {
const checkItems = common_vendor.ref([]); const checkItems = common_vendor.ref([]);
const typeMap = { 1: "日常检查", 2: "专项检查", 3: "设备检查" }; const typeMap = { 1: "日常检查", 2: "专项检查", 3: "设备检查" };
const cycleMap = { 1: "每天一次", 2: "每周", 3: "每月", 4: "每季度" }; const cycleMap = { 1: "每天一次", 2: "每周", 3: "每月", 4: "每季度" };
const runModeMap = { 1: "单人完成", 2: "全员", 3: "指定分组" }; const runModeMap = { 1: "单人完成", 2: "全员", 3: "指定分组", 4: "排班模式" };
const weekendMap = { 1: "包含周末", 2: "不包含周末" }; const weekendMap = { 1: "包含周末", 2: "不包含周末" };
const typeLabel = common_vendor.computed(() => detail.value.typeName || typeMap[detail.value.type] || "-"); const typeLabel = common_vendor.computed(() => detail.value.typeName || typeMap[detail.value.type] || "-");
const cycleLabel = common_vendor.computed(() => detail.value.cycleName || cycleMap[detail.value.cycle] || "-"); const cycleLabel = common_vendor.computed(() => detail.value.cycleName || cycleMap[detail.value.cycle] || "-");
const runModeLabel = common_vendor.computed(() => detail.value.runModeName || runModeMap[detail.value.runMode] || "-"); const runModeLabel = common_vendor.computed(() => detail.value.runModeName || runModeMap[detail.value.runMode] || "-");
const weekendLabel = common_vendor.computed(() => detail.value.isWeekendName || weekendMap[detail.value.isWeekend] || "-"); const weekendLabel = common_vendor.computed(() => detail.value.isWeekendName || weekendMap[detail.value.isWeekend] || "-");
const executorLabel = common_vendor.computed(() => { const executorLabel = common_vendor.computed(() => {
if (Number(detail.value.runMode) === 2) const runMode = Number(detail.value.runMode);
if (runMode === 2)
return "全员"; return "全员";
return detail.value.executorName || "-"; if (runMode === 4) {
const rosterItems = detail.value.rosterItems || [];
if (rosterItems.length > 0) {
return rosterItems.map((item) => item.identityName).filter(Boolean).join("、") || "-";
}
return "-";
}
return detail.value.executorIdentityName || detail.value.executorName || "-";
}); });
const formatDate = (value) => { const formatDate = (value) => {
if (!value) if (!value)
@@ -41,7 +49,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" }); common_vendor.index.showToast({ title: res.msg || "获取详情失败", icon: "none" });
} }
} catch (error) { } catch (error) {
common_vendor.index.__f__("error", "at pages/checklist/detail.vue:137", "获取检查计划详情失败:", error); common_vendor.index.__f__("error", "at pages/checklist/detail.vue:145", "获取检查计划详情失败:", error);
common_vendor.index.showToast({ title: "获取详情失败", icon: "none" }); common_vendor.index.showToast({ title: "获取详情失败", icon: "none" });
} finally { } finally {
loading.value = false; loading.value = false;

View File

@@ -1,6 +1,7 @@
"use strict"; "use strict";
const common_vendor = require("../../common/vendor.js"); const common_vendor = require("../../common/vendor.js");
const request_api = require("../../request/api.js"); const request_api = require("../../request/api.js");
const utils_userInfo = require("../../utils/userInfo.js");
if (!Array) { if (!Array) {
const _easycom_up_input2 = common_vendor.resolveComponent("up-input"); const _easycom_up_input2 = common_vendor.resolveComponent("up-input");
const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea"); const _easycom_up_textarea2 = common_vendor.resolveComponent("up-textarea");
@@ -22,6 +23,16 @@ if (!Math) {
const _sfc_main = { const _sfc_main = {
__name: "editchecklist", __name: "editchecklist",
setup(__props) { setup(__props) {
const showFullForm = common_vendor.computed(() => {
const identity = utils_userInfo.getCurrentIdentityFromStorage();
const type = Number(identity == null ? void 0 : identity.organizationEntityType);
return type === 0 || type === 1;
});
const MODE_OPTIONS = [
{ label: "单人完成", value: 1 },
{ label: "全员", value: 2 },
{ label: "排班模式", value: 4 }
];
const formData = common_vendor.reactive({ const formData = common_vendor.reactive({
name: "", name: "",
deptId: "", deptId: "",
@@ -30,12 +41,13 @@ const _sfc_main = {
type: "", type: "",
// 检查表类型1-日常检查2-专项检查3-设备检查 // 检查表类型1-日常检查2-专项检查3-设备检查
typeName: "", typeName: "",
modeId: "", runMode: void 0,
modeName: "", modeName: "",
selectDeptId: "", selectDeptId: "",
selectDeptName: "", selectDeptName: "",
executorId: "", executorId: "",
executorNames: "", executorNames: "",
rosterIdentityIds: [],
cycleId: "", cycleId: "",
cycleName: "", cycleName: "",
isWeekend: 1, isWeekend: 1,
@@ -153,11 +165,18 @@ const _sfc_main = {
const showStartDatePicker = common_vendor.ref(false); const showStartDatePicker = common_vendor.ref(false);
const showEndDatePicker = common_vendor.ref(false); const showEndDatePicker = common_vendor.ref(false);
const typeColumns = common_vendor.ref([["日常检查", "专项检查", "设备检查"]]); const typeColumns = common_vendor.ref([["日常检查", "专项检查", "设备检查"]]);
const modeColumns = common_vendor.ref([["单人完成", "全员"]]); const modeColumns = common_vendor.ref([MODE_OPTIONS.map((item) => item.label)]);
const cycleColumns = common_vendor.ref([["每天一次", "每周一次", "每月一次", "每季度一次"]]); const cycleColumns = common_vendor.ref([["每天一次", "每周一次", "每月一次", "每季度一次"]]);
const showExecutorPopup = common_vendor.ref(false); const showExecutorPopup = common_vendor.ref(false);
const executorList = common_vendor.ref([]); const executorList = common_vendor.ref([]);
const selectedExecutorId = common_vendor.ref(null); const selectedExecutorId = common_vendor.ref(null);
const selectedRosterIdentityIds = common_vendor.ref([]);
const pageScrollLockStyle = common_vendor.computed(() => {
if (showDeptPicker.value || showExecutorPopup.value) {
return "overflow: hidden; height: 100%;";
}
return "";
});
const deptTree = common_vendor.ref([]); const deptTree = common_vendor.ref([]);
const deptTreeRef = common_vendor.ref(null); const deptTreeRef = common_vendor.ref(null);
const selectedDeptId = common_vendor.ref(null); const selectedDeptId = common_vendor.ref(null);
@@ -246,18 +265,27 @@ const _sfc_main = {
showTypePicker.value = false; showTypePicker.value = false;
}; };
const onModeConfirm = (e) => { const onModeConfirm = (e) => {
if (e.value && e.value.length > 0) { var _a;
formData.modeName = e.value[0]; const index = Number(((_a = e.indexs) == null ? void 0 : _a[0]) ?? 0);
if (e.value[0] === "全员") { const option = MODE_OPTIONS[index];
clearExecutorSelection(); if (!option) {
showModePicker.value = false;
return;
} }
formData.modeName = option.label;
formData.runMode = option.value;
clearExecutorSelection();
if (formData.deptId && option.value !== 2) {
fetchDeptUsers(formData.deptId);
} }
showModePicker.value = false; showModePicker.value = false;
}; };
const clearExecutorSelection = () => { const clearExecutorSelection = () => {
formData.executorId = ""; formData.executorId = "";
formData.executorNames = ""; formData.executorNames = "";
formData.rosterIdentityIds = [];
selectedExecutorId.value = null; selectedExecutorId.value = null;
selectedRosterIdentityIds.value = [];
}; };
const fetchDeptUsers = async (deptId) => { const fetchDeptUsers = async (deptId) => {
if (!deptId) { if (!deptId) {
@@ -265,21 +293,44 @@ const _sfc_main = {
return; return;
} }
try { try {
const res = await request_api.getDeptUsers(deptId); const params = formData.runMode === 4 ? { type: 4 } : {};
const res = await request_api.getDeptUsers(deptId, params);
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
executorList.value = res.data || []; executorList.value = res.data || [];
} else { } else {
executorList.value = []; executorList.value = [];
} }
} catch (error) { } catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:726", "获取部门用户失败:", error); common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:810", "获取部门用户失败:", error);
executorList.value = []; executorList.value = [];
} }
}; };
const selectExecutor = (item) => { const selectExecutor = (item) => {
selectedExecutorId.value = item.userId; selectedExecutorId.value = item.userId;
}; };
const toggleRosterExecutor = (item) => {
const identityId = item.identityId;
if (identityId == null)
return;
const index = selectedRosterIdentityIds.value.indexOf(identityId);
if (index > -1) {
selectedRosterIdentityIds.value.splice(index, 1);
} else {
selectedRosterIdentityIds.value.push(identityId);
}
};
const confirmExecutorSelect = () => { const confirmExecutorSelect = () => {
if (formData.runMode === 4) {
if (selectedRosterIdentityIds.value.length === 0) {
common_vendor.index.showToast({ title: "请选择执行人员", icon: "none" });
return;
}
formData.rosterIdentityIds = [...selectedRosterIdentityIds.value];
const names = executorList.value.filter((user) => selectedRosterIdentityIds.value.includes(user.identityId)).map((user) => user.nickName || user.nickname);
formData.executorNames = names.join("、");
showExecutorPopup.value = false;
return;
}
if (!selectedExecutorId.value) { if (!selectedExecutorId.value) {
common_vendor.index.showToast({ title: "请选择执行人员", icon: "none" }); common_vendor.index.showToast({ title: "请选择执行人员", icon: "none" });
return; return;
@@ -294,7 +345,11 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "请先选择分派单位", icon: "none" }); common_vendor.index.showToast({ title: "请先选择分派单位", icon: "none" });
return; return;
} }
if (formData.runMode === 4) {
selectedRosterIdentityIds.value = [...formData.rosterIdentityIds || []];
} else {
selectedExecutorId.value = formData.executorId || null; selectedExecutorId.value = formData.executorId || null;
}
fetchDeptUsers(formData.deptId); fetchDeptUsers(formData.deptId);
showExecutorPopup.value = true; showExecutorPopup.value = true;
}; };
@@ -306,7 +361,7 @@ const _sfc_main = {
deptTree.value = handleTree(list, "deptId"); deptTree.value = handleTree(list, "deptId");
} }
} catch (error) { } catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:764", "获取部门树失败:", error); common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:876", "获取部门树失败:", error);
} }
}; };
const onCycleConfirm = (e) => { const onCycleConfirm = (e) => {
@@ -415,7 +470,7 @@ const _sfc_main = {
} }
} catch (error) { } catch (error) {
common_vendor.index.hideLoading(); common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:892", "删除检查项失败:", error); common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1004", "删除检查项失败:", error);
common_vendor.index.showToast({ title: "删除失败", icon: "none" }); common_vendor.index.showToast({ title: "删除失败", icon: "none" });
} }
} else { } else {
@@ -442,14 +497,63 @@ const _sfc_main = {
const showAddPopup = common_vendor.ref(false); const showAddPopup = common_vendor.ref(false);
const checkForm = common_vendor.reactive({ const checkForm = common_vendor.reactive({
name: "", name: "",
// 检查名称
point: "", point: "",
// 检查内容 industryId: null,
industryName: "",
leadDept: "",
commonProblem: "",
isSerious: 2,
regulationId: null, regulationId: null,
// 参考法规ID
regulationName: "" regulationName: ""
// 参考法规名称(显示用)
}); });
const industryOptions = common_vendor.ref([]);
const showIndustryPicker = common_vendor.ref(false);
const industryColumns = common_vendor.computed(() => [industryOptions.value.map((item) => item.name || item.industryName || "")]);
const showSeriousPicker = common_vendor.ref(false);
const seriousColumns = common_vendor.ref([["是", "否"]]);
const seriousName = common_vendor.computed(() => checkForm.isSerious === 1 ? "是" : "否");
const resetCheckForm = () => {
checkForm.name = "";
checkForm.point = "";
checkForm.industryId = null;
checkForm.industryName = "";
checkForm.leadDept = "";
checkForm.commonProblem = "";
checkForm.isSerious = 2;
checkForm.regulationId = null;
checkForm.regulationName = "";
};
const fetchIndustryOptions = async () => {
try {
const res = await request_api.getindustry();
if (res.code === 0) {
industryOptions.value = res.data || [];
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1073", "获取行业类型失败:", error);
}
};
common_vendor.watch(showAddPopup, (val) => {
if (val && showFullForm.value) {
fetchIndustryOptions();
}
});
const onIndustryConfirm = (e) => {
var _a;
const selectedName = (_a = e.value) == null ? void 0 : _a[0];
const selected = industryOptions.value.find((item) => (item.name || item.industryName) === selectedName);
if (selected) {
checkForm.industryId = selected.id;
checkForm.industryName = selected.name || selected.industryName || "";
}
showIndustryPicker.value = false;
};
const onSeriousConfirm = (e) => {
var _a;
const selectedName = (_a = e.value) == null ? void 0 : _a[0];
checkForm.isSerious = selectedName === "是" ? 1 : 2;
showSeriousPicker.value = false;
};
const showLawPopup = common_vendor.ref(false); const showLawPopup = common_vendor.ref(false);
const lawKeyword = common_vendor.ref(""); const lawKeyword = common_vendor.ref("");
const selectedLawId = common_vendor.ref(null); const selectedLawId = common_vendor.ref(null);
@@ -460,6 +564,9 @@ const _sfc_main = {
const lawPageSize = common_vendor.ref(10); const lawPageSize = common_vendor.ref(10);
const hasMoreLaw = common_vendor.ref(true); const hasMoreLaw = common_vendor.ref(true);
const openLawPopup = () => { const openLawPopup = () => {
if (!showFullForm.value) {
return;
}
showLawPopup.value = true; showLawPopup.value = true;
if (lawList.value.length === 0) { if (lawList.value.length === 0) {
fetchRegulationList(); fetchRegulationList();
@@ -491,7 +598,7 @@ const _sfc_main = {
hasMoreLaw.value = lawList.value.length < total; hasMoreLaw.value = lawList.value.length < total;
} }
} catch (error) { } catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:979", "获取法规列表失败:", error); common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1152", "获取法规列表失败:", error);
} finally { } finally {
lawLoading.value = false; lawLoading.value = false;
} }
@@ -529,12 +636,29 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "请输入检查内容", icon: "none" }); common_vendor.index.showToast({ title: "请输入检查内容", icon: "none" });
return; return;
} }
if (showFullForm.value) {
if (!checkForm.industryId) {
common_vendor.index.showToast({ title: "请选择行业类型", icon: "none" });
return;
}
if (!checkForm.leadDept) {
common_vendor.index.showToast({ title: "请输入牵头部门", icon: "none" });
return;
}
}
try { try {
common_vendor.index.showLoading({ title: "添加中..." }); common_vendor.index.showLoading({ title: "添加中..." });
const params = { const params = showFullForm.value ? {
name: checkForm.name, name: checkForm.name,
point: checkForm.point, point: checkForm.point,
regulationId: checkForm.regulationId || void 0 industryId: checkForm.industryId,
leadDept: checkForm.leadDept,
regulationId: checkForm.regulationId || void 0,
commonProblem: checkForm.commonProblem || void 0,
isSerious: checkForm.isSerious
} : {
name: checkForm.name,
point: checkForm.point
}; };
const res = await request_api.addCheckPoint(params); const res = await request_api.addCheckPoint(params);
if (res.code === 0) { if (res.code === 0) {
@@ -561,17 +685,14 @@ const _sfc_main = {
common_vendor.index.hideLoading(); common_vendor.index.hideLoading();
common_vendor.index.showToast({ title: "添加成功", icon: "success" }); common_vendor.index.showToast({ title: "添加成功", icon: "success" });
showAddPopup.value = false; showAddPopup.value = false;
checkForm.name = ""; resetCheckForm();
checkForm.point = "";
checkForm.regulationId = null;
checkForm.regulationName = "";
} else { } else {
common_vendor.index.hideLoading(); common_vendor.index.hideLoading();
common_vendor.index.showToast({ title: res.msg || "添加失败", icon: "none" }); common_vendor.index.showToast({ title: res.msg || "添加失败", icon: "none" });
} }
} catch (error) { } catch (error) {
common_vendor.index.hideLoading(); common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1079", "添加检查项失败:", error); common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1265", "添加检查项失败:", error);
common_vendor.index.showToast({ title: "添加失败", icon: "none" }); common_vendor.index.showToast({ title: "添加失败", icon: "none" });
} }
}; };
@@ -620,7 +741,7 @@ const _sfc_main = {
hasMoreLibrary.value = libraryList.value.length < total; hasMoreLibrary.value = libraryList.value.length < total;
} }
} catch (error) { } catch (error) {
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1139", "获取检查库列表失败:", error); common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1325", "获取检查库列表失败:", error);
} finally { } finally {
libraryLoading.value = false; libraryLoading.value = false;
} }
@@ -723,11 +844,12 @@ const _sfc_main = {
selectedLibraries.value = []; selectedLibraries.value = [];
} catch (error) { } catch (error) {
common_vendor.index.hideLoading(); common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1259", "获取检查库详情失败:", error); common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1445", "获取检查库详情失败:", error);
common_vendor.index.showToast({ title: "添加失败", icon: "none" }); common_vendor.index.showToast({ title: "添加失败", icon: "none" });
} }
}; };
const handleSave = async () => { const handleSave = async () => {
var _a;
if (!formData.name) { if (!formData.name) {
common_vendor.index.showToast({ title: "请输入检查表名称", icon: "none" }); common_vendor.index.showToast({ title: "请输入检查表名称", icon: "none" });
return; return;
@@ -740,11 +862,15 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "请选择检查表类型", icon: "none" }); common_vendor.index.showToast({ title: "请选择检查表类型", icon: "none" });
return; return;
} }
if (!formData.modeName) { if (!formData.runMode) {
common_vendor.index.showToast({ title: "请选择模式", icon: "none" }); common_vendor.index.showToast({ title: "请选择模式", icon: "none" });
return; return;
} }
if (formData.modeName === "单人完成" && !formData.executorId) { if (formData.runMode === 1 && !formData.executorId) {
common_vendor.index.showToast({ title: "请选择执行人员", icon: "none" });
return;
}
if (formData.runMode === 4 && (!formData.rosterIdentityIds || formData.rosterIdentityIds.length === 0)) {
common_vendor.index.showToast({ title: "请选择执行人员", icon: "none" }); common_vendor.index.showToast({ title: "请选择执行人员", icon: "none" });
return; return;
} }
@@ -775,10 +901,6 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "请添加检查项", icon: "none" }); common_vendor.index.showToast({ title: "请添加检查项", icon: "none" });
return; return;
} }
const runModeMap = {
"单人完成": 1,
"全员": 2
};
const cycleMap = { const cycleMap = {
"每天一次": 1, "每天一次": 1,
"每周一次": 2, "每周一次": 2,
@@ -794,7 +916,7 @@ const _sfc_main = {
description: formData.remark || "", description: formData.remark || "",
type: formData.type, type: formData.type,
// 检查表类型1-日常检查2-专项检查3-设备检查 // 检查表类型1-日常检查2-专项检查3-设备检查
runMode: runModeMap[formData.modeName] || 2, runMode: formData.runMode,
checkPointIds: items, checkPointIds: items,
itemIds, itemIds,
// 从检查库选择的库id数组 // 从检查库选择的库id数组
@@ -803,9 +925,12 @@ const _sfc_main = {
planStartTime: `${formData.startDate} 00:00:00`, planStartTime: `${formData.startDate} 00:00:00`,
planEndTime: `${formData.endDate} 00:00:00` planEndTime: `${formData.endDate} 00:00:00`
}; };
if (formData.modeName === "单人完成" && formData.executorId) { if (formData.runMode === 1 && formData.executorId) {
params.executorId = formData.executorId; params.executorId = formData.executorId;
} }
if (formData.runMode === 4 && ((_a = formData.rosterIdentityIds) == null ? void 0 : _a.length)) {
params.rosterIdentityIds = formData.rosterIdentityIds;
}
try { try {
common_vendor.index.showLoading({ title: "保存中..." }); common_vendor.index.showLoading({ title: "保存中..." });
const res = await request_api.addCheckTable(params); const res = await request_api.addCheckTable(params);
@@ -820,7 +945,7 @@ const _sfc_main = {
} }
} catch (error) { } catch (error) {
common_vendor.index.hideLoading(); common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1374", "保存失败:", error); common_vendor.index.__f__("error", "at pages/editchecklist/editchecklist.vue:1562", "保存失败:", error);
common_vendor.index.showToast({ title: "保存失败", icon: "none" }); common_vendor.index.showToast({ title: "保存失败", icon: "none" });
} }
}; };
@@ -829,94 +954,95 @@ const _sfc_main = {
}); });
return (_ctx, _cache) => { return (_ctx, _cache) => {
return common_vendor.e({ return common_vendor.e({
a: common_vendor.o(($event) => formData.name = $event), a: pageScrollLockStyle.value,
b: common_vendor.p({ b: common_vendor.o(($event) => formData.name = $event),
c: common_vendor.p({
placeholder: "请输入检查表名称", placeholder: "请输入检查表名称",
border: "surround", border: "surround",
modelValue: formData.name modelValue: formData.name
}), }),
c: common_vendor.t(formData.deptName || "请选择分派单位"), d: common_vendor.t(formData.deptName || "请选择分派单位"),
d: common_vendor.n(formData.deptName ? "picker-value" : "picker-placeholder"), e: common_vendor.n(formData.deptName ? "picker-value" : "picker-placeholder"),
e: common_vendor.o(openDeptPopup), f: common_vendor.o(openDeptPopup),
f: common_vendor.o(($event) => formData.remark = $event), g: common_vendor.o(($event) => formData.remark = $event),
g: common_vendor.p({ h: common_vendor.p({
placeholder: "请输入补充说明", placeholder: "请输入补充说明",
modelValue: formData.remark modelValue: formData.remark
}), }),
h: common_vendor.t(formData.typeName || "请选择检查表类型"), i: common_vendor.t(formData.typeName || "请选择检查表类型"),
i: common_vendor.n(formData.typeName ? "picker-value" : "picker-placeholder"), j: common_vendor.n(formData.typeName ? "picker-value" : "picker-placeholder"),
j: common_vendor.o(($event) => showTypePicker.value = true), k: common_vendor.o(($event) => showTypePicker.value = true),
k: common_vendor.o(onTypeConfirm), l: common_vendor.o(onTypeConfirm),
l: common_vendor.o(($event) => showTypePicker.value = false),
m: common_vendor.o(($event) => showTypePicker.value = false), m: common_vendor.o(($event) => showTypePicker.value = false),
n: common_vendor.p({ n: common_vendor.o(($event) => showTypePicker.value = false),
o: common_vendor.p({
show: showTypePicker.value, show: showTypePicker.value,
columns: typeColumns.value columns: typeColumns.value
}), }),
o: common_vendor.t(formData.modeName || "请选择模式"), p: common_vendor.t(formData.modeName || "请选择模式"),
p: common_vendor.n(formData.modeName ? "picker-value" : "picker-placeholder"), q: common_vendor.n(formData.modeName ? "picker-value" : "picker-placeholder"),
q: common_vendor.o(($event) => showModePicker.value = true), r: common_vendor.o(($event) => showModePicker.value = true),
r: common_vendor.o(onModeConfirm), s: common_vendor.o(onModeConfirm),
s: common_vendor.o(($event) => showModePicker.value = false),
t: common_vendor.o(($event) => showModePicker.value = false), t: common_vendor.o(($event) => showModePicker.value = false),
v: common_vendor.p({ v: common_vendor.o(($event) => showModePicker.value = false),
w: common_vendor.p({
show: showModePicker.value, show: showModePicker.value,
columns: modeColumns.value columns: modeColumns.value
}), }),
w: formData.modeName === "单人完成" x: formData.runMode === 1 || formData.runMode === 4
}, formData.modeName === "单人完成" ? { }, formData.runMode === 1 || formData.runMode === 4 ? {
x: common_vendor.t(formData.executorNames || (formData.deptId ? "请选择执行人员" : "请先选择分派单位")), y: common_vendor.t(formData.executorNames || (formData.deptId ? "请选择执行人员" : "请先选择分派单位")),
y: common_vendor.n(formData.executorNames ? "picker-value" : "picker-placeholder"), z: common_vendor.n(formData.executorNames ? "picker-value" : "picker-placeholder"),
z: common_vendor.o(openExecutorPopup) A: common_vendor.o(openExecutorPopup)
} : {}, { } : {}, {
A: common_vendor.t(formData.cycleName || "请选择周期"), B: common_vendor.t(formData.cycleName || "请选择周期"),
B: common_vendor.n(formData.cycleName ? "picker-value" : "picker-placeholder"), C: common_vendor.n(formData.cycleName ? "picker-value" : "picker-placeholder"),
C: common_vendor.o(($event) => showCyclePicker.value = true), D: common_vendor.o(($event) => showCyclePicker.value = true),
D: common_vendor.o(onCycleConfirm), E: common_vendor.o(onCycleConfirm),
E: common_vendor.o(($event) => showCyclePicker.value = false),
F: common_vendor.o(($event) => showCyclePicker.value = false), F: common_vendor.o(($event) => showCyclePicker.value = false),
G: common_vendor.p({ G: common_vendor.o(($event) => showCyclePicker.value = false),
H: common_vendor.p({
show: showCyclePicker.value, show: showCyclePicker.value,
columns: cycleColumns.value columns: cycleColumns.value
}), }),
H: formData.isWeekend === 1 ? 1 : "", I: formData.isWeekend === 1 ? 1 : "",
I: common_vendor.o(($event) => setIsWeekend(1)), J: common_vendor.o(($event) => setIsWeekend(1)),
J: formData.isWeekend === 2 ? 1 : "", K: formData.isWeekend === 2 ? 1 : "",
K: common_vendor.o(($event) => setIsWeekend(2)), L: common_vendor.o(($event) => setIsWeekend(2)),
L: common_vendor.t(formData.startDate || "请选择计划开始日期"), M: common_vendor.t(formData.startDate || "请选择计划开始日期"),
M: common_vendor.n(formData.startDate ? "picker-value" : "picker-placeholder"), N: common_vendor.n(formData.startDate ? "picker-value" : "picker-placeholder"),
N: common_vendor.o(openStartDatePicker), O: common_vendor.o(openStartDatePicker),
O: common_vendor.o(onStartDatePickerChange), P: common_vendor.o(onStartDatePickerChange),
P: common_vendor.o(onStartDateConfirm), Q: common_vendor.o(onStartDateConfirm),
Q: common_vendor.o(($event) => showStartDatePicker.value = false),
R: common_vendor.o(($event) => showStartDatePicker.value = false), R: common_vendor.o(($event) => showStartDatePicker.value = false),
S: common_vendor.o(($event) => startDateValue.value = $event), S: common_vendor.o(($event) => showStartDatePicker.value = false),
T: common_vendor.p({ T: common_vendor.o(($event) => startDateValue.value = $event),
U: common_vendor.p({
show: showStartDatePicker.value, show: showStartDatePicker.value,
mode: "date", mode: "date",
minDate: todayMinDate.value, minDate: todayMinDate.value,
filter: startDateFilter.value, filter: startDateFilter.value,
modelValue: startDateValue.value modelValue: startDateValue.value
}), }),
U: common_vendor.t(formData.endDate || "请选择计划结束日期"), V: common_vendor.t(formData.endDate || "请选择计划结束日期"),
V: common_vendor.n(formData.endDate ? "picker-value" : "picker-placeholder"), W: common_vendor.n(formData.endDate ? "picker-value" : "picker-placeholder"),
W: common_vendor.o(openEndDatePicker), X: common_vendor.o(openEndDatePicker),
X: common_vendor.o(onEndDatePickerChange), Y: common_vendor.o(onEndDatePickerChange),
Y: common_vendor.o(onEndDateConfirm), Z: common_vendor.o(onEndDateConfirm),
Z: common_vendor.o(($event) => showEndDatePicker.value = false),
aa: common_vendor.o(($event) => showEndDatePicker.value = false), aa: common_vendor.o(($event) => showEndDatePicker.value = false),
ab: common_vendor.o(($event) => endDateValue.value = $event), ab: common_vendor.o(($event) => showEndDatePicker.value = false),
ac: common_vendor.p({ ac: common_vendor.o(($event) => endDateValue.value = $event),
ad: common_vendor.p({
show: showEndDatePicker.value, show: showEndDatePicker.value,
mode: "date", mode: "date",
minDate: endDateMinDate.value, minDate: endDateMinDate.value,
filter: endDateFilter.value, filter: endDateFilter.value,
modelValue: endDateValue.value modelValue: endDateValue.value
}), }),
ad: common_vendor.t(checkItemCount.value), ae: common_vendor.t(checkItemCount.value),
ae: checkItemCount.value === 0 af: checkItemCount.value === 0
}, checkItemCount.value === 0 ? {} : {}, { }, checkItemCount.value === 0 ? {} : {}, {
af: common_vendor.f(manualCheckItems.value, (item, index, i0) => { ag: common_vendor.f(manualCheckItems.value, (item, index, i0) => {
return { return {
a: common_vendor.t(index + 1), a: common_vendor.t(index + 1),
b: common_vendor.t(item.name), b: common_vendor.t(item.name),
@@ -926,7 +1052,7 @@ const _sfc_main = {
f: "manual-" + index f: "manual-" + index
}; };
}), }),
ag: common_vendor.f(libraryCheckItems.value, (item, index, i0) => { ah: common_vendor.f(libraryCheckItems.value, (item, index, i0) => {
return { return {
a: common_vendor.t(item.sourceLibraryName || "-"), a: common_vendor.t(item.sourceLibraryName || "-"),
b: common_vendor.t(item.name), b: common_vendor.t(item.name),
@@ -936,41 +1062,87 @@ const _sfc_main = {
f: "lib-" + item.pointId f: "lib-" + item.pointId
}; };
}), }),
ah: common_vendor.o(($event) => showAddPopup.value = true), ai: common_vendor.o(($event) => showAddPopup.value = true),
ai: common_vendor.o(openLibraryPopup), aj: common_vendor.o(openLibraryPopup),
aj: common_vendor.o(handleSave), ak: common_vendor.o(handleSave),
ak: common_vendor.o(($event) => showAddPopup.value = false), al: common_vendor.o(($event) => showAddPopup.value = false),
al: common_vendor.o(($event) => checkForm.name = $event), am: showFullForm.value
am: common_vendor.p({ }, showFullForm.value ? {
an: common_vendor.t(checkForm.industryName || "请选择行业类型"),
ao: common_vendor.n(checkForm.industryName ? "" : "text-gray"),
ap: common_vendor.o(($event) => showIndustryPicker.value = true),
aq: common_vendor.o(onIndustryConfirm),
ar: common_vendor.o(($event) => showIndustryPicker.value = false),
as: common_vendor.o(($event) => showIndustryPicker.value = false),
at: common_vendor.p({
show: showIndustryPicker.value,
columns: industryColumns.value
})
} : {}, {
av: common_vendor.o(($event) => checkForm.name = $event),
aw: common_vendor.p({
placeholder: "请输入检查名称", placeholder: "请输入检查名称",
border: "surround", border: "surround",
modelValue: checkForm.name modelValue: checkForm.name
}), }),
an: common_vendor.o(($event) => checkForm.point = $event), ax: showFullForm.value
ao: common_vendor.p({ }, showFullForm.value ? {
ay: common_vendor.o(($event) => checkForm.leadDept = $event),
az: common_vendor.p({
placeholder: "请输入牵头部门名称",
border: "surround",
modelValue: checkForm.leadDept
})
} : {}, {
aA: common_vendor.o(($event) => checkForm.point = $event),
aB: common_vendor.p({
placeholder: "请输入检查内容", placeholder: "请输入检查内容",
height: 150, height: 150,
modelValue: checkForm.point modelValue: checkForm.point
}), }),
ap: common_vendor.t(checkForm.regulationName || "选择法规"), aC: showFullForm.value
aq: common_vendor.n(checkForm.regulationName ? "" : "text-gray"), }, showFullForm.value ? {
ar: common_vendor.o(openLawPopup), aD: common_vendor.t(checkForm.regulationName || "选择法规"),
as: common_vendor.o(($event) => showAddPopup.value = false), aE: common_vendor.n(checkForm.regulationName ? "" : "text-gray"),
at: common_vendor.o(handleAddCheck), aF: common_vendor.o(openLawPopup)
av: common_vendor.o(($event) => showAddPopup.value = false), } : {}, {
aw: common_vendor.p({ aG: showFullForm.value
}, showFullForm.value ? {
aH: common_vendor.o(($event) => checkForm.commonProblem = $event),
aI: common_vendor.p({
placeholder: "请输入常见隐患",
height: 120,
modelValue: checkForm.commonProblem
})
} : {}, {
aJ: showFullForm.value
}, showFullForm.value ? {
aK: common_vendor.t(seriousName.value),
aL: common_vendor.o(($event) => showSeriousPicker.value = true),
aM: common_vendor.o(onSeriousConfirm),
aN: common_vendor.o(($event) => showSeriousPicker.value = false),
aO: common_vendor.o(($event) => showSeriousPicker.value = false),
aP: common_vendor.p({
show: showSeriousPicker.value,
columns: seriousColumns.value
})
} : {}, {
aQ: common_vendor.o(($event) => showAddPopup.value = false),
aR: common_vendor.o(handleAddCheck),
aS: common_vendor.o(($event) => showAddPopup.value = false),
aT: common_vendor.p({
show: showAddPopup.value, show: showAddPopup.value,
mode: "center", mode: "center",
round: "20" round: "20"
}), }),
ax: common_vendor.o(($event) => showLawPopup.value = false), aU: common_vendor.o(($event) => showLawPopup.value = false),
ay: common_vendor.o(searchRegulation), aV: common_vendor.o(searchRegulation),
az: lawKeyword.value, aW: lawKeyword.value,
aA: common_vendor.o(($event) => lawKeyword.value = $event.detail.value), aX: common_vendor.o(($event) => lawKeyword.value = $event.detail.value),
aB: common_vendor.o(searchRegulation), aY: common_vendor.o(searchRegulation),
aC: lawLoading.value && lawList.value.length === 0 aZ: lawLoading.value && lawList.value.length === 0
}, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({ }, lawLoading.value && lawList.value.length === 0 ? {} : !lawLoading.value && lawList.value.length === 0 ? {} : common_vendor.e({
aE: common_vendor.f(lawList.value, (item, k0, i0) => { bb: common_vendor.f(lawList.value, (item, k0, i0) => {
return { return {
a: common_vendor.t(item.depict), a: common_vendor.t(item.depict),
b: common_vendor.t(item.legalBasis), b: common_vendor.t(item.legalBasis),
@@ -979,26 +1151,26 @@ const _sfc_main = {
e: common_vendor.o(($event) => selectLaw(item), item.id) e: common_vendor.o(($event) => selectLaw(item), item.id)
}; };
}), }),
aF: lawLoading.value bc: lawLoading.value
}, lawLoading.value ? {} : {}), { }, lawLoading.value ? {} : {}), {
aD: !lawLoading.value && lawList.value.length === 0, ba: !lawLoading.value && lawList.value.length === 0,
aG: common_vendor.o(loadMoreLaw), bd: common_vendor.o(loadMoreLaw),
aH: common_vendor.o(($event) => showLawPopup.value = false), be: common_vendor.o(($event) => showLawPopup.value = false),
aI: common_vendor.o(confirmLaw), bf: common_vendor.o(confirmLaw),
aJ: common_vendor.o(($event) => showLawPopup.value = false), bg: common_vendor.o(($event) => showLawPopup.value = false),
aK: common_vendor.p({ bh: common_vendor.p({
show: showLawPopup.value, show: showLawPopup.value,
mode: "center", mode: "center",
round: "20" round: "20"
}), }),
aL: common_vendor.o(closeLibraryPopup), bi: common_vendor.o(closeLibraryPopup),
aM: common_vendor.o(searchLibrary), bj: common_vendor.o(searchLibrary),
aN: libraryKeyword.value, bk: libraryKeyword.value,
aO: common_vendor.o(($event) => libraryKeyword.value = $event.detail.value), bl: common_vendor.o(($event) => libraryKeyword.value = $event.detail.value),
aP: common_vendor.o(searchLibrary), bm: common_vendor.o(searchLibrary),
aQ: libraryLoading.value && libraryList.value.length === 0 bn: libraryLoading.value && libraryList.value.length === 0
}, libraryLoading.value && libraryList.value.length === 0 ? {} : !libraryLoading.value && libraryList.value.length === 0 ? {} : common_vendor.e({ }, libraryLoading.value && libraryList.value.length === 0 ? {} : !libraryLoading.value && libraryList.value.length === 0 ? {} : common_vendor.e({
aS: common_vendor.f(libraryList.value, (item, k0, i0) => { bp: common_vendor.f(libraryList.value, (item, k0, i0) => {
return common_vendor.e({ return common_vendor.e({
a: selectedLibraries.value.includes(item.id) a: selectedLibraries.value.includes(item.id)
}, selectedLibraries.value.includes(item.id) ? {} : {}, { }, selectedLibraries.value.includes(item.id) ? {} : {}, {
@@ -1009,28 +1181,28 @@ const _sfc_main = {
f: common_vendor.o(($event) => toggleLibrarySelect(item), item.id) f: common_vendor.o(($event) => toggleLibrarySelect(item), item.id)
}); });
}), }),
aT: libraryLoading.value bq: libraryLoading.value
}, libraryLoading.value ? {} : {}), { }, libraryLoading.value ? {} : {}), {
aR: !libraryLoading.value && libraryList.value.length === 0, bo: !libraryLoading.value && libraryList.value.length === 0,
aU: common_vendor.o(loadMoreLibrary), br: common_vendor.o(loadMoreLibrary),
aV: common_vendor.o(addSelectedLibrary), bs: common_vendor.o(addSelectedLibrary),
aW: common_vendor.o(closeLibraryPopup), bt: common_vendor.o(closeLibraryPopup),
aX: common_vendor.p({ bv: common_vendor.p({
show: showLibraryPopup.value, show: showLibraryPopup.value,
mode: "center", mode: "center",
round: "20" round: "20"
}), }),
aY: common_vendor.o(cancelDeptSelect), bw: common_vendor.o(cancelDeptSelect),
aZ: showDeptPicker.value bx: showDeptPicker.value
}, showDeptPicker.value ? common_vendor.e({ }, showDeptPicker.value ? common_vendor.e({
ba: deptTree.value.length by: deptTree.value.length
}, deptTree.value.length ? { }, deptTree.value.length ? {
bb: common_vendor.sr(deptTreeRef, "98282eb3-13,98282eb3-12", { bz: common_vendor.sr(deptTreeRef, "98282eb3-17,98282eb3-16", {
"k": "deptTreeRef" "k": "deptTreeRef"
}), }),
bc: common_vendor.o(onDeptCheck), bA: common_vendor.o(onDeptCheck),
bd: common_vendor.o(onDeptNodeClick), bB: common_vendor.o(onDeptNodeClick),
be: common_vendor.p({ bC: common_vendor.p({
data: deptTree.value, data: deptTree.value,
["node-key"]: "deptId", ["node-key"]: "deptId",
["label-key"]: "deptName", ["label-key"]: "deptName",
@@ -1044,38 +1216,43 @@ const _sfc_main = {
["empty-text"]: "暂无部门数据" ["empty-text"]: "暂无部门数据"
}) })
} : {}) : {}, { } : {}) : {}, {
bf: common_vendor.o(cancelDeptSelect), bD: common_vendor.o(cancelDeptSelect),
bg: common_vendor.o(confirmDeptSelect), bE: common_vendor.o(confirmDeptSelect),
bh: common_vendor.o(cancelDeptSelect), bF: common_vendor.o(cancelDeptSelect),
bi: common_vendor.p({ bG: common_vendor.p({
show: showDeptPicker.value, show: showDeptPicker.value,
mode: "center", mode: "center",
round: "20", round: "20",
safeAreaInsetBottom: false safeAreaInsetBottom: false
}), }),
bj: common_vendor.o(($event) => showExecutorPopup.value = false), bH: common_vendor.o(($event) => showExecutorPopup.value = false),
bk: executorList.value.length === 0 bI: executorList.value.length === 0
}, executorList.value.length === 0 ? {} : { }, executorList.value.length === 0 ? {} : {
bl: common_vendor.f(executorList.value, (item, k0, i0) => { bJ: common_vendor.f(executorList.value, (item, k0, i0) => {
return common_vendor.e({ return common_vendor.e(formData.runMode === 4 ? common_vendor.e({
a: selectedExecutorId.value === item.userId a: selectedRosterIdentityIds.value.includes(item.identityId)
}, selectedRosterIdentityIds.value.includes(item.identityId) ? {} : {}, {
b: selectedRosterIdentityIds.value.includes(item.identityId) ? 1 : ""
}) : common_vendor.e({
c: selectedExecutorId.value === item.userId
}, selectedExecutorId.value === item.userId ? {} : {}, { }, selectedExecutorId.value === item.userId ? {} : {}, {
b: selectedExecutorId.value === item.userId ? 1 : "", d: selectedExecutorId.value === item.userId ? 1 : ""
c: common_vendor.t(item.nickName), }), {
d: item.userId, e: common_vendor.t(item.nickName),
e: common_vendor.o(($event) => selectExecutor(item), item.userId) f: item.identityId || item.userId,
g: common_vendor.o(($event) => formData.runMode === 4 ? toggleRosterExecutor(item) : selectExecutor(item), item.identityId || item.userId)
}); });
}) }),
bK: formData.runMode === 4
}, { }, {
bm: common_vendor.o(($event) => showExecutorPopup.value = false), bL: common_vendor.o(($event) => showExecutorPopup.value = false),
bn: common_vendor.o(confirmExecutorSelect), bM: common_vendor.o(confirmExecutorSelect),
bo: common_vendor.o(($event) => showExecutorPopup.value = false), bN: common_vendor.o(($event) => showExecutorPopup.value = false),
bp: common_vendor.p({ bO: common_vendor.p({
show: showExecutorPopup.value, show: showExecutorPopup.value,
mode: "center", mode: "center",
round: "20" round: "20"
}), })
bq: common_vendor.gei(_ctx, "")
}); });
}; };
} }

File diff suppressed because one or more lines are too long

View File

@@ -490,6 +490,23 @@
border-radius: 50%; border-radius: 50%;
background: #2667E9; background: #2667E9;
} }
.executor-checkbox.data-v-98282eb3 {
width: 40rpx;
height: 40rpx;
border: 2rpx solid #ccc;
border-radius: 8rpx;
margin-right: 20rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
font-size: 24rpx;
}
.executor-checkbox-active.data-v-98282eb3 {
background: #2667E9;
border-color: #2667E9;
color: #fff;
}
.executor-info.data-v-98282eb3 { .executor-info.data-v-98282eb3 {
flex: 1; flex: 1;
} }

View File

@@ -19,14 +19,15 @@ const _sfc_main = {
const checkPointId = common_vendor.ref(""); const checkPointId = common_vendor.ref("");
const oneTableId = common_vendor.ref(""); const oneTableId = common_vendor.ref("");
const userRole = common_vendor.ref(""); const userRole = common_vendor.ref("");
const isApprovalRole = common_vendor.computed(() => userRole.value === "approval");
const getUserRole = () => { const getUserRole = () => {
try { try {
const userInfoStr = common_vendor.index.getStorageSync("userInfo"); const userInfoStr = common_vendor.index.getStorageSync("userInfo");
if (userInfoStr) { if (userInfoStr) {
userRole.value = utils_userInfo.resolveUserRoleKey(JSON.parse(userInfoStr)); userRole.value = utils_userInfo.resolveUserIdentityRoleKey(JSON.parse(userInfoStr));
} }
} catch (error) { } catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:104", "获取用户信息失败:", error); common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:107", "获取用户信息失败:", error);
} }
}; };
const fetchTaskInfo = async (oneTableId2) => { const fetchTaskInfo = async (oneTableId2) => {
@@ -41,7 +42,7 @@ const _sfc_main = {
} }
} }
} catch (error) { } catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:120", "获取任务信息失败:", error); common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:123", "获取任务信息失败:", error);
} }
}; };
common_vendor.onLoad((options) => { common_vendor.onLoad((options) => {
@@ -123,7 +124,7 @@ const _sfc_main = {
}); });
} }
} catch (error) { } catch (error) {
common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:207", error); common_vendor.index.__f__("error", "at pages/hiddendanger/Inspection.vue:210", error);
if (pageNum.value > 1) { if (pageNum.value > 1) {
pageNum.value--; pageNum.value--;
} }
@@ -214,7 +215,8 @@ const _sfc_main = {
f: item.levelName === "重大隐患" ? 1 : "", f: item.levelName === "重大隐患" ? 1 : "",
g: common_vendor.t(item.address), g: common_vendor.t(item.address),
h: common_vendor.t(item.createdAt), h: common_vendor.t(item.createdAt),
i: common_vendor.o(($event) => details(item), item.hazardId), i: common_vendor.o(($event) => details(item), item.hazardId)
}, !isApprovalRole.value ? common_vendor.e({
j: item.statusName === "待整改" && item.canEdit j: item.statusName === "待整改" && item.canEdit
}, item.statusName === "待整改" && item.canEdit ? { }, item.statusName === "待整改" && item.canEdit ? {
k: common_vendor.o(($event) => assignHazard(item), item.hazardId) k: common_vendor.o(($event) => assignHazard(item), item.hazardId)
@@ -242,18 +244,22 @@ const _sfc_main = {
w: common_vendor.unref(utils_hazardNav.canShowWriteoffApprovalButton)(item, userRole.value) w: common_vendor.unref(utils_hazardNav.canShowWriteoffApprovalButton)(item, userRole.value)
}, common_vendor.unref(utils_hazardNav.canShowWriteoffApprovalButton)(item, userRole.value) ? { }, common_vendor.unref(utils_hazardNav.canShowWriteoffApprovalButton)(item, userRole.value) ? {
x: common_vendor.o(($event) => goWriteoffApproval(item), item.hazardId) x: common_vendor.o(($event) => goWriteoffApproval(item), item.hazardId)
} : {}, { } : {}) : {}, {
y: item.hazardId y: item.hazardId
}); });
}), }),
d: hiddenDangerList.value.length > 0 d: !isApprovalRole.value,
e: hiddenDangerList.value.length > 0
}, hiddenDangerList.value.length > 0 ? { }, hiddenDangerList.value.length > 0 ? {
e: common_vendor.p({ f: common_vendor.p({
status: loadStatus.value status: loadStatus.value
}) })
} : {}, { } : {}, {
f: common_vendor.o(goToAdd), g: !isApprovalRole.value
g: common_vendor.gei(_ctx, "") }, !isApprovalRole.value ? {
h: common_vendor.o(goToAdd)
} : {}, {
i: common_vendor.gei(_ctx, "")
}); });
}; };
} }

View File

@@ -1 +1 @@
<view class="{{['page', 'padding', 'data-v-b44c631d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{g}}"><scroll-view class="status-tabs data-v-b44c631d" scroll-x show-scrollbar="{{false}}"><view class="status-tabs-inner data-v-b44c631d"><view wx:for="{{a}}" wx:for-item="tab" wx:key="c" class="{{['status-tab-item', 'data-v-b44c631d', tab.d && 'status-tab-active']}}" bindtap="{{tab.e}}"><text class="status-tab-text data-v-b44c631d">{{tab.a}}</text><view wx:if="{{tab.b}}" class="status-tab-bar data-v-b44c631d"></view></view></view></scroll-view><view wx:if="{{b}}" class="empty-tip text-gray text-center padding data-v-b44c631d">暂无数据</view><view wx:for="{{c}}" wx:for-item="item" wx:key="y" class="padding radius bg-white list-list margin-bottom data-v-b44c631d"><view class="flex justify-between margin-bottom data-v-b44c631d"><view class="text-bold text-black data-v-b44c631d" style="word-break:break-all;flex:1">{{item.a}}</view><view class="text-blue data-v-b44c631d" style="white-space:nowrap;flex-shrink:0;margin-left:16rpx">{{item.b}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d">隐患等级:</view><view class="{{['level-tag', 'data-v-b44c631d', item.d && 'level-minor', item.e && 'level-normal', item.f && 'level-major']}}">{{item.c}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d" style="white-space:nowrap">隐患位置:</view><view class="text-black data-v-b44c631d">{{item.g}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d">创建时间:</view><view class="text-black data-v-b44c631d">{{item.h}}</view></view><view class="flex justify-end card-actions data-v-b44c631d" style="gap:10rpx"><button class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.i}}">查看详情</button><button wx:if="{{item.j}}" class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.k}}">隐患交办</button><button wx:if="{{item.l}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.m}}">立即整改</button><button wx:if="{{item.n}}" class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.o}}">编辑整改信息</button><button wx:if="{{item.p}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.q}}">立即验收</button><button wx:if="{{item.r}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.s}}">隐患交办</button><button wx:if="{{item.t}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.v}}">销号申请</button><button wx:if="{{item.w}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.x}}">销号审批</button></view></view><u-loadmore wx:if="{{d}}" class="data-v-b44c631d" virtualHostClass="data-v-b44c631d" style="margin-top:20rpx;margin-bottom:140rpx" virtualHostStyle="margin-top:20rpx;margin-bottom:140rpx" u-i="b44c631d-0" bind:__l="__l" u-p="{{e}}"/><view class="fixed-add-btn data-v-b44c631d" bindtap="{{f}}"><text class="cuIcon-add data-v-b44c631d"></text><text class="data-v-b44c631d">新增</text></view></view> <view class="{{['page', 'padding', 'data-v-b44c631d', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{i}}"><scroll-view class="status-tabs data-v-b44c631d" scroll-x show-scrollbar="{{false}}"><view class="status-tabs-inner data-v-b44c631d"><view wx:for="{{a}}" wx:for-item="tab" wx:key="c" class="{{['status-tab-item', 'data-v-b44c631d', tab.d && 'status-tab-active']}}" bindtap="{{tab.e}}"><text class="status-tab-text data-v-b44c631d">{{tab.a}}</text><view wx:if="{{tab.b}}" class="status-tab-bar data-v-b44c631d"></view></view></view></scroll-view><view wx:if="{{b}}" class="empty-tip text-gray text-center padding data-v-b44c631d">暂无数据</view><view wx:for="{{c}}" wx:for-item="item" wx:key="y" class="padding radius bg-white list-list margin-bottom data-v-b44c631d"><view class="flex justify-between margin-bottom data-v-b44c631d"><view class="text-bold text-black data-v-b44c631d" style="word-break:break-all;flex:1">{{item.a}}</view><view class="text-blue data-v-b44c631d" style="white-space:nowrap;flex-shrink:0;margin-left:16rpx">{{item.b}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d">隐患等级:</view><view class="{{['level-tag', 'data-v-b44c631d', item.d && 'level-minor', item.e && 'level-normal', item.f && 'level-major']}}">{{item.c}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d" style="white-space:nowrap">隐患位置:</view><view class="text-black data-v-b44c631d">{{item.g}}</view></view><view class="flex margin-bottom data-v-b44c631d"><view class="text-gray data-v-b44c631d">创建时间:</view><view class="text-black data-v-b44c631d">{{item.h}}</view></view><view class="flex justify-end card-actions data-v-b44c631d" style="gap:10rpx"><button class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.i}}">查看详情</button><block wx:if="{{d}}"><button wx:if="{{item.j}}" class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.k}}">隐患交办</button><button wx:if="{{item.l}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.m}}">立即整改</button><button wx:if="{{item.n}}" class="round cu-btn light bg-blue data-v-b44c631d" bindtap="{{item.o}}">编辑整改信息</button><button wx:if="{{item.p}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.q}}">立即验收</button><button wx:if="{{item.r}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.s}}">隐患交办</button><button wx:if="{{item.t}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.v}}">销号申请</button><button wx:if="{{item.w}}" class="round cu-btn bg-blue data-v-b44c631d" bindtap="{{item.x}}">销号审批</button></block></view></view><u-loadmore wx:if="{{e}}" class="data-v-b44c631d" virtualHostClass="data-v-b44c631d" style="margin-top:20rpx;margin-bottom:140rpx" virtualHostStyle="margin-top:20rpx;margin-bottom:140rpx" u-i="b44c631d-0" bind:__l="__l" u-p="{{f}}"/><view wx:if="{{g}}" class="fixed-add-btn data-v-b44c631d" bindtap="{{h}}"><text class="cuIcon-add data-v-b44c631d"></text><text class="data-v-b44c631d">新增</text></view></view>

View File

@@ -37,7 +37,7 @@ const _sfc_main = {
identityName: "", identityName: "",
userIdentity: null userIdentity: null
}); });
const currentRoleKey = common_vendor.computed(() => utils_userInfo.resolveUserRoleKey(userInfo)); const currentRoleKey = common_vendor.computed(() => utils_userInfo.resolveUserIdentityRoleKey(userInfo));
const isApprovalRole = common_vendor.computed(() => currentRoleKey.value === "approval"); const isApprovalRole = common_vendor.computed(() => currentRoleKey.value === "approval");
const displayIdentityName = common_vendor.computed(() => { const displayIdentityName = common_vendor.computed(() => {
return utils_userInfo.resolveIdentityName(userInfo, userInfo.userIdentity); return utils_userInfo.resolveIdentityName(userInfo, userInfo.userIdentity);
@@ -105,7 +105,7 @@ const _sfc_main = {
const commonMenuNames = ["隐患排查", "隐患销号"]; const commonMenuNames = ["隐患排查", "隐患销号"];
const infoList = common_vendor.computed(() => { const infoList = common_vendor.computed(() => {
if (currentRoleKey.value === "approval") { if (currentRoleKey.value === "approval") {
return []; return allMenuList.filter((item) => item.name === "隐患排查");
} }
if (currentRoleKey.value === "common") { if (currentRoleKey.value === "common") {
return allMenuList.filter((item) => commonMenuNames.includes(item.name)); return allMenuList.filter((item) => commonMenuNames.includes(item.name));
@@ -492,8 +492,8 @@ const _sfc_main = {
size: "14" size: "14"
}), }),
i: common_vendor.o(goSwitchIdentity), i: common_vendor.o(goSwitchIdentity),
j: !isApprovalRole.value j: infoList.value.length > 0
}, !isApprovalRole.value ? { }, infoList.value.length > 0 ? {
k: common_vendor.f(infoList.value, (item, index, i0) => { k: common_vendor.f(infoList.value, (item, index, i0) => {
return { return {
a: item.src, a: item.src,

View File

@@ -1,7 +1,7 @@
"use strict"; "use strict";
const common_vendor = require("../common/vendor.js"); const common_vendor = require("../common/vendor.js");
const request_luchRequest_core_Request = require("./luch-request/core/Request.js"); const request_luchRequest_core_Request = require("./luch-request/core/Request.js");
const baseUrl = "https://yingji.hexieapi.com/prod-api"; const baseUrl = "http://192.168.1.140:5004";
const imageBaseUrl = baseUrl.replace(/\/prod-api\/?$/, ""); const imageBaseUrl = baseUrl.replace(/\/prod-api\/?$/, "");
new request_luchRequest_core_Request.Request({ new request_luchRequest_core_Request.Request({
baseURL: baseUrl, baseURL: baseUrl,

View File

@@ -278,20 +278,19 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
}, _ctx.safeAreaInsetBottom ? {} : {}, { }, _ctx.safeAreaInsetBottom ? {} : {}, {
p: common_vendor.s($options.contentStyle), p: common_vendor.s($options.contentStyle),
q: common_vendor.o((...args) => _ctx.noop && _ctx.noop(...args)), q: common_vendor.o((...args) => _ctx.noop && _ctx.noop(...args)),
r: common_vendor.o((...args) => _ctx.noop && _ctx.noop(...args)), r: common_vendor.s($options.contentStyleWrap),
s: common_vendor.s($options.contentStyleWrap), s: common_vendor.o($options.afterEnter),
t: common_vendor.o($options.afterEnter), t: common_vendor.o($options.clickHandler),
v: common_vendor.o($options.clickHandler), v: common_vendor.p({
w: common_vendor.p({
show: _ctx.pageInline ? true : _ctx.show, show: _ctx.pageInline ? true : _ctx.show,
customStyle: $options.transitionStyle, customStyle: $options.transitionStyle,
mode: _ctx.pageInline ? "none" : $options.position, mode: _ctx.pageInline ? "none" : $options.position,
duration: _ctx.duration duration: _ctx.duration
}), }),
x: common_vendor.n(_ctx.customClass), w: common_vendor.n(_ctx.customClass),
x: _ctx.show == false ? "0px" : "",
y: _ctx.show == false ? "0px" : "", y: _ctx.show == false ? "0px" : "",
z: _ctx.show == false ? "0px" : "", z: common_vendor.gei(_ctx, "")
A: common_vendor.gei(_ctx, "")
}); });
} }
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-05c24e9b"]]); const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-05c24e9b"]]);

View File

@@ -1 +1 @@
<view class="{{['u-popup', 'data-v-05c24e9b', x, virtualHostClass]}}" style="{{'width:' + y + ';' + ('height:' + z) + ';' + virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{A}}"><view class="u-popup__trigger data-v-05c24e9b"><slot name="trigger"></slot><view bindtap="{{a}}" class="u-popup__trigger__cover data-v-05c24e9b"></view></view><u-overlay wx:if="{{b}}" class="data-v-05c24e9b" virtualHostClass="data-v-05c24e9b" bindclick="{{c}}" u-i="05c24e9b-0" bind:__l="__l" u-p="{{d}}"></u-overlay><u-transition wx:if="{{w}}" u-s="{{['d']}}" class="u-popup__content—transition data-v-05c24e9b" virtualHostClass="u-popup__content—transition data-v-05c24e9b" style="{{s}}" virtualHostStyle="{{s}}" bindafterEnter="{{t}}" bindclick="{{v}}" u-i="05c24e9b-1" bind:__l="__l" u-p="{{w}}"><view class="u-popup__content data-v-05c24e9b" style="{{p}}" catchtap="{{q}}" catchtouchmove="{{r}}"><u-status-bar wx:if="{{e}}" class="data-v-05c24e9b" virtualHostClass="data-v-05c24e9b" u-i="05c24e9b-2,05c24e9b-1" bind:__l="__l"></u-status-bar><view wx:if="{{f}}" class="u-popup__content__touch-area data-v-05c24e9b" bindtouchstart="{{g}}" bindtouchmove="{{h}}" bindtouchend="{{i}}" bindtouchcancel="{{j}}"><view class="u-popup__content__indicator data-v-05c24e9b"></view></view><slot></slot><view wx:if="{{k}}" catchtap="{{m}}" class="{{['u-popup__content__close', 'data-v-05c24e9b', n]}}" hover-class="u-popup__content__close--hover" hover-stay-time="150"><up-icon wx:if="{{l}}" class="data-v-05c24e9b" virtualHostClass="data-v-05c24e9b" u-i="05c24e9b-3,05c24e9b-1" bind:__l="__l" u-p="{{l}}"></up-icon></view><u-safe-bottom wx:if="{{o}}" class="data-v-05c24e9b" virtualHostClass="data-v-05c24e9b" u-i="05c24e9b-4,05c24e9b-1" bind:__l="__l"></u-safe-bottom></view><slot name="bottom"></slot></u-transition></view> <view class="{{['u-popup', 'data-v-05c24e9b', w, virtualHostClass]}}" style="{{'width:' + x + ';' + ('height:' + y) + ';' + virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{z}}"><view class="u-popup__trigger data-v-05c24e9b"><slot name="trigger"></slot><view bindtap="{{a}}" class="u-popup__trigger__cover data-v-05c24e9b"></view></view><u-overlay wx:if="{{b}}" class="data-v-05c24e9b" virtualHostClass="data-v-05c24e9b" bindclick="{{c}}" u-i="05c24e9b-0" bind:__l="__l" u-p="{{d}}"></u-overlay><u-transition wx:if="{{v}}" u-s="{{['d']}}" class="u-popup__content—transition data-v-05c24e9b" virtualHostClass="u-popup__content—transition data-v-05c24e9b" style="{{r}}" virtualHostStyle="{{r}}" bindafterEnter="{{s}}" bindclick="{{t}}" u-i="05c24e9b-1" bind:__l="__l" u-p="{{v}}"><view class="u-popup__content data-v-05c24e9b" style="{{p}}" catchtap="{{q}}"><u-status-bar wx:if="{{e}}" class="data-v-05c24e9b" virtualHostClass="data-v-05c24e9b" u-i="05c24e9b-2,05c24e9b-1" bind:__l="__l"></u-status-bar><view wx:if="{{f}}" class="u-popup__content__touch-area data-v-05c24e9b" bindtouchstart="{{g}}" bindtouchmove="{{h}}" bindtouchend="{{i}}" bindtouchcancel="{{j}}"><view class="u-popup__content__indicator data-v-05c24e9b"></view></view><slot></slot><view wx:if="{{k}}" catchtap="{{m}}" class="{{['u-popup__content__close', 'data-v-05c24e9b', n]}}" hover-class="u-popup__content__close--hover" hover-stay-time="150"><up-icon wx:if="{{l}}" class="data-v-05c24e9b" virtualHostClass="data-v-05c24e9b" u-i="05c24e9b-3,05c24e9b-1" bind:__l="__l" u-p="{{l}}"></up-icon></view><u-safe-bottom wx:if="{{o}}" class="data-v-05c24e9b" virtualHostClass="data-v-05c24e9b" u-i="05c24e9b-4,05c24e9b-1" bind:__l="__l"></u-safe-bottom></view><slot name="bottom"></slot></u-transition></view>

View File

@@ -334,6 +334,18 @@ const _sfc_main = {
} }
__expose({ getCheckedKeys, getCheckedNodes, setCheckedKeys, expandAll, collapseAll, clearChecked, setNodeChecked, checkAll }); __expose({ getCheckedKeys, getCheckedNodes, setCheckedKeys, expandAll, collapseAll, clearChecked, setNodeChecked, checkAll });
updateCheckedState(); updateCheckedState();
const scrollStyle = common_vendor.computed(() => {
const style = {
width: "100%",
boxSizing: "border-box"
};
if (props.height) {
style.height = `${props.height}rpx`;
} else {
style.height = "100%";
}
return style;
});
return (_ctx, _cache) => { return (_ctx, _cache) => {
return common_vendor.e({ return common_vendor.e({
a: flatData.value.length === 0 a: flatData.value.length === 0
@@ -386,9 +398,10 @@ const _sfc_main = {
tag: "view" tag: "view"
}) })
}, { }, {
g: `${__props.width}rpx`, g: __props.width ? `${__props.width}rpx` : void 0,
h: `${__props.height}rpx`, h: __props.height ? `${__props.height}rpx` : void 0,
i: common_vendor.gei(_ctx, "") i: common_vendor.s(scrollStyle.value),
j: common_vendor.gei(_ctx, "")
}); });
}; };
} }

View File

@@ -1 +1 @@
<scroll-view scroll-x scroll-y enable-flex class="{{['tree-wrapper', 'data-v-e21fa87f', virtualHostClass]}}" style="{{virtualHostStyle}}" hidden="{{virtualHostHidden || false}}" id="{{i}}"><view class="xq-tree-scroll data-v-e21fa87f"><view class="xq-tree data-v-e21fa87f" style="{{'min-width:' + g + ';' + ('min-height:' + h)}}"><view wx:if="{{a}}" class="xq-tree-empty data-v-e21fa87f">{{b}}</view><transition-group wx:else u-s="{{['d']}}" class="xq-tree-list data-v-e21fa87f" virtualHostClass="xq-tree-list data-v-e21fa87f" u-i="e21fa87f-0" bind:__l="__l" u-p="{{f||''}}"><view wx:for="{{c}}" wx:for-item="node" wx:key="l" class="{{['xq-tree-node', 'data-v-e21fa87f', node.m]}}" style="{{'padding-left:' + node.n + ';' + ('animation-delay:' + node.o)}}"><view class="xq-tree-node-content data-v-e21fa87f" bindtap="{{node.k}}"><view class="xq-tree-node-icon data-v-e21fa87f" catchtap="{{node.c}}"><text wx:if="{{node.a}}" class="{{['icon-arrow', 'data-v-e21fa87f', node.b && 'is-expanded']}}"> ▶ </text><view wx:else class="leaf-icon-placeholder data-v-e21fa87f"></view></view><view wx:if="{{d}}" class="xq-tree-node-checkbox data-v-e21fa87f" catchtap="{{node.g}}"><view class="{{['checkbox-custom', 'data-v-e21fa87f', node.f]}}"><text wx:if="{{node.d}}" class="data-v-e21fa87f"> ✓ </text><text wx:elif="{{node.e}}" class="data-v-e21fa87f"> — </text></view></view><slot wx:if="{{e}}" name="{{node.h}}"/><text wx:else class="xq-tree-node-label data-v-e21fa87f">{{node.j}}</text></view></view></transition-group></view></view></scroll-view> <scroll-view scroll-x scroll-y enable-flex style="{{i + ';' + virtualHostStyle}}" class="{{['tree-wrapper', 'data-v-e21fa87f', virtualHostClass]}}" hidden="{{virtualHostHidden || false}}" id="{{j}}"><view class="xq-tree-scroll data-v-e21fa87f"><view class="xq-tree data-v-e21fa87f" style="{{'min-width:' + g + ';' + ('min-height:' + h)}}"><view wx:if="{{a}}" class="xq-tree-empty data-v-e21fa87f">{{b}}</view><transition-group wx:else u-s="{{['d']}}" class="xq-tree-list data-v-e21fa87f" virtualHostClass="xq-tree-list data-v-e21fa87f" u-i="e21fa87f-0" bind:__l="__l" u-p="{{f||''}}"><view wx:for="{{c}}" wx:for-item="node" wx:key="l" class="{{['xq-tree-node', 'data-v-e21fa87f', node.m]}}" style="{{'padding-left:' + node.n + ';' + ('animation-delay:' + node.o)}}"><view class="xq-tree-node-content data-v-e21fa87f" bindtap="{{node.k}}"><view class="xq-tree-node-icon data-v-e21fa87f" catchtap="{{node.c}}"><view wx:if="{{node.a}}" class="{{['icon-arrow', 'data-v-e21fa87f', node.b && 'is-expanded']}}"/><view wx:else class="leaf-icon-placeholder data-v-e21fa87f"></view></view><view wx:if="{{d}}" class="xq-tree-node-checkbox data-v-e21fa87f" catchtap="{{node.g}}"><view class="{{['checkbox-custom', 'data-v-e21fa87f', node.f]}}"><text wx:if="{{node.d}}" class="data-v-e21fa87f"> ✓ </text><text wx:elif="{{node.e}}" class="data-v-e21fa87f"> — </text></view></view><slot wx:if="{{e}}" name="{{node.h}}"/><text wx:else class="xq-tree-node-label data-v-e21fa87f">{{node.j}}</text></view></view></transition-group></view></view></scroll-view>

View File

@@ -26,45 +26,23 @@
/* 文章场景相关 */ /* 文章场景相关 */
.xq-tree.data-v-e21fa87f { .xq-tree.data-v-e21fa87f {
display: inline-block; display: inline-block;
/* ⚠️ 关键:宽度由内容撑开,不继承父容器宽度 */
/* 内容不换行 */
/* 至少撑满容器 */
box-sizing: border-box; box-sizing: border-box;
width: -webkit-max-content; width: -webkit-max-content;
width: max-content; width: max-content;
/* 宽度由内容决定,不换行 */
white-space: nowrap; white-space: nowrap;
} }
.tree-wrapper.data-v-e21fa87f { .tree-wrapper.data-v-e21fa87f {
width: 100%; width: 100%;
height: 100%; box-sizing: border-box;
/* 确保节点不换行 */
} }
.xq-tree-scroll.data-v-e21fa87f { .xq-tree-scroll.data-v-e21fa87f {
display: inline-block; display: inline-block;
/* ⚠️ 关键:宽度由内容撑开,不继承父容器宽度 */
white-space: nowrap; white-space: nowrap;
/* 内容不换行 */
min-width: 100%; min-width: 100%;
/* 至少撑满容器 */
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
padding: 16rpx; padding: 16rpx;
} }
/* 小程序下 scroll-view 的滚动条样式由原生控制通常无法自定义H5 端同样可用 ::-webkit-scrollbar */
/* 下面的样式仅对 H5 端生效 */
.tree-wrapper.data-v-e21fa87f::-webkit-scrollbar {
height: 8rpx;
width: 8rpx;
}
.tree-wrapper.data-v-e21fa87f::-webkit-scrollbar-track {
background: #f1f1f1;
}
.tree-wrapper.data-v-e21fa87f::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4rpx;
}
.tree-node-enter-active.data-v-e21fa87f { .tree-node-enter-active.data-v-e21fa87f {
animation: treeExpandIn-e21fa87f 0.3s ease-out both; animation: treeExpandIn-e21fa87f 0.3s ease-out both;
} }
@@ -108,36 +86,47 @@
} }
.xq-tree-node.data-v-e21fa87f { .xq-tree-node.data-v-e21fa87f {
padding: 8rpx 0; padding: 8rpx 0;
overflow: hidden;
transform-origin: top; transform-origin: top;
} }
.xq-tree.data-v-e21fa87f {
width: 100%;
}
.xq-tree-empty.data-v-e21fa87f { .xq-tree-empty.data-v-e21fa87f {
padding: 40rpx; padding: 40rpx;
text-align: center; text-align: center;
color: #999; color: #999;
} }
.xq-tree-node.data-v-e21fa87f {
padding: 8rpx 0;
}
.xq-tree-node-content.data-v-e21fa87f { .xq-tree-node-content.data-v-e21fa87f {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.xq-tree-node-icon.data-v-e21fa87f { .xq-tree-node-icon.data-v-e21fa87f {
width: 40rpx; width: 40rpx;
text-align: center; height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0; flex-shrink: 0;
} }
.icon-arrow.data-v-e21fa87f {
width: 0;
height: 0;
border-top: 8rpx solid transparent;
border-bottom: 8rpx solid transparent;
border-left: 10rpx solid #666;
transition: transform 0.2s ease;
transform-origin: 30% 50%;
}
.icon-arrow.is-expanded.data-v-e21fa87f {
transform: rotate(90deg);
}
.xq-tree-node-checkbox.data-v-e21fa87f { .xq-tree-node-checkbox.data-v-e21fa87f {
margin-right: 12rpx; margin-right: 12rpx;
flex-shrink: 0; flex-shrink: 0;
} }
.xq-tree-node-label.data-v-e21fa87f { .xq-tree-node-label.data-v-e21fa87f {
flex: 1; flex-shrink: 0;
white-space: nowrap; white-space: nowrap;
font-size: 28rpx;
color: #333;
line-height: 1.5;
} }
.checkbox-custom.data-v-e21fa87f { .checkbox-custom.data-v-e21fa87f {
width: 32rpx; width: 32rpx;
@@ -159,22 +148,8 @@
color: #fff; color: #fff;
} }
.leaf-icon-placeholder.data-v-e21fa87f { .leaf-icon-placeholder.data-v-e21fa87f {
width: 100%; width: 16rpx;
height: 100%; height: 16rpx;
}
.uni-icon-warp.data-v-e21fa87f {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40rpx;
height: 40rpx;
}
.icon-arrow.is-expanded.data-v-e21fa87f {
transform: rotate(90deg);
}
.icon-arrow.data-v-e21fa87f {
display: inline-block;
transition: transform 0.3s ease;
} }
page.data-v-e21fa87f { page.data-v-e21fa87f {
box-sizing: border-box; box-sizing: border-box;

View File

@@ -35,6 +35,12 @@ function resolveRoleKey(roles, fallback = "") {
return normalizeRoleKey(first); return normalizeRoleKey(first);
return normalizeRoleKey(first.roleKey || first.role || fallback); return normalizeRoleKey(first.roleKey || first.role || fallback);
} }
function resolveUserIdentityRoleKey(userInfo) {
if (!userInfo)
return "";
const identity = normalizeUserIdentity(userInfo.userIdentity);
return normalizeRoleKey(identity == null ? void 0 : identity.roleKey);
}
function resolveUserRoleKey(userInfo) { function resolveUserRoleKey(userInfo) {
if (!userInfo) if (!userInfo)
return ""; return "";
@@ -134,7 +140,8 @@ function applyStoredUserInfo(target, stored) {
} }
exports.applyProfileToUserInfo = applyProfileToUserInfo; exports.applyProfileToUserInfo = applyProfileToUserInfo;
exports.applyStoredUserInfo = applyStoredUserInfo; exports.applyStoredUserInfo = applyStoredUserInfo;
exports.getCurrentIdentityFromStorage = getCurrentIdentityFromStorage;
exports.resolveIdentityName = resolveIdentityName; exports.resolveIdentityName = resolveIdentityName;
exports.resolveUserRoleKey = resolveUserRoleKey; exports.resolveUserIdentityRoleKey = resolveUserIdentityRoleKey;
exports.saveUserInfoToStorage = saveUserInfoToStorage; exports.saveUserInfoToStorage = saveUserInfoToStorage;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/userInfo.js.map //# sourceMappingURL=../../.sourcemap/mp-weixin/utils/userInfo.js.map

View File

@@ -36,6 +36,13 @@ function resolveRoleKey(roles, fallback = '') {
return normalizeRoleKey(first.roleKey || first.role || fallback); return normalizeRoleKey(first.roleKey || first.role || fallback);
} }
/** 从 userInfo 中读取当前身份 roleKey仅取 userIdentity.roleKey */
export function resolveUserIdentityRoleKey(userInfo) {
if (!userInfo) return '';
const identity = normalizeUserIdentity(userInfo.userIdentity);
return normalizeRoleKey(identity?.roleKey);
}
/** 解析用于权限判断的角色标识,优先当前身份 roleKey */ /** 解析用于权限判断的角色标识,优先当前身份 roleKey */
export function resolveUserRoleKey(userInfo) { export function resolveUserRoleKey(userInfo) {
if (!userInfo) return ''; if (!userInfo) return '';