Commit 427974ec authored by Mac's avatar Mac

修改滚动开班的样式

parent 20bc13a0
......@@ -18,7 +18,7 @@
<div>
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table" separator="none" title="班次" :data="shiftList" dense
class="sticky-column-table sticky-tow-column-table sticky-right-column-table" separator="none" title="班次" :data="shiftList" dense
:columns="columns" row-key="name">
<template v-slot:top="props">
<div class="col-2 q-table__title">班次</div>
......@@ -65,7 +65,7 @@
<q-input filled stack-label maxlength="20" :dense="false" v-model="shiftOption.Name" ref="Name"
class="col-12" label="班次名称" :rules="[val => !!val || '请填写班次名称']" />
</div>
<div class="row wrap ">
<div class="row wrap " v-if="shiftOption.Color==''">
<q-input filled stack-label class="col-12" label="背景颜色" v-model="shiftOption.Color" ref="color" :rules="['anyColor']" >
<template v-slot:append>
<q-icon name="colorize" class="cursor-pointer">
......@@ -137,6 +137,7 @@ export default {
msg: {
rowsPerPage: 9999,
},
colorlist:['#f1c40f','#e67e22','#e74c3c','#f39c12','#d35400','#c0392b','#1abc9c','#2ecc71','#3498db','#9b59b6','#16a085','#27ae60','#2980b9','#8e44ad',],//写死的颜色
columns: [
{
name: 'Name',
......@@ -150,18 +151,18 @@ export default {
align: 'left',
field: 'time'
},
{
name: 'UpdateByName',
label: '操作人',
align: 'left',
field: 'UpdateByName'
},
{
name: 'UpdateTime',
label: '操作时间',
align: 'left',
field: 'UpdateTime'
},
// {
// name: 'UpdateByName',
// label: '操作人',
// align: 'left',
// field: 'UpdateByName'
// },
// {
// name: 'UpdateTime',
// label: '操作时间',
// align: 'left',
// field: 'UpdateTime'
// },
{
name: 'optioned',
label: '操作',
......@@ -193,21 +194,42 @@ export default {
getScrollShiftList({}).then(res => {
if (res.Code == 1) {
this.shiftList = res.Data;
this.removeColor()
if(res.Data.length>0){
this.$emit('getLists',res.Data)
}
}
})
},
removeColor(){
this.shiftList.forEach(x=>{
this.colorlist.forEach((j,ji)=>{
if(x.Color == j){
this.colorlist[ji] = ''
}
})
})
console.log(this.colorlist)
},
//新增修改班次
Editshift(obj) {
if (obj) {
this.shiftOption = JSON.parse(JSON.stringify(obj) ) ;
} else {
let Color = '';
for(let i=0;i<this.colorlist.length;i++){
let x = this.colorlist[i];
if(x !=''){
Color = x;
break
}
}
console.log(Color)
this.shiftOption = {
Id:0,
Name:'',
color:'',
Color:Color,
StartTime:'',
EndTime:'',
};
......@@ -216,8 +238,7 @@ export default {
},
onSubmit(){
this.$refs.Name.validate()
this.$refs.color.validate()
if (!this.$refs.Name.hasError && !this.$refs.color.hasError) {
if (!this.$refs.Name.hasError ) {
if(!this.shiftOption.StartTime){
this.$q.notify({
type: 'negative',
......
......@@ -43,7 +43,7 @@
color: #1f2329;
}
.customMain {
width: 600px !important;
width: 700px !important;
display: flex;
flex-direction: column;
height: 100 vh;
......@@ -172,7 +172,7 @@
style="display: flex;align-items: center;margin-bottom: 10px;"
>
<el-input v-model="x.Sort" placeholder="排序" type='number' min="0" style="width: 100px;margin-right: 5px;"></el-input>
<el-input v-model="x.Sort" placeholder="排序" type='number' min="0" style="width: 80px;margin-right: 5px;"></el-input>
<el-time-select
class="q-mr-lg"
......@@ -197,6 +197,7 @@
}"
placeholder="结束时间(格式00:00)"
></el-time-select>
<el-input v-model="x.ClassHours" placeholder="消耗课时" type='number' min="0" style="width: 100px;margin-right: 5px;"></el-input>
<q-btn
round
size="xs"
......@@ -212,7 +213,7 @@
color="primary"
icon="add"
v-if="addMsg.TimeList.length == y + 1"
@click="addMsg.TimeList.push({ Sort: 1, StartTime: '', EndTime: '', Minutes: 0, })"
@click="addMsg.TimeList.push({ Sort: 1, StartTime: '', EndTime: '', Minutes: 0,ClassHours:'' })"
style="margin-left: 10px;"
/>
</div>
......@@ -336,7 +337,7 @@ export default {
this.addMsg = {
Id: 0,
Name: '',
TimeList: [{ Sort: 1, StartTime: '', EndTime: '', Minutes: 0, }]
TimeList: [{ Sort: 1, StartTime: '', EndTime: '', Minutes: 0, ClassHours:''}]
}
}
this.persistent = true
......@@ -346,12 +347,15 @@ export default {
if(!this.$refs.Name.hasError){
for(let i = 0;i<this.addMsg.TimeList.length;i++){
let x =this.addMsg.TimeList[i]
if(x.Sort=='' || x.Sort=='' || x.Sort<0){
if(x.Sort=='' || x.Sort==null || x.Sort<0){
x.Sort = 0
}
if(x.Minutes=='' || x.Minutes==''|| x.Minutes<0){
if(x.Minutes=='' || x.Minutes==null|| x.Minutes<0){
x.Minutes = 0
}
if(x.ClassHours=='' || x.ClassHours==null || x.ClassHours<0){
x.ClassHours = 0
}
if(x.StartTime==''){
this.$q.notify({
type: 'negative',
......
......@@ -137,9 +137,9 @@
style="width: 100%;border:1px solid #E6E6E6;display: flex;align-items: center;justify-content: center;height: 60px;">
暂无数据
</div>
</div>
<div style="width:100%;height: 50px;"></div>
</div>
</template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment