首页 > 其他分享 >科技政策查询(五一极限)

科技政策查询(五一极限)

时间:2024-06-17 13:55:24浏览次数:24  
标签:科技 -- value 查询 极限 文档 policy import 五一

验收通过了,因为要赶车所以当场学习能力大爆发了,成功验收,也成功赶上了车。

Control层

package com.cxk.baseframe.project.systemmanage.controller;

import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import javax.annotation.Resource;

import com.cxk.baseframe.config.common.annotation.Log;
import com.cxk.baseframe.config.common.entity.common.domain.AjaxResult;
import com.cxk.baseframe.config.common.entity.common.domain.page.TableDataInfo;
import com.cxk.baseframe.config.common.entity.systemmanage.system.Policy;
import com.cxk.baseframe.config.common.enums.BusinessType;
import com.cxk.baseframe.config.common.response.BaseController;
import com.cxk.baseframe.config.common.utils.MapUtil;
import com.cxk.baseframe.config.common.utils.poi.ExcelUtil;
import com.cxk.baseframe.project.systemmanage.service.IPolicyService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * 科技文档Controller
 *
 * @author cxk
 * @date 2024-04-30
 */
@Api(tags={"科技文档管理"})
@RestController
@RequestMapping("/system-manage-service/system/policy")
public class PolicyController extends BaseController
{
    @Resource
    private IPolicyService policyService;

