diff --git a/src/views/activityList/index.vue b/src/views/activityList/index.vue
index e3a3316..513d971 100644
--- a/src/views/activityList/index.vue
+++ b/src/views/activityList/index.vue
@@ -95,12 +95,21 @@
stripe
height="600px"
v-loading="activityloading"
+ @header-click="handleHeaderClick"
>
-
+
+
+ 装置编号复制列
+
+
{{ protocolMap[scope.row.protocol] }}
@@ -153,6 +162,38 @@ export default {
this.getactivityList();
},
methods: {
+ async handleHeaderClick(column) {
+ console.log(column);
+ // 获取当前列的数据字段名
+ const dataField = column.property;
+ // 获取当前列的所有数据值
+ const columnData = this.termsData.map((row) => row[dataField]);
+ console.log(`当前列数据字段:${dataField}`);
+ console.log(`当前列数据值:${columnData}`);
+ this.copyToClipboard(columnData.join("\n"));
+ },
+ copyToClipboard(text) {
+ const textArea = document.createElement("textarea");
+ textArea.value = text;
+ document.body.appendChild(textArea);
+ textArea.focus();
+ textArea.select();
+ try {
+ const successful = document.execCommand("copy");
+ const msg = successful ? "成功复制到剪贴板" : "复制失败";
+ console.log(msg);
+ this.$message({
+ duration: 1500,
+ showClose: true,
+ message: msg,
+ type: "success",
+ });
+ } catch (err) {
+ console.error("复制失败:", err);
+ } finally {
+ document.body.removeChild(textArea);
+ }
+ },
//导出活动列表表格
handleExport() {
htmlToExcel.getExcel("#activityTable", "设备活动列表");
diff --git a/src/views/homePage/components/tableMain.vue b/src/views/homePage/components/tableMain.vue
index 300b9b3..c9af0c0 100644
--- a/src/views/homePage/components/tableMain.vue
+++ b/src/views/homePage/components/tableMain.vue
@@ -1527,7 +1527,13 @@ export default {
this.$parent.fetchData();
return `命令已下发`;
} else {
- return ` 剩余:${minutes} 分钟 ${seconds} 秒`;
+ if (minutes < 10 && seconds < 10) {
+ return ` 0${minutes} : 0${seconds} `;
+ } else if (minutes < 10) {
+ return ` 0${minutes} : ${seconds} `;
+ } else {
+ return ` ${minutes} : ${seconds} `;
+ }
}
},
},
diff --git a/vue.config.js b/vue.config.js
index 032641e..3ebd2bd 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -2,12 +2,12 @@ const { defineConfig } = require("@vue/cli-service");
module.exports = defineConfig({
//打包清除console
- chainWebpack(config) {
- config.optimization.minimizer("terser").tap((args) => {
- args[0].terserOptions.compress.drop_console = true;
- return args;
- });
- },
+ // chainWebpack(config) {
+ // config.optimization.minimizer("terser").tap((args) => {
+ // args[0].terserOptions.compress.drop_console = true;
+ // return args;
+ // });
+ // },
productionSourceMap: false, // 生产环境是否要生成 sourceMap
publicPath: process.env.PUBLIC_PATH ? process.env.PUBLIC_PATH : "./", // 部署应用包时的基本 URL
// assetsPublicPath: process.env.NODE_ENV === "production" ? "" : "/",