192 lines
4.6 KiB
Plaintext
192 lines
4.6 KiB
Plaintext
<template>
|
|
<view class="admin-page">
|
|
<view class="admin-sections">
|
|
<!-- 搜索栏 -->
|
|
<view class="admin-card filter-card">
|
|
<view class="filter-row">
|
|
<view class="filter-item">
|
|
<text class="label">搜索:</text>
|
|
<input class="filter-input" placeholder="请输入语言Code" />
|
|
</view>
|
|
<button class="btn primary" @click="onSearch">搜索</button>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 操作栏 -->
|
|
<view class="action-bar header-actions">
|
|
<button class="btn primary" @click="addRegion">添加语言地区</button>
|
|
</view>
|
|
|
|
<!-- 表格内容 -->
|
|
<view class="admin-card content-card">
|
|
<view class="table-container list-table">
|
|
<view class="table-header">
|
|
<view class="col col-id"><text>编号</text></view>
|
|
<view class="col col-code"><text>浏览器语言识别码</text></view>
|
|
<view class="col col-desc"><text>语言说明</text></view>
|
|
<view class="col col-lang"><text>关联语言</text></view>
|
|
<view class="col col-action"><text>操作</text></view>
|
|
</view>
|
|
|
|
<view class="table-body">
|
|
<view v-for="item in dataList" :key="item.id" class="table-row">
|
|
<view class="col col-id"><text>{{ item.id }}</text></view>
|
|
<view class="col col-code"><text>{{ item.code }}</text></view>
|
|
<view class="col col-desc"><text>{{ item.desc }}</text></view>
|
|
<view class="col col-lang"><text>{{ item.lang || '暂无' }}</text></view>
|
|
<view class="col col-action">
|
|
<text class="action-btn" @click="editItem(item)">编辑</text>
|
|
<text class="action-btn divider">|</text>
|
|
<text class="action-btn danger" @click="deleteItem(item)">删除</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="uts">
|
|
import { ref } from 'vue'
|
|
|
|
const dataList = ref([
|
|
{ id: 346, code: 'zh-HK', desc: '中文(繁体, 香港特别行政区)', lang: '' },
|
|
{ id: 344, code: 'zh-MO', desc: '中文(繁体, 澳门特别行政区)', lang: '' },
|
|
{ id: 343, code: 'zh-Hant', desc: '中文(繁体)', lang: '繁体中文(zh-Hant)' },
|
|
{ id: 342, code: 'zh', desc: '中文', lang: '' },
|
|
{ id: 340, code: 'vi', desc: '越南语', lang: '' },
|
|
{ id: 339, code: 'yo-NG', desc: '约鲁巴语(尼日利亚)', lang: '' },
|
|
{ id: 337, code: 'en-GB', desc: '英语(英国)', lang: '' },
|
|
{ id: 336, code: 'en-IN', desc: '英语(印度)', lang: '' },
|
|
{ id: 335, code: 'en-JM', desc: '英语(牙买加)', lang: '' },
|
|
{ id: 334, code: 'en-NZ', desc: '英语(新西兰)', lang: '' }
|
|
])
|
|
|
|
function onSearch() {
|
|
uni.showToast({ title: '搜索中...', icon: 'none' })
|
|
}
|
|
|
|
function addRegion() {
|
|
uni.showToast({ title: '添加语言地区', icon: 'none' })
|
|
}
|
|
|
|
function editItem(item: any) {
|
|
uni.showToast({ title: '编辑: ' + item.code, icon: 'none' })
|
|
}
|
|
|
|
function deleteItem(item: any) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
content: '确定要删除此地区配置吗?',
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
uni.showToast({ title: '删除成功' })
|
|
}
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
.admin-page {
|
|
padding: 24px;
|
|
background-color: #f5f7f9;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.filter-row {
|
|
display: flex;
|
|
flex-direction: row;
|
|
align-items: center;
|
|
gap: 16px;
|
|
}
|
|
|
|
.label {
|
|
font-size: 14px;
|
|
color: #333;
|
|
}
|
|
|
|
.filter-input {
|
|
width: 200px;
|
|
height: 32px;
|
|
border: 1px solid #d9d9d9;
|
|
border-radius: 4px;
|
|
padding: 0 10px;
|
|
font-size: 14px;
|
|
}
|
|
|
|
.btn {
|
|
height: 32px;
|
|
padding: 0 16px;
|
|
border-radius: 4px;
|
|
font-size: 14px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
border: none;
|
|
}
|
|
|
|
.btn.primary {
|
|
background-color: #1890ff;
|
|
color: #fff;
|
|
}
|
|
|
|
.action-bar {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.admin-card {
|
|
background-color: #fff;
|
|
border-radius: 4px;
|
|
padding: 0;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.table-container {
|
|
width: 100%;
|
|
}
|
|
|
|
.table-header {
|
|
display: flex;
|
|
flex-direction: row;
|
|
background-color: #fafafa;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
}
|
|
|
|
.table-row {
|
|
display: flex;
|
|
flex-direction: row;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
}
|
|
|
|
.col {
|
|
padding: 16px;
|
|
display: flex;
|
|
align-items: center;
|
|
font-size: 14px;
|
|
color: #333;
|
|
}
|
|
|
|
.col-id { width: 100px; }
|
|
.col-code { flex: 1; }
|
|
.col-desc { flex: 2; }
|
|
.col-lang { flex: 1; }
|
|
.col-action { width: 150px; justify-content: flex-end; }
|
|
|
|
.action-btn {
|
|
color: #1890ff;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.action-btn.danger {
|
|
color: #ff4d4f;
|
|
}
|
|
|
|
.action-btn.divider {
|
|
margin: 0 8px;
|
|
color: #e8e8e8;
|
|
}
|
|
</style>
|