:add 在线人员快捷操作 代码生成去除/ 默认添加uid@

This commit is contained in:
wmn 2022-05-15 16:23:57 +08:00
parent 141fad05a7
commit dc19669a78
13 changed files with 259 additions and 256 deletions

View File

@ -140,5 +140,8 @@
],
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}

2
src/components.d.ts vendored
View File

@ -9,12 +9,14 @@ declare module '@vue/runtime-core' {
ACascader: typeof import('@arco-design/web-vue')['Cascader']
ACheckbox: typeof import('@arco-design/web-vue')['Checkbox']
ADescriptions: typeof import('@arco-design/web-vue')['Descriptions']
ADrawer: typeof import('@arco-design/web-vue')['Drawer']
AInput: typeof import('@arco-design/web-vue')['Input']
AInputNumber: typeof import('@arco-design/web-vue')['InputNumber']
ALink: typeof import('@arco-design/web-vue')['Link']
AMenu: typeof import('@arco-design/web-vue')['Menu']
AMenuItem: typeof import('@arco-design/web-vue')['MenuItem']
ASelect: typeof import('@arco-design/web-vue')['Select']
ASpace: typeof import('@arco-design/web-vue')['Space']
ASubMenu: typeof import('@arco-design/web-vue')['SubMenu']
ATable: typeof import('@arco-design/web-vue')['Table']
ATooltip: typeof import('@arco-design/web-vue')['Tooltip']

View File

@ -7,11 +7,11 @@ import { Message } from '@arco-design/web-vue'
const { text, isSupported, copy } = useClipboard()
var value2 = ref(223)
var uid = ref('')
var uid = ref('@')
var num = ref(1000)
const value = computed(() => {
return `/give ${uid.value} ${value2.value} ${num.value}`
return `give ${uid.value} ${value2.value} ${num.value}`
})
const options = reactive([
{

View File

@ -8,7 +8,7 @@ import holyrelicx from './json/holyrelicnx.json'
import { Message } from '@arco-design/web-vue'
const { text, isSupported, copy } = useClipboard()
var uid = ref('')
var uid = ref('@')
var holyrelicnamevalue = ref('')
var holyrelicnmainvalue = ref('')
@ -23,7 +23,7 @@ const value = computed(() => {
xct = xct + ` ${k.value},${k.num}`
}
})
return `/giveart ${uid.value} ${holyrelicnamevalue.value} ${holyrelicnmainvalue.value}${xct} ${
return `giveart ${uid.value} ${holyrelicnamevalue.value} ${holyrelicnmainvalue.value}${xct} ${
grade.value + 1
}`
})

View File

@ -2,266 +2,111 @@
[
{
"label": "生命值",
"value": 10001
"value": "hp"
},
{
"label": "生命值百分比",
"value": 10002
"label": "最大生命值",
"value": "maxhp"
},
{
"label": "攻击力",
"value": 10003
"value": "atk"
},
{
"label": "攻击力百分比",
"value": 10004
},
{
"label": "防御力",
"value": 10005
},
{
"label": "防御力百分比",
"value": 10006
"label": "元素精通",
"value": "em"
},
{
"label": "元素充能效率",
"value": 10007
},
{
"label": "元素精通",
"value": 10008
},
{
"label": "火元素抗性",
"value": 10009
},
{
"label": "雷元素抗性",
"value": 10010
},
{
"label": "冰元素抗性",
"value": 10011
},
{
"label": "水元素抗性",
"value": 10012
},
{
"label": "风元素抗性",
"value": 10013
},
{
"label": "岩元素抗性",
"value": 10014
},
{
"label": "草元素抗性",
"value": 10015
},
{
"label": "攻击力",
"value": 12001
},
{
"label": "生命值",
"value": 13001
},
{
"label": "生命值百分比",
"value": 13002
},
{
"label": "攻击力",
"value": 13003
},
{
"label": "攻击力百分比",
"value": 13004
},
{
"label": "防御力",
"value": 13005
},
{
"label": "防御力百分比",
"value": 13006
"value": "er"
},
{
"label": "暴击率",
"value": 13007
"value": "crate"
},
{
"label": "暴击伤害",
"value": 13008
"value": "cdmg"
},
{
"label": "冷却缩减",
"value": "cdr"
},
{
"label": "治疗加成",
"value": 13009
"value": "heal"
},
{
"label": "元素精通",
"value": 13010
"label": "受治疗加成",
"value": "heali"
},
{
"label": "生命值",
"value": 14001
"label": "护盾强效",
"value": "shield"
},
{
"label": "生命值",
"value": 15001
"label": "无视防御",
"value": "defi"
},
{
"label": "生命值百分比",
"value": 15002
"label": "元素增伤 火",
"value": "epyro"
},
{
"label": "攻击力",
"value": 15003
"label": "元素增伤 冰",
"value": "ecryo"
},
{
"label": "攻击力百分比",
"value": 15004
"label": "元素增伤 水",
"value": "ehydro"
},
{
"label": "防御力",
"value": 15005
"label": "元素增伤 岩",
"value": "egeo"
},
{
"label": "防御力百分比",
"value": 15006
"label": "元素增伤 草",
"value": "edendro"
},
{
"label": "元素精通",
"value": 15007
"label": "元素增伤 雷",
"value": "eelectro"
},
{
"label": "火元素伤害加成",
"value": 15008
"label": "元素增伤 物理",
"value": "ephys"
},
{
"label": "雷元素伤害加成",
"value": 15009
"label": "元素增伤 草",
"value": ""
},
{
"label": "冰元素伤害加成",
"value": 15010
"label": "元素抗性 火",
"value": "respyro"
},
{
"label": "水元素伤害加成",
"value": 15011
"label": "元素抗性 冰",
"value": "rescryo"
},
{
"label": "风元素伤害加成",
"value": 15012
"label": "元素抗性 水",
"value": "reshydro"
},
{
"label": "岩元素伤害加成",
"value": 15013
"label": "元素抗性 岩",
"value": "resgeo"
},
{
"label": "草元素伤害加成",
"value": 15014
"label": "元素抗性 草",
"value": "resdendro"
},
{
"label": "物理伤害加成",
"value": 15015
"label": "元素抗性 雷",
"value": "reselectro"
},
{
"label": "攻击力百分比",
"value": 10990
},
{
"label": "生命值百分比",
"value": 10980
},
{
"label": "防御力百分比",
"value": 10970
},
{
"label": "元素充能效率",
"value": 10960
},
{
"label": "元素精通",
"value": 10950
},
{
"label": "攻击力百分比",
"value": 30990
},
{
"label": "生命值百分比",
"value": 30980
},
{
"label": "防御力百分比",
"value": 30970
},
{
"label": "暴击率",
"value": 30960
},
{
"label": "暴击伤害",
"value": 30950
},
{
"label": "治疗加成",
"value": 30940
},
{
"label": "元素精通",
"value": 30930
},
{
"label": "攻击力百分比",
"value": 50990
},
{
"label": "生命值百分比",
"value": 50980
},
{
"label": "防御力百分比",
"value": 50970
},
{
"label": "火元素伤害加成",
"value": 50960
},
{
"label": "雷元素伤害加成",
"value": 50950
},
{
"label": "冰元素伤害加成",
"value": 50940
},
{
"label": "水元素伤害加成",
"value": 50930
},
{
"label": "风元素伤害加成",
"value": 50920
},
{
"label": "岩元素伤害加成",
"value": 50910
},
{
"label": "草元素伤害加成",
"value": 50900
},
{
"label": "物理伤害加成",
"value": 50890
},
{
"label": "元素精通",
"value": 50880
"label": "元素抗性 物理",
"value": "resphys"
}
]

View File

@ -10,9 +10,10 @@ const { text, isSupported, copy } = useClipboard()
var value2 = ref(21010101)
var grade = ref(80)
var num = ref(10)
var uid = ref('@')
const value = computed(() => {
return `/spawn ${value2.value} ${num.value} ${grade.value}`
return `spawn ${uid.value} ${value2.value} ${num.value} ${grade.value}`
})
const options = reactive(monster)
const message = Message
@ -27,29 +28,21 @@ function copyvalue() {
<template>
<div class="commuse">
<div class="commuse-item">
<div class="text-slate-900 dark:text-slate-100"> UID: </div>
<a-input v-model="uid" placeholder="请输入UID" allow-clear />
</div>
<div class="commuse-item">
<div class="text-slate-900 dark:text-slate-100"> 怪物: </div>
<a-cascader allow-search v-model="value2" :options="options" placeholder="" filterable />
</div>
<div class="commuse-item">
<div class="text-slate-900 dark:text-slate-100"> 等级: </div>
<a-input-number
v-model="grade"
placeholder="请输入数量"
mode="button"
size="large"
class="input-demo"
/>
<a-input-number v-model="grade" placeholder="请输入数量" mode="button" size="large" class="input-demo" />
</div>
<div class="commuse-item">
<div class="text-slate-900 dark:text-slate-100"> 数量: </div>
<a-input-number
v-model="num"
placeholder="请输入数量"
mode="button"
size="large"
class="input-demo"
/>
<a-input-number v-model="num" placeholder="请输入数量" mode="button" size="large" class="input-demo" />
</div>
<div class="generate">
<a-input v-model="value" placeholder="" />

View File

@ -0,0 +1,86 @@
[
{
"label": "给予指定玩家全部物品",
"value": [
"giveall @"
]
},
{
"label": "60级",
"value": [
"give @ 102 1880200"
]
},
{
"label": "世界8",
"value": [
"setworldlevel @ 8"
]
},
{
"label": "1000000原石",
"value": [
"give @ 201 1000000"
]
},
{
"label": "1000000纠缠之缘",
"value": [
"give @ 223 1880200"
]
},
{
"label": "1000000相遇之缘",
"value": [
"give @ 224 1000000"
]
},
{
"label": "1000000魔拉",
"value": [
"give @ 202 1000000"
]
},
{
"label": "1000000创世结晶",
"value": [
"give @ 203 1000000"
]
},
{
"label": "1000000创世结晶",
"value": [
"give @ 102 1000000"
]
},
{
"label": "50只120级丘丘人",
"value": [
"spawn @ 21010101 50 120"
]
},
{
"label": "治疗队伍中所有角色",
"value": [
"heal @"
]
},
{
"label": "当前角色普攻满级",
"value": [
"talent @ n 10"
]
},
{
"label": "当前角色Q满级",
"value": [
"talent @ q 10"
]
},
{
"label": "当前角色E满级",
"value": [
"talent @ e 10"
]
}
]

View File

@ -9,38 +9,32 @@ const { text, isSupported, copy } = useClipboard()
const options = reactive([
{
title: '治疗队伍中所有角色',
isuse: '仅客户端',
value: '/heal',
value: 'heal',
},
{
title: '列出在线玩家',
isuse: '均可使用',
value: '/list',
value: 'list',
},
{
title: '获取当前坐标',
isuse: '仅客户端',
value: '/position',
value: 'position',
},
{
title: '重载服务器配置',
isuse: '均可使用',
value: '/reload',
value: 'reload',
},
{
title: '重启服务端',
isuse: '均可使用',
value: '/restart',
value: 'restart',
},
{
title: '停止服务器',
isuse: '均可使用',
value: '/stop',
value: 'stop',
},
{
title: '世界等级8',
isuse: '仅客户端',
value: '/setworldlevel 8',
value: 'setworldlevel 8',
},
])
const message = Message

View File

@ -1,15 +1,40 @@
<template>
<div class="personnel">
<a-table :columns="columns" :data="data">
<a-space direction="vertical">
<a-button type="outline" @click="updatePlayerList">刷新</a-button>
<a-table :columns="columns" :data="appStore.PlayerList">
<template #optional="{ record }">
<a-button @click="$modal.info({ title: 'Name', content: record.name })">操作</a-button>
<a-button @click="handle(record)">操作</a-button>
</template>
</a-table>
</a-space>
</div>
<a-drawer :width="500" :visible="visible" placement="right" @ok="handleOk" @cancel="handleCancel" unmountOnClose>
<template #title>
操作 UID @{{ handleUid }}
</template>
<div class="personnel-drawer">
<a-space direction="vertical" fill>
<div>
一键操作
</div>
<a-space wrap>
<a-button v-for="(item, index) in operationData" type="outline" :key="index" @click="handleOP(item.value)">{{
item.label
}}</a-button>
</a-space>
</a-space>
</div>
</a-drawer>
</template>
<script setup lang="ts">
import { reactive, ref, computed } from 'vue'
import { reactive, ref, onMounted } from 'vue'
import { useAppStore } from '@/store/modules/app'
import operationdata from './operation.json'
const appStore = useAppStore()
function updatePlayerList() {
appStore.socketSend("{\"type\":\"Player\",\"data\":\"0\"}");
}
const data = ref([])
const columns = [
{
@ -38,9 +63,48 @@ const columns = [
},
{
title: '操作',
dataIndex: 'Optional',
slotName: 'optional'
},
];
const operationData = ref(operationdata)
const handleUid = ref(1)
const handle = (record: any) => {
handleUid.value = record.uid
visible.value = true;
}
const handleOP = (valueList: string[]) => {
for (let index = 0; index < valueList.length; index++) {
const element = valueList[index];
var i = element.search("@") + 1
send(insertStr(element, i))
}
}
function send(cmd: string) {
const send_msg = {
type: 'CMD',
data: cmd,
}
const send_msg_str = JSON.stringify(send_msg)
appStore.socketSend(send_msg_str)
}
function insertStr(soure: string, start: number, newStr = handleUid.value) {
return soure.slice(0, start) + newStr + soure.slice(start);
}
const handleOk = () => {
visible.value = false;
}
const handleCancel = () => {
visible.value = false;
}
const visible = ref(false);
onMounted(() => {
updatePlayerList()
})
</script>
<style lang="less" scoped>
.personnel {
@ -48,4 +112,11 @@ const columns = [
width: 700px;
}
</style>
<style lang="less" >
.personnel-drawer {
width: 100%;
height: 100%;
overflow: auto;
}
</style>

View File

@ -8,11 +8,12 @@ import role from './json/role.json'
const { text, isSupported, copy } = useClipboard()
var value2 = ref()
var value2 = ref("hp")
var num = ref()
var uid = ref("@")
const value = computed(() => {
return `/setstats ${value2.value} ${num.value}`
return `setstats ${uid.value} ${value2.value} ${num.value}`
})
const options = reactive(role)
const message = Message
@ -28,6 +29,10 @@ function copyvalue() {
<template>
<div class="commuse">
<div class="title"> 直接修改当前角色的面板 </div>
<div class="commuse-item">
<div class="text-slate-900 dark:text-slate-100"> UID: </div>
<a-input v-model="uid" placeholder="请输入UID" allow-clear />
</div>
<div class="commuse-item">
<div class="text-slate-900 dark:text-slate-100"> 属性: </div>
<a-cascader allow-search v-model="value2" :options="options" placeholder="" filterable />

View File

@ -8,7 +8,7 @@ const { text, isSupported, copy } = useClipboard()
var value2 = ref()
var value3 = ref('/give')
var uid = ref()
var uid = ref("@")
var num = ref()
const value = computed(() => {

View File

@ -6,14 +6,14 @@ import { Message } from '@arco-design/web-vue'
import weapon from './json/weapon.json'
const { text, isSupported, copy } = useClipboard()
var uid = ref(1)
var uid = ref("@")
var value2 = ref(12510)
var num = ref(5)
var grade = ref(90)
var refined = ref(5)
const value = computed(() => {
return `/give ${uid.value} ${value2.value} ${num.value} ${grade.value} ${refined.value}`
return `give ${uid.value} ${value2.value} ${num.value} ${grade.value} ${refined.value}`
})
const options = reactive(weapon)

View File

@ -57,7 +57,8 @@ export const useAppStore = defineStore(
send: (data: string | ArrayBuffer | Blob, useBuffer?: boolean | undefined) => { },
close: () => { },
open: () => { },
mesgData: [""]
mesgData: [""],
PlayerList: []
}),
getters: {},
actions: {
@ -175,8 +176,11 @@ export const useAppStore = defineStore(
case "cmd_msg":
this.mesgData.push(parse.data)
Message.info(parse.data)
break;
case "PlayerList":
this.PlayerList = parse.data
break;
default:
break;
}