Browse Source

添加云端站点配置页面

devin.zhu@doverfs.com 1 year ago
parent
commit
e9a9fc3752

+ 219 - 0
src/XF.Common.Api/Pages/GasStation/Index.razor

@@ -0,0 +1,219 @@
+@namespace XF.Common.Pages.GasStation
+@page "/gasStaion"
+@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
+@using XF.Common.Server.Core.VM.GasStation
+
+
+<PageContainer Title="云端站点开通">
+    <ChildContent>
+        <Card>
+            <Form Model="@model"
+                  Layout="vertical"
+                  ValidateMode=@FormValidateMode.Complex
+                  RequiredMark=@ChosenRequiredMark>
+                <Row>
+                    <GridCol Span="8">
+                        <FormItem Label="集团名称" Required>
+                            <Input @bind-Value="@context.ParentName" />
+                        </FormItem>
+                    </GridCol>
+                    <GridCol Span="2">
+                    </GridCol>
+                    <GridCol Span="8">
+                        <FormItem Label="油站名称" Required>
+                            <Input @bind-Value="@context.SiteName" />
+                        </FormItem>
+                    </GridCol>
+                </Row>
+                <Row Gutter="24">
+
+                    <GridCol Span="2">
+                        <label>油品运营</label>
+                    </GridCol>
+
+                    <GridCol Span="12">
+                        <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="@context.BaseProduct"></Checkbox>
+                    </GridCol>
+                    <GridCol Span="8">
+                    </GridCol>
+                </Row>
+
+                <Row Gutter="24" Style="margin-top:20px;">
+
+                    <GridCol Span="2">
+                        <label>短信通知</label>
+                    </GridCol>
+
+                    <GridCol Span="8">
+                        <Row>
+                            <Checkbox Label="" @bind-Checked="@context.Message"></Checkbox>
+                            <GridCol Span="2">     </GridCol>
+                            <GridCol Span="6">
+                                <Input @bind-Value="@context.MessageCount" Type="number" Placeholder="短信数量" />
+                            </GridCol>
+                        </Row>
+
+                    </GridCol>
+                    <GridCol Span="8">
+                        <Checkbox Label="小程序" @bind-Checked="wx"></Checkbox>
+                        <Checkbox Label="创建FCC连接账户" @bind-Checked="fccAccount"></Checkbox>
+                    </GridCol>
+                </Row>
+                <Row Style="margin-top:20px;">
+                    <GridCol Span="8">
+                        <FormItem Label="联系电话" Required>
+                            <Input @bind-Value="@context.Phone" />
+                        </FormItem>
+                    </GridCol>
+                    <GridCol Span="2">
+                    </GridCol>
+                    <GridCol Span="8">
+                        <FormItem Label="地址" Required>
+                            <Input @bind-Value="@context.Address" />
+                        </FormItem>
+                    </GridCol>
+                </Row>
+
+                <Row>
+                    <GridCol Span="8">
+                        <FormItem Label="管理员账户" Required>
+                            <Input @bind-Value="@context.Account" />
+                        </FormItem>
+                    </GridCol>
+                    <GridCol Span="2">
+                    </GridCol>
+                    <GridCol Span="8">
+                        <FormItem Label="密码" Required>
+                            <Input @bind-Value="@context.Pwd" Type="password" />
+                        </FormItem>
+                    </GridCol>
+                </Row>
+
+                <Row>
+                    <GridCol Span="8">
+                        <FormItem Label="经度" Required>
+                            <Input @bind-Value="@context.ParentName" />
+                        </FormItem>
+                    </GridCol>
+                    <GridCol Span="2">
+                    </GridCol>
+                    <GridCol Span="8">
+                        <FormItem Label="维度" Required>
+                            <Input @bind-Value="@context.SiteName" />
+                        </FormItem>
+                    </GridCol>
+                </Row>
+                <Row><GridCol Span="4"></GridCol>  <GridCol Span="4"><Button Size="@_size" Type="primary" Disabled="save_load" Style="width:260px;" Loading="@save_load"  OnClick="Save">生成新站</Button></GridCol><GridCol Span="2"></GridCol> <GridCol Span="4"><Button Size="@_size" Type="primary" Style="width:260px;">配置FCC</Button></GridCol></Row>
+            </Form>
+        </Card>
+    </ChildContent>
+</PageContainer>
+
+<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>
+
+
+
+ @code
+ {
+    bool save_load = false;
+    public FormRequiredMark ChosenRequiredMark { get; set; } = FormRequiredMark.Required;
+    string _size = ButtonSize.Large;
+    bool _expand = false;
+    bool pro_0 = true;
+    bool pro_92 = true;
+    bool pro_95 = true;
+    bool pro_98 = true;
+    bool pro_main = true;
+    bool wx = true;
+    bool fccAccount = true;
+
+    //注入需要调用后端的业务方法
+    [Inject] ISiteServer server { get; set; }
+
+    //商品基础对象
+    Dictionary<string, bool> checkProducts = new();
+
+    private SiteSaveVm model = new SiteSaveVm()
+        {
+            BaseProduct = true
+        };
+
+
+    /// <summary>
+    /// 获取页面Check box 选中赋值
+    /// </summary>
+    public void SetcheckBox(SiteSaveVm model)
+    {
+        model.CheckBox = new List<string>();
+        if (pro_0)
+        {
+            model.CheckBox.Add("#0");
+        }
+        if (pro_92)
+        {
+            model.CheckBox.Add("#92");
+        }
+        if (pro_95)
+        {
+            model.CheckBox.Add("#95");
+        }
+        if (pro_98)
+        {
+            model.CheckBox.Add("#98");
+        }
+        if (pro_main)
+        {
+            model.CheckBox.Add("pro_main");
+        }
+        if (wx)
+        {
+            model.CheckBox.Add("pro_wx");
+        }
+        if (fccAccount)
+        {
+            model.CheckBox.Add("pro_fcc");
+        }
+    }
+
+    /// <summary>
+    /// 站点新增保存
+    /// </summary>
+    public void Save()
+    {
+       save_load = true;
+       SetcheckBox(model);
+       server.SaveSite(model);
+       save_load = false;
+    }
+}
+

