|
|
|
|
@ -1,132 +1,76 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
<el-form-item label="文件路径" prop="filePath">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.filePath"
|
|
|
|
|
placeholder="请输入文件路径"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="文件类型" prop="fileSuffix">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.fileSuffix"
|
|
|
|
|
placeholder="请输入文件类型"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
|
|
|
<el-tab-pane label="启动页" name="startPage">
|
|
|
|
|
<div class="block" style="float: left;margin-left: 3%;margin-top: 3%">
|
|
|
|
|
<video
|
|
|
|
|
ref="video"
|
|
|
|
|
class="play-video"
|
|
|
|
|
controls="controls"
|
|
|
|
|
autoplay="autoplay"
|
|
|
|
|
width="337px"
|
|
|
|
|
height="600px"
|
|
|
|
|
>
|
|
|
|
|
<source :src="videoForm.filePath" type="video/mp4" />
|
|
|
|
|
</video>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="float: left;margin-left: 10%;margin-top: 10%;">
|
|
|
|
|
<el-upload
|
|
|
|
|
ref="upload"
|
|
|
|
|
:limit="1"
|
|
|
|
|
accept=".mp4"
|
|
|
|
|
:headers="upload.headers"
|
|
|
|
|
:action="upload.url"
|
|
|
|
|
:disabled="upload.isUploading"
|
|
|
|
|
:on-progress="handleFileUploadProgress"
|
|
|
|
|
:on-success="handleFileSuccess"
|
|
|
|
|
drag
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-upload"></i>
|
|
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
<div class="el-upload__tip" slot="tip">请上传视频,用于启动页显示,比例建议为16: 9</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-plus"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
v-hasPermi="['system:info:add']"
|
|
|
|
|
>新增</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="single"
|
|
|
|
|
@click="handleUpdate"
|
|
|
|
|
v-hasPermi="['system:info:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="danger"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
size="mini"
|
|
|
|
|
:disabled="multiple"
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
v-hasPermi="['system:info:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="warning"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['system:info:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
<el-tab-pane label="登录页" name="logoPage">
|
|
|
|
|
<div class="block" style="float: left;margin-left: 3%;margin-top: 3%">
|
|
|
|
|
<el-image :src="loginForm.filePath" style="width: 330px;height: 461px;">
|
|
|
|
|
<div slot="placeholder" class="image-slot"><span class="dot"></span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-image>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="float: left;margin-left: 10%;margin-top: 10%;">
|
|
|
|
|
<el-upload
|
|
|
|
|
ref="upload"
|
|
|
|
|
:limit="1"
|
|
|
|
|
accept=".jpg, .png, .jpeg"
|
|
|
|
|
:headers="upload.headers"
|
|
|
|
|
:action="upload.url"
|
|
|
|
|
:disabled="upload.isUploading"
|
|
|
|
|
:on-progress="handleFileUploadProgress"
|
|
|
|
|
:on-success="handleFileSuccess"
|
|
|
|
|
drag
|
|
|
|
|
>
|
|
|
|
|
<i class="el-icon-upload"></i>
|
|
|
|
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
<div class="el-upload__tip" slot="tip">请上传登录页背景图片,建议尺寸为375px*471p</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="主键ID" align="center" prop="id" />
|
|
|
|
|
<el-table-column label="文件路径" align="center" prop="filePath" />
|
|
|
|
|
<el-table-column label="文件类型" align="center" prop="fileSuffix" />
|
|
|
|
|
<el-table-column label="类型(1-启动页 2-登录页)" align="center" prop="type" />
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['system:info:edit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
v-hasPermi="['system:info:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
</el-tab-pane>
|
|
|
|
|
|
|
|
|
|
<pagination
|
|
|
|
|
v-show="total>0"
|
|
|
|
|
:total="total"
|
|
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
</el-tabs>
|
|
|
|
|
<div style="margin-left: 76%;margin-top: 2%" v-show="this.activeName != 'logoPage'">
|
|
|
|
|
<el-button type="primary" @click="submitForm">提 交</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改登录信息对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
<el-form-item label="文件路径" prop="filePath">
|
|
|
|
|
<el-input v-model="form.filePath" placeholder="请输入文件路径" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="文件类型" prop="fileSuffix">
|
|
|
|
|
<el-input v-model="form.fileSuffix" placeholder="请输入文件类型" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="删除标识" prop="delFlag">
|
|
|
|
|
<el-input v-model="form.delFlag" placeholder="请输入删除标识" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/firing";
|
|
|
|
|
|
|
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
|
|
export default {
|
|
|
|
|
name: "Info",
|
|
|
|
|
data() {
|
|
|
|
|
@ -137,6 +81,7 @@ export default {
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
activeName: 'startPage',
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
@ -147,8 +92,30 @@ export default {
|
|
|
|
|
infoList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
videoSrc: 'http://127.0.0.1:9300/statics/2023/12/16/0c49191de1ed8f91b28d9c2b12556154_20231216154804A002.mp4',
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 用户导入参数
|
|
|
|
|
upload: {
|
|
|
|
|
// 是否显示弹出层(用户导入)
|
|
|
|
|
open: false,
|
|
|
|
|
// 弹出层标题(用户导入)
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否禁用上传
|
|
|
|
|
isUploading: false,
|
|
|
|
|
// 是否更新已经存在的用户数据
|
|
|
|
|
updateSupport: 0,
|
|
|
|
|
// 设置上传的请求头部
|
|
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
|
// 上传的地址
|
|
|
|
|
url: process.env.VUE_APP_BASE_API + "/file/upload"
|
|
|
|
|
},
|
|
|
|
|
videoForm:{
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
loginForm:{
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
@ -175,8 +142,23 @@ export default {
|
|
|
|
|
this.infoList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
// 处理逻辑
|
|
|
|
|
this.infoList.forEach((item)=>{
|
|
|
|
|
if (item.type == 1) {
|
|
|
|
|
// 启动页
|
|
|
|
|
this.videoForm = item;
|
|
|
|
|
this.$refs["video"].load();
|
|
|
|
|
this.$refs["video"].play();
|
|
|
|
|
} else {
|
|
|
|
|
// 登录页
|
|
|
|
|
this.loginForm = item;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
handleClick(tab, event) {
|
|
|
|
|
console.log(tab, event);
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
@ -195,6 +177,59 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
// 文件上传中处理
|
|
|
|
|
handleFileUploadProgress(event, file, fileList) {
|
|
|
|
|
// this.upload.isUploading = true;
|
|
|
|
|
console.log('上传处理中==>',JSON.stringify(event))
|
|
|
|
|
},
|
|
|
|
|
// 文件上传成功处理
|
|
|
|
|
handleFileSuccess(response, file, fileList) {
|
|
|
|
|
if(response.code == '200') {
|
|
|
|
|
if (this.activeName == 'startPage') {
|
|
|
|
|
// 启动页处理
|
|
|
|
|
this.videoForm.filePath = response.data.url;
|
|
|
|
|
this.videoForm.fileUrl = response.data.url;
|
|
|
|
|
if (this.videoForm.id != null) {
|
|
|
|
|
// 更新操作
|
|
|
|
|
updateInfo(this.videoForm).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("更新成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// 新增操作
|
|
|
|
|
this.videoForm.type = 1;
|
|
|
|
|
addInfo(this.videoForm).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("保存成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// 登录页处理
|
|
|
|
|
this.loginForm.filePath = response.data.url;
|
|
|
|
|
this.loginForm.fileUrl = response.data.url;
|
|
|
|
|
if (this.loginForm.id != null) {
|
|
|
|
|
// 更新操作
|
|
|
|
|
updateInfo(this.loginForm).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("更新成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// 新增操作
|
|
|
|
|
this.loginForm.type = 2;
|
|
|
|
|
addInfo(this.loginForm).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("保存成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log('上传后的结果==>',JSON.stringify(response))
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
|