瀏覽代碼

调整部分样式和文字

lideyin 6 年之前
父節點
當前提交
8528ebbed2
共有 2 個文件被更改,包括 49 次插入32 次删除
  1. 4 4
      src/constants/constants.js
  2. 45 28
      src/modules/examwork/view/notice.vue

+ 4 - 4
src/constants/constants.js

@@ -63,8 +63,8 @@ export const PUBLISH_STATUS = [
 ];
 //公告接受规则类型
 export const NOTICE_RECEIVER_RULE_TYPE = [
-  { code: "STUDENTS_OF_EXAM", name: "归属考试的考生" },
-  { code: "TEACHER_OF_MARK_WORK", name: "评卷老师" },
-  { code: "ALL_STUDENTS_OF_ROOT_ORG", name: "顶级机构下所有学生" },
-  { code: "COMMON_USERS_OF_ROLE", name: "学习中心老师" }
+  { code: "STUDENTS_OF_EXAM", name: "学生-按考试批次选择" },
+  { code: "ALL_STUDENTS_OF_ROOT_ORG", name: "学生-学校中所有学生" },
+  { code: "TEACHER_OF_MARK_WORK", name: "老师-按评卷老师选择" },
+  { code: "COMMON_USERS_OF_ROLE", name: "老师-学习中心老师" }
 ];

+ 45 - 28
src/modules/examwork/view/notice.vue

@@ -6,7 +6,7 @@
         <el-form
           :inline="true"
           :model="formSearch"
-          label-position="right"
+          label-position="left"
           label-width="70px"
         >
           <el-form-item label="标题" class="pull-left">
@@ -33,8 +33,8 @@
             >
           </el-form-item>
         </el-form>
-
-        <span>操作:</span>
+        <div class="block-seperator"></div>
+        <span>批量操作:</span>
         <el-button
           size="small"
           type="danger"
@@ -66,7 +66,7 @@
             <template slot-scope="scope">
               <el-popover
                 :title="getRuleTypeName(scope.row.ruleType)"
-                trigger="click"
+                trigger="hover"
                 placement="top-start"
                 width="200px"
               >
@@ -83,9 +83,9 @@
 
                 <!-- <p v-html="getPublishObject(scope.row.publishObject)"></p> -->
                 <div slot="reference" style="text-align:left">
-                  <el-tag size="medium">{{
-                    getRuleTypeName(scope.row.ruleType)
-                  }}</el-tag>
+                  <!-- <el-tag size="medium"> -->
+                  {{ getPublishObject(scope.row.publishObject) }}
+                  <!-- </el-tag> -->
                 </div>
               </el-popover>
             </template>
@@ -111,24 +111,6 @@
           <el-table-column label="操作">
             <div slot-scope="scope">
               <el-button
-                v-show="scope.row.publishStatus == 'UNPUBLISHED'"
-                size="mini"
-                type="primary"
-                icon="el-icon-edit"
-                plain
-                @click="editNoticeDialog(scope.row)"
-                >编辑</el-button
-              >
-              <el-button
-                v-show="scope.row.publishStatus == 'UNPUBLISHED'"
-                size="mini"
-                type="danger"
-                @click="deleteById(scope.row)"
-                icon="el-icon-delete"
-                >删除</el-button
-              >
-              <el-button
-                v-show="scope.row.publishStatus != 'UNPUBLISHED'"
                 size="mini"
                 type="primary"
                 icon="el-icon-view"
@@ -136,6 +118,34 @@
                 @click="viewNoticeDialog(scope.row)"
                 >详情</el-button
               >
+              <el-dropdown style="margin-left: 10px;">
+                <el-button type="primary" plain size="mini">
+                  更多 <i class="el-icon-arrow-down el-icon--right"></i>
+                </el-button>
+                <el-dropdown-menu slot="dropdown">
+                  <el-dropdown-item>
+                    <el-button
+                      :disabled="scope.row.publishStatus != 'UNPUBLISHED'"
+                      size="mini"
+                      type="primary"
+                      icon="el-icon-edit"
+                      plain
+                      @click="editNoticeDialog(scope.row)"
+                      >编辑</el-button
+                    >
+                  </el-dropdown-item>
+                  <el-dropdown-item>
+                    <el-button
+                      :disabled="scope.row.publishStatus != 'UNPUBLISHED'"
+                      size="mini"
+                      type="danger"
+                      @click="deleteById(scope.row)"
+                      icon="el-icon-delete"
+                      >删除</el-button
+                    >
+                  </el-dropdown-item>
+                </el-dropdown-menu>
+              </el-dropdown>
             </div>
           </el-table-column>
         </el-table>
@@ -155,7 +165,8 @@
         <!-- 弹出窗口 -->
         <el-dialog
           width="700px"
-          title="编辑公告"
+          :title="this.operateType == 'add' ? '新增' : '编辑' + '公告'"
+          v-if="editNoticeDialogVisible"
           :visible.sync="editNoticeDialogVisible"
           :before-close="handleClose"
           :close-on-click-modal="false"
@@ -726,7 +737,7 @@ export default {
       this.noticeForm = {};
     },
     editNoticeDialog(row) {
-      this.operateType = "modify";
+      this.operateType = "edit";
       this.noticeForm = Object.assign({}, row);
       if (row.publishObject && row.publishObject.length > 0) {
         if (row.ruleType == "STUDENTS_OF_EXAM") {
@@ -766,6 +777,12 @@ export default {
       for (let po of publishObjectList) {
         strName += po.name + ";";
       }
+      if (strName.lastIndexOf(";") == strName.length - 1) {
+        strName = strName.substring(0, strName.length - 1);
+      }
+      if (strName.length > 15) {
+        strName = strName.substr(0, 15) + "...";
+      }
       return strName;
     },
     getRuleTypeName(ruleType) {
@@ -842,7 +859,7 @@ export default {
             }
           }
           //修改
-          if ("modify" == this.operateType) {
+          if ("edit" == this.operateType) {
             this.$httpWithMsg
               .post(EXAM_WORK_API + "/notice/updateNotice", this.noticeForm)
               .then(