editChart.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485
  1. <template>
  2. <div class="editchart-container" id="box">
  3. <span
  4. class="slide-icon slide-right"
  5. @click="isSlideLeft = !isSlideLeft"
  6. v-show="isSlideLeft"
  7. >
  8. <i class="el-icon-d-arrow-right"></i>
  9. </span>
  10. <div class="left-cont" v-show="!isSlideLeft" id="left">
  11. <div class="left-top">
  12. <el-button
  13. type="primary"
  14. @click="saveHandle"
  15. :disabled="chartInfo.ChartType === 5 && tableData.length !== 2"
  16. ><!-- 保存 -->{{$t('Dialog.confirm_save_btn')}}</el-button>
  17. <el-button v-permission="permissionBtn.chartLibPermission.chartLib_otherSave"
  18. type="primary" @click="saveChartOtherHandle"><!-- 另存为 -->{{$t('Table.save_as')}}</el-button>
  19. <el-button type="primary" plain @click="$router.replace({
  20. path: '/chartsetting',
  21. query: {
  22. code: chartInfo.UniqueCode,
  23. id: chartInfo.ChartInfoId
  24. }
  25. })"><!-- 取消 -->{{$t('Dialog.cancel_btn')}}</el-button>
  26. </div>
  27. <div class="left-min">
  28. <el-form
  29. ref="diaForm"
  30. label-position="top"
  31. label-width="80px"
  32. :model="chartInfo"
  33. :rules="chartRules"
  34. >
  35. <el-form-item :label="$t('EtaChartAddPage.label_chart_type')" prop="ChartType">
  36. <chartTypeSelect v-model="chartInfo.ChartType" style="width:90%" @change="needWatch=true;"/>
  37. </el-form-item>
  38. <el-form-item :label="$t('EtaChartAddPage.label_chart_theme')" prop="Theme">
  39. <el-select
  40. v-model="chartInfo.ChartThemeId"
  41. placeholder="请选择图表主题"
  42. style="width: 90%"
  43. @change="changeThemeHandle"
  44. >
  45. <el-option
  46. v-for="item in chartThemeArr"
  47. :key="item.ChartThemeId"
  48. :label="item.ChartThemeName"
  49. :value="item.ChartThemeId"
  50. >
  51. </el-option>
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item label="">
  55. <div class="search-cont" v-if="![10,14].includes(chartInfo.ChartType)">
  56. <div>
  57. <label><!-- 选择指标 -->{{$t('Edb.choose_edb')}}:</label>
  58. <el-radio-group v-model="edbFromType">
  59. <el-radio :label="0" style="margin-right: 15px"><!-- ETA指标 -->{{$t('Edb.eta_name')}}</el-radio>
  60. <el-radio :label="1"><!-- ETA预测指标 -->{{$t('Edb.eta_predictor_name')}}</el-radio>
  61. </el-radio-group>
  62. </div>
  63. <el-select
  64. v-model="search_txt"
  65. v-loadMore="searchLoad"
  66. ref="searchRef"
  67. :filterable="!search_txt"
  68. remote
  69. clearable
  70. :placeholder="$t('Edb.InputHolderAll.input_name_orid')"
  71. style="width:90%;margin-top: 10px;display: block;"
  72. :remote-method="searchHandle"
  73. @click.native="inputFocusHandle"
  74. @change="selectTarget($event && searchOptions.find(_ => _.EdbInfoId === $event))"
  75. >
  76. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  77. <el-option
  78. v-for="item in searchOptions"
  79. :key="item.EdbInfoId"
  80. :label="chart_lang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName"
  81. :value="item.EdbInfoId"
  82. :disabled="!item.HaveOperaAuth"
  83. >
  84. <edbDetailPopover :info="item">
  85. <div slot="reference">
  86. <img
  87. :src="$icons.lock_ico2"
  88. width="18"
  89. height="18"
  90. style="vertical-align:middle"
  91. v-if="!item.HaveOperaAuth"
  92. />
  93. {{chart_lang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName }}
  94. </div>
  95. </edbDetailPopover>
  96. </el-option>
  97. </el-select>
  98. </div>
  99. </el-form-item>
  100. <el-form-item :label="$t('Chart.Detail.chart_name')" prop="ChartName">
  101. <el-input
  102. v-model="chartInfo.ChartName"
  103. style="width: 90%"
  104. :placeholder="$t('Dialog.require_vaild')"
  105. clearable
  106. />
  107. </el-form-item>
  108. <!-- 图表别名-->
  109. <el-form-item :label="$t('Chart.Detail.chart_alias')" prop="ChartAlias" v-if="[1,4,5,6,11,14].includes(chartInfo.ChartType)">
  110. <el-input
  111. v-model="chartInfo.ChartAlias"
  112. style="width: 90%"
  113. :placeholder="$t('Chart.InputHolderAll.input_common',{label:$t('Chart.Detail.chart_alias')})"
  114. clearable
  115. />
  116. <el-tooltip effect="dark" placement="right">
  117. <div
  118. slot="content"
  119. style="line-height: 20px;width:300px"
  120. >{{$t('Chart.OptMsg.set_chart_alias')}}</div>
  121. <i class="el-icon-question" style="color: #666" />
  122. </el-tooltip>
  123. </el-form-item>
  124. <el-form-item :label="$t('Chart.Detail.chart_classify')" prop="classify">
  125. <el-cascader
  126. v-model="chartInfo.classify"
  127. :options="classifyOptions"
  128. :props="{
  129. label: currentLang==='en'?'ChartClassifyNameEn':'ChartClassifyName',
  130. value: 'ChartClassifyId',
  131. children: 'Children',
  132. }"
  133. style="width: 90%"
  134. :placeholder="$t('Chart.InputHolderAll.input_classify')"
  135. />
  136. </el-form-item>
  137. <el-form-item :label="$t('Chart.Detail.chart_unit')" prop="Unit" v-if="[7,11].includes(chartInfo.ChartType)">
  138. <el-select
  139. v-model="chartInfo.Unit"
  140. filterable
  141. allow-create
  142. default-first-option
  143. clearable
  144. @change="changeUnit"
  145. :placeholder="$t('Chart.InputHolderAll.input_common',{label:$t('Chart.Detail.chart_unit')})">
  146. <el-option
  147. v-for="item in UnitOptions"
  148. :key="item.label"
  149. :label="item.label"
  150. :value="item.value">
  151. </el-option>
  152. </el-select>
  153. </el-form-item>
  154. </el-form>
  155. <div class="xaxis-range-cont" v-if="chartInfo.ChartType===2 && tableData && tableData.length>0">
  156. <!-- 仅用于季节性图配置 -->
  157. <div style="margin-bottom: 12px;" class="xaxis-range-tip">
  158. {{$t('EtaChartAddPage.label_xserie_range')}}<!-- 横坐标显示范围 -->
  159. <el-tooltip>
  160. <div slot="content" v-html="$t('EtaChartAddPage.xserie_range_tip')">
  161. </div>
  162. <img src="~@/assets/img/icons/question_mark_black.png" style="height: 16px;cursor: pointer;margin-left: 6px;" />
  163. </el-tooltip>
  164. </div>
  165. <el-date-picker
  166. style="width: 45%;"
  167. v-model="SeasonExtraConfig.XStartDate"
  168. value-format="MM-dd"
  169. popper-class="x-range-picker-date"
  170. format="MM-dd"
  171. :placeholder="$t('Common.ph_time_start')"
  172. @change="xAxisChange"
  173. :clearable="false"
  174. ></el-date-picker>
  175. <el-date-picker
  176. style="width: 45%;"
  177. v-model="SeasonExtraConfig.XEndDate"
  178. value-format="MM-dd"
  179. popper-class="x-range-picker-date"
  180. format="MM-dd"
  181. :placeholder="$t('Common.ph_time_end')"
  182. @change="xAxisChange"
  183. :clearable="false"
  184. ></el-date-picker>
  185. <el-checkbox
  186. :label="$t('EtaChartAddPage.label_cross_year')"
  187. v-model="isSpanYear"
  188. :disabled="isSpanYearDisable"
  189. style="margin-top: 12px;"
  190. @change="changeIsSpanYear"
  191. ></el-checkbox>
  192. <br />
  193. <div class="legend-set-text" @click="openLegendEditDia">
  194. <span>{{$t('EtaChartAddPage.label_legend_set')}}<!-- 图例名称设置 --></span>
  195. <img src="~@/assets/img/icons/edit-blue.png" />
  196. </div>
  197. </div>
  198. <div class="targetset-cont">
  199. <!-- 仅用于散点图配置提出 -->
  200. <div class="scatter-setting" v-if="chartInfo.ChartType === 5 && tableData.length">
  201. <div style="display: flex;margin-right: 15px;">
  202. <span style="margin-right: 3px"><!-- 散点颜色: -->{{$t('Chart.Detail.scatter_color')}}:</span>
  203. <el-color-picker
  204. v-model="tableData[0].ChartColor"
  205. size="mini"
  206. show-alpha
  207. :predefine="predefineColors"
  208. ></el-color-picker>
  209. </div>
  210. <el-checkbox v-model="tableData[0].IsOrder"><!-- 逆序 -->{{$t('Chart.Detail.re_order')}}</el-checkbox>
  211. </div>
  212. <el-collapse v-model="activeNames" class="target-list" v-if="tableData.length&&![7,10,11,14].includes(chartInfo.ChartType)">
  213. <el-collapse-item v-for="(item,index) in tableData" :key="item.EdbInfoId" :disabled="[2,5].includes(chartInfo.ChartType)">
  214. <template slot="title">
  215. <span class="text_oneLine">{{currentLang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName}}</span>
  216. <!-- 当为季节性图的第二个轴时,隐藏删除按钮 -->
  217. <i class="el-icon-delete del-icon" @click.stop="delTarget(item)" v-if="!(chartInfo.ChartType===2&&index===1)"></i>
  218. </template>
  219. <ul class="setting-cont">
  220. <!-- 堆叠图 或组合图中的堆叠类型 非第一项隐藏配置 -->
  221. <template v-if="showYOptionsHandle(item,index)">
  222. <li>
  223. <el-checkbox v-model="item.IsOrder"><!-- 逆序 -->{{$t('Chart.Detail.re_order')}}</el-checkbox>
  224. </li>
  225. <li>
  226. <el-radio-group v-model="item.IsAxis" size="mini" @input="isChangeEdbAxis=true">
  227. <el-radio-button :label="1"><!-- 左轴 -->{{$t('Chart.Detail.l_axis')}}</el-radio-button>
  228. <el-radio-button :label="0"><!-- 右轴 -->{{$t('Chart.Detail.r_axis')}}</el-radio-button>
  229. <!-- 指标有右轴时才可以选右2轴 不然没有右2这个概念的意义 -->
  230. <el-radio-button
  231. v-if="[1,6].includes(chartInfo.ChartType)"
  232. :label="2"
  233. :disabled="(tableData.findIndex(_ => _.IsAxis===0) === -1)
  234. || (tableData.findIndex(_ => _.IsAxis===0) === index
  235. && tableData.filter(_ => _.IsAxis===0).length === 1)"
  236. ><!-- 右2轴 -->{{$t('Chart.Detail.rtwo_axis')}}</el-radio-button>
  237. </el-radio-group>
  238. </li>
  239. </template>
  240. <li style="min-width: 250px">
  241. <el-radio
  242. v-model="item.EdbInfoType"
  243. :label="1"
  244. @change="getPreviewSplineInfo"
  245. ><!-- 标准指标 -->{{$t('Chart.Detail.stand_lead')}}</el-radio
  246. >
  247. <div style="margin-top: 15px">
  248. <el-radio
  249. v-model="item.EdbInfoType"
  250. :label="0"
  251. style="margin-right: 10px"
  252. @change="getPreviewSplineInfo"
  253. ><!-- 领先指标 -->{{$t('Chart.Detail.leading_lead')}}</el-radio
  254. >
  255. <template v-if="item.EdbInfoType === 0">
  256. <!-- 领先 -->{{$t('EtaChartAddPage.label_lead')}}
  257. <el-input
  258. style="width: 60px"
  259. size="mini"
  260. type="number"
  261. min="0"
  262. v-model="item.LeadValue"
  263. @change="getPreviewSplineInfo"
  264. @keyup.native="filterCode(item)"
  265. ></el-input>
  266. <el-select
  267. v-model="item.LeadUnit"
  268. placeholder=""
  269. style="width: 60px"
  270. size="mini"
  271. @change="getPreviewSplineInfo"
  272. >
  273. <el-option
  274. v-for="item in fre_options"
  275. :key="item"
  276. :label="item"
  277. :value="item"
  278. >
  279. </el-option>
  280. </el-select>
  281. </template>
  282. </div>
  283. </li>
  284. <li>
  285. <div style="display: flex">
  286. <span style="margin-right: 3px"><!-- 线条颜色 -->{{$t('Chart.Detail.line_color')}}:</span>
  287. <el-color-picker
  288. v-model="item.ChartColor"
  289. size="mini"
  290. show-alpha
  291. :predefine="predefineColors"
  292. ></el-color-picker>
  293. </div>
  294. <div style="display: flex;margin-top: 12px" v-if="item.EdbInfoCategoryType === 1">
  295. <span style="margin-right: 3px"><!-- 预测值颜色 -->{{$t('Chart.Detail.predict_color')}}:</span>
  296. <el-color-picker
  297. v-model="item.PredictChartColor"
  298. size="mini"
  299. show-alpha
  300. :predefine="predefineColors"
  301. ></el-color-picker>
  302. </div>
  303. <div
  304. style="margin-top: 12px"
  305. v-if="chartInfo.ChartType === 1
  306. || (chartInfo.ChartType === 6 &&item.ChartStyle==='spline')"
  307. >
  308. <!-- 线条粗细 -->{{$t('Chart.Detail.line_size')}}:
  309. <el-input
  310. style="width: 60px"
  311. size="mini"
  312. type="number"
  313. :min="1"
  314. v-model="item.ChartWidth"
  315. />
  316. </div>
  317. </li>
  318. <li v-if="chartInfo.ChartType === 6">
  319. <div style="display: flex">
  320. <span style="margin-right: 3px"><!-- 生成样式 -->{{$t('Chart.label_create_sty')}}:</span>
  321. <el-select
  322. v-model="item.ChartStyle"
  323. placeholder="请选择生成样式"
  324. style="width: 50%"
  325. class="edb-item-style"
  326. >
  327. <el-option
  328. v-for="item in chartItemStyleArr"
  329. :key="item.key"
  330. :label="item.label"
  331. :value="item.value"
  332. >
  333. </el-option>
  334. </el-select>
  335. </div>
  336. </li>
  337. </ul>
  338. </el-collapse-item>
  339. </el-collapse>
  340. <!-- 奇怪柱状图配置 -->
  341. <bar-option
  342. v-if="[7,11].includes(chartInfo.ChartType)"
  343. ref="BarOptRef"
  344. :chartInfo="chartInfo"
  345. :edblist="tableData"
  346. :datedata="chartInfo.ChartType===7?barDateList:radarChartData.YDataList"
  347. :initData="chartInfo.ChartType===7?initBarOptions:(chartInfo.ExtraConfig&&JSON.parse(chartInfo.ExtraConfig))"
  348. @getData="barOptionPreviewMap"
  349. />
  350. <!-- 截面散点图 -->
  351. <sectional-scatter-option
  352. v-if="chartInfo.ChartType===10"
  353. ref="SectionScatterOptRef"
  354. :chartInfo="chartInfo"
  355. :initData="chartInfo.ExtraConfig?JSON.parse(chartInfo.ExtraConfig):null"
  356. :edbInfoData="tableData"
  357. :IsNameDefault="IsNameDefault"
  358. @getData="getSectionScatterData"
  359. @modifySeriesName="IsNameDefault = false"
  360. />
  361. <!-- 截面组合图 -->
  362. <sectional-combination-option
  363. ref="sectionalCombinationIns"
  364. v-if="chartInfo.ChartType===14"
  365. :chartInfo="chartInfo"
  366. :defaultData="sectionalCombinationData"
  367. @getData="getSectionalCombination"
  368. @hideChart="tableData=[];"
  369. @updateChart="handleUpdateSectionalCombinationChart"
  370. />
  371. <!-- 标识区 标记线 图表说明 -->
  372. <markersSection
  373. ref="markerSectionRef"
  374. :chartType="chartInfo.ChartType"
  375. :chartInfo="chartInfo"
  376. :tableData="tableData"
  377. @update="setChartMarkerInfo"
  378. @updateSeason="updateSeasonChart"
  379. @previewSeason="previewSeasonChart"
  380. @previewSeasonRight="previewSeasonRight"
  381. />
  382. </div>
  383. </div>
  384. <span
  385. class="move-btn resize"
  386. v-drag
  387. id="resize"
  388. ></span>
  389. <span class="slide-icon slide-left" @click="isSlideLeft = !isSlideLeft">
  390. <i class="el-icon-d-arrow-left"></i>
  391. </span>
  392. </div>
  393. <div class="right-cont" id="right" :style="isSlideLeft ? 'width:100%' : `width:80%`">
  394. <div class="chart-min-cont" v-if="tableData.length">
  395. <div class="cont-top">
  396. <div class="top-left">
  397. <!-- 默认曲线图 -->
  398. <template v-if="sameOptionType.includes(chartInfo.ChartType)">
  399. <el-button
  400. type="primary"
  401. v-for="item in yearSelector"
  402. :key="item.value"
  403. size="medium"
  404. :plain="item.value !== year_select"
  405. class="year-btn"
  406. @click.native="changeYear(item)"
  407. >{{ item.name }}</el-button
  408. >
  409. <el-button type="text" class="btn-sty" @click="openDateDia">{{
  410. dateTip
  411. }}</el-button>
  412. </template>
  413. <!-- 季节性图选择年份区间 -->
  414. <!-- <date-picker
  415. v-else-if="chartInfo.ChartType === 2"
  416. v-model="season_year"
  417. type="month"
  418. value-type="format"
  419. range
  420. placeholder="年份日期选择"
  421. @change="seasonYearChange"
  422. /> -->
  423. <div v-else-if="chartInfo.ChartType === 2" style="padding: 10px 20px;border: 1px solid #eee;border-radius: 8px;cursor: pointer;"
  424. @click="openDateDia">
  425. {{ season_year && season_year.length>0 ? season_year[0]+'~'+season_year[1]:"年份日期选择" }}
  426. </div>
  427. </div>
  428. </div>
  429. <div class="cont-bottom">
  430. <div class="chart-show-cont" v-if="!chartInfo.WarnMsg&&options.series">
  431. <div class="chartWrapper" id="chartWrapper">
  432. <h2
  433. class="chart-title"
  434. v-show="chartInfo.ChartName"
  435. :style="`
  436. textAlign:${JSON.parse(chartInfo.ChartThemeStyle).titleOptions.align};
  437. fontSize:${JSON.parse(chartInfo.ChartThemeStyle).titleOptions.style.fontSize}px;
  438. color:${JSON.parse(chartInfo.ChartThemeStyle).titleOptions.style.color}
  439. `"
  440. >
  441. {{ chartInfo.ChartName }}
  442. </h2>
  443. <Chart :options="options" :chartInfo="chartInfo" ref="chartRef" />
  444. <!-- 需求:曲线图、堆积柱状图、组合图加入新指标时上下限自动调整 -->
  445. <template v-if="![7,10,11].includes(chartInfo.ChartType)">
  446. <div class="range-cont left" v-if="leftIndex !== -1">
  447. <el-input
  448. style="width: 60px; display: block"
  449. size="mini"
  450. type="number"
  451. placeholder="上限"
  452. v-model="chartLimit.max"
  453. @change="changeLimit"
  454. />
  455. <el-input
  456. class="min-data-input"
  457. size="mini"
  458. type="number"
  459. placeholder="下限"
  460. v-model="chartLimit.min"
  461. @change="changeLimit"
  462. />
  463. </div>
  464. <div class="range-cont right" v-if="rightIndex !== -1">
  465. <el-input
  466. style="width: 60px; display: block"
  467. size="mini"
  468. type="number"
  469. placeholder="上限"
  470. v-model="chartLimit.rightMax"
  471. @change="changeLimit"
  472. />
  473. <el-input
  474. class="min-data-input"
  475. size="mini"
  476. type="number"
  477. placeholder="下限"
  478. v-model="chartLimit.rightMin"
  479. @change="changeLimit"
  480. />
  481. </div>
  482. <!-- 右2上下限设置 -->
  483. <div class="range-cont rightTwo" v-if="rightTwoIndex !== -1">
  484. <el-input
  485. style="width: 60px; display: block"
  486. size="mini"
  487. type="number"
  488. placeholder="上限"
  489. v-model="chartLimit.rightTwoMax"
  490. @change="changeLimit"
  491. />
  492. <el-input
  493. class="min-data-input"
  494. size="mini"
  495. type="number"
  496. placeholder="下限"
  497. v-model="chartLimit.rightTwoMin"
  498. @change="changeLimit"
  499. />
  500. </div>
  501. </template>
  502. <!-- 后续新图专用上下限 和其他数据依赖不公用 柱形图 截面散点-->
  503. <template v-if="[7,10,11].includes(chartInfo.ChartType)">
  504. <div class="range-cont left">
  505. <el-input
  506. style="width: 60px; display: block"
  507. size="mini"
  508. type="number"
  509. placeholder="上限"
  510. v-model="chartLimit.max"
  511. @change="changeLimit"
  512. />
  513. <el-input
  514. class="min-data-input"
  515. size="mini"
  516. type="number"
  517. placeholder="下限"
  518. v-model="chartLimit.min"
  519. @change="changeLimit"
  520. />
  521. </div>
  522. <!-- x轴上下限 -->
  523. <div class="range-cont bottom" v-if="chartLimit.x_min||chartLimit.x_max">
  524. <el-input
  525. class="left"
  526. size="mini"
  527. type="number"
  528. placeholder="下限"
  529. v-model="chartLimit.x_min"
  530. @change="changeLimit"
  531. />
  532. <el-input
  533. class="left"
  534. size="mini"
  535. type="number"
  536. placeholder="上限"
  537. v-model="chartLimit.x_max"
  538. @change="changeLimit"
  539. />
  540. </div>
  541. </template>
  542. </div>
  543. <div class="chart-bottom-insruction-info">
  544. <div class="chart-source">
  545. <span
  546. v-if="chartInfo.SourcesFrom"
  547. :style="`
  548. color: ${JSON.parse(chartInfo.SourcesFrom).isShow ? JSON.parse(chartInfo.SourcesFrom).color : '#999'};
  549. fontSize: ${ JSON.parse(chartInfo.SourcesFrom).fontSize }px;
  550. `"
  551. ><!-- 来源 -->{{$t('Chart.Detail.source')}}:{{ JSON.parse(chartInfo.SourcesFrom).text}}</span>
  552. <el-switch
  553. v-if="chartInfo.SourcesFrom"
  554. v-model="chartInfo.SourcesFromVisable"
  555. :active-value="true"
  556. :inactive-value="false"
  557. style="margin:0 15px;"
  558. @change="changeSourceVisable"
  559. />
  560. <span class="editsty" @click="isShowSourceDialog=true"><!-- 编辑 -->{{$t('Chart.chart_edit_btn')}}</span>
  561. </div>
  562. <!-- 是否堆积 -->
  563. <div v-if="showIsHeap">
  564. <span>{{$t('EtaChartAddPage.bar_stacking')}}</span>
  565. <el-tooltip
  566. :content="$t('EtaChartAddPage.stack_tips')"
  567. placement="top"
  568. >
  569. <i class="el-icon-info"></i>
  570. </el-tooltip>
  571. <el-switch
  572. style="margin-left: 20px"
  573. v-model="IsHeap"
  574. @change="handleHeapChange"
  575. >
  576. </el-switch>
  577. </div>
  578. <!-- 公历农历切换 只用于季节性图 -->
  579. <el-radio-group
  580. v-model="calendar_type"
  581. class="calendar-cont"
  582. v-if="chartInfo.ChartType === 2"
  583. @change="getPreviewSplineInfo"
  584. >
  585. <el-radio-button label="公历">{{$t('Chart.calendar_gre')}}</el-radio-button>
  586. <el-radio-button label="农历">{{$t('Chart.calendar_lunar_text')}}</el-radio-button>
  587. </el-radio-group>
  588. <!-- 图表说明 -->
  589. <div
  590. class="chart-instruction"
  591. v-if="chartInfo.Instructions&&JSON.parse(chartInfo.Instructions).isShow"
  592. v-text="JSON.parse(chartInfo.Instructions).text"
  593. :style="`
  594. color: ${JSON.parse(chartInfo.Instructions).color};
  595. fontSize: ${ JSON.parse(chartInfo.Instructions).fontSize }px
  596. `"
  597. ></div>
  598. </div>
  599. <span class="chart-author"><!-- 作者 -->{{$t('Chart.Detail.author')}}:{{ chartInfo.SysUserRealName }}</span>
  600. </div>
  601. <!-- 异常显示 -->
  602. <p class="error-tip" style="min-height: 400px" v-if="chartInfo.WarnMsg">{{chartInfo.WarnMsg}}</p>
  603. <!-- 关联指标 -->
  604. <chartRelationEdbList
  605. :chartInfo="chartInfo"
  606. :tableData="tableData"
  607. :updateData="updateData"
  608. @changeTableData="changeTableData"
  609. @delTarget="delTarget"
  610. @copyCode="copyCode"
  611. @viewTarget="viewTarget"
  612. />
  613. </div>
  614. </div>
  615. <div class="nodata" v-else>
  616. <tableNoData :text="$t('Common.no_info_msg')"/>
  617. </div>
  618. </div>
  619. <!-- 日期端选择弹窗 -->
  620. <DateChooseDia
  621. :isDateDia="isDateDia"
  622. :dateForm="dateForm"
  623. :earliestDate="earliestDate"
  624. @cancel="isDateDia = false"
  625. @dateBack="dataChangeBack"
  626. />
  627. <!-- 季节性 图例设置 -->
  628. <LegendEditDia
  629. :isEditLegend="legendEditDiaShow"
  630. :legendList="SeasonExtraConfig.ChartLegend"
  631. @cancel="legendEditDiaShow = false"
  632. @saveLegend="saveLegend"
  633. />
  634. <!-- 图表另存 -->
  635. <SaveChartOther
  636. :show.sync="isShowSaveOther"
  637. :data="chartInfo"
  638. />
  639. <!-- 数据来源编辑弹窗 -->
  640. <chartSourceEditDia
  641. :isShow.sync="isShowSourceDialog"
  642. :chartInfo="chartInfo"
  643. @update="value => {chartInfo.SourcesFrom=JSON.stringify({...value,isShow:chartInfo.SourcesFromVisable})}"
  644. />
  645. </div>
  646. </template>
  647. <script>
  648. import { dataBaseInterface } from '@/api/api.js';
  649. import { chartSetMixin } from './mixins/chartPublic';
  650. import {unitSelectList} from '@/utils/defaultOptions.js'
  651. import addOrEditMixn from './mixins/addOreditMixin';
  652. import Chart from './components/chart';
  653. import DateChooseDia from './components/DateChooseDia';
  654. import SaveChartOther from './components/SaveChartOther';
  655. import barOption from './components/barOptionSection.vue';
  656. import sectionalScatterOption from './components/sectionalScatterOption.vue';
  657. import LegendEditDia from './components/LegendEditDia.vue';
  658. import markersSection from './components/markersSection.vue';
  659. import chartSourceEditDia from './components/chartSourceEditDialog.vue';
  660. import chartRelationEdbList from './components/chartReleationEdbTable.vue';
  661. import sectionalCombinationOption from './components/sectionalCombination/sectionalCombinationOption.vue';
  662. export default {
  663. components: {
  664. Chart,
  665. DateChooseDia,
  666. SaveChartOther,
  667. barOption,
  668. sectionalScatterOption,
  669. LegendEditDia,
  670. markersSection,
  671. chartSourceEditDia,
  672. chartRelationEdbList,
  673. sectionalCombinationOption
  674. },
  675. directives: {
  676. drag(el, bindings) {
  677. el.onmousedown = function (e) {
  678. var init = e.clientX;
  679. // console.log(init);
  680. var box = $('#box')[0];
  681. // console.log(box.clientWidth)
  682. let total_wid = box.offsetWidth;
  683. var left = $('#left')[0];
  684. var right = $('#right')[0];
  685. var initWidth = left.offsetWidth;
  686. document.onmousemove = function (e) {
  687. var end = e.clientX;
  688. var newWidth = end - init + initWidth;
  689. left.style.width = newWidth + 'px';
  690. right.style.width = newWidth > 300 ? total_wid - newWidth + 'px' : total_wid - 320 + 'px';
  691. };
  692. document.onmouseup = function () {
  693. document.onmousemove = document.onmouseup = null;
  694. e.releaseCapture && e.releaseCapture();
  695. };
  696. e.setCapture && e.setCapture();
  697. return false;
  698. };
  699. },
  700. },
  701. watch: {
  702. tableData: {
  703. handler(newval, oldval) {
  704. if(newval) {
  705. if([7,10,11].includes(this.chartInfo.ChartType)) {
  706. // 奇怪柱形图
  707. this.chartInfo.ChartType === 7 && this.barDateList.length && this.$refs.BarOptRef && this.$refs.BarOptRef.getBarData();
  708. //雷达图
  709. this.chartInfo.ChartType === 11 && this.$refs.BarOptRef && this.$refs.BarOptRef.getBarData();
  710. }else {
  711. //只有当新增指标or切换左右轴时,才更新上下限
  712. if(this.updateLimit){
  713. this.EdbAxisChange()
  714. }
  715. this.setAddChartDefault();
  716. newval.length && !this.chartInfo.WarnMsg && this.setChartOptionHandle(newval);
  717. }
  718. // 设置起始日期和最新日期
  719. this.setExtremumDate()
  720. }
  721. },
  722. deep: true,
  723. },
  724. },
  725. mixins: [chartSetMixin,addOrEditMixn],
  726. computed:{
  727. UnitOptions(){
  728. return unitSelectList()
  729. }
  730. },
  731. data() {
  732. return {
  733. isSlideLeft: false,
  734. search_txt: '',
  735. activeNames: '',
  736. /* right */
  737. calendar_type: '公历',//默认公历
  738. season_year:'',//季节图时间段
  739. initBarOptions: null,//编辑时回显的barOptions数据
  740. needWatch: false,
  741. IsNameDefault:true,
  742. /* UnitOptions:unitArr */
  743. };
  744. },
  745. methods: {
  746. /* 获取图表详情 */
  747. getChartInfo() {
  748. dataBaseInterface
  749. .getChartByCode({
  750. UniqueCode: this.$route.query.code,
  751. })
  752. .then((res) => {
  753. if (res.Ret !== 200) return;
  754. const { ChartInfo,EdbInfoList,BarChartInfo} = res.Data;
  755. const {SeriesList=[]} = ChartInfo.ExtraConfig?JSON.parse(ChartInfo.ExtraConfig):{}
  756. const {IsNameDefault=true} = SeriesList.length?SeriesList[0]:[]
  757. this.IsNameDefault = IsNameDefault
  758. this.chartInfo = {
  759. ...ChartInfo,
  760. ChartName: this.currentLang==='en'?ChartInfo.ChartNameEn:ChartInfo.ChartName,
  761. classify: [ChartInfo.ChartClassify[0].ParentId,...ChartInfo.ChartClassify.map(item => item.ChartClassifyId)],
  762. Unit: ChartInfo.ChartType===7
  763. ? (this.currentLang==='en'?BarChartInfo.UnitEn:BarChartInfo.Unit)
  764. : (this.currentLang==='en'?ChartInfo.UnitEn:ChartInfo.Unit),
  765. SourcesFromVisable: ChartInfo.SourcesFrom ? JSON.parse(ChartInfo.SourcesFrom).isShow : true,
  766. };
  767. //处理下历史默认来源
  768. this.setDefaultSourceFrom();
  769. //初始化标识线/区/图表说明
  770. this.$refs.markerSectionRef.initData(ChartInfo);
  771. //季节性图处理SeasonAverageConfig,SeasonRightEdbConfig
  772. if(this.chartInfo.ChartType===2){
  773. const {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation,RightAxis} = res.Data.DataResp
  774. this.chartInfo.SeasonAverageConfig = {MaxMinLimits,SamePeriodAverage,SamePeriodStandardDeviation}
  775. this.chartInfo.SeasonRightConfig = RightAxis
  776. const tempData = _.cloneDeep(this.chartInfo.SeasonAverageConfig)
  777. tempData.RightAxis = _.cloneDeep(RightAxis)
  778. tempData.RightInfo = _.cloneDeep((RightAxis.EdbInfoList&&RightAxis.EdbInfoList[0])||{})
  779. if(tempData.RightAxis.IndicatorType!==1){
  780. tempData.RightInfo = EdbInfoList[1]||{}
  781. }
  782. delete tempData.MaxMinLimits.List
  783. delete tempData.SamePeriodAverage.List
  784. delete tempData.SamePeriodStandardDeviation.List
  785. delete tempData.RightAxis.EdbInfoList
  786. this.$refs.markerSectionRef.initSeasonData(tempData)
  787. }
  788. this.tableData = EdbInfoList;
  789. this.updateData = this.tableData.map(item=>{
  790. return this.formatUpdateData(item)
  791. })
  792. this.calendar_type = this.chartInfo.Calendar; //日历类型
  793. this.setDefaultPreviewOption() // 设置配置项
  794. this.$nextTick(()=>{
  795. this.setDefaultDateSelect(); //设置默认的日期选中
  796. })
  797. if(this.chartInfo.ChartType === 7) {
  798. //特殊柱形图数据
  799. this.initBarData(res.Data)
  800. this.initBarOptions = BarChartInfo;
  801. }
  802. //截面散点图
  803. this.chartInfo.ChartType === 10 && this.initSectionScatterData(res.Data);
  804. //雷达图
  805. this.chartInfo.ChartType === 11 && this.initRadarData(res.Data);
  806. // 时间序列组合图
  807. if(this.chartInfo.ChartType===6){
  808. this.IsHeap=res.Data.DataResp.IsHeap===1?true:false
  809. }
  810. // 截面组合图
  811. this.chartInfo.ChartType===14&&this.initSectionalCombinationChart(res.Data);
  812. this.getThemeList();
  813. //初始化上下限
  814. this.setLimitData(this.tableData)
  815. });
  816. },
  817. /* 设置默认时间选中项 */
  818. setDefaultDateSelect() {
  819. this.year_select = this.chartInfo.DateType;
  820. this.select_date = [this.chartInfo.StartDate, this.chartInfo.EndDate];
  821. this.count_year = this.chartInfo.StartYear;
  822. // this.calendar_type = this.chartInfo.Calendar; //日历类型
  823. if(this.chartInfo.ChartType==2){
  824. if(this.year_select==20){
  825. let latestYear = parseInt(this.tableData[0].LatestDate.substring(0,4))
  826. this.season_year=[`${latestYear-this.count_year+1}-01-01`,`${latestYear}-12-31`]
  827. }else if(this.year_select==6){
  828. this.season_year = [this.chartInfo.SeasonStartDate,this.tableData[0].LatestDate];
  829. }else{
  830. this.season_year = [this.chartInfo.SeasonStartDate,this.chartInfo.SeasonEndDate]
  831. }
  832. }
  833. this.dateTip =
  834. this.chartInfo.DateType === 5
  835. ? `${this.chartInfo.StartDate}~${this.chartInfo.EndDate}`
  836. : this.chartInfo.DateType === 6
  837. ? /* `${this.chartInfo.StartDate}~至今` */ this.$t('Chart.data_tip_since',{date:this.chartInfo.StartDate})
  838. : this.chartInfo.DateType === 20
  839. ?/* `最近${this.chartInfo.StartYear}年` */ this.$t('Chart.date_tip_count',{year:this.chartInfo.StartYear})
  840. :/* '请选择时间段' */this.$t('Chart.choose_time');
  841. },
  842. // 设置配置项
  843. setDefaultPreviewOption(){
  844. if(this.chartInfo.ChartType==2){
  845. this.count_year = this.chartInfo.StartYear
  846. if(this.chartInfo.SeasonExtraConfig){
  847. this.SeasonExtraConfig = JSON.parse(this.chartInfo.SeasonExtraConfig)
  848. // console.log(this.SeasonExtraConfig);
  849. this.isSpanYear=!!this.SeasonExtraConfig.JumpYear
  850. this.isSpanYearDisable=
  851. !!(new Date(`2023-${this.SeasonExtraConfig.XStartDate}`) > new Date(`2023-${this.SeasonExtraConfig.XEndDate}`) ||
  852. new Date(`2023-${this.SeasonExtraConfig.XStartDate}`) == new Date(`2023-${this.SeasonExtraConfig.XEndDate}`))
  853. }
  854. // 图例名称 需要在DataList中取,SeasonExtraConfig里面的可能是旧的
  855. this.SeasonExtraConfig.ChartLegend=[]
  856. const chartDataHandle = this.calendar_type === "农历"?
  857. this.tableData[0].DataList.filter((item, index) => index > 0):
  858. this.tableData[0].DataList
  859. chartDataHandle.map(item =>{
  860. this.SeasonExtraConfig.ChartLegend.push({Name:item.Years,Value:item.ChartLegend})
  861. })
  862. }
  863. },
  864. /* 保存 */
  865. saveHandle() {
  866. if(!this.tableData.length)
  867. return this.$message.warning(/* '暂未选择指标' */this.$t('ToolBox.CommodityPriceChart.tips_msg05'));
  868. this.$refs.diaForm.validate((valid) => {
  869. if(valid) {
  870. // 季节图只允许添加一个指标
  871. if(this.chartInfo.ChartType === 2 && this.tableData.length > 1) {}
  872. //return this.$message.warning(/* '您选择的图表样式为季节性图表,只支持单指标画图' */this.$t('Chart.OptMsg.season_one_msg'));
  873. if(this.chartInfo.ChartType === 7 && !this.$refs.BarOptRef.dateList.length)
  874. return this.$message.warning(/*'请添加日期'*/this.$t('ToolBox.CommodityPriceChart.tips_msg06'));
  875. if(this.chartInfo.ChartType === 10 && !this.$refs.SectionScatterOptRef.seriesArr[0].edbs)
  876. return this.$message.warning(/* '请添加系列指标' */this.$t('Chart.OptMsg.season_add_hint'));
  877. if(this.chartInfo.ChartType === 2){
  878. if(!(this.SeasonExtraConfig.XStartDate && this.SeasonExtraConfig.XEndDate)){
  879. return this.$message.warning(/* '横坐标显示范围不能为空' */this.$t('Chart.OptMsg.season_area_hint'));
  880. }
  881. }
  882. let db_arr = this.tableData.map(item => ({
  883. ChartColor: item.ChartColor,
  884. PredictChartColor: item.PredictChartColor,
  885. ChartStyle: item.ChartStyle,
  886. ChartWidth: Number(item.ChartWidth),
  887. EdbInfoId: item.EdbInfoId,
  888. EdbAliasName: item.EdbAliasName,
  889. EdbInfoType: item.EdbInfoType,
  890. IsAxis: item.IsAxis,
  891. IsOrder: item.IsOrder,
  892. LeadUnit: item.EdbInfoType ? '' : item.LeadUnit,
  893. LeadValue: item.EdbInfoType ? 0 : Number(item.LeadValue),
  894. MaxData: Number(item.MaxData),
  895. MinData: Number(item.MinData)
  896. })
  897. )
  898. let hasLimitChange = Boolean(this.chartInfo.MinMaxSave)
  899. //需检测上下限是否修改
  900. if(![7,10,11].includes(this.chartInfo.ChartType)&&!this.chartInfo.MinMaxSave){
  901. const limitSame= this.getLimitInfo()
  902. hasLimitChange = !limitSame
  903. }
  904. if(![10,11,14].includes(this.chartInfo.ChartType)){
  905. //每个数据转换需要检测是否合法
  906. for(let i=0;i<db_arr.length;i++){
  907. const {IsConvert,ConvertType,ConvertValue} = this.updateData[i]
  908. //计算方式是否合法
  909. if(IsConvert&&!this.checkConver(ConvertType,ConvertValue)){
  910. //提示语:第${i+1}个指标数据转换不合法,请检查数值
  911. return this.$message.warning(this.$t('EtaChartAddPage.data_transformation_list_hint',{num:i+1}))
  912. }
  913. //如果类型为对数,检测数据是否包含负数
  914. if(IsConvert&&ConvertType===3){
  915. if(!this.checkEdbData(this.tableData[i].DataList)){
  916. //提示语:第${i+1}个指标数据含有负数或0,无法进行对数运算,请检查
  917. return this.$message.warning(this.$t('EtaChartAddPage.data_transformation_list_hint2',{num:i+1}))
  918. }
  919. }
  920. }
  921. db_arr = db_arr.map((item,index)=>{
  922. const {IsConvert,ConvertType,ConvertValue,ConvertUnit,ConvertEnUnit} = this.updateData[index]
  923. return {
  924. ...item,
  925. IsConvert:Number(IsConvert),
  926. ConvertType:IsConvert?ConvertType:1,
  927. ConvertValue:IsConvert?Number(ConvertValue):100,
  928. ConvertUnit:IsConvert?ConvertUnit:'',
  929. ConvertEnUnit:IsConvert?ConvertEnUnit:''
  930. }
  931. })
  932. }
  933. const { ChartType,ChartName,ChartThemeId,SourcesFrom,Instructions,MarkersLines,MarkersAreas,ChartThemeStyle,ChartAlias } = this.chartInfo;
  934. let public_param = {
  935. ChartClassifyId: this.chartInfo.classify.length ? this.chartInfo.classify[this.chartInfo.classify.length - 1] : 0,
  936. ChartInfoId: this.chartInfo.ChartInfoId,
  937. ChartEdbInfoList: db_arr,
  938. ChartName,
  939. ChartType,
  940. ChartThemeId,
  941. SourcesFrom,
  942. Instructions,
  943. MarkersLines,
  944. MarkersAreas,
  945. ChartThemeStyle,
  946. ChartAlias,//别名
  947. }
  948. //提交参数
  949. const typePrams = this.getSaveParamsByChartType(public_param);
  950. let params = this.sameOptionType.includes(this.chartInfo.ChartType)
  951. ? {
  952. ...public_param,
  953. DateType: this.year_select,
  954. StartYear: this.count_year || 0,
  955. StartDate:
  956. [5,6].includes(this.year_select)
  957. ? this.select_date[0]
  958. : '',
  959. EndDate: this.year_select === 5 ? this.select_date[1] : '',
  960. ExtraConfig:JSON.stringify({IsHeap:this.IsHeap?1:0})//时间序列组合图是否堆积控制
  961. }
  962. : typePrams
  963. let svg = this.$refs.chartRef.chart.getSVG({
  964. chart: {
  965. width: 340,
  966. height: 230,
  967. }
  968. });
  969. if(![7,10,11].includes(this.chartInfo.ChartType)){
  970. const {
  971. min,max,rightMin,rightMax,rightTwoMin,rightTwoMax
  972. } = this.chartLimit
  973. params = {
  974. ...params,
  975. LeftMin:min+'',
  976. LeftMax:max+'',
  977. RightMin:rightMin+'',
  978. RightMax:rightMax+'',
  979. Right2Min:rightTwoMin+'',
  980. Right2Max:rightTwoMax+'',
  981. MinMaxSave:Number(hasLimitChange)
  982. }
  983. }
  984. //如果是季节性图,在这里加上同期/右轴的参数
  985. if(this.chartInfo.ChartType===2){
  986. const {SeasonRightConfig={}} = this.chartInfo
  987. const tempData = _.cloneDeep(this.chartInfo.SeasonAverageConfig||{})
  988. const {MaxMinLimits={},SamePeriodAverage={},SamePeriodStandardDeviation={}} = tempData||{}
  989. delete MaxMinLimits.List
  990. delete SamePeriodAverage.List
  991. delete SamePeriodStandardDeviation.List
  992. const tempConfig = _.cloneDeep(SeasonRightConfig)
  993. delete tempConfig.EdbInfoList
  994. params.SeasonExtraConfig = {
  995. ...this.SeasonExtraConfig,
  996. MaxMinLimits:MaxMinLimits.IsAdd?MaxMinLimits:{},
  997. SamePeriodAverage:SamePeriodAverage.IsAdd?SamePeriodAverage:{},
  998. SamePeriodStandardDeviation:SamePeriodStandardDeviation.IsAdd?SamePeriodStandardDeviation:{},
  999. RightAxis:SeasonRightConfig.IsAdd?tempConfig:{}//右轴的具体配置
  1000. }
  1001. }
  1002. dataBaseInterface.chartEdit(params).then(res => {
  1003. if(res.Ret !== 200) return;
  1004. this.$message.success('编辑成功');
  1005. if(this.$route.query.from === 'mychart') {
  1006. window.close();
  1007. }else {
  1008. this.$router.replace({
  1009. path: '/chartsetting',
  1010. query: {
  1011. code: res.Data.UniqueCode,
  1012. id: res.Data.ChartInfoId
  1013. }
  1014. })
  1015. }
  1016. })
  1017. }
  1018. })
  1019. },
  1020. },
  1021. mounted() {
  1022. this.getMenu();
  1023. this.getChartBaseSetting()
  1024. this.getChartInfo();
  1025. this.reloadRightWid();
  1026. window.addEventListener('resize', this.reloadRightWid);
  1027. },
  1028. destroyed() {
  1029. window.removeEventListener('resize', this.reloadRightWid);
  1030. }
  1031. };
  1032. </script>
  1033. <style lang="scss">
  1034. .editchart-container {
  1035. $font-small: 12px; $font-normal: 14px;
  1036. display: flex;
  1037. *{ box-sizing: border-box; }
  1038. .el-form--label-top .el-form-item__label {
  1039. padding: 0;
  1040. }
  1041. .el-form-item {
  1042. margin-bottom: 8px;
  1043. }
  1044. .el-input-number .el-input__inner {
  1045. padding: 0 34px 0 4px;
  1046. }
  1047. .target-other-name .el-input__inner {
  1048. padding: 0 30px 0 5px !important;
  1049. height: 40px !important;
  1050. line-height: 40px !important;
  1051. }
  1052. .el-color-picker--mini .el-color-picker__trigger {
  1053. width: 60px;
  1054. height: 25px;
  1055. padding: 0;
  1056. }
  1057. .el-color-picker--mini .el-color-picker__mask {
  1058. width: 60px;
  1059. height: 25px;
  1060. }
  1061. .slide-icon {
  1062. padding: 20px 0;
  1063. /* display: block; */
  1064. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
  1065. border-radius: 5px;
  1066. cursor: pointer;
  1067. position: absolute;
  1068. top: 50%;
  1069. transform: translateY(-50%);
  1070. z-index: 99;
  1071. &:hover {
  1072. background-color: rgba(0, 0, 0, 0.05);
  1073. }
  1074. &.slide-left {
  1075. right: 0;
  1076. }
  1077. &.slide-right {
  1078. left: 0;
  1079. }
  1080. }
  1081. .left-cont {
  1082. width: 400px;
  1083. min-width: 300px;
  1084. background: #fff;
  1085. margin-right: 20px;
  1086. border: 1px solid #ececec;
  1087. border-radius: 4px;
  1088. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  1089. height: calc(100vh - 113px);
  1090. overflow: hidden;
  1091. position: relative;
  1092. box-sizing: border-box;
  1093. .left-top {
  1094. padding: 15px 20px;
  1095. border: 1px solid #ececec;
  1096. box-shadow: 0px 3px 6px rgba(167, 167, 167, 0.09);
  1097. }
  1098. .left-min {
  1099. padding: 30px 20px;
  1100. max-height: calc(100vh - 194px);
  1101. overflow-y: auto;
  1102. .search-cont {
  1103. color: #606266;
  1104. }
  1105. .xaxis-range-cont{
  1106. color: #606266;
  1107. margin-top: 20px;
  1108. .xaxis-range-tip{
  1109. display: flex;
  1110. align-items: center;
  1111. justify-content: flex-start;
  1112. .hint-message{
  1113. font-size: 15px;
  1114. line-height: 22px;
  1115. }
  1116. }
  1117. .legend-set-text{
  1118. font-size: 15px;
  1119. color: #1B7BDE;
  1120. display: inline-flex;
  1121. align-items: center;
  1122. justify-content: flex-start;
  1123. margin-top: 20px;
  1124. cursor: pointer;
  1125. img{
  1126. height: 16px;
  1127. margin-left: 5px;
  1128. }
  1129. }
  1130. }
  1131. .targetset-cont {
  1132. padding: 30px 0 20px;
  1133. .el-input__inner {
  1134. height: 27px;
  1135. line-height: 27px;
  1136. padding: 0 4px;
  1137. }
  1138. .el-collapse-item.is-disabled .el-collapse-item__header {
  1139. color: #333;
  1140. }
  1141. .target-list {
  1142. border: 1px solid #DCDFE6;
  1143. .del-icon {
  1144. position: absolute;
  1145. right: 10px;
  1146. font-size: 16px;
  1147. color: #f00;
  1148. cursor: pointer;
  1149. }
  1150. .setting-cont {
  1151. padding: 20px 20px 0;
  1152. li {
  1153. padding-bottom: 20px;
  1154. margin-bottom: 20px;
  1155. border-bottom: 1px solid #DCDFE6;
  1156. &:last-child {
  1157. padding-bottom: 0;
  1158. margin-bottom: 0;
  1159. border-bottom: none;
  1160. }
  1161. }
  1162. }
  1163. }
  1164. .el-collapse-item__header {
  1165. background-color: #F0F2F5;
  1166. margin-bottom: 0;
  1167. border-bottom: 1px solid #DCDFE6;
  1168. padding: 0 30px;
  1169. .el-collapse-item__arrow {
  1170. position: absolute;
  1171. left: 8px;
  1172. }
  1173. }
  1174. .scatter-setting {
  1175. display: flex;
  1176. margin-bottom: 20px;
  1177. }
  1178. }
  1179. }
  1180. .move-btn {
  1181. height: 100%;
  1182. width: 4px;
  1183. position: absolute;
  1184. right: 0px;
  1185. top: 0;
  1186. &:hover {
  1187. cursor: col-resize;
  1188. }
  1189. }
  1190. }
  1191. .right-cont {
  1192. width: 80%;
  1193. .mx-datepicker {
  1194. width: 220px !important;
  1195. }
  1196. /* =================== */
  1197. .chart-min-cont {
  1198. background: #fff;
  1199. border: 1px solid #ececec;
  1200. height: calc(100vh - 118px);
  1201. overflow: auto;
  1202. /* overflow: hidden; */
  1203. border-radius: 4px;
  1204. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  1205. .cont-top {
  1206. padding: 12px 30px;
  1207. border-bottom: 1px solid #ececec;
  1208. display: flex;
  1209. justify-content: space-between;
  1210. align-items: center;
  1211. box-shadow: 0px 3px 6px rgba(167, 167, 167, 0.09);
  1212. .top-left {
  1213. .year-btn {
  1214. margin-right: 5px;
  1215. margin-bottom: 5px;
  1216. }
  1217. .btn-sty {
  1218. border: 1px solid #409eff;
  1219. }
  1220. .date-setting{
  1221. border: 1px solid #DCDFE6;
  1222. border-radius: 4px;
  1223. cursor: pointer;
  1224. color: #333333;
  1225. line-height: 16px;
  1226. }
  1227. }
  1228. .top-right {
  1229. font-size: 16px;
  1230. .join_txt {
  1231. color: #409eff;
  1232. cursor: pointer;
  1233. &:hover {
  1234. text-decoration: underline;
  1235. }
  1236. }
  1237. .collected {
  1238. color: #f00;
  1239. cursor: pointer;
  1240. &:hover {
  1241. text-decoration: underline;
  1242. }
  1243. }
  1244. .span-item {
  1245. color: #409eff;
  1246. cursor: pointer;
  1247. &:hover {
  1248. text-decoration: underline;
  1249. }
  1250. .el-icon-collection,
  1251. .el-icon-document-copy {
  1252. color: #409eff;
  1253. }
  1254. }
  1255. }
  1256. }
  1257. .cont-bottom {
  1258. padding: 20px 30px;
  1259. .error-tip{ color: #D03F28; font-size: 16px; margin-bottom: 25px; }
  1260. /* height: calc(100vh - 250px);
  1261. overflow: auto; */
  1262. .el-input__inner {
  1263. height: 27px;
  1264. line-height: 27px;
  1265. padding: 0 4px;
  1266. }
  1267. .el-input-number .el-input__inner {
  1268. padding: 0 34px 0 4px;
  1269. }
  1270. .highcharts-range-selector-group {
  1271. display: none;
  1272. .highcharts-input-group {
  1273. display: none;
  1274. }
  1275. }
  1276. .highcharts-axis-title {
  1277. display: block;
  1278. }
  1279. .calendar-cont {
  1280. display: block;
  1281. margin: 10px auto 0;
  1282. text-align: center;
  1283. }
  1284. /* =================== */
  1285. .chart-show-cont {
  1286. padding: 0 150px 60px 120px;
  1287. position: relative;
  1288. .chart-title {
  1289. font-size: 16px;
  1290. font-weight: normal;
  1291. text-align: center;
  1292. margin-bottom: 10px;
  1293. }
  1294. .chart-author {
  1295. font-size: 14px;
  1296. color: #333;
  1297. position: absolute;
  1298. bottom: 20px;
  1299. right: 50px;
  1300. }
  1301. .chartWrapper {
  1302. position: relative;
  1303. .range-cont {
  1304. position: absolute;
  1305. top: 15%;
  1306. .min-data-input {
  1307. width: 60px;
  1308. display: block;
  1309. }
  1310. &.left {
  1311. left: -80px;
  1312. }
  1313. &.right {
  1314. right: -65px;
  1315. }
  1316. &.rightTwo {
  1317. right: -130px;
  1318. }
  1319. &.bottom {
  1320. width: 100%;
  1321. display: flex;
  1322. justify-content: space-between;
  1323. top: auto;
  1324. right: 0;
  1325. bottom: -2%;
  1326. .left {
  1327. width: 60px;
  1328. display: block;
  1329. flex-shrink: 0;
  1330. }
  1331. }
  1332. }
  1333. }
  1334. }
  1335. .options-cont {
  1336. display: flex;
  1337. flex-wrap: wrap;
  1338. justify-content: space-between;
  1339. }
  1340. }
  1341. }
  1342. .nodata {
  1343. height: calc(100vh - 120px);
  1344. background-color: #fff;
  1345. text-align: center;
  1346. font-size: 16px;
  1347. color: #666;
  1348. padding: 100px 0;
  1349. }
  1350. @media screen and (min-width: 1711px){
  1351. .min-data-input {
  1352. margin-top: 310px;
  1353. }
  1354. .btn-sty {
  1355. padding: 10px;
  1356. }
  1357. .year-btn,.btn-sty {
  1358. font-size: $font-normal;
  1359. }
  1360. .date-setting{
  1361. width: 210px;
  1362. height: 40px;
  1363. padding: 12px;
  1364. font-size: $font-normal;
  1365. }
  1366. }
  1367. @media screen and (max-width: 1710px){
  1368. .min-data-input {
  1369. margin-top: 230px;
  1370. }
  1371. .year-btn {
  1372. font-size: $font-small;
  1373. margin-left: 5px;
  1374. margin-right: 5px;
  1375. margin-bottom: 5px;
  1376. padding: 6px 12px;
  1377. }
  1378. .btn-sty {
  1379. font-size: $font-small;
  1380. margin-left: 5px;
  1381. padding: 6px;
  1382. border: 1px solid #409eff;
  1383. }
  1384. .date-setting{
  1385. width: 180px;
  1386. height: 36px;
  1387. padding: 10px;
  1388. font-size: $font-small;
  1389. }
  1390. }
  1391. }
  1392. .expand-wrap{
  1393. display: flex;
  1394. justify-content: center;
  1395. align-items: center;
  1396. gap:30px;
  1397. .el-checkbox{
  1398. margin-right: 15px;
  1399. }
  1400. .el-input{
  1401. width:100px;
  1402. height:27px;
  1403. line-height: 27px;
  1404. .el-input__icon{
  1405. line-height: 27px;
  1406. }
  1407. }
  1408. }
  1409. }
  1410. </style>
  1411. <style lang="scss">
  1412. .edb-item-style .el-input__icon {
  1413. line-height: 27px;
  1414. }
  1415. /*他不要下拉选择框 QAQ */
  1416. .x-range-picker-date {
  1417. display: none;
  1418. }
  1419. </style>