This commit is contained in:
parent
19096087b5
commit
cbad1a4f1c
|
@ -0,0 +1,193 @@
|
|||
<template>
|
||||
<el-header>
|
||||
<div style="display: flex;">
|
||||
<div style="margin-left: 10px;">
|
||||
<el-input v-model="value1" placeholder="请输入标题" :input-style="inputStyle" clearable></el-input>
|
||||
</div>
|
||||
<div style="margin-left: 10px;">
|
||||
<div><el-button type="primary" icon="el-icon-search" @click="getData">搜索</el-button></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<div class="scTable" ref="scTableMain" v-loading="loading">
|
||||
<div class="scTable-table">
|
||||
<el-table :data="tableData" style="width: 100%" ref="scTable" :height="tableHeight"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column type="index" label="序号" width="80"> </el-table-column>
|
||||
<el-table-column prop="title" label="标题"> </el-table-column>
|
||||
<el-table-column prop="content" label="简介"> </el-table-column>
|
||||
<el-table-column prop="cover" label="封面图片" width="280">
|
||||
<template #default="scope">
|
||||
<el-image :src="scope.row.cover"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="scope">
|
||||
<span style="font-size: 14px;color: #409eff;margin-right: 10px;cursor: pointer;"
|
||||
@click.stop="getdetail('审核', scope.row.id)">审核</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="scTable-page">
|
||||
<div class="scTable-pagination">
|
||||
<el-pagination background :small="true" layout="total, prev, pager, next, jumper" :total="total"
|
||||
:page-size="pageSize" v-model:currentPage="currentPage"
|
||||
@current-change="paginationChange"></el-pagination>
|
||||
</div>
|
||||
<div class="scTable-do">
|
||||
<el-button @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="open" :title="title" destroy-on-close :before-close="before" width="50%">
|
||||
<el-form :model="formState" label-width="100px">
|
||||
<el-form-item label="状态" name="userName">
|
||||
<el-radio-group v-model="formState.resource">
|
||||
<el-radio :label="true">通过</el-radio>
|
||||
<el-radio :label="false">不通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="简介" name="artAtt">
|
||||
<el-input type="textarea" v-model="formState.desc"></el-input>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="onFinish()">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import http from "@/utils/request";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
const scEditor = defineAsyncComponent(() => import('@/components/scEditor'));
|
||||
export default {
|
||||
components: {
|
||||
scEditor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inputStyle: {
|
||||
paddingRight: '30px'
|
||||
},
|
||||
tableData: [],
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
loading: false,
|
||||
tableHeight: '100%',
|
||||
paginationLayout: "total, prev, pager, next, jumper",
|
||||
value1: '',
|
||||
open: false,
|
||||
title: '修改',
|
||||
formState: {
|
||||
resource: true,
|
||||
desc: ''
|
||||
},
|
||||
multipleSelection: [],
|
||||
ids: '',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.upTableHeight()
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
//更新表格高度
|
||||
upTableHeight() {
|
||||
this.tableHeight = (this.$refs.scTableMain.offsetHeight - 50) + "px"
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
let arr = []
|
||||
this.multipleSelection.forEach(item => {
|
||||
arr.push(item.id)
|
||||
})
|
||||
this.ids = arr.join(',')
|
||||
console.log(this.ids, arr)
|
||||
},
|
||||
//获取数据
|
||||
getData() {
|
||||
let parame = {
|
||||
title: this.value1,
|
||||
page: this.currentPage,
|
||||
size: this.pageSize
|
||||
}
|
||||
http.get("/api/exhibition/examineList", parame).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
this.currentPage = res.data.current
|
||||
this.loading = false
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
//分页点击
|
||||
paginationChange() {
|
||||
this.getData()
|
||||
},
|
||||
//刷新数据
|
||||
refresh() {
|
||||
this.$refs.scTable.clearSelection();
|
||||
this.loading = true
|
||||
this.getData()
|
||||
},
|
||||
before() {
|
||||
this.open = false;
|
||||
// router.replace();
|
||||
},
|
||||
handleClose() {
|
||||
this.open = false;
|
||||
this.formState.desc = ''
|
||||
this.formState.resource = true
|
||||
},
|
||||
onFinish() {
|
||||
|
||||
},
|
||||
getdetail(title, value) {
|
||||
this.title = title
|
||||
this.open = true
|
||||
this.ids = value
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scTable {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 60px);
|
||||
}
|
||||
|
||||
.scTable-table {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.scTable-page {
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 15px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.scTable-do {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,193 @@
|
|||
<template>
|
||||
<el-header>
|
||||
<div style="display: flex;">
|
||||
<div style="margin-left: 10px;">
|
||||
<el-input v-model="value1" placeholder="请输入标题" :input-style="inputStyle" clearable></el-input>
|
||||
</div>
|
||||
<div style="margin-left: 10px;">
|
||||
<div><el-button type="primary" icon="el-icon-search" @click="getData">搜索</el-button></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<div class="scTable" ref="scTableMain" v-loading="loading">
|
||||
<div class="scTable-table">
|
||||
<el-table :data="tableData" style="width: 100%" ref="scTable" :height="tableHeight"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column type="index" label="序号" width="80"> </el-table-column>
|
||||
<el-table-column prop="title" label="标题"> </el-table-column>
|
||||
<el-table-column prop="content" label="简介"> </el-table-column>
|
||||
<el-table-column prop="cover" label="封面图片" width="280">
|
||||
<template #default="scope">
|
||||
<el-image :src="scope.row.cover"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100">
|
||||
<template #default="scope">
|
||||
<span style="font-size: 14px;color: #409eff;margin-right: 10px;cursor: pointer;"
|
||||
@click.stop="getdetail('审核', scope.row.id)">审核</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="scTable-page">
|
||||
<div class="scTable-pagination">
|
||||
<el-pagination background :small="true" layout="total, prev, pager, next, jumper" :total="total"
|
||||
:page-size="pageSize" v-model:currentPage="currentPage"
|
||||
@current-change="paginationChange"></el-pagination>
|
||||
</div>
|
||||
<div class="scTable-do">
|
||||
<el-button @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="open" :title="title" destroy-on-close :before-close="before" width="50%">
|
||||
<el-form :model="formState" label-width="100px">
|
||||
<el-form-item label="状态" name="userName">
|
||||
<el-radio-group v-model="formState.resource">
|
||||
<el-radio :label="true">通过</el-radio>
|
||||
<el-radio :label="false">不通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="简介" name="artAtt">
|
||||
<el-input type="textarea" v-model="formState.desc"></el-input>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="onFinish()">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import http from "@/utils/request";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
const scEditor = defineAsyncComponent(() => import('@/components/scEditor'));
|
||||
export default {
|
||||
components: {
|
||||
scEditor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inputStyle: {
|
||||
paddingRight: '30px'
|
||||
},
|
||||
tableData: [],
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
loading: false,
|
||||
tableHeight: '100%',
|
||||
paginationLayout: "total, prev, pager, next, jumper",
|
||||
value1: '',
|
||||
open: false,
|
||||
title: '修改',
|
||||
formState: {
|
||||
resource: true,
|
||||
desc: ''
|
||||
},
|
||||
multipleSelection: [],
|
||||
ids: '',
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.upTableHeight()
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
//更新表格高度
|
||||
upTableHeight() {
|
||||
this.tableHeight = (this.$refs.scTableMain.offsetHeight - 50) + "px"
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
let arr = []
|
||||
this.multipleSelection.forEach(item => {
|
||||
arr.push(item.id)
|
||||
})
|
||||
this.ids = arr.join(',')
|
||||
console.log(this.ids, arr)
|
||||
},
|
||||
//获取数据
|
||||
getData() {
|
||||
let parame = {
|
||||
title: this.value1,
|
||||
page: this.currentPage,
|
||||
size: this.pageSize
|
||||
}
|
||||
http.get("/api/hall/examineList", parame).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
this.currentPage = res.data.current
|
||||
this.loading = false
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
//分页点击
|
||||
paginationChange() {
|
||||
this.getData()
|
||||
},
|
||||
//刷新数据
|
||||
refresh() {
|
||||
this.$refs.scTable.clearSelection();
|
||||
this.loading = true
|
||||
this.getData()
|
||||
},
|
||||
before() {
|
||||
this.open = false;
|
||||
// router.replace();
|
||||
},
|
||||
handleClose() {
|
||||
this.open = false;
|
||||
this.formState.desc = ''
|
||||
this.formState.resource = true
|
||||
},
|
||||
onFinish() {
|
||||
|
||||
},
|
||||
getdetail(title, value) {
|
||||
this.title = title
|
||||
this.open = true
|
||||
this.ids = value
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scTable {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 60px);
|
||||
}
|
||||
|
||||
.scTable-table {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.scTable-page {
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 15px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.scTable-do {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,314 @@
|
|||
<template>
|
||||
<el-header>
|
||||
<div style="display: flex;">
|
||||
<div style="margin-left: 10px;">
|
||||
<el-input v-model="value1" placeholder="请输入用户名" :input-style="inputStyle" clearable></el-input>
|
||||
</div>
|
||||
<div style="margin-left: 10px;">
|
||||
<div><el-button type="primary" icon="el-icon-search" @click="getData">搜索</el-button></div>
|
||||
</div>
|
||||
</div>
|
||||
</el-header>
|
||||
<div class="scTable" ref="scTableMain" v-loading="loading">
|
||||
<div class="scTable-table">
|
||||
<el-table :data="tableData" style="width: 100%" ref="scTable" :height="tableHeight">
|
||||
<el-table-column type="index" label="序号" width="100"> </el-table-column>
|
||||
<el-table-column prop="name" label="作品名称"> </el-table-column>
|
||||
<el-table-column prop="introduce" label="作品描述"> </el-table-column>
|
||||
<!-- <el-table-column prop="artAtt" label="简介">
|
||||
<template #default="scope">
|
||||
<div v-html="scope.row.artAtt"></div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="userName" label="作者"> </el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<span style="font-size: 14px;color: #409eff;margin-right: 10px;cursor: pointer;"
|
||||
@click.stop="getdetail('详情', scope.row.id)">详情</span>
|
||||
<span style="font-size: 14px;color: #409eff;margin-right: 10px;cursor: pointer;"
|
||||
@click.stop="getdetail('修改', scope.row.id)">修改</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="scTable-page">
|
||||
<div class="scTable-pagination">
|
||||
<el-pagination background :small="true" layout="total, prev, pager, next, jumper" :total="total"
|
||||
:page-size="pageSize" v-model:currentPage="currentPage"
|
||||
@current-change="paginationChange"></el-pagination>
|
||||
</div>
|
||||
<div class="scTable-do">
|
||||
<el-button @click="refresh" icon="el-icon-refresh" circle style="margin-left:15px"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="open" :title="title" destroy-on-close :before-close="before" width="50%">
|
||||
<el-form :model="formState" label-width="100px">
|
||||
<el-form-item label="姓名" name="userName">
|
||||
<el-input v-model="formState.userName" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="简介" name="artAtt">
|
||||
<sc-editor v-model="formState.artAtt" :height="350"></sc-editor>
|
||||
</el-form-item>
|
||||
<el-form-item label="代表作" name="opus">
|
||||
<div v-for="(item, index) in formState.opus" :key="index" style="margin-bottom: 20px;">
|
||||
<div style="display: flex;">
|
||||
<el-input v-model="item.name" style="width: 220px;margin-right: 20px;" />
|
||||
<el-button type="primary" @click="AddItem('0')">增加</el-button>
|
||||
<el-button v-if="index > 0" type="error" @click="delItem('0', index)">删除</el-button>
|
||||
</div>
|
||||
<sc-upload-multiple :accept="''" v-model="item.value"></sc-upload-multiple>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="荣誉奖项" name="greats">
|
||||
<div v-for="(val, g) in formState.greats" :key="g" style="margin-bottom: 20px;">
|
||||
<div style="display: flex;">
|
||||
<el-input v-model="formState.greats[g]" style="width: 220px;margin-right: 20px;" />
|
||||
<el-button type="primary" @click="AddItem('1')">增加</el-button>
|
||||
<el-button v-if="g > 0" type="error" @click="delItem('1', g)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="handleClose">取消</el-button>
|
||||
<el-button type="primary" @click="onFinish()">
|
||||
确定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import http from "@/utils/request";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
const scEditor = defineAsyncComponent(() => import('@/components/scEditor'));
|
||||
export default {
|
||||
components: {
|
||||
scEditor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
inputStyle: {
|
||||
paddingRight: '30px'
|
||||
},
|
||||
tableData: [],
|
||||
pageSize: 100,
|
||||
total: 0,
|
||||
currentPage: 1,
|
||||
loading: false,
|
||||
tableHeight: '100%',
|
||||
paginationLayout: "total, prev, pager, next, jumper",
|
||||
value1: '',
|
||||
open: false,
|
||||
title: '修改',
|
||||
formState: {},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.upTableHeight()
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
//更新表格高度
|
||||
upTableHeight() {
|
||||
this.tableHeight = (this.$refs.scTableMain.offsetHeight - 50) + "px"
|
||||
},
|
||||
//获取数据
|
||||
getData() {
|
||||
let parame = {
|
||||
name: this.value1,
|
||||
page: this.currentPage,
|
||||
size: this.pageSize
|
||||
}
|
||||
http.get("/api/works/listssssssss", parame).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.tableData = res.data.records
|
||||
// records.forEach(element => {
|
||||
// let arr1 = []
|
||||
// let arr2 = []
|
||||
// let arr3 = []
|
||||
// if(element.greats){
|
||||
// arr2 = JSON.parse(res.data.greats)
|
||||
// element.greats = arr2.split(',')
|
||||
// }else{
|
||||
// element.greats = []
|
||||
// }
|
||||
// if(element.opus){
|
||||
// arr3 = JSON.parse(res.data.opus)
|
||||
// if(arr3.length > 0){
|
||||
// arr3.forEach(item => {
|
||||
// if(item.value.length > 0){
|
||||
// item.value.forEach(v =>{
|
||||
// arr1.push(v)
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// element.opus = arr1
|
||||
// }else{
|
||||
// element.opus = []
|
||||
// }
|
||||
// });
|
||||
this.total = res.data.total
|
||||
this.currentPage = res.data.current
|
||||
this.loading = false
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
});
|
||||
},
|
||||
//分页点击
|
||||
paginationChange() {
|
||||
this.getData()
|
||||
},
|
||||
//刷新数据
|
||||
refresh() {
|
||||
this.$refs.scTable.clearSelection();
|
||||
this.loading = true
|
||||
this.getData()
|
||||
},
|
||||
//详情
|
||||
getdetail(title, value) {
|
||||
this.title = title
|
||||
let _this = this
|
||||
http.get("/api/user/artistsDetails", { id: value }).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.formState = res.data
|
||||
if (res.data.greats == "") {
|
||||
this.formState.greats = ['']
|
||||
} else {
|
||||
this.formState.greats = JSON.parse(res.data.greats)
|
||||
}
|
||||
if (res.data.opuss.length == 0) {
|
||||
this.formState.opus = [{
|
||||
name: '',
|
||||
value: []
|
||||
}]
|
||||
} else {
|
||||
this.formState.opus = []
|
||||
res.data.opuss.forEach(item => {
|
||||
let img = []
|
||||
if(item.value.length > 0){
|
||||
item.value.forEach(ele => {
|
||||
img.push({
|
||||
path: ele,
|
||||
preview: ele
|
||||
})
|
||||
})
|
||||
}
|
||||
_this.formState.opus.push({
|
||||
name: item.name,
|
||||
value: img
|
||||
})
|
||||
})
|
||||
console.log(this.formState.opuss)
|
||||
}
|
||||
this.open = true
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
});
|
||||
},
|
||||
//导出
|
||||
outPut() {
|
||||
let url = '/api/association/sign_export?name=' + this.value1
|
||||
http.download(url);
|
||||
},
|
||||
before() {
|
||||
this.open = false;
|
||||
// router.replace();
|
||||
},
|
||||
handleClose() {
|
||||
this.open = false;
|
||||
},
|
||||
onFinish() {
|
||||
if (this.title == '详情') {
|
||||
this.open = false
|
||||
} else {
|
||||
let opu = []
|
||||
this.formState.opus.forEach(element => {
|
||||
let arr = []
|
||||
if (element.value) {
|
||||
arr = element.value.split(',')
|
||||
opu.push({
|
||||
name: element.name,
|
||||
value: arr
|
||||
})
|
||||
} else {
|
||||
opu.push({
|
||||
name: element.name,
|
||||
value: []
|
||||
})
|
||||
}
|
||||
element.value = arr
|
||||
});
|
||||
let parmes = {
|
||||
id: this.formState.id,
|
||||
artAtt: this.formState.artAtt,
|
||||
greats: JSON.stringify(this.formState.greats),
|
||||
opus: JSON.stringify(opu),
|
||||
}
|
||||
http.post("/api/user/edit", parmes).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.open = false
|
||||
this.getData()
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
});
|
||||
}
|
||||
|
||||
},
|
||||
delItem(Edkey, num) {
|
||||
if (Edkey == '0') {
|
||||
this.formState.opus.splice(num, 1)
|
||||
} else {
|
||||
this.formState.greats.splice(num, 1)
|
||||
}
|
||||
},
|
||||
AddItem(Edkey) {
|
||||
if (Edkey == '0') {
|
||||
this.formState.opus.push({
|
||||
name: '',
|
||||
value: []
|
||||
})
|
||||
} else {
|
||||
this.formState.greats.push("")
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.scTable {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 60px);
|
||||
}
|
||||
|
||||
.scTable-table {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.scTable-page {
|
||||
height: 50px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 15px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.scTable-do {
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
|
@ -25,6 +25,21 @@
|
|||
clearable
|
||||
show-password
|
||||
placeholder="请输入密码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="code">
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="16">
|
||||
<el-input v-model="ruleForm.code"
|
||||
prefix-icon="el-icon-lock"
|
||||
clearable
|
||||
placeholder="请输入图片验证码"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div style="width: 100%; height: 40px;" @click="getImgFile()">
|
||||
<img :src="imgFile" style="height: 100%; width: 100%" />
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-bottom: 10px;">
|
||||
<el-row>
|
||||
|
@ -212,6 +227,7 @@
|
|||
</style>
|
||||
|
||||
<script>
|
||||
import http from "@/utils/request";
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
|
@ -220,8 +236,11 @@ export default {
|
|||
ruleForm: {
|
||||
user: "",
|
||||
password: "",
|
||||
autologin: false
|
||||
autologin: false,
|
||||
code: ''
|
||||
},
|
||||
imgFile: '',
|
||||
imgKey: '',
|
||||
rules: {
|
||||
user: [
|
||||
{ required: true, message: '请输入用户名', trigger: 'blur' }
|
||||
|
@ -241,6 +260,9 @@ export default {
|
|||
this.$store.commit("clearKeepLive")
|
||||
this.$store.commit("clearIframeList")
|
||||
},
|
||||
mounted() {
|
||||
this.getImgFile()
|
||||
},
|
||||
methods: {
|
||||
submitForm (formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
|
@ -256,7 +278,9 @@ export default {
|
|||
this.islogin = true;
|
||||
var data = {
|
||||
user: this.ruleForm.user,
|
||||
password: this.ruleForm.password
|
||||
password: this.ruleForm.password,
|
||||
code: this.ruleForm.code,
|
||||
captchaKey: this.imgKey
|
||||
}
|
||||
var userInfo = await this.$API.user.login.post(data);
|
||||
if (userInfo.code == 200) {
|
||||
|
@ -275,6 +299,17 @@ export default {
|
|||
this.$message.error(userInfo.message);
|
||||
this.islogin = false;
|
||||
}
|
||||
},
|
||||
getImgFile() {
|
||||
http.get("/api/auth/getImageCode", {}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.imgFile = res.data.captchaImg
|
||||
this.imgKey = res.data.captchaKey
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
this.loading = false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue