首页 > 其他分享 >每周总结第七周

每周总结第七周

时间:2023-06-09 22:56:26浏览次数:32  
标签:总结 第七 success 每周 type brand message data resp

本周开始了团队作业:

本阶段任务完成页面即可:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="icon" href="lib/logo.ico" type="images/x-ico" />
    <title>智能政策信息检索系统</title>
    <style>
        .el-table .warning-row {
            background: oldlace;
        }

        .el-table .success-row {
            background: #f0f9eb;
        }


    </style>

    <style type="text/css">
        body{
            background: url("./lib/background.png") no-repeat center center fixed;
            /*兼容浏览器版本*/
            -webkit-background-size: cover;
            -o-background-size: cover;
            background-size: cover;
        }
    </style>


</head>

<!--<html>
         <head>
    <meta content="text/html" charset="UTF-8">
    <title>HTML设置图片为页面背景</title>
         </head>

         <body background="夕阳余晖.jpg"
               style="background-repeat:no-repeat
               background-attachment:fixed;
               background-size:100% 100%; ">
         </body>
</html>
-->




<body>

<div id="app">

    <!--搜索表单-->
    <el-form :inline="true" :model="brand" class="demo-form-inline">

        <el-form-item label="政策名称">
            <el-input v-model="brand.name" placeholder="政策名称"></el-input>
        </el-form-item>

        <el-form-item label="发文字号">
            <el-input v-model="brand.document" placeholder="发文字号"></el-input>
        </el-form-item>

        <el-form-item label="发文机构">
            <el-input v-model="brand.organ" placeholder="政策编号"></el-input>
        </el-form-item>

        <el-form-item>
            <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
    </el-form>

    <!--按钮-->

    <el-row>

        <el-button type="danger" plain @click="deleteByIds">批量删除</el-button>
        <el-button type="primary" plain @click="dialogVisible = true">新增</el-button>

    </el-row>
    <!--添加数据对话框表单-->
    <el-dialog
            title="编辑政策"
            :visible.sync="dialogVisible"
            width="30%"
            >

        <el-form ref="form" :model="brand" label-width="80px">
            <el-form-item label="政策名称">
                <el-input v-model="brand.name"></el-input>
            </el-form-item>

            <el-form-item label="发文机构">
                <el-input v-model="brand.organ"></el-input>
            </el-form-item>

            <el-form-item label="政策分类">
                <el-input v-model="brand.type"></el-input>
            </el-form-item>

            <el-form-item label="政策种类">
                <el-input v-model="brand.category"></el-input>
            </el-form-item>

            <el-form-item label="政策范围">
                <el-select v-model="brand.ranged" placeholder="请选择政策范围">
                    <el-option label="全国(000000 QG)" value="全国(000000 QG)"></el-option>
                    <el-option label="河北省(130000 HE)" value="河北省(130000 HE)"></el-option>
                    <el-option label="重庆市(500000 CQ)" value="重庆市(500000 CQ)"></el-option>
                    <el-option label="北京市(110000 BJ)" value="北京市(110000 BJ)"></el-option>
                    <el-option label="浙江省(330000 ZJ)" value="浙江省(330000 ZJ)"></el-option>
                    <el-option label="上海市(310000 SH)" value="上海市(310000 SH)"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="发文字报">
                <el-input v-model="brand.document"></el-input>
            </el-form-item>

            <el-form-item label="颁布形式">
                <el-input v-model="brand.formd"></el-input>
            </el-form-item>


            <el-form-item label="政策内容">
                <el-input type="textarea" v-model="brand.text"></el-input>
            </el-form-item>


            <el-form-item>
                <el-button type="primary" @click="addBrand">提交</el-button>
                <el-button @click="dialogVisible = false">取消</el-button>
            </el-form-item>
        </el-form>

    </el-dialog>

    <!--修改数据对话框表单-->
    <el-dialog
            title="修改政策"
            :visible.sync="updateDialogVisible"
            width="30%"
    >

        <el-form ref="form" :model="brand" label-width="80px">
            <el-form-item label="政策名称">
                <el-input v-model="brand.name"></el-input>
            </el-form-item>

            <el-form-item label="发文机构">
                <el-input v-model="brand.organ"></el-input>
            </el-form-item>

            <el-form-item label="政策分类">
                <el-input v-model="brand.type"></el-input>
            </el-form-item>

            <el-form-item label="政策种类">
                <el-input v-model="brand.category"></el-input>
            </el-form-item>

            <el-form-item label="政策范围">
                <el-select v-model="brand.ranged" placeholder="请选择政策范围">
                    <el-option label="全国(000000 QG)" value="全国(000000 QG)"></el-option>
                    <el-option label="河北省(130000 HE)" value="河北省(130000 HE)"></el-option>
                    <el-option label="重庆市(500000 CQ)" value="重庆市(500000 CQ)"></el-option>
                    <el-option label="北京市(110000 BJ)" value="北京市(110000 BJ)"></el-option>
                    <el-option label="浙江省(330000 ZJ)" value="浙江省(330000 ZJ)"></el-option>
                    <el-option label="上海市(310000 SH)" value="上海市(310000 SH)"></el-option>
                </el-select>
            </el-form-item>

            <el-form-item label="发文字报">
                <el-input v-model="brand.document"></el-input>
            </el-form-item>

            <el-form-item label="颁布形式">
                <el-input v-model="brand.formd"></el-input>
            </el-form-item>


            <el-form-item label="政策内容">
                <el-input type="textarea" v-model="brand.text"></el-input>
            </el-form-item>


            <el-form-item>
                <el-button type="primary" @click="update">提交</el-button>
                <el-button @click="updateDialogVisible = false">取消</el-button>
            </el-form-item>
        </el-form>

    </el-dialog>


    <!--表格-->
    <template>
        <el-table
                :data="tableData"
                style="width: 100%"
                :row-class-name="tableRowClassName"
                @selection-change="handleSelectionChange"
        >
            <el-table-column
                    type="selection"
                    width="55">
            </el-table-column>
            <el-table-column
                    type="index"
                    width="50">
            </el-table-column>

            <el-table-column
                    prop="name"
                    label="政策名称"
                    align="center"
            >
            </el-table-column>
            <el-table-column
                    prop="organ"
                    label="发文机构"
                    align="center"
            >
            </el-table-column>
            <el-table-column
                    prop="viadata"
                    align="center"
                    label="颁布日期">
            </el-table-column>
            <el-table-column
                    prop="type"
                    align="center"
                    label="政策分类">
            </el-table-column>

            <el-table-column
                    align="center"
                    label="操作">
                <template slot-scope="scope">
                <el-row>
                    <el-button type="primary"  @click="brandShow(scope.row)">修改</el-button>
                    <el-button type="danger">删除</el-button>
                </el-row>

                </template>
            </el-table-column>

        </el-table>
    </template>

    <!--分页工具条-->
    <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-sizes="[5, 10, 15, 20]"
            :page-size="10"
            layout="total, sizes, prev, pager, next, jumper"
            :total="totalCount">
    </el-pagination>

