This commit is contained in:
yanran200730
2022-08-08 14:49:45 +08:00
162 changed files with 1284 additions and 83 deletions

View File

@@ -1,5 +1,5 @@
import dict from "./dict"; import dict from "./dict"
import dayjs from './monent'; import dayjs from './monent'
import qs from 'query-string' import qs from 'query-string'
const confirm = (content, title, config) => { const confirm = (content, title, config) => {
@@ -87,146 +87,146 @@ const idCardNoUtil = {
/*校验地址码*/ /*校验地址码*/
checkAddressCode: function (addressCode) { checkAddressCode: function (addressCode) {
const check = /^[1-9]\d{5}$/.test(addressCode); const check = /^[1-9]\d{5}$/.test(addressCode)
if (!check) return false; if (!check) return false
return !!idCardNoUtil.provinceAndCitys[parseInt(addressCode.substring(0, 2))]; return !!idCardNoUtil.provinceAndCitys[parseInt(addressCode.substring(0, 2))]
}, },
/*校验日期码*/ /*校验日期码*/
checkBirthDayCode: function (birDayCode) { checkBirthDayCode: function (birDayCode) {
const check = /^[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))$/.test(birDayCode); const check = /^[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))$/.test(birDayCode)
if (!check) return false; if (!check) return false
const yyyy = parseInt(birDayCode.substring(0, 4), 10); const yyyy = parseInt(birDayCode.substring(0, 4), 10)
const mm = parseInt(birDayCode.substring(4, 6), 10); const mm = parseInt(birDayCode.substring(4, 6), 10)
const dd = parseInt(birDayCode.substring(6), 10); const dd = parseInt(birDayCode.substring(6), 10)
const xdata = new Date(yyyy, mm - 1, dd); const xdata = new Date(yyyy, mm - 1, dd)
if (xdata > new Date()) { if (xdata > new Date()) {
return false; //生日不能大于当前日期 return false //生日不能大于当前日期
} else return (xdata.getFullYear() == yyyy) && (xdata.getMonth() == mm - 1) && (xdata.getDate() == dd); } else return (xdata.getFullYear() == yyyy) && (xdata.getMonth() == mm - 1) && (xdata.getDate() == dd)
}, },
/*计算校检码*/ /*计算校检码*/
getParityBit: function (idCardNo) { getParityBit: function (idCardNo) {
const id17 = idCardNo.substring(0, 17); const id17 = idCardNo.substring(0, 17)
/*加权 */ /*加权 */
let power = 0; let power = 0
for (let i = 0; i < 17; i++) { for (let i = 0; i < 17; i++) {
power += parseInt(id17.charAt(i), 10) * parseInt(idCardNoUtil.powers[i]); power += parseInt(id17.charAt(i), 10) * parseInt(idCardNoUtil.powers[i])
} }
/*取模*/ /*取模*/
const mod = power % 11; const mod = power % 11
return idCardNoUtil.parityBit[mod]; return idCardNoUtil.parityBit[mod]
}, },
/*验证校检码*/ /*验证校检码*/
checkParityBit: function (idCardNo) { checkParityBit: function (idCardNo) {
const parityBit = idCardNo.charAt(17).toUpperCase(); const parityBit = idCardNo.charAt(17).toUpperCase()
return idCardNoUtil.getParityBit(idCardNo) == parityBit; return idCardNoUtil.getParityBit(idCardNo) == parityBit
}, },
/*校验15位或18位的身份证号码*/ /*校验15位或18位的身份证号码*/
checkIdCardNo: function (idCardNo) { checkIdCardNo: function (idCardNo) {
//15位和18位身份证号码的基本校验 //15位和18位身份证号码的基本校验
const check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo); const check = /^\d{15}|(\d{17}(\d|x|X))$/.test(idCardNo)
if (!check) return false; if (!check) return false
//判断长度为15位或18位 //判断长度为15位或18位
if (idCardNo.length == 15) { if (idCardNo.length == 15) {
return idCardNoUtil.check15IdCardNo(idCardNo); return idCardNoUtil.check15IdCardNo(idCardNo)
} else if (idCardNo.length == 18) { } else if (idCardNo.length == 18) {
return idCardNoUtil.check18IdCardNo(idCardNo); return idCardNoUtil.check18IdCardNo(idCardNo)
} else { } else {
return false; return false
} }
}, },
//校验15位的身份证号码 //校验15位的身份证号码
check15IdCardNo: function (idCardNo) { check15IdCardNo: function (idCardNo) {
//15位身份证号码的基本校验 //15位身份证号码的基本校验
let check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo); let check = /^[1-9]\d{7}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}$/.test(idCardNo)
if (!check) return false; if (!check) return false
//校验地址码 //校验地址码
const addressCode = idCardNo.substring(0, 6); const addressCode = idCardNo.substring(0, 6)
check = idCardNoUtil.checkAddressCode(addressCode); check = idCardNoUtil.checkAddressCode(addressCode)
if (!check) return false; if (!check) return false
const birDayCode = '19' + idCardNo.substring(6, 12); const birDayCode = '19' + idCardNo.substring(6, 12)
//校验日期码 //校验日期码
return idCardNoUtil.checkBirthDayCode(birDayCode); return idCardNoUtil.checkBirthDayCode(birDayCode)
}, },
//校验18位的身份证号码 //校验18位的身份证号码
check18IdCardNo: function (idCardNo) { check18IdCardNo: function (idCardNo) {
//18位身份证号码的基本格式校验 //18位身份证号码的基本格式校验
let check = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(idCardNo); let check = /^[1-9]\d{5}[1-9]\d{3}((0[1-9])|(1[0-2]))((0[1-9])|([1-2][0-9])|(3[0-1]))\d{3}(\d|x|X)$/.test(idCardNo)
if (!check) return false; if (!check) return false
//校验地址码 //校验地址码
const addressCode = idCardNo.substring(0, 6); const addressCode = idCardNo.substring(0, 6)
check = idCardNoUtil.checkAddressCode(addressCode); check = idCardNoUtil.checkAddressCode(addressCode)
if (!check) return false; if (!check) return false
//校验日期码 //校验日期码
const birDayCode = idCardNo.substring(6, 14); const birDayCode = idCardNo.substring(6, 14)
check = idCardNoUtil.checkBirthDayCode(birDayCode); check = idCardNoUtil.checkBirthDayCode(birDayCode)
if (!check) return false; if (!check) return false
//验证校检码 //验证校检码
return idCardNoUtil.checkParityBit(idCardNo); return idCardNoUtil.checkParityBit(idCardNo)
}, },
formateDateCN: function (day) { formateDateCN: function (day) {
const yyyy = day.substring(0, 4); const yyyy = day.substring(0, 4)
const mm = day.substring(4, 6); const mm = day.substring(4, 6)
const dd = day.substring(6); const dd = day.substring(6)
return yyyy + '-' + mm + '-' + dd; return yyyy + '-' + mm + '-' + dd
}, },
//获取信息 //获取信息
getIdCardInfo: function (idCardNo) { getIdCardInfo: function (idCardNo) {
let aday; let aday
let idCardInfo = { let idCardInfo = {
gender: "", //性别 gender: "", //性别
birthday: "", // 出生日期(yyyy-mm-dd) birthday: "", // 出生日期(yyyy-mm-dd)
sex: ""//系统性别码 sex: ""//系统性别码
}; }
if (idCardNo.length == 15) { if (idCardNo.length == 15) {
aday = '19' + idCardNo.substring(6, 12); aday = '19' + idCardNo.substring(6, 12)
idCardInfo.birthday = idCardNoUtil.formateDateCN(aday); idCardInfo.birthday = idCardNoUtil.formateDateCN(aday)
if (parseInt(idCardNo.charAt(14)) % 2 == 0) { if (parseInt(idCardNo.charAt(14)) % 2 == 0) {
idCardInfo.gender = idCardNoUtil.genders.female; idCardInfo.gender = idCardNoUtil.genders.female
} else { } else {
idCardInfo.gender = idCardNoUtil.genders.male; idCardInfo.gender = idCardNoUtil.genders.male
} }
} else if (idCardNo.length == 18) { } else if (idCardNo.length == 18) {
aday = idCardNo.substring(6, 14); aday = idCardNo.substring(6, 14)
idCardInfo.birthday = idCardNoUtil.formateDateCN(aday); idCardInfo.birthday = idCardNoUtil.formateDateCN(aday)
if (parseInt(idCardNo.charAt(16)) % 2 == 0) { if (parseInt(idCardNo.charAt(16)) % 2 == 0) {
idCardInfo.gender = idCardNoUtil.genders.female; idCardInfo.gender = idCardNoUtil.genders.female
} else { } else {
idCardInfo.gender = idCardNoUtil.genders.male; idCardInfo.gender = idCardNoUtil.genders.male
} }
idCardInfo.sex = "" + Number(idCardNo.substring(16, 17)) % 2 idCardInfo.sex = "" + Number(idCardNo.substring(16, 17)) % 2
} }
return idCardInfo; return idCardInfo
}, },
/*18位转15位*/ /*18位转15位*/
getId15: function (idCardNo) { getId15: function (idCardNo) {
if (idCardNo.length == 15) { if (idCardNo.length == 15) {
return idCardNo; return idCardNo
} else if (idCardNo.length == 18) { } else if (idCardNo.length == 18) {
return idCardNo.substring(0, 6) + idCardNo.substring(8, 17); return idCardNo.substring(0, 6) + idCardNo.substring(8, 17)
} else { } else {
return null; return null
} }
}, },
/*15位转18位*/ /*15位转18位*/
getId18: function (idCardNo) { getId18: function (idCardNo) {
if (idCardNo.length == 15) { if (idCardNo.length == 15) {
const id17 = idCardNo.substring(0, 6) + '19' + idCardNo.substring(6); const id17 = idCardNo.substring(0, 6) + '19' + idCardNo.substring(6)
const parityBit = idCardNoUtil.getParityBit(id17); const parityBit = idCardNoUtil.getParityBit(id17)
return id17 + parityBit; return id17 + parityBit
} else if (idCardNo.length == 18) { } else if (idCardNo.length == 18) {
return idCardNo; return idCardNo
} else { } else {
return null; return null
} }
}, },
hideId(code) { hideId(code) {
@@ -255,11 +255,21 @@ export default {
dict, dict,
confirm, confirm,
calcAge, calcAge,
injectLib: (url, cb = () => 0) => {
const scriptList = document.body.querySelectorAll('script')
if (Object.values(scriptList || {}).findIndex(e => e.src == url) == -1) {
const script = document.createElement('script')
script.type = 'text/javascript'
script.src = url
script.addEventListener('load', () => cb())
document.body.appendChild(script)
} else cb()
},
dateFormat: (time, format) => { dateFormat: (time, format) => {
return dayjs(time).format(format || 'YYYY-MM-DD').replace("Invalid Date", "") return dayjs(time).format(format || 'YYYY-MM-DD').replace("Invalid Date", "")
}, },
formatName: (name) => { formatName: (name) => {
return Array.from(name)?.slice(-2)?.toString() || ""; return Array.from(name)?.slice(-2)?.toString() || ""
}, },
loading: title => { loading: title => {
uni.showLoading({ uni.showLoading({
@@ -272,24 +282,24 @@ export default {
}, },
colorUtils: { colorUtils: {
Hex2RGBA(color, alpha = 1) { Hex2RGBA(color, alpha = 1) {
let hex = 0; let hex = 0
if (color.charAt(0) == "#") { if (color.charAt(0) == "#") {
if (color.length == 4) { if (color.length == 4) {
//检测诸如#FFF简写格式 //检测诸如#FFF简写格式
color = "#" + color.charAt(1).repeat(2) + color = "#" + color.charAt(1).repeat(2) +
color.charAt(2).repeat(2) + color.charAt(2).repeat(2) +
color.charAt(3).repeat(2); color.charAt(3).repeat(2)
} }
hex = parseInt(color.slice(1), 16); hex = parseInt(color.slice(1), 16)
} }
let r = hex >> 16 & 0xFF; let r = hex >> 16 & 0xFF
let g = hex >> 8 & 0xFF; let g = hex >> 8 & 0xFF
let b = hex & 0xFF; let b = hex & 0xFF
return `rgba(${r},${g},${b},${alpha})`; return `rgba(${r},${g},${b},${alpha})`
}, },
RGBtoHex(r, g, b) { RGBtoHex(r, g, b) {
let hex = r << 16 | g << 8 | b; let hex = r << 16 | g << 8 | b
return "#" + hex.toString(16); return "#" + hex.toString(16)
} }
}, },
dayjs, dayjs,

View File

@@ -42,7 +42,7 @@
<script> <script>
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
import RenderContent from './RenderContent.vue' import RenderContent from './RenderContent.vue'
import { mapFieldLable } from './../../config' import { mapFieldLable } from '../../config'
export default { export default {
name: 'Daily', name: 'Daily',
label: '日报', label: '日报',

View File

@@ -43,7 +43,7 @@
<script> <script>
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
import { mapFieldLable } from './../../config' import { mapFieldLable } from '../../config'
import RenderContent from './RenderContent.vue' import RenderContent from './RenderContent.vue'
export default { export default {
name: 'InspectLog', name: 'InspectLog',
@@ -232,7 +232,7 @@
.top { .top {
width: 100%; width: 100%;
height: 16px; height: 16px;
background: url(./../../images/xc-icon.png) repeat; background: url(../../images/xc-icon.png) repeat;
background-size: 16px 16px; background-size: 16px 16px;
} }

View File

@@ -55,7 +55,7 @@
<script> <script>
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
import RenderContent from './RenderContent.vue' import RenderContent from './RenderContent.vue'
import { mapFieldLable } from './../../config' import { mapFieldLable } from '../../config'
export default { export default {
name: 'MeetingMminutes', name: 'MeetingMminutes',

View File

@@ -41,7 +41,7 @@
<script> <script>
import html2canvas from 'html2canvas' import html2canvas from 'html2canvas'
import RenderContent from './RenderContent.vue' import RenderContent from './RenderContent.vue'
import { mapFieldLable } from './../../config' import { mapFieldLable } from '../../config'
export default { export default {
name: 'WorkReport', name: 'WorkReport',

View File

Before

Width:  |  Height:  |  Size: 667 B

After

Width:  |  Height:  |  Size: 667 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

View File

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 290 B

View File

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

View File

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B

View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

View File

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 531 B

View File

Before

Width:  |  Height:  |  Size: 685 B

After

Width:  |  Height:  |  Size: 685 B

View File

Before

Width:  |  Height:  |  Size: 480 B

After

Width:  |  Height:  |  Size: 480 B

View File

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 267 B

View File

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 293 B

View File

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 119 B

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 796 B

After

Width:  |  Height:  |  Size: 796 B

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

Before

Width:  |  Height:  |  Size: 972 B

After

Width:  |  Height:  |  Size: 972 B

View File

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1001 B

After

Width:  |  Height:  |  Size: 1001 B

View File

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 243 B

View File

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 804 B

After

Width:  |  Height:  |  Size: 804 B

View File

Before

Width:  |  Height:  |  Size: 427 B

After

Width:  |  Height:  |  Size: 427 B

View File

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 292 B

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

Before

Width:  |  Height:  |  Size: 334 B

After

Width:  |  Height:  |  Size: 334 B

View File

Before

Width:  |  Height:  |  Size: 560 B

After

Width:  |  Height:  |  Size: 560 B

View File

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 288 B

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 854 B

After

Width:  |  Height:  |  Size: 854 B

View File

Before

Width:  |  Height:  |  Size: 428 B

After

Width:  |  Height:  |  Size: 428 B

View File

Before

Width:  |  Height:  |  Size: 715 B

After

Width:  |  Height:  |  Size: 715 B

View File

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 458 B

View File

Before

Width:  |  Height:  |  Size: 826 B

After

Width:  |  Height:  |  Size: 826 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 699 B

After

Width:  |  Height:  |  Size: 699 B

View File

Before

Width:  |  Height:  |  Size: 248 B

After

Width:  |  Height:  |  Size: 248 B

Some files were not shown because too many files have changed in this diff Show More