-11
This commit is contained in:
@@ -12,37 +12,7 @@
|
||||
:visiable="visiable"
|
||||
:loading="loading"
|
||||
/>
|
||||
<!-- 表格 -->
|
||||
<!-- <ele-pro-table
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="drinkingWaterId"
|
||||
:datasource="url"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@done="(d) => (data = d.data)"
|
||||
>
|
||||
<template #county="{text}">
|
||||
{{text="市区"}}
|
||||
</template>
|
||||
|
||||
<template #enumber="{ text, record }">
|
||||
<div class="editable-cell">
|
||||
<div v-if="editableData[record.key]" class="editable-cell-input-wrapper">
|
||||
<a-input v-model:value="editableData[record.key].name" @pressEnter="save(record.key)" />
|
||||
<check-outlined class="editable-cell-icon-check" @click="save(record.key)" />
|
||||
</div>
|
||||
<div v-else class="editable-cell-text-wrapper">
|
||||
{{ text || ' ' }}
|
||||
<edit-outlined class="editable-cell-icon" @click="edit(record.key)" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</ele-pro-table> -->
|
||||
|
||||
|
||||
|
||||
|
||||
<ele-pro-table ref="table" row-key="drinkingWaterId" :datasource="datasource" :columns="columns" :where="where"
|
||||
:scroll="{ x: 'max-content' }" @done="(d) => (data = d.data)">
|
||||
<template #county="{text}">
|
||||
@@ -50,18 +20,58 @@
|
||||
</template>
|
||||
|
||||
<template #enumber="{ text, record ,index }">
|
||||
|
||||
<div class="editable-cell">
|
||||
<div v-if="editableData[index]" class="editable-cell-input-wrapper">
|
||||
<a-input v-model:value="editableData[index].place" @pressEnter="save(record,index)" />
|
||||
<check-outlined class="editable-cell-icon-check" @click="save(record,index)" />
|
||||
<div v-if="editableData[index] && editableData[index].edable=='index1'" class="editable-cell-input-wrapper">
|
||||
<a-input v-model:value="editableData[index][index3]" @pressEnter="save(editableData[index],index)" />
|
||||
<check-outlined class="editable-cell-icon-check" @click="save(editableData[index],index)" />
|
||||
</div>
|
||||
<div v-else class="editable-cell-text-wrapper">
|
||||
{{ text || ' ' }}
|
||||
<edit-outlined class="editable-cell-icon" @click="edit(record,index)" />
|
||||
<edit-outlined class="editable-cell-icon" @click="edit(record,index,'index3')" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template #wnumber="{ text, record ,index }">
|
||||
<div class="editable-cell">
|
||||
<div v-if="editableData[index] && editableData[index].edable=='index2'" class="editable-cell-input-wrapper">
|
||||
<a-input v-model:value="editableData[index][index4]" @pressEnter="save(editableData[index],index)" />
|
||||
<check-outlined class="editable-cell-icon-check" @click="save(editableData[index],index)" />
|
||||
</div>
|
||||
<div v-else class="editable-cell-text-wrapper">
|
||||
{{ text || ' ' }}
|
||||
<edit-outlined class="editable-cell-icon" @click="edit(record,index,'index4')" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #desc="{ text, record ,index }">
|
||||
<div class="editable-cell">
|
||||
<div v-if="editableData[index] && editableData[index].edable=='index6'" class="editable-cell-input-wrapper">
|
||||
<a-input v-model:value="editableData[index][index6]" @pressEnter="save(editableData[index],index)" />
|
||||
<check-outlined class="editable-cell-icon-check" @click="save(editableData[index],index)" />
|
||||
</div>
|
||||
<div v-else class="editable-cell-text-wrapper">
|
||||
{{ text || ' ' }}
|
||||
<edit-outlined class="editable-cell-icon" @click="edit(record,index,'index6')" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #remark="{ text, record ,index }">
|
||||
<div class="editable-cell">
|
||||
<div v-if="editableData[index] && editableData[index].edable=='remark'" class="editable-cell-input-wrapper">
|
||||
<a-input v-model:value="editableData[index][remark]" @pressEnter="save(editableData[index],index)" />
|
||||
<check-outlined class="editable-cell-icon-check" @click="save(editableData[index],index)" />
|
||||
</div>
|
||||
<div v-else class="editable-cell-text-wrapper">
|
||||
{{ text || ' ' }}
|
||||
<edit-outlined class="editable-cell-icon" @click="edit(record,index,'remark')" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
</ele-pro-table>
|
||||
|
||||
</a-card>
|
||||
@@ -120,10 +130,11 @@ export default {
|
||||
{key: "index",title:"序号",dataIndex: "index",width: 48,align: "center",customRender: ({ index }) => index + 1,},
|
||||
{title:"城市",dataIndex:"city",},
|
||||
{title:"县城",dataIndex:"county",slots:{customRender:'county'}},
|
||||
{title:"水源地名称",dataIndex:"place",},
|
||||
{title:"水源地名称",dataIndex:"sourceWaterName",},
|
||||
{title:"类型",dataIndex:"waterSourceProperty",},
|
||||
{title:"监测时间",dataIndex:"reportTime",customRender: ({text}) => moment(text, "YYYY/MM/DD HH:mm:ss").format("YYYY/MM/DD")},
|
||||
{title:"应当监测项目个数",dataIndex:'',filters:[
|
||||
{title:"监测时间",dataIndex:"reportTime"},
|
||||
// {title:"监测时间",dataIndex:"reportTime",customRender: ({text}) => moment(text, "YYYY/MM/DD HH:mm:ss").format("YYYY/MM/DD")},
|
||||
{title:"应当监测项目个数",dataIndex:'index1',filters:[
|
||||
{
|
||||
text: '61',
|
||||
value: '61',
|
||||
@@ -137,16 +148,22 @@ export default {
|
||||
value: '64',
|
||||
},
|
||||
]},
|
||||
{title:"未测个数",dataIndex:"",},
|
||||
{title:"独立分析项目个数",dataIndex:"place",
|
||||
{title:"未测个数",dataIndex:"index2",},
|
||||
{title:"独立分析项目个数",dataIndex:"index3",
|
||||
slots: {
|
||||
customRender: 'enumber',
|
||||
},
|
||||
},
|
||||
},
|
||||
{title:"外送分析项目个数",dataIndex:"",},
|
||||
{title:"超标项目",dataIndex:"",},
|
||||
{title:"情况说明或原因",dataIndex:""},
|
||||
{title:"备注",dataIndex:"remark"},
|
||||
{title:"外送分析项目个数",dataIndex:"index4", slots: {
|
||||
customRender: 'wnumber',
|
||||
},},
|
||||
{title:"超标项目",dataIndex:"index5",},
|
||||
{title:"情况说明或原因",dataIndex:"index6", slots: {
|
||||
customRender: 'desc',
|
||||
}},
|
||||
{title:"备注",dataIndex:"remark",slots: {
|
||||
customRender: 'remark',
|
||||
},},
|
||||
],
|
||||
|
||||
|
||||
@@ -182,15 +199,16 @@ export default {
|
||||
},
|
||||
|
||||
//编辑单元格
|
||||
edit(item,index){
|
||||
edit(item,index,key){
|
||||
this.editableData[index] = item
|
||||
this.editableData[index].edable=key
|
||||
},
|
||||
|
||||
save(item,index){
|
||||
console.log('item',item)
|
||||
|
||||
this.datasource[index] = item
|
||||
this.editableData = []
|
||||
console.log('item.remark', item.remark)
|
||||
this.datasource[index] = item
|
||||
this.editableData = []
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
v-model:selection="selectionList"
|
||||
ref="table"
|
||||
row-key="drinkingWaterId"
|
||||
:datasource="url"
|
||||
:datasource="datasource"
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
:where="where"
|
||||
:scroll="{ x: 'max-content' }"
|
||||
@@ -32,10 +33,12 @@
|
||||
// import _ from "lodash";
|
||||
import XLSX from "xlsx";
|
||||
import Search from "./../components/search.vue";
|
||||
|
||||
import {
|
||||
pageDrinkingWaterStatisticUrl,
|
||||
// getColumnOptions
|
||||
} from "@/api/ecology/drinking-water";
|
||||
getWaterCount
|
||||
} from "@/api/ecology/new-drinking-water";
|
||||
|
||||
|
||||
import locale from "ant-design-vue/es/date-picker/locale/zh_CN";
|
||||
// import { tableColumns } from "./colums";
|
||||
|
||||
@@ -65,7 +68,6 @@ export default {
|
||||
locale,
|
||||
bill: {},
|
||||
// 表格数据接口
|
||||
url: pageDrinkingWaterStatisticUrl,
|
||||
selection: [],
|
||||
columns: [
|
||||
{title: "水源名称",dataIndex: "sourceWaterName",sorter: true,},
|
||||
@@ -84,12 +86,30 @@ export default {
|
||||
},
|
||||
// 表格选中数据
|
||||
selectionList: [],
|
||||
loading: false
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
// this.loadOptionData();
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 获取列表数据
|
||||
getPageData(){
|
||||
this.loading = true;
|
||||
getWaterCount(this.where).then(res=>{
|
||||
this.loading = false;
|
||||
if(res.data.code){
|
||||
this.$message.error(res.data.msg);
|
||||
this.datasource = []
|
||||
}else{
|
||||
this.datasource = res.data.data
|
||||
}
|
||||
}).catch(()=>{
|
||||
this.loading = false;
|
||||
})
|
||||
},
|
||||
|
||||
JumpFieldClick(record, column) {
|
||||
console.log(column.dataIndex);
|
||||
},
|
||||
@@ -107,9 +127,10 @@ export default {
|
||||
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
this.$refs.table.reload({
|
||||
where: this.where,
|
||||
});
|
||||
this.getPageData()
|
||||
// this.$refs.table.reload({
|
||||
// where: this.where,
|
||||
// });
|
||||
},
|
||||
/* 重置搜索 */
|
||||
reset() {
|
||||
|
||||
Reference in New Issue
Block a user