js:()=>(,);()的作用:明确表达式的边界。

()=>{表达式1;表达式2;表达式3;... return 结果}

等同于

()=>(表达式1,表达式2,表达式3,... 结果)

例子:

const strarr = ['a', 'b', 'c'];

const result = strarr.reduce((acc, curr) => {
  (acc[curr] = 1);
  console.log(acc);
  return acc
}, {});
console.log("strresult ↑")

const result1= strarr.reduce((acc, curr)=>((acc[curr]=1),console.log(acc),acc),{})
console.log("strresult1 ↑")

结果:

{ a: 1 }
{ a: 1, b: 1 }
{ a: 1, b: 1, c: 1 }
strresult ↑
{ a: 1 }
{ a: 1, b: 1 }
{ a: 1, b: 1, c: 1 }
strresult1 ↑
 

报错<Aug 19, 2025, 11:52:10,153 AM China Standard Time> <Error> <org.primefaces.application.exceptionhandler.PrimeExceptionHandler> <BEA-000000> <Cannot find component for subexpression "zhuanXuDetail" from component with id "j_idt11" in full expression "@form:zhuanXuDetail" referenced from "j_idt11:dataTableId:0:j_idt63". javax.faces.FacesException: Cannot find component for subexpression "zhuanXuDetail" from component with id "j_idt11" in full expression "@form:zhuanXuDetail" referenced from "j_idt11:dataTableId:0:j_idt63"., <p:column headerText="操作" style="text-align:center;width:60px"> <p:commandLink update="@form:zhuanXuDetail" value="查看明细" onclick="PF('deptDialog').show();" actionListener="#{zx.openEventDataDialog(zx)}" styleClass="centered-link"/> </p:column> </p:dataTable> </div> <p:dialog header="明细" widgetVar="zhuanXuDetail" modal="true" resizable="true" width="1200px" height="auto" contentHeight="flex" closeOnEscape="true"> <!-- 数据表格优化 --> <p:dataTable id="dataTableId2" value="#{zhuanXuReportBean.zhuanXuReportQuery}" lazy="true" paginator="true" rows="6" paginatorPosition="bottom" var="zhuanXuBean" emptyMessage="没有找到相关记录" styleClass="data-table fixed-layout-table" scrollable="true" scrollHeight="flex" scrollWidth="100%" tableStyle="table-layout: fixed; width: 100%" rowIndexVar="rowIndex"> <!-- 列宽优化 - 使用百分比宽度 --> <p:column headerText="厂房" width="8%"> <h:outputText value="#{zhuanXuBean.factory}" styleClass="ellipsis-text"/> </p:column> <p:column headerText="姓名(工号)" width="15%" > <h:outputText value="#{zhuanXuBean.nameNO}" styleClass="ellipsis-text"/> </p:column> <p:column headerText="单号" width="25%" > <h:outputText value="#{zhuanXuBean.orderNo}" styleClass="ellipsis-text"/> </p:column> <p:column headerText="板件" width="16%"> <h:outputText value="#{zhuanXuBean.plateNo}"> <f:convertDateTime pattern="yyyy-MM-dd HH:mm"/> </h:outputText> </p:column> <p:column headerText="下机时间" width="16%"> <h:outputText value="#{zhuanXuBean.machineDownTime}"> <f:convertDateTime pattern="yyyy-MM-dd HH:mm"/> </h:outputText> </p:column> <p:column headerText="转序时间" width="16%"> <h:outputText value="#{zhuanXuBean.zhuanXuTime}"> <f:convertDateTime pattern="yyyy-MM-dd HH:mm"/> </h:outputText> </p:column> <p:column headerText="状态" width="16%"> <h:outputText value="#{zhuanXuBean.state}"> <f:convertDateTime pattern="yyyy-MM-dd HH:mm"/> </h:outputText> </p:column> <p:column headerText="转序耗时" width="20%"> <h:outputText value="#{zhuanXuBean.zhuanXuDuration}" styleClass="ellipsis-text"/> </p:column> </p:dataTable> </p:dialog>
08-20
<template> <div :class="classObj" class="app-wrapper" :style="{'--current-color': theme}"> <div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/> <sidebar v-if="!sidebar.hide" class="sidebar-container"/> <div :class="{hasTagsView:needTagsView,sidebarHide:sidebar.hide}" class="main-container"> <div :class="{'fixed-header':fixedHeader}"> <navbar/> <tags-view v-if="needTagsView"/> </div> <app-main/> <right-panel> <settings/> </right-panel> </div> </div> </template> <script> import RightPanel from '@/components/RightPanel' import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components' import ResizeMixin from './mixin/ResizeHandler' import { mapState } from 'vuex' import variables from '@/assets/styles/variables.scss' import { useWindowSize } from '@vueuse/core' import defaultSettings from '@/settings' import useAppStore from '@/store/modules/app' import useSettingsStore from '@/store/modules/settings' import {onMounted, ref} from 'vue' import useUserStore from '@/store/modules/user' import { useWebSocketStore } from '@/store/modules/websocket'; const userStore = useUserStore() const settingsStore = useSettingsStore() const theme = computed(() => settingsStore.theme); const sideTheme = computed(() => settingsStore.sideTheme); const sidebar = computed(() => useAppStore().sidebar); const device = computed(() => useAppStore().device); const needTagsView = computed(() => settingsStore.tagsView); const fixedHeader = computed(() => settingsStore.fixedHeader); const classObj = computed(() => ({ hideSidebar: !sidebar.value.opened, openSidebar: sidebar.value.opened, withoutAnimation: sidebar.value.withoutAnimation, mobile: device.value === 'mobile' })) const { width, height } = useWindowSize(); const WIDTH = 992; // refer to Bootstrap's responsive design watch(() => device.value, () => { if (device.value === 'mobile' && sidebar.value.opened) { useAppStore().closeSideBar({ withoutAnimation: false }) } }) watchEffect(() => { if (width.value - 1 < WIDTH) { useAppStore().toggleDevice('mobile') useAppStore().closeSideBar({ withoutAnimation: true }) } else { useAppStore().toggleDevice('desktop') } }) function handleClickOutside() { useAppStore().closeSideBar({ withoutAnimation: false }) } const settingRef = ref(null); function setLayout() { settingRef.value.openSetting(); } onMounted(() => { // 向 localStorage 中存入 websocket:1 localStorage.setItem('websocket', '1'); if (localStorage.getItem('websocket')) { // 获取 WebSocket store 实例 const websocketStore = useWebSocketStore() // // 发送 WebSocket 消息 websocketStore.initWebSocket(userStore.name); } }) export default { name: 'Layout', components: { AppMain, Navbar, RightPanel, Settings, Sidebar, TagsView }, mixins: [ResizeMixin], computed: { ...mapState({ theme: state => state.settings.theme, sideTheme: state => state.settings.sideTheme, sidebar: state => state.app.sidebar, device: state => state.app.device, needTagsView: state => state.settings.tagsView, fixedHeader: state => state.settings.fixedHeader }), classObj() { return { hideSidebar: !this.sidebar.opened, openSidebar: this.sidebar.opened, withoutAnimation: this.sidebar.withoutAnimation, mobile: this.device === 'mobile' } }, variables() { return variables; } }, methods: { handleClickOutside() { this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) } } } </script> <style lang="scss" scoped> @import "~@/assets/styles/mixin.scss"; @import "~@/assets/styles/variables.scss"; .app-wrapper { @include clearfix; position: relative; height: 100%; width: 100%; &.mobile.openSidebar { position: fixed; top: 0; } } .drawer-bg { background: #000; opacity: 0.3; width: 100%; top: 0; height: 100%; position: absolute; z-index: 999; } .fixed-header { position: fixed; top: 0; right: 0; z-index: 9; width: calc(100% - #{$base-sidebar-width}); transition: width 0.28s; } .hideSidebar .fixed-header { width: calc(100% - 54px); } .sidebarHide .fixed-header { width: 100%; } .mobile .fixed-header { width: 100%; } </style> 修改
10-08
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值