Przeglądaj źródła

修改评论的界面。

YangZhiJie 2 lat temu
rodzic
commit
b90172e3ba

+ 57 - 47
src/window/tabFormView/CurdWindowComment.vue

@@ -6,38 +6,37 @@
 
 <template>
   <div>
-    <div v-for="item in traceComments" :key="item.id" class="media">
+    <div v-for="item in recordComments" :key="item.id" class="media">
       <div class="media-body">
-        <div class="commentClass">
+        <div class="comment">
           <AuthImage
             :auth-src="getImgSrc(item.imageName)"
             class="media-object thumbnail m-image"
-            style="height: 120px"
+            style="width: 60px; height: 60px"
           />
-          <div class="commentDetail">
+          <div class="comment-detail">
             <div class="common">
               <span class="media-heading">
                 {{ item.createdName }}
-                <a-tag style="font-size: 12px; margin: 0 18px" color="red">评论人</a-tag>
               </span>
-              <span class="media-heading">
+              <a-tag v-if="item.carbonCopyUserIds != null && item.carbonCopyUserIds.length > 0" class="comment-user-tag">
+                发送给:
                 {{
-                  item.carbonCopyUserIds ? item.carbonCopyUserIds : "暂无通知人"
+                  item.carbonCopyUserIds 
                 }}
-                <a-tag style="font-size: 12px; margin: 0 18px" color="orange">通知人</a-tag>
-              </span>
-            </div>
-            <div class="common">
-              <span style="font-size: 12px">{{ item.created }}</span>
-            </div>
-            <div class="common">
-              <span>主题</span>
-              <p>{{ item.theme }}</p>
+              </a-tag>
+
+              <a-tag color="default">
+                <template #icon>
+                  <clock-circle-outlined />
+                </template>
+                {{ item.created }}
+              </a-tag>
             </div>
             <div class="common">
-              <span>评论的内容</span>
+              <span class="common-title">{{ item.theme }}</span>
               <!-- eslint-disable-next-line -->
-              <div v-html="item.content" />
+              <div class="common-content" v-html="item.content" />
             </div>
             <div
               v-if="item.attachments != '' && item.attachments != undefined"
@@ -83,19 +82,19 @@ import Common from '../../common/Common.js';
 import { DownloadService } from 'pc-component-v3';
 import AuthImage from '../../widget/AuthImage.vue';
 import { FileTextOutlined } from '@ant-design/icons-vue';
