|
@@ -0,0 +1,213 @@
|
|
|
+<template>
|
|
|
+ <div class="qpage">
|
|
|
+ <el-form :inline="true" :model="queryForm" class="query-form-inline" label-width="auto">
|
|
|
+ <el-form-item label="井名">
|
|
|
+ <div style="width:160px;">{{queryForm.wellName}}</div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="月份">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryForm.months"
|
|
|
+ type="monthrange"
|
|
|
+ start-placeholder="开始月份"
|
|
|
+ end-placeholder="截止月份"
|
|
|
+ value-format="YYYY-MM"
|
|
|
+
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" :loading="isQuerying" @click="queryHandle">检索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+
|
|
|
+ <el-image-viewer
|
|
|
+ :hide-on-click-modal="true"
|
|
|
+ v-if="imageViewerCfg.show"
|
|
|
+ :url-list="imageViewerCfg.previewImg"
|
|
|
+ @close="imgViewerClose"
|
|
|
+ />
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <div class="qpage-body">
|
|
|
+ <CrudTable
|
|
|
+ ref="crudTable"
|
|
|
+ page-info-opts="total, prev, pager, next,sizes"
|
|
|
+ url="/analysis/diagram/query"
|
|
|
+ :autoPageSize="true"
|
|
|
+
|
|
|
+ >
|
|
|
+ <template #toolGroup>
|
|
|
+ <el-button type="primary" icon="DocumentAdd" @click="showUploadWin">上传</el-button>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ <template #tabColumns={indexGenerate}>
|
|
|
+ <el-table-column type="index" :index="indexGenerate" label="序号" width="60" align="center"/>
|
|
|
+ <el-table-column prop="wellName" label="井名" width="120" />
|
|
|
+ <el-table-column prop="diagramTypeName" label="分析图类型" width="160" />
|
|
|
+ <el-table-column prop="diagramMonthFmt" label="月份" width="120" />
|
|
|
+ <el-table-column prop="createTime" label="上传时间" width="160" />
|
|
|
+ <el-table-column prop="createBy" label="上传人" width="120" />
|
|
|
+ <el-table-column prop="oper" label="操作" width="200" fixed="right">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="tool-column">
|
|
|
+ <el-button type="primary" icon="DataLine" size="small" @click="viewDiagram(scope.row)">查看</el-button>
|
|
|
+
|
|
|
+ <el-button type="warning" icon="delete" size="small" @click="delHandle(scope.row)">删除</el-button>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </CrudTable>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <el-dialog v-model="popDialogShow" title="上传工况分析图" :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ >
|
|
|
+ <AnalysisDiagramUpload ref="dialogInnerComp" :initData="{wellId:queryForm.wellId,wellName:queryForm.wellName}"/>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="beforeCloseHandle('cancel')">取消</el-button>
|
|
|
+ <el-button type="primary" @click="beforeCloseHandle('sure')">
|
|
|
+ 确定
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ import {reactive,ref,watch} from 'vue'
|
|
|
+ import CrudTable from "../../components/crudtable/CrudTable.vue"
|
|
|
+ import {ElMessageBox,ElMessage} from 'element-plus'
|
|
|
+ import AnalysisDiagramUpload from './AnalysisDiagramUpload.vue'
|
|
|
+ import { storeToRefs } from 'pinia'
|
|
|
+ import { useHomeStore } from '../../store/home.js'
|
|
|
+ import analysisDiagramAPI from '../../api/analysisDiagram.js'
|
|
|
+
|
|
|
+ const crudTable=ref(null)
|
|
|
+
|
|
|
+ const isQuerying=ref(false)
|
|
|
+
|
|
|
+ const popDialogShow=ref(false)
|
|
|
+ const dialogInnerComp=ref(null)
|
|
|
+
|
|
|
+ const queryForm = reactive({
|
|
|
+ months: null,
|
|
|
+ wellId: null,
|
|
|
+ wellName:null
|
|
|
+ })
|
|
|
+
|
|
|
+ const imageViewerCfg=reactive({
|
|
|
+ show:false,
|
|
|
+ previewImg:[]
|
|
|
+ })
|
|
|
+
|
|
|
+ const imgViewerClose=()=>{
|
|
|
+ imageViewerCfg.show=false
|
|
|
+ }
|
|
|
+
|
|
|
+ const viewDiagram=(record)=>{
|
|
|
+ imageViewerCfg.show=true
|
|
|
+ imageViewerCfg.previewImg=[analysisDiagramAPI.getBasePath()+record.diagramPath]
|
|
|
+ }
|
|
|
+
|
|
|
+ const showUploadWin=()=>{
|
|
|
+ if(queryForm.wellId==null){
|
|
|
+ ElMessage.error('请先选择井,再继续')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ popDialogShow.value=true
|
|
|
+ }
|
|
|
+
|
|
|
+ const queryHandle=()=>{
|
|
|
+ isQuerying.value=true
|
|
|
+ let {wellId,months}=queryForm
|
|
|
+ let [startMonth,endMonth]=months||[null,null]
|
|
|
+ setTimeout(()=>{
|
|
|
+ crudTable.value.query({wellId,startMonth,endMonth}).then(resp=>{
|
|
|
+ isQuerying.value=false
|
|
|
+ })
|
|
|
+ },100)
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ const delHandle=(record)=>{
|
|
|
+ ElMessageBox.confirm(
|
|
|
+ '确定要删除该记录吗?',
|
|
|
+ '操作确认',
|
|
|
+ {
|
|
|
+ confirmButtonText:'确定',
|
|
|
+ cancelButtonText:'取消',
|
|
|
+ type: 'warning'
|
|
|
+ }
|
|
|
+ ).then(()=>{
|
|
|
+ analysisDiagramAPI.del(record.id).then(resp=>{
|
|
|
+ if(resp.code!=0){
|
|
|
+ ElMessage.error(resp.msg)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ ElMessage.success('操作成功')
|
|
|
+ queryHandle()
|
|
|
+
|
|
|
+ }).catch(err=>{
|
|
|
+ ElMessage.error(err||'操作失败')
|
|
|
+ })
|
|
|
+ }).catch(()=>{
|
|
|
+ console.log('cancel del')
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ const beforeCloseHandle=async (tag)=>{
|
|
|
+ if(tag==='cancel'){
|
|
|
+ popDialogShow.value=false
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ try{
|
|
|
+ await dialogInnerComp.value.submitForm()
|
|
|
+ popDialogShow.value=false
|
|
|
+ queryHandle()
|
|
|
+ }
|
|
|
+ catch(err){
|
|
|
+ console.log(err)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ const store = useHomeStore()
|
|
|
+ const {currentTreeNode} = storeToRefs(store)
|
|
|
+ watch(currentTreeNode, (newNode, oldNode) => {
|
|
|
+ if (newNode != null && newNode.nodeType == 'well') {
|
|
|
+ queryForm.wellId = newNode.id
|
|
|
+ queryForm.wellName = newNode.name
|
|
|
+ queryHandle()
|
|
|
+ }
|
|
|
+
|
|
|
+ }, {
|
|
|
+ immediate: true
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+ @import url('../../assets/css/qpage.css');
|
|
|
+
|
|
|
+ .edit-form-item{
|
|
|
+ width:260px;
|
|
|
+ }
|
|
|
+</style>
|