objList.jsp 144 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389
  1. <%@ taglib prefix="ss" uri="/ssTag" %>
  2. <%@ page language="java" pageEncoding="UTF-8" isELIgnored="false" %>
  3. <%@ taglib uri="/ssTag" prefix="ss" %>
  4. <%pageContext.setAttribute("wdpageinformation", "{'hastab':'0'}");%>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta http-equiv="pragma" content="no-cache">
  9. <meta http-equiv="cache-control" content="no-cache">
  10. <meta http-equiv="expires" content="0">
  11. <script>window.loginStatus = "${empty sessionScope['ssUser']?'0':'1'}"</script>
  12. <ss:skin file='main.css'/>
  13. <script type="text/javascript" src="/ss/jquery/jquery.js"></script>
  14. <script type="text/javascript" src="/ss/artdialog/artDialogUtil.js"></script>
  15. <script type="text/javascript" src="/ss/js/base.js"></script>
  16. <script> if (!window.wd) var wd = {};
  17. if (!wd.display) wd.display = {};
  18. wd.display.wdDialogId = "objList";
  19. if (!wd.app) wd.app = {};
  20. wd.app.name = 'pms';</script>
  21. <script type="text/javascript" src="/ss/js/masklayer.js"></script>
  22. <script type="text/javascript" src="/ss/js/wdDialogInit.js"></script>
  23. <script type="text/javascript" src="/ss/js/common.js"></script>
  24. <script type="text/javascript" src="/ss/js/display.js"></script>
  25. <script type="text/javascript" src="/ss/js/edit.js"></script>
  26. <script type="text/javascript" src="/ss/nicescroll/jquery.nicescroll.js"></script>
  27. <script type="text/javascript" src="/ss/nicescroll/jquery.nicescroll.iframehelper.min.js"></script>
  28. <link rel="stylesheet" type="text/css" href="/ss/window/theme/dhtmlxwindows.css">
  29. <link rel="stylesheet" type="text/css" href="/ss/window/theme/dhx_blue/dhtmlxwindows_dhx_blue.css">
  30. <script type="text/javascript" src="/ss/window/dhtmlxcommon.js"></script>
  31. <script type="text/javascript" src="/ss/window/dhtmlxwindows.js"></script>
  32. <script type="text/javascript" src="/ss/window/dhtmlxcontainer.js"></script>
  33. <script type="text/javascript" src="/ss/js/common.js"></script>
  34. <script type="text/javascript" src="/ss/js/display.js"></script>
  35. <script type="text/javascript" src="/ss/js/edit.js"></script>
  36. <ssDlg setPval="true"/>
  37. <%-- setValue="true" close="true"。Lin --%>
  38. <script type="text/javascript" src="/ss/jquery/jquery.ellipsis.js"></script>
  39. <%-- 新UI引入的JS --%>
  40. <script src="/js/load.js"></script>
  41. <%-- ="/newUI/ss/js/base.js"。Lin(新UI) --%>
  42. <script src="/js/pageC.js"></script>
  43. <%-- 对象变动、修改、查看页,左则选项卡宽度 在里面定义 Ben(20251213) --%>
  44. <%-- 改为 <data@ss name="prt"/>。Lin
  45. <tab@ss name="print" enable="viewobject.funcMap.play.print"/> --%>
  46. <ss:data name='prt'/><%-- 初始化弹出窗口的打印按钮的后台数据 Ben--%>
  47. <%@include file="/ss/clip/prtIcon.jsp" %>
  48. <%-- 引入初始化弹出窗口的打印按钮的JS Ben--%>
  49. <script>
  50. window.ss.dom.formElemConfig = window.ss.dom.formElemConfig || {};
  51. </script>
  52. <style>
  53. /* 首页 loading:没加载完不显示页面内容 */
  54. .pobj-loading-home {
  55. position: fixed;
  56. left: 50%;
  57. top: 50%;
  58. transform: translate(-50%, -50%);
  59. z-index: 9999;
  60. pointer-events: none;
  61. }
  62. /* 列表 loading:区域性(搜索条件和分页之间) */
  63. .pobj-list-loading {
  64. width: 100%;
  65. min-height: 260px;
  66. display: flex;
  67. align-items: center;
  68. justify-content: center;
  69. }
  70. .pobj-spinner {
  71. width: 18px;
  72. height: 18px;
  73. border-radius: 50%;
  74. border: 2px solid rgba(0, 0, 0, 0.2);
  75. border-top-color: rgba(0, 0, 0, 0.65);
  76. animation: pobjSpin 0.8s linear infinite;
  77. }
  78. @keyframes pobjSpin {
  79. from {
  80. transform: rotate(0deg);
  81. }
  82. to {
  83. transform: rotate(360deg);
  84. }
  85. }
  86. </style>
  87. </head>
  88. <body>
  89. <div id="app">
  90. <div v-show="loadingHome" class="pobj-loading-home" style="display:none;">
  91. <div class="pobj-spinner"></div>
  92. </div>
  93. <%-- 功能说明:移除 thnType 直出调试内容,避免进入页面即输出 by xu 20260123 --%>
  94. <%-- 功能说明:主布局容器(左侧表单 + 右侧 ss-sidebar);为首屏 rowNumPer 自适应计算需要,避免用 homeReady 把容器 display:none(否则无法测量宽高) by xu 20260123 --%>
  95. <div style="display: flex; height: 100%; ">
  96. <%-- 功能说明:左侧表单区域在 flex 中占满剩余宽度(避免挤掉右侧 ss-sidebar) by xu 20260113 --%>
  97. <form class="page-container" id="myForm" style="flex: 1; min-width: 0; width: auto;"
  98. action="<ss:serv name='${currentService.servName}' dest='${currentService.dest}' parm='${currentService.parm}'/>"
  99. method="post">
  100. <input type="hidden" name="isAnd" v-model="form.isAnd"/>
  101. <input name="management" type="hidden" v-model="form.management"/>
  102. <input name="isFulltext" type="hidden" v-model="form.isFulltext"/>
  103. <%-- 功能说明:分页已完全走 Vue+Ajax(ssPaging),不再依赖旧表单提交隐藏域 by xu 20260123 --%>
  104. <%--搜索条件start--%>
  105. <div class="search-bar">
  106. <ss-breadcrumb></ss-breadcrumb>
  107. <div class="search-bar-contaienr">
  108. <template v-if="homeReady">
  109. <template v-for="field in searchFieldList" :key="field.name">
  110. <ss-objp
  111. v-if="field.cbName"
  112. v-model="form[field.name]"
  113. :name="field.name"
  114. :placeholder="field.desc"
  115. width="150px"
  116. :inp="true"
  117. url="/service?ssServ=loadObjpOpt&objectpickerdropdown1=1"
  118. :cb="field.cbName"
  119. ></ss-objp>
  120. <ss-search-date-picker
  121. v-else-if="field.type == 11"
  122. v-model="form[field.name]"
  123. :name="field.name"
  124. type="date"
  125. :placeholder="field.desc"
  126. width="140px"
  127. :fmt="field.fmt"
  128. ></ss-search-date-picker>
  129. <ss-search-date-picker
  130. v-else-if="field.type == 3"
  131. v-model="form[field.name]"
  132. :name="field.name"
  133. type="datetime"
  134. :placeholder="field.desc"
  135. width="200px"
  136. :fmt="field.fmt"
  137. ></ss-search-date-picker>
  138. <ss-search-input
  139. v-else
  140. :name="field.name"
  141. :placeholder="field.desc"
  142. v-model="form[field.name]"
  143. width="120px"
  144. @search="search"
  145. ></ss-search-input>
  146. </template>
  147. <ss-search-input
  148. v-if="hasKeyword"
  149. name="ssKeyword"
  150. placeholder="关键词"
  151. v-model="form.ssKeyword"
  152. width="120px"
  153. @search="search"
  154. ></ss-search-input>
  155. <ss-search-button
  156. v-if="hasScope"
  157. :key="'scope-' + String(searchButtonConfigCheckId)"
  158. text="所有"
  159. icon-class="nav-icon-search"
  160. :opt="searchButtonConfig"
  161. :check-id="searchButtonConfigCheckId"
  162. ></ss-search-button>
  163. <template v-for="func in rootFuncList" :key="func.id || func.servName">
  164. <ss-search-button
  165. :text="func.desc || func.title || ''"
  166. icon-class="nav-icon-add"
  167. :opt="subpageOpt"
  168. :check-id="selSubpage"
  169. @click="handleRootFuncClick(func)"
  170. ></ss-search-button>
  171. </template>
  172. </template>
  173. <template v-else>
  174. <%--新UI 单对象查询翻页end Ben --%>
  175. <%--关键词--%>
  176. <%-- 再去掉 -- 只支持一行。Lin
  177. <ss:rpt name='searchableFields' id='fieldsList'>
  178. --%>
  179. <ss:rpt name='fieldsList' id='searchItem'>
  180. <%
  181. ss.obj.ObjFieldB f = (ss.obj.ObjFieldB) pageContext.getAttribute("searchItem");
  182. pageContext.setAttribute("searchItemValue", request.getParameter(f.name));
  183. %>
  184. <%--codebook 使用select下拉--%>
  185. <ss:equal val='${empty searchItem.cbName}' val2='false'>
  186. <%-- 旧的objecPicker
  187. <input type="text" name="${searchItem.name}" value="${searchItemValue}"/>
  188. <input type="text" name="${searchItem.name}Name" placeholder="${searchItem.desc}" style="width:${searchItem.width};min-width: 108px;"/>
  189. <ss:equal val='${empty cadcadingInputs[searchItem.name]}' val2='true'>
  190. <ss:objp name='${searchItem.name}' cb='${searchItem.cbName}' inp='true' filterField='${searchItem.filterFieldStr}'/>
  191. </ss:equal> --%>
  192. <%-- 新UI --%>
  193. <!-- <ss-objp
  194. v-model="${searchItem.name}"
  195. name="${searchItem.name}"
  196. :options="${searchItem.name}Option"
  197. placeholder="${searchItem.desc}"
  198. width="120"
  199. input="true"
  200. ></ss-objp> -->
  201. <ss-objp
  202. v-model="${searchItem.name}"
  203. name="${searchItem.name}"
  204. :opt="${searchItem.name}Option"
  205. placeholder="${searchItem.desc}"
  206. width="150px"
  207. :inp="true"
  208. url="/service?ssServ=loadObjpOpt&objectpickerdropdown1=1"
  209. cb="${searchItem.cbName}"
  210. ></ss-objp>
  211. <script>
  212. /**
  213. * objectPicker(如:性别码)
  214. * optUrl:加载下拉菜单option选项的url
  215. */
  216. window.ss.dom.formElemConfig.${searchItem.name} = {
  217. desc: '${searchItem.desc}',
  218. value: '${searchItemValue}',
  219. optUrl: '123456',
  220. type: 2
  221. };//放当前页面表单元素配置的变量
  222. </script>
  223. </ss:equal>
  224. <%--codebook 使用input输入框--%>
  225. <ss:equal val='${empty searchItem.cbName}' val2='true'>
  226. <%--日期--%>
  227. <ss:equal val='${searchItem.type}'
  228. valList='3,11'> <%-- 改 equal:val1='true' val2='${searchItem.type == "time"}'。Lin --%>
  229. <!-- <div class="input-inside"> -->
  230. <%--年度--%>
  231. <%--
  232. <ss:equal val='${searchItem.enrolDate}' val2='true'>
  233. <input type='hidden' placeholder="${searchItem.desc}" name='${searchItem.name}'
  234. value="<ss:txt val='${searchItemValue}'/>"/>
  235. <div><input type="text" name="${searchItem.name}_year" autocomplete="off" />
  236. <input name="${searchItem.name}_month" type="button" value="春季" ssVal="3"/>
  237. <input name="${searchItem.name}_month" type="button" value="秋季" ssVal="9"/>
  238. </div><script>(function(){wd.edit.onoffInit('radio','${searchItem.name}_month','',false,null,null,null,'edit');})();</script>
  239. <script>(function(){
  240. wd.display.initEnrolDate('${searchItem.name}','edit');
  241. })()
  242. </script>
  243. </ss:equal>
  244. --%>
  245. <%--日期--%>
  246. <ss:equal val='${searchItem.type==11}' val2='true'>
  247. <%--<input type='text' autocomplete="off" placeholder="${searchItem.desc}" name='${searchItem.name}'
  248. value='<ss:txt val='${searchItemValue}'/>' format="${searchItem.fmt}"/>
  249. <input type="button" ssType="date" ssName="${searchItem.name}"/>--%>
  250. <!-- <ss-date-picker
  251. v-model="${searchItem.name}"
  252. name="${searchItem.name}"
  253. type="date"
  254. placeholder="${searchItem.desc}"
  255. width="120px"
  256. ></ss-date-picker> -->
  257. <ss-search-date-picker
  258. v-model="${searchItem.name}"
  259. name="${searchItem.name}"
  260. type="date"
  261. placeholder="${searchItem.desc}"
  262. width="100px"
  263. fmt="${searchItem.fmt}"
  264. ></ss-search-date-picker>
  265. <script>
  266. //日期类型(出生日期)
  267. window.ss.dom.formElemConfig.${searchItem.name} = {
  268. desc: '${searchItem.desc}',
  269. value: '${searchItemValue}',
  270. type: 3,
  271. name: '${searchItem.name}'
  272. };//放当前页面表单元素配置的变量
  273. </script>
  274. </ss:equal>
  275. <!-- </div> -->
  276. </ss:equal>
  277. <%--文本--%>
  278. <%-- 改 equal:val1='false' val2='${searchItem.type == "time"}'。Lin --%>
  279. <ss:notEqual val='${searchItem.type}' valList='3,11'>
  280. <%--<input name='${searchItem.name}' placeholder="${searchItem.desc}" type='text'
  281. value='<ss:txt val='${searchItemValue}'/>'/>
  282. <input type="hidden" ssType="and" ssName="${searchItem.name}"/>--%>
  283. <%--<script>wd.edit.addClearTextButton("${searchItem.name}");</script>--%>
  284. <ss-search-input
  285. name="${searchItem.name}"
  286. placeholder="${searchItem.desc}"
  287. v-model="${searchItem.name}"
  288. width="100px"
  289. >
  290. </ss-search-input>
  291. </ss:notEqual>
  292. </ss:equal>
  293. </ss:rpt>
  294. <%-- 再去掉 -- 只支持一行。Lin
  295. </ss:rpt>
  296. --%>
  297. <%--
  298. <ss:rpt name='cadcadingName' id='item'>
  299. <ss:ccp name='${item}'/>
  300. </ss:rpt>
  301. --%>
  302. <ss:equal val='${hasKeyWord}' val2='true'>
  303. <%--
  304. <input name="ssKeyword" value="${ssKeyword}" type="text" placeholder="关键词"/>
  305. <script>wd.edit.addClearTextButton("ssKeyword");</script>
  306. --%>
  307. <!-- <ss-search-input
  308. name="ssKeyword"
  309. placeholder="关键词"
  310. v-model="form.keyword"
  311. width="120"
  312. >
  313. </ss-search-input> -->
  314. <ss-search-input
  315. name="ssKeyword"
  316. placeholder="关键词"
  317. v-model="ssKeyword"
  318. width="100px"
  319. @search="search"
  320. >
  321. </ss-search-input>
  322. <script>
  323. //关键词
  324. window.ss.dom.formElemConfig.ssKeyword = {
  325. value: '${ssKeyword}',
  326. name: "ssKeyword",
  327. desc: "关键词",
  328. type: 31
  329. };//放当前页面表单元素配置的变量
  330. </script>
  331. </ss:equal>
  332. <ss-search-button
  333. text="所有"
  334. icon-class="nav-icon-search"
  335. :opt="searchButtonConfig"
  336. :check-id="searchButtonConfigCheckId"
  337. ></ss-search-button>
  338. <%-- 新UI 单对象查询 选项卡、翻页start Ben --%>
  339. <ss:equal val='${"1"==isReady && !isMultipleObject}' val2='true'>
  340. <%--
  341. <ss:equal val='${hasScope}' val2='true'>
  342. <ul style="list-style: none;display: inline-block;">
  343. <li ssType="searchScope" ssVal=99>所有</li>
  344. <li ssType="searchScope" ssVal=2>管理</li>
  345. <li ssType="searchScope" ssVal=1>创建</li>
  346. <li ssType="searchScope" ssVal=3>已办</li>
  347. <li ssType="searchScope" ssVal=55>停用</li>
  348. </ul>
  349. </ss:equal>
  350. --%>
  351. </ss:equal>
  352. <%--
  353. <input type="submit" name="ssSearch" value="搜索" class="content-invertButton"/>
  354. --%>
  355. <!-- <ss-search-button text="搜索" @click="console.log('这里改成提交表单')">
  356. </ss-search-button> -->
  357. <script>
  358. <%-- 根按钮(管理按钮) --%>
  359. window.ss.dom.btnElemConfig = window.ss.dom.btnElemConfig || {};
  360. </script>
  361. <%--多对像搜索隐藏全文按钮--%>
  362. <%--
  363. <ss:equal val='${isMultipleObject}' val2='false'>
  364. --%><%--
  365. <input type="hidden" ssType="fts" ssName="fts" value="全文"/>--%> <%-- wdType="isFulltext" wdName="isFulltext"。Lin --%>
  366. <%--</ss:equal>--%>
  367. <%--根按钮(管理按钮)start--%>
  368. <ss:rpt name='buttonList' id='button'>
  369. <ss:auth serv='${button.servName}'>
  370. <ss:equal val='${empty button.pluginList}' val2='true'>
  371. <%--
  372. <input type="button" name="${button.name}" value="${button.buttonName}" class="content-button"
  373. onclick='wd.display.showComponent({show:["wdDialog"],url:"<ss:serv name='${button.servName}' dest='${button.dest}' parm='${button.parm}'/>",title:"${button.title}",width:"${button.width}",height:"${button.height}",minHeight:"${button.minHeight}",maxHeight:"${button.maxHeight+100}",showTitle:"${button.showTitle}"});'/>
  374. --%>
  375. <!-- <ss-search-button
  376. text="${button.name}"
  377. icon-class="nav-icon-add"
  378. ></ss-search-button> -->
  379. <script>
  380. function ${button.id}handleClick() {
  381. wd.display.showComponent({
  382. show: ["wdDialog"],
  383. url: "<ss:serv name='${button.servName}' dest='${button.dest}' parm='${button.parm}'/>",
  384. title: "${button.title}",
  385. width: "${button.width}",
  386. height: "${button.height}",
  387. minHeight: "${button.minHeight}",
  388. maxHeight: "${button.maxHeight+100}",
  389. showTitle: "${button.showTitle}"
  390. });
  391. }
  392. <%-- 实际没用上,注释掉 Ben(20251225)
  393. window.ss.dom.btnElemConfig.${button.id}={
  394. desc:"${button.buttonName}",
  395. id:"${button.id}",
  396. dropOptions:[],
  397. onclick: () => {
  398. wd.display.showComponent({show:["wdDialog"],url:"<ss:serv name='${button.servName}' dest='${button.dest}' parm='${button.parm}'/>",title:"${button.title}",width:"${button.width}",height:"${button.height}",minHeight:"${button.minHeight}",maxHeight:"${button.maxHeight+100}",showTitle:"${button.showTitle}"});
  399. }
  400. };
  401. --%>
  402. </script>
  403. <ss-search-button
  404. text="${button.buttonName}"
  405. icon-class="nav-icon-add"
  406. :opt="[]"
  407. :check-id="0"
  408. onclick="${button.id}handleClick()"
  409. ></ss-search-button>
  410. </ss:equal>
  411. <ss:equal val='${empty button.pluginList}' val2='false'>
  412. <ss:rpt name='${button.pluginList}' id='plugin'>
  413. <span style="display:none;" class="${button.id}children" value="${plugin.plugin.desc}"
  414. onclick='wd.display.showComponent({show:["wdDialog"],url:"<ss:serv
  415. name='${plugin.servName}' dest='${plugin.dest}'
  416. parm='${plugin.parm}'/>",title:"${plugin.title}",width:"${plugin.width}",height:"${plugin.height}",minHeight:"${plugin.minHeight}",maxHeight:"${plugin.maxHeight}",showTitle:"${plugin.showTitle}"});'>
  417. </span>
  418. </ss:rpt>
  419. <%-- <input type="button" id="${button.id}" name="${button.name}" value="${button.buttonName}" class="content-button" onclick='void(0)'/>
  420. <span style=" display:inline-table; width: 60px; ">
  421. <input type="button" id="${button.id}" name="${button.name}" value="${button.buttonName}" class="content-button" onclick='void(0)'/>
  422. <span class="icon-dimPoint" style="margin-right: 7px;margin-top: -25px;position: relative;">
  423. </span>
  424. </span>
  425. <script>wd.display.attachButton("${button.id}","${button.id}children",null,false,true)</script>--%>
  426. <%-- 新UI start Ben --%>
  427. <!-- <ss-search-button
  428. text="${plugin.plugin.desc}"
  429. icon-class="nav-icon-add"
  430. :options="${button.id}DropOptions"
  431. ></ss-search-button> -->
  432. <%-- :opt改为取vue.data中的变量,而不取window.ss.dom.btnElemConfig(因为取不到),onclick改为:onclick xu(20251209) --%>
  433. <ss-search-button
  434. text="${button.buttonName}"
  435. icon-class="nav-icon-add"
  436. :opt="btnElemConfig.${button.id}.dropOptions"
  437. check-id="${management}"
  438. onclick="${button.id}handleClick()"
  439. ></ss-search-button>
  440. <script>
  441. function ${button.id}handleClick() {
  442. wd.display.showComponent({
  443. show: ["wdDialog"],
  444. url: "<ss:serv name='${plugin.servName}' dest='${plugin.dest}' parm='${plugin.parm}'/>",
  445. title: "${plugin.title}",
  446. width: "${plugin.width}",
  447. height: "${plugin.height}",
  448. minHeight: "${plugin.minHeight}",
  449. maxHeight: "${plugin.maxHeight}",
  450. showTitle: "${plugin.showTitle}"
  451. });
  452. }
  453. <%-- 实际没用上,注释掉 Ben(20251225)
  454. window.ss.dom.btnElemConfig.${button.id}={id:"${button.id}",dropOptions:[],
  455. onclick: () => {
  456. wd.display.showComponent({show:["wdDialog"],url:"<ss:serv name='${plugin.servName}' dest='${plugin.dest}' parm='${plugin.parm}'/>",title:"${plugin.title}",width:"${plugin.width}",height:"${plugin.height}",minHeight:"${plugin.minHeight}",maxHeight:"${plugin.maxHeight}",showTitle:"${plugin.showTitle}"});
  457. }
  458. };
  459. --%>
  460. <%-- 循环生成按钮数组 --%>
  461. <ss:rpt name='${button.pluginList}' id='plugin'>
  462. window.ss.dom.btnElemConfig
  463. .${button.id}.
  464. dropOptions.push(
  465. {
  466. desc: '${plugin.plugin.desc}', <%-- 按钮名 --%>
  467. callback: function () {
  468. wd.display.showComponent({
  469. show: ["wdDialog"],
  470. url: "<ss:serv name='${plugin.servName}' dest='${plugin.dest}' parm='${plugin.parm}'/>",
  471. title: "${plugin.title}",
  472. width: "${plugin.width}",
  473. height: "${plugin.height}",
  474. minHeight: "${plugin.minHeight}",
  475. maxHeight: "${plugin.maxHeight}",
  476. showTitle: "${plugin.showTitle}"
  477. });
  478. }
  479. }
  480. );
  481. </ss:rpt>
  482. </script>
  483. <%-- 新UI end Ben --%>
  484. </ss:equal>
  485. </ss:auth>
  486. </ss:rpt>
  487. <%--管理按钮end--%>
  488. </template>
  489. </div>
  490. </div>
  491. <%--搜索条件end--%>
  492. <script type="text/javascript" src="/ss/env/env_search.js"></script>
  493. <%-- 旧UI初始化查询列表的js,新UI做好后,要被删掉的 --%>
  494. <%-- 新UI初始化查询列表数据的JS --%>
  495. <script>
  496. window.ss.dom.listConfig = window.ss.dom.listConfig || {};
  497. //二级对象 草稿箱
  498. window.ss.dom.listConfig.draftbox = [];
  499. <%-- 草稿箱start --%>
  500. <ss:rpt name='cgxList' id='item'>
  501. {
  502. let item = {};
  503. window.ss.dom.listConfig.draftbox.push(item);
  504. <%-- 下面的titlexxx是原来td的一个属性,不知道有啥用 --%>
  505. <ss:equal val='${not empty item.service.play && empty item.service.update && empty item.service.change}' val2='true'>
  506. item.titlexxx = "${item.service.play.title}";
  507. item.onclick = function () {
  508. wd.display.showComponent({
  509. show: ["wdDialog"],
  510. url: "<ss:serv name='${item.service.play.servName}' dest='${item.service.play.dest}' parm='${item.service.play.parm}'/>",
  511. title: "${item.service.play.title}",
  512. width: "${item.service.play.width}",
  513. height: "${item.service.play.height}",
  514. minHeight: "${item.service.play.minHeight}",
  515. maxHeight: "${item.service.play.maxHeight}"
  516. });
  517. };
  518. </ss:equal>
  519. <ss:equal val='${item.service.lbm}' val2='1'>
  520. <ss:equal val='${empty item.service.update}' val2='false'>
  521. item.titlexxx = "${item.service.update.title}";
  522. item.onclick = function () {
  523. wd.display.showComponent({
  524. show: ["wdDialog"],
  525. url: "<ss:serv name='${item.service.update.servName}' dest='${item.service.update.dest}' parm='${item.service.update.parm}'/>",
  526. title: "${item.service.update.title}",
  527. width: "${item.service.update.width}",
  528. height: "${item.service.update.height}",
  529. minHeight: "${item.service.update.minHeight}",
  530. maxHeight: "${item.service.update.maxHeight}"
  531. });
  532. };
  533. </ss:equal>
  534. </ss:equal>
  535. <ss:equal val='${item.service.lbm}' val2='11'>
  536. <ss:equal val='${empty item.service.change}' val2='false'>
  537. item.titlexxx = "${item.service.change.title}";
  538. item.onclick = function () {
  539. wd.display.showComponent({
  540. show: ["wdDialog"],
  541. url: "<ss:serv name='${item.service.change.servName}' dest='${item.service.change.dest}' parm='${item.service.change.parm}'/>",
  542. title: "${item.service.change.title}",
  543. width: "${item.service.change.width}",
  544. height: "${item.service.change.height}",
  545. minHeight: "${item.service.change.minHeight}",
  546. maxHeight: "${item.service.change.maxHeight}"
  547. });
  548. };
  549. </ss:equal>
  550. </ss:equal>
  551. item.buttons = [];
  552. <ss:equal val='${item.service.lbm}' val2='1'>
  553. item.buttons.push(
  554. {
  555. class: "cart-list-setting",
  556. title: "增加",
  557. onclick: () => {
  558. console.log("点击了增加");
  559. }
  560. }
  561. );
  562. </ss:equal>
  563. <ss:equal val='${item.service.lbm}' val2='11'>
  564. item.buttons.push(
  565. {
  566. class: "cart-list-setting",
  567. title: "变动",
  568. onclick: () => {
  569. console.log("点击了变动");
  570. }
  571. }
  572. );
  573. </ss:equal>
  574. <ss:equal val='${item.service.lbm}' val2='51'>
  575. item.buttons.push(
  576. {
  577. class: "cart-list-setting",
  578. title: "停用",
  579. onclick: () => {
  580. console.log("点击了停用");
  581. }
  582. }
  583. );
  584. </ss:equal>
  585. <ss:equal val='${item.service.lbm}' val2='55'>
  586. item.buttons.push(
  587. {
  588. class: "cart-list-setting",
  589. title: "启用",
  590. onclick: () => {
  591. console.log("点击了启用");
  592. }
  593. }
  594. </ss:equal>
  595. <ss:equal val='${item.service.lbm}' valList='51,55'>
  596. item.buttons.push(
  597. {
  598. class: "cart-list-setting",
  599. title: "还原",
  600. onclick: () => {
  601. wd.display.showComponent({
  602. show: ["wdDialog"],
  603. url: "<ss:serv name='deleteSq' parm='{"sqid":"${item.sqid}"}' dest='info'/>", // {"wdConfirmationCaptchaService":"0",。Lin
  604. title: "提示信息",
  605. width: 715,
  606. height: 483
  607. });
  608. }
  609. }
  610. </ss:equal>
  611. console.log('###item.thumbnail:${item.thumbnail}');
  612. <%--缩略图--%>
  613. <ss:equal val='${empty item.thumbnail}' val2='false'>
  614. <ss:equal val='${item.service.state}' val2='0'>
  615. item.thumb = "${sessionScope['ssUser'].skinDir}image/object/default-${item.ssObjName}.png"
  616. onerror = "javascript:this.src='${sessionScope['ssUser'].skinDir}image/default-photo.png';this.onerror=null;";
  617. </ss:equal>
  618. <ss:notEqual val='${item.service.state}' val2='0'>
  619. item.thumb = "<ss:serv name='dlByHttp' parm='{"path":"${item.thumbnail.value}","type":"img"}'/>"; // {"wdConfirmationCaptchaService":"0",。Lin
  620. </ss:notEqual>
  621. </ss:equal>
  622. <%-- 列标题 --%>
  623. <ss:equal val='${empty item.first}' val2='false'> <%-- 改 equal:val1="true" val2="${not empty item.first}"。Lin --%>
  624. <%--不带codebook--%>
  625. <ss:equal val='${empty item.first.field.cbName}' val2='true'>
  626. item.title = "<ss:txt val='${item.first.value}' miniDate='false' fmt='${item.first.field.fmt}'/>";
  627. </ss:equal>
  628. <%--带codebook--%>
  629. <ss:equal val='${empty item.first.field.cbName}' val2='false'>
  630. item.title = "<ss:cbTrans cb='${item.first.field.cbName}' val='${item.first.value}'/>";
  631. </ss:equal>
  632. </ss:equal>
  633. <%--列标题:缺标题显示属性start--%>
  634. <ss:equal val='${empty item.first && not empty item.third}' val2='true'>
  635. item.title = '';
  636. <ss:rpt name='${item.third}' id='itemList'>
  637. <ss:rpt name='${itemList}' id='item2'>
  638. item.title += '${item2.field.desc}:';
  639. <%--不带codebook--%>
  640. <ss:equal val='${empty item2.field.cbName}' val2='true'>
  641. item.title += '<ss:txt val='${item2.value}' fmt='${item2.field.fmt}' miniDate='false'/>&nbsp;';
  642. </ss:equal>
  643. <%--带codebook--%>
  644. <ss:equal val='${empty item2.field.cbName}' val2='false'>
  645. item.title += '<ss:cbTrans cb='${item2.field.cbName}' val='${item2.value}'/>&nbsp;';
  646. </ss:equal>
  647. </ss:rpt>
  648. </ss:rpt>
  649. </ss:equal>
  650. <%--缺标题显示属性end--%>
  651. <%--正文或摘要--%>
  652. <ss:equal val='${empty item.second}' val2='false'>
  653. // 摘要字段统一映射为 desc(用于 ss-list-card 右侧文字区规则) by xu 20260113
  654. item.desc = '${item.second.value}';
  655. item.summary = '${item.second.value}'; // legacy 兜底 by xu 20260113
  656. </ss:equal>
  657. // 对象号字段映射(用于 ss-list-card 第三部分回显) by xu 20260113
  658. item.objNum = '${item.ssObjId}';
  659. <%-- 列表底部的对象属性(tags) --%>
  660. <ss:equal val='${empty item.first || empty item.third}' val2='false'>
  661. item.tags = [];
  662. <ss:rpt name='${item.third}' id='itemList'>
  663. <ss:rpt name='${itemList}' id='item2'>
  664. {
  665. let v;
  666. <%--不带codebook--%>
  667. <ss:equal val='${empty item2.field.cbName}' val2='true'>
  668. v = '<ss:txt val='${item2.value}' fmt='${item2.field.fmt}' miniDate='false'/>';
  669. </ss:equal>
  670. <%--带codebook--%>
  671. <ss:equal val='${empty item2.field.cbName}' val2='false'>
  672. v = '<ss:cbTrans cb='${item2.field.cbName}' val='${item2.value}'/>';
  673. </ss:equal>
  674. item.tags.push({'${item2.field.desc}': v});
  675. }
  676. </ss:rpt>
  677. </ss:rpt>
  678. </ss:equal>
  679. <%-- 对象变动前后属性列表 --%>
  680. item.changeItems = [];
  681. <ss:rpt name='${item.forth}' id='item3'>
  682. item.changeItems.push({
  683. name: '${item3.name}',
  684. oldValue: '${item3.oldValue}',
  685. newValue: '${item3.newValue}'
  686. });
  687. </ss:rpt>
  688. }
  689. </ss:rpt>
  690. <%-- 草稿箱end --%>
  691. //在用或停用的对象列表
  692. window.ss.dom.listConfig.list = [];
  693. <ss:rpt name='objectList' id='item'><%-- 循环一次生成一行列表 start --%>
  694. {
  695. let item = {};//列表的其中一行的属性
  696. window.ss.dom.listConfig.list.push(item);
  697. <ss:equal val='${item.service.state}' val2='0'><%-- 借阅 --%>
  698. item.onclick = function () {
  699. wd.display.showComponent({
  700. show: ["wdDialog"],
  701. url: "<ss:serv name='ydsq_tj' parm='{"ssObjId":"${item.ssObjId}","ssObjName":"${item.ssObjName}"}' dest='ydsq_tj'/>", // {"wdConfirmationCaptchaService":"0",。Lin
  702. title: "借阅",
  703. width: 613,
  704. height: 387
  705. });
  706. }
  707. </ss:equal>
  708. <ss:equal val='${empty item.service.play}' val2='false'><%-- 有权查看,不需要借阅的情况 --%>
  709. item.titlexxx = "${item.service.play.title}";
  710. item.onclick = function () {
  711. wd.display.showComponent({
  712. getSize: 1,
  713. width: ((${item.service.play.width}+DOM_SIZE_objInfoTabWidth) + ""),
  714. show: ["wdDialog"],
  715. url: "<ss:serv name='${item.service.play.servName}' dest='${item.service.play.dest}' parm='${item.service.play.parm}'/>",
  716. title: "${item.service.play.title}",
  717. height: "${item.service.play.height}",
  718. minHeight: "${item.service.play.minHeight}",
  719. maxHeight: "${item.service.play.maxHeight}"
  720. });
  721. }
  722. </ss:equal>
  723. <ss:equal val='${empty item.thumbnail}' val2='false'><%-- 缩略图 --%>
  724. <ss:equal val='${item.service.state}' val2='0'><%-- 借阅 --%>
  725. item.thumb = "${sessionScope['ssUser'].skinDir}image/object/default-${item.ssObjName}.png";
  726. </ss:equal>
  727. <ss:notEqual val='${item.service.state}' val2='0'>
  728. console.log('@@@图片:${item.thumbnail.value}');
  729. item.thumb = "<ss:serv name='dlByHttp' parm='{"path":"${item.thumbnail.value}","type":"img"}'/>"; // {"wdConfirmationCaptchaService":"0",。Lin
  730. </ss:notEqual>
  731. </ss:equal>
  732. <%-- 标题 --%>
  733. <ss:equal val='${empty item.first}' val2='false'> <%-- 改 equal:val1="true" val2="${not empty item.first}"。Lin --%>
  734. <%--不带codebook--%>
  735. <ss:equal val='${empty item.first.field.cbName}' val2='true'>
  736. item.title = "<ss:txt val='${item.first.value}' miniDate='false' fmt='${item.first.field.fmt}'/>";
  737. </ss:equal>
  738. <%--带codebook--%>
  739. <ss:equal val='${empty item.first.field.cbName}' val2='false'>
  740. item.title = "<ss:cbTrans cb='${item.first.field.cbName}' val='${item.first.value}'/>";
  741. </ss:equal>
  742. </ss:equal>
  743. <%--缺标题显示属性当标题start--%>
  744. <ss:equal val='${empty item.first && not empty item.third}' val2='true'>
  745. item.title = '';
  746. <ss:rpt name='${item.third}' id='itemList'>
  747. <ss:rpt name='${itemList}' id='item2'>
  748. item.title += '${item2.field.desc}:';
  749. <%--属性名--%>
  750. <%--不带codebook--%><%--属性值--%>
  751. <ss:equal val='${empty item2.field.cbName}' val2='true'>
  752. item.title += "<ss:txt val='${item2.value}' fmt='${item2.field.fmt}' miniDate='false'/>&nbsp;";
  753. </ss:equal>
  754. <%--带codebook--%><%--属性值--%>
  755. <ss:equal val='${empty item2.field.cbName}' val2='false'>
  756. item.title += "<ss:cbTrans cb='${item2.field.cbName}' val='${item2.value}'/>&nbsp;";
  757. </ss:equal>
  758. </ss:rpt>
  759. </ss:rpt>
  760. </ss:equal>
  761. <%--缺标题显示属性当标题end--%>
  762. <%-- 摘要 --%>
  763. <ss:equal val='${empty item.second}' val2='false'>
  764. // 摘要字段统一映射为 desc(用于 ss-list-card 右侧文字区规则) by xu 20260113
  765. item.desc = '${item.second.value}';
  766. item.summary = '${item.second.value}'; // legacy 兜底 by xu 20260113
  767. </ss:equal>
  768. // 对象号字段映射(用于 ss-list-card 第三部分回显) by xu 20260113
  769. item.objNum = '${item.ssObjId}';
  770. <%-- 列表底部的对象标签组 --%>
  771. item.tags = [];
  772. <%-- 提到条件外面 Ben(20251230) --%>
  773. <ss:equal val='${empty item.first || empty item.third}' val2='false'>
  774. <%--item.tags=[]; 提到条件外面,不然列表报 Mount failed:TypeError: Cannot read properties of undefined (reading 'map') Ben(20251230) --%>
  775. <ss:rpt name='${item.third}' id='itemList'>
  776. <ss:rpt name='${itemList}' id='item2'>
  777. {
  778. let v;
  779. <%--不带codebook--%>
  780. <ss:equal val='${empty item2.field.cbName}' val2='true'>
  781. v = '<ss:txt val='${item2.value}' miniDate='false' fmt='${item2.field.fmt}'/>';
  782. </ss:equal>
  783. <%--带codebook--%>
  784. <ss:equal val='${empty item2.field.cbName}' val2='false'>
  785. v = '<ss:cbTrans cb='${item2.field.cbName}' val='${item2.value}'/>';
  786. </ss:equal>
  787. item.tags.push({
  788. ${item2.field.desc}:
  789. v
  790. })
  791. ;
  792. }
  793. </ss:rpt>
  794. </ss:rpt>
  795. </ss:equal>
  796. <%--按钮--%>
  797. <ss:equal val='${empty item.service.btnList}' val2='false'>
  798. item.buttons = [];
  799. <ss:rpt name='${item.service.btnList}' id='btn'>
  800. item.buttons.push(
  801. {
  802. id: "${btn.btnID}",
  803. titlexxx: "${btn.title}",
  804. class: "cart-list-setting",
  805. title: "${btn.name}",
  806. onclick: () => {
  807. <%--列表的变动按钮就在这里,下面的width会根据不同业务对象而不同
  808. 弹窗参数加上getSize=1,使showComponent弹窗方法不再通过ajax从后台取宽高 --%>
  809. wd.display.showComponent({
  810. getSize: 1,
  811. width: ((${btn.width}+DOM_SIZE_objInfoTabWidth) + ""),
  812. show: ["wdDialog"],
  813. url: "<ss:serv name='${btn.servName}' dest='${btn.dest}' parm='${btn.parm}'/>",
  814. title: "${btn.title}",
  815. height: "${btn.height}",
  816. minHeight: "${btn.minHeight}",
  817. maxHeight: "${btn.maxHeight}"
  818. });
  819. }
  820. }
  821. );
  822. <%--
  823. <ss:equal val='${index}' val2='0'>
  824. </ss:equal>
  825. <ss:notEqual val='${index}' val2='0'>
  826. </ss:notEqual>
  827. 改为不区分是否第1个变动按钮,都输出相同json数据 --%>
  828. </ss:rpt>
  829. </ss:equal>
  830. }
  831. </ss:rpt><%-- 循环一次生成一行列表 end --%>
  832. </script>
  833. <%--搜索结果start--%>
  834. <%-- 功能说明:卡片区域使用 grid 自动分列,剩余宽度平分(不锁死 max-width) by xu 20260109 --%>
  835. <div v-show="userInteracted && loadingList" class="pobj-list-loading" style="display:none;">
  836. <div class="pobj-spinner"></div>
  837. </div>
  838. <div v-show="!(userInteracted && loadingList)"
  839. :class="['content-area','item-content-area', cardGridKind ? ('ss-card-grid--' + cardGridKind) : '']">
  840. <template v-for="(item, i) in listConfig.draftbox" :key="i">
  841. <ss-folder-card v-if="item.children" :item="item"></ss-folder-card>
  842. <!-- 功能说明:传入 ssObjName + cardClickAction(卡片主体点击 view/single;角标仍多选) by xu 20260109 -->
  843. <ss-list-card v-else :item="item" :ss-obj-name="ssObjName" :card-click-action="cardClickAction"
  844. @toggle-select="handleToggleSelect"></ss-list-card>
  845. </template>
  846. <template v-for="(item, i) in listConfig.list" :key="i">
  847. <ss-folder-card v-if="item.children" :item="item"></ss-folder-card>
  848. <!-- 功能说明:传入 ssObjName + cardClickAction(卡片主体点击 view/single;角标仍多选) by xu 20260109 -->
  849. <ss-list-card v-else :item="item" :ss-obj-name="ssObjName" :card-click-action="cardClickAction"
  850. @toggle-select="handleToggleSelect"></ss-list-card>
  851. </template>
  852. <ss-page
  853. :key="String(ssPaging?.pageNo || 1) + '-' + String(ssPaging?.rowNumPer || 0) + '-' + String(ssPaging?.rowNum || 0)" <%-- // 功能说明:分页 key 不再硬编码 12,仅用于触发分页组件重渲染 by xu 20260123 --%>
  854. :total="Number(ssPaging?.rowNum || 0)"
  855. :size="Number(ssPaging?.rowNumPer || 0)" <%-- // 功能说明:分页大小仅使用 ssPaging.rowNumPer(默认值由 data 初始化兜底一次) by xu 20260123 --%>
  856. :page="Number(ssPaging?.pageNo || 1)"
  857. @change="handlePageChange">
  858. </ss-page>
  859. </div>
  860. </form>
  861. <!-- 功能说明:右侧业务面板(ss-sidebar),用于已选/服务/预订/图表等;当无 rbarTabNameList/rbarFuncList/pstatList 时临时隐藏 by xu 20260122 -->
  862. <ss-sidebar v-if="showRightSidebar"
  863. :buttons="sidebarButtons"
  864. :panels="sidebarPanels"
  865. @remove="handleSidebarRemove"
  866. ></ss-sidebar>
  867. <!-- 功能说明:业务页编辑态右下角新增入口(+ hover 上拉:增加图/增加表) by xu 20260123 -->
  868. <div v-if="isSysEditMode && sysModeSource === 'biz'" class="ss-objlist-fab" @click.stop>
  869. <button type="button" class="ss-objlist-fab__btn" title="新增">
  870. <ss-icon class="menu-base-icon icon-add"></ss-icon> <%-- // 功能说明:新增按钮图标样式参考左侧菜单 by xu 20260123 --%>
  871. </button>
  872. <div class="ss-objlist-fab__menu">
  873. <div class="ss-objlist-fab__item" @click="openAddPcht">增加图</div>
  874. <div class="ss-objlist-fab__item" @click="openAddPform">增加表</div>
  875. </div>
  876. </div>
  877. </div>
  878. </div>
  879. </body>
  880. </html>
  881. <script type="module">
  882. <%-- 打印新UI相关json对象 --%>
  883. const data = {
  884. ssObjName: "${ssObjName}", // 对象名
  885. // 后端注入的 ssServ 接口名(用于 ajax 拉取查询首页/列表数据)
  886. ssSearchPobjHomeServName: "${ssSearchPobjHomeServName}", // <对象名>_cxsy
  887. ssSearchPobjListServName: "${ssSearchPobjListServName}", // <对象名>_cxlb
  888. // 接口返回(调试用,可删)
  889. ssHomeResp: null,
  890. ssListResp: null,
  891. // 页面状态
  892. homeReady: false,
  893. userInteracted: false, // 用户触发(搜索/翻页/切换范围)
  894. loadingHome: false,
  895. loadingList: false,
  896. isSysEditMode: false, // 功能说明:系统编辑态(业务页)控制右下角“新增”入口显隐 by xu 20260123
  897. sysModeSource: "unknown", // 功能说明:编辑态来源(desktop/biz/menu/unknown) by xu 20260123
  898. // 首页接口返回字段(按 page/objlist修改.txt)
  899. searchFieldList: [], // 查询条件字段
  900. rootFuncList: [], // 根功能
  901. subpageOpt: [],
  902. selSubpage: "",
  903. hasKeyword: false, // 是否有关键词
  904. hasScope: false, // 是否带范围
  905. thnType: (() => { // 功能说明:首屏 thnType 优先从 JSP 注入(用于第一个接口前正确计算 rowNumPer);空/缺省回退 0 by xu 20260123
  906. try {
  907. const s = String("${thnType}" || "").trim();
  908. const n = parseInt(s, 10);
  909. return isNaN(n) ? 0 : n;
  910. } catch (_) {
  911. return 0;
  912. }
  913. })(), // 缩略图类型:1横向 2竖向 3方形 4圆形(目前仅用 1/2,其他先不处理)
  914. ssPaging: {pageNo: 1, rowNumPer: 12, rowNum: 0}, // 翻页信息 // 功能说明:分页默认每页12条(全文件仅此处兜底) by xu 20260123
  915. rbarFuncList: [], // 右侧栏功能
  916. rbarTabNameList: [], // 右侧栏选项卡
  917. pstatList: [], // 功能说明:个人统计图表配置(右侧图表区) by xu 20260114
  918. // 查询表单参数(用于接口入参)
  919. form: {management: "99", isFulltext: "0", isAnd: "", ssKeyword: ""},
  920. systemType: window.ss.dom.TYPE,
  921. listConfig: window.ss.dom.listConfig || {draftbox: [], list: []},
  922. formElemConfig: window.ss.dom.formElemConfig || {},
  923. // 卡片区域:自动分列/宽度平分 by xu 20260109
  924. cardGridKind: (() => { // 功能说明:首屏按 thnType 预设网格类型(决定 --ss-card-min),避免缩略图业务第一个接口仍按 300px 计算 by xu 20260123
  925. try {
  926. const t = (() => { const s = String("${thnType}" || "").trim(); const n = parseInt(s, 10); return isNaN(n) ? 0 : n; })();
  927. if (t === 1) return "thumbnail";
  928. if (t === 2) return "photo";
  929. return "none";
  930. } catch (_) {
  931. return "none";
  932. }
  933. })(), // none/photo/thumbnail by xu 20260109
  934. // 卡片主体点击动作:view=查看(调用 item.onclick);single=单选互斥;角标仍多选 by xu 20260109
  935. cardClickAction: "view", // 功能说明:默认先用 view,首页接口若返回预订面板则切到 single by xu 20260114
  936. hasBookPanel: false, // 功能说明:是否存在预订面板(驱动 cardClickAction + 选中后联动 cxycl) by xu 20260116
  937. hasServPanel: false, // 功能说明:是否存在服务面板(严格依赖首页 rbarTabNameList 是否返回 rbarServ) by xu 20260116
  938. hasObjPanel: false, // 功能说明:是否存在对象面板(严格依赖首页 rbarTabNameList 是否返回 rbarObj;无则不显示“已选”且禁止选中) by xu 20260122
  939. rbar: (String("${rbar}" || "").trim().toLowerCase() === "true") ? true : null, // 功能说明:JSP 注入 rbar:有字段且为 "true" 才展示;缺省/空串为 null,首页接口返回后会覆盖 by xu 20260123
  940. showRightSidebar: (String("${rbar}" || "").trim().toLowerCase() === "true"), // 功能说明:首屏右侧栏显隐以 JSP rbar 为准(用于首屏测量口径) by xu 20260123
  941. autoRowNumPer: 0, // 功能说明:动态计算的 rowNumPer(只记录,下次接口请求时生效;resize 不立即重拉) by xu 20260123
  942. yclLoading: false, // 功能说明:已选对象联动(cxycl)加载状态 by xu 20260114
  943. yclResp: null, // 功能说明:已选对象联动接口返回(调试/兜底) by xu 20260114
  944. // 右侧已选(用于未来接入 ss-sidebar 的已选面板) by xu 20260109
  945. selectedItems: [],
  946. // 右侧边栏:顶部按钮(由首页接口 rbarFuncList 初始化)
  947. sidebarButtons: [],
  948. // 右侧边栏:分区配置(由 initSidebarPanels 初始化) by xu 20260113
  949. sidebarPanels: [],
  950. <%-- 实际没用上,注释掉 Ben(20251225) btnElemConfig:window.ss.dom.btnElemConfig, --%>
  951. searchButtonConfigCheckId: "99",
  952. searchButtonConfig: [
  953. {
  954. id: "99",
  955. desc: "所有",
  956. callback: () => window.__objListVm && window.__objListVm.switchScope(99),
  957. },
  958. {
  959. id: "2",
  960. desc: "管理",
  961. callback: () => window.__objListVm && window.__objListVm.switchScope(2),
  962. },
  963. {
  964. id: "1",
  965. desc: "创建",
  966. callback: () => window.__objListVm && window.__objListVm.switchScope(1),
  967. },
  968. {
  969. id: "3",
  970. desc: "已办",
  971. callback: () => window.__objListVm && window.__objListVm.switchScope(3),
  972. },
  973. {
  974. id: "55",
  975. desc: "停用",
  976. callback: () => window.__objListVm && window.__objListVm.switchScope(55),
  977. }
  978. ],
  979. }
  980. if (window.ss.dom.formElemConfig) {
  981. Object.entries(window.ss.dom.formElemConfig).forEach(([key, config]) => {
  982. data[key] = config.value;
  983. // 处理 objPicker
  984. if (
  985. config.type === window.ss.dom.TYPE.OBJPICKER ||
  986. config.type === window.ss.dom.TYPE.OBJP
  987. ) {
  988. data[key + "ObjPicker"] = true;
  989. data[key + "Option"] = [];
  990. data[key + "Url"] = config.optUrl;
  991. }
  992. })
  993. }
  994. SS.ready(function () {
  995. // 功能说明:右侧 ss-sidebar__inner 统一增加 padding-top=10px(撤回外层 wrapper 方案) by xu 20260114
  996. try {
  997. if (!document.getElementById("ss-objlist-sidebar-inner-padding")) {
  998. var st = document.createElement("style");
  999. st.id = "ss-objlist-sidebar-inner-padding";
  1000. st.type = "text/css";
  1001. st.appendChild(document.createTextNode("#app .ss-sidebar__inner{padding-top:10px;}"));
  1002. document.head.appendChild(st);
  1003. }
  1004. } catch (e) {
  1005. }
  1006. window.ss.dom.initializeFormApp({
  1007. el: "#app",
  1008. data() {
  1009. return data;
  1010. },
  1011. methods: {
  1012. openAddPform() {
  1013. // 功能说明:编辑态新增统计表(pformSet) by xu 20260123
  1014. try {
  1015. wd.display.showComponent({
  1016. show: ["wdDialog"],
  1017. url: "<ss:serv name='addPform' parm='{\"dxm\":\"${ssObjName}\"}' dest='pformSet'/>", // {\"wdConfirmationCaptchaService\":\"0\",。Lin
  1018. title: "设置统计表",
  1019. width: 800,
  1020. height: 580
  1021. });
  1022. } catch (e) {
  1023. console.error("openAddPform failed", e);
  1024. }
  1025. },
  1026. openAddPcht() {
  1027. // 功能说明:编辑态新增统计图(pchtSet) by xu 20260123
  1028. try {
  1029. wd.display.showComponent({
  1030. show: ["wdDialog"],
  1031. url: "<ss:serv name='addPcht' parm='{\"dxm\":\"${ssObjName}\",\"use_grtjmbid\":\"${use_grtjmbid}\"}' dest='pchtSet'/>", // {\"wdConfirmationCaptchaService\":\"0\",。Lin
  1032. title: "设置统计图",
  1033. width: 800,
  1034. height: 580
  1035. });
  1036. } catch (e) {
  1037. console.error("openAddPcht failed", e);
  1038. }
  1039. },
  1040. openServiceDialog(srv) {
  1041. // 功能说明:使用 tools.js 统一封装的 openServiceDialog,支持透传搜索条件 by xu 20260122
  1042. if (!srv) return;
  1043. const extraParams = window.ssTools.pickSearchParams(this.searchFieldList, this.form);
  1044. // 功能说明:已选对象 ID 拼接为 rbarObjId=111,222 by xu 20260424
  1045. const objIds = (this.selectedItems || [])
  1046. .map((it) => it?.objNum || it?._raw?.ssObjId)
  1047. .filter(Boolean)
  1048. .join(',');
  1049. if (objIds) extraParams.rbarObjId = objIds;
  1050. // 功能说明:已选人员 ID 拼接为 rbarRyId=xxx,xxx by xu 20260424
  1051. const ryPanel = (this.sidebarPanels || []).find((p) => p?._tabKey === 'rbarry');
  1052. const ryIds = (ryPanel?.items || [])
  1053. .map((it) => it?.id || it?.ryId || it?._raw?.ryId)
  1054. .filter(Boolean)
  1055. .join(',');
  1056. if (ryIds) extraParams.rbarRyId = ryIds;
  1057. window.ssTools.openServiceDialog(srv, { extraParams });
  1058. },
  1059. normalizeObjToCard(row) {
  1060. const card = {
  1061. _raw: row,
  1062. ssObjName: row?.ssObjName,
  1063. objNum: row?.ssObjId,
  1064. title: "",
  1065. desc: row?.abs || "",
  1066. tags: [],
  1067. buttons: [],
  1068. stateIconList: row?.stateIconList || [],
  1069. statusIcons: [],
  1070. bigState: row?.bigState,
  1071. bookState: row?.bookState,
  1072. };
  1073. // 功能说明:将后端 stateIconList 映射为卡片右上角 statusIcons(按 icon-state/icon-servType 规则转为 biz 图标组;无匹配则不展示;不使用 menu-*) by xu 20260123
  1074. try {
  1075. const rawList = Array.isArray(row?.stateIconList) ? row.stateIconList : [];
  1076. const icons = [];
  1077. const seen = new Set();
  1078. rawList.forEach((s) => {
  1079. const cls = String(s || "").trim();
  1080. if (!cls) return;
  1081. const m = cls.match(/-(\d+)$/);
  1082. const code = m ? Number(m[1]) : NaN;
  1083. if (code === 1) return; // 约定:后缀为 1 的不处理 by xu 20260116
  1084. // 功能说明:icon-state-<对象名>-<状态码>:15=清洁中(icon-obj-qjz),275=维修中(icon-obj-wxz) by xu 20260123
  1085. const stateMatch = cls.match(/^icon-state-[^-]+-(\d+)$/);
  1086. if (stateMatch) {
  1087. const stateCode = Number(stateMatch[1]);
  1088. if (stateCode === 15) {
  1089. const k = "ss-card-status-biz-icon icon-obj-qjz";
  1090. if (!seen.has(k)) { seen.add(k); icons.push({ class: k, title: "清洁中" }); }
  1091. return;
  1092. }
  1093. if (stateCode === 275) {
  1094. const k = "ss-card-status-biz-icon icon-obj-wxz";
  1095. if (!seen.has(k)) { seen.add(k); icons.push({ class: k, title: "维修中" }); }
  1096. return;
  1097. }
  1098. return;
  1099. }
  1100. // 功能说明:icon-servType-<对象名>-<服务类别码>:只要类别码!=1 就显示服务图标 icon-obj-fw by xu 20260123
  1101. const servTypeMatch = cls.match(/^icon-servType-[^-]+-(\d+)$/);
  1102. if (servTypeMatch) {
  1103. const servTypeCode = Number(servTypeMatch[1]);
  1104. if (servTypeCode !== 1) {
  1105. const k = "ss-card-status-biz-icon icon-obj-fw";
  1106. if (!seen.has(k)) { seen.add(k); icons.push({ class: k, title: "服务中" }); }
  1107. }
  1108. return;
  1109. }
  1110. // 功能说明:兜底支持后端直接下发 icon-base 字形类(例如 icon-fauth),不再拼 menu-base-icon;不再用 icon-sauth 兜底 by xu 20260123
  1111. try {
  1112. const tokens = cls.match(/\bicon-[a-zA-Z0-9_-]+\b/g) || [];
  1113. const glyph = tokens.find((t) => t && t.indexOf("icon-state-") !== 0 && t.indexOf("icon-servType-") !== 0);
  1114. if (glyph) {
  1115. if (glyph === "icon-sauth") return; // 功能说明:不再使用 icon-sauth 作为兜底/透传展示 by xu 20260123
  1116. const k = "ss-card-status-base-icon " + glyph;
  1117. if (!seen.has(k)) { seen.add(k); icons.push({ class: k, title: "使用中" }); }
  1118. }
  1119. } catch (_) {}
  1120. });
  1121. card.statusIcons = icons;
  1122. } catch (e) {
  1123. }
  1124. // 功能说明:title 可能是 {val, fmt}(日期/时间),此处按 fmt 做格式化(避免显示英文时间串) by xu 20260114
  1125. try {
  1126. const t = row?.title;
  1127. if (t && typeof t === "object" && t.val !== undefined) {
  1128. card.title = String(window.ssTools.formatValByFmt(t.val, t.fmt) ?? "");
  1129. } else {
  1130. card.title = String(row?.title?.val || row?.title || "");
  1131. }
  1132. } catch (_) {
  1133. card.title = String(row?.title?.val || row?.title || "");
  1134. }
  1135. // 功能说明:bookState 优先于 bigState(0绿空闲/1黄预订中/2红),映射到卡片 status by xu 20260116
  1136. const hasBookState = row?.bookState !== undefined && row?.bookState !== null && row?.bookState !== "";
  1137. const hasBigState = row?.bigState !== undefined && row?.bigState !== null && row?.bigState !== "";
  1138. if (hasBookState || hasBigState) {
  1139. const stateVal = hasBookState ? Number(row.bookState) : Number(row.bigState);
  1140. card.status = stateVal === 2 ? "disabled" : stateVal === 1 ? "unavailable" : stateVal === 0 ? "available" : "";
  1141. }
  1142. // thnType:缩略图类型(目前仅处理 1=横向、2=竖向;其余先按无缩略图处理)
  1143. // 注意:即使 thn 为空,只要 thnType 存在,也要保留缩略图区域,以显示“对象号_icon”占位
  1144. const thnType = Number(this.thnType || 0);
  1145. if (thnType === 1) card.thumbType = "thumbnail"; // 横向:180×100
  1146. else if (thnType === 2) card.thumbType = "photo"; // 竖向:73×100(默认)
  1147. // thn:缩略图不为空 => 有图片(否则 ss-list-card 会按 thumbType 显示占位 icon)
  1148. if (row?.thn) card.thumb = window.ssTools.buildThumbUrl(row.thn);
  1149. if (Array.isArray(row?.catList)) {
  1150. row.catList.forEach((c) => {
  1151. if (!c || !c.desc) return;
  1152. // 功能说明:catList 存在 fmt 时格式化时间(yyyy-MM-dd / yyyy-MM-dd HH:mm:ss),避免直接显示英文时间串 by xu 20260114
  1153. const val = window.ssTools.formatValByFmt(c.val, c.fmt);
  1154. card.tags.push({[c.desc]: val});
  1155. });
  1156. }
  1157. if (Array.isArray(row?.chgRootFuncList)) {
  1158. row.chgRootFuncList.forEach((btn) => {
  1159. card.buttons.push({
  1160. id: btn.id,
  1161. titlexxx: btn.title,
  1162. class: "cart-list-setting",
  1163. title: btn.desc || btn.title || "",
  1164. onclick: () => this.openServiceDialog(btn),
  1165. });
  1166. });
  1167. }
  1168. if (row?.play) {
  1169. card.onclick = () => this.openServiceDialog(row.play);
  1170. }
  1171. return card;
  1172. },
  1173. buildPstatChartPanels(bizIcon) {
  1174. // 功能说明:根据 pstatList 构建右侧图表面板(type=chart),用于 ss-sidebar 底部图表区 by xu 20260114
  1175. const list = Array.isArray(this.pstatList) ? this.pstatList : [];
  1176. return list
  1177. .filter((it) => Number(it?.grtjlbm) === 1)
  1178. .map((it) => {
  1179. const panel = {
  1180. type: "chart",
  1181. _grtjid: it?.grtjid,
  1182. _tjtlbm: it?.tjtlbm,
  1183. title: it?.mc || "",
  1184. iconClass: bizIcon,
  1185. // 功能说明:右侧面板图表高度做上限(避免后端 gd 过大导致 sidebar 竖向撑爆) by xu 20260114
  1186. height: (() => {
  1187. const gd = Number(it?.gd);
  1188. const h = (isFinite(gd) && gd > 0) ? Math.max(160, Math.min(260, gd)) : 220;
  1189. return String(h) + "px";
  1190. })(),
  1191. // 功能说明:图表初始占位仍给通用类目坐标;真实类型以 wrPchtPlay.grtj.tjtlbm 为准 by xu 20260520
  1192. options: {
  1193. xAxis: {type: "category", data: []},
  1194. yAxis: {type: "value"},
  1195. series: [{type: "bar", data: []}]
  1196. },
  1197. };
  1198. // 功能说明:全校考勤类型占比图扇区点击下钻(出勤不可下钻) by 20261125
  1199. panel.onChartClick = (params) => this.openKqhzDrillDown(panel, params);
  1200. return panel;
  1201. });
  1202. },
  1203. // 功能说明:按 wrPchtPlay 返回的 tjtlbm 生成扇形/折线/条形图配置(1扇形/11折线/21条形) by xu 20260520
  1204. buildPstatChartOptions(data, tjtlbm) {
  1205. const safeData = Array.isArray(data) ? data : [];
  1206. const xData = safeData.map((it) => it.name);
  1207. const yData = safeData.map((it) => it.value);
  1208. const colorList = ["#5470C6", "#91CC75", "#FAC858", "#EE6666", "#73C0DE", "#3BA272", "#FC8452", "#9A60B4", "#EA7CCC"];
  1209. const typeCode = Number(tjtlbm);
  1210. if (typeCode === 1) {
  1211. return {
  1212. color: colorList,
  1213. tooltip: {trigger: "item"},
  1214. legend: {type: "scroll", bottom: 0, left: "center"},
  1215. series: [{
  1216. type: "pie",
  1217. radius: ["40%", "72%"],
  1218. center: ["50%", "42%"],
  1219. avoidLabelOverlap: true,
  1220. itemStyle: {borderRadius: 6, borderColor: "#fff", borderWidth: 2},
  1221. label: {show: true, formatter: "{b}: {c}"},
  1222. data: safeData,
  1223. }],
  1224. };
  1225. }
  1226. if (typeCode === 11) {
  1227. return {
  1228. color: colorList,
  1229. tooltip: {trigger: "axis"},
  1230. grid: {left: "3%", right: "3%", top: 12, bottom: 24, containLabel: true},
  1231. xAxis: {
  1232. type: "category",
  1233. boundaryGap: false,
  1234. data: xData,
  1235. axisLabel: {interval: 0, rotate: xData.length > 6 ? 30 : 0}
  1236. },
  1237. yAxis: {type: "value"},
  1238. series: [{
  1239. type: "line",
  1240. smooth: true,
  1241. symbol: "circle",
  1242. symbolSize: 8,
  1243. data: yData,
  1244. label: {show: true, position: "top"},
  1245. areaStyle: {opacity: 0.12},
  1246. }],
  1247. };
  1248. }
  1249. return {
  1250. color: colorList,
  1251. tooltip: {trigger: "axis", axisPointer: {type: "shadow"}},
  1252. grid: {left: "3%", right: "3%", top: 12, bottom: 24, containLabel: true},
  1253. xAxis: {
  1254. type: "category",
  1255. data: xData,
  1256. axisLabel: {interval: 0, rotate: xData.length > 6 ? 30 : 0}
  1257. },
  1258. yAxis: {type: "value"},
  1259. series: [{
  1260. type: "bar",
  1261. barMaxWidth: 36,
  1262. data: yData,
  1263. label: {show: true, position: "top"},
  1264. }],
  1265. };
  1266. },
  1267. loadPstatChartData(panel) {
  1268. // 功能说明:根据 grtjid 调 wrPchtPlay 获取真实数据,并写回 panel.options 触发渲染 by xu 20260114
  1269. const grtjid = panel?._grtjid;
  1270. if (!grtjid) return Promise.resolve(null);
  1271. return this.callSsService("wrPchtPlay", {grtjid})
  1272. .then((res) => {
  1273. const payload = res && typeof res === "object" ? (res.ssData || res) : null;
  1274. // 功能说明:兼容 wrPchtPlay 返回 dataArray(name=mc,value=sl) by xu 20260114
  1275. let list =
  1276. (payload && (payload.dataArray || payload.dataList || payload.list || payload.data)) ||
  1277. payload;
  1278. if (!Array.isArray(list)) list = [];
  1279. const data = list
  1280. .map((it) => {
  1281. if (!it || typeof it !== "object") return null;
  1282. const name = it.name ?? it.mc ?? it.desc ?? it.title;
  1283. const value = it.value ?? it.sl ?? it.zrs ?? it.count ?? it.num;
  1284. if (name === undefined || name === null) return null;
  1285. const v = Number(value);
  1286. return {name: String(name), value: isNaN(v) ? 0 : v};
  1287. })
  1288. .filter(Boolean);
  1289. // 功能说明:优先使用 wrPchtPlay.grtj.tjtlbm 决定图表类型,兼容 panel 初始携带的 tjtlbm by xu 20260520
  1290. const tjtlbm = payload?.grtj?.tjtlbm ?? panel?._tjtlbm;
  1291. panel._tjtlbm = tjtlbm;
  1292. // 功能说明:缓存本图扇区名,用于判断是海康图(迟到/晚归/未归)还是普通考勤图(出勤/缺勤) by 20261126
  1293. panel._drillNames = data.map((d) => d.name);
  1294. panel.options = this.buildPstatChartOptions(data, tjtlbm);
  1295. // 功能说明:打印右侧图表类型命中结果,便于确认 tjtlbm 分支是否生效 by xu 20260520
  1296. console.log("[objList chart] apply type", {
  1297. grtjid: grtjid,
  1298. title: panel?.title || payload?.grtj?.mc || "",
  1299. tjtlbm: tjtlbm,
  1300. chartType: Number(tjtlbm) === 1 ? "pie" : Number(tjtlbm) === 11 ? "line" : "bar",
  1301. dataLength: data.length,
  1302. });
  1303. // 功能说明:强制触发 sidebarPanels 更新(避免仅在选中卡片后才刷新图表) by xu 20260114
  1304. try {
  1305. this.sidebarPanels = (this.sidebarPanels || []).slice();
  1306. } catch (e) {
  1307. }
  1308. // 功能说明:图表初次渲染时容器尺寸可能未稳定,nextTick 后触发 resize,避免“未选中=灰色圆” by xu 20260114
  1309. try {
  1310. const self = this;
  1311. if (self && self.$nextTick) {
  1312. self.$nextTick(function () {
  1313. try {
  1314. window.dispatchEvent(new Event("resize"));
  1315. } catch (e) {
  1316. }
  1317. });
  1318. }
  1319. setTimeout(function () {
  1320. try {
  1321. window.dispatchEvent(new Event("resize"));
  1322. } catch (e) {
  1323. }
  1324. }, 120);
  1325. } catch (e) {
  1326. }
  1327. return res;
  1328. })
  1329. .catch((e) => {
  1330. console.error("loadPstatChartData failed", grtjid, e);
  1331. return null;
  1332. });
  1333. },
  1334. // 功能说明:全校考勤类型占比图三级下钻(普通图走 KQJL.KQLBM,海康图走海康口径) by 20261126
  1335. openKqhzDrillDown(panel, params) {
  1336. const title = panel?.title || "";
  1337. if (title.indexOf("全校考勤类型占比图") < 0) return; // 容忍“(本周)”等后缀
  1338. const name = params?.name || "";
  1339. if (!name) return;
  1340. const names = Array.isArray(panel?._drillNames) ? panel._drillNames : [];
  1341. const isHk = names.some((n) => n === "迟到" || n === "晚归" || n === "未归");
  1342. let parm = null;
  1343. let dest = "kqjl_kqhz_weekDays";
  1344. let dlgTitle = name + " - 本周每日分布";
  1345. let dlgWidth = 820;
  1346. let dlgHeight = 520;
  1347. if (isHk) {
  1348. // 海康图:类型 -> 专业饼图 -> 班级饼图 -> 卡片
  1349. const hkMap = { "迟到": "cd", "事假": "sj", "病假": "bj", "晚归": "wg", "未归": "wn" };
  1350. const kind = hkMap[name];
  1351. if (!kind) return;
  1352. parm = { mode: "hk", kind: kind, lbmc: name };
  1353. dest = "kqjl_kqhz_majorPie";
  1354. dlgTitle = name + " - 各专业分布(本周)";
  1355. dlgWidth = 900;
  1356. dlgHeight = 600;
  1357. } else {
  1358. // 普通图:缺勤/事假/病假(出勤不下钻)
  1359. const lbMap = { "缺勤": 1, "事假": 31, "病假": 41 };
  1360. const kqlbm = lbMap[name];
  1361. if (!kqlbm) return;
  1362. parm = { mode: "kq", kqlbm: kqlbm, lbmc: name };
  1363. }
  1364. try {
  1365. window.ssTools.openServiceDialog({
  1366. dest: dest,
  1367. parm: parm,
  1368. title: dlgTitle,
  1369. width: dlgWidth,
  1370. height: dlgHeight,
  1371. });
  1372. } catch (e) {
  1373. console.error("openKqhzDrillDown failed", e);
  1374. }
  1375. },
  1376. applyPobjHomeData(ssData) {
  1377. if (!ssData || typeof ssData !== "object") return;
  1378. this.ssHomeResp = ssData;
  1379. this.homeReady = true;
  1380. this.userInteracted = false;
  1381. this.ssObjName = ssData.ssObjName || this.ssObjName; // 对象名
  1382. this.searchFieldList = Array.isArray(ssData.searchFieldList) ? ssData.searchFieldList : []; // 查询条件字段
  1383. this.rootFuncList = Array.isArray(ssData.rootFuncList) ? ssData.rootFuncList : []; // 根功能
  1384. this.hasKeyword = !!ssData.hasKeyword; // 是否有关键词
  1385. this.hasScope = !!ssData.hasScope; // 是否带范围
  1386. this.thnType = Number(ssData.thnType || 0); // 缩略图类型
  1387. this.ssPaging = ssData.ssPaging || this.ssPaging; // 翻页信息
  1388. this.rbarFuncList = Array.isArray(ssData.rbarFuncList) ? ssData.rbarFuncList : []; // 右侧栏功能
  1389. this.rbarTabNameList = Array.isArray(ssData.rbarTabNameList) ? ssData.rbarTabNameList : []; // 右侧栏选项卡
  1390. this.pstatList = Array.isArray(ssData.pstatList) ? ssData.pstatList : []; // 功能说明:个人统计图表配置 by xu 20260114
  1391. // 功能说明:优先使用后端 0 服务字段 rbar 控制右侧栏显隐;若后端缺省未返回 rbar,则临时回退为 3 字段判空规则 by xu 20260123
  1392. if (Object.prototype.hasOwnProperty.call(ssData, "rbar")) {
  1393. this.rbar = !!ssData.rbar;
  1394. this.showRightSidebar = !!ssData.rbar;
  1395. } else {
  1396. this.rbar = null;
  1397. // 功能说明:临时规则——当 rbarTabNameList/rbarFuncList/pstatList 全为空时隐藏右侧栏,把宽度让给左侧列表;后续改为“无 rbarTabNameList && 无图表标记”再隐藏(等后端给图表标记) by xu 20260122
  1398. this.showRightSidebar = (this.rbarTabNameList?.length > 0) || (this.rbarFuncList?.length > 0) || (this.pstatList?.length > 0);
  1399. }
  1400. // 功能说明:如果首页返回预订/服务面板(rbarBook/rbarbook/rbarServ),则卡片主体点击切到 single(单选互斥),否则保持 view(查看) by xu 20260116
  1401. {
  1402. const tabs = Array.isArray(this.rbarTabNameList) ? this.rbarTabNameList : [];
  1403. const norm = (s) => String(s || "").trim().toLowerCase();
  1404. this.hasBookPanel = tabs.some((t) => norm(t) === "rbarbook"); // 功能说明:预订tab存在才回显bookList by xu 20260116
  1405. this.hasServPanel = tabs.some((t) => norm(t) === "rbarserv"); // 功能说明:服务tab存在才回显servList by xu 20260116
  1406. this.hasObjPanel = tabs.some((t) => norm(t) === "rbarobj"); // 功能说明:无 rbarObj 时禁用选中能力 by xu 20260122
  1407. this.cardClickAction = (this.hasObjPanel && (this.hasBookPanel || this.hasServPanel)) ? "single" : "view"; // 功能说明:仅允许选中时才启用单选联动 by xu 20260122
  1408. }
  1409. this.searchButtonConfigCheckId = String(this.form?.management || "99");
  1410. // 用当前表单参数初始化 form(确保 v-model 有值)
  1411. const curParams = this.getSearchFormParams();
  1412. const nextForm = {...this.form, ...curParams};
  1413. this.searchFieldList.forEach((f) => {
  1414. if (f && f.name && !(f.name in nextForm)) nextForm[f.name] = "";
  1415. });
  1416. this.form = nextForm;
  1417. this.searchButtonConfigCheckId = String(this.form?.management || "99");
  1418. if (this.rootFuncList) {
  1419. this.subpageOpt = [];
  1420. this.rootFuncList.forEach((func) => {
  1421. if (func.pageList) {
  1422. func.pageList.forEach((page) => {
  1423. this.subpageOpt.push({
  1424. id: page.id,
  1425. desc: page.desc,
  1426. callback: () => this.swSubpage(page),
  1427. });
  1428. });
  1429. }
  1430. });
  1431. }
  1432. // 初始化列表(objList/draftList)
  1433. const nextDraft = Array.isArray(ssData.draftList) ? ssData.draftList.map((r) => this.normalizeObjToCard(r)) : [];
  1434. const nextList = Array.isArray(ssData.objList) ? ssData.objList.map((r) => this.normalizeObjToCard(r)) : [];
  1435. if (this.listConfig) {
  1436. this.listConfig.draftbox = nextDraft;
  1437. this.listConfig.list = nextList;
  1438. }
  1439. // 列表数据更新后,重新探测卡片网格类型
  1440. this.cardGridKind = this.detectCardGridKind();
  1441. // 功能说明:首页列表/右侧栏落地后,按当前容器尺寸更新 autoRowNumPer(不立即重拉;下次列表请求时生效) by xu 20260123
  1442. if (this.$nextTick) this.$nextTick(() => this.scheduleAutoRowNumPer("home"));
  1443. else this.scheduleAutoRowNumPer("home");
  1444. // 初始化右侧栏(选项卡 + 功能)
  1445. const bizIcon = this.ssObjName ? ("ss-sidebar-biz-icon icon-obj-" + this.ssObjName) : "";
  1446. // 功能说明:右侧各 tab header 图标:预订/服务用固定业务图标,其余沿用当前对象图标 by xu 20260123
  1447. const tabIconClassOf = (tabKeyLower) => {
  1448. if (tabKeyLower === "rbarbook") return "ss-sidebar-biz-icon icon-obj-yd";
  1449. if (tabKeyLower === "rbarserv") return "ss-sidebar-biz-icon icon-obj-fw";
  1450. return bizIcon;
  1451. };
  1452. const pickedPanel = this.hasObjPanel ? { // 功能说明:仅 rbarObj 存在才显示“已选”tab by xu 20260122
  1453. type: "list",
  1454. title: "已选",
  1455. count: this.selectedItems.length,
  1456. iconClass: bizIcon,
  1457. closable: true,
  1458. itemLayout: "person",
  1459. items: this.selectedItems,
  1460. mode: "selected",
  1461. itemAction: true,
  1462. onClear: () => this.clearSelectedItems(),
  1463. } : null;
  1464. // 功能说明:面板 key 兼容后端大小写(rbarBook/rbarbook/rbarServ),并移除“对象”tab by xu 20260116
  1465. const titleMap = {rbarry: "人员", rbarbook: "预订", rbarserv: "服务"};
  1466. const tabs = Array.isArray(this.rbarTabNameList) ? this.rbarTabNameList : [];
  1467. const normKey = (s) => String(s || "").trim().toLowerCase();
  1468. const tabPanels = tabs.map((k) => {
  1469. const nk = normKey(k);
  1470. // 功能说明:右侧栏去掉“对象”tab(即使后端返回 rbarObj 也忽略) by xu 20260116
  1471. if (nk === "rbarobj") return null;
  1472. const p = {
  1473. type: "list",
  1474. _tabKey: nk, // 功能说明:保存原始 tab key(用于后续写回 items) by xu 20260114
  1475. title: titleMap[nk] || k,
  1476. iconClass: tabIconClassOf(nk),
  1477. items: [],
  1478. itemAction: false,
  1479. };
  1480. // 功能说明:右侧“预订/服务”面板复用“已选”tab 的 person 布局(title+meta),避免渲染 ss-sidebar-tag by xu 20260116
  1481. if (nk === "rbarbook") {
  1482. p.itemLayout = "person";
  1483. }
  1484. if (nk === "rbarserv") {
  1485. p.itemLayout = "simple"; // 功能说明:服务面板只回显 mc(名称),不需要 meta 槽位 by xu 20260116
  1486. }
  1487. // 功能说明:右侧“人员”面板先做前端 mock 搜索头(仅展示,不接后端) by xu 20260114
  1488. if (nk === "rbarry") {
  1489. p.iconClass = "ss-sidebar-biz-icon icon-obj-ry"; // 功能说明:右侧“人员”tab 使用右侧栏 biz 图标基类 by xu 20260123
  1490. p.count = 0;
  1491. p.headerFilters = [
  1492. {
  1493. key: "keyword",
  1494. component: "ss-search-input",
  1495. props: {name: "keyword", placeholder: "人员", width: "140px"},
  1496. value: "",
  1497. },
  1498. ];
  1499. p.headerSearchButton = true;
  1500. p.onSearch = function (payload) {
  1501. try {
  1502. console.log("人员搜索", payload);
  1503. } catch (_) {
  1504. }
  1505. };
  1506. p.mode = "selected";
  1507. p.items = [];
  1508. p.itemAction = false;
  1509. }
  1510. return p;
  1511. }).filter(Boolean);
  1512. this.sidebarPanels = pickedPanel ? [pickedPanel, ...tabPanels] : tabPanels; // 功能说明:无 rbarObj 时不注入“已选”tab by xu 20260122
  1513. try {
  1514. console.log("[pobj] sidebarPanels(init)", (this.sidebarPanels || []).map((p) => ({
  1515. title: p?.title,
  1516. type: p?.type,
  1517. tab: p?._tabKey
  1518. })));
  1519. } catch (_) {
  1520. } // 功能说明:打印初始化后的面板列表,排查缺少“对象/预订”tab by xu 20260116
  1521. // 功能说明:将 pstatList=51 聚拢为一个“报表”面板(type=report-table),用于右侧报表区 by xu 20260115
  1522. try {
  1523. const reportList = (Array.isArray(this.pstatList) ? this.pstatList : []).filter((it) => Number(it?.grtjlbm) === 51);
  1524. if (reportList.length) {
  1525. this.sidebarPanels = this.sidebarPanels.concat([{
  1526. type: "report-table",
  1527. title: "报表",
  1528. iconClass: bizIcon,
  1529. items: reportList,
  1530. // 功能说明:点击统计表单元格,优先按 fwm/bjm 组装后端 service 并弹窗 by xu 20260115
  1531. onOpen: (srv) => this.openServiceDialog(srv),
  1532. }]);
  1533. }
  1534. } catch (e) {
  1535. }
  1536. // 功能说明:将 pstatList=1 映射为右侧图表区(type=chart),并调 wrPchtPlay 拉取真实数据 by xu 20260114
  1537. const chartPanels = this.buildPstatChartPanels(bizIcon);
  1538. if (chartPanels.length) {
  1539. this.sidebarPanels = this.sidebarPanels.concat(chartPanels);
  1540. chartPanels.forEach((p) => this.loadPstatChartData(p));
  1541. // 功能说明:追加 chartPanels 后触发一次 resize,避免首次进入图表为灰色圆(布局未完成) by xu 20260114
  1542. try {
  1543. setTimeout(function () {
  1544. window.dispatchEvent(new Event("resize"));
  1545. }, 0);
  1546. } catch (_) {
  1547. }
  1548. }
  1549. this.sidebarButtons = this.rbarFuncList.map((f) => ({
  1550. id: f.id || f.servName,
  1551. text: f.desc || f.title || "",
  1552. onClick: () => this.openServiceDialog(f),
  1553. }));
  1554. if (!this.showRightSidebar) { // 功能说明:右侧栏隐藏时清空面板/按钮,避免残留旧数据误导(临时规则) by xu 20260122
  1555. this.sidebarPanels = [];
  1556. this.sidebarButtons = [];
  1557. }
  1558. },
  1559. handleRootFuncClick(func) {
  1560. this.openServiceDialog(func);
  1561. },
  1562. swSubpage(page) {
  1563. this.selSubpage = String(page.id);
  1564. this.openServiceDialog(page);
  1565. },
  1566. // 切换范围(所有/管理/创建/已办/停用)=> 刷新列表(不刷新右侧栏)
  1567. switchScope(management) {
  1568. if (this.loadingList) return;
  1569. this.form.management = String(management);
  1570. this.searchButtonConfigCheckId = String(management);
  1571. this.ssPaging.pageNo = 1;
  1572. this.userInteracted = true;
  1573. this.loadPobjList({ source: "scope" });
  1574. },
  1575. // 提取当前表单参数(用于 ajax 调用 /service?ssServ=...)
  1576. getSearchFormParams() {
  1577. const params = {};
  1578. try {
  1579. const arr = $("#myForm").serializeArray();
  1580. arr.forEach(({name, value}) => {
  1581. if (!name) return;
  1582. if (name === "pageNo" || name === "rowNumPer" || name === "rowNum") return; // 功能说明:分页参数不再从表单序列化读取(完全由 ssPaging 驱动) by xu 20260123
  1583. if (Object.prototype.hasOwnProperty.call(params, name)) {
  1584. const cur = params[name];
  1585. params[name] = Array.isArray(cur) ? cur.concat([value]) : [cur, value];
  1586. } else {
  1587. params[name] = value;
  1588. }
  1589. });
  1590. } catch (e) {
  1591. console.error("getSearchFormParams failed", e);
  1592. }
  1593. return params;
  1594. },
  1595. // 以 Vue data 为准,组装列表/搜索请求参数(避免依赖组件内部 input 的实现)
  1596. getPobjParams() {
  1597. const params = {};
  1598. const form = this.form || {};
  1599. Object.keys(form).forEach((k) => {
  1600. const v = form[k];
  1601. if (v === undefined || v === null) return;
  1602. if (typeof v === "object") return;
  1603. params[k] = v;
  1604. });
  1605. if (this.ssPaging) {
  1606. params.pageNo = this.ssPaging.pageNo;
  1607. params.rowNumPer = this.ssPaging.rowNumPer;
  1608. params.rowNum = this.ssPaging.rowNum;
  1609. }
  1610. return params;
  1611. },
  1612. // 通用:调用后端 service(统一返回原生 Promise,避免 jqXHR 不支持 finally/catch)
  1613. callSsService(ssServ, extraParams = {}) {
  1614. if (!ssServ) return Promise.resolve(null);
  1615. return new Promise((resolve) => {
  1616. $.ajax({
  1617. type: "get",
  1618. url: "/service",
  1619. data: {ssServ, ...extraParams},
  1620. dataType: "text",
  1621. })
  1622. .done((text) => {
  1623. if (typeof text !== "string") return resolve(text);
  1624. const t = text.trim();
  1625. if (!t) return resolve(null);
  1626. try {
  1627. return resolve(JSON.parse(t));
  1628. } catch (_) {
  1629. return resolve(text);
  1630. }
  1631. })
  1632. .fail((xhr, status, err) => {
  1633. console.error("callSsService failed", ssServ, status, err);
  1634. resolve(null);
  1635. });
  1636. });
  1637. },
  1638. // 初始化:拉取查询首页数据(搜索条件/初始列表/右侧面板等)
  1639. loadPobjHome() {
  1640. const ssServ = this.ssSearchPobjHomeServName;
  1641. if (!ssServ) return Promise.resolve(null);
  1642. if (this.loadingHome) return Promise.resolve(null);
  1643. const startedAt = Date.now();
  1644. this.loadingHome = true;
  1645. this.homeReady = false;
  1646. this.userInteracted = false;
  1647. const params = this.getPobjParams();
  1648. // 功能说明:打印首屏请求参数,确认 rowNumPer 是否在第一个接口前写入 by xu 20260123
  1649. try { console.log("[objList][自适应分页] 首页请求参数", { ssServ, pageNo: params?.pageNo, rowNumPer: params?.rowNumPer, rowNum: params?.rowNum, autoRowNumPer: this.autoRowNumPer }); } catch (_) {}
  1650. return this.callSsService(ssServ, params)
  1651. .then((res) => {
  1652. const payload = res && typeof res === "object" ? (res.ssData || res) : null;
  1653. this.applyPobjHomeData(payload);
  1654. console.log("[pobj] home", ssServ, res);
  1655. return res;
  1656. })
  1657. .finally(() => {
  1658. const delay = Math.max(0, 200 - (Date.now() - startedAt));
  1659. setTimeout(() => {
  1660. this.loadingHome = false;
  1661. }, delay);
  1662. });
  1663. },
  1664. applyPobjListData(ssData) {
  1665. if (!ssData || typeof ssData !== "object") return;
  1666. // thnType(若列表接口也返回,则更新;一般由首页接口返回)
  1667. if (ssData.thnType != null) this.thnType = Number(ssData.thnType || 0);
  1668. if (ssData.ssPaging) {
  1669. this.ssPaging = {
  1670. ...this.ssPaging,
  1671. ...ssData.ssPaging,
  1672. pageNo: Number(ssData.ssPaging.pageNo || 1),
  1673. rowNumPer: Number(this.ssPaging?.rowNumPer || ssData.ssPaging.rowNumPer || 0), // 功能说明:rowNumPer 由 loadPobjList 按 autoRowNumPer 统一生效;这里只在当前为空时回退后端值 by xu 20260123
  1674. rowNum: Number(ssData.ssPaging.rowNum || 0),
  1675. };
  1676. }
  1677. const nextList = Array.isArray(ssData.objList) ? ssData.objList.map((r) => this.normalizeObjToCard(r)) : [];
  1678. if (this.listConfig) this.listConfig.list = nextList;
  1679. this.cardGridKind = this.detectCardGridKind();
  1680. // 功能说明:列表接口返回后不再每次重算 autoRowNumPer,避免翻页过程中 rowNumPer 在 15/16 间抖动;仅在 autoRowNumPer 尚未得到时兜底计算一次 by xu 20260303
  1681. if (!Number(this.autoRowNumPer || 0)) {
  1682. if (this.$nextTick) this.$nextTick(() => this.scheduleAutoRowNumPer("list-init"));
  1683. else this.scheduleAutoRowNumPer("list-init");
  1684. }
  1685. },
  1686. // 功能说明:将 <对象名>_cxycl 返回的 bookList 写回右侧预订面板 by xu 20260114
  1687. applyPobjYclData(ssData) {
  1688. // 功能说明:兼容返回结构(ssData 可能是整包 {ssCode,ssData} 或直接 ssData),避免“预订tab不回显” by xu 20260116
  1689. if (!ssData) return;
  1690. const data = (ssData && typeof ssData === "object" && ssData.ssData && typeof ssData.ssData === "object") ? ssData.ssData : ssData;
  1691. if (!data || typeof data !== "object") return;
  1692. const ensurePanel = (tabKeyLower, title) => {
  1693. // 功能说明:严格依赖首页 rbarTabNameList 决定是否允许创建面板:未返回 rbarServ 时即使 cxycl 有 servList 也不处理 by xu 20260116
  1694. if (tabKeyLower === "rbarbook" && !this.hasBookPanel) return null;
  1695. if (tabKeyLower === "rbarserv" && !this.hasServPanel) return null;
  1696. const panels = Array.isArray(this.sidebarPanels) ? this.sidebarPanels : [];
  1697. let p = panels.find((it) => String(it?._tabKey || "").toLowerCase() === tabKeyLower);
  1698. if (p) return p;
  1699. const idx = panels.findIndex((it) => it?.type === "chart");
  1700. const insertAt = idx >= 0 ? idx : panels.length;
  1701. p = {
  1702. type: "list",
  1703. _tabKey: tabKeyLower,
  1704. title,
  1705. // 功能说明:预订/服务面板 iconClass 与首页初始化保持一致(避免 cxycl 兜底创建时图标错误) by xu 20260123
  1706. iconClass: (tabKeyLower === "rbarbook")
  1707. ? "ss-sidebar-biz-icon icon-obj-yd"
  1708. : (tabKeyLower === "rbarserv")
  1709. ? "ss-sidebar-biz-icon icon-obj-fw"
  1710. : (this.ssObjName ? ("ss-sidebar-biz-icon icon-obj-" + this.ssObjName) : ""),
  1711. items: [],
  1712. itemAction: false,
  1713. };
  1714. // 功能说明:预订面板默认使用 person 布局(title+meta) by xu 20260116
  1715. if (tabKeyLower === "rbarbook") p.itemLayout = "person";
  1716. if (tabKeyLower === "rbarserv") p.itemLayout = "simple"; // 功能说明:服务面板只回显 mc(名称) by xu 20260116
  1717. panels.splice(insertAt, 0, p);
  1718. this.sidebarPanels = panels;
  1719. return p;
  1720. };
  1721. const fmtDt = (v) => { // 功能说明:JSP 页面避免使用 JS 模板字符串插值(可能被 JSP EL 干扰),统一用字符串拼接 by xu 20260114
  1722. if (v === undefined || v === null || v === "") return "";
  1723. const d = new Date(v);
  1724. if (!isNaN(d.getTime())) {
  1725. const pad2 = (n) => String(n).padStart(2, "0");
  1726. return (
  1727. String(d.getFullYear()) +
  1728. "-" +
  1729. pad2(d.getMonth() + 1) +
  1730. "-" +
  1731. pad2(d.getDate()) +
  1732. " " +
  1733. pad2(d.getHours()) +
  1734. ":" +
  1735. pad2(d.getMinutes())
  1736. );
  1737. }
  1738. return String(v);
  1739. };
  1740. const bookList = Array.isArray(data.bookList) ? data.bookList : [];
  1741. const servList = Array.isArray(data.servList) ? data.servList : []; // 功能说明:将 <对象名>_cxycl 返回的 servList 写回右侧服务面板 by xu 20260116
  1742. try {
  1743. console.log("[pobj] cxycl bookList", {len: bookList.length, bookList: bookList});
  1744. } catch (_) {
  1745. } // 功能说明:打印 cxycl 返回,排查“预订tab不回显” by xu 20260116
  1746. // 功能说明:无论 bookList 是否为空,都要写回面板(为空则清空旧数据),避免“切换对象但仍显示上一次预订人” by xu 20260114
  1747. const bookPanel = ensurePanel("rbarbook", "预订");
  1748. if (bookPanel) {
  1749. bookPanel.itemLayout = "person"; // 功能说明:预订面板复用“已选”tab 的 person 布局(title+中间 meta 槽位),不走 tags by xu 20260114
  1750. bookPanel.items = bookList.map((b) => ({
  1751. _raw: b,
  1752. id: b?.id,
  1753. title: String(b?.ydr ?? ""), // 功能说明:预订面板 title=预订人 by xu 20260114
  1754. meta: String(b?.ydrdh ?? ""), // 功能说明:预订面板中间槽位 meta=电话(同“已选”tab) by xu 20260114
  1755. tags: [], // 功能说明:预订面板不使用 tags(避免自定义标签样式) by xu 20260114
  1756. }));
  1757. bookPanel.count = bookPanel.items.length;
  1758. }
  1759. // 功能说明:服务面板按预订(book)回显逻辑写回(title+meta),为空也要清空 by xu 20260116
  1760. const servPanel = ensurePanel("rbarserv", "服务");
  1761. if (servPanel) {
  1762. servPanel.itemLayout = "simple"; // 功能说明:服务面板字段只有 id/mc,仅回显 mc(名称) by xu 20260116
  1763. servPanel.items = servList.map((s) => ({
  1764. _raw: s,
  1765. id: s?.id, // 功能说明:服务面板 id=数据库ID by xu 20260116
  1766. title: String(s?.mc ?? ""), // 功能说明:服务面板 title=mc(名称) by xu 20260116
  1767. tags: [],
  1768. }));
  1769. servPanel.count = servPanel.items.length;
  1770. }
  1771. // 功能说明:强制触发 sidebarPanels 更新,避免仅修改子对象导致视图未刷新(预订tab回显不更新) by xu 20260116
  1772. try {
  1773. this.sidebarPanels = (this.sidebarPanels || []).slice();
  1774. } catch (e) {
  1775. }
  1776. try {
  1777. console.log("[pobj] cxycl bookPanel(after)", {
  1778. title: bookPanel.title,
  1779. tab: bookPanel._tabKey,
  1780. count: bookPanel.count,
  1781. first: bookPanel.items?.[0],
  1782. });
  1783. } catch (_) {
  1784. } // 功能说明:打印写回后的面板状态,排查“预订tab不回显” by xu 20260116
  1785. },
  1786. // 功能说明:选中对象后联动调用 <对象名>_cxycl,填充右侧预订/服务面板 by xu 20260114
  1787. loadPobjYclByItem(item) {
  1788. if (!(this.hasBookPanel || this.hasServPanel)) return Promise.resolve(null); // 功能说明:预订/服务任一存在才调用 cxycl;否则不联动 by xu 20260116
  1789. const objNum = item?.objNum || item?._raw?.ssObjId || item?._raw?.ssObjId;
  1790. if (!objNum) return Promise.resolve(null);
  1791. const ssServ = this.ssObjName ? (String(this.ssObjName) + "_cxycl") : "";
  1792. if (!ssServ) return Promise.resolve(null);
  1793. const reqId = (this.__yclReqId = (this.__yclReqId || 0) + 1);
  1794. this.yclLoading = true;
  1795. // 功能说明:cxycl 需要同时传入 ssObjIdName=<对象名>id,且把对象ID用该字段名提交(如 cdid=90052) by xu 20260114
  1796. const ssObjIdName = String(this.ssObjName || "") + "id";
  1797. const params = {ssObjName: this.ssObjName, ssObjIdName: ssObjIdName, ssObjId: objNum};
  1798. params[ssObjIdName] = objNum;
  1799. return this.callSsService(ssServ, params)
  1800. .then((res) => {
  1801. if (reqId !== this.__yclReqId) return null;
  1802. // 功能说明:兼容 $.ajax/axios 等不同返回结构,避免取错层级导致 bookList 为空 by xu 20260116
  1803. const payload = res && typeof res === "object" ? (res.ssData || res?.data?.ssData || res?.data || res) : null;
  1804. this.yclResp = payload;
  1805. this.applyPobjYclData(payload);
  1806. return res;
  1807. })
  1808. .finally(() => {
  1809. if (reqId !== this.__yclReqId) return;
  1810. this.yclLoading = false;
  1811. });
  1812. },
  1813. // 拉取列表数据(分页/搜索等)
  1814. loadPobjList(options = {}) {
  1815. const ssServ = this.ssSearchPobjListServName;
  1816. if (!ssServ) return Promise.resolve(null);
  1817. // 只有用户操作后才允许请求列表(避免初始化阶段出现第二个 loading)
  1818. if (!this.userInteracted) return Promise.resolve(null);
  1819. if (this.loadingList) return Promise.resolve(null);
  1820. const opts = (options && typeof options === "object") ? options : {};
  1821. const source = String(opts.source || "general");
  1822. const lockRowNumPer = !!opts.lockRowNumPer;
  1823. this.__lastListLoadSource = source;
  1824. // 功能说明:rowNumPer 按 autoRowNumPer 生效(resize 只记录,不立即请求;下次接口请求时才更新) by xu 20260123
  1825. // 功能说明:翻页/刷新请求锁定当前 rowNumPer,避免在翻页链路中被 autoRowNumPer 覆盖导致 pageNo 重置 by xu 20260303
  1826. if (!lockRowNumPer) {
  1827. try {
  1828. const next = Number(this.autoRowNumPer || 0);
  1829. const cur = Number(this.ssPaging?.rowNumPer || 0);
  1830. if (next > 0 && next !== cur) {
  1831. try { console.log("[objList][自适应分页] 列表请求前应用 rowNumPer", { source, cur, next, pageNo: this.ssPaging?.pageNo }); } catch (_) {}
  1832. this.ssPaging.rowNumPer = next;
  1833. // 功能说明:仅在非翻页来源下,页大小变化时回到第一页;翻页来源必须保持当前页码 by xu 20260303
  1834. if (source !== "page") {
  1835. this.ssPaging.pageNo = 1;
  1836. }
  1837. }
  1838. } catch (_) {
  1839. }
  1840. }
  1841. const startedAt = Date.now();
  1842. this.loadingList = true;
  1843. // 点击后立即清空列表区域,避免用户误以为没点到
  1844. if (this.listConfig) {
  1845. this.listConfig.draftbox = [];
  1846. this.listConfig.list = [];
  1847. }
  1848. const params = this.getPobjParams();
  1849. try { console.log("[objList][分页请求]", { source, lockRowNumPer, pageNo: params?.pageNo, rowNumPer: params?.rowNumPer, rowNum: params?.rowNum }); } catch (_) {}
  1850. return this.callSsService(ssServ, params)
  1851. .then((res) => {
  1852. const payload = res && typeof res === "object" ? (res.ssData || res) : null;
  1853. this.ssListResp = payload;
  1854. this.applyPobjListData(payload);
  1855. console.log("[pobj] list", ssServ, res);
  1856. return res;
  1857. })
  1858. .finally(() => {
  1859. const delay = Math.max(0, 200 - (Date.now() - startedAt));
  1860. setTimeout(() => {
  1861. this.loadingList = false;
  1862. }, delay);
  1863. });
  1864. },
  1865. // 初始化右侧边栏分区(已选 items 指向 selectedItems) by xu 20260113
  1866. initSidebarPanels() {
  1867. const bizIcon = this.ssObjName ? ('ss-sidebar-biz-icon icon-obj-' + this.ssObjName) : ''; // 功能说明:右侧栏 iconClass 使用右侧栏 biz 图标基类 by xu 20260123
  1868. // 初始只放“已选”,其他分区由首页接口(rbarTabNameList)初始化
  1869. this.sidebarPanels = [];
  1870. this.sidebarButtons = [];
  1871. },
  1872. // 更新已选分区计数 by xu 20260113
  1873. updatePickedPanelCount() {
  1874. const pickedPanel = this.sidebarPanels?.find?.((p) => p?.title === '已选');
  1875. if (pickedPanel) pickedPanel.count = this.selectedItems.length;
  1876. },
  1877. // 清空已选(右侧 header 清空按钮) by xu 20260113
  1878. clearSelectedItems() {
  1879. // 功能说明:按稳定 key 反向同步当前列表卡片选中态(避免列表刷新后对象引用变化导致取消选中失效) by xu 20260122
  1880. const keyOf = (it) => String(it?.objNum || it?.ssObjId || it?._raw?.ssObjId || it?._raw?.objNum || "");
  1881. const keys = new Set((this.selectedItems || []).map(keyOf).filter(Boolean));
  1882. const all = [].concat(this.listConfig?.draftbox || []).concat(this.listConfig?.list || []);
  1883. all.forEach((it) => {
  1884. const k = keyOf(it);
  1885. if (!k) return;
  1886. if (keys.has(k)) it._ssSelected = false;
  1887. });
  1888. this.selectedItems.forEach((it) => {
  1889. if (it) it._ssSelected = false;
  1890. });
  1891. this.selectedItems.splice(0, this.selectedItems.length);
  1892. this.updatePickedPanelCount();
  1893. // 功能说明:强制触发 sidebarPanels 更新,避免 count 未刷新 by xu 20260122
  1894. try { this.sidebarPanels = (this.sidebarPanels || []).slice(); } catch (_) {}
  1895. },
  1896. // 右侧边栏移除 -> 反向同步左侧卡片状态 by xu 20260113
  1897. handleSidebarRemove(item) {
  1898. if (!item) return;
  1899. // 功能说明:按稳定 key 移除,避免列表刷新后 selectedItems/indexOf 引用不一致导致 count 不更新/取消失败 by xu 20260122
  1900. const keyOf = (it) => String(it?.objNum || it?.ssObjId || it?._raw?.ssObjId || it?._raw?.objNum || "");
  1901. const key = keyOf(item);
  1902. item._ssSelected = false;
  1903. const idx = key ? this.selectedItems.findIndex((it) => keyOf(it) === key) : this.selectedItems.indexOf(item);
  1904. if (idx > -1) this.selectedItems.splice(idx, 1);
  1905. // 反向同步当前列表里同 key 的卡片状态
  1906. if (key) {
  1907. const all = [].concat(this.listConfig?.draftbox || []).concat(this.listConfig?.list || []);
  1908. const cur = all.find((it) => keyOf(it) === key);
  1909. if (cur) cur._ssSelected = false;
  1910. }
  1911. this.updatePickedPanelCount();
  1912. // 功能说明:强制触发 sidebarPanels 更新,避免 count 未刷新 by xu 20260122
  1913. try { this.sidebarPanels = (this.sidebarPanels || []).slice(); } catch (_) {}
  1914. },
  1915. // 功能说明:动态计算 rowNumPer(让分页视觉上在最后一行出现),以 DOM 实测为准;返回明细用于调试 by xu 20260123
  1916. calcAutoRowNumPerDetail() {
  1917. try {
  1918. // 功能说明:Vue3 根节点可能是 Fragment(this.$el 不是 Element),统一从 #app 下查找内容区 by xu 20260123
  1919. const host = (this.$el && this.$el.nodeType === 1 && this.$el.querySelector)
  1920. ? this.$el
  1921. : (document.getElementById && document.getElementById("app")) || document.body;
  1922. const area = host && host.querySelector ? host.querySelector(".item-content-area") : null;
  1923. if (!area) return { err: "no_area" };
  1924. const cs = window.getComputedStyle ? window.getComputedStyle(area) : null;
  1925. // 功能说明:内容区宽度以 item-content-area 为准;若右侧栏与内容区发生覆盖(非并排布局),按重叠宽度扣减 by xu 20260123
  1926. let W = Math.max(0, area.clientWidth || 0);
  1927. let overlap = 0;
  1928. try {
  1929. if (this.showRightSidebar) {
  1930. const sidebar = host && host.querySelector ? host.querySelector(".ss-sidebar") : null;
  1931. if (sidebar && area.getBoundingClientRect && sidebar.getBoundingClientRect) {
  1932. const ar = area.getBoundingClientRect();
  1933. const sr = sidebar.getBoundingClientRect();
  1934. overlap = Math.max(0, Math.min(ar.right, sr.right) - Math.max(ar.left, sr.left));
  1935. if (overlap > 0) W = Math.max(0, W - overlap);
  1936. }
  1937. }
  1938. } catch (_) {
  1939. }
  1940. const H = Math.max(0, area.clientHeight || 0);
  1941. if (!W || !H) {
  1942. // 功能说明:首屏 homeReady=false 时容器 display:none,W/H 为 0;此处回退用 viewport 估算 by xu 20260123
  1943. const vw = Math.max(0, document.documentElement?.clientWidth || window.innerWidth || 0);
  1944. const vhRaw = Math.max(0, document.documentElement?.clientHeight || window.innerHeight || 0);
  1945. // 功能说明:首屏高度按 URL 上的 removeHigh 扣减(弹窗/iframe 会预留顶部/底部区域),否则 rows 会偏大 by xu 20260123
  1946. let removeHigh = 0;
  1947. try {
  1948. const qs = window.location && window.location.search ? window.location.search : "";
  1949. const m = String(qs).match(/(?:\\?|&)removeHigh=([^&]+)/);
  1950. if (m && m[1] != null) {
  1951. const v = parseFloat(decodeURIComponent(m[1]));
  1952. if (!isNaN(v) && v > 0) removeHigh = v;
  1953. }
  1954. } catch (_) {
  1955. }
  1956. const vh = Math.max(0, vhRaw - removeHigh);
  1957. // 功能说明:右侧栏宽度用 rbar 判定(JSP 注入已写入 this.rbar;首页接口返回后会覆盖) by xu 20260123
  1958. const rbarFlag = (this.rbar === true);
  1959. const sidebarW = rbarFlag ? 380 : 0;
  1960. const minW = (Number(this.thnType || 0) === 1) ? 400 : (Number(this.thnType || 0) === 2) ? 320 : 300;
  1961. const gap = 20;
  1962. const padLeft = 20;
  1963. const padRight = 20;
  1964. const padTop = 0;
  1965. const padBottom = 100;
  1966. const pagerH = 32; // 功能说明:分页高度以 .pager-container .pager-content 的 32px 为准(首屏未渲染时用该值预留) by xu 20260123
  1967. let cardH = Number(this.__autoCardH || 0) || Number(this.measureAutoCardHeight?.() || 0);
  1968. if (cardH) this.__autoCardH = cardH;
  1969. if (!vw || !vh || !cardH) return { err: "zero_size", W, H, overlap, vw, vh, cardH, showRightSidebar: !!this.showRightSidebar };
  1970. const Wcontent = Math.max(0, (vw - sidebarW) - padLeft - padRight);
  1971. const cols = Math.max(1, Math.floor((Wcontent + gap) / (minW + gap)));
  1972. const availH = Math.max(0, (vh - 75) - padTop - padBottom - pagerH); // 75=search/预留(与 CSS 对齐) by xu 20260123
  1973. const rows = Math.max(1, Math.floor((availH + gap) / (cardH + gap)));
  1974. const n = Math.max(1, cols * rows);
  1975. return { n, cols, rows, W: 0, H: 0, overlap, gap, padTop, padBottom, padLeft, padRight, minW, pagerH, cardH, vw, vhRaw, vh, removeHigh, sidebarW, rbarFlag, fallback: "viewport" };
  1976. }
  1977. const gap = cs ? (parseFloat(cs.gap) || 0) : 0;
  1978. const padLeft = cs ? (parseFloat(cs.paddingLeft) || 0) : 0;
  1979. const padRight = cs ? (parseFloat(cs.paddingRight) || 0) : 0;
  1980. const padTop = cs ? (parseFloat(cs.paddingTop) || 0) : 0;
  1981. const padBottom = cs ? (parseFloat(cs.paddingBottom) || 0) : 0;
  1982. const minW = cs ? (parseFloat(cs.getPropertyValue("--ss-card-min")) || 300) : 300;
  1983. const Wcontent = Math.max(0, W - padLeft - padRight);
  1984. const cols = Math.max(1, Math.floor((Wcontent + gap) / (minW + gap)));
  1985. const pagerEl = area.querySelector ? (area.querySelector(".pager-bar, .pager-container") || null) : null;
  1986. const pagerH = pagerEl && pagerEl.getBoundingClientRect ? (pagerEl.getBoundingClientRect().height || 0) : 0;
  1987. const cardEl = area.querySelector ? (area.querySelector(".knowledge-item-container") || null) : null;
  1988. let cardH = cardEl && cardEl.getBoundingClientRect ? (cardEl.getBoundingClientRect().height || 0) : 0;
  1989. if (!cardH) {
  1990. // 功能说明:首屏/空列表时通过 probe 实测卡片高度并缓存,避免 rowNumPer 只能等列表接口返回后才可计算 by xu 20260123
  1991. cardH = Number(this.__autoCardH || 0) || Number(this.measureAutoCardHeight?.() || 0);
  1992. if (cardH) this.__autoCardH = cardH;
  1993. }
  1994. if (!cardH) return { err: "no_card_height", W, H, overlap, showRightSidebar: !!this.showRightSidebar };
  1995. const availH = Math.max(0, H - padTop - padBottom - pagerH);
  1996. const rows = Math.max(1, Math.floor((availH + gap) / (cardH + gap)));
  1997. const n = Math.max(1, cols * rows);
  1998. return { n, cols, rows, W, H, overlap, gap, padTop, padBottom, padLeft, padRight, minW, pagerH, cardH, showRightSidebar: !!this.showRightSidebar };
  1999. } catch (_) {
  2000. return { err: "exception" };
  2001. }
  2002. },
  2003. // 功能说明:仅返回 rowNumPer 数值(兼容旧调用点) by xu 20260123
  2004. calcAutoRowNumPer() {
  2005. const d = this.calcAutoRowNumPerDetail?.();
  2006. return d && d.n ? d.n : 0;
  2007. },
  2008. measureAutoCardHeight() { // 功能说明:用 DOM probe 实测 ss-list-card 的稳定高度(不依赖接口数据) by xu 20260123
  2009. try {
  2010. const probe = document.createElement("div");
  2011. const kind = Number(this.thnType || 0) === 1 ? "card-thumbnail" : "card-photo";
  2012. probe.className = "knowledge-item-container " + kind;
  2013. probe.style.position = "fixed";
  2014. probe.style.left = "-99999px";
  2015. probe.style.top = "0";
  2016. probe.style.visibility = "hidden";
  2017. probe.style.pointerEvents = "none";
  2018. probe.style.zIndex = "-1";
  2019. // 让 probe 按最小列宽测量(min-width 对高度几乎无影响,但保持一致) by xu 20260123
  2020. try {
  2021. // 功能说明:同 calcAutoRowNumPerDetail,优先从 #app 下取 item-content-area by xu 20260123
  2022. const host = (this.$el && this.$el.nodeType === 1 && this.$el.querySelector)
  2023. ? this.$el
  2024. : (document.getElementById && document.getElementById("app")) || document.body;
  2025. const area = host && host.querySelector ? host.querySelector(".item-content-area") : null;
  2026. const cs = area && window.getComputedStyle ? window.getComputedStyle(area) : null;
  2027. const minW = cs ? (parseFloat(cs.getPropertyValue("--ss-card-min")) || 300) : 300;
  2028. probe.style.width = String(minW) + "px";
  2029. } catch (_) {
  2030. }
  2031. probe.innerHTML =
  2032. '<div class="body">' +
  2033. ' <div class="box-header"><div>_</div></div>' +
  2034. ' <div class="box-body">' +
  2035. ' <div class="left ss-objlist-thumbPlaceholder"><div class="ss-objlist-thumbIcon">_</div></div>' +
  2036. ' <div class="right"></div>' +
  2037. " </div>" +
  2038. "</div>";
  2039. document.body.appendChild(probe);
  2040. const h = probe.getBoundingClientRect ? (probe.getBoundingClientRect().height || 0) : 0;
  2041. document.body.removeChild(probe);
  2042. return Math.max(0, h);
  2043. } catch (_) {
  2044. return 0;
  2045. }
  2046. },
  2047. // 功能说明:延迟/去抖触发自动 rowNumPer 计算(避免 resize 频繁触发请求) by xu 20260123
  2048. scheduleAutoRowNumPer(reason) {
  2049. if (this.__autoRowNumTimer) clearTimeout(this.__autoRowNumTimer);
  2050. this.__autoRowNumTimer = setTimeout(() => {
  2051. this.__autoRowNumTimer = null;
  2052. this.applyAutoRowNumPer(reason || "");
  2053. }, 150);
  2054. },
  2055. // 功能说明:应用自动 rowNumPer;只记录到 data(下次接口请求时生效),resize 不立即重拉 by xu 20260123
  2056. applyAutoRowNumPer(reason) {
  2057. const d = this.calcAutoRowNumPerDetail?.();
  2058. const next = Number(d?.n || 0);
  2059. if (!next) return;
  2060. const cur = Number(this.autoRowNumPer || 0);
  2061. if (cur === next) return;
  2062. this.autoRowNumPer = next;
  2063. // 功能说明:打印计算明细,便于排查“为什么还是12” by xu 20260123
  2064. try { console.log("[objList][自适应分页] 计算更新", { reason, cur, next, detail: d }); } catch (_) {}
  2065. },
  2066. // 功能:探测当前业务列表卡片类型,用于网格列最小宽度 by xu 20260109
  2067. detectCardGridKind() {
  2068. const all = [].concat(this.listConfig?.draftbox || []).concat(this.listConfig?.list || []);
  2069. if (all.some(it => String(it?.thumbType || '').trim() === 'thumbnail')) return 'thumbnail';
  2070. if (all.some(it => !!it?.thumb || !!it?.thumbType)) return 'photo';
  2071. return 'none';
  2072. },
  2073. // 左侧卡片角标选中(多选)+ 卡片主体单选互斥(exclusive) by xu 20260109
  2074. handleToggleSelect({item, selected, exclusive}) {
  2075. if (!item) return;
  2076. if (!this.hasObjPanel) return; // 功能说明:无 rbarObj 时禁止选中(已选tab也不显示) by xu 20260122
  2077. // 已选分区:中间槽位 meta(可按业务改为后端字段) by xu 20260113
  2078. if (!item.meta) item.meta = String(item.objNum || '');
  2079. // 功能说明:按稳定 key 管理 selectedItems,避免列表刷新后对象引用变化导致取消选中/计数异常 by xu 20260122
  2080. const keyOf = (it) => String(it?.objNum || it?.ssObjId || it?._raw?.ssObjId || it?._raw?.objNum || "");
  2081. const key = keyOf(item);
  2082. const idx = key ? this.selectedItems.findIndex((it) => keyOf(it) === key) : this.selectedItems.indexOf(item);
  2083. if (exclusive && selected && this.cardClickAction === 'single') {
  2084. this.selectedItems.forEach((it) => {
  2085. if (it && it !== item) it._ssSelected = false;
  2086. });
  2087. // 不要重新赋值数组,保留引用(供右侧面板使用) by xu 20260109
  2088. this.selectedItems.splice(0, this.selectedItems.length);
  2089. this.selectedItems.push(item);
  2090. this.updatePickedPanelCount();
  2091. // 功能说明:预订模式下,单选互斥选中后联动加载右侧预订/服务数据 by xu 20260114
  2092. this.loadPobjYclByItem(item);
  2093. // 功能说明:强制触发 sidebarPanels 更新,避免 count 未刷新 by xu 20260122
  2094. try { this.sidebarPanels = (this.sidebarPanels || []).slice(); } catch (_) {}
  2095. return;
  2096. }
  2097. if (selected) {
  2098. if (idx === -1) {
  2099. this.selectedItems.push(item);
  2100. } else if (idx > -1 && this.selectedItems[idx] !== item) {
  2101. // 功能说明:用最新的 item 对象替换旧引用,确保侧边栏操作能反向同步到当前卡片 by xu 20260122
  2102. this.selectedItems.splice(idx, 1, item);
  2103. }
  2104. // 功能说明:预订模式下,多选角标选中也可触发联动(以最近选中项为准) by xu 20260114
  2105. this.loadPobjYclByItem(item);
  2106. } else {
  2107. if (idx > -1) this.selectedItems.splice(idx, 1);
  2108. }
  2109. this.updatePickedPanelCount();
  2110. // 功能说明:强制触发 sidebarPanels 更新,避免 count 未刷新 by xu 20260122
  2111. try { this.sidebarPanels = (this.sidebarPanels || []).slice(); } catch (_) {}
  2112. },
  2113. handlePageChange({pageNo, rowNumPer, rowNum}) {
  2114. // 翻页:调用列表接口刷新(不刷新右侧栏)
  2115. if (this.loadingList) return;
  2116. // 功能说明:rowNumPer<=0 兜底、pageNo 越界钳制,避免把 0 或超界页码发给后端导致空白 by xu 20261128
  2117. const safeSize = Number(rowNumPer) > 0 ? Number(rowNumPer) : (Number(this.ssPaging?.rowNumPer) > 0 ? Number(this.ssPaging.rowNumPer) : 12);
  2118. const safeTotal = Number(rowNum) > 0 ? Number(rowNum) : Number(this.ssPaging?.rowNum || 0);
  2119. const maxPage = Math.max(1, Math.ceil(safeTotal / safeSize));
  2120. let nextPageNo = Number(pageNo) || 1;
  2121. if (nextPageNo < 1) nextPageNo = 1;
  2122. if (nextPageNo > maxPage) nextPageNo = maxPage;
  2123. this.ssPaging.pageNo = nextPageNo;
  2124. this.ssPaging.rowNumPer = safeSize;
  2125. this.ssPaging.rowNum = safeTotal;
  2126. this.userInteracted = true;
  2127. this.loadPobjList({ source: "page", lockRowNumPer: true });
  2128. },
  2129. search() {
  2130. // 搜索:回到第一页,调用列表接口刷新(不刷新右侧栏)
  2131. if (this.loadingList) return;
  2132. this.ssPaging.pageNo = 1;
  2133. this.userInteracted = true;
  2134. this.loadPobjList({ source: "search" });
  2135. }
  2136. },
  2137. mounted() {
  2138. // 功能说明:临时将 vm 暴露到 window,供 searchButtonConfig.opt.callback 调用(后续再改为事件回传方式) by xu 20260123
  2139. try { window.__objListVm = this; } catch (_) {}
  2140. // 功能说明:弹窗保存后只刷新列表数据(走 Ajax),禁止走 form.submit/reload 以免跳到 /service 返回内容导致白屏 by xu 20260202
  2141. try {
  2142. const vm = this;
  2143. window.wdRefresh = function () {
  2144. try {
  2145. if (vm.loadingList) return;
  2146. // 保持当前筛选/页码,仅刷新列表数据
  2147. vm.userInteracted = true;
  2148. vm.loadPobjList({ source: "refresh", lockRowNumPer: true });
  2149. } catch (e) {
  2150. console.error("[objList] wdRefresh failed", e);
  2151. }
  2152. };
  2153. } catch (_) {}
  2154. // 初始化:把 URL/form 上已有的参数合并到 form/ssPaging(支持回显 + ajax)
  2155. const curParams = this.getSearchFormParams();
  2156. this.form = {...this.form, ...curParams};
  2157. // 功能说明:分页参数不再从表单读取/初始化(完全由 ssPaging 驱动,且页面不再输出分页隐藏域) by xu 20260123
  2158. this.searchButtonConfigCheckId = String(this.form?.management || "99");
  2159. // 功能说明:首屏在列表数据未到达前,按 thnType 预设 cardGridKind(决定 --ss-card-min),避免 detectCardGridKind 在空列表时把缩略图场景误判为 none by xu 20260123
  2160. try {
  2161. const t = Number(this.thnType || 0);
  2162. if (t === 1) this.cardGridKind = "thumbnail";
  2163. else if (t === 2) this.cardGridKind = "photo";
  2164. else this.cardGridKind = "none";
  2165. } catch (_) {
  2166. this.cardGridKind = "none";
  2167. }
  2168. // 初始化右侧边栏分区 by xu 20260113
  2169. this.initSidebarPanels();
  2170. // 功能说明:订阅系统编辑模式变化(来自 home 顶部按钮/菜单切换),用于业务页右下角“新增”入口显隐 by xu 20260123
  2171. try {
  2172. const bus = window.parent?.sharedEventBus;
  2173. if (bus?.subscribe) {
  2174. const applySysMode = (payload) => {
  2175. const mode = (payload && typeof payload === "object") ? payload.mode : payload;
  2176. const source = (payload && typeof payload === "object") ? payload.source : "unknown";
  2177. this.isSysEditMode = (mode === "edit");
  2178. this.sysModeSource = String(source || "unknown");
  2179. };
  2180. this.__sysEditSub = bus.subscribe("systemEditModelChange", applySysMode);
  2181. try { applySysMode(bus.getState?.("systemEditModelChange")); } catch (_) {}
  2182. }
  2183. } catch (_) {}
  2184. this.userInteracted = false;
  2185. // 功能说明:首屏在第一个接口调用前,按当前容器尺寸预先计算 rowNumPer,并写入 ssPaging(使首页接口直接返回“刚好铺满”的条数) by xu 20260123
  2186. const startHome = () => {
  2187. // 功能说明:首屏以 JSP 注入的 rbar 作为右侧栏存在与否的唯一依据 by xu 20260123
  2188. try { this.showRightSidebar = (this.rbar === true); } catch (_) {}
  2189. // 功能说明:打印首屏关键输入(thnType/cardGridKind/rbar),排查“有缩略图首屏 rowNumPer 偏大” by xu 20260123
  2190. try { console.log("[objList][自适应分页] 首屏输入", { thnType: this.thnType, cardGridKind: this.cardGridKind, rbar: this.rbar, showRightSidebar: this.showRightSidebar }); } catch (_) {}
  2191. // 功能说明:首屏首次渲染时容器可能尚未有尺寸(W/H=0),用 rAF 重试几帧再发第一个接口,确保 rowNumPer 能在首屏生效 by xu 20260123
  2192. let tries = 0;
  2193. const maxTries = 20;
  2194. const tick = () => {
  2195. let d = null;
  2196. try { d = this.calcAutoRowNumPerDetail?.(); } catch (_) {}
  2197. if (tries === 0 || tries === maxTries - 1) {
  2198. try { console.log("[objList][自适应分页] 首屏计算", { tries, detail: d }); } catch (_) {}
  2199. }
  2200. const n = Number(d?.n || 0);
  2201. if (n > 0) {
  2202. this.autoRowNumPer = n;
  2203. this.ssPaging.rowNumPer = n;
  2204. this.ssPaging.pageNo = 1;
  2205. try { console.log("[objList][自适应分页] 首屏应用 rowNumPer", { rowNumPer: n, ssPaging: this.ssPaging, fallback: d?.fallback }); } catch (_) {}
  2206. this.loadPobjHome();
  2207. return;
  2208. }
  2209. tries += 1;
  2210. if (tries >= maxTries) {
  2211. // 达到重试上限仍无法计算,回退按当前 ssPaging.rowNumPer 发请求 by xu 20260123
  2212. try { console.log("[objList][自适应分页] 首屏计算放弃", { ssPaging: this.ssPaging, autoRowNumPer: this.autoRowNumPer, last: d }); } catch (_) {}
  2213. this.loadPobjHome();
  2214. return;
  2215. }
  2216. requestAnimationFrame(tick);
  2217. };
  2218. requestAnimationFrame(tick);
  2219. };
  2220. if (this.$nextTick) this.$nextTick(() => startHome());
  2221. else startHome();
  2222. // 功能说明:监听窗口变化,触发 rowNumPer 自动计算(resize 只记录,下次接口请求时生效) by xu 20260123
  2223. this.__autoRowNumResizeHandler = () => this.scheduleAutoRowNumPer("resize");
  2224. window.addEventListener && window.addEventListener("resize", this.__autoRowNumResizeHandler);
  2225. }
  2226. ,beforeUnmount() {
  2227. // 功能说明:清理 resize 监听与 timer,避免页面切换残留 by xu 20260123
  2228. // 功能说明:清理 window.__objListVm(避免切页后回调指向旧 vm) by xu 20260123
  2229. try { if (window.__objListVm === this) window.__objListVm = null; } catch (_) {}
  2230. if (this.__autoRowNumResizeHandler && window.removeEventListener) {
  2231. window.removeEventListener("resize", this.__autoRowNumResizeHandler);
  2232. this.__autoRowNumResizeHandler = null;
  2233. }
  2234. if (this.__autoRowNumTimer) {
  2235. clearTimeout(this.__autoRowNumTimer);
  2236. this.__autoRowNumTimer = null;
  2237. }
  2238. // 功能说明:解绑系统编辑态订阅,避免多次进入页面累积回调 by xu 20260123
  2239. try { this.__sysEditSub?.unSubscribe?.(); } catch (_) {}
  2240. this.__sysEditSub = null;
  2241. }
  2242. });
  2243. });
  2244. <%-- 原有的清令牌 --%>
  2245. tokenCleanser("<ss:serv name='clearPageToken'/>", {tokenList: "<%= pageContext.getAttribute(ss.page.PageC.PAGE_tokenList)%>"});
  2246. </script>