Java实现ATM机模拟系统(Week2)

目录

前言

项目规划(第二周)

具体实现

用户大类

AccountOperations接口

UserOperations接口

Operations类(实现类)

Account类

User类

Area类 (父类)

货币大类 

Money类(抽象类)

操作界面

LoginInterface类

MainInterface类

RegistrationInterface类

三个界面的txt文档设计

后言


前言

上一周对ATM机模拟系统做了项目需求分析(Java实现ATM机模拟系统(week1)-CSDN博客),这周来做部分的实现。

项目规划(第二周)

  • 完成操作页面展示

  • 完成用户的登录。注册等用户基本操作

  • 学习I/O,要求用户数据必须持久化(也可使用jdbc+mysql)

  • 做好类的封装,自定义异常处理

具体实现

用户大类

AccountOperations接口

该接口主要定义了对帐户进行的操作方法,包括以下

  • 创建账户
  • 登录账户
  • 退出账户
  • 保存账户信息
  • 调出账户信息
package Account.Operations.Method;import Account.Account;
import Area.Area;import java.io.FileNotFoundException;public interface AccountOperations {public Account createAccount( Area area); // 创建账户public Account landAccount( String accountNumber, String cipher); // 登录账户public void logOut( Account account) throws FileNotFoundException;  // 退出账户public void saveAccountInformation( Account account);public Account retrieveAccountInformation( String accountNumber, String cipher);
}

UserOperations接口

该接口主要定义了用户执行的操作方法,目前包括以下

  • 存款
  • 取款
  • 查询余额
  • 修改密码
package Account.Operations.Method;import Account.Account;
import Currency.Money;public interface UserOperations {public void saveMoney( Money money, Account account); // 存钱public void withdraw( Money money, Account account); // 取钱public boolean checkBalance(Account account); // 查询余额public void changeCipher( Account account); // 修改密码
}

Operations类(实现类)

该类用于实现以上两个接口的方法

