|
@@ -95,21 +95,37 @@
|
|
|
</a-row>
|
|
|
<a-row :gutter="24" class="query-index-row" v-if="showQuery">
|
|
|
<a-col :span="6">
|
|
|
- <a-form-item name="tempName" label="开钻日期:">
|
|
|
+ <a-form-item name="tempName" label="最近采油日期:">
|
|
|
<a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']"
|
|
|
@change="(d)=>{onRangeChange(d,'oil_prod_recent_date_begin','oil_prod_recent_date_end')}"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
|
+ <a-row class="edit-operation">
|
|
|
+ <a-col :span="24" style="text-align: right">
|
|
|
+ <a-radio-group v-model:value="viewModel" style="text-align: left">
|
|
|
+ <a-radio-button value="list">
|
|
|
+ <UnorderedListOutlined/>
|
|
|
+ 列表
|
|
|
+ </a-radio-button>
|
|
|
+ <a-radio-button value="card">
|
|
|
+ <TableOutlined/>
|
|
|
+ 卡片
|
|
|
+ </a-radio-button>
|
|
|
+ </a-radio-group>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
<a-spin :spinning="loading">
|
|
|
- <div class="query-index-table">
|
|
|
+ <div class="query-index-table" v-if="viewModel=='list'">
|
|
|
<a-table :columns="columns" :data-source="data" :scroll="{ x:'100%', y: 500 }"
|
|
|
- :loading="loading"
|
|
|
- :row-key="record=>record.tempId"
|
|
|
+ :row-key="record=>record.tempId" :pagination="false"
|
|
|
bordered>
|
|
|
<template #bodyCell="{ column,record }">
|
|
|
+ <template v-if="column.key === 'well_id'">
|
|
|
+ <a-button type="link" size="small" @click="detail(record.well_id)">{{ record.well_id }}</a-button>
|
|
|
+ </template>
|
|
|
<template v-if="column.key === 'operation'">
|
|
|
<a-popover trigger="hover" placement="left">
|
|
|
<template #content>
|
|
@@ -122,12 +138,69 @@
|
|
|
<a-button type="link" size="small">删除</a-button>
|
|
|
</a-popconfirm>
|
|
|
</template>
|
|
|
- <a-button type="link" size="small">更多</a-button>
|
|
|
+ <a-button type="link" size="small">相关文档</a-button>
|
|
|
</a-popover>
|
|
|
</template>
|
|
|
</template>
|
|
|
</a-table>
|
|
|
</div>
|
|
|
+ <div class="query-index-table" v-else>
|
|
|
+ <a-row :gutter="[24,8]">
|
|
|
+ <a-col :span="8" v-for="item in data">
|
|
|
+ <a-card :title="'井名:'+item.well_common_name" bodyStyle="padding: 10px;">
|
|
|
+ <template #extra>
|
|
|
+ <a-button type="link">查看详情</a-button>
|
|
|
+ |
|
|
|
+ <a-button type="link">相关文档</a-button>
|
|
|
+ </template>
|
|
|
+ <table class="well-card-table">
|
|
|
+ <tr>
|
|
|
+ <th>井型:</th>
|
|
|
+ <td>{{ item.well_type }}</td>
|
|
|
+ <th>状态:</th>
|
|
|
+ <td>{{ item.current_state_name }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>开钻日期:</th>
|
|
|
+ <td>{{ item.spud_date }}</td>
|
|
|
+ <th>含水率:</th>
|
|
|
+ <td :class="getTdColor( item.water_cut)">{{ item.water_cut }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>开始采油日期:</th>
|
|
|
+ <td>{{ item.oil_prod_begin_date }}</td>
|
|
|
+ <th>最近采油日期:</th>
|
|
|
+ <td>{{ item.oil_prod_recent_date }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>月产油量(t):</th>
|
|
|
+ <td>{{ item.oil_prod_mon }}</td>
|
|
|
+ <td colspan="2" rowspan="2"></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>累产油量(t):</th>
|
|
|
+ <td>{{ item.oil_prod_year }}</td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>月产气量(m³):</th>
|
|
|
+ <td>{{ item.gas_prod_mon }}</td>
|
|
|
+ <td colspan="2" rowspan="2"></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th>累产气量(m³):</th>
|
|
|
+ <td>{{ item.gas_prod_year }}</td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </a-card>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+ <a-pagination :page-size-options="['5', '20', '30', '40', '50']" show-size-changer
|
|
|
+ v-model:current="pagination.current" :total="pagination.total"
|
|
|
+ style="float: right;margin-top: 10px;"
|
|
|
+ :pageSize="pagination.pageSize" :show-total="total => `共 ${total} 条`"
|
|
|
+ @change="(current)=>handleTableChange({ current: current,pageSize: pagination.pageSize })"
|
|
|
+ @showSizeChange="(current,pageSize)=>handleTableChange({ current: current,pageSize: pageSize })"/>
|
|
|
</a-spin>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -141,9 +214,11 @@ import {get} from "@/api/common";
|
|
|
import type {TableColumnsType} from "ant-design-vue";
|
|
|
import dayjs from "dayjs";
|
|
|
import {getPaginationTotalTitle} from "@/utils/common";
|
|
|
+import type {TableProps} from "ant-design-vue";
|
|
|
+import {useTabsViewStore} from "@/store/modules/tabsView";
|
|
|
|
|
|
export default defineComponent({
|
|
|
- name: 'queryindex',
|
|
|
+ name: 'wellinfoindex',
|
|
|
components: {},
|
|
|
setup() {
|
|
|
const route = useRoute();
|
|
@@ -155,6 +230,8 @@ export default defineComponent({
|
|
|
const activeTab = ref("1");
|
|
|
const showTree = ref(true);
|
|
|
const data = ref([]);
|
|
|
+ const viewModel = ref("list");
|
|
|
+ const tabsViewStore = useTabsViewStore();
|
|
|
const wellTypeList = ref([{label: "直井", value: "直井"}, {label: "定向井", value: "定向井"}, {label: "分支井", value: "分支井"}]);
|
|
|
const replaceFields = {
|
|
|
children: 'children',
|
|
@@ -200,7 +277,7 @@ export default defineComponent({
|
|
|
},
|
|
|
{
|
|
|
title: '完井日期', dataIndex: 'completion_date', key: 'completion_date', width: 120, customRender: ({record}) =>
|
|
|
- record.end_drilling_date == null ? "" : (dayjs(record.end_drilling_date).format('YYYY-MM-DD'))
|
|
|
+ record.end_drilling_date == null ? "" : (dayjs(record.completion_date).format('YYYY-MM-DD'))
|
|
|
},
|
|
|
{
|
|
|
title: '开始采油日期',
|
|
@@ -216,17 +293,32 @@ export default defineComponent({
|
|
|
customRender: ({record}) =>
|
|
|
record.oil_prod_recent_date == null ? "" : (dayjs(record.oil_prod_recent_date).format('YYYY-MM-DD'))
|
|
|
},
|
|
|
- {title: '状态', dataIndex: 'current_state', key: 'current_state', width: 120},
|
|
|
+ {title: '状态', dataIndex: 'current_state_name', key: 'current_state', width: 120},
|
|
|
{title: '设计井深(m)', dataIndex: 'budgeted_md', key: 'tempNo', width: 120},
|
|
|
- {title: '含水率', dataIndex: 'water_cut', key: 'water_cut', width: 120},
|
|
|
+ {
|
|
|
+ title: '含水率', dataIndex: 'water_cut', key: 'water_cut', width: 60, align: 'center', customCell: (record) => {
|
|
|
+ return {class: getTdColor(record.water_cut)};
|
|
|
+ }
|
|
|
+ },
|
|
|
{title: '月产油量(t)', dataIndex: 'oil_prod_mon', key: 'oil_prod_mon', width: 120},
|
|
|
- {title: '累产油量(t)', dataIndex: 'oil_prod_ year', key: 'oil_prod_ year', width: 120},
|
|
|
+ {title: '累产油量(t)', dataIndex: 'oil_prod_year', key: 'oil_prod_year', width: 120},
|
|
|
{title: '累产油量趋势', dataIndex: 'tempNo', key: 'tempNo', width: 150},
|
|
|
- {title: '月产气量(m³)', dataIndex: 'gas_prod_ year', key: 'gas_prod_ year', width: 120},
|
|
|
- {title: '累产气量(m³)', dataIndex: 'gas_prod_mon', key: 'gas_prod_mon', width: 120},
|
|
|
+ {title: '月产气量(m³)', dataIndex: 'gas_prod_mon', key: 'gas_prod_mon', width: 120},
|
|
|
+ {title: '累产气量(m³)', dataIndex: 'gas_prod_year', key: 'gas_prod_year', width: 120},
|
|
|
{title: '累产油量趋势', dataIndex: 'tempNo', key: 'tempNo', width: 150},
|
|
|
- {title: '操作列', dataIndex: 'operation', key: 'operation', width: 120}
|
|
|
+ {title: '操作列', dataIndex: 'operation', key: 'operation', align: 'center', width: 120}
|
|
|
];
|
|
|
+ const getTdColor = (water_cut) => {
|
|
|
+ if (water_cut == null || water_cut <= 2) {
|
|
|
+ return "";
|
|
|
+ } else if (water_cut > 2 && water_cut <= 40) {
|
|
|
+ return "color_level2";
|
|
|
+ } else if (water_cut > 40 && water_cut <= 8) {
|
|
|
+ return "color_level3";
|
|
|
+ } else {
|
|
|
+ return "color_level4";
|
|
|
+ }
|
|
|
+ }
|
|
|
const onSelectChange = (keys: any) => {
|
|
|
selectedRowKeys.value = keys;
|
|
|
};
|
|
@@ -246,6 +338,13 @@ export default defineComponent({
|
|
|
formState.total = result.total;
|
|
|
loading.value = false;
|
|
|
}
|
|
|
+ const handleTableChange: TableProps['onChange'] = (
|
|
|
+ pag: { pageSize: number; current: number },
|
|
|
+ ) => {
|
|
|
+ formState.page = pag.current;
|
|
|
+ formState.rows = pag.pageSize;
|
|
|
+ loadData();
|
|
|
+ };
|
|
|
const onRangeChange = (dateString, begin, end) => {
|
|
|
formState[begin] = dateString ? dateString[0].format("YYYY-MM-DD") : '';
|
|
|
formState[end] = dateString ? dateString[1].format("YYYY-MM-DD") : '';
|
|
@@ -256,6 +355,9 @@ export default defineComponent({
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ const detail = (well_id) => {
|
|
|
+ tabsViewStore.addTabByPath('/wellinfo/detail', {id: well_id});
|
|
|
+ }
|
|
|
const onQuery = () => {
|
|
|
loadData();
|
|
|
}
|
|
@@ -263,7 +365,7 @@ export default defineComponent({
|
|
|
data: [],
|
|
|
expandedKeys: [''],
|
|
|
selectedKeys: [''],
|
|
|
- autoExpandParent:true,
|
|
|
+ autoExpandParent: true,
|
|
|
searchStr: ''
|
|
|
});
|
|
|
const getSubjectTree = async function () {
|
|
@@ -332,9 +434,9 @@ export default defineComponent({
|
|
|
return {
|
|
|
route, selectedRowKeys, columns, loading, activeTab, showTree, onSelectChange, data,
|
|
|
expand, onQuery, loadData, onRangeChange, showQuery, wellTypeList, replaceFields,
|
|
|
- formRef,
|
|
|
+ formRef, viewModel, handleTableChange, detail,
|
|
|
formState,
|
|
|
- labelCol,
|
|
|
+ labelCol, getTdColor,
|
|
|
tabChange,
|
|
|
treeOnExpand,
|
|
|
subjectTrees,
|
|
@@ -349,16 +451,7 @@ export default defineComponent({
|
|
|
}
|
|
|
});
|
|
|
</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
-.ant-form-item {
|
|
|
- margin: 0 0 10px !important;
|
|
|
-}
|
|
|
-
|
|
|
-.ant-form-item-label label {
|
|
|
- width: 100% !important;
|
|
|
- background-color: #2dd36f;
|
|
|
-}
|
|
|
+<style lang="less">
|
|
|
|
|
|
.query-index {
|
|
|
display: flex;
|
|
@@ -427,8 +520,48 @@ export default defineComponent({
|
|
|
max-height: 600px;
|
|
|
}
|
|
|
|
|
|
-.query-index-row {
|
|
|
+.col-text {
|
|
|
+ padding-right: 0px !important;
|
|
|
+ text-align: right;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+
|
|
|
+.col-content {
|
|
|
+ width: 200px;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ white-space: nowrap;
|
|
|
+}
|
|
|
+
|
|
|
+.ant-card-body {
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.well-card-table {
|
|
|
+ th {
|
|
|
+ width: 25%;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ td {
|
|
|
+ width: 25%;
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.color_level1, .color_level1:hover {
|
|
|
+}
|
|
|
+
|
|
|
+.color_level2, .color_level2:hover {
|
|
|
+ background-color: #EAF4FF !important;
|
|
|
+}
|
|
|
+
|
|
|
+.color_level3, .color_level3:hover {
|
|
|
+ background-color: #D5EAFF;
|
|
|
+}
|
|
|
|
|
|
+.color_level4, .color_level4:hover {
|
|
|
+ background-color: #B7DBFF;
|
|
|
}
|
|
|
</style>
|
|
|
|