wbs.vue 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410
  1. <template>
  2. <div class="h-full">
  3. <div v-if="wbsTypeTabKey === 'tree'" v-loading="nodeSaveLoading" class="hc-layout-box" element-loading-text="批量保存数据中...">
  4. <div
  5. id="wbs-left-tree" :class="[isWbsTreeShow ? 'show' : '', isMouseTree ? 'on-transition' : '']"
  6. :style="`width:${isWbsTreeShow ? leftWidth : 0}px; ${isWbsTreeShow ? '' : 'display: none'}`"
  7. class="hc-layout-left-box bg-white"
  8. >
  9. <div class="hc-project-box">
  10. <div class="hc-project-icon-box">
  11. <HcIcon name="stack" />
  12. </div>
  13. <div class="project-name-box ml-2">
  14. <div class="project-alias">{{ projectInfo?.projectName }}</div>
  15. </div>
  16. </div>
  17. <div class="hc-tree-box">
  18. <div class="hc-tree-back-to">
  19. <el-link type="primary" @click="gobackHistory">回到上一次填报部位</el-link>
  20. <el-link type="warning" class="ml-4" @click="wbsMapTypeTab">导图结构填报</el-link>
  21. <HcTooltip keys="data-fill-wbs-hide-btn">
  22. <el-button class="ml-6" hc-btn keys="data-fill-wbs-hide-btn" :loading="hideSaveLoading" style="background-color: white;color:white" @click="hideTreeNode">隐藏</el-button>
  23. </HcTooltip>
  24. </div>
  25. <div class="hc-search-tree-val">
  26. <el-input v-model="searchTreeVal" clearable block placeholder="请输入名称关键词检索" @keyup="searchTreeKeyUp">
  27. <template #suffix>
  28. <HcIcon name="search-2" ui="text-xl iscusor" @click="searchTreeClick" />
  29. </template>
  30. </el-input>
  31. </div>
  32. <div v-if="isShowLeft" id="hc-tree-scrollbar" v-loading="treeLoading" class="hc-tree-scrollbar" element-loading-text="获取数据中...">
  33. <el-scrollbar v-show="isSearchTree" class="scroll-bar-right-16">
  34. <HcDataTree
  35. is-load-menu
  36. :datas="searchTreeData"
  37. :is-mark="TreeMark"
  38. :menus="ElTreeMenu"
  39. is-counts
  40. is-type
  41. :auto-expand-keys="TreeAutoExpandKeys"
  42. default-expand-all
  43. @node-tap="wbsElTreeClick"
  44. @menu-tap="ElTreeMenuClick"
  45. @load-menu="loadMenu"
  46. />
  47. </el-scrollbar>
  48. <el-scrollbar v-show="!isSearchTree" class="scroll-bar-right-16">
  49. <HcLazyTree
  50. ref="wbstree"
  51. is-load-menu
  52. :auto-expand-keys="TreeAutoExpandKeys"
  53. :is-mark="TreeMark"
  54. :menus="ElTreeMenu"
  55. is-counts
  56. is-type
  57. show-checkbox
  58. check-strictly
  59. @load="treeLoadNode"
  60. @menu-tap="ElTreeMenuClick"
  61. @node-loading="ElTreeNodeLoading"
  62. @node-tap="wbsElTreeClick"
  63. @check="ElTreeNodeCheck"
  64. @load-menu="loadMenu"
  65. />
  66. </el-scrollbar>
  67. </div>
  68. </div>
  69. <div class="hc-tree-foot-tip-box">
  70. <div class="dot-view green">已审批</div>
  71. <div class="dot-view black">未填报</div>
  72. <div class="dot-view orange">已填报-待审批</div>
  73. <div class="dot-view blue">已填报-未上报</div>
  74. </div>
  75. <!-- 左右拖动 -->
  76. <div class="horizontal-drag-line" @mousedown="onmousedown" />
  77. </div>
  78. <div id="wbs-content-box" v-loading="ListItemLoading" class="hc-layout-content-box">
  79. <!---展开收缩树 -->
  80. <div class="hc-expansion-contraction-tree" @click="setWbsTreeShow">
  81. <HcIcon v-show="isWbsTreeShow" name="arrow-left-s" />
  82. <HcIcon v-show="!isWbsTreeShow" name="arrow-right-s" />
  83. </div>
  84. <hc-tab-card :tabs="authBtnTabdata" :tab-key="authBtnTabKey" @change="authBtnTabClick">
  85. <template #extra>
  86. <HcTooltip keys="wbs_views_sort_btn">
  87. <el-button :disabled="ListItemDatas.length <= 0" hc-btn type="primary" @click="sortFormClick">排序</el-button>
  88. </HcTooltip>
  89. <HcTooltip keys="wbs_views_node_save_btn">
  90. <el-button :loading="nodeSaveLoading" hc-btn type="primary" @click="NodeSaveClick">辅助保存</el-button>
  91. </HcTooltip>
  92. <HcTooltip keys="wbs_views_drawings">
  93. <el-button :disabled="nodeDataInfo?.drawingsId === -1 || nodeDataInfo?.drawingsId === null" hc-btn color="#e03997" @click="viewsDrawings">图纸</el-button>
  94. </HcTooltip>
  95. <HcTooltip keys="wbs_preview">
  96. <el-button :disabled="NodeStatus === '1'" :loading="bussPdfsLoading" hc-btn color="#A16222" @click="bussPdfsClick">预览</el-button>
  97. </HcTooltip>
  98. <el-button hc-btn color="#A16222" @click="attachmentModalShow">查看附件</el-button>
  99. <el-button hc-btn :disabled="isCanadd" color="#567722" @click="addFilelist">上传附件</el-button>
  100. <HcTooltip v-if="NodeStatus !== '3'" keys="wbs_report">
  101. <el-button :disabled="NodeStatus === '3' || NodeStatus === '1'" :loading="reportLoading" hc-btn color="#FF976A" style="color: white;" @click="reportModalClick">上报</el-button>
  102. </HcTooltip>
  103. <HcTooltip v-if="NodeStatus === '3'" keys="wbs_abolish">
  104. <el-button hc-btn :laoding="abolishLoaing" color="#FF976A" style="color: white;" @click="abolishOneClick">撤回上报流程</el-button>
  105. </HcTooltip>
  106. <HcTooltip keys="wbs_views_sync_data_btn">
  107. <el-button v-if="authBtnTabKey === '2'" hc-btn color="#37c0fe" style="color: white;" :loading="syncdataloading" @click="syncdata">同步质检资料</el-button>
  108. </HcTooltip>
  109. <HcTooltip v-if="NodeStatus !== '3'" keys="wbs_save">
  110. <el-button
  111. :disabled="NodeStatus === '3' || ListItemDatas.length <= 0"
  112. :loading="tableFormSaveLoading" hc-btn color="#12C060"
  113. style="color: white; font-weight: bold"
  114. @click="tableFormSaveClick"
  115. >
  116. 保存数据
  117. </el-button>
  118. </HcTooltip>
  119. </template>
  120. <el-scrollbar v-if="ListItemDatas.length > 0" ref="ListItemScrollRef">
  121. <CollapseForm
  122. ref="ListItemRef"
  123. :tree-auto-expand-keys="TreeAutoExpandKeys"
  124. :classify="authBtnTabKey"
  125. :contract-id="contractId"
  126. :datas="ListItemDatas"
  127. :draw-type="!isDrawType"
  128. :primary-key-id="primaryKeyId"
  129. :status="NodeStatus"
  130. :tenant-id="userInfo?.tenant_id"
  131. :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
  132. :wbs-type="2"
  133. :treenode-data-info="nodeDataInfo"
  134. :newlistdata="newlistdata"
  135. @offset-top="ListItemOffsetTop"
  136. @renew="getTableDataAll"
  137. @get-list="searchNodeAllTable1"
  138. />
  139. </el-scrollbar>
  140. <hc-empty v-else title="暂无表单" />
  141. </hc-tab-card>
  142. </div>
  143. </div>
  144. <hc-new-card v-if="wbsTypeTabKey === 'map'" id-ref="wbs-node-tree-card-target">
  145. <template #header>
  146. <HcTooltip keys="wbs_views_division_btn">
  147. <el-button class="mr-10" hc-btn type="primary" @click="divisionClick">
  148. <HcIcon :line="false" name="node-tree" />
  149. <span>划分变更</span>
  150. </el-button>
  151. </HcTooltip>
  152. <HcNewSwitch v-if="isDrawer" :datas="authBtnTabdata" :keys="authBtnTabKey" :round="false" size="default" @change="authBtnTabClick" />
  153. </template>
  154. <template #extra>
  155. <HcNewSwitch :datas="wbsTypeTab" :keys="wbsTypeTabKey" size="default" @change="wbsTypeTabChange" />
  156. </template>
  157. <NodeTree
  158. ref="NodeTreeRef"
  159. :accordion="NodeTreeAccordion"
  160. :auto-expand-keys="TreeAutoExpandKeys"
  161. :contract-id="contractId"
  162. :is-mark="TreeMark"
  163. :menus="ElTreeMenu"
  164. :project-id="projectId"
  165. @menu-click="NodeTreeMenuClick"
  166. @node-click="NodeTreeClick"
  167. @node-dbl-click="NodeTreeDblClick"
  168. />
  169. <template #action>
  170. <div class="hc-tree-mp-tip-box">
  171. <div class="dot-view green">已审批</div>
  172. <div class="dot-view black">未填报</div>
  173. <div class="dot-view orange">已填报-待审批</div>
  174. <div class="dot-view blue">已填报-未上报</div>
  175. </div>
  176. </template>
  177. <HcDrawer v-model="isDrawer" to-id="wbs-node-tree-card-target" @close="drawerClose">
  178. <!-- 清表列表 -->
  179. <el-scrollbar v-if="ListItemDatas.length > 0" ref="ListItemScrollRef">
  180. <CollapseForm
  181. ref="ListItemsRef"
  182. :classify="authBtnTabKey"
  183. :contract-id="contractId"
  184. :datas="ListItemDatas"
  185. :draw-type="isDrawType"
  186. :primary-key-id="primaryKeyId"
  187. :status="NodeStatus"
  188. :tenant-id="userInfo?.tenant_id"
  189. :wbs-temp-id="projectInfo?.referenceWbsTemplateIdTrial"
  190. :wbs-type="2"
  191. @offset-top="ListItemOffsetTop"
  192. @renew="getTableDataAll"
  193. />
  194. </el-scrollbar>
  195. <hc-status v-else text="暂无表单" />
  196. <!-- 底部按钮区域 -->
  197. <template #action>
  198. <hc-tooltip v-if="NodeStatus !== '3'" keys="wbs_save">
  199. <el-button
  200. :disabled="NodeStatus === '3' || ListItemDatas.length <= 0"
  201. :loading="tableFormSaveLoading"
  202. hc-btn
  203. type="primary"
  204. @click="tableFormSaveClick"
  205. >
  206. <HcIcon name="save" />
  207. <span>保存</span>
  208. </el-button>
  209. </hc-tooltip>
  210. <hc-tooltip v-if="NodeStatus !== '3'" keys="wbs_report">
  211. <el-button
  212. :disabled="NodeStatus === '3' || NodeStatus === '1'"
  213. :loading="reportLoading"
  214. hc-btn
  215. @click="reportModalClick"
  216. >
  217. <HcIcon name="send-plane-2" />
  218. <span>上报</span>
  219. </el-button>
  220. </hc-tooltip>
  221. <hc-tooltip keys="wbs_preview">
  222. <el-button
  223. :disabled="NodeStatus === '1'"
  224. :loading="bussPdfsLoading"
  225. hc-btn
  226. @click="bussPdfsClick"
  227. >
  228. <HcIcon name="eye" />
  229. <span>预览</span>
  230. </el-button>
  231. </hc-tooltip>
  232. <hc-tooltip v-if="NodeStatus === '3'" keys="wbs_abolish">
  233. <el-button hc-btn>
  234. <HcIcon name="arrow-go-back" />
  235. <span>撤回上报流程</span>
  236. </el-button>
  237. </hc-tooltip>
  238. <hc-tooltip keys="wbs_views_drawings">
  239. <el-button :disabled="!nodeDataInfo?.fileUrl" hc-btn @click="viewsDrawings">
  240. <HcIcon name="image" />
  241. <span>图纸</span>
  242. </el-button>
  243. </hc-tooltip>
  244. <el-button hc-btn @click="attachmentModalShow">
  245. <HcIcon name="file" />
  246. <span>附件</span>
  247. </el-button>
  248. <el-button hc-btn @click="drawerClose">
  249. <HcIcon name="close" />
  250. <span>关闭填报页面</span>
  251. </el-button>
  252. </template>
  253. </HcDrawer>
  254. </hc-new-card>
  255. <!-- 查看图纸 -->
  256. <hc-drag-modal :is-show="drawingsShow" close-icon lefts="145" title="查看图纸" tops="100" ui="hc-image-preview-box" widths="380px" @close="drawingsClose">
  257. <div class="hc-image-preview-view">
  258. <!-- <el-image-viewer :url-list="[nodeDataInfo.fileUrl]" /> -->
  259. <el-image :src="drawList" />
  260. </div>
  261. </hc-drag-modal>
  262. <!-- 编辑节点 -->
  263. <hc-new-dialog v-model="editNodeModal" :loading="editNodeLoading" title="编辑节点" widths="600px" @save="editNodeClick">
  264. <el-form ref="formEditNodeRef" :model="formEditNodeModel" :rules="formEditNodeRules" label-width="auto" size="large">
  265. <el-form-item label="节点名称" prop="title">
  266. <el-input v-model="formEditNodeModel.title" placeholder="请输入节点名称" />
  267. </el-form-item>
  268. <el-form-item label="上级节点">
  269. <el-input v-model="formEditNodeModel.parent.title" disabled />
  270. </el-form-item>
  271. <el-form-item label="节点类型">
  272. <el-select v-model="formEditNodeModel.nodeType" disabled block>
  273. <el-option v-for="item in nodeTypeData" :key="item.value" :label="item.label" :value="item.value" />
  274. </el-select>
  275. </el-form-item>
  276. <el-form-item label="划分编号">
  277. <el-input v-model="formEditNodeModel.partitionCode" placeholder="请输入划分编号" />
  278. </el-form-item>
  279. <el-form-item class="hc-position-input-icon" label="模板位置">
  280. <el-input v-model="formEditNodeModel.position" :autosize="{ minRows: 3, maxRows: 6 }" type="textarea" />
  281. <el-tooltip content="一键复制模板位置">
  282. <HcIcon name="file-copy-2" @click="copyPositionText(formEditNodeModel.position)" />
  283. </el-tooltip>
  284. </el-form-item>
  285. </el-form>
  286. </hc-new-dialog>
  287. <!-- 复制节点 -->
  288. <hc-new-dialog v-model="copyNodeModal" :loading="copyNodeLoading" :widths="copyNodeTabKey === '1' ? '600px' : '1200px'" loading-text="复制节点中,请耐心等待..." title="复制节点">
  289. <div class="header-new-switch">
  290. <el-form ref="formCopyNodeModelRef" :model="formCopyNodeModel" label-position="left" :rules="formCopyNodeModelRules" label-width="auto" size="large">
  291. <el-form-item label="是否复制数据" prop="isCopyData" style="margin-bottom: 0;">
  292. <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
  293. <el-radio-group v-model="isCopyData">
  294. <el-radio :value="1">是</el-radio>
  295. <el-radio :value="0">否</el-radio>
  296. </el-radio-group>
  297. </el-form-item>
  298. <el-form-item v-if="isCopyData === 1" label="所属方" prop="classify" style="margin-bottom: 0;">
  299. <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
  300. <el-checkbox-group v-model="classifyList">
  301. <el-checkbox value="施工">施工</el-checkbox>
  302. <el-checkbox value="监理">监理</el-checkbox>
  303. </el-checkbox-group>
  304. </el-form-item>
  305. </el-form>
  306. <!-- HcNewSwitch :datas="authBtnTabdata" :keys="classifyType" :round="false" size="default"
  307. @change="classifyTypeTabClick"/ -->
  308. </div>
  309. <div v-if="copyNodeTabKey === '1'" class="copy-node-form-box">
  310. <el-form ref="formCopyNodeModelRef" :model="formCopyNodeModel" :rules="formCopyNodeModelRules" label-width="auto" size="large">
  311. <el-form-item v-if="copyNodeTabKey === '1'" label="节点名称" prop="title" style="margin-bottom: 0;">
  312. <el-input v-model="formCopyNodeModel.title" placeholder="请输入节点名称" />
  313. </el-form-item>
  314. <el-form-item v-if="copyNodeTabKey === '1'" label="划分编号" prop="partitionCode" style="margin-top: 10px;">
  315. <el-input v-model="formCopyNodeModel.partitionCode" placeholder="请输入划分编号" />
  316. </el-form-item>
  317. </el-form>
  318. </div>
  319. <div v-if="copyNodeTabKey === '3'" class="copy-node-form-box">
  320. <el-form ref="formCopyNodeModelRef" :model="formCopyNodeModel" :rules="formCopyNodeModelRules" label-width="auto" size="large">
  321. <el-form-item label="所属方" prop="classify" style="margin-bottom: 0;">
  322. <!-- <el-input v-model="formCopyNodeModel.classify" placeholder="请输入节点名称"/> -->
  323. <el-checkbox-group v-model="classifyList">
  324. <el-checkbox value="施工">施工</el-checkbox>
  325. <el-checkbox value="监理">监理</el-checkbox>
  326. </el-checkbox-group>
  327. </el-form-item>
  328. </el-form>
  329. </div>
  330. <div v-if="copyNodeTabKey !== '1'" class="copy-node-many-box">
  331. <div class="copy-node-many-tree">
  332. <el-scrollbar>
  333. <hc-lazy-tree :auto-expand-keys="TreeAutoExpandKeys" is-type @load="treeLoadNode" @node-tap="copyNodeElTreeClick" />
  334. </el-scrollbar>
  335. </div>
  336. <div class="copy-node-many-table">
  337. <el-scrollbar>
  338. <el-table :data="copyNodeTable" border>
  339. <el-table-column label="复制到的位置" prop="title" />
  340. <el-table-column v-if="copyNodeTabKey === '2'" label="节点名称" prop="nodeName">
  341. <template #default="{ row }">
  342. <el-form ref="copyNodeTableRef" :model="row" :rules="copyNodeTableRules" label-width="0" size="large">
  343. <el-form-item prop="nodeName" style="margin-bottom: 0;">
  344. <el-input v-model="row.nodeName" placeholder="请输入节点名称" />
  345. </el-form-item>
  346. </el-form>
  347. </template>
  348. </el-table-column>
  349. <el-table-column v-if="copyNodeTabKey === '2'" label="划分编号" prop="partitionCode">
  350. <template #default="{ row }">
  351. <el-form ref="copyNodeTableRef" :model="row" :rules="copyNodeTableRules" label-width="0" size="large">
  352. <el-form-item prop="partitionCode" style="margin-bottom: 0;">
  353. <el-input v-model="row.partitionCode" placeholder="请输入划分编号" />
  354. </el-form-item>
  355. </el-form>
  356. </template>
  357. </el-table-column>
  358. <el-table-column align="center" label="操作" prop="action" width="120">
  359. <template #default="{ _, $index }">
  360. <el-button plain type="danger" @click="copyNodeTableDel($index)">删除</el-button>
  361. </template>
  362. </el-table-column>
  363. </el-table>
  364. </el-scrollbar>
  365. </div>
  366. </div>
  367. <template #footer>
  368. <div class="lr-dialog-footer">
  369. <div class="left">
  370. <template v-for="(item, index) in copyNodeTab" :key="index">
  371. <el-button v-if="item?.key === copyNodeTabKey" plain size="large" type="primary" @click="copyNodeTabChange(item?.key)">{{ item.name }}</el-button>
  372. <el-button v-else bg size="large" text @click="copyNodeTabChange(item?.key)">{{ item.name }}</el-button>
  373. </template>
  374. </div>
  375. <div class="right">
  376. <el-button :disabled="copyNodeLoading" size="large" @click="copyNodeModal = false">取消</el-button>
  377. <el-button :loading="copyNodeLoading" hc-btn type="primary" @click="copyNodeClick">提交</el-button>
  378. </div>
  379. </div>
  380. </template>
  381. </hc-new-dialog>
  382. <!-- 新增子节点 -->
  383. <hc-new-dialog v-model="addNodeModal" :loading="addNodeLoading" loading-text="新增节点中,请耐心等待..." title="新增子节点" widths="720px" is-table>
  384. <el-alert :closable="false" title="双击节点,可编辑节点名称,编辑完成后,请按回车或输入框消失后,再点提交" type="warning" />
  385. <HcTreeNode
  386. v-if="addTreeNodeType === '1'"
  387. :node-id="addTreeNodeId"
  388. :old-id="addTreeNodeOldId"
  389. :contract-id="contractId"
  390. :wbs-id="projectInfo.referenceWbsTemplateId"
  391. :project-id="projectId"
  392. :is-custom="isCustom"
  393. @check-change="addTreeNodeCheckChange"
  394. />
  395. <HcTreeNode
  396. v-if="addTreeNodeType === '2'"
  397. :node-id="addTreeNodeId"
  398. :old-id="addTreeNodeOldId"
  399. :contract-id="contractId"
  400. :wbs-id="projectInfo.referenceWbsTemplateId"
  401. :project-id="projectId"
  402. strictly :is-custom="isCustom"
  403. @check-change="addTreeNodeCheckChange"
  404. />
  405. <template #footer>
  406. <div class="lr-dialog-footer">
  407. <div class="left flex items-center">
  408. <div class="mr-4">选中方式:</div>
  409. <el-radio-group v-model="addTreeNodeType">
  410. <el-radio label="1">当前及子节点</el-radio>
  411. <el-radio class="ml-4" label="2">仅当前节点</el-radio>
  412. </el-radio-group>
  413. </div>
  414. <div class="right">
  415. <el-button size="large" @click="addNodeModal = false">取消</el-button>
  416. <el-button :loading="addNodeLoading" hc-btn type="primary" @click="addNodeClick">提交</el-button>
  417. </div>
  418. </div>
  419. </template>
  420. </hc-new-dialog>
  421. <!-- 新增自定义节点 -->
  422. <hc-new-dialog v-model="addNodeModalCus" :loading="addNodeLoadingCus" loading-text="新增节点中,请耐心等待..." title="新增自定义节点(水利工程)" widths="720px" @save="addNodeClickCur">
  423. <div>节点名称:</div>
  424. <el-input v-model="nodeNameinput" placeholder="请输入节点名称" size="large" style="margin-top: 15px;" />
  425. </hc-new-dialog>
  426. <!-- 调整排序 -->
  427. <hc-new-dialog v-model="sortNodeModal" :loading="sortNodeLoading" title="调整排序" widths="700px" @save="sortNodeClick">
  428. <el-alert :closable="false" title="可拖动排序,也可在后面点击图标,切换排序" type="warning" />
  429. <div class="sort-node-body-box list-group header">
  430. <div class="list-group-item">
  431. <div class="index-box">序号</div>
  432. <div class="title-box">节点名称</div>
  433. <div class="icon-box">排序</div>
  434. </div>
  435. </div>
  436. <Draggable :list="sortNodeData" class="sort-node-body-box list-group" ghost-class="ghost" item-key="id" @end="sortNodeDrag = false" @start="sortNodeDrag = true">
  437. <template #item="{ element, index }">
  438. <div class="list-group-item">
  439. <div class="index-box">{{ index + 1 }}</div>
  440. <div class="title-box">{{ element.title }}</div>
  441. <div class="icon-box">
  442. <span class="icon" @click="downSortClick(index)">
  443. <HcIcon name="arrow-down" ui="text-lg" />
  444. </span>
  445. <span class="icon" @click="upSortClick(index)">
  446. <HcIcon name="arrow-up" ui="text-lg" />
  447. </span>
  448. </div>
  449. </div>
  450. </template>
  451. </Draggable>
  452. </hc-new-dialog>
  453. <!-- 批量上报审批 -->
  454. <hc-report-modal
  455. :addition="reportAddition"
  456. :contract-id="contractInfo?.contractType == 2 ? nodeDataInfo?.contractIdRelation : contractId"
  457. :ids="reportIds"
  458. :table-owner="authBtnTabKey"
  459. :classify-type="classType"
  460. :project-id="projectId"
  461. :show="showReportModal"
  462. :task-name="reportTaskName"
  463. :type-data="reportTypeData"
  464. title="批量上报审批" type="wbs" url="informationWriteQuery/taskOne"
  465. @finish="showReportFinish" @hide="showReportModal = false"
  466. />
  467. <!-- 查看附件 -->
  468. <hc-new-dialog v-model="attachmentModal" :footer="false" is-table title="附件列表" widths="780px">
  469. <div v-if="attachmentList.length > 0" v-loading="attachmentListLoaing">
  470. <div v-for="item in attachmentList " :key="item.id" class="hc-attachment-card">
  471. <div class="hc-attachment-header">{{ item?.nodeName }}</div>
  472. <div class="hc-attachment-content">
  473. <div v-for="item1 in item.fileList " :key="item1.id" class="hc-attachment-item">
  474. <div class="hc-attachment-file-name">
  475. <HcIcon name="attachment" />
  476. <div class="name">{{ item1?.name }}</div>
  477. </div>
  478. <div class="hc-attachment-btn-box">
  479. <el-button plain size="small" type="primary" @click="previewFile(item1)">
  480. <HcIcon name="eye" />
  481. <span>预览</span>
  482. </el-button>
  483. <el-button v-if="NodeStatus != 3" plain size="small" style="margin-left: 16px" type="danger" :loading="item1?.loading" @click="delFile(item1)">
  484. <HcIcon name="close" />
  485. <span>删除</span>
  486. </el-button>
  487. </div>
  488. </div>
  489. </div>
  490. </div>
  491. </div>
  492. <div v-else style="height: 100%;width: 100%;">
  493. <hc-no-data />
  494. </div>
  495. </hc-new-dialog>
  496. <!-- 上传文件 -->
  497. <hc-new-dialog v-model="uploadModal" :footer="false" title="上传文件" widths="38rem" @close="uploadModalClose">
  498. <div class="mb-4">
  499. <span style="color: red;">*</span> 选择附件类型:
  500. <el-select
  501. v-model="typevalue"
  502. placeholder="请选择"
  503. style="width: 240px"
  504. clearable
  505. @change="changeType"
  506. >
  507. <el-option
  508. v-for="item in typeoptions"
  509. :key="item.value"
  510. :label="item.label"
  511. :value="item.value"
  512. />
  513. </el-select>
  514. </div>
  515. <HcUpload
  516. :datas="uploadData" :file-list="fileListData" :is-canupload="false" action="/api/blade-manager/exceltab/add-bussfile-node" accept="application/pdf" accept-tip="允许格式:pdf"
  517. :auto-upload="false"
  518. :typevalue="typevalue"
  519. @change="uploadChange"
  520. @close="uploadModalClose"
  521. />
  522. </hc-new-dialog>
  523. <!-- 表单排序 -->
  524. <hc-new-dialog v-model="sortFormShow" is-table title="排序" widths="800px" is-footer-center @close="sortFormClose">
  525. <hc-table
  526. ref="tableSortFormRef"
  527. :column="tableSortFormColumn" :datas="tableSortFormData"
  528. is-row-drop is-sort quick-sort
  529. @row-drop="sortFormDropTap" @row-sort="rowSortFormTap"
  530. />
  531. <template #footer>
  532. <el-button hc-btn @click="sortFormClose">取消</el-button>
  533. <el-button hc-btn type="primary" :loading="sortFormLoading" @click="sortFormSubmit">提交</el-button>
  534. </template>
  535. </hc-new-dialog>
  536. </div>
  537. </template>
  538. <script setup>
  539. import { nextTick, onMounted, ref, watch } from 'vue'
  540. import { useRoute, useRouter } from 'vue-router'
  541. import { useAppStore } from '~src/store'
  542. import { HcIsButton } from '~src/plugins/IsButtons'
  543. import CollapseForm from './collapse-form/index.vue'
  544. import NodeTree from './components/nodeTree/index.vue'
  545. import HcTreeNode from './components/HcTreeNode.vue'
  546. import { HcUploadFileApi } from 'hc-vue3-ui'
  547. import { getStoreValue, setStoreValue } from '~src/utils/storage'
  548. import {
  549. arrToKey,
  550. deepClone,
  551. formValidate,
  552. getArrValue,
  553. getObjVal,
  554. getObjValue,
  555. isArrIndex,
  556. isNullES,
  557. isString,
  558. setCopyText,
  559. } from 'js-fast-way'
  560. import { eVisaTaskCheckApi, getDictionary, getDictionaryBiz, userConfigSave } from '~api/other'
  561. import wbsApi from '~api/data-fill/wbs'
  562. import queryApi from '~api/data-fill/query'
  563. import Draggable from 'vuedraggable'
  564. import { HcDelMsg, useClick } from 'hc-vue3-ui'
  565. import HcUpload from './components/HcUpload.vue'
  566. import { toPdfPage } from '~uti/btn-auth'
  567. //初始变量
  568. const router = useRouter()
  569. const useRoutes = useRoute()
  570. const useAppState = useAppStore()
  571. //全局变量
  572. const projectId = ref(useAppState.projectId)
  573. const contractId = ref(useAppState.contractId)
  574. const projectInfo = ref(useAppState.projectInfo)
  575. const contractInfo = ref(useAppState.contractInfo)
  576. const isCollapse = ref(useAppState.getCollapse)
  577. const userInfo = ref(useAppState.getUserInfo)
  578. const leftWidth = ref(440)
  579. //路由参数
  580. const routerQuery = useRoutes?.query
  581. // const typeName = routerQuery?.type || 'map'
  582. const typeName = routerQuery?.type || 'tree'
  583. //是否是抽屉
  584. const isDrawType = ref(true)
  585. //自动展开缓存
  586. const TreeAutoExpandKeys = ref(getStoreValue('wbsTreeExpandKeys') || [])
  587. //树搜索
  588. const isSearchTree = ref(false)
  589. const wbstreeKey = ref(Math.random())
  590. const searchElTreeLoadNode = ref(true)
  591. const searchTreeHeight = ref()
  592. const getSearchTreeData = async () => {
  593. treeLoading.value = true
  594. const { error, code, data } = await queryApi.getTreeNodeByQueryValueAndContractId({
  595. contractId: contractId.value,
  596. queryValue: searchTreeVal.value,
  597. tableOwner:authBtnTabKey.value,
  598. })
  599. //判断状态
  600. if (!error && code === 200) {
  601. let treedata = getArrValue(data)
  602. searchTreeData.value = treedata
  603. treeLoading.value = false
  604. } else {
  605. treeLoading.value = false
  606. searchTreeData.value = []
  607. }
  608. }
  609. //监听
  610. const searchTreeVal = ref('')
  611. watch(() => [
  612. useAppState.getCollapse, searchTreeVal.value,
  613. ], ([Collapse, search]) => {
  614. isCollapse.value = Collapse
  615. if (search.length == 0) {
  616. isSearchTree.value = false
  617. }
  618. })
  619. //加载树需要的classType
  620. const classType = ref('')
  621. watch(() => [
  622. classType.value,
  623. ], ([classify]) => {
  624. if (classify) {
  625. //重新加载左边树
  626. isShowLeft.value = false
  627. setTimeout(()=>{
  628. isShowLeft.value = true
  629. }, 500)
  630. }
  631. })
  632. //渲染完成
  633. onMounted(() => {
  634. console.log(projectInfo.value)
  635. treeLoading.value = typeName === 'tree'
  636. const treeWidth = useAppState.getTreeWidth
  637. leftWidth.value = (isNullES(treeWidth) || treeWidth <= 0 ) ? 440 : treeWidth
  638. setContractType(contractInfo.value?.contractType)
  639. getDictionaryApi()
  640. })
  641. //身份按钮切换数据
  642. const authBtnTabKey = ref('1')
  643. //变量
  644. const wbstree = ref(null)
  645. const isShowLeft = ref(true)
  646. const authBtnTabClick = (val) => {
  647. if (!primaryKeyId.value) {
  648. window?.$message?.warning('请先在左侧项目树选择一个节点')
  649. } else if (val['key'] !== authBtnTabKey.value) {
  650. authBtnTabKey.value = val['key']
  651. //重新加载左边树
  652. isShowLeft.value = false
  653. setTimeout(()=>{
  654. isShowLeft.value = true
  655. }, 500)
  656. getTableDataAll()
  657. }
  658. }
  659. //contractType, 1施工,2监理
  660. const setContractType = (contractType) => {
  661. if (contractType <= 0) {
  662. authBtnTabKey.value = '1'
  663. classType.value = '1'
  664. } else if (contractType === 3) {
  665. authBtnTabKey.value = '1'
  666. classType.value = '1'
  667. } else {
  668. authBtnTabKey.value = contractType + ''
  669. classType.value = contractType + ''
  670. }
  671. setElTreeMenu(contractType)
  672. }
  673. const getTableDataAll = async (key) => {
  674. await searchNodeAllTable()
  675. await queryNodeStatus()
  676. // wbstree.value.resetNode().then((res)=>{
  677. // if(res){
  678. // searchNodeAllTable()
  679. // queryNodeStatus()
  680. // }
  681. // })
  682. //保存后自动展开到当前表单
  683. if (!isNullES(key)) {
  684. console.log(key)
  685. await nextTick(() => {
  686. ListItemRef.value?.setCollapseKey(key)
  687. })
  688. }
  689. }
  690. //结构类型tab数据和相关处理
  691. const wbsTypeTabKey = ref(typeName)
  692. const wbsTypeTab = ref([
  693. { key: 'map', name: '导图结构填报' },
  694. { key: 'tree', name: '树形结构填报' },
  695. ])
  696. const authBtnTabdata = ref([
  697. { key: '1', name: '施工质检' },
  698. { key: '2', name: '监理质检' },
  699. ])
  700. const wbsTypeTabChange = (item) => {
  701. wbsTypeTabKey.value = item?.key
  702. ListItemDatas.value = []
  703. isDrawer.value = false
  704. treeLoading.value = typeName === 'tree'
  705. setStoreValue('classifyType', classType.value)
  706. setStoreValue('tableOwner', authBtnTabKey.value)
  707. //路由跳转
  708. router.push({
  709. path: useRoutes.path,
  710. query: {
  711. type: item?.key,
  712. classifyType:classType.value,
  713. tableOwner:authBtnTabKey.value,
  714. },
  715. })
  716. getSearchTreeData()
  717. }
  718. //切换导图结构
  719. const wbsMapTypeTab = () => {
  720. wbsTypeTabChange({ key: 'map', name: '导图结构填报' })
  721. }
  722. //设置图纸数据
  723. const setUploadDrawingsData = async (echoParams, link) => {
  724. const info = nodeDataInfo.value
  725. const { error, code, data } = await wbsApi.saveContractTreeDrawings({
  726. fileUrl: link,
  727. id: echoParams['drawingsId'],
  728. primaryKeyId: echoParams['primaryKeyId'],
  729. }, false)
  730. //处理数据
  731. if (!error && code === 200) {
  732. if (info['primaryKeyId'] === echoParams['primaryKeyId']) {
  733. nodeDataInfo.value['drawingsId'] = data
  734. nodeDataInfo.value['fileUrl'] = link
  735. window?.$message?.success('图纸上传成功')
  736. } else {
  737. window?.$message?.success('图纸上传成功,由于您切换了其他节点,需要手动刷新才能查看到图纸')
  738. }
  739. } else {
  740. window?.$message?.error('图纸保存失败')
  741. }
  742. }
  743. const NodeTreeAccordion = ref(true)
  744. //设置树菜单数据
  745. const ElTreeMenu = ref([])
  746. const TreeMark = ref(false)
  747. const setElTreeMenu = (contractType) => {
  748. let newArr = []
  749. if (contractType === 1) {
  750. if (HcIsButton('wbs_tree_add')) {
  751. newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
  752. newArr.push( { icon: 'add-circle', label: '自定义节点(水利工程)', key: 'add1' })
  753. }
  754. if (HcIsButton('wbs_tree_edit')) {
  755. newArr.push({ icon: 'draft', label: '编辑节点', key: 'edit' })
  756. }
  757. if (HcIsButton('wbs_tree_copy')) {
  758. newArr.push({ icon: 'file-copy-2', label: '复制节点', key: 'copy' })
  759. }
  760. if (HcIsButton('wbs_tree_mark')) {
  761. newArr.push({ icon: 'star', label: '标记为首件', key: 'mark' })
  762. TreeMark.value = true
  763. }
  764. if (HcIsButton('wbs_tree_upload')) {
  765. newArr.push({ icon: 'file-upload', label: '上传图纸', key: 'upload' })
  766. }
  767. if (HcIsButton('wbs_tree_sort')) {
  768. newArr.push({ icon: 'sort-asc', label: '调整排序', key: 'sort' })
  769. }
  770. if (HcIsButton('wbs_tree_del')) {
  771. newArr.push({ icon: 'delete-bin', label: '删除节点', key: 'del' })
  772. }
  773. if (HcIsButton('wbs_views_division_btn')) {
  774. newArr.push({ icon: 'folder-shared', label: '工程划分', key: 'nodetree' })
  775. }
  776. } else if (contractType === 2) {
  777. if (HcIsButton('wbs_tree_add')) {
  778. newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
  779. newArr.push( { icon: 'add-circle', label: '自定义节点(水利工程)', key: 'add1' })
  780. }
  781. if (HcIsButton('wbs_tree_copy')) {
  782. newArr.push({ icon: 'file-copy-2', label: '复制节点', key: 'copy' })
  783. }
  784. }
  785. ElTreeMenu.value = newArr
  786. }
  787. //树相关变量
  788. const primaryKeyId = ref('')
  789. const nodeItemInfo = ref({})
  790. const nodeDataInfo = ref({})
  791. const searchTreeData = ref([])
  792. //回车
  793. const searchTreeKeyUp = (e) => {
  794. if (e.key === 'Enter') {
  795. searchTreeClick()
  796. }
  797. }
  798. const treeLoading = ref(true)
  799. const searchTreeClick = async () => {
  800. if (searchTreeVal.value) {
  801. searchTreeHeight.value = document.getElementById('hc-tree-scrollbar').offsetHeight
  802. isSearchTree.value = true
  803. //treeLoading.value = true
  804. getSearchTreeData()
  805. } else {
  806. isSearchTree.value = false
  807. }
  808. }
  809. //懒加载的数据
  810. const treeLoadNode = async ({ node, item, level }, resolve) => {
  811. let contractIdRelation = '', parentId = '', primaryKeyId = ''
  812. if (level !== 0) {
  813. const nodeData = getObjValue(item)
  814. contractIdRelation = nodeData?.contractIdRelation || ''
  815. parentId = contractIdRelation ? nodeData?.primaryKeyId : nodeData?.id
  816. primaryKeyId = nodeData?.id || ''
  817. }
  818. //获取数据
  819. const { data } = await queryApi.queryWbsTreeData({
  820. contractId: contractId.value || '',
  821. contractIdRelation,
  822. primaryKeyId,
  823. parentId,
  824. // classifyType: authBtnTabKey.value,
  825. classifyType: classType.value,
  826. tableOwner:authBtnTabKey.value,
  827. })
  828. treeLoading.value = false
  829. resolve(getArrValue(data))
  830. }
  831. //树被点击
  832. const wbsElTreeClick = ({ node, data, keys }) => {
  833. nodeItemInfo.value = node
  834. nodeDataInfo.value = data
  835. primaryKeyId.value = data?.primaryKeyId || ''
  836. const { notExsitChild } = data
  837. const { hasChildren } = data
  838. if (notExsitChild || !hasChildren) {
  839. isCanadd.value = false
  840. getTableDataAll()
  841. } else {
  842. isCanadd.value = true
  843. ListItemDatas.value = []
  844. NodeStatus.value = '1'
  845. }
  846. setStoreValue('wbsTreeExpandKeys', keys)
  847. TreeAutoExpandKeys.value = keys || []
  848. saveHistory(keys.join(','))
  849. // getTableDataAll()
  850. }
  851. //树加载完成
  852. const ElTreeNodeLoading = () => {
  853. treeLoading.value = false
  854. }
  855. //保存用户填报历史
  856. const saveHistory = async (endNode)=>{
  857. await wbsApi.saveUserHistory({
  858. contractId: contractId.value,
  859. projectId: projectId.value,
  860. endNode,
  861. })
  862. }
  863. //回到上次填报历史
  864. const gobackHistory = async ()=>{
  865. isSearchTree.value = false
  866. const { error, code, data, msg } = await wbsApi.getUserHistory({
  867. contractId: contractId.value,
  868. projectId: projectId.value,
  869. })
  870. if (!error && code === 200) {
  871. TreeAutoExpandKeys.value = data['endNode'].split(',') || []
  872. //重新加载左边树
  873. isShowLeft.value = false
  874. setTimeout(()=>{
  875. isShowLeft.value = true
  876. }, 500)
  877. } else {
  878. window.$message.warning(msg)
  879. }
  880. }
  881. //树菜单被点击
  882. const ElTreeMenuClick = async ({ key, node, data, keys }) => {
  883. nodeItemInfo.value = node
  884. nodeDataInfo.value = data
  885. setStoreValue('wbsTreeExpandKeys', keys)
  886. TreeAutoExpandKeys.value = keys || []
  887. setTreeMenuDataClick({ key, node, data })
  888. }
  889. const treeMenuClick = (data)=>{
  890. console.log(data, 'data1')
  891. }
  892. //导图结构数据
  893. const NodeTreeRef = ref(null)
  894. //鼠标左键单击事件
  895. const NodeTreeClick = ({ keys }) => {
  896. setStoreValue('wbsTreeExpandKeys', keys)
  897. TreeAutoExpandKeys.value = keys || []
  898. }
  899. //双击事件
  900. const isDrawer = ref(false)
  901. const NodeTreeDblClick = ({ node, data }) => {
  902. nodeItemInfo.value = node
  903. nodeDataInfo.value = data
  904. primaryKeyId.value = data?.primaryKeyId || ''
  905. isDrawer.value = true
  906. getTableDataAll()
  907. }
  908. const drawerClose = () => {
  909. isDrawer.value = false
  910. ListItemDatas.value = []
  911. }
  912. //导图树菜单被点击
  913. const NodeTreeMenuClick = async ({ key, node, data }) => {
  914. nodeItemInfo.value = node
  915. nodeDataInfo.value = data
  916. setTreeMenuDataClick({ key, node, data })
  917. }
  918. //处理菜单被点击数据
  919. const setTreeMenuDataClick = ({ key, node, data }) => {
  920. const tabKey = wbsTypeTabKey.value
  921. if (key === 'mark' || key === 'cancel_mark') {
  922. firstItemBox()
  923. } else if (key === 'edit') {
  924. console.log(data, 'data')
  925. let form = {}
  926. if (tabKey === 'tree') {
  927. const parent = deepClone(node?.parent?.data || {})
  928. form = { ...deepClone(data), parent: parent }
  929. } else if (tabKey === 'map') {
  930. const parent = deepClone(node?.parentNodes?.data || {})
  931. form = { ...deepClone(data), parent: parent }
  932. }
  933. formEditNodeModel.value = form
  934. editNodeModal.value = true
  935. //处理路径
  936. let pathArr = []
  937. getPathName(node, pathArr)
  938. form.position = pathArr.join('\\')
  939. formEditNodeModel.value = form
  940. } else if (key === 'copy') {
  941. if (tabKey === 'tree') {
  942. const parent = deepClone(node?.parent?.data || {})
  943. formCopyNodeModel.value = { ...deepClone(data), parent: parent }
  944. } else if (tabKey === 'map') {
  945. const parent = deepClone(node?.parentNodes?.data || {})
  946. formCopyNodeModel.value = { ...deepClone(data), parent: parent }
  947. }
  948. classifyType.value = authBtnTabKey.value
  949. copyNodeTabKey.value = '1'
  950. copyNodeTable.value = []
  951. copyNodeLoading.value = false
  952. copyNodeModal.value = true
  953. } else if (key === 'add') {
  954. const { childNodes } = node
  955. console.log(childNodes, 'childNodes')
  956. isCustom.value = data?.isCustom
  957. addTreeNodeId.value = data?.primaryKeyId
  958. addTreeNodeOldId.value = data?.oldId
  959. addNodeLoading.value = false
  960. addNodeModal.value = true
  961. } else if (key === 'add1') {
  962. addTreeNodeId.value = data?.primaryKeyId
  963. addTreeNodeOldId.value = data?.oldId
  964. addNodeLoading.value = false
  965. nodeNameinput.value = ''
  966. addNodeModalCus.value = true
  967. } else if (key === 'upload') {
  968. const info = nodeDataInfo.value
  969. HcUploadFileApi({
  970. url: '/api/blade-resource/oss/endpoint/put-file',
  971. accept: '.png,.jpg,jpeg',
  972. accept_tip: '图片(png、jpg、jpeg)',
  973. size: 80,
  974. multiple: false,
  975. echoParams: {
  976. drawingsId: info['drawingsId'],
  977. primaryKeyId: info['primaryKeyId'],
  978. },
  979. success: ({ echoParams }, { data }) => {
  980. setUploadDrawingsData(echoParams.sourceKey, data?.link)
  981. },
  982. error: () => {
  983. window.$message.error('上传失败')
  984. },
  985. })
  986. } else if (key === 'del') {
  987. console.log(data, 'data')
  988. if (data['colorStatus'] === 1 || data['colorStatus'] === 2 || data['colorStatus'] === null || data['colorStatus'] === -1) {
  989. delModalClick()
  990. } else {
  991. window?.$message?.warning('该节点已存在上报数据,不允许删除')
  992. }
  993. } else if (key === 'sort') {
  994. let nodes = [], childNodes = []
  995. if (tabKey === 'tree') {
  996. childNodes = node?.parent?.childNodes || node?.parent?.children || []
  997. } else if (tabKey === 'map') {
  998. childNodes = node?.parentNodes?.childrenNodes || []
  999. }
  1000. for (let i = 0; i < childNodes.length; i++) {
  1001. const res = childNodes[i]?.data
  1002. nodes.push({
  1003. id: res?.primaryKeyId,
  1004. title: res?.title,
  1005. })
  1006. }
  1007. sortNodeData.value = nodes
  1008. sortNodeModal.value = true
  1009. } else if (key === 'nodetree') {
  1010. divisionClick()
  1011. }
  1012. }
  1013. //获取节点的路径名字
  1014. const getPathName = (node, pathArr) => {
  1015. if (node.parent?.parent) {
  1016. pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, '')) //去掉头尾空格
  1017. getPathName(node.parent, pathArr)
  1018. } else {
  1019. //根节点结束
  1020. pathArr.unshift(node.data?.title.replace(/(^\s*)|(\s*$)/g, '')) //去掉头尾空格
  1021. return pathArr
  1022. }
  1023. }
  1024. //确认标记为首件
  1025. const firstItemBox = () => {
  1026. const info = nodeDataInfo.value
  1027. window?.$messageBox?.alert(`<div class="text-base font-bold">
  1028. <span>请确认将</span>
  1029. <span class="text-main">【${info['title']}】</span>
  1030. <span>${info['isFirst'] ? '取消' : ''}标记为首件</span>
  1031. </div>`, '标记首件制', {
  1032. showCancelButton: true,
  1033. dangerouslyUseHTMLString: true,
  1034. callback: (action) => {
  1035. if (action === 'confirm') {
  1036. firstItemHttp(info)
  1037. }
  1038. },
  1039. })
  1040. }
  1041. //首件请求
  1042. const firstItemHttp = async (info) => {
  1043. const { error, code, msg } = await wbsApi.wbsTreeFirstSave({
  1044. primaryKeyId: info['primaryKeyId'],
  1045. saveOrDeleted: info['isFirst'] ? 1 : 0,
  1046. })
  1047. //处理数据
  1048. if (!error && code === 200) {
  1049. window?.$message?.success('操作成功')
  1050. window?.location?.reload() //刷新页面
  1051. } else {
  1052. window?.$message?.error(msg)
  1053. }
  1054. }
  1055. //编辑节点
  1056. const editNodeModal = ref(false)
  1057. //获取节点类型
  1058. const nodeTypeData = ref([])
  1059. const getDictionaryApi = async () => {
  1060. const { data } = await getDictionary({
  1061. code: 'wbs_node_type',
  1062. })
  1063. //处理数据
  1064. let newArr = []
  1065. const newData = getArrValue(data)
  1066. for (let i = 0; i < newData.length; i++) {
  1067. newArr.push({
  1068. label: newData[i]['dictValue'],
  1069. value: Number(newData[i]['dictKey']),
  1070. })
  1071. }
  1072. nodeTypeData.value = newArr
  1073. }
  1074. const formEditNodeRef = ref(null)
  1075. const formEditNodeModel = ref({
  1076. title: '',
  1077. parent: {
  1078. title: '',
  1079. },
  1080. nodeType: null,
  1081. partitionCode: '',
  1082. position: '',
  1083. })
  1084. const formEditNodeRules = {
  1085. title: {
  1086. required: true,
  1087. trigger: 'blur',
  1088. message: '请输入节点名称',
  1089. },
  1090. }
  1091. const editNodeLoading = ref(false)
  1092. //保存编辑节点数据
  1093. const editNodeClick = async () => {
  1094. const validate = await formValidate(formEditNodeRef.value)
  1095. if (validate) {
  1096. //发起请求
  1097. editNodeLoading.value = true
  1098. const { primaryKeyId, title, partitionCode } = formEditNodeModel.value
  1099. const { error, code, msg } = await wbsApi.wbsTreeUpdateNode({
  1100. nodeName: title || '',
  1101. pKeyId: primaryKeyId || '',
  1102. partitionCode: partitionCode || '',
  1103. })
  1104. //处理数据
  1105. editNodeLoading.value = false
  1106. if (!error && code === 200) {
  1107. window?.$message?.success('修改成功')
  1108. nodeDataInfo.value['title'] = title || ''
  1109. nodeDataInfo.value['partitionCode'] = partitionCode || ''
  1110. editNodeModal.value = false
  1111. window?.location?.reload() //刷新页面
  1112. } else {
  1113. window?.$message?.error(msg)
  1114. }
  1115. }
  1116. }
  1117. //复制节点
  1118. const copyNodeModal = ref(false)
  1119. //复制节点类型tab数据和相关处理
  1120. const copyNodeTabKey = ref('')
  1121. const copyNodeTab = ref([
  1122. { key: '1', name: '单份复制' },
  1123. { key: '2', name: '多份复制' },
  1124. //{key: '3', name: '复制数据'}
  1125. ])
  1126. const copyNodeTabChange = (key) => {
  1127. if (key !== copyNodeTabKey.value) {
  1128. copyNodeTabKey.value = key
  1129. copyNodeTable.value = []
  1130. copyNodeLoading.value = false
  1131. }
  1132. }
  1133. //复制节点变量
  1134. const copyNodeLoading = ref(false)
  1135. const formCopyNodeModel = ref({})
  1136. const classifyList = ref([])
  1137. const copyNodeTable = ref([])
  1138. const isCopyData = ref(0)
  1139. //复制树被点击
  1140. const copyNodeElTreeClick = ({ data, node }) => {
  1141. const TabKey = copyNodeTabKey.value
  1142. const { title, type, partitionCode } = formCopyNodeModel.value
  1143. if (TabKey === '2') {
  1144. // setCopyNodeTable(data, title, partitionCode)
  1145. //1 单位工程,2 分部工程,3 子分部工程,4 分项工程, 5 子分项工程,6 工序
  1146. // //不能复制到本身节点下
  1147. // //只能往上一级点击,不能跨层级点击
  1148. // //已上报的工序节点不能点击选择
  1149. // //如果选择的是父级节点,那不能复制到子级节点
  1150. const { hasChildren } = data
  1151. if (hasChildren === 0) {
  1152. if (data['colorStatus'] === 2 || data['colorStatus'] == 1 || data['colorStatus'] === null || data['colorStatus'] === -1) {//已上报的工序不能点击
  1153. if (data['id'] !== formCopyNodeModel.value.id) {//不能复制到本身节点下
  1154. //只能往上一级点击,不能跨层级点击
  1155. //如果选择的是父级节点,那不能复制到子级节点
  1156. if (type === 6 && (data['type'] === 4 || data['type'] === 5 || data['type'] == 6)) {
  1157. setCopyNodeTable(data, title)
  1158. }
  1159. if (type === 5 && data['type'] === 4) {
  1160. setCopyNodeTable(data, title, partitionCode)
  1161. }
  1162. if (type === 4 && (data['type'] === 2 || data['type'] === 3)) {
  1163. setCopyNodeTable(data, title, partitionCode)
  1164. }
  1165. if (type === 3 && data['type'] === 2) {
  1166. setCopyNodeTable(data, title, partitionCode)
  1167. }
  1168. if (type === 2 && data['type'] === 1) {
  1169. setCopyNodeTable(data, title, partitionCode)
  1170. }
  1171. if (type === 1 && data['type'] === 1) {
  1172. setCopyNodeTable(data, title, partitionCode)
  1173. }
  1174. }
  1175. } else {
  1176. window?.$message?.warning('该节点已存在上报数据,不允许复制')
  1177. }
  1178. } else {
  1179. if (data['id'] !== formCopyNodeModel.value.id) {//不能复制到本身节点下
  1180. //只能往上一级点击,不能跨层级点击
  1181. //如果选择的是父级节点,那不能复制到子级节点
  1182. if (type === 6 && (data['type'] === 4 || data['type'] === 5 || data['type'] == 6)) {
  1183. setCopyNodeTable(data, title)
  1184. }
  1185. if (type === 5 && data['type'] === 4) {
  1186. setCopyNodeTable(data, title, partitionCode)
  1187. }
  1188. if (type === 4 && (data['type'] === 2 || data['type'] === 3)) {
  1189. setCopyNodeTable(data, title, partitionCode)
  1190. }
  1191. if (type === 3 && data['type'] === 2) {
  1192. setCopyNodeTable(data, title, partitionCode)
  1193. }
  1194. if (type === 2 && data['type'] === 1) {
  1195. setCopyNodeTable(data, title, partitionCode)
  1196. }
  1197. if (type === 1 && data['type'] === 1) {
  1198. setCopyNodeTable(data, title, partitionCode)
  1199. }
  1200. }
  1201. }
  1202. } else if (TabKey === '3') {
  1203. console.log(1111111)
  1204. setCopyNodeTable(data, data?.title)
  1205. }
  1206. }
  1207. const setCopyNodeTable = (data, title) => {
  1208. copyNodeTable.value.push({
  1209. title: data?.title || '',
  1210. nodeName: title || '',
  1211. primaryKeyId: data?.primaryKeyId || '',
  1212. parentId: data?.parentId || '',
  1213. id: data?.id || '',
  1214. })
  1215. }
  1216. //节点表单
  1217. const formCopyNodeModelRef = ref(null)
  1218. const formCopyNodeModelRules = {
  1219. title: {
  1220. required: true,
  1221. trigger: 'blur',
  1222. message: '请输入节点名称',
  1223. },
  1224. }
  1225. //表格节点表单
  1226. const copyNodeTableRef = ref(null)
  1227. const copyNodeTableRules = {
  1228. nodeName: {
  1229. required: true,
  1230. trigger: 'blur',
  1231. message: '请输入节点名称',
  1232. },
  1233. }
  1234. //删除选中的节点
  1235. const copyNodeTableDel = (index) => {
  1236. copyNodeTable.value.splice(index, 1)
  1237. }
  1238. const classifyType = ref(authBtnTabKey.value)
  1239. const classifyTypeTabClick = ({ key }) => {
  1240. classifyType.value = key
  1241. }
  1242. //复制节点
  1243. const copyNodeClick = async () => {
  1244. const type = copyNodeTabKey.value
  1245. const form = formCopyNodeModel.value
  1246. const table = copyNodeTable.value
  1247. let classify = ''
  1248. let arr = []
  1249. if (classifyList.value.length > 0) {
  1250. classifyList.value.forEach((item) => {
  1251. if (item === '施工') {
  1252. arr.push(1)
  1253. } else if (item === '监理') {
  1254. arr.push(2)
  1255. }
  1256. })
  1257. classify = arr.join(',')
  1258. }
  1259. //isSameNode 是否同节点 1=同节点,0=跨节点
  1260. if (table.length > 0) {
  1261. table.forEach((ele) => {
  1262. if (ele.parentId === formCopyNodeModel.value.parentId || ele.id === formCopyNodeModel.value.parentId) {
  1263. ele.isSameNode = 1
  1264. } else {
  1265. ele.isSameNode = 0
  1266. }
  1267. })
  1268. }
  1269. if (isCopyData.value === 1) {
  1270. if (classify) {
  1271. //效验数据
  1272. if (type === '1') {
  1273. const validate = await formValidate(formCopyNodeModelRef.value)
  1274. if (validate) await copyContractTreeNode(type, form, [], classify)
  1275. } else if (type === '2') {
  1276. if (table.length > 0) {
  1277. const validate = await formValidate(copyNodeTableRef.value)
  1278. if (validate) await copyContractTreeNode(type, form, table, classify)
  1279. } else {
  1280. window?.$message?.warning('请先在左侧选择要复制到的节点')
  1281. }
  1282. }
  1283. } else {
  1284. window?.$message?.warning('请选择所属方')
  1285. }
  1286. } else {
  1287. if (type === '1') {
  1288. const validate = await formValidate(formCopyNodeModelRef.value)
  1289. if (validate) await copyContractTreeNode(type, form, [], classify)
  1290. } else if (type === '2') {
  1291. if (table.length > 0) {
  1292. const validate = await formValidate(copyNodeTableRef.value)
  1293. if (validate) await copyContractTreeNode(type, form, table, classify)
  1294. } else {
  1295. window?.$message?.warning('请先在左侧选择要复制到的节点')
  1296. }
  1297. }
  1298. }
  1299. }
  1300. //单个复制、多份复制请求
  1301. const copyContractTreeNode = async (type, form, table, classify) => {
  1302. copyNodeLoading.value = true
  1303. if (type === '1') {
  1304. const { error, code, msg } = await wbsApi.copyContractTreeNode({
  1305. copyType: type,
  1306. needCopyNodeName: form?.title || '',
  1307. partitionCode: form?.partitionCode || '',
  1308. needCopyPrimaryKeyId: form?.primaryKeyId || '',
  1309. parentPrimaryKeyId: form?.parent?.primaryKeyId || '',
  1310. copyBatchToPaths: table,
  1311. classifyType: classify,
  1312. isCopyData:isCopyData.value,
  1313. })
  1314. //判断状态
  1315. copyNodeLoading.value = false
  1316. if (!error && code === 200) {
  1317. window?.$message?.success('复制成功')
  1318. copyNodeModal.value = false
  1319. window?.location?.reload() //刷新页面
  1320. } else {
  1321. window?.$message?.error(msg)
  1322. }
  1323. } else {
  1324. const { error, code, msg } = await wbsApi.copyContractTreeNode({
  1325. copyType: type,
  1326. needCopyNodeName: form?.title || '',
  1327. needCopyPrimaryKeyId: form?.primaryKeyId || '',
  1328. parentPrimaryKeyId: form?.parent?.primaryKeyId || '',
  1329. copyBatchToPaths: table,
  1330. classifyType: classify,
  1331. isCopyData:isCopyData.value,
  1332. })
  1333. //判断状态
  1334. copyNodeLoading.value = false
  1335. if (!error && code === 200) {
  1336. window?.$message?.success('复制成功')
  1337. copyNodeModal.value = false
  1338. window?.location?.reload() //刷新页面
  1339. } else {
  1340. window?.$message?.error(msg)
  1341. }
  1342. }
  1343. }
  1344. //复制数据
  1345. const copyContractNodeSubmitBusinessData = async (form, table, classify) => {
  1346. copyNodeLoading.value = true
  1347. const { error, code } = await wbsApi.copyContractNodeSubmitBusinessData({
  1348. needCopyPrimaryKeyId: form?.primaryKeyId || '',
  1349. copyBatchToPaths: table,
  1350. classify: classify,
  1351. })
  1352. //判断状态
  1353. copyNodeLoading.value = false
  1354. if (!error && code === 200) {
  1355. window?.$message?.success('复制成功')
  1356. copyNodeModal.value = false
  1357. window?.location?.reload() //刷新页面
  1358. }
  1359. }
  1360. //新增节点
  1361. const addNodeModal = ref(false)
  1362. const addTreeNodeId = ref('')
  1363. const addTreeNodeOldId = ref('')
  1364. const addTreeNodeType = ref('1')
  1365. const isCustom = ref(null)
  1366. //新增自定义节点
  1367. const addNodeModalCus = ref(false)
  1368. const addNodeLoadingCus = ref(false)
  1369. const nodeNameinput = ref('')
  1370. //选中的节点
  1371. const allSelectedList = ref([])
  1372. const halfSelectedList = ref([])
  1373. const addTreeNodeCheckChange = (nodes) => {
  1374. let NodesArr = [], halfArr = []
  1375. //全选数据
  1376. const keys = nodes.checkedNodes || []
  1377. console.log(keys, 'keys')
  1378. for (let i = 0; i < keys.length; i++) {
  1379. NodesArr.push({
  1380. nodeName: keys[i].nodeName,
  1381. primaryKeyId: keys[i].pKeyId,
  1382. isPeer:keys[i].isPeer || 2,
  1383. })
  1384. }
  1385. allSelectedList.value = NodesArr
  1386. console.log( allSelectedList.value, ' allSelectedList.value')
  1387. //半选数据
  1388. const halfNodes = nodes.halfCheckedNodes || []
  1389. for (let i = 0; i < halfNodes.length; i++) {
  1390. halfArr.push({
  1391. nodeName: halfNodes[i].nodeName,
  1392. primaryKeyId: halfNodes[i].pKeyId,
  1393. isPeer:halfNodes[i].isPeer || 2,
  1394. })
  1395. }
  1396. halfSelectedList.value = halfArr
  1397. console.log( halfSelectedList.value, ' halfSelectedList.value')
  1398. }
  1399. //新增节点
  1400. const addNodeLoading = ref(false)
  1401. const addNodeClick = async () => {
  1402. const keys = allSelectedList.value || []
  1403. if (keys.length <= 0) {
  1404. window?.$message?.warning('请先选择节点')
  1405. } else {
  1406. //发起请求
  1407. addNodeLoading.value = true
  1408. const primaryKeyId = nodeDataInfo.value?.primaryKeyId || ''
  1409. const { error, code } = await wbsApi.saveContractTreeNode({
  1410. projectId: projectId.value,
  1411. contractId: contractId.value,
  1412. saveType: addTreeNodeType.value,
  1413. allSelectedList: allSelectedList.value,
  1414. halfSelectedList: halfSelectedList.value,
  1415. currentNodePrimaryKeyId: primaryKeyId,
  1416. })
  1417. //判断状态
  1418. addNodeLoading.value = false
  1419. if (!error && code === 200) {
  1420. window?.$message?.success('新增成功')
  1421. addNodeModal.value = false
  1422. window?.location?.reload() //刷新页面
  1423. }
  1424. }
  1425. }
  1426. const addNodeClickCur = async ()=>{
  1427. //发起请求
  1428. addNodeLoadingCus.value = true
  1429. const { error, code, msg } = await wbsApi.saveCustomAddContractNode({
  1430. nodeName: nodeNameinput.value,
  1431. nodeType: nodeDataInfo.value?.nodeType || '',
  1432. partitionCode: nodeDataInfo.value?.partitionCode || '',
  1433. primaryKeyId: nodeDataInfo.value?.primaryKeyId || '',
  1434. })
  1435. //判断状态
  1436. addNodeLoadingCus.value = false
  1437. if (!error && code === 200) {
  1438. window?.$message?.success('新增成功')
  1439. addNodeModalCus.value = false
  1440. window?.location?.reload() //刷新页面
  1441. } else {
  1442. window?.$message?.error(msg)
  1443. }
  1444. }
  1445. //删除节点
  1446. const delModalClick = () => {
  1447. HcDelMsg(async (resolve) => {
  1448. await removeContractTreeNode()
  1449. resolve() //关闭弹窗的回调
  1450. })
  1451. }
  1452. const removeContractTreeNode = async () => {
  1453. const loadingInstance = window.$loading.service({
  1454. fullscreen: true,
  1455. text: '删除节点中,请耐心等待...',
  1456. background: 'rgba(0, 0, 0, 0.7)',
  1457. })
  1458. const { error, code, msg } = await wbsApi.removeContractTreeNode({
  1459. ids: nodeDataInfo.value?.primaryKeyId || '',
  1460. })
  1461. //处理结果
  1462. loadingInstance.close()
  1463. if (!error && code === 200) {
  1464. window?.$message?.success('删除成功')
  1465. window?.location?.reload() //刷新页面
  1466. } else {
  1467. window.$message.error(msg)
  1468. }
  1469. }
  1470. //调整排序
  1471. const sortNodeModal = ref(false)
  1472. const sortNodeLoading = ref(false)
  1473. const sortNodeData = ref([])
  1474. const sortNodeDrag = ref(false)
  1475. //向下
  1476. const downSortClick = (index) => {
  1477. const indexs = index + 1
  1478. const data = sortNodeData.value || []
  1479. if (indexs !== data.length) {
  1480. const tmp = data.splice(indexs, 1)
  1481. sortNodeData.value.splice(index, 0, tmp[0])
  1482. } else {
  1483. window?.$message?.warning('已经处于置底,无法下移')
  1484. }
  1485. }
  1486. //向上
  1487. const upSortClick = (index) => {
  1488. const data = sortNodeData.value || []
  1489. if (index !== 0) {
  1490. const tmp = data.splice(index - 1, 1)
  1491. sortNodeData.value.splice(index, 0, tmp[0])
  1492. } else {
  1493. window?.$message?.warning('已经处于置顶,无法上移')
  1494. }
  1495. }
  1496. //确认排序
  1497. const sortNodeClick = async () => {
  1498. const sortList = []
  1499. const nodes = sortNodeData.value || []
  1500. nodes.forEach(item => {
  1501. sortList.push(item?.id)
  1502. })
  1503. //发起请求
  1504. sortNodeLoading.value = true
  1505. const { error, code, msg } = await wbsApi.diySortTreeNode({ sortList })
  1506. sortNodeLoading.value = false
  1507. //判断状态
  1508. if (!error && code === 200) {
  1509. window?.$message?.success('保存成功')
  1510. sortNodeModal.value = false
  1511. window?.location?.reload() //刷新页面
  1512. } else {
  1513. window.$message.error(msg)
  1514. }
  1515. }
  1516. //查看图纸
  1517. const drawList = ref('')
  1518. const drawingsShow = ref(false)
  1519. const viewsDrawings = () => {
  1520. const { primaryKeyId, drawingsId } = nodeDataInfo.value
  1521. if (!primaryKeyId) {
  1522. window?.$message?.warning('请先选择树节点')
  1523. } else if (drawingsId === -1 || drawingsId === null) {
  1524. window?.$message?.warning('该节点暂未上传图纸')
  1525. } else {
  1526. drawingsShow.value = true
  1527. getDrawList(drawingsId)
  1528. }
  1529. }
  1530. const drawingsClose = (res) => {
  1531. drawingsShow.value = res
  1532. }
  1533. const getDrawList = async (primaryKeyId)=>{
  1534. const { error, code, data } = await wbsApi.getTreeDrawings({ primaryKeyId })
  1535. //判断状态
  1536. if (!error && code === 200) {
  1537. drawList.value = data
  1538. } else {
  1539. drawList.value = data
  1540. }
  1541. }
  1542. //设置滚动条位置
  1543. const ListItemScrollRef = ref(null)
  1544. const ListItemOffsetTop = (offsetTop) => {
  1545. if (offsetTop > 0) {
  1546. setTimeout(() => {
  1547. ListItemScrollRef.value?.setScrollTop(offsetTop)
  1548. }, 350)
  1549. } else {
  1550. ListItemScrollRef.value?.setScrollTop(offsetTop)
  1551. }
  1552. }
  1553. //获取数据列表
  1554. const ListItemDatas = ref([])
  1555. const ListItemLoading = ref(false)
  1556. const searchNodeAllTable = async () => {
  1557. ListItemLoading.value = true
  1558. ListItemDatas.value = []
  1559. const info = nodeDataInfo.value
  1560. const { data } = await wbsApi.searchNodeAllTable({
  1561. projectId: projectId.value,
  1562. contractId: contractId.value,
  1563. primaryKeyId: info['primaryKeyId'],
  1564. type: authBtnTabKey.value,
  1565. })
  1566. ListItemDatas.value = getArrValue(data)
  1567. ListItemLoading.value = false
  1568. }
  1569. const newlistdata = ref([])
  1570. const searchNodeAllTable1 = async () => {
  1571. console.log('重新获取表单列表')
  1572. const info = nodeDataInfo.value
  1573. const { data } = await wbsApi.searchNodeAllTable({
  1574. projectId: projectId.value,
  1575. contractId: contractId.value,
  1576. primaryKeyId: info['primaryKeyId'],
  1577. type: authBtnTabKey.value,
  1578. })
  1579. newlistdata.value = getArrValue(data)
  1580. }
  1581. //查询状态
  1582. const NodeStatus = ref('1')
  1583. const queryNodeStatus = async () => {
  1584. const info = nodeDataInfo.value
  1585. if (contractInfo.value?.contractType == 1) {
  1586. const { error, code, data } = await wbsApi.queryNodeStatus({
  1587. primaryKeyId: info['primaryKeyId'],
  1588. //classify:1
  1589. classify: authBtnTabKey.value,
  1590. })
  1591. //1 未填报,2待上报,3已上报
  1592. if (!error && code === 200) {
  1593. NodeStatus.value = data ?? '1'
  1594. } else {
  1595. NodeStatus.value = '1'
  1596. }
  1597. } else {
  1598. const { error, code, data } = await wbsApi.queryNodeStatusJl({
  1599. // primaryKeyId: info['contractIdRelation'] ? info['id'] : info['primaryKeyId'],
  1600. primaryKeyId: info['primaryKeyId'],
  1601. //classify: 1
  1602. classify: authBtnTabKey.value,
  1603. })
  1604. //1 未填报,2待上报,3已上报
  1605. if (!error && code === 200) {
  1606. NodeStatus.value = data ?? '1'
  1607. } else {
  1608. NodeStatus.value = '1'
  1609. }
  1610. }
  1611. }
  1612. //批量上报
  1613. const reportIds = ref('')
  1614. const reportTaskName = ref('')
  1615. const reportAddition = ref({})
  1616. const showReportModal = ref(false)
  1617. const reportLoading = ref(false)
  1618. const reportTypeData = ref([])
  1619. const reportModalClick = async () => {
  1620. const info = nodeDataInfo.value
  1621. const rows = ListItemDatas.value
  1622. if (rows.length > 0) {
  1623. reportLoading.value = true
  1624. const taskCheck = await eVisaTaskCheckApi({
  1625. projectId: projectId.value,
  1626. contractId: contractInfo.value?.contractType == 2 ? info?.contractIdRelation : contractId.value,
  1627. // contractId: contractId.value
  1628. })
  1629. //处理数据
  1630. let newArr = []
  1631. for (let i = 0; i < rows.length; i++) {
  1632. newArr.push(rows[i]['isTypePrivatePid'])
  1633. }
  1634. reportTypeData.value = newArr
  1635. reportLoading.value = false
  1636. if (taskCheck) {
  1637. //初始弹出弹窗,防呆
  1638. reportIds.value = info['primaryKeyId']
  1639. reportAddition.value = {
  1640. classify: authBtnTabKey.value,
  1641. contractIdRelation: info['contractIdRelation'],
  1642. }
  1643. showReportModal.value = true
  1644. //请求文件题名
  1645. const { data } = await wbsApi.queryDocumentTitle({
  1646. primaryKeyId: info['primaryKeyId'],
  1647. classify: authBtnTabKey.value,
  1648. })
  1649. reportTaskName.value = isString(data) ? data : ''
  1650. }
  1651. } else {
  1652. window.$message?.warning('暂无相关数据')
  1653. }
  1654. }
  1655. //上报完成
  1656. const showReportFinish = () => {
  1657. showReportModal.value = false
  1658. getTableDataAll()
  1659. // window?.location?.reload() //刷新页面
  1660. }
  1661. //表单变量
  1662. const ListItemRef = ref(null)
  1663. const ListItemsRef = ref(null)
  1664. //保存
  1665. const tableFormSaveLoading = ref(false)
  1666. const tableFormSaveClick = async () => {
  1667. //获取数据
  1668. let FormData = [], FormRegExpJson = {}
  1669. if (isDrawer.value) {
  1670. FormData = await ListItemsRef.value?.getFormData()
  1671. FormRegExpJson = await ListItemsRef.value?.getFormRegExpJson()
  1672. } else {
  1673. FormData = await ListItemRef.value?.getFormData()
  1674. FormRegExpJson = await ListItemRef.value?.getFormRegExpJson()
  1675. }
  1676. //效验数据
  1677. if (getObjVal(FormRegExpJson)) {
  1678. setFormRegExpJson(FormRegExpJson)
  1679. } else if (FormData.length > 0) {
  1680. console.log('保存')
  1681. tableFormSaveLoading.value = true
  1682. console.log('FormData', FormData)
  1683. const { error, code, msg } = await wbsApi.saveExcelBussData({
  1684. dataInfo: { orderList: FormData },
  1685. })
  1686. tableFormSaveLoading.value = false
  1687. if (!error && code === 200) {
  1688. window?.$message?.success('保存成功')
  1689. // await bussPdfsClick()
  1690. const activeKey = ListItemRef.value?.getActiveKey()
  1691. getTableDataAll(activeKey)
  1692. } else {
  1693. window?.$message?.error(msg || '操作失败')
  1694. }
  1695. } else {
  1696. console.log('预览')
  1697. // await bussPdfsClick()
  1698. }
  1699. }
  1700. //效验数据
  1701. const setFormRegExpJson = (FormRegExpJson) => {
  1702. let nodeName = '', itemId = ''
  1703. Object.keys(FormRegExpJson).forEach(key => {
  1704. const name = FormRegExpJson[key]?.nodeName ?? ''
  1705. if (name) {
  1706. if (nodeName) {
  1707. nodeName += ',' + name
  1708. } else {
  1709. nodeName = name
  1710. itemId = FormRegExpJson[key]?.itemId
  1711. }
  1712. }
  1713. })
  1714. //const activeKey = ListItemRef.value?.getActiveKey()
  1715. //弹出提示
  1716. const val = '<div style="font-size: 16px;">请先完善 <span style="color:#1ECC95;">' + nodeName + '</span> 的数据内容</div>'
  1717. window?.$messageBox?.alert(val, '表单完善提醒', {
  1718. confirmButtonText: '确定',
  1719. dangerouslyUseHTMLString: true,
  1720. callback: (action) => {
  1721. if (action === 'confirm') {
  1722. ListItemRef.value?.setActiveKey(itemId)
  1723. ListItemOffsetTop(0)
  1724. setTimeout(() => {
  1725. const offsetTop = document.getElementById(itemId)?.offsetTop
  1726. ListItemOffsetTop(offsetTop)
  1727. }, 350)
  1728. }
  1729. },
  1730. })
  1731. }
  1732. //多表预览
  1733. const bussPdfsLoading = ref(false)
  1734. const bussPdfsClick = async () => {
  1735. const info = nodeDataInfo.value
  1736. bussPdfsLoading.value = true
  1737. const { error, code, data } = await wbsApi.getBussPdfs({
  1738. nodeId: info?.primaryKeyId || '',
  1739. classify: authBtnTabKey.value,
  1740. projectId: projectId.value,
  1741. // contractId: contractId.value
  1742. contractId: contractInfo.value?.contractType == 2 ? info?.contractIdRelation : contractId.value,
  1743. })
  1744. tableFormSaveLoading.value = false
  1745. bussPdfsLoading.value = false
  1746. if (!error && code === 200) {
  1747. toPdfPage(data)
  1748. //window.open(data, '_blank')
  1749. } else {
  1750. window.$message?.warning('获取PDF失败')
  1751. }
  1752. }
  1753. //撤回上报流程
  1754. const abolishLoaing = ref(false)
  1755. const abolishOneClick = () => {
  1756. window?.$messageBox?.alert('请谨慎考虑后,是否确定撤回?', '撤回上报', {
  1757. showCancelButton: true,
  1758. confirmButtonText: '确定撤回',
  1759. cancelButtonText: '取消',
  1760. callback: (action) => {
  1761. if (action === 'confirm') {
  1762. abolishOneSave()
  1763. }
  1764. },
  1765. })
  1766. }
  1767. //撤回请求
  1768. const abolishOneSave = async () => {
  1769. const info = nodeDataInfo.value
  1770. abolishLoaing.value = true
  1771. const { error, code } = await wbsApi.abolishOne({
  1772. primaryKeyId: info?.primaryKeyId || '',
  1773. classify: authBtnTabKey.value,
  1774. projectId:projectId.value,
  1775. contractId:contractId.value,
  1776. })
  1777. abolishLoaing.value = false
  1778. if (!error && code === 200) {
  1779. window.$message?.success('撤回成功')
  1780. getTableDataAll()
  1781. window?.location?.reload() //刷新页面
  1782. }
  1783. }
  1784. //附件列表
  1785. const attachmentModal = ref(false)
  1786. const attachmentModalShow = () => {
  1787. attachmentModal.value = true
  1788. getAttachmentList()
  1789. }
  1790. const attachmentListLoaing = ref(false)
  1791. const attachmentList = ref([])
  1792. const getAttachmentList = async ()=>{
  1793. attachmentListLoaing.value = true
  1794. const info = nodeDataInfo.value
  1795. const { error, code, data } = await wbsApi.tablesAndFile({
  1796. primaryKeyId: info?.primaryKeyId || '',
  1797. type: authBtnTabKey.value,
  1798. contractId:contractId.value,
  1799. projectId:projectId.value,
  1800. })
  1801. attachmentListLoaing.value = false
  1802. if (!error && code === 200) {
  1803. attachmentList.value = getArrValue(data)
  1804. } else {
  1805. attachmentList.value = []
  1806. }
  1807. }
  1808. //预览
  1809. const previewFile = (item)=>{
  1810. toPdfPage(item['domainPdfUrl'])
  1811. //window.open(item['domainPdfUrl'], '_blank')
  1812. }
  1813. //删除
  1814. const delFile = async (item)=>{
  1815. item.loading = true
  1816. const { error, code, msg } = await wbsApi.removeBussFile({
  1817. ids: item.id,
  1818. })
  1819. item.loading = false
  1820. if (!error && code === 200) {
  1821. window?.$message?.success('删除成功')
  1822. getAttachmentList()
  1823. getTableDataAll()
  1824. return true
  1825. } else {
  1826. window.$message.error(msg)
  1827. return false
  1828. }
  1829. }
  1830. //划分变更
  1831. const divisionClick = () => {
  1832. router.push({
  1833. path: '/data-fill/division',
  1834. })
  1835. }
  1836. //树展开和收起
  1837. const isWbsTreeShow = ref(true)
  1838. const setWbsTreeShow = () => {
  1839. isWbsTreeShow.value = !isWbsTreeShow.value
  1840. }
  1841. //拷贝内容
  1842. const copyPositionText = (val) => {
  1843. if (val) {
  1844. //navigator.clipboard.writeText(val);
  1845. setCopyText(val).then(() => {
  1846. window.$message?.success('复制成功')
  1847. }).catch(() => {
  1848. window.$message?.error('复制失败,请手动复制')
  1849. })
  1850. } else {
  1851. window.$message?.warning('没有可复制的数据')
  1852. }
  1853. }
  1854. //左右拖动,改变树形结构宽度
  1855. const isMouseTree = ref(false)
  1856. const onmousedown = () => {
  1857. const leftNum = isCollapse.value ? 142 : 272
  1858. isMouseTree.value = true
  1859. document.onmousemove = async (ve) => {
  1860. let diffVal = ve.clientX - leftNum
  1861. if (diffVal >= 310 && diffVal <= 900) {
  1862. leftWidth.value = diffVal
  1863. }
  1864. }
  1865. document.onmouseup = () => {
  1866. document.onmousemove = null
  1867. document.onmouseup = null
  1868. isMouseTree.value = false
  1869. }
  1870. }
  1871. //更新配置
  1872. watch(() => leftWidth.value, (diffVal) => {
  1873. setUserConfig(diffVal)
  1874. })
  1875. const setUserConfig = async (data) => {
  1876. await useClick()
  1877. useAppState.setTreeWidth(data)
  1878. await userConfigSave({ treeWidth: data })
  1879. }
  1880. //同步质检资料
  1881. const syncdataloading = ref(false)
  1882. const syncdata = async ()=>{
  1883. ListItemRef.value?.setActiveKey('')
  1884. const info = nodeDataInfo.value
  1885. syncdataloading.value = true
  1886. const { error, code, msg } = await wbsApi.syncTbadata({
  1887. pKeyId: info?.primaryKeyId || '',
  1888. })
  1889. syncdataloading.value = false
  1890. if (!error && code === 200) {
  1891. window.$message?.success(msg)
  1892. getTableDataAll()
  1893. // window?.location?.reload() //刷新页面
  1894. }
  1895. }
  1896. //附件添加
  1897. const typeoptions = ref([
  1898. {
  1899. value: '1',
  1900. label: '模板1',
  1901. },
  1902. {
  1903. value: '2',
  1904. label: '模板2',
  1905. },
  1906. ])
  1907. const getFileTypeApi = async () => {
  1908. const { data } = await getDictionaryBiz({
  1909. code: 'table_file_type',
  1910. })
  1911. //处理数据
  1912. let newArr = []
  1913. const newData = getArrValue(data)
  1914. for (let i = 0; i < newData.length; i++) {
  1915. newArr.push({
  1916. label: newData[i]['dictValue'],
  1917. value: Number(newData[i]['dictKey']),
  1918. })
  1919. }
  1920. typeoptions.value = newArr
  1921. }
  1922. const typevalue = ref('')
  1923. const isCanadd = ref(true)
  1924. const uploadModal = ref(false)
  1925. const fileListData = ref([])
  1926. const uploadData = ref({})
  1927. const uploadModalClose = ()=>{
  1928. uploadModal.value = false
  1929. typevalue.value = ''
  1930. }
  1931. //获取附件添加列表
  1932. const getBussFileList = async (pkeyId) => {
  1933. const { error, code, data } = await wbsApi.selectTableFileListByTen({
  1934. pkeyid: pkeyId,
  1935. })
  1936. if (!error && code === 200) {
  1937. fileListData.value = getArrValue(data)
  1938. } else {
  1939. fileListData.value = []
  1940. }
  1941. }
  1942. const addFilelist = async ()=>{
  1943. getBussFileList(primaryKeyId.value)
  1944. uploadModal.value = true
  1945. await getFileTypeApi()
  1946. //上传的配置
  1947. uploadData.value = {
  1948. classify:authBtnTabKey.value,
  1949. nodeId: primaryKeyId.value,
  1950. type:typevalue.value,
  1951. contractId:contractId.value,
  1952. }
  1953. }
  1954. const changeType = (val)=>{
  1955. uploadData.value.type = val
  1956. }
  1957. //上传文件
  1958. const uploadChange = async ({ type }) => {
  1959. if (type === 'success') {
  1960. getBussFileList(primaryKeyId.value)
  1961. } else if (type === 'del') {
  1962. getBussFileList(primaryKeyId.value)
  1963. }
  1964. }
  1965. //树节点被选中
  1966. const treeSelectNode = ref([])
  1967. const treeSelectdata = ref([])
  1968. const ElTreeNodeCheck = (_, { checkedKeys, checkedNodes }) => {
  1969. console.log(checkedNodes, 'checkedNodes')
  1970. treeSelectNode.value = getArrValue(checkedKeys)
  1971. treeSelectdata.value = getArrValue(checkedNodes)
  1972. }
  1973. //隐藏节点
  1974. const hideSaveLoading = ref(false)
  1975. const hideTreeNode = async ()=>{
  1976. const isExist1 = isArrIndex(treeSelectdata.value, 'colorStatus', 3)//已填报待审批
  1977. const isExist2 = isArrIndex(treeSelectdata.value, 'colorStatus', 4)//已审批
  1978. if (isExist1 || isExist2) {
  1979. window.$message.warning('已审批和已填报-待审批状态的节点,不可隐藏;')
  1980. return
  1981. }
  1982. const keys = arrToKey(treeSelectdata.value, 'pKeyId', ',')
  1983. if (keys.length <= 0) {
  1984. window?.$message?.warning('请先在左侧项目树选择节点')
  1985. return
  1986. }
  1987. //发起请求
  1988. hideSaveLoading.value = true
  1989. const { error, code, msg } = await wbsApi.updateNodeStates({
  1990. ids: keys,
  1991. status:2,
  1992. }, false)
  1993. hideSaveLoading.value = false
  1994. if (!error && code === 200) {
  1995. window?.$message?.success(msg || '操作成功')
  1996. setTimeout(() => {
  1997. window?.location?.reload() //刷新页面
  1998. }, 1000)
  1999. } else {
  2000. window?.$message?.error(msg)
  2001. }
  2002. }
  2003. const loadMenu = ({ node, item, level }, resolve)=>{
  2004. setElTreeMenu(contractInfo.value?.contractType)
  2005. let menusArr = ElTreeMenu.value
  2006. const { isCustomChild, notExsitChild } = item //isCustomChild===1//代表子级是自定义节点
  2007. // const { isCustom } = item
  2008. // if (isCustom === 1 && isCustomChild === 0 && notExsitChild) {//无子级,显示两个按钮
  2009. // menusArr.unshift( { icon: 'add-circle', label: '新增自定义节点', key: 'add1' })
  2010. // resolve(menusArr)
  2011. // } else if (isCustom === 1 && isCustomChild === 1) {//自定义节点类型下如果有自定义节点,就不允许新增节点
  2012. // menusArr.unshift( { icon: 'add-circle', label: '新增自定义节点', key: 'add1' })
  2013. // let menusArr1 = arrDelKey(menusArr, 'label', '新增节点') // [{id:1}]
  2014. // resolve(menusArr1)
  2015. // } else if (isCustom === 1 && isCustomChild === 0 && !notExsitChild) { //自定义节点类型下如果有划分节点,就不允许新增自定义节点
  2016. // resolve(menusArr)
  2017. // } else if (level === 1) {
  2018. // menusArr = [ { icon: 'add-circle', label: '新增自定义节点', key: 'add1' }]
  2019. // resolve(menusArr)
  2020. // } else {
  2021. // resolve(menusArr)
  2022. // }
  2023. if (level === 1) {
  2024. menusArr = [ { icon: 'add-circle', label: '自定义节点(水利工程)', key: 'add1' }]
  2025. resolve(menusArr)
  2026. } else {
  2027. resolve(menusArr)
  2028. }
  2029. }
  2030. //批量保存
  2031. const nodeSaveLoading = ref(false)
  2032. const NodeSaveClick = async () => {
  2033. const keys = treeSelectNode.value
  2034. if (keys.length <= 0) {
  2035. window?.$message?.warning('请先在左侧项目树选择节点')
  2036. return
  2037. }
  2038. //发起请求
  2039. nodeSaveLoading.value = true
  2040. const { error, code, msg } = await wbsApi.save_nodeId({
  2041. projectId: projectId.value,
  2042. contractId: contractId.value,
  2043. classify: authBtnTabKey.value,
  2044. nodeIds: keys.join(),
  2045. }, false)
  2046. nodeSaveLoading.value = false
  2047. if (!error && code === 200) {
  2048. window?.$message?.success('批量保存成功')
  2049. window?.location?.reload() //刷新页面
  2050. } else {
  2051. window?.$message?.error(msg)
  2052. }
  2053. }
  2054. //排序
  2055. const tableSortFormRef = ref(null)
  2056. const sortFormShow = ref(false)
  2057. const tableSortFormColumn = [
  2058. { key: 'nodeName', name: '名称' },
  2059. ]
  2060. const tableSortFormData = ref([])
  2061. const sortFormClick = () => {
  2062. sortFormShow.value = true
  2063. tableSortFormData.value = deepClone(ListItemDatas.value)
  2064. }
  2065. // 行拖拽
  2066. const sortFormDropTap = (rows) => {
  2067. tableSortFormData.value = [] // 先清空,否则排序会异常
  2068. nextTick(() => {
  2069. tableSortFormRef.value?.setData(rows)
  2070. })
  2071. }
  2072. // 点击排序
  2073. const rowSortFormTap = (rows) => {
  2074. tableSortFormData.value = [] // 先清空,否则排序会异常
  2075. nextTick(() => {
  2076. tableSortFormData.value = rows
  2077. })
  2078. }
  2079. //关闭排序
  2080. const sortFormClose = () => {
  2081. sortFormShow.value = false
  2082. sortFormLoading.value = false
  2083. tableSortFormData.value = []
  2084. }
  2085. //提交排序
  2086. const sortFormLoading = ref(false)
  2087. const sortFormSubmit = async () => {
  2088. const treeId = primaryKeyId.value
  2089. if (isNullES(treeId)) {
  2090. window?.$message?.warning('请先在左侧项目树选择一个节点')
  2091. return
  2092. }
  2093. const rows = tableSortFormData.value
  2094. const ids = arrToKey(rows, 'pkeyId')
  2095. //发起请求
  2096. sortFormLoading.value = true
  2097. const { error, code, msg } = await wbsApi.formTableSort({
  2098. projectId: projectId.value,
  2099. contractId: contractId.value,
  2100. classify: authBtnTabKey.value,
  2101. nodeIds: treeId,
  2102. ids: ids,
  2103. }, false)
  2104. sortFormLoading.value = false
  2105. if (!error && code === 200) {
  2106. window?.$message?.success('操作成功')
  2107. window?.location?.reload() //刷新页面
  2108. } else {
  2109. window?.$message?.error(msg)
  2110. }
  2111. }
  2112. </script>
  2113. <style lang="scss" scoped>
  2114. @import "../../styles/data-fill/wbs.scss";
  2115. .hc-add-node-modal-foot-box {
  2116. position: relative;
  2117. display: flex;
  2118. align-items: center;
  2119. .left-box {
  2120. position: relative;
  2121. flex: 1;
  2122. display: flex;
  2123. align-items: center;
  2124. }
  2125. .right-box {
  2126. position: relative;
  2127. }
  2128. }
  2129. .hc-expansion-contraction-tree {
  2130. position: absolute;
  2131. left: -13px;
  2132. top: 0;
  2133. width: 10px;
  2134. height: 100%;
  2135. user-select: none;
  2136. cursor: pointer;
  2137. display: flex;
  2138. justify-content: center;
  2139. align-items: center;
  2140. color: #8c9099;
  2141. font-size: 22px;
  2142. border-radius: 5px;
  2143. transition: background 0.2s;
  2144. background: rgba(255, 255, 255, 0);
  2145. &:hover {
  2146. background: #f1f5f8;
  2147. color: var(--el-color-primary);
  2148. }
  2149. }
  2150. .hc-table-form-action-tip {
  2151. position: absolute;
  2152. bottom: 77px;
  2153. width: 100%;
  2154. }
  2155. html.theme-dark {
  2156. .bg-svg-xml {
  2157. background-color: initial;
  2158. background-image: initial;
  2159. }
  2160. .hc-layout-box .hc-layout-content-box .hc-card-max-h-box.node-tree .hc-tree-foot-tip-box {
  2161. border-top: 1px solid #303030;
  2162. }
  2163. }
  2164. </style>
  2165. <style lang="scss">
  2166. .hc-tree-box .el-tree-node {
  2167. .el-checkbox {
  2168. margin-right: 0;
  2169. .el-checkbox__inner {
  2170. display: none;
  2171. }
  2172. }
  2173. .is-leaf + .el-checkbox {
  2174. margin-right: 8px;
  2175. .el-checkbox__inner {
  2176. display: inline-block;
  2177. }
  2178. }
  2179. }
  2180. .data-fill-wbs-content {
  2181. position: relative;
  2182. height: 100%;
  2183. .n-drawer-container {
  2184. margin: -20px -24px;
  2185. }
  2186. .n-drawer.n-drawer--top-placement {
  2187. height: auto !important;
  2188. background-color: initial;
  2189. pointer-events: none;
  2190. bottom: 0;
  2191. }
  2192. .drawer-data-fill-content-box {
  2193. position: relative;
  2194. height: 100%;
  2195. padding: 24px;
  2196. .n-card {
  2197. pointer-events: auto;
  2198. height: 100%;
  2199. overflow: auto;
  2200. }
  2201. .data-fill-content {
  2202. position: relative;
  2203. height: 100%;
  2204. overflow-y: auto;
  2205. scroll-behavior: smooth;
  2206. .data-fill-list-box .data-fill-list-item-content {
  2207. height: calc(100vh - 470px);
  2208. .data-fill-table-form-box {
  2209. height: 100%;
  2210. }
  2211. }
  2212. }
  2213. .data-fill-foot {
  2214. position: relative;
  2215. text-align: center;
  2216. }
  2217. }
  2218. }
  2219. .n-card.hc-card-overflow-box .n-card__content {
  2220. padding: 24px;
  2221. }
  2222. .n-card.hc-custom-card > .n-card-header {
  2223. padding: 15px 24px;
  2224. }
  2225. .n-card.hc-custom-card.copy {
  2226. width: 1200px;
  2227. max-height: 90vh;
  2228. overflow: auto;
  2229. .n-card-header .n-card-header__close {
  2230. display: none;
  2231. }
  2232. &.one {
  2233. width: 600px;
  2234. }
  2235. &.many {
  2236. width: 1200px;
  2237. }
  2238. }
  2239. .img-preview-box {
  2240. position: relative;
  2241. height: 100%;
  2242. width: 100%;
  2243. }
  2244. .hc-layout-content-box {
  2245. position: relative;
  2246. }
  2247. .iscusor {
  2248. cursor: pointer;
  2249. }
  2250. .hc-table-form-action-tip .hc-alert {
  2251. background-color: #f1f5f8;
  2252. display: inline;
  2253. vertical-align: middle;
  2254. box-shadow: -2px 0 10px 0 rgba(32, 37, 50, 0.03), 0 10px 21px 20px rgba(32, 37, 50, 0.03);
  2255. }
  2256. .copy-node-form-box {
  2257. margin-top: 24px;
  2258. padding-top: 24px;
  2259. border-top: 1px solid #efeff5;
  2260. }
  2261. .hc-position-input-icon {
  2262. position: relative;
  2263. margin-bottom: 0;
  2264. .el-form-item__content {
  2265. position: relative;
  2266. .el-textarea .el-textarea__inner {
  2267. padding-right: 30px;
  2268. }
  2269. .hc-icon-i {
  2270. position: absolute;
  2271. right: 10px;
  2272. bottom: 0;
  2273. font-size: 20px;
  2274. cursor: pointer;
  2275. color: #0081ff;
  2276. opacity: 1;
  2277. transition: opacity 0.2s;
  2278. &:hover {
  2279. opacity: .5;
  2280. }
  2281. }
  2282. }
  2283. }
  2284. </style>