仓库管理系统12--物资设置供应商设置

1、添加供应商窗体

2、布局控件UI

 

<UserControl x:Class="West.StoreMgr.View.SupplierView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:West.StoreMgr.View"
             mc:Ignorable="d" 
             DataContext="{Binding Source={StaticResource Locator},Path=Supplier}"
             d:DesignHeight="510" d:DesignWidth="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50"/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <!--标题-->
        <StackPanel Background="#EDF0F6" Orientation="Horizontal">
            <TextBlock Margin="10 0 0 0" Text="&#xf015;" FontSize="20" FontFamily="/Fonts/#FontAwesome" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#797672"/>
            <TextBlock Margin="10 0 0 0" Text="首页 > 供应商管理" FontSize="20" FontFamily="/Fonts/#FontAwesome" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="#797672"/>
        </StackPanel>

        <!--增加-->
        <Grid Grid.Row="1" Margin="20">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Border Background="#72BBE5">
                <TextBlock Text="添加供应商" FontSize="18" VerticalAlignment="Center" Foreground="#1F3C4C" Margin="0 0 10 0"/>
            </Border>
            <StackPanel Grid.Row="1" Orientation="Vertical" VerticalAlignment="Center"  Margin="-4 10 0 10">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <TextBlock Margin="0 0 10 0" Text="供应商名称:" VerticalAlignment="Center"/>
                    <TextBox Margin="0 0 10 0" Text="{Binding Supplier.Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="100" Height="30" />
                    <TextBlock Margin="0 0 10 0" Text="联系人:" VerticalAlignment="Center"/>
                    <TextBox Margin="0 0 10 0" Text="{Binding Supplier.Contact,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="200" Height="30" />
                    <TextBlock Margin="0 0 10 0" Text="电话:" VerticalAlignment="Center"/>
                    <TextBox Margin="0 0 10 0" Text="{Binding Supplier.Telephone,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="200" Height="30" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center"  Margin="0 10 0 10">
                    <TextBlock Margin="0 0 10 0" Text="电子信箱:" VerticalAlignment="Center"/>
                    <TextBox Margin="0 0 10 0" Text="{Binding Supplier.Email,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="100" Height="30" />
                    <TextBlock Margin="0 0 10 0" Text="地址:" VerticalAlignment="Center"/>
                    <TextBox Margin="0 0 10 0" Text="{Binding Supplier.Address,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="200" Height="30" />
                    <TextBlock Margin="0 0 10 0" Text="备注:" VerticalAlignment="Center"/>
                    <TextBox Margin="0 0 10 0" Text="{Binding Supplier.Tag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Width="200" Height="30" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="220 10 0 10">
                    <!--button-->
                    <Button Margin="0 0 0 0" Height="36" FontSize="20" Width="199" Grid.Row="3" 
                     Content="增 加" Style="{StaticResource ButtonStyle}" 
                     CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:SupplierView}}"
                     Command="{Binding AddCommand}"/>
                </StackPanel>
            </StackPanel>
        </Grid>

        <!--列表-->
        <Grid Grid.Row="2" Margin="10 -20 10 10">
            <DataGrid ItemsSource="{Binding SupplierList}" CanUserAddRows="False" AutoGenerateColumns="False">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="序号" Binding="{Binding Id}"/>
                    <DataGridTextColumn Header="供应商" Binding="{Binding Name}"/>
                    <DataGridTextColumn Header="联系人" Binding="{Binding Contact}"/>
                    <DataGridTextColumn Header="电话" Binding="{Binding Telephone}"/>
                    <DataGridTextColumn Header="邮箱" Binding="{Binding Email}"/>
                    <DataGridTextColumn Header="地址" Binding="{Binding Address}"/>
                    <DataGridTextColumn Header="备注" Binding="{Binding Tag}"/>
                    <DataGridTextColumn Header="日期" Binding="{Binding InsertDate}"/>
                    <DataGridTemplateColumn  Header="操作">
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Button Content="编辑" 
                                         Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:SupplierView},Path=DataContext.EditCommand}"
                                         CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}" 
                                         Tag="{Binding}" 
                                         Style="{StaticResource DataGridButtonStyle}" />
                                    <Button Content="删除" 
                                         Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:SupplierView},Path=DataContext.DeleteCommand}"
                                         CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
                                         Tag="{Binding}" 
                                         Style="{StaticResource DataGridButtonStyle}" />
                                </StackPanel>
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
            </DataGrid>
        </Grid>
    </Grid>
