xiaodai2017 2 years ago
parent
commit
8576a466a8

+ 3 - 3
src/views/system/updates/components/update-modal.vue

@@ -108,8 +108,8 @@ defineExpose({
         <ElCol :span="12">
           <ElFormItem label="类型" prop="sys_type">
             <ElSelect style="width: 100%" v-model="formData.sys_type">
-              <ElOption value="MSG" label="维护公告" />
-              <ElOption value="VER" label="版本信息" />
+              <ElOption value="MSG" label="公告" />
+              <ElOption value="VER" label="版本" />
             </ElSelect>
           </ElFormItem>
         </ElCol>
@@ -126,7 +126,7 @@ defineExpose({
           </ElFormItem>
         </ElCol>
         <ElCol :span="12">
-          <ElFormItem label="时间">
+          <ElFormItem label="时间" prop="addtime">
             <ElDatePicker
               value-format="YYYY-MM-DD HH:mm:ss"
               v-model="formData.addtime"

+ 21 - 8
src/views/system/updates/config/content.config.ts

@@ -1,6 +1,7 @@
 import { ContentConfig } from "/@/components/PageContent";
 import { httpList, httpDelete } from "/@/api/system/updates";
-
+import { h } from "vue";
+import { ElTag } from "element-plus";
 const columns = [
   {
     type: "expand",
@@ -8,23 +9,35 @@ const columns = [
   },
   {
     label: "版本号",
-    prop: "version",
-    minWidth: 180
+    prop: "version"
+  },
+  {
+    label: "类型",
+    prop: "sys_type",
+    cellRenderer({ row }) {
+      return h(
+        ElTag,
+        {
+          type: String(row.status) === "VER" ? "success" : "",
+          size: "small"
+        },
+        {
+          default: () => (String(row.status) === "VER" ? "版本" : "公告")
+        }
+      );
+    }
   },
   {
     label: "更新模块",
-    prop: "module",
-    minWidth: 180
+    prop: "module"
   },
   {
     label: "更新时间",
-    prop: "addtime",
-    minWidth: 180
+    prop: "addtime"
   },
   {
     label: "操作",
     fixed: "right",
-    width: 120,
     slot: "operation"
   }
 ];

+ 4 - 10
src/views/system/updates/index.vue

@@ -49,16 +49,10 @@ function getUpdateContent(content: string) {
       :get-content-ref="ref => (pageContenrRef = ref)"
     >
       <template #expand="row">
-        <div class="ml-[40px]">
-          <h1 class="font-bold ml-[10px]">更新内容</h1>
-          <div class="pl-[20px]">
-            <p
-              :class="`ml-[${content.indexOf('--') !== -1 ? '20px' : '0px'}]`"
-              v-for="(content, index) in getUpdateContent(row.system)"
-              :key="index"
-            >
-              {{ content }}
-            </p>
+        <div class="ml-[60px]">
+          <h1 class="font-bold">更新内容</h1>
+          <div class="ml-[5px]">
+            <div v-html="row.system" />
           </div>
         </div>
       </template>