【Vue.js】使用ElementUI实现增删改查(CRUD)及表单验证

news2024/11/20 1:43:54

前言:

本文根据上篇实现数据表格(查所有)完善增删改功能,数据表格===》查看数据表格的实现链接

一,增删改查

①后端Controller(增删改查方法):

package com.zking.ssm.controller;

import com.zking.ssm.model.Book;
import com.zking.ssm.service.IBookService;
import com.zking.ssm.util.JsonResponseBody;
import com.zking.ssm.util.PageBean;
import com.zking.ssm.vo.BookFileVo;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/book")
public class BookController {

    @Autowired
    private IBookService bookService;

    @RequestMapping("/addBook")
    @ResponseBody
    public JsonResponseBody<?> addBook(Book book){
        try {
            bookService.insert(book);
            return new JsonResponseBody<>("新增书本成功",true,0,null);
        } catch (Exception e) {
            e.printStackTrace();
            return new JsonResponseBody<>("新增书本失败",false,0,null);
        }
    }

    @RequestMapping("/editBook")
    @ResponseBody
    public JsonResponseBody<?> editBook(Book book){
        try {
            bookService.updateByPrimaryKey(book);
            return new JsonResponseBody<>("编辑书本成功",true,0,null);
        } catch (Exception e) {
            e.printStackTrace();
            return new JsonResponseBody<>("编辑书本失败",false,0,null);
        }
    }

    @RequestMapping("/delBook")
    @ResponseBody
    public JsonResponseBody<?> delBook(Book book){
        try {
            bookService.deleteByPrimaryKey(book.getId());
            return new JsonResponseBody<>("删除书本成功",true,0,null);
        } catch (Exception e) {
            e.printStackTrace();
            return new JsonResponseBody<>("删除书本失败",false,0,null);
        }
    }

    @RequestMapping("/queryBookPager")
    @ResponseBody
    public JsonResponseBody<List<Book>> queryBookPager(Book book, HttpServletRequest req){
        try {
            PageBean pageBean=new PageBean();
            pageBean.setRequest(req);
            List<Book> books = bookService.queryBookPager(book, pageBean);
            return new JsonResponseBody<>("OK",true,pageBean.getTotal(),books);
        } catch (Exception e) {
            e.printStackTrace();
            return new JsonResponseBody<>("分页查询书本失败",false,0,null);
        }
    }

    @RequestMapping("/queryBookCharts")
    @ResponseBody
    public JsonResponseBody<?> queryBookCharts(){
        try{
            Map<String, Object> charts = bookService.queryBookCharts();
            return new JsonResponseBody<>("OK",true,0,charts);
        }catch (Exception e){
            e.printStackTrace();
            return new JsonResponseBody<>("查询统计分析数据失败",false,0,null);
        }
    }

    @RequestMapping("/upload")
    @ResponseBody
    public JsonResponseBody<?> upload(BookFileVo bookFileVo){
        try {
            MultipartFile bookFile = bookFileVo.getBookFile();
            System.out.println(bookFileVo);
            System.out.println(bookFile.getContentType());
            System.out.println(bookFile.getOriginalFilename());
            return new JsonResponseBody<>("上传成功",true,0,null);
        } catch (Exception e) {
            e.printStackTrace();
            return new JsonResponseBody<>("上传失败",false,0,null);
        }
    }

    @RequestMapping("/download")
    public void download(HttpServletRequest request, HttpServletResponse response){
        try {
            String relativePath = "uploads/1.jpg";
            String absolutePath = request.getRealPath(relativePath);
            InputStream is = new FileInputStream(new File(absolutePath));
            OutputStream out = response.getOutputStream();
            response.setContentType("application/octet-stream");
            response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("1.jpg", "UTF-8"));
            byte[] by = new byte[1024];
            int len = -1;
            while (-1 != (len = is.read(by))) {
                out.write(by);
            }
            is.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @RequestMapping("/downloadUrl")
    public void downloadUrl(HttpServletRequest request, HttpServletResponse response){
        String relativePath = "uploads/1.jpg";
        String absolutePath = request.getRealPath(relativePath);
        InputStream is = null;
        OutputStream out = null;

        try {
            is = new FileInputStream(new File(absolutePath));
            // 设置Content-Disposition
            response.setHeader("Content-Disposition",
                    "attachment;filename=" + URLEncoder.encode("1.jpg", "UTF-8"));
            out = response.getOutputStream();
            IOUtils.copy(is, out);
            response.flushBuffer();
            System.out.println("完成");
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            IOUtils.closeQuietly(is);
            IOUtils.closeQuietly(out);
        }
    }
}













②配置action.js

