Procházet zdrojové kódy

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/types/components.d.ts
yangyuxuan před 7 měsíci
rodič
revize
b5f348906a

+ 20 - 0
src/types/components.d.ts

@@ -24,12 +24,20 @@ declare module 'vue' {
     DistributionMap: typeof import('./../components/Map/YztMap/DistributionMap.vue')['default']
     DrawMap: typeof import('./../components/Map/YztMap/DrawMap.vue')['default']
     Editor: typeof import('./../components/Editor/index.vue')['default']
+    ElAnchor: typeof import('element-plus/es')['ElAnchor']
+    ElAnchorLink: typeof import('element-plus/es')['ElAnchorLink']
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCard: typeof import('element-plus/es')['ElCard']
+    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
+    ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
+    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
+    ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
+    ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElDivider: typeof import('element-plus/es')['ElDivider']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -40,19 +48,31 @@ declare module 'vue' {
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
     ElIcon: typeof import('element-plus/es')['ElIcon']
+    ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
+    ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
+    ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
+    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
+    ElSlider: typeof import('element-plus/es')['ElSlider']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
     ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
+    ElTabPane: typeof import('element-plus/es')['ElTabPane']
+    ElTabs: typeof import('element-plus/es')['ElTabs']
+    ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
+    ElTimeline: typeof import('element-plus/es')['ElTimeline']
+    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
+    ElTree: typeof import('element-plus/es')['ElTree']
     ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     ExcelEditor: typeof import('./../components/ExcelEditor/index.vue')['default']

+ 83 - 126
src/views/riskPrevention/planManage/DocRecord.vue

@@ -1,94 +1,54 @@
 <template>
-    <div class="ya_bar">
-        <h3>预案内容</h3>
-        <div>
-            <el-button type="primary" @click="importDoc()"> 导入预案 </el-button>
-            <el-button type="info" plain icon="Download" @click="handleTemplate">下载导入模板</el-button>
-        </div>
+  <div class="ya_bar">
+    <h3>预案内容</h3>
+    <div>
+      <el-button type="primary" @click="importDoc()"> 导入预案 </el-button>
+      <el-button type="info" plain icon="Download" @click="handleTemplate">下载导入模板</el-button>
     </div>
-    
-    <el-card shadow="hover" v-show="doc_items.length > 0">
-        <el-tabs v-model="activeName" type="border-card" class="demo-tabs" @tab-click="handleClick2">
-            <!--
-            <el-tab-pane label="总则" name="first">
-                <div>
-                <el-row>
-                    <el-col :span="4">
-                        <el-anchor :container="containerRef" direction="vertical" type="default" :offset="30" @click="handleClick1">
-                            <el-anchor-link href="#part1" title="编制目的" />
-                            <el-anchor-link href="#part2" title="编制依据" />
-                            <el-anchor-link href="#part3" title="适用范围" />
-                            <el-anchor-link href="#part4" title="工作原则" />
-                        </el-anchor>
-                    </el-col>
-                    <el-col :span="20">
-                    <div ref="containerRef" style="height: 300px; overflow-y: auto">
-                        <div id="part1" style="height: auto; margin-top: 20px; font-size: 14px">
-                        <h3 style="font-weight: 600">1.1 编制目的</h3>
-                        <span style="text-indent: 2em"
-                            >这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容</span
-                        >
-                        </div>
-                        <div id="part2" style="height: auto; margin-top: 15px; font-size: 14px">
-                        <h3 style="font-weight: 600">1.2 编制依据</h3>
-                        <span style="text-indent: 28px"
-                            >这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容</span
-                        >
-                        </div>
-                        <div id="part3" style="height: auto; margin-top: 15px; font-size: 14px">
-                        <h3 style="font-weight: 600">1.3 适用范围</h3>
-                        <span style="text-indent: 28px"
-                            >这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容</span
-                        >
-                        </div>
-                        <div id="part4" style="height: auto; margin-top: 15px; font-size: 14px">
-                        <h3 style="font-weight: 600">1.4 工作原则</h3>
-                        <span style="text-indent: 28px"
-                            >这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容这是内容</span
-                        >
-                        </div>
-                    </div>
-                    </el-col>
-                </el-row>
-                </div>
-            </el-tab-pane>
-            -->
-            <el-tab-pane :label="item.title" :name="item.id" v-for="(item, index) in doc_items" :key="index">
-                <div>
-                    <el-row>
-                        <el-col :span="4">
-                            <el-anchor container="`containerRef${index}`" direction="vertical" type="default" :offset="30" @click="handleClick1">
-                                <el-anchor-link :href="sub_item.href" :title="sub_item.title"  :name="sub_item.id" v-for="(sub_item, index2) in item.items" :key="index2"/>
-                            </el-anchor>
-                        </el-col>
-                        <el-col :span="20">
-                            <div ref="`containerRef${index}`" style="height: 400px; overflow-y: auto">
-                                <div :id="sub_item.id" style="height: auto; margin-top: 15px; font-size: 14px" v-for="(sub_item, index3) in item.items" :key="index3">
-                                    <h3 style="font-weight: 600">{{ sub_item.title }}</h3>
-                                    <span v-html="sub_item.value"></span>
-                                </div>
-                            </div>
-                        </el-col>
-                    </el-row>
+  </div>
+
+  <el-card v-show="doc_items.length > 0" shadow="hover">
+    <el-tabs v-model="activeName" type="border-card" class="demo-tabs" @tab-click="handleClick2">
+      <el-tab-pane v-for="(item, index) in doc_items" :key="index" :label="item.title" :name="item.id">
+        <div>
+          <el-row>
+            <el-col :span="4">
+              <el-anchor :container="'#content' + index" direction="vertical" type="default" :offset="1" @click="handleClick1">
+                <el-anchor-link
+                  v-for="(sub_item, index2) in item.items"
+                  :key="index2"
+                  :href="sub_item.href"
+                  :title="sub_item.title"
+                  :name="sub_item.id"
+                />
+              </el-anchor>
+            </el-col>
+            <el-col :span="20">
+              <div :id="'content' + index" style="height: 400px; overflow-y: auto">
+                <div v-for="(sub_item, index3) in item.items" :id="sub_item.id" :key="index3" style="height: auto; margin-top: 15px; font-size: 14px">
+                  <h3 style="font-weight: 600">{{ sub_item.title }}</h3>
+                  <span v-html="sub_item.value"></span>
                 </div>
-            </el-tab-pane>
-        </el-tabs>
-    </el-card>
-
-    <el-dialog ref="formDialogRef" v-model="showImportDlg"  title="导入结构化文档" width="500px" append-to-body>
-        <el-form ref="formRef" :model="form" :rules="rules">
-            <FileUpload v-model="form.filename" :file-type="['xls', 'xlsx']" :limit="1" />
-        </el-form>
-        <template #footer>
-            <div class="dialog-footer">
-                <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
-                <el-button @click="cancel">取 消</el-button>
-            </div>
-        </template>
-    </el-dialog>
+              </div>
+            </el-col>
+          </el-row>
+        </div>
+      </el-tab-pane>
+    </el-tabs>
+  </el-card>
+  <el-dialog ref="formDialogRef" v-model="showImportDlg" title="导入结构化文档" width="500px" append-to-body>
+    <el-form ref="formRef" :model="form" :rules="rules">
+      <FileUpload v-model="form.filename" :file-type="['xls', 'xlsx']" :limit="1" />
+    </el-form>
+    <template #footer>
+      <div class="dialog-footer">
+        <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </template>
+  </el-dialog>
 </template>
 
-
 <script setup lang="ts">
 import { ref } from 'vue';
 import type { TabsPaneContext } from 'element-plus';
@@ -124,14 +84,13 @@ const handleClick2 = (tab: TabsPaneContext, event: Event) => {
 };
 
 const getData = () => {
-    getDoc({plan_id: props.id})
-    .then((res)=> {
-        doc_items.value = res.data;
-        if(doc_items.value.length > 0) {
-            activeName.value = doc_items.value[0].id;
-        }
-    })
-}
+  getDoc({ plan_id: props.id }).then((res) => {
+    doc_items.value = res.data;
+    if (doc_items.value.length > 0) {
+      activeName.value = doc_items.value[0].id;
+    }
+  });
+};
 
 const baseUrl = import.meta.env.VITE_APP_BASE_API;
 const downLoadApi = import.meta.env.VITE_APP_BASE_DOWNLOAD_API;
@@ -142,43 +101,42 @@ const formRef = ref<ElFormInstance>();
 const buttonLoading = ref(false);
 
 const form = ref({
-    filename: ''
+  filename: ''
 });
 
 const rules = reactive({
-    filename: [{ required: true, message: '导入文件不能为空', trigger: 'blur' }]
+  filename: [{ required: true, message: '导入文件不能为空', trigger: 'blur' }]
 });
 
 const importDoc = () => {
-    resetForm();
-    showImportDlg.value = true;
-}
+  resetForm();
+  showImportDlg.value = true;
+};
 
 const resetForm = () => {
-    form.value = {
-        filename:''
-    }
-    formRef.value?.resetFields();
-    formRef.value?.clearValidate();
-}
+  form.value = {
+    filename: ''
+  };
+  formRef.value?.resetFields();
+  formRef.value?.clearValidate();
+};
 
 /**提交按钮 */
 const submitForm = () => {
-    formRef.value?.validate(async (valid) => {
-        if (valid) {
-            try {
-                buttonLoading.value = true;
-                await importDocXls({ ...form.value, plan_id: props.id })
-                proxy?.$modal.msgSuccess('导入成功');
-                showImportDlg.value = false;
-                getData();
-            } finally {
-                buttonLoading.value = false;
-            }
-        }
-    })
-}
-
+  formRef.value?.validate(async (valid) => {
+    if (valid) {
+      try {
+        buttonLoading.value = true;
+        await importDocXls({ ...form.value, plan_id: props.id });
+        proxy?.$modal.msgSuccess('导入成功');
+        showImportDlg.value = false;
+        getData();
+      } finally {
+        buttonLoading.value = false;
+      }
+    }
+  });
+};
 
 /** 取消按钮 */
 const cancel = () => {
@@ -186,18 +144,17 @@ const cancel = () => {
   showImportDlg.value = false;
 };
 
-const handleTemplate = async() => {
-  location.href=baseUrl + downLoadApi + "yjya_doc_import.xlsx";
+const handleTemplate = async () => {
+  location.href = baseUrl + downLoadApi + 'yjya_doc_import.xlsx';
 };
 </script>
 
-
 <style lang="scss" scoped>
 .ya_bar {
-  display:flex;
-  flex-direction: row; 
+  display: flex;
+  flex-direction: row;
   flex-wrap: nowrap;
-  justify-content:space-between;
+  justify-content: space-between;
   align-items: center;
 }