ListItem.vue 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090
  1. <template>
  2. <div class="data-fill-list-box">
  3. <el-collapse v-model="ActiveKey" @change="CollapseChange">
  4. <template v-for="(item,index) in listDatas" :key="item?.pkeyId">
  5. <el-collapse-item :id="`item-${index}-${item?.pkeyId}`" :disabled="item['isBussShow'] === 2"
  6. :name="`item-${index}-${item?.pkeyId}`">
  7. <template #title>
  8. <div class="hc-collapse-item-header">
  9. <div class="text-lg truncate item-title">{{ item.nodeName }}</div>
  10. <div class="hc-extra-text-box">
  11. <HcTooltip v-if="item['isCopeTab'] === 2" keys="wbs_del_table">
  12. <el-button :disabled="item['isBussShow'] === 2" plain type="danger"
  13. @click.stop="delClick(item,index)">删除本表
  14. </el-button>
  15. </HcTooltip>
  16. <!-- <HcTooltip keys="wbs_copy_table">
  17. <el-button :disabled="item['isBussShow'] === 2" :loading="copyClickLoading" plain
  18. type="primary" @click.stop="copyClick(item,index)">
  19. 复制本表
  20. </el-button>
  21. </HcTooltip> -->
  22. <HcTooltip keys="wbs_copy_table">
  23. <el-button
  24. v-if="item['isLinkTable'] === 1"
  25. disabled plain
  26. type="info">
  27. 复制本表
  28. </el-button>
  29. <el-button v-else plain type="primary" @click.stop="copyClick(item,index)" :loading="copyClickLoading" >复制本表
  30. </el-button>
  31. </HcTooltip>
  32. <HcTooltip keys="wbs_hide_table">
  33. <el-button plain type="primary" @click.stop="hideClick(item,index)">
  34. <template v-if="item['isBussShow'] === 1">隐藏本表</template>
  35. <template v-else>显示本表</template>
  36. </el-button>
  37. </HcTooltip>
  38. <HcTooltip v-if="isStatus != 3" keys="wbs_preview_table">
  39. <el-button
  40. v-if="item['isBussShow'] === 2 || item['isTabPdf'] === 1|| item['pdfUrl'] === ''"
  41. disabled plain
  42. type="info">
  43. 预览
  44. </el-button>
  45. <el-button v-else plain type="primary" @click.stop="previewClick(item,index)">预览
  46. </el-button>
  47. </HcTooltip>
  48. <HcTooltip keys="wbs_upload_table">
  49. <el-button :disabled="item['isBussShow'] === 2"
  50. :type="item['tabFileType'] === 2?'success':'primary'"
  51. plain
  52. @click.stop="uploadClick(item,index)">
  53. <template v-if="item['tabFileType'] === 2">已上传</template>
  54. <template v-else>上传</template>
  55. </el-button>
  56. </HcTooltip>
  57. </div>
  58. </div>
  59. </template>
  60. <div :style="`height: calc(100vh - ${drawType ? '555px' : '386px'} - ${menuBarShow ? 50 : 0}px);`"
  61. class="data-fill-list-item-content">
  62. <div class="data-fill-table-form-box">
  63. <div :id="`table-form-${item?.pkeyId}`" class="hc-excel-table-form-view"/>
  64. <div v-if="item?.isTableForm === false" class="hc-no-table-form">
  65. <div class="table-form-no">
  66. <img :src="notableform" alt=""/>
  67. <div class="desc">暂无表单数据</div>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="data-fill-table-tip-box">
  72. <div class="text-orange tip-title">
  73. <HcIcon fill name="error" ui="text-2xl"/>
  74. <span class="ml-1">提示</span>
  75. </div>
  76. <div class="text-gray-400 tip-item">
  77. 1、灰色框代表可通过系统识别计算,公式自动引用,可通过公式计算少量数据,(表头数据及简单),也可只填写白色框数据
  78. </div>
  79. <div class="text-gray-400 tip-item">2、系统支持键盘中,shift +
  80. tab键向上一个填报框切换,tab向下一个填报框切换。Shift + 上 ( ↑ )、下 ( ↓ )、左 ( ← )、右 ( →
  81. )键,切换填报输入框焦点。
  82. </div>
  83. <div class="table-tip-foot">
  84. <div class="tip-left-btn">
  85. <HcTooltip keys="wbs_import_table">
  86. <div class="text-gray-400 dow-text">
  87. <HcIcon name="publish" ui="text-lg"/>
  88. <span class="ml-1">导入列表数据</span>
  89. </div>
  90. </HcTooltip>
  91. <HcTooltip keys="wbs_download_table">
  92. <div class="text-main dow-text">
  93. <HcIcon name="file_download" ui="text-lg"/>
  94. <span class="ml-1">下载导入模板</span>
  95. </div>
  96. </HcTooltip>
  97. </div>
  98. <div class="tip-right-btn">
  99. <HcTooltip keys="wbs_save_table">
  100. <el-button :disabled="item?.isTableForm === false"
  101. :loading="tableFormSaveLoading" hc-btn
  102. type="primary"
  103. @click="tableFormSaveClick(item,index)">
  104. <HcIcon name="save"/>
  105. <span>保存</span>
  106. </el-button>
  107. </HcTooltip>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </el-collapse-item>
  113. </template>
  114. </el-collapse>
  115. </div>
  116. <!--右键菜单-->
  117. <HcContextMenu ref="contextMenuRef" :datas="tableFormMenu" @item-click="handleMenuSelect"/>
  118. <!--上传文件-->
  119. <HcDialog :footer="false" :show="uploadModal" title="上传文件" widths="38rem" @close="uploadModal = false">
  120. <HcUpload :datas="uploadData" :fileList="fileListData" @change='uploadChange'/>
  121. </HcDialog>
  122. <!--插入设计值/频率-->
  123. <HcDialog :show="IDVFModal" saveText="确认插入" title="插入设计值/频率" widths="600px" @close="closeIDVFModal"
  124. @save="IDVFModalSaveClick">
  125. <el-alert :closable="false" title="填写完设计值和频率,系统自动计算实测值" type="warning"/>
  126. <el-form ref="formIDVFRef" :model="formIDVFModel" label-width="auto" size="large">
  127. <div class="form-item-div text-center mb-3">
  128. <el-radio-group v-model="formIDVFModel.type" size="large">
  129. <el-radio :label="1">公路工程</el-radio>
  130. <el-radio :label="2" class="ml-4">水利水电</el-radio>
  131. </el-radio-group>
  132. </div>
  133. <el-form-item label="设计值">
  134. <!-- onkeyup="value = value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" -->
  135. <el-input v-model="formIDVFModel.design" placeholder="如果设计值存在两个,则使用 '/' 连接,例如12/23"/>
  136. </el-form-item>
  137. <el-form-item v-if="formIDVFModel.type === 1" label="频率">
  138. <!-- onkeyup="value = value.replace(/^(0+)|[^\d]+/g,'')" -->
  139. <el-input v-model="formIDVFModel.size"
  140. placeholder="如果设计值使用 '/' 连接,则频率也是用 '/' 连接,例如5/10"/>
  141. </el-form-item>
  142. <el-form-item v-if="formIDVFModel.type === 2" label="容量">
  143. <!-- onkeyup="value = value.replace(/^(0+)|[^\d]+/g,'')" -->
  144. <el-input v-model="formIDVFModel.capacity"
  145. placeholder="如果容量存在两个,则使用 '*',或者 '/' 连接例如2*4,5/7"/>
  146. </el-form-item>
  147. <el-form-item label="合格点数">
  148. <el-input v-model="formIDVFModel.pass"
  149. placeholder="如果设计值使用 '/' 连接,则合格点数也是用 '/' 连接,例如2/5"/>
  150. </el-form-item>
  151. <el-form-item label="偏差范围">
  152. <el-input v-model="formIDVFModel.dev"
  153. placeholder="如果设计值使用 '/' 连接,则偏差范围也是用 '/' 连接,例如±2/±3"/>
  154. </el-form-item>
  155. </el-form>
  156. </HcDialog>
  157. <!--插入特殊字符-->
  158. <HcDialog :show="specialModal" saveText="确认插入" title="插入特殊字符" widths="600px" @close="specialModal = false"
  159. @save="specialNodeClick">
  160. <el-form ref="specialFormRef" :model="specialFormModel" :rules="specialFormRules" class="mb-6" label-width="0px"
  161. size="large">
  162. <el-form-item class="special-form-item" prop="val">
  163. <el-input id="specialId" ref="specialRef" v-model="specialFormModel.val"
  164. clearable placeholder="请选择特殊字符代码" @blur="specialInputBlur"/>
  165. </el-form-item>
  166. </el-form>
  167. <el-row :gutter="20" style="margin: -10px;">
  168. <el-col v-for="item in specialCharacters" :span="3" style="padding: 10px;">
  169. <div class="special-box" @click="specialClick">
  170. <span :title="`字符代码(C):${item !== 'K̅'?item.slice(2,7):'K̅'}`" class="font-EUDC" v-html="item"/>
  171. </div>
  172. </el-col>
  173. </el-row>
  174. </HcDialog>
  175. <!--关联试验数据-->
  176. <HcDialog :footer="false" :show="CTDModal" title="关联试验数据" widths="84%" @close="CTDModal = false">
  177. <div class="adding-form-dialog-box">
  178. <div class="dialog-tree-box">
  179. <el-scrollbar>
  180. <ElTree ref="ElTreeRef"
  181. :autoExpandKeys="CTDTreeAutoExpandKeys"
  182. :default-expanded-keys="defaultExpandedCids"
  183. :indent="0"
  184. :load="ElTreeLoadNode"
  185. :props="ElTreeProps"
  186. accordion
  187. class="hc-tree-node tree-line"
  188. highlight-current
  189. lazy
  190. node-key="primaryKeyId"
  191. @node-click="CTDElTreeClick"
  192. >
  193. </ElTree>
  194. </el-scrollbar>
  195. </div>
  196. <div class="dialog-table-box">
  197. <div class="dialog-search">
  198. <div class="w-64 ml-2">
  199. <HcDatePicker :dates="CTDbetweenTime" clearable @change="CTDbetweenTimeUpdate"/>
  200. </div>
  201. <div class="ml-2">
  202. <el-button type="primary" @click="CTDsearchClick">
  203. <HcIcon name="search-2"/>
  204. <span>搜索</span>
  205. </el-button>
  206. </div>
  207. </div>
  208. <div class="dialog-table">
  209. <HcTable :column="CTDdialogTableColumn" :datas="CTDdialogTableData1"
  210. :loading="CTDdialogTableLoading">
  211. <template #reportNo="{row}">
  212. <span class="text-link" @click="CTDtableRowName(row)">{{ row?.reportNo }}</span>
  213. </template>
  214. </HcTable>
  215. </div>
  216. <div class="dialog-pages">
  217. <HcPages :pages="CTDsearchFormPage" @change="CTDsearchFormPageChange"/>
  218. </div>
  219. </div>
  220. </div>
  221. </HcDialog>
  222. <!-- 选择要插入的数据 -->
  223. <HcDialog :show="insertDataShow" saveText="保存" title="选择需要插入的数据" widths="84%" @close="cancelinsertData"
  224. @save="submitinsertData">
  225. <div>
  226. <div class="flex-1" style="padding-left:20px">
  227. <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" :round="false" size="default"
  228. @change="tabTypeChange"/>
  229. <el-select v-model="testReportId" :loading="insertDataSelectoading" :placeholder="placeholderType"
  230. class="ml-2 w-80"
  231. clearable @change="testReportIdchange">
  232. <el-option v-for="item in testReportData" :key="item.pKeyId" :label="item['nodeName']"
  233. :value="item['pKeyId']"/>
  234. </el-select>
  235. </div>
  236. <div class="dialog-table-box">
  237. <!-- <div class="dialog-table">
  238. <HcTable :column="insertDataTableColumn" :datas="insertDataTable" :loading="insertDataTableLoading">
  239. <template #tempLow="{row}">{{row['tempLow']}} ~ {{row['tempHigh']}}</template>
  240. <template #action="{row}">
  241. <el-checkbox size="large" @change="insertDataTableCheck(row)"/>
  242. </template>
  243. </HcTable>
  244. </div> -->
  245. <!-- <div class="dialog-pages">
  246. <HcPages :pages="insertDataPage" @change="insertDataPageChange"/>
  247. </div> -->
  248. <div class="copy-node-many-table">
  249. <el-scrollbar v-loading="insertDataTableLoading">
  250. <el-table :data="insertDataTable" border stripe @selection-change="insertDataTableCheck">
  251. <el-table-column type="selection" width="55"/>
  252. <!-- <el-table-column prop="key_12__3_1" label="数据名称"/> -->
  253. <el-table-column label="字段名称" prop="key"/>
  254. <el-table-column label="数值" prop="value"/>
  255. <!-- <el-table-column prop="action" label="操作" width="120" align="center">
  256. <template #default="{row}">
  257. <el-checkbox size="large" @change="insertDataTableCheck(row)"/>
  258. </template> -->
  259. <!-- </el-table-column> -->
  260. </el-table>
  261. </el-scrollbar>
  262. </div>
  263. </div>
  264. </div>
  265. </HcDialog>
  266. <!-- 复制本表 -->
  267. <HcDialog :show="CopyModal" saveText="确认复制" title="复制本表" widths="1200px" @close="CopyModal = false"
  268. @save="CopyModal = false">
  269. <el-alert :closable="false" title="复跨节点复制: 把当前表格已形成的数据复制到其他工程部位的相同表格里面"
  270. type="warning"/>
  271. <el-alert :closable="false" title="本节点复制:在当前节点内复制本表及数据" type="warning"/>
  272. <div class="radio-group-box">
  273. <el-radio-group v-model="CopyModalType">
  274. <el-radio label="1">跨节点复制</el-radio>
  275. <el-radio class="ml-4" label="2">本节点复制</el-radio>
  276. </el-radio-group>
  277. </div>
  278. <div v-if="CopyModalType=== '1'" class="copy-node-many-box">
  279. <div class="copy-node-many-tree">
  280. <el-scrollbar>
  281. <WbsTree
  282. :contractId="contractId"
  283. :projectId="projectId"
  284. @nodeLoading="ElTreeNodeLoading"
  285. @nodeTap="wbsElTreeClick"
  286. />
  287. </el-scrollbar>
  288. </div>
  289. <div class="copy-node-many-table">
  290. <el-scrollbar v-loading="ListItemLoading">
  291. <el-table :data="copyModalTable" border stripe>
  292. <el-table-column label="表格名称" prop="fullName"/>
  293. <el-table-column align="center" label="操作" prop="action" width="120">
  294. <template #default="{row}">
  295. <el-checkbox v-model="row.isCheck" size="large" @change="copyModalTableCheck(row)"/>
  296. </template>
  297. </el-table-column>
  298. </el-table>
  299. </el-scrollbar>
  300. </div>
  301. </div>
  302. </HcDialog>
  303. <!--关联试验文件-->
  304. <HcDialog :show="fileModal" saveText="保存" title="关联试验文件" widths="84%" @close="fileModal = false"
  305. @save="savefileModal">
  306. <div class="radio-box">
  307. <el-radio-group v-model="fileModalradio" @change="radioChange">
  308. <el-radio :label="1">试验检测</el-radio>
  309. <el-radio :label="2">第三方检测</el-radio>
  310. <el-radio :label="3">外委检测</el-radio>
  311. </el-radio-group>
  312. </div>
  313. <div class="adding-form-dialog-box">
  314. <div class="dialog-tree-box">
  315. <el-scrollbar>
  316. <!-- 试验检测树 -->
  317. <ElTree v-if="fileModalradio==1"
  318. :indent="0"
  319. :load="ElTreeLoadNode"
  320. :props="ElTreeProps"
  321. accordion
  322. class="hc-tree-node tree-line"
  323. highlight-current
  324. lazy
  325. node-key="primaryKeyId"
  326. @node-click="fileModalElTreeClick"
  327. >
  328. </ElTree>
  329. <!-- 第三方树 -->
  330. <ElTree
  331. v-else
  332. ref="ElTreeRef2" :data="thirdtreeDatas" :indent="0" :props="thirdElTreeProps"
  333. accordion class="hc-tree-node" highlight-current
  334. node-key="id" @node-click="thirdtreeDatasElTreeClick">
  335. </ElTree>
  336. </el-scrollbar>
  337. </div>
  338. <div class="dialog-table-box">
  339. <div class="dialog-search">
  340. <div class="w-64 ml-2">
  341. <HcDatePicker :dates="filebetweenTime" clearable @change="filebetweenTimeUpdate"/>
  342. </div>
  343. <div class="ml-2">
  344. <el-button type="primary" @click="filesearchClick">
  345. <HcIcon name="search-2"/>
  346. <span>搜索</span>
  347. </el-button>
  348. </div>
  349. </div>
  350. <div class="dialog-table">
  351. <HcTable v-if="fileModalradio==1" ref="dialogTableRef1" :column="filedialogTableColumn"
  352. :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
  353. @selection-change="filedialogTableSelection1">
  354. <template #reportNo="{row}">
  355. <span :class="[row?.isSelectedStatus==1?'text-green':'']">{{ row?.reportNo }}</span>
  356. </template>
  357. </HcTable>
  358. <HcTable v-if="fileModalradio==2" ref="dialogTableRef2" :column="filedialogTableColumn1"
  359. :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
  360. @selection-change="filedialogTableSelection">
  361. <template #reportNo="{row}">
  362. <span :class="[row?.isSelectedStatus===1?'text-green':'']">{{ row?.reportNo }}</span>
  363. </template>
  364. </HcTable>
  365. <HcTable v-if="fileModalradio==3" ref="dialogTableRef" :column="filedialogTableColumn1"
  366. :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
  367. @selection-change="filedialogTableSelection">
  368. <template #reportNo="{row}">
  369. <span :class="[row?.isSelectedStatus===1?'text-green':'']">{{ row?.reportNo }}</span>
  370. </template>
  371. </HcTable>
  372. </div>
  373. <div class="dialog-pages">
  374. <HcPages :pages="filesearchFormPage" @change="filesearchFormPageChange"/>
  375. </div>
  376. </div>
  377. </div>
  378. </HcDialog>
  379. <!-- 公式参数配置 -->
  380. <HcDialog :show="formulaModal" saveText="保存" title="公式参数配置" widths="84%" @close="formulaModal = false"
  381. @save="PanelSaveClick">
  382. <div v-if="componentDetail['type']==='radio'">
  383. <el-form ref="formIDVFRef" :model="formulaModalinfo" label-width="auto" size="large">
  384. <el-form-item :label="componentDetail['info']['label']">
  385. <!-- onkeyup="value = value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" -->
  386. <el-radio-group v-model="formulaModalinfo.type" size="large">
  387. <el-radio :label="componentDetail['info']['value'][0]['value']">
  388. {{ componentDetail['info']['value'][0]['label'] }}
  389. </el-radio>
  390. <el-radio :label="componentDetail['info']['value'][1]['value']" class="ml-4">
  391. {{ componentDetail['info']['value'][1]['label'] }}
  392. </el-radio>
  393. </el-radio-group>
  394. </el-form-item>
  395. </el-form>
  396. </div>
  397. </HcDialog>
  398. </template>
  399. <script setup>
  400. import {ref, watch, nextTick} from "vue";
  401. import {getStoreData, setStoreData} from '~src/utils/storage'
  402. import notableform from '~src/assets/view/notableform.svg';
  403. import HTableForm from "~src/plugins/HTableForm"
  404. import WbsTree from "../components/WbsTree.vue"
  405. import wbsApi from "~api/data-fill/wbs"
  406. import dataApi from "~api/tentative/detect/test";
  407. import thirdApi from "~api/tentative/detect/third";
  408. import {getTreeAll} from "~api/tentative/detect"
  409. import HcUpload from "./HcUpload.vue"
  410. import {utilsText, isType, formValidate, deepClone, getObjValue} from "vue-utils-plus"
  411. import {useAppStore} from "~src/store";
  412. import samplingApi from "~api/tentative/material/sampling"
  413. //初始
  414. const props = defineProps({
  415. datas: {
  416. type: Array,
  417. default: () => ([])
  418. },
  419. classify: {
  420. type: [String, Number],
  421. default: ''
  422. },
  423. status: {
  424. type: [String, Number],
  425. default: ''
  426. },
  427. primaryKeyId: {
  428. type: [String, Number],
  429. default: ''
  430. },
  431. contractId: {
  432. type: [String, Number],
  433. default: ''
  434. },
  435. projectInfo: {
  436. type: Object,
  437. default: () => ({})
  438. },
  439. authBtnTabKey: {
  440. type: [String, Number],
  441. default: ''
  442. },
  443. drawType: {
  444. type: Boolean,
  445. default: false
  446. },
  447. wbsTempId: {
  448. type: [String, Number],
  449. default: ''
  450. },
  451. tenantId: {
  452. type: [String, Number],
  453. default: ''
  454. },
  455. wbsType: {
  456. type: [String, Number],
  457. default: ''
  458. },
  459. })
  460. const {isString, getObjNullValue, getArrValue} = isType()
  461. const {setPosInsert, setPosRange} = utilsText()
  462. const listDatas = ref(props.datas)
  463. const classify = ref(props.classify)
  464. const isStatus = ref(props.status)
  465. const isPrimaryKeyId = ref(props.primaryKeyId)
  466. const contractId = ref(props.contractId)
  467. const projectInfo = ref(props.projectInfo)
  468. const useAppState = useAppStore()
  469. const authBtnTabKey = ref(props.authBtnTabKey)
  470. const drawType = ref(props.drawType)
  471. const wbsTempId = ref(props.wbsTempId);
  472. const tenantId = ref(props.tenantId);
  473. const wbsType = ref(props.wbsType);
  474. const menuBarShow = ref(useAppState.menuBarShow)
  475. //全局变量
  476. const projectId = ref(useAppState.getProjectId);
  477. const componentDetail = ref({
  478. type: 'radio',
  479. info: {
  480. label: '是否引用公式数据',
  481. value: [
  482. {label: '是', value: 1},
  483. {label: '否', value: 0},
  484. ]
  485. }
  486. })
  487. //监听
  488. watch(() => [
  489. props.datas,
  490. props.classify,
  491. props.primaryKeyId,
  492. props.contractId,
  493. props.projectInfo,
  494. useAppState.menuBarShow,
  495. ], ([datas, classifyVal, primaryKeyId, cid, pInfo, menuBar]) => {
  496. listDatas.value = datas
  497. classify.value = classifyVal
  498. isPrimaryKeyId.value = primaryKeyId
  499. contractId.value = cid
  500. projectInfo.value = pInfo
  501. menuBarShow.value = menuBar
  502. setFormDataNum(datas)
  503. })
  504. //监听
  505. // watch(() => [
  506. // props.status
  507. // ], ([val]) => {
  508. // //1 未填报,2待上报,3已上报
  509. // isStatus.value = val
  510. // })
  511. //监听
  512. watch(() => [
  513. props.autoExpandKeys,
  514. props.projectId,
  515. props.contractId,
  516. props.wbsTempId,
  517. props.tenantId,
  518. props.wbsType,
  519. props.status
  520. ], ([expandKeys, UserProjectId, UserContractId, UserWbsTempId, UserTenantId, UserIdPrefix, wbs_type, val]) => {
  521. projectId.value = UserProjectId
  522. contractId.value = UserContractId
  523. wbsTempId.value = UserWbsTempId
  524. tenantId.value = UserTenantId
  525. wbsType.value = wbs_type
  526. isStatus.value = val
  527. })
  528. //渲染完成
  529. nextTick(() => {
  530. setFormDataNum(props.datas)
  531. })
  532. //获取表单初始数据
  533. const getFormDataInit = (item, pkeyId) => {
  534. return {
  535. projectId: item?.projectId,
  536. contractId: item?.contractId,
  537. classify: classify.value,
  538. pkeyId: pkeyId ? pkeyId + '' : '',
  539. nodeId: isPrimaryKeyId.value
  540. }
  541. }
  542. //设置表单对象的数量
  543. const formData = ref([])
  544. const setFormDataNum = (datas) => {
  545. ActiveKey.value = []
  546. let newArr = [];
  547. for (let i = 0; i < datas.length; i++) {
  548. newArr.push({
  549. ...getFormDataInit(datas[i], datas[i].pkeyId),
  550. isCollapseLoad: false,
  551. })
  552. }
  553. formData.value = newArr
  554. setTableFormMenu(projectInfo.value)
  555. }
  556. //展开事件
  557. const ActiveKey = ref([])
  558. const formKeyIds = ref('')
  559. const formparentId = ref('')
  560. const CollapseChange = async (name) => {
  561. ActiveKey.value = name
  562. let names = []
  563. if (name.length > 0) {
  564. names = name[0] ? name[name.length - 1].split('-') : name[0]
  565. }
  566. if (names.length > 0) {
  567. getOffsetTop(name);
  568. const index = names[1]
  569. const item = listDatas.value[index]
  570. formKeyIds.value = item.pkeyId ? item.pkeyId + '' : ''
  571. formparentId.value = item.parentId ? item.parentId + '' : ''
  572. if (!item.isTableFormRender) {
  573. //获取已填写的数据
  574. await getBussDataInfo(item, item.pkeyId, index)
  575. //按键key列表
  576. const keys = await getHtmlBussColsApi(item.pkeyId)
  577. //渲染表单
  578. await getExcelHtml(item, index, keys)
  579. }
  580. } else {
  581. getOffsetTop()
  582. formKeyIds.value = ''
  583. }
  584. }
  585. //获取按键切换输入框的key列表
  586. const getHtmlBussColsApi = async (pkeyId) => {
  587. const pkeyIds = pkeyId ? pkeyId + '' : ''
  588. if (pkeyIds) {
  589. const {error, code, data} = await wbsApi.getHtmlBussCols({pkeyId: pkeyIds}, false)
  590. if (!error && code === 200) {
  591. let keys = getArrValue(data);
  592. for (let i = 0; i < keys.length; i++) {
  593. if (keys[i].length <= 0) {
  594. keys.splice(i, 1)
  595. }
  596. }
  597. return keys;
  598. } else {
  599. return [];
  600. }
  601. }
  602. }
  603. //获取模板标签数据
  604. const formRegExpJson = ref({})
  605. const getExcelHtml = async (item, index, keys) => {
  606. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  607. if (pkeyIds) {
  608. const {error, code, data} = await wbsApi.getExcelHtml({pkeyId: pkeyIds}, false)
  609. const resData = isString(data) ? data || '' : ''
  610. if (!error && code === 200 && resData) {
  611. item.isTableForm = true
  612. //渲染表单
  613. HTableForm.createForm({
  614. template: resData,
  615. tableForm: formData.value[index],
  616. keys: keys,
  617. appId: `#table-form-${pkeyIds}`,
  618. onRight: (event, KeyName) => {
  619. onRightClick(event, KeyName, index)
  620. },
  621. //表单正则效验
  622. onBlur: (event, key, reg, val, msg, leng) => {
  623. setTableFormBlurReg(pkeyIds, event, key, reg, val, msg, item, index, leng)
  624. }
  625. })
  626. item.isTableFormRender = true
  627. item.isRenderTableForm = true
  628. await nextTick(() => {
  629. HTableForm.setByClassKeyup(keys)
  630. })
  631. } else {
  632. item.isTableForm = false
  633. item.isRenderTableForm = true
  634. window?.$message?.warning('暂无表单')
  635. }
  636. } else {
  637. item.isTableForm = false
  638. item.isRenderTableForm = false
  639. window?.$message?.warning('pkeyId为空')
  640. }
  641. }
  642. //正则效验
  643. const setTableFormBlurReg = (pkeyId, event, key, reg, val, msg, item, index, leng) => {
  644. const dom = document.getElementById(key)?.parentElement ?? ''
  645. if (dom) {
  646. if (val && reg) {
  647. let regx = new RegExp(reg);
  648. let state = regx.test(val);
  649. if (state) {
  650. delete formRegExpJson.value[pkeyId]
  651. dom.style = ''
  652. } else {
  653. formRegExpJson.value[pkeyId] = {
  654. key,
  655. reg,
  656. val,
  657. msg,
  658. state,
  659. nodeName: item.nodeName,
  660. itemId: `item-${index}-${item?.pkeyId}`
  661. }
  662. dom.style = '--el-input-border-color: #fe0000; box-shadow: 0 0 0 2px #fe0000 inset;'
  663. window?.$message?.warning(msg)
  664. }
  665. } else {
  666. delete formRegExpJson.value[pkeyId]
  667. dom.style = ''
  668. }
  669. /*let efficacyRegState = true, efficacyLengState = true;
  670. //正则效验
  671. if (val && reg) {
  672. let regx = new RegExp(reg);
  673. let state = regx.test(val);
  674. console.log('reg:', reg)
  675. console.log('val:', val)
  676. console.log('state:', state)
  677. if (!state) {
  678. efficacyRegState = true
  679. } else {
  680. efficacyRegState = false
  681. window?.$message?.warning(msg)
  682. }
  683. } else {
  684. efficacyRegState = true
  685. }
  686. //校验字符长度
  687. if (val && leng) {
  688. const num = val.toString().length;
  689. if (num > leng) {
  690. efficacyLengState = false
  691. window?.$message?.warning('长度不能超过' + leng)
  692. } else {
  693. efficacyLengState = true
  694. }
  695. } else {
  696. efficacyLengState = true
  697. }
  698. //处理效验结果
  699. if (efficacyRegState && efficacyLengState) {
  700. delete formRegExpJson.value[pkeyId]
  701. dom.style = ''
  702. } else {
  703. formRegExpJson.value[pkeyId] = {key, reg, val, msg, leng, state: efficacyRegState, lengState: efficacyLengState, nodeName: item.nodeName, itemId: `item-${index}-${item?.pkeyId}`}
  704. dom.style = '--el-input-border-color: #fe0000; box-shadow: 0 0 0 2px #fe0000 inset;'
  705. }*/
  706. }
  707. }
  708. //获取已填写的数据
  709. const getBussDataInfo = async (item, pkeyId, index) => {
  710. const pkeyIds = pkeyId ? pkeyId + '' : ''
  711. if (pkeyIds) {
  712. const {error, code, data} = await wbsApi.getBussDataInfo({
  713. pkeyId: pkeyIds
  714. }, false)
  715. const resData = getObjNullValue(data)
  716. if (!error && code === 200 && resData) {
  717. HTableForm.setPickerKey(resData)
  718. const InitObj = getFormDataInit(item, pkeyId) //有数据,关联数据
  719. formData.value[index] = {...resData, ...InitObj, isCollapseLoad: true}
  720. } else {
  721. formData.value[index] = {...getFormDataInit(item, pkeyId), isCollapseLoad: true}
  722. }
  723. } else {
  724. window?.$message?.warning('pkeyId为空')
  725. }
  726. }
  727. //单个保存
  728. const tableFormSaveLoading = ref(false)
  729. const tableFormSaveClick = async (item, index) => {
  730. if (isStatus.value !== '3') {
  731. const res = await saveExcelBussData(item, index)
  732. if (res) {
  733. await getBussPdfInfo(item)
  734. renewData()
  735. }
  736. } else {
  737. window?.$message?.warning('已上报的资料,不允许保存。')
  738. }
  739. }
  740. //保存表单数据
  741. const saveExcelBussData = async (item, index, showTip = true) => {
  742. const isRegExp = !!getObjNullValue(formRegExpJson.value)
  743. if (!isRegExp) {
  744. tableFormSaveLoading.value = true
  745. const InitObj = getFormDataInit(item, item.pkeyId)
  746. const {error, code} = await wbsApi.saveExcelBussData({
  747. ...formData.value[index],
  748. ...InitObj
  749. })
  750. //处理数据
  751. tableFormSaveLoading.value = false
  752. if (!error && code === 200) {
  753. if (showTip) window?.$message?.success('保存成功')
  754. return true
  755. } else {
  756. return false
  757. }
  758. } else {
  759. window?.$message?.warning('请先修改完红色输入框的数据')
  760. return false
  761. }
  762. }
  763. //预览PDF
  764. const getBussPdfInfo = async (item, showTip = true) => {
  765. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  766. if (pkeyIds) {
  767. const {error, code, data} = await wbsApi.getBussPdfInfo({
  768. pkeyId: pkeyIds
  769. }, false)
  770. if (!error && code === 200) {
  771. if (data) {
  772. window.open(data, '_blank')
  773. } else if (showTip) {
  774. window?.$message?.warning('PDF错误')
  775. }
  776. } else {
  777. if (showTip) {
  778. window?.$message?.warning(data.msg || '获取PDF失败')
  779. }
  780. }
  781. } else {
  782. window?.$message?.warning('pkeyId为空')
  783. }
  784. }
  785. //删除本表
  786. const delClick = async (item) => {
  787. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  788. if (pkeyIds) {
  789. if (isStatus.value !== '3') {
  790. const {error, code} = await wbsApi.removeBussTabInfo({
  791. pkeyid: pkeyIds,
  792. classify: classify.value,
  793. })
  794. if (!error && code === 200) {
  795. window?.$message?.success('操作成功')
  796. renewData()
  797. }
  798. } else {
  799. window?.$message?.warning('已上报的资料,不允许删除')
  800. }
  801. } else {
  802. window?.$message?.warning('pkeyId为空')
  803. }
  804. }
  805. //复制本表弹窗
  806. const CopyModal = ref(false);
  807. const CopyModalType = ref('1');
  808. const treeLoading = ref(false);
  809. const copyModalTable = ref([])
  810. const insertDataShow = ref(false);
  811. //类型tab数据和相关处理
  812. const tabTypeKey = ref('2')
  813. const tabTypeTab = ref([
  814. {key: '1', name: '试验记录表'},
  815. {key: '2', name: '试验报告单'},
  816. ]);
  817. let placeholderType = ref('试验报告单')
  818. const tabTypeChange = ({key}) => {
  819. tabTypeKey.value = key
  820. if (tabTypeKey.value === '1') {
  821. placeholderType = '试验记录表'
  822. } else {
  823. placeholderType = '试验报告单'
  824. }
  825. getSearchNodeTables()
  826. }
  827. const insertDataTableLoading = ref(false)
  828. const insertDataTableColumn = ref(
  829. [{key: 'key_12__3_1', name: '数据名称'}],
  830. )
  831. const insertDataTable = ref([])
  832. const multipleSelection = ref([])
  833. const insertDataTableCheck = (val) => {
  834. multipleSelection.value = val
  835. }
  836. //分页
  837. const insertDataPage = ref({current: 1, size: 20, total: 0})
  838. const insertDataPageChange = ({current, size}) => {
  839. insertDataPage.value.current = current
  840. insertDataPage.value.size = size
  841. // getDialogTableData()
  842. }
  843. const testReportId = ref('');
  844. const testReportData = ref([])
  845. let checPkd = ref('')
  846. const testReportIdchange = (key) => {
  847. testReportData.value.forEach((item) => {
  848. if (item.id = key) {
  849. checPkd.value = item.pKeyId
  850. }
  851. })
  852. getBussddataInfotrialData()
  853. }
  854. //树相关变量
  855. // const primaryKeyId = ref('')
  856. const nodeItemInfo = ref({})
  857. const nodeDataInfo = ref({})
  858. //树加载完成
  859. const ElTreeNodeLoading = () => {
  860. treeLoading.value = false
  861. }
  862. //获取数据列表
  863. const ListItemLoading = ref(false);
  864. const checked1 = ref(true)
  865. const searchNodeAllTable = async () => {
  866. copyModalTable.value = []
  867. const info = nodeDataInfo.value;
  868. ListItemLoading.value = true
  869. const {error, code, data} = await wbsApi.searchNodeAllTable({
  870. projectId: projectId.value,
  871. contractId: contractId.value,
  872. primaryKeyId: info['primaryKeyId'],
  873. type: authBtnTabKey.value
  874. })
  875. //处理数据
  876. ListItemLoading.value = false
  877. if (!error && code === 200) {
  878. copyModalTable.value = getArrValue(data);
  879. copyModalTable.value.forEach((item) => {
  880. item.isCheck = false
  881. })
  882. } else {
  883. copyModalTable.value = []
  884. }
  885. }
  886. const getTableDataAll = () => {
  887. searchNodeAllTable()
  888. }
  889. //树被点击
  890. const wbsElTreeClick = ({node, data, keys}) => {
  891. nodeItemInfo.value = node
  892. nodeDataInfo.value = data
  893. getTableDataAll();
  894. }
  895. const copyClickLoading = ref(false)
  896. //复制本表
  897. const copyClick = async (item, index) => {
  898. // CopyModal.value=true;
  899. // const copyModalTable=ref([])
  900. if (item.pkeyId) {
  901. if (isStatus.value !== '3') {
  902. copyClickLoading.value = true
  903. if (!item.isRenderTableForm) {
  904. await copeBussTab(item.pkeyId + '')
  905. } else if (!item.isTableForm) {
  906. window?.$message?.warning('暂无表单数据')
  907. } else if (item.isRenderTableForm) {
  908. const res = await saveExcelBussData(item, index, false)
  909. if (res) {
  910. await copeBussTab(item.pkeyId + '')
  911. } else {
  912. window?.$message?.warning('复制本表操作失败')
  913. }
  914. } else {
  915. window?.$message?.warning(`数据异常了, isRenderTableForm: ${item.isRenderTableForm}, isTableForm: ${item.isTableForm}, pkeyIds:${item.pkeyId}`)
  916. }
  917. } else {
  918. window?.$message?.warning('已上报的资料,不允许复制')
  919. }
  920. } else {
  921. window?.$message?.warning('pkeyId为空')
  922. }
  923. }
  924. //勾选复制本表
  925. const copyModalTableCheck = async (item) => {
  926. console.log('复制本表', item);
  927. }
  928. const copeBussTab = async (pkeyIds) => {
  929. const {error, code} = await wbsApi.copeBussTab({
  930. pkeyId: pkeyIds
  931. })
  932. if (!error && code === 200) {
  933. window?.$message?.success('操作成功')
  934. renewData()
  935. }
  936. }
  937. //隐藏本表
  938. const hideClick = async (item) => {
  939. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  940. if (pkeyIds) {
  941. if (isStatus.value !== '3') {
  942. const isBussShow = item['isBussShow'] === 2 ? 1 : 2 //状态(1显示 2隐藏)
  943. const {error, code} = await wbsApi.showBussTab({
  944. pkeyId: pkeyIds,
  945. status: isBussShow
  946. })
  947. if (!error && code === 200) {
  948. window?.$message?.success('操作成功')
  949. renewData()
  950. }
  951. } else {
  952. window?.$message?.warning('已上报的资料,不允许隐藏')
  953. }
  954. } else {
  955. window?.$message?.warning('pkeyId为空')
  956. }
  957. }
  958. //预览
  959. const previewClick = async (item, index) => {
  960. await getBussPdfInfo(item)
  961. }
  962. //上传变量
  963. const uploadModal = ref(false)
  964. const fileListData = ref([]);
  965. const uploadData = ref({})
  966. //上传被点击
  967. const uploadClick = (item, index) => {
  968. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  969. const keyName = `item-${index}-${pkeyIds}`
  970. if (pkeyIds) {
  971. if (isStatus.value !== '3' && item.isTableForm) {
  972. uploadModal.value = true
  973. uploadData.value = getFormDataInit(item, pkeyIds)
  974. //获取文件列表
  975. getBussFileList(pkeyIds)
  976. } else if (!item.isRenderTableForm) {
  977. CollapseChange([keyName])
  978. window?.$message?.warning('请再次点击上传')
  979. } else if (!item.isTableForm) {
  980. window?.$message?.warning('暂无表单数据')
  981. } else {
  982. window?.$message?.warning('已上报的资料,不允许上传')
  983. }
  984. } else {
  985. window?.$message?.warning('pkeyId为空')
  986. }
  987. }
  988. //获取文件列表
  989. const getBussFileList = async (pkeyId) => {
  990. const {error, code, data} = await wbsApi.getBussFileList({
  991. pkeyid: pkeyId
  992. })
  993. if (!error && code === 200) {
  994. fileListData.value = getArrValue(data)
  995. } else {
  996. fileListData.value = []
  997. }
  998. }
  999. //上传文件
  1000. const uploadChange = async ({type}) => {
  1001. if (type === 'success') {
  1002. uploadModal.value = false
  1003. renewData()
  1004. } else if (type === 'del') {
  1005. renewData()
  1006. }
  1007. }
  1008. //相关变量
  1009. const tableFormItemNode = ref({})
  1010. //菜单数据
  1011. const tableFormMenu = ref([])
  1012. //设置菜单权限数据
  1013. const setTableFormMenu = (info) => {
  1014. const infos = getObjValue(info)
  1015. const isOpen = infos['isOpenRandomNumber'] ?? 0
  1016. let newArr = []
  1017. if (isOpen === 1) {
  1018. newArr.push({label: '插入设计值/频率', key: "IDVF"})
  1019. }
  1020. //newArr.push({label: '插入设计值/频率', key: "IDVF"})
  1021. newArr.push({label: '插入特殊字符', key: "special"})
  1022. newArr.push({label: '关联试验数据', key: "CTD"}),
  1023. newArr.push({label: '关联试验文件', key: "file"}),
  1024. newArr.push({label: '公式参数', key: "formula"})
  1025. tableFormMenu.value = newArr
  1026. }
  1027. //鼠标右键事件
  1028. const contextMenuRef = ref(null)
  1029. const onRightClick = (event, KeyName, index) => {
  1030. console.log(KeyName, 'KeyName');
  1031. //取光标位置
  1032. const specialDom = document.getElementById(KeyName + "")
  1033. const startPos = specialDom?.selectionStart || 0
  1034. const endPos = specialDom?.selectionEnd || 0
  1035. //存储临时信息
  1036. tableFormItemNode.value = {KeyName, index, startPos, endPos, pkeyId: formKeyIds.value}
  1037. contextMenuRef.value?.showMenu(event) //展开菜单
  1038. }
  1039. const formulaModal = ref(false)
  1040. const formulaModalinfo = ref({
  1041. type: ''
  1042. })
  1043. //鼠标右键菜单被点击
  1044. const handleMenuSelect = ({key}) => {
  1045. if (key === 'IDVF') {
  1046. IDVFModal.value = true
  1047. } else if (key === 'special') {
  1048. specialModalShow()
  1049. } else if (key === 'CTD') {
  1050. CTDModal.value = true
  1051. CTDbetweenTime.value = []
  1052. CTDdialogTableData1.value = []
  1053. } else if (key === 'file') {
  1054. fileModal.value = true;
  1055. fileModalradio.value = 1
  1056. filedialogTableData.value = []
  1057. } else if (key === 'formula') {
  1058. formulaModal.value = true
  1059. console.log(tableFormItemNode.value,'tableFormItemNode.value');
  1060. getPanel()
  1061. }
  1062. }
  1063. //获取公式面板数据
  1064. const getPanel = async () => {
  1065. const pkeyIds = formKeyIds.value
  1066. if (pkeyIds) {
  1067. const {error, code, data} = await wbsApi.queryPanel({
  1068. key: tableFormItemNode.value['KeyName'],
  1069. contractId: contractId.value,
  1070. parentId: formparentId.value,
  1071. pkeyId: pkeyIds,
  1072. }, false)
  1073. if (!error && code === 200) {
  1074. componentDetail.value = getObjNullValue(data)
  1075. } else {
  1076. componentDetail.value = []
  1077. }
  1078. } else {
  1079. window?.$message?.warning('pkeyId为空')
  1080. }
  1081. }
  1082. const PanelSaveClick = async (item, index) => {
  1083. const {res, error, code} = await wbsApi.savePanel({
  1084. parentId: formparentId.value,
  1085. key: tableFormItemNode.value['KeyName'],
  1086. contractId: contractId.value,
  1087. value: formulaModalinfo?.value?.type,
  1088. pkeyId: tableFormItemNode.value?.pkeyId,
  1089. scope: componentDetail?.value['scope'],
  1090. code:componentDetail?.value?.info['code'],
  1091. })
  1092. if (!error && code === 200) {
  1093. window?.$message?.success('操作成功')
  1094. formulaModal.value = false;
  1095. }
  1096. }
  1097. //插入设计值
  1098. const IDVFModal = ref(false)
  1099. const formIDVFRef = ref(null)
  1100. const formIDVFModel = ref({type: 1, design: '', size: '', dev: '', key: '', capacity: '', pass: '', pkId: ''})
  1101. //插入特殊字符
  1102. const specialModal = ref(false)
  1103. const specialCharacters = ref([
  1104. '&#57344;', "&#57345;", "&#57346;", "&#57347;", '&#8804;', '&#8805;', '&#8451;',
  1105. '&#9312;', '&#9313;', '&#9314;', '&#9315;', '&#9316;', '&#9317;', '&#9318;', '&#9319;', '&#9320;', '&#9321;', '&#9322;', '&#9323;',
  1106. '&#9324;', '&#9325;', '&#9326;', '&#9327;', '&#9328;', '&#9329;', '&#9330;', '&#9331;',
  1107. "&#8544;", "&#8545;", "&#8546;", "&#8547;", "&#8548;", "&#8549;", "&#8550;", "&#8551;", "&#8552;", "&#8553;", "&#8554;", "&#8555;", "K̅"
  1108. ])
  1109. //输入框验证
  1110. const specialFormRef = ref(null)
  1111. const specialFormModel = ref({val: ''})
  1112. const specialFormRules = {
  1113. val: {
  1114. required: true,
  1115. trigger: "blur",
  1116. message: "请选择特殊字符代码"
  1117. }
  1118. }
  1119. //显示插入特殊字符
  1120. const specialRef = ref(null)
  1121. const specialModalShow = () => {
  1122. specialFormModel.value.val = ''
  1123. specialModal.value = true
  1124. nextTick(() => {
  1125. specialRef.value?.focus();
  1126. })
  1127. }
  1128. //失去焦点
  1129. const specialPos = ref({start: 0, end: 0})
  1130. const specialInputBlur = (e) => {
  1131. specialPos.value = {
  1132. start: e?.target?.selectionStart || 0,
  1133. end: e?.target?.selectionEnd || 0
  1134. }
  1135. }
  1136. //点击符号
  1137. const specialClick = (event) => {
  1138. const text = event?.target?.innerText ?? ''
  1139. const start = specialPos.value.start
  1140. const end = specialPos.value.end
  1141. const form = specialFormModel.value.val
  1142. specialFormModel.value.val = setPosInsert(start, end, form, text)
  1143. specialRef.value?.focus();
  1144. let posVal = start + text.length;
  1145. nextTick(() => {
  1146. setPosRange('specialId', posVal)
  1147. })
  1148. }
  1149. //确认插入
  1150. const specialNodeClick = async () => {
  1151. const res = await formValidate(specialFormRef.value)
  1152. if (res) {
  1153. const item = tableFormItemNode.value
  1154. const form = formData.value[item.index]
  1155. const val = specialFormModel.value.val ?? ''
  1156. formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], val)
  1157. specialModal.value = false
  1158. specialRef.value?.focus();
  1159. let posVal = item.startPos + val.length;
  1160. nextTick(() => {
  1161. setPosRange(item.KeyName, posVal)
  1162. })
  1163. }
  1164. }
  1165. //关联试验数据
  1166. const CTDModal = ref(false)
  1167. //树形结构异步加载数据
  1168. const defaultExpandedCids = ref([])
  1169. //自动展开缓存
  1170. const CTDTreeAutoExpandKeys = ref(getStoreData('CTDElTreeExpandKeys') || [])
  1171. const dialogTableRef = ref(null)
  1172. const dialogTableRef1 = ref(null)
  1173. const dialogTableRef2 = ref(null)
  1174. const ElTreeProps = ref({
  1175. label: 'title',
  1176. children: 'children',
  1177. isLeaf: 'hasChildren'
  1178. })
  1179. const ElTreeLoadNode = async (node, resolve) => {
  1180. let parentId = '0';
  1181. if (node.level !== 0) {
  1182. parentId = node?.data?.id
  1183. }
  1184. //获取数据
  1185. const {error, code, data} = await samplingApi.queryLazyTree({
  1186. wbsId: wbsTempId.value,
  1187. tenantId: tenantId.value,
  1188. projectId: projectId.value,
  1189. parentId,
  1190. wbsType: wbsType.value
  1191. })
  1192. //处理数据
  1193. if (!error && code === 200) {
  1194. let clickKey = '', defaultExpandedArr = [];
  1195. const keys = CTDTreeAutoExpandKeys.value || []
  1196. const resData = getArrValue(data)
  1197. for (let i = 0; i < resData.length; i++) {
  1198. resData[i].hasChildren = !resData[i].hasChildren
  1199. }
  1200. if (keys.length > 0) {
  1201. let lastKey = keys[keys.length - 1];
  1202. for (const item of resData) {
  1203. //自动展开
  1204. if (isItem(keys, item?.primaryKeyId)) {
  1205. defaultExpandedArr.push(item?.primaryKeyId)
  1206. }
  1207. //最后一个,选中点击
  1208. if (item?.primaryKeyId === lastKey) {
  1209. clickKey = item?.primaryKeyId
  1210. }
  1211. }
  1212. } else if (node.level === 0) {
  1213. defaultExpandedArr.push(resData[0]?.primaryKeyId)
  1214. }
  1215. //自动展开
  1216. defaultExpandedCids.value = defaultExpandedArr
  1217. if (node.level === 0) {
  1218. emit('nodeLoading')
  1219. if (resData.length <= 0) {
  1220. window?.$message?.warning('该项目未使用试验系统,无法获取数据')
  1221. }
  1222. }
  1223. resolve(resData)
  1224. //最后一个,执行点击
  1225. if (clickKey) {
  1226. await nextTick(() => {
  1227. // document.getElementById(`${idPrefix.value}${clickKey}`)?.click()
  1228. })
  1229. }
  1230. } else {
  1231. if (node.level === 0) {
  1232. emit('nodeLoading')
  1233. }
  1234. resolve([])
  1235. }
  1236. }
  1237. //节点被点击
  1238. const CTDnodeItemInfo = ref({})
  1239. const CTDnodeDataInfo = ref({})
  1240. const CTDdialogTableData1 = ref([])
  1241. const filedialogTableData = ref([])
  1242. //多选
  1243. const filetableCheckedKeys = ref([]);
  1244. const filedialogTableSelection1 = (rows) => {
  1245. filetableCheckedKeys.value = rows.filter((item) => {
  1246. return (item ?? '') !== '';
  1247. })
  1248. }
  1249. const filedialogTableSelection = (rows) => {
  1250. filetableCheckedKeys.value = rows.filter((item) => {
  1251. return (item ?? '') !== '';
  1252. })
  1253. }
  1254. //确认关联试验文件
  1255. const savefileModal = () => {
  1256. const idarr = []
  1257. filetableCheckedKeys.value.forEach((item) => {
  1258. idarr.push(item.id)
  1259. })
  1260. const idval = idarr.join(',')
  1261. savesubmitRelationFile(idval)
  1262. fileModal.value = false
  1263. }
  1264. const CTDdialogTableColumn = ref([
  1265. {key: 'reportNo', name: '报告编号'},
  1266. {key: 'reportDate', name: '报告日期'},
  1267. {key: 'projectPositionName', name: '工程用途及部位'},
  1268. {key: 'detectionResultName', name: '检测结果'},
  1269. ])
  1270. const filedialogTableColumn = ref([
  1271. // reportNo
  1272. {key: 'reportNo', name: '报告编号'},
  1273. {key: 'reportDate', name: '报告日期'},
  1274. {key: 'projectPositionName', name: '工程用途及部位'},
  1275. {key: 'detectionResultName', name: '检测结果'},
  1276. ])
  1277. const filedialogTableColumn1 = ref([
  1278. // reportNo
  1279. {key: 'reportNo', name: '报告编号'},
  1280. {key: 'reportDate', name: '报告日期'},
  1281. {key: 'projectPosition', name: '工程用途及部位'},
  1282. {key: 'detectionResultName', name: '检测结果'},
  1283. ])
  1284. const CTDElTreeClick = (data, node, keys) => {
  1285. CTDnodeItemInfo.value = node
  1286. CTDnodeDataInfo.value = data
  1287. getNodeData()
  1288. //缓存展开的节点
  1289. CTDTreeAutoExpandKeys.value = keys.value || []
  1290. setStoreData('CTDElTreeExpandKeys', keys.value)
  1291. }
  1292. //获取试验树节点下的记录信息
  1293. const getNodeData = async () => {
  1294. //获取数据
  1295. CTDdialogTableLoading.value = true
  1296. const {error, code, data} = await samplingApi.gettrialPage({
  1297. contractId: contractId.value,
  1298. nodeId: CTDnodeDataInfo.value.primaryKeyId,
  1299. current: CTDsearchFormPage.value.current,
  1300. size: CTDsearchFormPage.value.size,
  1301. startTime: CTDsearchFormPage.value.startTime,
  1302. endTime: CTDsearchFormPage.value.lastTime,
  1303. })
  1304. //处理数据
  1305. if (!error && code === 200) {
  1306. CTDdialogTableData1.value = getArrValue(data['records'])
  1307. CTDsearchFormPage.value.total = data.total || 0
  1308. CTDdialogTableLoading.value = false
  1309. } else {
  1310. CTDdialogTableData1.value = []
  1311. CTDsearchFormPage.value.total = 0
  1312. CTDdialogTableLoading.value = false
  1313. }
  1314. }
  1315. //试验文件节点下的数据
  1316. const getfileNodeData = async () => {
  1317. //获取数据
  1318. filedialogTableLoading.value = true
  1319. const {error, code, data} = await samplingApi.gettrialPage({
  1320. contractId: contractId.value,
  1321. nodeId: filenodeDataInfo.value.primaryKeyId,
  1322. current: filesearchFormPage.value.current,
  1323. size: filesearchFormPage.value.size,
  1324. startTime: filesearchFormPage.value.startTime,
  1325. endTime: filesearchFormPage.value.lastTime,
  1326. qualityTestPKeyId: isPrimaryKeyId.value
  1327. })
  1328. //处理数据
  1329. if (!error && code === 200) {
  1330. filedialogTableData.value = getArrValue(data['records'])
  1331. filesearchFormPage.value.total = data.total || 0
  1332. filedialogTableLoading.value = false
  1333. let defaultarr = []
  1334. filedialogTableData.value.forEach((item) => {
  1335. if (item.isSelectedStatus === 1) {
  1336. defaultarr.push(item)
  1337. }
  1338. tabtoggleSelection(defaultarr)
  1339. })
  1340. } else {
  1341. filedialogTableData.value = []
  1342. filesearchFormPage.value.total = 0
  1343. filesearchFormPage.value = false
  1344. }
  1345. }
  1346. const tabtoggleSelection = (rows) => {
  1347. if (rows) {
  1348. rows.forEach(row => {
  1349. nextTick(() => {
  1350. dialogTableRef1.value?.toggleRowSelection(row, true);
  1351. })
  1352. });
  1353. } else {
  1354. dialogTableRef1.value?.clearSelection();
  1355. }
  1356. }
  1357. const outtabtoggleSelection = (rows) => {
  1358. if (rows) {
  1359. rows.forEach(row => {
  1360. nextTick(() => {
  1361. dialogTableRef2.value?.toggleRowSelection(row, true);
  1362. })
  1363. });
  1364. } else {
  1365. dialogTableRef2.value?.clearSelection();
  1366. }
  1367. }
  1368. const thirdtabtoggleSelection = (rows) => {
  1369. console.log(rows, 'rows');
  1370. if (rows) {
  1371. rows.forEach(row => {
  1372. nextTick(() => {
  1373. if (fileModalradio.value == 2) {
  1374. dialogTableRef2.value?.toggleRowSelection(row, true);
  1375. } else {
  1376. dialogTableRef.value?.toggleRowSelection(row, true);
  1377. }
  1378. })
  1379. });
  1380. } else {
  1381. if (fileModalradio.value == 2) {
  1382. dialogTableRef2.value?.clearSelection();
  1383. } else {
  1384. dialogTableRef.value?.clearSelection();
  1385. }
  1386. }
  1387. }
  1388. //获取试验表中的data数据接口:
  1389. const getBussddataInfotrialData = async () => {
  1390. insertDataTableLoading.value = true;
  1391. console.log(checPkd.value, 'checPkd.value');
  1392. const {error, code, data} = await dataApi.getBussddataInfotrialList({
  1393. // id:testReportId.value,
  1394. id: currowid.value,
  1395. pkeyId: testReportId.value,
  1396. })
  1397. insertDataTableLoading.value = false
  1398. if (!error && code === 200) {
  1399. // insertDataTable.value = getArrValue(data)
  1400. let arrobj = getObjValue(data)
  1401. let arr = []
  1402. for (var key of Object.keys(arrobj)) {
  1403. arr.push({
  1404. key: key,
  1405. value: arrobj[key]
  1406. })
  1407. }
  1408. insertDataTable.value = arr
  1409. } else {
  1410. insertDataTable.value = []
  1411. }
  1412. }
  1413. //保存试验节点数据
  1414. //取消关联数据
  1415. const cancelinsertData = async () => {
  1416. insertDataShow.value = false
  1417. }
  1418. //确定关联试验数据数据
  1419. const submitinsertData = async () => {
  1420. if (multipleSelection.value.length > 0) {
  1421. const item = tableFormItemNode.value
  1422. const form = formData.value[item.index]
  1423. const val = []
  1424. multipleSelection.value.forEach((item) => {
  1425. val.push(item['value'])
  1426. })
  1427. const newval = val.join('、')
  1428. formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], newval)
  1429. insertDataShow.value = false
  1430. CTDModal.value = false
  1431. let posVal = item.startPos + newval.length;
  1432. nextTick(() => {
  1433. setPosRange(item.KeyName, posVal)
  1434. })
  1435. } else {
  1436. window?.$message?.warning('请选择你要关联的数据')
  1437. }
  1438. }
  1439. //公式参数配置
  1440. const saveformulaModal = () => {
  1441. console.log('保存');
  1442. }
  1443. //节点被点击
  1444. const ElTreeClick = async (data, node) => {
  1445. console.log(data, mode);
  1446. let autoKeysArr = []
  1447. await getNodeExpandKeys(node, autoKeysArr)
  1448. const autoKeys = autoKeysArr.reverse()
  1449. emit('nodeTap', {node, data, keys: autoKeys})
  1450. }
  1451. //处理自动展开的节点KEY
  1452. const getNodeExpandKeys = async (node, newKeys) => {
  1453. const parent = node?.parent ?? []
  1454. const primaryKeyId = node?.data?.primaryKeyId ?? ''
  1455. if (primaryKeyId) {
  1456. newKeys.push(primaryKeyId)
  1457. await getNodeExpandKeys(parent, newKeys)
  1458. }
  1459. }
  1460. const CTDbetweenTime = ref([])
  1461. const filebetweenTime = ref([])
  1462. //搜索表单
  1463. const CTDsearchFormPage = ref({
  1464. startTime: null, lastTime: null, wbsId: null, current: 1, size: 20, total: 0
  1465. })
  1466. const filesearchFormPage = ref({
  1467. startTime: null, lastTime: null, wbsId: null, current: 1, size: 20, total: 0
  1468. })
  1469. const CTDsearchFormPageChange = ({current, size}) => {
  1470. CTDsearchFormPage.value.current = current
  1471. CTDsearchFormPage.value.size = size
  1472. // getDialogTableData()
  1473. }
  1474. const filesearchFormPageChange = ({current, size}) => {
  1475. filesearchFormPage.value.current = current
  1476. filesearchFormPage.value.size = size
  1477. // getDialogTableData()
  1478. }
  1479. const CTDbetweenTimeUpdate = ({arr, query}) => {
  1480. CTDbetweenTime.value = arr
  1481. CTDsearchFormPage.value.startTime = arr[0]
  1482. CTDsearchFormPage.value.lastTime = arr[1]
  1483. }
  1484. const filebetweenTimeUpdate = ({arr, query}) => {
  1485. filebetweenTime.value = arr
  1486. filesearchFormPage.value.startTime = arr[0]
  1487. filesearchFormPage.value.lastTime = arr[1]
  1488. }
  1489. //搜索
  1490. const CTDsearchClick = () => {
  1491. CTDsearchFormPage.value.current = 1;
  1492. getNodeData()
  1493. }
  1494. const filesearchClick = () => {
  1495. filesearchFormPage.value.current = 1;
  1496. getfileNodeData()
  1497. }
  1498. const CTDdialogTableLoading = ref(false)
  1499. const filedialogTableLoading = ref(false)
  1500. const insertDataSelectoading = ref(false)
  1501. const CTDdialogTableKeys = ref([])
  1502. const currowid = ref('')
  1503. //名称被点击
  1504. const CTDtableRowName = (row) => {
  1505. currowid.value = row.id
  1506. insertDataShow.value = true
  1507. getSearchNodeTables()
  1508. }
  1509. const getSearchNodeTables = async () => {
  1510. insertDataSelectoading.value = true
  1511. const {error, code, data} = await dataApi.searchNodeTables({
  1512. id: currowid.value,
  1513. projectId: projectId.value,
  1514. contractId: contractId.value,
  1515. primaryKeyId: CTDnodeDataInfo.value.primaryKeyId,
  1516. // type: authBtnTabKey.value,
  1517. tableType: tabTypeKey.value
  1518. })
  1519. //处理数据
  1520. insertDataSelectoading.value = false
  1521. if (!error && code === 200) {
  1522. testReportData.value = getArrValue(data)
  1523. if(testReportData.value.length>0){
  1524. testReportId.value=testReportData.value[0].pKeyId
  1525. getBussddataInfotrialData()
  1526. }
  1527. } else {
  1528. testReportData.value = []
  1529. }
  1530. }
  1531. //关联试验文件
  1532. const fileModal = ref(false)
  1533. const fileModalradio = ref(1)
  1534. const radioChange = (val) => {
  1535. if (val !== 1) {
  1536. getthirdTreeDatas(val)
  1537. }
  1538. }
  1539. //获取试验文件树树数据
  1540. const fileModaltreeDatas = ref([])
  1541. //节点被点击
  1542. //节点被点击
  1543. const filenodeItemInfo = ref({})
  1544. const filenodeDataInfo = ref({})
  1545. const fileTableData1 = ref([])
  1546. const fileTableColumn = ref([
  1547. {key: 'recordNo', name: '报告编号'},
  1548. {key: 'reportDate', name: '报告日期'},
  1549. {key: 'projectPositionName', name: '工程用途及部位'},
  1550. {key: 'detectionResultName', name: '检测结果'},
  1551. ])
  1552. const fileModalElTreeClick = async (data, node) => {
  1553. filenodeItemInfo.value = node
  1554. filenodeDataInfo.value = data
  1555. getfileNodeData()
  1556. }
  1557. //获取第三方树试验文件
  1558. //获取树数据
  1559. const thirdtreeDatas = ref([])
  1560. const thirdElTreeProps = ref({
  1561. label: 'nodeName',
  1562. children: 'children',
  1563. isLeaf: 'hasChildren'
  1564. })
  1565. const getthirdTreeDatas = async (type) => {
  1566. const {error, code, data} = await getTreeAll({
  1567. projectId: projectId.value,
  1568. contractId: contractId.value
  1569. })
  1570. if (!error && code === 200) {
  1571. if (type == 2) {
  1572. thirdtreeDatas.value = getArrValue(data['rightTree'])
  1573. } else {
  1574. thirdtreeDatas.value = getArrValue(data['leftTree'])
  1575. }
  1576. } else {
  1577. thirdtreeDatas.value = []
  1578. }
  1579. }
  1580. const thirdfilenodeItemInfo = ref({})
  1581. const thirdfilenodeDataInfo = ref({})
  1582. //获取第三方树节点下的数据
  1583. const getthirdTreetavleDatas = async () => {
  1584. filedialogTableLoading.value = true
  1585. const {error, code, data} = await thirdApi.queryPage({
  1586. projectId: projectId.value,
  1587. contractId: contractId.value,
  1588. nodeId: thirdfilenodeDataInfo.value.id,
  1589. current: filesearchFormPage.value.current,
  1590. size: filesearchFormPage.value.size,
  1591. startTime: filesearchFormPage.value.startTime,
  1592. endTime: filesearchFormPage.value.lastTime,
  1593. qualityTestPKeyId: isPrimaryKeyId.value
  1594. })
  1595. //处理数据
  1596. if (!error && code === 200) {
  1597. filedialogTableData.value = getArrValue(data['records'])
  1598. filesearchFormPage.value.total = data.total || 0
  1599. filedialogTableLoading.value = false
  1600. if (filedialogTableData.value.length > 0) {
  1601. let defaultarr = []
  1602. filedialogTableData.value.forEach((item) => {
  1603. if (item.isSelectedStatus === 1) {
  1604. defaultarr.push(item)
  1605. }
  1606. if (fileModalradio === 2) {
  1607. outtabtoggleSelection(defaultarr)
  1608. } else {
  1609. thirdtabtoggleSelection(defaultarr)
  1610. }
  1611. })
  1612. }
  1613. } else {
  1614. filedialogTableData.value = []
  1615. filesearchFormPage.value.total = 0
  1616. filesearchFormPage.value = false
  1617. }
  1618. filedialogTableLoading.value = false
  1619. }
  1620. const thirdtreeDatasElTreeClick = (data, node) => {
  1621. thirdfilenodeItemInfo.value = node
  1622. thirdfilenodeDataInfo.value = data
  1623. getthirdTreetavleDatas()
  1624. }
  1625. //关联试验文件
  1626. const savesubmitRelationFile = async (ids) => {
  1627. console.log(isPrimaryKeyId.value, ' isPrimaryKeyId.value');
  1628. const {error, code, data} = await samplingApi.submitRelationFile({
  1629. projectId: projectId.value,
  1630. contractId: contractId.value,
  1631. nodeId: isPrimaryKeyId.value,
  1632. type: fileModalradio.value,
  1633. ids
  1634. })
  1635. if (!error && code === 200) {
  1636. window?.$message?.success('操作成功')
  1637. }
  1638. }
  1639. //设计值频率计算
  1640. const IDVFModalSaveClick = async () => {
  1641. const {pkeyId, KeyName, index} = tableFormItemNode.value
  1642. if (pkeyId) {
  1643. const {design, size} = formIDVFModel.value
  1644. const {error, code, data} = await wbsApi.queryFormulaRange({
  1645. ...formIDVFModel.value,
  1646. // dev: (!design && !size) ? '±5': '',
  1647. key: KeyName,
  1648. pkId: pkeyId,
  1649. })
  1650. //处理数据
  1651. const res = getObjNullValue(data)
  1652. if (!error && code === 200 && res) {
  1653. Object.keys(data).forEach(key => {
  1654. formData.value[index][key] = data[key]
  1655. })
  1656. IDVFModal.value = false
  1657. }
  1658. } else {
  1659. window?.$message?.warning('pkeyId为空')
  1660. }
  1661. }
  1662. const closeIDVFModal = () => {
  1663. IDVFModal.value = false
  1664. formIDVFModel.value = {type: 1, design: '', size: '', dev: '', key: '', capacity: '', pass: '', pkId: ''}
  1665. }
  1666. //事件
  1667. const emit = defineEmits(['renew', 'offsetTop'])
  1668. //被点击
  1669. const getOffsetTop = (key = '') => {
  1670. if (key) {
  1671. const dom = document.getElementById(key[key.length - 1])
  1672. if (!drawType.value) {
  1673. if (dom?.offsetTop >= 583 && ActiveKey.value.length > 1) {
  1674. const barWidth = menuBarShow.value ? 36 : 0;
  1675. emit('offsetTop', dom?.offsetTop - 583 + barWidth)
  1676. } else {
  1677. emit('offsetTop', dom?.offsetTop)
  1678. }
  1679. } else {
  1680. if (dom.offsetTop >= 424 && ActiveKey.value.length > 1) {
  1681. const barWidth = menuBarShow.value ? 18 : 0;
  1682. emit('offsetTop', dom?.offsetTop - 424 - barWidth)
  1683. } else {
  1684. emit('offsetTop', dom?.offsetTop)
  1685. }
  1686. }
  1687. } else {
  1688. emit('offsetTop', 0)
  1689. }
  1690. ActiveKey.value = ActiveKey.value[ActiveKey.value.length - 1]
  1691. }
  1692. //通知数据更新
  1693. const renewData = () => {
  1694. emit('renew')
  1695. ActiveKey.value = []
  1696. }
  1697. //获取表单数据
  1698. const getFormData = () => {
  1699. const formArr = formData.value;
  1700. return formArr.filter((item) => {
  1701. return (item.pkeyId ?? '') !== '' && item.isCollapseLoad;
  1702. })
  1703. }
  1704. //获取表单效验数据
  1705. const getFormRegExpJson = () => {
  1706. return deepClone(formRegExpJson.value);
  1707. }
  1708. //获取当前展开项
  1709. const getActiveKey = () => {
  1710. return ActiveKey.value;
  1711. }
  1712. //设置当前展开项
  1713. const setActiveKey = (key) => {
  1714. return ActiveKey.value = key;
  1715. }
  1716. //名称被点击
  1717. const tableRowName = (row) => {
  1718. console.log(row, 'row');
  1719. //如果 evisaPdfUrl 不为空,使用evisaPdfUrl,反之使用pdfUrl
  1720. // if (row['evisaPdfUrl']) {
  1721. // window.open(row['evisaPdfUrl'],'_blank')
  1722. // } else if (row['pdfUrl']) {
  1723. // window.open(row['pdfUrl'],'_blank')
  1724. // } else {
  1725. // window.$message?.warning('文件不存在')
  1726. // }
  1727. }
  1728. // 暴露出去
  1729. defineExpose({
  1730. getFormData,
  1731. getFormRegExpJson,
  1732. getActiveKey,
  1733. setActiveKey
  1734. })
  1735. </script>
  1736. <style lang="scss" scoped>
  1737. table {
  1738. width: 100%;
  1739. }
  1740. .data-fill-list-box {
  1741. position: relative;
  1742. //margin-bottom: 25%;
  1743. .hc-collapse-item-header {
  1744. flex: 1;
  1745. position: relative;
  1746. margin-left: 46px;
  1747. display: flex;
  1748. align-items: center;
  1749. .item-title {
  1750. flex: 1;
  1751. position: relative;
  1752. user-select: none;
  1753. color: #50545E;
  1754. font-size: 16px;
  1755. font-weight: 400;
  1756. cursor: pointer;
  1757. }
  1758. .hc-extra-text-box {
  1759. position: relative;
  1760. padding-right: 24px;
  1761. }
  1762. }
  1763. .data-fill-list-item-content {
  1764. position: relative;
  1765. display: flex;
  1766. height: calc(100vh - 386px);
  1767. .data-fill-table-form-box {
  1768. position: relative;
  1769. padding: 24px 20px;
  1770. height: 100%;
  1771. overflow: auto;
  1772. flex: 1;
  1773. border: 8px solid #50545E;
  1774. .hc-no-table-form {
  1775. position: relative;
  1776. height: 100%;
  1777. display: flex;
  1778. justify-content: center;
  1779. align-items: center;
  1780. .table-form-no {
  1781. position: relative;
  1782. img {
  1783. width: 350px;
  1784. }
  1785. .desc {
  1786. text-align: center;
  1787. font-size: 20px;
  1788. color: #aaa;
  1789. }
  1790. }
  1791. }
  1792. }
  1793. .data-fill-table-tip-box {
  1794. width: 240px;
  1795. position: relative;
  1796. border-left: 1px solid #E9E9E9;
  1797. padding: 20px 15px 80px;
  1798. .tip-title {
  1799. font-size: 16px;
  1800. margin-bottom: 10px;
  1801. display: flex;
  1802. align-items: center;
  1803. }
  1804. .tip-item {
  1805. margin-bottom: 20px;
  1806. }
  1807. .table-tip-foot {
  1808. position: absolute;
  1809. bottom: 15px;
  1810. right: 0;
  1811. left: 0;
  1812. display: flex;
  1813. align-items: center;
  1814. padding: 0 15px;
  1815. .tip-left-btn {
  1816. flex: 1;
  1817. .dow-text {
  1818. cursor: pointer;
  1819. display: flex;
  1820. align-items: center;
  1821. }
  1822. }
  1823. }
  1824. }
  1825. }
  1826. }
  1827. .special-box {
  1828. position: relative;
  1829. display: flex;
  1830. justify-content: center;
  1831. align-items: center;
  1832. border: 1px solid #eee;
  1833. border-radius: 3px;
  1834. height: 52px;
  1835. width: 52px;
  1836. cursor: pointer;
  1837. user-select: none;
  1838. transition: color .3s, background-color .3s;
  1839. &:hover {
  1840. color: var(--el-color-primary);
  1841. background-color: var(--el-color-primary-light-8);
  1842. }
  1843. .font-EUDC {
  1844. font-size: 22px;
  1845. }
  1846. }
  1847. .radio-group-box {
  1848. text-align: center;
  1849. }
  1850. </style>
  1851. <style lang="scss">
  1852. .data-fill-list-box {
  1853. .el-collapse {
  1854. --el-collapse-header-height: 60px;
  1855. border: 0;
  1856. .el-collapse-item {
  1857. margin: 0 0 16px;
  1858. background-color: #f1f5f8;
  1859. border: 1px solid #E9E9E9;
  1860. border-radius: 4px;
  1861. }
  1862. .el-collapse-item__header {
  1863. background-color: transparent;
  1864. font-weight: 400;
  1865. border-bottom: 0;
  1866. cursor: default;
  1867. font-size: 14px;
  1868. .el-collapse-item__arrow {
  1869. position: absolute;
  1870. color: #50545E;
  1871. cursor: pointer;
  1872. left: 20px;
  1873. margin: 0;
  1874. }
  1875. }
  1876. .el-collapse-item.is-active .el-collapse-item__header.is-active {
  1877. background-color: #E7EEF4;
  1878. }
  1879. .el-collapse-item__wrap {
  1880. background-color: transparent;
  1881. border-bottom: 0;
  1882. .el-collapse-item__content {
  1883. position: relative;
  1884. padding-bottom: 0;
  1885. font-size: 14px;
  1886. color: #50545E;
  1887. line-height: initial;
  1888. }
  1889. }
  1890. }
  1891. }
  1892. //插入特殊字符弹窗的输入框
  1893. .data-fill-list-box .data-fill-table-form-box td,
  1894. .data-fill-list-box .data-fill-table-form-box td .el-input .el-input__wrapper .el-input__inner,
  1895. .el-form-item.special-form-item .el-form-item__content .el-input .el-input__wrapper .el-input__inner {
  1896. font-family: "EUDC", 宋体, v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  1897. }
  1898. //复制本表弹窗
  1899. .copy-node-many-box {
  1900. position: relative;
  1901. height: 53vh;
  1902. display: flex;
  1903. margin-top: 24px;
  1904. margin-bottom: -30px;
  1905. border-top: 1px solid #efeff5;
  1906. .copy-node-many-tree {
  1907. position: relative;
  1908. flex: 1;
  1909. height: 100%;
  1910. padding: 20px 20px 20px 0;
  1911. border-right: 1px solid #efeff5;
  1912. }
  1913. .copy-node-many-table {
  1914. position: relative;
  1915. flex: 1;
  1916. height: 100%;
  1917. padding: 20px 0 20px 20px;
  1918. }
  1919. }
  1920. //关联试验数据
  1921. .adding-form-dialog-box {
  1922. position: relative;
  1923. height: 100%;
  1924. display: flex;
  1925. .dialog-tree-box {
  1926. position: relative;
  1927. border-right: 1px solid #EEEEEE;
  1928. width: 500px;
  1929. height: 100%
  1930. }
  1931. .dialog-table-box {
  1932. position: relative;
  1933. flex: 1;
  1934. height: 100%;
  1935. padding: 18px;
  1936. .dialog-search {
  1937. position: relative;
  1938. display: flex;
  1939. }
  1940. .dialog-table {
  1941. position: relative;
  1942. height: calc(100% - 68px);
  1943. padding: 18px 0;
  1944. }
  1945. .dialog-pages {
  1946. position: relative;
  1947. }
  1948. }
  1949. }
  1950. .copy-node-many-table {
  1951. position: relative;
  1952. flex: 1;
  1953. height: 100%;
  1954. padding: 20px 0 20px 20px;
  1955. }
  1956. .dialog-table-box {
  1957. position: relative;
  1958. flex: 1;
  1959. height: 100%;
  1960. padding: 18px;
  1961. .dialog-search {
  1962. position: relative;
  1963. display: flex;
  1964. }
  1965. .dialog-table {
  1966. position: relative;
  1967. height: calc(100% - 68px);
  1968. padding: 18px 0;
  1969. }
  1970. .dialog-pages {
  1971. position: relative;
  1972. }
  1973. }
  1974. .text-blue {
  1975. color: blue;
  1976. }
  1977. .text-green {
  1978. color: green
  1979. }
  1980. </style>