    /**
     * 查询科技文档列表
     */
    @ApiOperation(value="查询科技文档列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "policy", value = "科技文档实体", dataType = "Policy", required = false),
            @ApiImplicitParam(name = "pageNum", value = "页码", dataType = "Integer", defaultValue = "1", required = false),
            @ApiImplicitParam(name = "pageSize", value = "每页大小", dataType = "Integer", defaultValue = "10", required = false)
    })
    @GetMapping("/list")
    public TableDataInfo list(Policy policy)
    {
        startPage();
        List<Policy> list = policyService.selectPolicyList(policy);
        return getDataTable(list);
    }

    /**
     * 导出科技文档列表
     */
    @ApiOperation(value="导出科技文档列表")
    @ApiImplicitParam(name = "policy", value = "科技文档实体", dataType = "Policy", required = false)
    @Log(title = "科技文档", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Policy policy)
    {
        List<Policy> list = policyService.selectPolicyList(policy);
        ExcelUtil<Policy> util = new ExcelUtil(Policy.class);
        util.exportExcel(response, list, "科技文档数据");
    }

    /**
     * 获取科技文档详细信息
     */
    @ApiOperation(value="获取科技文档详细信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "科技文档Id", dataType = "String", paramType = "query", required = true)
    })
    @GetMapping(value = "/getInfo")
    public AjaxResult getInfo(@RequestParam String id)
    {
        return success(policyService.selectPolicyById(id));
    }

    /**
     * 新增科技文档
     */
    @ApiOperation(value="新增科技文档")
    @ApiImplicitParam(name = "policy", value = "科技文档实体", dataType = "Policy", required = true)
    @Log(title = "科技文档", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public AjaxResult add(@RequestBody Policy policy)
    {
        return toAjax(policyService.insertPolicy(policy));
    }

    /**
     * 修改科技文档
     */
    @ApiOperation(value="修改科技文档")
    @ApiImplicitParam(name = "policy", value = "科技文档实体", dataType = "Policy", required = true)
    @Log(title = "科技文档", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody Policy policy)
    {
        return toAjax(policyService.updatePolicy(policy));
    }

    /**
     * 删除科技文档
     */
    @ApiOperation(value="删除科技文档")
    @ApiImplicitParam(name = "ids", value = "科技文档数组", dataType = "String[]", required = true)
    @Log(title = "科技文档", businessType = BusinessType.DELETE)
    @PostMapping("/remove")
    public AjaxResult remove(@RequestParam String[] ids)
    {
        return toAjax(policyService.deletePolicyByIds(ids));
    }

 

<template>

  <div class="app-container">

<!--    <div><img v-bind:src="logo" alt="Vue Logo" class="custom-image"></div>-->

    <div class="center-container">

      <div class="image-container">

        <img v-bind:src="logo" alt="Vue Logo" class="custom-image">

      </div>

    </div>

<!--    <style>-->

<!--      .center-container {-->

<!--        display: flex;-->

<!--        justify-content: center; /* 水平居中 */-->

<!--        align-items: center; /* 垂直居中 */-->

<!--        height: 100vh; /* 让容器占满整个视口高度 */-->

<!--      }-->

<!--      </style>-->

 

    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">

      <el-form-item label="政策名称   " prop="name">

        <el-input

          v-model="queryParams.name"

          placeholder="请输入政策名称   "

          clearable

          @keyup.enter.native="handleQuery"

        />

      </el-form-item>

<!--      <el-form-item label="政策分类" prop="type">-->

<!--        <el-input-->

<!--          v-model="queryParams.type"-->

<!--          placeholder="请输入政策分类"-->

<!--          clearable-->

<!--          @keyup.enter.native="handleQuery"-->

<!--        />-->

<!--      </el-form-item>-->

      <el-form-item label="发文字号" prop="document">

        <el-input

          v-model="queryParams.document"

          placeholder="请输入发文字号"

          clearable

          @keyup.enter.native="handleQuery"

        />

      </el-form-item>

      <el-form-item label="制定机关" prop="organ">

        <el-input

          v-model="queryParams.organ"

          placeholder="请输入制定机关"

          clearable

          @keyup.enter.native="handleQuery"

        />

      </el-form-item>

<!--      <el-form-item label="发布日期" prop="pubdata">-->

<!--        <el-date-picker clearable-->

<!--          v-model="queryParams.pubdata"-->

<!--          type="date"-->

<!--          value-format="yyyy-MM-dd"-->

<!--          placeholder="请选择发布日期">-->

<!--        </el-date-picker>-->

<!--      </el-form-item>-->

      <el-form-item label="全文检索" prop="text">

        <el-input

          v-model="queryParams.text"

          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="['system:policy: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:policy: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:policy: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:policy:export']"-->

<!--        >导出</el-button>-->

<!--      </el-col>-->

      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>

    </el-row>

 

    <el-table v-loading="loading" :data="policyList" @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="name" />

    <el-table-column label="政策分类" align="center" prop="type" />

      <el-table-column label="发文字号" align="center" prop="document" />

      <el-table-column label="制定机关" align="center" prop="organ" />

      <el-table-column label="发布日期" align="center" prop="pubdata" width="180">

        <template slot-scope="scope">

          <span>{{ parseTime(scope.row.pubdata, '{y}-{m}-{d}') }}</span>

        </template>

      </el-table-column>

<!--      <el-table-column label="全文检索" align="center" prop="text" />-->

      <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:policy:edit']"

          >查看</el-button>

<!--          <el-button-->

<!--            size="mini"-->

<!--            type="text"-->

<!--            icon="el-icon-delete"-->

<!--            @click="handleDelete(scope.row)"-->

<!--            v-hasPermi="['system:policy:remove']"-->

<!--          >删除</el-button>-->

        </template>

        <template slot-scope="scope">

          <router-link :to="{ name: 'PolicyView', params: { id: scope.row.id }}">查看</router-link>

        </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="name">

          <el-input v-model="form.name" placeholder="请输入政策名称   " />

        </el-form-item>

        <el-form-item label="政策分类" prop="type">

          <el-input v-model="form.type" placeholder="请输入政策分类" />

        </el-form-item>

        <el-form-item label="发文字号" prop="document">

          <el-input v-model="form.document" placeholder="请输入发文字号" />

        </el-form-item>

        <el-form-item label="制定机关" prop="organ">

          <el-input v-model="form.organ" placeholder="请输入制定机关" />

        </el-form-item>

        <el-form-item label="发布日期" prop="pubdata">

          <el-date-picker clearable

            v-model="form.pubdata"

            type="date"

            value-format="yyyy-MM-dd"

            placeholder="请选择发布日期">

          </el-date-picker>

        </el-form-item>

        <el-form-item label="全文检索">

          <editor v-model="form.text" :min-height="192"/>

        </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 logo from '@/assets/logo/logo.png'

 

import { listPolicy, getPolicy, delPolicy, addPolicy, updatePolicy } from "@/api/system/policy";

 

export default {

  name: "Policy",

  data() {

    return {

      logo,

      // 遮罩层

      loading: true,

      // 选中数组

      ids: [],

      // 非单个禁用

      single: true,

      // 非多个禁用

      multiple: true,

      // 显示搜索条件

      showSearch: true,

      // 总条数

      total: 0,

      // 科技文档表格数据

      policyList: [],

      // 弹出层标题

      title: "",

      // 是否显示弹出层

      open: false,

      // 查询参数

      queryParams: {

        pageNum: 1,

        pageSize: 10,

        name: null,

        type: null,

        document: null,

        organ: null,

        pubdata: null,

        text: null

      },

      // 表单参数

      form: {},

      // 表单校验

      rules: {

      }

    };

  },

  created() {

    this.getList();

  },

  methods: {

    /** 查询科技文档列表 */

    getList() {

      this.loading = true;

      listPolicy(this.queryParams).then(response => {

        this.policyList = response.rows;

        this.total = response.total;

        this.loading = false;

      });

    },

    // 取消按钮

    cancel() {

      this.open = false;

      this.reset();

    },

    // 表单重置

    reset() {

      this.form = {

        id: null,

        name: null,

        type: null,

        document: null,

        organ: null,

        pubdata: null,

        text: 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

      getPolicy(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) {

            updatePolicy(this.form).then(response => {

              this.$modal.msgSuccess("修改成功");

              this.open = false;

              this.getList();

            });

          } else {

            addPolicy(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 delPolicy(ids);

      }).then(() => {

        this.getList();

        this.$modal.msgSuccess("删除成功");

      }).catch(() => {});

    },

    /** 导出按钮操作 */

    handleExport() {

      this.download('/system-manage-service/system/policy/export', {

        ...this.queryParams

      }, `policy_${new Date().getTime()}.xlsx`)

    }

  }

};

</script>

标签:科技,--,value,查询,极限,文档,policy,import,五一
From: https://www.cnblogs.com/po3a/p/18252216

相关文章

  • MYSQL查询语句报1 of ORDER BY clause is not in SELECT list
    我的语句如下:SELECTDISTINCT r.id, r.device_model_id, r.device_model_name, r.alarm_type_id, r.alarm_type_name, r.alarm_level, r.filter_condition, r.filter_condition_value, r.offline_tag, p.param_data_id, p.parmsFROM alarm_ruler, alarm_rule_pa......
  • Mybatis-Plus-Join(MPJ连表查询)
    mybatis-plus作为mybatis的增强工具,它的出现极大的简化了开发中的数据库操作,但是长久以来,它的联表查询能力一直被大家所诟病。一旦遇到leftjoin或rightjoin的左右连接,你还是得老老实实的打开xml文件,手写上一大段的sql语句一款叫做mybatis-plus-join的工具(后面就简称mpj了),可以不......
  • 聚焦 Navicat 17 新特性 | 查询与配置的革新之处
    随着Navicat17的发布,引起业界热烈讨论与关注,这也标志着Navicat的产品力再次飞跃。新版本引入的众多创新特性极大地提升了用户在数据库管理和数据分析方面的体验,涵盖模型设计与同步、数据字典、数据分析(dataprofiling)、优化的用户界面与交互、跨平台兼容性、智能查询优化......
  • Dynamics CRM 365 使用FetchXml 查询数据(Query data using FetchXml )
    前言FetchXml是一种基于XML的专有查询语言,用于从Dataverse检索数据。添加引用Microsoft.CrmSdk.CoreAssembliesSystem.Configuration检索数据(Retrievedata)RetrieveMultipleusingMicrosoft.Xrm.Sdk.Query;usingMicrosoft.Xrm.Sdk;usingMicrosoft.Xrm.Tooling.C......
  • 探秘大数据信用报告:最佳查询方式
    大数据信用报告查询方式一般有几种?哪种比较好?在了解这个问题之前,想必你对大数据信用与人行信用的区别都是比较清楚了,本文呢就着重讲一下大数据信用报告查询方式有几种,哪种比较好,感兴趣的朋友不妨一起去看看。大数据信用报告常见的三种查询方式:一、二维码分享......
  • 7、Oracle中的子查询
    最近项目要用到Oracle,奈何之前没有使用过,所以在B站上面找了一个学习视频,用于记录学习过程以及自己的思考。视频链接:【尚硅谷】Oracle数据库全套教程,oracle从安装到实战应用如果有侵权,请联系删除,谢谢。学习目标:描述子查询可以解决的问题。定义子查询。列出子查询的类型。......
  • 政策查询系统(安卓)6
    编写安卓的界面<?xmlversion="1.0"encoding="utf-8"?><androidx.constraintlayout.widget.ConstraintLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-au......
  • 政策查询系统(安卓)7
    配置plugins{id("com.android.application")}android{namespace="com.example.policyquery"compileSdk=34defaultConfig{applicationId="com.example.policyquery"minSdk=28targetSdk=34......
  • 五一冲刺(政策查询系统)1
    今日课上的政策查询系统极限测试寥寥草草将功能实现了,把内部代码进行完善一下完整代码:index.jsp<%@pagecontentType="text/html;charset=UTF-8"language="java"%><!DOCTYPEhtml><htmllang="en"xmlns:th="http://www.thymeleaf.org"><......
  • 五一冲刺(政策查询系统)2
    packageDao;importBean.Menu;importBean.bean;importBean.policy;importDBUtil.dbutil;importorg.apache.ibatis.io.Resources;importorg.apache.ibatis.session.SqlSession;importorg.apache.ibatis.session.SqlSessionFactory;importorg.apache.ibatis.ses......