diff --git a/src/utils/exportExcel.js b/src/utils/exportExcel.js
index 8430e76..4ca14d9 100644
--- a/src/utils/exportExcel.js
+++ b/src/utils/exportExcel.js
@@ -11,6 +11,12 @@ export function easyExport(data, fileName = '导出文件') {
const wb = XLSX.utils.book_new();
// 二维数组例子:[ ['姓名', '年龄', '城市'], ['张三', 25, '北京'], ['李四', 30, '上海'] ];
const ws = XLSX.utils.aoa_to_sheet(data); // aoa_to_sheet 方法将二维数组转换为工作表
+
+
+
+ // 宽度调整
+ ws['!cols'] = Array(data?.[0]?.length || 0).fill({ wpx: 80 });
+
XLSX.utils.book_append_sheet(wb, ws, "Sheet1");
XLSX.writeFile(wb, fileName + '.xlsx');
}
diff --git a/src/views/backOfficeSystem/fourColorManage/warningControl/behaviorWarning/index.vue b/src/views/backOfficeSystem/fourColorManage/warningControl/behaviorWarning/index.vue
index 91ef6c8..1c39ee0 100644
--- a/src/views/backOfficeSystem/fourColorManage/warningControl/behaviorWarning/index.vue
+++ b/src/views/backOfficeSystem/fourColorManage/warningControl/behaviorWarning/index.vue
@@ -10,6 +10,7 @@
搜索
关闭搜索
+ 导出
@@ -19,11 +20,12 @@
+ :key="pageData.keyCount" :tableConfiger="pageData.tableConfiger" :controlsWidth="pageData.controlsWidth"
+ :expand="true" @chooseData="handleChooseData">
{{ row.xwcs }}
-
+
@@ -80,6 +82,9 @@ import FkDialog from "@/views/backOfficeSystem/fourColorManage/warningControl/ce
import { reactive, ref, onMounted, getCurrentInstance, computed, watch, nextTick } from "vue";
import AddFrom from './components/addFrom.vue'
import { holographicProfileJump } from "@/utils/tools.js"
+import { getMultiDictVal } from "@/utils/dict.js"
+import { exportExlByObj } from "@/utils/exportExcel.js"
+
const { proxy } = getCurrentInstance();
const { D_GS_SSYJ, D_GSXT_YJXX_CZZT } = proxy.$dict("D_GS_SSYJ", "D_GSXT_YJXX_CZZT"); //获取字典数据
@@ -90,6 +95,8 @@ const dict = ref({
D_GSXT_YJXX_CZZT
})
const searchBox = ref(); //搜索框
+/** 选中项 */
+const selectRows = ref([])
const bqLbData = ref({
bqXl: []
})
@@ -112,7 +119,7 @@ const pageData = reactive({
keyCount: 0,
tableConfiger: {
rowHieght: 61,
- showSelectType: "null",
+ showSelectType: "checkBox",
loading: false,
haveControls: true
},
@@ -130,7 +137,7 @@ const pageData = reactive({
{ label: "行为子类", prop: "xwzlmc", showOverflowTooltip: true },
{ label: "行为描述", prop: "xwms", showOverflowTooltip: true },
{ label: "行为次数", prop: "xwcs", showSolt: true },
- { label: "行为颜色", prop: "bqYs", showSolt: true },
+ { label: "行为颜色", prop: "bqys", showSolt: true },
{ label: "行为分值", prop: "xwfz", },
{ label: "处置状态", prop: "czzt", showSolt: true },
{ label: "所属县局", prop: "ssbm" },
@@ -298,6 +305,39 @@ const tabHeightFn = () => {
tabHeightFn();
};
};
+
+
+/** 触发选中 */
+const handleChooseData = (val) => {
+ selectRows.value = val
+}
+const exportExl = () => {
+ const titleObj = {
+ xm: "姓名",
+ sfzh: "身份证号",
+ dh: "电话",
+ xldlmc: "行为大类",
+ xwzlmc: "行为子类",
+ xwms: "行为描述",
+ xwcs: "行为次数",
+ bqys_cname: "行为颜色",
+ xwfz: "行为分值",
+ czzt_cname: "处置状态",
+ ssbm: "所属县局",
+ }
+ /** 导出【选中】的数据 (没有就全部)*/
+ const needArr = selectRows.value?.length > 0 ? selectRows.value : pageData.tableData
+ const data = needArr.map(item => {
+ return {
+ ...item,
+ bqys_cname: getMultiDictVal(item.bqys, D_GS_SSYJ),
+ czzt_cname: getMultiDictVal(item.czzt, D_GSXT_YJXX_CZZT),
+ }
+ })
+ exportExlByObj(titleObj, data, '行为预警')
+
+}
+