</UserControl>

 3、添加viewmodel

using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using West.StoreMgr.Helper;
using West.StoreMgr.Service;
using CommonServiceLocator;
using West.StoreMgr.Windows;
using static West.StoreMgr.Windows.MsgBoxWindow;

namespace West.StoreMgr.ViewModel
{
    /// <summary>
    /// 供应商viewmodel
    /// </summary>
    public class SupplierViewModel : ViewModelBase
    {
        public SupplierViewModel()
        {
            SupplierList = new SupplierService().Select();
        }

        private Supplier supplier = new Supplier();
        public Supplier Supplier
        {
            get { return supplier; }
            set { supplier = value; RaisePropertyChanged(); }
        }

        private List<Supplier> supplierList = new List<Supplier>();

        public List<Supplier> SupplierList
        {
            get { return supplierList; }
            set { supplierList = value; RaisePropertyChanged(); }
        }

        /// <summary>
        /// 添加
        /// </summary>
        public RelayCommand AddCommand
        {
            get
            {
                var command = new RelayCommand(() =>
                {
                    if (string.IsNullOrEmpty(Supplier.Name) == true
                    || string.IsNullOrEmpty(Supplier.Contact) == true
                    || string.IsNullOrEmpty(Supplier.Telephone) == true)
                    { 
                        MsgWinHelper.ShowError("不能为空!");
                        return;
                    }

                    Supplier.InsertDate = DateTime.Now;

                    var service = new SupplierService();
                    int count = service.Insert(Supplier);
                    if (count > 0)
                    {
                        SupplierList = service.Select();
                        MsgWinHelper.ShowMessage("添加成功!");
                        Supplier = new Supplier();
                    }
                    else
                    {
                        MsgWinHelper.ShowError("添加失败!");
                    }
                });

                return command;
            }
        }

        /// <summary>
        /// 修改
        /// </summary>
        public RelayCommand<Button> EditCommand
        {
            get
            {
                var command = new RelayCommand<Button>((view) =>
                {
                    var old = view.Tag as Supplier;
                    if (old == null) return;
                    var model = ServiceLocator.Current.GetInstance<EditSupplierViewModel>();
                    model.Supplier = old;
                    var window = new EditSupplierWindow();
                    window.ShowDialog();
                    SupplierList = new SupplierService().Select();
                });

                return command;
            }
        }

        //删除
        public RelayCommand<Button> DeleteCommand
        {
            get
            {
                var command = new RelayCommand<Button>((view) =>
                { 
                    if (MsgWinHelper.ShowQuestion("您确定要删除该空运详情单吗?") == CustomMessageBoxResult.OK)
                    {
                        var old = view.Tag as Supplier;
                        if (old == null) return;

                        var service = new SupplierService();
                        int count = service.Delete(old);
                        if (count > 0)
                        {
                            SupplierList = service.Select();
                            MsgWinHelper.ShowMessage("删除成功!");
                        }
                        else
                        {
                            MsgWinHelper.ShowError("删除失败!");
                        }
                    }
                });

                return command;
            }
        }
    }
}

4、运行效果

5、修改供应商

1)UI布局

