| | |
| | | data: query, |
| | | }); |
| | | } |
| | | //æ¥è¯¢é¢è¦å表 |
| | | export function selectDeviationWarningPage(query) { |
| | | return request({ |
| | | url: "/insProductDeviationWarning/selectDeviationWarningPage", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | | //æ¥è¯¢é¢è¦å表 |
| | | export function selectDeviationWarning(query) { |
| | | return request({ |
| | | url: "/insProductDeviationWarning/selectDeviationWarning", |
| | | method: "get", |
| | | params: query, |
| | | }); |
| | | } |
| | |
| | | </span> |
| | | </el-dialog> |
| | | <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" |
| | | :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border |
| | | :show-close="false" :visible.sync="bsm3Dia" |
| | | title="åºé´å¼å¡«å" width="800px"> |
| | | <el-table :data="editTable" height="80vh" style="width: 100%"> |
| | | <el-table :data="editTable" height="80vh" style="width: 100%" :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border> |
| | | <!-- inspectionItemList --> |
| | | <el-table-column label="æ£éªé¡¹" prop="inspectionItemList" width="180"> |
| | | </el-table-column> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div> |
| | | <lims-table :tableData="tableData" :column="column" |
| | | :height="'calc(100vh - 500px)'" @pagination="pagination" |
| | | :rowClick="rowClick" |
| | | :page="page" :tableLoading="tableLoading"></lims-table> |
| | | </div> |
| | | <div> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <div class="inspection-card"> |
| | | <div class="title">æ£éªé¡¹åå·®é¢è¦æ°æ®è¯¦æ
</div> |
| | | <Echarts ref="chart" |
| | | :chartStyle="chartStyle" |
| | | :grid="grid" |
| | | :options="echartsOptions" |
| | | :series="echartsSeries" |
| | | :tooltip="tooltip" |
| | | :xAxis="xAxis" |
| | | :yAxis="yAxis" |
| | | style="height: 40vh;"></Echarts> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | <el-dialog :visible.sync="viewDia" title="æ¥ç详æ
" width="1100px"> |
| | | <lims-table :tableData="tableData1" :column="column1" |
| | | height="570" |
| | | :tableLoading="tableLoading1"></lims-table> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import limsTable from "@/components/Table/lims-table.vue"; |
| | | import {selectDeviationWarning, selectDeviationWarningPage} from "@/api/statisticalCharts/dataAnalysis"; |
| | | import Echarts from "@/components/echarts/echarts.vue"; |
| | | |
| | | export default { |
| | | name: '', |
| | | // import å¼å
¥çç»ä»¶éè¦æ³¨å
¥å°å¯¹è±¡ä¸æè½ä½¿ç¨ |
| | | components: {Echarts, limsTable}, |
| | | data() { |
| | | // è¿éåæ¾æ°æ® |
| | | return { |
| | | viewDia: false, |
| | | queryParams: {}, |
| | | tableData: [], |
| | | tableLoading: false, |
| | | column: [ |
| | | { label: 'æ ·åç¼å·', prop: 'sampleCode',width: 150 }, |
| | | { label: 'æ ·ååç§°', prop: 'sampleName',width: 150 }, |
| | | { label: 'åå·', prop: 'sampleModel' }, |
| | | { label: 'ä¾åºååç§°', prop: 'supplierName',width: 150 }, |
| | | { label: 'æ£éªé¡¹åç§°', prop: 'inspectionItemName',width: 150 }, |
| | | { label: 'ä¾åºååç§°', prop: 'supplierName',width: 150 }, |
| | | { |
| | | label: "åå·®å¼", |
| | | prop: "deviationValue", |
| | | width: 150, |
| | | dataType: "tag", |
| | | formatType: (params) => { |
| | | return 'danger' |
| | | }, |
| | | }, |
| | | { label: 'æ£æµæ¶é´', prop: 'detectionTime',width: 160 }, |
| | | { |
| | | dataType: 'action', |
| | | label: 'æä½', |
| | | operation: [ |
| | | { |
| | | name: 'æ¥ç', |
| | | type: 'text', |
| | | clickFun: (row) => { |
| | | this.openDia(row); |
| | | }, |
| | | } |
| | | ] |
| | | } |
| | | ], |
| | | page: { |
| | | total: 0, |
| | | size: 20, |
| | | current: 1 |
| | | }, |
| | | tableData1: [], |
| | | tableLoading1: false, |
| | | column1: [ |
| | | { label: 'æ ·åç¼å·', prop: 'sampleCode'}, |
| | | { label: 'ä¾åºååç§°', prop: 'supplierName'}, |
| | | { label: 'ä¾åºååç§°', prop: 'supplierName'}, |
| | | { |
| | | label: "æ£æµå¼", |
| | | prop: "testValue", |
| | | width: 150, |
| | | dataType: "tag", |
| | | formatType: (params) => { |
| | | return 'danger' |
| | | }, |
| | | }, |
| | | { label: 'æ£æµæ¶é´', prop: 'detectionTime',width: 160 }, |
| | | ], |
| | | chartStyle: { |
| | | width: '100%', |
| | | height: '96%' // 设置å¾è¡¨å®¹å¨çé«åº¦ |
| | | }, |
| | | grid: { |
| | | left: '3%', |
| | | right: '4%', |
| | | bottom: '3%', |
| | | containLabel: true |
| | | }, |
| | | tooltip: {}, |
| | | echartsOptions: {}, |
| | | echartsSeries: [ |
| | | { |
| | | name: 'åå·®å¼', |
| | | type: 'line', |
| | | smooth: true, |
| | | tooltip: { |
| | | valueFormatter: function (value) { |
| | | return value; |
| | | } |
| | | }, |
| | | label: { |
| | | show: true, |
| | | position: 'top', |
| | | formatter: function (value) { |
| | | return value.value; |
| | | }, |
| | | distance: 14 |
| | | }, |
| | | data: [], |
| | | markArea: {}, |
| | | markPoint: {} |
| | | }, |
| | | ], |
| | | xAxis: [ |
| | | { |
| | | type: 'category', |
| | | data: [], |
| | | boundaryGap: false, |
| | | axisLabel: { |
| | | interval: 0, // å¼ºå¶æ¾ç¤ºæææ ç¾ |
| | | rotate: 0, // ä¸æè½¬ï¼å¯ä»¥æ ¹æ®éè¦è°æ´ï¼ |
| | | formatter: function (value) { |
| | | // æ¯éä¸å®é¿åº¦æ·»å æ¢è¡ç¬¦ |
| | | const maxLength = 9; // æ¯æ®µæå¤§åç¬¦æ° |
| | | let result = ''; |
| | | for (let i = 0; i < value.length; i += maxLength) { |
| | | result += value.substring(i, i + maxLength) + '\n'; |
| | | } |
| | | return result.trim(); // 廿æ«å°¾å¤ä½çæ¢è¡ç¬¦ |
| | | }, |
| | | margin: 10, // æ ç¾ä¸è½´çº¿çè·ç¦» |
| | | }, |
| | | } |
| | | ], |
| | | yAxis: [{ |
| | | type: 'value', |
| | | axisLabel: { |
| | | formatter: '{value}' |
| | | } |
| | | }], |
| | | }; |
| | | }, |
| | | mounted() { |
| | | this.refreshTable() |
| | | }, |
| | | // æ¹æ³éå |
| | | methods: { |
| | | // æ¥è¯¢åè¡¨ä¿¡æ¯ |
| | | refreshTable() { |
| | | this.tableLoading = true |
| | | selectDeviationWarningPage({ ...this.page}).then(res => { |
| | | this.tableLoading = false |
| | | this.tableData = res.data.records |
| | | this.page.total = res.data.total |
| | | }).catch(err => { |
| | | this.tableLoading = false |
| | | }) |
| | | }, |
| | | // æ¥è¯¢æçº¿å¾ä¿¡æ¯ |
| | | rowClick (row) { |
| | | selectDeviationWarning({deviationWarningId: row.deviationWarningId}).then(res => { |
| | | console.log('res---', res) |
| | | if (res.data === null) { |
| | | this.$message.warning('ææ æ°æ®') |
| | | return |
| | | } |
| | | let lineData = [] |
| | | let xAxis = [] |
| | | let markAreas = []; // åå¨ markArea çæ°ç» |
| | | let markPoints = []; |
| | | res.data.forEach((item, index) => { |
| | | lineData.push(item.testValue) |
| | | xAxis.push(item.sampleCode) |
| | | // 妿 isIssue 为 1ï¼å卿¤ç´¢å¼å¤æ·»å ä¸ä¸ª markArea |
| | | if (item.isIssue == 1) { |
| | | const startColumn = index > 0 ? xAxis[index - 1] : xAxis[index]; // èµ·ç¹ï¼åä¸åæå½åå |
| | | const endColumn = xAxis[index]; // ç»ç¹ï¼å½åå |
| | | |
| | | markAreas.push([ |
| | | { |
| | | xAxis: startColumn, // ä»åä¸åå¼å§ |
| | | }, |
| | | { |
| | | xAxis: endColumn, // å°å½ååç»æ |
| | | } |
| | | ]); |
| | | markPoints.push({ |
| | | name: 'é®é¢ç¹', |
| | | coord: [item.sampleCode, item.testValue], |
| | | value: item.testValue, |
| | | itemStyle: { |
| | | color: 'rgba(255, 173, 177, 0.8)' |
| | | }, |
| | | label: { |
| | | show: true, |
| | | formatter: function(params) { |
| | | return params.value; // èªå®ä¹æ ç¾å
容 |
| | | }, |
| | | color: 'black', // æ ç¾æåé¢è² |
| | | fontSize: 12, |
| | | distance: 5, // è°æ´æ ç¾ä¸æ°æ³¡çè·ç¦» |
| | | padding: [0,0], |
| | | backgroundColor: 'rgba(255, 173, 177, 0.8)', // æ ç¾èæ¯è²åéæåº¦ |
| | | borderRadius: 4 |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | this.xAxis[0].data = xAxis |
| | | this.echartsSeries[0].data = lineData |
| | | // æ´æ° markArea é
ç½® |
| | | this.echartsSeries[0].markArea = { |
| | | itemStyle: { |
| | | color: 'rgba(255, 173, 177, 0.4)' // è®¾ç½®èæ¯é¢è² |
| | | }, |
| | | data: markAreas // 卿çæç markArea æ°æ® |
| | | }; |
| | | this.echartsSeries[0].markPoint = { |
| | | data: markPoints |
| | | }; |
| | | }) |
| | | }, |
| | | // éç½® |
| | | refresh() { |
| | | // this.resetForm('entity') |
| | | this.refreshTable() |
| | | }, |
| | | // å页忢 |
| | | pagination(page) { |
| | | this.page.size = page.limit |
| | | this.refreshTable() |
| | | }, |
| | | openDia (row) { |
| | | this.viewDia = true |
| | | this.tableLoading1 = true |
| | | selectDeviationWarning({deviationWarningId: row.deviationWarningId}).then(res => { |
| | | this.tableLoading1 = false |
| | | this.tableData1 = res.data |
| | | }).catch(() => { |
| | | this.tableLoading1 = false |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .inspection-card{ |
| | | width: 100%; |
| | | margin-top: 10px; |
| | | } |
| | | </style> |