|
@@ -91,7 +91,7 @@
|
|
|
multiple
|
|
|
tree-line
|
|
|
:tree-data="subjectTrees.organizationTree"
|
|
|
- tree-node-filter-prop="label" >
|
|
|
+ tree-node-filter-prop="label">
|
|
|
</a-tree-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -106,7 +106,7 @@
|
|
|
multiple
|
|
|
tree-line
|
|
|
:tree-data="subjectTrees.constructUnitTree"
|
|
|
- tree-node-filter-prop="label" >
|
|
|
+ tree-node-filter-prop="label">
|
|
|
</a-tree-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -300,7 +300,7 @@
|
|
|
<a-list-item v-if="item.file_name.indexOf(docKey)>-1||docKey==''">
|
|
|
<template #actions>
|
|
|
<filePreview :fileName="item.file_name" :filePath="item.storage_path"></filePreview>
|
|
|
- <a-button type="link" @click="downFile(item)" functioncode="T010502" danger>下载</a-button>
|
|
|
+ <a-button type="link" @click="downFile(item)" functioncode="T010501" danger>下载</a-button>
|
|
|
</template>
|
|
|
<a-list-item-meta
|
|
|
:description="item.file_business_type">
|
|
@@ -323,9 +323,9 @@
|
|
|
import {ref, defineComponent, computed, watch} from 'vue';
|
|
|
import type {FormInstance} from 'ant-design-vue';
|
|
|
import {useRoute} from 'vue-router';
|
|
|
-import { get,postData} from "@/api/common";
|
|
|
+import {get, postData} from "@/api/common";
|
|
|
import {getPaginationTotalTitle} from "@/utils/common";
|
|
|
-import { message } from 'ant-design-vue';
|
|
|
+import {message} from 'ant-design-vue';
|
|
|
import type {TableProps} from "ant-design-vue";
|
|
|
import {useTabsViewStore} from "@/store/modules/tabsView";
|
|
|
import ChartCell from '@/components/basic/chart/chart-cell.vue'
|
|
@@ -355,8 +355,8 @@ export default defineComponent({
|
|
|
const tabsViewStore = useTabsViewStore();
|
|
|
const docKey = ref('');
|
|
|
const docList = ref([]);
|
|
|
- const wellTypeList = ref([{label: "直井", value: "直井"}, {label: "定向井", value: "定向井"}, {label: "分支井",value: "分支井"}]);
|
|
|
- const wellPurposeList = ref([{label: "探井", value: "探井"}, {label: "开发井", value: "开发井"}, {label: "水井",value: "水井"}]);
|
|
|
+ const wellTypeList = ref([{label: "直井", value: "直井"}, {label: "定向井", value: "定向井"}, {label: "分支井", value: "分支井"}]);
|
|
|
+ const wellPurposeList = ref([{label: "探井", value: "探井"}, {label: "开发井", value: "开发井"}, {label: "水井", value: "水井"}]);
|
|
|
const replaceFields = {
|
|
|
children: 'children',
|
|
|
title: 'label',
|
|
@@ -364,14 +364,14 @@ export default defineComponent({
|
|
|
};
|
|
|
|
|
|
const downFile = (record: any) => {
|
|
|
- download(record.file_business_type, record.file_name);
|
|
|
+ download(record.storage_path, record.file_name);
|
|
|
};
|
|
|
const resetFields = function () {
|
|
|
let keys: string[] = Object.keys(formState);
|
|
|
keys.forEach(key => {
|
|
|
if (typeof (formState[key]) == "string") {
|
|
|
formState[key] = '';
|
|
|
- }else if(typeof (formState[key]) == "object"){
|
|
|
+ } else if (typeof (formState[key]) == "object") {
|
|
|
formState[key] = [];
|
|
|
}
|
|
|
})
|
|
@@ -379,33 +379,59 @@ export default defineComponent({
|
|
|
|
|
|
filterColumns.value = [...columns];
|
|
|
|
|
|
- watch(
|
|
|
- () => showColumnType.value,
|
|
|
- () => {
|
|
|
- const filterValue = columns.filter((item: any) => {
|
|
|
- if (!showColumnType.value.includes("oil")) {
|
|
|
- if (["oil_prod_mon", "oil_prod_year", "oil"].includes(item.dataIndex)) {
|
|
|
- return false
|
|
|
- }
|
|
|
+ function showColumnTypeChange() {
|
|
|
+ const filterValue = columns.filter((item: any) => {
|
|
|
+ if (!showColumnType.value.includes("oil")) {
|
|
|
+ if (["oil_prod_mon", "oil_prod_year", "oil"].includes(item.dataIndex)) {
|
|
|
+ return false
|
|
|
}
|
|
|
- if (!showColumnType.value.includes("gas")) {
|
|
|
- if (["gas_prod_mon", "gas_prod_year", "gas"].includes(item.dataIndex)) {
|
|
|
- return false
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (!showColumnType.value.includes("gas")) {
|
|
|
+ if (["gas_prod_mon", "gas_prod_year", "gas"].includes(item.dataIndex)) {
|
|
|
+ return false
|
|
|
}
|
|
|
- if (!showColumnType.value.includes("water")) {
|
|
|
- if (["water_prod_mon", "water_prod_year", "water"].includes(item.dataIndex)) {
|
|
|
- return false
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (!showColumnType.value.includes("water")) {
|
|
|
+ if (["water_prod_mon", "water_prod_year", "water"].includes(item.dataIndex)) {
|
|
|
+ return false
|
|
|
}
|
|
|
- return true
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ })
|
|
|
+ //拖拽后在显示隐藏列则需要按拖拽后的列排序
|
|
|
+ const sortedArray = filterValue.sort((a, b) => {
|
|
|
+ const indexA = filterColumns.value.findIndex(f=>f.key==a.key);
|
|
|
+ const indexB = filterColumns.value.findIndex(f=>f.key==b.key);
|
|
|
+ return (indexA==-1||indexB==-1)?1: indexA - indexB;
|
|
|
+ });
|
|
|
+ filterColumns.value = [...sortedArray];
|
|
|
+ setSettingColoumns();
|
|
|
+ }
|
|
|
+
|
|
|
+ function getSettingColoumns() {
|
|
|
+ let userColumnsJson = localStorage.getItem('userColumns');
|
|
|
+ let userShowColumnsType = localStorage.getItem('userShowColumnsType');
|
|
|
+ if (userColumnsJson != undefined) {
|
|
|
+ let array = new Array();
|
|
|
+ let userColumns = JSON.parse(userColumnsJson);
|
|
|
+ userColumns.forEach(it => {
|
|
|
+ array.push(columns.find(c => c.key == it.key));
|
|
|
})
|
|
|
- filterColumns.value = [...filterValue];
|
|
|
+ filterColumns.value = array;
|
|
|
+ }
|
|
|
+ if (userShowColumnsType != undefined) {
|
|
|
+ showColumnType.value = JSON.parse(userShowColumnsType);
|
|
|
}
|
|
|
- );
|
|
|
+ }
|
|
|
+
|
|
|
+ function setSettingColoumns() {
|
|
|
+ localStorage.setItem("userShowColumnsType", JSON.stringify(showColumnType.value));
|
|
|
+ localStorage.setItem("userColumns", JSON.stringify(filterColumns.value));
|
|
|
+ }
|
|
|
|
|
|
const preCheckValues = ref(Object.assign(showColumnType.value));
|
|
|
const onCheckboxChange = (checkValues: []) => {
|
|
|
+ showColumnTypeChange();
|
|
|
setTimeout(() => {
|
|
|
let tbody = document.getElementsByClassName("ant-table-body")[0];
|
|
|
if (tbody) {
|
|
@@ -443,7 +469,7 @@ export default defineComponent({
|
|
|
|
|
|
const loadData = async function () {
|
|
|
loading.value = true;
|
|
|
- const result: any = await postData('wellInfo/getList',formState);
|
|
|
+ const result: any = await postData('wellInfo/getList', formState);
|
|
|
|
|
|
data.value = result.list;
|
|
|
formState.total = result.total;
|
|
@@ -521,7 +547,7 @@ export default defineComponent({
|
|
|
})
|
|
|
.filter((item, i, self) => item && self.indexOf(item) === i);
|
|
|
|
|
|
- if (expanded.length==0) {
|
|
|
+ if (expanded.length == 0) {
|
|
|
message.warning('没有查询到相关目录');
|
|
|
}
|
|
|
subjectTrees.value.expandedKeys = expanded as string[];
|
|
@@ -580,7 +606,7 @@ export default defineComponent({
|
|
|
|
|
|
return {
|
|
|
route, selectedRowKeys, loading, activeTab, showTree, onSelectChange, data,
|
|
|
- expand, onQuery, loadData, onRangeChange, showQuery, wellTypeList,wellPurposeList, replaceFields,
|
|
|
+ expand, onQuery, loadData, onRangeChange, showQuery, wellTypeList, wellPurposeList, replaceFields,
|
|
|
formRef, viewModel, handleTableChange, detail,
|
|
|
formState, isShowDoc, showDoc, docKey, docList, resetFields, showColumnType, filterColumns,
|
|
|
labelCol, getTdColor, downFile,
|
|
@@ -588,11 +614,11 @@ export default defineComponent({
|
|
|
treeOnExpand,
|
|
|
subjectTrees,
|
|
|
getSubjectTree, searchTree,
|
|
|
- treeOnSelect, pagination,
|
|
|
+ treeOnSelect, pagination, getSettingColoumns,
|
|
|
};
|
|
|
},
|
|
|
- created
|
|
|
- () {
|
|
|
+ created() {
|
|
|
+ this.getSettingColoumns();
|
|
|
this.loadData();
|
|
|
}
|
|
|
,
|