desc: 调整高度样式

This commit is contained in:
zyy 2019-10-29 13:15:57 +08:00
parent 7246568801
commit c08e2afaaa
10 changed files with 2382 additions and 2260 deletions

View File

@ -25,31 +25,31 @@ module.exports = {
"vue/no-v-html": "off",
'accessor-pairs': 2,
"arrow-spacing": 0,//=>的前/后括号
'block-spacing': [2, 'always'],
'brace-style': [2, '1tbs', {
'block-spacing': [2, 'always'], // 禁止或强制在代码块中开括号前和闭括号后有空格 { return 11 }
'brace-style': [2, '1tbs', { // 强制在代码块中使用一致的大括号风格
'allowSingleLine': true
}],
'camelcase': [0, {
'camelcase': [0, { // 强制使用驼峰拼写法命名规定
'properties': 'always'
}],
'comma-dangle': [2, 'never'],
'comma-spacing': [2, {
'comma-dangle': [2, 'never'], // 要求或禁止末尾逗号
'comma-spacing': [2, { // 强制在逗号前后使用一致的空格
'before': false,
'after': true
}],
'comma-style': [2, 'last'],
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'comma-style': [2, 'last'], // 强制在逗号前后使用一致的空格
'constructor-super': 2, // 要求在构造函数中有super()调用
'curly': [2, 'multi-line'], // 强制所有控制语句使用一致的括号风格
'dot-location': [2, 'property'], // 强制在点号之前和之后一致的换行
'eol-last': 2, // 禁止文件末尾存在空行禁止文件末尾存在空行
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': ["error", "tab"],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'indent': [2, 4], // 强制使用一致的缩进
'jsx-quotes': [2, 'prefer-single'], // 强制在JSX属性中一致地使用双引号或单引号
'key-spacing': [0, { // 强制要求在对象字面量的属性中键和值之间使用一致的间距
'beforeColon': false,
'afterColon': true
}],
@ -58,8 +58,8 @@ module.exports = {
'after': true
}],
"new-cap": 2,//函数名首行大写必须使用new方式调用首行小写必须用不带new方式调用
'new-parens': 2,
'no-array-constructor': 2,
'new-parens': 2, // 要求构造无参构造函数时有圆括号
'no-array-constructor': 2, // 禁用Array构造函数
'no-caller': 2,
'no-console': 'off',
'no-class-assign': 2,
@ -96,7 +96,8 @@ module.exports = {
"no-mixed-spaces-and-tabs": [2, false],//禁止混用tab和空格
"no-multi-spaces": 1,// 不能用多余的空格
'no-multi-str': 2,
'no-multiple-empty-lines': [2, {
'no-multiple-empty-lines': [2, { // 禁止出现多行空行
// 最大连续空行数
'max': 1
}],
'no-native-reassign': 2,
@ -121,7 +122,7 @@ module.exports = {
'no-sparse-arrays': 2,
'no-this-before-super': 2,
'no-throw-literal': 2,
"no-trailing-spaces": 1,//一行结束后面不要有空格
"no-trailing-spaces": 1,// 禁止行尾空格
'no-undef': 2,
'no-undef-init': 2,
'no-unexpected-multiline': 2,
@ -139,7 +140,7 @@ module.exports = {
'no-useless-computed-key': 2,
'no-useless-constructor': 2,
'no-useless-escape': 0,
'no-whitespace-before-property': 2,
'no-whitespace-before-property': 2, // 禁止属性前有空白
'no-with': 2,
'one-var': [2, {
'initialized': 'never'
@ -156,15 +157,15 @@ module.exports = {
'allowTemplateLiterals': true
}],
'semi': [2, 'always'], // 语句强制分号结尾
'semi-spacing': [2, {
'semi-spacing': [2, { // 强制分号之前和之后使用一致的空格
'before': false,
'after': true
}],
"strict": 2,//使用严格模式
'space-before-blocks': [2, 'always'], //不以新行开始的块{前面要不要有空格
'space-before-blocks': [2, 'always'], // 不以新行开始的块{前面要不要有空格 强制在块之前使用一致的空格
"space-before-function-paren": [0, "always"],// 函数定义时括号前面要不要有空格
"space-in-parens": [0, "never"],// 小括号里面要不要有空格
"space-infix-ops": 0,//中缀操作符周围要不要有空格
"space-infix-ops": 2,// 要求操作符周围有空格
'space-unary-ops': [2, {
'words': true,
'nonwords': false
@ -172,7 +173,7 @@ module.exports = {
'spaced-comment': [2, 'always', {
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
}], //注释风格要不要有空格什么的
'template-curly-spacing': [2, 'never'],
// 'template-curly-spacing': [2, 'never'],
'use-isnan': 2, //禁止比较时使用NaN只能用isNaN()
'valid-typeof': 2, //必须使用合法的typeof的值
"wrap-iife": [2, "inside"],//立即执行函数表达式的小括号风格
@ -180,7 +181,7 @@ module.exports = {
'yoda': [2, 'never'], //禁止尤达条件
'prefer-const': 2,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
"object-curly-spacing": [0, "never"],//大括号内是否允许不必要的空格
"array-bracket-spacing": [2, "never"], //是否允许非空数组里面有多余的空格
"object-curly-spacing": [0, "never"], // 强制在大括号中使用一致的空格
"array-bracket-spacing": [2, "never"], // 禁止或强制在括号内使用空格
}
}

View File

@ -1,5 +1,6 @@
<template>
<div class="query-list-page" :style="{height: queryList.height ? 'auto' : listPageHeight}">
<!-- :style="{height: queryList.height ? 'auto' : listPageHeight}" -->
<div class="query-list-page">
<query-form
v-show="!(queryForm.show === false)"
ref="queryForm"

View File

@ -3,8 +3,8 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else {

View File

@ -1,5 +1,5 @@
<template>
<el-card>
<el-card style="height: 100%; overflow-y: auto;">
<div slot="header" style="text-align: center;">
<b>{{ $t('lesson.courseName') + ': '+ name }}</b>
</div>

View File

@ -1,5 +1,12 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="25%" :before-close="handleClose" center>
<el-dialog
v-dialogDrag
:title="title"
:visible.sync="dialogVisible"
width="25%"
:before-close="handleClose"
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>
@ -32,7 +39,14 @@ export default {
const form = {
labelWidth: '120px',
items: [
{ prop: 'skinCode', label: this.$t('lesson.skinType'), type: 'select', required: true, options: this.skinCodeList, disabled: true }
{
prop: 'skinCode',
label: this.$t('lesson.skinType'),
type: 'select',
required: true,
options: this.skinCodeList,
disabled: true
}
]
};
return form;
@ -40,7 +54,11 @@ export default {
rules() {
const crules = {
skinCode: [
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
{
required: true,
message: this.$t('rules.inputSkinType'),
trigger: 'change'
}
]
};
return crules;
@ -77,13 +95,19 @@ export default {
const self = this;
this.$refs.dataform.validateForm(() => {
if (this.isShow) {
this.$confirm(this.$t('lesson.wellClearOperate'), this.$t('global.tips'), {
this.$confirm(
this.$t('lesson.wellClearOperate'),
this.$t('global.tips'),
{
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
}
)
.then(() => {
self.create();
}).catch(() => { });
})
.catch(() => {});
} else {
self.create();
}
@ -92,14 +116,21 @@ export default {
create() {
const self = this;
this.loading = true;
addTrainingRulesList(this.formModel.skinCode, OperationList[this.formModel.skinCode].list).then(response => {
addTrainingRulesList(
this.formModel.skinCode,
OperationList[this.formModel.skinCode].list
)
.then(response => {
self.loading = false;
self.$message.success(this.$t('lesson.batchCreateSuccess'));
self.handleClose();
self.$emit('reloadTable'); //
}).catch(error => {
})
.catch(error => {
self.loading = false;
self.$message.error(`${this.$('error.batchCreateFailed')}:${error.message}`);
self.$message.error(
`${this.$('error.batchCreateFailed')}:${error.message}`
);
});
},
handleClose() {

View File

@ -200,7 +200,7 @@ export default {
} else {
this.formModel = {
skinCode: this.$route.query.skinCode
}
};
}
},
repliceName(fieldValue, enumList) {

View File

@ -1,6 +1,8 @@
<template>
<div>
<div style="height: 100%; overflow-y: auto;">
<!-- <div style="height: calc(100% - 80px); overflow-y: auto;"> -->
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<!-- </div> -->
<training-edit ref="create" type="ADD" @reloadTable="reloadTable" />
<training-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
<add-batch ref="addBatch" @reloadTable="reloadTable" />
@ -14,7 +16,11 @@
</template>
<script>
import { getTrainingRulesList, deleteTrainingRulesData, getPlaceholderList } from '@/api/management/operation';
import {
getTrainingRulesList,
deleteTrainingRulesData,
getPlaceholderList
} from '@/api/management/operation';
import { getSkinCodeList } from '@/api/management/mapskin';
import TrainingEdit from './addEdit';
import AddBatch from './addBatch';
@ -55,7 +61,6 @@ export default {
label: this.$t('lesson.trainingName')
}
}
},
queryList: {
query: this.getList,
@ -66,28 +71,56 @@ export default {
title: this.$t('lesson.trainingName'),
prop: 'trainingName',
type: 'replicText',
columnValue: (row) => { return this.repliceName(row.trainingName, this.placeholderMap[row.trainingType]); }
columnValue: row => {
return this.repliceName(
row.trainingName,
this.placeholderMap[row.trainingType]
);
}
},
{
title: this.$t('lesson.skinType'),
prop: 'skinCode',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.skinCode, this.skinCodeList, ['code', 'name']); },
tagType: (row) => { return ''; }
columnValue: row => {
return this.$convertField(row.skinCode, this.skinCodeList, [
'code',
'name'
]);
},
tagType: row => {
return '';
}
},
{
title: this.$t('lesson.trainingType'),
prop: 'trainingType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.trainingType, this.trainingTypeList, ['code', 'name']); },
tagType: (row) => { return 'success'; }
columnValue: row => {
return this.$convertField(
row.trainingType,
this.trainingTypeList,
['code', 'name']
);
},
tagType: row => {
return 'success';
}
},
{
title: this.$t('lesson.operationType'),
prop: 'operateType',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.operateType, this.trainingOperateTypeMap[row.trainingType], ['code', 'name']); },
tagType: (row) => { return 'success'; }
columnValue: row => {
return this.$convertField(
row.operateType,
this.trainingOperateTypeMap[row.trainingType],
['code', 'name']
);
},
tagType: row => {
return 'success';
}
},
{
title: this.$t('lesson.minDuration'),
@ -102,7 +135,12 @@ export default {
title: this.$t('lesson.trainingRemark'),
prop: 'trainingRemark',
type: 'replicText',
columnValue: (row) => { return this.repliceName(row.trainingRemark, this.placeholderMap[row.trainingType]); }
columnValue: row => {
return this.repliceName(
row.trainingRemark,
this.placeholderMap[row.trainingType]
);
}
},
{
type: 'button',
@ -185,7 +223,10 @@ export default {
this.$Dictionary.trainingType().then(list => {
this.trainingTypeList = list;
list.forEach(elem => {
this.queryForm.queryObject.trainingType.config.data.push({ value: elem.code, label: elem.name });
this.queryForm.queryObject.trainingType.config.data.push({
value: elem.code,
label: elem.name
});
});
});
@ -195,7 +236,10 @@ export default {
if (enumList && enumList.length > 0) {
for (let i = 0; i < enumList.length; i++) {
if (fieldValue.includes(`{${enumList[i].id}}`)) {
fieldValue = fieldValue.replace(`{${enumList[i].id}}`, `{${enumList[i].name}}`);
fieldValue = fieldValue.replace(
`{${enumList[i].id}}`,
`{${enumList[i].name}}`
);
}
}
return fieldValue;
@ -209,7 +253,10 @@ export default {
if (form && form.trainingType) {
form.operateType = '';
this.trainingOperateTypeMap[form.trainingType].forEach(elem => {
this.queryForm.queryObject.operateType.config.data.push({ value: elem.code, label: elem.name });
this.queryForm.queryObject.operateType.config.data.push({
value: elem.code,
label: elem.name
});
});
}
},
@ -220,7 +267,10 @@ export default {
return res;
},
handleViewDetail(index, row) {
this.$router.push({ path: `${UrlConfig.design.trainingRuleDetail}`, query: { id: row.id, type: row.trainingType, skinCode: row.skinCode } });
this.$router.push({
path: `${UrlConfig.design.trainingRuleDetail}`,
query: { id: row.id, type: row.trainingType, skinCode: row.skinCode }
});
},
handleEdit(index, row) {
@ -240,22 +290,28 @@ export default {
},
handleDelete(index, row) {
this.$confirm(this.$t('lesson.wellDelTrainingRule'), this.$t('global.tips'), {
this.$confirm(
this.$t('lesson.wellDelTrainingRule'),
this.$t('global.tips'),
{
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
deleteTrainingRulesData(row.id).then(response => {
}
).then(() => {
deleteTrainingRulesData(row.id)
.then(response => {
this.$message.success(this.$t('lesson.deleteSuccess'));
this.reloadTable();
}).catch(() => {
})
.catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
turnback() {
this.$router.go(-1)
this.$router.go(-1);
},
reloadTable() {
this.queryList.reload();

View File

@ -1,5 +1,12 @@
<template>
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogVisible" width="25%" :before-close="handleClose" center>
<el-dialog
v-dialogDrag
:title="title"
:visible.sync="dialogVisible"
width="25%"
:before-close="handleClose"
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>
@ -31,8 +38,20 @@ export default {
const form = {
labelWidth: '120px',
items: [
{ prop: 'skinCodeFrom', label: this.$t('lesson.skinTypeFrom'), type: 'select', required: true, options: this.skinCodeList },
{ prop: 'skinCodeTo', label: this.$t('lesson.skinTypeTo'), type: 'select', required: true, options: this.skinCodeList }
{
prop: 'skinCodeFrom',
label: this.$t('lesson.skinTypeFrom'),
type: 'select',
required: true,
options: this.skinCodeList
},
{
prop: 'skinCodeTo',
label: this.$t('lesson.skinTypeTo'),
type: 'select',
required: true,
options: this.skinCodeList
}
]
};
return form;
@ -40,10 +59,18 @@ export default {
rules() {
const crules = {
skinCodeFrom: [
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
{
required: true,
message: this.$t('rules.inputSkinType'),
trigger: 'change'
}
],
skinCodeTo: [
{ required: true, message: this.$t('rules.inputSkinType'), trigger: 'change' }
{
required: true,
message: this.$t('rules.inputSkinType'),
trigger: 'change'
}
]
};
return crules;
@ -87,14 +114,18 @@ export default {
create() {
const self = this;
this.loading = true;
postOperateSaveAs(this.formModel.skinCodeFrom, this.formModel.skinCodeTo).then(response => {
postOperateSaveAs(this.formModel.skinCodeFrom, this.formModel.skinCodeTo)
.then(response => {
self.loading = false;
self.$message.success(this.$t('lesson.batchCreateSuccess'));
self.handleClose();
self.$emit('reloadTable'); //
}).catch(error => {
})
.catch(error => {
self.loading = false;
self.$message.error(`${this.$('error.batchCreateFailed')}:${error.message}`);
self.$message.error(
`${this.$('error.batchCreateFailed')}:${error.message}`
);
});
},
handleClose() {

View File

@ -1,6 +1,8 @@
<template>
<div>
<div style="height: 100%; overflow-y: auto;">
<!-- <div style="height: calc(100% - 80px); overflow-y: auto;"> -->
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<!-- </div> -->
<training-draft
ref="draftTrain"
:skin-code-list="skinCodeList"