Pārlūkot izejas kodu

试剂跟换验证bug修复,系统首页样式修复

wangxiaoyi 1 gadu atpakaļ
vecāks
revīzija
d47c2f0464

+ 37 - 7
src/assets/styles/pages/dashboard.scss

@@ -18,38 +18,55 @@ $transition: all .5s;
             margin: 12px 0 !important;
             cursor: pointer;
             .item-header > p {
-                font-size: 18px;
+                font-size: 16px;
+                font-weight: 600;
                 white-space: nowrap;
                 overflow: hidden;
                 text-overflow: ellipsis;
             }
             .item-body {
-                margin-top: 15px;
+                margin-top: 5px;
+                margin-bottom: 5px;
                 & > span {
-                    font-size: 32px;
+                    font-size: 24px;
                     font-weight: bold;
                 }
             }
+            .item-bottom {
+                display: flex;
+                justify-content: space-between;
+                align-items: center;
+                font-size: 13px;
+                opacity: .6;
+            }
             @media (max-width: 1688px) {
                 .item-header > p {
                     font-size: 16px;
                 }
                 .item-body {
                     & > span {
-                        font-size: 32px;
+                        font-size: 24px;
                         font-weight: bold;
                     }
                 }
             }
+            @media (max-width: 1640px) {
+                .item-bottom {
+                    font-size: 12px;
+                }
+            }
             @media (max-width: 1580px) {
                 .item-header > p {
                     font-size: 14px;
                 }
                 .item-body {
                     & > span {
-                        font-size: 30px;
+                        font-size: 22px;
                     }
                 }
+                .item-bottom {
+                    font-size: 11px;
+                }
                 
             }
             @media (max-width: 1450px) {
@@ -58,10 +75,20 @@ $transition: all .5s;
                 }
                 .item-body {
                     & > span {
-                        font-size: 28px;
+                        font-size: 20px;
                     }
                 }
             }
+            @media (max-width: 1455px) {
+                .item-bottom {
+                    font-size: 10px;
+                }
+            }
+            @media (max-width: 1355px) {
+                .item-bottom {
+                    font-size: 9px;
+                }
+            }
             @media (max-width: 1288px) {
                 .item-header > p {
                     white-space: normal;
@@ -72,9 +99,12 @@ $transition: all .5s;
                 }
                 .item-body {
                     & > span {
-                        font-size: 26px;
+                        font-size: 18px;
                     }
                 }
+                .item-bottom {
+                    font-size: 8px;
+                }
             }
         }
         

+ 2 - 0
src/business/platform/form/formrender/dynamic-form/mixins/StatisOrRecordTable.vue

