schangxiang@126.com
2024-11-21 60735779c303c2dd10feea45d7fd761103b225e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<template>
    <div class="sys-dict-container">
        <el-row :gutter="8" style="width: 100%; height: 100%; flex: 1">
            <el-col :span="24" :xs="24" style="display: flex; height: 100%; flex: 1">
                <el-card class="full-table" shadow="hover" :body-style="{ height: 'calc(100% - 51px)' }">
                    <template #header>
                        <el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"><ele-Collection /></el-icon>帮助文档内容
                        <span v-show="docTitle">: {{ docTitle }}</span>
                    </template>
                    <div class="boxView">
                        <div v-html="valueHtml"></div>
                    </div>
                </el-card>
            </el-col>
        </el-row>
    </div>
</template>
 
<script lang="ts" setup name="sysDict">
import { onMounted, reactive, ref, watch } from 'vue';
import { ElMessageBox, ElMessage } from 'element-plus';
import { pageWmsSysHelpDoc } from '/@/api/main/WmsSystem/wmsSysHelpDoc';
import { useRoute } from 'vue-router';
const route = useRoute();
const state = reactive({
    loading: false,
});
 
console.log(route);
console.log(route.meta);
console.log(route.meta.idMenu);
const docTitle = ref("");
docTitle.value = route.meta.title || "";
const valueHtml = ref('');
// 查询字典操作
const handleDictTypeQuery = async () => {
    if (!route.meta.idMenu) {
        debugger;
        console.log('路由id未找到');
        return;
    }
    state.loading = true;
    var res = await pageWmsSysHelpDoc({
        helpFlagId: route.meta.idMenu,
        pageSize: 1,
    });
    if (res.data.type == 'success') {
        var arr = res.data.result?.items;
        if (arr.length > 0 && arr.length == 1) {
            valueHtml.value = arr[0].helpContext;
        } else {
            valueHtml.value = '';
        }
    }
    state.loading = false;
};
 
onMounted(async () => {
    handleDictTypeQuery();
});
</script>
<style>
img{
    max-width: 100% !important;
}
.boxView{
    height: calc(100vh - 200px);
    overflow-y: auto;
}
</style>