新增活动列表

master
fanluyan 2 years ago
parent c9278d0b2e
commit 6d80327ef8

@ -29,6 +29,10 @@ export default {
path: "/upgradation",
name: "上传Apk",
},
{
path: "/activity",
name: "活动列表",
},
],
};
},

@ -50,6 +50,15 @@ const routes = [
keepAlive: true,
},
},
{
path: "/activity",
component: () => import("../views/activityList/index.vue"),
name: "activity",
meta: {
title: "活动列表",
keepAlive: true,
},
},
],
},
];

@ -40,18 +40,7 @@ export function getqueryProtocolApi(data) {
},
});
}
//获取活动列表
export function getqueryActivityApi(data) {
return request({
url: "api/queryActivity.php",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//运维,快心跳
export function getdoActionApi(data) {
return request({
@ -134,3 +123,25 @@ export function getupdUpgradeApi(data) {
},
});
}
//新建活动和删除活动
export function updActivityApi(data) {
return request({
url: "api/updActivity.php",
method: "post",
data,
});
}
//获取活动列表和详细列表
export function getqueryActivityApi(data) {
return request({
url: "api/queryActivity.php",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}

@ -0,0 +1,258 @@
<template>
<div class="activityBox">
<div class="uploadForm">
<div class="noteBox">
<h3 class="lableBox">活动名称</h3>
<el-input
class="noteClass"
v-model="activityForm.title"
placeholder="输入活动名称"
@focus="inputfocus"
></el-input>
<p class="redErr" v-if="titleFlag">*</p>
</div>
<div class="upgradeBox">
<h3 class="lableBox">装置列表</h3>
<el-input
type="textarea"
:rows="32"
placeholder="请输入装置列表"
v-model="activityForm.cmdidArr"
@focus="textfocus"
>
</el-input>
<p class="redErr" v-if="cmdidFlag">*</p>
</div>
<el-button
class="uploadBtn"
size="small"
type="primary"
@click="submitUpload"
>上传活动列表</el-button
>
</div>
<div class="activityList">
<el-table
:data="activityData"
style="width: 100%"
border
stripe
height="calc(100% - 0px)"
v-loading="activityloading"
>
<el-table-column type="index" width="50" label="序号">
</el-table-column>
<el-table-column
prop="createTime"
label="创建时间"
width="180"
></el-table-column>
<el-table-column prop="title" label="活动名称"> </el-table-column>
<el-table-column prop="termCount" label="装置数量"> </el-table-column>
<!-- <el-table-column prop="path" label="文件路径"> </el-table-column> -->
<el-table-column label="操作" width="300" class-name="editClass">
<template slot-scope="scope">
<el-link
type="primary"
@click="handleEditClick(scope.row)"
size="small"
icon="el-icon-document"
>详情</el-link
>
<el-link
type="danger"
@click="handleDeleteClick(scope.row)"
size="small"
icon="el-icon-delete"
>删除</el-link
>
</template>
</el-table-column>
</el-table>
</div>
</div>
</template>
<script>
import { updActivityApi, getqueryActivityApi } from "@/utils/api/index";
export default {
name: "activity",
components: {},
data() {
return {
activityloading: true,
activityData: [], //
activityForm: {
title: "",
cmdidArr: "",
},
titleFlag: false, //title
cmdidFlag: false, //cmdid
};
},
computed: {},
mounted() {
this.getactivityList();
},
methods: {
//
getactivityList() {
this.activityloading = true;
this.activityData = [];
getqueryActivityApi({
act: "list",
})
.then((res) => {
console.log(res);
this.activityData = res.data;
this.activityloading = false;
})
.catch((err) => {});
},
//
handleEditClick(row) {
getqueryActivityApi({
act: "detail",
id: row.id,
})
.then((res) => {
console.log(res);
})
.catch((err) => {});
},
//
handleDeleteClick(row) {
console.log(row);
updActivityApi({
act: "del",
id: row.id,
})
.then((res) => {
console.log(res);
this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.$message({
duration: 1500,
showClose: true,
message: "文件删除成功",
type: "success",
});
this.getUpgradeList();
})
.catch(() => {
this.$message({
type: "info",
showClose: true,
message: "已取消删除",
});
});
})
.catch((err) => {});
},
//title
inputfocus() {
this.titleFlag = false;
},
//text
textfocus() {
this.cmdidFlag = false;
},
//
submitUpload() {
// let arrList = "";
// arrList = [...this.activityForm.cmdidArr.trim().split("\n")];
if (this.activityForm.title == "") {
this.titleFlag = true;
return;
}
if (this.activityForm.cmdidArr == "") {
this.cmdidFlag = true;
return;
}
console.log(this.activityForm.title);
console.log(this.activityForm.cmdidArr);
//console.log(arrList);
updActivityApi({
title: this.activityForm.title,
cmdids: this.activityForm.cmdidArr,
act: "new",
})
.then((res) => {
console.log(res);
this.getactivityList();
})
.catch((err) => {});
},
},
};
</script>
<style lang="less">
.activityBox {
height: calc(100% - 24px);
width: calc(100% - 24px);
padding: 12px;
display: flex;
.uploadForm {
min-width: 300px;
margin-right: 20px;
.noteBox {
margin-bottom: 16px;
position: relative;
.noteClass {
width: 100%;
}
.lableBox {
font-size: 14px;
font-weight: normal;
width: 78px;
line-height: 32px;
}
.redErr {
position: absolute;
font-size: 12px;
color: red;
}
}
.upgradeBox {
position: relative;
.lableBox {
font-size: 14px;
font-weight: normal;
width: 78px;
line-height: 32px;
}
.redErr {
position: absolute;
font-size: 12px;
color: red;
}
}
.uploadBtn {
margin-top: 16px;
margin-left: auto;
display: flex;
}
}
.activityList {
height: calc(100% - 0px);
flex: 1;
min-width: 0;
.el-table {
.el-table__cell {
text-align: center;
}
}
}
.editClass {
.el-link.el-link--primary {
margin-right: 14px;
}
}
}
</style>

@ -95,7 +95,7 @@
<el-tag type="danger" v-else>线</el-tag>
</template>
</el-table-column>
<el-table-column label="运维" prop="in_maintain" width="120" sortable>
<el-table-column label="运维" prop="in_maintain" width="100" sortable>
<template slot="header" slot-scope="scope">
<el-checkbox
:indeterminate="isIndeterminate"
@ -113,7 +113,7 @@
></el-checkbox>
</template>
</el-table-column>
<el-table-column label="快心跳" prop="quick_hb" width="128" sortable>
<el-table-column label="快心跳" prop="quick_hb" width="108" sortable>
<template slot="header" slot-scope="scope">
<el-checkbox
:indeterminate="isIndeterminate"
@ -179,11 +179,16 @@
</el-table-column>
<el-table-column label="心跳信息" v-if="xtcheck" key="xt">
<el-table-column label="次数" min-width="48">
<el-table-column
label="次数"
min-width="68"
sortable
:sort-method="sortnumberOfHb"
>
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
? scope.row.raw_report.msgs.numberOfHb
scope.row.raw_report.msgs.hasOwnProperty("numberOfHb")
? Number(scope.row.raw_report.msgs.numberOfHb)
: ""
}}
</template>
@ -218,20 +223,30 @@
}}
</template>
</el-table-column>
<el-table-column label="成功" min-width="48">
<el-table-column
label="成功"
min-width="70"
sortable
:sort-method="sortSuccess"
>
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
? scope.row.raw_report.msgs.success
scope.row.raw_report.msgs.hasOwnProperty("success")
? Number(scope.row.raw_report.msgs.success)
: ""
}}
</template>
</el-table-column>
<el-table-column label="失败" min-width="48">
<el-table-column
label="失败"
min-width="70"
sortable
:sort-method="sortFailure"
>
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
? scope.row.raw_report.msgs.failure
scope.row.raw_report.msgs.hasOwnProperty("failure")
? Number(scope.row.raw_report.msgs.failure)
: ""
}}
</template>
@ -326,19 +341,19 @@
</el-table-column>
</el-table-column>
<el-table-column label="SIM卡" v-if="simcheck" min-width="160" key="sim">
<el-table-column label="卡1" min-width="48" prop="simcard1">
<el-table-column label="卡1" width="148" prop="simcard1">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
scope.row.raw_report.msgs.hasOwnProperty("simcard1")
? scope.row.raw_report.msgs.simcard1
: ""
}}
</template>
</el-table-column>
<el-table-column label="卡2" min-width="48" prop="simcard2">
<el-table-column label="卡2" width="148" prop="simcard2">
<template slot-scope="scope">
{{
scope.row.raw_report.hasOwnProperty("msgs")
scope.row.raw_report.msgs.hasOwnProperty("simcard2")
? scope.row.raw_report.msgs.simcard2
: ""
}}
@ -354,8 +369,68 @@
}}
</template>
</el-table-column>
<el-table-column label="I1版本" v-if="i1check" min-width="160" key="I1">
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("i1Version")
? scope.row.raw_report.msgs.i1Version
: ""
}}
</template>
</el-table-column>
<el-table-column
label="运维版本"
v-if="ywbbcheck"
min-width="160"
key="ywbb"
>
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("maintainVersion")
? scope.row.raw_report.msgs.maintainVersion
: ""
}}
</template>
</el-table-column>
<el-table-column
label="Camera版本"
v-if="Cameracheck"
width="100"
key="Camera"
>
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("cameraService")
? scope.row.raw_report.msgs.cameraService
: ""
}}
</template>
</el-table-column>
<el-table-column label="AI版本" v-if="AIcheck" width="80" key="AI">
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("aiVersion")
? scope.row.raw_report.msgs.aiVersion
: ""
}}
</template>
</el-table-column>
<el-table-column
label="MCU版本"
v-if="MCUcheck"
min-width="160"
key="MCU"
>
<template slot-scope="scope">
{{
scope.row.raw_report.msgs.hasOwnProperty("mcu")
? scope.row.raw_report.msgs.mcu
: ""
}}
</template>
</el-table-column>
<!-- <el-table-column
label="版本"
min-width="120"
class-name="bbStyle"
@ -387,15 +462,9 @@
</p>
</el-tooltip>
<!-- <p>
<b>I1:</b>{{ scope.row.raw_report.msgs.i1Version }}<b>运维:</b
>{{ scope.row.raw_report.msgs.maintainVersion }}<b>Camera:</b
>{{ scope.row.raw_report.msgs.cameraService }}<b>AI:</b
>{{ scope.row.raw_report.msgs.aiVersion }}<b>MCU:</b
>{{ scope.row.raw_report.msgs.mcu }}
</p> -->
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<el-drawer
class="drawerBox"
@ -438,8 +507,20 @@
<el-checkbox v-model="cmacheck" @change="saveLocalStorage"
>CMA服务器</el-checkbox
>
<el-checkbox v-model="bbcheck" @change="saveLocalStorage"
>版本</el-checkbox
<el-checkbox v-model="i1check" @change="saveLocalStorage"
>I1版本</el-checkbox
>
<el-checkbox v-model="ywbbcheck" @change="saveLocalStorage"
>运维版本</el-checkbox
>
<el-checkbox v-model="Cameracheck" @change="saveLocalStorage"
>Camera版本</el-checkbox
>
<el-checkbox v-model="AIcheck" @change="saveLocalStorage"
>AI版本</el-checkbox
>
<el-checkbox v-model="MCUcheck" @change="saveLocalStorage"
>MCU版本</el-checkbox
>
</div>
</div>
@ -686,17 +767,22 @@ export default {
kxtNumber: 0,
nowTime: new Date().getTime() / 1000,
gycheck: false,
dccheck: true,
xtcheck: true,
gycheck: true,
dccheck: false,
xtcheck: false,
// xtcs: false,
// xtzq: false,
pzcheck: true,
wlcheck: true,
cqcheck: true,
cmacheck: false,
pzcheck: false,
wlcheck: false,
cqcheck: false,
simcheck: false,
bbcheck: true,
cmacheck: true,
// bbcheck: true,
i1check: true,
ywbbcheck: true,
Cameracheck: false,
AIcheck: false,
MCUcheck: false,
//
operateOptions: [
{ id: 1, name: "安卓重启" },
@ -879,7 +965,22 @@ export default {
Number(b.raw_report.msgs.networkError)
);
},
sortSuccess(a, b) {
return (
Number(a.raw_report.msgs.success) - Number(b.raw_report.msgs.success)
);
},
sortFailure(a, b) {
return (
Number(a.raw_report.msgs.failure) - Number(b.raw_report.msgs.failure)
);
},
sortnumberOfHb(a, b) {
return (
Number(a.raw_report.msgs.numberOfHb) -
Number(b.raw_report.msgs.numberOfHb)
);
},
// sortSignature1(a, b) {
// return (
// Number(a.raw_report.msgs.signature1.split("/")[0]) -
@ -1268,7 +1369,13 @@ export default {
localStorage.setItem("cqcheck", this.cqcheck);
localStorage.setItem("cmacheck", this.cmacheck);
localStorage.setItem("simcheck", this.simcheck);
localStorage.setItem("bbcheck", this.bbcheck);
localStorage.setItem("i1check", this.i1check);
localStorage.setItem("ywbbcheck", this.ywbbcheck);
localStorage.setItem("Cameracheck", this.Cameracheck);
localStorage.setItem("AIcheck", this.AIcheck);
localStorage.setItem("MCUcheck", this.MCUcheck);
this.adjustTableHeight();
},
loadLocalStorage() {
this.checkAllKXT = localStorage.getItem("checkAllKXT", this.checkAllKXT)
@ -1279,13 +1386,13 @@ export default {
: false;
this.gycheck = localStorage.getItem("gycheck")
? JSON.parse(localStorage.getItem("gycheck"))
: false;
: true;
this.dccheck = localStorage.getItem("dccheck")
? JSON.parse(localStorage.getItem("dccheck"))
: true;
: false;
this.xtcheck = localStorage.getItem("xtcheck")
? JSON.parse(localStorage.getItem("xtcheck"))
: true;
: false;
// this.xtcs = localStorage.getItem("xtcs")
// ? JSON.parse(localStorage.getItem("xtcs"))
// : false;
@ -1294,22 +1401,36 @@ export default {
// : false;
this.pzcheck = localStorage.getItem("pzcheck")
? JSON.parse(localStorage.getItem("pzcheck"))
: true;
: false;
this.wlcheck = localStorage.getItem("wlcheck")
? JSON.parse(localStorage.getItem("wlcheck"))
: true;
: false;
this.cqcheck = localStorage.getItem("cqcheck")
? JSON.parse(localStorage.getItem("cqcheck"))
: true;
this.cmacheck = localStorage.getItem("cmacheck")
? JSON.parse(localStorage.getItem("cmacheck"))
: false;
this.simcheck = localStorage.getItem("simcheck")
? JSON.parse(localStorage.getItem("simcheck"))
: false;
this.bbcheck = localStorage.getItem("bbcheck")
? JSON.parse(localStorage.getItem("bbcheck"))
this.cmacheck = localStorage.getItem("cmacheck")
? JSON.parse(localStorage.getItem("cmacheck"))
: true;
this.i1check = localStorage.getItem("i1check")
? JSON.parse(localStorage.getItem("i1check"))
: true;
this.ywbbcheck = localStorage.getItem("ywbbcheck")
? JSON.parse(localStorage.getItem("ywbbcheck"))
: true;
this.Cameracheck = localStorage.getItem("Cameracheck")
? JSON.parse(localStorage.getItem("Cameracheck"))
: false;
this.AIcheck = localStorage.getItem("AIcheck")
? JSON.parse(localStorage.getItem("AIcheck"))
: false;
this.MCUcheck = localStorage.getItem("MCUcheck")
? JSON.parse(localStorage.getItem("MCUcheck"))
: false;
console.log(
"规约:" + this.gycheck,
"电池:" + this.dccheck,
@ -1322,6 +1443,15 @@ export default {
"版本:" + this.bbcheck
);
},
adjustTableHeight() {
// window.resize
const resizeEvent = new Event("resize");
window.dispatchEvent(resizeEvent);
// 使 Vue nextTick DOM
this.$nextTick(() => {
this.$refs.ywMultipleTable.doLayout(); // el-table doLayout
});
},
},
};
</script>

Loading…
Cancel
Save