640 lines
22 KiB
Vue
640 lines
22 KiB
Vue
<script setup lang="ts">
|
||
import BatchDeleteActions from '@/components/BatchDeleteActions.vue'
|
||
import BatchDeleteCheckbox from '@/components/BatchDeleteCheckbox.vue'
|
||
import { useRowSelection } from '@/utils/use-row-selection'
|
||
/** 分类管理对话框(2026-11-17 用户口径「京东分类管理并到京东数据库分类编辑里,
|
||
* 做一个搜索和添加 删除 编辑 分类名称即可」):原 V204 独立子菜单页(JdCategoryManagerPage)
|
||
* 整体并入本对话框,从京东数据库页工具栏「分类管理」打开。
|
||
* 职责不变:当前数据权限分组的分类建/改名/删除+新增的名称搜索;商品归类不在这里
|
||
* (去「批量编辑分类」)。列表状态自管理(写操作后自刷新并 emit changed 让父页刷筛选下拉)。
|
||
* 权限口径(V203)不变:本组管理员/公司超管/平台超管可写(editable);同组普通号
|
||
* 只读可看(无新建行,改名/删除按钮逐行不渲染),后端同口径 403 兜底。
|
||
* 2026-11-17 晚用户口径「admin 权限最大」:京东侧还没有任何数据权限分组时(平台闸
|
||
* 上线后 jd 档组全空),平台超管在本弹窗空态直建第一个京东档分组(组长=自己),
|
||
* 建完 emit group-created 让父页重取作用域,当前分组翻到新组后接着就能建分类,
|
||
* 不再死在「你还不属于任何数据权限分组」。 */
|
||
import { computed, ref, watch } from 'vue'
|
||
import {
|
||
createJdProductGroup,
|
||
deleteJdProductGroup,
|
||
fetchJdProductGroups,
|
||
updateJdProductGroup,
|
||
type JdProductGroup,
|
||
} from './jd-product-api.ts'
|
||
import { createShopGroup } from '../account/shop-group-api.ts'
|
||
import { useAdminSessionStore } from '@/stores/admin-session'
|
||
import { openAdminConfirm } from '@/components/admin-confirm'
|
||
import { showAdminFeedback } from '@/components/admin-feedback-ui'
|
||
import { loadFailureMessage } from '@/components/load-failure-model'
|
||
import LoadFailureBar from '@/components/LoadFailureBar.vue'
|
||
import { requestErrorMessage } from '../../api/envelope.ts'
|
||
|
||
const props = defineProps<{
|
||
visible: boolean
|
||
/** 当前数据权限分组(分类的作用域;<=0=不属于任何分组,只留空态)。 */
|
||
ownerGroupId: number
|
||
ownerGroupName: string
|
||
/** 当前分组可写(scope 的 editable):建/改名/删除控件全挂它。 */
|
||
editable: boolean
|
||
/** 操作者是否平台超管(scope 原样透传):只在「还没有分组」的空态开直建口子。 */
|
||
platformSuperAdmin?: boolean
|
||
}>()
|
||
|
||
const emit = defineEmits<{ (event: 'close'): void; (event: 'changed'): void; (event: 'group-created'): void }>()
|
||
|
||
const session = useAdminSessionStore()
|
||
|
||
const loading = ref(false)
|
||
/** 首屏取数失败(可见红条+重试);写操作失败走 errorText 红条(无重试语义)。 */
|
||
const loadFailure = ref('')
|
||
const errorText = ref('')
|
||
const groups = ref<JdProductGroup[]>([])
|
||
/** 搜索:按分类名称包含过滤(本地过滤,不另发请求)。 */
|
||
const keyword = ref('')
|
||
/** 分页(2026-11-17 用户口径「分类这也要加分页」):分类与父页「分类」下拉共用同一条全量
|
||
* 接口(下拉必须全量,不能分页),所以这里做本地切片;搜索同样是本地过滤 ⇒ 分页与搜索
|
||
* 同源,不会出现「先 limit 再过滤」那种翻页永久漏项。每页 6 行:实测 8 行在 700px 高的
|
||
* 视口里会顶出列表内滚动条(滚动条与页码条并存很难看),6 行矮屏也一屏放得下。 */
|
||
const PAGE_SIZE = 6
|
||
const pageNo = ref(1)
|
||
/** 新建:只收名称(排序输入 2026-11-15 客户口径下线,sortOrder 恒 0,后端契约不变)。 */
|
||
const createName = ref('')
|
||
const creating = ref(false)
|
||
/** 改名:正在编辑的分类 id 与草稿名。 */
|
||
const editingId = ref(0)
|
||
const editingName = ref('')
|
||
const saving = ref(false)
|
||
|
||
const canCreate = computed(() => props.editable && createName.value.trim().length > 0 && !creating.value && !saving.value)
|
||
/** 搜索命中(名称包含,大小写不敏感;空关键字=全量)。 */
|
||
const filteredGroups = computed(() => {
|
||
const kw = keyword.value.trim().toLowerCase()
|
||
if (!kw) return groups.value
|
||
return groups.value.filter((group) => group.name.toLowerCase().includes(kw))
|
||
})
|
||
/** 总页数(至少 1 页:空列表时页码条不渲染,但钳制逻辑要有个有效上界)。 */
|
||
const totalPages = computed(() => Math.max(1, Math.ceil(filteredGroups.value.length / PAGE_SIZE)))
|
||
/** 当前页的行(在搜索命中集上切片)。 */
|
||
const pagedGroups = computed(() => {
|
||
const start = (pageNo.value - 1) * PAGE_SIZE
|
||
return filteredGroups.value.slice(start, start + PAGE_SIZE)
|
||
})
|
||
/** 只有超过一页才出页码条:一屏装得下时不白占一行。 */
|
||
const showPager = computed(() => filteredGroups.value.length > PAGE_SIZE)
|
||
|
||
/** 翻页:页码钳在 [1, totalPages](删除/搜索后越界不会翻到空白页)。 */
|
||
function goPage(target: number): void {
|
||
pageNo.value = Math.min(Math.max(1, target), totalPages.value)
|
||
}
|
||
/** 空表文案分四种:不属于任何组 / 本组没分类(可管理)/ 本组没分类(只读)/ 搜索无命中。
|
||
* 平台超管的「还没有分组」空态不走这里——模板换成直建分组的表单(canBootstrapGroup)。 */
|
||
const emptyListText = computed(() => {
|
||
if (props.ownerGroupId <= 0) return '你还不属于任何数据权限分组'
|
||
if (!groups.value.length) {
|
||
return props.editable ? '本组暂无分类,先新建一个' : '本组暂无分类'
|
||
}
|
||
return '没有匹配的分类'
|
||
})
|
||
|
||
/** 空态直建分组的口子(2026-11-17 用户口径「admin 权限最大」):平台超管 + 还没有任何
|
||
* 可见分组时才开。组员/翻档等完整分组管理仍归「分组管理」页,这里只解决「从 0 到 1」。 */
|
||
const canBootstrapGroup = computed(() => props.platformSuperAdmin === true && props.ownerGroupId <= 0)
|
||
/** 直建表单:只收名称;组长=当前操作者,platform 恒 'jd'(京东侧作用域只认 jd 档)。 */
|
||
const newGroupName = ref('')
|
||
const creatingGroup = ref(false)
|
||
const canCreateGroup = computed(() =>
|
||
canBootstrapGroup.value && newGroupName.value.trim().length > 0 && !creatingGroup.value)
|
||
|
||
/** 平台超管空态直建第一个京东档分组:走分组管理同一条 POST(shop-manages/groups),
|
||
* 组长=当前操作者、组员先空。成功后 emit group-created 让父页整条作用域重取——
|
||
* ownerGroupId 翻到新组后由下方 watch 接手按新组重取分类,操作者接着就能建分类。 */
|
||
async function submitCreateGroup(): Promise<void> {
|
||
const name = newGroupName.value.trim()
|
||
if (!name || creatingGroup.value || !canBootstrapGroup.value) return
|
||
const operatorId = session.user?.id ?? 0
|
||
if (!operatorId) {
|
||
errorText.value = '无法获取当前登录用户,请重新登录'
|
||
return
|
||
}
|
||
creatingGroup.value = true
|
||
errorText.value = ''
|
||
try {
|
||
await createShopGroup(name, [], operatorId, 'jd')
|
||
newGroupName.value = ''
|
||
showAdminFeedback(`已新建京东档分组「${name}」`, 'success')
|
||
emit('group-created')
|
||
} catch (error) {
|
||
errorText.value = requestErrorMessage(error) || '新建分组失败'
|
||
} finally {
|
||
creatingGroup.value = false
|
||
}
|
||
}
|
||
|
||
async function loadGroups(): Promise<void> {
|
||
if (props.ownerGroupId <= 0) {
|
||
groups.value = []
|
||
loading.value = false
|
||
loadFailure.value = ''
|
||
errorText.value = ''
|
||
return
|
||
}
|
||
loading.value = true
|
||
loadFailure.value = ''
|
||
try {
|
||
groups.value = await fetchJdProductGroups(props.ownerGroupId)
|
||
} catch (error) {
|
||
loadFailure.value = loadFailureMessage(error, '分类列表加载失败')
|
||
groups.value = []
|
||
} finally {
|
||
loading.value = false
|
||
}
|
||
}
|
||
|
||
async function submitCreate(): Promise<void> {
|
||
const name = createName.value.trim()
|
||
if (!name || creating.value || !props.editable) return
|
||
creating.value = true
|
||
errorText.value = ''
|
||
try {
|
||
await createJdProductGroup({ name, sortOrder: 0, ownerGroupId: props.ownerGroupId })
|
||
createName.value = ''
|
||
keyword.value = ''
|
||
showAdminFeedback(`已新建分类「${name}」`, 'success')
|
||
emit('changed')
|
||
await loadGroups()
|
||
} catch (error) {
|
||
errorText.value = requestErrorMessage(error) || '新建分类失败'
|
||
} finally {
|
||
creating.value = false
|
||
}
|
||
}
|
||
|
||
function startRename(group: JdProductGroup): void {
|
||
editingId.value = group.id
|
||
editingName.value = group.name
|
||
errorText.value = ''
|
||
}
|
||
|
||
function cancelRename(): void {
|
||
editingId.value = 0
|
||
editingName.value = ''
|
||
}
|
||
|
||
async function submitRename(group: JdProductGroup): Promise<void> {
|
||
const name = editingName.value.trim()
|
||
if (!name || saving.value) return
|
||
saving.value = true
|
||
errorText.value = ''
|
||
try {
|
||
await updateJdProductGroup(group.id, { name, sortOrder: group.sortOrder })
|
||
groups.value = groups.value.map((item) => (item.id === group.id ? { ...item, name } : item))
|
||
cancelRename()
|
||
showAdminFeedback(`已把分类改名为「${name}」`, 'success')
|
||
emit('changed')
|
||
} catch (error) {
|
||
errorText.value = requestErrorMessage(error) || '改名失败'
|
||
} finally {
|
||
saving.value = false
|
||
}
|
||
}
|
||
|
||
/** 删除分类不删商品:只解挂本组归属行(商品回到未分类),后端 JdProductGroupService.delete。 */
|
||
const batch = useRowSelection({
|
||
pageRows: () => pagedGroups.value,
|
||
rowId: (row) => row.id,
|
||
rowLabel: (row) => row.name,
|
||
deleteOne: (id) => deleteJdProductGroup(id),
|
||
refresh: async (outcome) => {
|
||
if (outcome.deleted.length) emit('changed')
|
||
await loadGroups()
|
||
},
|
||
blocked: () => !props.visible || !props.editable || loading.value || saving.value || creating.value || !!editingId.value || !!loadFailure.value,
|
||
scope: () => [props.visible, props.ownerGroupId, props.editable],
|
||
consequence: '分类下的商品将回到未分类,商品本身不会被删除。',
|
||
})
|
||
|
||
async function removeGroup(group: JdProductGroup): Promise<void> {
|
||
if (batch.busy) return
|
||
const ok = await openAdminConfirm({ title: '删除分类', message: `确定删除分类「${group.name}」吗?删除后该分类下 ${group.productCount} 个商品回到未分类。`, confirmText: '确认删除', danger: true })
|
||
if (!ok || saving.value) return
|
||
saving.value = true
|
||
errorText.value = ''
|
||
try {
|
||
await deleteJdProductGroup(group.id)
|
||
batch.removeFromSelection(group.id)
|
||
showAdminFeedback(`已删除分类「${group.name}」`, 'success')
|
||
emit('changed')
|
||
await loadGroups()
|
||
} catch (error) {
|
||
errorText.value = requestErrorMessage(error) || '删除分类失败'
|
||
} finally {
|
||
saving.value = false
|
||
}
|
||
}
|
||
|
||
watch(
|
||
() => props.visible,
|
||
(visible) => {
|
||
if (visible) {
|
||
keyword.value = ''
|
||
errorText.value = ''
|
||
loadFailure.value = ''
|
||
cancelRename()
|
||
createName.value = ''
|
||
newGroupName.value = ''
|
||
pageNo.value = 1
|
||
void loadGroups()
|
||
}
|
||
},
|
||
// immediate:对话框可能以 visible=true 直接挂载(测试/复用场景),这时也要首取。
|
||
{ immediate: true },
|
||
)
|
||
|
||
/** 建组成功后父页重取作用域会把 ownerGroupId 翻到新组:按新组重取分类列表,
|
||
* 操作者不用关弹窗重开就能接着建分类。 */
|
||
watch(
|
||
() => props.ownerGroupId,
|
||
(next, prev) => {
|
||
if (next > 0 && next !== prev) void loadGroups()
|
||
},
|
||
)
|
||
|
||
/** 改关键字回第一页(命中集变了,停在旧页码会落在空白处)。 */
|
||
watch(keyword, () => {
|
||
pageNo.value = 1
|
||
})
|
||
/** 命中集变少(删掉最后一条/搜索收窄)后把越界页码钳回最后一页。 */
|
||
watch(totalPages, (pages) => {
|
||
if (pageNo.value > pages) pageNo.value = pages
|
||
})
|
||
</script>
|
||
|
||
<template>
|
||
<div v-if="visible" class="modal-mask" @click.self="emit('close')">
|
||
<div class="manage-modal">
|
||
<div class="modal-head">
|
||
<h3>分类管理</h3>
|
||
<button class="modal-close" type="button" aria-label="关闭" @click="emit('close')">×</button>
|
||
</div>
|
||
|
||
<div class="manage-bar">
|
||
<input v-model="keyword" class="search-input" type="text" placeholder="搜索分类名称" aria-label="搜索分类名称" />
|
||
<div v-if="editable" class="group-create">
|
||
<input v-model="createName" type="text" placeholder="输入新分类名称" aria-label="新分类名称" @keyup.enter="submitCreate" />
|
||
<button class="btn" type="button" :disabled="batch.busy || !canCreate" @click="submitCreate">新建</button>
|
||
</div>
|
||
</div>
|
||
|
||
<LoadFailureBar v-if="loadFailure" :message="loadFailure" @retry="loadGroups" />
|
||
<p v-if="errorText" class="group-error">{{ errorText }}</p>
|
||
|
||
<BatchDeleteActions v-if="editable" :batch="batch" />
|
||
|
||
<!-- 表头(2026-11-18 用户红框口径):列表有数据时在搜索行下列出三列名,与行同构对齐;
|
||
只读口径下行没有改名/删除按钮,操作列表头随之不渲染。 -->
|
||
<div v-if="filteredGroups.length" class="option-head">
|
||
<BatchDeleteCheckbox v-if="editable" label="全选当前页可删除记录" :checked="batch.pageAll" :partial="batch.pageSome"
|
||
:disabled="batch.disabled || batch.pageEmpty" @change="batch.togglePage" />
|
||
<span class="head-name">分类名称</span>
|
||
<span class="head-count">商品数</span>
|
||
<span v-if="editable" class="head-actions">操作</span>
|
||
</div>
|
||
|
||
<ul class="option-list">
|
||
<template v-if="filteredGroups.length">
|
||
<li v-for="group in pagedGroups" :key="group.id" class="option-row" :class="{ 'batch-selected': batch.isSelected(group) }">
|
||
<BatchDeleteCheckbox v-if="editable" :label="batch.reason(group) || `选择 ${batch.label(group)}`" :checked="batch.isSelected(group)"
|
||
:disabled="batch.disabled || !!batch.reason(group)" @change="batch.toggle(group)" />
|
||
<template v-if="editingId === group.id">
|
||
<input v-model="editingName" class="rename-input" type="text" aria-label="分类新名称" @keyup.enter="submitRename(group)" />
|
||
<span class="row-actions">
|
||
<button class="btn btn-sm" type="button" :disabled="saving" @click="submitRename(group)">保存</button>
|
||
<button class="btn btn-sm btn-secondary" type="button" @click="cancelRename">取消</button>
|
||
</span>
|
||
</template>
|
||
<template v-else>
|
||
<span class="option-name" :title="group.name">{{ group.name }}</span>
|
||
<span class="option-meta" title="该分类下的商品数">{{ group.productCount }}</span>
|
||
<span v-if="editable" class="row-actions">
|
||
<button class="btn btn-sm btn-secondary" type="button" :disabled="saving || batch.busy" @click="startRename(group)">改名</button>
|
||
<button class="btn btn-sm btn-danger" type="button" :disabled="saving || batch.busy" @click="removeGroup(group)">删除</button>
|
||
</span>
|
||
</template>
|
||
</li>
|
||
</template>
|
||
<li v-else-if="loading" class="manage-empty">加载中...</li>
|
||
<li v-else class="manage-empty">
|
||
<template v-if="canBootstrapGroup">
|
||
<div class="group-bootstrap">
|
||
<input
|
||
v-model="newGroupName"
|
||
class="search-input"
|
||
type="text"
|
||
placeholder="输入分组名称"
|
||
aria-label="新分组名称"
|
||
@keyup.enter="submitCreateGroup"
|
||
/>
|
||
<button class="btn" type="button" :disabled="!canCreateGroup" @click="submitCreateGroup">新建分组</button>
|
||
</div>
|
||
</template>
|
||
<template v-else>{{ emptyListText }}</template>
|
||
</li>
|
||
</ul>
|
||
|
||
<div v-if="showPager" class="manage-pager">
|
||
<button class="btn btn-sm btn-secondary" type="button" :disabled="pageNo <= 1" @click="goPage(pageNo - 1)">上一页</button>
|
||
<span class="pager-text">第 {{ pageNo }} / {{ totalPages }} 页 · 共 {{ filteredGroups.length }} 个分类</span>
|
||
<button class="btn btn-sm btn-secondary" type="button" :disabled="pageNo >= totalPages" @click="goPage(pageNo + 1)">下一页</button>
|
||
</div>
|
||
|
||
<div class="modal-foot">
|
||
<button class="btn btn-secondary" type="button" @click="emit('close')">关闭</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<style scoped>
|
||
.modal-mask {
|
||
position: fixed;
|
||
inset: 0;
|
||
z-index: 2800;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
padding: 40px 20px;
|
||
background: rgba(45, 66, 86, 0.36);
|
||
backdrop-filter: blur(6px);
|
||
}
|
||
.manage-modal {
|
||
display: flex;
|
||
flex-direction: column;
|
||
/* 2026-11-17 用户口径「宽度不需要那么宽」「红框大小就够了」:垂直排列后每行拉满,
|
||
480/420 都显空荡;按用户红框量到约 340px(全局 main.css 有 `* { box-sizing: border-box }`,
|
||
这个 width 就是含内边距与边框的总宽)。行内容(名称+商品数徽标+改名/删除)与页码条
|
||
在 340−42=298px 可用宽度里仍放得下,不会挤换行。 */
|
||
width: min(340px, 100%);
|
||
max-height: 80vh;
|
||
padding: 18px 20px 20px;
|
||
border: 1px solid #c7d7e5;
|
||
border-radius: 14px;
|
||
background: #ffffff;
|
||
box-shadow: 0 22px 60px rgba(39, 67, 94, 0.2);
|
||
}
|
||
.modal-head {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
}
|
||
.modal-head h3 {
|
||
margin: 0;
|
||
font-size: 15px;
|
||
font-weight: 650;
|
||
color: #24384d;
|
||
}
|
||
.modal-close {
|
||
width: 30px;
|
||
height: 30px;
|
||
border: 1px solid transparent;
|
||
border-radius: 9px;
|
||
background: none;
|
||
color: #5b6f83;
|
||
font-size: 20px;
|
||
line-height: 1;
|
||
cursor: pointer;
|
||
}
|
||
.modal-close:hover {
|
||
border-color: #cbd9e6;
|
||
background: #eef4fa;
|
||
color: #24384d;
|
||
}
|
||
/* 2026-11-17 用户口径演变:「垂直排阿」→ 弹窗收窄到 340px 后「弄成一排呗」:
|
||
搜索框、新分类名输入、新建按钮合回一行。340−42=298px 可用宽度:新建按钮约 56
|
||
+两处 gap 16。实测按比例分(flex 1:1.75)会偏移(搜索 122/新建输入只剩 105,
|
||
7 字占位 115px 被截),改成搜索定宽 108px(6 字占位 102px 放得下),新建行吃剩余
|
||
(298−108−16=174,输入约 118px,占位完整)。 */
|
||
.manage-bar {
|
||
display: flex;
|
||
flex-wrap: nowrap;
|
||
gap: 8px;
|
||
align-items: center;
|
||
margin-bottom: 12px;
|
||
}
|
||
.search-input,
|
||
.group-create input {
|
||
min-height: 36px;
|
||
padding: 6px 12px;
|
||
border: 1px solid #cbd9e6;
|
||
border-radius: 9px;
|
||
background: #f8fbfd;
|
||
color: #24384d;
|
||
font-size: 13px;
|
||
font-family: inherit;
|
||
outline: none;
|
||
transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
|
||
}
|
||
.search-input:hover,
|
||
.group-create input:hover {
|
||
border-color: #9fb7cd;
|
||
}
|
||
.search-input:focus,
|
||
.group-create input:focus {
|
||
background: #ffffff;
|
||
border-color: #5f85ad;
|
||
box-shadow: 0 0 0 3px rgba(95, 133, 173, 0.16);
|
||
}
|
||
.search-input {
|
||
flex: 0 0 108px;
|
||
min-width: 0;
|
||
}
|
||
.group-create {
|
||
display: flex;
|
||
flex: 1;
|
||
gap: 8px;
|
||
min-width: 0;
|
||
}
|
||
.group-create input {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
.group-error {
|
||
margin: 0 0 8px;
|
||
padding: 10px 12px;
|
||
border: 1px solid #f0c9c2;
|
||
border-radius: 10px;
|
||
background: #fdf1ef;
|
||
color: #a04432;
|
||
font-size: 13px;
|
||
}
|
||
/* 表头与行同形(同 gap、同左右内边距),列名只是淡色小字不抢行内容;
|
||
商品数列吃与徽标一致的 min-width/内边距,操作列同 rows 的 margin-left:auto 靠右。 */
|
||
.option-head {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
padding: 6px 8px;
|
||
border-bottom: 1px solid #e7eef5;
|
||
font-size: 12px;
|
||
color: #8293a5;
|
||
}
|
||
.head-name {
|
||
flex: 0 1 auto;
|
||
min-width: 0;
|
||
}
|
||
.head-count {
|
||
flex: none;
|
||
min-width: 22px;
|
||
padding: 0 7px;
|
||
text-align: center;
|
||
white-space: nowrap;
|
||
}
|
||
.head-actions {
|
||
flex: none;
|
||
margin-left: auto;
|
||
white-space: nowrap;
|
||
}
|
||
.option-list {
|
||
flex: 1;
|
||
min-height: 0;
|
||
overflow-y: auto;
|
||
margin: 0;
|
||
padding: 0;
|
||
list-style: none;
|
||
border-top: 1px solid #e7eef5;
|
||
}
|
||
.option-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
padding: 9px 8px;
|
||
border-bottom: 1px solid #e7eef5;
|
||
font-size: 13.5px;
|
||
}
|
||
.option-row:hover {
|
||
background: #f1f7fb;
|
||
}
|
||
/* 名称不占剩余空间:它只包住自己的文字,数量徽标紧贴其后。
|
||
剩余空间全部让给 row-actions 的 margin-left:auto(有操作时按钮仍靠右)。
|
||
写回 flex:1 会让名称把空白吃满、把号码顶到行尾(2026-11-17 用户反馈「0 和名称离的有点远」)。 */
|
||
.option-name {
|
||
flex: 0 1 auto;
|
||
min-width: 0;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
color: #24384d;
|
||
}
|
||
.option-meta {
|
||
flex: none;
|
||
min-width: 22px;
|
||
padding: 1px 7px;
|
||
border-radius: 9px;
|
||
background: #eef4fa;
|
||
color: #4e6479;
|
||
font-size: 12px;
|
||
text-align: center;
|
||
white-space: nowrap;
|
||
}
|
||
.row-actions {
|
||
flex: none;
|
||
margin-left: auto;
|
||
white-space: nowrap;
|
||
}
|
||
.manage-empty {
|
||
padding: 30px 12px;
|
||
text-align: center;
|
||
color: #8293a5;
|
||
font-size: 13px;
|
||
list-style: none;
|
||
}
|
||
/* 平台超管空态直建分组:只有输入行(引导语/组长说明等小字 2026-11-17 用户口径「小字不需要」删除)。 */
|
||
.group-bootstrap {
|
||
display: flex;
|
||
gap: 8px;
|
||
}
|
||
.group-bootstrap .search-input {
|
||
flex: 1;
|
||
min-width: 0;
|
||
text-align: left;
|
||
}
|
||
.manage-pager {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
gap: 10px;
|
||
margin-top: 10px;
|
||
}
|
||
.pager-text {
|
||
color: #5b6f83;
|
||
font-size: 12.5px;
|
||
white-space: nowrap;
|
||
}
|
||
.rename-input {
|
||
flex: 1;
|
||
min-width: 0;
|
||
min-height: 32px;
|
||
padding: 4px 10px;
|
||
border: 1px solid #cbd9e6;
|
||
border-radius: 8px;
|
||
font-size: 13.5px;
|
||
font-family: inherit;
|
||
outline: none;
|
||
}
|
||
.rename-input:focus {
|
||
background: #ffffff;
|
||
border-color: #5f85ad;
|
||
}
|
||
.modal-foot {
|
||
display: flex;
|
||
justify-content: flex-end;
|
||
gap: 10px;
|
||
margin-top: 14px;
|
||
}
|
||
.btn {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
min-height: 36px;
|
||
padding: 6px 14px;
|
||
border: 1px solid #4f78a5;
|
||
border-radius: 9px;
|
||
background: linear-gradient(135deg, #5f85ad, #4f78a5);
|
||
color: #ffffff;
|
||
font-family: inherit;
|
||
font-size: 13px;
|
||
cursor: pointer;
|
||
}
|
||
.btn:disabled {
|
||
cursor: not-allowed;
|
||
opacity: 0.55;
|
||
}
|
||
.btn-sm {
|
||
min-height: 28px;
|
||
padding: 3px 10px;
|
||
font-size: 12.5px;
|
||
margin-right: 6px;
|
||
}
|
||
.btn-sm:last-child {
|
||
margin-right: 0;
|
||
}
|
||
.btn-secondary {
|
||
background: #ffffff;
|
||
color: #5b6f83;
|
||
border-color: #c7d7e5;
|
||
}
|
||
.btn-secondary:hover:not(:disabled) {
|
||
color: #2f5d8b;
|
||
border-color: #95b1cb;
|
||
background: #edf5fb;
|
||
}
|
||
/* 危险动作与全站 .btn-danger 同形(实心红渐变+白字)。 */
|
||
.btn-danger {
|
||
background: linear-gradient(135deg, #c06d77, #b35f6a);
|
||
border-color: #b35f6a;
|
||
color: #ffffff;
|
||
}
|
||
.btn-danger:hover:not(:disabled) {
|
||
background: linear-gradient(135deg, #cb7c84, #b96570);
|
||
}
|
||
</style>
|