Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
b1413f02
提交
b1413f02
authored
6月 22, 2021
作者:
Ricky
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加字典标签样式回显
上级
60c22b6a
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
118 行增加
和
11 行删除
+118
-11
index.vue
ruoyi-ui/src/components/DictTag/index.vue
+52
-0
data.vue
ruoyi-ui/src/views/system/dict/data.vue
+56
-6
index.vue
ruoyi-ui/src/views/system/dict/index.vue
+10
-5
没有找到文件。
ruoyi-ui/src/components/DictTag/index.vue
0 → 100644
浏览文件 @
b1413f02
<
template
>
<div>
<template
v-for=
"(item, index) in options"
>
<template
v-if=
"values.includes(item.dictValue)"
>
<span
v-if=
"item.listClass == 'default' || item.listClass == ''"
:key=
"item.dictValue"
:index=
"index"
:class=
"item.cssClass"
>
{{
item
.
dictLabel
}}
</span
>
<el-tag
v-else
:key=
"item.dictValue"
:index=
"index"
:type=
"item.listClass == 'primary' ? '' : item.listClass"
:class=
"item.cssClass"
>
{{
item
.
dictLabel
}}
</el-tag>
</
template
>
</template>
</div>
</template>
<
script
>
export
default
{
name
:
"DictTag"
,
props
:
{
options
:
{
type
:
Array
,
default
:
null
,
},
value
:
[
String
,
Array
],
},
computed
:
{
values
()
{
if
(
this
.
value
)
{
return
Array
.
isArray
(
this
.
value
)
?
this
.
value
:
[
this
.
value
];
}
else
{
return
[];
}
},
},
};
</
script
>
<
style
scoped
>
.el-tag
+
.el-tag
{
margin-left
:
10px
;
}
</
style
>
\ No newline at end of file
ruoyi-ui/src/views/system/dict/data.vue
浏览文件 @
b1413f02
...
@@ -86,10 +86,19 @@
...
@@ -86,10 +86,19 @@
<el-table
v-loading=
"loading"
:data=
"dataList"
@
selection-change=
"handleSelectionChange"
>
<el-table
v-loading=
"loading"
:data=
"dataList"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
type=
"selection"
width=
"55"
align=
"center"
/>
<el-table-column
label=
"字典编码"
align=
"center"
prop=
"dictCode"
/>
<el-table-column
label=
"字典编码"
align=
"center"
prop=
"dictCode"
/>
<el-table-column
label=
"字典标签"
align=
"center"
prop=
"dictLabel"
/>
<el-table-column
label=
"字典标签"
align=
"center"
prop=
"dictLabel"
>
<template
slot-scope=
"scope"
>
<span
v-if=
"scope.row.listClass == '' || scope.row.listClass == 'default'"
>
{{
scope
.
row
.
dictLabel
}}
</span>
<el-tag
v-else
:type=
"scope.row.listClass == 'primary' ? '' : scope.row.listClass"
>
{{
scope
.
row
.
dictLabel
}}
</el-tag>
</
template
>
</el-table-column>
<el-table-column
label=
"字典键值"
align=
"center"
prop=
"dictValue"
/>
<el-table-column
label=
"字典键值"
align=
"center"
prop=
"dictValue"
/>
<el-table-column
label=
"字典排序"
align=
"center"
prop=
"dictSort"
/>
<el-table-column
label=
"字典排序"
align=
"center"
prop=
"dictSort"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
:formatter=
"statusFormat"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"statusOptions"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
...
@@ -136,9 +145,22 @@
...
@@ -136,9 +145,22 @@
<el-form-item
label=
"数据键值"
prop=
"dictValue"
>
<el-form-item
label=
"数据键值"
prop=
"dictValue"
>
<el-input
v-model=
"form.dictValue"
placeholder=
"请输入数据键值"
/>
<el-input
v-model=
"form.dictValue"
placeholder=
"请输入数据键值"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"样式属性"
prop=
"cssClass"
>
<el-input
v-model=
"form.cssClass"
placeholder=
"请输入样式属性"
/>
</el-form-item>
<el-form-item
label=
"显示排序"
prop=
"dictSort"
>
<el-form-item
label=
"显示排序"
prop=
"dictSort"
>
<el-input-number
v-model=
"form.dictSort"
controls-position=
"right"
:min=
"0"
/>
<el-input-number
v-model=
"form.dictSort"
controls-position=
"right"
:min=
"0"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"回显样式"
prop=
"listClass"
>
<el-select
v-model=
"form.listClass"
>
<el-option
v-for=
"item in listClassOptions"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
<el-radio
...
@@ -163,9 +185,14 @@
...
@@ -163,9 +185,14 @@
<
script
>
<
script
>
import
{
listData
,
getData
,
delData
,
addData
,
updateData
,
exportData
}
from
"@/api/system/dict/data"
;
import
{
listData
,
getData
,
delData
,
addData
,
updateData
,
exportData
}
from
"@/api/system/dict/data"
;
import
{
listType
,
getType
}
from
"@/api/system/dict/type"
;
import
{
listType
,
getType
}
from
"@/api/system/dict/type"
;
// 字典标签组件(使用频繁可在全局挂载)
import
DictTag
from
'@/components/DictTag'
export
default
{
export
default
{
name
:
"Data"
,
name
:
"Data"
,
components
:
{
DictTag
},
data
()
{
data
()
{
return
{
return
{
// 遮罩层
// 遮罩层
...
@@ -190,6 +217,33 @@ export default {
...
@@ -190,6 +217,33 @@ export default {
title
:
""
,
title
:
""
,
// 是否显示弹出层
// 是否显示弹出层
open
:
false
,
open
:
false
,
// 数据标签回显样式
listClassOptions
:
[
{
value
:
"default"
,
label
:
"默认"
},
{
value
:
"primary"
,
label
:
"主要"
},
{
value
:
"success"
,
label
:
"成功"
},
{
value
:
"info"
,
label
:
"信息"
},
{
value
:
"warning"
,
label
:
"警告"
},
{
value
:
"danger"
,
label
:
"危险"
}
],
// 状态数据字典
// 状态数据字典
statusOptions
:
[],
statusOptions
:
[],
// 类型数据字典
// 类型数据字典
...
@@ -250,10 +304,6 @@ export default {
...
@@ -250,10 +304,6 @@ export default {
this
.
loading
=
false
;
this
.
loading
=
false
;
});
});
},
},
// 数据状态字典翻译
statusFormat
(
row
,
column
)
{
return
this
.
selectDictLabel
(
this
.
statusOptions
,
row
.
status
);
},
// 取消按钮
// 取消按钮
cancel
()
{
cancel
()
{
this
.
open
=
false
;
this
.
open
=
false
;
...
...
ruoyi-ui/src/views/system/dict/index.vue
浏览文件 @
b1413f02
...
@@ -123,7 +123,11 @@
...
@@ -123,7 +123,11 @@
</router-link>
</router-link>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
:formatter=
"statusFormat"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"status"
>
<
template
slot-scope=
"scope"
>
<dict-tag
:options=
"statusOptions"
:value=
"scope.row.status"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"备注"
align=
"center"
prop=
"remark"
:show-overflow-tooltip=
"true"
/>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"180"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
...
@@ -190,9 +194,14 @@
...
@@ -190,9 +194,14 @@
<
script
>
<
script
>
import
{
listType
,
getType
,
delType
,
addType
,
updateType
,
exportType
,
refreshCache
}
from
"@/api/system/dict/type"
;
import
{
listType
,
getType
,
delType
,
addType
,
updateType
,
exportType
,
refreshCache
}
from
"@/api/system/dict/type"
;
// 字典标签组件(使用频繁可在全局挂载)
import
DictTag
from
'@/components/DictTag'
export
default
{
export
default
{
name
:
"Dict"
,
name
:
"Dict"
,
components
:
{
DictTag
},
data
()
{
data
()
{
return
{
return
{
// 遮罩层
// 遮罩层
...
@@ -257,10 +266,6 @@ export default {
...
@@ -257,10 +266,6 @@ export default {
}
}
);
);
},
},
// 字典状态字典翻译
statusFormat
(
row
,
column
)
{
return
this
.
selectDictLabel
(
this
.
statusOptions
,
row
.
status
);
},
// 取消按钮
// 取消按钮
cancel
()
{
cancel
()
{
this
.
open
=
false
;
this
.
open
=
false
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论