| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128 |
- <%@ taglib prefix="ss" uri="/ssTag" %>
- <%@ page language="java" pageEncoding="UTF-8" isELIgnored="false" %>
- <%@ taglib uri="/ssTag" prefix="ss" %>
- <%pageContext.setAttribute("wdpageinformation", "{'hastab':'0'}");%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="pragma" content="no-cache">
- <meta http-equiv="cache-control" content="no-cache">
- <meta http-equiv="expires" content="0">
- <script>window.loginStatus = "${empty sessionScope['ssUser']?'0':'1'}"</script>
- <ss:skin file='main.css'/>
- <script type="text/javascript" src="/ss/jquery/jquery.js"></script>
- <script type="text/javascript" src="/ss/artdialog/artDialogUtil.js"></script>
- <script type="text/javascript" src="/ss/js/base.js"></script>
- <script> if (!window.wd) var wd = {};
- if (!wd.display) wd.display = {};
- wd.display.wdDialogId = "objList";
- if (!wd.app) wd.app = {};
- wd.app.name = 'pms';</script>
- <script type="text/javascript" src="/ss/js/masklayer.js"></script>
- <script type="text/javascript" src="/ss/js/wdDialogInit.js"></script>
- <script type="text/javascript" src="/ss/js/common.js"></script>
- <script type="text/javascript" src="/ss/js/display.js"></script>
- <script type="text/javascript" src="/ss/js/edit.js"></script>
- <script type="text/javascript" src="/ss/nicescroll/jquery.nicescroll.js"></script>
- <script type="text/javascript" src="/ss/nicescroll/jquery.nicescroll.iframehelper.min.js"></script>
- <link rel="stylesheet" type="text/css" href="/ss/window/theme/dhtmlxwindows.css">
- <link rel="stylesheet" type="text/css" href="/ss/window/theme/dhx_blue/dhtmlxwindows_dhx_blue.css">
- <script type="text/javascript" src="/ss/window/dhtmlxcommon.js"></script>
- <script type="text/javascript" src="/ss/window/dhtmlxwindows.js"></script>
- <script type="text/javascript" src="/ss/window/dhtmlxcontainer.js"></script>
- <script type="text/javascript" src="/ss/js/common.js"></script>
- <script type="text/javascript" src="/ss/js/display.js"></script>
- <script type="text/javascript" src="/ss/js/edit.js"></script>
- <ssDlg setPval="true"/>
- <%-- setValue="true" close="true"。Lin --%>
- <script type="text/javascript" src="/ss/jquery/jquery.ellipsis.js"></script>
- <%-- 新UI引入的JS --%>
- <script src="/js/load.js"></script>
- <%-- ="/newUI/ss/js/base.js"。Lin(新UI) --%>
- <script src="/js/pageC.js"></script>
- <%-- 对象变动、修改、查看页,左则选项卡宽度 在里面定义 Ben(20251213) --%>
- <%-- 改为 <data@ss name="prt"/>。Lin
- <tab@ss name="print" enable="viewobject.funcMap.play.print"/> --%>
- <ss:data name='prt'/><%-- 初始化弹出窗口的打印按钮的后台数据 Ben--%>
- <%@include file="/ss/clip/prtIcon.jsp" %>
- <%-- 引入初始化弹出窗口的打印按钮的JS Ben--%>
- <script>
- window.ss.dom.formElemConfig = window.ss.dom.formElemConfig || {};
- </script>
- <style>
- /* 首页 loading:没加载完不显示页面内容 */
- .pobj-loading-home {
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- z-index: 9999;
- pointer-events: none;
- }
- /* 列表 loading:区域性(搜索条件和分页之间) */
- .pobj-list-loading {
- width: 100%;
- min-height: 260px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .pobj-spinner {
- width: 18px;
- height: 18px;
- border-radius: 50%;
- border: 2px solid rgba(0, 0, 0, 0.2);
- border-top-color: rgba(0, 0, 0, 0.65);
- animation: pobjSpin 0.8s linear infinite;
- }
- @keyframes pobjSpin {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
- }
- </style>
- </head>
- <body>
- <div id="app">
- <div v-show="loadingHome" class="pobj-loading-home" style="display:none;">
- <div class="pobj-spinner"></div>
- </div>
- <%-- 功能说明:主布局容器(左侧表单 + 右侧 ss-sidebar) by xu 20260113 --%>
- <div style="display: flex; height: 100%; " v-show="homeReady">
- <%-- 功能说明:左侧表单区域在 flex 中占满剩余宽度(避免挤掉右侧 ss-sidebar) by xu 20260113 --%>
- <form class="page-container" id="myForm" style="flex: 1; min-width: 0; width: auto;"
- action="<ss:serv name='${currentService.service}' dest='${currentService.dest}' parm='${currentService.param}'/>"
- method="post">
- <input type="hidden" name="isAnd" v-model="form.isAnd"/>
- <input name="management" type="hidden" v-model="form.management"/>
- <input name="isFulltext" type="hidden" v-model="form.isFulltext"/>
- <input type="hidden" name="pageNo" v-model="ssPaging.pageNo"/>
- <input type="hidden" name="rowNumPer" v-model="ssPaging.rowNumPer"/>
- <input type="hidden" name="rowNum" v-model="ssPaging.rowNum"/>
- <%--搜索条件start--%>
- <div class="search-bar">
- <ss-breadcrumb></ss-breadcrumb>
- <div class="search-bar-contaienr">
- <template v-if="homeReady">
- <template v-for="field in searchFieldList" :key="field.name">
- <ss-objp
- v-if="field.cbName"
- v-model="form[field.name]"
- :name="field.name"
- :placeholder="field.desc"
- width="150px"
- inp="true"
- url="/service?ssServ=loadObjpOpt&objectpickerdropdown1=1"
- :cb="field.cbName"
- ></ss-objp>
- <ss-search-date-picker
- v-else-if="field.type == 11"
- v-model="form[field.name]"
- :name="field.name"
- type="date"
- :placeholder="field.desc"
- width="140px"
- :fmt="field.fmt"
- ></ss-search-date-picker>
- <ss-search-date-picker
- v-else-if="field.type == 3"
- v-model="form[field.name]"
- :name="field.name"
- type="datetime"
- :placeholder="field.desc"
- width="200px"
- :fmt="field.fmt"
- ></ss-search-date-picker>
- <ss-search-input
- v-else
- :name="field.name"
- :placeholder="field.desc"
- v-model="form[field.name]"
- width="120px"
- @search="search"
- ></ss-search-input>
- </template>
- <ss-search-input
- v-if="hasKeyword"
- name="ssKeyword"
- placeholder="关键词"
- v-model="form.ssKeyword"
- width="120px"
- @search="search"
- ></ss-search-input>
- <ss-search-button
- v-if="hasScope"
- :key="'scope-' + String(searchButtonConfigCheckId)"
- text="所有"
- icon-class="nav-icon-search"
- :opt="searchButtonConfig"
- :check-id="searchButtonConfigCheckId"
- ></ss-search-button>
- <template v-for="func in rootFuncList" :key="func.id || func.servName">
- <ss-search-button
- :text="func.desc || func.title || ''"
- icon-class="nav-icon-add"
- :opt="[]"
- :check-id="0"
- @click="handleRootFuncClick(func)"
- ></ss-search-button>
- </template>
- </template>
- <template v-else>
- <%--新UI 单对象查询翻页end Ben --%>
- <%--关键词--%>
- <%-- 再去掉 -- 只支持一行。Lin
- <ss:rpt name='searchableFields' id='fieldsList'>
- --%>
- <ss:rpt name='fieldsList' id='searchItem'>
- <%
- ss.obj.ObjFieldB f = (ss.obj.ObjFieldB) pageContext.getAttribute("searchItem");
- pageContext.setAttribute("searchItemValue", request.getParameter(f.name));
- %>
- <%--codebook 使用select下拉--%>
- <ss:equal val='${empty searchItem.cbName}' val2='false'>
- <%-- 旧的objecPicker
- <input type="text" name="${searchItem.name}" value="${searchItemValue}"/>
- <input type="text" name="${searchItem.name}Name" placeholder="${searchItem.desc}" style="width:${searchItem.width};min-width: 108px;"/>
- <ss:equal val='${empty cadcadingInputs[searchItem.name]}' val2='true'>
- <ss:objp name='${searchItem.name}' cb='${searchItem.cbName}' inp='true' filterField='${searchItem.filterFieldStr}'/>
- </ss:equal> --%>
- <%-- 新UI --%>
- <!-- <ss-objp
- v-model="${searchItem.name}"
- name="${searchItem.name}"
- :options="${searchItem.name}Option"
- placeholder="${searchItem.desc}"
- width="120"
- input="true"
- ></ss-objp> -->
- <ss-objp
- v-model="${searchItem.name}"
- name="${searchItem.name}"
- :opt="${searchItem.name}Option"
- placeholder="${searchItem.desc}"
- width="150px"
- inp="true"
- url="/service?ssServ=loadObjpOpt&objectpickerdropdown1=1"
- cb="${searchItem.cbName}"
- ></ss-objp>
- <script>
- /**
- * objectPicker(如:性别码)
- * optUrl:加载下拉菜单option选项的url
- */
- window.ss.dom.formElemConfig.${searchItem.name} = {
- desc: '${searchItem.desc}',
- value: '${searchItemValue}',
- optUrl: '123456',
- type: 2
- };//放当前页面表单元素配置的变量
- </script>
- </ss:equal>
- <%--codebook 使用input输入框--%>
- <ss:equal val='${empty searchItem.cbName}' val2='true'>
- <%--日期--%>
- <ss:equal val='${searchItem.type}'
- valList='3,11'> <%-- 改 equal:val1='true' val2='${searchItem.type == "time"}'。Lin --%>
- <!-- <div class="input-inside"> -->
- <%--年度--%>
- <%--
- <ss:equal val='${searchItem.enrolDate}' val2='true'>
- <input type='hidden' placeholder="${searchItem.desc}" name='${searchItem.name}'
- value="<ss:txt val='${searchItemValue}'/>"/>
- <div><input type="text" name="${searchItem.name}_year" autocomplete="off" />
- <input name="${searchItem.name}_month" type="button" value="春季" ssVal="3"/>
- <input name="${searchItem.name}_month" type="button" value="秋季" ssVal="9"/>
- </div><script>(function(){wd.edit.onoffInit('radio','${searchItem.name}_month','',false,null,null,null,'edit');})();</script>
- <script>(function(){
- wd.display.initEnrolDate('${searchItem.name}','edit');
- })()
- </script>
- </ss:equal>
- --%>
- <%--日期--%>
- <ss:equal val='${searchItem.type==11}' val2='true'>
- <%--<input type='text' autocomplete="off" placeholder="${searchItem.desc}" name='${searchItem.name}'
- value='<ss:txt val='${searchItemValue}'/>' format="${searchItem.fmt}"/>
- <input type="button" ssType="date" ssName="${searchItem.name}"/>--%>
- <!-- <ss-date-picker
- v-model="${searchItem.name}"
- name="${searchItem.name}"
- type="date"
- placeholder="${searchItem.desc}"
- width="120px"
- ></ss-date-picker> -->
- <ss-search-date-picker
- v-model="${searchItem.name}"
- name="${searchItem.name}"
- type="date"
- placeholder="${searchItem.desc}"
- width="100px"
- fmt="${searchItem.fmt}"
- ></ss-search-date-picker>
- <script>
- //日期类型(出生日期)
- window.ss.dom.formElemConfig.${searchItem.name} = {
- desc: '${searchItem.desc}',
- value: '${searchItemValue}',
- type: 3,
- name: '${searchItem.name}'
- };//放当前页面表单元素配置的变量
- </script>
- </ss:equal>
- <!-- </div> -->
- </ss:equal>
- <%--文本--%>
- <%-- 改 equal:val1='false' val2='${searchItem.type == "time"}'。Lin --%>
- <ss:notEqual val='${searchItem.type}' valList='3,11'>
- <%--<input name='${searchItem.name}' placeholder="${searchItem.desc}" type='text'
- value='<ss:txt val='${searchItemValue}'/>'/>
- <input type="hidden" ssType="and" ssName="${searchItem.name}"/>--%>
- <%--<script>wd.edit.addClearTextButton("${searchItem.name}");</script>--%>
- <ss-search-input
- name="${searchItem.name}"
- placeholder="${searchItem.desc}"
- v-model="${searchItem.name}"
- width="100px"
- >
- </ss-search-input>
- </ss:notEqual>
- </ss:equal>
- </ss:rpt>
- <%-- 再去掉 -- 只支持一行。Lin
- </ss:rpt>
- --%>
- <%--
- <ss:rpt name='cadcadingName' id='item'>
- <ss:ccp name='${item}'/>
- </ss:rpt>
- --%>
- <ss:equal val='${hasKeyWord}' val2='true'>
- <%--
- <input name="ssKeyword" value="${ssKeyword}" type="text" placeholder="关键词"/>
- <script>wd.edit.addClearTextButton("ssKeyword");</script>
- --%>
- <!-- <ss-search-input
- name="ssKeyword"
- placeholder="关键词"
- v-model="form.keyword"
- width="120"
- >
- </ss-search-input> -->
- <ss-search-input
- name="ssKeyword"
- placeholder="关键词"
- v-model="ssKeyword"
- width="100px"
- @search="search"
- >
- </ss-search-input>
- <script>
- //关键词
- window.ss.dom.formElemConfig.ssKeyword = {
- value: '${ssKeyword}',
- name: "ssKeyword",
- desc: "关键词",
- type: 31
- };//放当前页面表单元素配置的变量
- </script>
- </ss:equal>
- <ss-search-button
- text="所有"
- icon-class="nav-icon-search"
- :opt="searchButtonConfig"
- :check-id="searchButtonConfigCheckId"
- ></ss-search-button>
- <%-- 新UI 单对象查询 选项卡、翻页start Ben --%>
- <ss:equal val='${"1"==isReady && !isMultipleObject}' val2='true'>
- <%--
- <ss:equal val='${hasScope}' val2='true'>
- <ul style="list-style: none;display: inline-block;">
- <li ssType="searchScope" ssVal=99>所有</li>
- <li ssType="searchScope" ssVal=2>管理</li>
- <li ssType="searchScope" ssVal=1>创建</li>
- <li ssType="searchScope" ssVal=3>已办</li>
- <li ssType="searchScope" ssVal=55>停用</li>
- </ul>
- </ss:equal>
- --%>
- </ss:equal>
- <%--
- <input type="submit" name="ssSearch" value="搜索" class="content-invertButton"/>
- --%>
- <!-- <ss-search-button text="搜索" @click="console.log('这里改成提交表单')">
- </ss-search-button> -->
- <script>
- <%-- 根按钮(管理按钮) --%>
- window.ss.dom.btnElemConfig = window.ss.dom.btnElemConfig || {};
- </script>
- <%--多对像搜索隐藏全文按钮--%>
- <%--
- <ss:equal val='${isMultipleObject}' val2='false'>
- --%><%--
- <input type="hidden" ssType="fts" ssName="fts" value="全文"/>--%> <%-- wdType="isFulltext" wdName="isFulltext"。Lin --%>
- <%--</ss:equal>--%>
- <%--根按钮(管理按钮)start--%>
- <ss:rpt name='buttonList' id='button'>
- <ss:auth serv='${button.service}'>
- <ss:equal val='${empty button.pluginList}' val2='true'>
- <%--
- <input type="button" name="${button.name}" value="${button.buttonName}" class="content-button"
- onclick='wd.display.showComponent({show:["wdDialog"],url:"<ss:serv name='${button.service}' dest='${button.dest}' parm='${button.param}'/>",title:"${button.title}",width:"${button.width}",height:"${button.height}",minHeight:"${button.minHeight}",maxHeight:"${button.maxHeight+100}",showTitle:"${button.showTitle}"});'/>
- --%>
- <!-- <ss-search-button
- text="${button.name}"
- icon-class="nav-icon-add"
- ></ss-search-button> -->
- <script>
- function ${button.id}handleClick() {
- wd.display.showComponent({
- show: ["wdDialog"],
- url: "<ss:serv name='${button.service}' dest='${button.dest}' parm='${button.param}'/>",
- title: "${button.title}",
- width: "${button.width}",
- height: "${button.height}",
- minHeight: "${button.minHeight}",
- maxHeight: "${button.maxHeight+100}",
- showTitle: "${button.showTitle}"
- });
- }
- <%-- 实际没用上,注释掉 Ben(20251225)
- window.ss.dom.btnElemConfig.${button.id}={
- desc:"${button.buttonName}",
- id:"${button.id}",
- dropOptions:[],
- onclick: () => {
- wd.display.showComponent({show:["wdDialog"],url:"<ss:serv name='${button.service}' dest='${button.dest}' parm='${button.param}'/>",title:"${button.title}",width:"${button.width}",height:"${button.height}",minHeight:"${button.minHeight}",maxHeight:"${button.maxHeight+100}",showTitle:"${button.showTitle}"});
- }
- };
- --%>
- </script>
- <ss-search-button
- text="${button.buttonName}"
- icon-class="nav-icon-add"
- :opt="[]"
- :check-id="0"
- onclick="${button.id}handleClick()"
- ></ss-search-button>
- </ss:equal>
- <ss:equal val='${empty button.pluginList}' val2='false'>
- <ss:rpt name='${button.pluginList}' id='plugin'>
- <span style="display:none;" class="${button.id}children" value="${plugin.plugin.desc}"
- onclick='wd.display.showComponent({show:["wdDialog"],url:"<ss:serv
- name='${plugin.service}' dest='${plugin.dest}'
- parm='${plugin.param}'/>",title:"${plugin.title}",width:"${plugin.width}",height:"${plugin.height}",minHeight:"${plugin.minHeight}",maxHeight:"${plugin.maxHeight}",showTitle:"${plugin.showTitle}"});'>
- </span>
- </ss:rpt>
- <%-- <input type="button" id="${button.id}" name="${button.name}" value="${button.buttonName}" class="content-button" onclick='void(0)'/>
- <span style=" display:inline-table; width: 60px; ">
- <input type="button" id="${button.id}" name="${button.name}" value="${button.buttonName}" class="content-button" onclick='void(0)'/>
- <span class="icon-dimPoint" style="margin-right: 7px;margin-top: -25px;position: relative;">
- </span>
- </span>
- <script>wd.display.attachButton("${button.id}","${button.id}children",null,false,true)</script>--%>
- <%-- 新UI start Ben --%>
- <!-- <ss-search-button
- text="${plugin.plugin.desc}"
- icon-class="nav-icon-add"
- :options="${button.id}DropOptions"
- ></ss-search-button> -->
- <%-- :opt改为取vue.data中的变量,而不取window.ss.dom.btnElemConfig(因为取不到),onclick改为:onclick xu(20251209) --%>
- <ss-search-button
- text="${button.buttonName}"
- icon-class="nav-icon-add"
- :opt="btnElemConfig.${button.id}.dropOptions"
- check-id="${management}"
- onclick="${button.id}handleClick()"
- ></ss-search-button>
- <script>
- function ${button.id}handleClick() {
- wd.display.showComponent({
- show: ["wdDialog"],
- url: "<ss:serv name='${plugin.service}' dest='${plugin.dest}' parm='${plugin.param}'/>",
- title: "${plugin.title}",
- width: "${plugin.width}",
- height: "${plugin.height}",
- minHeight: "${plugin.minHeight}",
- maxHeight: "${plugin.maxHeight}",
- showTitle: "${plugin.showTitle}"
- });
- }
- <%-- 实际没用上,注释掉 Ben(20251225)
- window.ss.dom.btnElemConfig.${button.id}={id:"${button.id}",dropOptions:[],
- onclick: () => {
- wd.display.showComponent({show:["wdDialog"],url:"<ss:serv name='${plugin.service}' dest='${plugin.dest}' parm='${plugin.param}'/>",title:"${plugin.title}",width:"${plugin.width}",height:"${plugin.height}",minHeight:"${plugin.minHeight}",maxHeight:"${plugin.maxHeight}",showTitle:"${plugin.showTitle}"});
- }
- };
- --%>
- <%-- 循环生成按钮数组 --%>
- <ss:rpt name='${button.pluginList}' id='plugin'>
- window.ss.dom.btnElemConfig
- .${button.id}.
- dropOptions.push(
- {
- desc: '${plugin.plugin.desc}', <%-- 按钮名 --%>
- callback: function () {
- wd.display.showComponent({
- show: ["wdDialog"],
- url: "<ss:serv name='${plugin.service}' dest='${plugin.dest}' parm='${plugin.param}'/>",
- title: "${plugin.title}",
- width: "${plugin.width}",
- height: "${plugin.height}",
- minHeight: "${plugin.minHeight}",
- maxHeight: "${plugin.maxHeight}",
- showTitle: "${plugin.showTitle}"
- });
- }
- }
- );
- </ss:rpt>
- </script>
- <%-- 新UI end Ben --%>
- </ss:equal>
- </ss:auth>
- </ss:rpt>
- <%--管理按钮end--%>
- </template>
- </div>
- </div>
- <%--搜索条件end--%>
- <script type="text/javascript" src="/ss/env/env_search.js"></script>
- <%-- 旧UI初始化查询列表的js,新UI做好后,要被删掉的 --%>
- <%-- 新UI初始化查询列表数据的JS --%>
- <script>
- window.ss.dom.listConfig = window.ss.dom.listConfig || {};
- //二级对象 草稿箱
- window.ss.dom.listConfig.draftbox = [];
- <%-- 草稿箱start --%>
- <ss:rpt name='cgxList' id='item'>
- {
- let item = {};
- window.ss.dom.listConfig.draftbox.push(item);
- <%-- 下面的titlexxx是原来td的一个属性,不知道有啥用 --%>
- <ss:equal val='${not empty item.service.play && empty item.service.update && empty item.service.change}' val2='true'>
- item.titlexxx = "${item.service.play.title}";
- item.onclick = function () {
- wd.display.showComponent({
- show: ["wdDialog"],
- url: "<ss:serv name='${item.service.play.service}' dest='${item.service.play.dest}' parm='${item.service.play.param}'/>",
- title: "${item.service.play.title}",
- width: "${item.service.play.width}",
- height: "${item.service.play.height}",
- minHeight: "${item.service.play.minHeight}",
- maxHeight: "${item.service.play.maxHeight}"
- });
- };
- </ss:equal>
- <ss:equal val='${item.service.lbm}' val2='1'>
- <ss:equal val='${empty item.service.update}' val2='false'>
- item.titlexxx = "${item.service.update.title}";
- item.onclick = function () {
- wd.display.showComponent({
- show: ["wdDialog"],
- url: "<ss:serv name='${item.service.update.service}' dest='${item.service.update.dest}' parm='${item.service.update.param}'/>",
- title: "${item.service.update.title}",
- width: "${item.service.update.width}",
- height: "${item.service.update.height}",
- minHeight: "${item.service.update.minHeight}",
- maxHeight: "${item.service.update.maxHeight}"
- });
- };
- </ss:equal>
- </ss:equal>
- <ss:equal val='${item.service.lbm}' val2='11'>
- <ss:equal val='${empty item.service.change}' val2='false'>
- item.titlexxx = "${item.service.change.title}";
- item.onclick = function () {
- wd.display.showComponent({
- show: ["wdDialog"],
- url: "<ss:serv name='${item.service.change.service}' dest='${item.service.change.dest}' parm='${item.service.change.param}'/>",
- title: "${item.service.change.title}",
- width: "${item.service.change.width}",
- height: "${item.service.change.height}",
- minHeight: "${item.service.change.minHeight}",
- maxHeight: "${item.service.change.maxHeight}"
- });
- };
- </ss:equal>
- </ss:equal>
- item.buttons = [];
- <ss:equal val='${item.service.lbm}' val2='1'>
- item.buttons.push(
- {
- class: "cart-list-setting",
- title: "增加",
- onclick: () => {
- console.log("点击了增加");
- }
- }
- );
- </ss:equal>
- <ss:equal val='${item.service.lbm}' val2='11'>
- item.buttons.push(
- {
- class: "cart-list-setting",
- title: "变动",
- onclick: () => {
- console.log("点击了变动");
- }
- }
- );
- </ss:equal>
- <ss:equal val='${item.service.lbm}' val2='51'>
- item.buttons.push(
- {
- class: "cart-list-setting",
- title: "停用",
- onclick: () => {
- console.log("点击了停用");
- }
- }
- );
- </ss:equal>
- <ss:equal val='${item.service.lbm}' val2='55'>
- item.buttons.push(
- {
- class: "cart-list-setting",
- title: "启用",
- onclick: () => {
- console.log("点击了启用");
- }
- }
- </ss:equal>
- <ss:equal val='${item.service.lbm}' valList='51,55'>
- item.buttons.push(
- {
- class: "cart-list-setting",
- title: "还原",
- onclick: () => {
- wd.display.showComponent({
- show: ["wdDialog"],
- url: "<ss:serv name='deleteSq' parm='{"wdConfirmationCaptchaService":"0","sqid":"${item.sqid}"}' dest='info'/>",
- title: "提示信息",
- width: 715,
- height: 483
- });
- }
- }
- </ss:equal>
- console.log('###item.thumbnail:${item.thumbnail}');
- <%--缩略图--%>
- <ss:equal val='${empty item.thumbnail}' val2='false'>
- <ss:equal val='${item.service.state}' val2='0'>
- item.thumb = "${sessionScope['ssUser'].skinDir}image/object/default-${item.ssObjName}.png"
- onerror = "javascript:this.src='${sessionScope['ssUser'].skinDir}image/default-photo.png';this.onerror=null;";
- </ss:equal>
- <ss:notEqual val='${item.service.state}' val2='0'>
- item.thumb = "<ss:serv name='dlByHttp' parm='{"wdConfirmationCaptchaService":"0","path":"${item.thumbnail.value}","type":"img"}'/>";
- </ss:notEqual>
- </ss:equal>
- <%-- 列标题 --%>
- <ss:equal val='${empty item.first}' val2='false'> <%-- 改 equal:val1="true" val2="${not empty item.first}"。Lin --%>
- <%--不带codebook--%>
- <ss:equal val='${empty item.first.field.cbName}' val2='true'>
- item.title = "<ss:txt val='${item.first.value}' miniDate='false' fmt='${item.first.field.fmt}'/>";
- </ss:equal>
- <%--带codebook--%>
- <ss:equal val='${empty item.first.field.cbName}' val2='false'>
- item.title = "<ss:cbTrans cb='${item.first.field.cbName}' val='${item.first.value}'/>";
- </ss:equal>
- </ss:equal>
- <%--列标题:缺标题显示属性start--%>
- <ss:equal val='${empty item.first && not empty item.third}' val2='true'>
- item.title = '';
- <ss:rpt name='${item.third}' id='itemList'>
- <ss:rpt name='${itemList}' id='item2'>
- item.title += '${item2.field.desc}:';
- <%--不带codebook--%>
- <ss:equal val='${empty item2.field.cbName}' val2='true'>
- item.title += '<ss:txt val='${item2.value}' fmt='${item2.field.fmt}' miniDate='false'/> ';
- </ss:equal>
- <%--带codebook--%>
- <ss:equal val='${empty item2.field.cbName}' val2='false'>
- item.title += '<ss:cbTrans cb='${item2.field.cbName}' val='${item2.value}'/> ';
- </ss:equal>
- </ss:rpt>
- </ss:rpt>
- </ss:equal>
- <%--缺标题显示属性end--%>
- <%--正文或摘要--%>
- <ss:equal val='${empty item.second}' val2='false'>
- // 摘要字段统一映射为 desc(用于 ss-list-card 右侧文字区规则) by xu 20260113
- item.desc = '${item.second.value}';
- item.summary = '${item.second.value}'; // legacy 兜底 by xu 20260113
- </ss:equal>
- // 对象号字段映射(用于 ss-list-card 第三部分回显) by xu 20260113
- item.objNum = '${item.ssObjId}';
- <%-- 列表底部的对象属性(tags) --%>
- <ss:equal val='${empty item.first || empty item.third}' val2='false'>
- item.tags = [];
- <ss:rpt name='${item.third}' id='itemList'>
- <ss:rpt name='${itemList}' id='item2'>
- {
- let v;
- <%--不带codebook--%>
- <ss:equal val='${empty item2.field.cbName}' val2='true'>
- v = '<ss:txt val='${item2.value}' fmt='${item2.field.fmt}' miniDate='false'/>';
- </ss:equal>
- <%--带codebook--%>
- <ss:equal val='${empty item2.field.cbName}' val2='false'>
- v = '<ss:cbTrans cb='${item2.field.cbName}' val='${item2.value}'/>';
- </ss:equal>
- item.tags.push({'${item2.field.desc}': v});
- }
- </ss:rpt>
- </ss:rpt>
- </ss:equal>
- <%-- 对象变动前后属性列表 --%>
- item.changeItems = [];
- <ss:rpt name='${item.forth}' id='item3'>
- item.changeItems.push({
- name: '${item3.name}',
- oldValue: '${item3.oldValue}',
- newValue: '${item3.newValue}'
- });
- </ss:rpt>
- }
- </ss:rpt>
- <%-- 草稿箱end --%>
- //在用或停用的对象列表
- window.ss.dom.listConfig.list = [];
- <ss:rpt name='objectList' id='item'><%-- 循环一次生成一行列表 start --%>
- {
- let item = {};//列表的其中一行的属性
- window.ss.dom.listConfig.list.push(item);
- <ss:equal val='${item.service.state}' val2='0'><%-- 借阅 --%>
- item.onclick = function () {
- wd.display.showComponent({
- show: ["wdDialog"],
- url: "<ss:serv name='ydsq_tj' parm='{"wdConfirmationCaptchaService":"0","ssObjId":"${item.ssObjId}","ssObjName":"${item.ssObjName}"}' dest='ydsq_tj'/>",
- title: "借阅",
- width: 613,
- height: 387
- });
- }
- </ss:equal>
- <ss:equal val='${empty item.service.play}' val2='false'><%-- 有权查看,不需要借阅的情况 --%>
- item.titlexxx = "${item.service.play.title}";
- item.onclick = function () {
- wd.display.showComponent({
- getSize: 1,
- width: ((${item.service.play.width}+DOM_SIZE_objInfoTabWidth) + ""),
- show: ["wdDialog"],
- url: "<ss:serv name='${item.service.play.service}' dest='${item.service.play.dest}' parm='${item.service.play.param}'/>",
- title: "${item.service.play.title}",
- height: "${item.service.play.height}",
- minHeight: "${item.service.play.minHeight}",
- maxHeight: "${item.service.play.maxHeight}"
- });
- }
- </ss:equal>
- <ss:equal val='${empty item.thumbnail}' val2='false'><%-- 缩略图 --%>
- <ss:equal val='${item.service.state}' val2='0'><%-- 借阅 --%>
- item.thumb = "${sessionScope['ssUser'].skinDir}image/object/default-${item.ssObjName}.png";
- </ss:equal>
- <ss:notEqual val='${item.service.state}' val2='0'>
- console.log('@@@图片:${item.thumbnail.value}');
- item.thumb = "<ss:serv name='dlByHttp' parm='{"wdConfirmationCaptchaService":"0","path":"${item.thumbnail.value}","type":"img"}'/>";
- </ss:notEqual>
- </ss:equal>
- <%-- 标题 --%>
- <ss:equal val='${empty item.first}' val2='false'> <%-- 改 equal:val1="true" val2="${not empty item.first}"。Lin --%>
- <%--不带codebook--%>
- <ss:equal val='${empty item.first.field.cbName}' val2='true'>
- item.title = "<ss:txt val='${item.first.value}' miniDate='false' fmt='${item.first.field.fmt}'/>";
- </ss:equal>
- <%--带codebook--%>
- <ss:equal val='${empty item.first.field.cbName}' val2='false'>
- item.title = "<ss:cbTrans cb='${item.first.field.cbName}' val='${item.first.value}'/>";
- </ss:equal>
- </ss:equal>
- <%--缺标题显示属性当标题start--%>
- <ss:equal val='${empty item.first && not empty item.third}' val2='true'>
- item.title = '';
- <ss:rpt name='${item.third}' id='itemList'>
- <ss:rpt name='${itemList}' id='item2'>
- item.title += '${item2.field.desc}:';
- <%--属性名--%>
- <%--不带codebook--%><%--属性值--%>
- <ss:equal val='${empty item2.field.cbName}' val2='true'>
- item.title += "<ss:txt val='${item2.value}' fmt='${item2.field.fmt}' miniDate='false'/> ";
- </ss:equal>
- <%--带codebook--%><%--属性值--%>
- <ss:equal val='${empty item2.field.cbName}' val2='false'>
- item.title += "<ss:cbTrans cb='${item2.field.cbName}' val='${item2.value}'/> ";
- </ss:equal>
- </ss:rpt>
- </ss:rpt>
- </ss:equal>
- <%--缺标题显示属性当标题end--%>
- <%-- 摘要 --%>
- <ss:equal val='${empty item.second}' val2='false'>
- // 摘要字段统一映射为 desc(用于 ss-list-card 右侧文字区规则) by xu 20260113
- item.desc = '${item.second.value}';
- item.summary = '${item.second.value}'; // legacy 兜底 by xu 20260113
- </ss:equal>
- // 对象号字段映射(用于 ss-list-card 第三部分回显) by xu 20260113
- item.objNum = '${item.ssObjId}';
- <%-- 列表底部的对象标签组 --%>
- item.tags = [];
- <%-- 提到条件外面 Ben(20251230) --%>
- <ss:equal val='${empty item.first || empty item.third}' val2='false'>
- <%--item.tags=[]; 提到条件外面,不然列表报 Mount failed:TypeError: Cannot read properties of undefined (reading 'map') Ben(20251230) --%>
- <ss:rpt name='${item.third}' id='itemList'>
- <ss:rpt name='${itemList}' id='item2'>
- {
- let v;
- <%--不带codebook--%>
- <ss:equal val='${empty item2.field.cbName}' val2='true'>
- v = '<ss:txt val='${item2.value}' miniDate='false' fmt='${item2.field.fmt}'/>';
- </ss:equal>
- <%--带codebook--%>
- <ss:equal val='${empty item2.field.cbName}' val2='false'>
- v = '<ss:cbTrans cb='${item2.field.cbName}' val='${item2.value}'/>';
- </ss:equal>
- item.tags.push({
- ${item2.field.desc}:
- v
- })
- ;
- }
- </ss:rpt>
- </ss:rpt>
- </ss:equal>
- <%--按钮--%>
- <ss:equal val='${empty item.service.btnList}' val2='false'>
- item.buttons = [];
- <ss:rpt name='${item.service.btnList}' id='btn'>
- item.buttons.push(
- {
- id: "${btn.btnID}",
- titlexxx: "${btn.title}",
- class: "cart-list-setting",
- title: "${btn.name}",
- onclick: () => {
- <%--列表的变动按钮就在这里,下面的width会根据不同业务对象而不同
- 弹窗参数加上getSize=1,使showComponent弹窗方法不再通过ajax从后台取宽高 --%>
- wd.display.showComponent({
- getSize: 1,
- width: ((${btn.width}+DOM_SIZE_objInfoTabWidth) + ""),
- show: ["wdDialog"],
- url: "<ss:serv name='${btn.service}' dest='${btn.dest}' parm='${btn.param}'/>",
- title: "${btn.title}",
- height: "${btn.height}",
- minHeight: "${btn.minHeight}",
- maxHeight: "${btn.maxHeight}"
- });
- }
- }
- );
- <%--
- <ss:equal val='${index}' val2='0'>
- </ss:equal>
- <ss:notEqual val='${index}' val2='0'>
- </ss:notEqual>
- 改为不区分是否第1个变动按钮,都输出相同json数据 --%>
- </ss:rpt>
- </ss:equal>
- }
- </ss:rpt><%-- 循环一次生成一行列表 end --%>
- </script>
- <%--搜索结果start--%>
- <%-- 功能说明:卡片区域使用 grid 自动分列,剩余宽度平分(不锁死 max-width) by xu 20260109 --%>
- <div v-show="userInteracted && loadingList" class="pobj-list-loading" style="display:none;">
- <div class="pobj-spinner"></div>
- </div>
- <div v-show="!(userInteracted && loadingList)"
- :class="['content-area','item-content-area', cardGridKind ? ('ss-card-grid--' + cardGridKind) : '']">
- <template v-for="(item, i) in listConfig.draftbox" :key="i">
- <ss-folder-card v-if="item.children" :item="item"></ss-folder-card>
- <!-- 功能说明:传入 ssObjName + cardClickAction(卡片主体点击 view/single;角标仍多选) by xu 20260109 -->
- <ss-list-card v-else :item="item" :ss-obj-name="ssObjName" :card-click-action="cardClickAction"
- @toggle-select="handleToggleSelect"></ss-list-card>
- </template>
- <template v-for="(item, i) in listConfig.list" :key="i">
- <ss-folder-card v-if="item.children" :item="item"></ss-folder-card>
- <!-- 功能说明:传入 ssObjName + cardClickAction(卡片主体点击 view/single;角标仍多选) by xu 20260109 -->
- <ss-list-card v-else :item="item" :ss-obj-name="ssObjName" :card-click-action="cardClickAction"
- @toggle-select="handleToggleSelect"></ss-list-card>
- </template>
- <ss-page
- :key="String(ssPaging?.pageNo || 1) + '-' + String(ssPaging?.rowNumPer || 12) + '-' + String(ssPaging?.rowNum || 0)" <%-- // 功能说明:分页默认每页12条 by xu 20260116 --%>
- :total="Number(ssPaging?.rowNum || 0)"
- :size="Number(ssPaging?.rowNumPer || 12)" <%-- // 功能说明:分页默认每页12条 by xu 20260116 --%>
- :page="Number(ssPaging?.pageNo || 1)"
- @change="handlePageChange">
- </ss-page>
- </div>
- </form>
- <!-- 功能说明:右侧业务面板(ss-sidebar),用于已选/服务/预定/图表等 by xu 20260113 -->
- <ss-sidebar
- :buttons="sidebarButtons"
- :panels="sidebarPanels"
- @remove="handleSidebarRemove"
- ></ss-sidebar>
- </div>
- </div>
- </body>
- </html>
- <script type="module">
- <%-- 打印新UI相关json对象 --%>
- const data = {
- ssObjName: "${ssObjName}", // 对象名
- // 后端注入的 ssServ 接口名(用于 ajax 拉取查询首页/列表数据)
- ssSearchPobjHomeServName: "${ssSearchPobjHomeServName}", // <对象名>_cxsy
- ssSearchPobjListServName: "${ssSearchPobjListServName}", // <对象名>_cxlb
- // 接口返回(调试用,可删)
- ssHomeResp: null,
- ssListResp: null,
- // 页面状态
- homeReady: false,
- userInteracted: false, // 用户触发(搜索/翻页/切换范围)
- loadingHome: false,
- loadingList: false,
- // 首页接口返回字段(按 page/objlist修改.txt)
- searchFieldList: [], // 查询条件字段
- rootFuncList: [], // 根功能
- hasKeyword: false, // 是否有关键词
- hasScope: false, // 是否带范围
- thnType: 0, // 缩略图类型:1横向 2竖向 3方形 4圆形(目前仅用 1/2,其他先不处理)
- ssPaging: {pageNo: 1, rowNumPer: 12, rowNum: 0}, // 翻页信息 // 功能说明:默认每页12条 by xu 20260116
- rbarFuncList: [], // 右侧栏功能
- rbarTabNameList: [], // 右侧栏选项卡
- pstatList: [], // 功能说明:个人统计图表配置(右侧图表区) by xu 20260114
- // 查询表单参数(用于接口入参)
- form: {management: "99", isFulltext: "0", isAnd: "", ssKeyword: ""},
- systemType: window.ss.dom.TYPE,
- listConfig: window.ss.dom.listConfig || {draftbox: [], list: []},
- formElemConfig: window.ss.dom.formElemConfig || {},
- // 卡片区域:自动分列/宽度平分 by xu 20260109
- cardGridKind: '', // none/photo/thumbnail by xu 20260109
- // 卡片主体点击动作:view=查看(调用 item.onclick);single=单选互斥;角标仍多选 by xu 20260109
- cardClickAction: "view", // 功能说明:默认先用 view,首页接口若返回预定面板则切到 single by xu 20260114
- hasBookPanel: false, // 功能说明:是否存在预定面板(驱动 cardClickAction + 选中后联动 cxycl) by xu 20260116
- hasServPanel: false, // 功能说明:是否存在服务面板(严格依赖首页 rbarTabNameList 是否返回 rbarServ) by xu 20260116
- yclLoading: false, // 功能说明:已选对象联动(cxycl)加载状态 by xu 20260114
- yclResp: null, // 功能说明:已选对象联动接口返回(调试/兜底) by xu 20260114
- // 右侧已选(用于未来接入 ss-sidebar 的已选面板) by xu 20260109
- selectedItems: [],
- // 右侧边栏:顶部按钮(由首页接口 rbarFuncList 初始化)
- sidebarButtons: [],
- // 右侧边栏:分区配置(由 initSidebarPanels 初始化) by xu 20260113
- sidebarPanels: [],
- <%-- 实际没用上,注释掉 Ben(20251225) btnElemConfig:window.ss.dom.btnElemConfig, --%>
- searchButtonConfigCheckId: "99",
- searchButtonConfig: [
- {
- id: "99",
- desc: "所有",
- callback: () => window.__objListVm && window.__objListVm.switchScope(99),
- },
- {
- id: "2",
- desc: "管理",
- callback: () => window.__objListVm && window.__objListVm.switchScope(2),
- },
- {
- id: "1",
- desc: "创建",
- callback: () => window.__objListVm && window.__objListVm.switchScope(1),
- },
- {
- id: "3",
- desc: "已办",
- callback: () => window.__objListVm && window.__objListVm.switchScope(3),
- },
- {
- id: "55",
- desc: "停用",
- callback: () => window.__objListVm && window.__objListVm.switchScope(55),
- }
- ],
- }
- if (window.ss.dom.formElemConfig) {
- Object.entries(window.ss.dom.formElemConfig).forEach(([key, config]) => {
- data[key] = config.value;
- // 处理 objPicker
- if (config.type === window.ss.dom.TYPE.OBJPICKER) {
- data[key + "ObjPicker"] = true;
- data[key + "Option"] = [];
- data[key + "Url"] = config.optUrl;
- }
- })
- }
- SS.ready(function () {
- // 功能说明:右侧 ss-sidebar__inner 统一增加 padding-top=10px(撤回外层 wrapper 方案) by xu 20260114
- try {
- if (!document.getElementById("ss-objlist-sidebar-inner-padding")) {
- var st = document.createElement("style");
- st.id = "ss-objlist-sidebar-inner-padding";
- st.type = "text/css";
- st.appendChild(document.createTextNode("#app .ss-sidebar__inner{padding-top:10px;}"));
- document.head.appendChild(st);
- }
- } catch (e) {
- }
- window.ss.dom.initializeFormApp({
- el: "#app",
- data() {
- return data;
- },
- methods: {
- openServiceDialog(srv) {
- if (!srv) return;
- // 功能说明:优先 ssToken 打开;若无 ssToken(如 rootFuncList),回退 servName+dest+parm 拼接 by xu 20260114
- const token = String(srv.ssToken || "").trim();
- let url = "";
- if (token) {
- url = "/service?ssToken=" + encodeURIComponent(token);
- } else if (srv.servName) {
- url = "/service?ssServ=" + encodeURIComponent(String(srv.servName));
- if (srv.dest) url += "&ssDest=" + encodeURIComponent(String(srv.dest));
- // 功能说明:兼容后端字段名 parm/param(两种都可能出现) by xu 20260114
- const p = (srv.parm !== undefined ? srv.parm : srv.param);
- try {
- if (typeof p === "string") {
- const s = p.trim();
- if (s && (s[0] === "{" || s[0] === "[")) {
- const obj = JSON.parse(s);
- if (obj && typeof obj === "object") {
- Object.entries(obj).forEach(([k, v]) => {
- if (v === undefined || v === null) return;
- url += "&" + encodeURIComponent(k) + "=" + encodeURIComponent(String(v));
- });
- }
- } else if (s) {
- url += (s.startsWith("&") ? "" : "&") + s;
- }
- } else if (p && typeof p === "object") {
- Object.entries(p).forEach(([k, v]) => {
- if (v === undefined || v === null) return;
- url += "&" + encodeURIComponent(k) + "=" + encodeURIComponent(String(v));
- });
- }
- } catch (_) {
- }
- } else if (srv.dest) {
- // 功能说明:报表场景可能后端不返回 fwm(servName),支持仅用 ssDest 打开 by xu 20260115
- url = "/service?ssDest=" + encodeURIComponent(String(srv.dest));
- // 功能说明:兼容后端字段名 parm/param(两种都可能出现) by xu 20260115
- const p = (srv.parm !== undefined ? srv.parm : srv.param);
- try {
- if (typeof p === "string") {
- const s = p.trim();
- if (s && (s[0] === "{" || s[0] === "[")) {
- const obj = JSON.parse(s);
- if (obj && typeof obj === "object") {
- Object.entries(obj).forEach(([k, v]) => {
- if (v === undefined || v === null) return;
- url += "&" + encodeURIComponent(k) + "=" + encodeURIComponent(String(v));
- });
- }
- } else if (s) {
- url += (s.startsWith("&") ? "" : "&") + s;
- }
- } else if (p && typeof p === "object") {
- Object.entries(p).forEach(([k, v]) => {
- if (v === undefined || v === null) return;
- url += "&" + encodeURIComponent(k) + "=" + encodeURIComponent(String(v));
- });
- }
- } catch (_) {
- }
- }
- // 功能说明:打开弹窗时透传当前搜索条件(searchFieldList.name -> form[name])by xu 20260116
- try {
- const list = Array.isArray(this.searchFieldList) ? this.searchFieldList : [];
- const escapeRegExp = (s) => String(s || "").replace(/[.*+?^{}$()|[\]\\]/g, "\\$&");
- const hasParam = (u, key) => {
- if (!key) return false;
- const re = new RegExp("([?&])" + escapeRegExp(key) + "=");
- return re.test(String(u || ""));
- };
- const appendParam = (u, key, value) => {
- if (!key) return u;
- if (value === undefined || value === null) return u;
- const s = String(value);
- if (s === "") return u;
- if (hasParam(u, key)) return u;
- return (
- u +
- (u.indexOf("?") > -1 ? "&" : "?") +
- encodeURIComponent(String(key)) +
- "=" +
- encodeURIComponent(s)
- );
- };
- list.forEach((f) => {
- const key = f && f.name;
- if (!key) return;
- const v = this.form ? this.form[key] : undefined;
- if (Array.isArray(v)) {
- v.forEach((vv) => {
- url = appendParam(url, key, vv);
- });
- return;
- }
- url = appendParam(url, key, v);
- });
- } catch (_) {
- }
- if (!url) return;
- console.log("[objList] openServiceDialog url =", url, "srv =", srv);
- wd.display.showComponent({
- show: ["wdDialog"],
- url,
- title: srv.title || srv.desc || "",
- width: srv.width,
- height: srv.height,
- minHeight: srv.minHeight,
- maxHeight: srv.maxHeight,
- showTitle: srv.showTitle,
- });
- },
- formatValByFmt(val, fmt) {
- // 功能说明:统一按 fmt 动态格式化 {val, fmt}(支持任意组合 yyyy/MM/dd/HH/mm/ss),用于 title/catList by xu 20260114
- try {
- if (!fmt || val === undefined || val === null || val === "") return val;
- const raw = typeof val === "string"
- ? val.replace(/[\u202f\u00a0]/g, " ").replace(/ /g, " ").trim()
- : val;
- const d = raw instanceof Date ? raw : new Date(raw);
- if (isNaN(d.getTime())) return val;
- const pad2 = (n) => String(n).padStart(2, "0");
- const tokens = {
- yyyy: String(d.getFullYear()),
- MM: pad2(d.getMonth() + 1),
- M: String(d.getMonth() + 1),
- dd: pad2(d.getDate()),
- d: String(d.getDate()),
- HH: pad2(d.getHours()),
- H: String(d.getHours()),
- mm: pad2(d.getMinutes()),
- m: String(d.getMinutes()),
- ss: pad2(d.getSeconds()),
- s: String(d.getSeconds()),
- };
- const f = String(fmt);
- // 不写死具体 fmt:按 token 替换;若 fmt 不含 token,则回退原值 by xu 20260114
- if (!/(yyyy|MM|dd|HH|mm|ss|M|d|H|m|s)/.test(f)) return val;
- return f.replace(/yyyy|MM|dd|HH|mm|ss|M|d|H|m|s/g, (k) => tokens[k] ?? k);
- } catch (_) {
- return val;
- }
- },
- buildThumbUrl(thn) {
- if (!thn) return "";
- return "/service?ssServ=dlByHttp&type=img&path=" + encodeURIComponent(String(thn));
- },
- normalizeObjToCard(row) {
- const card = {
- _raw: row,
- ssObjName: row?.ssObjName,
- objNum: row?.ssObjId,
- title: "",
- desc: row?.abs || "",
- tags: [],
- buttons: [],
- stateIconList: row?.stateIconList || [],
- statusIcons: [],
- bigState: row?.bigState,
- bookState: row?.bookState,
- };
- // 功能说明:将后端 stateIconList 映射为卡片右上角 statusIcons(后缀=1忽略;icon-state-*/icon-servType-* 只要后缀!=1 则显示 icon-sauth) by xu 20260116
- try {
- const rawList = Array.isArray(row?.stateIconList) ? row.stateIconList : [];
- const icons = [];
- let showSauth = false;
- rawList.forEach((s) => {
- const cls = String(s || "").trim();
- if (!cls) return;
- const m = cls.match(/-(\d+)$/);
- const code = m ? Number(m[1]) : NaN;
- if (code === 1) return; // 约定:后缀为 1 的不处理 by xu 20260116
- // 约定:state/servType 只要有一个后缀不为 1,就展示一个 icon-sauth(去重) by xu 20260116
- if (cls.indexOf("icon-state-") === 0 || cls.indexOf("icon-servType-") === 0) {
- showSauth = true;
- }
- });
- if (showSauth) {
- icons.push({class: "menu-base-icon icon-sauth", title: "使用中"});
- }
- card.statusIcons = icons;
- } catch (e) {
- }
- // 功能说明:title 可能是 {val, fmt}(日期/时间),此处按 fmt 做格式化(避免显示英文时间串) by xu 20260114
- try {
- const t = row?.title;
- if (t && typeof t === "object" && t.val !== undefined) {
- card.title = String(this.formatValByFmt(t.val, t.fmt) ?? "");
- } else {
- card.title = String(row?.title?.val || row?.title || "");
- }
- } catch (_) {
- card.title = String(row?.title?.val || row?.title || "");
- }
- // 功能说明:bookState 优先于 bigState(0绿空闲/1黄预订中/2红),映射到卡片 status by xu 20260116
- const hasBookState = row?.bookState !== undefined && row?.bookState !== null && row?.bookState !== "";
- const hasBigState = row?.bigState !== undefined && row?.bigState !== null && row?.bigState !== "";
- if (hasBookState || hasBigState) {
- const stateVal = hasBookState ? Number(row.bookState) : Number(row.bigState);
- card.status = stateVal === 2 ? "disabled" : stateVal === 1 ? "unavailable" : stateVal === 0 ? "available" : "";
- }
- // thnType:缩略图类型(目前仅处理 1=横向、2=竖向;其余先按无缩略图处理)
- // 注意:即使 thn 为空,只要 thnType 存在,也要保留缩略图区域,以显示“对象号_icon”占位
- const thnType = Number(this.thnType || 0);
- if (thnType === 1) card.thumbType = "thumbnail"; // 横向:180×100
- else if (thnType === 2) card.thumbType = "photo"; // 竖向:73×100(默认)
- // thn:缩略图不为空 => 有图片(否则 ss-list-card 会按 thumbType 显示占位 icon)
- if (row?.thn) card.thumb = this.buildThumbUrl(row.thn);
- if (Array.isArray(row?.catList)) {
- row.catList.forEach((c) => {
- if (!c || !c.desc) return;
- // 功能说明:catList 存在 fmt 时格式化时间(yyyy-MM-dd / yyyy-MM-dd HH:mm:ss),避免直接显示英文时间串 by xu 20260114
- const val = this.formatValByFmt(c.val, c.fmt);
- card.tags.push({[c.desc]: val});
- });
- }
- if (Array.isArray(row?.chgRootFuncList)) {
- row.chgRootFuncList.forEach((btn) => {
- card.buttons.push({
- id: btn.id,
- titlexxx: btn.title,
- class: "cart-list-setting",
- title: btn.desc || btn.title || "",
- onclick: () => this.openServiceDialog(btn),
- });
- });
- }
- if (row?.play) {
- card.onclick = () => this.openServiceDialog(row.play);
- }
- return card;
- },
- buildPstatChartPanels(bizIcon) {
- // 功能说明:根据 pstatList 构建右侧图表面板(type=chart),用于 ss-sidebar 底部图表区 by xu 20260114
- const list = Array.isArray(this.pstatList) ? this.pstatList : [];
- return list
- .filter((it) => Number(it?.grtjlbm) === 1)
- .map((it) => ({
- type: "chart",
- _grtjid: it?.grtjid,
- title: it?.mc || "",
- iconClass: bizIcon,
- // 功能说明:右侧面板图表高度做上限(避免后端 gd 过大导致 sidebar 竖向撑爆) by xu 20260114
- height: (() => {
- const gd = Number(it?.gd);
- const h = (isFinite(gd) && gd > 0) ? Math.max(160, Math.min(260, gd)) : 220;
- return String(h) + "px";
- })(),
- // 功能说明:统计图默认先用柱状图(后续可按后端类型再扩展) by xu 20260115
- options: {
- xAxis: {type: "category", data: []},
- yAxis: {type: "value"},
- series: [{type: "bar", data: []}]
- },
- }));
- },
- loadPstatChartData(panel) {
- // 功能说明:根据 grtjid 调 wrPchtPlay 获取真实数据,并写回 panel.options 触发渲染 by xu 20260114
- const grtjid = panel?._grtjid;
- if (!grtjid) return Promise.resolve(null);
- return this.callSsService("wrPchtPlay", {grtjid})
- .then((res) => {
- const payload = res && typeof res === "object" ? (res.ssData || res) : null;
- // 功能说明:兼容 wrPchtPlay 返回 dataArray(name=mc,value=sl) by xu 20260114
- let list =
- (payload && (payload.dataArray || payload.dataList || payload.list || payload.data)) ||
- payload;
- if (!Array.isArray(list)) list = [];
- const data = list
- .map((it) => {
- if (!it || typeof it !== "object") return null;
- const name = it.name ?? it.mc ?? it.desc ?? it.title;
- const value = it.value ?? it.sl ?? it.zrs ?? it.count ?? it.num;
- if (name === undefined || name === null) return null;
- const v = Number(value);
- return {name: String(name), value: isNaN(v) ? 0 : v};
- })
- .filter(Boolean);
- // 功能说明:统计图默认先用柱状图(tooltip/label 显示数值;全 0 也正常展示) by xu 20260115
- const xData = data.map((it) => it.name);
- const yData = data.map((it) => it.value);
- panel.options = {
- color: ["#5470C6", "#91CC75", "#FAC858", "#EE6666", "#73C0DE", "#3BA272", "#FC8452", "#9A60B4", "#EA7CCC"],
- tooltip: {trigger: "axis", axisPointer: {type: "shadow"}},
- grid: {left: "3%", right: "3%", top: 12, bottom: 24, containLabel: true},
- xAxis: {
- type: "category",
- data: xData,
- axisLabel: {interval: 0, rotate: xData.length > 6 ? 30 : 0}
- },
- yAxis: {type: "value"},
- series: [{
- type: "bar",
- barMaxWidth: 36,
- data: yData,
- label: {show: true, position: "top"},
- }],
- };
- // 功能说明:强制触发 sidebarPanels 更新(避免仅在选中卡片后才刷新图表) by xu 20260114
- try {
- this.sidebarPanels = (this.sidebarPanels || []).slice();
- } catch (e) {
- }
- // 功能说明:图表初次渲染时容器尺寸可能未稳定,nextTick 后触发 resize,避免“未选中=灰色圆” by xu 20260114
- try {
- const self = this;
- if (self && self.$nextTick) {
- self.$nextTick(function () {
- try {
- window.dispatchEvent(new Event("resize"));
- } catch (e) {
- }
- });
- }
- setTimeout(function () {
- try {
- window.dispatchEvent(new Event("resize"));
- } catch (e) {
- }
- }, 120);
- } catch (e) {
- }
- return res;
- })
- .catch((e) => {
- console.error("loadPstatChartData failed", grtjid, e);
- return null;
- });
- },
- applyPobjHomeData(ssData) {
- if (!ssData || typeof ssData !== "object") return;
- this.ssHomeResp = ssData;
- this.homeReady = true;
- this.userInteracted = false;
- this.ssObjName = ssData.ssObjName || this.ssObjName; // 对象名
- this.searchFieldList = Array.isArray(ssData.searchFieldList) ? ssData.searchFieldList : []; // 查询条件字段
- this.rootFuncList = Array.isArray(ssData.rootFuncList) ? ssData.rootFuncList : []; // 根功能
- this.hasKeyword = !!ssData.hasKeyword; // 是否有关键词
- this.hasScope = !!ssData.hasScope; // 是否带范围
- this.thnType = Number(ssData.thnType || 0); // 缩略图类型
- this.ssPaging = ssData.ssPaging || this.ssPaging; // 翻页信息
- this.rbarFuncList = Array.isArray(ssData.rbarFuncList) ? ssData.rbarFuncList : []; // 右侧栏功能
- this.rbarTabNameList = Array.isArray(ssData.rbarTabNameList) ? ssData.rbarTabNameList : []; // 右侧栏选项卡
- // 功能说明:cd 一级对象先强制显示“服务”tab(后端暂未返回 rbarServ,仅用于当前阶段联调) by xu 20260116
- if (String(this.ssObjName || "").trim().toLowerCase() === "cd" && !this.rbarTabNameList.includes("rbarServ") && !this.rbarTabNameList.includes("rbarserv")) {
- this.rbarTabNameList.push("rbarServ");
- }
- this.pstatList = Array.isArray(ssData.pstatList) ? ssData.pstatList : []; // 功能说明:个人统计图表配置 by xu 20260114
- // 功能说明:如果首页返回预定/服务面板(rbarBook/rbarbook/rbarServ),则卡片主体点击切到 single(单选互斥),否则保持 view(查看) by xu 20260116
- {
- const tabs = Array.isArray(this.rbarTabNameList) ? this.rbarTabNameList : [];
- const norm = (s) => String(s || "").trim().toLowerCase();
- this.hasBookPanel = tabs.some((t) => norm(t) === "rbarbook"); // 功能说明:预定tab存在才回显bookList by xu 20260116
- this.hasServPanel = tabs.some((t) => norm(t) === "rbarserv"); // 功能说明:服务tab存在才回显servList by xu 20260116
- this.cardClickAction = (this.hasBookPanel || this.hasServPanel) ? "single" : "view"; // 功能说明:预定/服务任一存在则单选联动 by xu 20260116
- }
- this.searchButtonConfigCheckId = String(this.form?.management || "99");
- // 用当前表单参数初始化 form(确保 v-model 有值)
- const curParams = this.getSearchFormParams();
- const nextForm = {...this.form, ...curParams};
- this.searchFieldList.forEach((f) => {
- if (f && f.name && !(f.name in nextForm)) nextForm[f.name] = "";
- });
- this.form = nextForm;
- this.searchButtonConfigCheckId = String(this.form?.management || "99");
- // 初始化列表(objList/draftList)
- const nextDraft = Array.isArray(ssData.draftList) ? ssData.draftList.map((r) => this.normalizeObjToCard(r)) : [];
- const nextList = Array.isArray(ssData.objList) ? ssData.objList.map((r) => this.normalizeObjToCard(r)) : [];
- if (this.listConfig) {
- this.listConfig.draftbox = nextDraft;
- this.listConfig.list = nextList;
- }
- // 列表数据更新后,重新探测卡片网格类型
- this.cardGridKind = this.detectCardGridKind();
- // 初始化右侧栏(选项卡 + 功能)
- const bizIcon = this.ssObjName ? ("menu-icon icon-obj-" + this.ssObjName) : "";
- const pickedPanel = {
- type: "list",
- title: "已选",
- count: this.selectedItems.length,
- iconClass: bizIcon,
- closable: true,
- itemLayout: "person",
- items: this.selectedItems,
- mode: "selected",
- itemAction: true,
- onClear: () => this.clearSelectedItems(),
- };
- // 功能说明:面板 key 兼容后端大小写(rbarBook/rbarbook/rbarServ),并移除“对象”tab by xu 20260116
- const titleMap = {rbarry: "人员", rbarbook: "预定", rbarserv: "服务"};
- const tabs = Array.isArray(this.rbarTabNameList) ? this.rbarTabNameList : [];
- const normKey = (s) => String(s || "").trim().toLowerCase();
- const tabPanels = tabs.map((k) => {
- const nk = normKey(k);
- // 功能说明:右侧栏去掉“对象”tab(即使后端返回 rbarObj 也忽略) by xu 20260116
- if (nk === "rbarobj") return null;
- const p = {
- type: "list",
- _tabKey: nk, // 功能说明:保存原始 tab key(用于后续写回 items) by xu 20260114
- title: titleMap[nk] || k,
- iconClass: bizIcon,
- items: [],
- itemAction: false,
- };
- // 功能说明:右侧“预定/服务”面板复用“已选”tab 的 person 布局(title+meta),避免渲染 ss-sidebar-tag by xu 20260116
- if (nk === "rbarbook") {
- p.itemLayout = "person";
- }
- if (nk === "rbarserv") {
- p.itemLayout = "simple"; // 功能说明:服务面板只回显 mc(名称),不需要 meta 槽位 by xu 20260116
- }
- // 功能说明:右侧“人员”面板先做前端 mock 搜索头(仅展示,不接后端) by xu 20260114
- if (nk === "rbarry") {
- p.iconClass = "menu-icon icon-obj-ry";
- p.count = 0;
- p.headerFilters = [
- {
- key: "keyword",
- component: "ss-search-input",
- props: {name: "keyword", placeholder: "人员", width: "140px"},
- value: "",
- },
- ];
- p.headerSearchButton = true;
- p.onSearch = function (payload) {
- try {
- console.log("人员搜索", payload);
- } catch (_) {
- }
- };
- p.mode = "selected";
- p.items = [];
- p.itemAction = false;
- }
- return p;
- }).filter(Boolean);
- this.sidebarPanels = [pickedPanel, ...tabPanels];
- try {
- console.log("[pobj] sidebarPanels(init)", (this.sidebarPanels || []).map((p) => ({
- title: p?.title,
- type: p?.type,
- tab: p?._tabKey
- })));
- } catch (_) {
- } // 功能说明:打印初始化后的面板列表,排查缺少“对象/预定”tab by xu 20260116
- // 功能说明:将 pstatList=51 聚拢为一个“报表”面板(type=report-table),用于右侧报表区 by xu 20260115
- try {
- const reportList = (Array.isArray(this.pstatList) ? this.pstatList : []).filter((it) => Number(it?.grtjlbm) === 51);
- if (reportList.length) {
- this.sidebarPanels = this.sidebarPanels.concat([{
- type: "report-table",
- title: "报表",
- iconClass: bizIcon,
- items: reportList,
- // 功能说明:点击统计表单元格,优先按 fwm/bjm 组装后端 service 并弹窗 by xu 20260115
- onOpen: (srv) => this.openServiceDialog(srv),
- }]);
- }
- } catch (e) {
- }
- // 功能说明:将 pstatList=1 映射为右侧图表区(type=chart),并调 wrPchtPlay 拉取真实数据 by xu 20260114
- const chartPanels = this.buildPstatChartPanels(bizIcon);
- if (chartPanels.length) {
- this.sidebarPanels = this.sidebarPanels.concat(chartPanels);
- chartPanels.forEach((p) => this.loadPstatChartData(p));
- // 功能说明:追加 chartPanels 后触发一次 resize,避免首次进入图表为灰色圆(布局未完成) by xu 20260114
- try {
- setTimeout(function () {
- window.dispatchEvent(new Event("resize"));
- }, 0);
- } catch (_) {
- }
- }
- this.sidebarButtons = this.rbarFuncList.map((f) => ({
- id: f.id || f.servName,
- text: f.desc || f.title || "",
- onClick: () => this.openServiceDialog(f),
- }));
- },
- handleRootFuncClick(func) {
- this.openServiceDialog(func);
- },
- // 切换范围(所有/管理/创建/已办/停用)=> 刷新列表(不刷新右侧栏)
- switchScope(management) {
- if (this.loadingList) return;
- this.form.management = String(management);
- this.searchButtonConfigCheckId = String(management);
- this.ssPaging.pageNo = 1;
- this.userInteracted = true;
- this.loadPobjList();
- },
- // 提取当前表单参数(用于 ajax 调用 /service?ssServ=...)
- getSearchFormParams() {
- const params = {};
- try {
- const arr = $("#myForm").serializeArray();
- arr.forEach(({name, value}) => {
- if (!name) return;
- if (Object.prototype.hasOwnProperty.call(params, name)) {
- const cur = params[name];
- params[name] = Array.isArray(cur) ? cur.concat([value]) : [cur, value];
- } else {
- params[name] = value;
- }
- });
- } catch (e) {
- console.error("getSearchFormParams failed", e);
- }
- return params;
- },
- // 以 Vue data 为准,组装列表/搜索请求参数(避免依赖组件内部 input 的实现)
- getPobjParams() {
- const params = {};
- const form = this.form || {};
- Object.keys(form).forEach((k) => {
- const v = form[k];
- if (v === undefined || v === null) return;
- if (typeof v === "object") return;
- params[k] = v;
- });
- if (this.ssPaging) {
- params.pageNo = this.ssPaging.pageNo;
- params.rowNumPer = this.ssPaging.rowNumPer;
- params.rowNum = this.ssPaging.rowNum;
- }
- return params;
- },
- // 通用:调用后端 service(统一返回原生 Promise,避免 jqXHR 不支持 finally/catch)
- callSsService(ssServ, extraParams = {}) {
- if (!ssServ) return Promise.resolve(null);
- return new Promise((resolve) => {
- // 功能说明:演示兜底——后端 wrPchtPlay 异常时,固定 grtjid 返回 mock 数据 by xu 20260116
- try {
- const serv = String(ssServ || "").trim();
- const grtjid = Number(extraParams?.grtjid);
- if (serv === "wrPchtPlay" && (grtjid === 57243 || grtjid === 57241)) {
- const mockMap = {
- 57243: {
- ssCode: 0,
- ssData: {
- dataArray: [
- {
- tjzbm: 9005000201,
- sjtjzbm: 90050002,
- mc: "教室",
- ms: "教室",
- xh: 1,
- sl: 7,
- jsgs: "yfbl_js",
- dxm: "cd"
- },
- {
- tjzbm: 9005000202,
- sjtjzbm: 90050002,
- mc: "图书馆",
- ms: "图书馆",
- xh: 2,
- sl: 8,
- jsgs: "yfbl_tsg",
- dxm: "cd"
- },
- {
- tjzbm: 9005000203,
- sjtjzbm: 90050002,
- mc: "学生宿舍",
- ms: "学生宿舍",
- xh: 3,
- sl: 5,
- jsgs: "yfbl_xsss",
- dxm: "cd"
- },
- {
- tjzbm: 9005000204,
- sjtjzbm: 90050002,
- mc: "办公室",
- ms: "办公室",
- xh: 4,
- sl: 17,
- jsgs: "yfbl_bgs",
- dxm: "cd"
- },
- {
- tjzbm: 9005000205,
- sjtjzbm: 90050002,
- mc: "食堂",
- ms: "食堂",
- xh: 5,
- sl: 8,
- jsgs: "yfbl_st",
- dxm: "cd"
- },
- {
- tjzbm: 9005000206,
- sjtjzbm: 90050002,
- mc: "教师宿舍",
- ms: "教师宿舍",
- xh: 6,
- sl: 9,
- jsgs: "yfbl_jsss",
- dxm: "cd"
- },
- ],
- grtj: {
- grtjid: 57243,
- jlztm: 1,
- yjtjzbm: 0,
- mc: "各类用房详细分布",
- tjtlbm: 21,
- grtjlbm: 0,
- xh: 0,
- kd: 0,
- gd: 0,
- tabName: "grtj",
- idName: "grtjid",
- fieldTypeMap: {
- kd: 2,
- jlztm: 2,
- xh: 2,
- grtjlbm: 2,
- gd: 2,
- grtjid: 4,
- tjtlbm: 2,
- mc: 1,
- dxm: 1,
- yyryid: 5,
- grtjmbid: 5,
- yjtjzbm: 4
- },
- },
- },
- },
- 57241: {
- ssCode: 0,
- ssData: {
- dataArray: [
- {
- tjzbm: 9005000101,
- sjtjzbm: 90050001,
- mc: "教学及辅助用房",
- ms: "教学及辅助用房",
- xh: 1,
- sl: 49,
- jsgs: "jzmjbl_jxjfzyf",
- dxm: "cd"
- },
- {
- tjzbm: 9005000102,
- sjtjzbm: 90050001,
- mc: "行政办公用房",
- ms: "行政办公用房",
- xh: 2,
- sl: 17,
- jsgs: "jzmjbl_xzbgyf",
- dxm: "cd"
- },
- {
- tjzbm: 9005000103,
- sjtjzbm: 90050001,
- mc: "生活用房",
- ms: "生活用房",
- xh: 3,
- sl: 25,
- jsgs: "jzmjbl_shyf",
- dxm: "cd"
- },
- {
- tjzbm: 9005000104,
- sjtjzbm: 90050001,
- mc: "其他用房",
- ms: "其他用房",
- xh: 4,
- sl: 5,
- jsgs: "jzmjbl_qtyf",
- dxm: "cd"
- },
- ],
- grtj: {
- grtjid: 57241,
- jlztm: 1,
- yjtjzbm: 0,
- mc: "校舍建筑面积总体分布",
- tjtlbm: 21,
- grtjlbm: 0,
- xh: 0,
- kd: 0,
- gd: 0,
- tabName: "grtj",
- idName: "grtjid",
- fieldTypeMap: {
- kd: 2,
- jlztm: 2,
- xh: 2,
- grtjlbm: 2,
- gd: 2,
- grtjid: 4,
- tjtlbm: 2,
- mc: 1,
- dxm: 1,
- yyryid: 5,
- grtjmbid: 5,
- yjtjzbm: 4
- },
- },
- },
- },
- };
- return resolve(mockMap[String(grtjid)] || null);
- }
- } catch (e) {
- }
- $.ajax({
- type: "get",
- url: "/service",
- data: {ssServ, ...extraParams},
- dataType: "text",
- })
- .done((text) => {
- if (typeof text !== "string") return resolve(text);
- const t = text.trim();
- if (!t) return resolve(null);
- try {
- return resolve(JSON.parse(t));
- } catch (_) {
- return resolve(text);
- }
- })
- .fail((xhr, status, err) => {
- console.error("callSsService failed", ssServ, status, err);
- resolve(null);
- });
- });
- },
- // 初始化:拉取查询首页数据(搜索条件/初始列表/右侧面板等)
- loadPobjHome() {
- const ssServ = this.ssSearchPobjHomeServName;
- if (!ssServ) return Promise.resolve(null);
- if (this.loadingHome) return Promise.resolve(null);
- const startedAt = Date.now();
- this.loadingHome = true;
- this.homeReady = false;
- this.userInteracted = false;
- const params = this.getPobjParams();
- return this.callSsService(ssServ, params)
- .then((res) => {
- const payload = res && typeof res === "object" ? (res.ssData || res) : null;
- this.applyPobjHomeData(payload);
- console.log("[pobj] home", ssServ, res);
- return res;
- })
- .finally(() => {
- const delay = Math.max(0, 200 - (Date.now() - startedAt));
- setTimeout(() => {
- this.loadingHome = false;
- }, delay);
- });
- },
- applyPobjListData(ssData) {
- if (!ssData || typeof ssData !== "object") return;
- // thnType(若列表接口也返回,则更新;一般由首页接口返回)
- if (ssData.thnType != null) this.thnType = Number(ssData.thnType || 0);
- if (ssData.ssPaging) {
- this.ssPaging = {
- ...this.ssPaging,
- ...ssData.ssPaging,
- pageNo: Number(ssData.ssPaging.pageNo || 1),
- rowNumPer: Number(ssData.ssPaging.rowNumPer || 12), // 功能说明:分页默认每页12条 by xu 20260116
- rowNum: Number(ssData.ssPaging.rowNum || 0),
- };
- }
- const nextList = Array.isArray(ssData.objList) ? ssData.objList.map((r) => this.normalizeObjToCard(r)) : [];
- if (this.listConfig) this.listConfig.list = nextList;
- this.cardGridKind = this.detectCardGridKind();
- },
- // 功能说明:将 <对象名>_cxycl 返回的 bookList 写回右侧预定面板 by xu 20260114
- applyPobjYclData(ssData) {
- // 功能说明:兼容返回结构(ssData 可能是整包 {ssCode,ssData} 或直接 ssData),避免“预定tab不回显” by xu 20260116
- if (!ssData) return;
- const data = (ssData && typeof ssData === "object" && ssData.ssData && typeof ssData.ssData === "object") ? ssData.ssData : ssData;
- if (!data || typeof data !== "object") return;
- const ensurePanel = (tabKeyLower, title) => {
- // 功能说明:严格依赖首页 rbarTabNameList 决定是否允许创建面板:未返回 rbarServ 时即使 cxycl 有 servList 也不处理 by xu 20260116
- if (tabKeyLower === "rbarbook" && !this.hasBookPanel) return null;
- if (tabKeyLower === "rbarserv" && !this.hasServPanel) return null;
- const panels = Array.isArray(this.sidebarPanels) ? this.sidebarPanels : [];
- let p = panels.find((it) => String(it?._tabKey || "").toLowerCase() === tabKeyLower);
- if (p) return p;
- const idx = panels.findIndex((it) => it?.type === "chart");
- const insertAt = idx >= 0 ? idx : panels.length;
- p = {
- type: "list",
- _tabKey: tabKeyLower,
- title,
- iconClass: this.ssObjName ? ("menu-icon icon-obj-" + this.ssObjName) : "",
- items: [],
- itemAction: false,
- };
- // 功能说明:预定面板默认使用 person 布局(title+meta) by xu 20260116
- if (tabKeyLower === "rbarbook") p.itemLayout = "person";
- if (tabKeyLower === "rbarserv") p.itemLayout = "simple"; // 功能说明:服务面板只回显 mc(名称) by xu 20260116
- panels.splice(insertAt, 0, p);
- this.sidebarPanels = panels;
- return p;
- };
- const fmtDt = (v) => { // 功能说明:JSP 页面避免使用 JS 模板字符串插值(可能被 JSP EL 干扰),统一用字符串拼接 by xu 20260114
- if (v === undefined || v === null || v === "") return "";
- const d = new Date(v);
- if (!isNaN(d.getTime())) {
- const pad2 = (n) => String(n).padStart(2, "0");
- return (
- String(d.getFullYear()) +
- "-" +
- pad2(d.getMonth() + 1) +
- "-" +
- pad2(d.getDate()) +
- " " +
- pad2(d.getHours()) +
- ":" +
- pad2(d.getMinutes())
- );
- }
- return String(v);
- };
- const bookList = Array.isArray(data.bookList) ? data.bookList : [];
- const servList = Array.isArray(data.servList) ? data.servList : []; // 功能说明:将 <对象名>_cxycl 返回的 servList 写回右侧服务面板 by xu 20260116
- try {
- console.log("[pobj] cxycl bookList", {len: bookList.length, bookList: bookList});
- } catch (_) {
- } // 功能说明:打印 cxycl 返回,排查“预定tab不回显” by xu 20260116
- // 功能说明:无论 bookList 是否为空,都要写回面板(为空则清空旧数据),避免“切换对象但仍显示上一次预定人” by xu 20260114
- const bookPanel = ensurePanel("rbarbook", "预定");
- if (bookPanel) {
- bookPanel.itemLayout = "person"; // 功能说明:预定面板复用“已选”tab 的 person 布局(title+中间 meta 槽位),不走 tags by xu 20260114
- bookPanel.items = bookList.map((b) => ({
- _raw: b,
- id: b?.id,
- title: String(b?.ydr ?? ""), // 功能说明:预定面板 title=预订人 by xu 20260114
- meta: String(b?.ydrdh ?? ""), // 功能说明:预定面板中间槽位 meta=电话(同“已选”tab) by xu 20260114
- tags: [], // 功能说明:预定面板不使用 tags(避免自定义标签样式) by xu 20260114
- }));
- bookPanel.count = bookPanel.items.length;
- }
- // 功能说明:服务面板按预定(book)回显逻辑写回(title+meta),为空也要清空 by xu 20260116
- const servPanel = ensurePanel("rbarserv", "服务");
- if (servPanel) {
- servPanel.itemLayout = "simple"; // 功能说明:服务面板字段只有 id/mc,仅回显 mc(名称) by xu 20260116
- servPanel.items = servList.map((s) => ({
- _raw: s,
- id: s?.id, // 功能说明:服务面板 id=数据库ID by xu 20260116
- title: String(s?.mc ?? ""), // 功能说明:服务面板 title=mc(名称) by xu 20260116
- tags: [],
- }));
- servPanel.count = servPanel.items.length;
- }
- // 功能说明:强制触发 sidebarPanels 更新,避免仅修改子对象导致视图未刷新(预定tab回显不更新) by xu 20260116
- try {
- this.sidebarPanels = (this.sidebarPanels || []).slice();
- } catch (e) {
- }
- try {
- console.log("[pobj] cxycl bookPanel(after)", {
- title: bookPanel.title,
- tab: bookPanel._tabKey,
- count: bookPanel.count,
- first: bookPanel.items?.[0],
- });
- } catch (_) {
- } // 功能说明:打印写回后的面板状态,排查“预定tab不回显” by xu 20260116
- },
- // 功能说明:选中对象后联动调用 <对象名>_cxycl,填充右侧预定/服务面板 by xu 20260114
- loadPobjYclByItem(item) {
- if (!(this.hasBookPanel || this.hasServPanel)) return Promise.resolve(null); // 功能说明:预定/服务任一存在才调用 cxycl;否则不联动 by xu 20260116
- const objNum = item?.objNum || item?._raw?.ssObjId || item?._raw?.ssObjId;
- if (!objNum) return Promise.resolve(null);
- const ssServ = this.ssObjName ? (String(this.ssObjName) + "_cxycl") : "";
- if (!ssServ) return Promise.resolve(null);
- const reqId = (this.__yclReqId = (this.__yclReqId || 0) + 1);
- this.yclLoading = true;
- // 功能说明:cxycl 需要同时传入 ssObjIdName=<对象名>id,且把对象ID用该字段名提交(如 cdid=90052) by xu 20260114
- const ssObjIdName = String(this.ssObjName || "") + "id";
- const params = {ssObjName: this.ssObjName, ssObjIdName: ssObjIdName, ssObjId: objNum};
- params[ssObjIdName] = objNum;
- return this.callSsService(ssServ, params)
- .then((res) => {
- if (reqId !== this.__yclReqId) return null;
- // 功能说明:兼容 $.ajax/axios 等不同返回结构,避免取错层级导致 bookList 为空 by xu 20260116
- const payload = res && typeof res === "object" ? (res.ssData || res?.data?.ssData || res?.data || res) : null;
- this.yclResp = payload;
- this.applyPobjYclData(payload);
- return res;
- })
- .finally(() => {
- if (reqId !== this.__yclReqId) return;
- this.yclLoading = false;
- });
- },
- // 拉取列表数据(分页/搜索等)
- loadPobjList() {
- const ssServ = this.ssSearchPobjListServName;
- if (!ssServ) return Promise.resolve(null);
- // 只有用户操作后才允许请求列表(避免初始化阶段出现第二个 loading)
- if (!this.userInteracted) return Promise.resolve(null);
- if (this.loadingList) return Promise.resolve(null);
- const startedAt = Date.now();
- this.loadingList = true;
- // 点击后立即清空列表区域,避免用户误以为没点到
- if (this.listConfig) {
- this.listConfig.draftbox = [];
- this.listConfig.list = [];
- }
- const params = this.getPobjParams();
- return this.callSsService(ssServ, params)
- .then((res) => {
- const payload = res && typeof res === "object" ? (res.ssData || res) : null;
- this.ssListResp = payload;
- this.applyPobjListData(payload);
- console.log("[pobj] list", ssServ, res);
- return res;
- })
- .finally(() => {
- const delay = Math.max(0, 200 - (Date.now() - startedAt));
- setTimeout(() => {
- this.loadingList = false;
- }, delay);
- });
- },
- // 初始化右侧边栏分区(已选 items 指向 selectedItems) by xu 20260113
- initSidebarPanels() {
- const bizIcon = this.ssObjName ? ('menu-icon icon-obj-' + this.ssObjName) : '';
- // 初始只放“已选”,其他分区由首页接口(rbarTabNameList)初始化
- this.sidebarPanels = [];
- this.sidebarButtons = [];
- },
- // 更新已选分区计数 by xu 20260113
- updatePickedPanelCount() {
- const pickedPanel = this.sidebarPanels?.find?.((p) => p?.title === '已选');
- if (pickedPanel) pickedPanel.count = this.selectedItems.length;
- },
- // 清空已选(右侧 header 清空按钮) by xu 20260113
- clearSelectedItems() {
- this.selectedItems.forEach((it) => {
- if (it) it._ssSelected = false;
- });
- this.selectedItems.splice(0, this.selectedItems.length);
- this.updatePickedPanelCount();
- },
- // 右侧边栏移除 -> 反向同步左侧卡片状态 by xu 20260113
- handleSidebarRemove(item) {
- if (!item) return;
- item._ssSelected = false;
- const idx = this.selectedItems.indexOf(item);
- if (idx > -1) this.selectedItems.splice(idx, 1);
- this.updatePickedPanelCount();
- },
- // 功能:探测当前业务列表卡片类型,用于网格列最小宽度 by xu 20260109
- detectCardGridKind() {
- const all = [].concat(this.listConfig?.draftbox || []).concat(this.listConfig?.list || []);
- if (all.some(it => String(it?.thumbType || '').trim() === 'thumbnail')) return 'thumbnail';
- if (all.some(it => !!it?.thumb || !!it?.thumbType)) return 'photo';
- return 'none';
- },
- // 左侧卡片角标选中(多选)+ 卡片主体单选互斥(exclusive) by xu 20260109
- handleToggleSelect({item, selected, exclusive}) {
- if (!item) return;
- // 已选分区:中间槽位 meta(可按业务改为后端字段) by xu 20260113
- if (!item.meta) item.meta = String(item.objNum || '');
- const idx = this.selectedItems.indexOf(item);
- if (exclusive && selected && this.cardClickAction === 'single') {
- this.selectedItems.forEach((it) => {
- if (it && it !== item) it._ssSelected = false;
- });
- // 不要重新赋值数组,保留引用(供右侧面板使用) by xu 20260109
- this.selectedItems.splice(0, this.selectedItems.length);
- this.selectedItems.push(item);
- this.updatePickedPanelCount();
- // 功能说明:预定模式下,单选互斥选中后联动加载右侧预定/服务数据 by xu 20260114
- this.loadPobjYclByItem(item);
- return;
- }
- if (selected) {
- if (idx === -1) this.selectedItems.push(item);
- // 功能说明:预定模式下,多选角标选中也可触发联动(以最近选中项为准) by xu 20260114
- this.loadPobjYclByItem(item);
- } else {
- if (idx > -1) this.selectedItems.splice(idx, 1);
- }
- this.updatePickedPanelCount();
- },
- handlePageChange({pageNo, rowNumPer, rowNum}) {
- // 翻页:调用列表接口刷新(不刷新右侧栏)
- if (this.loadingList) return;
- this.ssPaging.pageNo = pageNo;
- this.ssPaging.rowNumPer = rowNumPer;
- this.ssPaging.rowNum = rowNum;
- this.userInteracted = true;
- this.loadPobjList();
- },
- search() {
- // 搜索:回到第一页,调用列表接口刷新(不刷新右侧栏)
- if (this.loadingList) return;
- this.ssPaging.pageNo = 1;
- this.userInteracted = true;
- this.loadPobjList();
- }
- },
- mounted() {
- // 供 scope 回调引用(ss-search-button 的 opt.callback 里需要找到 vm)
- window.__objListVm = this;
- // 初始化:把 URL/form 上已有的参数合并到 form/ssPaging(支持回显 + ajax)
- const curParams = this.getSearchFormParams();
- this.form = {...this.form, ...curParams};
- if (curParams.pageNo) this.ssPaging.pageNo = Number(curParams.pageNo) || 1;
- if (curParams.rowNumPer) this.ssPaging.rowNumPer = Number(curParams.rowNumPer) || 12; // 功能说明:默认每页12条(兼容未传rowNumPer) by xu 20260116
- this.searchButtonConfigCheckId = String(this.form?.management || "99");
- // 初始化卡片网格类型(用于自动分列/宽度平分) by xu 20260109
- this.cardGridKind = this.detectCardGridKind();
- // 初始化右侧边栏分区 by xu 20260113
- this.initSidebarPanels();
- this.userInteracted = false;
- // 先跑通首页接口:用于初始化顶部搜索条件、初始列表、右侧栏
- this.loadPobjHome();
- }
- });
- });
- <%-- 原有的清令牌 --%>
- tokenCleanser("<ss:serv name='ss.clearPageToken'/>", {tokenList: "<%= pageContext.getAttribute(ss.page.PageC.PAGE_tokenList)%>"});
- </script>
|