|
@@ -53,7 +53,50 @@
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
+ <template #specificDeptName>
|
|
|
|
|
+ <el-input v-model="ruleFormData.specificDeptName" placeholder="暂无内容" :disabled="isViewMode" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #specificPersonName>
|
|
|
|
|
+ <el-input v-model="ruleFormData.specificPersonName" placeholder="暂无内容" :disabled="isViewMode" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #startTime>
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="ruleFormData.startTime"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ placeholder="暂无内容"
|
|
|
|
|
+ :disabled="isViewMode"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #endTime>
|
|
|
|
|
+ <el-date-picker
|
|
|
|
|
+ v-model="ruleFormData.endTime"
|
|
|
|
|
+ type="date"
|
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
|
+ placeholder="暂无内容"
|
|
|
|
|
+ :disabled="isViewMode"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #attachmentUrl>
|
|
|
|
|
+ <div class="file-list" v-if="ruleFormData.attachmentUrl && ruleFormData.attachmentUrl.length != 0">
|
|
|
|
|
+ <div class="file-item" v-for="file in ruleFormData.attachmentUrl" :key="file.fileId">
|
|
|
|
|
+ <span class="file-item--name">{{ file.fileName }}</span>
|
|
|
|
|
+ <div class="file-item--footer">
|
|
|
|
|
+ <el-button link type="primary" @click="previewOnline(file.fileUrl, file.fileType)"
|
|
|
|
|
+ >预览</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button link type="primary" @click.stop="downloadFile(file.fileUrl, file.fileName)"
|
|
|
|
|
+ >下载</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-else>
|
|
|
|
|
+ 暂无附件
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </template>
|
|
|
</BasicForm>
|
|
</BasicForm>
|
|
|
|
|
+ <PreviewOnline ref="previewOnlineRef" />
|
|
|
</main>
|
|
</main>
|
|
|
<footer class="safety-platform-container__footer">
|
|
<footer class="safety-platform-container__footer">
|
|
|
<el-button @click="router.back()">返回</el-button>
|
|
<el-button @click="router.back()">返回</el-button>
|
|
@@ -82,9 +125,12 @@
|
|
|
import { queryAvailableUserList } from '@/api/system/person-group';
|
|
import { queryAvailableUserList } from '@/api/system/person-group';
|
|
|
import type { addSafetyCultureFilePageQuery } from '@/api/safety-culture';
|
|
import type { addSafetyCultureFilePageQuery } from '@/api/safety-culture';
|
|
|
import type { DeptTree } from '@/types/dept/type';
|
|
import type { DeptTree } from '@/types/dept/type';
|
|
|
|
|
+ import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
|
|
|
|
|
+ import { downloadFile } from '@/views/disaster/utils';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
|
+ const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
|
|
|
|
|
|
|
|
const operate = computed(() => (route.query.operate as string) || 'safety-culture-material-create');
|
|
const operate = computed(() => (route.query.operate as string) || 'safety-culture-material-create');
|
|
|
const currentId = computed(() => Number(route.query.id));
|
|
const currentId = computed(() => Number(route.query.id));
|
|
@@ -99,15 +145,38 @@
|
|
|
ACADEMY_FILE_FORM_RULES,
|
|
ACADEMY_FILE_FORM_RULES,
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- const viewFormConfig = ref(
|
|
|
|
|
- ACADEMY_FILE_FORM_CONFIG.map((item) => ({
|
|
|
|
|
|
|
+ const viewFormConfig = ref([
|
|
|
|
|
+ // 原有的表单配置
|
|
|
|
|
+ ...ACADEMY_FILE_FORM_CONFIG.map((item) => ({
|
|
|
...item,
|
|
...item,
|
|
|
componentProps: {
|
|
componentProps: {
|
|
|
...item.componentProps,
|
|
...item.componentProps,
|
|
|
disabled: true,
|
|
disabled: true,
|
|
|
},
|
|
},
|
|
|
})),
|
|
})),
|
|
|
- );
|
|
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'specificDeptName',
|
|
|
|
|
+ label: '具体负责部门:',
|
|
|
|
|
+ slot: 'specificDeptName'
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ prop: 'specificPersonName',
|
|
|
|
|
+ label: '具体负责人:',
|
|
|
|
|
+ slot: 'specificPersonName'
|
|
|
|
|
+ },{
|
|
|
|
|
+ prop: 'startTime',
|
|
|
|
|
+ label: '计划开始日期:',
|
|
|
|
|
+ slot: 'startTime'
|
|
|
|
|
+ },{
|
|
|
|
|
+ prop: 'endTime',
|
|
|
|
|
+ label: '计划结束时间:',
|
|
|
|
|
+ slot: 'endTime'
|
|
|
|
|
+ },{
|
|
|
|
|
+ prop: 'attachmentUrl',
|
|
|
|
|
+ label: '附件:',
|
|
|
|
|
+ slot: 'attachmentUrl'
|
|
|
|
|
+ }
|
|
|
|
|
+ ]);
|
|
|
|
|
|
|
|
const computedFormConfig = computed(() => {
|
|
const computedFormConfig = computed(() => {
|
|
|
if (isViewMode.value) {
|
|
if (isViewMode.value) {
|
|
@@ -215,8 +284,13 @@
|
|
|
ruleFormData.categoryName = res.categoryName != null ? String(res.categoryName) : '';
|
|
ruleFormData.categoryName = res.categoryName != null ? String(res.categoryName) : '';
|
|
|
ruleFormData.responsibleDeptId = res.responsibleDeptId != null ? Number(res.responsibleDeptId) : undefined;
|
|
ruleFormData.responsibleDeptId = res.responsibleDeptId != null ? Number(res.responsibleDeptId) : undefined;
|
|
|
ruleFormData.responsiblePersonId =
|
|
ruleFormData.responsiblePersonId =
|
|
|
- res.responsiblePersonId != null ? Number(res.responsiblePersonId) : undefined;
|
|
|
|
|
|
|
+ res.responsiblePersonId != null ? Number(res.responsiblePersonId) : undefined;
|
|
|
ruleFormData.cooperateDeptIds = normalizeToNumberArray(res.cooperateDeptIds);
|
|
ruleFormData.cooperateDeptIds = normalizeToNumberArray(res.cooperateDeptIds);
|
|
|
|
|
+ ruleFormData.specificDeptName = res.specificDeptName || '';
|
|
|
|
|
+ ruleFormData.specificPersonName = res.specificPersonName || '';
|
|
|
|
|
+ ruleFormData.startTime = res.startTime || undefined;
|
|
|
|
|
+ ruleFormData.endTime = res.endTime || undefined;
|
|
|
|
|
+ ruleFormData.attachmentUrl = JSON.parse(res.attachmentUrl || '[]');
|
|
|
}
|
|
}
|
|
|
cloneRuleFormData();
|
|
cloneRuleFormData();
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -250,6 +324,12 @@
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const previewOnline = (url: string | undefined, type) => {
|
|
|
|
|
+ if (url) {
|
|
|
|
|
+ previewOnlineRef.value?.open(url, type);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
cloneRuleFormData();
|
|
cloneRuleFormData();
|
|
|
loadDeptTreeData();
|
|
loadDeptTreeData();
|