allBusinessCon.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479
  1. <template>
  2. <div style="padding:16px;">
  3. <el-row :gutter="10" class="mb8" style="display: flex;align-items: center;">
  4. <el-col :span="5">
  5. <div class="flex">
  6. <span class="seach-title">涉及的服务</span>
  7. <el-select v-model="queryParams.service_name" style="width: 70%" size="small" clearable @change="handChange" @clear="handleQuery">
  8. <el-option
  9. v-for="item in serviceList"
  10. :key="item.id"
  11. :label="item.name"
  12. :value="item.service_name"
  13. />
  14. </el-select>
  15. </div>
  16. </el-col>
  17. <el-col :span="5">
  18. <div class="flex">
  19. <span class="seach-title">延迟范围 >=</span>
  20. <el-input v-model="queryParams.duration" style="width: 70%" size="small" clearable placeholder="请输入延迟范围" @keyup.enter.native="handleQuery" @clear="handleQuery" />
  21. </div>
  22. </el-col>
  23. <el-col :span="5">
  24. <div class="flex">
  25. <span class="seach-title">错误率 >=</span>
  26. <el-input v-model="queryParams.error_rate" style="width: 70%" size="small" clearable placeholder="请输入0-1之间的小数" @keyup.enter.native="handleQuery" @clear="handleQuery" />
  27. <!-- <el-input-number size="small" controls-position="right" style="width: 70%" v-model="queryParams.error_rate" :step="0.1" :min="0" :max="1" clearable placeholder="请输入0-1之间的小数" @keyup.enter.native="handleQuery" ></el-input-number> -->
  28. </div>
  29. </el-col>
  30. <el-col :span="5">
  31. <div class="flex">
  32. <span class="seach-title">请求量 >=</span>
  33. <el-input v-model="queryParams.request_total" style="width: 70%" size="small" clearable placeholder="请输入请求量" @keyup.enter.native="handleQuery" @clear="handleQuery" />
  34. </div>
  35. </el-col>
  36. <el-col :span="4">
  37. <el-checkbox v-model="queryParams.access_database" @change="handleQuery">涉及数据库</el-checkbox>
  38. <el-checkbox v-model="queryParams.favor" @change="handleQuery">仅收藏</el-checkbox>
  39. </el-col>
  40. </el-row>
  41. <el-row :gutter="10" class="mb8 flex" style="margin-bottom: 10px;">
  42. <el-col :span="2">
  43. <div class="flex">
  44. <el-dropdown
  45. style="margin-left: 10px"
  46. size="mini"
  47. trigger="click"
  48. placement="bottom"
  49. >
  50. <el-button type="primary" size="mini">
  51. <!-- 下拉菜单 -->
  52. <i class="el-icon-s-grid" />
  53. <i class="el-icon-arrow-down" />
  54. </el-button>
  55. <el-dropdown-menu slot="dropdown">
  56. <el-checkbox-group
  57. v-model="colSelect"
  58. style="text-align: left"
  59. @change="columnChange"
  60. >
  61. <el-dropdown-item
  62. v-for="(item, index) in colData"
  63. :key="index"
  64. ><el-checkbox :label="item.title">{{
  65. item.title
  66. }}</el-checkbox></el-dropdown-item>
  67. </el-checkbox-group>
  68. </el-dropdown-menu>
  69. </el-dropdown>
  70. </div>
  71. </el-col>
  72. </el-row>
  73. <div class="TableBox">
  74. <el-table
  75. ref="tableRef"
  76. :key="isUpdate"
  77. v-loading="loading"
  78. :data="serveceMapList"
  79. @row-click="handleRowClick"
  80. @sort-change="handleSortChang"
  81. >
  82. <el-table-column v-if="colData[0].istrue" align="center" header-align="center" class-name="column_one" label="业务名" prop="name" :show-overflow-tooltip="true" />
  83. <el-table-column v-if="colData[4].istrue" header-align="center" align="center" label="请求总数" sortable prop="request_total" :show-overflow-tooltip="true">
  84. <template slot-scope="scope">
  85. <div :class="scope.row.request_total!=0&&scope.row.request_total!= undefined?'table_bg':'table_bg_yellow'">
  86. <div class="table-num-box">
  87. {{ scope.row.request_total== undefined?0:Number(scope.row.request_total).toFixed(2) }}
  88. </div>
  89. <div class="table-day-rate-box">
  90. <i v-show="processNumber(scope.row.request_total_dod).sign" :class="processNumber(scope.row.request_total_dod).sign == 'up'? 'el-icon-up up':'el-icon-down down'" />
  91. <span>
  92. {{ scope.row.request_total_dod==undefined?0:getErrRate(processNumber(scope.row.request_total_dod).value) }}
  93. </span>
  94. </div>
  95. </div>
  96. </template>
  97. </el-table-column>
  98. <el-table-column v-if="colData[1].istrue" header-align="center" align="center" label="调用占比" prop="request_rate" :show-overflow-tooltip="true">
  99. <template slot-scope="scope">
  100. <div class="table_bg">
  101. <div class="table-num-box">
  102. {{ getErrRate(scope.row.request_rate) }}
  103. </div>
  104. <div class="table-day-rate-box">
  105. <i v-show="processNumber(scope.row.request_rate_dod).sign" :class="processNumber(scope.row.request_rate_dod).sign == 'up'? 'el-icon-up up':'el-icon-down down'" />
  106. <span>
  107. {{ scope.row.request_rate_dod==undefined?0:getErrRate(processNumber(scope.row.request_rate_dod).value) }}
  108. </span>
  109. </div>
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column v-if="colData[2].istrue" header-align="center" align="center" label="SpanName" prop="span_name" :show-overflow-tooltip="true">
  114. <template slot-scope="scope">
  115. <span>{{ scope.row.span_name }}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column v-if="colData[3].istrue" header-align="center" align="center" label="rpm" sortable prop="rpm" :show-overflow-tooltip="true">
  119. <template slot-scope="scope">
  120. <div class="table_bg">
  121. {{ scope.row.rpm == undefined?0:Number(scope.row.rpm).toFixed(2) }}
  122. </div>
  123. </template>
  124. </el-table-column>
  125. <el-table-column v-if="colData[5].istrue" header-align="center" align="center" label="错误率" sortable prop="error_rate" :show-overflow-tooltip="true">
  126. <template slot-scope="scope">
  127. <div :class="scope.row.error_rate==0?'table_bg':'table_bg_red'">
  128. <div class="table-num-box">
  129. {{ getErrRate(scope.row.error_rate) }}
  130. </div>
  131. <div class="table-day-rate-box">
  132. <i v-show="processNumber(scope.row.error_rate_dod).sign" :class="processNumber(scope.row.error_rate_dod).sign == 'up'? 'el-icon-up up':'el-icon-down down'" />
  133. <span>
  134. {{ scope.row.error_rate_dod==undefined?0:getErrRate(processNumber(scope.row.error_rate_dod).value) }}
  135. </span>
  136. </div>
  137. </div>
  138. </template>
  139. </el-table-column>
  140. <el-table-column v-if="colData[6].istrue" header-align="center" align="center" label="最大延迟(ms)" sortable prop="max" :show-overflow-tooltip="true">
  141. <template slot-scope="scope">
  142. <div :class="scope.row.duration_max<2000?'table_bg':'table_bg_red'">
  143. <div class="table-num-box">
  144. {{ scope.row.duration_max==undefined?0:Number(scope.row.duration_max).toFixed(2) }}
  145. </div>
  146. <div class="table-day-rate-box">
  147. <i v-show="processNumber(scope.row.duration_max_dod).sign" :class="processNumber(scope.row.duration_max_dod).sign == 'up'? 'el-icon-up up':'el-icon-down down'" />
  148. <span>
  149. {{ scope.row.duration_max_dod==undefined?0:getErrRate(processNumber(scope.row.duration_max_dod).value) }}
  150. </span>
  151. </div>
  152. </div>
  153. </template>
  154. </el-table-column>
  155. <el-table-column v-if="colData[7].istrue" header-align="center" align="center" label="平均延迟(ms)" sortable prop="duration_average" :show-overflow-tooltip="true">
  156. <template slot-scope="scope">
  157. <div :class="scope.row.duration_average<2000?'table_bg':'table_bg_red'">
  158. <div class="table-num-box">
  159. {{ scope.row.duration_average==undefined?0:Number(scope.row.duration_average).toFixed(2) }}
  160. </div>
  161. <div class="table-day-rate-box">
  162. <i v-show="processNumber(scope.row.duration_average_dod).sign" :class="processNumber(scope.row.duration_average_dod).sign == 'up'? 'el-icon-up up':'el-icon-down down'" />
  163. <span>
  164. {{ scope.row.duration_average_dod==undefined?0:getErrRate(processNumber(scope.row.duration_average_dod).value) }}
  165. </span>
  166. </div>
  167. </div>
  168. </template>
  169. </el-table-column>
  170. <el-table-column v-if="colData[8].istrue" header-align="center" align="center" label="中位延迟" prop="duration_median" width="200">
  171. <template slot-scope="scope">
  172. <div :class="scope.row.duration_median<2000?'table_bg':'table_bg_red'" style="display:flex;">
  173. <div>
  174. <div class="table-num-box">
  175. {{ scope.row.duration_median==undefined?0:Number(scope.row.duration_median).toFixed(2) }}
  176. </div>
  177. <div class="table-day-rate-box">
  178. <i v-show="processNumber(scope.row.duration_median_dod).sign" :class="processNumber(scope.row.duration_median_dod).sign == 'up'? 'el-icon-up up':'el-icon-down down'" />
  179. <span>
  180. {{ scope.row.duration_median_dod==undefined?0:getErrRate(processNumber(scope.row.duration_median_dod).value) }}
  181. </span>
  182. </div>
  183. </div>
  184. <span v-if="scope.row.quantiles!=undefined" style="display:flex;">
  185. {{ drawEchartsp5(scope.row, scope.$index, 'five') }}
  186. <div :id="`allBussiness-five-trend-index` + scope.$index" style="flex:1;padding-left:10px; height: 40px;width: 120px; max-width: 200px;" class="tiger-trend-charts" />
  187. </span>
  188. </div>
  189. </template>
  190. </el-table-column>
  191. <el-table-column v-if="colData[9].istrue" header-align="center" align="center" label="90分位延迟" prop="duration_p90" width="200">
  192. <template slot-scope="scope">
  193. <div :class="scope.row.duration_p90<2000?'table_bg':'table_bg_red'" style="display:flex;">
  194. <div>
  195. <div class="table-num-box">
  196. {{ scope.row.duration_p90==undefined?0:Number(scope.row.duration_p90).toFixed(2) }}
  197. </div>
  198. <div class="table-day-rate-box">
  199. <i v-show="processNumber(scope.row.duration_p90_dod).sign" :class="processNumber(scope.row.duration_p90_dod).sign == 'up'? 'el-icon-up up':'el-icon-down down'" />
  200. <span>
  201. {{ scope.row.duration_p90_dod==undefined?0:getErrRate(processNumber(scope.row.duration_p90_dod).value) }}
  202. </span>
  203. </div>
  204. </div>
  205. <span v-if="scope.row.quantiles!=undefined" style="display:flex;">
  206. {{ drawEchartsp90(scope.row, scope.$index, 'nine') }}
  207. <div :id="`allBussiness-nine-trend-index` + scope.$index" style="flex:1;padding-left:10px" class="tiger-trend-charts" />
  208. </span>
  209. </div>
  210. </template>
  211. </el-table-column>
  212. <el-table-column v-if="colData[10].istrue" header-align="center" align="center" label="99分位延迟" prop="duration_p99" width="200">
  213. <template slot-scope="scope">
  214. <div :class="scope.row.duration_p99<2000?'table_bg':'table_bg_red'" style="display:flex;">
  215. <div>
  216. <div class="table-num-box">
  217. {{ scope.row.duration_p99==undefined?0:Number(scope.row.duration_p99).toFixed(2) }}
  218. </div>
  219. <div class="table-day-rate-box">
  220. <i v-show="processNumber(scope.row.duration_p99_dod).sign" :class="processNumber(scope.row.duration_p99_dod).sign == 'up'? 'el-icon-up up':'el-icon-down down'" />
  221. <span>
  222. {{ scope.row.duration_p99_dod==undefined?0:getErrRate(processNumber(scope.row.duration_p99_dod).value) }}
  223. </span>
  224. </div>
  225. </div>
  226. <span v-if="scope.row.quantiles!=undefined" style="display:flex;">
  227. {{ drawEchartsp99(scope.row, scope.$index, 'hundred') }}
  228. <div :id="`allBussiness-hundred-trend-index` + scope.$index" style="flex:1;padding-left:10px" class="tiger-trend-charts" />
  229. </span>
  230. </div>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. label="操作"
  235. align="center"
  236. class-name="small-padding fixed-width"
  237. width="160"
  238. >
  239. <template slot-scope="scope">
  240. <el-button
  241. size="mini"
  242. type="text"
  243. icon="el-icon-edit"
  244. @click.native.stop="handleUpdate(scope.row)"
  245. >标注</el-button>
  246. <el-button
  247. v-if="scope.row.favor == 0"
  248. size="mini"
  249. type="text"
  250. icon="el-icon-star-off"
  251. @click.native.stop="handleFavor(scope.row)"
  252. />
  253. <el-button
  254. v-if="scope.row.favor == 1"
  255. size="mini"
  256. type="text"
  257. icon="el-icon-star-on"
  258. @click.native.stop="handleFavor(scope.row)"
  259. />
  260. <el-button
  261. style="color:#F56C6C"
  262. size="mini"
  263. type="text"
  264. icon="el-icon-delete"
  265. @click.native.stop="handleDelete(scope.row)"
  266. >删除</el-button>
  267. </template>
  268. </el-table-column>
  269. </el-table>
  270. </div>
  271. <pagination
  272. v-show="tableCount>0"
  273. :total="tableCount"
  274. :page.sync="queryParams.page_num"
  275. :limit.sync="queryParams.page_size"
  276. @pagination="getList"
  277. />
  278. <!-- 添加或修改应用配置对话框 -->
  279. <el-dialog v-if="open" :title="title" :visible.sync="open" width="700px" :center="true" :close-on-click-modal="false">
  280. <el-form ref="form" :model="form" :rules="rules" label-width="95px">
  281. <el-form-item label="中文别名" prop="name">
  282. <el-input v-model="form.name" placeholder="请输入中文别名" />
  283. </el-form-item>
  284. </el-form>
  285. <div slot="footer" class="dialog-footer">
  286. <el-button type="primary" @click="submitForm">确 定</el-button>
  287. <el-button @click="cancel">取 消</el-button>
  288. </div>
  289. </el-dialog>
  290. <!-- 业务空间 -->
  291. <ServiceSpaceDrawer v-if="isShowServiceSpaceDrawer" :is-opendrawer="isShowServiceSpaceDrawer" :bussiness-id="currentBussinessId" :bussiness-name="currentBussinessName" @handleClose="handleClose" />
  292. </div>
  293. </template>
  294. <script>
  295. import ServiceSpaceDrawer from './ServiceSpaceDrawer.vue'
  296. import { addUrlMapping, getNewBusinessList, listBizStats, listBizGraph, updateBiz, delBiz, favorBiz } from '@/api/mapping'
  297. import { formatJson } from '@/utils'
  298. import storage from '@/utils/storage'
  299. // import bus from '@/utils/bus'
  300. import { listService } from '@/api/service'
  301. import { getToken } from '@/utils/auth'
  302. import resize from '../../mixins/resize'
  303. import BigNumber from 'bignumber.js'
  304. export default {
  305. name: 'allBusinessCon',
  306. components: {
  307. ServiceSpaceDrawer
  308. },
  309. mixins: [resize],
  310. data() {
  311. return {
  312. loading: false,
  313. // 设置选中的列的复选框
  314. colSelect: [
  315. '业务名',
  316. '调用占比',
  317. // "SpanName",
  318. // "rpm",
  319. '请求总数',
  320. '错误率',
  321. // '最大延迟(ms)',
  322. // "延迟比例",
  323. '中位延迟'
  324. // '90分位延迟',
  325. // '99分位延迟'
  326. ],
  327. colData: [
  328. { title: '业务名', istrue: false },
  329. { title: '调用占比', istrue: false },
  330. { title: 'SpanName', istrue: false },
  331. { title: 'rpm', istrue: false },
  332. { title: '请求总数', istrue: false },
  333. { title: '错误率', istrue: false },
  334. { title: '最大延迟(ms)', istrue: false },
  335. { title: '平均延迟(ms)', istrue: false },
  336. { title: '中位延迟', istrue: false },
  337. { title: '90分位延迟', istrue: false },
  338. { title: '99分位延迟', istrue: false }
  339. ],
  340. isUpdate: false,
  341. isflag: false,
  342. tableflag: false,
  343. isShowServiceSpaceDrawer: false,
  344. topflag: false,
  345. detailData: {},
  346. drawerDetail: false,
  347. tableLoading: false,
  348. // 表格高度
  349. tableHeight: '',
  350. // 数据总数
  351. tableCount: 0,
  352. serveceMapList: [],
  353. // 应用数据列表
  354. appData: [],
  355. // 遮罩层
  356. // 选中数组
  357. ids: [],
  358. // 非单个禁用
  359. single: true,
  360. // 非多个禁用
  361. multiple: true,
  362. // 总条数
  363. total: 0,
  364. menuIdsChecked: [],
  365. // 弹出层标题
  366. title: '',
  367. // 是否显示弹出层
  368. open: false,
  369. isEdit: false,
  370. // 日期范围
  371. dateRange: [],
  372. // 查询参数
  373. queryParams: {
  374. app_alias: '', // 应用别名
  375. service_name: null, // 服务名称
  376. duration: '', // 最小延迟
  377. error_rate: '', // 最小错误率
  378. request_total: '', // 最低请求量
  379. node_num: '', // 最小节点数量
  380. access_database: '', // 是否涉及数据库
  381. favor: '', // 是否收藏
  382. sort_field: 'request_total', // 支持 request_total(请求总数,调用占比)、error_rate(错误率)、duration_median(中位延迟)
  383. sort_type: 'desc',
  384. page_num: 1, // 当前页码
  385. page_size: 10// 每页条数
  386. },
  387. // 表单参数
  388. form: {
  389. },
  390. // 表单校验
  391. rules: {
  392. name: [
  393. { required: true, message: '接口名称不能为空', trigger: 'blur' }
  394. ],
  395. url: [
  396. { required: true, message: 'URL组不能为空', trigger: 'blur' }
  397. ]
  398. },
  399. appsAction: process.env.VUE_APP_BASE_API + '/api/v1/public/uploadFile',
  400. appsfileList: [],
  401. headers: { 'Authorization': 'Bearer ' + getToken() },
  402. appsItem: {},
  403. expands: [],
  404. serviceList: [],
  405. rowData: [],
  406. serviceMapTimer: null,
  407. BizStatsQuery: {
  408. biz_id: 0,
  409. start_time: '',
  410. end_time: ''
  411. },
  412. tempList: [],
  413. graphData: {},
  414. graphStatsQuery: {
  415. biz_node_id: 0, // 仅支持传递单个节点,多个节点需要并发请求分别调用
  416. end_time: 1702972800,
  417. start_time: 1702969200
  418. },
  419. serviceParams: {
  420. app_id: '',
  421. start_time: '',
  422. end_time: '',
  423. pageIndex: 1,
  424. pageSize: 200
  425. },
  426. graphObj: [],
  427. detailTitle: '',
  428. detailObj: {},
  429. myChartList: [],
  430. myChartboxList: [],
  431. myChartBox2List: [],
  432. currentBussinessId: '', // 当前点击业务id
  433. currentBussinessName: '相关业务'// 当前点击业务名字
  434. }
  435. },
  436. watch: {
  437. '$store.state.time.globalTimes': {
  438. handler(newValue, oldValue) {
  439. if (newValue) {
  440. this.serviceParams.start_time = newValue.startTime
  441. this.serviceParams.end_time = newValue.endTime
  442. this.serviceParams.pageIndex = 1
  443. this.queryParams.start_time = newValue.startTime
  444. this.queryParams.end_time = newValue.endTime
  445. this.BizStatsQuery.start_time = newValue.startTime
  446. this.BizStatsQuery.end_time = newValue.endTime
  447. this.graphStatsQuery.start_time = newValue.startTime
  448. this.graphStatsQuery.end_time = newValue.endTime
  449. this.queryParams.page_num = 1
  450. this.serveceMapList = []
  451. this.getServiceList() // 获取服务列表select
  452. this.getList()
  453. if (newValue.timeOut) {
  454. if (newValue.timeOut == 1) {
  455. clearInterval(this.serviceMapTimer)
  456. } else {
  457. clearInterval(this.serviceMapTimer)
  458. this.Refresh(newValue.timeOut)
  459. }
  460. }
  461. }
  462. },
  463. // immediate: true,
  464. deep: true
  465. },
  466. serveceMapList: {
  467. handler(newVal, oldVal) {
  468. if (newVal) {
  469. this.serveceMapList = newVal
  470. this.tableflag = true
  471. }
  472. },
  473. // immediate: true,
  474. deep: true
  475. }
  476. },
  477. created() {
  478. this.columnChange()
  479. this.$store.commit('time/setTimeFlag', false)
  480. const start_time = this.$store.state.time.globalTimes.startTime
  481. const end_time = this.$store.state.time.globalTimes.endTime
  482. this.serviceParams.start_time = start_time
  483. this.serviceParams.end_time = end_time
  484. this.BizStatsQuery.start_time = start_time
  485. this.BizStatsQuery.end_time = end_time
  486. this.appItem = storage.get('appsItem')
  487. if (JSON.stringify(this.appItem) != '{}') {
  488. this.appItem = storage.get('appsItem')
  489. this.queryParams.app_alias = this.appItem.alias
  490. this.serviceParams.app_id = this.appItem.id
  491. this.getList()
  492. }
  493. this.getServiceList() // 获取服务列表select
  494. this.$forceUpdate()
  495. },
  496. mounted() {
  497. this.$forceUpdate()
  498. },
  499. beforeDestroy() {
  500. clearInterval(this.serviceMapTimer)
  501. this.disposeEcharts(this.myChartList)
  502. this.disposeEcharts(this.myChartboxList)
  503. this.disposeEcharts(this.myChartBox2List)
  504. },
  505. methods: {
  506. // 获取该业务的服务list
  507. getServiceList() {
  508. listService(this.serviceParams).then(res => {
  509. if (res.code === 200) {
  510. this.serviceList = res.data.list
  511. }
  512. })
  513. },
  514. // 判断数字是正是负还是零并给出标识
  515. processNumber(num) {
  516. const result = {
  517. value: num,
  518. sign: ''
  519. }
  520. if (num > 0) {
  521. result.sign = 'up'
  522. } else if (num < 0) {
  523. result.value = Math.abs(num) // 返回绝对值
  524. result.sign = 'down'
  525. } else {
  526. result.sign = ''
  527. }
  528. return result
  529. },
  530. getErrRate(error_rate) {
  531. const strErrorRate = numToString(error_rate)
  532. let length = 0
  533. if (strErrorRate !== '0') {
  534. const arr = strErrorRate.split('.')
  535. if (arr.length > 1) {
  536. length = strErrorRate.split('.')[1].length
  537. }
  538. }
  539. if (error_rate == 0) {
  540. return error_rate
  541. } else if (error_rate == 1) {
  542. return error_rate * 100 + '%'
  543. } else if (length <= 2) {
  544. return error_rate * 100 + '%'
  545. } else {
  546. return convertToPercentage(error_rate)
  547. }
  548. function numToString(num) {
  549. let str = num.toString()
  550. if (str.includes('e')) {
  551. const parts = str.split('e')
  552. const base = parts[0]
  553. const exp = parseInt(parts[1])
  554. const decimalPlaces = base.split('.')[1]?.length || 0
  555. const zerosNeeded = Math.abs(exp) - decimalPlaces
  556. if (exp < 0) {
  557. str = '0.' + '0'.repeat(zerosNeeded) + base.replace('.', '')
  558. } else {
  559. str = base + '0'.repeat(zerosNeeded)
  560. }
  561. }
  562. return str
  563. }
  564. function convertToPercentage(value) {
  565. const bnValue = new BigNumber(value)
  566. const percentage = bnValue.multipliedBy(100)// 乘法运算
  567. let roundedPercentage = percentage.decimalPlaces(2, BigNumber.ROUND_FLOOR)// decimalPlaces保留小数位
  568. // 如果四舍五入后的值小于原始值,手动增加 0.01
  569. if (roundedPercentage.isLessThan(percentage)) { // 判断是否小于
  570. roundedPercentage = roundedPercentage.plus(0.01)
  571. }
  572. return `${roundedPercentage.toFixed(2)}%`
  573. }
  574. },
  575. handleUpdateName() {
  576. this.open = true
  577. this.form = this.detailObj
  578. },
  579. // 控制列的显示和隐藏
  580. columnChange(val) {
  581. this.colData.filter((i) => {
  582. if (this.colSelect.indexOf(i.title) !== -1) {
  583. i.istrue = true
  584. } else {
  585. i.istrue = false
  586. }
  587. })
  588. },
  589. Refresh(timeOut) {
  590. this.serviceMapTimer = setInterval(() => {
  591. this.getList()
  592. this.getServiceList() // 获取服务列表select
  593. }, timeOut)
  594. },
  595. handleClose() {
  596. this.isShowServiceSpaceDrawer = false
  597. },
  598. drawerCloseDetail() {
  599. this.drawerDetail = false
  600. },
  601. handleRowClick(row, column, event) {
  602. this.currentBussinessId = row.id
  603. this.currentBussinessName = row.name
  604. this.isShowServiceSpaceDrawer = true
  605. },
  606. getListBizGraph(id) {
  607. this.loading = true
  608. listBizGraph({ biz_id: id }).then((res) => {
  609. this.graphData = {}
  610. if (res.code == 200) {
  611. const arr = res.data
  612. console.log(10000001111, arr)
  613. if (arr.length > 0) {
  614. const List = this.handelListBizData(arr)
  615. this.graphData = List[0]
  616. this.loading = false
  617. } else {
  618. this.graphData = {}
  619. }
  620. }
  621. })
  622. },
  623. handelListBizData(data) {
  624. data.forEach((v, k) => {
  625. // v.collapsed = false;
  626. v.id = v.id.toString()
  627. v.name = v.name
  628. v.label = v.stats.duration != undefined ? (v.stats.duration).toString() : ''
  629. v.currency = 'ms'
  630. v.rate = v.stats.success_rate
  631. v.status = v.stats.success_rate >= 0.6 ? 'B' : v.stats.success_rate == 0 ? 'DI' : 'R'
  632. v.variableValue = v.stats.success_rate
  633. v.variableUp = v.stats.success_rate_up
  634. if (v.children != undefined && v.children.length > 0) {
  635. v.children = this.handelListBizData(v.children)
  636. }
  637. })
  638. return data
  639. },
  640. handleData(data) {
  641. console.log(3000, data)
  642. data.forEach((v, k) => {
  643. v.id = v.biz_id
  644. v.collapsed = false
  645. v.name = v.name
  646. v.label = v.service_name
  647. v.currency = 'ms'
  648. v.rate = v.duration_persent
  649. v.status = (v.status_code == 'STATUS_CODE_ERROR' || v.events_timestamp.length > 0 || v.http_code > 399) ? 'R' : (v.duration > 500) ? 'Y' : 'G'
  650. v.variableValue = v.duration_persent
  651. // v.status_code = 'UNSET'
  652. if (v.children != undefined && v.children.length > 0) {
  653. v.children = this.handleData(v.children)
  654. }
  655. })
  656. return data
  657. },
  658. // 根据行的id判断
  659. getRowKeys(row) {
  660. return row.id
  661. },
  662. clickRowHandle(row, column, event) {
  663. // alert('a')
  664. },
  665. clickRowHandleNode(item) {
  666. this.detailData = item
  667. this.drawerDetail = true
  668. },
  669. toggle() {
  670. this.$router.push({
  671. path: 'dashboard'
  672. })
  673. },
  674. // 加载更多
  675. loadMore() {
  676. if (!this.loading) {
  677. this.loading = true
  678. if (this.serveceMapList.length < this.tableCount) {
  679. this.queryParams.page_num++
  680. this.getList()
  681. } else {
  682. // this.$message("已加载完所有的数据!");
  683. this.loading = false
  684. }
  685. }
  686. },
  687. // 获取左侧table 数据
  688. getList() {
  689. const _this = this
  690. this.loading = true
  691. this.myChartList = []
  692. this.myChartboxList = []
  693. this.myChartBox2List = []
  694. getNewBusinessList(this.queryParams).then(res => {
  695. if (res.code == 200) {
  696. this.serveceMapList = res.data.list || []
  697. this.tableCount = res.data.total || 0
  698. this.loading = false
  699. if (_this.serveceMapList.length > 0) {
  700. for (let i = 0; i < _this.serveceMapList.length; i++) {
  701. this.BizStatsQuery.biz_id = _this.serveceMapList[i].id
  702. listBizStats(this.BizStatsQuery).then(response => {
  703. if (response.code == 200) {
  704. if (response.data.biz_id != undefined) {
  705. if (_this.serveceMapList[i].id == response.data.biz_id) {
  706. _this.serveceMapList[i] = Object.assign({}, _this.serveceMapList[i], response.data)
  707. _this.isUpdate = !_this.isUpdate
  708. }
  709. }
  710. }
  711. })
  712. }
  713. }
  714. this.$nextTick(() => {
  715. this.$forceUpdate()
  716. })
  717. }
  718. })
  719. },
  720. beforeUpload(file) {
  721. const isRightSize = file.size / 1024 / 1024 < 2
  722. if (!isRightSize) {
  723. this.$message.error('文件大小超过 2MB')
  724. }
  725. return isRightSize
  726. },
  727. uploadSuccess(response, file, fileList) {
  728. this.form.imgUrl = process.env.VUE_APP_BASE_API + response.data.full_path
  729. },
  730. // 取消按钮
  731. cancel() {
  732. this.open = false
  733. this.reset()
  734. },
  735. // 表单重置
  736. reset() {
  737. this.form = {
  738. id: undefined,
  739. name: undefined,
  740. url: undefined,
  741. type: undefined,
  742. module: undefined,
  743. summary: undefined,
  744. favor: undefined
  745. }
  746. this.resetForm('form')
  747. },
  748. handChange(val) {
  749. this.queryParams.service_name = val
  750. this.handleQuery()
  751. },
  752. /** 搜索按钮操作 */
  753. handleQuery() {
  754. this.queryParams.page_num = 1
  755. this.serveceMapList = []
  756. this.tempList = []
  757. this.getList()
  758. },
  759. /** 重置按钮操作 */
  760. resetQuery() {
  761. this.dateRange = []
  762. this.resetForm('queryForm')
  763. this.handleQuery()
  764. },
  765. // 多选框选中数据
  766. handleSelectionChange(selection) {
  767. this.ids = selection.map(item => item.id)
  768. this.single = selection.length !== 1
  769. this.multiple = !selection.length
  770. },
  771. /** 新增按钮操作 */
  772. handleAdd() {
  773. this.reset()
  774. // this.getMenuTreeselect(0)
  775. this.open = true
  776. this.title = '新增URL组'
  777. this.isEdit = false
  778. },
  779. handleSortChang(column, prop, order) {
  780. prop = column.prop
  781. order = column.order
  782. if (order === 'descending') {
  783. this.queryParams.sort_type = 'desc'
  784. } else if (order === 'ascending') {
  785. this.queryParams.sort_type = 'asc'
  786. }
  787. this.queryParams.sort_field = prop
  788. this.getList()
  789. },
  790. /** 修改按钮操作 */
  791. handleUpdate(row) {
  792. this.reset()
  793. // this.form = row;
  794. this.form.name = row.name
  795. this.form.id = row.id
  796. this.title = '修改业务别名'
  797. this.isEdit = true
  798. this.open = true
  799. },
  800. /** 提交按钮 */
  801. submitForm: function() {
  802. this.$refs['form'].validate(valid => {
  803. if (valid) {
  804. if (this.form.id !== undefined || this.form.id != 0) {
  805. updateBiz(this.form, this.form.id).then(response => {
  806. if (response.code === 200) {
  807. this.msgSuccess(response.msg)
  808. this.open = false
  809. this.drawer = false
  810. this.queryParams.page_num = 1
  811. this.serveceMapList = []
  812. this.tempList = []
  813. this.getList()
  814. } else {
  815. this.msgError(response.msg)
  816. }
  817. })
  818. } else {
  819. addUrlMapping(this.form).then(response => {
  820. if (response.code === 200) {
  821. this.msgSuccess(response.msg)
  822. this.open = false
  823. this.queryParams.page_num = 1
  824. this.serveceMapList = []
  825. this.tempList = []
  826. this.getList()
  827. } else {
  828. this.msgError(response.msg)
  829. }
  830. })
  831. }
  832. }
  833. })
  834. },
  835. /** 删除按钮操作 */
  836. handleDelete(row) {
  837. // const id = (row.id && [row.id]) || this.ids
  838. const id = row.id
  839. this.$confirm('是否确认删除接口映射编号为"' + id + '"的数据项?', '警告', {
  840. confirmButtonText: '确定',
  841. cancelButtonText: '取消',
  842. type: 'warning'
  843. }).then(function() {
  844. return delBiz(id)
  845. }).then((response) => {
  846. this.queryParams.page_num = 1
  847. this.serveceMapList = []
  848. this.tempList = []
  849. this.msgSuccess(response.msg)
  850. this.getList()
  851. }).catch(function() {})
  852. },
  853. handleFavor(row) {
  854. let favor = ''
  855. if (row.favor == 1) {
  856. favor = '0'
  857. } else if (row.favor == 0) {
  858. favor = '1'
  859. }
  860. favorBiz({ favor: favor }, row.id).then(res => {
  861. if (res.code === 200) {
  862. this.msgSuccess(res.msg)
  863. this.queryParams.page_num = 1
  864. this.serveceMapList = []
  865. this.tempList = []
  866. this.getList()
  867. }
  868. })
  869. },
  870. /** 导出按钮操作 */
  871. handleExport() {
  872. this.$confirm('是否确认导出所有角色数据项?', '警告', {
  873. confirmButtonText: '确定',
  874. cancelButtonText: '取消',
  875. type: 'warning'
  876. }).then(() => {
  877. this.downloadLoading = true
  878. import('@/vendor/Export2Excel').then(excel => {
  879. const tHeader = ['角色编号', '角色名称', '权限字符', '显示顺序', '状态', '创建时间']
  880. const filterVal = ['roleId', 'roleName', 'roleKey', 'roleSort', 'status', 'createdAt']
  881. const list = this.roleList
  882. const data = formatJson(filterVal, list)
  883. excel.export_json_to_excel({
  884. header: tHeader,
  885. data,
  886. filename: '角色管理',
  887. autoWidth: true, // Optional
  888. bookType: 'xlsx' // Optional
  889. })
  890. this.downloadLoading = false
  891. })
  892. })
  893. },
  894. drawEcharts(row, index) {
  895. const option = {
  896. tooltip: {
  897. trigger: 'axis',
  898. confine: false,
  899. appendToBody: true
  900. },
  901. grid: {
  902. top: 10,
  903. left: 0,
  904. right: '4%',
  905. bottom: '-2%',
  906. containLabel: false
  907. },
  908. xAxis: {
  909. type: 'category',
  910. boundaryGap: false,
  911. // data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  912. data: row.duration_stats.time,
  913. show: false
  914. },
  915. yAxis: {
  916. type: 'value',
  917. show: false
  918. },
  919. series: [
  920. {
  921. name: 'P.50',
  922. type: 'line',
  923. stack: 'Total',
  924. symbol: 'none',
  925. // // data: [120, 132, 101, 134, 90, 230, 210]
  926. // data: Number(row.duration_stats.p50).toFixed(2)
  927. data: row.duration_stats.p50
  928. },
  929. {
  930. name: 'P.95',
  931. type: 'line',
  932. stack: 'Total',
  933. symbol: 'none',
  934. // data: [320, 332, 301, 334, 390, 330, 320]
  935. // data: Number(row.duration_stats.p90).toFixed(2)
  936. data: row.duration_stats.p90
  937. },
  938. {
  939. name: 'P.99',
  940. type: 'line',
  941. stack: 'Total',
  942. symbol: 'none',
  943. // data: [820, 932, 901, 934, 1290, 1330, 1320]
  944. // data: Number(row.duration_stats.p99).toFixed(2)
  945. data: row.duration_stats.p99
  946. }
  947. ]
  948. }
  949. const chartId = 'tiger-' + arguments[2] + '-trend-index' + arguments[1]
  950. this.$nextTick(() => {
  951. const myChart = this.$echarts5.init(document.getElementById(chartId), 'macarons')
  952. myChart.setOption(option)
  953. myChart.resize()
  954. })
  955. },
  956. drawEchartsp5(row, index) {
  957. const that = this
  958. let obj = {}
  959. obj = row
  960. // if(row.quantiles != undefined&&row.quantiles.time !=null){
  961. const option = {
  962. tooltip: {
  963. trigger: 'axis',
  964. confine: false,
  965. appendToBody: true
  966. },
  967. xAxis: {
  968. type: 'category',
  969. boundaryGap: false,
  970. data: obj.quantiles.time,
  971. show: false
  972. },
  973. grid: {
  974. top: '15%',
  975. bottom: '10%',
  976. left: '1%',
  977. right: '1%'
  978. },
  979. yAxis: {
  980. type: 'value',
  981. show: false
  982. },
  983. series: [
  984. {
  985. name: 'P50',
  986. data: obj.quantiles.p50,
  987. type: 'line',
  988. showSymbol: false,
  989. lineStyle: {
  990. width: 1
  991. },
  992. areaStyle: {
  993. z: 3,
  994. coordinateSystem: 'cartesian2d',
  995. legendHoverLink: true,
  996. clip: true,
  997. color: 'rgba(0, 0, 180, 0.2)'
  998. },
  999. tooltip: {
  1000. valueFormatter: function(value) {
  1001. return value + ' ms'
  1002. }
  1003. }
  1004. }
  1005. ]
  1006. }
  1007. setTimeout(() => { // tiger-five-trend-index
  1008. const chartId = 'allBussiness-' + 'five' + '-trend-index' + index
  1009. let myChart = that.$echarts5.getInstanceByDom(document.getElementById(chartId))
  1010. if (myChart == null) {
  1011. myChart = that.$echarts5.init(document.getElementById(chartId), 'macarons')
  1012. }
  1013. myChart.dispatchAction({ type: 'hideTip' })
  1014. that.myChartList.push(myChart)
  1015. option && myChart.setOption(option, true)
  1016. // myChart.group = `index${row.id}`
  1017. // that.$echarts5.connect(`index${row.id}`)
  1018. }, 5000)
  1019. },
  1020. drawEchartsp90(row, index) {
  1021. const that = this
  1022. let obj = {}
  1023. obj = row
  1024. // if(row.quantiles != undefined&&row.quantiles.time !=null){
  1025. const option = {
  1026. tooltip: {
  1027. trigger: 'axis',
  1028. confine: false,
  1029. appendToBody: true
  1030. },
  1031. xAxis: {
  1032. type: 'category',
  1033. boundaryGap: false,
  1034. data: obj.quantiles.time,
  1035. show: false
  1036. },
  1037. grid: {
  1038. top: '15%',
  1039. bottom: '10%',
  1040. left: '1%',
  1041. right: '1%'
  1042. },
  1043. yAxis: {
  1044. type: 'value',
  1045. show: false
  1046. },
  1047. series: [
  1048. {
  1049. name: 'P90',
  1050. data: obj.quantiles.p90,
  1051. type: 'line',
  1052. showSymbol: false,
  1053. lineStyle: {
  1054. width: 1
  1055. },
  1056. areaStyle: {
  1057. z: 3,
  1058. coordinateSystem: 'cartesian2d',
  1059. legendHoverLink: true,
  1060. clip: true,
  1061. color: 'rgba(0, 0, 180, 0.3)'
  1062. },
  1063. tooltip: {
  1064. valueFormatter: function(value) {
  1065. return value + ' ms'
  1066. }
  1067. }
  1068. }
  1069. ]
  1070. }
  1071. setTimeout(() => {
  1072. const chartId = 'allBussiness-' + arguments[2] + '-trend-index' + arguments[1]
  1073. let myChartbox = this.$echarts5.getInstanceByDom(document.getElementById(chartId))
  1074. if (myChartbox == null) {
  1075. myChartbox = that.$echarts5.init(document.getElementById(chartId), 'ninebox')
  1076. }
  1077. this.myChartboxList.push(myChartbox)
  1078. myChartbox.dispatchAction({ type: 'hideTip' })
  1079. option && myChartbox.setOption(option, true)
  1080. // myChartbox.group = `index${row.id}`
  1081. // this.$echarts5.connect(`index${row.id}`)
  1082. }, 1000)
  1083. // }
  1084. },
  1085. drawEchartsp99(row, index) {
  1086. const that = this
  1087. // if(row.quantiles != undefined&&row.quantiles.time !=null){
  1088. const option = {
  1089. tooltip: {
  1090. trigger: 'axis',
  1091. confine: false,
  1092. appendToBody: true
  1093. },
  1094. xAxis: {
  1095. type: 'category',
  1096. boundaryGap: false,
  1097. data: row.quantiles.time,
  1098. show: false
  1099. },
  1100. grid: {
  1101. top: '15%',
  1102. bottom: '10%',
  1103. left: '1%',
  1104. right: '1%'
  1105. },
  1106. yAxis: {
  1107. type: 'value',
  1108. show: false
  1109. },
  1110. animation: true,
  1111. animationDuration: 1000,
  1112. series: [
  1113. {
  1114. name: 'P99',
  1115. data: row.quantiles.p99,
  1116. type: 'line',
  1117. showSymbol: false,
  1118. lineStyle: {
  1119. width: 1
  1120. },
  1121. areaStyle: {
  1122. z: 3,
  1123. coordinateSystem: 'cartesian2d',
  1124. legendHoverLink: true,
  1125. clip: true,
  1126. color: 'rgba(0, 0, 180, 0.3)'
  1127. },
  1128. tooltip: {
  1129. valueFormatter: function(value) {
  1130. return value + ' ms'
  1131. }
  1132. }
  1133. }
  1134. ]
  1135. }
  1136. setTimeout(() => {
  1137. const chartId = 'allBussiness-' + arguments[2] + '-trend-index' + arguments[1]
  1138. let myChartBox2 = this.$echarts5.getInstanceByDom(document.getElementById(chartId))
  1139. if (myChartBox2 == null) {
  1140. myChartBox2 = that.$echarts5.init(document.getElementById(chartId), 'hundredbox')
  1141. }
  1142. this.myChartBox2List.push(myChartBox2)
  1143. myChartBox2.dispatchAction({ type: 'hideTip' })
  1144. option && myChartBox2.setOption(option, true)
  1145. // myChartBox2.group = `index${row.id}`
  1146. // this.$echarts5.connect(`index${row.id}`)
  1147. }, 1000)
  1148. // }
  1149. },
  1150. drawEchartsScale(row) {
  1151. let myChartScale = this.$echarts5.getInstanceByDom(document.getElementById(chartId))
  1152. if (myChartScale == null) {
  1153. myChartScale = this.$echarts5.init(document.getElementById('scaleMain'))
  1154. }
  1155. // 绘制趋势echarts
  1156. const option = {
  1157. tooltip: {
  1158. trigger: 'axis',
  1159. confine: false,
  1160. appendToBody: true,
  1161. show: true,
  1162. formatter: function(params) {
  1163. storage.set('paramsValue', params)
  1164. const axisValueLabel = params[0].axisValueLabel
  1165. let str0 = ''
  1166. params.forEach((item, idx) => {
  1167. // str1+=`${}`
  1168. str0 += `${item.marker}${item.seriesName}<span style='margin-left:30px;text-align:right;font-weight:400'>${item.data}</span>`
  1169. switch (idx) {
  1170. case 0:
  1171. str0
  1172. break
  1173. case 1:
  1174. str0
  1175. break
  1176. default:
  1177. str0
  1178. }
  1179. str0 += idx === params.length - 1 ? '' : '<br/>'
  1180. })
  1181. return axisValueLabel + '<br>' + str0
  1182. }
  1183. },
  1184. title: {
  1185. text: '延迟比例',
  1186. // subtext: 'ms',
  1187. textStyle: {
  1188. fontSize: 14
  1189. }
  1190. // triggerEvent: true,
  1191. },
  1192. grid: {
  1193. // top:'5%',
  1194. left: '3%',
  1195. right: '6%',
  1196. bottom: '1%',
  1197. containLabel: true
  1198. },
  1199. xAxis: {
  1200. type: 'category',
  1201. boundaryGap: false,
  1202. data: row.quantiles.time,
  1203. axisLabel: {
  1204. textStyle: {
  1205. fontSize: 12,
  1206. textAlign: 'center'
  1207. },
  1208. formatter: function(params) {
  1209. let newParams = ''
  1210. const dateStr = params.substring(0, 10)
  1211. // dateStr = dateStr.replace(/\-/g, function(match) {
  1212. // return match.replace(/\-/g, '.');
  1213. // });
  1214. const timeStr = params.substring(11, 19)
  1215. newParams = dateStr + '\n' + timeStr
  1216. return newParams
  1217. }
  1218. }
  1219. },
  1220. yAxis: {
  1221. type: 'value',
  1222. scale: true,
  1223. gridIndex: 0,
  1224. axisLabel: {
  1225. formatter: '{value}'
  1226. },
  1227. axisLine: {
  1228. show: true
  1229. },
  1230. axisTick: {
  1231. show: true
  1232. },
  1233. splitLine: {
  1234. show: true
  1235. }
  1236. },
  1237. series: [
  1238. {
  1239. name: 'P.50',
  1240. type: 'line',
  1241. stack: 'Total',
  1242. symbol: 'none',
  1243. // symbol: 'emptyCircle',//拐点
  1244. data: row.quantiles.p50
  1245. },
  1246. {
  1247. name: 'P.95',
  1248. type: 'line',
  1249. stack: 'Total',
  1250. symbol: 'none', // 拐点
  1251. // symbol: 'emptyCircle',//拐点
  1252. data: row.quantiles.p90
  1253. },
  1254. {
  1255. name: 'P.99',
  1256. type: 'line',
  1257. stack: 'Total',
  1258. symbol: 'none', // 拐点
  1259. // symbol: 'emptyCircle',//拐点
  1260. data: row.quantiles.p99
  1261. }
  1262. ]
  1263. }
  1264. myChartScale.setOption(option)
  1265. },
  1266. disposeEcharts(echartsList) {
  1267. if (echartsList.length > 0) {
  1268. for (let i = 0; i < echartsList.length; i++) {
  1269. echartsList[i].dispose()
  1270. }
  1271. }
  1272. }
  1273. }
  1274. }
  1275. </script>
  1276. <style lang="scss" scoped>
  1277. ::v-deep .el-input--suffix .el-input__inner{
  1278. padding-right: 0;
  1279. }
  1280. ::v-deep .el-checkbox__label{
  1281. font-size: 12px;
  1282. }
  1283. .flex{
  1284. display: flex;
  1285. align-items: center;
  1286. }
  1287. .seach-title{
  1288. // width:100px;
  1289. display: inline-block;
  1290. margin-right: 10px;
  1291. }
  1292. .iconfont {
  1293. font-family: "iconfont" !important;
  1294. font-size: 20px;
  1295. font-style: normal;
  1296. -webkit-font-smoothing: antialiased;
  1297. -moz-osx-font-smoothing: grayscale;
  1298. }
  1299. .icon-jiantou_zuoyouqiehuan:before {
  1300. content: "\eb0d";
  1301. }
  1302. .icon-qiehuan:before {
  1303. content: "\e606";
  1304. }
  1305. .icon-qiehuan1:before {
  1306. content: "\e789";
  1307. }
  1308. ::v-deep .el-card__body{
  1309. position: relative !important;
  1310. }
  1311. .back{
  1312. position: absolute;
  1313. top:10px;
  1314. right:10px;
  1315. width:20px;
  1316. height:20px;
  1317. }
  1318. .tiger-trend-charts {
  1319. height: 40px;
  1320. // width:100px;
  1321. width: 140px;
  1322. max-width: 200px;
  1323. }
  1324. ::v-deep .el-icon-star-on{
  1325. font-size: 16px;
  1326. }
  1327. .more{
  1328. margin:16px 0;
  1329. text-align: center;
  1330. font-size: 16px;
  1331. color:#1890ff;
  1332. cursor: pointer;
  1333. }
  1334. .nomore{
  1335. color:#999;
  1336. }
  1337. .green_small{
  1338. display: inline-block;
  1339. width:8px;
  1340. height: 8px;
  1341. border-radius: 50%;
  1342. background:#67C23A;
  1343. margin-right:8px;
  1344. }
  1345. .red_small{
  1346. width:8px;
  1347. height: 8px;
  1348. display: inline-block;
  1349. border-radius: 50%;
  1350. background:#F56C6C;
  1351. margin-right:8px;
  1352. }
  1353. .flexWrap{
  1354. // display:flex;
  1355. // justify-content: space-between;
  1356. }
  1357. .flex-left{
  1358. // width:calc (100% - 720px);
  1359. width:100%;
  1360. }
  1361. .flex-right{
  1362. width:100%;
  1363. // width:39.99%;
  1364. // width: 720px;
  1365. }
  1366. .noData{
  1367. width: 100%;
  1368. height: calc(100vh - 120px);
  1369. background: #fff;
  1370. }
  1371. .noData_title{
  1372. margin-bottom: 0px;
  1373. padding: 2px 5px;
  1374. text-overflow: ellipsis;
  1375. overflow: hidden;
  1376. white-space: nowrap;
  1377. font-size: 14px;
  1378. font-weight: 500;
  1379. line-height: 1.57143;
  1380. font-family: Inter, Helvetica, Arial, sans-serif;
  1381. }
  1382. ::v-deep .el-drawer__title{
  1383. margin-top:50px;
  1384. }
  1385. .table_bg{
  1386. background: #e8f4ff;
  1387. color:#1890ff;
  1388. padding:0 4px;
  1389. }
  1390. .table_bg_red{
  1391. background-color: #fef0f0;
  1392. color: #f56c6c;
  1393. padding:0 8px;
  1394. }
  1395. .table_bg_yellow{
  1396. background-color: #fdf6ec;
  1397. color: #e6a23c;
  1398. padding:0 4px;
  1399. }
  1400. .table-num-box{
  1401. height:20px;
  1402. line-height:30px;
  1403. }
  1404. .table-day-rate-box{
  1405. height:20px;
  1406. line-height:20px;
  1407. font-size:10px;
  1408. }
  1409. .up{
  1410. color:#ea463d;
  1411. }
  1412. .down{
  1413. color:#00b54f;
  1414. }
  1415. .el-icon-up:before{
  1416. content:'\e6e6'
  1417. }
  1418. .el-icon-down:before{
  1419. content:'\e6eb'
  1420. }
  1421. .TableBox{
  1422. margin-top:10px;
  1423. }
  1424. .TableBox ::v-deep .el-table .cell{
  1425. line-height: 40px !important;
  1426. padding-left: 1px;
  1427. padding-right: 1px;
  1428. cursor: pointer;
  1429. }
  1430. .TableBox ::v-deep .el-table--medium .el-table__cell {
  1431. padding: 2px 0!important;
  1432. }
  1433. // .P_box{
  1434. // width:58px;
  1435. // min-width: 58px;
  1436. // text-align: right;
  1437. // overflow: hidden;
  1438. // text-overflow: ellipsis;
  1439. // white-space:nowrap;
  1440. // padding-right: 10px;
  1441. // box-sizing: border-box;
  1442. // }
  1443. .P_box{
  1444. // width:68px;
  1445. min-width: 68px;
  1446. max-width: 100px;
  1447. // text-align: right;
  1448. text-align:left;
  1449. overflow: hidden;
  1450. text-overflow: ellipsis;
  1451. white-space:nowrap;
  1452. padding-right: 10px;
  1453. box-sizing: border-box;
  1454. margin-left: 10px;
  1455. }
  1456. .TableBox ::v-deep .el-table__cell.column_one .cell{
  1457. padding-left:10px !important;
  1458. padding-right:10px !important;
  1459. }
  1460. </style>