| | |
| | | <span class="icon iconfont"></span>
|
| | | </div>
|
| | | </div>
|
| | | <div class="add-group">
|
| | | <el-upload
|
| | | class="upload-demo"
|
| | | drag
|
| | | action="https://jsonplaceholder.typicode.com/posts/"
|
| | | multiple
|
| | | v-show="showUpload"
|
| | | >
|
| | | <i class="el-icon-upload"></i>
|
| | | <div class="el-upload__text">
|
| | | 事件声音文件拖到此处,或<em>点击上传</em> <br />
|
| | | 仅支持mp3/wma等格式
|
| | | <div class="add-group">
|
| | | <el-upload
|
| | | class="upload-demo"
|
| | | drag
|
| | | action="https://jsonplaceholder.typicode.com/posts/"
|
| | | :http-request="uploadSound"
|
| | | v-show="showUpload"
|
| | | >
|
| | | <i class="el-icon-upload"></i>
|
| | | <div class="el-upload__text">
|
| | | 事件声音文件拖到此处,或<em>点击上传</em> <br />
|
| | | 仅支持mp3/wma等格式
|
| | | </div>
|
| | | </el-upload>
|
| | | <div v-show="!showUpload"></div>
|
| | | <div class="add-btn">
|
| | | <span class="icon iconfont" @click="showUpload = !showUpload"
|
| | | ></span
|
| | | >
|
| | | </div>
|
| | | </el-upload>
|
| | | <div v-show="!showUpload"
|
| | | ></div>
|
| | | <div class="add-btn">
|
| | | <span class="icon iconfont" @click="showUpload=!showUpload"></span>
|
| | | </div>
|
| | |
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | | </div>
|
| | |
| | |
|
| | | <script>
|
| | | import { saveAlarmConfig } from "@/api/system";
|
| | | import { uploadSound,getSoundList } from "@/api/event";
|
| | |
|
| | | import cloudNode from "../components/CloudNode";
|
| | | import ipInput from "@/components/subComponents/IPInput";
|
| | |
| | |
|
| | | export default {
|
| | | data() {
|
| | | const checkPwd = (rule, value, callback) => {
|
| | | if (!value) {
|
| | | return callback(new Error("密码不能为空"));
|
| | | }
|
| | | setTimeout(() => {
|
| | | if (value.length != 6) {
|
| | | callback(new Error("密码应为6位!"));
|
| | | } else {
|
| | | callback();
|
| | | }
|
| | | }, 1000);
|
| | | };
|
| | |
|
| | | return {
|
| | | isHighClass: false,
|
| | |
|
| | |
| | | isOpenWifi: false,
|
| | | inWireDetail: false,
|
| | | wireForm: {},
|
| | | showUpload:false,
|
| | | showUpload: false,
|
| | | alarmConf: {
|
| | | min_video_len: 0,
|
| | | max_video_len: 0,
|
| | |
| | | ipInput,
|
| | | switchBar,
|
| | | },
|
| | | mounted() {},
|
| | | mounted() {
|
| | | this.getSounds()
|
| | |
|
| | | },
|
| | | beforeDestroy() {},
|
| | | props: ["barName"],
|
| | | methods: {
|
| | | getSounds() {
|
| | | getSoundList().then(res => {
|
| | | if (res.success) {
|
| | | this.soundList = res.data.list
|
| | | }
|
| | | }).catch(
|
| | | e => console.log(e)
|
| | | )
|
| | | },
|
| | | uploadSound(params){
|
| | | let param = new FormData();
|
| | | param.append("file", params.file);
|
| | | uploadSound(param).then((res) => {
|
| | | console.log(res.data); |
| | | });
|
| | | },
|
| | | openRight(typ) {
|
| | | this.activePage = typ;
|
| | | if (typ=="sound") {
|
| | | this.getSounds()
|
| | | }
|
| | | },
|
| | | openRight(typ) {
|
| | | this.activePage = typ;
|
| | | },
|
| | |
| | | .bar:hover {
|
| | | background-color: rgba(233, 233, 233, 1);
|
| | | }
|
| | | .add-group{
|
| | | margin-top: 170px;
|
| | | height: 235px;
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | | justify-content: space-between;
|
| | |
|
| | | .add-group {
|
| | | margin-top: 170px;
|
| | | height: 235px;
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | | justify-content: space-between;
|
| | | }
|
| | | .upload-demo {
|
| | | .el-upload-dragger {
|