feat(权限): 新增 v-permission 按钮级权限指令并移除前端权限别名
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
} from '@/utils/signing-fields'
|
||||
|
||||
import EditorWangPane from './editors/EditorWangPane.vue'
|
||||
import { DOC_TEMPLATE_PERMISSIONS } from '../permissions'
|
||||
import type { DocumentTemplate, TemplateEditorForm } from '../types'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -30,6 +31,11 @@ const emit = defineEmits<{
|
||||
save: [form: TemplateEditorForm]
|
||||
}>()
|
||||
|
||||
/** 新增文书用创建权限,编辑已有文书用编辑权限;后端仍会再校验一次 */
|
||||
const savePermission = computed(() =>
|
||||
props.template ? DOC_TEMPLATE_PERMISSIONS.edit : DOC_TEMPLATE_PERMISSIONS.create,
|
||||
)
|
||||
|
||||
// Word 自维护方案:科室把文书从 Word/WPS 直接粘贴进来(保留表格与基本格式),
|
||||
// 或上传 .docx 由 mammoth 转换;签署时由交互管线识别"勾选"表并转为签署域。
|
||||
// 编辑引擎固定为 WangEditor(MIT)。更换引擎只需新增一个实现 EditorPaneHandle 的面板组件,
|
||||
@@ -389,7 +395,14 @@ function save() {
|
||||
<footer class="dialog-footer">
|
||||
<p>保存后进入文书库;签署时自动填充占位符,"勾选"表转为交互勾选。</p>
|
||||
<button type="button" class="footer-button secondary" @click="emit('close')">取消</button>
|
||||
<button type="button" class="footer-button primary" @click="save">保存文书</button>
|
||||
<button
|
||||
v-permission.disable="savePermission"
|
||||
type="button"
|
||||
class="footer-button primary"
|
||||
@click="save"
|
||||
>
|
||||
保存文书
|
||||
</button>
|
||||
</footer>
|
||||
</section>
|
||||
</div>
|
||||
@@ -716,6 +729,14 @@ function save() {
|
||||
filter: brightness(0.96);
|
||||
}
|
||||
|
||||
.footer-button:disabled {
|
||||
color: #aebbc0;
|
||||
cursor: not-allowed;
|
||||
background: #f1f5f6;
|
||||
border-color: #dce5e8;
|
||||
filter: none;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.meta-grid {
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
|
||||
Reference in New Issue
Block a user