chartSetting.vue 111 KB

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