Commit 82429922 authored by 小费同学阿's avatar 小费同学阿 💬

进度信息模块封装ui代码优化

parent 4fae7d9c
......@@ -14,7 +14,10 @@ export function listAllArticle(data) {
return request({
url: '/business/article/list-all',
method: 'post',
data
data,
headers: {
repeatSubmit: false
}
})
}
......
......@@ -56,7 +56,7 @@ export default {
// 大小限制(MB)
fileSize: {
type: Number,
default: 5
default: 4
},
// 文件类型, 例如['png', 'jpg', 'jpeg']
fileType: {
......
......@@ -59,6 +59,13 @@ export default {
type: 'warning'
})
},
confirmAllConfig(content, title = '系统提示', options = {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}) {
return MessageBox.confirm(content, title, options)
},
// 提交内容
prompt(content) {
return MessageBox.prompt(content, '系统提示', {
......
......@@ -141,51 +141,6 @@ export const constantRoutes = [
}
]
},
// 文章
{
path: '/article-management',
component: Layout,
hidden: true,
permissions: ['*:*:*'],
children: [
{
path: 'index',
props: true,
component: () => import('@/views/article-management/article-management'),
name: 'Article-management',
meta: { title: '文章管理', icon: 'component' }
},
// 文章编辑路由
{
path: 'article-edit/:id',
props: true,
component: () => import('@/views/article-management/article-edit'),
name: 'Article-edit',
meta: { title: '文章编辑', icon: 'component' }
},
// 文章详情路由
{
path: 'article-detail/:id',
component: () => import('@/views/article-management/article-detail'),
name: 'ArticleDetail',
props: true,
meta: {
title: '文章详情', icon: 'component'
}
},
// 文章添加路由
{
path: 'article-insert',
component: () => import('@/views/article-management/article-insert'),
name: 'ArticleInsert',
props: true,
meta: {
title: '新增文章',
activeMenu: '/article-management'
}
}
]
},
// 病历管理
{
path: '/medical-record-management',
......@@ -301,7 +256,7 @@ export const constantRoutes = [
},
// 文章
{
path: '/article-management',
path: '/article/management',
component: Layout,
hidden: true,
permissions: ['*:*:*'],
......
......@@ -23,7 +23,7 @@ color: #333333;"
<div style="display:flex;">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="form.articleTitle" placeholder="请输入文章标题" />
<el-input v-model="form.articleTitle" maxlength="60" placeholder="请输入文章标题" />
</el-form-item>
<el-form-item label="权重" prop="articleWeight">
<el-input-number
......
......@@ -23,13 +23,13 @@ color: #333333;"
<div style="display:flex;">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="form.articleTitle" maxlength="40" placeholder="请输入文章标题" show-word-limit />
<el-input v-model.trim="form.articleTitle" maxlength="60" placeholder="请输入文章标题" />
</el-form-item>
<el-form-item label="权重" prop="articleWeight">
<el-input-number v-model="form.articleWeight" :max="9999" :min="1" controls-position="right" />
<el-input-number v-model="form.articleWeight" :max="9999" :min="0" controls-position="right" />
</el-form-item>
<el-form-item label="文章封面" prop="articleCover">
<image-upload v-model="form.articleCover" limit="1" />
<image-upload v-model="form.articleCover" :limit="1" />
</el-form-item>
<el-form-item label="状态" prop="articleStatus">
<div style="display: flex;">
......@@ -47,13 +47,17 @@ color: #333333;"
</div>
</el-form-item>
<el-form-item label="文章内容" prop="articleContent">
<editor v-model="form.articleContent" :min-height="192" />
<editor
v-model.trim="form.articleContent"
:min-height="192"
@change="changeQuillEditor('articleContent')"
/>
</el-form-item>
</el-form>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button class="queryBtn" @click="submitForm">提交</el-button>
<el-button :loading="submitLoading" class="queryBtn" @click="submitForm">提交</el-button>
<el-button class="resetBtn" @click="goBack">返回</el-button>
</div>
</div>
......@@ -75,8 +79,7 @@ export default {
props: {
id: {
// 防止接受状态类型不兼容
type: [Number, String],
required: true
type: [Number, String]
}
},
data() {
......@@ -90,12 +93,14 @@ export default {
// 表单参数
form: {
// 权重
articleWeight: '0',
articleWeight: 0,
// 状态位
articleStatus: '0',
// 创建时间
articleCreateTime: ''
},
// 提交中状态
submitLoading: false,
// 表单校验
rules: {
// 文章标题判空校验
......@@ -104,7 +109,8 @@ export default {
],
// 文章权重判空校验
articleWeight: [
{ required: true, message: '文章权重不能为空', trigger: 'change' }
{ required: true, message: '文章权重不能为空', trigger: 'change' },
{ min: 1, max: 9999, type: 'number', message: '文章权重需要在1~9999之间', trigger: 'change' }
],
// 文章封面判空校验
articleCover: [
......@@ -125,6 +131,10 @@ export default {
this.addDate()
},
methods: {
// change事件,验证表单内容,val是当前需要验证的字段名
changeQuillEditor(val) {
this.$refs['form'].validateField(val)
},
// 获取当前年月日
addDate() {
const nowDate = new Date()
......@@ -141,19 +151,15 @@ export default {
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.$confirm('确认新增?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
addArticle(this.form).then(response => {
this.$message({
type: 'success',
message: '新增成功!'
})
this.goBack()
this.submitLoading = true
addArticle(this.form).then(response => {
this.$message({
type: 'success',
message: '新增成功!'
})
this.getList()
this.goBack()
}).finally(_ => {
this.submitLoading = false
})
}
})
......@@ -162,9 +168,7 @@ export default {
selectDictLabel,
/** 返回跳转列表页 */
goBack() {
this.$router.push({
path: '/article-management/index'
})
this.$router.back()
}
}
}
......
......@@ -103,15 +103,18 @@
<el-table-column label="缴费金额" align="left" prop="payAmount" />
<el-table-column label="设备当前状态" align="left" prop="status">
<template slot-scope="scope">
<span
v-if="scope.row.status === '1'"
style="color: #5FB54B;">{{ showStatus(scope.row.status)}}</span>
<span
v-else-if="scope.row.status === '2'"
style="color: #FF9D4E;">{{ showStatus(scope.row.status)}}</span>
<span
v-else
style="color: #DB4747;">{{ showStatus(scope.row.status) || '-' }}</span>
<span
v-if="scope.row.status === '1'"
style="color: #5FB54B;"
>{{ showStatus(scope.row.status) }}</span>
<span
v-else-if="scope.row.status === '2'"
style="color: #FF9D4E;"
>{{ showStatus(scope.row.status) }}</span>
<span
v-else
style="color: #DB4747;"
>{{ showStatus(scope.row.status) || '-' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="left" class-name="small-padding fixed-width">
......
<template>
<!-- -->
<!-- -->
<div class="app-container">
<div style="background-color: #fff">
<div class="headerTitle">
......
......@@ -129,7 +129,7 @@
</el-row>
</el-form>
<!-- 设备表格 -->
<el-table >
<el-table>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备名称" align="center" prop="petNickname" />
<el-table-column label="检查日期" align="center" prop="petBreed" />
......
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