1.排程管理支持主表单元格合并,明细表显示
2.企业微信userid改为下拉框显示姓名+工号
This commit is contained in:
1 parent
05913f742f
commit
7d046862f7
5 files changed
+325
-13
No files matched your search
@@ -1379,7 +1379,7 @@ const messages = {
|
||||
noAuditData: '暂无审计记录',
|
||||
confirmUnbind: '确认解绑该用户的企业微信账号?',
|
||||
fields: {
|
||||
userId: '用户ID (user_id)',
|
||||
userSelect: '选择用户',
|
||||
wecomUserId: '企业微信 UserId',
|
||||
wecomUnionId: 'UnionId (可选)',
|
||||
enabled: '启用企业微信登录',
|
||||
@@ -2230,7 +2230,7 @@ const messages = {
|
||||
noAuditData: '暫無審計記錄',
|
||||
confirmUnbind: '確認解綁該用戶的企業微信帳號?',
|
||||
fields: {
|
||||
userId: '用戶ID (user_id)',
|
||||
userSelect: '選擇用戶',
|
||||
wecomUserId: '企業微信 UserId',
|
||||
wecomUnionId: 'UnionId (可選)',
|
||||
enabled: '啟用企業微信登入',
|
||||
@@ -3086,7 +3086,7 @@ const messages = {
|
||||
noAuditData: 'ไม่มีบันทึกการตรวจสอบ',
|
||||
confirmUnbind: 'ยืนยันยกเลิกการผูกบัญชี WeCom ของผู้ใช้นี้หรือไม่?',
|
||||
fields: {
|
||||
userId: 'รหัสผู้ใช้ (user_id)',
|
||||
userSelect: 'เลือกผู้ใช้',
|
||||
wecomUserId: 'WeCom UserId',
|
||||
wecomUnionId: 'UnionId (ไม่บังคับ)',
|
||||
enabled: 'เปิดใช้การเข้าสู่ระบบ WeCom',
|
||||
|
||||
@@ -395,7 +395,25 @@ const wecomBindForm = ref({
|
||||
wecom_userid: '',
|
||||
wecom_unionid: '',
|
||||
});
|
||||
const wecomBindUserQuery = ref('');
|
||||
const wecomBindUserDropdownOpen = ref(false);
|
||||
const wecomBindUserOptions = computed(() => {
|
||||
const keyword = wecomBindUserQuery.value.trim().toLowerCase();
|
||||
return users.value
|
||||
.filter((u) => {
|
||||
if (!keyword) return true;
|
||||
return [u.real_name, u.employee_id, String(u.id)]
|
||||
.filter(Boolean)
|
||||
.some((val) => String(val).toLowerCase().includes(keyword));
|
||||
})
|
||||
.map((u) => ({
|
||||
id: u.id,
|
||||
label: `${u.real_name || u.username} ${u.employee_id ? `(${u.employee_id})` : ''}`.trim(),
|
||||
employeeId: u.employee_id || '',
|
||||
}));
|
||||
});
|
||||
const wecomBoundOnly = ref(false);
|
||||
let wecomBindUserCloseTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
const wecomAuditSourceFilter = ref<'all' | 'wecom' | 'password'>('all');
|
||||
const wecomAuditStatusFilter = ref<'all' | 'success' | 'failed'>('all');
|
||||
const filteredWecomLoginAudits = computed(() => wecomLoginAudits.value);
|
||||
@@ -1717,6 +1735,19 @@ const loadWecomBindings = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const selectWecomBindUser = (id: number, label: string) => {
|
||||
wecomBindForm.value.user_id = id;
|
||||
wecomBindUserQuery.value = label;
|
||||
wecomBindUserDropdownOpen.value = false;
|
||||
};
|
||||
|
||||
const scheduleCloseWecomBindUserDropdown = () => {
|
||||
if (wecomBindUserCloseTimer) clearTimeout(wecomBindUserCloseTimer);
|
||||
wecomBindUserCloseTimer = setTimeout(() => {
|
||||
wecomBindUserDropdownOpen.value = false;
|
||||
}, 150);
|
||||
};
|
||||
|
||||
const loadWecomAudits = async () => {
|
||||
try {
|
||||
const params = new URLSearchParams({ limit: '200' });
|
||||
@@ -1959,6 +1990,8 @@ const bindWecomUser = async () => {
|
||||
});
|
||||
const data = await res.json().catch(() => ({}));
|
||||
if (!res.ok) throw new Error(data.error || t('admin.wecom.msg.bindFailed'));
|
||||
wecomBindUserQuery.value = '';
|
||||
wecomBindUserDropdownOpen.value = false;
|
||||
wecomBindForm.value.wecom_userid = '';
|
||||
wecomBindForm.value.wecom_unionid = '';
|
||||
await refreshWecomData();
|
||||
@@ -4754,7 +4787,35 @@ const handlePermissionImport = async (event: Event) => {
|
||||
<div class="bg-white rounded-2xl border border-gray-100 shadow-sm p-5 space-y-4">
|
||||
<h3 class="font-semibold text-gray-900">{{ t('admin.wecom.quickBind') }}</h3>
|
||||
<div class="grid grid-cols-1 md:grid-cols-4 gap-3">
|
||||
<input v-model="wecomBindForm.user_id" type="number" :placeholder="t('admin.wecom.fields.userId')" class="input-field" />
|
||||
<div class="relative md:col-span-1">
|
||||
<input
|
||||
v-model="wecomBindUserQuery"
|
||||
type="text"
|
||||
class="input-field"
|
||||
:placeholder="t('admin.wecom.fields.userSelect')"
|
||||
@focus="wecomBindUserDropdownOpen = true"
|
||||
@input="wecomBindUserDropdownOpen = true"
|
||||
@blur="scheduleCloseWecomBindUserDropdown"
|
||||
/>
|
||||
<div
|
||||
v-if="wecomBindUserDropdownOpen"
|
||||
class="absolute z-20 mt-2 max-h-64 w-72 overflow-auto rounded-xl border border-gray-200 bg-white shadow-lg"
|
||||
>
|
||||
<button
|
||||
v-for="u in wecomBindUserOptions"
|
||||
:key="u.id"
|
||||
type="button"
|
||||
class="flex w-full items-center justify-between gap-3 px-3 py-2 text-left hover:bg-blue-50"
|
||||
@mousedown.prevent="selectWecomBindUser(u.id, u.label)"
|
||||
>
|
||||
<span class="text-sm text-gray-900">{{ u.label }}</span>
|
||||
<span class="text-xs text-gray-500">{{ u.employeeId || '' }}</span>
|
||||
</button>
|
||||
<div v-if="wecomBindUserOptions.length === 0" class="px-3 py-2 text-sm text-gray-400">
|
||||
{{ t('admin.wecom.noData') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input v-model="wecomBindForm.wecom_userid" :placeholder="t('admin.wecom.fields.wecomUserId')" class="input-field md:col-span-2" />
|
||||
<input v-model="wecomBindForm.wecom_unionid" :placeholder="t('admin.wecom.fields.wecomUnionId')" class="input-field" />
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user