2024.7.10 新元素官网 字典倒序,网站接口代码
This commit is contained in:
parent
3fbe35e556
commit
25a85220ba
|
@ -0,0 +1,67 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.utils.sign.Base64;
|
||||
import com.ruoyi.system.domain.XysArticle;
|
||||
import com.ruoyi.system.domain.XysImg;
|
||||
import com.ruoyi.system.service.IXysArticleService;
|
||||
import com.ruoyi.system.service.IXysImgService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 門戶Controller
|
||||
*
|
||||
* @author libao
|
||||
* @date 2024-07-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/door")
|
||||
public class DoorController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IXysArticleService xysArticleService;
|
||||
@Autowired
|
||||
private IXysImgService xysImgService;
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
@GetMapping("/getArticleList")
|
||||
public TableDataInfo getArticleList(XysArticle xysArticle)
|
||||
{
|
||||
startPage();
|
||||
List<XysArticle> list = xysArticleService.selectXysArticleList(xysArticle);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询图片列表
|
||||
*/
|
||||
@GetMapping("/getImgList")
|
||||
public TableDataInfo getImgList(XysImg xysImg)
|
||||
{
|
||||
startPage();
|
||||
List<XysImg> list = xysImgService.selectXysImgList(xysImg);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章管理详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(xysArticleService.selectXysArticleById(id));
|
||||
}
|
||||
|
||||
}
|
|
@ -79,8 +79,8 @@ public class XysArticleController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody XysArticle xysArticle)
|
||||
{
|
||||
String content = new String(Base64.decode(xysArticle.getContent()));
|
||||
xysArticle.setContent(content);
|
||||
// String content = new String(Base64.decode(xysArticle.getContent()));
|
||||
// xysArticle.setContent(content);
|
||||
return toAjax(xysArticleService.insertXysArticle(xysArticle));
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ public class XysArticleController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody XysArticle xysArticle)
|
||||
{
|
||||
String content = new String(Base64.decode(xysArticle.getContent()));
|
||||
xysArticle.setContent(content);
|
||||
// String content = new String(Base64.decode(xysArticle.getContent()));
|
||||
// xysArticle.setContent(content);
|
||||
return toAjax(xysArticleService.updateXysArticle(xysArticle));
|
||||
}
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
||||
|
|
|
@ -66,7 +66,11 @@
|
|||
<el-table v-loading="loading" :data="imgList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="官网图片管理" align="center" prop="id" />
|
||||
<el-table-column label="图片类型" align="center" prop="imgType" />
|
||||
<el-table-column label="图片类型" align="center" prop="imgType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.img_type" :value="scope.row.imgType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图片地址" align="center" prop="imgUrl" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.imgUrl" :width="50" :height="50"/>
|
||||
|
@ -109,6 +113,16 @@
|
|||
<!-- 添加或修改图片管理对话框 -->
|
||||
<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="imgType">
|
||||
<el-select v-model="form.imgType" placeholder="请选择图片类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.img_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片地址" prop="imgUrl">
|
||||
<image-upload v-model="form.imgUrl"/>
|
||||
</el-form-item>
|
||||
|
@ -139,7 +153,7 @@ import { listImg, getImg, delImg, addImg, updateImg } from "@/api/system/img";
|
|||
|
||||
export default {
|
||||
name: "Img",
|
||||
dicts: ['article_cat'],
|
||||
dicts: ['img_type', 'article_cat'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
|
Loading…
Reference in New Issue