Merge branch 'dev' of https://git.cloud.tencent.com/joylink/jl-nclient into dev
# Conflicts: # src/views/lesson/trainingmanage/index.vue
This commit is contained in:
commit
bf7b12cacb
@ -197,5 +197,6 @@ export default {
|
|||||||
companyInfo:'Beijing Jiulian Technology Co., Ltd',
|
companyInfo:'Beijing Jiulian Technology Co., Ltd',
|
||||||
companyTel:'Tel: +86 13289398171',
|
companyTel:'Tel: +86 13289398171',
|
||||||
companyICP:'Copyright ©2018 Beijing Jiulian Technology Co., Ltd ICP: 18028522',
|
companyICP:'Copyright ©2018 Beijing Jiulian Technology Co., Ltd ICP: 18028522',
|
||||||
enterPermissionNum:'please input permission number'
|
enterPermissionNum:'please input number',
|
||||||
|
enterPermissionNumInt:'number must interger'
|
||||||
};
|
};
|
||||||
|
@ -198,4 +198,5 @@ export default {
|
|||||||
companyTel:'联系电话: 13289398171',
|
companyTel:'联系电话: 13289398171',
|
||||||
companyICP:'Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号',
|
companyICP:'Copyright ©2018 北京玖琏科技有限公司 京ICP备18028522号',
|
||||||
enterPermissionNum:'请输入权限数量',
|
enterPermissionNum:'请输入权限数量',
|
||||||
|
enterPermissionNumInt:'权限数量需为整数'
|
||||||
};
|
};
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- :label="$t('global.permissionList')" -->
|
<!-- :label="$t('global.permissionList')" -->
|
||||||
<el-form-item key="permissionList" :prop="'permissionList.' + scope.$index + '.chooseNumber'" :required="false" :rules="rules.chooseNumber">
|
<el-form-item :prop="'permissionList.' + scope.$index + '.chooseNumber'" :required="false" :rules="rules.chooseNumber">
|
||||||
<el-input-number v-model="scope.row.chooseNumber" size="mini" :max="scope.row.remains" :min="0" />
|
<el-input-number v-model="scope.row.chooseNumber" size="mini" :max="scope.row.remains" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
@ -91,11 +91,24 @@ export default {
|
|||||||
mapId: '',
|
mapId: '',
|
||||||
numberMessage: '',
|
numberMessage: '',
|
||||||
PermissionType: '',
|
PermissionType: '',
|
||||||
isLoading:false
|
isLoading:false,
|
||||||
|
errorTip:this.$t('global.enterPermissionNum'),
|
||||||
|
errorIntTip:this.$t('global.enterPermissionNumInt')
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rules() {
|
rules() {
|
||||||
|
const validateChoose = (rule, value, callback)=> {
|
||||||
|
if (value || value === 0) {
|
||||||
|
if (Number.isInteger(value)) {
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
callback(new Error(this.errorIntTip));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback(new Error(this.errorTip));
|
||||||
|
}
|
||||||
|
};
|
||||||
const crules = {
|
const crules = {
|
||||||
startTime: [
|
startTime: [
|
||||||
{ required: true, message: this.$t('global.enterStartTime'), trigger: 'change' }
|
{ required: true, message: this.$t('global.enterStartTime'), trigger: 'change' }
|
||||||
@ -107,7 +120,14 @@ export default {
|
|||||||
{ required: true, message: this.$t('global.chooseTime'), trigger: 'blur' }
|
{ required: true, message: this.$t('global.chooseTime'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
chooseNumber:[
|
chooseNumber:[
|
||||||
{ required: true, message: this.$t('global.enterPermissionNum'), trigger: 'blur'}
|
{
|
||||||
|
validator:validateChoose,
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator:validateChoose,
|
||||||
|
trigger: 'change'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return crules;
|
return crules;
|
||||||
@ -157,7 +177,10 @@ export default {
|
|||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
if (res.data && res.data.length > 0) {
|
if (res.data && res.data.length > 0) {
|
||||||
this.isDisabled = false;
|
this.isDisabled = false;
|
||||||
this.formModel.permissionList = res.data;
|
let jsonData = JSON.stringify(res.data);
|
||||||
|
jsonData = jsonData.replace(/\"id\"/g, '"chooseNumber":0,"id"');
|
||||||
|
jsonData = JSON.parse(jsonData);
|
||||||
|
this.formModel.permissionList = jsonData;
|
||||||
} else {
|
} else {
|
||||||
this.isDisabled = true;
|
this.isDisabled = true;
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- :label="$t('global.permissionList')" -->
|
<!-- :label="$t('global.permissionList')" -->
|
||||||
<el-form-item key="permissionList" :prop="'permissionList.' + scope.$index + '.chooseNumber'" :required="false" :rules="rules.chooseNumber">
|
<el-form-item :prop="'permissionList.' + scope.$index + '.chooseNumber'" :required="false" :rules="rules.chooseNumber">
|
||||||
<el-input-number v-model="scope.row.chooseNumber" size="mini" :max="scope.row.remains" :min="0" />
|
<el-input-number v-model="scope.row.chooseNumber" size="mini" :max="scope.row.remains" :min="0" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
</template>
|
||||||
@ -91,11 +91,24 @@ export default {
|
|||||||
mapId: '',
|
mapId: '',
|
||||||
numberMessage: '',
|
numberMessage: '',
|
||||||
PermissionType: '',
|
PermissionType: '',
|
||||||
isLoading : false
|
isLoading : false,
|
||||||
|
errorTip:this.$t('global.enterPermissionNum'),
|
||||||
|
errorIntTip:this.$t('global.enterPermissionNumInt')
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rules() {
|
rules() {
|
||||||
|
const validateChoose = (rule, value, callback)=> {
|
||||||
|
if (value || value === 0) {
|
||||||
|
if (Number.isInteger(value)) {
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
callback(new Error(this.errorIntTip));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
callback(new Error(this.errorTip));
|
||||||
|
}
|
||||||
|
};
|
||||||
const crules = {
|
const crules = {
|
||||||
startTime: [
|
startTime: [
|
||||||
{ required: true, message: this.$t('global.enterStartTime'), trigger: 'change' }
|
{ required: true, message: this.$t('global.enterStartTime'), trigger: 'change' }
|
||||||
@ -107,7 +120,14 @@ export default {
|
|||||||
{ required: true, message: this.$t('global.chooseTime'), trigger: 'blur' }
|
{ required: true, message: this.$t('global.chooseTime'), trigger: 'blur' }
|
||||||
],
|
],
|
||||||
chooseNumber:[
|
chooseNumber:[
|
||||||
{ required: true, message: this.$t('global.enterPermissionNum'), trigger: 'blur'}
|
{
|
||||||
|
validator:validateChoose,
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validator:validateChoose,
|
||||||
|
trigger: 'change'
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
return crules;
|
return crules;
|
||||||
@ -131,6 +151,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
setTotalMax() {
|
setTotalMax() {
|
||||||
let endTime;
|
let endTime;
|
||||||
let startTime;
|
let startTime;
|
||||||
@ -157,7 +178,10 @@ export default {
|
|||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
if (res.data && res.data.length > 0) {
|
if (res.data && res.data.length > 0) {
|
||||||
this.isDisabled = false;
|
this.isDisabled = false;
|
||||||
this.formModel.permissionList = res.data;
|
let jsonData = JSON.stringify(res.data);
|
||||||
|
jsonData = jsonData.replace(/\"id\"/g, '"chooseNumber":0,"id"');
|
||||||
|
jsonData = JSON.parse(jsonData);
|
||||||
|
this.formModel.permissionList = jsonData;
|
||||||
} else {
|
} else {
|
||||||
this.isDisabled = true;
|
this.isDisabled = true;
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,8 @@ export default {
|
|||||||
this.queryForm.queryObject.prdId.config.data.push({ value: elem.id, label: elem.name });
|
this.queryForm.queryObject.prdId.config.data.push({ value: elem.id, label: elem.name });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.typeChoose({type:this.queryForm.queryObject.prdId.config.data[0].id});
|
// debugger;
|
||||||
|
// this.typeChoose({type:this.queryForm.queryObject.type.config.data[0].value});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user