|
|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="basic-info">
|
|
|
<!-- 展示模式:按来源路由分支展示 -->
|
|
|
- <div v-if="props.editOrShow === 'show'">
|
|
|
+ <div class="show-view-content" v-if="props.editOrShow === 'show'">
|
|
|
<!-- criminal 展示 -->
|
|
|
<div v-if="props.fromRoute === 'criminal'" class="camera-from show-view">
|
|
|
<div class="form-title">案件信息</div>
|
|
|
@@ -26,7 +26,7 @@
|
|
|
<!-- 编辑模式:按来源路由分支展示 -->
|
|
|
<template v-else>
|
|
|
<!-- criminal 编辑(复原 edit.vue) -->
|
|
|
- <el-form v-if="props.fromRoute === 'criminal'" ref="form" label-width="84px" class="camera-from">
|
|
|
+ <el-form v-if="props.fromRoute === 'criminal'" ref="form" label-width="96px" class="camera-from">
|
|
|
<div class="form-title">案件信息</div>
|
|
|
<el-form-item label="案件名称">
|
|
|
<el-input v-model="bindFire.caseTitle" maxlength="50" placeholder="请输入案件名称" />
|
|
|
@@ -41,7 +41,7 @@
|
|
|
</el-form>
|
|
|
|
|
|
<!-- fire 编辑(原有) -->
|
|
|
- <el-form v-else ref="form" label-width="84px" class="camera-from">
|
|
|
+ <el-form v-else ref="form" label-width="100px" class="camera-from">
|
|
|
<div class="form-title">案件信息</div>
|
|
|
<el-form-item label="项目编号" class="mandatory">
|
|
|
<el-input
|
|
|
@@ -187,6 +187,7 @@ const getSnapshot = () => {
|
|
|
const autoSave = async () => {
|
|
|
// criminal 路由不触发 fire 自动保存
|
|
|
if (props.fromRoute === 'criminal') return;
|
|
|
+ if (props.editOrShow === 'show') return;
|
|
|
if (!isValidForAutoSave()) return;
|
|
|
const snapshot = getSnapshot();
|
|
|
if (snapshot === lastSavedSnapshot) return;
|
|
|
@@ -241,6 +242,7 @@ const getSnapshotCriminal = () => {
|
|
|
|
|
|
const autoSaveCriminal = async () => {
|
|
|
if (props.fromRoute !== 'criminal') return;
|
|
|
+ if (props.editOrShow === 'show') return;
|
|
|
if (!isValidForAutoSaveCriminal()) return;
|
|
|
const snapshot = getSnapshotCriminal();
|
|
|
if (snapshot === lastSavedSnapshotCriminal) return;
|
|
|
@@ -270,6 +272,7 @@ const triggerAutoSaveCriminal = debounce(() => autoSaveCriminal(), 800);
|
|
|
|
|
|
// 深度监听表单对象;日期单独监听
|
|
|
watch(bindFire, () => {
|
|
|
+ if (props.editOrShow === 'show') return;
|
|
|
if (props.fromRoute === 'criminal') {
|
|
|
triggerAutoSaveCriminal();
|
|
|
} else {
|
|
|
@@ -277,6 +280,7 @@ watch(bindFire, () => {
|
|
|
}
|
|
|
}, { deep: true });
|
|
|
watch(accidentDate, () => {
|
|
|
+ if (props.editOrShow === 'show') return;
|
|
|
if (props.fromRoute !== 'criminal') triggerAutoSave();
|
|
|
});
|
|
|
|
|
|
@@ -287,12 +291,14 @@ onMounted(() => {
|
|
|
if (!title || !String(title).trim()) return;
|
|
|
if (props.fromRoute === 'criminal') {
|
|
|
(bindFire.value as any).caseTitle = title;
|
|
|
- // criminal:重命名后立即自动保存
|
|
|
- autoSaveCriminal();
|
|
|
+ if (props.editOrShow !== 'show') {
|
|
|
+ autoSaveCriminal();
|
|
|
+ }
|
|
|
} else {
|
|
|
(bindFire.value as any).projectName = title;
|
|
|
- // fire 路由:直接调用 autoSave 立即保存
|
|
|
- autoSave();
|
|
|
+ if (props.editOrShow !== 'show') {
|
|
|
+ autoSave();
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
window.addEventListener('fireDetails:renameTitle', renameHandler as any);
|
|
|
@@ -303,6 +309,7 @@ onMounted(() => {
|
|
|
|
|
|
defineExpose<QuiskExpose>({
|
|
|
async submit() {
|
|
|
+ if (props.editOrShow === 'show') return;
|
|
|
if (props.fromRoute === 'criminal') {
|
|
|
if (!bindFire.value.caseTitle || !bindFire.value.caseTitle.trim()) {
|
|
|
ElMessage.error("案件名称不能为空");
|
|
|
@@ -377,16 +384,19 @@ const handleMapConfirm = (LocationInfo: any) => {
|
|
|
<style scoped lang="scss">
|
|
|
.basic-info{
|
|
|
width: 100%;
|
|
|
- height: calc(100% - 200px);
|
|
|
+ height: calc(100% - 174px);
|
|
|
background: #f5f7fa;
|
|
|
padding: 24px 0;
|
|
|
+ .show-view-content{
|
|
|
+ height: calc(100% - 20px);
|
|
|
+ }
|
|
|
}
|
|
|
.camera-from {
|
|
|
width: 60%;
|
|
|
- height: calc(100% - 140px);
|
|
|
+ height: calc(100% - 166px);
|
|
|
background: #FFFFFF;
|
|
|
margin: 0 auto;
|
|
|
- padding: 48px 100px 48px;
|
|
|
+ padding: 48px 280px 48px 280px;
|
|
|
overflow: auto;
|
|
|
.form-title{
|
|
|
text-align: center;
|
|
|
@@ -401,11 +411,13 @@ const handleMapConfirm = (LocationInfo: any) => {
|
|
|
</style>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
+// todo: 滚动留白
|
|
|
.show-view {
|
|
|
.info-row {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
- margin-bottom: 16px;
|
|
|
+ margin-bottom: 40px;
|
|
|
+ // todo: 头部对齐
|
|
|
.label {
|
|
|
width: 84px;
|
|
|
color: rgba(0, 0, 0, 0.85);
|
|
|
@@ -417,4 +429,12 @@ const handleMapConfirm = (LocationInfo: any) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.camera-from{
|
|
|
+ :deep(.el-form-item){
|
|
|
+ margin-bottom: 40px;
|
|
|
+ }
|
|
|
+ :deep(.el-form-item__label){
|
|
|
+ padding-right: 24px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|