Merge remote-tracking branch 'origin/feature-20240104' into feature-20240104

master
382696293@qq.com 2 years ago
commit 9c4388336c

@ -33,6 +33,7 @@ public class SysFileController
try
{
// 上传并返回访问地址
System.out.println("文件上传开始");
String url = sysFileService.uploadFile(file);
SysFile sysFile = new SysFile();
sysFile.setName(FileUtils.getName(url));

@ -23,3 +23,8 @@ spring:
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
servlet:
multipart:
enabled: true #默认支持文件上传
max-file-size: 50MB #最大文件
max-request-size: 30MB #最大支持请求大小

@ -185,6 +185,7 @@ export default {
refreshTable: true,
//
queryParams: {
type: 2,
tagName: undefined,
status: undefined
},

@ -1,132 +1,101 @@
<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="middlePage">
<div style="height: 500px;">
<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>
</div>
</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>
</el-tabs>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改登录信息对话框 -->
<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 +106,7 @@ export default {
ids: [],
//
single: true,
activeName: 'startPage',
//
multiple: true,
//
@ -147,8 +117,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 +167,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 +202,61 @@ 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;
this.videoForm.fileSuffix = 'video';
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;
this.videoForm.fileSuffix = 'image';
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;

@ -0,0 +1,336 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="标签名称" prop="tagName">
<el-input
v-model="queryParams.tagName"
placeholder="请输入标签名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="标签状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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-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:dept:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="deptList"
row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column prop="tagName" label="标签名称" width="260"></el-table-column>
<el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<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:dept:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['system:dept:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:dept:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改标签对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="24" v-if="form.parentId !== 0">
<el-form-item label="上级标签" prop="parentId">
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级标签" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="标签名称" prop="tagName">
<el-input v-model="form.tagName" placeholder="请输入标签名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="显示排序" prop="orderNum">
<el-input-number v-model="form.orderNum" controls-position="right" :min="0" />
</el-form-item>
</el-col>
</el-row>
<!-- <el-row>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="负责人" prop="leader">-->
<!-- <el-input v-model="form.leader" placeholder="请输入负责人" maxlength="20" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="联系电话" prop="phone">-->
<!-- <el-input v-model="form.phone" placeholder="请输入联系电话" maxlength="11" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <el-row>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="邮箱" prop="email">-->
<!-- <el-input v-model="form.email" placeholder="请输入邮箱" maxlength="50" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col :span="12">-->
<!-- <el-form-item label="标签状态">-->
<!-- <el-radio-group v-model="form.status">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.sys_normal_disable"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
</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 { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/wechatTab";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Dept",
dicts: ['sys_normal_disable'],
components: { Treeselect },
data() {
return {
//
loading: true,
//
showSearch: true,
//
deptList: [],
//
deptOptions: [],
//
title: "",
//
open: false,
//
isExpandAll: true,
//
refreshTable: true,
//
queryParams: {
type: 1,
tagName: undefined,
status: undefined
},
//
form: {},
//
rules: {
// parentId: [
// { required: true, message: "", trigger: "blur" }
// ],
tagName: [
{ required: true, message: "标签名称不能为空", trigger: "blur" }
],
orderNum: [
{ required: true, message: "显示排序不能为空", trigger: "blur" }
],
email: [
{
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"]
}
],
phone: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
message: "请输入正确的手机号码",
trigger: "blur"
}
]
}
};
},
created() {
this.getList();
},
methods: {
/** 查询标签列表 */
getList() {
this.loading = true;
listDept(this.queryParams).then(response => {
this.deptList = this.handleTree(response.data, "id");
this.loading = false;
});
},
/** 转换标签数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.id,
label: node.tagName,
children: node.children
};
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: undefined,
parentId: undefined,
tagName: undefined,
orderNum: undefined,
leader: undefined,
phone: undefined,
email: undefined,
status: "0"
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
if (row != undefined) {
this.form.parentId = row.id;
}
this.open = true;
this.title = "添加标签";
listDept().then(response => {
this.deptOptions = this.handleTree(response.data, "id");
});
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
getDept(row.id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改标签";
});
listDeptExcludeChild(row.id).then(response => {
this.deptOptions = this.handleTree(response.data, "id");
});
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != undefined) {
updateDept(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addDept(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除名称为"' + row.tagName + '"的数据项?').then(function() {
return delDept(row.id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
};
</script>

@ -66,7 +66,7 @@
<el-upload
ref="upload"
:limit="1"
accept=".jpg, .png, .jpeg"
accept=".jpg, .png, .jpeg, .mp4"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"

@ -185,6 +185,7 @@ export default {
refreshTable: true,
//
queryParams: {
type: 1,
tagName: undefined,
status: undefined
},

Loading…
Cancel
Save