parent
db5160de63
commit
c0a589e111
@ -0,0 +1,104 @@
|
||||
package com.ruoyi.bid.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.bid.domain.BidSite;
|
||||
import com.ruoyi.bid.service.IBidSiteService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 常用网站Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/bid/site")
|
||||
public class BidSiteController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBidSiteService bidSiteService;
|
||||
|
||||
/**
|
||||
* 查询常用网站列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bid:site:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BidSite bidSite)
|
||||
{
|
||||
startPage();
|
||||
List<BidSite> list = bidSiteService.selectBidSiteList(bidSite);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出常用网站列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bid:site:export')")
|
||||
@Log(title = "常用网站", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BidSite bidSite)
|
||||
{
|
||||
List<BidSite> list = bidSiteService.selectBidSiteList(bidSite);
|
||||
ExcelUtil<BidSite> util = new ExcelUtil<BidSite>(BidSite.class);
|
||||
util.exportExcel(response, list, "常用网站数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取常用网站详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bid:site:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(bidSiteService.selectBidSiteById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增常用网站
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bid:site:add')")
|
||||
@Log(title = "常用网站", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BidSite bidSite)
|
||||
{
|
||||
return toAjax(bidSiteService.insertBidSite(bidSite));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改常用网站
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bid:site:edit')")
|
||||
@Log(title = "常用网站", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody BidSite bidSite)
|
||||
{
|
||||
return toAjax(bidSiteService.updateBidSite(bidSite));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除常用网站
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('bid:site:remove')")
|
||||
@Log(title = "常用网站", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(bidSiteService.deleteBidSiteByIds(ids));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package com.ruoyi.bid.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 常用网站对象 bid_site
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public class BidSite extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 网站名称 */
|
||||
@Excel(name = "网站名称")
|
||||
private String siteName;
|
||||
|
||||
/** url */
|
||||
@Excel(name = "url")
|
||||
private String site;
|
||||
|
||||
/** 收藏(0否1是) */
|
||||
@Excel(name = "收藏(0否1是)")
|
||||
private String favorite;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSiteName(String siteName)
|
||||
{
|
||||
this.siteName = siteName;
|
||||
}
|
||||
|
||||
public String getSiteName()
|
||||
{
|
||||
return siteName;
|
||||
}
|
||||
|
||||
public void setSite(String site)
|
||||
{
|
||||
this.site = site;
|
||||
}
|
||||
|
||||
public String getSite()
|
||||
{
|
||||
return site;
|
||||
}
|
||||
|
||||
public void setFavorite(String favorite)
|
||||
{
|
||||
this.favorite = favorite;
|
||||
}
|
||||
|
||||
public String getFavorite()
|
||||
{
|
||||
return favorite;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("siteName", getSiteName())
|
||||
.append("site", getSite())
|
||||
.append("favorite", getFavorite())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bid.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bid.domain.BidSite;
|
||||
|
||||
/**
|
||||
* 常用网站Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface BidSiteMapper
|
||||
{
|
||||
/**
|
||||
* 查询常用网站
|
||||
*
|
||||
* @param id 常用网站主键
|
||||
* @return 常用网站
|
||||
*/
|
||||
public BidSite selectBidSiteById(Long id);
|
||||
|
||||
/**
|
||||
* 查询常用网站列表
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 常用网站集合
|
||||
*/
|
||||
public List<BidSite> selectBidSiteList(BidSite bidSite);
|
||||
|
||||
/**
|
||||
* 新增常用网站
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBidSite(BidSite bidSite);
|
||||
|
||||
/**
|
||||
* 修改常用网站
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBidSite(BidSite bidSite);
|
||||
|
||||
/**
|
||||
* 删除常用网站
|
||||
*
|
||||
* @param id 常用网站主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBidSiteById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除常用网站
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBidSiteByIds(Long[] ids);
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package com.ruoyi.bid.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.bid.domain.BidSite;
|
||||
|
||||
/**
|
||||
* 常用网站Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
public interface IBidSiteService
|
||||
{
|
||||
/**
|
||||
* 查询常用网站
|
||||
*
|
||||
* @param id 常用网站主键
|
||||
* @return 常用网站
|
||||
*/
|
||||
public BidSite selectBidSiteById(Long id);
|
||||
|
||||
/**
|
||||
* 查询常用网站列表
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 常用网站集合
|
||||
*/
|
||||
public List<BidSite> selectBidSiteList(BidSite bidSite);
|
||||
|
||||
/**
|
||||
* 新增常用网站
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBidSite(BidSite bidSite);
|
||||
|
||||
/**
|
||||
* 修改常用网站
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBidSite(BidSite bidSite);
|
||||
|
||||
/**
|
||||
* 批量删除常用网站
|
||||
*
|
||||
* @param ids 需要删除的常用网站主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBidSiteByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除常用网站信息
|
||||
*
|
||||
* @param id 常用网站主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBidSiteById(Long id);
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.ruoyi.bid.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.bid.mapper.BidSiteMapper;
|
||||
import com.ruoyi.bid.domain.BidSite;
|
||||
import com.ruoyi.bid.service.IBidSiteService;
|
||||
|
||||
/**
|
||||
* 常用网站Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-12-09
|
||||
*/
|
||||
@Service
|
||||
public class BidSiteServiceImpl implements IBidSiteService
|
||||
{
|
||||
@Autowired
|
||||
private BidSiteMapper bidSiteMapper;
|
||||
|
||||
/**
|
||||
* 查询常用网站
|
||||
*
|
||||
* @param id 常用网站主键
|
||||
* @return 常用网站
|
||||
*/
|
||||
@Override
|
||||
public BidSite selectBidSiteById(Long id)
|
||||
{
|
||||
return bidSiteMapper.selectBidSiteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询常用网站列表
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 常用网站
|
||||
*/
|
||||
@Override
|
||||
public List<BidSite> selectBidSiteList(BidSite bidSite)
|
||||
{
|
||||
return bidSiteMapper.selectBidSiteList(bidSite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增常用网站
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBidSite(BidSite bidSite)
|
||||
{
|
||||
return bidSiteMapper.insertBidSite(bidSite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改常用网站
|
||||
*
|
||||
* @param bidSite 常用网站
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBidSite(BidSite bidSite)
|
||||
{
|
||||
return bidSiteMapper.updateBidSite(bidSite);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除常用网站
|
||||
*
|
||||
* @param ids 需要删除的常用网站主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBidSiteByIds(Long[] ids)
|
||||
{
|
||||
return bidSiteMapper.deleteBidSiteByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除常用网站信息
|
||||
*
|
||||
* @param id 常用网站主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBidSiteById(Long id)
|
||||
{
|
||||
return bidSiteMapper.deleteBidSiteById(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.bid.mapper.BidSiteMapper">
|
||||
|
||||
<resultMap type="BidSite" id="BidSiteResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteName" column="site_name" />
|
||||
<result property="site" column="site" />
|
||||
<result property="favorite" column="favorite" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBidSiteVo">
|
||||
select id, site_name, site, favorite, remark from bid_site
|
||||
</sql>
|
||||
|
||||
<select id="selectBidSiteList" parameterType="BidSite" resultMap="BidSiteResult">
|
||||
<include refid="selectBidSiteVo"/>
|
||||
<where>
|
||||
<if test="siteName != null and siteName != ''"> and site_name like concat('%', #{siteName}, '%')</if>
|
||||
<if test="site != null and site != ''"> and site = #{site}</if>
|
||||
<if test="favorite != null and favorite != ''"> and favorite = #{favorite}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBidSiteById" parameterType="Long" resultMap="BidSiteResult">
|
||||
<include refid="selectBidSiteVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBidSite" parameterType="BidSite" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into bid_site
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="siteName != null">site_name,</if>
|
||||
<if test="site != null">site,</if>
|
||||
<if test="favorite != null">favorite,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="siteName != null">#{siteName},</if>
|
||||
<if test="site != null">#{site},</if>
|
||||
<if test="favorite != null">#{favorite},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBidSite" parameterType="BidSite">
|
||||
update bid_site
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="siteName != null">site_name = #{siteName},</if>
|
||||
<if test="site != null">site = #{site},</if>
|
||||
<if test="favorite != null">favorite = #{favorite},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBidSiteById" parameterType="Long">
|
||||
delete from bid_site where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBidSiteByIds" parameterType="String">
|
||||
delete from bid_site where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询常用网站列表
|
||||
export function listSite(query) {
|
||||
return request({
|
||||
url: '/bid/site/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询常用网站详细
|
||||
export function getSite(id) {
|
||||
return request({
|
||||
url: '/bid/site/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增常用网站
|
||||
export function addSite(data) {
|
||||
return request({
|
||||
url: '/bid/site',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改常用网站
|
||||
export function updateSite(data) {
|
||||
return request({
|
||||
url: '/bid/site',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除常用网站
|
||||
export function delSite(id) {
|
||||
return request({
|
||||
url: '/bid/site/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,278 @@
|
||||
<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="siteName">
|
||||
<el-input
|
||||
v-model="queryParams.siteName"
|
||||
placeholder="请输入网站名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="url" prop="site">
|
||||
<el-input
|
||||
v-model="queryParams.site"
|
||||
placeholder="请输入url"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收藏(0否1是)" prop="favorite">
|
||||
<el-input
|
||||
v-model="queryParams.favorite"
|
||||
placeholder="请输入收藏(0否1是)"
|
||||
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-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="['bid:site: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="['bid:site: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="['bid:site: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="['bid:site:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="siteList" @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="siteName" />
|
||||
<el-table-column label="url" align="center" prop="site" />
|
||||
<el-table-column label="收藏(0否1是)" align="center" prop="favorite" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="['bid:site:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bid:site: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"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改常用网站对话框 -->
|
||||
<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="siteName">
|
||||
<el-input v-model="form.siteName" placeholder="请输入网站名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="url" prop="site">
|
||||
<el-input v-model="form.site" placeholder="请输入url" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收藏(0否1是)" prop="favorite">
|
||||
<el-input v-model="form.favorite" placeholder="请输入收藏(0否1是)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" 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 { listSite, getSite, delSite, addSite, updateSite } from "@/api/bid/site"
|
||||
|
||||
export default {
|
||||
name: "Site",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 常用网站表格数据
|
||||
siteList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
siteName: null,
|
||||
site: null,
|
||||
favorite: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询常用网站列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listSite(this.queryParams).then(response => {
|
||||
this.siteList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
siteName: null,
|
||||
site: null,
|
||||
favorite: null,
|
||||
remark: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加常用网站"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getSite(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改常用网站"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateSite(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addSite(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除常用网站编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delSite(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bid/site/export', {
|
||||
...this.queryParams
|
||||
}, `site_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,336 @@
|
||||
<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="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
placeholder="请输入标题"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="链接" prop="link">
|
||||
<el-input
|
||||
v-model="queryParams.link"
|
||||
placeholder="请输入链接"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发布日期" prop="fbDate">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.fbDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择发布日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源站点" prop="sourceSite">
|
||||
<el-input
|
||||
v-model="queryParams.sourceSite"
|
||||
placeholder="请输入来源站点"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="省份" prop="province">
|
||||
<el-input
|
||||
v-model="queryParams.province"
|
||||
placeholder="请输入省份"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="预估金额,正则提取" prop="estimatedAmount">
|
||||
<el-input
|
||||
v-model="queryParams.estimatedAmount"
|
||||
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-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="['bid: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="['bid: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="['bid: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="['bid:info:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<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="title" />
|
||||
<el-table-column label="链接" align="center" prop="link" />
|
||||
<el-table-column label="发布日期" align="center" prop="fbDate" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.fbDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="来源站点" align="center" prop="sourceSite" />
|
||||
<el-table-column label="省份" align="center" prop="province" />
|
||||
<el-table-column label="客户类型:教育/医疗/政府" align="center" prop="customerType" />
|
||||
<el-table-column label="预估金额,正则提取" align="center" prop="estimatedAmount" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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="['bid:info:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['bid:info: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"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改招标信息对话框 -->
|
||||
<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="title">
|
||||
<el-input v-model="form.title" placeholder="请输入标题" />
|
||||
</el-form-item>
|
||||
<el-form-item label="链接" prop="link">
|
||||
<el-input v-model="form.link" placeholder="请输入链接" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发布日期" prop="fbDate">
|
||||
<el-date-picker clearable
|
||||
v-model="form.fbDate"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择发布日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="来源站点" prop="sourceSite">
|
||||
<el-input v-model="form.sourceSite" placeholder="请输入来源站点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="省份" prop="province">
|
||||
<el-input v-model="form.province" placeholder="请输入省份" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预估金额,正则提取" prop="estimatedAmount">
|
||||
<el-input v-model="form.estimatedAmount" placeholder="请输入预估金额,正则提取" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" 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/bid/info"
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 招标信息表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
title: null,
|
||||
link: null,
|
||||
fbDate: null,
|
||||
sourceSite: null,
|
||||
province: null,
|
||||
customerType: null,
|
||||
estimatedAmount: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询招标信息列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
listInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
title: null,
|
||||
link: null,
|
||||
fbDate: null,
|
||||
sourceSite: null,
|
||||
province: null,
|
||||
customerType: null,
|
||||
estimatedAmount: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
}
|
||||
this.resetForm("form")
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm")
|
||||
this.handleQuery()
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = "添加招标信息"
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = "修改招标信息"
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功")
|
||||
this.open = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids
|
||||
this.$modal.confirm('是否确认删除招标信息编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delInfo(ids)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess("删除成功")
|
||||
}).catch(() => {})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('bid/info/export', {
|
||||
...this.queryParams
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Loading…
Reference in new issue