news 2026/4/30 9:41:20

记录一次前端模型利用freesql映射,报400的问题

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
记录一次前端模型利用freesql映射,报400的问题

前端代码如下:

<template>

  <div>

    <el-row style="margin-top: 16px">

      <el-col :span="6" style="margin-left: 16px">

        <span style="width: 100px">名称:</span>

        <el-input

          v-model="querygoodsname"

          size="mini"

          style="width: 260px"

          placeholder="名称"

        ></el-input>

      </el-col>

     

      <el-col :span="4">

        <el-button

          type="primary"

          size="medium"

          style="width: 90px"

          @click="GetGoodsInfos()"

          >查询</el-button

        >

      </el-col>

    </el-row>

    <el-row style="margin-left: 20px; margin-top: 16px">

      <el-table

        :data="queryGoodsInfos"

        :max-height="720"

        border

        style="width: 100%"

      >

        <el-table-column prop="Id" label="商品编号" sortable></el-table-column>

        <el-table-column prop="goodsname" label="商品名称" sortable></el-table-column>

        <el-table-column prop="price" label="商品价格" sortable></el-table-column>

        <el-table-column prop="productfactory" label="生产厂商" sortable></el-table-column>

         <el-table-column prop="unit" label="单位" sortable></el-table-column>

        <el-table-column prop="" label="操作">

          <template slot-scope="scope">

            <el-button  type="text" size="small">查看</el-button>

            <el-button  type="text" size="small">修改</el-button>

            <el-button  type="text"size="small">删除</el-button>

          </template>

        </el-table-column>

      </el-table>

    </el-row>

  </div>

</template>

<script>

import waves from "@/directive/waves/index.js"; // 水波纹指令

import { mapGetters } from "vuex";

import { GetRoleInfos} from "@/api/role.js";

import { GetGoods, QueryGoodsInfos, AddGoods, UpdateGoods, DeleteGoods} from "@/api/goods.js";

export default {

  name: "GoodsManage",

  components: {},

  directives: {

    waves,

  },

  data() {

    return {

      goods: {

        Id: 0,

        goodsname: "",

        price: 0.0,

        type: "",

        productfactory: "",

        unit: "",

      },

      role:"",

      roleInfos: [],

      querygoodsname: "", // 查询框的用户名称

      goodsInfoVisable: false,

      goodsInfos: [],

      queryGoodsInfos: [],

      rules: {

        goodsname: [

          { required: true, message: "请输入用户名称", trigger: "blur" },

        ]

      },

    };

  },

  computed: {

    ...mapGetters(["name", "avatar", "roles"]),

  },

  watch: {},

  created() {

    this.userName = this.name;

    GetGoods()

      .then((response) => {

        this.goodsInfos = this.queryGoodsInfos = response.Data;

      })

      .catch(() => {

        console.log("获取商品数据失败");

      });

    GetRoleInfos(this.roleInfo)

      .then((response) => {

        this.roleInfos = response.Data;

      })

      .catch(() => {

        console.log("获取角色数据失败");

      });

  },

  methods: {

   GetGoodsInfos() {

    if(this.querygoodsname)

    {

    this.goods.goodsname = this.querygoodsname;

    this.queryGoodsInfos=[];

    QueryGoodsInfos({goodsname: this.querygoodsname})

      .then((response) => {

        console.log("获取商品数据

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/4/30 9:41:09

Windows Cleaner:3个步骤让你的电脑告别卡顿,C盘不再爆红

Windows Cleaner&#xff1a;3个步骤让你的电脑告别卡顿&#xff0c;C盘不再爆红 【免费下载链接】WindowsCleaner Windows Cleaner——专治C盘爆红及各种不服&#xff01; 项目地址: https://gitcode.com/gh_mirrors/wi/WindowsCleaner 你是否经常面对C盘爆红的警告而束…

作者头像 李华
网站建设 2026/4/16 17:42:50

HTML头部元信息避坑

HTML头部元信息避坑指南技术文章大纲元信息基础与重要性头部元信息的定义与作用&#xff08;SEO、渲染控制、兼容性等&#xff09;常见元标签分类&#xff08;<meta>、<link>、<title>等&#xff09;常见错误与修复方案字符编码声明缺失或错误错误示例&#…

作者头像 李华
网站建设 2026/4/15 23:16:12

STL体积计算器:3D打印模型体积与重量估算完整指南

STL体积计算器&#xff1a;3D打印模型体积与重量估算完整指南 【免费下载链接】STL-Volume-Model-Calculator STL Volume Model Calculator Python 项目地址: https://gitcode.com/gh_mirrors/st/STL-Volume-Model-Calculator STL-Volume-Model-Calculator 是一个功能强…

作者头像 李华
网站建设 2026/4/17 1:39:13

手把手教你用AIFuzzing检测Web应用越权漏洞(含AI模式配置技巧)

手把手教你用AIFuzzing检测Web应用越权漏洞&#xff08;含AI模式配置技巧&#xff09; 在Web应用安全测试中&#xff0c;越权漏洞是最常见也最危险的安全隐患之一。这类漏洞往往难以通过传统扫描工具有效识别&#xff0c;而AIFuzzing通过结合规则引擎与AI分析能力&#xff0c;为…

作者头像 李华
网站建设 2026/4/14 20:03:34

SVPWM控制异步电机PI双闭环变频调速系统的MATLAB仿真及结果展示

SVPWM控制异步电机PI双闭环变频调速系统。 附赠参考文档 用matlab仿真的 可查看结果。工业现场那些需要精准调速的传送带、风机设备里&#xff0c;藏着个硬核技术——基于SVPWM的异步电机双闭环变频调速。这玩意儿听着玄乎&#xff0c;其实拆开来看就是个带保镖的指挥官系统&am…

作者头像 李华
网站建设 2026/4/14 20:02:15

告别多步采样!用Stable Diffusion做医学图像分割,SDSeg单步推理保姆级解读

SDSeg&#xff1a;颠覆医学图像分割的单步扩散革命 医学影像分析领域正经历一场由扩散模型引领的效率革命。传统基于深度学习的医学图像分割方法虽然取得了显著进展&#xff0c;但在处理复杂病理结构时仍面临计算资源消耗大、推理速度慢等瓶颈问题。SDSeg&#xff08;Stable Di…

作者头像 李华