king
2020-04-04 81e50ca10197278a158452e918ed76a3edfe543e
2020-04-04
4个文件已修改
117 ■■■■■ 已修改文件
public/options.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/index.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/normalTable/index.jsx 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/zshare/normalTable/index.scss 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.js
@@ -14,5 +14,6 @@
  lineColor: '',
  webSite: '',
  doclogo: '',
  style: ''
  style: '',
  filter: 'false'
}
src/index.js
@@ -55,6 +55,14 @@
document.title = window.GLOB.platTitle
if (window.GLOB.filter === 'true') {
  let html = document.getElementsByTagName('html')[0]
  if (html) {
    html.style.filter = 'grayscale(100%)'
  }
}
const option = {
  white: 'mk-white'
src/tabviews/zshare/normalTable/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { Table, message, Affix, Button, Typography, Icon, Modal } from 'antd'
import { Table, message, Affix, Button, Typography, Modal } from 'antd'
import './index.scss'
const { Paragraph } = Typography
@@ -41,7 +41,7 @@
      let cell = {
        align: item.Align,
        dataIndex: item.field || item.uuid,
        title: <span>{item.label}{item.linkThdMenu ? <Icon type="link"/> : null}</span>,
        title: item.label,
        sorter: item.field && item.IsSort === 'true',
        width: item.Width || 120,
        render: (text, record) => {
@@ -130,36 +130,47 @@
    } else if (item.type === 'number') {
      let content = ''
      let match = false
      if (item.field && record.hasOwnProperty(item.field)) {
        content = +record[item.field]
      }
      if (content && item.match && item.matchVal) {
        if (item.match === '>') {
          if (content > item.matchVal) {
            match = true
      if (item.field && record.hasOwnProperty(item.field)) {
        try {
          content = parseFloat(record[item.field])
          if (isNaN(content)) {
            content = ''
          }
        } else if (item.match === '<') {
          if (content < item.matchVal) {
            match = true
          }
        } else if (item.match === '>=') {
          if (content >= item.matchVal) {
            match = true
          }
        } else if (item.match === '<=') {
          if (content <= item.matchVal) {
            match = true
          }
        } catch {
          content = ''
        }
      }
      if (content && item.format === 'thdSeparator') {
        content = `${content}`
        content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
      if (content !== '') {
        if (item.match && item.matchVal) {
          if (item.match === '>') {
            if (content > item.matchVal) {
              match = true
            }
          } else if (item.match === '<') {
            if (content < item.matchVal) {
              match = true
            }
          } else if (item.match === '>=') {
            if (content >= item.matchVal) {
              match = true
            }
          } else if (item.match === '<=') {
            if (content <= item.matchVal) {
              match = true
            }
          }
        }
        content = content.toFixed(item.decimal || 0)
        if (item.format === 'thdSeparator') {
          content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
        }
        content = (item.prefix || '') + content + (item.postfix || '')
      }
      content = (item.prefix || '') + content + (item.postfix || '')
      if (item.linkThdMenu) {
        return (
@@ -241,15 +252,26 @@
      item.subColumn.forEach(col => {
        if (!col.field || !record.hasOwnProperty(col.field)) return
        
        if (col.type === 'number' && typeof(record[col.field]) === 'number') {
          let content = record[col.field]
          if (col.format === 'thdSeparator') {
            content = `${content}`
            content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
        if (col.type === 'number') {
          let content = ''
          try {
            content = parseFloat(record[col.field])
            if (isNaN(content)) {
              content = ''
            }
          } catch {
            content = ''
          }
          if (content !== '') {
            content = content.toFixed(col.decimal || 0)
            if (col.format === 'thdSeparator') {
              content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
            }
          content = (col.prefix || '') + content + (col.postfix || '')
            content = (col.prefix || '') + content + (col.postfix || '')
          }
          contents.push(content)
        } else if (col.type === 'picture') {
src/tabviews/zshare/normalTable/index.scss
@@ -7,18 +7,8 @@
      tr {
        th {
          position: relative;
          .ant-table-column-title {
            white-space: nowrap;
            position: static!important;
            .anticon-link {
              // color: #1890ff;
              opacity: 0.5;
              position: absolute;
              left: 0px;
              bottom: 0px;
              font-size: 12px;
            }
          }
        }
      }
@@ -126,14 +116,12 @@
            color: #1890ff;
            box-shadow: none;
            padding: 0 5px;
          }
          button + button {
            margin-left: 10px;
            margin: 0px 5px;
          }
        }
        .button {
          button + button {
            margin-left: 10px;
          button {
            margin: 0px 5px;
          }
        }
      }