+ 168 - 53
src/XF.Common.Api/Pages/SiteConfig/Index.razor

@@ -1,74 +1,189 @@
 @namespace XF.Common.Pages.SiteConfig
-@page "/SiteConfig/index"
+@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
 
-<div>
-    <Form @ref="_form" Model="formData" Name="advanced_search" Class="ant-advanced-search-form">
-        <Row Gutter="24">
-            @for (var i = 0; i < (_expand ? 10 : 6); i++)
-            {
-                var index = i;
-                <GridCol Span="8" @key="index">
-                    <FormItem Label="@($"Field {index}")">
-                        <Input @bind-Value="@(context[$"field-{index}"].Value)" 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;
-        }
+<PageContainer Title="云端站点开通">
+    <ChildContent>
+        <div>
+            <Form Model="@model" Name="advanced_search" Class="ant-advanced-search-form">
+                <Row Gutter="24">
+                    <GridCol Span="12">
+                        <FormItem Label="集团名称" )">
+                            <Input @bind-Value="@context.ParentName" Placeholder="placeholder" />
+                        </FormItem>
+                    </GridCol>
+                    <GridCol Span="12">
+                        <FormItem Label="油站名称" )">
+                            <Input @bind-Value="@context.SiteName" Placeholder="placeholder" />
+                        </FormItem>
+                    </GridCol>
+                </Row>
 
-        [data-theme='compact'] .ant-advanced-search-form .ant-form-item-control-wrapper,
-        .ant-advanced-search-form .ant-form-item-control-wrapper {
-            flex: 1;
-        }
-</style>
+                <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="@context.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="">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; }
 
-    protected override void OnInitialized()
-    {
-        base.OnInitialized();
+    //商品基础对象
+    Dictionary<string, bool> checkProducts = new();
+    private Model model = new Model();
 
-        for (var i = 0; i < 10; i++)
-        {
-            formData.Add($"field-{i}", new FormValue());
-        }
+    //初始化油品数据
+    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 Model
+    {
+        /// <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; }
+    }
+}

+ 0 - 275
src/XF.Common.Api/Pages/SiteConfig/SiteConfigPage.razor

@@ -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; }
-    }
-}

+ 0 - 16
src/XF.Common.Api/Pages/SiteConfig/SiteConfigPage.razor.css

@@ -1,16 +0,0 @@
-/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */
-/* stylelint-disable no-duplicate-selectors */
-/* stylelint-disable */
-/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
-.title__b__1 {
-  position: relative;
-  color: rgba(0, 0, 0, 0.85);
-  font-size: 12px;
-  text-align: center;
-}
-.head-title {
-  margin-bottom: 20px;
-  color: rgba(0, 0, 0, 0.85);
-  font-weight: 500px;
-  font-size: 16px;
-}

+ 20 - 3
src/XF.Common.Api/Server/Core/Server/ISiteServer.cs

