|
|
@@ -1,101 +1,107 @@
|
|
|
<template>
|
|
|
- <div class="app-container calendar-list-container">
|
|
|
-
|
|
|
- <!-- 查询和其他操作 -->
|
|
|
- <div class="filter-container">
|
|
|
- <el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入字典名称" v-model="listQuery.dictName"></el-input>
|
|
|
- <el-input clearable class="filter-item" style="width: 200px;" placeholder="请输入字典类型" v-model="listQuery.dictType"></el-input>
|
|
|
- <el-select v-model="listQuery.status" clearable placeholder="字典状态" class="filter-item" style="width: 200px">
|
|
|
- <el-option :key="item.type" v-for="item in typeList" :label="item.name" :value="item.type">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleQuery">查找</el-button>
|
|
|
- <el-button class="filter-item" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
|
|
- <el-button class="filter-item" type="primary" @click="handleCreate" icon="el-icon-plus">添加</el-button>
|
|
|
- <el-button class="filter-item" type="warning" icon="el-icon-delete" @click="delAll">批量删除</el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
- <!-- 查询结果 -->
|
|
|
- <el-table
|
|
|
- size="small"
|
|
|
- :data="list"
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- v-loading="listLoading"
|
|
|
- element-loading-text="正在查询中。。。"
|
|
|
- border
|
|
|
- fit
|
|
|
- highlight-current-row
|
|
|
- >
|
|
|
- <el-table-column type="selection" width="55px"> </el-table-column>
|
|
|
- <el-table-column type="index" label="序号" header-align="center" align="center">
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column align="center" min-width="100px" label="字典名称" prop="dictName">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" min-width="150px" label="字典类型">
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- 查询表单区域 -->
|
|
|
+ <el-form :model="listQuery" size="small" :inline="true" label-position="top">
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="字典名称">
|
|
|
+ <el-input v-model="listQuery.dictName" placeholder="请输入字典名称" style="width: 100%" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="字典类型">
|
|
|
+ <el-input v-model="listQuery.dictType" placeholder="请输入字典类型" style="width: 100%" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-select v-model="listQuery.status" clearable placeholder="请选择状态" style="width: 100%">
|
|
|
+ <el-option :key="item.type" v-for="item in typeList" :label="item.name" :value="item.type">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="搜索">
|
|
|
+ <el-button style="width: 100%;" type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="重置">
|
|
|
+ <el-button style="width: 100%;" icon="el-icon-refresh" type="primary" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <!-- 操作按钮区域 -->
|
|
|
+ <el-row :gutter="10" class="mb8">
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" class="editButton" size="small" icon="el-icon-plus" @click="handleCreate">添加</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="danger" icon="el-icon-delete" size="small" @click="delAll">批量删除</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <!-- 表格区域 -->
|
|
|
+ <div class="border-card">
|
|
|
+ <el-table height="450" size="small" :data="list" @selection-change="handleSelectionChange" v-loading="listLoading" element-loading-text="正在查询中。。。" border fit highlight-current-row>
|
|
|
+ <el-table-column type="selection" width="55px" align="center"></el-table-column>
|
|
|
+ <el-table-column type="index" label="序号" header-align="center" align="center" width="55"></el-table-column>
|
|
|
+ <el-table-column align="center" min-width="100px" label="字典名称" prop="dictName"></el-table-column>
|
|
|
+ <el-table-column align="center" min-width="150px" label="字典类型">
|
|
|
<template slot-scope="scope">
|
|
|
- <router-link :to="{name: 'dictDataList', params: { id: scope.row.dictType }}">
|
|
|
- <div style="color: #337ab7;cursor: pointer;">{{ scope.row.dictType }}</div>
|
|
|
- </router-link>
|
|
|
+ <router-link :to="{name: 'dictDataList', params: { id: scope.row.dictType }}">
|
|
|
+ <div style="color: #337ab7;cursor: pointer;">{{ scope.row.dictType }}</div>
|
|
|
+ </router-link>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" min-width="100px" label="状态">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="80px" label="状态">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-tag v-if="scope.row.status === '1'">停用</el-tag>
|
|
|
- <el-tag v-else>正常</el-tag>
|
|
|
+ <el-tag v-if="scope.row.status === '1'">停用</el-tag>
|
|
|
+ <el-tag v-else>正常</el-tag>
|
|
|
</template>
|
|
|
-
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" min-width="200px" label="备注" prop="remark">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" min-width="150px" label="创建时间" prop="createTime">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- @click="handleUpdate(scope.row, false)"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
-
|
|
|
- <el-button type="danger" size="small" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <!-- 分页 -->
|
|
|
- <div class="pagination-container">
|
|
|
- <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.page"
|
|
|
- :page-sizes="[10,20,30,50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
|
|
- </el-pagination>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" min-width="200px" label="备注" prop="remark"></el-table-column>
|
|
|
+ <el-table-column align="center" min-width="100px" label="创建时间" prop="createTime"></el-table-column>
|
|
|
+ <el-table-column align="center" label="操作" width="240px" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" icon="el-icon-edit" class="editText" size="small" @click="handleUpdate(scope.row, false)">编辑</el-button>
|
|
|
+ <el-button type="text" icon="el-icon-delete" class="deleteText" size="small" @click="handleDelete(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <!-- 分页 -->
|
|
|
+ <div class="pagination-container">
|
|
|
+ <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listQuery.page"
|
|
|
+ :page-sizes="[10,20,30,50]" :page-size="listQuery.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<!-- 添加或修改对话框 -->
|
|
|
- <el-dialog
|
|
|
- :close-on-click-modal="false"
|
|
|
- :title="textMap[dialogStatus]"
|
|
|
- :visible.sync="dialogFormVisible"
|
|
|
- width="40%"
|
|
|
- >
|
|
|
- <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px" style='width: 700px; margin-left:50px;'>
|
|
|
- <el-form-item label="字典名称" prop="dictName">
|
|
|
- <el-input style="width: 300px" v-model="dataForm.dictName"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="字典类型" prop="dictType">
|
|
|
- <el-input style="width: 300px" v-model="dataForm.dictType"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="状态">
|
|
|
- <el-radio-group v-model="dataForm.status">
|
|
|
- <el-radio :label="'0'">正常</el-radio>
|
|
|
- <el-radio :label="'1'">停用</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="备注">
|
|
|
- <el-input type="textarea" :rows="2" style="width: 300px" v-model="dataForm.remark"></el-input>
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
-
|
|
|
+ <el-dialog :close-on-click-modal="false" :title="textMap[dialogStatus]" :visible.sync="dialogFormVisible" width="40%">
|
|
|
+ <el-form :rules="rules" ref="dataForm" :model="dataForm" status-icon label-position="left" label-width="80px">
|
|
|
+ <el-form-item label="字典名称" prop="dictName">
|
|
|
+ <el-input v-model="dataForm.dictName" placeholder="请输入字典名称"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="字典类型" prop="dictType">
|
|
|
+ <el-input v-model="dataForm.dictType" placeholder="请输入字典类型"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="状态">
|
|
|
+ <el-radio-group v-model="dataForm.status">
|
|
|
+ <el-radio :label="'0'">正常</el-radio>
|
|
|
+ <el-radio :label="'1'">停用</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注">
|
|
|
+ <el-input type="textarea" :rows="2" v-model="dataForm.remark" placeholder="请输入备注"></el-input>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogFormVisible = false">取消</el-button>
|
|
|
@@ -103,25 +109,25 @@
|
|
|
<el-button v-else type="primary" @click="updateData">确定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
-
|
|
|
+
|
|
|
</div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <style>
|
|
|
- .demo-table-expand {
|
|
|
- font-size: 0;
|
|
|
- }
|
|
|
- .demo-table-expand label {
|
|
|
- width: 200px;
|
|
|
- color: #99a9bf;
|
|
|
- }
|
|
|
- .demo-table-expand .el-form-item {
|
|
|
- margin-right: 0;
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
- </style>
|
|
|
-
|
|
|
- <script>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style>
|
|
|
+ .demo-table-expand {
|
|
|
+ font-size: 0;
|
|
|
+ }
|
|
|
+ .demo-table-expand label {
|
|
|
+ width: 200px;
|
|
|
+ color: #99a9bf;
|
|
|
+ }
|
|
|
+ .demo-table-expand .el-form-item {
|
|
|
+ margin-right: 0;
|
|
|
+ margin-bottom: 0;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<script>
|
|
|
import { list, createItem, updateItem, deleteitem } from "@/api/dictManage";
|
|
|
import waves from "@/directive/waves"; // 水波纹指令
|
|
|
import Tinymce from '@/components/Tinymce'
|
|
|
@@ -297,7 +303,7 @@
|
|
|
this.getList()
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
|
|
|
},
|
|
|
@@ -341,28 +347,27 @@
|
|
|
},
|
|
|
}
|
|
|
}
|
|
|
- </script>
|
|
|
- <style>
|
|
|
- .ad-avatar-uploader .el-upload {
|
|
|
- border: 1px dashed #d9d9d9;
|
|
|
- border-radius: 6px;
|
|
|
- cursor: pointer;
|
|
|
- position: relative;
|
|
|
- overflow: hidden;
|
|
|
- }
|
|
|
- .ad-avatar-uploader .el-upload:hover {
|
|
|
- border-color: #409EFF;
|
|
|
- }
|
|
|
- .ad-avatar-uploader-icon {
|
|
|
- font-size: 28px;
|
|
|
- color: #8c939d;
|
|
|
- width: 178px;
|
|
|
- height: 178px;
|
|
|
- line-height: 178px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- .ad-avatar {
|
|
|
- display: block;
|
|
|
- }
|
|
|
- </style>
|
|
|
-
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+ .ad-avatar-uploader .el-upload {
|
|
|
+ border: 1px dashed #d9d9d9;
|
|
|
+ border-radius: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ .ad-avatar-uploader .el-upload:hover {
|
|
|
+ border-color: #409EFF;
|
|
|
+ }
|
|
|
+ .ad-avatar-uploader-icon {
|
|
|
+ font-size: 28px;
|
|
|
+ color: #8c939d;
|
|
|
+ width: 178px;
|
|
|
+ height: 178px;
|
|
|
+ line-height: 178px;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ .ad-avatar {
|
|
|
+ display: block;
|
|
|
+ }
|
|
|
+</style>
|