Commit 336787b0 authored by honghuiliu's avatar honghuiliu 💬

Merge remote-tracking branch 'origin/master'

parents e31bbace db8ad46e
......@@ -1775,6 +1775,63 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"ssri": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
......@@ -1783,6 +1840,28 @@
"requires": {
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
......@@ -5121,6 +5200,11 @@
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
"dev": true
},
"ezuikit-js": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/ezuikit-js/-/ezuikit-js-0.6.3.tgz",
"integrity": "sha512-nFaQXHALzGgXop4aZ23g96EmKT+IRfvibx4I4jLIcNAjXWI+PZk3g/365end7trMY646+5BeP0kn9CXzHH9s1g=="
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
......@@ -10709,87 +10793,6 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"loader-utils": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.2.tgz",
"integrity": "sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A==",
"dev": true,
"optional": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^3.0.0",
"json5": "^2.1.2"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "4.0.12",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.0.12.tgz",
......
......@@ -11,6 +11,7 @@
"core-js": "^3.6.5",
"dayjs": "^1.10.7",
"element-plus": "^2.0.1",
"ezuikit-js": "^0.6.3",
"pinia": "^2.0.14",
"vue": "^3.0.0",
"vue-router": "^4.0.0-0",
......
<template>
<div class="hello-ezuikit-js">
<div id="video-container" style="flex: 1;"></div>
<div style="flex-shrink: 0;padding:5px 0;text-align: right">
<el-button type="primary" @click="stop">暂停</el-button>
<el-button type="primary" @click="play">播放</el-button>
<!--<el-button @click="openSound">openSound</el-button>-->
<!--<el-button @click="closeSound">closeSound</el-button>-->
<!--<el-button @click="startSave">startSave</el-button>-->
<!--<el-button @click="stopSave">stopSave</el-button>-->
<!--<el-button @click="capturePicture">capturePicture</el-button>-->
<!--<el-button @click="fullScreen">fullScreen</el-button>-->
<!--<el-button @click="getOSDTime">getOSDTime</el-button>-->
<!--<el-button @click="ezopenStartTalk">开始对讲</el-button>-->
<!--<el-button @click="ezopenStopTalk">结束对讲</el-button>-->
<!--<el-button @click="destroy">销毁</el-button>-->
</div>
</div>
</template>
<script>
import EZUIKit from "ezuikit-js";
let player = null;
export default {
name: "esu",
props: {
url: String,
accessToken: String,
},
data(){
return {
next_time:Date.now()
}
},
mounted(){
this.init();
window.addEventListener('onresize',this.resize);
},
methods: {
play() {
const playPromise = player.play();
playPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
stop() {
const stopPromise = player.stop();
stopPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
getOSDTime() {
const getOSDTimePromise = player.getOSDTime();
getOSDTimePromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
capturePicture() {
const capturePicturePromise = player.capturePicture(`${new Date().getTime()}`);
capturePicturePromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
openSound() {
const openSoundPromise = player.openSound();
openSoundPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
closeSound() {
const openSoundPromise = player.closeSound();
openSoundPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
startSave() {
const startSavePromise = player.startSave(`${new Date().getTime()}`);
startSavePromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
stopSave() {
const stopSavePromise = player.stopSave();
stopSavePromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
ezopenStartTalk() {
player.startTalk();
},
ezopenStopTalk() {
player.stopTalk();
},
fullScreen() {
player.fullScreen();
},
destroy() {
const destroyPromise = player.destroy();
destroyPromise.then((data) => {
console.log("promise 获取 数据", data)
})
},
resize(){
if(Date.now() - this.next_time>600){
this.next_time = Date.now();
}
},
init(){
player = new EZUIKit.EZUIKitPlayer({
id: 'video-container', // 视频容器ID
accessToken: this.accessToken,
url: this.url,
// simple - 极简版; pcLive-pc直播;pcRec-pc回放;mobileLive-移动端直播;mobileRec-移动端回放;security - 安防版;voice-语音版;
// template: 'simple',
// plugin: ['talk'], // 加载插件,talk-对讲
// width: 600,
// height: 400,
});
this.$nextTick(()=>{
player.play();
});
}
}
};
</script>
<style lang="less" scoped>
.hello-ezuikit-js{
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
</style>
......@@ -135,7 +135,7 @@
</div>
</div>
<div class="body-one monitor" v-else-if="tab=='monitor'">
<esu :url="detail.url" :accessToken="detail.accessToken"></esu>
</div>
<div class="body-one process" v-else-if="tab=='process'">
<div class="process-box">
......@@ -278,12 +278,15 @@
setup(props, {emit}) {
const state = reactive({
show:false,
url:'ezopen://open.ys7.com/E77565052/1.hd.live',
order_id:'',
detail: {
poster:[],
index: 0,
yewei:0.7,
type:1
type:1,
accessToken:'at.bvx2ea007tfqqdvkcb9iuhk70q6gjodm-7smdnjfh9j-1wdmw5f-mal3go2vz',
url:'ezopen://open.ys7.com/E77565052/1.live',
},
showBanner:false,
tabs: [
......@@ -613,7 +616,8 @@
}
},
components: {
orderDetail:defineAsyncComponent(()=>import("@/views/order-detail.vue"))
orderDetail:defineAsyncComponent(()=>import("@/views/order-detail.vue")),
esu:defineAsyncComponent(()=>import("@/components/EZUIKitJs.vue")),
}
}
</script>
......
<template>
<div>
<div class="gva-search-box">
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
<el-form-item label="原始设备id">
<el-input v-model="searchInfo.rawDeviceId" placeholder="搜索条件" />
</el-form-item>
<el-form-item label="数据类型">
<el-input v-model="searchInfo.typeName" placeholder="搜索条件" />
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="small" icon="refresh" @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button size="small" type="primary" icon="plus" @click="openDialog">新增</el-button>
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="small" type="primary" link @click="deleteVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="onDelete">确定</el-button>
<div>
<div class="gva-search-box">
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
<el-form-item label="原始设备ID">
<el-input v-model="searchInfo.rawDeviceId" placeholder="搜索条件"/>
</el-form-item>
<el-form-item label="数据类型">
<el-input v-model="searchInfo.typeName" placeholder="搜索条件"/>
</el-form-item>
<el-form-item>
<el-button size="small" type="primary" icon="search" @click="onSubmit">查询</el-button>
<el-button size="small" icon="refresh" @click="onReset">重置</el-button>
</el-form-item>
</el-form>
</div>
<div class="gva-table-box">
<div class="gva-btn-list">
<!--<el-button size="small" type="primary" icon="plus" @click="openDialog">新增</el-button>-->
<el-popover v-model:visible="deleteVisible" placement="top" width="160">
<p>确定要删除吗?</p>
<div style="text-align: right; margin-top: 8px;">
<el-button size="small" type="primary" link @click="deleteVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="onDelete">确定</el-button>
</div>
<template #reference>
<el-button icon="delete" size="small" style="margin-left: 10px;"
:disabled="!multipleSelection.length" @click="deleteVisible = true">删除
</el-button>
</template>
</el-popover>
</div>
<el-table
ref="multipleTable"
style="flex: 1;"
height="100%"
tooltip-effect="dark"
:data="tableData"
row-key="ID"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"/>
<el-table-column align="left" label="原始设备ID" prop="rawDeviceId" min-width="120"/>
<el-table-column align="left" label="公厕ID" prop="toiletId" min-width="120"/>
<el-table-column align="left" label="数据类型" prop="typeName" min-width="120"/>
<el-table-column align="left" label="数据值单位" prop="unit" min-width="120"/>
<el-table-column align="left" label="数据值" prop="value" min-width="120"/>
<el-table-column align="left" label="创建时间" min-width="180">
<template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
</el-table-column>
<el-table-column align="left" label="操作" min-width="120" fixed="right">
<template #default="scope">
<el-button type="primary" link icon="edit" size="small" class="table-button"
@click="updateQshMonitorDataFunc(scope.row)">查看
</el-button>
<el-button type="primary" link icon="delete" size="small" @click="deleteRow(scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="gva-pagination">
<el-pagination
layout="total, sizes, prev, pager, next, jumper"
:current-page="page"
:page-size="pageSize"
:page-sizes="[10, 30, 50, 100]"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
<template #reference>
<el-button icon="delete" size="small" style="margin-left: 10px;" :disabled="!multipleSelection.length" @click="deleteVisible = true">删除</el-button>
</template>
</el-popover>
</div>
<el-table
ref="multipleTable"
style="width: 100%"
tooltip-effect="dark"
:data="tableData"
row-key="ID"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column align="left" label="日期" width="180">
<template #default="scope">{{ formatDate(scope.row.CreatedAt) }}</template>
</el-table-column>
<el-table-column align="left" label="原始设备id" prop="rawDeviceId" width="120" />
<el-table-column align="left" label="公厕id" prop="toiletId" width="120" />
<el-table-column align="left" label="数据类型" prop="typeName" width="120" />
<el-table-column align="left" label="数据值单位" prop="unit" width="120" />
<el-table-column align="left" label="数据值" prop="value" width="120" />
<el-table-column align="left" label="按钮组">
<template #default="scope">
<el-button type="primary" link icon="edit" size="small" class="table-button" @click="updateQshMonitorDataFunc(scope.row)">变更</el-button>
<el-button type="primary" link icon="delete" size="small" @click="deleteRow(scope.row)">删除</el-button>
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="历史数据">
<el-form :model="formData" label-position="right" label-width="120px">
<el-form-item label="原始设备ID:">
<el-input v-model="formData.rawDeviceId" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="公厕ID:">
<el-input v-model="formData.toiletId" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="数据类型:">
<el-input v-model="formData.typeName" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="数据值单位:">
<el-input v-model="formData.unit" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="数据值:">
<el-input v-model="formData.value" clearable placeholder="请输入"/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button size="small" @click="closeDialog">取 消</el-button>
<!--<el-button size="small" type="primary" @click="enterDialog">确 定</el-button>-->
</div>
</template>
</el-table-column>
</el-table>
<div class="gva-pagination">
<el-pagination
layout="total, sizes, prev, pager, next, jumper"
:current-page="page"
:page-size="pageSize"
:page-sizes="[10, 30, 50, 100]"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</el-dialog>
</div>
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
<el-form :model="formData" label-position="right" label-width="80px">
<el-form-item label="原始设备id:">
<el-input v-model="formData.rawDeviceId" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="公厕id:">
<el-input v-model.number="formData.toiletId" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="数据类型:">
<el-input v-model="formData.typeName" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="数据值单位:">
<el-input v-model="formData.unit" clearable placeholder="请输入" />
</el-form-item>
<el-form-item label="数据值:">
<el-input v-model="formData.value" clearable placeholder="请输入" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button size="small" @click="closeDialog">取 消</el-button>
<el-button size="small" type="primary" @click="enterDialog">确 定</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'QshMonitorData'
}
export default {
name: 'QshMonitorData'
}
</script>
<script setup>
import {
createQshMonitorData,
deleteQshMonitorData,
deleteQshMonitorDataByIds,
updateQshMonitorData,
findQshMonitorData,
getQshMonitorDataList
} from '@/api/qshMonitorData'
import {
createQshMonitorData,
deleteQshMonitorData,
deleteQshMonitorDataByIds,
updateQshMonitorData,
findQshMonitorData,
getQshMonitorDataList
} from '@/api/qshMonitorData'
// 全量引入格式化工具 请按需保留
import { getDictFunc, formatDate, formatBoolean, filterDict } from '@/utils/format'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref } from 'vue'
// 全量引入格式化工具 请按需保留
import {getDictFunc, formatDate, formatBoolean, filterDict} from '@/utils/format'
import {ElMessage, ElMessageBox} from 'element-plus'
import {ref} from 'vue'
// 自动化生成的字典(可能为空)以及字段
const formData = ref({
// 自动化生成的字典(可能为空)以及字段
const formData = ref({
rawDeviceId: '',
toiletId: 0,
toiletId: '',
typeName: '',
unit: '',
value: '',
})
})
// =========== 表格控制部分 ===========
const page = ref(1)
const total = ref(0)
const pageSize = ref(10)
const tableData = ref([])
const searchInfo = ref({})
// =========== 表格控制部分 ===========
const page = ref(1)
const total = ref(0)
const pageSize = ref(10)
const tableData = ref([])
const searchInfo = ref({})
// 重置
const onReset = () => {
searchInfo.value = {}
}
// 重置
const onReset = () => {
searchInfo.value = {}
}
// 搜索
const onSubmit = () => {
page.value = 1
pageSize.value = 10
getTableData()
}
// 搜索
const onSubmit = () => {
page.value = 1
pageSize.value = 10
getTableData()
}
// 分页
const handleSizeChange = (val) => {
pageSize.value = val
getTableData()
}
// 分页
const handleSizeChange = (val) => {
pageSize.value = val
getTableData()
}
// 修改页面容量
const handleCurrentChange = (val) => {
page.value = val
getTableData()
}
// 修改页面容量
const handleCurrentChange = (val) => {
page.value = val
getTableData()
}
// 查询
const getTableData = async() => {
const table = await getQshMonitorDataList({ page: page.value, pageSize: pageSize.value, ...searchInfo.value })
if (table.code === 0) {
tableData.value = table.data.list
total.value = table.data.total
page.value = table.data.page
pageSize.value = table.data.pageSize
}
}
// 查询
const getTableData = async () => {
const table = await getQshMonitorDataList({page: page.value, pageSize: pageSize.value, ...searchInfo.value})
if (table.code === 0) {
tableData.value = table.data.list
total.value = table.data.total
page.value = table.data.page
pageSize.value = table.data.pageSize
}
}
getTableData()
getTableData()
// ============== 表格控制部分结束 ===============
// ============== 表格控制部分结束 ===============
// 获取需要的字典 可能为空 按需保留
const setOptions = async () =>{
}
// 获取需要的字典 可能为空 按需保留
const setOptions = async () => {
}
// 获取需要的字典 可能为空 按需保留
setOptions()
// 获取需要的字典 可能为空 按需保留
setOptions()
// 多选数据
const multipleSelection = ref([])
// 多选
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
// 多选数据
const multipleSelection = ref([])
// 多选
const handleSelectionChange = (val) => {
multipleSelection.value = val
}
// 删除行
const deleteRow = (row) => {
ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// 删除行
const deleteRow = (row) => {
ElMessageBox.confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteQshMonitorDataFunc(row)
})
}
// 批量删除控制标记
const deleteVisible = ref(false)
// 批量删除控制标记
const deleteVisible = ref(false)
// 多选删除
const onDelete = async() => {
const ids = []
if (multipleSelection.value.length === 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
return
}
multipleSelection.value &&
// 多选删除
const onDelete = async () => {
const ids = []
if (multipleSelection.value.length === 0) {
ElMessage({
type: 'warning',
message: '请选择要删除的数据'
})
return
}
multipleSelection.value &&
multipleSelection.value.map(item => {
ids.push(item.ID)
ids.push(item.ID)
})
const res = await deleteQshMonitorDataByIds({ ids })
if (res.code === 0) {
ElMessage({
type: 'success',
message: '删除成功'
})
if (tableData.value.length === ids.length && page.value > 1) {
page.value--
const res = await deleteQshMonitorDataByIds({ids})
if (res.code === 0) {
ElMessage({
type: 'success',
message: '删除成功'
})
if (tableData.value.length === ids.length && page.value > 1) {
page.value--
}
deleteVisible.value = false
getTableData()
}
deleteVisible.value = false
getTableData()
}
}
// 行为控制标记(弹窗内部需要增还是改)
const type = ref('')
// 行为控制标记(弹窗内部需要增还是改)
const type = ref('')
// 更新行
const updateQshMonitorDataFunc = async(row) => {
const res = await findQshMonitorData({ ID: row.ID })
type.value = 'update'
if (res.code === 0) {
formData.value = res.data.reqshMonitorData
dialogFormVisible.value = true
// 更新行
const updateQshMonitorDataFunc = async (row) => {
const res = await findQshMonitorData({ID: row.ID})
type.value = 'update'
if (res.code === 0) {
formData.value = res.data.reqshMonitorData
dialogFormVisible.value = true
}
}
}
// 删除行
const deleteQshMonitorDataFunc = async (row) => {
const res = await deleteQshMonitorData({ ID: row.ID })
if (res.code === 0) {
ElMessage({
// 删除行
const deleteQshMonitorDataFunc = async (row) => {
const res = await deleteQshMonitorData({ID: row.ID})
if (res.code === 0) {
ElMessage({
type: 'success',
message: '删除成功'
})
if (tableData.value.length === 1 && page.value > 1) {
page.value--
page.value--
}
getTableData()
}
getTableData()
}
}
// 弹窗控制标记
const dialogFormVisible = ref(false)
// 弹窗控制标记
const dialogFormVisible = ref(false)
// 打开弹窗
const openDialog = () => {
type.value = 'create'
dialogFormVisible.value = true
}
// 打开弹窗
const openDialog = () => {
type.value = 'create'
dialogFormVisible.value = true
}
// 关闭弹窗
const closeDialog = () => {
dialogFormVisible.value = false
formData.value = {
rawDeviceId: '',
toiletId: 0,
typeName: '',
unit: '',
value: '',
// 关闭弹窗
const closeDialog = () => {
dialogFormVisible.value = false
formData.value = {
rawDeviceId: '',
toiletId: '',
typeName: '',
unit: '',
value: '',
}
}
// 弹窗确定
const enterDialog = async () => {
let res
switch (type.value) {
case 'create':
res = await createQshMonitorData(formData.value)
break
case 'update':
res = await updateQshMonitorData(formData.value)
break
default:
res = await createQshMonitorData(formData.value)
break
}
if (res.code === 0) {
ElMessage({
type: 'success',
message: '创建/更改成功'
})
closeDialog()
getTableData()
}
}
}
// 弹窗确定
const enterDialog = async () => {
let res
switch (type.value) {
case 'create':
res = await createQshMonitorData(formData.value)
break
case 'update':
res = await updateQshMonitorData(formData.value)
break
default:
res = await createQshMonitorData(formData.value)
break
}
if (res.code === 0) {
ElMessage({
type: 'success',
message: '创建/更改成功'
})
closeDialog()
getTableData()
}
}
</script>
<style>
......
......@@ -45,14 +45,14 @@
>
<el-table-column type="selection" width="55"/>
<el-table-column align="left" label="点位名称" prop="name" min-width="180"/>
<el-table-column align="left" label="公厕地址" prop="address" min-width="180"/>
<el-table-column align="left" label="公厕地址" prop="address" min-width="200"/>
<el-table-column align="left" label="公厕类型" prop="type" min-width="120">
<template #default="scope">
{{ filterDict(scope.row.type,typeOptions) }}
</template>
</el-table-column>
<el-table-column align="left" label="纬度" prop="lat" min-width="120"/>
<el-table-column align="left" label="经度" prop="lng" min-width="120"/>
<el-table-column align="left" label="纬度" prop="lat" min-width="180"/>
<el-table-column align="left" label="经度" prop="lng" min-width="180"/>
<el-table-column align="left" label="管理人员" prop="manager" min-width="120"/>
<el-table-column align="left" label="管理员联系电话" prop="managerPhone" min-width="140"/>
<el-table-column align="left" label="创建时间" min-width="180">
......@@ -80,7 +80,7 @@
/>
</div>
</div>
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="弹窗操作">
<el-dialog v-model="dialogFormVisible" :before-close="closeDialog" title="公厕详情">
<el-form :model="formData" label-position="right" label-width="120px">
<el-form-item label="点位名称:">
<el-input v-model="formData.name" clearable placeholder="请输入"/>
......@@ -92,7 +92,7 @@
</el-select>
</el-form-item>
<el-form-item label="公厕地址:">
<el-input v-model="formData.address" clearable placeholder="请输入"/>
<el-input v-model="formData.address" type="textarea" resize="none" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="展示图片:">
<new-upload v-if="dialogFormVisible" :list="[formData.showImage]" @upload="(file)=>formData.showImage = file[0]"></new-upload>
......@@ -112,8 +112,14 @@
<el-form-item label="管理员联系电话:">
<el-input v-model="formData.managerPhone" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="监控信息:">
<el-input v-model="formData.monitor" clearable placeholder="请输入"/>
<el-form-item label="监控账号:">
<el-input v-model="formData.monitor_ac" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="监控ID:">
<el-input v-model="formData.monitor_id" clearable placeholder="请输入"/>
</el-form-item>
<el-form-item label="设备ID:">
<el-input v-model="formData.yewei_device" clearable placeholder="请输入"/>
</el-form-item>
</el-form>
<template #footer>
......@@ -156,7 +162,9 @@
lng: '',
manager: '',
managerPhone: '',
monitor: '',
monitor_ac: '',//监控账号
monitor_id: '',//监控ID
yewei_device: '',//设备ID
name: '',
showImage: '',
type: undefined,
......@@ -315,7 +323,9 @@
lng: '',
manager: '',
managerPhone: '',
monitor: '',
monitor_ac: '',//监控账号
monitor_id: '',//监控ID
yewei_device: '',//设备ID
name: '',
showImage: '',
type: undefined,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment