Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mes-ui
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
周远喜
mes-ui
Commits
147ad0f5
Commit
147ad0f5
authored
Nov 16, 2020
by
renjintao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
state
parent
23588f23
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
145 deletions
+136
-145
dataGrid.vue
components/page/dataGrid.vue
+2
-0
state.vue
components/page/state.vue
+134
-145
No files found.
components/page/dataGrid.vue
View file @
147ad0f5
...
@@ -689,6 +689,8 @@ export default {
...
@@ -689,6 +689,8 @@ export default {
});
});
e
[
elem
.
key
]
=
codeInfo
.
substr
(
0
,
codeInfo
.
length
-
1
);
e
[
elem
.
key
]
=
codeInfo
.
substr
(
0
,
codeInfo
.
length
-
1
);
}
}
}
else
{
e
[
elem
.
key
]
=
''
}
}
});
});
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
//导出数据增加对应的物料管理信息 code: 1【rootCategoryId 大类】 2【categoryId 大类】 3【codeRuleId 编码名称】
...
...
components/page/state.vue
View file @
147ad0f5
<
template
>
<
template
>
<div
class=
"ib"
@
click=
"showLife"
>
<div
class=
"ib"
@
click=
"showLife"
>
<div
class=
"ib"
v-if=
"!isMore"
>
<div
class=
"ib"
v-if=
"!isMore"
>
<span
v-if=
"type == 'text'"
:style=
"style"
>
{{
name
}}
</span>
<span
v-if=
"type == 'text'"
:style=
"style"
>
{{
name
}}
</span>
<Tag
v-if=
"type == 'tag'"
:color=
"tagcolor"
>
{{
name
}}
</Tag>
<Tag
v-if=
"type == 'tag'"
:color=
"tagcolor"
>
{{
name
}}
</Tag>
<Badge
v-if=
"type == 'dot'"
:color=
"tagcolor"
:text=
"name"
/>
<Badge
v-if=
"type == 'dot'"
:color=
"tagcolor"
:text=
"name"
/>
<Icon
<Icon
v-if=
"type == 'icon'"
:type=
"item.icon"
:color=
"tagcolor"
:title=
"name"
:size=
"size"
/>
v-if=
"type == 'icon'"
:type=
"item.icon"
:color=
"tagcolor"
:title=
"name"
:size=
"size"
/>
</div>
</div>
<div
class=
"ib"
v-else
v-for=
"(li, i) in items"
:key=
"i"
>
<div
class=
"ib"
v-else
v-for=
"(li, i) in items"
:key=
"i"
>
<span
v-if=
"type == 'text'"
:style=
"li.style"
>
{{
li
.
name
}}
</span>
<span
v-if=
"type == 'text'"
:style=
"li.style"
>
{{
li
.
name
}}
</span>
<Tag
v-if=
"type == 'tag'"
:color=
"li.tagcolor"
>
{{
li
.
name
}}
</Tag>
<Tag
v-if=
"type == 'tag'"
:color=
"li.tagcolor"
>
{{
li
.
name
}}
</Tag>
<Badge
v-if=
"type == 'dot'"
:color=
"li.tagcolor"
:text=
"li.name"
/>
<Badge
v-if=
"type == 'dot'"
:color=
"li.tagcolor"
:text=
"li.name"
/>
</div>
</div>
<Modal
<Modal
v-model=
"modal"
title=
"生命周期"
width=
"1200"
footer-hide
:mask-closable=
"false"
>
v-model=
"modal"
<component
:is=
"detail"
:code=
"code"
:value=
"value"
:mode=
"mode"
/>
title=
"生命周期"
width=
"1200"
footer-hide
:mask-closable=
"false"
>
<component
:is=
"detail"
:code=
"code"
:value=
"value"
:mode=
"mode"
/>
</Modal>
</Modal>
</div>
</div>
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
export
default
{
name
:
"state"
,
name
:
"state"
,
data
()
{
data
()
{
return
{
return
{
mode
:
"0"
,
mode
:
"0"
,
name
:
""
,
name
:
""
,
isMore
:
false
,
isMore
:
false
,
modal
:
false
,
modal
:
false
,
item
:
{},
item
:
{},
items
:
[],
items
:
[],
data
:
[],
data
:
[],
detail
:
null
,
detail
:
null
,
};
};
},
props
:
{
default
:
{
type
:
String
,
default
:
""
,
},
},
type
:
{
props
:
{
type
:
String
,
default
:
{
default
:
"text"
,
type
:
String
,
validator
:
function
(
value
)
{
default
:
""
,
return
[
"text"
,
"tag"
,
"dot"
,
"icon"
].
indexOf
(
value
)
!=
-
1
;
},
},
type
:
{
type
:
String
,
default
:
"text"
,
validator
:
function
(
value
)
{
return
[
"text"
,
"tag"
,
"dot"
,
"icon"
].
indexOf
(
value
)
!=
-
1
;
},
},
code
:
{
type
:
String
,
required
:
true
,
},
value
:
{
type
:
[
String
,
Number
],
required
:
false
,
},
color
:
{
type
:
Boolean
,
default
:
true
,
},
size
:
{
type
:
Number
,
default
:
24
,
},
icon
:
{
type
:
Boolean
,
default
:
false
,
},
img
:
{
type
:
Boolean
,
default
:
false
,
},
},
},
code
:
{
created
()
{
type
:
String
,
this
.
data
=
this
.
$store
.
getters
.
dictionaryByKey
(
this
.
code
)
||
[];
required
:
true
,
},
},
value
:
{
methods
:
{
type
:
[
String
,
Number
],
setName
(
v
)
{
required
:
false
,
if
((
v
+
""
).
indexOf
(
","
)
==
-
1
)
{
var
item
;
this
.
data
.
map
((
u
)
=>
{
if
(
u
.
code
==
v
)
{
item
=
u
;
}
});
if
(
item
)
{
this
.
name
=
item
.
name
;
this
.
item
=
item
;
}
else
{
if
(
v
==
"undefined"
||
v
==
''
||
v
==
null
||
v
==
'null'
)
{
this
.
name
=
" "
;
}
else
{
this
.
name
=
this
.
value
;
}
}
}
else
{
this
.
isMore
=
true
;
var
items
=
[];
var
ul
=
(
v
+
""
).
split
(
","
);
this
.
data
.
map
((
u
)
=>
{
if
(
ul
.
indexOf
(
u
.
code
)
>
-
1
)
{
u
.
tagcolor
=
u
.
color
|
"default"
;
u
.
style
=
{
color
:
u
.
color
|
"inherit"
};
items
.
push
(
u
);
}
});
this
.
items
=
items
;
}
},
showLife
()
{
this
.
modal
=
true
;
this
.
detail
=
()
=>
import
(
"./life"
);
},
},
},
color
:
{
computed
:
{
type
:
Boolean
,
tagcolor
()
{
default
:
true
,
if
(
this
.
color
&&
this
.
item
&&
this
.
item
.
color
!=
""
&&
this
.
item
.
color
!=
null
)
{
return
this
.
item
.
color
;
}
return
"default"
;
},
style
()
{
if
(
!
this
.
color
)
{
return
{};
}
return
{
color
:
this
.
item
&&
this
.
item
.
color
!=
""
&&
this
.
item
.
color
!=
null
?
this
.
item
.
color
:
"inherit"
,
};
},
},
},
size
:
{
watch
:
{
type
:
Number
,
value
(
v
)
{
default
:
24
,
this
.
setName
(
v
);
// this.$forceUpdate()
},
data
(
v
)
{
if
(
v
.
length
>
0
)
{
this
.
setName
(
this
.
value
);
this
.
$forceUpdate
();
}
},
},
},
icon
:
{
type
:
Boolean
,
default
:
false
,
},
img
:
{
type
:
Boolean
,
default
:
false
,
},
},
created
()
{
this
.
data
=
this
.
$store
.
getters
.
dictionaryByKey
(
this
.
code
)
||
[];
},
methods
:
{
setName
(
v
)
{
if
((
v
+
""
).
indexOf
(
","
)
==
-
1
)
{
var
item
;
this
.
data
.
map
((
u
)
=>
{
if
(
u
.
code
==
v
)
{
item
=
u
;
}
});
if
(
item
)
{
this
.
name
=
item
.
name
;
this
.
item
=
item
;
}
else
{
if
(
this
.
value
==
"undefined"
)
{
this
.
name
=
" "
;
}
else
{
this
.
name
=
this
.
value
;
}
}
}
else
{
this
.
isMore
=
true
;
var
items
=
[];
var
ul
=
(
v
+
""
).
split
(
","
);
this
.
data
.
map
((
u
)
=>
{
if
(
ul
.
indexOf
(
u
.
code
)
>
-
1
)
{
u
.
tagcolor
=
u
.
color
|
"default"
;
u
.
style
=
{
color
:
u
.
color
|
"inherit"
};
items
.
push
(
u
);
}
});
this
.
items
=
items
;
}
},
showLife
()
{
this
.
modal
=
true
;
this
.
detail
=
()
=>
import
(
"./life"
);
},
},
computed
:
{
tagcolor
()
{
if
(
this
.
color
&&
this
.
item
&&
this
.
item
.
color
!=
""
&&
this
.
item
.
color
!=
null
)
{
return
this
.
item
.
color
;
}
return
"default"
;
},
style
()
{
if
(
!
this
.
color
)
{
return
{};
}
return
{
color
:
this
.
item
&&
this
.
item
.
color
!=
""
&&
this
.
item
.
color
!=
null
?
this
.
item
.
color
:
"inherit"
,
};
},
},
watch
:
{
value
(
v
)
{
this
.
setName
(
v
);
// this.$forceUpdate()
},
data
(
v
)
{
if
(
v
.
length
>
0
)
{
this
.
setName
(
this
.
value
);
this
.
$forceUpdate
();
}
},
},
};
};
</
script
>
</
script
>
\ No newline at end of file
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