Commit 427974ec authored by Mac's avatar Mac

修改滚动开班的样式

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