|
@@ -1,275 +0,0 @@
|
|
|
-@namespace XF.Common.Pages.SiteConfig
|
|
|
-@page "/SiteConfig"
|
|
|
-@using AntDesign;
|
|
|
-@using Microsoft.AspNetCore.Components;
|
|
|
-@using Microsoft.AspNetCore.Components.Authorization;
|
|
|
-@using XF.Common.Core.VM;
|
|
|
-@using XF.Common.Core.Server;
|
|
|
-@using System.ComponentModel.DataAnnotations;
|
|
|
-@using System.ComponentModel
|
|
|
-@using System.Reflection
|
|
|
-@using System.Text.Json
|
|
|
-<PageContainer Title="云端站点开通12">
|
|
|
- <ChildContent>
|
|
|
- <Form Layout="@model.Layout"
|
|
|
- LabelCol="GetFormLabelCol()"
|
|
|
- WrapperCol="GetFormWrapperCol()"
|
|
|
- Model="@model"
|
|
|
- OnFinish="OnFinish"
|
|
|
- OnFinishFailed="OnFinishFailed">
|
|
|
- <FormItem Label="Form Layout">
|
|
|
- <RadioGroup @bind-Value="@context.Layout">
|
|
|
- <Radio RadioButton Value="@FormLayout.Horizontal">Horizontal</Radio>
|
|
|
- <Radio RadioButton Value="@FormLayout.Vertical">Vertical</Radio>
|
|
|
- <Radio RadioButton Value="@FormLayout.Inline">Inline</Radio>
|
|
|
- </RadioGroup>
|
|
|
- </FormItem>
|
|
|
-
|
|
|
- <FormItem Label="Field A">
|
|
|
- <Input @bind-Value="@context.FieldA" />
|
|
|
- </FormItem>
|
|
|
-
|
|
|
- <FormItem Label="Field B">
|
|
|
- <Input @bind-Value="@context.FieldB" />
|
|
|
- </FormItem>
|
|
|
-
|
|
|
- <FormItem WrapperCol="GetButtonItemLayout()">
|
|
|
- <Button Type="@ButtonType.Primary" HtmlType="submit">
|
|
|
- Submit
|
|
|
- </Button>
|
|
|
- </FormItem>
|
|
|
- </Form>
|
|
|
- @code
|
|
|
- {
|
|
|
- public class Model
|
|
|
- {
|
|
|
- public string Layout { get; set; } = FormLayout.Horizontal;
|
|
|
- public string FieldA { get; set; }
|
|
|
- public string FieldB { get; set; }
|
|
|
- }
|
|
|
-
|
|
|
- [Inject] ISiteServer server { get; set; }
|
|
|
-
|
|
|
-
|
|
|
- protected override Task OnInitializedAsync()
|
|
|
- {
|
|
|
- GetButtonItemLayout();
|
|
|
- return base.OnInitializedAsync();
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private Model model = new Model();
|
|
|
-
|
|
|
- private ColLayoutParam GetFormLabelCol()
|
|
|
- {
|
|
|
- return model.Layout == FormLayout.Horizontal ? new ColLayoutParam { Span = "4" } : null;
|
|
|
- }
|
|
|
-
|
|
|
- private ColLayoutParam GetFormWrapperCol()
|
|
|
- {
|
|
|
- return model.Layout == FormLayout.Horizontal ? new ColLayoutParam { Span = "14" } : null;
|
|
|
- }
|
|
|
-
|
|
|
- private ColLayoutParam GetButtonItemLayout()
|
|
|
- {
|
|
|
- return model.Layout == FormLayout.Horizontal ? new ColLayoutParam { Span = "14", Offset = "4" } : null;
|
|
|
- }
|
|
|
-
|
|
|
- private void OnFinish(EditContext editContext)
|
|
|
- {
|
|
|
- Console.WriteLine($"Success:{JsonSerializer.Serialize(model)}");
|
|
|
- }
|
|
|
-
|
|
|
- private void OnFinishFailed(EditContext editContext)
|
|
|
- {
|
|
|
- Console.WriteLine($"Failed:{JsonSerializer.Serialize(model)}");
|
|
|
- }
|
|
|
- }
|
|
|
- </ChildContent>
|
|
|
-</PageContainer>
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-@* <PageContainer Title="云端站点开通">
|
|
|
- <ChildContent>
|
|
|
- <div>
|
|
|
- <Form @ref="_form" Model="formData" Name="advanced_search" Class="ant-advanced-search-form">
|
|
|
- <Row Gutter="24">
|
|
|
- <GridCol Span="12">
|
|
|
- <FormItem Label="集团名称" )">
|
|
|
- <Input @bind-Value="@ParentName" Placeholder="placeholder" />
|
|
|
- </FormItem>
|
|
|
- </GridCol>
|
|
|
- <GridCol Span="12">
|
|
|
- <FormItem Label="油站名称" )">
|
|
|
- <Input @bind-Value="@SiteName" Placeholder="placeholder" />
|
|
|
- </FormItem>
|
|
|
- </GridCol>
|
|
|
- </Row>
|
|
|
-
|
|
|
- <Row Gutter="24">
|
|
|
- <GridCol Span="12">
|
|
|
- <label>油品运营</label>
|
|
|
- <Checkbox Label="#0" @bind-Checked="pro_0"></Checkbox>
|
|
|
- <Checkbox Label="#92" @bind-Checked="pro_92"></Checkbox>
|
|
|
- <Checkbox Label="#95" @bind-Checked="pro_95"></Checkbox>
|
|
|
- <Checkbox Label="#98" @bind-Checked="pro_98"></Checkbox>
|
|
|
-
|
|
|
- <Checkbox Label="基础商品数据" @bind-Checked="pro_main"></Checkbox>
|
|
|
- </GridCol>
|
|
|
- <GridCol Span="12">
|
|
|
- <FormItem Label="油站名称" )">
|
|
|
- <Input @bind-Value="@SiteName" Placeholder="placeholder" />
|
|
|
- </FormItem>
|
|
|
- </GridCol>
|
|
|
- </Row>
|
|
|
- <Row>
|
|
|
- <GridCol Span="24" Style="text-align:right;">
|
|
|
- <Button Type="primary" HtmlType="submit">Search</Button>
|
|
|
- <Button Style="margin: 0 8px;" OnClick="()=>{_form?.Reset();}">Clear</Button>
|
|
|
- <a style="font-size:12px" @onclick="()=>{_expand=!_expand;}">
|
|
|
- <Icon Type="@(_expand?"up":"down")"></Icon> Collapse
|
|
|
- </a>
|
|
|
- </GridCol>
|
|
|
- </Row>
|
|
|
- </Form>
|
|
|
- <div class="search-result-list">Search Result List</div>
|
|
|
- </div>
|
|
|
-
|
|
|
- <style>
|
|
|
- [data-theme='compact'] .ant-advanced-search-form,
|
|
|
- .ant-advanced-search-form {
|
|
|
- padding: 24px;
|
|
|
- background: #fbfbfb;
|
|
|
- border: 1px solid #d9d9d9;
|
|
|
- border-radius: 2px;
|
|
|
- }
|
|
|
-
|
|
|
- [data-theme='compact'] .ant-advanced-search-form .ant-form-item,
|
|
|
- .ant-advanced-search-form .ant-form-item {
|
|
|
- display: flex;
|
|
|
- }
|
|
|
-
|
|
|
- [data-theme='compact'] .ant-advanced-search-form .ant-form-item-control-wrapper,
|
|
|
- .ant-advanced-search-form .ant-form-item-control-wrapper {
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
- </style>
|
|
|
- </ChildContent>
|
|
|
-</PageContainer>
|
|
|
- *@
|
|
|
-
|
|
|
-@code {
|
|
|
- bool _expand = false;
|
|
|
- //AntDesign.Internal.IForm _form;
|
|
|
-
|
|
|
- Dictionary<string, FormValue> formData = new();
|
|
|
-
|
|
|
- bool pro_0 = true;
|
|
|
- bool pro_92 = true;
|
|
|
- bool pro_95 = true;
|
|
|
- bool pro_98 = true;
|
|
|
- bool pro_main = true;
|
|
|
-
|
|
|
-
|
|
|
- //[Inject] ISiteServer server { get; set; };
|
|
|
-
|
|
|
- //商品基础对象
|
|
|
- Dictionary<string, bool> checkProducts = new();
|
|
|
-
|
|
|
- //初始化油品数据
|
|
|
- void InitProduct()
|
|
|
- {
|
|
|
-
|
|
|
- // checkProducts.Add("#0",true);
|
|
|
- // checkProducts.Add("#92", true);
|
|
|
- // checkProducts.Add("#95", true);
|
|
|
-
|
|
|
- // checkProducts.Add("#98", true);
|
|
|
-
|
|
|
- // checkProducts.Add("基础商品数据", true);
|
|
|
- }
|
|
|
-
|
|
|
- class FormValue
|
|
|
- {
|
|
|
- public string Value { get; set; }
|
|
|
- }
|
|
|
-
|
|
|
- int current;
|
|
|
-
|
|
|
- void onChange(int current)
|
|
|
- {
|
|
|
- this.current = current;
|
|
|
- }
|
|
|
-
|
|
|
- public class Model1
|
|
|
- {
|
|
|
- /// <summary>
|
|
|
- /// 集团名称
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("集团名称")]
|
|
|
- public string ParentName { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 油站名称
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("油站名称")]
|
|
|
- public string SiteName { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 短信数量
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("短信数量")]
|
|
|
- public int MessageCount { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 短信通知
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("短信通知")]
|
|
|
- public bool Message { get; set; }
|
|
|
-
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 油品列表
|
|
|
- /// </summary>
|
|
|
- ///[Required, DisplayName("油品列表")]
|
|
|
- //public IEnumerable<Product> Products { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 基础数据
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("基础商品数据")]
|
|
|
- public bool BaseProduct { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 账户
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("账户")]
|
|
|
- public string Account { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 密码
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("密码")]
|
|
|
- [DataType(DataType.Password)]
|
|
|
- public string Pwd { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 联系电话
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("联系电话")]
|
|
|
- public string Phone { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 地址
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("地址")]
|
|
|
- public string Address { get; set; }
|
|
|
-
|
|
|
- /// <summary>
|
|
|
- /// 坐标
|
|
|
- /// </summary>
|
|
|
- [Required, DisplayName("坐标")]
|
|
|
- public string Coord { get; set; }
|
|
|
- }
|
|
|
-}
|