objList.jsp 134 KB

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