	'Book_LIST': '/book/queryBookPager', //书籍列表 
	'Book_ADD': '/book/addBook', //增加 
	'Book_UPD': '/book/editBook', //修改 
	'Book_DEL': '/book/delBook', // 删除

③定义弹窗

	<!--对话框-->
		<el-dialog title="title" :visible.sync="dialogFormVisible" @close="clear()">
			<el-form :model="book" :rules="rules" ref="book">
				<el-form-item label="书籍编号" :label-width="formLabelWidth">
					<el-input v-model="book.id" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="书籍名称" :label-width="formLabelWidth" prop="bookname">
					<el-input v-model="book.bookname" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="书籍价格" :label-width="formLabelWidth" prop="price">
					<el-input v-model="book.price" autocomplete="off"></el-input>
				</el-form-item>

				<el-form-item label="书籍类别" :label-width="formLabelWidth" prop="booktype">
					<el-select v-model="book.booktype" placeholder="请选择活动区域">
						<el-option v-for="t in types" :label="t.name" :value="t.name" :key="'key'+t.id"></el-option>
					</el-select>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="dosub">确 定</el-button>
			</div>
		</el-dialog>

④ 定义变量

	data() {
			return {
				bookname: '',
				tableData: [],
				rows: 10,
				page: 1,
				total: 0,
				title: '新增窗体',
				dialogFormVisible: false,
				formLabelWidth: '100px',
				types: [],
				book: {
					id: '',
					bookname: '',
					price: '',
					booktype: ''
				},
}
}

⑤ 定义方法

