chartSetting.vue 110 KB

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