databaseList.vue 78 KB

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