NEZ-875 fix: 修复Asset/Asset页面相关问题
This commit is contained in:
@@ -140,6 +140,26 @@ export function uSize (rule, value, callback) {
|
||||
}, 100)
|
||||
}
|
||||
|
||||
export function checkAssetAge (rule, value, callback) {
|
||||
setTimeout(() => {
|
||||
if (value.length > 128) {
|
||||
return callback(vm.$t('overall.checkAssetAge'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
export function checkExpressionAge (rule, value, callback) {
|
||||
setTimeout(() => {
|
||||
if (value.length > 64) {
|
||||
return callback(vm.$t('overall.checkAssetAge'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
export function longAndLat (rule, value, callback) { // 校验经纬度
|
||||
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { host, port } from '@/components/common/js/validate'
|
||||
import { host, port, checkAssetAge } from '@/components/common/js/validate'
|
||||
import { asset as assetConstants } from '@/components/common/js/constants'
|
||||
import selectAssetType from '@/components/common/popBox/selectAssetType'
|
||||
import locationCascader from '@/components/common/rightBox/locationCascader'
|
||||
@@ -317,7 +317,8 @@ export default {
|
||||
labelCascShow: true, // 用来控制label的cascader的重新渲染
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
||||
{ validator: checkAssetAge, trigger: 'blur' }
|
||||
],
|
||||
pid: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
@@ -430,6 +431,9 @@ export default {
|
||||
deep: true,
|
||||
immediate: true,
|
||||
handler (n) {
|
||||
if (this.editAsset.pid === -1) {
|
||||
this.editAsset.pid = ''
|
||||
}
|
||||
if (n && n !== -1) {
|
||||
if (this.vmLock) {
|
||||
if (this.options.parentAssetOptions.length === 0) {
|
||||
@@ -609,7 +613,7 @@ export default {
|
||||
const params = JSON.parse(JSON.stringify(this.editAsset))
|
||||
if (params.type.vm !== 1) {
|
||||
params.parent = {}
|
||||
params.pid = ''
|
||||
params.pid = '-1'
|
||||
}
|
||||
if (params.id) {
|
||||
this.$put(this.url, params).then(res => {
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
<script>
|
||||
import promqlInput from '../../page/dashboard/explore/promqlInput'
|
||||
import editRigthBox from '../mixin/editRigthBox'
|
||||
import { checkExpressionAge } from '@/components/common/js/validate'
|
||||
|
||||
export default {
|
||||
name: 'exprTempBox',
|
||||
@@ -107,7 +108,8 @@ export default {
|
||||
gnameList: [],
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' },
|
||||
{ validator: checkExpressionAge, trigger: true }
|
||||
],
|
||||
gname: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
|
||||
Reference in New Issue
Block a user