Merge remote-tracking branch 'origin/dev-3.1' into dev-3.1.1_theme
This commit is contained in:
@@ -87,8 +87,8 @@ export function noSpecialChar (rule, value, callback) {
|
||||
}
|
||||
|
||||
export function latlng (rule, value, callback) {
|
||||
const lngReg = /^[\-\+]?(0?\d{1,2}\.\d{1,7}|1[0-7]?\d{1}\.\d{1,7}|180\.0{1,7})$/
|
||||
const latReg = /^[\-\+]?([1-8]?\d{1}\.\d{1,7}|90\.0{1,7})$/
|
||||
const lngReg = /^[\-\+]?(0?\d{1,2}\.\d{1,7}|1[0-7]?\d{1}\.\d{1,7}|180\.0{1,7}|0?\d{1,2}|1[0-7]?\d{1}|180)$/ // 经度正则验证
|
||||
const latReg = /^[\-\+]?([1-8]?\d{1}\.\d{1,7}|90\.0{1,7}|[1-8]?\d{1}|90)$/ // 纬度正则验证
|
||||
setTimeout(() => {
|
||||
const lnglat = value.split(',')
|
||||
if (!lnglat || lnglat.length !== 2) {
|
||||
|
||||
@@ -136,8 +136,8 @@ export default {
|
||||
this.$message.error(this.$t('tip.lnglatError'))
|
||||
return false
|
||||
}
|
||||
const lngReg = /^[\-\+]?(0?\d{1,2}\.\d{0,7}|1[0-7]?\d{1}\.\d{1,7}|180\.0{0,7})$/
|
||||
const latReg = /^[\-\+]?([0-8]?\d{1}\.\d{0,7}|90\.0{0,7})$/
|
||||
const lngReg = /^[\-\+]?(0?\d{1,2}\.\d{1,7}|1[0-7]?\d{1}\.\d{1,7}|180\.0{1,7}|0?\d{1,2}|1[0-7]?\d{1}|180)$/ // 经度正则验证
|
||||
const latReg = /^[\-\+]?([1-8]?\d{1}\.\d{1,7}|90\.0{1,7}|[1-8]?\d{1}|90)$/ // 纬度正则验证
|
||||
if (!lngReg.test(lnglat[0]) || !latReg.test(lnglat[1])) {
|
||||
// this.lnglat = this.oldlnglat
|
||||
this.$message.error(this.$t('tip.lnglatError'))
|
||||
|
||||
@@ -70,7 +70,8 @@ import latlngPicker from '../latlngPicker'
|
||||
import editRigthBox from '../mixin/editRigthBox'
|
||||
import { noSpecialChar, latlng } from '@/components/common/js/validate'
|
||||
|
||||
const regNum = /^[0-9]+.?[0-9]*/
|
||||
const latitudeNum = /^[\-\+]?([1-8]?\d{1}\.\d{1,7}|90\.0{1,7}|[1-8]?\d{1}|90)$/ // 纬度正则验证
|
||||
const longitudeNum = /^[\-\+]?(0?\d{1,2}\.\d{1,7}|1[0-7]?\d{1}\.\d{1,7}|180\.0{1,7}|0?\d{1,2}|1[0-7]?\d{1}|180)$/ // 经度正则验证
|
||||
|
||||
export default {
|
||||
name: 'dcBox',
|
||||
@@ -139,10 +140,10 @@ export default {
|
||||
const attr = this.$refs.latlngPicker.getAttribute()
|
||||
param.latitude = attr.latitude
|
||||
param.longitude = attr.longitude
|
||||
if (!regNum.test(param.longitude)) {
|
||||
if (!longitudeNum.test(param.longitude)) {
|
||||
param.longitude = null
|
||||
}
|
||||
if (!regNum.test(param.latitude)) {
|
||||
if (!latitudeNum.test(param.latitude)) {
|
||||
param.latitude = null
|
||||
}
|
||||
this.$post('/dc', param).then(response => {
|
||||
|
||||
@@ -32,10 +32,6 @@
|
||||
<script>
|
||||
export default {
|
||||
name: 'changePin',
|
||||
props: {
|
||||
curUser: { type: String },
|
||||
showDialog: { type: Boolean, default: false }
|
||||
},
|
||||
data () {
|
||||
const temp = this
|
||||
const validatePass = (rule, value, callback) => {
|
||||
@@ -54,12 +50,11 @@ export default {
|
||||
}
|
||||
return {
|
||||
user: {
|
||||
username: '',
|
||||
pin: '',
|
||||
newPin: '',
|
||||
confirmPin: ''
|
||||
},
|
||||
sysUser: sessionStorage.getItem('nz-username'),
|
||||
userId: localStorage.getItem('nz-user-id'),
|
||||
rules: {
|
||||
pin: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
newPin: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, { validator: validatePass, trigger: 'blur' }],
|
||||
@@ -68,9 +63,7 @@ export default {
|
||||
visible: false
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.user.username = this.curUser && this.curUser != '' ? this.curUser : sessionStorage.getItem('nz-username')
|
||||
},
|
||||
created () {},
|
||||
methods: {
|
||||
dialogOpened: function () {
|
||||
if (this.$refs.changePinForm) {
|
||||
@@ -88,9 +81,10 @@ export default {
|
||||
if (valid) {
|
||||
const paramObj = {
|
||||
pin: this.user.pin,
|
||||
newPin: this.user.newPin
|
||||
newPin: this.user.newPin,
|
||||
id: this.userId
|
||||
}
|
||||
this.$put('/sys/user/pin?oldPin=' + paramObj.pin + '&newPin=' + paramObj.newPin).then(response => {
|
||||
this.$put('/sys/user/pin?oldPin=' + paramObj.pin + '&newPin=' + paramObj.newPin + '&id=' + paramObj.id).then(response => {
|
||||
if (response && response.code == 200) {
|
||||
this.$message({ duration: 2000, type: 'success', message: this.$t('tip.saveSuccess') })
|
||||
this.user.pin = ''
|
||||
@@ -103,11 +97,6 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
showDialog: function (n, o) {
|
||||
this.visible = n
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user