<Window x:Class="West.StoreMgr.Windows.EditSupplierWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:West.StoreMgr.Windows"
        mc:Ignorable="d"
         ResizeMode="NoResize"
          WindowStartupLocation="CenterScreen"
         DataContext="{Binding Source={StaticResource Locator},Path=EditSupplier}"
         Title="修改供应商" Height="450" Width="800">
    <Grid Background="#E4ECEF">
        <Grid Grid.Column="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.5*"/>
                <ColumnDefinition/>
                <ColumnDefinition Width="0.5*"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Border Grid.Column="0" Height="2" Width="122" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <!--渐变色横条-->
                    <Border.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                            <GradientStop Color="Red" Offset="0"></GradientStop>
                            <GradientStop Color="#6d6d6d"  Offset="1"></GradientStop>
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
                <TextBlock Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center" VerticalAlignment="Center" Text="修改供应商" FontSize="36"/>
                <Border Grid.Column="2"  Height="2" Width="122" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <!--渐变色横条-->
                    <Border.Background>
                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                            <GradientStop Color="Red" Offset="1"></GradientStop>
                            <GradientStop Color="#6d6d6d"  Offset="0"></GradientStop>
                        </LinearGradientBrush>
                    </Border.Background>
                </Border>
            </Grid>
           

            <TextBlock Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="供应商" FontSize="20"/>
            <TextBlock Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="联系人" FontSize="20"/>
            <TextBlock Grid.Row="3" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Text="电话" FontSize="20"/>

            <TextBox Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Supplier.Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" Width="200" Height="30"/>
            <TextBox Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Supplier.Contact,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" Width="200" Height="30"/>
            <TextBox Grid.Row="3" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Supplier.Telephone,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" Width="200" Height="30"/>

            <TextBlock Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="电子邮箱" FontSize="20"/>
            <TextBlock Grid.Row="2" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="地址" FontSize="20"/>
            <TextBlock Grid.Row="3" Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center" Text="备注" FontSize="20"/>

            <TextBox Grid.Row="1" Grid.Column="3" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Supplier.Email,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" Width="200" Height="30"/>
            <TextBox Grid.Row="2" Grid.Column="3" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Supplier.Address,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" Width="200" Height="30"/>
            <TextBox Grid.Row="3" Grid.Column="3" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Supplier.Tag,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" FontSize="20" Width="200" Height="30"/>


            <!--button-->
            <StackPanel Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" Orientation="Horizontal" HorizontalAlignment="Right" >
                <Button  Height="45" Width="199" Grid.Row="4" FontSize="20"  Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center" Margin="20 0 20 0"
                     Content="修 改" Style="{StaticResource ButtonStyle}" 
                     CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:EditSupplierWindow}}"
                     Command="{Binding EditCommand}"/>
                <Button  Height="45" Width="199" Grid.Row="4"  FontSize="20"   Grid.Column="0" Grid.ColumnSpan="4" HorizontalAlignment="Center" Margin="20 0 65 0"
                     Content="取 消" Style="{StaticResource ButtonStyle}" 
                     CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=local:EditSupplierWindow}}"
                     Command="{Binding CancelCommand}"/>
            </StackPanel> 
        </Grid> 
    </Grid>
</Window>

 2)viewmodel

using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using West.StoreMgr.Helper;
using West.StoreMgr.Service;

namespace West.StoreMgr.ViewModel
{
    /// <summary>
    /// 编辑供应商viewmodel
    /// </summary>
    public class EditSupplierViewModel : ViewModelBase
    {
        private Supplier supplier = new Supplier();
        public Supplier Supplier
        {
            get { return supplier; }
            set { supplier = value; RaisePropertyChanged(); }
        }

        /// <summary>
        /// 修改
        /// </summary>
        public RelayCommand<Window> EditCommand
        {
            get
            {
                var command = new RelayCommand<Window>((window) =>
                {
                    if (string.IsNullOrEmpty(Supplier.Name) == true
                    || string.IsNullOrEmpty(Supplier.Contact) == true
                    || string.IsNullOrEmpty(Supplier.Telephone) == true)
                    { 
                        MsgWinHelper.ShowError("不能为空!");
                        return;
                    }

                    var service = new SupplierService();
                    int count = service.Update(Supplier);
                    if (count > 0)
                    {
                        MsgWinHelper.ShowMessage("修改成功!");
                        window.Close();
                    }
                    else
                    { 
                        MsgWinHelper.ShowError("修改失败!");
                    }
                });

                return command;
            }
        }

        /// <summary>
        /// 取消
        /// </summary>
        public RelayCommand<Window> CancelCommand
        {
            get
            {
                var command = new RelayCommand<Window>((window) =>
                {
                    window.Close();
                });

                return command;
            }
        }
    }
}

3)运行效果

 

6、删除供应商

原创不易,打字不易,截图不易,多多点赞,送人玫瑰,留有余香,财务自由明日实现。 

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

VLM系列文章1-LLaVA

