| | |
| | | </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" |
| | |
| | | class="el-icon-video-pause" |
| | | style="font-size:26px; vertical-align:middle; color:#409eff" |
| | | ></i> |
| | | </span> |
| | | </span>--> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | // console.log(list, "sensor") |
| | | // id为空,新增摄像机 |
| | | |
| | | if (this.form.voiceEnable && this.form.voiceId === "") { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: "请选择一个事件声音" |
| | | }); |
| | | // if (this.form.voiceEnable && this.form.voiceId === "") { |
| | | // this.$notify({ |
| | | // type: "error", |
| | | // message: "请选择一个事件声音" |
| | | // }); |
| | | |
| | | return; |
| | | } |
| | | // return; |
| | | // } |
| | | |
| | | this.$refs[formName].validate(async valid => { |
| | | if (valid) { |
| | |
| | | message: "摄像机信息修改失败!" |
| | | }); |
| | | } |
| | | }).catch(err => { |
| | | this.$notify({ |
| | | type: "error", |
| | | message: err.data |
| | | }); |
| | | }); |
| | | } else { |
| | | this.form.areaid = this.addParentId; |
| | |
| | | >{{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> |
| | |
| | | |
| | | <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"> |
| | |
| | | } |
| | | }, |
| | | filters: { |
| | | statusFormat (value) { |
| | | statusFormat(value) { |
| | | let statusCode = { |
| | | "-1": "已删除", |
| | | "0": "暂停处理", |
| | |
| | | } |
| | | 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]; |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | snapshotClass () { |
| | | snapshotClass() { |
| | | let classs = ["snapshot"]; |
| | | if (this.form.type === 1) { |
| | | classs.push("snapshot-video") |
| | |
| | | |
| | | return classs; |
| | | }, |
| | | dirOptions () { |
| | | dirOptions() { |
| | | return this.DataStackPool.dirs.filter(dir => { |
| | | return dir.id !== this.DataStackPool.selectedDir.id |
| | | }) |
| | | } |
| | | }, |
| | | data () { |
| | | data() { |
| | | return { |
| | | videoUrl: "", |
| | | imgUrl: "", |
| | |
| | | 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) { |
| | | |
| | |
| | | } |
| | | }, |
| | | // 清空输入框 |
| | | initFormData () { |
| | | initFormData() { |
| | | this.form = { |
| | | enable: false, |
| | | id: "", |
| | |
| | | }; |
| | | }, |
| | | // 添加设备 |
| | | 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 |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | _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; |
| | |
| | | }, |
| | | |
| | | // 保存 |
| | | onSubmit (formName) { |
| | | onSubmit(formName) { |
| | | this.$refs[formName].validate(async valid => { |
| | | if (valid) { |
| | | saveDir(this.form).then(rsp => { |
| | |
| | | }); |
| | | }, |
| | | // 删除摄像机 |
| | | deleteDir () { |
| | | deleteDir() { |
| | | this.$confirm("是否删除此文件夹?", { |
| | | center: true, |
| | | cancelButtonClass: "comfirm-class-cancle", |
| | |
| | | }); |
| | | }); |
| | | }, |
| | | 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 |
| | |
| | | }) |
| | | } |
| | | }, |
| | | async handleFileStatus (row, status, multi = false) { |
| | | async handleFileStatus(row, status, multi = false) { |
| | | let ids = this.multipleSelection; |
| | | if (!multi) { |
| | | ids = [row.id]; |
| | |
| | | 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) { |
| | |
| | | |
| | | }).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) { |
| | |
| | | } |
| | | }) |
| | | }, |
| | | 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({ |
| | |
| | | } |
| | | }) |
| | | }, |
| | | cellFileMove () { |
| | | cellFileMove() { |
| | | moveFile({ id: this.targetFile, stackId: this.targetDir }).then(rsp => { |
| | | if (rsp && rsp.success) { |
| | | this.$notify({ |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | <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" |
| | |
| | | :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 |
| | |
| | | @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;" |
| | |
| | | } from '@/api/scene' |
| | | import RuleEditor from "@/components/subComponents/RuleEditor"; |
| | | import SceneEditor from "./scene/Editor"; |
| | | import { getSoundList } from "@/api/event"; |
| | | |
| | | export default { |
| | | name: "SceneRuleEditor", |
| | |
| | | }, |
| | | mounted() { |
| | | // window.addEventListener('resize', this.windowSizeChange) |
| | | |
| | | this.getSounds(); |
| | | this.eventAudio.addEventListener("ended", () => { |
| | | this.togglePlay = true |
| | | }) |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | 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: '请先选择一个声音!' |
| | | }) |
| | | 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++) { |
| | |
| | | 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", |
| | |
| | | } |
| | | this.editScene = true; |
| | | this.cleanForm(); |
| | | console.log(this.tableRuleList) |
| | | |
| | | //初始化场景名称 |
| | | var pattern = /^场景\s*\d+\s*$/; |
| | |
| | | |
| | | }, |
| | | 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) => { |
| | |
| | | |
| | | }, |
| | | |
| | | 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', |
| | |
| | | return true |
| | | }, |
| | | saveSceneRule() { |
| | | |
| | | if (!this.validateForm()) { |
| | | return |
| | | } |
| | |
| | | this.sceneForm.rules = editorResp.rules; |
| | | this.sceneForm.id = editorResp.id; |
| | | this.sceneForm.group_text = editorResp.text; |
| | | |
| | | this.onSaveScene(this.sceneForm); |
| | | }, |
| | | handleDelScene(groupRule) { |
| | |
| | | } |
| | | } |
| | | textarea { |
| | | height: 143px; |
| | | height: 92px; |
| | | } |
| | | } |
| | | .right { |
| | |
| | | } |
| | | .cell { |
| | | padding-left: 0 !important; |
| | | i{ |
| | | outline: none!important; |
| | | i { |
| | | outline: none !important; |
| | | } |
| | | } |
| | | } |
| | |
| | | </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"> |
| | |
| | | },
|
| | | methods: {
|
| | | getSdkConnection() {
|
| | | console.log(this.VideoManageData.Dictionary)
|
| | | this.sdkConnects = this.VideoManageData.Dictionary['RULECOMPUTEBETWEEN'].map(r => {
|
| | |
|
| | | return {
|
| | |
| | | }
|
| | | })
|
| | |
|
| | | 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,
|
| | |
| | | //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
|
| | |
| | | }
|
| | |
|
| | | })
|
| | | console.log(group_text)
|
| | | }
|
| | |
|
| | | groupRule.text = group_text
|
| | |
| | | <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>
|
| | |
| | |
|
| | | <script>
|
| | | export default {
|
| | | props:[
|
| | | props: [
|
| | | // 'swiperOption',
|
| | | 'sceneData'
|
| | | ],
|
| | | |
| | |
|
| | | data() {
|
| | | return {
|
| | | // mockSceneData: [
|
| | |
| | | nextEl: ".swiper-next-border",
|
| | | prevEl: ".swiper-pre-border"
|
| | | },
|
| | | observer:true,//修改swiper自己或子元素时,自动初始化swiper
|
| | | observeParents:true,//修改swiper的父元素时,自动初始化swiper
|
| | | observer: true,//修改swiper自己或子元素时,自动初始化swiper
|
| | | observeParents: true,//修改swiper的父元素时,自动初始化swiper
|
| | | },
|
| | | 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 = [];
|
| | | }
|
| | | });
|
| | |
| | | },
|
| | | computed: {
|
| | | slides() {
|
| | | return this.chunk(this.mockSceneData,5);
|
| | | return this.chunk(this.mockSceneData, 5);
|
| | | }
|
| | | }
|
| | | };
|
| | |
| | | fill: currentColor;
|
| | | overflow: hidden;
|
| | | }
|
| | | .task-tip{
|
| | | .task-tip {
|
| | | font-family: PingFangSC-Regular;
|
| | | font-size: 12px;
|
| | | color: #cccccc;
|
| | |
| | | left: 50%;
|
| | | transform: translate(-50%, -50%);
|
| | | box-shadow: none;
|
| | | width: 100%
|
| | | width: 100%;
|
| | | }
|
| | | }
|
| | | .double {
|
| | |
| | | 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' |