</div>


<script src="js/vue.js"></script>
<script src="element-ui/lib/index.js"></script>
<link rel="stylesheet" href="element-ui/lib/theme-chalk/index.css">
<script src="js/axios-0.18.0.js"></script>

<script>
    new Vue({
        el: "#app",

        mounted(){

            this.selectAll();

        },

        methods: {

                //查询分页数据
                selectAll(){
                    /*//当页面加载完成后,发送异步请求来获取数据\
                    var _this = this;

                    axios({
                        method:"get",
                        url:"http://localhost:8080/brand-case/selectAllServlet"
                    }).then(function (resp){
                        _this.tableData = resp.data;
                    })*/

                    var _this = this;

                    axios({
                        method:"post",
                        url:"http://localhost:8080/brand-case/selectByPageAndConditionServlet?currentPage="+this.currentPage+"&pageSize="+this.pageSize,
                        data:this.brand
                    }).then(function (resp){
                        //设置表格数据
                        _this.tableData = resp.data.rows; //{rows:[],totalCount:100}
                        //设置总记录数
                        _this.totalCount = resp.data.totalCount;
                    })
                },

            tableRowClassName({row, rowIndex}) {
                if (rowIndex === 1) {
                    return 'warning-row';
                } else if (rowIndex === 3) {
                    return 'success-row';
                }
                return '';
            },
            // 复选框选中后执行的方法
            handleSelectionChange(val) {
                this.multipleSelection = val;

                console.log(this.multipleSelection)
            },
            // 查询方法
            onSubmit() {
                //console.log(this.brand);
                this.selectAll();

            },
            // 添加数据
            addBrand(){
                //console.log(this.brand);
                var _this = this;
                //发送ajax请求,添加数据
                axios({
                    method: "post",
                    url:"http://localhost:8080/brand-case/addServlet",
                    data:_this.brand
                }).then(function (resp){
                    if(resp.data == "success"){
                        //添加成功

                        //关闭窗口
                        _this.dialogVisible = false;

                        //重新查询
                        _this.selectAll();

                        _this.$message({
                            showClose: true,
                            message: '恭喜你,添加成功',
                            type: 'success'
                        });

                    };
                })

            },

            //分页
            handleSizeChange(val) {
               // console.log(`每页 ${val} 条`);
                //设置每页显示的条数
                this.pageSize = val;
                this.selectAll();
            },
            handleCurrentChange(val) {
                //console.log(`当前页: ${val}`);
                //重新设置当前页码
               this.currentPage = val;
                this.selectAll();
            },
            //批量删除

            deleteByIds(){
                    //弹出一个确认提示框
                this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    //用户点击确认按钮

                    //1.创建一个id数组[1,2,3]
                    //console.log(this.multipleSelection);
                    for (let i = 0; i < this.multipleSelection.length; i++) {
                        let selectionElement = this.multipleSelection[i];
                        this.selectedIds[i] = selectionElement.id;

                    }

                    //2.发送AJAX请求
                    var _this = this;
                    axios({
                        method: "post",
                        url:"http://localhost:8080/brand-case/deleteByIdsServlet",
                        data:_this.selectedIds
                    }).then(function (resp){
                        if(resp.data == "success"){
                            //删除成功
                            //重新查询
                            _this.selectAll();

                            _this.$message({
                                showClose: true,
                                message: '恭喜你,删除成功',
                                type: 'success'
                            });

                        };
                    })

                }).catch(() => {
                    this.$message({
                        //用户点击取消按钮
                        type: 'info',
                        message: '已取消删除'
                    });
                });

            },
            brandShow(row) {
                // 获取数据
                this.brand = row;
                console.log(this.brand);
                // 弹出窗口
                this.updateDialogVisible = true;
            },
            update(){
                var _this = this;
                axios({
                    method:"post",
                    url:"http://localhost:8080/brand-case/updateByIdServlet",
                    data:_this.brand //这是提交的表单数据
                }).then(function (resp){
                    //这里是success数据
                    if(resp.data == "success"){
                        //添加成功
                        console.log("修改成功!");
                        //关闭窗口
                        _this.updateDialogVisible = false;
                        //重新查询数据进行显示
                        _this.selectAll();
                        _this.$message({
                            message: '恭喜你,修改成功',
                            type: 'success'
                        });
                    }
                    if(resp.data == "fail"){
                        _this.$message.error('修改失败');
                    }
                })
            },

        },
        data() {
            return {
                //每页显示的条数
                pageSize:10,
                //总记录数
                totalCount:100,
                // 当前页码
                currentPage: 1,
                // 添加数据对话框是否展示的标记
                dialogVisible: false,

                // 修改数据对话框是否展示标记
                updateDialogVisible:false,

                // 品牌模型数据
                brand: {
                    id:'',
                    name: '',
                    document: '',
                    organ: '',
                    viadata:"",
                    type:"",
                    text:"",
                    category:"",
                    ranged:"",
                    formd:"",
                },
                //被选中的id数组
                selectedIds:[],
                // 复选框选中数据集合
                multipleSelection: [],
                // 表格数据
                tableData: [{
                    name: '政策',
                    organ: '最高人民检察院',
                    viadata: '2023.4.24',
                    type: "1"
                }, {
                    name: '政策',
                    organ: '最高人民检察院',
                    viadata: '2023.4.24',
                    type: "1"
                }, {
                    name: '政策',
                    organ: '最高人民检察院',
                    viadata: '2023.4.24',
                    type: "1"
                }, {
                    name: '政策',
                    organ: '最高人民检察院',
                    viadata: '2023.4.24',
                    type: "1"
                }]
            }
        }
    })