作为VLM系列的第一篇文章&#xff0c;打算以LLaVA入手&#xff0c;毕竟是VLM领域较为经典的工作。 1. 核心贡献 多模态指令跟随数据&#xff1a;包括PT、SFT数据的构造流程&#xff1b;大型多模态模型&#xff1a;一种新的框架&#xff0c;结构较为简单高效&#xff1b;评估数…

深入了解 GPT-4 和 ChatGPT 的 API---使用 OpenAI Python 库

文章目录 OpenAI 访问权限和 API 密钥Hello World 示例程序使用 GPT-4 和 ChatGPTChatCompletion 端点的输入选项ChatCompletion 端点的输出格式 OpenAI 将 GPT-4 和 ChatGPT 作为服务提供。这意味着用户无法直接访问模型代码&#xff0c;也无法在自己的服务器上运行这些模型。…

牛客周赛 Round 48 解题报告 | 珂学家

前言 题解 这场感觉有点难&#xff0c;D完全没思路, EF很典&#xff0c;能够学到知识. E我的思路是容斥贡献&#xff0c;F很典&#xff0c;上周考过一次&#xff0c;引入虚拟节点质数(有点像种类并查集类似的技巧). 欢迎关注 珂朵莉 牛客周赛专栏 珂朵莉 牛客小白月赛专栏 …

【第十八课】区域经济分析——探索性空间数据分析软件实操

一、前言 ArcGIS有专门处理探索性空间数据分析方法的工具,即地统计分析模块。 该模块主要由三个功能模块组成:探索性数据分析(Explore)、地统计分析向导(Geostatistical Wizard),以及生成数据子集(Create Subsets)。其中利用 这些基本功能模块,可以方便完成多种地统…

Thinkphp/Laravel高校竞赛管理系统的设计与实现_9pi7u

高校竞赛管理&#xff0c;其工作流程繁杂、多样、管理复杂与设备维护繁琐。而计算机已完全能够胜任高校竞赛管理工作&#xff0c;而且更加准确、方便、快捷、高效、清晰、透明&#xff0c;它完全可以克服以上所述的不足之处。这将给查询信息和管理带来很大的方便&#xff0c;从…

【Qt】Qt多线程编程指南:提升应用性能与用户体验

文章目录 前言1. Qt 多线程概述2. QThread 常用 API3. 使用线程4. 多线的使用场景5. 线程安全问题5.1. 加锁5.2. QReadWriteLocker、QReadLocker、QWriteLocker 6. 条件变量 与 信号量6.1. 条件变量6.2 信号量 总结 前言 在现代软件开发中&#xff0c;多线程编程已成为一个不可…

数字图像分析(第三部分)

文章目录 第11章 基于概率图模型的图像分析概率有向图模型因子分解生成式模型链式图条件独立性有向图模型的马尔科夫毯概率无向图模型模型定义概率无向图模型的因子分解条件随机场条件随机场的定义条件随机场的预测算法第12章 运动分析运动相机建模光流运动表达方法运动估计准则…

AI软件革新文本操作体验:从自动粘贴文本到一键提取保存手机号码

在当今数字化时代&#xff0c;AI技术的快速发展为各行各业带来了革命性的变革。特别是在文本处理领域&#xff0c;AI软件通过其强大的自动粘贴文本功能以及一键提取并保存手机号码的便捷操作&#xff0c;极大地提高了工作效率&#xff0c;为用户带来了全新的体验。本文将深入探…

CSS 文本输入框右下角的尺寸控件(三斜线:-webkit-resizer)消除,以及如何配置其样式,添加 resize 让标签元素可进行拖拽放大。

前言&#xff1a;在日常的前端开发中&#xff0c;不管是原始的和 还在在各类组件库中的文本输入框中&#xff0c;元素内容的右下角总是有一个三斜线的样式&#xff0c;本文简单了解它是什么&#xff1f;如何去控制并修改样式&#xff1f; 一、它是&#xff1f; 这三个斜线其实…

v0.9.6 开源跨平台个人知识管理工具 TidGi-Desktop

