Commit 3bb08ee1 authored by 张伯涛's avatar 张伯涛

本地路由,字典类型接口调节

parent 5ed9bdeb
import request from '@/utils/request'
import Qs from 'qs'
// 查询字典数据列表
export function listData(query) {
return request({
url: '/authority/system/dict/data/list',
url: '/system/dict/data/list',
method: 'get',
params: query
})
......@@ -12,7 +13,7 @@ export function listData(query) {
// 查询字典数据详细
export function getData(dictCode) {
return request({
url: '/authority/system/dict/data/' + dictCode,
url: '/system/dict/data/detail/' + dictCode,
method: 'get'
})
}
......@@ -28,15 +29,16 @@ export function getDicts(dictType) {
// 查询字典类型
export function checkDictLabelUnique(dictLabel) {
return request({
url: '/authority/system/dict/data/checkDictLabelUnique?dictLabel=' + dictLabel,
url: '/system/dict/data/checkDictLabelUnique?dictLabel=' + dictLabel,
method: 'get'
})
}
// 新增字典数据
export function addData(data) {
data = Qs.stringify(data)
return request({
url: '/authority/system/dict/data/',
url: '/system/dict/data/add',
method: 'post',
data: data
})
......@@ -44,8 +46,10 @@ export function addData(data) {
// 修改字典数据
export function updateData(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/authority/system/dict/data/',
url: '/system/dict/data/update/' + businessId,
method: 'put',
data: data
})
......@@ -54,7 +58,7 @@ export function updateData(data) {
// 删除字典数据
export function delData(dictCode) {
return request({
url: '/authority/system/dict/data/' + dictCode,
url: '/system/dict/data/deleteLogical/' + dictCode,
method: 'delete'
})
}
......@@ -62,8 +66,9 @@ export function delData(dictCode) {
// 导出字典数据
export function exportData(query) {
return request({
url: '/authority/system/dict/data/export',
url: '/system/dict/data/export' + query.dictType,
method: 'get',
params: query
params: query,
responseType: 'blob'
})
}
......@@ -92,6 +92,19 @@ export const constantRoutes = [
name: 'welcome',
hidden: true,
meta: { title: '欢迎', icon: 'dashboard' }
},
{
path: '/dict',
component: Layout,
hidden: true,
children: [
{
path: 'type/data/:dictId(\\d+)',
component: (resolve) => require(['@/views/system/dict/data'], resolve),
name: 'Data',
meta: { title: '字典数据', icon: '' }
}
]
}
// {
// path: '/old',
......
......@@ -6,24 +6,24 @@
<el-select v-model="queryParams.dictType" placeholder="请选择字典名称" clearable size="small">
<el-option
v-for="item in typeOptions"
:key="item.dictId"
:key="item.businessId"
:label="item.dictName"
:value="item.dictType"
/>
</el-select>
</el-form-item>
<el-form-item label="参数标签" prop="dictLabel">
<el-form-item label="字典标签" prop="dictLabel">
<el-input
v-model="queryParams.dictLabel"
placeholder="请输入参数标签"
placeholder="请输入字典标签"
clearable
:maxlength="30"
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="参数状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择参数状态" clearable size="small">
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="数据状态" clearable size="small">
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
......@@ -259,11 +259,11 @@ export default {
}
},
created() {
const dictId = this.$route.query && this.$route.query.dictId
const dictId = this.$route.params && this.$route.params.dictId
this.getType(dictId)
this.getTypeList()
this.getDicts(dictCons['NORMAL_DISABLE']).then(response => {
this.statusOptions = response.data;
this.statusOptions = response.data
})
},
methods: {
......
......@@ -482,7 +482,7 @@ export default {
this.manageLoading = true
const temp = Object.assign({}, this.form)
if (!temp.parentId) { temp.dataId = '' }
if (this.title === 'update') {
if (this.title === '修改字典类型') {
updateType(temp).then(response => {
if (response.code === 200) {
this.$message({
......@@ -512,20 +512,17 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const businessIds = row.businessId
this.$confirm('所选择数据被删除后不可再恢复,是否继续?', '提示', {
const dictIds = row.businessId || this.ids
this.$confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return delType(businessIds)
return delType(dictIds)
}).then(() => {
this.getList()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {})
this.msgSuccess('删除成功')
})
},
/** 导出按钮操作 */
handleExport() {
......
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