@@ -456,7 +470,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page"
- :page-sizes="$store.state.PAGESIZRS"
+ :page-sizes="pageSizeList"
:page-size="pageSize"
layout="total, sizes, prev, pager, next"
:total="Number(total)"
@@ -990,8 +1004,12 @@ export default {
},
data() {
return {
+ pageSizeList: [],
+ multipleSelection: [],
+ isAllChecked: false,
loading: false,
sendStatusArr: [
+ // { name: "未下发", value: 1 },
{ name: "成功", value: 1 },
{ name: "失败", value: 2 },
{ name: "部分成功", value: 3 },
@@ -1086,7 +1104,7 @@ export default {
pageSize: 10,
},
whoId: "",
- isIscDevice: false
+ isIscDevice: false,
};
},
computed: {
@@ -1118,6 +1136,7 @@ export default {
created() {
this.projectSn = this.$store.state.projectSn;
this.company = COMPANY;
+ this.pageSizeList = JSON.parse(JSON.stringify(this.$store.state.PAGESIZRS));
this.getMachineList();
this.getInfoList();
this.getProjectList();
@@ -1125,13 +1144,55 @@ export default {
this.getConfig();
},
methods: {
+ // 批量授权
+ onBatchSynchronization() {
+ if (this.multipleSelection.length == 0) {
+ this.$message.warning("请选择需要授权的数据!");
+ return;
+ }
+
+ console.log(this.multipleSelection);
+ const ids = this.multipleSelection.map((item) => item.id).join(",");
+ this.onBatchSynchronizationDeal(ids);
+ },
+ onBatchSynchronizationDeal(ids) {
+ // getHikvisionSyncApi({
+ // projectSn: this.projectSn,
+ // ids,
+ // }).then((res) => {
+ // if (res.code == 200) {
+ // this.$message.success(res.message);
+ // } else {
+ // this.$message.error(res.result.msg);
+ // }
+ // });
+ },
+ // 选中状态
+ handleSelectionChange(val) {
+ this.multipleSelection = val;
+ },
+ checkAllFn() {
+ // 全选按钮值切换
+ this.isAllChecked = !this.isAllChecked;
+ this.$refs.multipleTable.toggleAllSelection();
+ // this.checkedDataFn();
+ },
+ checkedDataFn() {
+ if (this.isAllChecked) {
+ this.tableData.map((item) => {
+ this.$refs.multipleTable.toggleRowSelection(item, true);
+ });
+ } else {
+ this.$refs.multipleTable.clearSelection();
+ }
+ },
getConfig() {
getProjectUfaceConfigInfo({
projectSn: this.$store.state.projectSn,
}).then((result) => {
if (result.success) {
if (result.result) {
- this.isIscDevice = result.result.supplierType == 9 ? true: false;
+ this.isIscDevice = result.result.supplierType == 9 ? true : false;
}
}
});
@@ -1283,6 +1344,11 @@ export default {
console.log(res.result);
this.total = res.result.total;
this.tableData = JSON.parse(JSON.stringify(res.result.records));
+ if (
+ +res.result.total > this.pageSizeList[this.pageSizeList.length - 1]
+ ) {
+ this.pageSizeList.push(+res.result.total);
+ }
}
});
},
@@ -1547,8 +1613,8 @@ export default {
});
},
tableRowClassName({ row, rowIndex }) {
- if(!this.isIscDevice){
- return
+ if (!this.isIscDevice) {
+ return;
}
if (row.sendSuccessStatus === 1) {
return "green2";