Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
web-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张伯涛
web-template
Commits
0b43da6e
Commit
0b43da6e
authored
Jan 08, 2021
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
岗位,字典,字典类型,状态按钮
parent
9302af52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
6 deletions
+46
-6
data.vue
src/views/system/dict/data.vue
+18
-1
index.vue
src/views/system/dict/index.vue
+17
-4
index.vue
src/views/system/post/index.vue
+11
-1
No files found.
src/views/system/dict/data.vue
View file @
0b43da6e
...
@@ -107,7 +107,18 @@
...
@@ -107,7 +107,18 @@
{{
isNaN
(
scope
.
row
.
dictSort
)
?
'-'
:
scope
.
row
.
dictSort
}}
{{
isNaN
(
scope
.
row
.
dictSort
)
?
'-'
:
scope
.
row
.
dictSort
}}
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
prop=
"flag"
:formatter=
"statusFormat"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"flag"
:formatter=
"statusFormat"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.flag"
class=
"switchDisabledStyle"
inactive-value=
"0"
active-value=
"1"
@
click
.
native=
"changeStatus(scope.row)"
>
</el-switch>
</
template
>
</el-table-column>
<el-table-column
:show-overflow-tooltip=
"true"
label=
"备注"
prop=
"remarks"
>
<el-table-column
:show-overflow-tooltip=
"true"
label=
"备注"
prop=
"remarks"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
remarks
||
'-'
}}
{{
scope
.
row
.
remarks
||
'-'
}}
...
@@ -301,6 +312,7 @@ export default {
...
@@ -301,6 +312,7 @@ export default {
methods
:
{
methods
:
{
// 状态
// 状态
changeStatus
(
row
)
{
changeStatus
(
row
)
{
const
text
=
row
.
flag
===
'1'
?
'启用'
:
'停用'
const
title
=
`“
${
row
.
dictLabel
}
”参数即将被
${
row
.
status
===
'0'
?
'停用'
:
'启用'
}
,是否继续?`
const
title
=
`“
${
row
.
dictLabel
}
”参数即将被
${
row
.
status
===
'0'
?
'停用'
:
'启用'
}
,是否继续?`
this
.
$confirm
(
title
,
'提示'
,
{
this
.
$confirm
(
title
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
...
@@ -312,6 +324,11 @@ export default {
...
@@ -312,6 +324,11 @@ export default {
updateData
(
row2
).
then
(
res
=>
{
updateData
(
row2
).
then
(
res
=>
{
row
.
status
=
row
.
status
===
'0'
?
'1'
:
'0'
row
.
status
=
row
.
status
===
'0'
?
'1'
:
'0'
}).
catch
()
}).
catch
()
}).
then
(()
=>
{
this
.
$message
({
message
:
text
+
'成功'
,
type
:
'success'
})
}).
catch
()
}).
catch
()
},
},
/** 查询字典类型详细 */
/** 查询字典类型详细 */
...
...
src/views/system/dict/index.vue
View file @
0b43da6e
...
@@ -124,7 +124,18 @@
...
@@ -124,7 +124,18 @@
<div
v-else
>
-
</div>
<div
v-else
>
-
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
prop=
"flag"
:formatter=
"statusFormat"
/>
<el-table-column
label=
"状态"
align=
"center"
prop=
"flag"
:formatter=
"statusFormat"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.flag"
class=
"switchDisabledStyle"
inactive-value=
"0"
active-value=
"1"
@
click
.
native=
"handleStatusChange(scope.row)"
>
</el-switch>
</
template
>
</el-table-column>
<el-table-column
label=
"备注"
prop=
"remarks"
:show-overflow-tooltip=
"true"
>
<el-table-column
label=
"备注"
prop=
"remarks"
:show-overflow-tooltip=
"true"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
remarks
||
'-'
}}
{{
scope
.
row
.
remarks
||
'-'
}}
...
@@ -231,9 +242,11 @@ import { listType,
...
@@ -231,9 +242,11 @@ import { listType,
selectDictType
selectDictType
}
from
'@/api/system/dict/type'
}
from
'@/api/system/dict/type'
import
dictCons
from
'@/utils/dictCons'
import
dictCons
from
'@/utils/dictCons'
import
Template
from
"@/views/instance/Template"
;
export
default
{
export
default
{
name
:
'Dict'
,
name
:
'Dict'
,
components
:
{
Template
},
data
()
{
data
()
{
const
verifyTypeProp
=
(
rule
,
value
,
callback
)
=>
{
const
verifyTypeProp
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
===
''
||
value
===
undefined
||
value
===
null
)
{
if
(
value
===
''
||
value
===
undefined
||
value
===
null
)
{
...
@@ -384,8 +397,8 @@ export default {
...
@@ -384,8 +397,8 @@ export default {
}
}
},
},
handleStatusChange
(
row
)
{
handleStatusChange
(
row
)
{
const
text
=
row
.
status
===
'0
'
?
'启用'
:
'停用'
const
text
=
row
.
flag
===
'1
'
?
'启用'
:
'停用'
this
.
$confirm
(
`
${
row
.
dictName
}
`
,
'提示'
,
{
this
.
$confirm
(
'确认要"'
+
text
+
'""'
+
row
.
dictName
+
'"吗?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
confirmButtonText
:
'确定'
,
cancelButtonText
:
'取消'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
type
:
'warning'
...
@@ -397,7 +410,7 @@ export default {
...
@@ -397,7 +410,7 @@ export default {
type
:
'success'
type
:
'success'
})
})
}).
catch
(
function
()
{
}).
catch
(
function
()
{
row
.
status
=
row
.
status
===
'0'
?
'1'
:
'0'
row
.
flag
=
row
.
flag
===
'0'
?
'1'
:
'0'
})
})
},
},
// 字典状态字典翻译
// 字典状态字典翻译
...
...
src/views/system/post/index.vue
View file @
0b43da6e
...
@@ -106,6 +106,16 @@
...
@@ -106,6 +106,16 @@
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"状态"
align=
"center"
prop=
"flag"
:formatter=
"statusFormat"
>
<el-table-column
label=
"状态"
align=
"center"
prop=
"flag"
:formatter=
"statusFormat"
>
<
template
slot-scope=
"scope"
>
<el-switch
v-model=
"scope.row.flag"
class=
"switchDisabledStyle"
inactive-value=
"0"
active-value=
"1"
@
click
.
native=
"handleStatusChange(scope.row)"
>
</el-switch>
</
template
>
<!-- <template slot-scope="scope">-->
<!-- <template slot-scope="scope">-->
<!-- {{ scope.row.flag || '-' }}-->
<!-- {{ scope.row.flag || '-' }}-->
<!-- </template>-->
<!-- </template>-->
...
@@ -412,7 +422,7 @@ export default {
...
@@ -412,7 +422,7 @@ export default {
updatePost
(
temp
).
then
(()
=>
{
updatePost
(
temp
).
then
(()
=>
{
this
.
$message
({
this
.
$message
({
type
:
'success'
,
type
:
'success'
,
message
:
temp
.
status
===
'
0
'
?
'启用成功'
:
'停用成功'
message
:
temp
.
status
===
'
1
'
?
'启用成功'
:
'停用成功'
})
})
row
.
status
=
temp
.
status
row
.
status
=
temp
.
status
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment