databaseList.vue 77 KB

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