databaseList.vue 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612
  1. <template>
  2. <div class="database_container">
  3. <div class="database_top">
  4. <div class="top-left">
  5. <el-button v-permission="permissionBtn.edbDataPermission.edbData_addEdb"
  6. type="primary" @click="addHandler"><!-- 添加指标 -->{{$t('EtaBasePage.add_edb_btn')}}</el-button>
  7. <el-button v-permission="permissionBtn.edbDataPermission.edbData_calcuEdb"
  8. type="primary" @click="addComputedHandler"><!-- 计算指标 -->{{$t('EtaBasePage.calculation_edb_btn')}}</el-button>
  9. <el-button v-permission="permissionBtn.edbDataPermission.edbData_replaceEdb"
  10. type="primary" @click="replaceEdbHandler"><!-- 替换指标 -->{{$t('EtaBasePage.replace_edb_btn')}}</el-button>
  11. <el-button v-permission="permissionBtn.edbDataPermission.edbData_codeRun"
  12. type="primary" @click="$router.push({path: '/codecount'})"><!-- 代码运算 -->{{$t('EtaBasePage.algorithm_btn')}}</el-button>
  13. <el-button v-permission="permissionBtn.edbDataPermission.edbData_dataAdjust"
  14. type="primary" @click="$router.push({path: '/adjustdata'})"><!-- 数据调整 -->{{$t('EtaBasePage.adjustment_btn')}}</el-button>
  15. <!-- <el-button v-permission="permissionBtn.edbDataPermission.edbData_batchUpdate"
  16. type="primary" plain @click="updateHandler">一键刷新</el-button> -->
  17. </div>
  18. <div class="top-right">
  19. <change-lang
  20. v-permission="permissionBtn.edbDataPermission.edbData_switchEn"
  21. :lang="currentLang"
  22. style="height: 32px;"
  23. @changeLang="changeLanguage"
  24. />
  25. <el-select
  26. v-model="search_txt"
  27. v-loadMore="searchLoad"
  28. ref="searchRef"
  29. :filterable="!search_txt"
  30. remote
  31. clearable
  32. :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
  33. style="width: 260px;"
  34. :remote-method="searchHandle"
  35. @click.native="inputFocusHandle"
  36. >
  37. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  38. <el-option
  39. v-for="item in searchOptions"
  40. :key="item.EdbInfoId"
  41. :label="currentLang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName"
  42. :value="item.EdbInfoId"
  43. >
  44. <div>
  45. <img
  46. :src="$icons.lock_ico2"
  47. width="18"
  48. height="18"
  49. style="vertical-align:middle"
  50. v-if="!item.HaveOperaAuth"
  51. />
  52. {{currentLang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName}}
  53. </div>
  54. </el-option>
  55. </el-select>
  56. </div>
  57. </div>
  58. <div class="database-label">
  59. <edb-label-list
  60. :currentLang="currentLang"
  61. :labelList="labelList"
  62. :activeLabelId="select_node"
  63. @clickLabel="changeCurrentLabel"
  64. @deleteLabel="deleteLabel"
  65. @moveLabel="({oldIndex,newIndex})=>{labelList[oldIndex] = labelList.splice(newIndex, 1, labelList[oldIndex])[0];}"
  66. />
  67. </div>
  68. <div class="database_main box" id="box" v-if="showData">
  69. <!-- 展开收起目录按钮 -->
  70. <span
  71. v-show="!isMainLeftShow"
  72. class="slide-btn-icon slide-right"
  73. @click="isMainLeftShow = !isMainLeftShow"
  74. >
  75. <i :class="{'el-icon-d-arrow-left':isMainLeftShow,'el-icon-d-arrow-right':!isMainLeftShow}"></i>
  76. </span>
  77. <!-- <target-tree /> -->
  78. <div class="main-left left" id="left" v-show="isMainLeftShow">
  79. <div class="tree-cont">
  80. <div style="padding-bottom:20px;padding-right:20px;display:flex;justify-content:space-between">
  81. <span>目录</span>
  82. <el-checkbox
  83. v-model="IsOnlyMe"
  84. @change="onlyMeHandler"
  85. >只看我的</el-checkbox>
  86. </div>
  87. <div class="target_tree">
  88. <el-tree
  89. ref="menuTree"
  90. :data="treeData"
  91. node-key="UniqueCode"
  92. :props="defaultProp"
  93. :allow-drag="canDragHandle"
  94. :allow-drop="canDropHandle"
  95. :current-node-key="select_node"
  96. :default-expanded-keys="defaultShowNodes"
  97. :draggable="isEdbBtnShow('moveCatalog')"
  98. :expand-on-click-node="false"
  99. check-strictly
  100. empty-text="暂无目录"
  101. lazy
  102. :load="getLazyTreeData"
  103. @node-expand="handleNodeExpand"
  104. @node-collapse="handleNodeCollapse"
  105. @current-change="nodeChange"
  106. @node-drop="dropOverHandle"
  107. @node-drag-end="dropMouseLeave"
  108. @node-drag-leave="dropMouseLeave"
  109. @node-drag-enter="dropMouseOver"
  110. >
  111. <span
  112. class="custom-tree-node"
  113. slot-scope="{ node, data }"
  114. >
  115. <el-input
  116. ref="editVal"
  117. style="width: 90px"
  118. placeholder="请输入值"
  119. class="label-input"
  120. v-model="new_label"
  121. v-if="data.isEdit&&isEdbBtnShow('editCatalog')"
  122. @blur="changeValue(node, data)"
  123. />
  124. <span
  125. @dblclick.stop="editNodeLabel(node, data)"
  126. v-else
  127. class="text_oneLine node_label"
  128. :style="`width:${(select_node === data.UniqueCode && node.Nodewidth) || ''}`"
  129. :id="`node${data.UniqueCode}`"
  130. >
  131. <img
  132. :src="$icons.lock_ico2"
  133. width="18"
  134. height="18"
  135. style="vertical-align:middle"
  136. v-if="!data.HaveOperaAuth&&data.EdbInfoId"
  137. />
  138. <span>{{ currentLang==='en' ? (data.ClassifyNameEn||data.ClassifyName) : data.ClassifyName }}</span>
  139. </span>
  140. <span
  141. style="display: flex; align-items: center"
  142. v-if="select_node===data.UniqueCode&&data.HaveOperaAuth"
  143. >
  144. <img
  145. src="~@/assets/img/data_m/move_ico.png"
  146. alt=""
  147. style="width: 14px; height: 14px; margin-right: 8px"
  148. v-if="data.Button.MoveButton&&isEdbBtnShow('moveCatalog')"
  149. />
  150. <!-- 添加子项 -->
  151. <img
  152. src="~@/assets/img/set_m/add.png"
  153. alt=""
  154. style="width: 14px; height: 14px; margin-right: 8px"
  155. @click.stop="addNode(node,data)"
  156. v-if="data.Button.AddButton&&isEdbBtnShow('editCatalog')&&node.level<6"
  157. />
  158. <!-- 编辑节点 如果是分类,判断data.Button.OpButton不变;如果是指标,不显示(ETA1.0.3) -->
  159. <img
  160. src="~@/assets/img/set_m/edit.png"
  161. alt=""
  162. style="width: 15px; height: 14px; margin-right: 8px"
  163. @click.stop="editNode(node,data)"
  164. v-if="!data.EdbCode&&(data.Button.OpButton)&&isEdbBtnShow('editCatalog')"
  165. />
  166. <!-- 删除节点 如果是分类,判断data.Button.DeleteButton不变;如果是指标,不显示(ETA1.0.3) -->
  167. <img
  168. slot="reference"
  169. src="~@/assets/img/set_m/del.png"
  170. alt=""
  171. style="width: 14px; height: 14px;"
  172. @click.stop="removeNode(node,data)"
  173. v-if="!data.EdbCode&&(data.Button.DeleteButton)&&isEdbBtnShow('deleteCatalog')"
  174. />
  175. <!-- 查看计算指标 -->
  176. <i class="el-icon-view"
  177. v-if="data.EdbType===2&&![58,59,67,68,74].includes(data.Source)&&isEdbBtnShow('checkCalcChart')"
  178. @click.stop="viewNode(node,data)"></i>
  179. <!-- 查看关联图表 -->
  180. <img
  181. v-if="data.Button.ShowChartRelation&&isEdbBtnShow('checkRelatedChart')"
  182. @click.stop="showAssociateChart=true,showAssociateComputeData=false"
  183. src="~@/assets/img/icons/associate_chart.png"
  184. style="width: 14px; height: 14px;margin-left: 8px"
  185. alt=""
  186. />
  187. <!-- 查看关联指标 -->
  188. <img
  189. v-if="data.Button.ShowEdbRelation&&isEdbBtnShow('checkRelatedEdb')"
  190. @click.stop="showAssociateComputeData=true,showAssociateChart=false"
  191. src="~@/assets/img/icons/associate_data.png"
  192. style="width: 14px; height: 14px;margin-left: 8px"
  193. alt=""
  194. />
  195. </span>
  196. </span>
  197. </el-tree>
  198. </div>
  199. <div class="noDepart" @click="addLevelOneHandle" v-if="CanOpClassify&&isEdbBtnShow('editCatalog')">
  200. <img
  201. src="~@/assets/img/set_m/add_ico.png"
  202. alt=""
  203. style="width: 16px; height: 16px; margin-right: 10px"
  204. />
  205. <span>{{$t('EtaBasePage.add_first_menu_btn')}}</span>
  206. </div>
  207. </div>
  208. <span class="move-btn resize" v-drag id="resize" @mousemove="dynamicNode&&resetNodeStyle(dynamicNode)">
  209. </span>
  210. <span
  211. v-show="isMainLeftShow"
  212. class="slide-btn-icon slide-left"
  213. @click="isMainLeftShow = !isMainLeftShow"
  214. >
  215. <i :class="{'el-icon-d-arrow-left':isMainLeftShow,'el-icon-d-arrow-right':!isMainLeftShow}"></i>
  216. </span>
  217. </div>
  218. <!-- 指标关联图模块 -->
  219. <div class="main-right right" id="right" style="background:transparent;border:none;box-shadow:none" v-if="showAssociateChart">
  220. <dataAssociateChart :edbInfoId="selected_edbid"></dataAssociateChart>
  221. </div>
  222. <div class="main-right right" id="right" style="background:transparent;border:none;box-shadow:none;padding-top: 30px;box-sizing: border-box;" v-if="showAssociateComputeData">
  223. <dataAssociateComputeData :edbInfoId="selected_edbid"></dataAssociateComputeData>
  224. </div>
  225. <!-- 指标图表列表 -->
  226. <div class="main-right right list" id="right" v-show="isShowList">
  227. <p>{{$t('EtaBasePage.total_show',{limit: Total||0})}}</p>
  228. <div class="list-wrap" ref="listRef" @scroll="loadMoreHandle" v-if="Total">
  229. <div class="chart-list-item-wrap">
  230. <div class="list-item" v-for="item in chartList" :key="item.EdbInfoId">
  231. <div class="header">
  232. <span v-show="currentLang=='ch'">{{ item.EdbName }}</span>
  233. <span v-show="currentLang=='en'">{{ item.EdbNameEn || item.EdbName }}</span>
  234. </div>
  235. <div class="image" @click="detailShowHandle(item)"
  236. :style="{background: `no-repeat top/cover url('${!item.HaveOperaAuth ? $icons.lock_big : item.ChartImage}')`}">
  237. </div>
  238. <div class="info">
  239. {{$t('EtaBasePage.time_show')}}:{{item.CreateTime.substring(0,10)}}
  240. </div>
  241. </div>
  242. </div>
  243. </div>
  244. <div v-if="!Total" class="nodata">
  245. <tableNoData :text="$t('Table.no_edb_msg')"/>
  246. </div>
  247. </div>
  248. <!-- 指标详情 -->
  249. <div class="main-right right detail-wrap" id="right" v-show="isShowDetail">
  250. <div class="detail" v-if="EdbData.HaveOperaAuth">
  251. <div class="header">
  252. <el-tabs v-model="activeTab" @tab-click="rePainChart">
  253. <el-tab-pane :label="$t('Edb.trend_chart_tab')" name="Chart">
  254. </el-tab-pane>
  255. <el-tab-pane :label="$t('Edb.data_detail_tab')" name="Data">
  256. </el-tab-pane>
  257. </el-tabs>
  258. <div class="edb-tool-icon edb-tool" style="align-items: center;">
  259. <el-button
  260. v-if="isEdbBtnShow('update')"
  261. type="text"
  262. @click="refreshTargetHandle"
  263. >{{$t('Edb.detail_refresh_btn')}}<!-- 刷新 --></el-button>
  264. <el-button
  265. v-if="isEdbBtnShow('edit')"
  266. type="text"
  267. :disabled="!(EdbData.Button.OpButton)"
  268. @click="editNode({},EdbData)"
  269. >{{$t('Edb.detail_edit_btn')}}<!-- 编辑 --></el-button>
  270. <!-- 指保存指标的上下限,在走势图才显示 -->
  271. <el-button
  272. v-if="activeTab==='Chart'&&isEdbBtnShow('saveEdb')"
  273. type="text"
  274. @click.stop="saveEdbLimit"
  275. >{{$t('Edb.detail_save_btn')}}<!-- 保存 --></el-button>
  276. <el-button
  277. v-if="EdbData.EdbType===2&&isEdbBtnShow('toSource')"
  278. type="text"
  279. @click="toHistoryPage(selected_edbid,$route.matched);lookEdbId=selected_edbid"
  280. >{{$t('Edb.detail_trace_btn')}}<!-- 指标溯源 --></el-button>
  281. <el-popover
  282. v-if="showPopver"
  283. placement="bottom-end"
  284. trigger="hover"
  285. popper-class="edb-tool-popover"
  286. width="300" style="display: inline-block;"
  287. >
  288. <div class="edb-tool-wrap">
  289. <el-button
  290. v-if="isEdbBtnShow('setEn')"
  291. type="text"
  292. @click="openEnNameDia"
  293. >{{$t('Edb.detail_en_btn')}}<!-- 设置英文名称 --></el-button>
  294. <el-button
  295. v-if="EdbData.Button.InsertNewDataButton&&isEdbBtnShow('newValue')"
  296. type="text"
  297. @click.stop="updateNewestDataHandle"
  298. >{{(EdbData.DataInsertConfig.Date)?$t('Edb.detail_edit_latest'):$t('Edb.detail_add_latest')}}<!-- 添加最新值 --></el-button>
  299. <el-button
  300. v-if="EdbData.EdbType===2&&isEdbBtnShow('calculateAgain')"
  301. type="text"
  302. @click.stop="reCalculateHandler"
  303. :loading="calculateLoading"
  304. >{{$t('Edb.detail_recalculate_btn')}}<!-- 重新计算 --></el-button>
  305. <el-button
  306. v-if="EdbData.EdbType===1&&isEdbBtnShow('refreshAll')"
  307. type="text"
  308. @click.stop="refreshBaseHandler"
  309. :loading="refreshLoading"
  310. >{{$t('Edb.detail_refresh_all')}}<!-- 全部刷新 --></el-button>
  311. <el-button
  312. v-if="isEdbBtnShow('copyData')"
  313. type="text"
  314. @click="copyCode"
  315. >{{$t('Edb.detail_copydata_btn')}}<!-- 复制数据 --></el-button>
  316. <el-button
  317. v-if="EdbData.Button.DeleteButton&&isEdbBtnShow('deleteEdb')"
  318. type="text"
  319. @click="removeNode(_,EdbData)"
  320. style="color:#C54322;"
  321. >{{$t('Edb.detail_del_btn')}}<!-- 删除 --></el-button>
  322. </div>
  323. <div class="edb-btn" slot="reference">
  324. <el-button type="text">{{$t('Edb.detail_more_btn')}}<!-- 更多操作 --></el-button>
  325. <i class="el-icon-more" style="font-size: 14px;transform: rotate(90deg);cursor: pointer;color: #3375e1;"/>
  326. </div>
  327. </el-popover>
  328. </div>
  329. </div>
  330. <div class="container" id="detail-container">
  331. <div class="chart" v-show="activeTab==='Chart'">
  332. <chart-trend-render
  333. :edbid="selected_edbid"
  334. :chartLang="currentLang"
  335. :isShowChartBasis="isEdbBtnShow('showChartBasis')"
  336. :isAllowSwitchSeason="isEdbBtnShow('switchSeason')"
  337. :isAllowEditLimit="isEdbBtnShow('editLimit')"
  338. ref="createChart"
  339. @editEnName="openEnNameDia"/>
  340. <div class="info">
  341. <span>{{$t('Edb.Detail.source')}}:{{EdbData.SourceName}}</span>
  342. <span>{{$t('Edb.creater')}}:{{EdbData.SysUserRealName}}</span>
  343. </div>
  344. <ul class="value-ul"
  345. v-show="showTable&&dataList.length">
  346. <li class="value-item" style="background-color: #EBEFF6;">
  347. <span style="width:240px">{{$t('Edb.Detail.e_date')}}({{$t('Edb.Detail.e_fre')}}:{{EdbData.Frequency}})</span>
  348. <span style="flex:1;">{{$t('Edb.Detail.e_value')}}</span>
  349. </li>
  350. <li class="value-item"
  351. v-for="item in dataList.slice(0,3)"
  352. :key="item.EdbDataId">
  353. <span class="value-label date" style="width:240px">
  354. <span style="position: relative;">
  355. <i class="new-tag" v-if="EdbData.LatestDate===item.DataTime"></i>
  356. {{item.DataTime}}
  357. </span>
  358. </span>
  359. <span :class="['value-label',{'predict-act': EdbData.DataInsertConfig.Date===item.DataTime}]" style="flex:1;">
  360. <span :class="['value-style',{'predict-act': EdbData.DataInsertConfig.Date===item.DataTime}]">{{item.Value}}</span>
  361. </span>
  362. </li>
  363. <li class="nodata value-item" v-if="!dataList.length"><!-- 暂无数据 -->{{$t('Table.prompt_slogan')}}</li>
  364. </ul>
  365. </div>
  366. <div class="list" v-show="activeTab==='Data'">
  367. <edb-detail-data
  368. ref="edb_detail_data"
  369. :current-lang="currentLang"
  370. :table-data="tableData"
  371. :table-colums-one="tableColumsOne"
  372. :table-colums-two="tableColumsTwo"
  373. :data-list="dataList"
  374. :haveMore="haveMore"
  375. @getNextData="()=>{page_no++;getDataList();}"
  376. />
  377. </div>
  378. </div>
  379. </div>
  380. <noDataAuth v-if="EdbData.HaveOperaAuth===false" :text="$t('MsgPrompt.no_edb_auth')"/>
  381. </div>
  382. </div>
  383. <!-- 输入英文指标弹窗 -->
  384. <set-en-name-dia :isOpenDialog="setEnName" @cancel="setEnName=false"
  385. :formData="formItemArray" @updateEnName="updateEnName" cType="ebd" />
  386. <!-- 目录弹窗 -->
  387. <openDialog
  388. :isOpenDialog="isOpenDialog"
  389. :title="dialog_title"
  390. :formData="dialogForm"
  391. @closeDia="isOpenDialog=false"
  392. @sucessCallback="sucessCallback"
  393. />
  394. <!-- 指标弹窗 -->
  395. <addTargetDiaBase
  396. ref="addTargetDiaBase"
  397. :isAddTarget="isAddTarget"
  398. @cancelHandle="isAddTarget = false"
  399. @addSuccessHandle="addTargetSuccess"
  400. />
  401. <!-- 完善指标信息 -->
  402. <completeTargetDia
  403. :isOpenDialog="isComplete"
  404. @cancel="cacelCompleteCallback"
  405. :params="add_params"
  406. @addTargetCallback="addTargetCallback"
  407. />
  408. <!-- 计算指标弹窗 -->
  409. <computedDialog
  410. :isOpenComputed="computed_type === 4"
  411. :title="computedTit"
  412. :calulateForm="calulateForm"
  413. :calulateList="calulateList"
  414. @cancel="computed_type=0"
  415. @addCallBack="addComputedCallBack"
  416. @openPrev="isOpenComputed=true"
  417. @lookHistory="id => {toHistoryPage(id,$route.matched);lookEdbId=id;}"
  418. />
  419. <!-- 计算弹窗控制 -->
  420. <el-dialog
  421. :visible.sync="isOpenComputed"
  422. :close-on-click-modal="false"
  423. :modal-append-to-body='false'
  424. @close="isOpenComputed=false;"
  425. custom-class="dialog-computed"
  426. top="6vh"
  427. center
  428. width="920px"
  429. v-dialogDrag>
  430. <div class="dialog-computed-header">
  431. <el-radio-group :value="1" size="medium">
  432. <el-radio-button :label="1">{{$t('EtaBasePage.normal_calculate_tab')}}</el-radio-button>
  433. <span @click="showBatchComputedPop=true">
  434. <el-radio-button :label="2">{{$t('EtaBasePage.batch_calculate_tab')}}</el-radio-button>
  435. </span>
  436. </el-radio-group>
  437. </div>
  438. <ul class="computed-ul">
  439. <li
  440. :class="['cpmputed-li',item.type === computed_type?'act':'']"
  441. v-for="item in computedShowTypes"
  442. :key="item.type"
  443. @click="changeComputedType(item.type)">
  444. {{item.name}}
  445. <el-popover
  446. placement="top-start"
  447. width="500"
  448. trigger="hover"
  449. v-if="tips.get(item.type)"
  450. >
  451. <p style="padding:20px;line-height:25px;" v-html="tips.get(item.type)"/>
  452. <i slot="reference" class="el-icon-warning-outline"/>
  453. </el-popover>
  454. </li>
  455. </ul>
  456. </el-dialog>
  457. <!-- 转月值 同比 同差 平均值弹窗 -->
  458. <operationDialog
  459. :isOperation="([5,6,7,8,12,13,14,22,35,51,52,61,62,63,75].includes(computed_type) || (computed_type===40&&operationForm.view)) && computed_source===1"
  460. :type="computed_type"
  461. :operationForm="operationForm"
  462. @cancel="computed_type=0"
  463. @addCallBack="addComputedCallBack"
  464. @openPrev="isOpenComputed=true"
  465. @lookHistory="id => {toHistoryPage(id,$route.matched);lookEdbId=id;}"
  466. @changeSource="changeComputedType"
  467. />
  468. <!-- 一键成图弹窗 -->
  469. <!-- <create-chart
  470. :isCreateChart="isCreateChart"
  471. :edbid="selected_edbid"
  472. :chartLang="currentLang"
  473. ref="createChart"
  474. @close="isCreateChart = false"
  475. @editEnName="openEnNameDia"
  476. /> -->
  477. <!-- 一键更新弹窗 -->
  478. <update-dialog
  479. :isUpdate="isUpdate"
  480. @cancel="isUpdate = false"
  481. />
  482. <!-- 替换指标弹窗 -->
  483. <replace-dialog
  484. :isShow="isReplaceDia"
  485. @cancel="isReplaceDia = false"
  486. />
  487. <!-- 拼接弹窗 -->
  488. <joint-target-dia
  489. :isShow="computed_type === 'joint'"
  490. :params="operationForm"
  491. @cancel="computed_type=0"
  492. @addCallBack="addComputedCallBack"
  493. @openPrev="isOpenComputed=true"
  494. />
  495. <!-- 拟合残差弹窗 -->
  496. <fittingResidueDia
  497. :isShow="computed_type === 37 && computed_source===1"
  498. :type="37"
  499. :operationForm="operationForm"
  500. @cancel="computed_type=0"
  501. @addCallBack="addComputedCallBack"
  502. @openPrev="isOpenComputed=true"
  503. />
  504. <!-- 批量计算弹窗 -->
  505. <batchComputedDialog
  506. :isBatchComputed="[6,7,8,12,13,14,5,61,62,63,75].includes(computed_type) && computed_source===2"
  507. :type="computed_type"
  508. @cancel="computed_type=0"
  509. @addCallBack="addComputedCallBack"
  510. @openPrev="isOpenComputed=true"
  511. @lookHistory="id => {toHistoryPage(id,$route.matched);lookEdbId=id;}"
  512. @changeSource="changeComputedType"
  513. />
  514. <!-- 扩散指数弹窗 -->
  515. <diffusionIndexDialog
  516. :isShow="computed_type === 53 && computed_source===1"
  517. :type="computed_type"
  518. :operationForm="operationForm"
  519. @cancel="computed_type=0"
  520. @addCallBack="addComputedCallBack"
  521. @openPrev="isOpenComputed=true"
  522. />
  523. <!-- 添加最新值弹窗 -->
  524. <updateNewestDataDia
  525. :isShow.sync="isUpdateNewestData"
  526. :edbinfo="tableData[0]"
  527. :dataList="dataList"
  528. @success="updateNewest"
  529. />
  530. <!-- 指标历史记录 -->
  531. <!-- <edbHistoryDialog
  532. :isOpenDialog.sync="isLookHistory"
  533. :edbId="lookEdbId"
  534. /> -->
  535. <!-- 指数修匀弹窗 -->
  536. <SmoothEdbDialog
  537. :is-open-smooth="computed_type==='alpha'"
  538. :computed-source="computed_source"
  539. :operationForm="operationForm"
  540. @cancel="computed_type=0"
  541. @openPrev="isOpenComputed=true"
  542. @addCallBack="addComputedCallBack"
  543. @lookHistory="id => {toHistoryPage(id,$route.matched);lookEdbId=id;}"
  544. />
  545. <!-- 批量计算指标 -->
  546. <batchComputedV2
  547. :isShow="showBatchComputedPop"
  548. :type="computed_type"
  549. :operationForm="operationForm"
  550. @close="isOpenComputed=false;showBatchComputedPop=false"
  551. @closeSelf="handleCloseBatchPopSelf"
  552. @addCallBack="addComputedCallBack"
  553. />
  554. </div>
  555. </template>
  556. <script>
  557. import { dataBaseInterface } from '@/api/api.js';
  558. import { getComputedTypes,getBatchComputedTypes,getFormulaTip } from './databaseComponents/util';
  559. import openDialog from './databaseComponents/openDialog';
  560. import addTargetDiaBase from './databaseComponents/addTargetDiaBase';
  561. import completeTargetDia from './databaseComponents/completeTargetDia'
  562. import computedDialog from './databaseComponents/computedDialog';
  563. import operationDialog from './databaseComponents/operationDialog';
  564. import createChart from './databaseComponents/createChart';
  565. import updateDialog from './databaseComponents/updateDialog';
  566. import replaceDialog from './databaseComponents/replaceDialog';
  567. import jointTargetDia from './databaseComponents/jointTargetDia';
  568. import changeLang from "./components/changeLang.vue"
  569. import setEnNameDia from "./components/setEnNameDia.vue"
  570. import dataAssociateChart from './databaseComponents/dataAssociateChart.vue'
  571. import dataAssociateComputeData from './databaseComponents/dataAssociateComputeData.vue'
  572. import fittingResidueDia from './databaseComponents/fittingResidueDia.vue';
  573. import batchComputedDialog from './databaseComponents/batchComptedDialog.vue';
  574. import diffusionIndexDialog from './databaseComponents/diffusionIndexDia.vue';
  575. import updateNewestDataDia from './databaseComponents/updateNewestDia.vue';
  576. import EdbLabelList from '@/components/edbLabelList.vue';
  577. import chartTrendRender from './databaseComponents/chartTrendRender.vue';
  578. import edbDetailData from './databaseComponents/edbDetailData.vue';
  579. import SmoothEdbDialog from './databaseComponents/smoothEdbDialog.vue';
  580. import batchComputedV2 from './databaseComponents/batchComputedV2.vue';
  581. export default {
  582. name: '',
  583. components: {
  584. openDialog,
  585. addTargetDiaBase,
  586. completeTargetDia,
  587. computedDialog,
  588. operationDialog,
  589. createChart,
  590. updateDialog,
  591. replaceDialog,
  592. jointTargetDia,
  593. changeLang,
  594. setEnNameDia,
  595. dataAssociateChart,
  596. dataAssociateComputeData,
  597. fittingResidueDia,
  598. batchComputedDialog,
  599. diffusionIndexDialog,
  600. updateNewestDataDia,
  601. EdbLabelList,
  602. chartTrendRender,
  603. edbDetailData,
  604. SmoothEdbDialog,
  605. batchComputedV2
  606. },
  607. directives: {
  608. drag(el, bindings,vnode) {
  609. el.onmousedown = function(e) {
  610. var init = e.clientX;
  611. var box = $("#box")[0]
  612. let total_wid = box.offsetWidth
  613. var left = $("#left")[0];
  614. var right = $("#right")[0];
  615. var initWidth = left.offsetWidth;
  616. document.onmousemove = function(e) {
  617. var end = e.clientX;
  618. if(end > 310){
  619. var newWidth = end - init + initWidth;
  620. right.style.width = total_wid - newWidth + 'px'
  621. left.style.width = newWidth + "px";
  622. }else{
  623. end = 350;
  624. // 最小宽度300
  625. left.style.width = 300 + "px";
  626. // right.style.width = total_wid-300-20 +'px'
  627. }
  628. };
  629. document.onmouseup = function() {
  630. document.onmousemove = document.onmouseup = null;
  631. e.releaseCapture && e.releaseCapture();
  632. //移动结束触发重绘
  633. vnode.context.rePainChart()
  634. };
  635. e.setCapture && e.setCapture();
  636. return false;
  637. };
  638. }
  639. },
  640. data() {
  641. return {
  642. IsOnlyMe:false,//只看我的
  643. showData: false,
  644. search_txt: '', //搜索词
  645. searchOptions:[],//搜索到的筛选列表
  646. treeData: [], //树形数据
  647. defaultShowNodes:[], //默认展开的节点
  648. defaultProp: {
  649. label: 'ClassifyName',
  650. children: 'Children',
  651. isLeaf:'isLeaf'
  652. },//树结构配置项
  653. tableData: [],
  654. loading:null,
  655. showTable:false,
  656. page_no: 1,
  657. /*表格列 */
  658. tableColumsOne: [
  659. {
  660. label: '指标ID',
  661. key: 'EdbCode',
  662. minwidthsty: '150px'
  663. },
  664. {
  665. label: '指标名称',
  666. key: 'EdbName',
  667. enKey:'EdbNameEn',
  668. inputTip:'点击输入英文指标名称',
  669. minwidthsty: '200px'
  670. },
  671. {
  672. label: '频度',
  673. key: 'Frequency',
  674. enKey:'FrequencyEn',
  675. widthsty: '100px'
  676. },
  677. {
  678. label: '单位',
  679. key: 'Unit',
  680. enKey:'UnitEn',
  681. inputTip:'英文单位',
  682. // minwidthsty: '50px'
  683. widthsty: '100px'
  684. },
  685. {
  686. label: '数据来源',
  687. key: 'SourceName',
  688. widthsty: '160px'
  689. },
  690. ],
  691. tableColumsTwo: [
  692. {
  693. label: '指标目录',
  694. key: 'Menu',
  695. minwidthsty: '150px',
  696. },
  697. {
  698. label: '起始时间',
  699. key: 'StartDate',
  700. minwidthsty: '115px',
  701. },
  702. {
  703. label: '更新时间',
  704. key: 'ModifyTime',
  705. minwidthsty: '120px',
  706. },
  707. {
  708. label:'刷新状态',
  709. key:'NoUpdate',
  710. widthsty:'100px'
  711. },
  712. {
  713. label: '添加人',
  714. key: 'SysUserRealName',
  715. widthsty: '160px',
  716. }
  717. ],
  718. haveMore: true,
  719. selected_edbid: 0,//选中的指标id
  720. dataList: [],//指标数值
  721. new_label: '',//新的节点label值
  722. select_node:'',//当前选中的节点
  723. /* 新增编辑目录弹窗 */
  724. isOpenDialog:false,
  725. dialog_title: '',
  726. dialogForm:{
  727. level:''
  728. },
  729. /* 新增指标弹窗 */
  730. isAddTarget: false,
  731. /* 完善信息 */
  732. isComplete:false,
  733. add_params:{},
  734. defaultWarn:'请在左侧选择指标',//缺省文字
  735. /* 计算指标弹窗 */
  736. isOpenComputed:false,
  737. computedTit:'',
  738. calulateForm:{},
  739. calulateList:[],
  740. computed_type:0,//打开弹窗的类型
  741. operationForm:{},
  742. dynamicNode:null,
  743. edb_source:0,//指标来源 显示计算按钮
  744. calculateLoading: false,//计算指标刷新loading
  745. refreshLoading: false,//基础指标刷新loading
  746. /* 一键成图弹窗 */
  747. isCreateChart: false,
  748. /* 一键更新弹窗 */
  749. isUpdate:false,
  750. /* 替换指标弹窗 */
  751. isReplaceDia: false,
  752. /* 拼接指标弹窗 */
  753. isJoint: false,
  754. search_page: 1,
  755. search_have_more: false,
  756. current_search:'',
  757. currentLang:'ch', // 语言 ch 中文 en 英文
  758. // -----------------设置英文指标弹窗
  759. setEnName:false,
  760. // 传入的formItem所需内容
  761. formItemArray:[],
  762. // 在哪里更新的英文指标 table(表格上) chart(图表里)
  763. updateType:'table',
  764. // ----------------------
  765. edb_levels:[],//指标的父级分类id
  766. showAssociateChart:false,//显示指标关联的图
  767. showAssociateComputeData:false,//显示指标关联的引用计算指标
  768. computed_source: 1,//计算类型 1常规 2批量
  769. isBatchComputed: false,//批量计算弹窗
  770. //添加最新值弹窗
  771. isUpdateNewestData: false,
  772. /* 查看历史弹窗 */
  773. isLookHistory: false,
  774. lookEdbId: 0,
  775. labelList:[],//标签列表
  776. CanOpClassify: false,
  777. select_classifyId:0,//指标分类id
  778. PageSize:20,
  779. CurrentIndex:1,
  780. Total:0,
  781. IsListEnd:false,//是不是到底了
  782. chartList:[],
  783. activeTab:'',
  784. activeName:'second',
  785. isMainLeftShow:true,
  786. showBatchComputedPop:false,
  787. };
  788. },
  789. watch: {
  790. selected_edbid(newval) {
  791. if(!newval) {
  792. this.tableData = [];
  793. this.dataList = [];
  794. this.defaultWarn = '请在左侧选择指标';
  795. this.activeTab=''
  796. }else {
  797. console.log('new val')
  798. this.activeTab='Chart'
  799. this.initGetData();
  800. }
  801. },
  802. /* 选中搜索指标 展开目录 选中指标 展示数据 */
  803. search_txt(newval) {
  804. if (newval) {
  805. let [search_obj] = this.searchOptions.filter(
  806. (item) => item.EdbInfoId === newval
  807. );
  808. this.page_no = 1;
  809. if(this.$refs.edb_detail_data){
  810. this.$refs.edb_detail_data.$refs.valueUl.scrollTop=0
  811. }
  812. this.select_node = search_obj.UniqueCode;
  813. this.selected_edbid = newval;
  814. }
  815. },
  816. select_classifyId(newval){
  817. if(this.$refs.listRef) this.$refs.listRef.scrollTop = 0;
  818. if(newval){
  819. this.CurrentIndex = 1
  820. this.getEdbChartList()
  821. }
  822. },
  823. isMainLeftShow(newVal){
  824. this.rePainChart()
  825. },
  826. },
  827. computed: {
  828. /* 计算弹窗控制 */
  829. computedShowTypes() {
  830. return this.computed_source===1 ? getComputedTypes() : getBatchComputedTypes();
  831. },
  832. role() {
  833. let role = localStorage.getItem('Role') || '';
  834. if (['rai_researcher', 'ficc_researcher', 'researcher','ficc_seller','rai_seller','seller'].includes(role)) {
  835. return 'researcher'
  836. }else if(['rai_admin','ficc_admin'].includes(role)) {
  837. return 'admin'
  838. }
  839. else {
  840. return role;
  841. }
  842. },
  843. /* 登录角色id */
  844. roleId() {
  845. let id = parseInt(localStorage.getItem('AdminId'));
  846. return id;
  847. },
  848. //指标详情,也就是tableData[0]
  849. EdbData(){
  850. return this.tableData[0]?this.tableData[0]:{Button:{},DataInsertConfig:{},DataList:[]}
  851. },
  852. //是否显示指标列表
  853. isShowList(){
  854. return !this.showAssociateChart&&!this.showAssociateComputeData&&!this.selected_edbid
  855. },
  856. //是否显示指标详情
  857. isShowDetail(){
  858. return !this.showAssociateChart&&!this.showAssociateComputeData&&this.selected_edbid
  859. },
  860. //是否显示更多操作
  861. showPopver(){
  862. return this.isEdbBtnShow('setEn')||
  863. this.EdbData.Button.InsertNewDataButton&&this.isEdbBtnShow('newValue')||
  864. this.EdbData.EdbType===2&&this.isEdbBtnShow('calculateAgain')||
  865. this.EdbData.EdbType===1&&this.isEdbBtnShow('refreshAll')||
  866. this.isEdbBtnShow('copyData')||
  867. this.EdbData.Button.DeleteButton&&this.isEdbBtnShow('deleteEdb')
  868. },
  869. /*表格列 */
  870. tableColumsOne(){
  871. return [
  872. {
  873. label: this.$t('Edb.Detail.e_id'),
  874. key: 'EdbCode',
  875. minwidthsty: '150px'
  876. },
  877. {
  878. label: this.$t('Edb.Detail.e_name'),
  879. key: 'EdbName',
  880. enKey:'EdbNameEn',
  881. inputTip:'点击输入英文指标名称',
  882. minwidthsty: '200px'
  883. },
  884. {
  885. label: this.$t('Edb.Detail.e_fre'),
  886. key: 'Frequency',
  887. enKey:'FrequencyEn',
  888. widthsty: '100px'
  889. },
  890. {
  891. label: this.$t('Edb.Detail.e_unit'),
  892. key: 'Unit',
  893. enKey:'UnitEn',
  894. inputTip:'英文单位',
  895. // minwidthsty: '50px'
  896. widthsty: '100px'
  897. },
  898. {
  899. label: this.$t('Edb.Detail.source'),
  900. key: 'SourceName',
  901. widthsty: '160px'
  902. },
  903. ]
  904. },
  905. tableColumsTwo() {
  906. return [
  907. {
  908. label: this.$t('Edb.Detail.e_menu'),
  909. key: 'Menu',
  910. minwidthsty: '150px',
  911. },
  912. {
  913. label: this.$t('Edb.Detail.e_start_time'),
  914. key: 'StartDate',
  915. minwidthsty: '115px',
  916. },
  917. {
  918. label: this.$t('Edb.Detail.e_update_time'),
  919. key: 'ModifyTime',
  920. minwidthsty: '120px',
  921. },
  922. {
  923. label: this.$t('Edb.creater'),
  924. key: 'SysUserRealName',
  925. widthsty: '160px',
  926. }
  927. ]
  928. },
  929. tips() {//公式说明
  930. return getFormulaTip()
  931. },
  932. },
  933. methods: {
  934. //控制页面按钮权限
  935. isEdbBtnShow(type){
  936. const {edbDataPermission,checkPermissionBtn}=this.permissionBtn
  937. const BtnMap = {
  938. 'update':edbDataPermission.edbData_update,//指标更新
  939. 'edit':edbDataPermission.edbData_edit,//指标编辑
  940. /* 'toImg':edbDataPermission.edbData_toImgs, */
  941. 'copyData':edbDataPermission.edbData_copyData,//复制数据
  942. 'toSource':edbDataPermission.edbData_edbSource,//指标溯源
  943. 'setEn':edbDataPermission.edbData_enNameSetting,//设置英文名称
  944. 'newValue':edbDataPermission.edbData_newestValue,//添加/编辑最新值
  945. 'refreshAll':edbDataPermission.edbData_refreshAll,//全部刷新
  946. 'saveEdb':edbDataPermission.edbData_saveEdb,//保存指标
  947. 'deleteEdb':edbDataPermission.edbData_deleteEdb,//删除指标
  948. 'showChartBasis':edbDataPermission.edbData_showChartBasis,//展示/隐藏同比图
  949. 'switchSeason':edbDataPermission.edbData_switchSeason,//切换季节性图
  950. 'editLimit':edbDataPermission.edbData_editLimit,//编辑上下限
  951. 'calculateAgain':edbDataPermission.edbData_calculateAgain,//重新计算
  952. 'editCatalog':edbDataPermission.edbData_classifyOpt_add,//添加编辑目录
  953. 'deleteCatalog':edbDataPermission.edbData_classifyOpt_delete,//删除目录
  954. 'moveCatalog':edbDataPermission.edbData_classifyOpt_move,//删除目录
  955. 'checkRelatedChart':edbDataPermission.edbData_checkRelatedChart,//查看关联图表
  956. 'checkRelatedEdb':edbDataPermission.edbData_checkRelatedEdb,//查看关联指标
  957. 'checkCalcChart':edbDataPermission.edbData_checkCalcChart,//查看计算指标
  958. }
  959. return checkPermissionBtn(BtnMap[type])
  960. },
  961. /* 获取树分类数据 */
  962. getTreeData(params) {
  963. dataBaseInterface.targetCatalog({IsOnlyMe:this.IsOnlyMe,ParentId:0}).then(res=>{
  964. if(res.Ret===200){
  965. const arr=res.Data.AllNodes || []
  966. this.treeData=arr.map(item=>{
  967. return {
  968. ...item,
  969. // isLeaf:item.Children.length?false:true
  970. }
  971. })
  972. this.CanOpClassify = res.Data.CanOpClassify;
  973. this.currentLang = res.Data.Language === 'EN' ? 'en' : 'ch';
  974. this.setLangIntoStore()
  975. this.showData = true;
  976. /* 处理树展开和选中图表 */
  977. params && this.selectCurrentNode(params);
  978. !params && this.select_node && this.$refs.menuTree.setCurrentKey(this.select_node);
  979. }
  980. })
  981. },
  982. /* 获取最新的指标 默认展示 */
  983. getNewTargetList: _.throttle(function() {
  984. dataBaseInterface.targetNew().then(res => {
  985. if(res.Ret === 200) {
  986. /* 默认选中 默认指标id */
  987. this.select_node = res.Data ? res.Data.UniqueCode : '';
  988. this.selected_edbid = res.Data ? res.Data.EdbInfoId : 0;
  989. this.getTreeData();
  990. }
  991. })
  992. }),
  993. /* 获取指标数据 */
  994. getDataList: _.throttle(function(type) {
  995. dataBaseInterface.targetList({
  996. PageSize: 20,
  997. CurrentIndex: this.page_no,
  998. EdbInfoId: this.selected_edbid,
  999. // KeyWord: this.search_txt,
  1000. }).then(res => {
  1001. if(res.Ret === 200) {
  1002. this.showTable = true;
  1003. if(res.Data) {
  1004. // res.Data.Item.ModifyTime = res.Data.Item.ModifyTime.substr(0,10);
  1005. let classify_arr = res.Data.ClassifyList || [];
  1006. let str = '';
  1007. classify_arr.length && classify_arr.reverse().map((item) => str += item.ClassifyName + '/');
  1008. this.edb_levels = classify_arr;
  1009. this.$set(res.Data.Item,'Menu',str);
  1010. this.tableData = [res.Data.Item] || [];
  1011. this.edb_source = res.Data.Item.Source;
  1012. this.haveMore = this.page_no < res.Data.Paging.Pages ? true : false;
  1013. this.dataList = this.page_no === 1 ? (res.Data.Item.DataList || []) : this.dataList.concat(res.Data.Item.DataList);
  1014. //将指标添加进标签列表中
  1015. const {EdbNameEn,EdbName,EdbInfoId,UniqueCode,ClassifyId}=res.Data.Item
  1016. this.addLabel({code:UniqueCode,id:EdbInfoId,classifyId:ClassifyId,EdbName,EdbNameEn})
  1017. // 展开目录
  1018. this.defaultShowNodes=classify_arr.map(item=>item.UniqueCode)
  1019. //设置tree高亮
  1020. this.$nextTick(()=>{
  1021. setTimeout(() => {
  1022. this.$refs.menuTree.setCurrentKey(UniqueCode);
  1023. }, 1000);
  1024. })
  1025. }else {
  1026. this.tableData = [];
  1027. this.dataList = [];
  1028. this.defaultWarn = type=== 'search' ? '未搜索到该指标' : '请在左侧选择指标'
  1029. this.$refs.menuTree.setCurrentKey(null)
  1030. // 清除当前的label
  1031. this.$message.warning('该图表已删除,自动查看下一图表')
  1032. this.deleteLabel({code:this.select_node,id:this.selected_edbid,classifyId:''})
  1033. }
  1034. if(type==='refresh') {
  1035. if(this.$refs.edb_detail_data){
  1036. this.$refs.edb_detail_data.$refs.valueUl.scrollTop=0
  1037. }
  1038. }
  1039. this.$nextTick(()=>{
  1040. const _node = this.$refs.menuTree.getNode(this.select_node)
  1041. this.dynamicNode = _node;
  1042. this.dynamicNode&&this.resetNodeStyle(this.dynamicNode)
  1043. //滚动到高亮位置
  1044. setTimeout(() => {
  1045. let node = document.getElementById(`node${this.select_node}`)||{}
  1046. let parent = document.getElementsByClassName('target_tree')[0];
  1047. //parent可视区间:[scrollTop,scrollTop+offsetHeight]
  1048. //node位置:node.offsetTop
  1049. const overTop = node.offsetTop+node.clientHeight+30<parent.scrollTop
  1050. const overBottom = node.offsetTop+node.clientHeight+30>parent.scrollTop+parent.offsetHeight
  1051. if(overTop){
  1052. parent.scrollTop = node.offsetTop-60
  1053. }
  1054. if(overBottom){
  1055. parent.scrollTop = node.offsetTop - parent.offsetHeight/2
  1056. }
  1057. },1500)
  1058. })
  1059. }
  1060. })
  1061. }),
  1062. //获取指标图表列表
  1063. getEdbChartList(){
  1064. dataBaseInterface.getEdbChartList({
  1065. PageSize:this.PageSize,
  1066. CurrentIndex:this.CurrentIndex,
  1067. ClassifyId:this.select_classifyId,
  1068. IsOnlyMe:this.IsOnlyMe
  1069. }).then(res=>{
  1070. if(res.Ret!==200) return
  1071. if(res.Data){
  1072. this.chartList = this.CurrentIndex===1?res.Data.List:[...this.chartList,...res.Data.List]
  1073. this.Total = res.Data.Paging.Totals||0
  1074. this.IsListEnd = res.Data.Paging.IsEnd
  1075. }
  1076. })
  1077. },
  1078. //指标图表列表-加载更多
  1079. loadMoreHandle: _.throttle(function() {
  1080. let scrollTop = this.$refs.listRef.scrollTop;
  1081. let clientHeight = this.$refs.listRef.clientHeight;
  1082. let scrollHeight = this.$refs.listRef.scrollHeight;
  1083. if(scrollTop + clientHeight >= scrollHeight-210 && !this.IsListEnd){
  1084. this.CurrentIndex++;
  1085. this.getEdbChartList();
  1086. }
  1087. },300),
  1088. /* 搜索 */
  1089. searchHandle(query) {
  1090. this.search_page = 1;
  1091. this.current_search = query;
  1092. this.searchApi(this.current_search)
  1093. },
  1094. searchApi(query,page=1) {
  1095. dataBaseInterface.targetSearchByPage({
  1096. KeyWord:query,
  1097. CurrentIndex: page
  1098. }).then(res => {
  1099. if(res.Ret !== 200) return
  1100. const { List,Paging } = res.Data;
  1101. this.search_have_more = page < Paging.Pages;
  1102. this.searchOptions = page === 1 ? List : this.searchOptions.concat(List);
  1103. })
  1104. },
  1105. /* 聚焦获取当前检索 */
  1106. inputFocusHandle(e) {
  1107. this.search_page = 1;
  1108. this.current_search = e.target.value;
  1109. this.searchApi(this.current_search);
  1110. },
  1111. searchLoad() {
  1112. if(!this.search_have_more) return;
  1113. this.searchApi(this.current_search,++this.search_page);
  1114. },
  1115. /* 存储中英文状态 */
  1116. setLangIntoStore() {
  1117. this.$store.commit('edb/SET_LANG',this.currentLang)
  1118. },
  1119. /* 数值滚动加载 */
  1120. scrollHandle: _.throttle(function() {
  1121. let scrollTop = this.$refs.valueUl.scrollTop;
  1122. let clientHeight = this.$refs.valueUl.clientHeight;
  1123. let scrollHeight = this.$refs.valueUl.scrollHeight;
  1124. console.log('scrollTop:',scrollTop)
  1125. console.log('clientHeight:',clientHeight)
  1126. console.log('scrollHeight:',scrollHeight)
  1127. if(scrollTop + clientHeight >= scrollHeight-10 && this.haveMore){
  1128. this.page_no ++;
  1129. this.getDataList();
  1130. }
  1131. },200),
  1132. /* 切换中英文 */
  1133. changeLanguage: _.debounce(async function (lang){
  1134. this.search_txt = '';
  1135. this.currentLang = lang;
  1136. await dataBaseInterface.setUserLang({
  1137. ConfigCode: 'edb_language',
  1138. ConfigValue: lang === 'en' ? 'EN' : 'CN'
  1139. })
  1140. this.setLangIntoStore()
  1141. },200),
  1142. // 打开 编辑英文名称弹窗
  1143. openEnNameDia(type='table'){
  1144. this.updateType = type
  1145. this.formItemArray=[{
  1146. label:/* '指标名称' */ this.$t('Edb.Detail.e_name'),
  1147. value:this.tableData[0].EdbName,
  1148. key:'EdbName',
  1149. notEdit:true
  1150. }]
  1151. // 中文单位有 才能编辑英文单位
  1152. if(this.tableData[0].Unit && this.tableData[0].Unit!='无'){
  1153. this.formItemArray.push({
  1154. label:this.$t('Edb.Detail.e_unit') /* '单位' */,
  1155. value:this.tableData[0].Unit,
  1156. key:'Unit',
  1157. notEdit:true
  1158. },
  1159. {
  1160. label:this.$t('Edb.Detail.e_en_name')/* '英文指标名称' */,
  1161. value:this.tableData[0].EdbNameEn,
  1162. key:'EdbNameEn',
  1163. placeholder: this.$t('Edb.InputHolderAll.input_common',{label:this.$t('Edb.Detail.e_en_name')}) /* '请输入英文指标名称' */
  1164. },
  1165. {
  1166. label:this.$t('Edb.Detail.e_en_unit') /* '英文单位' */,
  1167. value:this.tableData[0].UnitEn,
  1168. key:'UnitEn',
  1169. placeholder:this.$t('Edb.InputHolderAll.input_common',{label:this.$t('Edb.Detail.e_en_unit')}) /* '请输入英文单位' */
  1170. })
  1171. }else{
  1172. this.formItemArray.push({
  1173. label:this.$t('Edb.Detail.e_en_name') /* '英文指标名称' */,
  1174. value:this.tableData[0].EdbNameEn,
  1175. key:'EdbNameEn',
  1176. placeholder:this.$t('Edb.InputHolderAll.input_common',{label:this.$t('Edb.Detail.e_en_name')}) /* '请输入英文指标名称' */
  1177. })
  1178. }
  1179. this.setEnName = true
  1180. },
  1181. updateEnName(item){
  1182. let params={
  1183. EdbInfoId: Number(this.selected_edbid),
  1184. ...item
  1185. }
  1186. dataBaseInterface.edbInfoEditEn(params).then(res=>{
  1187. if(res.Ret ==200){
  1188. this.$message({
  1189. message:res.Msg,
  1190. type:"success"
  1191. })
  1192. /* this.tableData[0].EdbNameEn = params.EdbNameEn
  1193. this.tableData[0].UnitEn = params.UnitEn
  1194. // 判断图表英文名称和英文单位是否都有,都有需要打上 英文标记
  1195. console.log(this.tableData[0].EdbNameEn,this.tableData[0].UnitEn);
  1196. if(this.tableData[0].EdbNameEn && (this.tableData[0].UnitEn || this.tableData[0].Unit == '无')){
  1197. this.tableData[0].IsEnEdb=true
  1198. }else{
  1199. this.tableData[0].IsEnEdb=false
  1200. } */
  1201. this.getTreeData()
  1202. this.getDataList()
  1203. if(this.updateType=='chart'){
  1204. // 重绘图表,刷新数据
  1205. this.$refs.createChart.getEdbData()
  1206. }
  1207. this.setEnName = false
  1208. }
  1209. })
  1210. },
  1211. /* 新增指标 */
  1212. addHandler() {
  1213. this.isAddTarget = true;
  1214. },
  1215. /* 完善指标信息 */
  1216. completeTargetHandle(params) {
  1217. this.add_params = params;
  1218. this.isComplete = true;
  1219. },
  1220. /* 新增指标成功回调 */
  1221. addTargetCallback(params) {
  1222. this.$refs.addTargetDiaBase.init();
  1223. this.isComplete = false;
  1224. this.isAddTarget = false;
  1225. this.getTreeData(params);
  1226. this.changeTreeNode()
  1227. // this.getNewTargetList();
  1228. },
  1229. /* 取消新增回调 */
  1230. cacelCompleteCallback() {
  1231. this.isComplete = false
  1232. this.add_params = {}
  1233. },
  1234. /* 节点变化时 */
  1235. nodeChange(data,node) {
  1236. this.search_txt = '';
  1237. this.select_classifyId = !data.EdbInfoId?data.ClassifyId:0;
  1238. this.select_node = data.UniqueCode;
  1239. this.selected_edbid = data.EdbInfoId;
  1240. this.resetNodeStyle(node);
  1241. this.dynamicNode = node;
  1242. this.showAssociateChart=false
  1243. this.showAssociateComputeData=false
  1244. },
  1245. resetNodeStyle: _.debounce(function(node) {
  1246. const tree = $('.target_tree')[0];
  1247. let width = tree.offsetWidth;
  1248. console.log(width)
  1249. // let label_wid = width > 500 ? 'auto' : (width <= 300 && width < 360) ? 100 : 0.7*width;
  1250. let label_wid =
  1251. width > 500
  1252. ? 'auto'
  1253. : width <= 260
  1254. ? 80
  1255. : 0.4 * width;
  1256. this.$set(node, 'Nodewidth', label_wid + 'px');
  1257. },200),
  1258. /* 双击label出现input修改框 */
  1259. editNodeLabel(node, data) {
  1260. //目录名称可以双击修改 指标不能
  1261. if(!data.EdbCode && this.role === 'admin'&&this.isEdbBtnShow('editCatalog')) {
  1262. this.$set(data,'isEdit',true)
  1263. this.new_label = data.ClassifyName;
  1264. this.$nextTick(() => {
  1265. this.$refs.editVal.focus();
  1266. });
  1267. }
  1268. },
  1269. /* input失去焦点恢复node 修改最新的值*/
  1270. changeValue(node, data) {
  1271. if(this.new_label) {
  1272. this.$set(data,'isEdit',false)
  1273. this.new_label !== data.ClassifyName && dataBaseInterface.nodeEdit({
  1274. ClassifyId: data.ClassifyId,
  1275. ClassifyName: this.new_label
  1276. }).then(res => {
  1277. if(res.Ret === 200) {
  1278. this.getTreeData();
  1279. }
  1280. })
  1281. }else {
  1282. this.$message.warning('名称不能为空')
  1283. }
  1284. },
  1285. /* 添加一级目录 */
  1286. addLevelOneHandle() {
  1287. this.dialog_title = '添加';
  1288. this.dialogForm = {
  1289. level_1: '',
  1290. parent_id: '',
  1291. level: 0
  1292. }
  1293. this.isOpenDialog = true;
  1294. },
  1295. // 递归节点
  1296. getNodeParentData(data,arr){
  1297. if(data.level===0) return
  1298. arr.push({classifyName:data.data.ClassifyName,classifyId:data.data.ClassifyId})
  1299. this.getNodeParentData(data.parent,arr)
  1300. return arr
  1301. },
  1302. /* 添加节点 */
  1303. addNode(node,data) {
  1304. console.log(node);
  1305. this.dialog_title = '添加';
  1306. let arr=[]
  1307. arr=this.getNodeParentData(node,arr)
  1308. // console.log(arr);
  1309. /* 添加目录 */
  1310. this.dialogForm = {
  1311. parentArr:arr,
  1312. parent_id: data.ClassifyId,
  1313. level: node.level,
  1314. levelVal:'',
  1315. isEDB:false
  1316. }
  1317. //存储当前要新增子级的目录code
  1318. sessionStorage.setItem('expandCode', data.UniqueCode);
  1319. this.isOpenDialog = true;
  1320. },
  1321. /* 编辑节点 */
  1322. editNode(node,data) {
  1323. // console.log(node);
  1324. this.dialog_title = '编辑';
  1325. if(data.EdbCode) {
  1326. /* 编辑指标 基础弹窗 */
  1327. (data.EdbType===1 || [58,59,67,68,74].includes(data.Source)) && dataBaseInterface.targetDetail({
  1328. EdbInfoId: data.EdbInfoId
  1329. }).then(res => {
  1330. if(res.Ret === 200) {
  1331. // 处理所在目录
  1332. let menuArrId=res.Data.ClassifyList&&res.Data.ClassifyList.map(item=>{
  1333. return item.ClassifyId
  1334. }).reverse()
  1335. this.dialogForm = {
  1336. parentArr:[],
  1337. level: 0,
  1338. levelVal: res.Data.EdbName,
  1339. level_menu:menuArrId||[],
  1340. edbinfo_id: res.Data.EdbInfoId,
  1341. frequency:res.Data.Frequency,
  1342. unit:res.Data.Unit,
  1343. isEDB:true
  1344. }
  1345. this.isOpenDialog = true;
  1346. }
  1347. });
  1348. /* 编辑计算指标 同比同差转月 */
  1349. (data.EdbType === 2 && ![27,40,58,59].includes(data.Source)) && dataBaseInterface.calculateDetail({
  1350. EdbInfoId: data.EdbInfoId
  1351. }).then(res => {
  1352. if(res.Ret === 200) {
  1353. this.setComputedDialogForm(data.Source,res.Data);
  1354. switch (data.Source) {
  1355. case 23:
  1356. case 24:
  1357. this.computed_type = 'joint';
  1358. break
  1359. case 72:
  1360. case 73:
  1361. this.computed_type = 'alpha';
  1362. break
  1363. default:
  1364. this.computed_type = data.Source;
  1365. break
  1366. }
  1367. // this.computed_type = [23,24].includes(data.Source) ? 'joint' : data.Source;
  1368. // this.computed_type = [72,73].includes(data.Source)? 'alpha': data.Source;
  1369. }
  1370. })
  1371. /* 代码运算 */
  1372. data.Source === 27 && this.$router.push({
  1373. path: '/codecount',
  1374. query: {
  1375. edbid: data.EdbInfoId
  1376. }
  1377. })
  1378. /* 数据调整 */
  1379. data.Source === 40 && this.$router.push({
  1380. path: '/adjustdata',
  1381. query: {
  1382. edbid: data.EdbInfoId,
  1383. }
  1384. })
  1385. }else {
  1386. let arr=[]
  1387. arr=this.getNodeParentData(node.parent,arr)
  1388. /* 编辑目录 */
  1389. this.dialogForm = {
  1390. isEDB:false,
  1391. parentArr:arr,
  1392. levelVal: data.ClassifyName||'',
  1393. classify_id: data.ClassifyId,
  1394. level: node.level-1
  1395. }
  1396. this.isOpenDialog = true;
  1397. }
  1398. },
  1399. /* 保存成功 */
  1400. sucessCallback(type) {
  1401. this.isOpenDialog = false;
  1402. this.getTreeData();
  1403. type==='update' && this.getDataList();
  1404. if(type === 'add') {
  1405. //新增分类完成之后,展开父节点显示刚新增的分类,若已展开节点则不做处理
  1406. let code = sessionStorage.getItem('expandCode');
  1407. let flag = this.defaultShowNodes.some((item) => {
  1408. return item === code
  1409. });
  1410. // console.log(flag)
  1411. !flag &&code&& this.defaultShowNodes.push(code);
  1412. sessionStorage.removeItem('expandCode');
  1413. }
  1414. },
  1415. /* 刷新获取指标最新数据 */
  1416. refreshTargetHandle: _.debounce(function() {
  1417. //如果该指标为暂停刷新,则提示
  1418. if(this.EdbData.NoUpdate){
  1419. this.$message.warning("该指标已暂停刷新")
  1420. return
  1421. }
  1422. if(this.selected_edbid) {
  1423. this.loading = this.$loading({
  1424. lock: true,
  1425. target:'.detail',
  1426. text: this.$t('MsgPrompt.refresh_ing_msg'),
  1427. spinner: 'el-icon-loading',
  1428. background: 'rgba(255, 255, 255, 0.8)'
  1429. });
  1430. dataBaseInterface.targetRefresh({
  1431. EdbInfoId: this.selected_edbid
  1432. }).then(res => {
  1433. if(res.Ret === 200) {
  1434. this.loading.close();
  1435. this.$message.success(res.Msg);
  1436. this.page_no = 1;
  1437. this.getDataList('refresh')
  1438. }else{
  1439. this.loading.close();
  1440. }
  1441. })
  1442. }
  1443. },500),
  1444. /* 删除节点校验 */
  1445. removeNode(node,data) {
  1446. dataBaseInterface.nodeDelCheck({
  1447. ClassifyId: data.ClassifyId,
  1448. EdbInfoId: data.EdbInfoId
  1449. }).then(res => {
  1450. if(res.Ret === 200) {
  1451. /**
  1452. * 0 可删除
  1453. * 1 关联指标
  1454. * 2 有子目录无指标
  1455. */
  1456. const deleteLabelMap = {
  1457. 1: /* '该目录关联指标不可删除' */this.$t('Edb.MsgPrompt.del_not_relate_edb'),
  1458. 2: /* '确认删除当前目录及包含的子目录吗?' */this.$t('Edb.MsgPrompt.del_confirm_menu_or_children'),
  1459. 3: /* '当前指标已用作画图,不可删除' */this.$t('Edb.MsgPrompt.del_edb_use_chart'),
  1460. 4: res.Data.TipsMsg
  1461. }
  1462. if([1,3,4].includes(res.Data.DeleteStatus)) this.$confirm(
  1463. deleteLabelMap[res.Data.DeleteStatus],
  1464. /* '删除失败' */this.$t('Edb.MsgPrompt.del_failed'),
  1465. {
  1466. confirmButtonText:/* '知道了' */this.$t('Dialog.known'),
  1467. showCancelButton:false,
  1468. type: 'error'
  1469. })
  1470. else if([0,2].includes(res.Data.DeleteStatus)) this.$confirm(
  1471. res.Data.DeleteStatus === 2
  1472. ? deleteLabelMap[res.Data.DeleteStatus]
  1473. : data.EdbCode? this.$t('Edb.MsgPrompt.del_edb_confirm')/* '删除后指标和指标值均不可使用,确认删除吗?' */:/* '确定删除当前目录吗?' */this.$t('Edb.MsgPrompt.del_menu_confirm'),
  1474. /* '提示' */this.$t('Dialog.warn_tit'),
  1475. {
  1476. confirmButtonText: /* '确定' */this.$t('Dialog.confirm_btn'),
  1477. cancelButtonText: /* '取消' */this.$t('Dialog.cancel_btn'),
  1478. type: 'warning'
  1479. }).then(() => {
  1480. this.delHandle(data.ClassifyId,data.EdbInfoId);
  1481. }).catch(() => {
  1482. });
  1483. }
  1484. })
  1485. },
  1486. /* 删除方法 */
  1487. delHandle(ClassifyId,EdbInfoId) {
  1488. dataBaseInterface.nodeDelete({
  1489. ClassifyId,
  1490. EdbInfoId
  1491. }).then(res => {
  1492. if(res.Ret === 200) {
  1493. this.$message.success(this.$t('MsgPrompt.delete_msg'));
  1494. this.getTreeData();
  1495. this.selected_edbid = 0;
  1496. this.deleteLabel({code:this.select_node,id:EdbInfoId,classifyId:ClassifyId})
  1497. // this.getNewTargetList();
  1498. }
  1499. })
  1500. },
  1501. /* 判断节点是否能被拖拽 */
  1502. canDragHandle({data}) {
  1503. return data.Button.MoveButton;
  1504. },
  1505. /* 判断节点是否能被拖入 */
  1506. canDropHandle(draggingNode, dropNode, type) {
  1507. let canDrop=false
  1508. // 如果拖动的是指标
  1509. if(draggingNode.data.EdbCode){
  1510. if(!(dropNode.level===1&&type!=='inner')){
  1511. canDrop=true
  1512. }
  1513. }else{//拖动的是目录
  1514. // console.log(dropNode.level,draggingNode.level);
  1515. //目录层级不能改变
  1516. if((dropNode.level+1==draggingNode.level&&type==='inner'&&!dropNode.data.EdbCode)||(dropNode.level===draggingNode.level&&type!=='inner')){
  1517. canDrop=true
  1518. }
  1519. }
  1520. return canDrop
  1521. },
  1522. /* 拖拽完成 */
  1523. dropOverHandle(b,a,i,e) {
  1524. // 被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置
  1525. console.log(b,a,i);
  1526. const isEDB=b.data.EdbCode?true:false
  1527. let list=a.parent.childNodes;
  1528. let targetIndex=0,PrevClassifyId=0,NextClassifyId=0,ParentClassifyId=0;
  1529. let ClassifyId=0,EdbInfoId=0,PrevEdbInfoId=0,NextEdbInfoId=0;
  1530. ClassifyId=isEDB?0:b.data.ClassifyId
  1531. EdbInfoId=isEDB?b.data.EdbInfoId:0
  1532. if(i!=='inner'){
  1533. ParentClassifyId=a.parent.data.ClassifyId||0
  1534. list.forEach((item,index)=>{
  1535. if(isEDB){
  1536. if(item.data.EdbInfoId===b.data.EdbInfoId){
  1537. targetIndex=index
  1538. }
  1539. }else{
  1540. if(item.data.ClassifyId===b.data.ClassifyId){
  1541. targetIndex=index
  1542. }
  1543. }
  1544. })
  1545. console.log(targetIndex);
  1546. if(targetIndex===0){
  1547. const data=list[targetIndex+1].data
  1548. NextClassifyId=data.EdbCode?0:data.ClassifyId
  1549. NextEdbInfoId=data.EdbCode?data.EdbInfoId:0
  1550. }else if(targetIndex===list.length-1){
  1551. const data=list[targetIndex-1].data
  1552. PrevClassifyId=data.EdbCode?0:data.ClassifyId
  1553. PrevEdbInfoId=data.EdbCode?data.EdbInfoId:0
  1554. }else{
  1555. const pData=list[targetIndex-1].data
  1556. PrevClassifyId=pData.EdbCode?0:pData.ClassifyId
  1557. PrevEdbInfoId=pData.EdbCode?pData.EdbInfoId:0
  1558. const nData=list[targetIndex+1].data
  1559. NextClassifyId=nData.EdbCode?0:nData.ClassifyId
  1560. NextEdbInfoId=nData.EdbCode?nData.EdbInfoId:0
  1561. }
  1562. }else{
  1563. ParentClassifyId=a.data.ClassifyId||0
  1564. }
  1565. const params={
  1566. ClassifyId,
  1567. ParentClassifyId,
  1568. EdbInfoId,
  1569. PrevClassifyId,
  1570. NextClassifyId,
  1571. PrevEdbInfoId,
  1572. NextEdbInfoId
  1573. }
  1574. console.log(params);
  1575. dataBaseInterface.classifyMoveSort(params).then(res=>{
  1576. if(res.Ret===200){
  1577. // this.$message.success('移动成功!')
  1578. this.$message.success(this.$t('MsgPrompt.move_sort_success'))
  1579. }
  1580. this.getTreeData()
  1581. if(this.selected_edbid){
  1582. this.getDataList();
  1583. }
  1584. })
  1585. },
  1586. /* 拖拽覆盖添加背景色 */
  1587. dropMouseOver(node1,node2,e) {
  1588. // console.log(e.layerY);
  1589. // 被拖拽节点对应的 Node、所进入节点对应的 Node、event
  1590. if(!node2.data.EdbInfoId&&(node1.level>node2.level||(node1.data.EdbInfoId>0&&!node2.data.EdbInfoId)) && (e.target.childNodes[0].className.includes('el-tree-node__content')
  1591. || e.target.className.includes('el-tree-node__content'))) {
  1592. // console.log(e.target.childNodes[0])
  1593. e.target.childNodes[0].className.includes('el-tree-node__content')
  1594. ? e.target.childNodes[0].style.backgroundColor = '#409eff'
  1595. : e.target.style.backgroundColor = '#409eff';
  1596. }
  1597. },
  1598. /* 拖拽离开/拖拽完成重置背景色 */
  1599. dropMouseLeave(node1,node2,e) {
  1600. let arrs = $('.el-tree-node__content');
  1601. for( let a of arrs ) {
  1602. a.style.backgroundColor = 'transparent';
  1603. }
  1604. },
  1605. // 树节点展开
  1606. handleNodeExpand (data) {
  1607. // 保存当前展开的节点
  1608. let flag = this.defaultShowNodes.some((item) => item === data.UniqueCode);
  1609. if (!flag) { // 不存在则存到数组里
  1610. this.defaultShowNodes.push(data.UniqueCode)
  1611. }
  1612. },
  1613. // 树节点关闭
  1614. handleNodeCollapse (data) {
  1615. this.defaultShowNodes.some((item, index) => {
  1616. if (item === data.UniqueCode) {
  1617. // 删除关闭节点
  1618. this.defaultShowNodes.length = index
  1619. }
  1620. })
  1621. },
  1622. /* 根据unicode展开树结构并选中指标 */
  1623. selectCurrentNode({ code, id,classifyId }) {
  1624. console.log(code, id,classifyId);
  1625. this.select_node = code;
  1626. this.selected_edbid = id;
  1627. //this.defaultShowNodes=this.findParentNodeForClassifyId(classifyId,code)
  1628. const containerDom = document.getElementById('detail-container')
  1629. containerDom&&(containerDom.scrollTop = 0)
  1630. //滚动到高亮节点位置
  1631. /* this.$nextTick(()=>{
  1632. setTimeout(() => {
  1633. let node = document.getElementById(`node${this.select_node}`)||{}
  1634. let parent = document.getElementsByClassName('tree-cont')[0];
  1635. //console.log('滚动',node,parent);
  1636. if(node.offsetTop > parent.offsetHeight) {
  1637. parent.scrollTop = node.offsetTop - parent.offsetHeight/2
  1638. }
  1639. },400)
  1640. }) */
  1641. },
  1642. // 查找树节点所有父节点
  1643. findParentNodeHandle(arr, id) {
  1644. // 遍历取父级code push数组
  1645. for (let i of arr) {
  1646. if (i.ClassifyId === id) {
  1647. return [i.UniqueCode];
  1648. }
  1649. if (i.Children) {
  1650. let node = this.findParentNodeHandle(i.Children, id);
  1651. if (node) {
  1652. return node.concat(i.UniqueCode);
  1653. }
  1654. }
  1655. }
  1656. },
  1657. // 通过分类id找到指标所属的分类
  1658. findParentNodeForClassifyId(id,code){
  1659. let arr=[]
  1660. this.treeData.forEach(item=>{
  1661. if(item.Children){
  1662. item.Children.forEach(_item=>{
  1663. if(_item.ClassifyId==id){
  1664. arr=[item.UniqueCode,_item.UniqueCode]
  1665. }
  1666. })
  1667. }
  1668. })
  1669. return [...arr,code]
  1670. },
  1671. /* 添加计算指标 */
  1672. addComputedHandler() {
  1673. this.computedTit = '计算指标';
  1674. this.calulateList = [];
  1675. this.calulateForm = {};
  1676. this.operationForm = {};
  1677. this.computed_type=0
  1678. this.isOpenComputed = true;
  1679. },
  1680. /* 新增计算指标回调 */
  1681. addComputedCallBack(type, params) {
  1682. this.computed_type = 0;
  1683. this.computed_source = 1;
  1684. this.showAssociateChart=false
  1685. this.showAssociateComputeData=false
  1686. this.showBatchComputedPop=false
  1687. this.isOpenComputed = false
  1688. console.log(type, params);
  1689. // this.getTreeData();
  1690. type === 'add' ? this.getTreeData(params) : this.getTreeData();
  1691. type === 'edit' && this.initGetData()
  1692. },
  1693. initGetData() {
  1694. this.page_no = 1;
  1695. if(this.$refs.edb_detail_data){
  1696. this.$refs.edb_detail_data.$refs.valueUl.scrollTop=0
  1697. }
  1698. this.getDataList();
  1699. },
  1700. /* 选择计算类型 */
  1701. changeComputedType(type) {
  1702. //保证source的对应关系
  1703. let typeMapSource = {
  1704. 'toMonthSeason': 5,
  1705. 'accumulate': 62
  1706. }
  1707. this.computed_type = typeMapSource[type] || type;
  1708. this.isOpenComputed = false;
  1709. },
  1710. /* 重新计算 */
  1711. reCalculateHandler() {
  1712. this.calculateLoading = true;
  1713. dataBaseInterface.reCalculateTarget({
  1714. EdbInfoId: Number(this.selected_edbid)
  1715. }).then(res => {
  1716. this.calculateLoading = false;
  1717. if(res.Ret !== 200) return;
  1718. this.$message.success(res.Msg);
  1719. this.initDataStatus();
  1720. }).catch(() => {
  1721. this.calculateLoading = false;
  1722. })
  1723. },
  1724. /* 查看计算公式 打开弹窗 */
  1725. viewNode(node,data) {
  1726. const { EdbInfoId,Source } = data;
  1727. //代码运算指标
  1728. if( Source === 27 ) return this.$router.push({
  1729. path: '/codecount',
  1730. query: {
  1731. edbid: EdbInfoId,
  1732. isView: true
  1733. }
  1734. })
  1735. dataBaseInterface.calculateDetail({
  1736. EdbInfoId,
  1737. }).then(res => {
  1738. if(res.Ret !== 200) return
  1739. this.setComputedDialogForm(Source,res.Data,true);
  1740. switch (data.Source) {
  1741. case 23:
  1742. case 24:
  1743. this.computed_type = 'joint';
  1744. break
  1745. case 72:
  1746. case 73:
  1747. this.computed_type = 'alpha';
  1748. break
  1749. default:
  1750. this.computed_type = data.Source;
  1751. break
  1752. }
  1753. })
  1754. },
  1755. /* 设置回显计算指标的表单 */
  1756. setComputedDialogForm(type,res,view=false) {
  1757. //指标运算 or 其他计算类型指标
  1758. // 处理所在目录
  1759. let menuArrId=res.EdbInfoDetail.ClassifyList&&res.EdbInfoDetail.ClassifyList.map(item=>{
  1760. return item.ClassifyId
  1761. }).reverse()
  1762. if( type === 4 ) {
  1763. /* 回显指标和表单 */
  1764. const list = res.CalculateList;
  1765. this.computedTit = view ? '查看计算指标' : '编辑计算指标';
  1766. /* 依赖的指标列表 */
  1767. this.calulateList = list.map(item => {
  1768. return {
  1769. tag: item.FromTag,
  1770. edb_name: item.FromEdbName,
  1771. target: item.FromEdbInfoId,
  1772. start_date: item.StartDate,
  1773. end_date: item.EndDate
  1774. }
  1775. })
  1776. const { EdbInfoId,CalculateFormula,EdbName,Unit,Frequency,EmptyType,MaxEmptyType,Extra } = res.EdbInfoDetail;
  1777. /* 公式和表单 */
  1778. this.calulateForm = {
  1779. edb_id: EdbInfoId,
  1780. formula: CalculateFormula,
  1781. menu: menuArrId||[],
  1782. targetName: EdbName,
  1783. unit: Unit,
  1784. frequency: Frequency,
  1785. emptyType: EmptyType,
  1786. maxEmptyType: MaxEmptyType,
  1787. Extra,
  1788. view
  1789. };
  1790. } else {
  1791. // 多指标求和求平均
  1792. if([81,82].includes(type)){
  1793. this.operationForm={...res,view}
  1794. this.showBatchComputedPop=true
  1795. return
  1796. }
  1797. let dataInfo = res.EdbInfoDetail;
  1798. let old_edb = res.CalculateList;
  1799. let public_params = {
  1800. edb_id: dataInfo.EdbInfoId,
  1801. targetName: dataInfo.EdbName,
  1802. frequency: dataInfo.Frequency,
  1803. unit: dataInfo.Unit,
  1804. menu: menuArrId||[],
  1805. Extra:dataInfo.Extra,
  1806. view
  1807. }
  1808. this.operationForm = [23,24,37,53].includes(type)
  1809. ? {
  1810. ...public_params,
  1811. source: dataInfo.Source,
  1812. date: dataInfo.CalculateFormula,
  1813. pre_edb: type === 23 ? old_edb.find(item => item.FromTag === 'A').FromEdbInfoId : '', //俺也不懂为什么这么定义都是江西老表的锅
  1814. after_edb: type === 23 ? old_edb.find(item => item.FromTag === 'B').FromEdbInfoId : '',
  1815. old_stay_edb: type === 24 ? old_edb.find(item => item.FromTag === 'A').FromEdbInfoId : '',
  1816. concat_edb: type === 24 ? old_edb.find(item => item.FromTag === 'B').FromEdbInfoId : '',
  1817. from_arr: old_edb,
  1818. correlationStr: dataInfo.CorrelationStr
  1819. }
  1820. : {
  1821. ...public_params,
  1822. oldedb_id: old_edb[0].FromEdbInfoId,
  1823. oldEdb_name: old_edb[0].FromEdbName,
  1824. formula: dataInfo.CalculateFormula || '',
  1825. moveType: dataInfo.MoveType,
  1826. moveUnit: dataInfo.MoveFrequency,
  1827. moveVal: type === 22 ? dataInfo.CalculateFormula : '',
  1828. calendar_type: type === 35 ? dataInfo.Calendar : '',
  1829. }
  1830. if([72,73].includes(type)){
  1831. const {EdbName,EdbInfoId,Frequency,Unit,ClassifyId,CalculateFormula} = dataInfo
  1832. this.operationForm = {
  1833. edb_id: EdbInfoId,
  1834. oldedb_id: old_edb[0].FromEdbInfoId,
  1835. oldEdb_name: old_edb[0].FromEdbName,
  1836. EdbName,Frequency,Unit,ClassifyId,Formula:CalculateFormula,
  1837. view
  1838. }
  1839. }
  1840. }
  1841. },
  1842. /* 基础指标刷新 */
  1843. refreshBaseHandler() {
  1844. if(this.EdbData.NoUpdate){
  1845. this.$message.warning("该指标已暂停刷新")
  1846. return
  1847. }
  1848. this.refreshLoading = true;
  1849. this.loading = this.$loading({
  1850. lock: true,
  1851. target:'.detail',
  1852. text: this.$t('MsgPrompt.refresh_ing_msg'),
  1853. spinner: 'el-icon-loading',
  1854. background: 'rgba(255, 255, 255, 0.8)'
  1855. });
  1856. dataBaseInterface.refreshBaseTarget({
  1857. EdbInfoId: Number(this.selected_edbid)
  1858. }).then(res => {
  1859. this.refreshLoading = false;
  1860. this.loading&&this.loading.close()
  1861. if(res.Ret !== 200) return;
  1862. this.$message.success(res.Msg);
  1863. this.initDataStatus();
  1864. }).catch(() => {
  1865. this.refreshLoading = false;
  1866. })
  1867. },
  1868. /* 一键成图 */
  1869. createChartHandle() {
  1870. this.isCreateChart = true;
  1871. },
  1872. /* 重新刷新 重新计算后重置刷数据 */
  1873. initDataStatus() {
  1874. this.page_no = 1;
  1875. if(this.$refs.edb_detail_data){
  1876. this.$refs.edb_detail_data.$refs.valueUl.scrollTop=0
  1877. }
  1878. this.getDataList();
  1879. },
  1880. /* 用于复制指标 */
  1881. async copyCode(){
  1882. const res = await dataBaseInterface.targetList({
  1883. PageSize: 100000,
  1884. CurrentIndex: 1,
  1885. EdbInfoId: this.selected_edbid,
  1886. })
  1887. if (res.Ret===200){
  1888. let arr = res.Data.Item.DataList ||[]
  1889. let str = '日期\t 值\n'
  1890. arr.forEach((item=> str += `${item.DataTime}\t${item.Value}\n`))
  1891. this.$copyText(str).then(
  1892. res => {
  1893. // this.$message.success("已成功复制!");
  1894. this.$message.success(this.$t('MsgPrompt.copy_success_msg'));
  1895. },
  1896. err => {
  1897. this.$message.error("复制失败!");
  1898. } )
  1899. }
  1900. },
  1901. /* 一键更新 */
  1902. updateHandler() {
  1903. this.isUpdate = true;
  1904. },
  1905. /* 替换指标 */
  1906. async replaceEdbHandler () {
  1907. const { Data } = await dataBaseInterface.replaceCheck();
  1908. Data === 2
  1909. ? this.isReplaceDia = true
  1910. : await this.$confirm(this.$t('EtaBasePage.replace_ing_msg'), this.$t('Dialog.warn_tit'), {
  1911. type: 'warning',
  1912. showCancelButton: false,
  1913. })
  1914. },
  1915. /* 添加最新值 */
  1916. updateNewestDataHandle() {
  1917. this.isUpdateNewestData = true;
  1918. },
  1919. updateNewest(){
  1920. this.initGetData()
  1921. this.rePainChart()
  1922. },
  1923. /* 获取标签列表 */
  1924. getlabelList(){
  1925. const List = JSON.parse(sessionStorage.getItem('database'))||[]
  1926. this.labelList = List
  1927. },
  1928. /* 添加标签 params :{code,id,classifyId,EdbName,EdbNameEn}*/
  1929. addLabel(params){
  1930. const index = this.labelList.findIndex(i=>i.code===params.code)
  1931. //标签已存在列表中,更新标签的值
  1932. if(index!==-1){
  1933. this.labelList.splice(index,1,params)
  1934. return
  1935. }
  1936. //根据页面宽度 判断标签数量是否达到上限
  1937. const listWidth = document.querySelector('.database-label').offsetWidth
  1938. const minWidth=170+20
  1939. const maxNum = Math.floor(listWidth/minWidth)
  1940. if(this.labelList.length>=maxNum){
  1941. //达到上限则挤出第一个,再添加
  1942. this.labelList.shift()
  1943. }
  1944. this.labelList.push(params)
  1945. sessionStorage.setItem('database',JSON.stringify(this.labelList))
  1946. },
  1947. //改变选中标签,
  1948. changeCurrentLabel(params){
  1949. if(params.code!==this.select_node){
  1950. this.selectCurrentNode(params)
  1951. }
  1952. },
  1953. //删除标签
  1954. deleteLabel(params){
  1955. const index = this.labelList.findIndex(i=>i.code===params.code)
  1956. //如果删除的标签是选中状态
  1957. if(this.select_node===params.code){
  1958. //删除的是唯一一个标签
  1959. if(this.labelList.length===1){
  1960. this.selected_edbid=0
  1961. this.select_node = ''
  1962. this.$refs.menuTree.setCurrentKey(null)
  1963. //不是唯一的标签,则默认选中上一个/下一个
  1964. }else{
  1965. index===0&&this.changeCurrentLabel(this.labelList[1])
  1966. index!==0&&index!==-1&&this.changeCurrentLabel(this.labelList[index-1])
  1967. }
  1968. }
  1969. index!==-1&&this.labelList.splice(index,1)
  1970. sessionStorage.setItem('database',JSON.stringify(this.labelList))
  1971. },
  1972. changeTreeNode(){
  1973. this.$refs.menuTree.setCurrentKey(this.select_node);
  1974. this.$nextTick(()=>{
  1975. const _node = this.$refs.menuTree.getCurrentNode()
  1976. this.dynamicNode = _node;
  1977. this.dynamicNode&&this.resetNodeStyle(this.dynamicNode)
  1978. })
  1979. },
  1980. //只看我的
  1981. onlyMeHandler(){
  1982. this.getTreeData()
  1983. this.CurrentIndex = 1;
  1984. this.$refs.listRef.scrollTop = 0;
  1985. this.getEdbChartList();
  1986. },
  1987. //绑定el-tree的load属性
  1988. async getLazyTreeData (node,resolve){
  1989. if(node.level===0){
  1990. resolve(this.treeData)
  1991. }else{
  1992. let arr=[]
  1993. const res=await dataBaseInterface.targetCatalog({ParentId:node.data.ClassifyId,IsOnlyMe:this.IsOnlyMe})
  1994. if (res.Ret === 200) {
  1995. const temarr = res.Data.AllNodes || [];
  1996. arr=temarr.map(item=>{
  1997. return {
  1998. ...item,
  1999. isLeaf:item.EdbInfoId?true:false
  2000. }
  2001. })
  2002. }
  2003. resolve(arr)
  2004. }
  2005. },
  2006. //保存指标上下限
  2007. saveEdbLimit(){
  2008. if(!this.$refs.createChart) return
  2009. //获取指标的上下限
  2010. const {MaxValue=0,MinValue=0} = this.$refs.createChart.chartInfo
  2011. dataBaseInterface.saveEdbChartLimit({
  2012. EdbInfoId:this.EdbData.EdbInfoId,
  2013. MaxValue:Number(MaxValue),
  2014. MinValue:Number(MinValue)
  2015. }).then(res=>{
  2016. if(res.Ret!==200) return
  2017. // this.$message.success('保存成功')
  2018. this.$message.success(this.$t('MsgPrompt.saved_msg'))
  2019. this.$refs.createChart.saveEdbImg(this.EdbData)
  2020. this.$refs.createChart.oldOptions = {}
  2021. })
  2022. },
  2023. //重绘指标图表
  2024. rePainChart(){
  2025. if(this.activeTab!=='Chart') return
  2026. this.$nextTick(()=>{
  2027. this.$refs.createChart.getDataByPath()
  2028. })
  2029. },
  2030. /* 展开对应菜单 显示详情 */
  2031. detailShowHandle({ UniqueCode, EdbInfoId,ClassifyId}) {
  2032. let params = {
  2033. code: UniqueCode,
  2034. id: EdbInfoId,
  2035. classifyId:ClassifyId
  2036. };
  2037. this.selectCurrentNode(params);
  2038. this.select_classifyId = 0;
  2039. },
  2040. // 添加wind wsd指标成功
  2041. addTargetSuccess(params){
  2042. this.getTreeData(params);
  2043. },
  2044. handleCloseBatchPopSelf(){
  2045. this.showBatchComputedPop=false
  2046. this.$nextTick(()=>{//重新打开计算指标选择类型弹窗
  2047. this.isOpenComputed=true
  2048. })
  2049. }
  2050. },
  2051. //离开页面时保存标签
  2052. beforeRouteLeave(to,from,next){
  2053. sessionStorage.setItem('database',JSON.stringify(this.labelList))
  2054. next()
  2055. },
  2056. mounted() {
  2057. this.getlabelList()
  2058. this.getEdbChartList()
  2059. this.$route.query.code
  2060. ? this.getTreeData({code: this.$route.query.code,id: this.$route.query.id,classifyId:this.$route.query.classifyId})
  2061. : this.getTreeData();
  2062. //离开页面时保存标签
  2063. window.onbeforeunload = ()=>{
  2064. sessionStorage.setItem('database',JSON.stringify(this.labelList))
  2065. }
  2066. },
  2067. destroyed(){
  2068. window.onbeforeunload = null
  2069. }
  2070. };
  2071. </script>
  2072. <style lang="scss">
  2073. @import "~@/styles/theme-vars.scss";
  2074. .database_container {
  2075. $mini_font: 12px;
  2076. $normal_font: 14px;
  2077. .firstColumTable .el-table__empty-block {
  2078. display: none;
  2079. }
  2080. .firstColumTable .el-table__header th:first-child .cell{
  2081. overflow: visible;
  2082. }
  2083. .el-table td,.el-table th {
  2084. padding: 10px 0;
  2085. }
  2086. .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
  2087. background-color: $theme-color !important;
  2088. border-color: $theme-color;
  2089. }
  2090. .el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner {
  2091. background-color: $theme-color !important;
  2092. border-color: $theme-color;
  2093. }
  2094. .el-icon-refresh {
  2095. font-size: 17px;
  2096. margin-left: 5px;
  2097. cursor: pointer;
  2098. }
  2099. @media screen and (min-width: 1711px) {
  2100. .target_tree {
  2101. font-size: $normal_font;
  2102. }
  2103. }
  2104. @media screen and (max-width: 1710px) {
  2105. .target_tree {
  2106. font-size: $mini_font;
  2107. }
  2108. }
  2109. .database_top {
  2110. display: flex;
  2111. justify-content: space-between;
  2112. align-items: center;
  2113. margin-bottom: 20px;
  2114. padding: 20px 30px;
  2115. background: #fff;
  2116. border: 1px solid #ececec;
  2117. border-radius: 4px;
  2118. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  2119. .top-right,.top-left{
  2120. display: flex;
  2121. align-items: center;
  2122. gap:20px;
  2123. flex-wrap: wrap;
  2124. .el-button + .el-button{
  2125. margin-left: 0;
  2126. }
  2127. }
  2128. /* .top-left{
  2129. display: flex;
  2130. } */
  2131. }
  2132. .database_main {
  2133. display: flex;
  2134. margin-top: 20px;
  2135. position:relative;
  2136. width:100%;
  2137. overflow-x: auto;
  2138. /* div::-webkit-scrollbar {
  2139. width: 5px !important;
  2140. } */
  2141. .main-left {
  2142. width: 400px;
  2143. min-width: 300px;
  2144. background: #fff;
  2145. margin-right: 20px;
  2146. border: 1px solid #ececec;
  2147. border-radius: 4px;
  2148. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  2149. height: calc(100vh - 225px);
  2150. overflow: hidden;
  2151. position: relative;
  2152. box-sizing: border-box;
  2153. .tree-cont {
  2154. padding: 30px;
  2155. /* height: calc(100vh - 290px);
  2156. overflow: auto; */
  2157. }
  2158. .target_tree {
  2159. color: #333;
  2160. height: calc(100vh - 400px);
  2161. overflow: auto;
  2162. .label-input .el-input__inner {
  2163. height: 25px;
  2164. line-height: 25px;
  2165. }
  2166. .custom-tree-node {
  2167. display: flex !important;
  2168. justify-content: space-between;
  2169. align-items: center;
  2170. display: block;
  2171. flex: 1;
  2172. .node_label {
  2173. margin-right: 2px;
  2174. }
  2175. .el-icon-view {
  2176. color: #409eff;
  2177. font-size: 18px;
  2178. margin-left: 5px;
  2179. }
  2180. }
  2181. .el-tree__drop-indicator{
  2182. /* position:absolute; */
  2183. /* left:0;
  2184. right:0; */
  2185. height:3px;
  2186. // margin-top: 8px;
  2187. background-color:$theme-color;
  2188. }
  2189. .el-tree-node__content {
  2190. margin-bottom: 14px !important;
  2191. }
  2192. .el-tree-node__children {
  2193. .el-tree-node {
  2194. /* margin-bottom: 8px !important; */
  2195. margin-bottom: 0px !important;
  2196. padding-left: 18px;
  2197. }
  2198. .el-tree-node__content {
  2199. margin-bottom: 5px !important;
  2200. padding-left: 0 !important;
  2201. }
  2202. }
  2203. .expanded.el-icon-caret-right:before {
  2204. content: url('../../assets/img/set_m/down.png') !important;
  2205. }
  2206. .el-icon-caret-right:before {
  2207. content: url('../../assets/img/set_m/slide.png') !important;
  2208. }
  2209. .el-tree-node__expand-icon.is-leaf.el-icon-caret-right:before {
  2210. content: '' !important;
  2211. }
  2212. .el-tree-node__expand-icon.expanded {
  2213. -webkit-transform: rotate(0deg);
  2214. transform: rotate(0deg);
  2215. }
  2216. .el-tree-node.is-current > .el-tree-node__content {
  2217. background-color: #f0f4ff !important;
  2218. }
  2219. .el-tree-node__content {
  2220. padding-right: 10px !important;
  2221. }
  2222. }
  2223. .noDepart {
  2224. margin: 30px 0;
  2225. display: flex;
  2226. align-items: center;
  2227. justify-content: center;
  2228. color: $theme-color;
  2229. font-size: 16px;
  2230. cursor: pointer;
  2231. }
  2232. .move-btn {
  2233. height: 100%;
  2234. width: 4px;
  2235. /* opacity: 0; */
  2236. position: absolute;
  2237. right: 0px;
  2238. top: 0;
  2239. &:hover {
  2240. cursor: col-resize;
  2241. /* background-color: orange */
  2242. }
  2243. }
  2244. }
  2245. .main-right {
  2246. flex: 1;
  2247. /* width:70%; */
  2248. height: calc(100vh - 225px);
  2249. background: #fff;
  2250. border: 1px solid #ececec;
  2251. border-radius: 4px;
  2252. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  2253. overflow: hidden;
  2254. .value-ul {
  2255. margin-top: 10px;
  2256. border-bottom: 1px solid #EBEFF6;
  2257. //max-height: calc(100vh - 495px);
  2258. //overflow-y: auto;
  2259. .value-item {
  2260. /* width: 100%; */
  2261. padding: 10px 0;
  2262. border: 1px solid #dcdfe6;
  2263. border-bottom: none;
  2264. display: flex;
  2265. justify-content: space-around;
  2266. >span{
  2267. padding:0 16px;
  2268. box-sizing: border-box;
  2269. }
  2270. .value-label {
  2271. position: relative;
  2272. color: #666;
  2273. .value-style{
  2274. /* background-color: #ECF2FE;
  2275. color: #0052D9; */
  2276. padding:5px;
  2277. border-radius: 4px;
  2278. &.predict-act {
  2279. color: orange;
  2280. }
  2281. }
  2282. &.date{
  2283. &::after{
  2284. content: '';
  2285. position:absolute;
  2286. right:0;
  2287. top:-14px;
  2288. height:calc(100% + 28px);
  2289. width:1px;
  2290. background-color: #dcdfe6;
  2291. }
  2292. }
  2293. }
  2294. .predict-act {
  2295. color: orange;
  2296. }
  2297. .new-tag {
  2298. width: 6px;
  2299. height: 6px;
  2300. display: inline-block;
  2301. position: absolute;
  2302. left: -12px;
  2303. top: 50%;
  2304. transform: translateY(-50%);
  2305. border-radius: 50%;
  2306. background: #f00;
  2307. }
  2308. }
  2309. .nodata {
  2310. text-align: center;
  2311. padding: 40px 0;
  2312. color: #999;
  2313. }
  2314. }
  2315. &.list{
  2316. background-color: transparent;
  2317. box-shadow: none;
  2318. border:none;
  2319. padding-left:30px;
  2320. display: flex;
  2321. flex-direction: column;
  2322. .list-wrap{
  2323. flex: 1;
  2324. margin-top: 20px;
  2325. overflow-y: auto;
  2326. .dragShdow {
  2327. box-shadow: 0 1px 8px rgba(64, 158, 255, 0.8);
  2328. opacity: 0.5;
  2329. }
  2330. .list-item{
  2331. width:23%;
  2332. min-width: 210px;
  2333. background-color: #fff;
  2334. display: flex;
  2335. flex-direction: column;
  2336. box-sizing: border-box;
  2337. border-radius: 4px;
  2338. border:1px solid #DCDFE6;
  2339. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  2340. .header,.info{
  2341. padding:10px;
  2342. box-sizing: border-box;
  2343. text-align: left;
  2344. }
  2345. .header{
  2346. white-space: nowrap;
  2347. overflow: hidden;
  2348. text-overflow: ellipsis;
  2349. font-size: 16px;
  2350. font-weight: 600;
  2351. box-shadow: 0 3px 6px rgba(37, 37, 239, 0.1);
  2352. }
  2353. .image{
  2354. margin:10px;
  2355. margin-bottom: 0;
  2356. height: 0;
  2357. padding-bottom: 67%;
  2358. cursor: pointer;
  2359. }
  2360. }
  2361. }
  2362. }
  2363. &.detail-wrap{
  2364. overflow-x:auto;
  2365. }
  2366. .detail{
  2367. display: flex;
  2368. flex-direction: column;
  2369. min-width: 780px;
  2370. height:100%;
  2371. >.header{
  2372. display: flex;
  2373. position: relative;
  2374. height: 60px;
  2375. .el-tabs{
  2376. width:210px;
  2377. .el-tabs__header{
  2378. margin-bottom: 0;
  2379. }
  2380. .el-tabs__nav{
  2381. display: flex;
  2382. width: 100%;
  2383. .el-tabs__item{
  2384. flex: 1;
  2385. text-align: center;
  2386. font-size: 16px;
  2387. height: 60px;
  2388. line-height: 60px;
  2389. }
  2390. }
  2391. }
  2392. .edb-tool{
  2393. flex: 1;
  2394. text-align: right;
  2395. display: flex;
  2396. gap: 16px;
  2397. justify-content: flex-end;
  2398. padding-right: 15px;
  2399. position: relative;
  2400. &::after{
  2401. position: absolute;
  2402. content:'';
  2403. width:100%;
  2404. left: 0;
  2405. bottom: 0;
  2406. height:2px;
  2407. background-color: #E4E7ED;
  2408. }
  2409. }
  2410. }
  2411. .container{
  2412. flex: 1;
  2413. overflow-y: auto;
  2414. padding:15px;
  2415. .chart{
  2416. .info{
  2417. display: flex;
  2418. justify-content: space-between;
  2419. }
  2420. .table{
  2421. margin-top: 16px;
  2422. border:1px solid #E7E7E7 ;
  2423. .table-header{
  2424. display: flex;
  2425. padding:6px;
  2426. span{
  2427. flex: 1;
  2428. border-bottom: 1px solid #E7E7E7;
  2429. }
  2430. }
  2431. }
  2432. }
  2433. .list{
  2434. height: 100%;
  2435. }
  2436. }
  2437. }
  2438. }
  2439. .slide-btn-icon{
  2440. &.slide-left{
  2441. right:0;
  2442. }
  2443. &.slide-right{
  2444. left: 0;
  2445. }
  2446. }
  2447. }
  2448. .dialog-computed {
  2449. .el-dialog__header {
  2450. background-color: #fff;
  2451. .el-dialog__close {
  2452. color: #333;
  2453. }
  2454. }
  2455. .computed-ul {
  2456. box-sizing: border-box;
  2457. max-height: 600px;
  2458. height:65vh;
  2459. overflow-y: auto;
  2460. padding: 40px 92px;
  2461. display: flex;
  2462. flex-wrap: wrap;
  2463. .cpmputed-li {
  2464. width: 180px;
  2465. padding: 19px 0;
  2466. height: 60px;
  2467. box-sizing: border-box;
  2468. color: $theme-color;
  2469. font-size: 16px;
  2470. background:#ECF5FF;
  2471. border-radius: 8px;
  2472. border: 1px solid #99baf0;
  2473. text-align: center;
  2474. cursor: pointer;
  2475. margin-right: 65px;
  2476. margin-bottom: 55px;
  2477. &:nth-child(3n) {
  2478. margin-right:0;
  2479. }
  2480. &:hover {
  2481. background: $theme-color;
  2482. color: #fff;
  2483. }
  2484. &.act {
  2485. background: $theme-color;
  2486. color: #fff;
  2487. }
  2488. }
  2489. }
  2490. }
  2491. }
  2492. .edb-tool-popover{
  2493. .edb-tool-wrap{
  2494. display: flex;
  2495. flex-wrap: wrap;
  2496. gap:10px;
  2497. .el-button + .el-button{
  2498. margin-left: 0;
  2499. }
  2500. }
  2501. }
  2502. </style>