chartSetting.vue 106 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085
  1. <template>
  2. <div class="chartSetting_container">
  3. <div class="chartSetting_main box" id="box" v-if="showData">
  4. <span
  5. class="slide-icon slide-right"
  6. @click="slideHandle"
  7. v-show="isSlideLeft"
  8. >
  9. <i class="el-icon-d-arrow-right"></i>
  10. </span>
  11. <div class="chartSetting-label-list">
  12. <edb-label-list
  13. :currentLang="currentLang"
  14. :labelList="labelList"
  15. :activeLabelId="select_node"
  16. @clickLabel="changeCurrentLabel"
  17. @deleteLabel="deleteLabel"
  18. @moveLabel="({oldIndex,newIndex})=>{labelList[oldIndex] = labelList.splice(newIndex, 1, labelList[oldIndex])[0];}"
  19. />
  20. </div>
  21. <div class="chartSetting-main">
  22. <div class="main-left left" id="left" v-show="!isSlideLeft">
  23. <div class="add-chart-cont">
  24. <el-button
  25. v-permission="permissionBtn.chartLibPermission.chartLib_add"
  26. @click="$router.push({path: '/addchart'})" type="primary"
  27. ><!-- 添加图表 -->{{$t('Chart.add_chart_btn')}}</el-button>
  28. <change-lang v-permission="permissionBtn.chartLibPermission.chartLib_switchEn"
  29. :lang="currentLang" @changeLang="changeLanguage" style="margin-left: 10px;"/>
  30. </div>
  31. <ul class="left-tab">
  32. <li
  33. :class="['tab',{'act': leftShowLabel===tab.val}]"
  34. v-for="tab in leftTabs"
  35. :key="tab.val"
  36. @click="leftShowLabel=tab.val"
  37. >{{tab.label}}</li>
  38. <li >
  39. <el-checkbox v-model="isOnlyMe"
  40. v-permission="permissionBtn.chartLibPermission.chartLib_isOnlyMine"
  41. @change="onlyMeHandler"><!-- 只看我的 -->{{$t('Chart.only_see_mine')}}</el-checkbox>
  42. </li>
  43. </ul>
  44. <!-- 目录 -->
  45. <template v-if="leftShowLabel === '目录'">
  46. <div class="chartSetting_main_top">
  47. <el-select
  48. v-model="search_txt"
  49. v-loadMore="searchLoad"
  50. :filterable="!search_txt"
  51. remote
  52. clearable
  53. :placeholder="$t('Chart.search_chart_placeholder')"
  54. style="width: 100%; margin-top: 20px"
  55. :remote-method="searchHandle"
  56. @click.native="inputFocusHandle"
  57. >
  58. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  59. <el-option
  60. v-for="item in searchOptions"
  61. :key="item.ChartInfoId"
  62. :label="currentLang==='en'?(item.ChartNameEn||item.ChartName):item.ChartName"
  63. :value="item.ChartInfoId"
  64. >
  65. </el-option>
  66. </el-select>
  67. </div>
  68. <div class="tree-cont">
  69. <el-tree
  70. ref="treeRef"
  71. class="target_tree"
  72. :data="treeData"
  73. node-key="UniqueCode"
  74. :props="defaultProp"
  75. :allow-drag="canDragHandle"
  76. :allow-drop="canDropHandle"
  77. :current-node-key="select_node"
  78. :default-expanded-keys="defaultShowNodes"
  79. draggable
  80. :expand-on-click-node="false"
  81. check-strictly
  82. :empty-text="$t('Common.no_classify_msg')"
  83. lazy
  84. :load="getLazyTreeData"
  85. @node-expand="handleNodeExpand"
  86. @node-collapse="handleNodeCollapse"
  87. @current-change="nodeChange"
  88. @node-drop="dropOverHandle"
  89. @node-drag-end="dropMouseLeave"
  90. @node-drag-leave="dropMouseLeave"
  91. @node-drag-enter="dropMouseOver"
  92. >
  93. <span class="custom-tree-node" slot-scope="{ node, data }">
  94. <el-input
  95. ref="editVal"
  96. style="width: 90px"
  97. placeholder="请输入值"
  98. class="label-input"
  99. v-model="new_label"
  100. v-if="data.isEdit&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_add')"
  101. @blur="changeValue(node, data)"
  102. />
  103. <span
  104. @dblclick.stop="editNodeLabel(node, data)"
  105. v-else
  106. class="text_oneLine node_label"
  107. :style="`width:${
  108. (select_node === data.UniqueCode && node.Nodewidth) || ''
  109. }`"
  110. :id="`node${data.UniqueCode}`"
  111. >
  112. <span>{{ currentLang==='en' ? (data.ChartClassifyNameEn||data.ChartClassifyName) : data.ChartClassifyName }}</span>
  113. </span>
  114. <span
  115. style="display: flex; align-items: center"
  116. v-if="select_node === data.UniqueCode"
  117. >
  118. <img
  119. src="~@/assets/img/data_m/move_ico.png"
  120. alt=""
  121. style="width: 14px; height: 14px; margin-right: 8px"
  122. v-if="data.Button.MoveButton"
  123. />
  124. <!-- 添加子项 -->
  125. <img
  126. src="~@/assets/img/set_m/add.png"
  127. alt=""
  128. style="width: 14px; height: 14px; margin-right: 8px"
  129. @click.stop="addNode(node, data)"
  130. v-if="data.Button.AddButton&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_add')"
  131. />
  132. <!-- 编辑子项 -->
  133. <img
  134. src="~@/assets/img/set_m/edit.png"
  135. alt=""
  136. style="width: 15px; height: 14px; margin-right: 8px"
  137. @click.stop="editNode(node, data)"
  138. v-if="data.Button.OpButton&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_add')"
  139. />
  140. <!-- 删除子项 -->
  141. <img
  142. slot="reference"
  143. src="~@/assets/img/set_m/del.png"
  144. alt=""
  145. style="width: 14px; height: 14px"
  146. @click.stop="removeNode(node, data)"
  147. v-if="data.Button.DeleteButton&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_delete')"
  148. />
  149. </span>
  150. </span>
  151. </el-tree>
  152. <div
  153. class="noDepart"
  154. @click="addLevelOneHandle"
  155. v-if="CanOpClassify&&permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_add')"
  156. >
  157. <img
  158. src="~@/assets/img/set_m/add_ico.png"
  159. alt=""
  160. style="width: 16px; height: 16px; margin-right: 10px"
  161. />
  162. <span><!-- 添加图表分类 -->{{$t('EtaChartPage.add_classify_btn')}}</span>
  163. </div>
  164. </div>
  165. </template>
  166. <!-- 坐标轴 -->
  167. <div class="targetset-cont" v-else>
  168. <!-- 仅用于散点图配置提出 -->
  169. <div class="scatter-setting" v-if="chartInfo.ChartType === 5 && tableData.length">
  170. <div style="display: flex;margin-right: 15px;">
  171. <span style="margin-right: 3px"><!-- 线条颜色 -->{{$t('Chart.Detail.line_color')}}:</span>
  172. <el-color-picker
  173. v-model="tableData[0].ChartColor"
  174. size="mini"
  175. show-alpha
  176. :predefine="predefineColors"
  177. ></el-color-picker>
  178. </div>
  179. <el-checkbox v-model="tableData[0].IsOrder"><!-- 逆序 -->{{$t('Chart.Detail.re_order')}}</el-checkbox>
  180. </div>
  181. <el-collapse v-model="activeNames" class="target-list" v-if="tableData.length">
  182. <el-collapse-item v-for="(item,index) in tableData" :key="item.EdbInfoId" :disabled="![1,4,6].includes(chartInfo.ChartType)">
  183. <template slot="title">
  184. <span class="text_oneLine">{{item.EdbName}}</span>
  185. </template>
  186. <ul class="setting-cont">
  187. <!-- 堆叠图 或组合图中的堆叠类型 非第一项隐藏配置 -->
  188. <template v-if="showYOptionsHandle(item,index)">
  189. <li>
  190. <el-checkbox v-model="item.IsOrder"><!-- 逆序 -->{{$t('Chart.Detail.re_order')}}</el-checkbox>
  191. </li>
  192. <li>
  193. <el-radio-group v-model="item.IsAxis" size="mini">
  194. <el-radio-button :label="1"><!-- 左轴 -->{{$t('Chart.Detail.l_axis')}}</el-radio-button>
  195. <el-radio-button :label="0"><!-- 右轴 -->{{$t('Chart.Detail.r_axis')}}</el-radio-button>
  196. <!-- 指标有右轴时才可以选右2轴 不然没有右2这个概念的意义 -->
  197. <el-radio-button
  198. v-if="[1,6].includes(chartInfo.ChartType)"
  199. :label="2"
  200. :disabled="(tableData.findIndex(_ => _.IsAxis===0) === -1)
  201. || (tableData.findIndex(_ => _.IsAxis===0) === index
  202. && tableData.filter(_ => _.IsAxis===0).length === 1)"
  203. ><!-- 右2轴 -->{{$t('Chart.Detail.rtwo_axis')}}</el-radio-button>
  204. </el-radio-group>
  205. </li>
  206. </template>
  207. <li style="min-width: 250px">
  208. <el-radio
  209. v-model="item.EdbInfoType"
  210. :label="1"
  211. @change="getPreviewChartInfo"
  212. ><!-- 标准指标 -->{{$t('Chart.Detail.stand_lead')}}</el-radio>
  213. <div style="margin-top: 15px">
  214. <el-radio
  215. v-model="item.EdbInfoType"
  216. :label="0"
  217. style="margin-right: 10px"
  218. @change="getPreviewChartInfo"
  219. ><!-- 领先指标 -->{{$t('Chart.Detail.leading_lead')}}</el-radio>
  220. <template v-if="item.EdbInfoType === 0">
  221. <!-- 领先 -->{{$t('EtaChartAddPage.label_lead')}}
  222. <el-input
  223. style="width: 60px"
  224. size="mini"
  225. type="number"
  226. min="0"
  227. v-model="item.LeadValue"
  228. @change="getPreviewChartInfo"
  229. @keyup.native="filterCode(item)"
  230. ></el-input>
  231. <el-select
  232. v-model="item.LeadUnit"
  233. placeholder=""
  234. style="width: 60px"
  235. size="mini"
  236. @change="getPreviewChartInfo"
  237. >
  238. <el-option
  239. v-for="item in fre_options"
  240. :key="item"
  241. :label="item"
  242. :value="item"
  243. >
  244. </el-option>
  245. </el-select>
  246. </template>
  247. </div>
  248. </li>
  249. <li>
  250. <div style="display: flex">
  251. <span style="margin-right: 3px"><!-- 线条颜色 -->{{$t('Chart.Detail.line_color')}}:</span>
  252. <el-color-picker
  253. v-model="item.ChartColor"
  254. size="mini"
  255. show-alpha
  256. :predefine="predefineColors"
  257. ></el-color-picker>
  258. </div>
  259. <div style="display: flex;margin-top: 12px" v-if="item.EdbInfoCategoryType === 1">
  260. <span style="margin-right: 3px"><!-- 预测值颜色 -->{{$t('Chart.Detail.predict_color')}}:</span>
  261. <el-color-picker
  262. v-model="item.PredictChartColor"
  263. size="mini"
  264. show-alpha
  265. :predefine="predefineColors"
  266. ></el-color-picker>
  267. </div>
  268. <div
  269. style="margin-top: 12px"
  270. v-if="chartInfo.ChartType === 1
  271. || (chartInfo.ChartType === 6 && item.ChartStyle==='spline')"
  272. >
  273. <!-- 线条粗细 -->{{$t('Chart.Detail.line_size')}}:
  274. <el-input
  275. style="width: 60px"
  276. size="mini"
  277. type="number"
  278. :min="1"
  279. v-model="item.ChartWidth"
  280. @keyup.native="filterWidth(item)"
  281. />
  282. </div>
  283. </li>
  284. <li v-if="chartInfo.ChartType === 6">
  285. <div style="display: flex">
  286. <span style="margin-right: 3px"><!-- 生成样式 -->{{$t('Chart.label_create_sty')}}:</span>
  287. <el-select
  288. v-model="item.ChartStyle"
  289. placeholder="请选择生成样式"
  290. style="width: 50%"
  291. class="edb-item-style"
  292. >
  293. <el-option
  294. v-for="item in chartItemStyleArr"
  295. :key="item.key"
  296. :label="item.label"
  297. :value="item.value"
  298. >
  299. </el-option>
  300. </el-select>
  301. </div>
  302. </li>
  303. </ul>
  304. </el-collapse-item>
  305. </el-collapse>
  306. <div v-else class="nodata">
  307. <tableNoData :text="$t('Common.no_info_msg')"/>
  308. </div>
  309. </div>
  310. <span
  311. class="move-btn resize"
  312. v-drag
  313. id="resize"
  314. @mousemove="dynamicNode && resetNodeStyle(dynamicNode)"
  315. ></span>
  316. <span class="slide-icon slide-left" @click="slideHandle">
  317. <i class="el-icon-d-arrow-left"></i>
  318. </span>
  319. </div>
  320. <div
  321. class="main-right right"
  322. id="right"
  323. :style="isSlideLeft ? 'width:100%' : `width:${dynamicWidth}`"
  324. >
  325. <!-- =============具体图表区域============== -->
  326. <div class="chart-min-cont" v-if="tableData.length">
  327. <div class="cont-top">
  328. <div class="top-left">
  329. <!-- 默认曲线图 -->
  330. <template v-if="sameOptionType.includes(chartInfo.ChartType)">
  331. <el-button
  332. type="primary"
  333. v-for="item in yearSelector"
  334. :key="item.value"
  335. size="medium"
  336. :plain="item.value !== year_select"
  337. class="year-btn"
  338. @click.native="changeYear(item)"
  339. >{{ item.name }}</el-button
  340. >
  341. <el-button type="text" class="btn-sty" @click="openDateDia">{{
  342. dateTip
  343. }}</el-button>
  344. </template>
  345. <!-- 季节性图选择年份区间 -->
  346. <!-- <date-picker
  347. v-else-if="chartInfo.ChartType === 2"
  348. v-model="season_year"
  349. type="month"
  350. value-type="format"
  351. range
  352. placeholder="年份日期选择"
  353. @change="seasonYearChange"
  354. /> -->
  355. <div v-else-if="chartInfo.ChartType === 2" @click="openDateDia" class="date-setting">
  356. {{ season_year && season_year.length>0 ? season_year[0]+'~'+season_year[1]:"年份日期选择" }}
  357. </div>
  358. </div>
  359. </div>
  360. <div class="cont-bottom">
  361. <el-row class="bottom-min">
  362. <el-col
  363. :span="21"
  364. style="padding-bottom: 30px;"
  365. >
  366. <div class="chartEn-mark" v-show="chartInfo.IsEnChart" style="top: 0;left: 0;">En</div>
  367. <div class="chart-show-cont" v-if="!chartInfo.WarnMsg">
  368. <div class="chartWrapper" id="chartWrapper">
  369. <h2
  370. class="chart-title"
  371. :style="`
  372. textAlign:${JSON.parse(chartInfo.ChartThemeStyle).titleOptions.align};
  373. fontSize:${JSON.parse(chartInfo.ChartThemeStyle).titleOptions.style.fontSize}px;
  374. color:${JSON.parse(chartInfo.ChartThemeStyle).titleOptions.style.color}
  375. `"
  376. >
  377. {{ currentLang==='en'?(chartInfo.ChartNameEn||chartInfo.ChartName):chartInfo.ChartName }}
  378. </h2>
  379. <Chart :options="options" :chartInfo="chartInfo" ref="chartRef"/>
  380. <!-- <div class="range-cont left" v-if="leftIndex != -1">
  381. <el-input
  382. style="width: 60px; display: block"
  383. size="mini"
  384. type="number"
  385. :placeholder="$t('Chart.up_limit')"
  386. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  387. v-model="tableData[leftIndex].MaxData"
  388. />
  389. <el-input
  390. class="min-data-input"
  391. size="mini"
  392. type="number"
  393. :placeholder="$t('Chart.low_limit')"
  394. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  395. v-model="tableData[leftIndex].MinData"
  396. />
  397. </div>
  398. <div
  399. class="range-cont right"
  400. v-if="rightIndex != -1"
  401. >
  402. <el-input
  403. style="width: 60px; display: block"
  404. size="mini"
  405. type="number"
  406. :placeholder="$t('Chart.up_limit')"
  407. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  408. v-model="tableData[rightIndex].MaxData"
  409. />
  410. <el-input
  411. class="min-data-input"
  412. size="mini"
  413. type="number"
  414. :placeholder="$t('Chart.low_limit')"
  415. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  416. v-model="tableData[rightIndex].MinData"
  417. />
  418. </div>
  419. <div class="range-cont rightTwo" v-if="rightTwoIndex != -1">
  420. <el-input
  421. style="width: 60px; display: block"
  422. size="mini"
  423. type="number"
  424. :placeholder="$t('Chart.up_limit')"
  425. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  426. v-model="tableData[rightTwoIndex].MaxData"
  427. />
  428. <el-input
  429. class="min-data-input"
  430. size="mini"
  431. type="number"
  432. :placeholder="$t('Chart.low_limit')"
  433. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  434. v-model="tableData[rightTwoIndex].MinData"
  435. />
  436. </div> -->
  437. <template v-if="![7,10,11].includes(chartInfo.ChartType)">
  438. <div class="range-cont left" v-if="leftIndex != -1">
  439. <el-input
  440. style="width: 60px; display: block"
  441. size="mini"
  442. type="number"
  443. placeholder="上限"
  444. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  445. v-model="chartLimit.max"
  446. @change="changeLimit"
  447. />
  448. <el-input
  449. class="min-data-input"
  450. size="mini"
  451. type="number"
  452. placeholder="下限"
  453. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  454. v-model="chartLimit.min"
  455. @change="changeLimit"
  456. />
  457. </div>
  458. <div
  459. class="range-cont right"
  460. v-if="rightIndex != -1"
  461. >
  462. <el-input
  463. style="width: 60px; display: block"
  464. size="mini"
  465. type="number"
  466. placeholder="上限"
  467. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  468. v-model="chartLimit.rightMax"
  469. @change="changeLimit"
  470. />
  471. <el-input
  472. class="min-data-input"
  473. size="mini"
  474. type="number"
  475. placeholder="下限"
  476. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  477. v-model="chartLimit.rightMin"
  478. @change="changeLimit"
  479. />
  480. </div>
  481. <div class="range-cont rightTwo" v-if="rightTwoIndex != -1">
  482. <el-input
  483. style="width: 60px; display: block"
  484. size="mini"
  485. type="number"
  486. placeholder="上限"
  487. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  488. v-model="chartLimit.rightTwoMax"
  489. @change="changeLimit"
  490. />
  491. <el-input
  492. class="min-data-input"
  493. size="mini"
  494. type="number"
  495. placeholder="下限"
  496. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  497. v-model="chartLimit.rightTwoMin"
  498. @change="changeLimit"
  499. />
  500. </div>
  501. </template>
  502. <!-- 后续新图专用上下限 和其他数据依赖不公用 柱形图 截面散点-->
  503. <template v-if="[7,10,11].includes(chartInfo.ChartType)">
  504. <div class="range-cont left">
  505. <el-input
  506. style="width: 60px; display: block"
  507. size="mini"
  508. type="number"
  509. :placeholder="$t('Chart.up_limit')"
  510. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  511. v-model="chartLimit.max"
  512. @change="changeLimit"
  513. />
  514. <el-input
  515. class="min-data-input"
  516. size="mini"
  517. type="number"
  518. :placeholder="$t('Chart.low_limit')"
  519. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  520. v-model="chartLimit.min"
  521. @change="changeLimit"
  522. />
  523. </div>
  524. <!-- x轴上下限 -->
  525. <div class="range-cont bottom" v-if="chartLimit.x_min||chartLimit.x_max">
  526. <el-input
  527. class="left"
  528. size="mini"
  529. type="number"
  530. :placeholder="$t('Chart.low_limit')"
  531. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  532. v-model="chartLimit.x_min"
  533. @change="changeLimit"
  534. />
  535. <el-input
  536. class="left"
  537. size="mini"
  538. type="number"
  539. :placeholder="$t('Chart.up_limit')"
  540. :disabled="!permissionBtn.isShowBtn('chartLibPermission','chartLib_editLimit')"
  541. v-model="chartLimit.x_max"
  542. @change="changeLimit"
  543. />
  544. </div>
  545. </template>
  546. </div>
  547. <span class="chart-author"
  548. ><!-- 作者 -->{{$t('Chart.Detail.author')}}:{{ chartInfo.SysUserRealName || '' }}</span
  549. >
  550. <div class="chart-bottom-insruction-info">
  551. <div class="chart-source" >
  552. <span
  553. v-if="chartInfo.SourcesFrom&&JSON.parse(chartInfo.SourcesFrom).isShow"
  554. :style="`
  555. color: ${JSON.parse(chartInfo.SourcesFrom).color};
  556. fontSize: ${ JSON.parse(chartInfo.SourcesFrom).fontSize }px;
  557. `"
  558. ><!-- 来源 -->{{$t('Chart.Detail.source')}}:{{ JSON.parse(chartInfo.SourcesFrom).text}}</span>
  559. </div>
  560. <!-- 公历农历切换 只用于季节性图 -->
  561. <el-radio-group
  562. v-model="calendar_type"
  563. class="calendar-cont"
  564. v-if="chartInfo.ChartType === 2"
  565. @change="getPreviewChartInfo"
  566. >
  567. <el-radio-button label="公历">{{$t('Chart.calendar_gre')}}</el-radio-button>
  568. <el-radio-button label="农历">{{$t('Chart.calendar_lunar')}}</el-radio-button>
  569. </el-radio-group>
  570. <!-- 图表说明 -->
  571. <div
  572. class="chart-instruction"
  573. v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow"
  574. v-text="JSON.parse(chartInfo.Instructions).text"
  575. :style="`
  576. color: ${JSON.parse(chartInfo.Instructions).color};
  577. fontSize: ${ JSON.parse(chartInfo.Instructions).fontSize }px
  578. `"
  579. ></div>
  580. </div>
  581. </div>
  582. <!-- 异常显示 -->
  583. <p class="error-tip" style="min-height: 400px;" v-if="chartInfo.WarnMsg">{{chartInfo.WarnMsg}}</p>
  584. </el-col>
  585. <el-col :span="3" style="position: absolute;height: 100%;right: 0;min-width: 115px;">
  586. <ul class="right-actions">
  587. <li><!-- 操作 -->{{$t('Table.column_operations')}}</li>
  588. <li
  589. v-permission="permissionBtn.chartLibPermission.chartLib_share"
  590. class="span-item shareLink"
  591. @click="copyChartConfirm('url')"
  592. :data-clipboard-text="linkUrl"
  593. v-if="!chartInfo.Disabled"
  594. >
  595. <i class="el-icon-share"/>&nbsp;<!-- 分享 -->
  596. {{$t('Chart.chart_share_btn')}}
  597. </li>
  598. <li
  599. v-permission="permissionBtn.chartLibPermission.chartLib_addMy"
  600. class="span-item"
  601. @click="addMychartHandle(chartInfo)"
  602. >
  603. <img
  604. :src="$icons.chart_join_ico"
  605. alt=""
  606. style="width: 13px; height: 12px; vertical-align: middle"
  607. /><!-- 加入我的图库 -->{{$t('Chart.chart_addmy_btn')}}
  608. </li>
  609. <li
  610. v-permission="permissionBtn.chartLibPermission.chartLib_refresh"
  611. class="span-item"
  612. @click="refreshHandle"
  613. >
  614. <span>
  615. <i class="el-icon-refresh" style="margin-left:0"/>&nbsp;<!-- 刷新 -->{{$t('Edb.detail_refresh_btn')}}
  616. </span>
  617. </li>
  618. <li
  619. v-permission="permissionBtn.chartLibPermission.chartLib_save"
  620. class="span-item"
  621. >
  622. <span @click="saveChartHandle('')">
  623. <i class="el-icon-collection" />&nbsp;<!-- 保存 -->{{$t('Chart.chart_save_btn')}}
  624. </span>
  625. </li>
  626. <li
  627. v-permission="permissionBtn.chartLibPermission.chartLib_otherSave"
  628. class="span-item"
  629. >
  630. <span @click="saveChartOtherHandle">
  631. <i class="el-icon-document-add" />&nbsp;<!-- 另存为 -->{{$t('Chart.chart_copy_btn')}}
  632. </span>
  633. </li>
  634. <li
  635. v-permission="permissionBtn.chartLibPermission.chartLib_edit"
  636. class="span-item"
  637. v-if="chartInfo.IsEdit"
  638. @click="editChartHandle"
  639. >
  640. <img
  641. src="~@/assets/img/set_m/edit.png"
  642. alt=""
  643. style="width: 13px; height: 12px;"
  644. />&nbsp;<!-- 编辑 -->{{$t('Chart.chart_edit_btn')}}
  645. </li>
  646. <li
  647. v-permission="permissionBtn.chartLibPermission.chartLib_copyOffice"
  648. class="span-item copy"
  649. @click="copyChartConfirm('office')"
  650. v-if="!chartInfo.Disabled"
  651. >
  652. <i class="el-icon-document-copy" />&nbsp;<!-- 复制至office -->{{$t('Chart.chart_copyoffice')}}
  653. </li>
  654. <li
  655. v-permission="permissionBtn.chartLibPermission.chartLib_copyWechat"
  656. class="span-item copy"
  657. @click="copyChartConfirm('微信')"
  658. v-if="!chartInfo.Disabled"
  659. >
  660. <img style="width: 13px; height: 12px;vertical-align: middle" src="~@/assets/img/chart_m/WeChat.jpg" />&nbsp;<!-- 复制至微信 -->{{$t('Chart.chart_copywx')}}
  661. </li>
  662. <li
  663. v-permission="permissionBtn.chartLibPermission.chartLib_enNameSetting"
  664. class="span-item copy"
  665. @click="openEnNameDia"
  666. >
  667. <img style="width: 16px;vertical-align: middle" :src="$icons.to_en" />&nbsp;<!-- 设置英文名称 -->{{$t('Edb.detail_en_btn')}}
  668. </li>
  669. <li
  670. v-permission="permissionBtn.chartLibPermission.chartLib_del"
  671. class="span-item"
  672. style="color: #ff4040"
  673. @click="delChartHandle"
  674. v-if="chartInfo.IsEdit"
  675. >
  676. <i class="el-icon-delete" style="color: #ff4040" />&nbsp;<!-- 删除 -->{{$t('Chart.chart_del_btn')}}
  677. </li>
  678. </ul>
  679. </el-col>
  680. </el-row>
  681. <el-table
  682. :data="tableData"
  683. ref="tableRef"
  684. highlight-current-row
  685. border
  686. >
  687. <el-table-column
  688. v-for="item in tableColums"
  689. :key="item.label"
  690. :label="item.label"
  691. :width="item.widthsty"
  692. :min-width="item.minwidthsty"
  693. align="center"
  694. >
  695. <template slot-scope="scope">
  696. <span v-if="item.key==='SourceName'">
  697. {{scope.row[item.key]}}
  698. <i
  699. class="el-icon-tickets"
  700. style="color:#409EFF;font-size:18px"
  701. @click="toHistoryPage(scope.row.EdbInfoId,$route.matched)"
  702. v-if="scope.row.EdbType===2"
  703. />
  704. </span>
  705. <span v-else>{{ currentLang==='en' ? (scope.row[item.enKey]||scope.row[item.key]) : scope.row[item.key] }}</span>
  706. </template>
  707. </el-table-column>
  708. <el-table-column
  709. :label="$t('Table.column_operations')"
  710. key="Copy"
  711. align="center"
  712. width="110"
  713. >
  714. <template slot-scope="scope">
  715. <span
  716. v-permission="permissionBtn.chartLibPermission.chartLib_copyData"
  717. class="editsty" @click="copyCode(scope.row)"
  718. >
  719. <i class="el-icon-document-copy" />&nbsp;<!-- 复制数据 -->{{$t('Edb.detail_copydata_btn')}}
  720. </span>
  721. <span
  722. v-permission="permissionBtn.chartLibPermission.chartLib_viewData"
  723. class="editsty"
  724. @click="viewTarget(scope.row)"
  725. >
  726. <!-- 查看数据 -->{{$t('Edb.detail_lookdata_btn')}}
  727. </span>
  728. </template>
  729. </el-table-column>
  730. <div slot="empty">
  731. <tableNoData :text="$t('Table.no_edb_msg')" size="mini"/>
  732. </div>
  733. </el-table>
  734. </div>
  735. </div>
  736. <!-- ==============图表列表展示============= -->
  737. <div class="chart-public-cont" v-else>
  738. <span>{{$t('Chart.total_chart_show',{limit:public_total})}}</span>
  739. <div
  740. class="chart-public-list"
  741. ref="listChartPage"
  742. @scroll="loadMorePublicChart"
  743. >
  744. <div class="chart-list-item-wrap">
  745. <div class="chart-list-item" v-for="chart in chartPublicList" :key="chart.ChartInfoId">
  746. <div class="chart-item-top" style="position:relative;">
  747. <div class="chartEn-mark" v-show="chart.IsEnChart">En</div>
  748. <span class="text_oneLine" :style="{'padding-left':chart.IsEnChart?'24px':''}">{{ currentLang === 'en' ? (chart.ChartNameEn||chart.ChartName) : chart.ChartName }}</span>
  749. </div>
  750. <div class="chart-item-img" @click="detailShowHandle(chart)"
  751. :style="chart.ChartImage?{background: `no-repeat top/cover url('${chart.ChartImage}')`}:{}"></div>
  752. <div class="chart-item-bottom">
  753. <span><!-- 创建时间 -->{{$t('Chart.list_chart_time')}}: {{ chart.CreateTime.slice(0,10) }}</span>
  754. <span v-permission="permissionBtn.chartLibPermission.chartLib_addMy"
  755. class="join_txt"
  756. @click="addMychartHandle(chart)"
  757. >
  758. <img
  759. :src="$icons.chart_join_ico"
  760. alt=""
  761. style="width: 13px; height: 12px; vertical-align: middle"
  762. />
  763. <!-- 加入我的图库 -->{{$t('Chart.chart_addmy_btn')}}
  764. </span>
  765. </div>
  766. </div>
  767. </div>
  768. </div>
  769. <div v-if="!public_total" class="nodata">
  770. <tableNoData :text="$t('Common.no_chart_msg')"/>
  771. </div>
  772. </div>
  773. </div>
  774. <img :src="drawImg" alt="" class="drawImg" />
  775. </div>
  776. </div>
  777. <!-- 目录弹窗 -->
  778. <chartDialog
  779. :isOpenDialog="isOpenDialog"
  780. :title="dialog_title"
  781. :formData="dialogForm"
  782. @closeDia="isOpenDialog = false"
  783. @sucessCallback="sucessCallback"
  784. />
  785. <!-- 日期端选择弹窗 -->
  786. <DateChooseDia
  787. :isDateDia="isDateDia"
  788. :dateForm="dateForm"
  789. :earliestDate="earliestDate"
  790. @cancel="isDateDia = false"
  791. @dateBack="dataChangeBack"
  792. />
  793. <!-- 加入我的图库弹窗 -->
  794. <addMyClassifyDia
  795. :isAddMyDialog="isAddMyChart"
  796. :add_id="add_chart_id"
  797. :add_ids="add_ids"
  798. @cancel="isAddMyChart = false"
  799. @addSuccess="addMySuccess"
  800. />
  801. <!-- 图表另存 -->
  802. <SaveChartOther
  803. :show.sync="isShowSaveOther"
  804. fromType="chartsetting"
  805. :data="chartInfo"
  806. @ensure="getTreeData"
  807. />
  808. <!-- 输入英文指标弹窗 -->
  809. <set-en-name-dia
  810. :isOpenDialog="setEnName"
  811. @cancel="setEnName=false"
  812. @updateEnName="updateEnName"
  813. :formData="formItemArray"
  814. :chartType="chartInfo.ChartType"
  815. :datainfo="chartInfo.ChartType===10?JSON.parse(chartInfo.ExtraConfig):null"
  816. :edblist="chartInfo.ChartType===10?tableData:[]"
  817. />
  818. <!-- 指标历史记录 -->
  819. <!-- <edbHistoryDialog
  820. :isOpenDialog.sync="isLookHistory"
  821. :edbId="lookEdbId"
  822. /> -->
  823. </div>
  824. </template>
  825. <script>
  826. import html2canvas from 'html2canvas';
  827. import { dataBaseInterface, mychartInterface } from '@/api/api.js';
  828. import {
  829. copyOtherOptions
  830. } from '@/utils/defaultOptions';
  831. import { chartSetMixin } from './mixins/chartPublic'
  832. import mPage from '@/components/mPage';
  833. import Chart from './components/chart';
  834. import chartDialog from './components/chartDialog';
  835. import DateChooseDia from './components/DateChooseDia';
  836. import addMyClassifyDia from './components/addMyClassifyDia';
  837. import SaveChartOther from './components/SaveChartOther';
  838. import changeLang from "./components/changeLang.vue"
  839. import setEnNameDia from "./components/setEnNameDia.vue"
  840. import EdbLabelList from '../../components/edbLabelList.vue';
  841. export default {
  842. name: '',
  843. components: {
  844. mPage,
  845. chartDialog,
  846. Chart,
  847. DateChooseDia,
  848. addMyClassifyDia,
  849. SaveChartOther,
  850. changeLang,
  851. setEnNameDia,
  852. EdbLabelList
  853. },
  854. directives: {
  855. drag(el, bindings) {
  856. el.onmousedown = function (e) {
  857. var init = e.clientX;
  858. // console.log(init);
  859. var box = $('#box')[0];
  860. // console.log(box.clientWidth)
  861. let total_wid = box.offsetWidth;
  862. var left = $('#left')[0];
  863. var right = $('#right')[0];
  864. var initWidth = left.offsetWidth;
  865. document.onmousemove = function (e) {
  866. var end = e.clientX;
  867. var newWidth = end - init + initWidth;
  868. left.style.width = newWidth + 'px';
  869. right.style.width = newWidth > 300 ? total_wid - newWidth + 'px' : total_wid - 320 + 'px';
  870. };
  871. document.onmouseup = function () {
  872. document.onmousemove = document.onmouseup = null;
  873. e.releaseCapture && e.releaseCapture();
  874. };
  875. e.setCapture && e.setCapture();
  876. return false;
  877. };
  878. },
  879. },
  880. mixins: [chartSetMixin],
  881. data() {
  882. return {
  883. showData: false,
  884. treeData: [], //树数据
  885. defaultShowNodes: [], //展开节点
  886. defaultProp: {
  887. label: 'ChartClassifyName',
  888. children: 'Children',
  889. isLeaf:'isLeaf'
  890. }, //树结构配置项
  891. loading: null,
  892. selected_chartid: '', //当前选中的图表id
  893. selected_chartClassify: '', //当前选中的图表所属分类
  894. new_label: '', //新的节点label值
  895. select_node: '', //当前选中的节点
  896. /* 右侧 */
  897. chartInfo: {}, //图表信息
  898. search_txt: '', //搜索词
  899. searchOptions: [], //搜索到的图表列表
  900. expandKey: [], //展开数组
  901. /* 新增编辑目录弹窗 */
  902. isOpenDialog: false,
  903. dialog_title: '',
  904. dialogForm: {
  905. level: '',
  906. },
  907. drawImg: '',
  908. dynamicWidth: '',
  909. /* 季节性图 */
  910. season_year: '', //显示的年份
  911. selected_chartType: '', //选择的图表类型 获取图表信息时用
  912. calendar_type: '公历',
  913. isSlideLeft: false,
  914. dynamicNode: null, //当前选中的node对象 用于拖动宽度时动态改变label宽度
  915. /* 公共图库列表展示 */
  916. isShowPublicChart: false,
  917. publicHaveMove: true, // 是否还有下一页
  918. default_classify: '',
  919. public_page_no: 1,
  920. public_page_size: 12,
  921. public_total: 0,
  922. chartPublicList: [],
  923. isAddMyChart: false, //加入图库弹窗
  924. add_chart_id: 0, //要加入的图表
  925. /* 左侧更改目录和坐标轴切换 */
  926. leftShowLabel: '目录',
  927. add_ids:[],//加入时已有的分类
  928. // 只看我的?
  929. isOnlyMe:false,
  930. search_page: 1,
  931. search_have_more: false,
  932. current_search:'',
  933. /* 查看历史弹窗 */
  934. isLookHistory: false,
  935. lookEdbId: 0,
  936. labelList:[],//标签列表
  937. CanOpClassify: false,//添加分类按钮控制
  938. };
  939. },
  940. watch: {
  941. /* 设置动态右侧区域宽度 */
  942. isSlideLeft(newval) {
  943. if (!newval) {
  944. this.$nextTick(() => {
  945. this.reloadRightWid();
  946. });
  947. }
  948. },
  949. // 公用图库关联分类
  950. default_classify(newval) {
  951. //重置滚动高度 防止触底加载
  952. if(this.$refs.listChartPage) this.$refs.listChartPage.scrollTop = 0;
  953. if (newval) {
  954. this.public_page_no = 1;
  955. this.getPublicChartList();
  956. }
  957. },
  958. selected_chartid(newval) {
  959. if (!newval) {
  960. this.year_select = this.yearSelector[0].value;
  961. this.calendar_type = '公历';
  962. this.season_year = '';
  963. this.tableData = [];
  964. this.chartInfo = {};
  965. } else {
  966. sessionStorage.removeItem('beforeOptions');
  967. newval && this.getChartDetail();
  968. this.formItemArray=[]
  969. }
  970. },
  971. /* 选中搜索图表 展开目录 选中图表 展示图表 */
  972. search_txt(newval) {
  973. if (newval) {
  974. let [search_obj] = this.searchOptions.filter(
  975. (item) => item.ChartInfoId === newval
  976. );
  977. this.select_node = search_obj.UniqueCode;
  978. this.selected_chartClassify = search_obj.ChartClassifyId; //图表所属分类
  979. this.year_select = search_obj.DateType; //年份选择
  980. this.calendar_type = search_obj.Calendar || '公历'; //公历/农历
  981. this.season_year = [
  982. search_obj.SeasonStartDate,
  983. search_obj.SeasonEndDate,
  984. ]; //季节年份区间
  985. this.select_date = [search_obj.StartDate, search_obj.EndDate];
  986. this.selected_chartType = search_obj.ChartType; //图表类型
  987. this.selected_chartid = newval;
  988. }
  989. },
  990. tableData: {
  991. handler(newval, oldval) {
  992. newval.length && !this.chartInfo.WarnMsg && this.setChartOptionHandle(newval);
  993. },
  994. deep: true,
  995. },
  996. },
  997. computed: {
  998. role() {
  999. let role = localStorage.getItem('Role') || '';
  1000. if (['rai_researcher', 'ficc_researcher', 'researcher','ficc_seller','rai_seller','seller'].includes(role)) {
  1001. return 'researcher';
  1002. } else if (['rai_admin', 'ficc_admin'].includes(role)) {
  1003. return 'admin';
  1004. } else {
  1005. return role;
  1006. }
  1007. },
  1008. /* 登录角色id */
  1009. roleId() {
  1010. let id = parseInt(localStorage.getItem('AdminId'));
  1011. return id;
  1012. },
  1013. //登录角色姓名
  1014. roleName() {
  1015. let name = localStorage.getItem('userName') || '';
  1016. return name;
  1017. },
  1018. //禁用条件
  1019. isDisabled() {
  1020. if (
  1021. this.selected_chartid &&
  1022. this.role !== 'admin' &&
  1023. this.chartInfo.SysUserId !== this.roleId
  1024. ) {
  1025. return true;
  1026. } else {
  1027. return false;
  1028. }
  1029. },
  1030. /* 分享地址 */
  1031. linkUrl() {
  1032. const LINK_CHART_URL = this.$setting.dynamicOutLinks.ChartViewUrl+'/chartshow';
  1033. return `${LINK_CHART_URL}?code=${this.chartInfo.UniqueCode}&fromType=share&lang=${this.currentLang}`
  1034. },
  1035. leftTabs() {
  1036. return [
  1037. {label: this.$t('EtaChartPage.tab_classify'),val:'目录'},
  1038. {label: this.$t('EtaChartPage.tab_series'),val:'坐标轴'}
  1039. ]
  1040. }
  1041. },
  1042. methods: {
  1043. getTreeData(params) {
  1044. // dataBaseInterface.chartTree({IsShowMe:this.isOnlyMe}).then((res) => {
  1045. dataBaseInterface.chartClassify({IsShowMe:this.isOnlyMe}).then((res) => {
  1046. if (res.Ret === 200) {
  1047. this.showData = true;
  1048. this.currentLang = res.Data.Language === 'EN' ? 'en' : 'ch';
  1049. this.setLangIntoStore();
  1050. const arr=res.Data.AllNodes || [];
  1051. this.treeData = arr.map(item=>{
  1052. return {
  1053. ...item,
  1054. isLeaf:item.Children.length?false:true
  1055. }
  1056. })
  1057. this.CanOpClassify = res.Data.CanOpClassify;
  1058. this.$nextTick(() => {
  1059. /* 新增完成后 处理树展开和选中图表 */
  1060. params && this.selectCurrentNode(params);
  1061. });
  1062. }
  1063. });
  1064. },
  1065. /* 节点变化时 */
  1066. nodeChange(data, node) {
  1067. this.search_txt = '';
  1068. this.dynamicNode = node;
  1069. sessionStorage.removeItem('beforeOptions');
  1070. //详情时判断是否是本人添加图表 若不是不用做保存校验 新增时要进入保存校验逻辑
  1071. if (
  1072. (this.selected_chartid &&
  1073. (this.role === 'admin' ||
  1074. this.chartInfo.SysUserId === this.roleId)) ||
  1075. !this.chartInfo.SysUserId
  1076. ) {
  1077. let arr = sessionStorage.getItem('defaultArr');
  1078. if (
  1079. arr &&
  1080. this.selected_chartid &&
  1081. arr !== JSON.stringify(this.tableData)
  1082. ) {
  1083. this.$confirm('您还未保存此图表,是否确认保存?', '提示', {
  1084. confirmButtonText: '确定',
  1085. cancelButtonText: '取消',
  1086. type: 'warning',
  1087. showClose: false,
  1088. closeOnClickModal: false,
  1089. })
  1090. .then(() => {
  1091. this.saveChartHandle('');
  1092. })
  1093. .catch(() => {
  1094. this.select_node = data.UniqueCode;
  1095. this.selected_chartid = data.ChartInfoId;
  1096. this.selected_chartType = data.ChartType;
  1097. this.selected_chartClassify = data.ChartInfoId
  1098. ? data.ChartClassifyId
  1099. : '';
  1100. this.calendar_type = data.ChartInfoId ? data.Calendar : '公历'; //公历/农历
  1101. this.season_year = data.ChartInfoId
  1102. ? [data.SeasonStartDate, data.SeasonEndDate]
  1103. : ''; //季节年份区间
  1104. this.year_select = data.ChartInfoId ? data.DateType : this.yearSelector[0].value; //图表年份选择
  1105. this.select_date =
  1106. this.year_select === 5 || this.year_select === 6
  1107. ? [data.StartDate, data.EndDate]
  1108. : '';
  1109. this.resetNodeStyle(node);
  1110. this.tableData =
  1111. !this.selected_chartClassify && this.tableData.length
  1112. ? []
  1113. : this.tableData;
  1114. });
  1115. return;
  1116. }
  1117. }
  1118. this.select_node = data.UniqueCode;
  1119. this.selected_chartid = data.ChartInfoId;
  1120. this.selected_chartType = data.ChartType;
  1121. this.selected_chartClassify = data.ChartInfoId
  1122. ? data.ChartClassifyId
  1123. : '';
  1124. this.calendar_type = data.ChartInfoId ? data.Calendar : '公历'; //公历/农历
  1125. this.season_year = data.ChartInfoId
  1126. ? [data.SeasonStartDate, data.SeasonEndDate]
  1127. : ''; //季节年份区间
  1128. this.year_select = data.ChartInfoId ? data.DateType : this.yearSelector[0].value; //图表年份选择
  1129. this.select_date =
  1130. this.year_select === 5 || this.year_select === 6
  1131. ? [data.StartDate, data.EndDate]
  1132. : '';
  1133. this.resetNodeStyle(node);
  1134. this.tableData =
  1135. !this.selected_chartClassify && this.tableData.length
  1136. ? []
  1137. : this.tableData;
  1138. //公用图库关联分类
  1139. this.default_classify = !data.ChartInfoId ? data.ChartClassifyId : '';
  1140. },
  1141. resetNodeStyle: _.debounce(function (node) {
  1142. const tree = $('.target_tree')[0];
  1143. let width = tree.offsetWidth;
  1144. let label_wid = width > 500 ? 'auto' : width <= 250 ? 80 : 0.4 * width;
  1145. this.$set(node, 'Nodewidth', label_wid + 'px');
  1146. }, 300),
  1147. /* 双击label出现input修改框 */
  1148. editNodeLabel(node, data) {
  1149. //目录名称可以双击修改 指标不能
  1150. if (!data.ChartInfoId && data.Button.OpButton&&this.permissionBtn.isShowBtn('chartLibPermission','chartLib_classifyOpt_add')) {
  1151. this.$set(data, 'isEdit', true);
  1152. this.new_label = data.ChartClassifyName;
  1153. this.$nextTick(() => {
  1154. this.$refs.editVal.focus();
  1155. });
  1156. }
  1157. },
  1158. /* input失去焦点恢复node 修改最新的值*/
  1159. changeValue(node, data) {
  1160. if (this.new_label) {
  1161. this.$set(data, 'isEdit', false);
  1162. this.new_label !== data.ChartClassifyName &&
  1163. dataBaseInterface
  1164. .editChartClassify({
  1165. ChartClassifyId: data.ChartClassifyId,
  1166. ChartClassifyName: this.new_label,
  1167. })
  1168. .then((res) => {
  1169. if (res.Ret === 200) {
  1170. this.getTreeData();
  1171. }
  1172. });
  1173. } else {
  1174. this.$message.warning('名称不能为空');
  1175. }
  1176. },
  1177. // 只看我的 复选框改变事件
  1178. onlyMeHandler(){
  1179. this.getTreeData();
  1180. this.getPublicChartList()
  1181. },
  1182. /* 添加一级目录 */
  1183. addLevelOneHandle() {
  1184. this.dialog_title = '添加';
  1185. this.dialogForm = {
  1186. level_1: '',
  1187. parent_id: '',
  1188. level: 0,
  1189. };
  1190. this.isOpenDialog = true;
  1191. },
  1192. /* 添加节点 */
  1193. addNode(node, data) {
  1194. this.dialog_title = '添加';
  1195. /* 添加目录 */
  1196. this.dialogForm = {
  1197. level_1:
  1198. node.level === 1
  1199. ? data.ChartClassifyName
  1200. : node.level === 2
  1201. ? node.parent.data.ChartClassifyName
  1202. : node.parent.parent.data.ChartClassifyName,
  1203. level_2:
  1204. node.level === 1
  1205. ? ''
  1206. : node.level === 2
  1207. ? data.ChartClassifyName
  1208. : node.parent.data.ChartClassifyName,
  1209. // level_3: node.level === 3 ? data.ChartClassifyName : '',
  1210. parent_id: data.ChartClassifyId,
  1211. level: node.level,
  1212. };
  1213. this.isOpenDialog = true;
  1214. //存储当前要新增子级的目录code
  1215. sessionStorage.setItem('expandCode', data.UniqueCode);
  1216. },
  1217. /* 编辑节点 */
  1218. editNode(node, data) {
  1219. this.dialog_title = '编辑';
  1220. /* 编辑目录 */
  1221. this.dialogForm = {
  1222. level_1:
  1223. node.level === 1
  1224. ? data.ChartClassifyName
  1225. : node.level === 2
  1226. ? node.parent.data.ChartClassifyName
  1227. : node.parent.parent.data.ChartClassifyName,
  1228. level_2:
  1229. node.level === 1
  1230. ? ''
  1231. : node.level === 2
  1232. ? data.ChartClassifyName
  1233. : node.parent.data.ChartClassifyName,
  1234. level_3: node.level === 3 ? data.ChartClassifyName : '',
  1235. classify_id: data.ChartClassifyId,
  1236. level: node.level,
  1237. };
  1238. this.isOpenDialog = true;
  1239. },
  1240. /* 删除节点校验 */
  1241. removeNode(node, data) {
  1242. dataBaseInterface
  1243. .delChartCheck({
  1244. ChartClassifyId: data.ChartClassifyId,
  1245. ChartInfoId: data.ChartInfoId,
  1246. })
  1247. .then((res) => {
  1248. if (res.Ret === 200) {
  1249. /**
  1250. * 0 可删除
  1251. * 1 关联图表一
  1252. * 2 有子目录无图表
  1253. */
  1254. const deleteLabelMap = {
  1255. 1: /* '该分类下关联图表不可删除' */this.$t('Chart.OptMsg.classify_del_fail'),
  1256. 2: /* '确认删除当前分类及包含的子分类吗?' */this.$t('Chart.OptMsg.classify_delall_confirm'),
  1257. 4: res.Data.TipsMsg
  1258. }
  1259. if([1,4].includes(res.Data.DeleteStatus)) this.$confirm(
  1260. deleteLabelMap[res.Data.DeleteStatus],
  1261. /* '删除失败' */this.$t('Chart.OptMsg.del_fail_tag'),
  1262. {
  1263. confirmButtonText: /* '知道了' */this.$t('Dialog.known'),
  1264. showCancelButton:false,
  1265. type: 'error'
  1266. })
  1267. else if([0,2].includes(res.Data.DeleteStatus)) this.$confirm(
  1268. res.Data.DeleteStatus === 2
  1269. ? deleteLabelMap[res.Data.DeleteStatus]
  1270. : data.ChartInfoId?this.$t('Chart.OptMsg.chart_del_confirm'):this.$t('Chart.OptMsg.classify_del_confirm'),
  1271. this.$t('Dialog.warn_tit'),
  1272. {
  1273. confirmButtonText: /* '确定' */this.$t('Dialog.confirm_btn'),
  1274. cancelButtonText: /* '取消' */this.$t('Dialog.cancel_btn'),
  1275. type: 'warning'
  1276. }).then(() => {
  1277. res.Data.DeleteStatus === 0 && data.ChartInfoId
  1278. ? this.delHandle(data.ChartClassifyId, data.ChartInfoId, 1)
  1279. : this.delHandle(data.ChartClassifyId, data.ChartInfoId);
  1280. }).catch(() => {
  1281. });
  1282. }
  1283. });
  1284. },
  1285. /* 删除方法 */
  1286. delHandle(ChartClassifyId, ChartInfoId, type) {
  1287. dataBaseInterface
  1288. .delChartClassify({
  1289. ChartClassifyId,
  1290. ChartInfoId,
  1291. })
  1292. .then((res) => {
  1293. if (res.Ret === 200) {
  1294. this.$message.success(res.Msg);
  1295. const label = this.labelList.find(i=>i.id===ChartInfoId)
  1296. if (!res.Data.ChartInfoId) this.selected_chartid = '';
  1297. if(type && res.Data.ChartInfoId){
  1298. this.getTreeData({
  1299. code: res.Data.UniqueCode,
  1300. id: res.Data.ChartInfoId,
  1301. type: res.Data.ChartType,
  1302. })
  1303. label&&this.deleteLabel(label,'chart')
  1304. }else{
  1305. this.getTreeData();
  1306. label&&this.deleteLabel(label)
  1307. }
  1308. //如果router.query里的图表被删除,则清掉参数
  1309. if(Number(this.$route.query.id)===ChartInfoId){
  1310. this.$router.replace({path: '/chartsetting'})
  1311. }
  1312. }
  1313. });
  1314. },
  1315. /* 新增/编辑分类成功 */
  1316. sucessCallback(type) {
  1317. this.isOpenDialog = false;
  1318. this.getTreeData();
  1319. if (type === 'add') {
  1320. //新增分类完成之后,展开父节点显示刚新增的分类,若已展开节点则不做处理
  1321. let code = sessionStorage.getItem('expandCode');
  1322. let flag = this.defaultShowNodes.some((item) => {
  1323. return item === code;
  1324. });
  1325. // console.log(flag)
  1326. !flag && code && this.defaultShowNodes.push(code);
  1327. sessionStorage.removeItem('expandCode');
  1328. }
  1329. },
  1330. /* 判断节点是否能被拖拽 */
  1331. canDragHandle(node) {
  1332. let canMove = false;
  1333. if (node.data.Button.MoveButton) {
  1334. canMove = true;
  1335. }
  1336. return canMove;
  1337. },
  1338. /* 判断节点是否能被拖入 4*/
  1339. canDropHandle(draggingNode, dropNode, type) {
  1340. let canDrop = false;
  1341. // 移动的是一级目录
  1342. if(draggingNode.level===1&&dropNode.level===1&&type!=='inner') {
  1343. canDrop=true
  1344. }
  1345. // 二级目录
  1346. if(draggingNode.level===2){
  1347. if((dropNode.level===1&&type==='inner')||(dropNode.level===2&&type!=='inner')){
  1348. canDrop=true
  1349. }
  1350. }
  1351. //三级目录
  1352. if(draggingNode.level===3){
  1353. if((dropNode.level===2&&type==='inner')||(dropNode.level===3&&type!=='inner')){
  1354. canDrop=true
  1355. }
  1356. }
  1357. //四级指标层
  1358. if(draggingNode.level===4){
  1359. if((dropNode.level===3&&type==='inner')||(dropNode.level===4&&type!=='inner')){
  1360. canDrop=true
  1361. }
  1362. }
  1363. return canDrop;
  1364. },
  1365. /* 拖拽完成 */
  1366. dropOverHandle(b, a, i, e) {
  1367. // console.log(i, a);
  1368. // 被拖拽节点对应的 Node、结束拖拽时最后进入的节点、被拖拽节点的放置位置
  1369. // 一/二级目录
  1370. if (b.level === 1 || b.level === 2||b.level===3) {
  1371. this.handleMoveCatalogue(b, a, i, e)
  1372. }
  1373. // 指标层
  1374. if (b.level === 4) {
  1375. this.handleMoveChart(b, a, i, e)
  1376. }
  1377. },
  1378. // 移动的为一、二、三级目录
  1379. handleMoveCatalogue(b,a,i,e){
  1380. let list=a.parent.childNodes,targetIndex=0,PrevClassifyId=0,NextClassifyId=0,ParentClassifyId=0;
  1381. list.forEach((item,index)=>{
  1382. if(item.data.ChartClassifyId===b.data.ChartClassifyId){
  1383. targetIndex=index
  1384. return
  1385. }
  1386. })
  1387. if(targetIndex===0){
  1388. PrevClassifyId=0
  1389. // i=='inner'时,list里面只有一个Node时会数组越界,后面会对'inner'的重新处理,这里不报错就行
  1390. NextClassifyId=list[targetIndex+1] ? list[targetIndex+1].data.ChartClassifyId : 0
  1391. }else if(targetIndex===list.length-1){
  1392. PrevClassifyId=list[targetIndex-1].data.ChartClassifyId
  1393. NextClassifyId=0
  1394. }else{
  1395. PrevClassifyId=list[targetIndex-1].data.ChartClassifyId
  1396. NextClassifyId=list[targetIndex+1].data.ChartClassifyId
  1397. }
  1398. if(b.level===2){
  1399. if(i==='inner'){
  1400. ParentClassifyId=a.data.ChartClassifyId
  1401. PrevClassifyId=0
  1402. NextClassifyId=a.data.Children.length>1?a.data.Children[1].ChartClassifyId:0
  1403. }else{
  1404. ParentClassifyId=a.data.ParentId
  1405. }
  1406. }
  1407. if(b.level===3){
  1408. if(i==='inner'){
  1409. ParentClassifyId=a.data.ChartClassifyId
  1410. PrevClassifyId=0
  1411. NextClassifyId=a.data.Children.length>1?a.data.Children[1].ChartClassifyId:0
  1412. }else{
  1413. ParentClassifyId=a.data.ParentId
  1414. }
  1415. }
  1416. dataBaseInterface.chartClassifyMove({
  1417. ClassifyId: b.data.ChartClassifyId,
  1418. ParentClassifyId: ParentClassifyId,
  1419. PrevClassifyId: PrevClassifyId,
  1420. NextClassifyId:NextClassifyId
  1421. }).then((res) => {
  1422. if (res.Ret === 200) {
  1423. this.$message.success('移动成功!');
  1424. }
  1425. this.getTreeData();
  1426. });
  1427. },
  1428. // 移动的为指标层 四级
  1429. handleMoveChart(b,a,i,e){
  1430. let PrevChartInfoId=0,NextChartInfoId=0,targetIndex=0, list=a.parent.childNodes.map(_ => _.data)
  1431. if(i==='inner'){
  1432. PrevChartInfoId=0
  1433. NextChartInfoId=a.data.Children.length>1?a.data.Children[1].ChartInfoId:0
  1434. }else{
  1435. list.forEach((item,index)=>{
  1436. if(item.ChartInfoId===b.data.ChartInfoId){
  1437. targetIndex=index
  1438. return
  1439. }
  1440. })
  1441. if(targetIndex===0){
  1442. PrevChartInfoId=0
  1443. NextChartInfoId=list[targetIndex+1].ChartInfoId
  1444. }else if(targetIndex===list.length-1){
  1445. PrevChartInfoId=list[targetIndex-1].ChartInfoId
  1446. NextChartInfoId=0
  1447. }else{
  1448. PrevChartInfoId=list[targetIndex-1].ChartInfoId
  1449. NextChartInfoId=list[targetIndex+1].ChartInfoId
  1450. }
  1451. }
  1452. dataBaseInterface.chartMove({
  1453. ChartClassifyId: a.data.ChartClassifyId,
  1454. ChartInfoId: b.data.ChartInfoId,
  1455. PrevChartInfoId: PrevChartInfoId,
  1456. NextChartInfoId:NextChartInfoId
  1457. }).then((res) => {
  1458. if (res.Ret === 200) {
  1459. this.$message.success('移动成功!');
  1460. }
  1461. this.getTreeData();
  1462. });
  1463. },
  1464. /* 拖拽覆盖添加背景色 */
  1465. dropMouseOver(node1, node2, e) {
  1466. if (
  1467. ((node1.level === 2 && node2.level === 1) ||
  1468. (node1.level === 3 && node2.level === 2)) &&
  1469. (e.target.childNodes[0].className.includes('el-tree-node__content') ||
  1470. e.target.className.includes('el-tree-node__content'))
  1471. ) {
  1472. // console.log(e.target.childNodes[0])
  1473. e.target.childNodes[0].className.includes('el-tree-node__content')
  1474. ? (e.target.childNodes[0].style.backgroundColor = '#409eff')
  1475. : (e.target.style.backgroundColor = '#409eff');
  1476. }
  1477. // if (
  1478. // node2.level === 2 &&
  1479. // (e.target.childNodes[0].className.includes(
  1480. // 'el-tree-node__content'
  1481. // ) ||
  1482. // e.target.className.includes('el-tree-node__content'))
  1483. // ) {
  1484. // e.target.childNodes[0].className.includes('el-tree-node__content')
  1485. // ? (e.target.childNodes[0].style.backgroundColor = '#409eff')
  1486. // : (e.target.style.backgroundColor = '#409eff');
  1487. // }
  1488. },
  1489. /* 拖拽离开/拖拽完成重置背景色 */
  1490. dropMouseLeave(node1, node2, e) {
  1491. let arrs = $('.el-tree-node__content');
  1492. for (let a of arrs) {
  1493. a.style.backgroundColor = 'transparent';
  1494. }
  1495. },
  1496. // 树节点展开
  1497. handleNodeExpand(data) {
  1498. // 保存当前展开的节点
  1499. let flag = this.defaultShowNodes.some((item) => item === data.UniqueCode);
  1500. if (!flag) { // 不存在则存到数组里
  1501. this.defaultShowNodes.push(data.UniqueCode)
  1502. }
  1503. },
  1504. // 树节点关闭
  1505. handleNodeCollapse(data) {
  1506. this.defaultShowNodes.some((item, index) => {
  1507. if (item === data.UniqueCode) {
  1508. // 删除关闭节点
  1509. this.defaultShowNodes.length = index;
  1510. }
  1511. });
  1512. },
  1513. // 懒加载tree
  1514. handleTreeLoad(node,resolve){
  1515. if(node.level===0){
  1516. resolve(this.treeData)
  1517. }
  1518. if(node.level===1){
  1519. let arr=[]
  1520. this.treeData.forEach(item=>{
  1521. if(item.UniqueCode===node.data.UniqueCode){
  1522. arr=item.Children
  1523. }
  1524. })
  1525. resolve(arr)
  1526. }
  1527. if(node.level===2){
  1528. dataBaseInterface.getChartListForClassify({
  1529. ChartClassifyId:node.data.ChartClassifyId,
  1530. IsShowMe:this.isOnlyMe
  1531. }).then(res=>{
  1532. if(res.Ret===200){
  1533. let arr=res.Data.AllNodes||[]
  1534. arr=arr.map(item=>{
  1535. return {
  1536. ...item,
  1537. isLeaf:true
  1538. }
  1539. })
  1540. resolve(arr)
  1541. }else{
  1542. resolve([])
  1543. }
  1544. this.changeTreeNode()
  1545. })
  1546. }
  1547. if(node.level>2){
  1548. resolve([])
  1549. }
  1550. },
  1551. //绑定el-tree的load属性
  1552. getLazyTreeData (node,resolve,maxLevel=3){
  1553. if(node.level===0){
  1554. resolve(this.treeData)
  1555. }
  1556. if(node.level>0&&node.level<=maxLevel){
  1557. //获取对应层级的Child
  1558. resolve(node.data.Children||[])
  1559. }
  1560. if(node.level===maxLevel){
  1561. //调接口获取该分类下图表的数据
  1562. dataBaseInterface.getChartListForClassify({
  1563. ChartClassifyId:node.data.ChartClassifyId,
  1564. IsShowMe:this.isOnlyMe
  1565. }).then(res=>{
  1566. if(res.Ret===200){
  1567. let arr=res.Data.AllNodes||[]
  1568. arr=arr.map(item=>{
  1569. return {
  1570. ...item,
  1571. isLeaf:true
  1572. }
  1573. })
  1574. resolve(arr)
  1575. }else{
  1576. resolve([])
  1577. }
  1578. this.changeTreeNode()
  1579. })
  1580. }
  1581. if(node.level>maxLevel){
  1582. resolve([])
  1583. }
  1584. },
  1585. /* 获取图表详情 回显参数 */
  1586. async getChartDetail() {
  1587. const res = await dataBaseInterface.getChartInfoById({
  1588. ChartInfoId: this.selected_chartid
  1589. })
  1590. if(res.Ret===406){
  1591. this.$message.warning(res.Msg)
  1592. this.deleteLabel({code:this.select_node})
  1593. return
  1594. }
  1595. if (res.Ret !== 200) return;
  1596. this.chartInfo = res.Data.ChartInfo;
  1597. //处理下历史默认来源
  1598. this.setDefaultSourceFrom();
  1599. this.tableData = res.Data.EdbInfoList;
  1600. //初始化上下限
  1601. this.setLimitData(this.tableData)
  1602. // 设置起始日期和最新日期
  1603. this.setExtremumDate()
  1604. this.setDefaultDateSelect(); //设置默认的日期选中
  1605. this.setDefaultPreviewOption(); //设置默认预览配置项
  1606. sessionStorage.setItem('defaultArr',JSON.stringify(res.Data.EdbInfoList));
  1607. const chartTypeMap = {
  1608. 7: this.initBarData, //柱形图
  1609. 10: this.initSectionScatterData, //截面散点
  1610. 11: this.initRadarData //雷达图
  1611. }
  1612. chartTypeMap[this.chartInfo.ChartType] && chartTypeMap[this.chartInfo.ChartType](res.Data);
  1613. //将指标添加进标签列表中
  1614. const {ChartNameEn,ChartName,ChartInfoId,UniqueCode,ChartClassifyId}=res.Data.ChartInfo
  1615. this.addLabel({code:UniqueCode,id:ChartInfoId,classifyId:ChartClassifyId,EdbName:ChartName,EdbNameEn:ChartNameEn,chartData:res.Data.ChartInfo})
  1616. this.defaultShowNodes=this.findParentNodeHandle(this.treeData,ChartClassifyId).reverse();
  1617. this.changeTreeNode()
  1618. //滚动到高亮节点位置
  1619. this.$refs.treeRef.setCurrentKey(this.select_node);
  1620. setTimeout(() => {
  1621. let node = document.getElementById(`node${this.select_node}`);
  1622. let parent = document.getElementsByClassName('tree-cont')[0];
  1623. //parent可视区间:[scrollTop,scrollTop+offsetHeight]
  1624. //node位置:node.offsetTop
  1625. const overTop = node.offsetTop+node.clientHeight+15<parent.scrollTop
  1626. const overBottom = node.offsetTop+node.clientHeight+15>parent.scrollTop+parent.offsetHeight
  1627. console.log(overBottom)
  1628. if(overTop){
  1629. parent.scrollTop = node.offsetTop-30
  1630. }
  1631. if(overBottom){
  1632. parent.scrollTop = node.offsetTop - parent.offsetHeight/2
  1633. }
  1634. },400)
  1635. },
  1636. /* 设置默认时间选中项 */
  1637. setDefaultDateSelect() {
  1638. this.year_select = this.chartInfo.DateType;
  1639. this.select_date = [this.chartInfo.StartDate, this.chartInfo.EndDate];
  1640. this.count_year = this.chartInfo.StartYear;
  1641. this.calendar_type = this.chartInfo.Calendar; //日历类型
  1642. if(this.chartInfo.ChartType==2){
  1643. if(this.year_select==20){
  1644. let latestYear = parseInt(this.tableData[0].LatestDate.substring(0,4))
  1645. this.season_year=[`${latestYear-this.count_year+1}-01-01`,`${latestYear}-12-31`]
  1646. }else if(this.year_select==6){
  1647. this.season_year = [this.chartInfo.SeasonStartDate,this.tableData[0].LatestDate];
  1648. }else{
  1649. this.season_year = [this.chartInfo.SeasonStartDate,this.chartInfo.SeasonEndDate]
  1650. }
  1651. }
  1652. this.dateTip =
  1653. this.chartInfo.DateType === 5
  1654. ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
  1655. : this.chartInfo.DateType === 6
  1656. ? `${this.chartInfo.StartDate}~至今`
  1657. : this.chartInfo.DateType === 20
  1658. ?`最近${this.chartInfo.StartYear}年`
  1659. :/* '请选择时间段' */this.$t('Chart.choose_time');
  1660. },
  1661. // 设置默认预览配置项
  1662. setDefaultPreviewOption(){
  1663. if(this.chartInfo.ChartType==2){
  1664. if(this.chartInfo.SeasonExtraConfig){
  1665. this.SeasonExtraConfig = JSON.parse(this.chartInfo.SeasonExtraConfig)
  1666. }else{
  1667. // 返回空就是默认值
  1668. this.SeasonExtraConfig.XStartDate="01-01"
  1669. this.SeasonExtraConfig.XEndDate="12-31",
  1670. this.SeasonExtraConfig.JumpYear=0
  1671. }
  1672. // 从DataList中取 ChartLegend
  1673. this.SeasonExtraConfig.ChartLegend=[]
  1674. const chartDataHandle = this.calendar_type === "农历"?
  1675. this.tableData[0].DataList.filter((item, index) => index > 0):
  1676. this.tableData[0].DataList
  1677. chartDataHandle.map(item =>{
  1678. this.SeasonExtraConfig.ChartLegend.push({Name:item.Years,Value:item.ChartLegend})
  1679. })
  1680. }
  1681. },
  1682. /* 获取图表详情信息 type为refresh刷新指标不存储时间 */
  1683. async getPreviewChartInfo(type) {
  1684. let dateArray=this.chartInfo.ChartType==2?this.season_year:this.select_date
  1685. let params = {
  1686. ChartType: this.chartInfo.ChartType,
  1687. DateType: this.year_select,
  1688. StartDate: [5 , 6].includes(this.year_select)
  1689. ? dateArray[0]
  1690. : '',
  1691. EndDate: this.year_select === 5 ? dateArray[1] : '',
  1692. Calendar: this.calendar_type,
  1693. // ETA1.0.5 去除了这两个入参
  1694. // SeasonStartDate: this.season_year ? this.season_year[0] : '',
  1695. // SeasonEndDate: this.season_year ? this.season_year[1] : '',
  1696. SeasonExtraConfig:this.SeasonExtraConfig,
  1697. StartYear:this.count_year || 0,
  1698. ChartEdbInfoList: this.tableData.map(_ => ({
  1699. EdbInfoId: _.EdbInfoId,
  1700. EdbInfoType: _.EdbInfoType,
  1701. LeadValue: _.EdbInfoType ? 0 : Number(_.LeadValue),
  1702. LeadUnit: _.EdbInfoType ? '' : _.LeadUnit,
  1703. IsConvert:Number(_.IsConvert),
  1704. ConvertType:Number(_.ConvertType),
  1705. ConvertValue:Number(_.ConvertValue),
  1706. ConvertUnit:Number(_.IsConvert)?_.ConvertUnit:'',
  1707. ConvertEnUnit:Number(_.IsConvert)?_.ConvertEnUnit:''
  1708. }))
  1709. }
  1710. const res = await dataBaseInterface.getSplinePreviewData(params)
  1711. if(res.Ret !== 200) return
  1712. const { EdbInfoList } = res.Data;
  1713. this.tableData.forEach((item) => {
  1714. let edbData = EdbInfoList.find(_ => _.EdbInfoId===item.EdbInfoId);
  1715. item.DataList = edbData.DataList;
  1716. //更新起始时间和最近更新时间
  1717. item.StartDate = edbData.StartDate;
  1718. item.ModifyTime = edbData.ModifyTime;
  1719. if(edbData.EdbInfoCategoryType===1) item.MoveLatestDate = edbData.MoveLatestDate;
  1720. });
  1721. },
  1722. /* 搜索 */
  1723. searchHandle(query) {
  1724. this.search_page = 1;
  1725. this.current_search = query;
  1726. this.searchApi(this.current_search)
  1727. },
  1728. searchApi(query,page=1) {
  1729. /* 查找列表 */
  1730. dataBaseInterface
  1731. .chartSearchByEs({
  1732. Keyword: query,
  1733. IsShowMe:this.isOnlyMe,
  1734. CurrentIndex: page
  1735. })
  1736. .then((res) => {
  1737. if (res.Ret !== 200) return
  1738. const { List,Paging } = res.Data;
  1739. this.search_have_more = page < Paging.Pages;
  1740. this.searchOptions = page === 1 ? List : [...this.searchOptions,...List];
  1741. });
  1742. },
  1743. /* 聚焦获取当前检索 */
  1744. inputFocusHandle(e) {
  1745. this.search_page = 1;
  1746. this.current_search = e.target.value;
  1747. if(this.current_search) {
  1748. this.searchApi(this.current_search)
  1749. }else {
  1750. this.searchOptions = [];
  1751. }
  1752. },
  1753. searchLoad() {
  1754. if(!this.search_have_more) return;
  1755. this.searchApi(this.current_search,++this.search_page);
  1756. },
  1757. /* 保存当前图表配置 */
  1758. saveChartHandle: _.debounce(function () {
  1759. if (this.selected_chartid) {
  1760. //遍历每条线的指标配置
  1761. let arr = this.tableData.map((item) => {
  1762. return {
  1763. ChartColor: item.ChartColor,
  1764. PredictChartColor: item.PredictChartColor,
  1765. ChartStyle: item.ChartStyle,
  1766. ChartWidth: Number(item.ChartWidth),
  1767. EdbInfoId: item.EdbInfoId,
  1768. EdbInfoType: item.EdbInfoType,
  1769. IsAxis: item.IsAxis,
  1770. IsOrder: item.IsOrder,
  1771. LeadUnit: item.EdbInfoType ? '' : item.LeadUnit,
  1772. LeadValue: item.EdbInfoType ? 0 : Number(item.LeadValue),
  1773. MaxData: Number(item.MaxData),
  1774. MinData: Number(item.MinData),
  1775. };
  1776. });
  1777. let public_param = {
  1778. ChartClassifyId: this.selected_chartClassify,
  1779. ChartInfoId: this.selected_chartid || 0,
  1780. ChartEdbInfoList: arr,
  1781. }
  1782. let typeChartParam = {};
  1783. switch(this.chartInfo.ChartType) {
  1784. case 2:
  1785. typeChartParam = {
  1786. ...public_param,
  1787. DateType: this.year_select,
  1788. StartYear:this.count_year || 0,
  1789. Calendar: this.calendar_type,
  1790. StartDate: this.season_year ? this.season_year[0] : '',
  1791. EndDate: this.season_year ? this.season_year[1] : '',
  1792. }
  1793. break
  1794. case 7:
  1795. case 11:
  1796. typeChartParam = {
  1797. ...public_param,
  1798. DateType: 6,
  1799. LeftMin: String(this.chartLimit.min),
  1800. LeftMax: String(this.chartLimit.max),
  1801. }
  1802. break
  1803. case 10:
  1804. typeChartParam = {
  1805. ...public_param,
  1806. DateType: 6,
  1807. Calendar: "公历",
  1808. ExtraConfig: JSON.stringify({
  1809. ...JSON.parse(this.chartInfo.ExtraConfig),
  1810. XMinValue: String(this.chartLimit.x_min),
  1811. XMaxValue: String(this.chartLimit.x_max),
  1812. YMinValue: String(this.chartLimit.min),
  1813. YMaxValue: String(this.chartLimit.max),
  1814. })
  1815. }
  1816. break
  1817. }
  1818. let params = this.sameOptionType.includes(this.selected_chartType)
  1819. ? {
  1820. ...public_param,
  1821. DateType: this.year_select,
  1822. StartYear:this.count_year || 0,
  1823. StartDate:
  1824. this.year_select === 5 || this.year_select === 6
  1825. ? this.select_date[0]
  1826. : '',
  1827. EndDate: this.year_select === 5 ? this.select_date[1] : '',
  1828. }
  1829. : typeChartParam;
  1830. if(![7,10,11].includes(this.selected_chartType)){
  1831. const {
  1832. min,max,rightMin,rightMax,rightTwoMin,rightTwoMax
  1833. } = this.chartLimit
  1834. params = {
  1835. ...params,
  1836. LeftMin:min+'',
  1837. LeftMax:max+'',
  1838. RightMin:rightMin+'',
  1839. RightMax:rightMax+'',
  1840. Right2Min:rightTwoMin+'',
  1841. Right2Max:rightTwoMax+'',
  1842. //手动保存视为更改过上下限
  1843. MinMaxSave:1
  1844. }
  1845. }
  1846. dataBaseInterface.chartSave(params).then((res) => {
  1847. if (res.Ret === 200) {
  1848. // this.$message.success('保存成功');
  1849. this.$message.success(this.$t('MsgPrompt.saved_msg'));
  1850. sessionStorage.removeItem('beforeOptions');
  1851. sessionStorage.setItem(
  1852. 'defaultArr',
  1853. JSON.stringify(this.tableData)
  1854. );
  1855. this.getTreeData();
  1856. //关联图表和图片
  1857. this.setChartImage();
  1858. }
  1859. });
  1860. }
  1861. }, 500),
  1862. // 英文面板时候的判断
  1863. copyChartConfirm(type){
  1864. if(this.currentLang=='en'){
  1865. // 是否所有数据都填写完
  1866. let flag=true
  1867. // 是否有英文表格名称
  1868. if(!this.chartInfo.ChartNameEn) flag = false
  1869. if(flag){
  1870. for (const data of this.tableData) {
  1871. // 单位中文名为空时 英文名不做判断
  1872. if(data.EdbNameEn=="" || (data.UnitEn=="" && data.Unit!="")){
  1873. flag = false
  1874. break
  1875. }
  1876. }
  1877. }
  1878. if(!flag){
  1879. this.$confirm(/* '英文名称未输入完整,分享图表上可能出现空名称的情况,确定继续分享吗?' */this.$t('Chart.OptMsg.copy_noenough_en'), /* '提示' */this.$t('Dialog.warn_tit'), {
  1880. type: 'warning',
  1881. })
  1882. .then(() => {
  1883. if(type==='url'){
  1884. // this.shareUrl()
  1885. const input = document.createElement('input')
  1886. input.setAttribute('readonly','readonly')
  1887. input.value = this.linkUrl
  1888. document.body.appendChild(input)
  1889. input.select();
  1890. document.execCommand('copy');
  1891. document.body.removeChild(input);
  1892. // this.$message.success('复制链接成功')
  1893. this.$message.success(this.$t('Chart.OptMsg.copy_link_success'))
  1894. }else{
  1895. this.copyChartHandle(type)
  1896. }
  1897. })
  1898. .catch(() => {});
  1899. }else{
  1900. if(type=='url'){
  1901. this.shareUrl()
  1902. }else{
  1903. this.copyChartHandle(type)
  1904. }
  1905. }
  1906. }else{
  1907. if(type=='url'){
  1908. this.shareUrl()
  1909. }else{
  1910. this.copyChartHandle(type)
  1911. }
  1912. }
  1913. },
  1914. /* 点击复制先用canvas画出 转成图片在放到粘贴板中 */
  1915. copyChartHandle:_.debounce(function(type){{
  1916. let chartsName = this.currentLang=='ch'?this.chartInfo.ChartName:this.chartInfo.ChartNameEn
  1917. let { heightNum, widthNum , newTitle , dynamic_copyOptions} = this.dynamicWidthAndHeight(type,this.chartInfo.ChartType,chartsName,this.chartInfo.Source === 1?this.tableData.length:this.commodityChartData.length)
  1918. const chartType = this.sameOptionType.includes(this.chartInfo.ChartType)?'legend':'seasonLegend'
  1919. // 英文转SVG设置变动
  1920. if(this.currentLang == 'en'){
  1921. // 散点图 如果横轴单位为'英文单位',表示客户没填,转成svg时置为空
  1922. if(this.chartInfo.ChartType == 5){
  1923. this.$refs.chartRef.chart.options.xAxis.forEach(it => {
  1924. if(it.title.text == '英文单位') it.title.text=''
  1925. });
  1926. }
  1927. // 如果竖轴坐标单位为'英文单位',表示客户没填,转成svg时置为空
  1928. this.$refs.chartRef.chart.options.yAxis.forEach(it => {
  1929. if(it.title.text == '英文单位') it.title.text=''
  1930. });
  1931. }
  1932. let svg = this.$refs.chartRef.chart.getSVG({
  1933. chart:{
  1934. width:widthNum,
  1935. height:heightNum,
  1936. backgroundColor:"rgba(255, 255, 255, 0)",
  1937. },
  1938. title: {
  1939. text: newTitle,
  1940. margin: 10,
  1941. style: {
  1942. fontSize: '18px'
  1943. }
  1944. },
  1945. legend:{
  1946. ...copyOtherOptions[chartType],
  1947. ...dynamic_copyOptions[chartType]
  1948. }
  1949. });
  1950. this.copyBlobItem(widthNum,heightNum,svg,type);
  1951. }
  1952. },500) ,
  1953. // 选择
  1954. getSelect(targetNode) {
  1955. if (window.getSelection) {
  1956. //chrome等主流浏览器
  1957. var selection = window.getSelection();
  1958. var range = document.createRange();
  1959. range.selectNode(targetNode);
  1960. selection.removeAllRanges();
  1961. selection.addRange(range);
  1962. } else if (document.body.createTextRange) {
  1963. //ie
  1964. var range = document.body.createTextRange();
  1965. range.moveToElementText(targetNode);
  1966. range.select();
  1967. }
  1968. },
  1969. /* 点击删除图表 */
  1970. delChartHandle() {
  1971. this.$confirm(/* '删除后该图表将不能再引用,确认删除吗?' */this.$t('Chart.OptMsg.chart_del_confirm'), this.$t('Dialog.warn_tit'), {
  1972. confirmButtonText: /* '确定' */this.$t('Dialog.confirm_btn'),
  1973. cancelButtonText: /* '取消' */this.$t('Dialog.cancel_btn'),
  1974. type: 'warning',
  1975. })
  1976. .then(() => {
  1977. this.delHandle(
  1978. this.selected_chartClassify || 0,
  1979. this.selected_chartid,
  1980. 1
  1981. );
  1982. })
  1983. .catch(() => {});
  1984. },
  1985. /* 图表未保存时更新图表数据 */
  1986. refreshTarget() {
  1987. for (let i in this.tableData) {
  1988. let params = {
  1989. EdbInfoId: this.tableData[i].EdbInfoId,
  1990. DateType: this.year_select,
  1991. StartDate:
  1992. this.year_select === 5 || this.year_select === 6
  1993. ? this.select_date[0]
  1994. : '',
  1995. EndDate: this.year_select === 5 ? this.select_date[1] : '',
  1996. EdbInfoType: this.tableData[i].EdbInfoType,
  1997. LeadValue: this.tableData[i].EdbInfoType
  1998. ? 0
  1999. : this.tableData[i].LeadValue,
  2000. LeadUnit: this.tableData[i].EdbInfoType
  2001. ? ''
  2002. : this.tableData[i].LeadUnit,
  2003. };
  2004. dataBaseInterface.edbinfoDetail(params).then((res) => {
  2005. if (res.Ret === 200) {
  2006. let newData = res.Data.EdbInfo;
  2007. this.tableData[i].DataList = newData.DataList;
  2008. if(newData.EdbInfoCategoryType===1) this.tableData[i].MoveLatestDate = newData.MoveLatestDate;
  2009. }
  2010. });
  2011. }
  2012. },
  2013. /* 年份改变 重新刷新图表接口 保存当前的图表配置和上下限 只改变图表 */
  2014. changeYear(item) {
  2015. this.year_select = item.value;
  2016. this.select_date = '';
  2017. this.dateTip = /* '请选择时间段' */this.$t('Chart.choose_time');
  2018. // 图表已存在
  2019. this.selected_chartid && this.getPreviewChartInfo();
  2020. },
  2021. /* 打开时间段弹窗 */
  2022. openDateDia() {
  2023. // 自定义时间段回显
  2024. let selectDateStart = this.chartInfo.ChartType === 2?this.season_year[0]:this.select_date[0]
  2025. let selectDateEnd = this.chartInfo.ChartType === 2?this.season_year[1]:this.select_date[1]
  2026. this.dateForm = {
  2027. date_type: this.year_select,
  2028. start_date:
  2029. this.year_select === 5 || this.year_select === 6
  2030. ? selectDateStart
  2031. : '',
  2032. end_date: this.year_select === 5 ? selectDateEnd : '',
  2033. count_year: this.year_select === 20 ? this.count_year : ''
  2034. };
  2035. this.isDateDia = true;
  2036. },
  2037. /* 保存完自定义日期 刷新数据 保存当前的图表配置和上下限 只改变图表*/
  2038. dataChangeBack(data) {
  2039. // console.log(data,'timeData');
  2040. this.year_select = data.dateType;
  2041. this.isDateDia = false;
  2042. this.select_date = [data.start_date, data.end_date];
  2043. this.count_year = data.count_year
  2044. let dateStart = data.start_date
  2045. let dateEnd = data.end_date
  2046. let latestYear = parseInt(this.latestDate.substring(0,4))
  2047. if(data.dateType==20){
  2048. dateStart = `${latestYear-data.count_year+1}-01-01`
  2049. dateEnd = `${latestYear}-12-31`
  2050. }
  2051. if(this.chartInfo.ChartType === 2){
  2052. // 季节性图
  2053. if(data.dateType==6){
  2054. dateEnd = this.$moment(new Date()).format("YYYY-MM-DD")
  2055. }
  2056. this.season_year = [dateStart, dateEnd];
  2057. // 因为原本季节性图不支持 DateType为5和6的 所以季节性也将StartDate和EndDate传过去
  2058. this.select_date = [dateStart, dateEnd];
  2059. }else{
  2060. this.select_date = [dateStart, dateEnd];
  2061. if(data.dateType==20){
  2062. this.dateTip = `最近${data.count_year}年`
  2063. }else if (data.dateType === 5) {
  2064. this.dateTip = `${data.start_date}~${data.end_date}`;
  2065. } else {
  2066. this.dateTip = `${data.start_date}~至今`;
  2067. }
  2068. }
  2069. this.getPreviewChartInfo();
  2070. },
  2071. /* 编辑图表 跳转 */
  2072. editChartHandle() {
  2073. this.$router.push({
  2074. path: '/editchart',
  2075. query: {
  2076. code: this.chartInfo.UniqueCode
  2077. }
  2078. })
  2079. },
  2080. /* 根据unicode展开树结构并选中当前图表 重置图表配置 日期区间 */
  2081. // 如果有chartData则说明是从图列表点击来的,如果没有 则说明是路由中带的参数此时要获取一下详情
  2082. async selectCurrentNode({ code, id, type,chartData }) {
  2083. let deep_arr = _.cloneDeep(this.treeData);
  2084. // 查找选中的节点信息
  2085. let select_obj = chartData?chartData:await this.findNode(deep_arr, id);
  2086. // 查找图表的分类父级id
  2087. this.select_node = code;
  2088. // 重置筛选状态
  2089. this.selected_chartClassify = select_obj.ChartClassifyId; //图表所属分类
  2090. this.year_select = select_obj.DateType; //年份选择
  2091. this.calendar_type = select_obj.Calendar || '公历'; //公历/农历
  2092. this.season_year = [select_obj.SeasonStartDate, select_obj.SeasonEndDate]; //季节年份区间
  2093. this.select_date = [select_obj.StartDate, select_obj.EndDate]; //曲线日期选择
  2094. this.selected_chartType = select_obj.ChartType;
  2095. this.selected_chartid = id;
  2096. },
  2097. /* 根据图表id 查找对象 */
  2098. findNode(arr, id) {
  2099. // 由于目录第三级图表改为懒加载 故从新增图跳转回来情况只能获取一下图详情了 不能直接去分类数据里面查了
  2100. return new Promise((resolve,reject)=>{
  2101. dataBaseInterface.chartInfo({
  2102. ChartInfoId: id,
  2103. }).then(res=>{
  2104. if(res.Ret==200){
  2105. resolve(res.Data.ChartInfo)
  2106. }
  2107. })
  2108. })
  2109. // 遍历取父级code push数组
  2110. // for (let i of arr) {
  2111. // if (i.ChartInfoId === id) {
  2112. // return i;
  2113. // }
  2114. // if (i.Children) {
  2115. // let node = this.findNode(i.Children, id);
  2116. // if (node) {
  2117. // return node;
  2118. // }
  2119. // }
  2120. // }
  2121. },
  2122. /* 点击表格行展开配置项 */
  2123. rowClickHandle(row) {
  2124. this.expandKey =
  2125. this.expandKey.length && this.expandKey[0] === row.EdbCode
  2126. ? []
  2127. : [row.EdbCode];
  2128. },
  2129. /* 设置row-key */
  2130. getRowKey(row) {
  2131. return row.EdbCode;
  2132. },
  2133. /* 控制展开一行收起其他行并高亮 */
  2134. expandChangeHandle(row, expandedRows) {
  2135. this.expandKey =
  2136. this.expandKey.length && this.expandKey[0] === row.EdbCode
  2137. ? []
  2138. : [row.EdbCode];
  2139. this.$refs.tableRef.setCurrentRow(row);
  2140. },
  2141. // 查找树节点所有父节点
  2142. findParentNodeHandle(arr, id) {
  2143. // 遍历取父级code push数组
  2144. for (let i of arr) {
  2145. if (i.ChartClassifyId === id) {
  2146. return [i.UniqueCode];
  2147. }
  2148. if (i.Children) {
  2149. let node = this.findParentNodeHandle(i.Children, id);
  2150. if (node) {
  2151. return node.concat(i.UniqueCode);
  2152. }
  2153. }
  2154. }
  2155. },
  2156. // 通过分类id找到指标所属的分类
  2157. findParentNodeForClassifyId(id,code){
  2158. let arr=[]
  2159. this.treeData.forEach(item=>{
  2160. if(item.Children){
  2161. item.Children.forEach(_item=>{
  2162. if(_item.ChartClassifyId==id){
  2163. arr=[item.UniqueCode,_item.UniqueCode]
  2164. }
  2165. })
  2166. }
  2167. })
  2168. return [...arr]
  2169. },
  2170. /* 向左收起 展开 */
  2171. slideHandle() {
  2172. this.isSlideLeft = !this.isSlideLeft;
  2173. },
  2174. /* 季节图切换年份 保持当前配置 */
  2175. seasonYearChange() {
  2176. this.getPreviewChartInfo();
  2177. },
  2178. /* 一键刷新 超长等待..*/
  2179. refreshHandle() {
  2180. this.refreshLoading = this.$loading({
  2181. lock: true,
  2182. target: '.main-right',
  2183. text: /* '刷新图表中...' */this.$t('Chart.OptMsg.refresh_ing_msg'),
  2184. spinner: 'el-icon-loading',
  2185. background: 'rgba(255, 255, 255, 0.8)',
  2186. });
  2187. dataBaseInterface
  2188. .chartRefresh({
  2189. ChartInfoId: this.selected_chartid,
  2190. })
  2191. .then((res) => {
  2192. this.refreshLoading.close();
  2193. if (res.Ret === 200) {
  2194. [7,10,11].includes(this.chartInfo.ChartType) ? this.getChartDetail() : this.getPreviewChartInfo();
  2195. // this.$message.success('刷新成功');
  2196. this.$message.success(this.$t('MsgPrompt.refresh_success_msg'));
  2197. }
  2198. });
  2199. },
  2200. /* 重绘右侧区域宽度 */
  2201. reloadRightWid() {
  2202. let total_wid = $('#box')[0].offsetWidth;
  2203. let left = $('#left')[0].offsetWidth;
  2204. let rigtWid = total_wid - left - 20 + 'px';
  2205. $('#right')[0].style.width = rigtWid;
  2206. },
  2207. /* 转base64 */
  2208. svgToBase64(svg) {
  2209. const base64img = `data:image/svg+xml;base64,${window.btoa(
  2210. unescape(encodeURI(svg))
  2211. )}`;
  2212. // console.log(base64img)
  2213. return base64img;
  2214. },
  2215. /* 点击保存时关联图表和截取的图片 */
  2216. setChartImage() {
  2217. let svg = this.$refs.chartRef.chart.getSVG({
  2218. chart:{
  2219. width: 340,
  2220. height: 230,
  2221. }
  2222. });
  2223. let form = new FormData();
  2224. form.append('Img', svg);
  2225. this.setImageHandle(form);
  2226. },
  2227. async setImageHandle(form) {
  2228. let { Data } = await dataBaseInterface.uploadImgSvg(form);
  2229. // let { Data } = await dataBaseInterface.uploadImg(form);
  2230. await dataBaseInterface.setChartImage({
  2231. ChartInfoId: this.selected_chartid,
  2232. ImageUrl: Data.ResourceUrl,
  2233. });
  2234. },
  2235. /* 分享图表 */
  2236. shareUrl() {
  2237. var clipboard = new this.Clipboard('.shareLink')
  2238. clipboard.on('success', e => {
  2239. console.log(e);
  2240. // this.$message.success('复制链接成功')
  2241. this.$message.success(this.$t('Chart.OptMsg.copy_link_success'))
  2242. e.clearSelection() // 释放内存
  2243. clipboard.destroy()
  2244. })
  2245. // // 浏览器不支持
  2246. clipboard.on('error', e => {
  2247. // this.$message.warning('浏览器暂不支持')
  2248. this.$message.warning(this.$t('MsgPrompt.browser_not_support'))
  2249. // 释放内存
  2250. clipboard.destroy()
  2251. })
  2252. },
  2253. /* ----------------公用图库part-------------------- */
  2254. getPublicChartList() {
  2255. mychartInterface
  2256. .publicList({
  2257. PageSize: this.public_page_size,
  2258. CurrentIndex: this.public_page_no,
  2259. ChartClassifyId: this.default_classify || 0,
  2260. IsShowMe:this.isOnlyMe || false
  2261. })
  2262. .then((res) => {
  2263. if (res.Ret !== 200) return;
  2264. // this.isShowPublicChart = res.Data ? true : false;
  2265. this.publicHaveMove = res.Data
  2266. ? this.public_page_no < res.Data.Paging.Pages
  2267. : false;
  2268. this.chartPublicList = res.Data
  2269. ? this.public_page_no === 1
  2270. ? res.Data.List
  2271. : [...this.chartPublicList, ...res.Data.List]
  2272. : [];
  2273. this.public_total = res.Data ? res.Data.Paging.Totals : 0;
  2274. });
  2275. },
  2276. /* 加载更多 */
  2277. loadMorePublicChart:_.throttle(function(e) {
  2278. let scrollTop = this.$refs.listChartPage.scrollTop;
  2279. let clientHeight = this.$refs.listChartPage.clientHeight;
  2280. let scrollHeight = this.$refs.listChartPage.scrollHeight;
  2281. console.log('scrollTop:',scrollTop)
  2282. console.log('clientHeight:',clientHeight)
  2283. console.log('scrollHeight:',scrollHeight)
  2284. if(scrollTop + clientHeight >= scrollHeight-10 && this.publicHaveMove){
  2285. this.public_page_no++;
  2286. this.getPublicChartList();
  2287. }
  2288. },300),
  2289. /* 点击图表区域跳转详情 选中左侧图表菜单 */
  2290. detailShowHandle(item) {
  2291. this.leftShowLabel = '目录';
  2292. this.$nextTick(() => {
  2293. let params = {
  2294. code: item.UniqueCode,
  2295. id: item.ChartInfoId,
  2296. type: item.ChartType,
  2297. chartData:item
  2298. };
  2299. this.selectCurrentNode(params);
  2300. this.default_classify = '';
  2301. this.reloadRightWid();
  2302. })
  2303. },
  2304. /* 加入我的图库 */
  2305. addMychartHandle(item) {
  2306. this.add_chart_id = item.ChartInfoId;
  2307. //已有的分类ids
  2308. this.add_ids = item.MyChartClassifyId ? item.MyChartClassifyId.split(',').map(item => Number(item)) : [];
  2309. this.isAddMyChart = true;
  2310. },
  2311. /* 加入我的图库成功 */
  2312. addMySuccess(params) {
  2313. this.isAddMyChart = false;
  2314. /* 判断是详情还是图库列表 */
  2315. if (this.selected_chartid) {
  2316. this.chartInfo.IsAdd = true;
  2317. this.chartInfo.MyChartId = params.MyChartInfoId;
  2318. this.chartInfo.MyChartClassifyId = params.MyChartClassifyId;
  2319. } else {
  2320. this.chartPublicList.forEach((item) => {
  2321. if (item.ChartInfoId === this.add_chart_id) {
  2322. item.IsAdd = true;
  2323. item.MyChartId = params.MyChartInfoId;
  2324. item.MyChartClassifyId = params.MyChartClassifyId
  2325. }
  2326. });
  2327. }
  2328. },
  2329. /* 存储中英文状态 */
  2330. setLangIntoStore() {
  2331. this.$store.commit('edb/SET_CAHRT_LANG',this.currentLang)
  2332. },
  2333. /* 获取标签列表 */
  2334. getlabelList(){
  2335. const List = JSON.parse(sessionStorage.getItem('etachart'))||[]
  2336. this.labelList = List
  2337. },
  2338. /* 添加标签 params 基本属性{code,id,classifyId,EdbName,EdbNameEn}*/
  2339. addLabel(params){
  2340. const index = this.labelList.findIndex(i=>i.code===params.code)
  2341. //标签已存在列表中,更新标签的值
  2342. if(index!==-1){
  2343. this.labelList.splice(index,1,params)
  2344. return
  2345. }
  2346. //根据页面宽度 判断标签数量是否达到上限
  2347. const listWidth = document.querySelector('.chartSetting-label-list').offsetWidth
  2348. const minWidth=170+20
  2349. const maxNum = Math.floor(listWidth/minWidth)
  2350. if(this.labelList.length>=maxNum){
  2351. //达到上限则挤出第一个,再添加
  2352. this.labelList.shift()
  2353. }
  2354. this.labelList.push(params)
  2355. },
  2356. //改变选中标签,
  2357. changeCurrentLabel(params){
  2358. if(params.code!==this.select_node){
  2359. this.selectCurrentNode(params)
  2360. }
  2361. },
  2362. //删除标签
  2363. deleteLabel(params,type="label"){
  2364. const index = this.labelList.findIndex(i=>i.code===params.code)
  2365. //如果删除的标签是选中状态
  2366. if(this.select_node===params.code){
  2367. //删除的是唯一一个标签
  2368. if(this.labelList.length===1){
  2369. this.selected_chartid=''
  2370. this.select_node = ''
  2371. this.$refs.treeRef.setCurrentKey(null)
  2372. this.getPublicChartList()
  2373. //不是唯一的标签,则默认选中上一个/下一个
  2374. }else{
  2375. type==='label'&&index===0&&this.changeCurrentLabel(this.labelList[1])
  2376. type==='label'&&index!==0&&index!==-1&&this.changeCurrentLabel(this.labelList[index-1])
  2377. }
  2378. }
  2379. index!==-1&&this.labelList.splice(index,1)
  2380. },
  2381. changeTreeNode(){
  2382. this.$refs.treeRef.setCurrentKey(this.select_node);
  2383. this.$nextTick(()=>{
  2384. const _node = this.$refs.treeRef.getNode(this.select_node)
  2385. this.dynamicNode = _node;
  2386. this.dynamicNode&&this.resetNodeStyle(this.dynamicNode)
  2387. })
  2388. }
  2389. },
  2390. //离开页面时保存标签
  2391. beforeRouteLeave(to,from,next){
  2392. sessionStorage.setItem('etachart',JSON.stringify(this.labelList))
  2393. next()
  2394. },
  2395. mounted() {
  2396. this.getlabelList()
  2397. if(this.$route.query.code) {
  2398. this.getTreeData({code: this.$route.query.code,id: Number(this.$route.query.id)})
  2399. } else {
  2400. this.getTreeData();
  2401. this.getPublicChartList();
  2402. }
  2403. window.addEventListener('resize', this.reloadRightWid);
  2404. //离开页面时保存标签
  2405. window.onbeforeunload = ()=>{
  2406. sessionStorage.setItem('etachart',JSON.stringify(this.labelList))
  2407. }
  2408. },
  2409. destroyed() {
  2410. window.removeEventListener('resize', this.reloadRightWid);
  2411. window.onbeforeunload = null
  2412. },
  2413. };
  2414. </script>
  2415. <style lang="scss">
  2416. @import './css/chartfit.scss';
  2417. .chartSetting_container {
  2418. * {box-sizing: border-box;}
  2419. .flip-list-move {
  2420. transition: transform 0.4s;
  2421. }
  2422. .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
  2423. background-color: #409eff !important;
  2424. border-color: #409eff;
  2425. }
  2426. .el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner {
  2427. background-color: #409eff !important;
  2428. border-color: #409eff;
  2429. }
  2430. .el-card .el-card__header {
  2431. padding: 14px 20px;
  2432. }
  2433. .main-left {
  2434. .add-chart-cont {
  2435. padding: 15px 20px;
  2436. border: 1px solid #ECECEC;
  2437. display: flex;
  2438. box-shadow: 0px 3px 6px rgba(167, 167, 167, 0.09);
  2439. }
  2440. .left-tab {
  2441. display: flex;
  2442. align-items: center;
  2443. padding: 20px 20px 0;
  2444. .tab {
  2445. cursor: pointer;
  2446. font-size: 16px;
  2447. border-bottom: 2px solid transparent;
  2448. margin-right: 40px;
  2449. padding-bottom: 5px;
  2450. &.act{
  2451. color: #409eff;
  2452. border-color: #409eff;
  2453. }
  2454. &:hover {
  2455. color: #409eff;
  2456. }
  2457. }
  2458. }
  2459. .targetset-cont {
  2460. padding: 30px 20px 20px;
  2461. height: calc(100vh - 290px);
  2462. overflow-y: auto;
  2463. .target-list {
  2464. border: 1px solid #DCDFE6;
  2465. .setting-cont {
  2466. padding: 20px 20px 0;
  2467. li {
  2468. padding-bottom: 20px;
  2469. margin-bottom: 20px;
  2470. border-bottom: 1px solid #DCDFE6;
  2471. &:last-child {
  2472. padding-bottom: 0;
  2473. margin-bottom: 0;
  2474. border-bottom: none;
  2475. }
  2476. }
  2477. }
  2478. }
  2479. .scatter-setting {
  2480. display: flex;
  2481. margin-bottom: 20px;
  2482. }
  2483. .el-input__inner {
  2484. height: 27px;
  2485. line-height: 27px;
  2486. padding: 0 4px;
  2487. }
  2488. .el-input-number .el-input__inner {
  2489. padding: 0 34px 0 4px;
  2490. }
  2491. .el-color-picker--mini .el-color-picker__trigger {
  2492. width: 60px;
  2493. height: 25px;
  2494. padding: 0;
  2495. }
  2496. .el-color-picker--mini .el-color-picker__mask {
  2497. width: 60px;
  2498. height: 25px;
  2499. }
  2500. .el-collapse-item__header {
  2501. background-color: #F0F2F5;
  2502. margin-bottom: 0;
  2503. border-bottom: 1px solid #DCDFE6;
  2504. padding: 0 20px 0 30px;
  2505. .el-collapse-item__arrow {
  2506. position: absolute;
  2507. left: 8px;
  2508. }
  2509. }
  2510. }
  2511. }
  2512. .cont-bottom {
  2513. .error-tip{ color: #D03F28; font-size: 16px;padding: 25px 0 0 25px; }
  2514. .bottom-min {
  2515. border: 1px solid #DCDFE6;
  2516. margin-bottom: 20px;
  2517. .right-actions {
  2518. /* max-width: 160px; */
  2519. min-width: 115px;
  2520. height: 100%;
  2521. padding: 20px 10px;
  2522. border-left: 1px solid #DCDFE6;
  2523. li {
  2524. margin-bottom: 15px;
  2525. }
  2526. @media screen and (max-width: 1710px) {
  2527. font-size: 12px;
  2528. }
  2529. .span-item {
  2530. color: #409eff;
  2531. cursor: pointer;
  2532. &:hover {
  2533. text-decoration: underline;
  2534. }
  2535. .el-icon-collection,
  2536. .el-icon-document-copy {
  2537. color: #409eff;
  2538. }
  2539. }
  2540. }
  2541. .calendar-cont {
  2542. .el-radio-button__inner {
  2543. padding: 8px 16px;
  2544. }
  2545. }
  2546. }
  2547. }
  2548. /* ===================== */
  2549. .chart-public-cont {
  2550. color: #333;
  2551. .el-card .el-card__header,
  2552. .el-card__body {
  2553. padding: 10px;
  2554. }
  2555. .chart-public-list {
  2556. margin-top: 10px;
  2557. display: flex;
  2558. flex-wrap: wrap;
  2559. max-height: calc(100vh - 143px);
  2560. overflow: hidden;
  2561. overflow-y: auto;
  2562. .drag-cont {
  2563. width: 100%;
  2564. display: flex;
  2565. flex-wrap: wrap;
  2566. }
  2567. .dragShdow {
  2568. box-shadow: 0 1px 8px rgba(64, 158, 255, 0.8);
  2569. opacity: 0.5;
  2570. }
  2571. .public-chart-item {
  2572. .item-top {
  2573. display: flex;
  2574. justify-content: space-between;
  2575. align-items: center;
  2576. font-size: 16px;
  2577. font-weight: 600;
  2578. }
  2579. .chart-img {
  2580. width: 100%;
  2581. height: 230px;
  2582. object-fit: fill !important;
  2583. cursor: pointer;
  2584. }
  2585. .item-bottom {
  2586. margin-top: 10px;
  2587. display: flex;
  2588. justify-content: space-between;
  2589. font-size: 12px;
  2590. color: #666;
  2591. .collected {
  2592. color: #f00;
  2593. cursor: pointer;
  2594. }
  2595. .join_txt {
  2596. color: #409eff;
  2597. cursor: pointer;
  2598. }
  2599. }
  2600. }
  2601. .chart-list-item{
  2602. width:23%;
  2603. min-width:230px;
  2604. .chart-item-top,.chart-item-bottom{
  2605. display: flex;
  2606. justify-content: space-between;
  2607. }
  2608. }
  2609. }
  2610. }
  2611. .nodata {
  2612. /* height: calc(100vh - 240px); */
  2613. text-align: center;
  2614. font-size: 16px;
  2615. color: #666;
  2616. }
  2617. .copy-excel {
  2618. color: #409eff;
  2619. font-size: 14px;
  2620. padding-left: 50px;
  2621. padding-right: 10px;
  2622. }
  2623. @media screen and (min-width: 1711px) {
  2624. .el-icon-refresh {
  2625. font-size: 17px;
  2626. margin-left: 5px;
  2627. cursor: pointer;
  2628. }
  2629. .chartSetting_top {
  2630. display: flex;
  2631. justify-content: space-between;
  2632. align-items: center;
  2633. margin-bottom: 20px;
  2634. padding: 20px 30px;
  2635. background: #fff;
  2636. border: 1px solid #ececec;
  2637. border-radius: 4px;
  2638. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  2639. .el-select__input {
  2640. margin-left: 30px;
  2641. }
  2642. }
  2643. .chartSetting_main {
  2644. /* display: flex; */
  2645. /* div::-webkit-scrollbar {
  2646. width: 5px !important;
  2647. } */
  2648. .slide-icon {
  2649. padding: 20px 0;
  2650. /* display: block; */
  2651. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
  2652. border-radius: 5px;
  2653. cursor: pointer;
  2654. position: absolute;
  2655. top: 50%;
  2656. transform: translateY(-50%);
  2657. z-index: 99;
  2658. &:hover {
  2659. background-color: rgba(0, 0, 0, 0.05);
  2660. }
  2661. &.slide-left {
  2662. right: 0;
  2663. }
  2664. &.slide-right {
  2665. left: 0;
  2666. }
  2667. }
  2668. .main-left {
  2669. width: 400px;
  2670. min-width: 350px;
  2671. background: #fff;
  2672. margin-right: 20px;
  2673. border: 1px solid #ececec;
  2674. border-radius: 4px;
  2675. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  2676. height: calc(100vh - 113px);
  2677. overflow: hidden;
  2678. position: relative;
  2679. box-sizing: border-box;
  2680. .chartSetting_main_top {
  2681. padding: 10px 20px 15px;
  2682. .add-cont {
  2683. cursor: pointer;
  2684. font-size: 15px;
  2685. color: #409eff;
  2686. }
  2687. }
  2688. .tree-cont {
  2689. padding: 15px 20px 30px;
  2690. overflow: auto;
  2691. max-height: calc(100vh - 330px);
  2692. margin-right: 20px;
  2693. }
  2694. .target_tree {
  2695. font-size: 14px;
  2696. color: #333;
  2697. .label-input .el-input__inner {
  2698. height: 25px;
  2699. line-height: 25px;
  2700. }
  2701. .custom-tree-node {
  2702. display: flex !important;
  2703. justify-content: space-between;
  2704. align-items: center;
  2705. display: block;
  2706. flex: 1;
  2707. .node_label {
  2708. margin-right: 2px;
  2709. }
  2710. }
  2711. .el-tree__drop-indicator {
  2712. /* position:absolute; */
  2713. /* left:0;
  2714. right:0; */
  2715. height: 3px;
  2716. // margin-top: 8px;
  2717. background-color: #409eff;
  2718. }
  2719. .el-tree-node__content {
  2720. margin-bottom: 14px !important;
  2721. }
  2722. .el-tree-node__children {
  2723. .el-tree-node {
  2724. /* margin-bottom: 8px !important; */
  2725. margin-bottom: 0px !important;
  2726. padding-left: 18px;
  2727. }
  2728. .el-tree-node__content {
  2729. margin-bottom: 5px !important;
  2730. padding-left: 0 !important;
  2731. }
  2732. }
  2733. .expanded.el-icon-caret-right:before {
  2734. content: url('../../assets/img/set_m/down.png') !important;
  2735. }
  2736. .el-icon-caret-right:before {
  2737. content: url('../../assets/img/set_m/slide.png') !important;
  2738. }
  2739. .el-tree-node__expand-icon.is-leaf.el-icon-caret-right:before {
  2740. content: '' !important;
  2741. }
  2742. .el-tree-node__expand-icon.expanded {
  2743. -webkit-transform: rotate(0deg);
  2744. transform: rotate(0deg);
  2745. }
  2746. .el-tree-node.is-current > .el-tree-node__content {
  2747. background-color: #f0f4ff !important;
  2748. }
  2749. .el-tree-node__content {
  2750. padding-right: 10px !important;
  2751. }
  2752. }
  2753. .noDepart {
  2754. margin: 60px 0;
  2755. display: flex;
  2756. align-items: center;
  2757. justify-content: center;
  2758. color: #409eff;
  2759. font-size: 16px;
  2760. cursor: pointer;
  2761. }
  2762. .move-btn {
  2763. height: 100%;
  2764. width: 4px;
  2765. /* opacity: 0; */
  2766. position: absolute;
  2767. right: 0px;
  2768. top: 0;
  2769. &:hover {
  2770. cursor: col-resize;
  2771. /* background-color: orange */
  2772. }
  2773. }
  2774. }
  2775. .main-right {
  2776. flex:1;
  2777. overflow: hidden;
  2778. .mx-datepicker {
  2779. width: 220px !important;
  2780. }
  2781. /* =================== */
  2782. .chart-min-cont {
  2783. background: #fff;
  2784. border: 1px solid #ececec;
  2785. height: calc(100vh - 114px);
  2786. overflow: auto;
  2787. /* overflow: hidden; */
  2788. border-radius: 4px;
  2789. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  2790. .cont-top {
  2791. padding: 12px 30px;
  2792. border-bottom: 1px solid #ececec;
  2793. display: flex;
  2794. justify-content: space-between;
  2795. align-items: center;
  2796. box-shadow: 0px 3px 6px rgba(167, 167, 167, 0.09);
  2797. .top-left {
  2798. .year-btn {
  2799. font-size: 14px;
  2800. margin-right: 5px;
  2801. margin-bottom: 5px;
  2802. }
  2803. .btn-sty {
  2804. font-size: 16px;
  2805. padding: 10px;
  2806. border: 1px solid #409eff;
  2807. }
  2808. .date-setting{
  2809. width: 210px;
  2810. height: 40px;
  2811. padding: 12px;
  2812. border: 1px solid #DCDFE6;
  2813. border-radius: 4px;
  2814. cursor: pointer;
  2815. font-size: 14px;
  2816. color: #333333;
  2817. }
  2818. }
  2819. .top-right {
  2820. font-size: 16px;
  2821. .join_txt {
  2822. color: #409eff;
  2823. cursor: pointer;
  2824. &:hover {
  2825. text-decoration: underline;
  2826. }
  2827. }
  2828. .collected {
  2829. color: #f00;
  2830. cursor: pointer;
  2831. &:hover {
  2832. text-decoration: underline;
  2833. }
  2834. }
  2835. .span-item {
  2836. color: #409eff;
  2837. cursor: pointer;
  2838. &:hover {
  2839. text-decoration: underline;
  2840. }
  2841. .el-icon-collection,
  2842. .el-icon-document-copy {
  2843. color: #409eff;
  2844. }
  2845. }
  2846. }
  2847. }
  2848. .cont-bottom {
  2849. padding: 20px 30px;
  2850. /* height: calc(100vh - 250px);
  2851. overflow: auto; */
  2852. .el-input__inner {
  2853. height: 27px;
  2854. line-height: 27px;
  2855. padding: 0 4px;
  2856. }
  2857. .el-input-number .el-input__inner {
  2858. padding: 0 34px 0 4px;
  2859. }
  2860. .el-color-picker--mini .el-color-picker__trigger {
  2861. width: 60px;
  2862. height: 25px;
  2863. padding: 0;
  2864. }
  2865. .el-color-picker--mini .el-color-picker__mask {
  2866. width: 60px;
  2867. height: 25px;
  2868. }
  2869. .el-table__expanded-cell {
  2870. padding: 20px 26px;
  2871. }
  2872. .highcharts-range-selector-group {
  2873. display: none;
  2874. .highcharts-input-group {
  2875. display: none;
  2876. }
  2877. }
  2878. .highcharts-axis-title {
  2879. display: block;
  2880. }
  2881. .calendar-cont {
  2882. display: block;
  2883. margin: 10px auto 0;
  2884. text-align: center;
  2885. }
  2886. /* =================== */
  2887. .chart-show-cont {
  2888. padding: 10px 160px 0 120px;
  2889. position: relative;
  2890. .chart-title {
  2891. font-size: 16px;
  2892. font-weight: normal;
  2893. text-align: center;
  2894. margin-bottom: 10px;
  2895. }
  2896. .chart-author {
  2897. font-size: 14px;
  2898. color: #333;
  2899. position: absolute;
  2900. bottom: -20px;
  2901. right: 50px;
  2902. }
  2903. .chartWrapper {
  2904. position: relative;
  2905. .range-cont {
  2906. position: absolute;
  2907. top: 13%;
  2908. .min-data-input {
  2909. width: 60px;
  2910. display: block;
  2911. margin-top: 320px;
  2912. }
  2913. &.left {
  2914. left: -80px;
  2915. }
  2916. &.right {
  2917. right: -65px;
  2918. }
  2919. &.rightTwo {
  2920. right: -130px;
  2921. }
  2922. &.bottom {
  2923. width: 100%;
  2924. display: flex;
  2925. justify-content: space-between;
  2926. top: auto;
  2927. right: 0;
  2928. bottom: -2%;
  2929. .left {
  2930. width: 60px;
  2931. display: block;
  2932. flex-shrink: 0;
  2933. }
  2934. }
  2935. }
  2936. }
  2937. }
  2938. .options-cont {
  2939. display: flex;
  2940. flex-wrap: wrap;
  2941. justify-content: space-between;
  2942. }
  2943. }
  2944. }
  2945. }
  2946. .chartSetting-main{
  2947. display: flex;
  2948. }
  2949. .chartSetting-label-list{
  2950. margin-bottom: 22px;
  2951. }
  2952. }
  2953. .drawImg {
  2954. position: absolute;
  2955. top: -999px;
  2956. z-index: -100;
  2957. }
  2958. }
  2959. }
  2960. </style>
  2961. <style lang="scss">
  2962. .edb-item-style .el-input__icon {
  2963. line-height: 27px;
  2964. }
  2965. </style>