Administrator 1 жил өмнө
parent
commit
c15b8ca61d

+ 4 - 24
router/ARKConfigRouter.go

@@ -141,12 +141,7 @@ func UpdateGroup(c *gin.Context) {
 
 // DeleteGroup 修改VIP
 func DeleteGroup(c *gin.Context) {
-	param := util.GetJsonAnyParam(c)
-	name, err := param("groupName")
-	if err != nil {
-		c.JSON(200, CreateResultError(400, "参数错误"))
-		return
-	}
+	name := c.Query("groupName")
 
 	if cast.ToString(name) == "" {
 		c.JSON(200, CreateResultError(400, "VIP名称不能为空"))
@@ -210,12 +205,7 @@ func UpdateKit(c *gin.Context) {
 	c.JSON(200, CreateResultError(400, "礼包不存在"))
 }
 func DeleteKit(c *gin.Context) {
-	param := util.GetJsonAnyParam(c)
-	name, err := param("kitName")
-	if err != nil {
-		c.JSON(200, CreateResultError(400, "参数错误"))
-		return
-	}
+	name := c.Query("kitName")
 
 	if cast.ToString(name) == "" {
 		c.JSON(200, CreateResultError(400, "礼包名称不能为空"))
@@ -417,12 +407,7 @@ func UpdateShopItem(c *gin.Context) {
 }
 
 func DeleteShopItem(c *gin.Context) {
-	param := util.GetJsonAnyParam(c)
-	name, err := param("shopItemName")
-	if err != nil {
-		c.JSON(200, CreateResultError(400, "参数错误"))
-		return
-	}
+	name := c.Query("shopItemName")
 	if cast.ToString(name) == "" {
 		c.JSON(200, CreateResultError(400, "商店名不能为空"))
 		return
@@ -500,12 +485,7 @@ func UpdateSellItem(c *gin.Context) {
 }
 
 func DeleteSellItem(c *gin.Context) {
-	param := util.GetJsonAnyParam(c)
-	name, err := param("sellItemName")
-	if err != nil {
-		c.JSON(http.StatusBadRequest, CreateResultError(400, "参数错误"))
-		return
-	}
+	name := c.Query("sellItemName")
 	if cast.ToString(name) == "" {
 		c.JSON(http.StatusBadRequest, CreateResultError(400, "商品描述不能为空"))
 		return

+ 33 - 7
ui/src/api/ARKShopItemAPI.ts

@@ -1,5 +1,5 @@
 import {Item} from "./ConfigFile.ts";
-import {GetDataByPath, PutDataByPath, ResponseData} from "./api.ts";
+import {DeleteDataByPath, GetDataByPath, PutDataByPath, ResponseData} from "./api.ts";
 
 export class ShopData {
     Description: string
@@ -16,6 +16,10 @@ export class ShopData {
 export class ShopItem extends ShopData {
     Items: Item[]
 
+    static Create(): ShopItem {
+        return new ShopItem("", 0, "item", []);
+    }
+
     constructor(Type: string, Description: string, Price: number, Items: Item[]) {
         super(Description, Price, Type);
         this.Items = Items;
@@ -31,6 +35,10 @@ export class ShopDino extends ShopData {
     SaddleBlueprint: string
     Blueprint: string
 
+    static Create(): ShopDino {
+        return new ShopDino("", 0, "dino", 0, 0, 0, false, "", "", "");
+    }
+
     constructor(Description: string, Price: number, Type: string, Level: number, MinLevel: number, MaxLevel: number, Neutered: boolean, Gender: string, SaddleBlueprint: string, Blueprint: string) {
         super(Description, Price, Type);
         this.Level = Level;
@@ -46,6 +54,9 @@ export class ShopDino extends ShopData {
 export class ShopBeacon extends ShopData {
     ClassName: string
 
+    static Create(): ShopBeacon {
+        return new ShopBeacon("", 0, "beacon", "");
+    }
     constructor(Description: string, Price: number, Type: string, ClassName: string) {
         super(Description, Price, Type);
         this.ClassName = ClassName;
@@ -57,6 +68,9 @@ export class ShopBeacon extends ShopData {
 export class ShopExperience extends ShopData {
     Amount: number
     GiveToDino: boolean
+    static Create(): ShopExperience {
+        return new ShopExperience("", 0, "experience", 0, false);
+    }
 
     constructor(Description: string, Price: number, Type: string, Amount: number, GiveToDino: boolean) {
         super(Description, Price, Type);
@@ -68,6 +82,9 @@ export class ShopExperience extends ShopData {
 //ShopUnlockengram
 export class ShopUnlockengram extends ShopData {
     Items: ShopUnlockengramItem[]
+    static Create(): ShopUnlockengram {
+        return new ShopUnlockengram("", 0, "unlockengram", []);
+    }
 
     constructor(Description: string, Price: number, Type: string, Items: ShopUnlockengramItem[]) {
         super(Description, Price, Type);
@@ -78,6 +95,9 @@ export class ShopUnlockengram extends ShopData {
 export class ShopUnlockengramItem {
     Blueprint: string
 
+    static Create(): ShopUnlockengramItem {
+        return new ShopUnlockengramItem("");
+    }
     constructor(Blueprint: string) {
         this.Blueprint = Blueprint;
     }
@@ -86,6 +106,9 @@ export class ShopUnlockengramItem {
 export class ShopCommand extends ShopData {
     Items: ShopCommandItem[]
 
+    static Create(): ShopCommand {
+        return new ShopCommand("", 0, "command", []);
+    }
     constructor(Description: string, Price: number, Type: string, Items: ShopCommandItem[]) {
         super(Description, Price, Type);
         this.Items = Items;
@@ -103,20 +126,23 @@ export class ShopCommandItem {
 }
 
 export function GetShopItems(type: string) {
-    return GetDataByPath("/ark/shopItem?type=" + type, {}, true) as Promise<ResponseData<ShopItem[]>>;
+    return GetDataByPath("/ark/shopItem?type=" + type, {}, true) as Promise<ResponseData<ShopData[]>>;
 }
 
-export function SaveShopItem(shopItem: ShopItem) {
-    return PutDataByPath("/ark/shopItem", shopItem, true)
+export function SaveShopItem(shopItem: ShopItem, name: string, shopType: string) {
+    return PutDataByPath("/ark/shopItem",
+        {shopItem: shopItem, shopItemName: name, shopType: shopType},
+        true)
 }
 
-export function UpdateShopItem(oldShopItem: ShopItem, newShopItem: ShopItem) {
+export function UpdateShopItem(newShopItem: ShopItem, name: string, shopType: string) {
     return PutDataByPath("/ark/shopItem", {
-        oldShopItem: oldShopItem, newShopItem: newShopItem
+        newShopItem: newShopItem,
+        shopItemName: name, shopType: shopType
     }, true)
 }
 
 export function DeleteShopItem(shopItemName: string) {
-    return PutDataByPath("/ark/shopItem", {shopItemName: shopItemName}, true)
+    return DeleteDataByPath("/ark/shopItem", {shopItemName: shopItemName}, true)
 }
 

+ 125 - 1
ui/src/components/ShopBeaconComponent.vue

@@ -1,21 +1,97 @@
 <template>
+  <el-row>
+    <el-col :span="1.5">
+      <el-button plain class="el-btn-margin" type="primary"
+                 @click="OpenAddAndUpdateView('save',
+                 new BaseData<ShopBeacon>('', ShopBeacon.Create()))">
+        添加信标
+      </el-button>
+    </el-col>
+  </el-row>
+
   <el-table :data="shopItems" border stripe>
     <el-table-column prop="Name" label="商品名称"></el-table-column>
+    <el-table-column prop="data.Type" label="类型">
+      <template #default="scope">
+        {{ getTypeNameByType(scope.row.data.Type) }}
+      </template>
+    </el-table-column>
     <el-table-column prop="data.Description" label="商品描述"></el-table-column>
     <el-table-column prop="data.Price" label="商品价格"></el-table-column>
     <el-table-column prop="data.ClassName" label="类名"/>
+    <el-table-column label="操作" width="180">
+      <template #default="scope">
+        <el-button type="primary" link
+                   @click="OpenAddAndUpdateView('save',
+                   new BaseData<ShopBeacon>(scope.row.Name,scope.row.data))">
+          修改
+        </el-button>
+        <el-button type="danger" link @click="DeleteItem(scope.row.Name)">删除
+        </el-button>
+      </template>
+    </el-table-column>
   </el-table>
+
+  <el-dialog title="查看恐龙列表" v-model="openView" width="1100px">
+    <el-form :model="shopItemForm" label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="类型">
+            <el-text type="primary" label="类型">
+              {{ getTypeNameByType(shopItemForm.data.Type) }}
+            </el-text>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12"></el-col>
+        <el-col :span="8">
+          <el-form-item label="名称">
+            <el-input v-model="shopItemForm.Name" label="名称"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="价格">
+            <el-input-number v-model="shopItemForm.data.Price" label="价格"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="描述">
+            <el-input type="textarea" v-model="shopItemForm.data.Description" label="描述"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-divider/>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="等级">
+            <el-input v-model="shopItemForm.data.ClassName" label="类名"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button type="primary" @click="SubmitForm()">确 定</el-button>
+        <el-button @click="openView=false">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
 </template>
 
 <script setup lang="ts">
 
 import {ref} from "vue";
 import {BaseData} from "../api/ConfigFile";
-import {GetShopItems, ShopBeacon, ShopDino} from "../api/ARKShopItemAPI";
+import {DeleteShopItem, GetShopItems, SaveShopItem, ShopBeacon, ShopDino, UpdateShopItem} from "../api/ARKShopItemAPI";
+import {ElMessage} from "element-plus";
 
 let shopItems = ref<BaseData<ShopBeacon>[]>([])
+let shopItemForm = ref<BaseData<ShopBeacon>>(new BaseData<ShopBeacon>("", ShopBeacon.Create()))
+
+let itemStatus = ref<string>("")
+let openView = ref(false)
 
 function replay() {
+  shopItems.value = []
   GetShopItems("beacon").then(res => {
     if (res.code == 200) {
       console.log(res.data)
@@ -25,7 +101,55 @@ function replay() {
     }
   })
 }
+
 replay()
+
+
+function OpenAddAndUpdateView(status: string, item: BaseData<ShopBeacon>) {
+  openView.value = true
+  itemStatus.value = status
+  shopItemForm.value = item
+}
+
+function SubmitForm() {
+  switch (itemStatus.value) {
+    case "save":
+      SaveShopItem(shopItemForm.value.data, shopItemForm.value.Name, "beacon").then(
+          res => {
+            if (res.code == 200) {
+              ElMessage.success("保存成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+    case "update":
+      UpdateShopItem(shopItemForm.value.data, shopItemForm.value.Name, "beacon").then(res => {
+            if (res.code == 200) {
+              ElMessage.success("修改成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+  }
+  replay()
+  openView.value = false
+}
+
+function DeleteItem(itemName: string) {
+  DeleteShopItem(itemName).then(res => {
+    if (res.code == 200) {
+      ElMessage.success("删除成功")
+    } else {
+      ElMessage.error(res.message)
+    }
+  })
+  replay()
+}
+
 function getTypeNameByType(type: string): string {
   switch (type) {
     case "item":

+ 144 - 5
ui/src/components/ShopCommandsComponent.vue

@@ -1,11 +1,26 @@
 <template>
+  <el-row>
+    <el-col :span="1.5">
+      <el-button plain class="el-btn-margin" type="primary"
+                 @click="OpenAddAndUpdateView('save',
+                 new BaseData<ShopExperience>('',ShopCommand.Create()))">
+        添加信标
+      </el-button>
+    </el-col>
+  </el-row>
   <el-table :data="shopItems" border stripe>
     <el-table-column prop="Name" label="商品名称"></el-table-column>
     <el-table-column prop="data.Description" label="商品描述"></el-table-column>
     <el-table-column prop="data.Price" label="商品价格"></el-table-column>
-    <el-table-column prop="data.Items" label="命令">
+
+    <el-table-column label="操作" width="180">
       <template #default="scope">
-        <el-button type="primary" @click="OpenShow(scope.row.data.Items)">查看命令</el-button>
+        <el-button type="success" link @click="OpenShow(scope.row.data.Items)">查看物品</el-button>
+        <el-button type="primary" link @click="OpenAddAndUpdateView('save',
+                new BaseData<ShopCommand>(scope.row.Name,scope.row.data))">修改
+        </el-button>
+        <el-button type="danger" link @click="DeleteItem(scope.row.Name)">删除
+        </el-button>
       </template>
     </el-table-column>
   </el-table>
@@ -15,17 +30,91 @@
       <el-table-column prop="DisplayAs" label="显示为"></el-table-column>
     </el-table>
   </el-dialog>
+
+  <el-dialog title="添加/修改命令" v-model="openView" width="800px">
+    <el-form :model="shopItemForm" label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="类型">
+            <el-text type="primary" label="类型">
+              {{ getTypeNameByType(shopItemForm.data.Type) }}
+            </el-text>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12"></el-col>
+        <el-col :span="8">
+          <el-form-item label="名称">
+            <el-input v-model="shopItemForm.Name" label="名称"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="价格">
+            <el-input-number v-model="shopItemForm.data.Price" label="价格"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="描述">
+            <el-input type="textarea" v-model="shopItemForm.data.Description" label="描述"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-divider/>
+      <el-row>
+        <el-col :span="1.5">
+          <el-button plain class="el-btn-margin" type="primary"
+                     @click="AddItems()">
+            添加
+          </el-button>
+        </el-col>
+        <el-col :span="24">
+          <el-table :data="shopItemForm.data.Items" border stripe>
+            <el-table-column prop="Command" label="命令">
+              <template #default="scope">
+                <el-input v-model="scope.row.Command" label="命令"/>
+              </template>
+            </el-table-column>
+            <el-table-column prop="DisplayAs" label="显示为">
+              <template #default="scope">
+                <el-input v-model="scope.row.DisplayAs" label="显示为"/>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button type="primary" @click="SubmitForm()">确 定</el-button>
+        <el-button @click="openView=false">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
 </template>
 
 <script setup lang="ts">
 
 import {ref} from "vue";
 import {BaseData} from "../api/ConfigFile";
-import {GetShopItems, ShopCommand, ShopCommandItem} from "../api/ARKShopItemAPI";
+import {
+  DeleteShopItem,
+  GetShopItems,
+  SaveShopItem,
+  ShopCommand,
+  ShopCommandItem,
+  ShopExperience,
+  UpdateShopItem
+} from "../api/ARKShopItemAPI";
+import {ElMessage} from "element-plus";
 
+const type = ref("command")
 let shopItems = ref<BaseData<ShopCommand>[]>([])
 let open = ref<boolean>(false)
-let shopCommandItem = ref<ShopCommandItem[]>(null)
+let shopCommandItem = ref<ShopCommandItem[]>([])
+
+let openView = ref<boolean>(false)
+let itemStatus = ref<string>("")
+let shopItemForm = ref<BaseData<ShopCommand>>(
+    new BaseData<ShopCommand>("", ShopCommand.Create()))
 
 function OpenShow(item: ShopCommandItem[]) {
   open.value = true
@@ -34,7 +123,7 @@ function OpenShow(item: ShopCommandItem[]) {
 }
 
 function replay() {
-  GetShopItems("command").then(res => {
+  GetShopItems(type.value).then(res => {
     if (res.code == 200) {
       for (let item in res.data) {
         shopItems.value.push(new BaseData(item, res.data[item] as ShopCommand))
@@ -45,6 +134,56 @@ function replay() {
 
 replay()
 
+function OpenAddAndUpdateView(status: string, shopItem: BaseData<ShopCommand>) {
+  openView.value = true
+  itemStatus.value = status
+  console.log(shopItem)
+  shopItemForm.value = shopItem
+}
+
+function SubmitForm() {
+  switch (itemStatus.value) {
+    case "save":
+      SaveShopItem(shopItemForm.value.data, shopItemForm.value.Name, type.value).then(
+          res => {
+            if (res.code == 200) {
+              ElMessage.success("保存成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+    case "update":
+      UpdateShopItem(shopItemForm.value.data, shopItemForm.value.Name, type.value).then(res => {
+            if (res.code == 200) {
+              ElMessage.success("修改成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+  }
+  replay()
+  openView.value = false
+}
+
+function DeleteItem(itemName: string) {
+  DeleteShopItem(itemName).then(res => {
+    if (res.code == 200) {
+      ElMessage.success("删除成功")
+    } else {
+      ElMessage.error(res.message)
+    }
+  })
+  replay()
+}
+
+function AddItems() {
+  shopItemForm.value.data.Items.push(new ShopCommandItem("", ''))
+}
+
 function getTypeNameByType(type: string): string {
   switch (type) {
     case "item":

+ 160 - 2
ui/src/components/ShopDinoComponent.vue

@@ -1,4 +1,13 @@
 <template>
+  <el-row>
+    <el-col :span="1.5">
+      <el-button plain class="el-btn-margin" type="primary"
+                 @click="OpenAddAndUpdateView('save',
+                 new BaseData<ShopDino>('', ShopDino.Create()))">
+        添加恐龙
+      </el-button>
+    </el-col>
+  </el-row>
   <el-table :data="shopItems" border stripe>
     <el-table-column prop="Name" label="商品名称"></el-table-column>
     <el-table-column prop="data.Description" label="商品描述"></el-table-column>
@@ -10,18 +19,120 @@
     <el-table-column prop="data.Gender" label="性别"/>
     <el-table-column prop="data.SaddleBlueprint" label=" 鞍蓝图"/>
     <el-table-column prop="data.Blueprint" label="蓝图"/>
+    <el-table-column label="操作" width="180">
+      <template #default="scope">
+        <el-button type="primary" link
+                   @click="OpenAddAndUpdateView('save',
+                   new BaseData<ShopDino>(scope.row.Name,scope.row.data))">
+          修改
+        </el-button>
+        <el-button type="danger" link @click="DeleteItem(scope.row.Name)">删除
+        </el-button>
+      </template>
+    </el-table-column>
   </el-table>
+
+  <el-dialog title="查看恐龙列表" v-model="openView" width="1100px">
+    <el-form :model="shopDinoForm" label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="类型">
+            <el-text type="primary" label="类型">
+              {{ getTypeNameByType(shopDinoForm.data.Type) }}
+            </el-text>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12"></el-col>
+        <el-col :span="8">
+          <el-form-item label="名称">
+            <el-input v-model="shopDinoForm.Name" label="名称"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="价格">
+            <el-input-number v-model="shopDinoForm.data.Price" label="价格"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="描述">
+            <el-input type="textarea" v-model="shopDinoForm.data.Description" label="描述"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-divider/>
+      <el-row>
+        <el-col :span="8">
+          <el-form-item label="等级">
+            <el-input-number v-model="shopDinoForm.data.Level" label="等级"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="最低等级">
+            <el-input-number v-model="shopDinoForm.data.MinLevel" label="最低等级"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="最高等级">
+            <el-input-number v-model="shopDinoForm.data.MaxLevel" label="最高等级"/>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="是否被绝育">
+            <el-switch v-model="shopDinoForm.data.Neutered" label="是否被绝育"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="性别">
+            <el-select v-model="shopDinoForm.data.Gender" label="性别">
+              <el-option label="雄性" value="male"/>
+              <el-option label="雌性" value="female"/>
+              <el-option label="随机" value="random"/>
+            </el-select>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="鞍蓝图">
+            <el-input type="textarea" rows="3" v-model="shopDinoForm.data.SaddleBlueprint" label="鞍蓝图"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="蓝图">
+            <el-input type="textarea" rows="3" v-model="shopDinoForm.data.Blueprint" label="蓝图"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button type="primary" @click="SubmitForm()">确 定</el-button>
+        <el-button @click="openView=false">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
+
 </template>
 
 <script setup lang="ts">
 
 import {ref} from "vue";
 import {BaseData} from "../api/ConfigFile";
-import {GetShopItems, ShopDino} from "../api/ARKShopItemAPI";
+import {DeleteShopItem, GetShopItems, SaveShopItem, ShopDino, UpdateShopItem} from "../api/ARKShopItemAPI";
+import {ElMessage} from "element-plus";
 
 let shopItems = ref<BaseData<ShopDino>[]>([])
 
+let shopDinoForm = ref<BaseData<ShopDino>>(new BaseData<ShopDino>("", ShopDino.Create()))
+
+let itemStatus = ref<string>("")
+let openView = ref(false)
+
+
+
+
 function replay() {
+  shopItems.value = []
   GetShopItems("dino").then(res => {
     if (res.code == 200) {
       console.log(res.data)
@@ -31,7 +142,55 @@ function replay() {
     }
   })
 }
+
 replay()
+
+function OpenAddAndUpdateView(status: string, shopDino: BaseData<shopDino>) {
+  openView.value = true
+  itemStatus.value = status
+  shopDinoForm.value = shopDino
+}
+
+function SubmitForm() {
+  switch (itemStatus.value) {
+    case "save":
+      SaveShopItem(shopDinoForm.value.data, shopDinoForm.value.Name, "dino").then(
+          res => {
+            if (res.code == 200) {
+              ElMessage.success("保存成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+    case "update":
+      UpdateShopItem(shopOldItemsForm.value.data, shopDinoForm.value.Name, "dino").then(res => {
+            if (res.code == 200) {
+              ElMessage.success("修改成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+  }
+  replay()
+  openView.value = false
+}
+
+function DeleteItem(itemName: string) {
+  DeleteShopItem(itemName).then(res => {
+    if (res.code == 200) {
+      ElMessage.success("删除成功")
+    } else {
+      ElMessage.error(res.message)
+    }
+  })
+  replay()
+}
+
+
 function getTypeNameByType(type: string): string {
   switch (type) {
     case "item":
@@ -49,7 +208,6 @@ function getTypeNameByType(type: string): string {
     default:
       return ""
   }
-
 }
 
 </script>

+ 117 - 2
ui/src/components/ShopExperienceComponent.vue

@@ -1,23 +1,91 @@
 <template>
+  <el-row>
+    <el-col :span="1.5">
+      <el-button plain class="el-btn-margin" type="primary"
+                 @click="OpenAddAndUpdateView('save',
+                 new BaseData<ShopExperience>('', ShopExperience.Create()))">
+        添加信标
+      </el-button>
+    </el-col>
+  </el-row>
   <el-table :data="shopItems" border stripe>
     <el-table-column prop="Name" label="商品名称"></el-table-column>
+    <el-table-column prop="data.Type" label="类型">
+      <template #default="scope">
+        {{ getTypeNameByType(scope.row.data.Type) }}
+      </template>
+    </el-table-column>
     <el-table-column prop="data.Description" label="商品描述"></el-table-column>
     <el-table-column prop="data.Price" label="商品价格"></el-table-column>
     <el-table-column prop="data.Amount" label="数量"/>
     <el-table-column prop="data.GiveToDino" label="是否给到龙"/>
   </el-table>
+  <el-dialog title="添加/修改恐龙列表" v-model="openView" width="1100px">
+    <el-form :model="shopItemForm" label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="类型">
+            <el-text type="primary" label="类型">
+              {{ getTypeNameByType(shopItemForm.data.Type) }}
+            </el-text>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12"></el-col>
+        <el-col :span="8">
+          <el-form-item label="名称">
+            <el-input v-model="shopItemForm.Name" label="名称"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="价格">
+            <el-input-number v-model="shopItemForm.data.Price" label="价格"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="描述">
+            <el-input type="textarea" v-model="shopItemForm.data.Description" label="描述"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-divider/>
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="数量">
+            <el-input-number v-model="shopItemForm.data.Amount" label="数量"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="是否给到龙">
+            <el-switch v-model="shopItemForm.data.GiveToDino" label="是否给到龙"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button type="primary" @click="SubmitForm()">确 定</el-button>
+        <el-button @click="openView=false">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
 </template>
 
 <script setup lang="ts">
 
 import {ref} from "vue";
 import {BaseData} from "../api/ConfigFile";
-import {GetShopItems, ShopExperience} from "../api/ARKShopItemAPI";
+import {DeleteShopItem, GetShopItems, SaveShopItem, ShopExperience, UpdateShopItem} from "../api/ARKShopItemAPI";
+import {ElMessage} from "element-plus";
 
+const type = ref("experience")
 let shopItems = ref<BaseData<ShopExperience>[]>([])
+let shopItemForm = ref<BaseData<ShopExperience>>(new BaseData<ShopExperience>("", ShopExperience.Create()))
 
+let itemStatus = ref<string>("")
+let openView = ref(false)
 function replay() {
-  GetShopItems("experience").then(res => {
+  shopItems.value = []
+  GetShopItems(type.value).then(res => {
     if (res.code == 200) {
       console.log(res.data)
       for (let item in res.data) {
@@ -26,7 +94,54 @@ function replay() {
     }
   })
 }
+
 replay()
+
+function OpenAddAndUpdateView(status: string, item: BaseData<ShopExperience>) {
+  openView.value = true
+  itemStatus.value = status
+  shopItemForm.value = item
+}
+
+function SubmitForm() {
+  switch (itemStatus.value) {
+    case "save":
+      SaveShopItem(shopItemForm.value.data, shopItemForm.value.Name, type.value).then(
+          res => {
+            if (res.code == 200) {
+              ElMessage.success("保存成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+    case "update":
+      UpdateShopItem(shopItemForm.value.data, shopItemForm.value.Name, type.value).then(res => {
+            if (res.code == 200) {
+              ElMessage.success("修改成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+  }
+  replay()
+  openView.value = false
+}
+
+function DeleteItem(itemName: string) {
+  DeleteShopItem(itemName).then(res => {
+    if (res.code == 200) {
+      ElMessage.success("删除成功")
+    } else {
+      ElMessage.error(res.message)
+    }
+  })
+  replay()
+}
+
 function getTypeNameByType(type: string): string {
   switch (type) {
     case "item":

+ 172 - 6
ui/src/components/ShopItemsComponent.vue

@@ -1,11 +1,26 @@
 <template>
+  <el-row>
+    <el-col :span="1.5">
+      <el-button plain class="el-btn-margin" type="primary"
+                 @click="OpenAddAndUpdateView('save',
+                 new BaseData<ShopItem>('',ShopItem.Create()) )">
+        添加商品
+      </el-button>
+    </el-col>
+  </el-row>
   <el-table :data="shopItems" border stripe>
     <el-table-column prop="Name" label="商品名称"></el-table-column>
     <el-table-column prop="data.Description" label="商品描述"></el-table-column>
     <el-table-column prop="data.Price" label="商品价格"></el-table-column>
-    <el-table-column label="操作">
+
+    <el-table-column label="操作" width="180">
       <template #default="scope">
-        <el-button type="primary" @click="OpenShow(scope.row.data.Items)">查看物品列表</el-button>
+        <el-button type="success" link @click="OpenShow(scope.row.data.Items)">查看物品</el-button>
+        <el-button type="primary" link @click="OpenAddAndUpdateView('save',
+                new BaseData<ShopItem>(scope.row.Name,scope.row.data))">修改
+        </el-button>
+        <el-button type="danger" link @click="DeleteItem(scope.row.Name)">删除
+        </el-button>
       </template>
     </el-table-column>
   </el-table>
@@ -18,18 +33,115 @@
       <el-table-column prop="Quality" label="品质"></el-table-column>
     </el-table>
   </el-dialog>
+
+  <el-dialog title="查看物品列表" v-model="openView" width="1100px">
+    <el-form :model="shopItemsForm" label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="类型">
+            <el-text type="primary" label="类型">
+              {{ getTypeNameByType(shopItemsForm.data.Type) }}
+            </el-text>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12"></el-col>
+        <el-col :span="8">
+          <el-form-item label="名称">
+            <el-input v-model="shopItemsForm.Name" label="名称"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="价格">
+            <el-input-number v-model="shopItemsForm.data.Price" label="价格"/>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="12">
+          <el-form-item label="描述">
+            <el-input type="textarea" v-model="shopItemsForm.data.Description" label="描述"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-divider/>
+      <el-form-item label="物品列表">
+        <el-row>
+          <el-col>
+            <el-button class="el-btn-margin" type="primary" plain @click="AddItems()">添加物品</el-button>
+          </el-col>
+        </el-row>
+        <el-table :data="shopItemsForm.data.Items" border stripe>
+          <el-table-column prop="Amount" label="数量" width="175px">
+            <template #default="scope">
+              <el-input-number v-model="scope.row.Amount" label="数量"/>
+            </template>
+          </el-table-column>
+          <el-table-column prop="Fixed" label="固定" width="85px">
+            <template #default="scope">
+              <el-switch v-model="scope.row.ForceBlueprint" label="强制">
+                <template #open>
+                  是
+                </template>
+                <template #close>
+                  否
+                </template>
+              </el-switch>
+            </template>
+          </el-table-column>
+          <el-table-column prop="ForceBlueprint" label="强制" width="85px">
+            <template #default="scope">
+              <el-switch v-model="scope.row.ForceBlueprint" label="强制">
+                <template #open>
+                  是
+                </template>
+                <template #close>
+                  否
+                </template>
+              </el-switch>
+            </template>
+          </el-table-column>
+          <el-table-column prop="Quality" label="品质" width="175px">
+            <template #default="scope">
+              <el-input-number v-model="scope.row.Quality" label="品质"/>
+            </template>
+          </el-table-column>
+          <el-table-column prop="Blueprint" label="蓝图">
+            <template #default="scope">
+              <el-input v-model="scope.row.Blueprint" label="蓝图"/>
+            </template>
+          </el-table-column>
+          <el-table-column label="删除">
+            <template #default="scope">
+              <el-button @click="shopItemsForm.data.Items.splice(scope.$index, 1)" type="danger" link>删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button type="primary" @click="SubmitForm()">确 定</el-button>
+        <el-button @click="openView=false">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
 </template>
 
 <script setup lang="ts">
-import {BaseData} from "../api/ConfigFile";
-import {GetShopItems, ShopItem} from "../api/ARKShopItemAPI";
+import {BaseData, Item} from "../api/ConfigFile";
+import {DeleteShopItem, GetShopItems, SaveShopItem, ShopItem, UpdateShopItem} from "../api/ARKShopItemAPI";
 import {ref} from "vue";
+import {ElMessage} from "element-plus";
 
 let shopItems = ref<BaseData<ShopItem>[]>([])
 let open = ref<boolean>(false)
-let showItem = ref<BaseData<ShopItem>>(null)
+let showItem = ref<Item[]>([])
+//表单更新,保存新数据
+let itemStatus = ref<string>("")
+let openView = ref<boolean>(false)
+
+let shopItemsForm = ref<BaseData<ShopItem>>(new BaseData<ShopItem>("", ShopItem.Create()))
 
-function OpenShow(item: BaseData<ShopItem>) {
+function OpenShow(item: Item[]) {
   open.value = true
   showItem.value = item
 }
@@ -43,7 +155,61 @@ function replay() {
     }
   })
 }
+
 replay()
+
+function OpenAddAndUpdateView(status: string, shopItem: BaseData<ShopItem>) {
+  openView.value = true
+  itemStatus.value = status
+  if (status === "update") {
+    shopItemsForm.value = JSON.parse(JSON.stringify(shopItem))
+  }
+  shopItemsForm.value = shopItem
+}
+
+function SubmitForm() {
+  switch (itemStatus.value) {
+    case "save":
+      SaveShopItem(shopItemsForm.value.data, shopItemsForm.value.Name, "item").then(
+          res => {
+            if (res.code == 200) {
+              ElMessage.success("保存成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+    case "update":
+      UpdateShopItem(shopItemsForm.value.data, shopItemsForm.value.Name, "item").then(res => {
+            if (res.code == 200) {
+              ElMessage.success("修改成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+  }
+  replay()
+  openView.value = false
+}
+
+function DeleteItem(itemName: string) {
+  DeleteShopItem(itemName).then(res => {
+    if (res.code == 200) {
+      ElMessage.success("删除成功")
+    } else {
+      ElMessage.error(res.message)
+    }
+  })
+  replay()
+}
+
+function AddItems() {
+  shopItemsForm.value.data.Items.push(new Item(0, '', false, false, 0))
+}
+
 function getTypeNameByType(type: string): string {
   switch (type) {
     case "item":

+ 133 - 4
ui/src/components/ShopUnlockengramComponent.vue

@@ -1,26 +1,104 @@
 <template>
+  <el-row>
+    <el-col :span="1.5">
+      <el-button plain class="el-btn-margin" type="primary"
+                 @click="OpenAddAndUpdateView('save',
+                 new BaseData<ShopExperience>('',ShopCommand.Create()))">
+        添加信标
+      </el-button>
+    </el-col>
+  </el-row>
   <el-table :data="shopItems" border stripe>
     <el-table-column prop="Name" label="商品名称"></el-table-column>
     <el-table-column prop="data.Description" label="商品描述"></el-table-column>
     <el-table-column prop="data.Price" label="商品价格"></el-table-column>
     <el-table-column prop="data.Items" label="解锁技能条目">
-      <template #default="scope" >
-        <template  v-for="item in scope.row.data.Items">
-          <el-text>{{ item.Blueprint }}</el-text><br>
+      <template #default="scope">
+        <template v-for="item in scope.row.data.Items">
+          <el-text>{{ item.Blueprint }}</el-text>
+          <br>
         </template>
       </template>
     </el-table-column>
+    <el-table-column label="操作" width="180">
+      <template #default="scope">
+        <el-button type="success" link @click="OpenShow(scope.row.data.Items)">查看物品</el-button>
+        <el-button type="primary" link @click="OpenAddAndUpdateView('save',
+                new BaseData<ShopCommand>(scope.row.Name,scope.row.data))">修改
+        </el-button>
+        <el-button type="danger" link @click="DeleteItem(scope.row.Name)">删除
+        </el-button>
+      </template>
+    </el-table-column>
   </el-table>
+
+  <el-dialog title="添加/修改 技能点解锁" v-model="openView" width="1100px">
+    <el-form :model="shopItemForm" label-width="100px">
+      <el-row>
+        <el-col :span="12">
+          <el-form-item label="类型">
+            <el-text type="primary" label="类型">
+              {{ getTypeNameByType(shopItemForm.data.Type) }}
+            </el-text>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12"></el-col>
+        <el-col :span="8">
+          <el-form-item label="名称">
+            <el-input v-model="shopItemForm.Name" label="名称"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8">
+          <el-form-item label="价格">
+            <el-input-number v-model="shopItemForm.data.Price" label="价格"/>
+          </el-form-item>
+        </el-col>
+        <el-col :span="12">
+          <el-form-item label="描述">
+            <el-input type="textarea" v-model="shopItemForm.data.Description" label="描述"/>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-divider/>
+      <el-col :span="1.5">
+        <el-button plain class="el-btn-margin" type="primary"
+                   @click="AddItems()">
+          添加
+        </el-button>
+      </el-col>
+      <el-col :span="24">
+        <el-table :data="shopItemForm.data.Items" border stripe>
+          <el-table-column prop="Blueprint" label="图纸"></el-table-column>
+        </el-table>
+      </el-col>
+    </el-form>
+  </el-dialog>
+
 </template>
 
 <script setup lang="ts">
 
 import {ref} from "vue";
 import {BaseData} from "../api/ConfigFile";
-import {GetShopItems, ShopExperience, ShopUnlockengram} from "../api/ARKShopItemAPI";
+import {
+  DeleteShopItem,
+  GetShopItems,
+  SaveShopItem,
+  ShopCommand, ShopCommandItem,
+  ShopDino,
+  ShopExperience,
+  ShopUnlockengram, ShopUnlockengramItem, UpdateShopItem
+} from "../api/ARKShopItemAPI";
+import {ElMessage} from "element-plus";
 
+const type = ref("unlockengram")
 let shopItems = ref<BaseData<ShopUnlockengram>[]>([])
 
+let shopItemForm = ref<BaseData<ShopUnlockengram>>(new BaseData<ShopUnlockengram>("", ShopDino.Create()))
+
+let itemStatus = ref<string>("")
+let openView = ref(false)
+
 function replay() {
   GetShopItems("unlockengram").then(res => {
     if (res.code == 200) {
@@ -31,7 +109,58 @@ function replay() {
     }
   })
 }
+
 replay()
+
+function OpenAddAndUpdateView(status: string, shopItem: BaseData<ShopUnlockengram>) {
+  openView.value = true
+  itemStatus.value = status
+  shopItemForm.value = shopItem
+}
+
+function SubmitForm() {
+  switch (itemStatus.value) {
+    case "save":
+      SaveShopItem(shopItemForm.value.data, shopItemForm.value.Name, type.value).then(
+          res => {
+            if (res.code == 200) {
+              ElMessage.success("保存成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+    case "update":
+      UpdateShopItem(shopItemForm.value.data, shopItemForm.value.Name, type.value).then(res => {
+            if (res.code == 200) {
+              ElMessage.success("修改成功")
+            } else {
+              ElMessage.error(res.message)
+            }
+          }
+      )
+      break
+  }
+  replay()
+  openView.value = false
+}
+
+function DeleteItem(itemName: string) {
+  DeleteShopItem(itemName).then(res => {
+    if (res.code == 200) {
+      ElMessage.success("删除成功")
+    } else {
+      ElMessage.error(res.message)
+    }
+  })
+  replay()
+}
+
+function AddItems() {
+  shopItemForm.value.data.Items.push(new ShopUnlockengramItem("", ''))
+}
+
 function getTypeNameByType(type: string): string {
   switch (type) {
     case "item":

+ 51 - 4
ui/src/page/back/KitsView.vue

@@ -11,25 +11,72 @@
           <el-table-column prop="data.DefaultAmount" label="默认数量" width="100"></el-table-column>
           <el-table-column prop="data.Dinos" label="恐龙" width="60">
             <template #default="scope">
-              <el-button type="danger" link @click="" v-if="scope.row.data.Dinos" >恐龙</el-button>
+              <el-button type="danger" v-if="scope.row.data.Dinos"
+                         link @click="OpenDinoInfo(scope.row.data.Dinos)">恐龙
+              </el-button>
             </template>
           </el-table-column>
           <el-table-column prop="data.Items" label="物品" width="60">
             <template #default="scope">
-              <el-button type="success" link @click="" v-if="scope.row.data.Items">物品</el-button>
+              <el-button type="success" link v-if="scope.row.data.Items"
+                         @click="OpenItemInfo(scope.row.data.Items)">物品
+              </el-button>
             </template>
           </el-table-column>
         </el-table>
       </el-col>
     </el-row>
+    <el-dialog title="恐龙" v-model="openDino" width="800">
+      <el-row>
+        <el-col :span="24">
+          <el-table :data="DinoList" border>
+            <el-table-column prop="Level" label="等级" width="75"></el-table-column>
+            <el-table-column prop="Neutered" label="绝育" width="100"></el-table-column>
+            <el-table-column prop="Blueprint" label="蓝图" ></el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+    </el-dialog>
+    <el-dialog title="恐龙" v-model="openItem" width="1000">
+      <el-row>
+        <el-col :span="24">
+          <el-table :data="ItemList" border>
+            <el-table-column prop="Amount" label="数量" width="75"></el-table-column>
+            <el-table-column prop="Fixed" label="固定" width="100"></el-table-column>
+            <el-table-column prop="ForceBlueprint" label="是否为蓝图" ></el-table-column>
+            <el-table-column prop="Blueprint" label="蓝图" ></el-table-column>
+            <el-table-column prop="Quality" label="品质" width="60"></el-table-column>
+          </el-table>
+        </el-col>
+      </el-row>
+
+    </el-dialog>
+
   </div>
 </template>
 
 <script setup lang="ts">
-import {BaseData, GetKits, Kit} from "../../api/ConfigFile.ts";
+import {BaseData, Dino, GetKits, Item, Kit} from "../../api/ConfigFile.ts";
 import {ref} from "vue";
 
 let Kits = ref<BaseData<Kit>[]>([])
+let openDino = ref(false)
+let DinoList = ref<Dino[]>([])
+
+function OpenDinoInfo(dino: Dino[]) {
+  DinoList.value = []
+  DinoList.value = dino
+  openDino.value = true
+}
+
+let openItem = ref(false)
+let ItemList = ref<Item[]>([])
+
+function OpenItemInfo(item: Item[]) {
+  ItemList.value = []
+  ItemList.value = item
+  openItem.value = true
+}
 
 function replay() {
   Kits.value = []
@@ -46,7 +93,7 @@ replay()
 </script>
 
 <style scoped lang="scss">
-.body-kit{
+.body-kit {
   padding: 10px;
 }
 

+ 9 - 7
ui/src/page/back/ShopItemView2.vue

@@ -47,17 +47,19 @@ import ShopDinoComponent from "../../components/ShopDinoComponent.vue";
 import ShopBeaconComponent from "../../components/ShopBeaconComponent.vue";
 import ShopExperienceComponent from "../../components/ShopExperienceComponent.vue";
 import ShopUnlockengramComponent from "../../components/ShopUnlockengramComponent.vue";
+import router from "../../router";
 
-let activeName = ref('all')
-
-let open = ref(false)
-let showItem = ref<BaseData<ShopData>>()
+let activeName = ref<string>('all')
 
 let shopItems = ref<BaseData<ShopData>[]>([])
 
-function OpenShow(item: BaseData<ShopData>) {
-  open.value = true
-  showItem.value = item
+initRouterActiveName()
+
+function initRouterActiveName() {
+  let an = router.currentRoute.value.params.activeName
+  if (an) {
+    activeName.value = an.toString()
+  }
 }
 
 function replay() {

+ 5 - 0
ui/src/router/index.ts

@@ -48,6 +48,11 @@ const routes: Array<RouteRecordRaw> = [
                 path: "shopItem",
                 component: () => import("../page/back/ShopItemView2.vue"),
             },
+            {
+                name: "back-shopItem2",
+                path: "shopItem/:activeName",
+                component: () => import("../page/back/ShopItemView2.vue"),
+            },
             {
                 name: "back-sellItem",
                 path: "sellItem",

+ 3 - 0
ui/src/style.css

@@ -13,4 +13,7 @@ body {
 div{
   margin: 0;
   padding: 0;
+}
+.el-btn-margin{
+  margin: 0  10px 10px 0;
 }