chartSetting.vue 112 KB

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