Elements-SY

modify

...@@ -12,12 +12,6 @@ ...@@ -12,12 +12,6 @@
12 } 12 }
13 } 13 }
14 } 14 }
15 -@mixin mariginBottom($pixe: 4px) {
16 - margin-bottom: $pixe;
17 -}
18 -.btn-mg {
19 - @include mariginBottom()
20 -}
21 .blue-btn { 15 .blue-btn {
22 @include colorBtn($blue) 16 @include colorBtn($blue)
23 } 17 }
......
1 -@import './variables.scss'; 1 +@import "./variables.scss";
2 -@import './mixin.scss'; 2 +@import "./mixin.scss";
3 -@import './transition.scss'; 3 +@import "./transition.scss";
4 -@import './element-ui.scss'; 4 +@import "./element-ui.scss";
5 -@import './sidebar.scss'; 5 +@import "./sidebar.scss";
6 -@import './btn.scss'; 6 +@import "./btn.scss";
7 7
8 body { 8 body {
9 height: 100%; 9 height: 100%;
10 -moz-osx-font-smoothing: grayscale; 10 -moz-osx-font-smoothing: grayscale;
11 -webkit-font-smoothing: antialiased; 11 -webkit-font-smoothing: antialiased;
12 text-rendering: optimizeLegibility; 12 text-rendering: optimizeLegibility;
13 - font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; 13 + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
14 + Microsoft YaHei, Arial, sans-serif;
14 } 15 }
15 16
16 label { 17 label {
...@@ -108,7 +109,8 @@ aside { ...@@ -108,7 +109,8 @@ aside {
108 display: block; 109 display: block;
109 line-height: 32px; 110 line-height: 32px;
110 font-size: 16px; 111 font-size: 16px;
111 - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; 112 + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
113 + Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
112 color: #2c3e50; 114 color: #2c3e50;
113 -webkit-font-smoothing: antialiased; 115 -webkit-font-smoothing: antialiased;
114 -moz-osx-font-smoothing: grayscale; 116 -moz-osx-font-smoothing: grayscale;
...@@ -138,7 +140,7 @@ aside { ...@@ -138,7 +140,7 @@ aside {
138 } 140 }
139 141
140 .text-center { 142 .text-center {
141 - text-align: center 143 + text-align: center;
142 } 144 }
143 145
144 .sub-navbar { 146 .sub-navbar {
...@@ -149,7 +151,13 @@ aside { ...@@ -149,7 +151,13 @@ aside {
149 text-align: right; 151 text-align: right;
150 padding-right: 20px; 152 padding-right: 20px;
151 transition: 600ms ease position; 153 transition: 600ms ease position;
152 - background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%); 154 + background: linear-gradient(
155 + 90deg,
156 + rgba(32, 182, 249, 1) 0%,
157 + rgba(32, 182, 249, 1) 0%,
158 + rgba(33, 120, 241, 1) 100%,
159 + rgba(33, 120, 241, 1) 100%
160 + );
153 161
154 .subtitle { 162 .subtitle {
155 font-size: 20px; 163 font-size: 20px;
...@@ -216,7 +224,7 @@ body { ...@@ -216,7 +224,7 @@ body {
216 } 224 }
217 225
218 &::-webkit-scrollbar-track-piece { 226 &::-webkit-scrollbar-track-piece {
219 - background: #F2F6FC; 227 + background: #f2f6fc;
220 } 228 }
221 } 229 }
222 230
...@@ -239,7 +247,7 @@ body { ...@@ -239,7 +247,7 @@ body {
239 .el-table__fixed, 247 .el-table__fixed,
240 .el-table__fixed-right { 248 .el-table__fixed-right {
241 height: calc(100% - 7px) !important; 249 height: calc(100% - 7px) !important;
242 - box-shadow: -5px -2px 10px rgba(0, 0, 0, .12) !important; 250 + box-shadow: -5px -2px 10px rgba(0, 0, 0, 0.12) !important;
243 251
244 .el-table__fixed-body-wrapper { 252 .el-table__fixed-body-wrapper {
245 height: calc(100% - 36px) !important; 253 height: calc(100% - 36px) !important;
...@@ -247,7 +255,7 @@ body { ...@@ -247,7 +255,7 @@ body {
247 } 255 }
248 256
249 // 当表格没有滚动条时 257 // 当表格没有滚动条时
250 -.el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right { 258 +.el-table__body-wrapper.is-scrolling-none ~ .el-table__fixed-right {
251 height: 100% !important; 259 height: 100% !important;
252 bottom: 0 !important; 260 bottom: 0 !important;
253 box-shadow: none !important; 261 box-shadow: none !important;
...@@ -307,4 +315,7 @@ body { ...@@ -307,4 +315,7 @@ body {
307 315
308 .el-select-dropdown__wrap { 316 .el-select-dropdown__wrap {
309 max-height: 350px !important; 317 max-height: 350px !important;
310 -}
...\ No newline at end of file ...\ No newline at end of file
318 +}
319 +.btn-mb-4 {
320 + margin-bottom: 4px;
321 +}
......
1 <template> 1 <template>
2 - <div class="form-header demo-edit"> 2 + <div class="form-header">
3 <el-row style="padding: 20px 0"> 3 <el-row style="padding: 20px 0">
4 <el-col> 4 <el-col>
5 <el-divider content-position="left">ET86配舱航班顺位</el-divider> 5 <el-divider content-position="left">ET86配舱航班顺位</el-divider>
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
36 @focus="inputFocus(scope)" 36 @focus="inputFocus(scope)"
37 @input="inputEvent" 37 @input="inputEvent"
38 placeholder="请输入航班号" 38 placeholder="请输入航班号"
39 + class="demo-edit"
40 + ref="demo"
39 /> 41 />
40 </template> 42 </template>
41 </el-table-column> 43 </el-table-column>
...@@ -416,11 +418,18 @@ export default { ...@@ -416,11 +418,18 @@ export default {
416 this.getEdit(); 418 this.getEdit();
417 this.PostFindDestinationFltRuleByFlightNo(); 419 this.PostFindDestinationFltRuleByFlightNo();
418 }, 420 },
419 - mounted() {}, 421 + mounted() {
422 + this.$nextTick(() => {
423 + let el = document.querySelector(".demo-edit");
424 + console.log(el);
425 + console.log(this.$refs.demo);
426 + });
427 + },
420 directives: { 428 directives: {
421 "input-filter": { 429 "input-filter": {
422 bind: function (el, binding) { 430 bind: function (el, binding) {
423 el.handler = function (event) { 431 el.handler = function (event) {
432 + console.log(el);
424 let regExp = /[^0-9a-zA-Z_]/g; 433 let regExp = /[^0-9a-zA-Z_]/g;
425 let newValue = event.target.value.replace(regExp, ""); 434 let newValue = event.target.value.replace(regExp, "");
426 if (newValue !== event.target.value) { 435 if (newValue !== event.target.value) {
...@@ -602,6 +611,7 @@ export default { ...@@ -602,6 +611,7 @@ export default {
602 // 表单提交 611 // 表单提交
603 submitForm(formName) { 612 submitForm(formName) {
604 this.$refs[formName].validate((valid) => { 613 this.$refs[formName].validate((valid) => {
614 + console.log(valid);
605 if (valid) { 615 if (valid) {
606 } else { 616 } else {
607 console.log("error submit!!"); 617 console.log("error submit!!");
......
...@@ -135,36 +135,81 @@ export default { ...@@ -135,36 +135,81 @@ export default {
135 }, 135 },
136 // 最少件数 136 // 最少件数
137 validateMinPieces(name) { 137 validateMinPieces(name) {
138 + // 校验输入的规则(只能输入正整数)
138 if (/^\d+$/.test(Number(this.queryForm[name]))) { 139 if (/^\d+$/.test(Number(this.queryForm[name]))) {
140 + /*
141 + 【表单校验分析步骤】如下:
142 + 1、校验合规数字(只能输入正整数);
143 + 2、校验一种所有的表单域都为空的情况下 & 所有表单域都不为空的情况下;
144 + 3、所有表单域都为空的情况下最好办,直接返回false;
145 + 4、所有表单都不为空的情况下:这种情况就是做自定义校验;
146 + 5、自定义校验符合规则的返回true否则返回false;
147 + 提示:在做校验数字规则一定要注意无理数(E & e);
148 +
149 +
150 +
151 + :rule="{
152 + el: '.el' || document.querySelector(el), // 获取元素
153 + rule: [], // 规则
154 + value: scope.row, // 校验的值
155 + message: '', // 提示语
156 + style: {}, // 设置提示语文字
157 + hoverMessage: false, // 是否通过鼠标hover时提示Error
158 + required: true,
159 + trigger: 'blur',
160 + }"
161 + 通常情况下表单校验都是单列校验,也就是说每个表单域的校验都是独立的而不受其他表单域的校验的牵涉;
162 + 但是有些情况下,我们的表单校验可能有多列并行校验,比如说重量区间,最大重量和最小重量两个表单域,
163 + 最大重量不能小于最小重量。
164 +
165 + 提交表单的时候获取布尔值或者每一个表单校验的
166 + 单列校验或者多列(并行)校验,
167 +
168 + 使用自定义指令做表单校验:
169 + 当校验不合规则时,一种是插入节点给文本提示的同时让input文本框变成红色的;
170 + 一种是让文本框变成红色的同时鼠标hover的时候弹出悬浮框提示;
171 + 当提交表单的时候不合规则的表单域全部红色描边,并且报错文本提示语
172 +
173 + 提交表单的时候
174 +
175 + */
176 +
139 if (this.queryForm[name] && this.queryForm.maxNumOfPieces) { 177 if (this.queryForm[name] && this.queryForm.maxNumOfPieces) {
178 + // 左区间大于右区间
140 if ( 179 if (
141 Number(this.queryForm[name]) > Number(this.queryForm.maxNumOfPieces) 180 Number(this.queryForm[name]) > Number(this.queryForm.maxNumOfPieces)
142 ) { 181 ) {
143 - // 最少件数1~100,并且最少件数不得大于最多件数
144 this.$refs.minNumOfPieces.innerHTML = ""; 182 this.$refs.minNumOfPieces.innerHTML = "";
145 - this.$refs.minNumOfPieces.innerHTML = 183 + this.$refs.minNumOfPieces.innerHTML = "最少件数不得大于最多件数";
146 - "最少件数1~100,并且最少件数不得大于最多件数"; 184 + } else if (
147 - return false; 185 + Number(this.queryForm[name]) == null &&
148 - } else { 186 + Number(this.queryForm.maxNumOfPieces) == null
187 + ) {
149 this.$refs.minNumOfPieces.innerHTML = ""; 188 this.$refs.minNumOfPieces.innerHTML = "";
150 - } 189 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能为空";
151 - if (Number(this.queryForm[name]) > 100) { 190 + } else if (
191 + Number(this.queryForm[name]) == 0 &&
192 + Number(this.queryForm.maxNumOfPieces) == 0
193 + ) {
152 this.$refs.minNumOfPieces.innerHTML = ""; 194 this.$refs.minNumOfPieces.innerHTML = "";
153 - this.$refs.minNumOfPieces.innerHTML = "件数范围1~100"; 195 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能为0";
154 - return false; 196 + } else {
197 + this.$refs.minNumOfPieces.innerHTML = "";
198 + return true;
155 } 199 }
156 - } else if (this.queryForm[name] !== "" && Number(this.queryForm[name]) < 1) { 200 + } // 不能为空,不能等于0,不能大于指定的数
201 + else if (Number(this.queryForm[name]) == null) {
157 this.$refs.minNumOfPieces.innerHTML = ""; 202 this.$refs.minNumOfPieces.innerHTML = "";
158 - this.$refs.minNumOfPieces.innerHTML = 203 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能为空";
159 - "最少件数1~100,并且最少件数不得大于最多件数"; 204 + } else if (Number(this.queryForm[name]) == 0) {
160 - return false; 205 + this.$refs.minNumOfPieces.innerHTML = "";
206 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能为0";
161 } else if (Number(this.queryForm[name]) > 100) { 207 } else if (Number(this.queryForm[name]) > 100) {
162 this.$refs.minNumOfPieces.innerHTML = ""; 208 this.$refs.minNumOfPieces.innerHTML = "";
163 - this.$refs.minNumOfPieces.innerHTML = 209 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能大于100";
164 - "最少件数1~100,并且最少件数不得大于最多件数";
165 - return false;
166 } else { 210 } else {
167 this.$refs.minNumOfPieces.innerHTML = ""; 211 this.$refs.minNumOfPieces.innerHTML = "";
212 + return true;
168 } 213 }
169 } else { 214 } else {
170 this.$refs.minNumOfPieces.innerHTML = ""; 215 this.$refs.minNumOfPieces.innerHTML = "";
...@@ -174,36 +219,43 @@ export default { ...@@ -174,36 +219,43 @@ export default {
174 }, 219 },
175 // 最多件数 220 // 最多件数
176 validateMaxPieces(name) { 221 validateMaxPieces(name) {
222 + // 校验输入的规则(只能输入正整数)
177 if (/^\d+$/.test(Number(this.queryForm[name]))) { 223 if (/^\d+$/.test(Number(this.queryForm[name]))) {
178 if (this.queryForm[name] && this.queryForm.maxNumOfPieces) { 224 if (this.queryForm[name] && this.queryForm.maxNumOfPieces) {
179 if ( 225 if (
180 Number(this.queryForm[name]) < Number(this.queryForm.minNumOfPieces) 226 Number(this.queryForm[name]) < Number(this.queryForm.minNumOfPieces)
181 ) { 227 ) {
182 - // 最多件数1~100,并且最多件数不得小于最小件数
183 this.$refs.minNumOfPieces.innerHTML = ""; 228 this.$refs.minNumOfPieces.innerHTML = "";
184 - this.$refs.minNumOfPieces.innerHTML = 229 + this.$refs.minNumOfPieces.innerHTML = "最大件数不得小于最少件数";
185 - "最多件数1~100,并且最多件数不得小于最小件数"; 230 + } else if (
186 - return false; 231 + Number(this.queryForm[name]) == null &&
187 - } else { 232 + Number(this.queryForm.minNumOfPieces) == null
233 + ) {
188 this.$refs.minNumOfPieces.innerHTML = ""; 234 this.$refs.minNumOfPieces.innerHTML = "";
189 - } 235 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能为空";
190 - if (Number(this.queryForm[name]) > 100) { 236 + } else if (
237 + Number(this.queryForm[name]) == 0 &&
238 + Number(this.queryForm.minNumOfPieces) == 0
239 + ) {
191 this.$refs.minNumOfPieces.innerHTML = ""; 240 this.$refs.minNumOfPieces.innerHTML = "";
192 - this.$refs.minNumOfPieces.innerHTML = "件数范围1~100"; 241 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能为0";
193 return false; 242 return false;
243 + } else {
244 + this.$refs.minNumOfPieces.innerHTML = "";
245 + return true;
194 } 246 }
195 - } else if (this.queryForm[name] !== "" && Number(this.queryForm[name]) < 1) { 247 + } else if (Number(this.queryForm[name]) == null) {
196 this.$refs.minNumOfPieces.innerHTML = ""; 248 this.$refs.minNumOfPieces.innerHTML = "";
197 - this.$refs.minNumOfPieces.innerHTML = 249 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能为空";
198 - "最多件数1~100,并且最多件数不得小于最小件数"; 250 + } else if (Number(this.queryForm[name]) == 0) {
199 - return false; 251 + this.$refs.minNumOfPieces.innerHTML = "";
252 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能为0";
200 } else if (Number(this.queryForm[name]) > 100) { 253 } else if (Number(this.queryForm[name]) > 100) {
201 this.$refs.minNumOfPieces.innerHTML = ""; 254 this.$refs.minNumOfPieces.innerHTML = "";
202 - this.$refs.minNumOfPieces.innerHTML = 255 + this.$refs.minNumOfPieces.innerHTML = "最少件数和最多件数不能大于100";
203 - "最多件数1~100,并且最多件数不得小于最小件数";
204 - return false;
205 } else { 256 } else {
206 this.$refs.minNumOfPieces.innerHTML = ""; 257 this.$refs.minNumOfPieces.innerHTML = "";
258 + return true;
207 } 259 }
208 } else { 260 } else {
209 this.$refs.minNumOfPieces.innerHTML = ""; 261 this.$refs.minNumOfPieces.innerHTML = "";
......
...@@ -36,13 +36,13 @@ ...@@ -36,13 +36,13 @@
36 <template slot="optionColumn"> 36 <template slot="optionColumn">
37 <el-table-column header-align="center" align="center" label="操作" min-width="210px"> 37 <el-table-column header-align="center" align="center" label="操作" min-width="210px">
38 <template slot-scope="scope"> 38 <template slot-scope="scope">
39 - <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" class="btn-mg">查看</el-button> 39 + <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" class="btn-mb-4">查看</el-button>
40 - <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:role:update']" class="btn-mg">修改 40 + <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:role:update']" class="btn-mb-4">修改
41 </el-button> 41 </el-button>
42 <el-button :type="scope.row.valid == 1 ? 'warning' : 'primary'" size="mini" 42 <el-button :type="scope.row.valid == 1 ? 'warning' : 'primary'" size="mini"
43 - v-hasPermi="['system:role:openClose']" @click="roleStatus(scope)" class="btn-mg">{{ scope.row.valid == 1 ? "停用" : "启用" }} 43 + v-hasPermi="['system:role:openClose']" @click="roleStatus(scope)" class="btn-mb-4">{{ scope.row.valid == 1 ? "停用" : "启用" }}
44 </el-button> 44 </el-button>
45 - <el-button type="danger" size="mini" @click="removeRole(scope)" v-hasPermi="['system:role:delete']" class="btn-mg">删除角色 45 + <el-button type="danger" size="mini" @click="removeRole(scope)" v-hasPermi="['system:role:delete']" class="btn-mb-4">删除角色
46 </el-button> 46 </el-button>
47 </template> 47 </template>
48 </el-table-column> 48 </el-table-column>
......
...@@ -34,17 +34,17 @@ ...@@ -34,17 +34,17 @@
34 <template slot="optionColumn"> 34 <template slot="optionColumn">
35 <el-table-column header-align="center" align="center" min-width="210px" label="操作"> 35 <el-table-column header-align="center" align="center" min-width="210px" label="操作">
36 <template slot-scope="scope"> 36 <template slot-scope="scope">
37 - <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" class="btn-mg">查看</el-button> 37 + <el-button type="primary" size="mini" @click="buttonClick(scope, 0)" class="btn-mb-4">查看</el-button>
38 - <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:user:update']" class="btn-mg">修改 38 + <el-button type="primary" size="mini" @click="buttonClick(scope, 1)" v-hasPermi="['system:user:update']" class="btn-mb-4">修改
39 </el-button> 39 </el-button>
40 <!-- <el-button type="primary" size="mini" @click="passwordShow = !passwordShow" 40 <!-- <el-button type="primary" size="mini" @click="passwordShow = !passwordShow"
41 >修改密码</el-button 41 >修改密码</el-button
42 > --> 42 > -->
43 <el-button :type="scope.row.isValid == 1 ? 'warning' : 'primary'" size="mini" 43 <el-button :type="scope.row.isValid == 1 ? 'warning' : 'primary'" size="mini"
44 - v-hasPermi="['system:user:openClose']" @click="userStatus(scope)" class="btn-mg">{{ 44 + v-hasPermi="['system:user:openClose']" @click="userStatus(scope)" class="btn-mb-4">{{
45 scope.row.isValid == 1 ? "停用" : "启用" 45 scope.row.isValid == 1 ? "停用" : "启用"
46 }}</el-button> 46 }}</el-button>
47 - <el-button type="danger" size="mini" @click="removeUser(scope)" v-hasPermi="['system:user:delete']" class="btn-mg">删除用户 47 + <el-button type="danger" size="mini" @click="removeUser(scope)" v-hasPermi="['system:user:delete']" class="btn-mb-4">删除用户
48 </el-button> 48 </el-button>
49 </template> 49 </template>
50 </el-table-column> 50 </el-table-column>
......