Skip to content

Commit 54de657

Browse files
committed
自定义机器人性格
1 parent 9b82a94 commit 54de657

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/components/manage/BotManage.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<th style="width: 120px">加群</th>
4646
<th style="width: 160px">登陆时间</th>
4747
<th>删除</th>
48-
<th>是否收费</th>
48+
<th v-if="user_permission >= 5">是否收费</th>
4949
<th v-if="user_permission >= 1">更多</th>
5050
</tr>
5151
</thead>
@@ -95,7 +95,7 @@
9595
<td>
9696
<n-button quaternary type="error" @click="del_bot(i._id)">删除</n-button>
9797
</td>
98-
<td>
98+
<td v-if="user_permission >= 5">
9999
<n-switch v-model:value="bot_data[i._id].is_com" @update:value="set_bot_info(i._id)" />
100100
</td>
101101
<td v-if="user_permission >= 1">
@@ -133,10 +133,15 @@
133133
<n-input-number v-model:value="bot_data[cur_bot_id].master" :show-button="false" />
134134
<n-button tertiary @click="set_bot_info(cur_bot_id)">确定</n-button>
135135
</n-input-group>
136+
<br><br>
137+
<n-input-group>
138+
<n-input-group-label>机器人性格</n-input-group-label>
139+
<n-input autosize style="min-width: 30%" v-model:value="bot_data[cur_bot_id].character":maxlength="25" show-count></n-input>
140+
<n-button tertiary @click="set_bot_info(cur_bot_id)">确定</n-button>
141+
</n-input-group>
142+
<br>
136143
<br>
137-
<span>
138-
开启收费<n-switch v-model:value="bot_data[cur_bot_id].is_com" @update:value="set_bot_info(cur_bot_id)" />
139-
</span>
144+
<span v-if="user_permission >= 5">开启收费<n-switch v-model:value="bot_data[cur_bot_id].is_com" @update:value="set_bot_info(cur_bot_id)" /></span>
140145
</div>
141146
<br>
142147
<n-table :bordered="false" :single-line="false">
@@ -429,7 +434,8 @@ async function set_bot_info(bot_id=null) {
429434
var set_data = {
430435
"is_com": bot_data.value[bot_id]["is_com"],
431436
"enable": bot_data.value[bot_id]["enable"],
432-
"master": bot_data.value[bot_id]["master"]
437+
"master": bot_data.value[bot_id]["master"],
438+
"character": bot_data.value[bot_id]["character"],
433439
}
434440
var req_data = {
435441
action: "set_info",

0 commit comments

Comments
 (0)