mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
发布 v4.2.0
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ruoyi-vue-plus",
|
||||
"version": "4.1.0",
|
||||
"version": "4.2.0",
|
||||
"description": "RuoYi-Vue-Plus后台管理系统",
|
||||
"author": "LionLi",
|
||||
"license": "MIT",
|
||||
|
@ -57,3 +57,15 @@ export function getCodeImg() {
|
||||
timeout: 20000
|
||||
})
|
||||
}
|
||||
|
||||
// 短信验证码
|
||||
export function getCodeSms() {
|
||||
return request({
|
||||
url: '/captchaSms',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
method: 'get',
|
||||
timeout: 20000
|
||||
})
|
||||
}
|
||||
|
@ -9,6 +9,14 @@ export function listOss(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 查询OSS对象基于id串
|
||||
export function listByIds(ossId) {
|
||||
return request({
|
||||
url: '/system/oss/listByIds/' + ossId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除OSS对象存储
|
||||
export function delOss(ossId) {
|
||||
return request({
|
||||
|
@ -17,7 +17,7 @@ $--button-font-weight: 400;
|
||||
$--border-color-light: #dfe4ed;
|
||||
$--border-color-lighter: #e6ebf5;
|
||||
|
||||
$--table-border:1px solid#dfe6ec;
|
||||
$--table-border: 1px solid #dfe6ec;
|
||||
|
||||
/* icon font path, required */
|
||||
$--font-path: '~element-ui/lib/theme-chalk/fonts';
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { delOss } from "@/api/system/oss";
|
||||
import { listByIds, delOss } from "@/api/system/oss";
|
||||
|
||||
export default {
|
||||
name: "FileUpload",
|
||||
@ -83,11 +83,21 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
async handler(val) {
|
||||
if (val) {
|
||||
let temp = 1;
|
||||
// 首先将值转为数组
|
||||
const list = Array.isArray(val) ? val : this.value.split(',');
|
||||
let list;
|
||||
if (Array.isArray(val)) {
|
||||
list = val;
|
||||
} else {
|
||||
await listByIds(val).then(res => {
|
||||
list = res.data.map(oss => {
|
||||
oss = { name: oss.originalName, url: oss.url, ossId: oss.ossId };
|
||||
return oss;
|
||||
});
|
||||
})
|
||||
}
|
||||
// 然后将数组转为对象数组
|
||||
this.fileList = list.map(item => {
|
||||
item = { name: item.name, url: item.url, ossId: item.ossId };
|
||||
@ -157,7 +167,7 @@ export default {
|
||||
this.fileList = this.fileList.concat(this.uploadList);
|
||||
this.uploadList = [];
|
||||
this.number = 0;
|
||||
this.$emit("input", this.fileList);
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
this.$modal.closeLoading();
|
||||
}
|
||||
} else {
|
||||
@ -170,7 +180,7 @@ export default {
|
||||
let ossId = this.fileList[index].ossId;
|
||||
delOss(ossId);
|
||||
this.fileList.splice(index, 1);
|
||||
this.$emit("input", this.fileList);
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
},
|
||||
// 获取文件名称
|
||||
getFileName(name) {
|
||||
@ -181,6 +191,15 @@ export default {
|
||||
return name;
|
||||
}
|
||||
},
|
||||
// 对象转成指定字符串分隔
|
||||
listToString(list, separator) {
|
||||
let strs = "";
|
||||
separator = separator || ",";
|
||||
for (let i in list) {
|
||||
strs += list[i].ossId + separator;
|
||||
}
|
||||
return strs != "" ? strs.substr(0, strs.length - 1) : "";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
@ -12,7 +12,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isExternal } from "@/utils/validate";
|
||||
|
||||
export default {
|
||||
name: "ImagePreview",
|
||||
@ -33,19 +32,13 @@ export default {
|
||||
computed: {
|
||||
realSrc() {
|
||||
let real_src = this.src.split(",")[0];
|
||||
if (isExternal(real_src)) {
|
||||
return real_src;
|
||||
}
|
||||
return process.env.VUE_APP_BASE_API + real_src;
|
||||
return real_src;
|
||||
},
|
||||
realSrcList() {
|
||||
let real_src_list = this.src.split(",");
|
||||
let srcList = [];
|
||||
real_src_list.forEach(item => {
|
||||
if (isExternal(item)) {
|
||||
return srcList.push(item);
|
||||
}
|
||||
return srcList.push(process.env.VUE_APP_BASE_API + item);
|
||||
return srcList.push(item);
|
||||
});
|
||||
return srcList;
|
||||
},
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { delOss } from "@/api/system/oss";
|
||||
import { listByIds, delOss } from "@/api/system/oss";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@ -87,10 +87,17 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
async handler(val) {
|
||||
if (val) {
|
||||
// 首先将值转为数组
|
||||
const list = Array.isArray(val) ? val : this.value.split(',');
|
||||
let list;
|
||||
if (Array.isArray(val)) {
|
||||
list = val;
|
||||
} else {
|
||||
await listByIds(val).then(res => {
|
||||
list = res.data;
|
||||
})
|
||||
}
|
||||
// 然后将数组转为对象数组
|
||||
this.fileList = list.map(item => {
|
||||
// 此处name使用ossId 防止删除出现重名
|
||||
@ -120,7 +127,7 @@ export default {
|
||||
let ossId = this.fileList[findex].ossId;
|
||||
delOss(ossId);
|
||||
this.fileList.splice(findex, 1);
|
||||
this.$emit("input", this.fileList);
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
}
|
||||
},
|
||||
// 上传成功回调
|
||||
@ -131,7 +138,7 @@ export default {
|
||||
this.fileList = this.fileList.concat(this.uploadList);
|
||||
this.uploadList = [];
|
||||
this.number = 0;
|
||||
this.$emit("input", this.fileList);
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
this.$modal.closeLoading();
|
||||
}
|
||||
} else {
|
||||
@ -184,6 +191,15 @@ export default {
|
||||
this.dialogImageUrl = file.url;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
// 对象转成指定字符串分隔
|
||||
listToString(list, separator) {
|
||||
let strs = "";
|
||||
separator = separator || ",";
|
||||
for (let i in list) {
|
||||
strs += list[i].ossId + separator;
|
||||
}
|
||||
return strs != "" ? strs.substr(0, strs.length - 1) : "";
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -73,6 +73,9 @@ DictData.install()
|
||||
* please remove it before going online! ! !
|
||||
*/
|
||||
|
||||
// 修改 el-dialog 默认点击遮照为不关闭
|
||||
Element.Dialog.props.closeOnClickModal.default = false
|
||||
|
||||
Vue.use(Element, {
|
||||
size: Cookies.get('size') || 'medium' // set element-ui default size
|
||||
})
|
||||
|
@ -11,7 +11,7 @@ import DictOptions from './DictOptions'
|
||||
export default class DictMeta {
|
||||
constructor(options) {
|
||||
this.type = options.type
|
||||
this.request = options.request,
|
||||
this.request = options.request
|
||||
this.responseConverter = options.responseConverter
|
||||
this.labelField = options.labelField
|
||||
this.valueField = options.valueField
|
||||
|
@ -1,29 +0,0 @@
|
||||
export default [
|
||||
{
|
||||
layout: 'colFormItem',
|
||||
tagIcon: 'input',
|
||||
label: '手机号',
|
||||
vModel: 'mobile',
|
||||
formId: 6,
|
||||
tag: 'el-input',
|
||||
placeholder: '请输入手机号',
|
||||
defaultValue: '',
|
||||
span: 24,
|
||||
style: { width: '100%' },
|
||||
clearable: true,
|
||||
prepend: '',
|
||||
append: '',
|
||||
'prefix-icon': 'el-icon-mobile',
|
||||
'suffix-icon': '',
|
||||
maxlength: 11,
|
||||
'show-word-limit': true,
|
||||
readonly: false,
|
||||
disabled: false,
|
||||
required: true,
|
||||
changeTag: true,
|
||||
regList: [{
|
||||
pattern: '/^1(3|4|5|7|8|9)\\d{9}$/',
|
||||
message: '手机号格式错误'
|
||||
}]
|
||||
}
|
||||
]
|
@ -68,7 +68,7 @@ export function addDateRange(params, dateRange, propName) {
|
||||
return search;
|
||||
}
|
||||
|
||||
// 回显数据字典
|
||||
// 回显数据字典
|
||||
export function selectDictLabel(datas, value) {
|
||||
if (value === undefined) {
|
||||
return "";
|
||||
@ -207,10 +207,10 @@ export function tansParams(params) {
|
||||
for (const propName of Object.keys(params)) {
|
||||
const value = params[propName];
|
||||
var part = encodeURIComponent(propName) + "=";
|
||||
if (value !== null && typeof (value) !== "undefined") {
|
||||
if (value !== null && value !== "" && typeof (value) !== "undefined") {
|
||||
if (typeof value === 'object') {
|
||||
for (const key of Object.keys(value)) {
|
||||
if (value[key] !== null && typeof (value[key]) !== 'undefined') {
|
||||
if (value[key] !== null && value[key] !== "" && typeof (value[key]) !== 'undefined') {
|
||||
let params = propName + '[' + key + ']';
|
||||
var subPart = encodeURIComponent(params) + "=";
|
||||
result += subPart + encodeURIComponent(value[key]) + "&";
|
||||
@ -233,4 +233,4 @@ export async function blobValidate(data) {
|
||||
} catch (error) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
// 版本号
|
||||
version: "4.1.0",
|
||||
version: "4.2.0",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
|
@ -191,7 +191,7 @@
|
||||
|
||||
<script>
|
||||
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
|
||||
import { listType, getType } from "@/api/system/dict/type";
|
||||
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type";
|
||||
|
||||
export default {
|
||||
name: "Data",
|
||||
@ -287,8 +287,8 @@ export default {
|
||||
},
|
||||
/** 查询字典类型列表 */
|
||||
getTypeList() {
|
||||
listType().then(response => {
|
||||
this.typeOptions = response.rows;
|
||||
getDictOptionselect().then(response => {
|
||||
this.typeOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询字典数据列表 */
|
||||
|
@ -2,14 +2,13 @@
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="配置key" prop="configKey">
|
||||
<el-select v-model="queryParams.configKey" placeholder="请选择配置key" clearable size="small">
|
||||
<el-option
|
||||
v-for="configKey in configKeyOptions"
|
||||
:key="configKey.configKey"
|
||||
:label="configKey.label"
|
||||
:value="configKey.configKey"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="queryParams.configKey"
|
||||
placeholder="配置key"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="桶名称" prop="bucketName">
|
||||
<el-input
|
||||
@ -77,6 +76,7 @@
|
||||
<el-table-column label="主建" align="center" prop="ossConfigId" v-if="false"/>
|
||||
<el-table-column label="配置key" align="center" prop="configKey" />
|
||||
<el-table-column label="访问站点" align="center" prop="endpoint" width="200" />
|
||||
<el-table-column label="自定义域名" align="center" prop="domain" width="200" />
|
||||
<el-table-column label="桶名称" align="center" prop="bucketName" />
|
||||
<el-table-column label="前缀" align="center" prop="prefix" />
|
||||
<el-table-column label="域" align="center" prop="region" />
|
||||
@ -122,18 +122,14 @@
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="配置key" prop="configKey">
|
||||
<el-select v-model="form.configKey" placeholder="请选择配置key">
|
||||
<el-option
|
||||
v-for="configKey in configKeyOptions"
|
||||
:key="configKey.configKey"
|
||||
:label="configKey.label"
|
||||
:value="configKey.configKey"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-model="form.configKey" placeholder="请输入配置key" />
|
||||
</el-form-item>
|
||||
<el-form-item label="访问站点" prop="endpoint">
|
||||
<el-input v-model="form.endpoint" placeholder="请输入访问站点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="自定义域名" prop="domain">
|
||||
<el-input v-model="form.domain" placeholder="请输入自定义域名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="accessKey" prop="accessKey">
|
||||
<el-input v-model="form.accessKey" placeholder="请输入accessKey" />
|
||||
</el-form-item>
|
||||
@ -204,14 +200,6 @@ export default {
|
||||
total: 0,
|
||||
// 对象存储配置表格数据
|
||||
ossConfigList: [],
|
||||
// configKeyOptions
|
||||
configKeyOptions: [],
|
||||
configKeyDatas: [
|
||||
{ configKey: "minio", label: "Minio" },
|
||||
{ configKey: "qiniu", label: "七牛云" },
|
||||
{ configKey: "aliyun", label: "阿里云" },
|
||||
{ configKey: "qcloud", label: "腾讯云" },
|
||||
],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@ -276,7 +264,6 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.configKeyOptions = this.configKeyDatas;
|
||||
},
|
||||
methods: {
|
||||
/** 查询对象存储配置列表 */
|
||||
@ -303,6 +290,7 @@ export default {
|
||||
bucketName: undefined,
|
||||
prefix: undefined,
|
||||
endpoint: undefined,
|
||||
domain: undefined,
|
||||
isHttps: "N",
|
||||
region: undefined,
|
||||
status: "1",
|
||||
|
@ -21,6 +21,7 @@
|
||||
:filter-node-method="filterNode"
|
||||
ref="tree"
|
||||
default-expand-all
|
||||
highlight-current
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</div>
|
||||
|
@ -486,7 +486,7 @@
|
||||
</el-tree>
|
||||
</template>
|
||||
|
||||
<template v-if="activeData.layout === 'colFormItem'">
|
||||
<template v-if="activeData.layout === 'colFormItem' && activeData.tag !== 'el-button'">
|
||||
<el-divider>正则校验</el-divider>
|
||||
<div
|
||||
v-for="(item, index) in activeData.regList"
|
||||
|
@ -316,7 +316,7 @@ export default {
|
||||
return result.value || ' ';
|
||||
},
|
||||
/** 复制代码成功 */
|
||||
clipboardSuccess(){
|
||||
clipboardSuccess() {
|
||||
this.$modal.msgSuccess("复制成功");
|
||||
},
|
||||
// 多选框选中数据
|
||||
|
Reference in New Issue
Block a user