@@ -122,6 +122,8 @@ export default {
         .sin{
             margin: 5px;
             cursor: pointer;
+            font-weight: 500;
+            font-family: inherit;
         }
     }
     /deep/ .el-popover{

+ 93 - 76
src/filters/index.js

@@ -6,21 +6,21 @@ import Utils from '@/utils/util'
  * 时间格式化
  *
  */
-export function dateFormat(dateObj, dateFormat = 'yyyy-MM-dd HH:mm:ss', origFormat) {
-  if (Utils.isEmpty(dateObj)) { return '' }
-  try {
-    if (typeof dateObj === 'number') {
-      dateObj = new Date(dateObj)
+export function dateFormat (dateObj, dateFormat = 'yyyy-MM-dd HH:mm:ss', origFormat) {
+    if (Utils.isEmpty(dateObj)) { return '' }
+    try {
+        if (typeof dateObj === 'number') {
+            dateObj = new Date(dateObj)
+        }
+        if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
+            // 需要把字符串转换日期格式
+            dateObj = dateDealFmt.dealFmt(dateObj, origFormat || dateFormat)
+        }
+        return format(dateObj, dateFormat)
+    } catch (error) {
+        console.error('转换日期格式错误:', error)
+        return dateObj
     }
-    if (Object.prototype.toString.call(dateObj) !== '[object Date]' || isNaN(dateObj.getTime())) {
-      // 需要把字符串转换日期格式
-      dateObj = dateDealFmt.dealFmt(dateObj, origFormat || dateFormat)
-    }
-    return format(dateObj, dateFormat)
-  } catch (error) {
-    console.error('转换日期格式错误:', error)
-    return dateObj
-  }
 }
 
 /**
@@ -30,8 +30,8 @@ export function dateFormat(dateObj, dateFormat = 'yyyy-MM-dd HH:mm:ss', origForm
  * @param {String} locale 国际化语言
  * @returns {String} 相对时间字符串
  */
-export function formatRelativeTime(time, format, locale) {
-  return getRelativeTime(time, format, locale)
+export function formatRelativeTime (time, format, locale) {
+    return getRelativeTime(time, format, locale)
 }
 
 /**
@@ -40,25 +40,25 @@ export function formatRelativeTime(time, format, locale) {
  * @param {string} label
  * @return {string}
  */
-function pluralize(time, label) {
-  return time + label
+function pluralize (time, label) {
+    return time + label
 }
 
 /**
  * duration
  * @param {*} time
  */
-export function duration(time) {
-  const between = Number(time)
-  if (between < 1000) {
-    return pluralize(~~(between / 1000), '秒')
-  } else if (between < 3600 * 1000) {
-    return pluralize(~~(between / (60 * 1000)), '分钟')
-  } else if (between < 86400 * 1000) {
-    return pluralize(~~(between / (60 * 60 * 1000)), '小时')
-  } else {
-    return pluralize(~~(between / (60 * 60 * 24 * 1000)), '天')
-  }
+export function duration (time) {
+    const between = Number(time)
+    if (between < 1000) {
+        return pluralize(~~(between / 1000), '秒')
+    } else if (between < 3600 * 1000) {
+        return pluralize(~~(between / (60 * 1000)), '分钟')
+    } else if (between < 86400 * 1000) {
+        return pluralize(~~(between / (60 * 60 * 1000)), '小时')
+    } else {
+        return pluralize(~~(between / (60 * 60 * 24 * 1000)), '天')
+    }
 }
 
 /**
@@ -66,56 +66,73 @@ export function duration(time) {
  * @param {*} num
  * @param {*} digits
  */
-export function numberFormatter(num, digits = 2) {
-  const si = [
-    { value: 1E18, symbol: 'E' },
-    { value: 1E15, symbol: 'P' },
-    { value: 1E12, symbol: 'T' },
-    { value: 1E9, symbol: 'G' },
-    { value: 1E6, symbol: 'M' },
-    { value: 1E3, symbol: 'k' }
-  ]
-  for (let i = 0; i < si.length; i++) {
-    if (num >= si[i].value) {
-      return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol
+export function numberFormatter (num, digits = 2) {
+    const si = [
+        { value: 1E18, symbol: 'E' },
+        { value: 1E15, symbol: 'P' },
+        { value: 1E12, symbol: 'T' },
+        { value: 1E9, symbol: 'G' },
+        { value: 1E6, symbol: 'M' },
+        { value: 1E3, symbol: 'k' }
+    ]
+    for (let i = 0; i < si.length; i++) {
+        if (num >= si[i].value) {
+            return (num / si[i].value + 0.1).toFixed(digits).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, '$1') + si[i].symbol
+        }
     }
-  }
-  return num.toString()
+    return num.toString()
 }
 
 /**
  * html 格式转文本
  * @param {*} val
 */
-export function html2Text(val) {
-  const div = document.createElement('div')
-  div.innerHTML = val
-  return div.textContent || div.innerText
+export function html2Text (val) {
+    const div = document.createElement('div')
+    div.innerHTML = val
+    return div.textContent || div.innerText
 }
 
 /**
  * 正则去掉所有的html标记
  * @param {*} val
  */
-export function removeHtmlTag(val) {
-  if (Utils.isEmpty(val)) { return val }
-  return val.replace(/<[^>]+>/g, '')
+export function removeHtmlTag (val) {
+    if (Utils.isEmpty(val)) { return val }
+    return val.replace(/<[^>]+>/g, '')
 }
 
 /**
  * 去第一个字符
  * @param {*} val
  */
-export function firstStr(val) {
-  return val.substr(0, 1)
+export function firstStr (val) {
+    return val.substr(0, 1)
 }
 
+export function filterDataMethod (val1, val2) {
+    if (!val1) {
+        return 0
+    }
+    const arrData = val1.split(',')
+    if (val2 === 'join') {
+        return arrData[1]
+    } else if (val2 === 'joinRate') {
+        return arrData[0] == 0 ? '0%' : ((arrData[1] / arrData[0]) * 100).toFixed(1) + '%'
+    } else if (val2 === 'unjoin') {
+        return arrData[2]
+    } else if (val2 === 'unjoinRate') {
+        return arrData[0] == 0 ? '0%' : ((arrData[2] / arrData[0]) * 100).toFixed(1) + '%'
+    } else {
+        return 0
+    }
+}
 /**
  * 千分位过滤
  * @param {*} num
  */
-export function toThousandslsFilter(num) {
-  return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
+export function toThousandslsFilter (num) {
+    return (+num || 0).toString().replace(/^-?\d+/g, m => m.replace(/(?=(?!\b)(\d{3})+$)/g, ','))
 }
 
 /**
@@ -125,12 +142,12 @@ export function toThousandslsFilter(num) {
  * @param {*} labelKey  选项的展示值key
  * @param {*} valueKey  选项的值key
  */
-export function optionsFilter(val, options = [], labelKey = 'label', valueKey = 'value', defaultValue = '') {
-  let opt
-  if (Array.isArray(options)) {
-    opt = options.find(x => x[valueKey] === val)
-  }
-  return opt ? opt[labelKey] : val || defaultValue
+export function optionsFilter (val, options = [], labelKey = 'label', valueKey = 'value', defaultValue = '') {
+    let opt
+    if (Array.isArray(options)) {
+        opt = options.find(x => x[valueKey] === val)
+    }
+    return opt ? opt[labelKey] : val || defaultValue
 }
 
 /**
@@ -140,21 +157,21 @@ export function optionsFilter(val, options = [], labelKey = 'label', valueKey =
  * @param {*} labelKey  选项的展示值key
  * @param {*} valueKey  选项的值key
  */
-export function optionsCheckboxFilter(val, options = [], labelKey = 'label', valueKey = 'value', defaultValue = '') {
-  if (Utils.isEmpty(val)) {
-    return []
-  }
-  const valAry = val.split(',')
-  const optMap = []
-  options.forEach(x => {
-    optMap[valueKey] = x[labelKey]
-  })
-
-  const optVal = []
-  valAry.forEach(v => {
-    if (optMap[v]) {
-      optVal.push(optMap[v])
+export function optionsCheckboxFilter (val, options = [], labelKey = 'label', valueKey = 'value', defaultValue = '') {
+    if (Utils.isEmpty(val)) {
+        return []
     }
-  })
-  return optVal
+    const valAry = val.split(',')
+    const optMap = []
+    options.forEach(x => {
+        optMap[valueKey] = x[labelKey]
+    })
+
+    const optVal = []
+    valAry.forEach(v => {
+        if (optMap[v]) {
+            optVal.push(optMap[v])
+        }
+    })
+    return optVal
 }

+ 25 - 15
src/views/component/reagent/reagentChange.vue

@@ -7,9 +7,9 @@
                     <div v-if="nodeId === 'Activity_0xkc1ji' || readonly" />
                     <div v-else>
                         <el-button type="primary" size="mini" icon="ibps-icon-edit" @click="openDialog">配置样品</el-button>
-                        <el-button type="success" size="mini" icon="ibps-icon-plus" @click="generateData">生成数据</el-button>
+                        <el-button type="success" size="mini" icon="ibps-icon-refresh" @click="generateData">重置</el-button>
                         <el-button v-if="!disabled" type="danger" size="mini" icon="ibps-icon-calculator" @click="computedResult">计算结果</el-button>
-                        <el-button v-else type="danger" size="mini" icon="ibps-icon-edit" @click="disabled=false">编辑</el-button>
+                        <el-button v-else type="danger" size="mini" icon="ibps-icon-edit" @click="handleEdit">编辑</el-button>
                     </div>
                 </el-col>
             </el-row>
@@ -70,10 +70,13 @@
         >
             <div v-for="(item, index) in dialogData" :key="index" class="ragent-dialog-content">
                 <span>样品编号{{ index+1 }}</span>
-                <el-input v-model="item.number" :min="0" type="number" style="width: 30%;" />
+                <div style="display: flex;align-items: center;">
+                    <span style="color: red;margin-right: 3px;">*</span>
+                    <el-input v-model="item.number" required :min="0" type="number" style="flex:1;" />
+                </div>
                 <div>
-                    <el-button type="text" @click="addRow">添加</el-button>
-                    <el-button type="text" style="color:red;" @click="deleteRow(index)">删除</el-button>
+                    <el-button type="text" :style="{visibility: index === dialogData.length-1?'visible':'hidden'}" @click="addRow">添加</el-button>
+                    <el-button type="text" :style="{visibility: index === dialogData.length-1?'visible':'hidden'}" style="color:red;" @click="deleteRow(index)">删除</el-button>
                 </div>
             </div>
             <span slot="footer" class="dialog-footer">
@@ -137,6 +140,7 @@ export default {
             immediate: true
         },
         'formData.sjghyzjlbxmcszb': {
+            // 在表单中的任何操作都会触发子表的监听
             handler (val) {
                 this.ypData = []
                 this.ypFlag = false
@@ -148,17 +152,17 @@ export default {
                     this.ypData.push({ ...item })
                 })
                 // 处理表单”平行实验/留样再测“
-                // if (val.length && !this.ypFlag) {
+                // if (val.length && !this.ypFlag && this.copyDialogData.length && (this.params.nodeId === 'Activity_1bwqyf1' || this.params.nodeId === 'StartEvent_1fk5is7')) {
                 //     // 点完计算结果后再去编辑”平行实验/留样再测“表单,则给表格置空重新填写
-                //     if (this.disabled && this.reagentData.length) {
-                //         this.copyDialogData = []
-                //         this.reagentData = []
-                //         this.disabled = false
-                //         return this.$message.error('请重新配置样品')
-                //     }
-                //     if (!this.disabled && this.reagentData.length) {
-                //         this.initData()
-                //     }
+                //     // if (this.disabled && this.reagentData.length) {
+                //     //     this.copyDialogData = []
+                //     //     this.reagentData = []
+                //     //     this.disabled = false
+                //     //     return this.$message.error('请重新配置样品')
+                //     // }
+                //     // if (!this.disabled && this.reagentData.length) {
+                //     //     this.initData()
+                //     // }
                 // }
             },
             deep: true,
@@ -327,6 +331,12 @@ export default {
             } else {
                 this.centerDialogVisible = false
                 this.copyDialogData = JSON.parse(JSON.stringify(this.dialogData))
+                // 样品配置完自定生成表格数据,先判断样品配置表数据是否全填
+                if (this.ypData.length > 0 && !this.ypFlag) {
+                    this.initData()
+                } else {
+                    this.$message.warning('请完成样品参数配置')
+                }
             }
         },
         // 去除小数*100精度方法

+ 8 - 2
src/views/platform/desktop/myLayout/layout.vue

@@ -303,8 +303,8 @@ export default {
         .item {
             position: relative;
             margin: 12px;
-            padding: 12px;
-            height: 90px;
+            padding: 15px;
+            // height: 110px;
             border-radius: 4px;
             box-sizing: border-box;
             overflow: hidden;
@@ -333,6 +333,12 @@ export default {
                 line-height: 60px;
             }
         }
+        .item-bottom {
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            font-size: 13px;
+        }
         // .item-footer {
         //     line-height: 16px;
         //     & > span {

+ 11 - 0
src/views/system/dashboard/templates/bpmApprove.vue

@@ -21,6 +21,17 @@
                         <div class="item-body">
                             <h2><count-to :end-val="parseInt(item.dataText,10)" :duration="2000" /></h2>
                         </div>
+                        <template v-if="item.dataContent === '我的培训'|| item.dataContent === '我的考试'">
+                            <div class="item-bottom">
+                                <span>已参加:{{ item.dataText | filterDataMethod('join') }}</span>
+                                <span>未参加:{{ item.dataText | filterDataMethod('unjoin') }}</span>
+                            </div>
+                            <!-- <div class="item-bottom">
+                                <span>未参加:{{ item.dataText | filterDataMethod('unjoin') }}</span>
+                                <span>占: {{ item.dataText | filterDataMethod('unjoinRate') }}</span>
+                            </div> -->
+                        </template>
+
                         <p class="item-tip">{{ item.dataContent | firstStr }}</p>
                     </div>
                 </el-col>