This commit is contained in:
sjl
2025-01-14 15:14:37 +08:00
parent 26cda335c5
commit 23b2974597
7 changed files with 55 additions and 28 deletions

View File

@@ -19,6 +19,6 @@ VITE_API_URL=/api
# 开发环境跨域代理,支持配置多个 # 开发环境跨域代理,支持配置多个
VITE_PROXY=[["/api","http://192.168.1.121:18092/"]] VITE_PROXY=[["/api","http://192.168.1.124:18092/"]]
#VITE_PROXY=[["/api","http://192.168.1.125:18092/"]] #VITE_PROXY=[["/api","http://192.168.1.125:18092/"]]
# VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文 # VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文

View File

@@ -46,7 +46,6 @@ router.beforeEach(async (to, from, next) => {
const authStore = useAuthStore() const authStore = useAuthStore()
// 1.NProgress 开始 // 1.NProgress 开始
NProgress.start() NProgress.start()
console.log('11111111111111');
// 2.动态设置标题 // 2.动态设置标题
const title = import.meta.env.VITE_GLOB_APP_TITLE const title = import.meta.env.VITE_GLOB_APP_TITLE
document.title = to.meta.title ? `${to.meta.title} - ${title}` : title document.title = to.meta.title ? `${to.meta.title} - ${title}` : title

View File

@@ -241,17 +241,17 @@ watch(webMsgSend,function (newValue,oldValue){
item.devName === newValue.data.devName); item.devName === newValue.data.devName);
if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在 if (firstCoefficientVO) { // 检查 firstCoefficientVO 是否存在
firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4); firstCoefficientVO.aVuData = parseFloat(newValue.data.aVuData).toFixed(4);
firstCoefficientVO.aVuXi = parseFloat(newValue.data.aVuXi).toFixed(4); firstCoefficientVO.aVuXi = parseFloat((newValue.data.aVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4); firstCoefficientVO.bVuData = parseFloat(newValue.data.bVuData).toFixed(4);
firstCoefficientVO.bVuXi = parseFloat(newValue.data.bVuXi).toFixed(4); firstCoefficientVO.bVuXi = parseFloat((newValue.data.bVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4); firstCoefficientVO.cVuData = parseFloat(newValue.data.cVuData).toFixed(4);
firstCoefficientVO.cVuXi = parseFloat(newValue.data.cVuXi).toFixed(4); firstCoefficientVO.cVuXi = parseFloat((newValue.data.cVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4); firstCoefficientVO.aIeData = parseFloat(newValue.data.aIeData).toFixed(4);
firstCoefficientVO.aIeXi = parseFloat(newValue.data.aIeXi).toFixed(4); firstCoefficientVO.aIeXi = parseFloat((newValue.data.aVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4); firstCoefficientVO.bIeData = parseFloat(newValue.data.bIeData).toFixed(4);
firstCoefficientVO.bIeXi = parseFloat(newValue.data.bIeXi).toFixed(4); firstCoefficientVO.bIeXi = parseFloat((newValue.data.bVuXi / 10000).toFixed(4)).toString();
firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4); firstCoefficientVO.cIeData = parseFloat(newValue.data.cIeData).toFixed(4);
firstCoefficientVO.cIeXi = parseFloat(newValue.data.cIeXi).toFixed(4); firstCoefficientVO.cIeXi = parseFloat((newValue.data.cVuXi / 10000).toFixed(4)).toString();
//console.log(newValue.data.devName + '对象:', firstCoefficientVO); //console.log(newValue.data.devName + '对象:', firstCoefficientVO);
activeIndex.value++; activeIndex.value++;
} else { } else {

View File

@@ -451,6 +451,13 @@ const getTableList = async (params: any) => {
'reportState': form.value.checkReportStatus, 'reportState': form.value.checkReportStatus,
'name':form.value.search 'name':form.value.search
}); });
}else{//点击树根节点,表格显示无数据
return getBoundPqDevList({'planId': '',
'checkStateList': [0],
'checkResult': form.value.checkResult,
'reportState': form.value.checkReportStatus,
'name':form.value.search
});
} }
}; };
@@ -579,9 +586,6 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
}, },
{ prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow}, { prop: 'operation', label: '操作', fixed: 'right', minWidth: 200 ,isShow: operationShow},
]) ])
// 跳转详情页 // 跳转详情页
const toDetail = () => { const toDetail = () => {
router.push( router.push(
@@ -1025,7 +1029,6 @@ const handleTest = async (val:string) => {
}; };
// 打开 drawer(新增、查看、编辑) // 打开 drawer(新增、查看、编辑)
const openDrawer = async (title: string, row: any) => { const openDrawer = async (title: string, row: any) => {
if (title === '查看') if (title === '查看')
@@ -1109,9 +1112,6 @@ onBeforeMount(async () => {
})) }))
}) })
const handleQuitClicked = () => { const handleQuitClicked = () => {
emit('batchGenerateClicked'); // 触发事件 emit('batchGenerateClicked'); // 触发事件
}; };

