Merge branch 'test' of https://git.code.tencent.com/lian-cbtc/jl-client into test
This commit is contained in:
commit
a5c97fc6b5
@ -60,9 +60,11 @@ export default {
|
||||
this.bacground = 'rgba(0,0,0,0)';
|
||||
this.scaleRate = window.innerWidth / 2200;
|
||||
if (this.stationId == 'mainHouseOne') {
|
||||
this.title = '黄山主变电所接线图';
|
||||
// 黄山
|
||||
this.title = '主所1主变电所接线图';
|
||||
} else {
|
||||
this.title = '茶亭主变电所接线图';
|
||||
// 茶亭
|
||||
this.title = '主所2主变电所接线图';
|
||||
}
|
||||
params.userInterface = 'substation';
|
||||
// parkingLotName
|
||||
|
@ -10,12 +10,11 @@
|
||||
:modal="false"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="6" :offset="2" style="height: 30px; line-height: 30px;">{{ $t('planMonitor.serviceNumber2')+$t('global.colon') }}</el-col>
|
||||
<el-col :span="10" :offset="1">
|
||||
<el-input v-model="serviceNumber" size="mini" maxlength="3" minlength="2" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form ref="form" :rules="rules" :model="formModel" label-width="100px" size="medium" @submit.native.prevent>
|
||||
<el-form-item prop="serviceNumber" :label="$t('planMonitor.serviceNumber2')+$t('global.colon')" :required="true">
|
||||
<el-input v-model="formModel.serviceNumber" type="text" size="mini" maxlength="3" minlength="2" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="medium" @click="doClose">{{ $t('global.cancel') }}</el-button>
|
||||
<el-button type="primary" size="medium" @click="handleCommit">{{ $t('global.confirm') }}</el-button>
|
||||
@ -40,7 +39,15 @@ export default {
|
||||
return {
|
||||
dialogShow: false,
|
||||
loading: false,
|
||||
serviceNumber: ''
|
||||
formModel:{
|
||||
serviceNumber: ''
|
||||
},
|
||||
rules:{
|
||||
serviceNumber:[
|
||||
{required: true, validator: this.validateServiceNumber, trigger: 'blur'},
|
||||
{required: true, validator: this.validateServiceNumber, trigger: 'change'}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@ -58,9 +65,30 @@ export default {
|
||||
this.loading = false;
|
||||
this.dialogShow = false;
|
||||
},
|
||||
validateServiceNumber(rule, value, callback) {
|
||||
if (typeof value == 'string' && value.trim().length == 0) {
|
||||
return callback(new Error('请填写服务号'));
|
||||
} else {
|
||||
const newValue = parseInt(value);
|
||||
if (newValue) {
|
||||
if (newValue.toString() != value) {
|
||||
this.formModel.serviceNumber = newValue;
|
||||
}
|
||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||
if (serviceNumberList.includes(value)) {
|
||||
return callback(new Error('该服务号已存在,请重新填写'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
} else {
|
||||
this.formModel.serviceNumber = '';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
handleCommit() {
|
||||
if (this.$route.query.planId || this.loadRunPlanId) {
|
||||
if (this.serviceNumber.length >= 2 && this.serviceNumber.length <= 3) {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
if (this.$route.query.planId || this.loadRunPlanId) {
|
||||
checkServiceNumberExist({ planId: this.$route.query.planId || this.loadRunPlanId, serviceNumber: this.serviceNumber }).then(resp => {
|
||||
if (resp.data) {
|
||||
this.$emit('dispatchDialog', {
|
||||
@ -79,11 +107,13 @@ export default {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$messageBox('长度在二到三位');
|
||||
this.$messageBox(this.$t('tip.chooseToOpenTheRunGraph'));
|
||||
}
|
||||
} else {
|
||||
this.$messageBox(this.$t('tip.chooseToOpenTheRunGraph'));
|
||||
}
|
||||
});
|
||||
// if (this.serviceNumber.length >= 2 && this.serviceNumber.length <= 3) {
|
||||
// } else {
|
||||
// this.$messageBox('长度在二到三位');
|
||||
// }
|
||||
},
|
||||
handleConfirm(isNew = false) {
|
||||
this.doClose();
|
||||
|
@ -58,7 +58,8 @@ export default {
|
||||
|
||||
rules: {
|
||||
serviceNumber:[
|
||||
{required: true, validator: this.validateServiceNumber, trigger: 'blur'}
|
||||
{required: true, validator: this.validateServiceNumber, trigger: 'blur'},
|
||||
{required: true, validator: this.validateServiceNumber, trigger: 'change'}
|
||||
],
|
||||
beginTime: [
|
||||
{ required: true, message: '请填写开始时间', trigger: 'blur' }
|
||||
@ -134,15 +135,24 @@ export default {
|
||||
this.dialogShow = true;
|
||||
},
|
||||
validateServiceNumber(rule, value, callback) {
|
||||
if (value.trim().length == 0) {
|
||||
if (typeof value == 'string' && value.trim().length == 0) {
|
||||
return callback(new Error('请填写服务号'));
|
||||
} else {
|
||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||
if (serviceNumberList.includes(value.trim())) {
|
||||
return callback(new Error('该服务号已存在,请重新填写'));
|
||||
const newValue = parseInt(value);
|
||||
if (newValue) {
|
||||
if (newValue.toString() != value) {
|
||||
this.formModel.serviceNumber = newValue;
|
||||
}
|
||||
const serviceNumberList = Object.keys(this.$store.state.runPlan.editData);
|
||||
if (serviceNumberList.includes(value)) {
|
||||
return callback(new Error('该服务号已存在,请重新填写'));
|
||||
} else {
|
||||
return callback();
|
||||
}
|
||||
} else {
|
||||
return callback();
|
||||
this.formModel.serviceNumber = '';
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
validateRunningRouting(rule, value, callback) {
|
||||
|
@ -32,7 +32,7 @@
|
||||
<span>{{ $t('global.startTime')+$t('global.colon') }}</span>
|
||||
</el-col>
|
||||
<el-col :span="5">
|
||||
<el-time-picker v-model="addModel.startTime" size="mini" value-format="HH:mm:ss" :clearable="false" />
|
||||
<el-time-picker v-model="addModel.startTime" size="mini" value-format="HH:mm:ss" :clearable="false" :picker-options="{selectableRange:'02:00:00-23:59:59'}" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row style="margin-top: 5px;height: 28px;line-height: 28px;">
|
||||
|
@ -146,6 +146,7 @@
|
||||
value-format="HH:mm:ss"
|
||||
size="mini"
|
||||
:clearable="false"
|
||||
:picker-options="{selectableRange:'02:00:00-23:59:59'}"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -80,8 +80,8 @@ export default {
|
||||
return {
|
||||
labelWidth: '100px',
|
||||
items: [
|
||||
{ prop: 'beginTime', label: '开始时间', type: 'timePicker'},
|
||||
{ prop: 'overTime', label: '结束时间', type: 'timePicker'},
|
||||
{ prop: 'beginTime', label: '开始时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
|
||||
{ prop: 'overTime', label: '结束时间', type: 'timePicker', selectableRange:'02:00:00-23:59:59'},
|
||||
{ prop: 'departureTimeInterval', label: '发车间隔', type: 'number'},
|
||||
{ prop: 'parkedTime', label: '停站时间', type: 'number'},
|
||||
{ prop: 'reentryTime', label: '折返时间', type: 'number'},
|
||||
|
@ -24,6 +24,7 @@
|
||||
value-format="timestamp"
|
||||
:disabled="isEdit"
|
||||
:picker-options="pickerOptions"
|
||||
@change="handle"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -37,8 +38,8 @@
|
||||
style="width: 100%;"
|
||||
value-format="timestamp"
|
||||
:disabled="true"
|
||||
:picker-options="pickerOptions"
|
||||
/>
|
||||
<!-- :picker-options="pickerOptions" -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
@ -123,6 +124,7 @@ export default {
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return time.getTime() < new Date(new Date().toLocaleDateString()).getTime();
|
||||
// return time.getTime() < Date.now() - 1 * 24 * 3600 * 1000;
|
||||
}
|
||||
},
|
||||
formDetail: {
|
||||
@ -217,6 +219,12 @@ export default {
|
||||
passMark: data.passMark
|
||||
};
|
||||
},
|
||||
handle() {
|
||||
var startAt = new Date(this.form.startDate) * 1000 / 1000;
|
||||
if (startAt < Date.now()) {
|
||||
this.form.startDate = new Date().getTime();
|
||||
}
|
||||
},
|
||||
getClassList() {
|
||||
if (this.isClassShow) {
|
||||
this.classList = [];
|
||||
@ -255,34 +263,26 @@ export default {
|
||||
});
|
||||
},
|
||||
submitForm() {
|
||||
this.submit('definition');
|
||||
},
|
||||
submit(type) {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.startDate) {
|
||||
this.form.startDate = this.getDate(this.form.startDate);
|
||||
const form = Object.assign({}, this.form);
|
||||
if (form.startDate) {
|
||||
form.startDate = this.getDate(form.startDate);
|
||||
}
|
||||
if (this.form.endDate) {
|
||||
this.form.endDate = this.getDate(this.form.endDate);
|
||||
if (form.endDate) {
|
||||
form.endDate = this.getDate(form.endDate);
|
||||
}
|
||||
this.form['trial'] = this.trial;
|
||||
this.$store.dispatch('exam/setCourseDetail', this.form);
|
||||
this.$emit('definition', this.form);
|
||||
form['trial'] = this.trial;
|
||||
this.$store.dispatch('exam/setCourseDetail', form);
|
||||
this.$emit(type, form);
|
||||
}
|
||||
});
|
||||
},
|
||||
createQuickly() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.startDate) {
|
||||
this.form.startDate = this.getDate(this.form.startDate);
|
||||
}
|
||||
if (this.form.endDate) {
|
||||
this.form.endDate = this.getDate(this.form.endDate);
|
||||
}
|
||||
this.form['trial'] = this.trial;
|
||||
this.$store.dispatch('exam/setCourseDetail', this.form);
|
||||
this.$emit('createQuickly', this.form);
|
||||
}
|
||||
});
|
||||
this.submit('createQuickly');
|
||||
},
|
||||
getDate(date) {
|
||||
const now = new Date(date);
|
||||
|
@ -149,6 +149,7 @@ export default {
|
||||
this.$store.dispatch('exam/setRuleList', []); // 清空规则列表数据
|
||||
const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`;
|
||||
const lessonId = this.$route.params.lessonId;
|
||||
this.$store.dispatch('exam/setCourseDetail', {});
|
||||
if (parseInt(lessonId)) {
|
||||
this.$router.replace({ path: `${path}`, query: { mapId: this.$route.query.mapId, lessonId: lessonId, noPreLogout: this.$route.query.noPreLogout } });
|
||||
} else {
|
||||
|
@ -141,8 +141,8 @@ export default {
|
||||
name: this.course.name, // 名称
|
||||
passingPoint: Number(this.course.passMark), // 及格分
|
||||
remarks: this.course.desc, // 考试说明
|
||||
endTime: this.course.endTime,
|
||||
startTime: this.course.startTime,
|
||||
endTime: this.course.endDate,
|
||||
startTime: this.course.startDate,
|
||||
type: this.course.type, // 类型
|
||||
trial: this.course.trial == 2 // 权限判断
|
||||
};
|
||||
|
@ -76,7 +76,8 @@ export default {
|
||||
title: this.$t('publish.examTime'),
|
||||
prop: 'startTime',
|
||||
type: 'formatter',
|
||||
format: 'yyyy-MM-dd hh:ss'
|
||||
format: 'yyyy-MM-dd hh:ss',
|
||||
width:'200px'
|
||||
},
|
||||
{
|
||||
title: this.$t('publish.fullMark'),
|
||||
|
@ -4,7 +4,7 @@
|
||||
<el-dialog title="复制iscs数据" :visible.sync="dialogVisible" width="400px" center>
|
||||
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button :loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
|
||||
<el-button @click="close">{{ $t('global.cancel') }}</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
@ -158,11 +158,14 @@ export default {
|
||||
},
|
||||
doSave() {
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
this.loading = true;
|
||||
copyIscsData(this.formModel).then(res=>{
|
||||
this.loading = false;
|
||||
this.$message.success('复制ISCS数据成功');
|
||||
this.close();
|
||||
this.reloadTable();
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
this.reloadTable();
|
||||
this.$messageBox('复制ISCS数据失败');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user