Browse Source

feat: 样式优化,新闻页面表格新增修改是否展示封面列

mnisting 4 tháng trước cách đây
mục cha
commit
a19058dc0a

+ 9 - 0
src/api/newsManage/index.js

@@ -44,6 +44,15 @@ export const editNewsStatus = (query) => {
   });
 };
 
+// 修改封面展示状态 /business/officialAccount/updateShowCoverPic
+export const updateShowCoverPic = (query) => {
+  return request({
+    url: "/business/officialAccount/updateShowCoverPic",
+    method: "put",
+    params: query,
+  });
+};
+
 // 删除 /business/officialAccount/{officialAccountId}
 export const delNews = (officialAccountId) => {
   return request({

+ 51 - 3
src/views/newsManage/index.vue

@@ -54,7 +54,7 @@
       <el-table-column
         label="编号"
         prop="officialAccountId"
-        width="120"
+        width="80"
         align="center"
       />
       <el-table-column
@@ -62,7 +62,7 @@
         prop="title"
         align="center"
         :show-overflow-tooltip="true"
-        width="150"
+        min-width="300"
       />
       <el-table-column
         label="作者"
@@ -71,7 +71,12 @@
         :show-overflow-tooltip="true"
         width="150"
       />
-      <el-table-column label="跳转地址" prop="url" align="center" />
+      <el-table-column
+        label="跳转地址"
+        prop="url"
+        align="center"
+        min-width="300"
+      />
       <el-table-column
         label="类别"
         prop="publishType"
@@ -79,6 +84,25 @@
         :formatter="typeFormatter"
       />
 
+      <el-table-column label="封面" align="center" prop="thumbUrl" width="100">
+        <template slot-scope="scope">
+          <image-preview :src="scope.row.thumbUrl" :width="50" :height="50" />
+        </template>
+      </el-table-column>
+      <el-table-column label="是否显示封面" align="center" width="100">
+        <template slot-scope="scope">
+          <el-switch
+            v-model="scope.row.showCoverPic"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            active-value="1"
+            inactive-value="0"
+            @change="changeShowPic(scope.row)"
+          >
+          </el-switch>
+        </template>
+      </el-table-column>
+
       <el-table-column label="状态" align="center">
         <template slot-scope="scope">
           <el-switch
@@ -104,7 +128,9 @@
       </el-table-column>
       <el-table-column
         label="操作"
+        fixed="right"
         align="center"
+        width="160"
         class-name="small-padding fixed-width"
       >
         <template slot-scope="scope">
@@ -154,6 +180,7 @@ import {
   editNews,
   editNewsStatus,
   delNews,
+  updateShowCoverPic,
 } from "@/api/newsManage";
 
 import addNewsDlg from "./components/addNews.vue";
@@ -289,6 +316,27 @@ export default {
     handleSelectionChange(selection) {
       this.selectRows = selection;
     },
+    // 修改封面展示状态
+    changeShowPic(row) {
+      let params = {
+        officialAccountIds: row.officialAccountId,
+        showCoverPic: row.showCoverPic,
+      };
+      // console.log(params, 1211);
+      this.$modal
+        .confirm("是否确认修改封面展示状态")
+        .then(function () {
+          return updateShowCoverPic(params);
+        })
+        .then((res) => {
+          this.getList();
+          this.$modal.msgSuccess(res.msg);
+        })
+        .catch((err) => {
+          console.log(err, "err");
+          row.showCoverPic = row.showCoverPic === "0" ? "1" : "0";
+        });
+    },
     // 修改招聘信息状态
     changeStatus(row) {
       let params = {

+ 15 - 6
src/views/recruitInfoManage/index.vue

@@ -101,22 +101,29 @@
     <!-- @selection-change="handleSelectionChange" -->
     <el-table v-loading="loading" :data="tableData">
       <!-- <el-table-column type="selection" width="55" align="center" /> -->
-      <el-table-column label="职位编号" prop="hireInfoId" width="120" />
+      <el-table-column
+        label="职位编号"
+        prop="hireInfoId"
+        width="80"
+        align="center"
+      />
       <el-table-column
         label="职位名称"
         prop="jobName"
         :show-overflow-tooltip="true"
-        width="150"
+        width="200"
+        align="center"
       />
       <el-table-column
         label="工作地点"
         prop="jobLocation"
         :show-overflow-tooltip="true"
-        width="150"
+        width="200"
+        align="center"
       />
-      <el-table-column label="薪资" prop="salary" />
-      <el-table-column label="资历" prop="seniority" />
-      <el-table-column label="福利" prop="benefit" />
+      <el-table-column label="薪资" prop="salary" align="center" />
+      <el-table-column label="资历" prop="seniority" align="center" />
+      <el-table-column label="福利" prop="benefit" align="center" width="360" />
 
       <el-table-column label="状态" align="center">
         <template slot-scope="scope">
@@ -144,6 +151,8 @@
       <el-table-column
         label="操作"
         align="center"
+        fixed="right"
+        width="160"
         class-name="small-padding fixed-width"
       >
         <template slot-scope="scope">