在这个信息爆炸的时代&#xff0c;知识管理变得尤为重要。太记(TidGi)&#xff0c;一款基于太微(TiddlyWiki)的知识管理桌面应用&#xff0c;正是为了满足人们对信息整理、知识管理和个人隐私保护的需求而设计的。它不仅能够帮助用户高效地管理和整理信息&#xff0c;还能够自动…

简化部署流程——无线UWB如何实现自标定?

一.什么是UWB信标自标定&#xff1f; UWB&#xff08;超宽带&#xff09;自标定是指在UWB系统中&#xff0c;基站或节点能够自动识别和确定自己的位置&#xff0c;无需外部干预或手动输入其地理位置信息。这种技术主要利用系统内部的信号测量和算法来自动计算节点之间的距离以…

使用PEFT库进行ChatGLM3-6B模型的LORA高效微调

PEFT库进行ChatGLM3-6B模型LORA高效微调 LORA微调ChatGLM3-6B模型安装相关库使用ChatGLM3-6B模型GPU显存占用准备数据集加载模型加载数据集数据处理数据集处理配置LoRA配置训练超参数开始训练保存LoRA模型模型推理从新加载合并模型使用微调后的模型 LORA微调ChatGLM3-6B模型 本…

【vue】vue响应式原理

vue响应式原理 vue2的响应式原理 vue2对对象类型的监听是通过Object.defineProperty实现的&#xff0c;给想要实现响应式的数据对象每个属性加上get,set方法&#xff0c;以实现数据劫持的操作。而对数组类型的监听是通过重写数组的方法实现的。 Object.defineProperty的定义…

组合数学、圆排列、离散数学多重集合笔记

自用 如果能帮到您&#xff0c;那也值得高兴 知识点 离散数学经典题目 多重集合组合 补充容斥原理公式 隔板法题目 全排列题目&#xff1a;

机械拆装-基于Unity-准备零件

目录 前言 1. 装配体模型的准备&#xff08;STEP格式保存为零件&#xff09; 1.1 关于不停提示“默认模板无效” 1.2 关于无法保存单个零件的解决 2. 整理装配体与零件 2.1 零件命名规则 2.2 建立子装配体 3. 装配体和零件转换格式 3.1 3DMax单位设置 3.2 装配体转换 3.3…

JavaScript通用下载方法,但jpg图片下载打不开

通用下载方法&#xff0c;通过Blob的方式&#xff0c;访问Url地址&#xff0c;下载对应的图片&#xff0c;excel等文件。 axios({method: "get",url,responseType: "blob",}).then((res: any) > {const link document.createElement("a");co…

Linux - 札记 - W10: Warning: Changing a readonly file

Linux - 札记 - W10: Warning: Changing a readonly file 这里写目录标题 一、问题描述1. 现象2. 原因 二、解决方案 一、问题描述 1. 现象 在使用 vim 编辑文件时&#xff08;我这里是要编辑 /root/.ssh/authorized_keys&#xff09;提示&#xff1a;W10: Warning: Changing…

VOC格式转YOLO格式,xml文件转txt文件简单通用代码

目录 前言 思路介绍 代码 完整代码 拓展代码 前言 很多人在进行目标检测训练时习惯将得到的数据标注为XML文件的VOC格式&#xff0c;或者在网上获取的数据集被标注为XML文件&#xff0c;但是不同的标注工具进行的标注会产生不同的标注xml文件&#xff0c;这里我写了一种通用…

信息学奥赛初赛天天练-36-CSP-J2021阅读程序-ASCII、运算符优先级、二进制补码存储、模拟算法应用

PDF文档公众号回复关键字:20240626 2021 CSP-J 阅读程序2 1 阅读程序(判断题1.5分 选择题3分 共计40分 ) #include<stdio.h> #include<string.h>char base[64]; char table[256]; char str[256]; char ans[256];void init() {for(int i0;i<26;i) base[i]Ai;fo…

49、基于归一化感知器的输入向量分类(matlab)

1、基于归一化感知器的输入向量分类的原理及流程 归一化感知器是一种分类算法&#xff0c;其原理基于感知器算法&#xff0c;但是在输入向量上进行了归一化处理&#xff0c;以提高算法的性能和稳定性。 流程如下&#xff1a; 输入向量归一化&#xff1a;对每个输入向量进行归…