chartEditor.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944
  1. <template>
  2. <div class="commodity-chart-editor-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 type="primary" plain @click="$router.back()">{{$t('Dialog.cancel_btn')}}</el-button>
  18. </div>
  19. <div class="left-min">
  20. <div class="search-cont">
  21. <label>{{$t('ToolBox.CommodityPriceChart.select_spot_price')}}</label>
  22. <el-select
  23. v-model="search_txt"
  24. v-loadMore="searchLoad"
  25. ref="searchRef"
  26. :filterable="!search_txt"
  27. remote
  28. clearable
  29. :placeholder="$t('ToolBox.CommodityPriceChart.select_spot_price')"
  30. style="width:90%;margin-top: 10px;display: block;"
  31. :remote-method="searchHandle"
  32. @click.native="inputFocusHandle"
  33. @change="selectTarget($event && searchOptions.find(_ => _.EdbInfoId === $event))"
  34. >
  35. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  36. <el-option
  37. v-for="item in searchOptions"
  38. :key="item.EdbInfoId"
  39. :label="currentLang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName"
  40. :value="item.EdbInfoId"
  41. :disabled="!item.HaveOperaAuth"
  42. >
  43. <div>
  44. <img
  45. :src="$icons.lock_ico2"
  46. width="18"
  47. height="18"
  48. style="vertical-align:middle"
  49. v-if="!item.HaveOperaAuth"
  50. />
  51. {{currentLang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName}}
  52. </div>
  53. </el-option>
  54. </el-select>
  55. </div>
  56. <!-- 盘面利润 -->
  57. <div class="profit-set" v-if="chartInfo.Source===5">
  58. <el-button type="text" @click="openProfitOption">{{$t('ToolBox.CommodityPriceChart.plate_profit_set')}}</el-button>
  59. </div>
  60. <el-form
  61. ref="diaForm"
  62. label-position="top"
  63. label-width="80px"
  64. :model="chartInfo"
  65. :rules="chartRules"
  66. >
  67. <el-form-item :label="$t('ToolBox.CommodityPriceChart.select_future')" prop="futures_id" v-if="chartInfo.Source===2">
  68. <el-cascader
  69. v-model="chartInfo.futures_id"
  70. :options="futuresOptions"
  71. :props="{
  72. label: 'FutureGoodEdbInfoName',
  73. value: 'FutureGoodEdbInfoId',
  74. children: 'Child',
  75. emitPath: false
  76. }"
  77. style="width: 90%"
  78. :placeholder="$t('ToolBox.CommodityPriceChart.please_select_future')"
  79. @change="changeFuturesHandle"
  80. />
  81. </el-form-item>
  82. <el-form-item :label="$t('ToolBox.CommodityPriceChart.chart_name')" :prop="currentLang==='en'?'ChartNameEn':'ChartName'">
  83. <el-input
  84. v-if="currentLang==='en'"
  85. v-model="chartInfo.ChartNameEn"
  86. style="width: 90%"
  87. :placeholder="$t('Dialog.require_vaild')"
  88. clearable
  89. />
  90. <el-input
  91. v-else
  92. v-model="chartInfo.ChartName"
  93. style="width: 90%"
  94. :placeholder="$t('Dialog.require_vaild')"
  95. clearable
  96. />
  97. </el-form-item>
  98. <el-form-item :label="$t('ToolBox.CommodityPriceChart.chart_classify')" prop="classify">
  99. <el-cascader
  100. v-model="chartInfo.classify"
  101. :options="classifyOptions"
  102. :props="{
  103. label: 'ChartClassifyName',
  104. value: 'ChartClassifyId',
  105. children: 'Children',
  106. emitPath: false
  107. }"
  108. style="width: 90%"
  109. :placeholder="$t('ToolBox.CommodityPriceChart.please_select_classify')"
  110. />
  111. </el-form-item>
  112. </el-form>
  113. <div class="targetset-cont">
  114. <!-- 价格曲线日期配置 -->
  115. <bar-option
  116. v-if="!chart_code || (chart_code&&chartInfo.ChartType)"
  117. ref="BarOptRef"
  118. :chartInfo="chartInfo"
  119. :edblist="tableData"
  120. :datedata="commodityChartData"
  121. :initData="initDateOptions"
  122. @getData="getPreviewData"
  123. />
  124. </div>
  125. </div>
  126. <span
  127. class="move-btn resize"
  128. v-drag
  129. id="resize"
  130. ></span>
  131. <span class="slide-icon slide-left" @click="isSlideLeft = !isSlideLeft">
  132. <i class="el-icon-d-arrow-left"></i>
  133. </span>
  134. </div>
  135. <div class="right-cont" id="right" :style="isSlideLeft ? 'width:100%' : `width:80%`">
  136. <div class="chart-min-cont" v-if="tableData.length&&(chartInfo.futures_id||profitInfo.list.length)&&commodityChartData.length">
  137. <div class="cont-bottom">
  138. <div class="chart-show-cont" v-show="options.series">
  139. <div class="chartWrapper" id="chartWrapper">
  140. <h2 class="chart-title" v-show="chartInfo.ChartName">{{ chartInfo.ChartName }}</h2>
  141. <Chart
  142. :options="options"
  143. :chartInfo="chartInfo"
  144. minHeight="440px"
  145. height="500px"
  146. ref="chartRef"
  147. />
  148. <!-- 上下限 -->
  149. <div class="range-cont left">
  150. <el-input
  151. style="width: 60px; display: block"
  152. size="mini"
  153. type="number"
  154. placeholder="上限"
  155. v-model="chartLimit.max"
  156. @change="setCommodityChart"
  157. />
  158. <el-input
  159. class="min-data-input"
  160. size="mini"
  161. type="number"
  162. placeholder="下限"
  163. v-model="chartLimit.min"
  164. @change="setCommodityChart"
  165. />
  166. </div>
  167. </div>
  168. <span class="chart-author"
  169. >{{$t('MsgPrompt.author')}}:{{ chartInfo.SysUserRealName || roleName }}</span
  170. >
  171. </div>
  172. </div>
  173. </div>
  174. <div class="nodata" v-else>
  175. <tableNoData text="暂无信息"/>
  176. </div>
  177. </div>
  178. <!-- 盘面利润设置弹窗 -->
  179. <plateProfitDia
  180. :isShow.sync="isOpenPlateprofitDia"
  181. :options="futuresOptions"
  182. :data="profitInfo"
  183. @ensure="setProfitBack"
  184. />
  185. </div>
  186. </template>
  187. <script>
  188. import { dataBaseInterface } from '@/api/api.js';
  189. import futuresInterface from '@/api/modules/futuresBaseApi';
  190. import { chartSetMixin } from '@/views/dataEntry_manage/mixins/chartPublic';
  191. import Chart from '@/views/dataEntry_manage/components/chart';
  192. import barOption from '@/views/dataEntry_manage/components/barOptionSection.vue';
  193. import plateProfitDia from './components/plateProfitDia.vue';
  194. export default {
  195. components: { Chart,barOption,plateProfitDia },
  196. directives: {
  197. drag(el, bindings) {
  198. el.onmousedown = function (e) {
  199. var init = e.clientX;
  200. // console.log(init);
  201. var box = $('#box')[0];
  202. // console.log(box.clientWidth)
  203. let total_wid = box.offsetWidth;
  204. var left = $('#left')[0];
  205. var right = $('#right')[0];
  206. var initWidth = left.offsetWidth;
  207. document.onmousemove = function (e) {
  208. var end = e.clientX;
  209. var newWidth = end - init + initWidth;
  210. left.style.width = newWidth + 'px';
  211. right.style.width = newWidth > 300 ? total_wid - newWidth + 'px' : total_wid - 320 + 'px';
  212. };
  213. document.onmouseup = function () {
  214. document.onmousemove = document.onmouseup = null;
  215. e.releaseCapture && e.releaseCapture();
  216. };
  217. e.setCapture && e.setCapture();
  218. return false;
  219. };
  220. },
  221. },
  222. computed: {
  223. roleName() {
  224. return localStorage.getItem('userName');
  225. }
  226. },
  227. mixins: [chartSetMixin],
  228. data() {
  229. return {
  230. chart_code: this.$route.query.code || '',
  231. isSlideLeft: false,
  232. search_txt: '',
  233. activeNames:'',
  234. chartInfo: {
  235. ChartName: '',
  236. futures_id: '',
  237. classify: '',
  238. Source: this.$route.query.scence==='profit' ? 5 : 2,
  239. },
  240. chartRules: {
  241. futures_id:[
  242. { required: true, message: this.$t('ToolBox.CommodityPriceChart.tips_msg01')||'暂未选择期货', trigger: 'blur' },
  243. ],
  244. ChartName:[
  245. { required: true, message: this.$t('ToolBox.CommodityPriceChart.tips_msg02')||'图表名称不能为空', trigger: 'blur' },
  246. ],
  247. ChartNameEn:[
  248. { required: true, message: this.$t('ToolBox.CommodityPriceChart.tips_msg02')||'图表名称不能为空', trigger: 'blur' },
  249. ],
  250. classify:[
  251. { required: true, message: this.$t('ToolBox.CommodityPriceChart.tips_msg03')||'图表分类不能为空', trigger: 'blur' },
  252. ],
  253. },
  254. classifyOptions: [],//分类option
  255. futuresOptions: [],//期货种类
  256. initDateOptions: null,
  257. searchOptions: [],
  258. search_have_more: true,
  259. search_page: 1,
  260. current_search:'',
  261. //盘面利润设置
  262. isOpenPlateprofitDia: false,
  263. profitInfo: {
  264. list: [],
  265. formula: ''
  266. }
  267. };
  268. },
  269. methods: {
  270. /* 获取图表详情 */
  271. getChartInfo() {
  272. dataBaseInterface.getChartByCode({
  273. UniqueCode: this.chart_code,
  274. })
  275. .then((res) => {
  276. if (res.Ret !== 200) return;
  277. const { ChartInfo,BarChartInfo,EdbInfoList,DataResp } = res.Data;
  278. this.chartInfo = ChartInfo.Source===5 ? {
  279. ...ChartInfo,
  280. classify: ChartInfo.ChartClassifyId,
  281. ProfitNameEn: DataResp.ProfitNameEn,
  282. ProfitName: DataResp.ProfitName,
  283. } : {
  284. ...ChartInfo,
  285. classify: ChartInfo.ChartClassifyId,
  286. futures_id: BarChartInfo.EdbInfoIdList.find(_ => _.Source===2).EdbInfoId
  287. };
  288. this.search_txt = EdbInfoList[0].EdbInfoId;
  289. this.tableData = [EdbInfoList[0]];
  290. this.searchOptions = this.tableData;
  291. this.initDateOptions = ChartInfo.Source===5 ? {
  292. DateList: DataResp.Extra.DateList,
  293. Sort: {
  294. DateIndex: 0,
  295. Sort: 0
  296. }
  297. } : BarChartInfo;
  298. this.profitInfo = ChartInfo.Source===5 ? {
  299. list: DataResp.Extra.FutureGoodEdbInfoIdList,
  300. formula: DataResp.Extra.CalculateFormula
  301. } : {}
  302. this.initCommodityData(res.Data)
  303. });
  304. },
  305. /* 选择指标 获取指标详情并push到表格中*/
  306. selectTarget(edb) {
  307. if(!edb){
  308. this.tableData = [];
  309. return
  310. }
  311. this.tableData = [edb];
  312. this.commodityChartData.length && this.chartInfo.futures_id && this.$refs.BarOptRef.getBarData();
  313. },
  314. /* 选择期货 */
  315. changeFuturesHandle(val) {
  316. if(!val) return
  317. this.commodityChartData.length && this.tableData.length && this.$refs.BarOptRef.getBarData();
  318. },
  319. /* 获取数据 */
  320. async getPreviewData({sort,dateList}) {
  321. if(!dateList.length) this.commodityChartData = [];
  322. if(!this.tableData.length || !dateList.length) return
  323. this.chartInfo.Source===2
  324. ? await this.getCommodityPreview(dateList)
  325. : await this.getProfitPreview(dateList);
  326. },
  327. /* 价格曲线预览 */
  328. async getCommodityPreview(dateList) {
  329. let params = {
  330. EdbInfoIdList: [
  331. ...this.tableData.map(_ => ({EdbInfoId: _.EdbInfoId,Name:'',Source: 1})),
  332. { EdbInfoId: Number(this.chartInfo.futures_id),Name: '',Source: 2 }
  333. ],
  334. DateList: dateList.map(_ => ({
  335. Type: _.Type,
  336. Date: _.Date,
  337. Value: _.Value,
  338. Name: '',
  339. Color: _.Color
  340. })),
  341. }
  342. const res = await futuresInterface.getChartData(params);
  343. if(res.Ret !== 200) return
  344. const { EdbInfoList,XDataList,YDataList } = res.Data;
  345. this.commodityEdbList = EdbInfoList;
  346. this.commodityChartData = YDataList;
  347. this.commodityXData = XDataList;
  348. //初始状态设置上下限极值
  349. if(!this.chartInfo.LeftMin) {
  350. const value_arr = this.commodityChartData.map(_ => _.Value).flat(Infinity)
  351. this.chartLimit = {
  352. min: Math.min(...value_arr),
  353. max: Math.max(...value_arr)
  354. }
  355. }
  356. this.setCommodityChart();
  357. },
  358. /* 利润曲线预览 */
  359. async getProfitPreview(dateList) {
  360. if(!this.profitInfo.list.length) return this.$message.warning(this.$t('ToolBox.CommodityPriceChart.tips_msg04')||'请先设置盘面利润配置')
  361. const { list,formula } = this.profitInfo;
  362. let params = {
  363. FutureGoodEdbInfoIdList: list,
  364. CalculateFormula: formula,
  365. BaseEdbInfoId: this.tableData[0].EdbInfoId,
  366. DateList: dateList.map(_ => ({
  367. Type: _.Type,
  368. Date: _.Date,
  369. Value: _.Value,
  370. Name: '',
  371. Color: _.Color
  372. })),
  373. }
  374. const res = await futuresInterface.previewProfitData(params);
  375. if(res.Ret !== 200) return
  376. const { XDataList,YDataList,ProfitNameEn,ProfitName } = res.Data.DataResp;
  377. const { EdbInfoList } = res.Data;
  378. this.commodityEdbList = EdbInfoList;
  379. this.commodityChartData = YDataList;
  380. this.commodityXData = XDataList;
  381. this.chartInfo = {
  382. ...this.chartInfo,
  383. ProfitName,
  384. ProfitNameEn
  385. }
  386. //初始状态设置上下限极值
  387. if(!this.chartInfo.LeftMin) {
  388. const value_arr = this.commodityChartData.map(_ => _.Value).flat(Infinity)
  389. this.chartLimit = {
  390. min: Math.min(...value_arr),
  391. max: Math.max(...value_arr)
  392. }
  393. }
  394. this.setCommodityChart();
  395. },
  396. /* 搜索 */
  397. searchHandle(query) {
  398. this.search_page = 1;
  399. this.current_search = query;
  400. this.searchApi(this.current_search)
  401. },
  402. async searchApi(query,page=1) {
  403. let params = {
  404. KeyWord:query,
  405. CurrentIndex: page,
  406. }
  407. const res = await dataBaseInterface.targetSearchByPage(params)
  408. if(res.Ret !== 200) return
  409. const { List,Paging } = res.Data;
  410. this.search_have_more = page < Paging.Pages;
  411. this.searchOptions = page === 1 ? List : this.searchOptions.concat(List);
  412. },
  413. /* 聚焦获取当前检索 */
  414. inputFocusHandle(e) {
  415. this.search_page = 1;
  416. this.current_search = e.target.value;
  417. this.searchApi(this.current_search);
  418. },
  419. searchLoad() {
  420. if(!this.search_have_more) return;
  421. this.searchApi(this.current_search,++this.search_page);
  422. },
  423. /* 获取分类目录结构 */
  424. getMenu() {
  425. futuresInterface.classifyOne().then(res => {
  426. if(res.Ret !== 200) return
  427. this.classifyOptions = res.Data.AllNodes || [];
  428. })
  429. },
  430. /* 获取期货数据分类option */
  431. getFuturesOptions() {
  432. futuresInterface.futuresTargetClassify().then(res => {
  433. if(res.Ret !== 200) return
  434. res.Data = res.Data || [];
  435. this.futuresOptions = res.Data || [];
  436. })
  437. },
  438. reloadRightWid() {
  439. let total_wid = $('#box')[0].offsetWidth;
  440. let left = $('#left')[0].offsetWidth;
  441. let rigtWid = total_wid - left - 20 + 'px';
  442. $('#right')[0].style.width = rigtWid;
  443. },
  444. /* 保存 */
  445. async saveHandle() {
  446. if(!this.tableData.length) return this.$message.warning(this.$t('ToolBox.CommodityPriceChart.tips_msg05')||'暂未选择指标');
  447. await this.$refs.diaForm.validate();
  448. if(!this.$refs.BarOptRef.dateList.length) return this.$message.warning(this.$t('ToolBox.CommodityPriceChart.tips_msg06')||'请添加日期');
  449. let public_param = {
  450. ChartClassifyId: this.chartInfo.classify || 0,
  451. ChartName: this.currentLang==='en'?this.chartInfo.ChartNameEn:this.chartInfo.ChartName,
  452. ChartType:8,
  453. DateType: 6,
  454. }
  455. this.chartInfo.Source === 2 ? this.handleSaveCommodity(public_param) : this.handleSaveProfit(public_param);
  456. },
  457. /* 商品价格曲线保存 */
  458. async handleSaveCommodity(public_param) {
  459. let params = {
  460. ...public_param,
  461. LeftMin: String(this.chartLimit.min),
  462. LeftMax: String(this.chartLimit.max),
  463. BarChartInfo: {
  464. EdbInfoIdList: [
  465. ...this.tableData.map(_ => ({EdbInfoId: _.EdbInfoId,Name:'',Source: 1})),
  466. { EdbInfoId: this.chartInfo.futures_id,Name: '',Source: 2 }
  467. ],
  468. DateList: this.$refs.BarOptRef.dateList.map(item => ({
  469. Type: item.Type,
  470. Date: item.Date,
  471. Value: item.Value,
  472. Name: '',
  473. Color: item.Color
  474. }))
  475. }
  476. }
  477. const { Ret,Data } = this.chart_code
  478. ? await futuresInterface.chartEdit({...params,ChartInfoId: this.chartInfo.ChartInfoId })
  479. : await futuresInterface.chartAdd(params)
  480. if(Ret !== 200) return;
  481. this.setChartImage(Data);
  482. },
  483. /* 利润曲线保存 */
  484. async handleSaveProfit(public_param) {
  485. if(!this.profitInfo.list.length) return this.$message.warning(this.$t('ToolBox.CommodityPriceChart.tips_msg04')||'请先设置盘面利润配置');
  486. const { list,formula } = this.profitInfo;
  487. let params = {
  488. ...public_param,
  489. LeftMin: String(this.chartLimit.min),
  490. LeftMax: String(this.chartLimit.max),
  491. Extra: {
  492. FutureGoodEdbInfoIdList: list,
  493. CalculateFormula: formula,
  494. BaseEdbInfoId: this.tableData[0].EdbInfoId,
  495. DateList: this.$refs.BarOptRef.dateList.map(_ => ({
  496. Type: _.Type,
  497. Date: _.Date,
  498. Value: _.Value,
  499. Name: '',
  500. Color: _.Color
  501. })),
  502. }
  503. }
  504. const { Ret,Data } = this.chart_code
  505. ? await futuresInterface.profitChartEdit({...params,ChartInfoId: this.chartInfo.ChartInfoId })
  506. : await futuresInterface.profitChartAdd(params)
  507. if(Ret !== 200) return;
  508. this.setChartImage(Data);
  509. },
  510. /* 设置图表封面图片 */
  511. setChartImage(data) {
  512. let svg = this.$refs.chartRef.chart.getSVG({
  513. chart: {
  514. width: 340,
  515. height: 230,
  516. }
  517. });
  518. let form = new FormData();
  519. form.append('Img', svg);
  520. this.setImageHandle(form,data);
  521. },
  522. async setImageHandle(form,{ UniqueCode,ChartInfoId }) {
  523. let { Data } = await dataBaseInterface.uploadImgSvg(form);
  524. await dataBaseInterface.setChartImage({
  525. ChartInfoId: ChartInfoId,
  526. ImageUrl: Data.ResourceUrl,
  527. });
  528. this.$message.success(this.chart_code ? this.$t('MsgPrompt.add_msg2')||'添加成功' : this.$t('MsgPrompt.saved_msg')||'保存成功');
  529. this.$router.replace({
  530. path: '/commordityChartBase',
  531. query: {
  532. code: UniqueCode,
  533. id: ChartInfoId
  534. }
  535. })
  536. },
  537. openProfitOption() {
  538. this.isOpenPlateprofitDia = true;
  539. },
  540. /* 盘面利润数据 */
  541. setProfitBack(obj) {
  542. this.profitInfo = obj;
  543. this.tableData.length && this.$refs.BarOptRef.dateList.length && this.getPreviewData({sort:null,dateList:this.$refs.BarOptRef.dateList});
  544. },
  545. },
  546. mounted() {
  547. this.getMenu();
  548. this.getFuturesOptions();
  549. this.chart_code && this.getChartInfo();
  550. window.addEventListener('resize', this.reloadRightWid);
  551. },
  552. destroyed() {
  553. window.removeEventListener('resize', this.reloadRightWid);
  554. },
  555. beforeRouteEnter(to, from, next) {
  556. if(to.query.code){
  557. if(to.query.scence=='price'){
  558. to.matched[1].name='编辑价格曲线'
  559. }else{
  560. to.matched[1].name='编辑利润曲线'
  561. }
  562. }else{
  563. if(to.query.scence=='price'){
  564. to.matched[1].name='添加价格曲线'
  565. }else{
  566. to.matched[1].name='添加利润曲线'
  567. }
  568. }
  569. next()
  570. }
  571. };
  572. </script>
  573. <style lang="scss">
  574. .commodity-chart-editor-container {
  575. $font-small: 12px; $font-normal: 14px;
  576. display: flex;
  577. *{ box-sizing: border-box; }
  578. .el-form--label-top .el-form-item__label {
  579. padding: 0;
  580. }
  581. .el-form-item {
  582. margin-bottom: 8px;
  583. }
  584. .el-input-number .el-input__inner {
  585. padding: 0 34px 0 4px;
  586. }
  587. .target-other-name .el-input__inner {
  588. padding: 0 30px 0 5px !important;
  589. height: 40px !important;
  590. line-height: 40px !important;
  591. }
  592. .el-color-picker--mini .el-color-picker__trigger {
  593. width: 60px;
  594. height: 25px;
  595. padding: 0;
  596. }
  597. .el-color-picker--mini .el-color-picker__mask {
  598. width: 60px;
  599. height: 25px;
  600. }
  601. .slide-icon {
  602. padding: 20px 0;
  603. /* display: block; */
  604. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
  605. border-radius: 5px;
  606. cursor: pointer;
  607. position: absolute;
  608. top: 50%;
  609. transform: translateY(-50%);
  610. z-index: 99;
  611. &:hover {
  612. background-color: rgba(0, 0, 0, 0.05);
  613. }
  614. &.slide-left {
  615. right: 0;
  616. }
  617. &.slide-right {
  618. left: 0;
  619. }
  620. }
  621. .left-cont {
  622. width: 400px;
  623. min-width: 300px;
  624. background: #fff;
  625. margin-right: 20px;
  626. border: 1px solid #ececec;
  627. border-radius: 4px;
  628. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  629. height: calc(100vh - 113px);
  630. overflow: hidden;
  631. position: relative;
  632. box-sizing: border-box;
  633. .left-top {
  634. padding: 15px 20px;
  635. border: 1px solid #ececec;
  636. box-shadow: 0px 3px 6px rgba(167, 167, 167, 0.09);
  637. }
  638. .left-min {
  639. padding: 30px 20px;
  640. max-height: calc(100vh - 194px);
  641. overflow-y: auto;
  642. .search-cont {
  643. color: #606266;
  644. margin-bottom: 10px;
  645. }
  646. .targetset-cont {
  647. padding: 30px 0 20px;
  648. .el-input__inner {
  649. height: 27px;
  650. line-height: 27px;
  651. padding: 0 4px;
  652. }
  653. .el-collapse-item.is-disabled .el-collapse-item__header {
  654. color: #333;
  655. }
  656. .target-list {
  657. border: 1px solid #DCDFE6;
  658. .del-icon {
  659. position: absolute;
  660. right: 10px;
  661. font-size: 16px;
  662. color: #f00;
  663. cursor: pointer;
  664. }
  665. .setting-cont {
  666. padding: 20px 20px 0;
  667. li {
  668. padding-bottom: 20px;
  669. margin-bottom: 20px;
  670. border-bottom: 1px solid #DCDFE6;
  671. &:last-child {
  672. padding-bottom: 0;
  673. margin-bottom: 0;
  674. border-bottom: none;
  675. }
  676. }
  677. }
  678. }
  679. .el-collapse-item__header {
  680. background-color: #F0F2F5;
  681. margin-bottom: 0;
  682. border-bottom: 1px solid #DCDFE6;
  683. padding: 0 30px;
  684. .el-collapse-item__arrow {
  685. position: absolute;
  686. left: 8px;
  687. }
  688. }
  689. .scatter-setting {
  690. display: flex;
  691. margin-bottom: 20px;
  692. }
  693. }
  694. }
  695. .move-btn {
  696. height: 100%;
  697. width: 4px;
  698. position: absolute;
  699. right: 0px;
  700. top: 0;
  701. &:hover {
  702. cursor: col-resize;
  703. }
  704. }
  705. }
  706. .right-cont {
  707. width: 80%;
  708. .mx-datepicker {
  709. width: 220px !important;
  710. }
  711. /* =================== */
  712. .chart-min-cont {
  713. background: #fff;
  714. border: 1px solid #ececec;
  715. height: calc(100vh - 118px);
  716. overflow: auto;
  717. /* overflow: hidden; */
  718. border-radius: 4px;
  719. box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
  720. .cont-top {
  721. padding: 12px 30px;
  722. border-bottom: 1px solid #ececec;
  723. display: flex;
  724. justify-content: space-between;
  725. align-items: center;
  726. box-shadow: 0px 3px 6px rgba(167, 167, 167, 0.09);
  727. .top-left {
  728. .year-btn {
  729. margin-right: 5px;
  730. margin-bottom: 5px;
  731. }
  732. .btn-sty {
  733. border: 1px solid #409eff;
  734. }
  735. }
  736. .top-right {
  737. font-size: 16px;
  738. .join_txt {
  739. color: #409eff;
  740. cursor: pointer;
  741. &:hover {
  742. text-decoration: underline;
  743. }
  744. }
  745. .collected {
  746. color: #f00;
  747. cursor: pointer;
  748. &:hover {
  749. text-decoration: underline;
  750. }
  751. }
  752. .span-item {
  753. color: #409eff;
  754. cursor: pointer;
  755. &:hover {
  756. text-decoration: underline;
  757. }
  758. .el-icon-collection,
  759. .el-icon-document-copy {
  760. color: #409eff;
  761. }
  762. }
  763. }
  764. }
  765. .cont-bottom {
  766. padding: 30px;
  767. /* height: calc(100vh - 250px);
  768. overflow: auto; */
  769. .el-input__inner {
  770. height: 27px;
  771. line-height: 27px;
  772. padding: 0 4px;
  773. }
  774. .el-input-number .el-input__inner {
  775. padding: 0 34px 0 4px;
  776. }
  777. .highcharts-range-selector-group {
  778. display: none;
  779. .highcharts-input-group {
  780. display: none;
  781. }
  782. }
  783. .highcharts-axis-title {
  784. display: block;
  785. }
  786. .calendar-cont {
  787. display: block;
  788. margin: 10px auto 0;
  789. text-align: center;
  790. }
  791. /* =================== */
  792. .chart-show-cont {
  793. min-height: 400px;
  794. padding: 0 150px 20px 120px;
  795. position: relative;
  796. .chart-title {
  797. font-size: 16px;
  798. font-weight: normal;
  799. text-align: center;
  800. margin-bottom: 10px;
  801. }
  802. .chart-author {
  803. font-size: 14px;
  804. color: #333;
  805. position: absolute;
  806. bottom: 20px;
  807. right: 50px;
  808. }
  809. .chartWrapper {
  810. position: relative;
  811. .range-cont {
  812. position: absolute;
  813. top: 15%;
  814. .min-data-input {
  815. width: 60px;
  816. display: block;
  817. }
  818. &.left {
  819. left: -80px;
  820. }
  821. &.right {
  822. right: -65px;
  823. }
  824. &.rightTwo {
  825. right: -130px;
  826. }
  827. }
  828. }
  829. }
  830. .options-cont {
  831. display: flex;
  832. flex-wrap: wrap;
  833. justify-content: space-between;
  834. }
  835. }
  836. }
  837. .nodata {
  838. height: calc(100vh - 120px);
  839. background-color: #fff;
  840. text-align: center;
  841. font-size: 16px;
  842. color: #666;
  843. padding: 100px 0;
  844. }
  845. @media screen and (min-width: 1711px){
  846. .min-data-input {
  847. margin-top: 360px;
  848. }
  849. .btn-sty {
  850. padding: 10px;
  851. }
  852. .year-btn,.btn-sty {
  853. font-size: $font-normal;
  854. }
  855. }
  856. @media screen and (max-width: 1710px){
  857. .min-data-input {
  858. margin-top: 290px;
  859. }
  860. .year-btn {
  861. font-size: $font-small;
  862. margin-left: 5px;
  863. margin-right: 5px;
  864. margin-bottom: 5px;
  865. padding: 6px 12px;
  866. }
  867. .btn-sty {
  868. font-size: $font-small;
  869. margin-left: 5px;
  870. padding: 6px;
  871. border: 1px solid #409eff;
  872. }
  873. }
  874. }
  875. }
  876. </style>
  877. <style lang="scss">
  878. .edb-item-style .el-input__icon {
  879. line-height: 27px;
  880. }
  881. </style>