Bladeren bron

支部园地风采、支部园地宣传

Wang Zi Wen 2 jaren geleden
bovenliggende
commit
50c3c1a135

+ 1 - 0
ruoyi-system/src/main/resources/mapper/branch/TBranchDemeanorMapper.xml

@@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by IS_PINNED desc
     </select>
     
     <select id="selectTBranchDemeanorByDemeanorId" parameterType="Long" resultMap="TBranchDemeanorResult">

+ 1 - 0
ruoyi-system/src/main/resources/mapper/branch/TBranchPublicizeMapper.xml

@@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by IS_PINNED desc
     </select>
     
     <select id="selectTBranchPublicizeByPublicizeId" parameterType="Long" resultMap="TBranchPublicizeResult">

+ 2 - 2
ruoyi-ui/src/views/branch/zbfc/demeanor/index.vue

@@ -102,7 +102,7 @@
             icon="el-icon-select"
             @click="handlePin (scope.row)"
             v-if="scope.row.isPinned == 0"
-            v-hasPermi="['system:demeanor:edit']"
+            v-hasPermi="['branch:demeanor:edit']"
           >置顶</el-button>
           <el-button
             size="mini"
@@ -110,7 +110,7 @@
             icon="el-icon-select"
             @click="handlePin (scope.row)"
             v-if="scope.row.isPinned == 1"
-            v-hasPermi="['system:demeanor:edit']"
+            v-hasPermi="['branch:demeanor:edit']"
           >取消置顶</el-button>
           <el-button
             size="mini"

+ 57 - 2
ruoyi-ui/src/views/branch/zbfc/publicize/index.vue

@@ -77,7 +77,17 @@
     <el-table v-loading="loading" :data="publicizeList" @selection-change="handleSelectionChange" :height="clientHeight" border>
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="publicizeId" width="80" />
-      <el-table-column label="标题" align="center" prop="publicizeTitle" />
+      <el-table-column
+        label="标题"
+        align="center"
+        prop="publicizeTitle"
+        :show-overflow-tooltip="true"
+      >
+        <template slot-scope="scope">
+          <el-tag type="success" v-if="scope.row.isPinned == 1">已置顶</el-tag>
+          {{scope.row.publicizeTitle}}
+        </template>
+      </el-table-column>
       <el-table-column label="创建者" align="center" prop="createBy" width="100" />
       <el-table-column label="创建时间" align="center" prop="createTime" width="100">
         <template slot-scope="scope">
@@ -86,6 +96,22 @@
       </el-table-column>
       <el-table-column label="操作" align="center" fixed="right" width="240" class-name="small-padding fixed-width">
         <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-select"
+            @click="handlePin (scope.row)"
+            v-if="scope.row.isPinned == 0"
+            v-hasPermi="['branch:publicize:edit']"
+          >置顶</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-select"
+            @click="handlePin (scope.row)"
+            v-if="scope.row.isPinned == 1"
+            v-hasPermi="['branch:publicize:edit']"
+          >取消置顶</el-button>
           <el-button
             size="mini"
             type="text"
@@ -171,7 +197,7 @@
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-row>
           <el-col :span="12">
-            <el-form-item label="标题" prop="demeanorTitle">
+            <el-form-item label="标题" prop="publicizeTitle">
               <el-input v-model="form.publicizeTitle" placeholder="请输入标题" v-bind:disabled="check"/>
             </el-form-item>
           </el-col>
@@ -276,6 +302,35 @@ export default {
     this.getTreeselect();
   },
   methods: {
+    /** 处理置顶 */
+    handlePin(row) {
+      let publicize = row;
+      if (publicize.isPinned == 0) {
+        this.$confirm('是否确认置顶编号为 '+ ' '+publicize.publicizeId+ ' 的数据项?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          publicize.isPinned = 1;
+          updatePublicize(publicize).then(() => {
+            this.$modal.msgSuccess('置顶成功');
+            this.getList();
+          });
+        })
+      } else {
+        this.$confirm('是否确认取消置顶编号为 '+ ' '+publicize.publicizeId+ ' 的数据项?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          publicize.isPinned = 0;
+          updatePublicize(publicize).then(() => {
+            this.$modal.msgSuccess('取消置顶成功');
+            this.getList();
+          });
+        })
+      }
+    },
     /** 查看 **/
     handleSelect(row) {
       this.reset();