</script>

</body>
</html>

 

同时还进行了jdbc的基础知识学习。

标签:总结,第七,success,每周,type,brand,message,data,resp
From: https://www.cnblogs.com/sxwgzx23/p/17470448.html

相关文章

  • 每周总结第五周
    本周进行了结对作业完成了web地铁查询系统整体还是使用jsp组成页面,jdbc连接数据库的方法进行编写。 文件太多,不在细写。 总之,地铁的换站功能没能完成。 ......
  • 【Sword系列】第七届全国残疾人职业技能大赛样题-网络安全-数据包分析
    前言Wireshark(前称Ethereal)是一个网络数据包分析软件。网络数据包分析软件的功能是截取网络数据包,并尽可能显示出最为详细的网络数据包数据。在过去,网络数据包分析软件是非常昂贵,或是专门属于营利用的软件,Wireshark的出现改变了这一切。在GNU通用公共许可证的保障范围底下,用户可以......
  • 每周总结第四周
    本周完成了算法作业: 课堂练习01题目:计算最长英语单词链。一、题目内容:大家经常玩成语接龙游戏,我们试一试英语的接龙吧:一个文本文件中有N个不同的英语单词,我们能否写一个程序,快速找出最长的能首尾相连的英语单词链,每个单词最多只能用一次。最长的定义是:最多单词数量,和单词......
  • 【做题笔记】做题经验总结
    1.int*int会爆int,记得开longlong2.一般情况下,对于一棵树,树根没有父亲3.一定要看输入和输出格式4.多测不清空,爆零两行泪......
  • 接口总结
    接口框架:python+pytest+requests+logging+allure1、接口的参数化(数据驱动)将测试用到的数据从用例或代码中抽离保存到excel、csv中。程序运行时,pytest会自动调用test开头的yaml用例,yaml用例有个关键字parametrize:${read_xlsx(file_path)}会被执行。1、文件的读取:通过excel(xlsx)......
  • 学起总结
    作为一门计算机科学领域的重要学科,软件工程是为了开发高质量、可靠、可维护、可重用的软件而进行的。从最基本的概念、原则和方法到高级的工具和框架,软件工程的学习需要渗透一定的理论知识,了解开发实践,并理解业内的最佳实践和当前的趋势。在这篇总结中,我将分享我学习软件工程时所......
  • 第十六周总结
    在学习软件工程的过程中,我了解到以下几个关键概念和原则:软件开发生命周期:软件开发通常遵循一个生命周期,包括需求分析、设计、编码、测试和维护等阶段。每个阶段都有特定的目标和活动,并且它们之间有明确的交付物和依赖关系。需求工程:需求工程是软件开发的起点,它涉及与利益相关者......
  • 每周总结--第一周
    在本周我接触了安卓的基础学习,并且通过自学完成了一个每日打卡app每日打卡app源码alarmActivity,javapackagecom.example.myapp01;importandroidx.appcompat.app.AppCompatActivity;importandroid.os.Bundle;publicclassalarmActivityextendsAppCompatActivity{......
  • 第十六周总结
    packagecom.example.myapplication;importandroidx.appcompat.app.AlertDialog;importandroidx.appcompat.app.AppCompatActivity;importandroid.app.Activity;importandroid.content.Intent;importandroid.os.Bundle;importandroid.view.View;importandroid......
  • 第十五周总结
    <?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"......