¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.bo; |
| | | |
| | | import com.ruoyi.common.core.domain.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * OSSäºåå¨å页æ¥è¯¢å¯¹è±¡ sys_oss |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel("OSSäºåå¨å页æ¥è¯¢å¯¹è±¡") |
| | | public class SysOssQueryBo extends BaseEntity { |
| | | |
| | | /** |
| | | * åé¡µå¤§å° |
| | | */ |
| | | @ApiModelProperty("å页大å°") |
| | | private Integer pageSize; |
| | | /** |
| | | * å½åé¡µæ° |
| | | */ |
| | | @ApiModelProperty("å½å页æ°") |
| | | private Integer pageNum; |
| | | /** |
| | | * æåºå |
| | | */ |
| | | @ApiModelProperty("æåºå") |
| | | private String orderByColumn; |
| | | /** |
| | | * æåºçæ¹ådescæè
asc |
| | | */ |
| | | @ApiModelProperty(value = "æåºçæ¹å", example = "asc,desc") |
| | | private String isAsc; |
| | | |
| | | |
| | | /** |
| | | * æä»¶å |
| | | */ |
| | | @ApiModelProperty("æä»¶å") |
| | | private String fileName; |
| | | /** |
| | | * æä»¶åç¼å |
| | | */ |
| | | @ApiModelProperty("æä»¶åç¼å") |
| | | private String fileSuffix; |
| | | /** |
| | | * URLå°å |
| | | */ |
| | | @ApiModelProperty("URLå°å") |
| | | private String url; |
| | | /** |
| | | * æå¡å |
| | | */ |
| | | @ApiModelProperty("æå¡å") |
| | | private String service; |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.system.bo.SysOssQueryBo; |
| | | import com.ruoyi.system.domain.SysOss; |
| | | import com.ruoyi.system.service.ISysOssService; |
| | | import com.ruoyi.system.vo.SysOssVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Validated |
| | | @Api(value = "OSSäºå卿§å¶å¨", tags = {"OSSäºåå¨ç®¡ç"}) |
| | | @RequiredArgsConstructor(onConstructor_ = @Autowired) |
| | | @RestController |
| | | @RequestMapping("/system/oss") |
| | |
| | | private final ISysOssService iSysOssService; |
| | | |
| | | /** |
| | | * æ¥è¯¢æä»¶ä¸ä¼ å表 |
| | | * æ¥è¯¢OSSäºåå¨å表 |
| | | */ |
| | | @ApiOperation("æ¥è¯¢OSSäºåå¨å表") |
| | | @PreAuthorize("@ss.hasPermi('system:oss:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysOss> list(SysOss sysOss) { |
| | | return iSysOssService.queryPageList(sysOss); |
| | | public TableDataInfo<SysOssVo> list(@Validated SysOssQueryBo bo) { |
| | | return iSysOssService.queryPageList(bo); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ å¾ç |
| | | * ä¸ä¼ OSSäºåå¨ |
| | | */ |
| | | @ApiOperation("ä¸ä¼ OSSäºåå¨") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "file", value = "æä»¶", dataType = "java.io.File", required = true), |
| | | }) |
| | | @PreAuthorize("@ss.hasPermi('system:oss:upload')") |
| | | @Log(title = "OSSäºåå¨", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit |
| | | @PostMapping("/upload") |
| | | public AjaxResult<Map<String, String>> upload(@RequestParam("file") MultipartFile file) { |
| | | public AjaxResult<Map<String, String>> upload(@RequestPart("file") MultipartFile file) { |
| | | if (file.isEmpty()) { |
| | | throw new CustomException("ä¸ä¼ æä»¶ä¸è½ä¸ºç©º"); |
| | | } |
| | |
| | | /** |
| | | * å é¤OSSäºåå¨ |
| | | */ |
| | | @ApiOperation("å é¤OSSäºåå¨") |
| | | @PreAuthorize("@ss.hasPermi('system:oss:remove')") |
| | | @Log(title = "OSSäºåå¨" , businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ossIds}") |
| | | public AjaxResult<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ossIds) { |
| | | return toAjax(iSysOssService.deleteByIds(Arrays.asList(ossIds)) ? 1 : 0); |
| | | return toAjax(iSysOssService.deleteWithValidByIds(Arrays.asList(ossIds), true) ? 1 : 0); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.common.core.mybatisplus.core.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysOss; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysOssMapper extends BaseMapper<SysOss> { |
| | | public interface SysOssMapper extends BaseMapperPlus<SysOss> { |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.mybatisplus.core.IServicePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.system.bo.SysOssQueryBo; |
| | | import com.ruoyi.system.domain.SysOss; |
| | | import com.ruoyi.system.vo.SysOssVo; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Collection; |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface ISysOssService extends IService<SysOss> { |
| | | public interface ISysOssService extends IServicePlus<SysOss> { |
| | | |
| | | TableDataInfo<SysOss> queryPageList(SysOss sysOss); |
| | | TableDataInfo<SysOssVo> queryPageList(SysOssQueryBo sysOss); |
| | | |
| | | SysOss upload(MultipartFile file); |
| | | |
| | | Boolean deleteByIds(Collection<Long> ids); |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl; |
| | | import com.ruoyi.common.core.page.PagePlus; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.exception.CustomException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.oss.factory.OssFactory; |
| | | import com.ruoyi.oss.service.ICloudStorageService; |
| | | import com.ruoyi.system.bo.SysOssQueryBo; |
| | | import com.ruoyi.system.domain.SysOss; |
| | | import com.ruoyi.system.mapper.SysOssMapper; |
| | | import com.ruoyi.system.service.ISysOssService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import com.ruoyi.system.vo.SysOssVo; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * æä»¶ä¸ä¼ æå¡å±å®ç° |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class SysOssServiceImpl extends ServiceImpl<SysOssMapper, SysOss> implements ISysOssService { |
| | | public class SysOssServiceImpl extends ServicePlusImpl<SysOssMapper, SysOss> implements ISysOssService { |
| | | |
| | | @Override |
| | | public TableDataInfo<SysOss> queryPageList(SysOss sysOss) { |
| | | public TableDataInfo<SysOssVo> queryPageList(SysOssQueryBo bo) { |
| | | PagePlus<SysOss, SysOssVo> result = pageVo(PageUtils.buildPagePlus(), buildQueryWrapper(bo), SysOssVo.class); |
| | | return PageUtils.buildDataInfo(result); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysOss> buildQueryWrapper(SysOssQueryBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<SysOss> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StrUtil.isNotBlank(sysOss.getFileName()), SysOss::getFileName, sysOss.getFileName()); |
| | | lqw.like(StrUtil.isNotBlank(sysOss.getFileSuffix()), SysOss::getFileSuffix, sysOss.getFileSuffix()); |
| | | lqw.like(StrUtil.isNotBlank(sysOss.getUrl()), SysOss::getUrl, sysOss.getUrl()); |
| | | lqw.like(StrUtil.isNotBlank(sysOss.getService()), SysOss::getService, sysOss.getService()); |
| | | return PageUtils.buildDataInfo(page(PageUtils.buildPage(), lqw)); |
| | | lqw.like(StrUtil.isNotBlank(bo.getFileName()), SysOss::getFileName, bo.getFileName()); |
| | | lqw.eq(StrUtil.isNotBlank(bo.getFileSuffix()), SysOss::getFileSuffix, bo.getFileSuffix()); |
| | | lqw.eq(StrUtil.isNotBlank(bo.getUrl()), SysOss::getUrl, bo.getUrl()); |
| | | lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null, |
| | | SysOss::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime")); |
| | | lqw.eq(StrUtil.isNotBlank(bo.getCreateBy()), SysOss::getCreateBy, bo.getCreateBy()); |
| | | lqw.eq(StrUtil.isNotBlank(bo.getService()), SysOss::getService, bo.getService()); |
| | | return lqw; |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Boolean deleteByIds(Collection<Long> ids) { |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | // åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | List<SysOss> list = listByIds(ids); |
| | | for (SysOss sysOss : list) { |
| | | ICloudStorageService storage = OssFactory.instance(sysOss.getService()); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * OSSäºåå¨è§å¾å¯¹è±¡ sys_oss |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | @Data |
| | | @ApiModel("OSSäºåå¨è§å¾å¯¹è±¡") |
| | | public class SysOssVo { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * äºåå¨ä¸»é® |
| | | */ |
| | | @ApiModelProperty("äºåå¨ä¸»é®") |
| | | private Long ossId; |
| | | |
| | | /** |
| | | * æä»¶å |
| | | */ |
| | | @ApiModelProperty("æä»¶å") |
| | | private String fileName; |
| | | |
| | | /** |
| | | * æä»¶åç¼å |
| | | */ |
| | | @ApiModelProperty("æä»¶åç¼å") |
| | | private String fileSuffix; |
| | | |
| | | /** |
| | | * URLå°å |
| | | */ |
| | | @ApiModelProperty("URLå°å") |
| | | private String url; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ApiModelProperty("å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * ä¸ä¼ 人 |
| | | */ |
| | | @ApiModelProperty("ä¸ä¼ 人") |
| | | private String createBy; |
| | | |
| | | /** |
| | | * æå¡å |
| | | */ |
| | | @ApiModelProperty("æå¡å") |
| | | private String service; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // æ¥è¯¢OSSäºåå¨å表 |
| | | export function listOss(query) { |
| | | return request({ |
| | | url: '/system/oss/list', |
| | | method: 'get', |
| | | params: query |
| | | }) |
| | | } |
| | | |
| | | // ä¸ä¼ OSSäºåå¨ |
| | | export function addOss(data) { |
| | | return request({ |
| | | url: '/system/oss/upload', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // ä¸è½½OSSäºåå¨ |
| | | export function downloadOss(ossId) { |
| | | return request({ |
| | | url: '/system/oss/download/' + ossId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // å é¤OSSäºåå¨ |
| | | export function delOss(ossId) { |
| | | return request({ |
| | | url: '/system/oss/' + ossId, |
| | | method: 'delete' |
| | | }) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="æä»¶å" prop="fileName"> |
| | | <el-input |
| | | v-model="queryParams.fileName" |
| | | placeholder="请è¾å
¥æä»¶å" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æä»¶åç¼" prop="fileSuffix"> |
| | | <el-input |
| | | v-model="queryParams.fileSuffix" |
| | | placeholder="请è¾å
¥æä»¶åç¼" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´"> |
| | | <el-date-picker |
| | | v-model="daterangeCreateTime" |
| | | size="small" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="ä¸ä¼ 人" prop="createBy"> |
| | | <el-input |
| | | v-model="queryParams.createBy" |
| | | placeholder="请è¾å
¥ä¸ä¼ 人" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="æå¡å" prop="service"> |
| | | <el-input |
| | | v-model="queryParams.service" |
| | | placeholder="请è¾å
¥æå¡å" |
| | | clearable |
| | | size="small" |
| | | @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-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:oss:upload']" |
| | | >ä¸ä¼ </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:oss:remove']" |
| | | >å é¤</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="ossList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="äºåå¨ä¸»é®" align="center" prop="ossId" v-if="false"/> |
| | | <el-table-column label="æä»¶å" align="center" prop="fileName" /> |
| | | <el-table-column label="æä»¶åç¼å" align="center" prop="fileSuffix" /> |
| | | <el-table-column label="URLå°å" align="center" prop="url" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ä¸ä¼ 人" align="center" prop="createBy" /> |
| | | <el-table-column label="æå¡å" align="center" prop="service" /> |
| | | <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="handleDownload(scope.row)" |
| | | v-hasPermi="['system:oss:download']" |
| | | >ä¸è½½</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:oss:remove']" |
| | | >å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- æ·»å æä¿®æ¹OSSäºåå¨å¯¹è¯æ¡ --> |
| | | <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="æä»¶å"> |
| | | <imageUpload v-model="form.file"/> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button :loading="buttonLoading" type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { listOss, delOss, addOss, downloadOss } from "@/api/system/oss"; |
| | | |
| | | export default { |
| | | name: "Oss", |
| | | data() { |
| | | return { |
| | | // æé®loading |
| | | buttonLoading: false, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // 导åºé®ç½©å± |
| | | exportLoading: false, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // OSSäºåå¨è¡¨æ ¼æ°æ® |
| | | ossList: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // å建æ¶é´æ¶é´èå´ |
| | | daterangeCreateTime: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | fileName: undefined, |
| | | fileSuffix: undefined, |
| | | url: undefined, |
| | | createTime: undefined, |
| | | createBy: undefined, |
| | | service: undefined |
| | | }, |
| | | // 表ååæ° |
| | | form: {}, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | file: [ |
| | | { required: true, message: "æä»¶ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢OSSäºåå¨å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | this.queryParams.params = {}; |
| | | if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) { |
| | | this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0]; |
| | | this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1]; |
| | | } |
| | | listOss(this.queryParams).then(response => { |
| | | this.ossList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | ossId: undefined, |
| | | file: undefined, |
| | | fileName: undefined, |
| | | fileSuffix: undefined, |
| | | url: undefined, |
| | | createTime: undefined, |
| | | createBy: undefined, |
| | | updateTime: undefined, |
| | | updateBy: undefined, |
| | | service: undefined |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.daterangeCreateTime = []; |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.ossId) |
| | | this.single = selection.length!==1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "ä¸ä¼ OSSäºåå¨"; |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | this.buttonLoading = true; |
| | | addOss(this.form).then(response => { |
| | | this.msgSuccess("ä¸ä¼ æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }).finally(() => { |
| | | this.buttonLoading = false; |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const ossIds = row.ossId || this.ids; |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤OSSäºåå¨ç¼å·ä¸º"' + ossIds + '"çæ°æ®é¡¹?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }).then(() => { |
| | | this.loading = true; |
| | | return delOss(ossIds); |
| | | }).then(() => { |
| | | this.loading = false; |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | |
| | | insert into sys_config values(10, 'OSSäºå卿å¡å', 'sys.oss.cloudStorageService', 'minio', 'Y', 'admin', sysdate(), '', null, 'OSSäºå卿å¡å(qiniu:ä¸çäº, aliyun:é¿éäº, qcloud:è
¾è®¯äº, minio: Minio)'); |
| | | |
| | | insert into sys_menu values('118', 'æä»¶ç®¡ç', '1', '10', 'oss', 'system/oss/index', 1, 0, 'C', '0', '0', 'system:oss:list', 'oss', 'admin', sysdate(), '', null, 'æä»¶ç®¡çèå'); |
| | | insert into sys_menu values('118', 'æä»¶ç®¡ç', '1', '10', 'oss', 'system/oss/index', 1, 0, 'C', '0', '0', 'system:oss:list', 'upload', 'admin', sysdate(), '', null, 'æä»¶ç®¡çèå'); |
| | | |
| | | insert into sys_menu values('1600', 'æä»¶æ¥è¯¢', '118', '1', '#', '', 1, 0, 'F', '0', '0', 'system:oss:query', '#', 'admin', sysdate(), '', null, ''); |
| | | insert into sys_menu values('1601', 'æä»¶ä¸ä¼ ', '118', '2', '#', '', 1, 0, 'F', '0', '0', 'system:oss:upload', '#', 'admin', sysdate(), '', null, ''); |