This commit is contained in:
王一嘉
2025-07-21 08:54:13 +08:00
parent 50a85dd274
commit b15962dd65
4 changed files with 37 additions and 13 deletions

View File

@@ -2,6 +2,7 @@
import DOWNICON from "../static/icons/down.png";
import {onMounted, reactive} from "vue";
const emits = defineEmits(['change']);
const {placeholder, api} = defineProps({
placeholder: {
type: String,
@@ -19,6 +20,7 @@ const modelValue = defineModel();
const change = ({detail: {value}}) => {
modelValue.value = list.filter(v => !v.hidden)[value].id;
emits('change', modelValue.value);
}
onMounted(() => {
@@ -31,7 +33,7 @@ onMounted(() => {
<template>
<picker :range="list.filter(v => !v.hidden).map(v => v.name)" @change="change">
<view class="x-select">
<view class="x-select" v-if="!$slots.default">
<view v-if="modelValue === null" class="text-[#86909C] test-28r">
{{ placeholder }}
</view>
@@ -41,6 +43,7 @@ onMounted(() => {
<image :src="DOWNICON" class="!size-[24rpx]" mode="aspectFill"></image>
</view>
<slot v-else></slot>
</picker>
</template>

View File

@@ -15,6 +15,7 @@ import Api from "../../api/index.js";
import {onShow} from "@dcloudio/uni-app";
import {useSystemStore} from "../../pinia/SystemStore/index.js";
import XPrompt from "../../components/XPrompt.vue";
import XSelect from "../../components/XSelect.vue";
const SystemStore = useSystemStore();
const BASE = [
@@ -84,6 +85,14 @@ const deleteItem = async (id) => {
showToast(msg);
await getData();
}
const changeStatus = async (value, item) => {
const {msg} = await Api.system.editAccount({
...item,
status: value,
});
showToast(msg);
}
</script>
<template>
@@ -122,27 +131,41 @@ const deleteItem = async (id) => {
<view class="test-28r">{{ v.nickname }}</view>
<view class="text-[#86909C] test-24r">{{ v.account }}</view>
</view>
<view class="px-[12rpx] py-[7rpx] test-24r success" v-if="v.status === 1">
<view class="px-[12rpx] py-[7rpx] test-24r success !flex items-center gap-0.5" v-if="v.status === 1">
{{ v.status_text }}
<x-select v-model:model-value="v.status" :api="Api.system.getAccountStatus"
@change="changeStatus($event, v)">
<tui-icon size="14" name="arrowdown"></tui-icon>
</x-select>
</view>
<view class="px-[12rpx] py-[7rpx] test-24r warn !flex items-center gap-0.5"
v-else-if="v.status === 0 || v.status === 3">
{{ v.status_text }}
</view>
<view class="px-[12rpx] py-[7rpx] test-24r warn" v-else-if="v.status === 0 || v.status === 3">
{{ v.status_text }}
</view>
<view class="px-[12rpx] py-[7rpx] test-24r error" v-else-if="v.status === -2">
{{ v.status_text }}
<view class="px-[12rpx] py-[7rpx] test-24r error !flex items-center gap-0.5"
v-else-if="v.status === -2">
<x-prompt title="封禁原因" :info="v.check_text">
<template v-slot:button>
<tui-icon name="about" :size="15" color="#F53F3F"></tui-icon>
</template>
</x-prompt>
</view>
<view class="px-[12rpx] py-[7rpx] test-24r error" v-else>
{{ v.status_text }}
<x-select v-model:model-value="v.status" :api="Api.system.getAccountStatus"
@change="changeStatus($event, v)">
<tui-icon size="14" name="arrowdown"></tui-icon>
</x-select>
</view>
<view class="px-[12rpx] py-[7rpx] test-24r error !flex items-center gap-0.5" v-else>
<x-prompt :title="v.status_text+'原因'" :info="v.check_text">
<template v-slot:button>
<tui-icon name="about" :size="15" color="#F53F3F"></tui-icon>
</template>
</x-prompt>
{{ v.status_text }}
<x-select v-model:model-value="v.status" :api="Api.system.getAccountStatus"
@change="changeStatus($event, v)">
<tui-icon size="14" name="arrowdown"></tui-icon>
</x-select>
</view>
</view>
<view class="!w-full !h-[2rpx] bg-[#E5E6EB] !my-[20rpx]"></view>

View File

@@ -77,9 +77,6 @@ const getSelect = async () => {
<x-form-item label="昵称">
<x-input v-model:model-value="form.nickname" height="80rpx" placeholder="请输入昵称"></x-input>
</x-form-item>
<x-form-item label="账号状态">
<x-select v-model:model-value="form.status" :api="Api.system.getAccountStatus"></x-select>
</x-form-item>
<x-form-item label="恢复时间" v-if="form.status === 2">
<x-date-time :type="1" v-model:model-value="form.abnormaltime"></x-date-time>
</x-form-item>

View File

@@ -50,7 +50,8 @@ const changeTab = ({index}) => {
<view class="!pt-[24rpx] !pb-[28rpx] !px-[32rpx] !flex gap-[32rpx] items-center">
<view class="flex-grow">
<x-input v-model:model-value="po.keyword" height="72rpx" placeholder="请输入要查询的内容">
<x-input v-model:model-value="po.keyword" height="72rpx"
:placeholder="`请输入要查询的${po.type===0?'任务编号':'标题'}`">
<template #prefix>
<tui-icon name="search" size="18" class="!mr-[12rpx]"></tui-icon>
</template>