导出模板修改
This commit is contained in:
@@ -139,10 +139,9 @@
|
||||
|
||||
},
|
||||
{
|
||||
title: '行政等级',
|
||||
title: '区域等级',
|
||||
dataIndex: 'regionLevel',
|
||||
sorter: true,
|
||||
|
||||
},
|
||||
{
|
||||
title: '条目',
|
||||
|
||||
@@ -10,11 +10,10 @@
|
||||
<a-row>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="测点名称:">
|
||||
<a-select v-model:value.trim="where.place" allowClear showSearch>
|
||||
<a-select v-model:value="where.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item, index) in palceOptions"
|
||||
:value="item.value"
|
||||
:key="index"
|
||||
v-for="(item) in palceOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
@@ -22,11 +21,10 @@
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="路段:">
|
||||
<a-select v-model:value.trim="where.road" allowClear showSearch>
|
||||
<a-select v-model:value="where.road" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item, index) in roadOptions"
|
||||
:value="item.value"
|
||||
:key="index"
|
||||
v-for="(item) in roadOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
@@ -34,11 +32,10 @@
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="城区">
|
||||
<a-select v-model:value.trim="where.area" allowClear showSearch>
|
||||
<a-select v-model:value="where.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item, index) in areaOptions"
|
||||
:value="item.value"
|
||||
:key="index"
|
||||
v-for="(item) in areaOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
@@ -379,6 +376,15 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md="12" :sm="24">
|
||||
<a-form-item label="备注" name="remark">
|
||||
<a-input
|
||||
v-model:value="form.remark"
|
||||
placeholder="请输入备注"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
@@ -643,6 +649,16 @@ export default {
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "区域等级",
|
||||
dataIndex: "regionLevel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "创建人",
|
||||
dataIndex: "username",
|
||||
|
||||
@@ -9,12 +9,22 @@
|
||||
>
|
||||
<a-row>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="测点名称:">
|
||||
<a-select v-model:value.trim="where.place" allowClear showSearch>
|
||||
<a-form-item label="区域等级:">
|
||||
<a-select v-model:value="where.regionLevel" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item, index) in palceOptions"
|
||||
:value="item.value"
|
||||
:key="index"
|
||||
v-for="(item) in regionLevelOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="测点名称:">
|
||||
<a-select v-model:value="where.place" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item) in palceOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
@@ -22,11 +32,10 @@
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="路段:">
|
||||
<a-select v-model:value.trim="where.road" allowClear showSearch>
|
||||
<a-select v-model:value="where.road" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item, index) in roadOptions"
|
||||
:value="item.value"
|
||||
:key="index"
|
||||
v-for="(item) in roadOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
@@ -34,11 +43,10 @@
|
||||
</a-col>
|
||||
<a-col :lg="6" :md="12" :sm="24" :xs="24">
|
||||
<a-form-item label="城区">
|
||||
<a-select v-model:value.trim="where.area" allowClear showSearch>
|
||||
<a-select v-model:value="where.area" allowClear showSearch>
|
||||
<a-select-option
|
||||
v-for="(item, index) in areaOptions"
|
||||
:value="item.value"
|
||||
:key="index"
|
||||
v-for="(item) in areaOptions"
|
||||
:key="item.value"
|
||||
>{{ item.label }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
@@ -266,6 +274,16 @@ export default {
|
||||
title: "声校准仪器编号",
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "区域等级",
|
||||
dataIndex: "regionLevel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "创建人",
|
||||
@@ -276,6 +294,7 @@ export default {
|
||||
palceOptions: [],
|
||||
areaOptions: [],
|
||||
roadOptions: [],
|
||||
regionLevelOptions: [],
|
||||
// 表格搜索条件
|
||||
where: {
|
||||
checked: 1,
|
||||
@@ -314,6 +333,14 @@ export default {
|
||||
};
|
||||
});
|
||||
});
|
||||
getColumnOptions("region_level").then((res) => {
|
||||
this.regionLevelOptions = res.data.data.map((item) => {
|
||||
return {
|
||||
label: item,
|
||||
value: item,
|
||||
};
|
||||
});
|
||||
});
|
||||
},
|
||||
/* 刷新表格 */
|
||||
reload() {
|
||||
@@ -332,6 +359,11 @@ export default {
|
||||
},
|
||||
exportFile() {
|
||||
const columns = [
|
||||
{
|
||||
title: "行政区划代码",
|
||||
dataIndex: "regionCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "监测年度",
|
||||
dataIndex: "monitorYear",
|
||||
@@ -391,6 +423,11 @@ export default {
|
||||
title: "测点参照物",
|
||||
dataIndex: "refObj",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "路段覆盖人口(万人)",
|
||||
dataIndex: "people",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "月",
|
||||
@@ -495,16 +532,22 @@ export default {
|
||||
dataIndex: "soundInstrumentCode",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "区域等级",
|
||||
dataIndex: "regionLevel",
|
||||
sorter: true,
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
dataIndex: "remark",
|
||||
sorter: true,
|
||||
},
|
||||
];
|
||||
const arr = [];
|
||||
const th = columns.map((item) => item.title);
|
||||
th.unshift("行政区划代码");
|
||||
th.push("备注");
|
||||
arr.push(th);
|
||||
this.data.forEach((d) => {
|
||||
const td = columns.map((item) => d[item.dataIndex]);
|
||||
td.unshift("")
|
||||
// td.push("备注")
|
||||
arr.push(td);
|
||||
});
|
||||
let sheet = XLSX.utils.aoa_to_sheet(arr);
|
||||
|
||||
Reference in New Issue
Block a user