From f2fcae7c31b8a0bbbcc6298865d7340e488f61f3 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期四, 05 十一月 2020 18:51:07 +0800
Subject: [PATCH] 修改事件声音配置
---
src/pages/cameraAccess/components/scene/Editor.vue | 5
vue.config.js | 4
src/pages/cameraAccess/components/CameraInfo.vue | 26 ++-
src/pages/cameraAccess/components/DataStackInfo.vue | 87 +++++++-------
src/pages/cameraAccess/components/SceneRule.vue | 133 +++++++++++++++------
src/pages/cameraAccess/components/scene/SlideScene.vue | 69 +++++++----
src/pages/cameraAccess/components/SeparateRules.vue | 18 --
7 files changed, 204 insertions(+), 138 deletions(-)
diff --git a/src/pages/cameraAccess/components/CameraInfo.vue b/src/pages/cameraAccess/components/CameraInfo.vue
index ddeaae0..58eee53 100644
--- a/src/pages/cameraAccess/components/CameraInfo.vue
+++ b/src/pages/cameraAccess/components/CameraInfo.vue
@@ -61,9 +61,10 @@
</el-col>
<el-col :span="9" :offset="1">
<el-form-item label="浜嬩欢澹伴煶">
- <div class="flex-wrap" style="margin-left:-10px">
+ <div class="flex-wrap" style="margin-top: 10px;">
<el-switch v-model="form.voiceEnable" :width="50"></el-switch>
- <el-select
+ <!-- 灞忚斀澹伴煶閫夋嫨,璋冩暣鍒板満鏅� -->
+ <!-- <el-select
v-model="voice"
placeholder="閫夋嫨澹伴煶"
size="small"
@@ -88,7 +89,7 @@
class="el-icon-video-pause"
style="font-size:26px; vertical-align:middle; color:#409eff"
></i>
- </span>
+ </span>-->
</div>
</el-form-item>
</el-col>
@@ -362,14 +363,14 @@
// console.log(list, "sensor")
// id涓虹┖锛屾柊澧炴憚鍍忔満
- if (this.form.voiceEnable && this.form.voiceId === "") {
- this.$notify({
- type: "error",
- message: "璇烽�夋嫨涓�涓簨浠跺0闊�"
- });
+ // if (this.form.voiceEnable && this.form.voiceId === "") {
+ // this.$notify({
+ // type: "error",
+ // message: "璇烽�夋嫨涓�涓簨浠跺0闊�"
+ // });
- return;
- }
+ // return;
+ // }
this.$refs[formName].validate(async valid => {
if (valid) {
@@ -399,6 +400,11 @@
message: "鎽勫儚鏈轰俊鎭慨鏀瑰け璐ワ紒"
});
}
+ }).catch(err => {
+ this.$notify({
+ type: "error",
+ message: err.data
+ });
});
} else {
this.form.areaid = this.addParentId;
diff --git a/src/pages/cameraAccess/components/DataStackInfo.vue b/src/pages/cameraAccess/components/DataStackInfo.vue
index d20e8e7..aebdd67 100644
--- a/src/pages/cameraAccess/components/DataStackInfo.vue
+++ b/src/pages/cameraAccess/components/DataStackInfo.vue
@@ -172,7 +172,7 @@
>{{row.name}}</a>
</template>
</el-table-column>
- <el-table-column prop="fileSize" label="澶у皬" >
+ <el-table-column prop="fileSize" label="澶у皬">
<template slot-scope="scope">{{scope.row.size | readFileSizeUnit}}</template>
</el-table-column>
<el-table-column prop="duration" label="鏃堕暱" show-overflow-tooltip align="center"></el-table-column>
@@ -271,8 +271,12 @@
<template v-for="stack in DataStackPool.dirs">
<!-- 鏂囦欢涓婁紶缁勪欢 -->
- <file-uploader :ref="`uploader_${stack.id}`" :key="stack.id" v-show="activeName === 'uploading' && stack.id == DataStackPool.selectedDir.id" :sourceType="stack.type" />
- <!-- <file-uploader ref="uploader" v-show="activeName === 'uploading'" /> -->
+ <file-uploader
+ :ref="`uploader_${stack.id}`"
+ :key="stack.id"
+ v-show="activeName === 'uploading' && stack.id == DataStackPool.selectedDir.id"
+ :sourceType="stack.type"
+ />
</template>
<!-- 鏂囦欢棰勮 -->
<el-dialog title="鏌ョ湅鏂囦欢" :visible.sync="previewDialog" width="500px">
@@ -335,7 +339,7 @@
}
},
filters: {
- statusFormat (value) {
+ statusFormat(value) {
let statusCode = {
"-1": "宸插垹闄�",
"0": "鏆傚仠澶勭悊",
@@ -345,7 +349,7 @@
}
return statusCode[value];
},
- readFileSizeUnit (value) {
+ readFileSizeUnit(value) {
let UNITS = [' B', ' KB', ' MB', ' GB', ' TB', ' PB', ' EB', ' ZB', ' YB'];
let format = function (value, power) {
return (value / Math.pow(1024, power)).toFixed(2) + UNITS[power];
@@ -364,7 +368,7 @@
}
},
computed: {
- snapshotClass () {
+ snapshotClass() {
let classs = ["snapshot"];
if (this.form.type === 1) {
classs.push("snapshot-video")
@@ -378,13 +382,13 @@
return classs;
},
- dirOptions () {
+ dirOptions() {
return this.DataStackPool.dirs.filter(dir => {
return dir.id !== this.DataStackPool.selectedDir.id
})
}
},
- data () {
+ data() {
return {
videoUrl: "",
imgUrl: "",
@@ -416,29 +420,28 @@
timer: 0,
targetDir: "",
targetFile: "",
-
+
};
},
- mounted () {
+ mounted() {
this.initFormData();
console.log(this.PollData.barCharts)
},
- beforeDestroy () {
+ beforeDestroy() {
this.taskUid = 0;
},
watch: {
'fileList.length': {
- handler (n, o) {
+ handler(n, o) {
//鏁版嵁鏍堟枃浠舵暟閲忓彉鏇�
//鏇存柊鐙珛鍦烘櫙鏁版嵁鏍堟枃浠�
this.$root.$children[0].$children[1].$refs['sepRule'].getStackFiles();
}
},
-
},
methods: {
- preview (row) {
+ preview(row) {
this.previewDialog = true;
if (row.type === 1) {
@@ -449,7 +452,7 @@
}
},
// 娓呯┖杈撳叆妗�
- initFormData () {
+ initFormData() {
this.form = {
enable: false,
id: "",
@@ -461,14 +464,14 @@
};
},
// 娣诲姞璁惧
- addDir (node) {
+ addDir(node) {
this.isAdd = true;
this.isDisabled = false;
this.initFormData();
this.DataStackPool.clean();
this.fileList = [];
},
- selectDir (node) {
+ selectDir(node) {
if (node.id === "") {
return
}
@@ -493,12 +496,12 @@
this.videoUrl = '';
this.imgUrl = '';
},
- initFetchListTask () {
+ initFetchListTask() {
const uid = Math.round(Math.random() * 1000);
this.taskUid = uid;
this.timingtask(uid);
},
- timingtask (uid) {
+ timingtask(uid) {
if (uid !== this.taskUid || this.form.id === "") {
return;
}
@@ -508,7 +511,7 @@
_this.timingtask(uid);
}, 2 * 1000);
},
- fetchFileList () {
+ fetchFileList() {
findAllFileByStackId({ name: this.searchInput, stackId: this.form.id, page: this.page, size: this.size, type: 0 }).then(rsp => {
if (rsp && rsp.success && rsp.data.total >= 0) {
this.fileList = rsp.data.dataList;
@@ -531,7 +534,7 @@
},
// 淇濆瓨
- onSubmit (formName) {
+ onSubmit(formName) {
this.$refs[formName].validate(async valid => {
if (valid) {
saveDir(this.form).then(rsp => {
@@ -552,7 +555,7 @@
});
},
// 鍒犻櫎鎽勫儚鏈�
- deleteDir () {
+ deleteDir() {
this.$confirm("鏄惁鍒犻櫎姝ゆ枃浠跺す锛�", {
center: true,
cancelButtonClass: "comfirm-class-cancle",
@@ -581,32 +584,32 @@
});
});
},
- handleTabClick (tab, event) {
+ handleTabClick(tab, event) {
console.log(tab, event);
},
- handleSelect (val) {
+ handleSelect(val) {
this.multipleSelection = val.map(row => {
return row.id;
});
},
- handelSearchInputChange (val) {
+ handelSearchInputChange(val) {
this.multipleSelection = [];
},
- handleUpload () {
+ handleUpload() {
console.log(this.DataStackPool.selectedDir.id)
console.log(this.$refs[`uploader_${this.DataStackPool.selectedDir.id}`][0].$refs.button.$refs.btn.click())
},
- handleRefrashFileList (val) {
+ handleRefrashFileList(val) {
this.page = val;
this.multipleSelection = [];
this.fetchFileList();
},
- handleSizeChange (val) {
+ handleSizeChange(val) {
this.size = val;
this.multipleSelection = [];
this.fetchFileList();
},
- async handleSortFile (direct, id) {
+ async handleSortFile(direct, id) {
let res = await sortFile({
id: id,
direct: direct
@@ -622,7 +625,7 @@
})
}
},
- async handleFileStatus (row, status, multi = false) {
+ async handleFileStatus(row, status, multi = false) {
let ids = this.multipleSelection;
if (!multi) {
ids = [row.id];
@@ -650,10 +653,10 @@
console.log("err")
}
},
- dropdownClick (cmd) {
+ dropdownClick(cmd) {
cmd.cb(cmd.data);
},
- handleFileDelete (rows, multi = false) {
+ handleFileDelete(rows, multi = false) {
let _this = this;
let ids = this.multipleSelection;
if (!multi) {
@@ -680,17 +683,17 @@
}).catch(() => { })
},
- handleFileMove (row) {
+ handleFileMove(row) {
this.targetDir = "";
this.targetFile = row.id;
this.fileDialog = true;
},
- handleFileRename (row) {
+ handleFileRename(row) {
this.editRowId = row.id;
clearTimeout(this.timer);
this.timer = null;
},
- cellRenameFile (row) {
+ cellRenameFile(row) {
this.editRowId = "";
renameFile({ id: row.id, name: row.name }).then(rsp => {
if (rsp && rsp.success) {
@@ -713,10 +716,10 @@
}
})
},
- isSelectable (row, rowIndex) {
+ isSelectable(row, rowIndex) {
return row.status !== 2
},
- cellFileCopy () {
+ cellFileCopy() {
copyFile({ id: this.targetFile, stackIds: [this.targetDir] }).then(rsp => {
if (rsp && rsp.success) {
this.$notify({
@@ -732,7 +735,7 @@
}
})
},
- cellFileMove () {
+ cellFileMove() {
moveFile({ id: this.targetFile, stackId: this.targetDir }).then(rsp => {
if (rsp && rsp.success) {
this.$notify({
@@ -852,19 +855,19 @@
vertical-align: middle;
}
.snapshot-video {
- background: url('/images/cameraAccess/video.png');
+ background: url("/images/cameraAccess/video.png");
background-repeat: round;
}
.snapshot-image {
- background: url('/images/cameraAccess/image.png');
+ background: url("/images/cameraAccess/image.png");
background-repeat: round;
}
.snapshot-audio {
- background: url('/images/cameraAccess/audio.png');
+ background: url("/images/cameraAccess/audio.png");
background-repeat: round;
}
.snapshot-files {
- background: url('/images/cameraAccess/files.png');
+ background: url("/images/cameraAccess/files.png");
background-repeat: round;
}
}
diff --git a/src/pages/cameraAccess/components/SceneRule.vue b/src/pages/cameraAccess/components/SceneRule.vue
index a5f879e..188db95 100644
--- a/src/pages/cameraAccess/components/SceneRule.vue
+++ b/src/pages/cameraAccess/components/SceneRule.vue
@@ -46,9 +46,36 @@
<el-form-item label="鍦烘櫙鎻忚堪">
<el-input v-model="sceneForm.desc" type="textarea" size="mini"></el-input>
</el-form-item>
+ <el-form-item label="浜嬩欢澹伴煶">
+ <el-select
+ v-model="sceneForm.voice"
+ placeholder="绌�"
+ size="small"
+ value-key="id"
+ @change="selSound"
+ >
+ <el-option v-for="item in soundList" :key="item.id" :label="item.name" :value="item"></el-option>
+ </el-select>
+ <span
+ @click="togglePlayer"
+ style="cursor:pointer; margin-left:20px"
+ v-show="sceneForm.voiceId.length"
+ >
+ <i
+ v-if="togglePlay"
+ class="el-icon-video-play"
+ style="font-size:26px; vertical-align:middle; color:#409eff"
+ ></i>
+ <i
+ v-else
+ class="el-icon-video-pause"
+ style="font-size:26px; vertical-align:middle; color:#409eff"
+ ></i>
+ </span>
+ </el-form-item>
</div>
</div>
-
+
<scene-editor
ref="sceneEditor"
:isLinkRule="linkRule"
@@ -73,32 +100,26 @@
:cell-style="cellStyle"
:header-cell-style="{background:'#f8f8f8',color:'#222222'}"
>
- <el-table-column label="搴忓彿" type="index" align="center" ></el-table-column>
- <el-table-column
- label="鍦烘櫙鍚嶇О"
- prop="scene_name"
-
- align="center"
- show-overflow-tooltip
- ></el-table-column>
+ <el-table-column label="搴忓彿" type="index" align="center"></el-table-column>
+ <el-table-column label="鍦烘櫙鍚嶇О" prop="scene_name" align="center" show-overflow-tooltip></el-table-column>
<el-table-column label="绛栫暐" prop="group_text" align="center" min-width="350px">
<template slot-scope="scope">
<span v-html="scope.row.group_text"></span>
</template>
</el-table-column>
- <el-table-column label="鏃堕棿娈�" prop="time_name" align="center" ></el-table-column>
+ <el-table-column label="鏃堕棿娈�" prop="time_name" align="center"></el-table-column>
<el-table-column label="鎻忚堪" prop="desc" align="center" min-width="150"></el-table-column>
<!-- <el-table-column label="鐘舵��" align="center" width="90">
<template slot-scope="scope">
<el-switch v-model="scope.row.defence_state" @change="updateDefence(scope.row)"></el-switch>
</template>
</el-table-column>-->
- <el-table-column label="浜嬩欢绛夌骇" align="center" >
+ <el-table-column label="浜嬩欢绛夌骇" align="center">
<template slot-scope="scope">
<span>{{scope.row.alarm_level | alarmLevel }}</span>
</template>
</el-table-column>
- <el-table-column label="鎿嶄綔" fixed="right" align="center" >
+ <el-table-column label="鎿嶄綔" fixed="right" align="center">
<template slot-scope="scope">
<el-tooltip content="缂栬緫" :hide-after="700" placement="top" popper-class="atooltip">
<i
@@ -107,7 +128,12 @@
@click="handleEdit(scope.row)"
></i>
</el-tooltip>
- <el-tooltip content="鍒犻櫎" :hide-after="700" placement="top" popper-class="atooltipgroup_">
+ <el-tooltip
+ content="鍒犻櫎"
+ :hide-after="700"
+ placement="top"
+ popper-class="atooltipgroup_"
+ >
<i
class="iconfont iconshanchu4 btn-icon"
style="font-size: 28px; color:red;"
@@ -130,6 +156,7 @@
} from '@/api/scene'
import RuleEditor from "@/components/subComponents/RuleEditor";
import SceneEditor from "./scene/Editor";
+import { getSoundList } from "@/api/event";
export default {
name: "SceneRuleEditor",
@@ -181,7 +208,10 @@
},
mounted() {
// window.addEventListener('resize', this.windowSizeChange)
-
+ this.getSounds();
+ this.eventAudio.addEventListener("ended", () => {
+ this.togglePlay = true
+ })
},
data() {
return {
@@ -194,14 +224,54 @@
desc: "",
template_id: "",
time_rule_id: "",
+ voice: {},
+ voiceId: ""
},
templateSdks: [],
templateRules: "",
ruleList: [],
- sceneNameStore: []
+ sceneNameStore: [],
+ eventAudio: new Audio(),
+ soundList: [],
+ togglePlay: true
}
},
methods: {
+ getSounds() {
+ getSoundList().then(res => {
+ if (res.success) {
+ this.soundList = [{ id: "", name: "绌�", path: "" }].concat(res.data.list)
+ }
+ }).catch(
+ e => console.log(e)
+ )
+ },
+ selSound(sound) {
+ this.soundPath = sound.path;
+ this.sceneForm.voiceId = sound.id;
+ this.togglePlay = true;
+ this.eventAudio.pause()
+ this.$forceUpdate()
+ // this.eventAudio.
+ },
+ togglePlayer() {
+ if (!this.soundPath) {
+ this.$notify({
+ type: 'info',
+ message: '璇峰厛閫夋嫨涓�涓0闊�!'
+ })
+ return false;
+ }
+ this.eventAudio.src = this.soundPath;
+ if (this.togglePlay) {
+ this.eventAudio.play();
+ this.togglePlay = false
+ } else {
+ this.eventAudio.pause()
+ this.togglePlay = true
+ }
+ // this.togglePlay = !this.togglePlay
+ },
bubbleSort(arr) {
for (var i = arr.length - 1; i > 0; i--) {
for (var j = 0; j < i; j++) {
@@ -233,13 +303,13 @@
desc: "",
template_id: "",
time_rule_id: "",
+ voice: {},
+ voiceId: ""
};
this.$refs.sceneEditor.cleanRule();
this.$refs.sceneEditor.getSdkConnection();
},
handleCreate() {
-
- console.log(this.DataStackPool.selectedDir.id, this.TreeDataPool.treeActiveName == 'dataStack')
if (this.linkRule && this.TreeDataPool.selectedNodes.length < 2) {
this.$notify({
type: "warning",
@@ -261,7 +331,6 @@
}
this.editScene = true;
this.cleanForm();
- console.log(this.tableRuleList)
//鍒濆鍖栧満鏅悕绉�
var pattern = /^鍦烘櫙\s*\d+\s*$/;
@@ -280,8 +349,9 @@
},
handleEdit(scene) {
-
this.sceneForm = scene;
+ this.sceneForm.voice = this.soundList.find(o => o.id === scene.voiceId);
+
this.editScene = true;
let selectedTpl = {};
this.sceneTemplates.forEach((t) => {
@@ -296,24 +366,7 @@
},
- selectTemplate() {
- let selectedTpl = {};
- this.sceneTemplates.forEach((t) => {
- if (t.id == this.sceneForm.template_id) {
- selectedTpl = t;
- }
- })
-
- // 璁剧疆榛樿鍙傛暟, 鏃堕棿瑙勫垯鍙栫涓�涓�
- this.sceneForm.time_rule_id = this.VideoManageData.TimeRules[0].id;
- this.sceneForm.scene_name = selectedTpl.name;
- this.sceneForm.desc = selectedTpl.desc;
-
- this.templateSdks = selectedTpl.sdks;
- this.templateRules = selectedTpl.rules;
- },
validateForm() {
-
if (!this.sceneForm.scene_name.trim()) {
this.$notify({
type: 'warning',
@@ -336,7 +389,6 @@
return true
},
saveSceneRule() {
-
if (!this.validateForm()) {
return
}
@@ -344,6 +396,7 @@
this.sceneForm.rules = editorResp.rules;
this.sceneForm.id = editorResp.id;
this.sceneForm.group_text = editorResp.text;
+
this.onSaveScene(this.sceneForm);
},
handleDelScene(groupRule) {
@@ -410,7 +463,7 @@
}
}
textarea {
- height: 143px;
+ height: 92px;
}
}
.right {
@@ -441,8 +494,8 @@
}
.cell {
padding-left: 0 !important;
- i{
- outline: none!important;
+ i {
+ outline: none !important;
}
}
}
diff --git a/src/pages/cameraAccess/components/SeparateRules.vue b/src/pages/cameraAccess/components/SeparateRules.vue
index 6993ed4..d014e4b 100644
--- a/src/pages/cameraAccess/components/SeparateRules.vue
+++ b/src/pages/cameraAccess/components/SeparateRules.vue
@@ -28,21 +28,9 @@
</div>
<div v-if="Camera.analytics" class="flex-box" v-show="cameraType === 'camera'">
- <span class="label">鍒嗚鲸鐜�</span>
- <el-select
- v-model="Camera.selectResolution"
- placeholder="璇烽�夋嫨"
- size="mini"
- style="width: 134px;
- margin-left:10px;"
- >
- <el-option
- v-for="item in Camera.resolutionOption"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
+ <span
+ class="label"
+ >鍒嗚鲸鐜�: {{Camera.resolutionOption.find(o=>o.value === Camera.selectResolution).label}}</span>
</div>
<div v-if="Camera.analytics" class="flex-box">
diff --git a/src/pages/cameraAccess/components/scene/Editor.vue b/src/pages/cameraAccess/components/scene/Editor.vue
index 6c8c8ec..ae96008 100644
--- a/src/pages/cameraAccess/components/scene/Editor.vue
+++ b/src/pages/cameraAccess/components/scene/Editor.vue
@@ -516,7 +516,6 @@
},
methods: {
getSdkConnection() {
- console.log(this.VideoManageData.Dictionary)
this.sdkConnects = this.VideoManageData.Dictionary['RULECOMPUTEBETWEEN'].map(r => {
return {
@@ -656,12 +655,10 @@
}
})
- console.log(argObj.valueOptions)
},
setOptArgValueOptions(optArg) {
let alias = optArg.alias;
- console.log(this.VideoManageData.Dictionary[alias])
optArg.valueOptions = this.VideoManageData.Dictionary[alias].map(r => {
return {
name: r.name,
@@ -839,7 +836,6 @@
//sdkItem.sdk_id = sdkItem.sdkObj.id;
if (resetArgs) {
sdkItem.argDef = JSON.parse(sdkItem.sdkObj.argDef)
- console.log(sdkItem.argDef)
//鍙栧嚭榛樿鍙傛暟
sdkItem.defaultArg = sdkItem.argDef.filter(
arg => !arg.config.isOptional
@@ -1579,7 +1575,6 @@
}
})
- console.log(group_text)
}
groupRule.text = group_text
diff --git a/src/pages/cameraAccess/components/scene/SlideScene.vue b/src/pages/cameraAccess/components/scene/SlideScene.vue
index d79ae9a..4bf640f 100644
--- a/src/pages/cameraAccess/components/scene/SlideScene.vue
+++ b/src/pages/cameraAccess/components/scene/SlideScene.vue
@@ -1,41 +1,62 @@
<template>
<div class="swiper-box">
<p class="task-tip" v-if="sceneData.length == 0 ">鏆傛棤鍦烘櫙锛岃寮�濮嬪垱寤�</p>
- <swiper ref="sceneSwiper" v-if="sceneData.length>=1" :options="swiperOption" class="swiper-box-container">
+ <swiper
+ ref="sceneSwiper"
+ v-if="sceneData.length>=1"
+ :options="swiperOption"
+ class="swiper-box-container"
+ >
<swiper-slide v-for="item in sceneData" :key="item.id+'s'">
- <div class="wrap-box" >
+ <div class="wrap-box">
<div class="inner">
<div class="scenario-icon">
<div class="single" v-if="item.rules.length==1">
<div class="svg-wrap">
<!-- <svg class="icon" aria-hidden="true" style="font-size:4rem;">
<use :xlink:href="`#${item.rules[0].icon}`" />
- </svg> -->
- <img class="baseImg" :src="item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${item.rules[0].icon_blob}`" alt="">
+ </svg>-->
+ <img
+ class="baseImg"
+ :src="item.rules[0].icon_blob && item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${item.rules[0].icon_blob}`"
+ alt
+ />
</div>
</div>
<div class="double" v-else-if="item.rules.length==2">
<div class="svg-wrap" v-for="(rule,index) in item.rules" :key="index">
<!-- <svg class="icon" aria-hidden="true" style="font-size:2rem;">
<use :xlink:href="`#${rule.icon}`" />
- </svg> -->
- <img class="baseImg" :src="item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`" alt="">
+ </svg>-->
+ <img
+ class="baseImg"
+ :src="item.rules[0].icon_blob &&item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`"
+ alt
+ />
</div>
</div>
<div class="third" v-else-if="item.rules.length==3">
<div class="svg-wrap" v-for="(rule,index) in item.rules" :key="'t'+index">
<!-- <svg class="icon" aria-hidden="true" style="font-size:2rem;">
<use :xlink:href="`#${rule.icon}`" />
- </svg> -->
- <img class="baseImg" :src="item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`" alt="">
+ </svg>-->
+ <img
+ class="baseImg"
+ :src="item.rules[0].icon_blob &&item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`"
+ alt
+ />
</div>
</div>
<div class="four" v-else-if="item.rules.length==4">
<div class="svg-wrap" v-for="(rule,index) in item.rules" :key="'f'+index">
<!-- <svg class="icon" aria-hidden="true" style="font-size:2rem;">
<use :xlink:href="`#${rule.icon}`" />
- </svg> -->
- <img class="baseImg" :src="item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`" alt="">
+ </svg>-->
+ <img
+ class="baseImg"
+ :src="item.rules[0].icon_blob && item.rules[0].icon_blob.indexOf(',')>0?item.rules[0].icon_blob:`data:image/png;base64,${rule.icon_blob}`"
+ alt
+ />
</div>
</div>
</div>
@@ -59,11 +80,11 @@
<script>
export default {
- props:[
+ props: [
// 'swiperOption',
'sceneData'
],
-
+
data() {
return {
// mockSceneData: [
@@ -99,28 +120,28 @@
nextEl: ".swiper-next-border",
prevEl: ".swiper-pre-border"
},
- observer:true,//淇敼swiper鑷繁鎴栧瓙鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper
- observeParents:true,//淇敼swiper鐨勭埗鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper
+ observer: true,//淇敼swiper鑷繁鎴栧瓙鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper
+ observeParents: true,//淇敼swiper鐨勭埗鍏冪礌鏃讹紝鑷姩鍒濆鍖杝wiper
},
mySwiper: {}
}
},
- mounted(){
+ mounted() {
// this.mySwiper = this.$refs.sceneSwiper.swiper;
-
+
},
- methods:{
+ methods: {
//鎷嗗垎浜岀淮鏁扮粍
- chunk(arr,size = 1){
- if(arr.length == 0) return;
+ chunk(arr, size = 1) {
+ if (arr.length == 0) return;
const tempContainer = [];
let innerArr = [];
arr.forEach(item => {
- if(innerArr.length == 0){
+ if (innerArr.length == 0) {
tempContainer.push(innerArr);
}
innerArr.push(item);
- if(innerArr.length == size){
+ if (innerArr.length == size) {
innerArr = [];
}
});
@@ -129,7 +150,7 @@
},
computed: {
slides() {
- return this.chunk(this.mockSceneData,5);
+ return this.chunk(this.mockSceneData, 5);
}
}
};
@@ -143,7 +164,7 @@
fill: currentColor;
overflow: hidden;
}
-.task-tip{
+.task-tip {
font-family: PingFangSC-Regular;
font-size: 12px;
color: #cccccc;
@@ -239,7 +260,7 @@
left: 50%;
transform: translate(-50%, -50%);
box-shadow: none;
- width: 100%
+ width: 100%;
}
}
.double {
diff --git a/vue.config.js b/vue.config.js
index 541395b..f276d7a 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -79,8 +79,8 @@
changeOrigin: true,
},
"/data/api-v/app/findAllApp": {
- target: '/',
- // target: 'http://localhost:8080/',
+ // target: '/',
+ target: 'http://localhost:8080/',
changeOrigin: true,
pathRewrite: {
'^/data/api-v/app/findAllApp': 'apps.json'
--
Gitblit v1.8.0