提交 82d2ae48 authored 作者: wangyizheng's avatar wangyizheng

页面美化

上级 18768674
...@@ -10,13 +10,14 @@ const before = new BeforeEnter() ...@@ -10,13 +10,14 @@ const before = new BeforeEnter()
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.prototype.openLoading = function() { Vue.prototype.openLoading = function(HTMLElement = 'HTMLElement') {
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: '正在努力加载中...', text: '正在努力加载中...',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)', background: 'rgba(0, 0, 0, 0.3)',
target: '.sub-main', target: HTMLElement,
// target: '.sub-main',
body: true, body: true,
customClass: 'mask' customClass: 'mask'
}) })
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
border border
stripe stripe
size="mini" size="mini"
class="table-list"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
fixed fixed
...@@ -124,7 +125,7 @@ ...@@ -124,7 +125,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="currentPage" :current-page="currentPage"
:page-sizes="[10, 20, 30, 50, 100]" :page-sizes="[3, 5, 10, 20, 30, 50, 100]"
:page-size="limit" :page-size="limit"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="totalPage"> :total="totalPage">
...@@ -371,7 +372,7 @@ export default { ...@@ -371,7 +372,7 @@ export default {
opera: '', opera: '',
currentPage: 1, currentPage: 1,
totalPage: 0, totalPage: 0,
limit: 10, limit: 3,
levelArr: [ levelArr: [
{ level: 1, content: '低风险' }, { level: 1, content: '低风险' },
{ level: 2, content: '中风险' }, { level: 2, content: '中风险' },
...@@ -448,7 +449,7 @@ export default { ...@@ -448,7 +449,7 @@ export default {
this.list({ page: val, limit: this.limit }) this.list({ page: val, limit: this.limit })
}, },
list(params = {}) { list(params = {}) {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
casesApi.case2s(params).then(res => { casesApi.case2s(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.data this.tableData = res.data.data
...@@ -521,7 +522,7 @@ export default { ...@@ -521,7 +522,7 @@ export default {
}, },
handleDelete(id) { handleDelete(id) {
this.$confirm('确认删除?', '提示').then(_ => { this.$confirm('确认删除?', '提示').then(_ => {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
casesApi.deleteCase2(id).then(res => { casesApi.deleteCase2(id).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('删除成功') this.$message.success('删除成功')
...@@ -591,7 +592,7 @@ export default { ...@@ -591,7 +592,7 @@ export default {
.then(_ => { .then(_ => {
this.loading = true this.loading = true
// 提交表单 // 提交表单
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
casesApi.createCase2(this.addForm).then(res => { casesApi.createCase2(this.addForm).then(res => {
if (res.code === 0 && res.message === 'SUCCESS') { if (res.code === 0 && res.message === 'SUCCESS') {
this.list({ page: this.currentPage, limit: this.limit }) this.list({ page: this.currentPage, limit: this.limit })
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
:data="tableData" :data="tableData"
style="width: 100%" style="width: 100%"
size="mini" size="mini"
class="table-list"
row-key="id" row-key="id"
border border
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> :tree-props="{children: 'children', hasChildren: 'hasChildren'}">
...@@ -78,7 +79,7 @@ ...@@ -78,7 +79,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:current-page="currentPage" :current-page="currentPage"
:page-sizes="[20, 30, 40, 50]" :page-sizes="[3, 5, 10, 20, 30, 40, 50]"
:page-size="limit" :page-size="limit"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
:total="totalPage"> :total="totalPage">
...@@ -225,7 +226,7 @@ export default { ...@@ -225,7 +226,7 @@ export default {
tableData: [], tableData: [],
opera: '', opera: '',
currentPage: 1, currentPage: 1,
limit: 20, limit: 3,
totalPage: 0, totalPage: 0,
parentName: '', parentName: '',
urlDisabled: false, urlDisabled: false,
...@@ -350,7 +351,7 @@ export default { ...@@ -350,7 +351,7 @@ export default {
this.$message.error('文件上传失败') this.$message.error('文件上传失败')
}, },
list(params = {}) { list(params = {}) {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
categoryApi.categories(params).then(res => { categoryApi.categories(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.data this.tableData = res.data.data
...@@ -382,7 +383,7 @@ export default { ...@@ -382,7 +383,7 @@ export default {
}, },
handleDelete(id) { handleDelete(id) {
this.$confirm('确认删除?', '提示').then(_ => { this.$confirm('确认删除?', '提示').then(_ => {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
categoryApi.deleteCategory(id).then(res => { categoryApi.deleteCategory(id).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('删除成功') this.$message.success('删除成功')
...@@ -424,7 +425,7 @@ export default { ...@@ -424,7 +425,7 @@ export default {
} }
}, },
add() { add() {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
categoryApi.addCategory(this.mainForm).then(res => { categoryApi.addCategory(this.mainForm).then(res => {
if (res.code === -1) { if (res.code === -1) {
this.$message.error(res.message) this.$message.error(res.message)
...@@ -437,7 +438,7 @@ export default { ...@@ -437,7 +438,7 @@ export default {
}) })
}, },
addChild() { addChild() {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
categoryApi.addCategory(this.childForm).then(res => { categoryApi.addCategory(this.childForm).then(res => {
if (res.code === -1) { if (res.code === -1) {
this.$message.error(res.message) this.$message.error(res.message)
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
:data="tableData" :data="tableData"
border border
stripe stripe
class="table-list"
size="mini" size="mini"
style="width: 100%"> style="width: 100%">
<el-table-column fixed width="150px" label="案例名称"> <el-table-column fixed width="150px" label="案例名称">
...@@ -421,12 +422,15 @@ export default { ...@@ -421,12 +422,15 @@ export default {
}, },
handleDelete(id) { handleDelete(id) {
this.$confirm('确认删除?', '提示').then(_ => { this.$confirm('确认删除?', '提示').then(_ => {
const rLoading = this.openLoading('.table-list')
characteristicsApi.deleteCharacteristic2(id).then(res => { characteristicsApi.deleteCharacteristic2(id).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('删除成功')
this.list({ page: this.currentPage, limit: this.limit }) this.list({ page: this.currentPage, limit: this.limit })
rLoading.close()
this.$message.success('删除成功')
return true return true
} else { } else {
rLoading.close()
this.$message.error(res.message) this.$message.error(res.message)
return false return false
} }
...@@ -434,7 +438,7 @@ export default { ...@@ -434,7 +438,7 @@ export default {
}) })
}, },
list(params = {}) { list(params = {}) {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
characteristicsApi.characteristics2List(params).then(res => { characteristicsApi.characteristics2List(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.data this.tableData = res.data.data
...@@ -476,7 +480,7 @@ export default { ...@@ -476,7 +480,7 @@ export default {
.then(_ => { .then(_ => {
this.loading = true this.loading = true
// 提交表单 // 提交表单
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
characteristicsApi.createCharacteristic2(this.addForm).then(res => { characteristicsApi.createCharacteristic2(this.addForm).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.list({ page: 1, limit: this.limit }) this.list({ page: 1, limit: this.limit })
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
border border
stripe stripe
size="mini" size="mini"
class="table-list"
style="width: 100%"> style="width: 100%">
<el-table-column fixed label="案例名称"> <el-table-column fixed label="案例名称">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -210,7 +211,7 @@ export default { ...@@ -210,7 +211,7 @@ export default {
}, },
delete(id) { delete(id) {
this.$confirm('确认删除?', '提示').then(_ => { this.$confirm('确认删除?', '提示').then(_ => {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
reachSchemeApi.deleteReachScheme(id).then(res => { reachSchemeApi.deleteReachScheme(id).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('删除成功') this.$message.success('删除成功')
...@@ -226,7 +227,7 @@ export default { ...@@ -226,7 +227,7 @@ export default {
}) })
}, },
list(params = {}) { list(params = {}) {
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
reachSchemeApi.reachSchemeList(params).then(res => { reachSchemeApi.reachSchemeList(params).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.data this.tableData = res.data.data
...@@ -266,7 +267,7 @@ export default { ...@@ -266,7 +267,7 @@ export default {
.then(_ => { .then(_ => {
this.loading = true this.loading = true
// 提交表单 // 提交表单
const rLoading = this.openLoading() const rLoading = this.openLoading('.table-list')
reachSchemeApi.createReachScheme(this.addForm).then(res => { reachSchemeApi.createReachScheme(this.addForm).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.list({ page: 1, limit: this.limit }) this.list({ page: 1, limit: this.limit })
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论