View File

@@ -202,10 +202,6 @@ const tableRef2 = ref()
const currentId = ref('') const currentId = ref('')
watch( watch(
() => form.value, () => form.value,
(val, oldVal) => { (val, oldVal) => {
@@ -271,7 +267,6 @@ const findPlanById = (plans: Plan.ReqPlan[], id: string): Plan.ReqPlan | undefin
const getPieData = async (id: string) => { const getPieData = async (id: string) => {
currentId.value = id // 设置当前ID currentId.value = id // 设置当前ID
// 初始化计数对象 // 初始化计数对象
const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 } const checkStateCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0, 3: 0 }
const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 } const checkResultCount: { [key: number]: number } = { 0: 0, 1: 0, 2: 0 }
@@ -306,6 +301,10 @@ const getPieData = async (id: string) => {
reportStateCount[t.reportState]++ reportStateCount[t.reportState]++
} }
}) })
}else{
planName.value = '所选计划:'
} }
// 检查 checkStateCount 是否全为 0 // 检查 checkStateCount 是否全为 0
@@ -339,6 +338,7 @@ chartsData3.value = [
pieRef3.value.init() pieRef3.value.init()
} }
const getTree = (data?: any) => { const getTree = (data?: any) => {
treeRef.value.getTreeData(data) treeRef.value.getTreeData(data)
} }
//前往检测 //前往检测
@@ -434,9 +434,18 @@ onBeforeMount(async () => {
} }
planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]> planList.value = (await getPlanListByPattern(reqPlan)) as ResultData<Plan.ReqPlan[]>
if (planList.value.data[0].children[0]) { for (let i = 0; i < planList.value.data.length; i++) {
currentId.value = planList.value.data[0].children[0].id if (Array.isArray(planList.value.data[i].children) && planList.value.data[i].children.length > 0) {
currentId.value = planList.value.data[i].children[0].id; // 直接赋值第一个 children 的 id
break; // 确保只执行一次
} }
}
// if (planList.value.data[0].children[0]) {
// currentId.value = planList.value.data[0].children[0].id
// console.log('currentId.value',planList.value.data[0])
// }
if (chartsInfoRef.value) { if (chartsInfoRef.value) {
resizeObserver.observe(chartsInfoRef.value) resizeObserver.observe(chartsInfoRef.value)
} }

View File

@@ -41,7 +41,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="出厂日期" prop="createDate" > <el-form-item label="出厂日期" prop="createDate" v-if="scene === '0'">
<el-date-picker <el-date-picker
v-model="formContent.createDate" v-model="formContent.createDate"
placeholder="请选择出厂日期" placeholder="请选择出厂日期"
@@ -281,17 +281,21 @@ const baseRules: Record<string, Array<FormItemRule>> = {
const rules = computed(() => { const rules = computed(() => {
const dynamicRules = { ...baseRules }; const dynamicRules = { ...baseRules };
if (scene.value === '0'){//只有电科院需要展示
dynamicRules.createDate= [{ required: true, message: '出厂日期必填!', trigger: 'blur' }];
}
if (scene.value !== '0') { if (scene.value !== '0') {
dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }]; dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }];
dynamicRules.hardwareVersion = [{ required: true, message: '固件版本必填!', trigger: 'blur' }]; dynamicRules.hardwareVersion = [{ required: true, message: '固件版本必填!', trigger: 'blur' }];
dynamicRules.softwareVersion = [{ required: true, message: '软件版本必填!', trigger: 'blur' }]; dynamicRules.softwareVersion = [{ required: true, message: '软件版本必填!', trigger: 'blur' }];
dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }]; dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }];
} }
if (scene.value !== '2') { if (scene.value !== '2') {
dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }]; dynamicRules.name = [{ required: true, message: '设备名称必填!', trigger: 'blur' }];
dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }]; dynamicRules.manufacturer = [{ required: true, message: '生产厂家必选!', trigger: 'change' }];
dynamicRules.createDate= [{ required: true, message: '出厂日期必填!', trigger: 'blur' }];
} }

View File

@@ -94,8 +94,9 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
prop: 'createDate', prop: 'createDate',
label: '出厂日期', label: '出厂日期',
minWidth: 200, minWidth: 200,
isShow: appSceneStore.currentScene === '0',
...(appSceneStore.currentScene === '0' ? {
search: { search: {
span: 2,
render: () => { render: () => {
return ( return (
<div class='flx-flex-start'> <div class='flx-flex-start'>
@@ -107,6 +108,20 @@ const columns = reactive<ColumnProps<Device.ResPqDev>[]>([
) )
}, },
}, },
} : {}),
// search: {
// span: 2,
// render: () => {
// return (
// <div class='flx-flex-start'>
// <TimeControl
// default={'月'}
// onUpdate-dates={handleDateChange}
// />
// </div>
// )
// },
// },
}, },
{ {
prop: 'devChns', prop: 'devChns',