tree.vue 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286
  1. <template>
  2. <basic-container>
  3. <el-row :gutter="20">
  4. <el-col :span="10">
  5. <div class="box">
  6. <p>工程节点信息</p>
  7. <div class="flex">
  8. <el-input
  9. placeholder="输入关键字进行过滤"
  10. v-model="filterText"
  11. @input="filterChange"
  12. ></el-input>
  13. <!-- <el-button type="info" class="mg-l-20">导入划分</el-button> -->
  14. </div>
  15. <el-scrollbar>
  16. <div v-loading="treeLoad">
  17. <el-tree
  18. v-show="!filterText"
  19. class="filter-tree"
  20. lazy
  21. :data="treeData"
  22. :load="loadNode"
  23. @node-click="getNodeDetail"
  24. :props="defaultProps"
  25. :expand-on-click-node="false"
  26. highlight-current
  27. node-key="id"
  28. ref="tree"
  29. >
  30. <span
  31. class="custom-tree-node"
  32. :class="data.moreShow?'show':''"
  33. slot-scope="{ node, data }"
  34. >
  35. <!--@mouseover="mouseover(data)" @mouseleave="mouseout(data)"-->
  36. <span>
  37. {{ node.label }}
  38. <el-dropdown
  39. @click="command=>{setLeftType(command,data)}"
  40. @visible-change="visiblechange($event,data)"
  41. >
  42. <el-button
  43. type="text"
  44. icon="el-icon-more"
  45. class="normal-black"
  46. >
  47. </el-button>
  48. <el-dropdown-menu slot="dropdown">
  49. <el-dropdown-item
  50. @click.native="setLeftType(1,data,node)"
  51. icon="el-icon-circle-plus-outline"
  52. >新增子级</el-dropdown-item>
  53. <el-dropdown-item
  54. @click.native="setLeftType(2,data,node)"
  55. icon="el-icon-edit"
  56. >编辑节点</el-dropdown-item>
  57. <el-dropdown-item
  58. @click.native="setLeftType(3,data,node)"
  59. icon="el-icon-document-copy"
  60. >复制节点</el-dropdown-item>
  61. <el-dropdown-item
  62. @click.native="setLeftType(4,data,node)"
  63. icon="iconfont hcicon-danganziliao-biaogetianxie"
  64. class="font-s-12"
  65. >元素公式</el-dropdown-item>
  66. <el-dropdown-item
  67. @click.native="setLeftType(5,data,node)"
  68. icon="el-icon-coin"
  69. >元素设置</el-dropdown-item>
  70. <el-dropdown-item
  71. @click.native="nodeInfo(data,node)"
  72. icon="el-icon-help"
  73. >节点参数</el-dropdown-item>
  74. <el-dropdown-item
  75. @click.native="importTemplate(data,node)"
  76. v-if="node.level == 2"
  77. icon="el-icon-upload"
  78. >导入划分</el-dropdown-item>
  79. <el-dropdown-item
  80. v-if="data.parentId!=0"
  81. @click.native="sortpai(data,node)"
  82. icon="el-icon-sort"
  83. >调整排序</el-dropdown-item>
  84. </el-dropdown-menu>
  85. </el-dropdown>
  86. </span>
  87. </span>
  88. </el-tree>
  89. <el-tree
  90. v-show="filterText"
  91. class="filter-tree"
  92. :data="treeData"
  93. @node-click="getNodeDetail"
  94. :props="defaultProps"
  95. :expand-on-click-node="false"
  96. highlight-current
  97. node-key="id"
  98. :filter-node-method="filterNode"
  99. ref="treeall"
  100. >
  101. <span
  102. class="custom-tree-node"
  103. slot-scope="{ node, data }"
  104. :class="data.moreShow?'show':''"
  105. >
  106. <span>
  107. {{ node.label }}
  108. <el-dropdown
  109. @click="command=>{setLeftType(command,data)}"
  110. @visible-change="visiblechange($event,data)"
  111. >
  112. <el-button
  113. type="text"
  114. icon="el-icon-more"
  115. class="normal-black"
  116. >
  117. </el-button>
  118. <el-dropdown-menu slot="dropdown">
  119. <el-dropdown-item
  120. @click.native="setLeftType(1,data,node)"
  121. icon="el-icon-circle-plus-outline"
  122. >新增子级</el-dropdown-item>
  123. <el-dropdown-item
  124. @click.native="setLeftType(2,data,node)"
  125. icon="el-icon-edit"
  126. >编辑节点</el-dropdown-item>
  127. <el-dropdown-item
  128. @click.native="setLeftType(3,data,node)"
  129. icon="el-icon-document-copy"
  130. >复制节点</el-dropdown-item>
  131. <el-dropdown-item
  132. @click.native="setLeftType(4,data,node)"
  133. icon="iconfont hcicon-danganziliao-biaogetianxie"
  134. class="font-s-12"
  135. >元素公式</el-dropdown-item>
  136. <el-dropdown-item
  137. @click.native="setLeftType(5,data,node)"
  138. icon="el-icon-coin"
  139. >元素设置</el-dropdown-item>
  140. <el-dropdown-item
  141. @click.native="nodeInfo(data)"
  142. icon="el-icon-help"
  143. >节点参数</el-dropdown-item>
  144. <el-dropdown-item
  145. @click.native="importTemplate(data,node)"
  146. v-if="node.level == 2"
  147. icon="el-icon-upload"
  148. >导入划分</el-dropdown-item>
  149. </el-dropdown-menu>
  150. </el-dropdown>
  151. </span>
  152. </span>
  153. </el-tree>
  154. </div>
  155. </el-scrollbar>
  156. </div>
  157. </el-col>
  158. <el-col :span="14">
  159. <template v-if="leftType==5">
  160. <p>节点信息</p>
  161. <el-table
  162. :data="tableData"
  163. border
  164. style="width: 100%"
  165. >
  166. <el-table-column
  167. align="center"
  168. prop="deptName"
  169. label="当前节点"
  170. ></el-table-column>
  171. <el-table-column
  172. align="center"
  173. prop="deptCategory"
  174. :formatter="formatCat"
  175. label="节点类型"
  176. width="180"
  177. ></el-table-column>
  178. <el-table-column
  179. align="center"
  180. prop="parentName"
  181. label="上级节点"
  182. ></el-table-column>
  183. </el-table>
  184. <p>
  185. <span>当前项目信息表</span>
  186. <el-button
  187. @click="showFormElement"
  188. type="text"
  189. icon="el-icon-circle-plus-outline"
  190. class="text-icon mg-l-10"
  191. ></el-button>
  192. <el-button
  193. type="text"
  194. icon="el-icon-document-copy"
  195. class="text-icon"
  196. ></el-button>
  197. </p>
  198. <el-table
  199. :data="formData"
  200. border
  201. style="width: 100%"
  202. >
  203. <el-table-column
  204. align="center"
  205. prop="tableName"
  206. label="表单名称"
  207. ></el-table-column>
  208. <el-table-column
  209. align="center"
  210. prop="elementTotal"
  211. label="字段总量"
  212. ></el-table-column>
  213. <el-table-column
  214. align="center"
  215. prop="tableType"
  216. :formatter="formatTableType"
  217. label="表单类型"
  218. ></el-table-column>
  219. <el-table-column
  220. align="center"
  221. prop="tableOwner"
  222. :formatter="formatOwner"
  223. label="所属方"
  224. ></el-table-column>
  225. <el-table-column label="操作">
  226. <template slot-scope="scope">
  227. <el-button
  228. size="mini"
  229. @click="handleEdit(scope.$index, scope.row)"
  230. >编辑</el-button>
  231. <el-button
  232. size="mini"
  233. type="danger"
  234. @click="handleDelete(scope.$index, scope.row)"
  235. >删除</el-button>
  236. </template>
  237. </el-table-column>
  238. </el-table>
  239. </template>
  240. <template v-if="leftType==4">
  241. <el-table
  242. :data="formData"
  243. border
  244. style="width: 100%"
  245. >
  246. <el-table-column
  247. align="center"
  248. prop="tableName"
  249. label="表单名称"
  250. ></el-table-column>
  251. <el-table-column
  252. align="center"
  253. prop="tableType"
  254. :formatter="formatTableType"
  255. label="表单类型"
  256. ></el-table-column>
  257. <el-table-column
  258. label="是否关联清表"
  259. width="130"
  260. prop="isLinkTable"
  261. align="center"
  262. >
  263. <template slot-scope="scope">
  264. <span v-if="scope.row.isLinkTable == 2">是</span>
  265. <span v-else>否</span>
  266. </template>
  267. </el-table-column>
  268. <el-table-column
  269. align="center"
  270. prop="tableOwner"
  271. :formatter="formatOwner"
  272. label="所属方"
  273. ></el-table-column>
  274. <el-table-column
  275. label="操作"
  276. width="350"
  277. align="center"
  278. >
  279. <template slot-scope="scope">
  280. <el-link
  281. type="primary"
  282. @click="rightClick(scope.row.pkeyId,scope.row.excelId,scope.row.id,scope.row.initTableName,)"
  283. >编辑元素</el-link>
  284. <el-link
  285. class="mg-l-10"
  286. type="primary"
  287. @click="Associationlist(scope)"
  288. >关联清表</el-link>
  289. <el-link
  290. class="mg-l-10"
  291. type="primary"
  292. @click="adjustExcel(scope.row.pkeyId,scope.row.excelId)"
  293. >调整表单</el-link>
  294. <el-link
  295. class="mg-l-10"
  296. type="danger"
  297. @click="handleDelete(scope.$index, scope.row)"
  298. >删除表单</el-link>
  299. <!-- <el-button
  300. size="mini"
  301. @click="handleEditFormula(scope.$index, scope.row)">编辑元素公式</el-button> -->
  302. </template>
  303. </el-table-column>
  304. </el-table>
  305. </template>
  306. </el-col>
  307. </el-row>
  308. <!-- 调整表单模板 -->
  309. <div
  310. v-if="excelHtml"
  311. class="excelHtml"
  312. >
  313. <dynamicExcel
  314. @remove="removeExcel"
  315. v-if="excelHtml"
  316. :pkeyId='GLExcelFrom.id'
  317. />
  318. </div>
  319. <!-- 私有wbs树排序弹框 -->
  320. <el-dialog
  321. title="调整排序"
  322. :visible="sortTag"
  323. width="50%"
  324. append-to-body
  325. >
  326. <ManualSorting
  327. v-if="sortTag2"
  328. @bianhua='bianhua()'
  329. :sort='sort'
  330. />
  331. <span
  332. slot="footer"
  333. class="dialog-footer"
  334. >
  335. <el-button @click="sortTag=false,sortTag2=false">取 消</el-button>
  336. <el-button
  337. type="primary"
  338. @click="editSort()"
  339. >确 定</el-button>
  340. </span>
  341. </el-dialog>
  342. <!-- 关联清表 -->
  343. <el-dialog
  344. title="关联清表"
  345. class="excelBox"
  346. :visible.sync="GLExcel"
  347. width="500px"
  348. modal-append-to-body
  349. append-to-body
  350. :before-close="GLExcelMD"
  351. >
  352. <div>
  353. <el-select
  354. style="width:400px;"
  355. v-model="GLExcelFrom.name"
  356. placeholder="请选择"
  357. @change="changetherr()"
  358. >
  359. <el-option
  360. v-for="(item,key) in GLExcelData"
  361. :key="key"
  362. :label="item.name"
  363. :value="item.id"
  364. >
  365. </el-option>
  366. </el-select>
  367. <el-scrollbar style="margin-top:20px;height:50vh;">
  368. <el-input
  369. style="width:400px;"
  370. v-model.trim="GLExcelFrom.search"
  371. placeholder="请输入需要选择的内容"
  372. ></el-input>
  373. <el-tree
  374. :filter-node-method="filterNode222"
  375. ref="tree"
  376. class="filter-tree"
  377. style="margin-top:10px;"
  378. :props="GLExcelProps"
  379. :data="exceldata"
  380. node-key="id"
  381. accordion
  382. show-checkbox
  383. @check="checkchange"
  384. >
  385. </el-tree>
  386. </el-scrollbar>
  387. </div>
  388. <span
  389. slot="footer"
  390. class="dialog-footer"
  391. style="display: flex;justify-content: center;align-items: center;"
  392. >
  393. <el-button @click="GLExcelMD()">取 消</el-button>
  394. <el-button
  395. style="margin-left:30px;"
  396. type="primary"
  397. @click="saveLinkTab()"
  398. >确 定</el-button>
  399. </span>
  400. </el-dialog>
  401. <el-dialog
  402. :title="dialogTitle"
  403. :visible.sync="dialogVisible"
  404. width="50%"
  405. append-to-body
  406. :close-on-click-modal="false"
  407. >
  408. <el-form
  409. ref="nodeDetail"
  410. :model="nodeDetail"
  411. :rules="rules"
  412. label-width="110px"
  413. >
  414. <el-form-item
  415. label="节点名称"
  416. prop="deptName"
  417. >
  418. <el-input v-model="nodeDetail.deptName"></el-input>
  419. </el-form-item>
  420. <el-form-item label="上级节点">
  421. <el-input
  422. v-model="nodeDetail.parentName"
  423. disabled
  424. ></el-input>
  425. </el-form-item>
  426. <el-form-item
  427. label="节点类型"
  428. prop="deptCategory"
  429. >
  430. <el-select
  431. v-model="nodeDetail.deptCategory"
  432. placeholder="请选择"
  433. class="w-100p"
  434. >
  435. <el-option
  436. v-for="item in deptCategorylist"
  437. :key="item.id"
  438. :label="item.dictValue"
  439. :value="item.dictKey"
  440. ></el-option>
  441. </el-select>
  442. </el-form-item>
  443. <el-form-item label="划分编号">
  444. <el-input v-model="nodeDetail.partitionCode"></el-input>
  445. </el-form-item>
  446. <el-form-item label="唯一编码">
  447. <el-input v-model="nodeDetail.uniqueCode"></el-input>
  448. </el-form-item>
  449. <template v-if="nodeDetail.deptCategory == 6">
  450. <el-form-item label="是否有混凝土">
  451. <el-radio-group
  452. v-model="nodeDetail.isConcrete"
  453. size="small"
  454. >
  455. <el-radio
  456. :label="0"
  457. border
  458. >无</el-radio>
  459. <el-radio
  460. :label="1"
  461. border
  462. >有</el-radio>
  463. </el-radio-group>
  464. </el-form-item>
  465. <el-form-item label="是否试验节点">
  466. <el-radio-group
  467. v-model="nodeDetail.isExpernode"
  468. size="small"
  469. >
  470. <el-radio
  471. :label="0"
  472. border
  473. >否</el-radio>
  474. <el-radio
  475. :label="1"
  476. border
  477. >是</el-radio>
  478. </el-radio-group>
  479. </el-form-item>
  480. </template>
  481. <el-form-item label="内业资料类型">
  482. <el-select
  483. v-model="nodeDetail.majorDataType"
  484. placeholder="请选择"
  485. class="w-100p"
  486. >
  487. <el-option
  488. v-for="item in majorDataTypeList"
  489. :key="item.id"
  490. :label="item.dictValue"
  491. :value="item.dictKey"
  492. ></el-option>
  493. </el-select>
  494. </el-form-item>
  495. </el-form>
  496. <span
  497. slot="footer"
  498. class="dialog-footer"
  499. >
  500. <el-button @click="dialogVisible = false">取 消</el-button>
  501. <el-button
  502. type="primary"
  503. @click="saveNode"
  504. >确 定</el-button>
  505. </span>
  506. </el-dialog>
  507. <el-dialog
  508. title="创建新的元素表"
  509. :visible.sync="eleVisible"
  510. width="80%"
  511. append-to-body
  512. :close-on-click-modal="false"
  513. >
  514. <el-form
  515. ref="eleDialog"
  516. :model="eleForm"
  517. :rules="eleRules"
  518. label-width="110px"
  519. >
  520. <el-form-item
  521. label="表名"
  522. prop="deptName"
  523. >
  524. <el-input v-model="eleForm.deptName"></el-input>
  525. </el-form-item>
  526. <el-row>
  527. <el-col :span="12">
  528. <el-form-item
  529. label="表类型"
  530. prop="tableType"
  531. >
  532. <el-select
  533. v-model="eleForm.tableType"
  534. placeholder="请选择"
  535. class="w-100p"
  536. >
  537. <el-option
  538. v-for="item in tableTypelist"
  539. :key="item.id"
  540. :label="item.dictValue"
  541. :value="item.dictKey"
  542. ></el-option>
  543. </el-select>
  544. </el-form-item>
  545. </el-col>
  546. <el-col :span="12">
  547. <el-form-item
  548. label="所属方"
  549. prop="tableOwner"
  550. >
  551. <el-select
  552. v-model="eleForm.tableOwner"
  553. placeholder="请选择"
  554. class="w-100p"
  555. >
  556. <el-option
  557. v-for="item in ownerTypeList"
  558. :key="item.id"
  559. :label="item.dictValue"
  560. :value="item.dictKey"
  561. ></el-option>
  562. </el-select>
  563. </el-form-item>
  564. </el-col>
  565. </el-row>
  566. </el-form>
  567. <div class="flex jc-sb">
  568. <div></div>
  569. <div>
  570. <el-link
  571. type="primary"
  572. @click="importVisible = true"
  573. >快捷导入</el-link>
  574. <el-link
  575. type="primary"
  576. class="mg-l-20"
  577. @click="downloadTmp"
  578. >下载导入模版</el-link>
  579. </div>
  580. </div>
  581. <div class="border-grey">
  582. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  583. <el-table
  584. :data="eleForm.elementList"
  585. border
  586. style="width: 100%"
  587. height="400px"
  588. >
  589. <el-table-column
  590. align="center"
  591. type="index"
  592. width="50"
  593. ></el-table-column>
  594. <el-table-column
  595. align="center"
  596. prop="eName"
  597. label="字段名称"
  598. >
  599. <template slot-scope="scope">
  600. <el-input
  601. v-model="scope.row.eName"
  602. size="small"
  603. placeholder="请输入内容"
  604. ></el-input>
  605. </template>
  606. </el-table-column>
  607. <el-table-column
  608. align="center"
  609. prop="eType"
  610. label="数据类型"
  611. width="120"
  612. >
  613. <template slot-scope="scope">
  614. <el-select
  615. v-model="scope.row.eType"
  616. size="small"
  617. placeholder="请选择"
  618. >
  619. <el-option
  620. v-for="item in dataTypeList"
  621. :key="item.id"
  622. :label="item.dictValue"
  623. :value="item.dictKey"
  624. ></el-option>
  625. </el-select>
  626. </template>
  627. </el-table-column>
  628. <el-table-column
  629. align="center"
  630. prop="eLength"
  631. label="长度"
  632. width="120"
  633. >
  634. <template slot-scope="scope">
  635. <el-input
  636. v-model="scope.row.eLength"
  637. size="small"
  638. placeholder="请输入内容"
  639. :disabled="scope.row.eType == 4"
  640. ></el-input>
  641. </template>
  642. </el-table-column>
  643. <el-table-column
  644. align="center"
  645. prop="eAllowDeviation"
  646. label="允许偏差值"
  647. >
  648. <template slot-scope="scope">
  649. <div class="flex">
  650. <el-select
  651. v-model="scope.row.allow"
  652. size="small"
  653. placeholder="请选择"
  654. style="width:120px"
  655. >
  656. <el-option
  657. :key="1"
  658. label="≥"
  659. value="≥"
  660. ></el-option>
  661. <el-option
  662. :key="2"
  663. label="≤"
  664. value="≤"
  665. ></el-option>
  666. <el-option
  667. :key="3"
  668. label="±"
  669. value="±"
  670. ></el-option>
  671. <el-option
  672. :key="4"
  673. label="【】"
  674. value="【】"
  675. ></el-option>
  676. </el-select>
  677. <el-input
  678. v-model="scope.row.deviation"
  679. size="small"
  680. placeholder="请输入内容"
  681. ></el-input>
  682. </div>
  683. </template>
  684. </el-table-column>
  685. <el-table-column
  686. align="center"
  687. prop="eInspectionMethod"
  688. label="检查方法和频率"
  689. >
  690. <template slot-scope="scope">
  691. <el-input
  692. v-model="scope.row.eInspectionMethod"
  693. size="small"
  694. placeholder="请输入内容"
  695. ></el-input>
  696. </template>
  697. </el-table-column>
  698. <el-table-column
  699. align="center"
  700. label="操作"
  701. width="80"
  702. >
  703. <template slot="header">
  704. <el-button
  705. @click="addEleRow(eleForm.elementList)"
  706. type="text"
  707. icon="el-icon-circle-plus-outline"
  708. class="text-icon"
  709. ></el-button>
  710. </template>
  711. <template slot-scope="scope">
  712. <el-button
  713. icon="el-icon-remove-outline"
  714. type="text"
  715. @click="delEleRow(scope.$index,eleForm.elementList)"
  716. class="text-icon text-icon-danger"
  717. ></el-button>
  718. </template>
  719. </el-table-column>
  720. </el-table>
  721. </div>
  722. <span
  723. slot="footer"
  724. class="dialog-footer"
  725. >
  726. <el-button @click="eleVisible = false">取 消</el-button>
  727. <el-button
  728. type="primary"
  729. @click="saveFormAndElementHandle"
  730. >保 存</el-button>
  731. </span>
  732. </el-dialog>
  733. <el-dialog
  734. title="模版导入"
  735. :visible.sync="importVisible"
  736. width="50%"
  737. append-to-body
  738. :close-on-click-modal="false"
  739. >
  740. <p>提示:必须按照系统要求的模版格式上传,否则系统识别无效 <el-link
  741. type="primary"
  742. @click="downloadTmp"
  743. >下载导入模版</el-link>
  744. </p>
  745. <div>
  746. <el-button
  747. size="small"
  748. type="primary"
  749. @click="fileClick2"
  750. >本地上传</el-button>
  751. <input
  752. @change="tmpImport"
  753. type="file"
  754. hidden
  755. ref="file2"
  756. accept=".xls, .xlsx"
  757. >
  758. </div>
  759. <el-table
  760. :data="tempList"
  761. border
  762. style="width: 100%"
  763. >
  764. <el-table-column
  765. align="center"
  766. prop="eName"
  767. label="字段信息"
  768. >
  769. </el-table-column>
  770. <el-table-column
  771. align="center"
  772. prop="eType"
  773. label="数据类型"
  774. width="120"
  775. >
  776. </el-table-column>
  777. <el-table-column
  778. align="center"
  779. prop="eLength"
  780. label="长度"
  781. width="120"
  782. >
  783. </el-table-column>
  784. <el-table-column
  785. align="center"
  786. prop="eAllowDeviation"
  787. label="允许偏差值"
  788. >
  789. </el-table-column>
  790. <el-table-column
  791. align="center"
  792. prop="eInspectionMethod"
  793. label="检查方法和频率"
  794. >
  795. </el-table-column>
  796. </el-table>
  797. <span
  798. slot="footer"
  799. class="dialog-footer"
  800. >
  801. <el-button @click="importVisible = false">取 消</el-button>
  802. <el-button
  803. type="primary"
  804. @click="importHandle"
  805. >确 定</el-button>
  806. </span>
  807. </el-dialog>
  808. <el-dialog
  809. :title="(curEleTable.tableName?curEleTable.tableName:'')+' 元素编辑'"
  810. :visible.sync="editEleVisible"
  811. width="80%"
  812. append-to-body
  813. :close-on-click-modal="false"
  814. >
  815. <p class="font-c-warning">编辑元素信息(请谨慎操作)</p>
  816. <el-table
  817. :data="editEleList"
  818. border
  819. style="width: 100%"
  820. height="400px"
  821. >
  822. <el-table-column
  823. align="center"
  824. type="index"
  825. width="50"
  826. ></el-table-column>
  827. <el-table-column
  828. align="center"
  829. prop="eName"
  830. label="字段信息"
  831. >
  832. <template slot-scope="scope">
  833. <el-input
  834. v-model="scope.row.eName"
  835. size="small"
  836. placeholder="请输入内容"
  837. ></el-input>
  838. </template>
  839. </el-table-column>
  840. <el-table-column
  841. align="center"
  842. prop="eType"
  843. label="数据类型"
  844. width="120"
  845. >
  846. <template slot-scope="scope">
  847. <el-select
  848. v-model="scope.row.eType"
  849. size="small"
  850. placeholder="请选择"
  851. >
  852. <el-option
  853. v-for="item in dataTypeList"
  854. :key="item.id"
  855. :label="item.dictValue"
  856. :value="item.dictKey"
  857. ></el-option>
  858. </el-select>
  859. </template>
  860. </el-table-column>
  861. <el-table-column
  862. align="center"
  863. prop="eLength"
  864. label="长度"
  865. width="120"
  866. >
  867. <template slot-scope="scope">
  868. <el-input
  869. v-model="scope.row.eLength"
  870. size="small"
  871. placeholder="请输入内容"
  872. :disabled="scope.row.eType == 4"
  873. ></el-input>
  874. </template>
  875. </el-table-column>
  876. <el-table-column
  877. align="center"
  878. prop="eAllowDeviation"
  879. label="允许偏差值"
  880. >
  881. <template slot-scope="scope">
  882. <div class="flex">
  883. <el-select
  884. v-model="scope.row.allow"
  885. size="small"
  886. placeholder="请选择"
  887. style="width:120px"
  888. >
  889. <el-option
  890. :key="1"
  891. label="≥"
  892. value="≥"
  893. ></el-option>
  894. <el-option
  895. :key="2"
  896. label="≤"
  897. value="≤"
  898. ></el-option>
  899. <el-option
  900. :key="3"
  901. label="±"
  902. value="±"
  903. ></el-option>
  904. <el-option
  905. :key="4"
  906. label="【】"
  907. value="【】"
  908. ></el-option>
  909. </el-select>
  910. <el-input
  911. v-model="scope.row.deviation"
  912. size="small"
  913. placeholder="请输入内容"
  914. ></el-input>
  915. </div>
  916. </template>
  917. </el-table-column>
  918. <el-table-column
  919. align="center"
  920. prop="eInspectionMethod"
  921. label="检查方法和频率"
  922. >
  923. <template slot-scope="scope">
  924. <el-input
  925. v-model="scope.row.eInspectionMethod"
  926. size="small"
  927. placeholder="请输入内容"
  928. ></el-input>
  929. </template>
  930. </el-table-column>
  931. <el-table-column
  932. align="center"
  933. label="操作"
  934. width="120"
  935. >
  936. <template slot="header">
  937. <el-button
  938. @click="addEleRow(editEleList)"
  939. type="text"
  940. icon="el-icon-circle-plus-outline"
  941. class="text-icon"
  942. ></el-button>
  943. </template>
  944. <template slot-scope="scope">
  945. <el-button
  946. v-if="scope.row.id"
  947. icon="el-icon-remove-outline"
  948. type="text"
  949. @click="delEleRowHandle(scope.$index,editEleList)"
  950. class="text-icon text-icon-danger"
  951. ></el-button>
  952. <div
  953. class="flex"
  954. v-else
  955. >
  956. <el-button
  957. @click="saveNewEle(scope.row)"
  958. type="mini"
  959. >保存</el-button>
  960. <el-button
  961. icon="el-icon-remove-outline"
  962. type="text"
  963. @click="delEleRowHandle(scope.$index,editEleList)"
  964. class="text-icon text-icon-danger"
  965. ></el-button>
  966. </div>
  967. </template>
  968. </el-table-column>
  969. </el-table>
  970. <span
  971. slot="footer"
  972. class="dialog-footer"
  973. >
  974. <el-button @click="editEleVisible = false">取 消</el-button>
  975. <el-button
  976. type="primary"
  977. @click="saveEles"
  978. >确 定</el-button>
  979. </span>
  980. </el-dialog>
  981. <el-dialog
  982. title="元素公式"
  983. :visible.sync="editEleFormulaVisible"
  984. width="800px"
  985. append-to-body
  986. :close-on-click-modal="false"
  987. >
  988. <div class="flex mg-b-10">
  989. <el-input
  990. v-model="formulaInput"
  991. placeholder="请输入内容"
  992. size="samll"
  993. ></el-input>
  994. <el-button type="info">保存</el-button>
  995. </div>
  996. <el-table
  997. :data="editEleList"
  998. border
  999. style="width: 100%"
  1000. height="400px"
  1001. >
  1002. <el-table-column
  1003. align="center"
  1004. prop="eName"
  1005. label="字段信息"
  1006. >
  1007. </el-table-column>
  1008. <el-table-column
  1009. align="center"
  1010. label="操作"
  1011. width="200"
  1012. >
  1013. <template slot-scope="scope">
  1014. <el-link type="primary">公式配置</el-link>
  1015. <el-link
  1016. class="mg-l-10"
  1017. type="danger"
  1018. @click="delEleRowHandle(scope.$index,editEleList)"
  1019. >删除</el-link>
  1020. </template>
  1021. </el-table-column>
  1022. </el-table>
  1023. </el-dialog>
  1024. <el-dialog
  1025. title="导入划分"
  1026. :visible.sync="importTemplateVisible"
  1027. width="800px"
  1028. append-to-body
  1029. :close-on-click-modal="false"
  1030. >
  1031. <div v-loading="importLoading">
  1032. <div>
  1033. <el-link
  1034. type="primary"
  1035. @click="handleDownload"
  1036. >下载导入模版</el-link>
  1037. </div>
  1038. <div class="mg-t-20">
  1039. <el-button
  1040. type="primary"
  1041. @click="fileClick"
  1042. >选择文件</el-button>
  1043. <span
  1044. v-if="upFile"
  1045. class="mg-l-20"
  1046. >{{upFile.name}}</span>
  1047. <input
  1048. @change="fileChange"
  1049. type="file"
  1050. hidden
  1051. ref="file"
  1052. accept=".xls, .xlsx"
  1053. >
  1054. </div>
  1055. <div v-if="!upFile">当前还未选择文件,请选择需要导入的文件</div>
  1056. </div>
  1057. <span
  1058. slot="footer"
  1059. class="dialog-footer"
  1060. >
  1061. <el-button @click="importTemplateVisible = false">取 消</el-button>
  1062. <el-button
  1063. type="primary"
  1064. @click="importTemplateHandle"
  1065. :loading="importLoading"
  1066. >导 入</el-button>
  1067. </span>
  1068. </el-dialog>
  1069. <el-dialog
  1070. title="节点参数"
  1071. :visible.sync="nodeInfoVisible"
  1072. width="800px"
  1073. append-to-body
  1074. class="jiedian"
  1075. :close-on-click-modal="false"
  1076. :show-close="false"
  1077. >
  1078. <div>
  1079. <el-button
  1080. type="text"
  1081. icon="el-icon-s-operation"
  1082. class="right-btn"
  1083. @click="setNodeParameters()"
  1084. ></el-button>
  1085. <div class="flexEnd">
  1086. <i
  1087. class="el-icon-circle-plus marbottom10"
  1088. @click="addNodeInfoTable()"
  1089. style="font-size:24px;color:rgb(37, 193, 99);cursor: pointer;"
  1090. ></i>
  1091. </div>
  1092. <el-table
  1093. :data="nodeInfoTable"
  1094. border
  1095. style="width: 100%"
  1096. height="400"
  1097. >
  1098. <el-table-column
  1099. align="center"
  1100. prop="name"
  1101. label="参数名称"
  1102. >
  1103. <template slot-scope="scope">
  1104. <el-select
  1105. v-model="scope.row.k"
  1106. placeholder="请选择"
  1107. class="w-100p"
  1108. >
  1109. <el-option
  1110. v-for="item in namelist"
  1111. :key="item.k"
  1112. :label="item.name"
  1113. :value="item.k"
  1114. ></el-option>
  1115. </el-select>
  1116. </template>
  1117. </el-table-column>
  1118. <el-table-column
  1119. align="center"
  1120. prop="value"
  1121. label="参数值设置"
  1122. >
  1123. <template slot-scope="scope">
  1124. <el-input v-model="scope.row.v"></el-input>
  1125. </template>
  1126. </el-table-column>
  1127. <el-table-column
  1128. align="center"
  1129. prop="describe"
  1130. label="描述"
  1131. >
  1132. <template slot-scope="scope">
  1133. <el-input v-model="scope.row.remark"></el-input>
  1134. </template>
  1135. </el-table-column>
  1136. <el-table-column
  1137. label="操作"
  1138. width="120"
  1139. align="center"
  1140. >
  1141. <template slot-scope="scope">
  1142. <el-button
  1143. type="text"
  1144. size="small"
  1145. class="text-icon-danger"
  1146. @click="delNodeInfoss(scope.$index)"
  1147. >删除</el-button>
  1148. </template>
  1149. </el-table-column>
  1150. </el-table>
  1151. </div>
  1152. <span
  1153. slot="footer"
  1154. class="dialog-footer"
  1155. >
  1156. <el-button @click="nodeInfoVisible = false">取 消</el-button>
  1157. <el-button
  1158. type="primary"
  1159. @click="nodeInfoSave()"
  1160. >保 存</el-button>
  1161. </span>
  1162. </el-dialog>
  1163. <!-- 设置参数名称 -->
  1164. <el-dialog
  1165. title="设置参数名称"
  1166. :visible.sync="infoNameVisible"
  1167. width="800px"
  1168. append-to-body
  1169. class="jiedian"
  1170. :close-on-click-modal="false"
  1171. >
  1172. <div>
  1173. <div class="flexEnd">
  1174. <i
  1175. class="el-icon-circle-plus marbottom10"
  1176. @click="setParameterName()"
  1177. style="font-size:24px;color:rgb(37, 193, 99);cursor: pointer;"
  1178. ></i>
  1179. </div>
  1180. <el-table
  1181. :data="namelists"
  1182. border
  1183. style="width: 100%"
  1184. height="400"
  1185. >
  1186. <el-table-column
  1187. align="center"
  1188. prop="name"
  1189. label="参数名称"
  1190. >
  1191. <template slot-scope="scope">
  1192. <el-input v-model="scope.row.name"></el-input>
  1193. </template>
  1194. </el-table-column>
  1195. <el-table-column
  1196. align="center"
  1197. prop="key"
  1198. label="参数值KEY"
  1199. >
  1200. <template slot-scope="scope">
  1201. <el-input v-model="scope.row.k"></el-input>
  1202. </template>
  1203. </el-table-column>
  1204. <el-table-column
  1205. align="center"
  1206. prop="describe"
  1207. label="描述"
  1208. >
  1209. <template slot-scope="scope">
  1210. <el-input v-model="scope.row.remark"></el-input>
  1211. </template>
  1212. </el-table-column>
  1213. <el-table-column
  1214. label="操作"
  1215. width="120"
  1216. align="center"
  1217. >
  1218. <template slot-scope="scope">
  1219. <el-button
  1220. type="text"
  1221. size="small"
  1222. class="text-icon-danger"
  1223. @click="delNodeInfo(scope.$index)"
  1224. >删除</el-button>
  1225. </template>
  1226. </el-table-column>
  1227. </el-table>
  1228. </div>
  1229. <span
  1230. slot="footer"
  1231. class="dialog-footer"
  1232. >
  1233. <el-button @click="addParameterName()">保 存</el-button>
  1234. <el-button @click="closeParameter()">关 闭</el-button>
  1235. </span>
  1236. </el-dialog>
  1237. </basic-container>
  1238. </template>
  1239. <script>
  1240. import ManualSorting from '@/components/WbsTree/ManualSorting'
  1241. import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
  1242. import {
  1243. saveFormAndElement, selectFormElements,
  1244. importWbsTree, findWbsTreePrivateSameLevel, wbsTreePrivateSort, parameters, saveOrUpdateBatch, keymap
  1245. } from "@/api/manager/wbstree";
  1246. import {
  1247. saveElement, remove as removeElement, updateBatchElements, getTemplate,
  1248. importWbsElement
  1249. } from "@/api/manager/wbsformelement";
  1250. import { getLazytree, getDetail, update, findNodeTableByCondition as selectByNodeTable, removeTableByCondition as removeTableById } from "@/api/manager/wbsprivate";
  1251. import { findProjectTree as getAlltree } from "@/api/manager/projectinfo";
  1252. import { getList as getAttchFromOriginalName } from "@/api/resource/attach";
  1253. import { getDictionary } from "@/api/system/dict";
  1254. import { mapGetters } from "vuex";
  1255. import { getList, tabLazytreeAll, saveLinkTab, getExcelHtml } from '@/api/exctab/excelmodel'
  1256. export default {
  1257. data () {
  1258. return {
  1259. jiedianId: '',
  1260. //#region
  1261. sortTag: false,
  1262. sortTag2: false,
  1263. sortArray: [],
  1264. //#endregion
  1265. //#region 关联清表
  1266. loading: false,
  1267. GLExcel: false,
  1268. GLExcelFrom: {
  1269. id: "",
  1270. name: '',
  1271. search: '',//搜素框舒服的值
  1272. },
  1273. GLExcelData: [],//
  1274. GLExcelProps: {
  1275. label: 'name',
  1276. children: 'children',
  1277. disabled: 'hasChildren',
  1278. // isLeaf: !'hasChildren',
  1279. },
  1280. exceldata: [],//清表模板
  1281. //#endregion
  1282. //#region 调整表单
  1283. adjustmentExcel: '',
  1284. excelHtml: false,
  1285. //#endregion
  1286. //#region
  1287. id: '',
  1288. projectid: '',
  1289. filterText: '',
  1290. treeData: [],
  1291. treeLoad: false,
  1292. menuShow: false,
  1293. defaultProps: {
  1294. children: 'children',
  1295. label: 'title',
  1296. isLeaf: function (data) {
  1297. return !data.hasChildren;
  1298. }
  1299. },
  1300. leftType: 5,
  1301. curTreeData: {},
  1302. tableData: [],
  1303. nodeDetail: {},
  1304. formData: [],
  1305. editType: 1,
  1306. dialogVisible: false,
  1307. deptCategorylist: [],
  1308. majorDataTypeList: [],
  1309. rules: {
  1310. deptName: [
  1311. { required: true, message: '请输入节点名称', trigger: 'blur' },
  1312. ],
  1313. deptCategory: [
  1314. { required: true, message: '请选择节点类型', trigger: 'change' }
  1315. ]
  1316. },
  1317. eleVisible: false,
  1318. tableTypelist: [],
  1319. dataTypeList: [],
  1320. ownerTypeList: [],
  1321. eleForm: {
  1322. elementList: [],
  1323. },
  1324. eleRules: {
  1325. deptName: [
  1326. { required: true, message: '请输入表名称', trigger: 'blur' },
  1327. ],
  1328. tableType: [
  1329. { required: true, message: '请选择表类型', trigger: 'change' }
  1330. ],
  1331. tableOwner: [
  1332. { required: true, message: '请选择所属方', trigger: 'change' }
  1333. ],
  1334. },
  1335. importVisible: false,
  1336. tempList: [],
  1337. curEleTable: {},
  1338. editEleVisible: false,
  1339. editEleList: [],
  1340. eleReg: /(≥|≤|±|【】)?([^≥≤±【】]*)/,
  1341. editEleFormulaVisible: false,
  1342. formulaInput: '',
  1343. importTemplateVisible: false,
  1344. fileUrl: '',
  1345. upFile: null,
  1346. importLoading: false,
  1347. nodeInfoVisible: false,
  1348. nodeInfoTable: [],
  1349. namelist: [],
  1350. namelists: [],
  1351. infoNameVisible: false,
  1352. //#endregion
  1353. };
  1354. },
  1355. computed: {
  1356. ...mapGetters(["userInfo"]),
  1357. dialogTitle: function () {
  1358. let text = '节点';
  1359. if (this.leftType == 1) {
  1360. text = '新增' + text;
  1361. } else if (this.leftType == 2) {
  1362. text = '编辑' + text;
  1363. }
  1364. return text;
  1365. },
  1366. },
  1367. created () {
  1368. this.init();
  1369. //console.log(this.userInfo)
  1370. },
  1371. methods: {
  1372. //#region
  1373. init () {
  1374. this.id = this.$route.query.wbsid;
  1375. this.projectid = this.$route.query.pid;
  1376. this.getDeptCategorylist();
  1377. this.getTableTypelist();
  1378. this.getDataTypelist();
  1379. this.getOwnerTypelist();
  1380. },
  1381. loadNode (node, resolve) {
  1382. let pid = 0;
  1383. if (node.level != 0) {
  1384. pid = node.data.id
  1385. }
  1386. getLazytree(this.id, pid, this.userInfo.tenant_id, this.projectid).then((res) => {
  1387. let arr = [];
  1388. if (Array.isArray(res.data.data)) {
  1389. arr = res.data.data;
  1390. }
  1391. return resolve(arr);
  1392. })
  1393. },
  1394. getNodeDetail (data, node) {
  1395. let parentName = '';
  1396. if (node.parent.data) {
  1397. parentName = node.parent.data.title;
  1398. }
  1399. this.curTreeData = data;
  1400. this.curTreeData.parentName = parentName;
  1401. getDetail(data.id, this.id, this.projectid).then((res) => {
  1402. res.data.data.parentName = parentName;
  1403. this.tableData = [res.data.data];
  1404. this.nodeDetail = Object.assign({}, res.data.data);
  1405. })
  1406. this.updateNodeTable();
  1407. },
  1408. saveNode () {
  1409. this.$refs['nodeDetail'].validate((valid) => {
  1410. if (valid) {
  1411. if (this.editType == 1) {
  1412. this.addNode();
  1413. } else if (this.editType == 2) {
  1414. this.updateNode();
  1415. }
  1416. } else {
  1417. console.log('error submit!!');
  1418. return false;
  1419. }
  1420. });
  1421. },
  1422. addNode () {
  1423. update(this.nodeDetail).then(() => {
  1424. this.updateTreeNewNode();
  1425. this.dialogVisible = false;
  1426. this.$message({
  1427. type: "success",
  1428. message: "新增成功!"
  1429. });
  1430. })
  1431. },
  1432. updateNode () {
  1433. update(this.nodeDetail).then(() => {
  1434. let node = this.tableData[0];
  1435. node.deptName = this.nodeDetail.deptName;
  1436. node.deptCategory = this.nodeDetail.deptCategory;
  1437. this.curTreeData.title = this.nodeDetail.deptName;
  1438. this.dialogVisible = false;
  1439. this.$message({
  1440. type: "success",
  1441. message: "修改成功!"
  1442. });
  1443. })
  1444. },
  1445. setLeftType (type, data, node) {
  1446. this.jiedianId = data.id
  1447. if (type == 4 || type == 5) {
  1448. this.leftType = type;
  1449. }
  1450. this.curTreeData = data;
  1451. this.$refs.tree.setCurrentKey(data.id);
  1452. if (type == 1 || type == 2) {
  1453. this.getMajorDataTypeList();
  1454. this.dialogVisible = true;
  1455. this.editType = type;
  1456. }
  1457. getDetail(data.id, this.id, this.projectid).then((res) => {
  1458. let parentName = '';
  1459. if (node.parent.data) {
  1460. parentName = node.parent.data.title;
  1461. }
  1462. res.data.data.parentName = parentName;
  1463. this.tableData = [res.data.data];
  1464. if (type == 1) {
  1465. this.nodeDetail = {
  1466. parentId: res.data.data.id,
  1467. parentName: parentName,
  1468. projectId: res.data.data.projectId
  1469. };
  1470. } else {
  1471. this.nodeDetail = Object.assign({}, res.data.data);
  1472. }
  1473. this.nodeDetail.type = 1;// '1'节点 '2'表单
  1474. this.nodeDetail.wbsId = this.id;
  1475. this.nodeDetail.tenantId = this.userInfo.tenant_id
  1476. })
  1477. if (this.leftType == 4) {
  1478. selectByNodeTable(data.id, this.projectid, this.id).then((res) => {
  1479. if (res.data.data.length) {
  1480. this.formData = res.data.data;
  1481. } else {
  1482. this.formData = [];
  1483. }
  1484. })
  1485. }
  1486. },
  1487. showFormElement () {
  1488. if (!this.nodeDetail.id) {
  1489. this.$message({
  1490. type: "warning",
  1491. message: "请先选择在哪个节点下创建表"
  1492. });
  1493. return;
  1494. }
  1495. this.eleVisible = true;
  1496. },
  1497. addEleRow (list) {
  1498. list.push({});
  1499. },
  1500. delEleRow (index, list) {
  1501. list.splice(index, 1);
  1502. },
  1503. saveFormAndElementHandle () {
  1504. this.$refs['eleDialog'].validate((valid) => {
  1505. if (valid) {
  1506. this.eleForm.wbsId = this.id;
  1507. this.eleForm.tenantId = this.userInfo.tenant_id;
  1508. this.eleForm.deptCategory = -1;
  1509. this.eleForm.type = 2;// '1'节点 '2'表单
  1510. this.eleForm.parentId = this.nodeDetail.id;
  1511. this.eleForm.elementList.forEach((element) => {
  1512. element.eAllowDeviation = (element.allow ? element.allow : '') + (element.deviation ? element.deviation : '');
  1513. if (element.eType == 4) {
  1514. element.eLength = 0;
  1515. }
  1516. })
  1517. saveFormAndElement(this.eleForm).then(() => {
  1518. //console.log(res)
  1519. this.updateTreeNewNode();
  1520. this.updateNodeTable();
  1521. this.eleVisible = false;
  1522. this.$message({
  1523. type: "success",
  1524. message: "新增成功!"
  1525. });
  1526. })
  1527. } else {
  1528. console.log('error submit!!');
  1529. return false;
  1530. }
  1531. });
  1532. },
  1533. updateTreeNewNode () {
  1534. getLazytree(this.id, this.nodeDetail.parentId, this.userInfo.tenant_id, this.projectid).then((res) => {
  1535. this.$refs.tree.updateKeyChildren(this.nodeDetail.parentId, res.data.data)
  1536. })
  1537. },
  1538. updateNodeTable () {
  1539. selectByNodeTable(this.curTreeData.id, this.projectid, this.id).then((res) => {
  1540. if (res.data.data.length) {
  1541. this.formData = res.data.data;
  1542. } else {
  1543. this.formData = [];
  1544. }
  1545. })
  1546. },
  1547. importHandle () {
  1548. },
  1549. handleEdit (index, row) {
  1550. this.curEleTable = row;
  1551. selectFormElements(this.curEleTable.id).then((res) => {
  1552. res.data.data.forEach((element) => {
  1553. this.eleReg.exec(element.eAllowDeviation);
  1554. // console.log(RegExp.$1)
  1555. // console.log(RegExp.$2)
  1556. element.allow = RegExp.$1 ? RegExp.$1 : '';
  1557. element.deviation = RegExp.$2 ? RegExp.$2 : '';
  1558. })
  1559. this.editEleList = res.data.data;
  1560. })
  1561. this.editEleVisible = true;
  1562. },
  1563. handleDelete (index, row) {
  1564. this.$confirm('是否删除 ' + row.tableName + ' ?', '删除元素表', {
  1565. distinguishCancelAndClose: true,
  1566. confirmButtonText: '删除',
  1567. cancelButtonText: '取消'
  1568. }).then(() => {
  1569. removeTableById(row.id, this.projectid, this.id).then(() => {
  1570. this.formData.splice(index, 1);
  1571. this.$message({
  1572. type: "success",
  1573. message: "删除成功!"
  1574. });
  1575. })
  1576. })
  1577. },
  1578. handleEditFormula (index, row) {
  1579. this.curEleTable = row;
  1580. selectFormElements(this.curEleTable.id).then((res) => {
  1581. this.editEleList = res.data.data;
  1582. })
  1583. this.editEleFormulaVisible = true;
  1584. },
  1585. saveNewEle (row) {
  1586. row.eAllowDeviation = (row.allow ? row.allow : '') + (row.deviation ? row.deviation : '');
  1587. row.fId = this.curEleTable.id;
  1588. row.initTableName = this.curEleTable.initTableName;
  1589. if (row.eType == 4) {
  1590. row.eLength = 0;
  1591. }
  1592. saveElement(row).then((res) => {
  1593. if (res.data.data) {
  1594. this.$set(row, 'id', res.data.data.id);
  1595. this.$set(row, 'ekey', res.data.data.ekey);
  1596. this.$message({
  1597. type: "success",
  1598. message: "保存成功!"
  1599. });
  1600. }
  1601. })
  1602. },
  1603. delEleRowHandle (index, list) {
  1604. let row = list[index];
  1605. if (row.id) {
  1606. //有id需要请求删除
  1607. this.$confirm('是否确认删除?', '删除元素', {
  1608. distinguishCancelAndClose: true,
  1609. confirmButtonText: '删除',
  1610. cancelButtonText: '取消'
  1611. }).then(() => {
  1612. removeElement(row.id, this.curEleTable.initTableName, row.ekey).then(() => {
  1613. list.splice(index, 1);
  1614. })
  1615. })
  1616. } else {
  1617. list.splice(index, 1);
  1618. }
  1619. },
  1620. saveEles () {
  1621. for (let i = 0; i < this.editEleList.length; i++) {
  1622. if (!this.editEleList[i].id) {
  1623. this.$message({
  1624. type: "warning",
  1625. message: "请先将新增的元素点击保存"
  1626. });
  1627. return;
  1628. }
  1629. }
  1630. if (this.editEleList.length > 0) {
  1631. this.editEleList.forEach((element) => {
  1632. element.eAllowDeviation = (element.allow ? element.allow : '') + (element.deviation ? element.deviation : '');
  1633. if (element.eType == 4) {
  1634. element.eLength = 0;
  1635. }
  1636. })
  1637. updateBatchElements(this.editEleList, this.curEleTable.initTableName).then(() => {
  1638. this.editEleVisible = false;
  1639. this.updateNodeTable();
  1640. this.$message({
  1641. type: "success",
  1642. message: "保存成功!"
  1643. });
  1644. })
  1645. } else {
  1646. this.editEleVisible = false;
  1647. this.updateNodeTable();
  1648. this.$message({
  1649. type: "success",
  1650. message: "保存成功!"
  1651. });
  1652. }
  1653. },
  1654. filterChange () {
  1655. //console.log(this.$refs)
  1656. //debugger
  1657. if (this.treeData.length > 0) {
  1658. this.$refs.treeall.filter(this.filterText);
  1659. return;
  1660. }
  1661. this.treeLoad = true;
  1662. getAlltree(this.projectid, this.id).then((res) => {
  1663. this.treeLoad = false;
  1664. this.treeData = res.data.data;
  1665. this.$nextTick(() => {
  1666. this.$refs.treeall.filter(this.filterText);
  1667. })
  1668. })
  1669. },
  1670. importTemplate (data) {
  1671. this.importTemplateVisible = true;
  1672. this.curTreeData = data;
  1673. if (!this.fileUrl) {
  1674. getAttchFromOriginalName(1, 20, {
  1675. originalName: 'WBS划分模板.xls'
  1676. }).then((res) => {
  1677. if (res.data.data.records.length) {
  1678. this.fileUrl = res.data.data.records[0].link;
  1679. } else {
  1680. this.fileUrl = '';
  1681. }
  1682. })
  1683. }
  1684. },
  1685. importTemplateHandle () {
  1686. if (!this.upFile) {
  1687. this.$message({
  1688. type: "warning",
  1689. message: "请先选择文件再进行导入"
  1690. });
  1691. }
  1692. let forms = new FormData();
  1693. forms.append('excelFile', this.upFile);
  1694. let wbsTreeFu = {
  1695. wbsId: this.id,
  1696. parentId: this.curTreeData.id,
  1697. // ancestors:'0,'+this.curTreeData.id,
  1698. }
  1699. let json = JSON.stringify(wbsTreeFu);
  1700. let blob = new Blob([json], { type: 'application/json' })
  1701. forms.append('wbsTreeFu', blob);
  1702. this.importLoading = true;
  1703. importWbsTree(forms).then(() => {
  1704. //this.$router.go(0)
  1705. let node = this.$refs.tree.getNode(this.curTreeData.id);
  1706. node.isLeaf = false;
  1707. this.importTemplateVisible = false;
  1708. this.upFile = null;
  1709. }).finally(() => {
  1710. this.importLoading = false;
  1711. })
  1712. },
  1713. handleDownload () {
  1714. if (this.fileUrl) {
  1715. window.open(this.fileUrl);
  1716. } else {
  1717. this.$message({
  1718. type: "warning",
  1719. message: "请先在附件管理上传【WBS划分模板.xls】文件"
  1720. });
  1721. }
  1722. },
  1723. fileClick () {
  1724. this.$refs.file.click();
  1725. },
  1726. fileChange (e) {
  1727. const file = e.target.files[0]
  1728. if (!file) {
  1729. // 如果用户没有选择图片,只是点了文件上传这个按钮
  1730. return
  1731. }
  1732. //console.log(file)
  1733. this.upFile = file;
  1734. },
  1735. editNodeInfo (index, row) {
  1736. this.$set(row, 'isEdit', true);
  1737. },
  1738. saveNodeInfoHandle (index, row) {
  1739. row.isEdit = false;
  1740. },
  1741. downloadTmp () {
  1742. getTemplate().then((res) => {
  1743. //console.log(res)
  1744. let blob = new Blob([res.data], {
  1745. type: 'application/vnd.ms-excel'
  1746. });
  1747. //console.log(blob)
  1748. let filename = Date.parse(new Date()) + '.xls';
  1749. if (window.navigator.msSaveOrOpenBlob) {
  1750. // 兼容IE10
  1751. window.navigator.msSaveBlob(blob, filename);
  1752. } else {
  1753. // 兼容chrome/firefox
  1754. let aTag = document.createElement('a');
  1755. aTag.download = Date.parse(new Date()) + '.xls';
  1756. aTag.href = window.URL.createObjectURL(blob);
  1757. aTag.click();
  1758. URL.revokeObjectURL(aTag.href);
  1759. }
  1760. })
  1761. },
  1762. fileClick2 () {
  1763. this.$refs.file2.click();
  1764. },
  1765. tmpImport (e) {
  1766. const file = e.target.files[0];
  1767. const formData = new FormData();
  1768. formData.append('file', file);
  1769. //console.log(file.name)
  1770. importWbsElement(formData).then((res) => {
  1771. res.data.data.forEach((element) => {
  1772. element.eName = element.elementName;
  1773. element.eLength = element.elementLength;
  1774. element.eType = Number(element.elementType);
  1775. element.eAllowDeviation = element.elementAllowDeviation;
  1776. element.eInspectionMethod = element.elementInspectionMethod;
  1777. this.eleReg.exec(element.eAllowDeviation);
  1778. // console.log(RegExp.$1)
  1779. // console.log(RegExp.$2)
  1780. element.allow = RegExp.$1 ? RegExp.$1 : '';
  1781. element.deviation = RegExp.$2 ? RegExp.$2 : '';
  1782. })
  1783. this.eleForm.elementList = res.data.data;
  1784. this.importVisible = false;
  1785. }).finally(() => {
  1786. e.target.value = '';
  1787. })
  1788. },
  1789. visiblechange (value, data) {
  1790. this.$set(data, 'moreShow', value)
  1791. },
  1792. getDeptCategorylist () {
  1793. if (this.deptCategorylist.length > 1) {
  1794. return;
  1795. }
  1796. getDictionary({
  1797. code: 'wbs_node_type'
  1798. }).then((res) => {
  1799. res.data.data.forEach(element => {
  1800. element.dictKey = Number(element.dictKey)
  1801. });
  1802. this.deptCategorylist = res.data.data;
  1803. })
  1804. },
  1805. getMajorDataTypeList () {
  1806. if (this.majorDataTypeList.length > 1) {
  1807. return;
  1808. }
  1809. getDictionary({
  1810. code: 'major_data_type'
  1811. }).then((res) => {
  1812. res.data.data.forEach(element => {
  1813. element.dictKey = Number(element.dictKey)
  1814. });
  1815. this.majorDataTypeList = res.data.data;
  1816. })
  1817. },
  1818. getTableTypelist () {
  1819. if (this.tableTypelist.length > 1) {
  1820. return;
  1821. }
  1822. getDictionary({
  1823. code: 'table_type'
  1824. }).then((res) => {
  1825. res.data.data.forEach(element => {
  1826. element.dictKey = Number(element.dictKey)
  1827. });
  1828. this.tableTypelist = res.data.data;
  1829. })
  1830. },
  1831. getDataTypelist () {
  1832. if (this.dataTypeList.length > 1) {
  1833. return;
  1834. }
  1835. getDictionary({
  1836. code: 'data_type'
  1837. }).then((res) => {
  1838. res.data.data.forEach(element => {
  1839. element.dictKey = Number(element.dictKey)
  1840. });
  1841. this.dataTypeList = res.data.data;
  1842. })
  1843. },
  1844. getOwnerTypelist () {
  1845. if (this.ownerTypeList.length > 1) {
  1846. return;
  1847. }
  1848. getDictionary({
  1849. code: 'owner_type'
  1850. }).then((res) => {
  1851. res.data.data.forEach(element => {
  1852. element.dictKey = Number(element.dictKey)
  1853. });
  1854. this.ownerTypeList = res.data.data;
  1855. })
  1856. },
  1857. formatCat (row, column, cellValue) {
  1858. for (let i = 0; i < this.deptCategorylist.length; i++) {
  1859. if (this.deptCategorylist[i].dictKey == cellValue) {
  1860. return this.deptCategorylist[i].dictValue
  1861. }
  1862. }
  1863. return cellValue;
  1864. //console.log(cellValue)
  1865. },
  1866. formatTableType (row, column, cellValue) {
  1867. for (let i = 0; i < this.tableTypelist.length; i++) {
  1868. if (this.tableTypelist[i].dictKey == cellValue) {
  1869. return this.tableTypelist[i].dictValue
  1870. }
  1871. }
  1872. return cellValue;
  1873. //console.log(cellValue)
  1874. },
  1875. formatOwner (row, column, cellValue) {
  1876. for (let i = 0; i < this.ownerTypeList.length; i++) {
  1877. if (this.ownerTypeList[i].dictKey == cellValue) {
  1878. return this.ownerTypeList[i].dictValue
  1879. }
  1880. }
  1881. return cellValue;
  1882. //console.log(cellValue)
  1883. },
  1884. formatdataType (row, column, cellValue) {
  1885. for (let i = 0; i < this.dataTypeList.length; i++) {
  1886. if (this.dataTypeList[i].dictKey == cellValue) {
  1887. return this.dataTypeList[i].dictValue
  1888. }
  1889. }
  1890. return cellValue;
  1891. },
  1892. filterNode (value, data) {
  1893. if (!value) return true;
  1894. return data.title.indexOf(value) !== -1;
  1895. },
  1896. //#endregion
  1897. //#region wbs私有树排序
  1898. async sortpai (data) {
  1899. console.log(data);
  1900. await this.findWbsTreePrivateSameLevel({
  1901. parentId: data.parentId,
  1902. projectId: this.projectid,
  1903. wbsId: this.id
  1904. })
  1905. this.sortTag = true
  1906. this.sortTag2 = true
  1907. },
  1908. editSort () {
  1909. this.wbsTreePrivateSort()
  1910. },
  1911. bianhua () {
  1912. this.sortTag2 = false
  1913. this.$nextTick(() => {
  1914. this.sortTag2 = true
  1915. })
  1916. },
  1917. async wbsTreePrivateSort () {//wbs私有树节点手动排序
  1918. const { data: res } = await wbsTreePrivateSort(this.sort)
  1919. console.log(res);
  1920. if (res.code == 200) {
  1921. this.sortTag = false
  1922. this.sortTag2 = false
  1923. this.getLazytreessss()
  1924. }
  1925. },
  1926. async findWbsTreePrivateSameLevel (da) {//wbs私有树同级节点接口
  1927. const { data: res } = await findWbsTreePrivateSameLevel(da)
  1928. console.log(res);
  1929. if (res.code == 200) {
  1930. this.sort = res.data
  1931. }
  1932. },
  1933. async getLazytreessss () {
  1934. const { data: res } = await getLazytree(this.id, 0, this.userInfo.tenant_id, this.projectid)
  1935. console.log(res);
  1936. if (res.code == 200) {
  1937. this.treeData = res.data
  1938. }
  1939. },
  1940. //#endregion
  1941. //#region 关联清表
  1942. async getList (da) {//获取清表模板信息
  1943. const { data: res } = await getList(da)
  1944. console.log(res);
  1945. if (res.code === 200 && res.msg === '操作成功') {
  1946. this.GLExcelData = res.data.records
  1947. }
  1948. },
  1949. async tabLazytreeAll () {//清表树信息
  1950. const { data: res } = await tabLazytreeAll({
  1951. modeId: this.GLExcelFrom.name,
  1952. name: this.GLExcelFrom.search,
  1953. })
  1954. console.log(res);
  1955. if (res.code === 200 && res.msg === '操作成功') {
  1956. this.exceldata = res.data
  1957. }
  1958. },
  1959. Associationlist (scope) {//关联清表点击事件
  1960. console.log(scope.row);
  1961. this.GLExcel = true
  1962. this.getList({
  1963. current: 1,
  1964. size: 100000,
  1965. parentId: 0
  1966. })
  1967. this.GLExcelFrom.name = scope.row.modeId
  1968. setTimeout(() => {
  1969. this.$refs.tree.setCheckedKeys([scope.row.excelId])
  1970. }, 2000)
  1971. this.GLExcelFrom.id = scope.row.pkeyId
  1972. },
  1973. changetherr () {//清表类型选择框change事件
  1974. if (this.GLExcelFrom.name != "") {
  1975. this.GLExcelFrom.search = ''
  1976. this.tabLazytreeAll()
  1977. }
  1978. },
  1979. GLExcelMD () {//弹框关闭事件
  1980. this.GLExcelFrom.name = ""
  1981. this.GLExcelFrom.search = ''
  1982. this.GLExcelFrom.id = ''
  1983. this.exceldata = []
  1984. this.$refs.tree.setCheckedKeys([])
  1985. this.GLExcel = false
  1986. },
  1987. checkchange (data) {//节点选中回调
  1988. if (this.$refs.tree.getCheckedNodes().length === 0) {
  1989. this.$refs.tree.setCheckedKeys([])
  1990. } else if (this.$refs.tree.getCheckedNodes().length >= 1) {
  1991. this.$refs.tree.setCheckedKeys([data.id])
  1992. }
  1993. },
  1994. async saveLinkTab () {//保存按钮
  1995. if (this.$refs.tree.getCheckedNodes.length > 0) {
  1996. const { data: res } = await saveLinkTab({
  1997. exceTabId: this.$refs.tree.getCheckedNodes()[this.$refs.tree.getCheckedNodes().length - 1].id,
  1998. tabId: this.GLExcelFrom.id,
  1999. })
  2000. console.log(res);
  2001. if (res.code === 200) {
  2002. this.$message({
  2003. type: 'success',
  2004. message: '关联清表成功',
  2005. })
  2006. this.GLExcel = false
  2007. this.GLExcelMD()
  2008. selectByNodeTable(this.jiedianId, this.projectid, this.id).then((res) => {
  2009. if (res.data.data.length) {
  2010. this.formData = res.data.data;
  2011. } else {
  2012. this.formData = [];
  2013. }
  2014. })
  2015. }
  2016. } else {
  2017. this.$message({
  2018. type: 'success',
  2019. message: '请先设置清表',
  2020. })
  2021. }
  2022. },
  2023. filterNode222 (value, data) {
  2024. if (!value) return true;
  2025. return data.name.indexOf(value) !== -1;
  2026. },
  2027. //#endregion
  2028. //#region 节点参数
  2029. nodeInfo (data) {//节点参数按钮
  2030. this.keymap()
  2031. this.jiedianId = data.primaryKeyId
  2032. this.parameters(data.primaryKeyId)
  2033. this.nodeInfoVisible = true;
  2034. },
  2035. addNodeInfoTable () {//添加节点参数数据
  2036. this.nodeInfoTable.unshift({ k: '', v: '', remark: '', wbsId: this.jiedianId })
  2037. },
  2038. delNodeInfo (key) {//设置参数名称中的删除按钮
  2039. this.namelists.splice(key, 1)
  2040. },
  2041. delNodeInfoss (key) {//节点参数
  2042. this.nodeInfoTable.splice(key, 1)
  2043. },
  2044. setNodeParameters () {//打开设置节点参数弹框按钮
  2045. this.infoNameVisible = true
  2046. this.namelists = [...this.namelist]
  2047. },
  2048. async setParameterName () {//设置参数名称中添加节点参数按钮
  2049. // wbsId: this.jiedianId
  2050. this.namelists.unshift({ name: '', remark: '', k: '', type: 0, })
  2051. },
  2052. async nodeInfoSave () {//节点参数弹框保存按钮
  2053. if (this.nodeInfoTable) {
  2054. let tag = true
  2055. this.nodeInfoTable.forEach(val => {
  2056. if (!val.k | !val.v) {
  2057. return tag = false
  2058. }
  2059. })
  2060. if (tag) {
  2061. await this.saveOrUpdateBatch(this.nodeInfoTable)
  2062. this.nodeInfoVisible = false
  2063. this.$message({
  2064. type: "success",
  2065. message: "设置参数节点成功!"
  2066. })
  2067. } else {
  2068. this.$message({
  2069. type: "error",
  2070. message: "请填写所有的参数名称和参数值!"
  2071. })
  2072. }
  2073. } else {
  2074. this.$message({
  2075. type: "error",
  2076. message: "请先设置参数节点!"
  2077. })
  2078. }
  2079. },
  2080. async addParameterName () {//设置参数名称中的保存按钮
  2081. if (this.namelists) {
  2082. let tag = true
  2083. this.namelists.forEach(val => {
  2084. if (!val.name || !val.k) {
  2085. return tag = false
  2086. }
  2087. })
  2088. if (tag) {
  2089. await this.saveOrUpdateBatch(this.namelists) //保存设置参数
  2090. this.infoNameVisible = false
  2091. this.keymap()
  2092. } else {
  2093. this.$message({
  2094. type: "error",
  2095. message: "请填写所有的参数名称和参数值KEY!"
  2096. })
  2097. }
  2098. } else {
  2099. this.$message({
  2100. type: "error",
  2101. message: "请设置参数"
  2102. })
  2103. }
  2104. },
  2105. closeParameter () {//设置参数名称,关闭按钮
  2106. this.namelists = []
  2107. this.infoNameVisible = false
  2108. },
  2109. async parameters (wbsId) {//获取接待你参数列表
  2110. const { data: res } = await parameters({ wbsId })
  2111. console.log(res);
  2112. if (res.code == 200) {
  2113. this.nodeInfoTable = res.data
  2114. }
  2115. },
  2116. async saveOrUpdateBatch (da) {//保存
  2117. const { data: res } = await saveOrUpdateBatch(da)
  2118. console.log(res);
  2119. },
  2120. async keymap () {//节点参数枚举
  2121. const { data: res } = await keymap()
  2122. console.log(res);
  2123. if (res.code = 200) {
  2124. this.namelist = res.data
  2125. }
  2126. },
  2127. //#endregion
  2128. //#region 调整表单
  2129. adjustExcel (pkeyId, excelId) {//调整表单
  2130. this.GLExcelFrom.id = pkeyId
  2131. this.getExcelHtml(excelId)
  2132. },
  2133. async getExcelHtml (excelId) {
  2134. const { data: res } = await getExcelHtml({ excelId })
  2135. console.log(res);
  2136. if (res.code === 200) {
  2137. localStorage.setItem('excelHtml', res.data)
  2138. this.adjustmentExcel = res.data
  2139. this.excelHtml = true
  2140. }
  2141. },
  2142. removeExcel () {
  2143. this.excelHtml = false
  2144. },
  2145. //#endregion
  2146. //#region 编辑元素
  2147. async rightClick (pkeyId, excelId, id, initTableName) {
  2148. await this.getExcelHtml2(excelId)
  2149. this.$router.push({
  2150. path: '/project/editElement',
  2151. query: {
  2152. pkeyId: pkeyId,
  2153. excelId: excelId,
  2154. id: id,
  2155. initTableName
  2156. }
  2157. })
  2158. },
  2159. async getExcelHtml2 (excelId) {
  2160. const { data: res } = await getExcelHtml({ excelId })
  2161. console.log(res);
  2162. if (res.code === 200) {
  2163. localStorage.setItem('editElement', res.data)
  2164. }
  2165. },
  2166. //#endregion
  2167. },
  2168. watch: {
  2169. 'GLExcelFrom.search' (val) {
  2170. console.log(val);
  2171. if (this.exceldata) {
  2172. this.$refs.tree.filter(val);
  2173. }
  2174. }
  2175. },
  2176. components: {
  2177. dynamicExcel,
  2178. ManualSorting,
  2179. },
  2180. };
  2181. </script>
  2182. <style scoped lang="scss">
  2183. .font-s-12 /deep/ .iconfont {
  2184. font-size: 12px;
  2185. }
  2186. .el-popper[x-placement^="bottom"] {
  2187. margin-top: -6px;
  2188. }
  2189. .right-btn {
  2190. position: absolute;
  2191. right: 20px;
  2192. top: 10px;
  2193. font-size: 20px;
  2194. }
  2195. .custom-tree-node {
  2196. .normal-black {
  2197. display: none;
  2198. }
  2199. &:hover {
  2200. .normal-black {
  2201. display: block;
  2202. }
  2203. }
  2204. &.show .normal-black {
  2205. display: block;
  2206. }
  2207. }
  2208. .excelBox {
  2209. /deep/.el-dialog__body {
  2210. padding: 20px;
  2211. }
  2212. }
  2213. //调整表单样式
  2214. .excelHtml {
  2215. position: absolute;
  2216. z-index: 999999;
  2217. top: 50px;
  2218. left: 0px;
  2219. width: 100%;
  2220. height: 100%;
  2221. }
  2222. .jiedian {
  2223. /deep/.el-dialog__body {
  2224. padding: 10px 20px !important;
  2225. }
  2226. }
  2227. </style>