Commit 3eefb072 authored by 黄奎's avatar 黄奎

页面修改

parent bdd20e06
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<img :src="props.value" /> <img :src="props.value" />
</q-avatar> </q-avatar>
<q-avatar size="md" color="teal-10" text-color="white" v-if="!props.value"> <q-avatar size="md" color="teal-10" text-color="white" v-if="!props.value">
{{props.row.TeacherName.substring(0,1)}}</q-avatar> {{props.row.TeacherName}}</q-avatar>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-TeacherName="props"> <template v-slot:body-cell-TeacherName="props">
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<img :src="props.value" /> <img :src="props.value" />
</q-avatar> </q-avatar>
<q-avatar size="md" color="teal-10" text-color="white" v-if="!props.value"> <q-avatar size="md" color="teal-10" text-color="white" v-if="!props.value">
{{props.row.AssistName.substring(0,1)}}</q-avatar> {{props.row.AssistName}}</q-avatar>
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-AssistName="props"> <template v-slot:body-cell-AssistName="props">
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
</template> </template>
<template v-slot:body-cell-Status="props"> <template v-slot:body-cell-Status="props">
<q-td :props="props"> <q-td :props="props">
<q-toggle disable size="md" color="primary" :false-value="1" :true-value="0" v-model="props.row.Status" <q-toggle size="md" color="primary" :false-value="1" :true-value="0" v-model="props.row.Status"
title="注意:关闭后,学员将无法正常使用." /> title="注意:关闭后,学员将无法正常使用." @input="deleteStudentInfo(props.row)" />
</q-td> </q-td>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
...@@ -59,8 +59,6 @@ ...@@ -59,8 +59,6 @@
<div style="min-width:190px;width:100%"> <div style="min-width:190px;width:100%">
<q-btn flat size="xs" icon="iconfont icon-ziyuan" color="warning" style="font-weight:400" class="q-mr-xs" <q-btn flat size="xs" icon="iconfont icon-ziyuan" color="warning" style="font-weight:400" class="q-mr-xs"
label="重置密码" @click="resetPw(props.row.StuId)" /> label="重置密码" @click="resetPw(props.row.StuId)" />
<q-btn flat size="xs" icon="iconfont icon-shanchu" color="negative" style="font-weight:400"
class="q-mr-xs" label="删除" @click="deleteUser(props.row.StuId)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditStudent(props.row)" /> @click="EditStudent(props.row)" />
</div> </div>
...@@ -243,11 +241,12 @@ ...@@ -243,11 +241,12 @@
}); });
}); });
}, },
deleteUser(id) { deleteStudentInfo(obj) {
let that = this let that = this;
var str = (obj.Status == 1 ? "【禁用】" : "【启用】");
this.$q.dialog({ this.$q.dialog({
title: "删除学员", title: str + "学员",
message: "你正在进行删除学员行为,一旦执行无法找回,是否确认执行?", message: "你正在进行" + str + "学员行为,一旦执行无法找回,是否确认执行?",
persistent: true, persistent: true,
cancel: { cancel: {
label: "取消", label: "取消",
...@@ -261,17 +260,20 @@ ...@@ -261,17 +260,20 @@
}).onOk(() => { }).onOk(() => {
that.resetLoading = true that.resetLoading = true
deleteStudent({ deleteStudent({
StuId: id StuId: obj.StuId,
Status: obj.Status
}).then(res => { }).then(res => {
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
color: 'accent', color: 'accent',
timeout: 2000, timeout: 2000,
message: '数据删除成功!', message: '数据操作成功!',
position: 'top' position: 'top'
}) })
this.getStudent() this.getStudent()
}) })
}).onCancel(() => {
obj.Status = obj.Status == 1 ? 0 : 1;
}); });
}, },
changePage(val) { changePage(val) {
......
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
</template> </template>
<template v-slot:body-cell-Status="props"> <template v-slot:body-cell-Status="props">
<q-td :props="props"> <q-td :props="props">
<q-toggle disable size="md" color="primary" :false-value="1" :true-value="0" v-model="props.row.Status" <q-toggle size="md" color="primary" :false-value="1" :true-value="0" v-model="props.row.Status"
title="注意:关闭后,管理员将无法正常使用." /> title="注意:关闭后,管理员将无法正常使用." @input="DeleteManager(props.row)" />
</q-td> </q-td>
</template> </template>
<template v-slot:bottom> <template v-slot:bottom>
...@@ -59,8 +59,7 @@ ...@@ -59,8 +59,7 @@
<div style="min-width:190px;width:100%"> <div style="min-width:190px;width:100%">
<q-btn flat size="xs" icon="iconfont icon-ziyuan" color="warning" style="font-weight:400" class="q-mr-xs" <q-btn flat size="xs" icon="iconfont icon-ziyuan" color="warning" style="font-weight:400" class="q-mr-xs"
label="重置密码" @click="resetPw(props.row.MId)" /> label="重置密码" @click="resetPw(props.row.MId)" />
<q-btn flat size="xs" icon="iconfont icon-shanchu" color="negative" style="font-weight:400"
class="q-mr-xs" label="删除" @click="deleteUser(props.row.MId)" />
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑" <q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="EditManager(props.row)" /> @click="EditManager(props.row)" />
</div> </div>
...@@ -224,13 +223,14 @@ ...@@ -224,13 +223,14 @@
}).catch(() => { }).catch(() => {
that.resetLoading = false that.resetLoading = false
}); });
}); })
}, },
deleteUser(id) { DeleteManager(obj) {
let that = this let that = this;
var str = (obj.Status == 1 ? "【禁用】" : "【启用】");
this.$q.dialog({ this.$q.dialog({
title: "删除管理者", title: str + "管理者",
message: "你正在进行删除管理者行为,一旦执行无法找回,是否确认执行?", message: "你正在进行" + str + "管理者行为,一旦执行无法找回,是否确认执行?",
persistent: true, persistent: true,
cancel: { cancel: {
label: "取消", label: "取消",
...@@ -244,17 +244,20 @@ ...@@ -244,17 +244,20 @@
}).onOk(() => { }).onOk(() => {
that.resetLoading = true that.resetLoading = true
deleteManagerInfo({ deleteManagerInfo({
MId: id MId: obj.MId,
Status: obj.Status
}).then(res => { }).then(res => {
this.$q.notify({ this.$q.notify({
icon: 'iconfont icon-chenggong', icon: 'iconfont icon-chenggong',
color: 'accent', color: 'accent',
timeout: 2000, timeout: 2000,
message: '数据删除成功!', message: '操作成功!',
position: 'top' position: 'top'
}) })
this.getManager() this.getManager()
}) })
}).onCancel(() => {
obj.Status = obj.Status == 1 ? 0 : 1;
}); });
}, },
changePage(val) { changePage(val) {
......
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