objList.jsp 141 KB

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