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