		methods: {
			del(idx, row) {
				this.$confirm('此操作将永久删除id为' + row.id + '的数据,是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let url = this.axios.urls.Book_DEL;
					this.axios.post(url, {
						id: row.id
					}).then(r => {
						this.clear();
						this.query({})
						this.$message({
							type: 'success',
							message: '删除成功!'
						});
						this.query({});
					}).catch(e => {

					})

				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},
			dosub() {
				this.$refs['book'].validate((valid) => {
					if (valid) {

						let url = this.axios.urls.Book_ADD;
						if (this.title == '编辑窗体') {
							url = this.axios.urls.Book_UPD;
						}
						let params = {
							id: this.book.id,
							bookname: this.book.bookname,
							price: this.book.price,
							booktype: this.book.booktype
						};
						console.log(params);
						this.axios.post(url, params).then(r => {
							this.clear();
							this.query({})
						}).catch(e => {

						})

					} else {
						console.log('error submit!!');
						return false;
					}
				});


			},
			//初始化对话框,重置对话框
			clear() {
				this.dialogFormVisible = false;
				this.title = '新增窗体';
				this.book = {
					id: '',
					bookname: '',
					price: '',
					booktype: ''
				}
			},
			open(idx, row) {
				//打开对话框
				this.dialogFormVisible = true;
				if (row) {
					this.title = '编辑窗体';
					this.book.id = row.id;
					this.book.bookname = row.bookname;
					this.book.price = row.price;
					this.book.booktype = row.booktype;
				}
			},
			query(params) {
				let url = this.axios.urls.Book_LIST;
				this.axios.get(url, {
					params: params
				}).then(r => {
					console.log(r);
					this.tableData = r.data.rows;
					this.total = r.data.total;
				}).catch(e => {})
			},
			onSubmit() {
				let params = {
					bookname: this.bookname
				}
				this.query(params);
			},

			//当页大小发生变化
			handleSizeChange(r) {
				let params = {
					bookname: this.bookname,
					rows: r,
					page: this.page
				}
				this.query(params)
			},
			//当前页码发生变化
			handleCurrentChange(p) {
				let params = {
					bookname: this.bookname,
					rows: this.rows,
					page: p
				}
				this.query(params);
			}
		},
		created() {
			this.query({});
			this.types = [{
				id: 1,
				name: '恐怖'
			}, {
				id: 2,
				name: '惊悚'
			}, {
				id: 3,
				name: '动画片'
			}, {
				id: 4,
				name: '爱情'
			}];
		}

⑥ 完整代码

<template>
	<div>
		<!-- 上搜索框 -->
		<div class="books">
			<el-form :inline="true" class="demo-form-inline" style="margin-top: 40px; margin-left: 20px;">
				<el-form-item label="书本名称">
					<el-input v-model="bookname" placeholder="请输入书本名称..."></el-input>
				</el-form-item>

				<el-form-item>
					<el-button type="primary" @click="onSubmit">查询</el-button>
					<el-button type="primary" @click="open()">新增</el-button>
				</el-form-item>
			</el-form>
		</div>

		<!-- 中 数据表格 -->
		<el-table :data="tableData" style="width: 100%">
			<el-table-column prop="id" label="书本编号" width="180"></el-table-column>
			<el-table-column prop="bookname" label="书本名称" width="180"></el-table-column>
			<el-table-column prop="price" label="书本价格"></el-table-column>
			<el-table-column prop="booktype" label="书本类型"></el-table-column>
			<el-table-column label="操作">
				<template slot-scope="scope">
					<el-button size="mini" @click="open(scope.$index, scope.row)">编辑</el-button>
					<el-button size="mini" type="danger" @click="del(scope.$index, scope.row)">删除</el-button>
				</template>
			</el-table-column>
		</el-table>


		<!-- 下 分页条 -->
		<div class="block">
			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"
				:page-sizes="[10, 20, 30, 40]" :page-size="rows" layout="total, sizes, prev, pager, next, jumper"
				:total="total">
			</el-pagination>
		</div>


		<!--对话框-->
		<el-dialog title="title" :visible.sync="dialogFormVisible" @close="clear()">
			<el-form :model="book" >
				<el-form-item label="书籍编号" :label-width="formLabelWidth">
					<el-input v-model="book.id" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="书籍名称" :label-width="formLabelWidth" prop="bookname">
					<el-input v-model="book.bookname" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="书籍价格" :label-width="formLabelWidth" prop="price">
					<el-input v-model="book.price" autocomplete="off"></el-input>
				</el-form-item>

				<el-form-item label="书籍类别" :label-width="formLabelWidth" prop="booktype">
					<el-select v-model="book.booktype" placeholder="请选择活动区域">
						<el-option v-for="t in types" :label="t.name" :value="t.name" :key="'key'+t.id"></el-option>
					</el-select>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="dosub">确 定</el-button>
			</div>
		</el-dialog>

	</div>
</template>


<script>
	export default {
		data() {
			return {
				bookname: '',
				tableData: [],
				rows: 10,
				page: 1,
				total: 0,
				title: '新增窗体',
				dialogFormVisible: false,
				formLabelWidth: '100px',
				types: [],
				book: {
					id: '',
					bookname: '',
					price: '',
					booktype: ''
				},

			
			}
		},
		methods: {
			del(idx, row) {
				this.$confirm('此操作将永久删除id为' + row.id + '的数据,是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let url = this.axios.urls.Book_DEL;
					this.axios.post(url, {
						id: row.id
					}).then(r => {
						this.clear();
						this.query({})
						this.$message({
							type: 'success',
							message: '删除成功!'
						});
						this.query({});
					}).catch(e => {

					})

				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},
			dosub() {
				this.$refs['book'].validate((valid) => {
					if (valid) {

						let url = this.axios.urls.Book_ADD;
						if (this.title == '编辑窗体') {
							url = this.axios.urls.Book_UPD;
						}
						let params = {
							id: this.book.id,
							bookname: this.book.bookname,
							price: this.book.price,
							booktype: this.book.booktype
						};
						console.log(params);
						this.axios.post(url, params).then(r => {
							this.clear();
							this.query({})
						}).catch(e => {

						})

					} else {
						console.log('error submit!!');
						return false;
					}
				});


			},
			//初始化对话框,重置对话框
			clear() {
				this.dialogFormVisible = false;
				this.title = '新增窗体';
				this.book = {
					id: '',
					bookname: '',
					price: '',
					booktype: ''
				}
			},
			open(idx, row) {
				//打开对话框
				this.dialogFormVisible = true;
				if (row) {
					this.title = '编辑窗体';
					this.book.id = row.id;
					this.book.bookname = row.bookname;
					this.book.price = row.price;
					this.book.booktype = row.booktype;
				}
			},
			query(params) {
				let url = this.axios.urls.Book_LIST;
				this.axios.get(url, {
					params: params
				}).then(r => {
					console.log(r);
					this.tableData = r.data.rows;
					this.total = r.data.total;
				}).catch(e => {})
			},
			onSubmit() {
				let params = {
					bookname: this.bookname
				}
				this.query(params);
			},

			//当页大小发生变化
			handleSizeChange(r) {
				let params = {
					bookname: this.bookname,
					rows: r,
					page: this.page
				}
				this.query(params)
			},
			//当前页码发生变化
			handleCurrentChange(p) {
				let params = {
					bookname: this.bookname,
					rows: this.rows,
					page: p
				}
				this.query(params);
			}
		},
		created() {
			this.query({});
			this.types = [{
				id: 1,
				name: '恐怖'
			}, {
				id: 2,
				name: '惊悚'
			}, {
				id: 3,
				name: '动画片'
			}, {
				id: 4,
				name: '爱情'
			}];
		}

	}
</script>

<style>
</style>

⑦ 效果演示

二、表单验证 

2.1 添加规则

需要在里面的form表单里面添加:model="book" :rules="rules" ref="book":model和ref必须是一样的

      <el-form :model="book" :rules="rules" ref="book">

在<el-form-item>里面添加prop属性

注意:该prop属性值要与实体表字段名一致

2.2 定义规则

	rules: {
					bookname: [{
							required: true,
							message: '请输入书籍名称',
							trigger: 'blur'
						},
						{
							min: 2,
							max: 7,
							message: '长度在 2 到 7 个字符',
							trigger: 'blur'

						}
					],
					price: [{
						required: true,
						message: '请输入书籍价格',
						trigger: 'blur'
					}],
					booktype: [{
						required: true,
						message: '请输入书籍类别',
						trigger: 'blur'
					}]
				}

2.3 提交事件

在提交的事件里面添加。

 
 this.$refs[formName].validate((valid) => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });

ormName:form里面:model="book" 或者ref="book"  的名字

比例我的提交事件为确定按钮,那我是在确定按钮的事件中添加。比如:

		dosub() {
				this.$refs['book'].validate((valid) => {
					if (valid) {

						let url = this.axios.urls.Book_ADD;
						if (this.title == '编辑窗体') {
							url = this.axios.urls.Book_UPD;
						}
						let params = {
							id: this.book.id,
							bookname: this.book.bookname,
							price: this.book.price,
							booktype: this.book.booktype
						};
						console.log(params);
						this.axios.post(url, params).then(r => {
							this.clear();
							this.query({})
						}).catch(e => {

						})

					} else {
						console.log('error submit!!');
						return false;
					}
				});


			},

当你的规则必配了就执行你的增加修改的方法,或者其他的方法

2.4 前端完整代码​​​​​​​

<template>
	<div>
		<!-- 上搜索框 -->
		<div class="books">
			<el-form :inline="true" class="demo-form-inline" style="margin-top: 40px; margin-left: 20px;">
				<el-form-item label="书本名称">
					<el-input v-model="bookname" placeholder="请输入书本名称..."></el-input>
				</el-form-item>

				<el-form-item>
					<el-button type="primary" @click="onSubmit">查询</el-button>
					<el-button type="primary" @click="open()">新增</el-button>
				</el-form-item>
			</el-form>
		</div>

		<!-- 中 数据表格 -->
		<el-table :data="tableData" style="width: 100%">
			<el-table-column prop="id" label="书本编号" width="180"></el-table-column>
			<el-table-column prop="bookname" label="书本名称" width="180"></el-table-column>
			<el-table-column prop="price" label="书本价格"></el-table-column>
			<el-table-column prop="booktype" label="书本类型"></el-table-column>
			<el-table-column label="操作">
				<template slot-scope="scope">
					<el-button size="mini" @click="open(scope.$index, scope.row)">编辑</el-button>
					<el-button size="mini" type="danger" @click="del(scope.$index, scope.row)">删除</el-button>
				</template>
			</el-table-column>
		</el-table>


		<!-- 下 分页条 -->
		<div class="block">
			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"
				:page-sizes="[10, 20, 30, 40]" :page-size="rows" layout="total, sizes, prev, pager, next, jumper"
				:total="total">
			</el-pagination>
		</div>


		<!--对话框-->
		<el-dialog title="title" :visible.sync="dialogFormVisible" @close="clear()">
			<el-form :model="book" :rules="rules" ref="book">
				<el-form-item label="书籍编号" :label-width="formLabelWidth">
					<el-input v-model="book.id" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="书籍名称" :label-width="formLabelWidth" prop="bookname">
					<el-input v-model="book.bookname" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="书籍价格" :label-width="formLabelWidth" prop="price">
					<el-input v-model="book.price" autocomplete="off"></el-input>
				</el-form-item>

				<el-form-item label="书籍类别" :label-width="formLabelWidth" prop="booktype">
					<el-select v-model="book.booktype" placeholder="请选择活动区域">
						<el-option v-for="t in types" :label="t.name" :value="t.name" :key="'key'+t.id"></el-option>
					</el-select>
				</el-form-item>
			</el-form>
			<div slot="footer" class="dialog-footer">
				<el-button @click="dialogFormVisible = false">取 消</el-button>
				<el-button type="primary" @click="dosub">确 定</el-button>
			</div>
		</el-dialog>

	</div>
</template>


<script>
	export default {
		data() {
			return {
				bookname: '',
				tableData: [],
				rows: 10,
				page: 1,
				total: 0,
				title: '新增窗体',
				dialogFormVisible: false,
				formLabelWidth: '100px',
				types: [],
				book: {
					id: '',
					bookname: '',
					price: '',
					booktype: ''
				},

				rules: {
					bookname: [{
							required: true,
							message: '请输入书籍名称',
							trigger: 'blur'
						},
						{
							min: 2,
							max: 7,
							message: '长度在 2 到 7 个字符',
							trigger: 'blur'

						}
					],
					price: [{
						required: true,
						message: '请输入书籍价格',
						trigger: 'blur'
					}],
					booktype: [{
						required: true,
						message: '请输入书籍类别',
						trigger: 'blur'
					}]
				}
			}
		},
		methods: {
			del(idx, row) {
				this.$confirm('此操作将永久删除id为' + row.id + '的数据,是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					let url = this.axios.urls.Book_DEL;
					this.axios.post(url, {
						id: row.id
					}).then(r => {
						this.clear();
						this.query({})
						this.$message({
							type: 'success',
							message: '删除成功!'
						});
						this.query({});
					}).catch(e => {

					})

				}).catch(() => {
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},
			dosub() {
				this.$refs['book'].validate((valid) => {
					if (valid) {

						let url = this.axios.urls.Book_ADD;
						if (this.title == '编辑窗体') {
							url = this.axios.urls.Book_UPD;
						}
						let params = {
							id: this.book.id,
							bookname: this.book.bookname,
							price: this.book.price,
							booktype: this.book.booktype
						};
						console.log(params);
						this.axios.post(url, params).then(r => {
							this.clear();
							this.query({})
						}).catch(e => {

						})

					} else {
						console.log('error submit!!');
						return false;
					}
				});


			},
			//初始化对话框,重置对话框
			clear() {
				this.dialogFormVisible = false;
				this.title = '新增窗体';
				this.book = {
					id: '',
					bookname: '',
					price: '',
					booktype: ''
				}
			},
			open(idx, row) {
				//打开对话框
				this.dialogFormVisible = true;
				if (row) {
					this.title = '编辑窗体';
					this.book.id = row.id;
					this.book.bookname = row.bookname;
					this.book.price = row.price;
					this.book.booktype = row.booktype;
				}
			},
			query(params) {
				let url = this.axios.urls.Book_LIST;
				this.axios.get(url, {
					params: params
				}).then(r => {
					console.log(r);
					this.tableData = r.data.rows;
					this.total = r.data.total;
				}).catch(e => {})
			},
			onSubmit() {
				let params = {
					bookname: this.bookname
				}
				this.query(params);
			},

			//当页大小发生变化
			handleSizeChange(r) {
				let params = {
					bookname: this.bookname,
					rows: r,
					page: this.page
				}
				this.query(params)
			},
			//当前页码发生变化
			handleCurrentChange(p) {
				let params = {
					bookname: this.bookname,
					rows: this.rows,
					page: p
				}
				this.query(params);
			}
		},
		created() {
			this.query({});
			this.types = [{
				id: 1,
				name: '恐怖'
			}, {
				id: 2,
				name: '惊悚'
			}, {
				id: 3,
				name: '动画片'
			}, {
				id: 4,
				name: '爱情'
			}];
		}

	}
</script>

<style>
</style>

2.5 效果

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1046443.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

新能源汽车行业出口ERP管理解决方案

中国汽车企业以史无前例的规模进军慕尼黑车展。本届展会&#xff0c;中国汽车参展企业数量达50家&#xff0c;是2021年的两倍。欧洲销售的新型电动汽车中&#xff0c;8%由中国品牌制造。2022年上半年&#xff0c;中国电动汽车的平均价格不到3.2万欧元&#xff08;3.5万美元&…

香港云服务器和日本云服务器哪个好?(详细对比)

​  购置海外服务器时&#xff0c;您是在乎网络速度?价格?稳定性?当这几个因素同时存在&#xff0c;我们该如何选择?本篇针对海外热门的两个地区&#xff0c;中国香港和日本&#xff0c;这两种云服务器谁优谁劣?各有什么亮点?逐一进行对比分析。 一、速度上来看 中国香…

Tungsten Fabric数据量过大问题处理初探

开源SDN系统Tungsten Fabric面临数据产生过多问题。 经排查&#xff0c;产生数据多出自analytics组件的Cassandra数据库()。很多分析数据会存储至Cassandra库&#xff0c;并持久化处理。 没有特殊调整的话&#xff0c;目录在 /var/lib/docker/volumes/analytics_database_an…

春招秋招,大学生求职容易遇到哪些问题?

每到毕业季就有大批大学生从校园出来&#xff0c;他们怀抱梦想&#xff0c;希望能做出一番成绩。但现实总归是残酷的&#xff0c;有些人找不到工作&#xff0c;有一些人频繁跳槽&#xff0c;也有一些人最终找到的工作与自己的专业没有一点关系&#xff0c;迷茫好几年才找到方向…

数字音频工作站FL Studio 21中文版下载及电音编曲要用乐理吗 电音编曲步骤

FL Studio 21是一款强大的数字音频工作站&#xff08;DAW&#xff09;软件&#xff0c;为您提供一个完整的软件音乐制作环境。它是制作高质量的音乐、乐器、录音等的完整解决方案。该程序配备了各种工具和插件&#xff0c;帮助你创建专业的虚拟乐器&#xff0c;如贝斯、吉他、钢…

探索Moonbeam路由流动性的强大功能

Moonbeam的GMP预编译作为MRL的接口&#xff0c;有助于将带有Token的消息从GMP协议&#xff08;通过XCMP&#xff09;传输到与Moonbeam链接的平行链。 为何是个重磅消息&#xff1f;因为这项技术使得将流动性从外部区块链转移到其他波卡平行链成为可能&#xff01; 这里补充一…

快手商品详情数据接口

快手商品详情数据接口的调用需要使用快手提供的API接口。API接口是一种程序之间进行交互的方式&#xff0c;它允许两个程序或者网页之间互相通信、交换数据。 快手API接口的具体使用方法和步骤需要您参考快手的官方文档或者开发者指南。在使用快手API接口时&#xff0c;您需要…

基于遗传算法解决的多仓库多旅行推销员问题(Matlab代码实现)

&#x1f4a5;&#x1f4a5;&#x1f49e;&#x1f49e;欢迎来到本博客❤️❤️&#x1f4a5;&#x1f4a5; &#x1f3c6;博主优势&#xff1a;&#x1f31e;&#x1f31e;&#x1f31e;博客内容尽量做到思维缜密&#xff0c;逻辑清晰&#xff0c;为了方便读者。 ⛳️座右铭&a…

【Python基础】if __name__ == ‘__main__‘:和assert函数

&#x1f4e2;&#xff1a;如果你也对机器人、人工智能感兴趣&#xff0c;看来我们志同道合✨ &#x1f4e2;&#xff1a;不妨浏览一下我的博客主页【https://blog.csdn.net/weixin_51244852】 &#x1f4e2;&#xff1a;文章若有幸对你有帮助&#xff0c;可点赞 &#x1f44d;…

day49 jdbc技术

一、概述 什么是JDBC Java DataBase COnnectivity Java 数据库连接 其实就是利用Java程序连接并访问数据库的一种技术 为什么要学习JDBC 之前我们是通过终端&#xff0c;或者第三方工具直接连接数据库 在企业开发中&#xff0c;更多的是通过程序来连接数据库的 未来学习的M…

docker部署MinIO集群

docker部署MinIO集群 1 拉取镜像 docker pull minio/minio:RELEASE.2023-08-16T20-17-30Z 2 启动集群节点命令 注意&#xff1a;要对配置文件中使用到的文件夹进行授权 version: 3 # 公共操作 x-minio-common: &minio-commonimage: minio/minio:RELEASE.2023-08-16T20-17…

SpringCloud nacos1.x.x版本升级到2.2.3版本并开启鉴权踩坑

近期由于服务器漏洞扫描&#xff0c;检测出nacos存在绕过登录鉴权漏洞&#xff0c;如图 需要进行升级并开启鉴权&#xff0c;就此次升级做下记录。 1.首先备份原来的nacos&#xff0c;导出配置文件作为备份&#xff1b; 2&#xff0c;从官网下载nacos-server-2.2.3.zip&#x…

华为云云耀云服务器L实例评测 | 实例使用教学之简单使用:通过 Docker 容器化技术在华为云云耀云服务器快速构建网站

华为云云耀云服务器L实例评测 &#xff5c; 实例使用教学之简单使用&#xff1a;通过 Docker 容器化技术在华为云云耀云服务器快速构建网站 介绍华为云云耀云服务器 华为云云耀云服务器 &#xff08;目前已经全新升级为 华为云云耀云服务器L实例&#xff09; 华为云云耀云服务器…

目标检测算法改进系列之Backbone替换为LSKNet

LSKNet Large Selective Kernel Network&#xff08;LSKNet&#xff09;可以动态地调整其大空间感受野&#xff0c;以更好地建模遥感场景中各种物体的测距的场景。据我们所知&#xff0c;这是首次在遥感物体检测领域探索大选择性卷积核机制的工作。在没有任何附加条件的情况下…

zemaxRKE广角目镜

在埃尔弗目镜的基础上&#xff0c;用一个消色差双胶合透镜取代了原本的双凸单透镜 半视场增加到35度 色差矫正很好 成本较低、生产工艺成熟 入瞳直径4mm波长0.51、0.56、0.61半视场35焦距28mm 镜头参数 效果&#xff1a; 成像光路&#xff1a;

内外监控软件科普:内网监控系统是什么?好用的内网监控系统有哪些?

随着互联网技术的快速发展&#xff0c;企业对于内部网络安全和信息保护的需求越来越高。内网监控系统作为一种有效的网络安全防护手段&#xff0c;可以帮助企业实现对内部网络的全面监控&#xff0c;确保数据安全和业务稳定。本文将从内网监控系统的定义、种类以及监控范围等方…

Verilog仿真文件中的阻塞和非阻塞赋值问题探讨

文章目录 测试验证RTL代码一、时钟初始值为1’b11.1、时钟用“”赋值&#xff0c;输入信号用“<”赋值(correct)1.2、时钟和输入信号都用“<”赋值(error)1.3、时钟和输入信号都用“”赋值(error)1.4、时钟用“<”赋值&#xff0c;输入信号用“”赋值(error) 二、时钟…

AI智能视频监控技术如何助力美好乡村建设?

随着城市化发展&#xff0c;很多乡村设施也在逐渐完善&#xff0c;智能监控也成了乡村发展必不可少的一环&#xff0c;智能视频监控应该在乡村建设里如何发挥作用呢&#xff1f; 1、有效提升安全意识 通过在乡村重要区域、公共场所、道路等设置智能视频监控设备&#xff0c;可…

【AI视野·今日Sound 声学论文速览 第十三期】Wed, 27 Sep 2023

AI视野今日CS.Sound 声学论文速览 Wed, 27 Sep 2023 Totally 1 papers &#x1f449;上期速览✈更多精彩请移步主页 Daily Sound Papers Synthias Melody: A Benchmark Framework for Unsupervised Domain Adaptation in Audio Authors Chia Hsin Lin, Charles Jones, Bj rn W…