+import {
+  ClockCircleOutlined,
+} from '@ant-design/icons-vue';
+
 export default {
   components: {
     DownloadService,
     AuthImage,
     FileTextOutlined,
+    ClockCircleOutlined,
   },
-  // props: ['traceId', 'trace'],
   props: {
-    traceId: {
-      type: String,
-      default: null,
-    },
-    trace: {
+    recordId: {
       type: String,
       default: null,
     },
@@ -103,7 +102,7 @@ export default {
 
   data: function () {
     return {
-      traceComments: [],
+      recordComments: [],
       className: 'com.leanwo.prodog.system.model.CurdWindowComment',
       uuid: '',
       userClassName: 'com.leanwo.prodog.base.model.User',
@@ -111,17 +110,19 @@ export default {
   },
 
   watch: {
-    traceId: function (curVal, oldVal) {
+    recordId: function (curVal, oldVal) {
       if (curVal != undefined) {
-        this.getTraceComment();
+        this.getCurdComment();
+      }else{
+        this.recordComments = [];
       }
     },
   },
 
   mounted: function () {
     this.uuid = this.$route.params.uuid;
-    if (this.traceId != undefined) {
-      this.getTraceComment();
+    if (this.recordId != undefined) {
+      this.getCurdComment();
     }
   },
   methods: {
@@ -137,8 +138,9 @@ export default {
      * 根据追踪表Id获取评论
      * @author GuoZhiBo 20171201
      */
-    getTraceComment: function () {
+    getCurdComment: function () {
       var _self = this;
+      _self.recordComments = [];
       $.ajax({
         url: Common.getApiURL(
           'CurdWindowCommentResource/queryCurdWindowComment',
@@ -147,13 +149,13 @@ export default {
         dataType: 'json',
         async: false,
         data: {
-          traceId: _self.traceId,
+          recordId: _self.recordId,
         },
         beforeSend: function (request) {
           Common.addTokenToRequest(request);
         },
         success: function (data) {
-          _self.traceComments = data;
+          _self.recordComments = data;
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
           Common.processException(XMLHttpRequest, textStatus, errorThrown);
@@ -186,32 +188,40 @@ export default {
 </script>
 
 <style scoped>
-.headDiv {
-  display: flex;
-  justify-content: space-between;
-  font-size: 14px;
-}
-.commentClass {
+.comment {
   display: flex;
 }
-.commentDetail {
+
+.comment-detail {
   margin-left: 24px;
 }
-.common {
-  padding-bottom: 10px;
-}
-:deep(p) {
-  margin-left: 24px;
+
+.comment-detail p {
   margin-bottom: 0px !important;
   font-size: 14px;
-  width: 90%;
 }
-span {
-  font-size: 16px;
+
+.comment-user{
+  font-size: 12px;
+}
+
+.comment-user-tag{
+  font-size: 12px;
+  margin: 0 10px 0 5px;
 }
+
 .ant-divider-horizontal {
   margin: 6px 0;
 }
+
+.common-title{
+  font-weight: bold;
+}
+
+:deep .common-content p{
+  margin-bottom: 0;
+}
+
 .files {
   display: flex;
   align-items: center;

+ 8 - 33
src/window/tabFormView/CurdWindowCommentCreate.vue

@@ -101,7 +101,7 @@ export default {
 
   props: {
 
-    traceId: {
+    recordId: {
       type: String,
       default: null,
     }, 
@@ -115,12 +115,11 @@ export default {
 
   data: function () {
     return {
-      // traceId: null,
       content: '',
       images: [],
       className: 'com.leanwo.prodog.system.model.CurdWindowComment',
       files: [],
-      traceConfigDto: {},
+      commentDto: {},
       summernoteInitSuccess: false, // summernote初始化成功
       loading: false,
       options: [],
@@ -135,7 +134,6 @@ export default {
       document.activeElement.blur();
     });
     this.initData();
-    // this.getTraceConfig();
     $('#summernote').summernote({
       toolbar: [
         [
@@ -273,8 +271,6 @@ export default {
      */
     initData: function () {
       var _self = this;
-      // this.traceId = Number(this.$route.params.traceId);
-      console.log(_self.traceId);
     },
     /**
      * 监听文件改变事件
@@ -410,10 +406,10 @@ export default {
       }
       var size = undefined;
       if (
-        _self.traceConfigDto.commentAttachmentSize != undefined &&
-        _self.traceConfigDto.commentAttachmentSize != null
+        _self.commentDto.commentAttachmentSize != undefined &&
+        _self.commentDto.commentAttachmentSize != null
       ) {
-        size = _self.traceConfigDto.commentAttachmentSize;
+        size = _self.commentDto.commentAttachmentSize;
       }
       //当系统没有配置附件大小时默认8m
       if (size == undefined) {
@@ -461,27 +457,6 @@ export default {
         Notify.error('提示', '上传的文件为空!');
       }
     },
-    /**
-     * 获取任务管理配置
-     */
-    getTraceConfig: function () {
-      var _self = this;
-      $.ajax({
-        url: Common.getApiURL('TraceConfigResource/queryTraceConfigDto'),
-        type: 'get',
-        dataType: 'json',
-        beforeSend: function (request) {
-          Common.addTokenToRequest(request);
-        },
-
-        success: function (data) {
-          _self.traceConfigDto = data;
-        },
-        error: function (XMLHttpRequest, textStatus, errorThrown) {
-          Common.processException(XMLHttpRequest, textStatus, errorThrown);
-        },
-      });
-    },
     /**
      * 获取文件地址
      * @param  {String} item 图片名称
@@ -560,8 +535,8 @@ export default {
       var _self = this;
       _self.content = $('#summernote').summernote('code');
       if (_self.content != '' && _self.content != null) {
-        var traceComment = {
-          traceId: _self.traceId,
+        var curdComment = {
+          recordId: _self.recordId,
           content: _self.content,
           attachments: _self.files.join(','),
           carbonCopyUserIds: _self.userIds.join(','),
@@ -576,7 +551,7 @@ export default {
           beforeSend: function (request) {
             Common.addTokenToRequest(request);
           },
-          data: JSON.stringify(traceComment),
+          data: JSON.stringify(curdComment),
           success: function (data) {
             _self.loading=false;
             // _self.back();

+ 41 - 22
src/window/tabFormView/TabFormView.vue

@@ -275,7 +275,7 @@
 
     
     <!-- 历史审批记录 -->
-    <div v-if="modelData != null" class="row clearfix">
+    <div v-if="showHistoryApproveComment" class="row clearfix">
       <div class="col-md-12">
         <HistoryApproveComment :record-id="modelData.id" :process-instance-id="processInstanceId" />      
       </div>
@@ -304,7 +304,7 @@
     </Modal>
 
     <Modal v-model:show="modal3" :large="true" :show-canel-button="false" :show-ok-button="false" title="创建评论">
-      <TraceCommentCreate ref="traceCommentCreate" :trace-id="modelData.id" :window-no="modelData.windowNo" />
+      <CurdWindowCommentCreate ref="curdCommentCreate" :record-id="modelData.id" :window-no="modelData.windowNo" />
       <template #footer>
         <button type="submit" class="btn btn-default" @click="saveAndSendNotification">
           确认
@@ -315,23 +315,27 @@
       </template>
     </Modal>
 
+    <div>
+      <div class="page-header">
+        <h4>评论信息</h4>
+      </div>
+      <CurdWindowComment ref="curdComment" :record-id="modelData.id" />
+    </div>
+
+    
     <div>
       <button
         type="button"
         style="width: 100%; margin-top: 5px"
         class="btn btn-default"
         aria-label="Left Align"
-        @click="openTraceComment"
+        @click="openCurdWindowComment"
       >
-        <span class="glyphicon glyphicon-pencil" aria-hidden="true" />评论
+        <span class="glyphicon glyphicon-pencil" aria-hidden="true" />
+        <span style="margin-left: 10px">评论</span>
       </button>
     </div>
-    <div>
-      <div class="page-header">
-        <h4>评论信息</h4>
-      </div>
-      <TraceComment ref="traceComment" :trace-id="modelData.id" />
-    </div>
+
     <Loading v-if="loading" />
   </div>
 </template>
@@ -369,8 +373,8 @@ import JsUtil from '../../common/JsUtil.js';
 import { Notify, Uuid } from 'pc-component-v3';
 
 
-import TraceComment from './CurdWindowComment.vue';
-import TraceCommentCreate from './CurdWindowCommentCreate.vue';
+import CurdWindowComment from './CurdWindowComment.vue';
+import CurdWindowCommentCreate from './CurdWindowCommentCreate.vue';
 import NotificationPanel from '../../customer/NotificationPanel.vue';
 import HistoryApproveComment from '../../workflow/HistoryApproveComment.vue';
 
@@ -388,8 +392,8 @@ export default {
     ApproveComment,
     TabAudit,
     WorkflowUserDefine,
-    TraceComment,
-    TraceCommentCreate,
+    CurdWindowComment,
+    CurdWindowCommentCreate,
     NotificationPanel,
     HistoryApproveComment,
   },
@@ -480,9 +484,9 @@ export default {
     },
 
     /**
-         * 是否显示审批面板
-         * 处于审批中的单据,显示审批面板
-         */
+     * 是否显示审批面板
+     * 处于审批中的单据,显示审批面板
+     */
     showApproveComment: function () {
       // 判断是否显示审批按钮
       if (
@@ -500,6 +504,21 @@ export default {
       return false;
     },
 
+    /**
+     * 是否显示历史审批记录面板
+     * 处于审批中的单据,显示审批面板
+     */
+    showHistoryApproveComment: function(){
+      if (
+        this.window != null &&
+          this.window.workflow != null &&
+          this.modelData != null
+      ) {
+        return true;
+      }
+      return false;
+    },
+
     /**
          * 是否显示审批评论面板
          * 审批完成的单据,显示审批评论面板
@@ -789,9 +808,9 @@ export default {
      * 打开评论界面进行评论
      * @author GuoZhiBo 20171201
      */
-    openTraceComment: function () {
+    openCurdWindowComment: function () {
       var _self = this;
-      // this.$router.push('/trace/traceCommentCreate/' + _self.recordId);
+      // this.$router.push('/record/curdCommentCreate/' + _self.recordId);
       _self.modal3 = true;
       console.log(_self.modelData);
       console.log(_self.modelData.id);
@@ -799,14 +818,14 @@ export default {
 
     saveAndSendNotification: function () {
       var _self = this;
-      _self.$refs.traceCommentCreate.photograph();
+      _self.$refs.curdCommentCreate.photograph();
       _self.sendNotification();
     },
 
     // 发送通知
     sendNotification: function () {
       var _self = this;
-      var notification = _self.$refs.traceCommentCreate.getNotification();
+      var notification = _self.$refs.curdCommentCreate.getNotification();
       var recordIds = [];
       recordIds.push(_self.modelData.id);
       if (recordIds.length == 0) {
@@ -855,7 +874,7 @@ export default {
           _self.loading=false;
           Notify.success(_self.$t('lang.tabButton.describe11'), '操作成功', true);
           _self.modal3 = false;
-          _self.$refs.traceComment.getTraceComment();
+          _self.$refs.curdComment.getCurdComment();
         },
         error: function (XMLHttpRequest, textStatus, errorThrown) {
           _self.loading=false;

+ 0 - 35
src/workflow/WorkflowEditResource.js

@@ -99,41 +99,6 @@ export default {
     });
   },
 
-  /**
-	 * 工具类自动生成的方法
-	 * 工具作者: 杨志杰
-	 * 根据curd窗口编号查询页签表单视图 
-	 */
-  getTabFormFields: function(windowNo){
-    var requestUrl = 'CurdWindowResourceV2/getTabFormFields';
-    var paramCount = 0;
-    if(windowNo != null){
-      requestUrl += (paramCount > 0) ? '&' : '?';
-      requestUrl += ('windowNo=' + windowNo);
-      paramCount ++;
-    }
-
-
-    return new Promise((resolve, reject) => {
-      $.ajax({
-        url: Common.getApiURL(requestUrl),
-        type: 'get',
-				
-        dataType: 'json',
-				
-				
-        beforeSend: function(request) {
-          Common.addTokenToRequest(request);
-        },
-        success: function(data) {
-          resolve(data);
-        },
-        error: function(XMLHttpRequest, textStatus, errorThrown) {
-          reject(XMLHttpRequest);
-        },
-      });
-    });
-  },
 
   /**
 	 * 工具类自动生成的方法