@@ -1,4 +1,6 @@
-namespace XF.Common.Core.Server
+using XF.Common.Server.Core.VM.GasStation;
+
+namespace XF.Common.Core.Server
 {
     /// <summary>
     /// 配置站点服务
@@ -9,13 +11,28 @@
         /// 保存新站点
         /// </summary>
         /// <returns></returns>
-        Task<bool> SaveSite();
+        Task<bool> SaveSite(SiteSaveVm Model);
+
+        /// <summary>
+        /// GetStieByParBuid
+        /// </summary>
+        /// <param name="parBuid">ParBuid</param>
+        /// <returns></returns>
+        Task<IEnumerable<SiteListVm>> GetStieByParBuid(string parBuid);
+
+
+        /// <summary>
+        /// GetStieByBuid
+        /// </summary>
+        /// <param name="buid">buid</param>
+        /// <returns></returns>
+        Task<IEnumerable<SiteListVm>> GetStie(string buid);
 
         /// <summary>
         /// 测试数据库连接
         /// </summary>
         /// <returns></returns>
-        Task<object> GetParentBUData();
+        Task<IEnumerable<SiteListVm>> GetParentBUData();
     }
 
     

+ 23 - 0
src/XF.Common.Api/Server/Core/VM/GasStation/SiteListVm.cs

@@ -0,0 +1,23 @@
+namespace XF.Common.Server.Core.VM.GasStation
+{
+    /// <summary>
+    /// 站点列表
+    /// </summary>
+    public class SiteListVm
+    {
+        /// <summary>
+        /// 父集站点
+        /// </summary>
+        public Guid ParBuid { get; set; }
+
+        /// <summary>
+        /// buid
+        /// </summary>
+        public Guid Buid { get; set; }
+
+        /// <summary>
+        /// 站点名称
+        /// </summary>
+        public string Name { get; set; }
+    }
+}

+ 84 - 0
src/XF.Common.Api/Server/Core/VM/GasStation/SiteSaveVm.cs

@@ -0,0 +1,84 @@
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel;
+
+namespace XF.Common.Server.Core.VM.GasStation
+{
+
+
+    public class SiteSaveVm
+    {
+        /// <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; }
+
+        public List<string> CheckBox { get; set; }
+
+
+
+    }
+
+}

+ 40 - 5
src/XF.Common.Api/Server/Services/SiteServer.cs

@@ -1,7 +1,10 @@
-using XF.Common.Core;
+using System;
+using XF.Common.Core;
 using XF.Common.Core.Server;
+using XF.Common.Map;
 using XF.Common.Repositories;
 using XF.Common.Server.Core.Repositories;
+using XF.Common.Server.Core.VM.GasStation;
 using ServiceLifetime = XF.Common.Core.ServiceLifetime;
 
 namespace XF.Common.Server
@@ -23,15 +26,47 @@ namespace XF.Common.Server
         /// 获取父级BU参数
         /// </summary>
         /// <returns></returns>
-        public async Task<object> GetParentBUData()
+        public async Task<IEnumerable<SiteListVm>> GetParentBUData()
         {
            var list=await _businessUnitInfoReponse.GetListAsync(k=>string.IsNullOrWhiteSpace(k.parent_bu_id));
-            return list;
+            return list.ToDTOList<SiteListVm>();
+          
         }
 
-        public Task<bool> SaveSite()
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="buid"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public async Task<IEnumerable<SiteListVm>> GetStie(string buid)
+        {
+            var list = await _businessUnitInfoReponse.GetListAsync(k =>k.business_unit_info_id==buid);
+            return list.ToDTOList<SiteListVm>();
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="parBuid"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public async Task<IEnumerable<SiteListVm>> GetStieByParBuid(string parBuid)
+        {
+            var list = await _businessUnitInfoReponse.GetListAsync(k => k.parent_bu_id == parBuid);
+            return list.ToDTOList<SiteListVm>();
+        }
+
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="Model"></param>
+        /// <returns></returns>
+        /// <exception cref="NotImplementedException"></exception>
+        public async Task<bool> SaveSite(SiteSaveVm Model)
         {
-            throw new NotImplementedException();
+            return true;
         }
     }
 }

+ 3 - 3
src/XF.Common.Api/wwwroot/data/menu.json

@@ -6,14 +6,14 @@
     "icon": "setting"
   },
   {
-    "path": "/siteConfig",
+    "path": "/GasStation",
     "name": "快速建站配置",
     "key": "SiteConfig",
     "icon": "windows",
     "children": [
       {
-        "path": "/siteConfig",
-        "name": "云端站点开通",
+        "path": "/GasStaion",
+        "name": "加油站开通",
         "key": "SiteConfig.Cloud"
       },
       {