package Account.Operations;import Account.Account;
import Account.Operations.Method.AccountOperations;
import Account.Operations.Method.UserOperations;
import Area.Area;
import Currency.Money;
import OperationInterface.LoginInterface;import java.io.*;
import java.nio.file.Files;
import java.nio.file.Path;
import java.security.SecureRandom;
import java.util.Scanner;public class Operations implements AccountOperations, UserOperations {Operations operations = new Operations();LoginInterface loginInterface = new LoginInterface();@Overridepublic Account createAccount( Area area) {Scanner s = new Scanner(System.in);// 给出账号System.out.println("输入本人身份证号码:");String id = s.next();// 给出手机号System.out.println("输入本人手机号:");String mobileNumber = s.next();StringBuilder ac = new StringBuilder();ac.append(area.obtainNumber());SecureRandom num = new SecureRandom();for( int i = 0; i < 11; i++) {int t = num.nextInt(10);ac.append(t);}String accountNumber = ac.toString();// 输入密码String cipher =s.next();// 创建一个账号,并且初始化账号, 并且返回一个账号return new Account( accountNumber, cipher, 0.0, 0.0, 0, id, mobileNumber);}@Overridepublic Account landAccount( String accountNumber, String cipher) {// 直接调用retrieveAccountInformation()方法调出相应账户Account account = retrieveAccountInformation( accountNumber, cipher);if( account == null ) {System.out.println("输入账号密码有误,请重新输入!!!");// 返回登录操作继续输入账号和密码Scanner s = new Scanner(System.in);// 如果有什么其他操作, 如 创建账号、修改密码操作, 加这里/* ········· */// 利用递归函数重复输入,直到能匹配到账号为止account = landAccount( s.next(), s.next());}return account;}@Overridepublic void logOut( Account account) throws FileNotFoundException {// 将目前的账号清空, 重复利用account = null;System.out.println("账号退出成功!!!");// 退出账号后的后续操作写这里/*  ······   *///返回登录界面loginInterface.loginInterface();//operations.landAccount() ; //}@Overridepublic void saveAccountInformation( Account account) {// 为这个账户创建一个文本文档,存放账户信息String address = "E:\\Account\\" + account.getAccountNumber() + ".txt";File save = new File(address);// 如果文件已经存在,直接覆盖掉之前的信息保存if( save.exists() ) {try (FileOutputStream fileOut = new FileOutputStream(address) ) {ObjectOutputStream oos = new ObjectOutputStream(fileOut);oos.writeObject(account);oos.close();fileOut.close();System.out.println("账户信息保存成功");} catch (IOException e) {throw new RuntimeException("账户信息保存失败");}}// 如果文件不存在,者创建一个新文件存放账户信息else {try {if( save.createNewFile() ) {try (FileOutputStream fileOut = new FileOutputStream(address) ) {ObjectOutputStream oos = new ObjectOutputStream(fileOut);oos.writeObject(account);oos.close();fileOut.close();System.out.println("账户信息保存成功");} catch (IOException e) {throw new RuntimeException("账户信息保存失败");}}} catch (IOException e) {throw new RuntimeException(e);}}}@Overridepublic Account retrieveAccountInformation( String accountNumber, String cipher) {String address = "E:\\Account";// 读取指定路径目录File dictionary = new File(address);// 将该目录中的文件读入到list中File[] list = dictionary.listFiles();Account result = null;if( list != null ) {// 通过循环遍历目录中的文件,进行逐个查找for( File t : list) {Path find = Path.of(t.getAbsolutePath());String content = null;try {content = new String(Files.readAllBytes(find));} catch (IOException e) {throw new RuntimeException(e);}if( content.contains(accountNumber) && content.contains(cipher) ) {// 将目标文件信息读取到一个Account对象中try (FileInputStream in = new FileInputStream(address + "\\" + t.getName())) {ObjectInputStream oos = new ObjectInputStream(in);try {result = (Account) oos.readObject();} catch (ClassNotFoundException e) {throw new ClassCastException("读取用户信息失败!!!");}in.close();oos.close();} catch (IOException e) {throw new RuntimeException(e);}break;}}}else {System.out.println("目录为空!!!");}return result;}@Overridepublic void saveMoney(Money money, Account account) {Scanner s = new Scanner(System.in);System.out.println("放入所存金额:");account.setDeposit(account.getDeposit() + money.MoneyExchange( money, s.nextInt()));// 这里也可以采用一个 try - catch 块处理 saveAccountInformation方法中遇到的异常,目前未采用saveAccountInformation(account);System.out.println("存储成功!!!");}@Overridepublic void withdraw(Money money, Account account) {Scanner s = new Scanner(System.in);System.out.println("输入要取出金额:");int draw = s.nextInt();if( draw > account.getDeposit() ) {System.out.println("余额不足!!!");}else {// 账户中的货币都是以人民币形式存储的,所以要把取出(存入)的货币转化成人民币account.setDeposit(account.getDeposit() - money.MoneyExchange( money, s.nextInt()));}}@Overridepublic void changeCipher(Account account) {Scanner s = new Scanner(System.in);System.out.println("请输入本用户身份证号:");String id = s.next();System.out.println("请输入本用户手机号:");String mobileNumber = s.next();String address = "E:\\Account";File file = new File(address);File[] list = file.listFiles();if( list != null ) {// 通过循环遍历目录中的文件,进行逐个查找for( File t : list) {Path find = Path.of(t.getAbsolutePath());String content = null;try {content = new String(Files.readAllBytes(find));} catch (IOException e) {throw new RuntimeException(e);}if( content.contains(id) && content.contains(mobileNumber) ) {// 将目标文件信息读取到一个Account对象中try (FileInputStream in = new FileInputStream(address + "\\" + t.getName())) {ObjectInputStream oos = new ObjectInputStream(in);try {Account result = (Account) oos.readObject();System.out.println("请输入新密码(由六位数组成):");result.setCipher(s.next());System.out.println("密码更改成功!!!");// 保存信息saveAccountInformation(result);} catch (ClassNotFoundException e) {throw new ClassCastException("更改密码时读取用户信息失败!!!");}in.close();oos.close();} catch (IOException e) {throw new RuntimeException(e);}break;}}}else {System.out.println("目录为空!!!");}}public boolean checkBalance(Account account) {Account result = retrieveAccountInformation( account.getAccountNumber(), account.getCipher());if ( result != null ) {System.out.println("账户余额为:" + result.getDeposit() + "RMB");return true;}else {System.out.println("账户余额查询失败,请重新输入账号和密码!!!");return false;// 如果查询失败可根据用户选择进行继续查询,这里通过返回值判断是否查询成功}}
}

Account类

该类是对账户的定义,包括了账户应当具有的属性

包括但不限于

  • 账号
  • 密码
  • 手机号
  • 余额
  • 年利率(待商榷)
  • 时间(待商榷)
  • 用户id
package Account;import java.io.Serializable;// 因为要实现账户保存,所以要接Serializable接口
public class Account implements Serializable {private String accountNumber;private String cipher;private Double deposit;private Double annualInterestRate;private int time;private final String id;private final String mobileNumber;public Account(String accountNumber, String cipher, Double deposit, Double annualInterestRate, int time, String id, String mobileNumber) {this.accountNumber = accountNumber;this.cipher = cipher;this.deposit = deposit;this.annualInterestRate = annualInterestRate;this.time = time;this.id = id;this.mobileNumber = mobileNumber;}@Overridepublic String toString() {return "Account{" +"accountNumber='" + accountNumber + '\'' +", cipher='" + cipher + '\'' +", deposit=" + deposit +", annualInterestRate=" + annualInterestRate +", time=" + time +'}';}private int getTime() {return time;}public String getAccountNumber() {return accountNumber;}public String getCipher() {return cipher;}public Double getAnnualInterestRate() {return annualInterestRate;}public Double getDeposit() {return deposit;}public void setAccountNumber(String accountNumber) {this.accountNumber = accountNumber;}public void setDeposit(Double deposit) {this.deposit = deposit;}public void setAnnualInterestRate(Double annualInterestRate) {this.annualInterestRate = annualInterestRate;}public void setTime(int time) {this.time = time;}public void setCipher(String cipher) {this.cipher = cipher;}public String getId() {return id;}public String getMobileNumber() {return mobileNumber;}
}

User类

该类是面向用户的,主要实现了用户使用系统时的操作逻辑,通过用户输入的操作数来执行对应的操作。

package User;import Account.Account;
import Account.Operations.Operations;
import OperationInterface.LoginInterface;
import OperationInterface.MainInterface;
import OperationInterface.RegistrationInterface;import java.io.FileNotFoundException;
import java.util.Scanner;import static java.lang.System.exit;public class User {public void userOperation() throws FileNotFoundException {// 跳出首页画面提示用户/* ······· */Scanner s = new Scanner(System.in);Account account = null;Operations operation = new Operations();System.out.println("输入 1 登录账户   输入 2 创建新账户  ");int userOperation = s.nextInt();if(userOperation == 1){LoginInterface loginInterface = new LoginInterface();loginInterface.loginInterface();Operations operations = new Operations();//调用登录方法//operations.landAccount(); ////如何判断登录成功?成功则进入主界面MainInterface mainInterface = new MainInterface();mainInterface.mainInterface(); //展示主界面}else if (userOperation == 2){RegistrationInterface registrationInterface = new RegistrationInterface();registrationInterface.registrationInterface();Operations operations = new Operations();//调用创建账户方法//operations.createAccount(); }else {System.out.println("您进行的操作不合法!");}// 以下可以根据页面直接加操作/* ············· */}public void mainInterfaceOperation(){//主界面操作Scanner scanner = new  Scanner(System.in) ;Operations operations = new Operations();int n = scanner.nextInt();if (n == 1){//调用存款方法//operations.saveMoney(); //}else if(n == 2){//调用取款方法//operations.withdraw(); //}else if(n == 3){//调用查询余额方法//operations.checkBalance() ;///}else if(n == 4){//调用货币交换方法 !!未实现}else if(n == 5){//调用修改密码方法//operations.changeCipher(); }else if(n == 6){//调用操作日志查询方法 !!未实现}else if(n == 7){//调用退出账户方法,返回登录界面//operations.logOut(); ///}else if(n == 8){//退出系统,即终止程序运行exit(0) ;}}
}

Area类 (父类)

在创建账户时,需要根据用户所在地区给出前几位数字,我们用一个Area父类来实现这一功能,每个不同的地区均是其子类

package Area;public class Area {public String name;public Area(String name) {this.name = name;}public String obtainNumber() {return null;}
}

货币大类 

本周货币大类不在需要实现的范围内,故只进行了简单的架构

Money类(抽象类)

主要实现货币交换的方法,每个不同的币种均是其子类

package Currency;public abstract class Money {public Double exchangeRate; // 汇率, 人民币与该货币的比public abstract Double MoneyExchange( Money money, int num); // 某货币交换成人民币public abstract  Double ExchangeMoney( Money money, int num);// 人民币交换成某货币
}

操作界面

目前实现了三个界面

  • 登录界面
  • 注册界面
  • 主界面

界面的实现极其简单,无非是几个文件创建和输出的事情罢了。

LoginInterface类

package OperationInterface;import java.io.*;public class LoginInterface {public void loginInterface() throws FileNotFoundException {File file = new File("Login.txt"); //创建File类对象,并给出其相对路径,否则默认创建在当前路径下if (file.exists()) { //调用exists方法,判断文件是否存在fileInput(file); //如已存在,直接打开} else { //如不存在,执行创建操作try {file.createNewFile();fileInput(file);} catch (Exception e) {System.out.println("系统故障!");}}}private void fileInput(File file) {FileReader f = null;//文件读取对象BufferedReader f1 = null;//字符流对象try {f = new FileReader(file);f1 = new BufferedReader(f);//循环打印cc文件中的每行数据String str = null;while ((str = f1.readLine()) != null) {System.out.println(str);}} catch (Exception e) {System.out.println("系统故障!");} finally {try {f1.close();f.close();} catch (Exception e2) {System.out.println("系统故障!");}}}
}

MainInterface类

package OperationInterface;import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;public class MainInterface {public void mainInterface() throws FileNotFoundException {File file = new File("Main.txt"); //创建File类对象,并给出其相对路径,否则默认创建在当前路径下if (file.exists()) { //调用exists方法,判断文件是否存在fileInput(file); //如已存在,直接打开} else { //如不存在,执行创建操作try {file.createNewFile();fileInput(file);} catch (Exception e) {System.out.println("系统故障!");}}}private void fileInput(File file) {FileReader f = null;//文件读取对象BufferedReader f1 = null;//字符流对象try {f = new FileReader(file);f1 = new BufferedReader(f);//循环打印cc文件中的每行数据String str = null;while ((str = f1.readLine()) != null) {System.out.println(str);}} catch (Exception e) {System.out.println("系统故障!");} finally {try {f1.close();f.close();} catch (Exception e2) {System.out.println("系统故障!");}}}
}

RegistrationInterface类

package OperationInterface;import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;public class RegistrationInterface {public void registrationInterface() throws FileNotFoundException {File file = new File("Registration.txt"); //创建File类对象,并给出其相对路径,否则默认创建在当前路径下if (file.exists()) { //调用exists方法,判断文件是否存在fileInput(file); //如已存在,直接打开} else { //如不存在,执行创建操作try {file.createNewFile();fileInput(file);} catch (Exception e) {System.out.println("系统故障!");}}}private void fileInput(File file) {FileReader f = null;//文件读取对象BufferedReader f1 = null;//字符流对象try {f = new FileReader(file);f1 = new BufferedReader(f);//循环打印cc文件中的每行数据String str = null;while ((str = f1.readLine()) != null) {System.out.println(str);}} catch (Exception e) {System.out.println("系统故障!");} finally {try {f1.close();f.close();} catch (Exception e2) {System.out.println("系统故障!");}}}
}

三个界面的txt文档设计

//登录界面               登录账号:
密码://注册界面注册请输入身份证号:
请输入手机号:
请输入密码://主界面欢迎1.存款            2.取款
3.查询余额         4.货币交换
5.更改密码         6.操作日志查询
7.退出账户         8.退出系统

后言

本周主要实现了用户的部分基本操作,采用的主要手段为文件操作(文件的写入与读取也有博客记录Java文件操作(从创建文件到简单输入输出流)-CSDN博客),用于存储数据,设计操作界面等。在和朋友进行合作开发的过程中,我们也遇到了许多问题,比如当我们分析完项目需求后,双方就开始着手写代码实现,却没有提前沟通好代码逻辑,导致虽然写了注释,互相读代码时也遇到了不小的障碍(所以大家千万别学我们

新手上路,水平有限,如有错误,还望海涵并指出!

与君共勉!

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

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

相关文章

redis的Set详细介绍

Redis的集合&#xff08;Set&#xff09;是由字符串组成的无序集合&#xff0c;和列表&#xff08;List&#xff09;不同的是&#xff0c;集合中的元素是唯一的&#xff0c;不存在重复的元素。以下是关于Redis集合的一些详细介绍&#xff1a; 基本概念&#xff1a; Redis的集合…

vue + koa + Sequelize + 阿里云部署 + 宝塔:宝塔数据库连接

之前文章已经介绍了宝塔上传前后端代码并部署&#xff0c;不清楚的请看这篇文章&#xff1a; vue koa 阿里云部署 宝塔&#xff1a;宝塔前后端部署 下面是宝塔创建数据库&#xff1a; 我用的 koa Sequelize 连接的数据库&#xff0c;Sequelize 非常适合前端使用&#xf…

【Python】字符串处理技巧大揭秘:从基础到高级

欢迎来CILMY23的博客 本篇主题为 字符串处理技巧大揭秘&#xff1a;从基础到高级 个人主页&#xff1a;CILMY23-CSDN博客 Python系列专栏&#xff1a;http://t.csdnimg.cn/HqYo8 上一篇博客&#xff1a; http://t.csdnimg.cn/5NRlT C语言专栏&#xff1a; http://t.csdnim…

5543: 【J1】【vector】【pair】星空时代大比武

题目描述 星空时代人类发明了很多太空母舰用来开拓家园&#xff0c;现有2n&#xff08;n≤10&#xff09;艘太空母舰进行战斗力大小比较&#xff0c;角逐出谁是最强太空母舰。比赛规则如下&#xff1a;1 号太空母舰和 2 号太空母舰比赛&#xff0c;胜者晋级。3 号太空母舰和 4…

虚幻UE5智慧城市全流程开发教学

一、背景 这几年&#xff0c;智慧城市/智慧交通/智慧水利等飞速发展&#xff0c;骑士特意为大家做了一个这块的学习路线。 二、这是学习大纲 1.给虚幻UE5初学者准备的智慧城市/数字孪生蓝图开发教程 https://www.bilibili.com/video/BV1894y1u78G 2.UE5数字孪生蓝图开发教学…

Docker 安装 Linux 系统可视化监控 Netdata

docker 安装 netdata 前提准备Docker 两种方式部署 Netdata1、使用 docker run 命令运行 netdata 服务2、使用 docker compose 运行 netdata 服务 Netdata 服务可视化界面Netdata 汉化处理 前提准备 说明&#xff1a;此处使用 windows11 安装的 docker desktop & wsl2/apli…

大语言模型LLM《提示词工程指南》学习笔记01

文章目录 大语言模型LLM《提示词工程指南》学习笔记01以下是使用不同LLM提供程序时会遇到的常见设置&#xff1a;标准提示词应该遵循以下格式&#xff1a;提示词要素 大语言模型LLM《提示词工程指南》学习笔记01 提示工程&#xff08;Prompt Engineering&#xff09;是一门较新…

linux E: You don‘t have enough free space in /var/cache/apt/archives/. 空间不足

问题&#xff1a; 在ubuntu的亚马逊云计算机平台上&#xff0c;apt install的时候&#xff0c;报错&#xff0c;空间不足 解决方法&#xff1a; 查看磁盘情况&#xff1a; 设置自动清理&#xff1a; sudo apt-get autoclean sudo apt-get clean 解决&#xff1a;

RabbitMQ3.13.x之十_流过滤的内部结构设计与实现

RabbitMQ3.13.x之十_流过滤的内部结构设计与实现 文章目录 RabbitMQ3.13.x之十_流过滤的内部结构设计与实现1. 概念1. 消息发布2. 消息消费 2. 流的结构1. 在代理端进行过滤2. 客户端筛选3. JavaAPI示例4. 流过滤配置5. AMQP上的流过滤6. 总结 3. 相关链接 1. 概念 流过滤的思…

前端与后端协同:实现Excel导入导出功能

&#x1f31f; 前言 欢迎来到我的技术小宇宙&#xff01;&#x1f30c; 这里不仅是我记录技术点滴的后花园&#xff0c;也是我分享学习心得和项目经验的乐园。&#x1f4da; 无论你是技术小白还是资深大牛&#xff0c;这里总有一些内容能触动你的好奇心。&#x1f50d; &#x…

[实战经验]Mybatis的mapper.xml参数#{para}与#{para, jdbcType=BIGINT}有什么区别?

在MyBatis框架中&#xff0c;传入参数使用#{para}和#{para, jdbcTypeBIGINT}的有什么区别呢&#xff1f; #{para}&#xff1a;这种写法表示使用MyBatis自动推断参数类型&#xff0c;并根据参数的Java类型自动匹配数据库对应的类型。例如&#xff0c;如果参数para的Java类型是Lo…

RISC-V GNU Toolchain 工具链安装问题解决(含 stdio.h 问题解决)

我的安装过程主要参照 riscv-collab/riscv-gnu-toolchain 的官方 Readme 和这位佬的博客&#xff1a;RSIC-V工具链介绍及其安装教程 - 风正豪 &#xff08;大佬的博客写的非常详细&#xff0c;唯一不足就是 sudo make linux -jxx 是全部小写。&#xff09; 工具链前前后后我装了…

非关系型数据库--------------------Redis 群集模式

目录 一、集群原理 二、集群的作用 &#xff08;1&#xff09;数据分区 &#xff08;2&#xff09;高可用 Redis集群的作用和优势 三、Redis集群的数据分片 四、Redis集群的工作原理 五、搭建redis群集模式 5.1启用脚本配置集群 5.2修改集群配置 5.3启动redis节点 5…

自动化运维(八)Ansible 之核心模块

Ansible 的核心模块是 Ansible 默认提供的一组最基本和常用的模块。这些模块涵盖了各种常见的任务,如文件管理、包管理、系统配置等。以下是一些 Ansible 的核心模块: 1、命令执行模块: command: 用于在远程主机上执行简单的命令。它不支持管道、重定向和通配符等 shell 功能…

Django--admin 后台管理站点

Django最大的优点之一&#xff0c;就是体贴的提供了一个基于项目model创建的一个后台管理站点admin。这个界面只给站点管理员使用&#xff0c;并不对大众开放。虽然admin的界面可能不是那么美观&#xff0c;功能不是那么强大&#xff0c;内容不一定符合你的要求&#xff0c;但是…

dm8 备份与恢复

dm8 备份与恢复 基础环境 操作系统&#xff1a;Red Hat Enterprise Linux Server release 7.9 (Maipo) 数据库版本&#xff1a;DM Database Server 64 V8 架构&#xff1a;单实例1 设置bak_path路径 --创建备份文件存放目录 su - dmdba mkdir -p /dm8/backup--修改dm.ini 文件…

非关系型数据库——Redis基本操作

目录 一、Redis数据库常用命令 1.Set——存放数据 2.Get——获取数据 3.Keys——获取符合条件的键值 4.Exists——判断键值是否存在 5.Del——删除指定键值 6.Type——获取键值对应的类型 7.Rename——对已有键值重命名&#xff08;覆盖&#xff09; 8.Renamenx——对…

【蓝桥杯嵌入式】13届程序题刷题记录及反思

一、题目分析 考察内容&#xff1a; led按键&#xff08;短按&#xff09;PWM输出&#xff08;PA1&#xff09;串口接收lcd显示 根据PWM输出占空比调节&#xff0c;高频与低频切换 串口接收&#xff08;指令解析&#xff09;【中断接收】 2个显示界面 led灯闪烁定时器 二…

SV学习笔记(六)

覆盖率类型 写在前面 覆盖率是 衡量设计验证完备性 的一个通用词。随着测试逐步覆盖各种合理的场景&#xff0c;仿真过程会慢慢勾画出你的设计情况。覆盖率工具会 在仿真过程中收集信息 &#xff0c;然后进行后续处理并且得到覆盖率报告。通过这个报告找出覆盖之外的盲区&…

动态属性的响应式问题和行内编辑的问题

动态属性的响应式问题 通过点击给目标添加动态数据&#xff0c;该数据不具备响应式特性 如下图&#xff1a; 点击编辑&#xff0c;前面的数据框会变成输入框&#xff0c;点取消会消失 // 获取数据 async getList () {const res await xxxthis.list res.data.rows// 1. 获…