新增教研室和教员的时候,同步创建部门和教员账号

This commit is contained in:
2026-09-17 12:00:44 +08:00
parent f7299c36e8
commit 95a3571c69
25 changed files with 1452 additions and 50 deletions
@@ -0,0 +1,112 @@
<template>
<el-dialog
:title="title"
:visible.sync="visible"
width="640px"
append-to-body
:close-on-click-modal="false"
>
<div class="align-summary">
<span>新建 <b class="ok">{{ result.createCount || 0 }}</b></span>
<span>复用 <b>{{ result.reuseCount || 0 }}</b></span>
<span>跳过 <b class="warn">{{ result.skipCount || 0 }}</b></span>
<span>失败 <b class="err">{{ result.failCount || 0 }}</b></span>
</div>
<div class="align-detail">
<template v-for="sec in sections">
<div v-if="sec.list && sec.list.length" :key="sec.key" class="align-sec">
<div class="sec-title" :class="sec.cls">{{ sec.label }}({{ sec.list.length }})</div>
<div class="sec-body">
<div v-for="(item, idx) in sec.list" :key="sec.key + idx">{{ item }}</div>
</div>
</div>
</template>
<el-empty v-if="isEmpty" description="无需处理" :image-size="60" />
</div>
<div slot="footer">
<el-button type="primary" @click="visible = false">关 闭</el-button>
</div>
</el-dialog>
</template>
<script>
/**
* 组织/账号对齐结果清单弹窗。
* result: { createCount, reuseCount, skipCount, failCount, createList, reuseList, skipList, failList, message }
*/
export default {
name: 'OrgSyncResultDialog',
props: {
title: { type: String, default: '对齐结果' }
},
data() {
return {
visible: false,
result: {}
}
},
computed: {
sections() {
const r = this.result || {}
return [
{ key: 'create', label: '新建', cls: 'ok', list: r.createList },
{ key: 'reuse', label: '复用', cls: '', list: r.reuseList },
{ key: 'skip', label: '跳过', cls: 'warn', list: r.skipList },
{ key: 'fail', label: '失败', cls: 'err', list: r.failList }
]
},
isEmpty() {
const r = this.result || {}
return !(r.createCount || r.reuseCount || r.skipCount || r.failCount)
}
},
methods: {
open(result) {
this.result = result || {}
this.visible = true
}
}
}
</script>
<style scoped lang="scss">
.align-summary {
display: flex;
gap: 24px;
margin-bottom: 12px;
font-size: 14px;
b { color: #409eff; }
b.ok { color: #67c23a; }
b.warn { color: #e6a23c; }
b.err { color: #f56c6c; }
}
.align-detail {
max-height: 50vh;
overflow-y: auto;
.align-sec {
margin-bottom: 10px;
.sec-title {
font-weight: 600;
margin-bottom: 4px;
color: #303133;
&.ok { color: #67c23a; }
&.warn { color: #e6a23c; }
&.err { color: #f56c6c; }
}
.sec-body {
padding: 8px 10px;
background: #f5f7fa;
border-radius: 4px;
font-size: 12px;
color: #606266;
line-height: 1.8;
}
}
}
</style>