浏览代码

新增 演练范本详情弹框

zhulu 1 年之前
父节点
当前提交
fa58dec20b
共有 2 个文件被更改,包括 137 次插入2 次删除
  1. 122 0
      src/views/core/drill/drillDictionary/dialog.info.vue
  2. 15 2
      src/views/core/drill/drillDictionary/index.vue

+ 122 - 0
src/views/core/drill/drillDictionary/dialog.info.vue

@@ -0,0 +1,122 @@
+<template>
+  <div class="edu-training-edit">
+    <DialogCom title="演练范本详情" :visible.sync="isShow" width="1000px" append-to-body>
+      <div class="page-body">
+        <el-descriptions
+          class="contentArea"
+          :column="1"
+          size="medium"
+          border
+          :contentStyle="content_style"
+          :label-style="labelStyle"
+        >
+          <el-descriptions-item labelClassName="gx_info_label" label="演练项目">
+            {{
+              getLabel(dict.type.core_drill_type, formData.drillType, "未知")
+            }}
+          </el-descriptions-item>
+          <el-descriptions-item labelClassName="gx_info_label" label="演练场景">
+            {{ formData.drillProjects }}
+          </el-descriptions-item>
+          <el-descriptions-item
+            labelClassName="gx_info_label"
+            span="2"
+            label="预设案由"
+          >
+            <span class="text_nbsp"> {{ formData.defaultCause }}</span>
+          </el-descriptions-item>
+        </el-descriptions>
+      </div>
+
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onHide">关闭</el-button>
+      </div>
+    </DialogCom>
+  </div>
+</template>
+
+<script>
+import { mapState, mapMutations } from "vuex";
+import { getDrillDictionary } from "@/api/core/drill/drillDictionary";
+import { getLabel } from "@/views/commonOption";
+export default {
+  components: { },
+  dicts: ["drill_task_status", "core_drill_type"],
+  data() {
+    const params = this.$route.params;
+    return {
+      id: params ? params.id : null,
+      isShow: false,
+      formData: this.reset(),
+      drillTypeOptions: [],
+      formFileListDefualtValue: [],
+      labelStyle: {
+        color: "#000",
+        "text-align": "center",
+        height: "40px",
+        "min-width": "150px",
+        "word-break": "keep-all",
+      },
+      content_style: {
+        "text-align": "left",
+        "min-width": "300px",
+        "word-break": "break-all",
+      },
+      iconClasses: ["icon-rate-face-1", "icon-rate-face-2", "icon-rate-face-3"], // 等同于 { 2: 'icon-rate-face-1', 4: { value: 'icon-rate-face-2', excluded: true }, 5: 'icon-rate-face-3' }
+    };
+  },
+  props: {},
+  watch: {},
+  computed: {
+    ...mapState(["loginUser"]),
+  },
+  methods: {
+    ...mapMutations([]),
+    getLabel,
+    reset(other = {}) {
+      return {
+        id: null,
+        drillType: null,       
+        defaultCause: null,
+        drillProjects: null,
+        ...other,
+      };
+    },
+    async refresh(id, other) {
+      if (!id) {
+        this.reset(other);
+      } else {
+        getDrillDictionary(id).then((response) => {
+          this.formData = response.data;
+          this.loading = false;
+      });
+        // getDrillTask(id).then((response) => {
+        //   this.formData = response.data;
+        //   this.formFileListDefualtValue = response.data.fileList;
+        //   this.formData.signImageList = this.getSingImageList();
+        //   this.loading = false;
+        // });
+      }
+    },
+    async show(id, other = {}) {
+      this.id = id;
+      await this.refresh(id, other);
+      this.isShow = true;
+    },
+    // 事件
+    onHide() {
+      this.isShow = false;
+    },
+    initDrillTypeOptions() {
+      initList().then((response) => {
+        this.drillTypeOptions = response;
+      });
+    },
+    // 事件
+    //apimark//
+  },
+  mounted() {},
+};
+</script>
+
+<style lang="scss" scoped></style>

+ 15 - 2
src/views/core/drill/drillDictionary/index.vue

@@ -177,6 +177,14 @@
                 <el-button
                   size="mini"
                   type="text"
+                  icon="el-icon-view"
+                  @click="handleDetail(scope.row.id)"
+                  v-hasPermi="['core:drillDictionary:list']"
+                  >详情
+                </el-button>
+                <el-button
+                  size="mini"
+                  type="text"
                   icon="el-icon-edit-outline"
                   v-if="canEdit(scope.row)"
                   @click="handleUpdate(scope.row)"
@@ -260,7 +268,8 @@
         <el-button @click="cancel">取 消</el-button>
       </div>
     </DialogCom>
-  </div>
+    <dialog-info ref="infoDialog" @success="handleQuery()"></dialog-info>
+  </div>  
 </template>
 
 <script>
@@ -277,10 +286,11 @@ import tableList from "@/mixins/tableList";
 import {queryKnowledgeList} from "@/api/core/edu/knowledge";
 import KTextarea from "@/components/common/textarea.vue";
 import {mapGetters} from "vuex";
+import DialogInfo from "./dialog.info";
 
 export default {
   name: "DrillDictionary",
-  components: {OrgTree, BtnTip, KTextarea},
+  components: {OrgTree, BtnTip, KTextarea,DialogInfo},
   dicts: ["core_drill_type", "core_drill_category"],
   mixins: [tableList],
   data() {
@@ -415,6 +425,9 @@ export default {
         this.title = "编辑演练范本";
       });
     },
+    handleDetail(id) {
+      this.$refs["infoDialog"].show(id, {});
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate((valid) => {