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
be5ff771
Commit
be5ff771
authored
Jun 05, 2020
by
仇晓婷
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
零部件库
parent
20adf7bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
23 deletions
+124
-23
add.vue
pages/materiel/classification/add.vue
+68
-14
edit.vue
pages/materiel/classification/edit.vue
+55
-8
index.vue
pages/materiel/classification/index.vue
+1
-1
No files found.
pages/materiel/classification/add.vue
View file @
be5ff771
...
...
@@ -33,14 +33,25 @@
</Col>
<Col
:span=
"24"
style=
"padding:20px 0 0px 10px;margin-bottom:10px;"
class=
"table-solt"
>
<Table
border
:columns=
"columns"
:data=
"checkList"
class=
"tableCommon"
height=
"300"
>
<template
slot-scope=
"
{ row, index }" slot="title">
<div
v-if=
"row.fieldType==1||row.fieldType==2"
>
{{
row
.
title
}}
</div>
<Input
v-if=
"row.fieldType==3"
v-model=
"row.title"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"note"
>
<Input
v-model=
"row.note"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
<div
v-if=
"row.fieldType==1"
>
{{
row
.
note
}}
</div>
<Input
v-model=
"row.note"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
v-else
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"datatype"
>
<
!--
<Input
v-model=
"row.datatype"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
--
>
<Select
v-model=
"row.datatype"
style=
"width:200px"
@
on-change=
"setRow(row,index)"
>
<
div
v-if=
"row.fieldType==1"
>
{{
row
.
datatype
}}
</div
>
<Select
v-model=
"row.datatype"
v-else
>
<Option
v-for=
"item in cityList"
@
on-change=
"setRow(row,index)"
v-for=
"(item,index) in cityList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
...
...
@@ -52,8 +63,15 @@
<
template
slot-scope=
"{ row, index }"
slot=
"required"
>
<Checkbox
v-model=
"row.required"
@
on-change=
"setRow(row,index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isunique"
>
<Checkbox
v-model=
"row.isunique"
@
on-change=
"setRow(row,index)"
></Checkbox>
<
template
slot-scope=
"{ row, index }"
slot=
"isUnique"
>
<Checkbox
v-model=
"row.isUnique"
@
on-change=
"setRow(row,index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
v-if=
"row.fieldType==2||row.fieldType==3"
>
<a
@
click=
"remove(index)"
style=
"color:#FF7A8B"
>
删除
</a>
</
template
>
</Table>
</Col>
...
...
@@ -79,6 +97,7 @@ export default {
upId
:
0
,
code
:
0
},
cityList
:
[
{
value
:
"0"
,
...
...
@@ -112,7 +131,8 @@ export default {
{
title
:
"属性名称"
,
key
:
"title"
,
align
:
"center"
align
:
"center"
,
slot
:
"title"
},
{
title
:
"备注"
,
...
...
@@ -140,9 +160,15 @@ export default {
},
{
title
:
"是否唯一属性"
,
key
:
"is
u
nique"
,
key
:
"is
U
nique"
,
align
:
"center"
,
slot
:
"isunique"
slot
:
"isUnique"
},
{
title
:
"操作"
,
slot
:
"action"
,
width
:
100
,
align
:
"center"
}
],
checkList
:
[],
...
...
@@ -159,19 +185,47 @@ export default {
},
methods
:
{
tableData
()
{
let
conditions
=
[];
let
conditions
=
[
{
conditionalType
:
"In"
,
fieldName
:
"fieldType"
,
fieldValue
:
"1,2"
},
{
conditionalType
:
"Equal"
,
fieldName
:
"categoryId"
,
fieldValue
:
"0"
}
];
Api
.
listTable
({
conditions
:
conditions
}).
then
(
r
=>
{
if
(
r
.
result
)
{
console
.
log
(
r
);
this
.
checkList
=
r
.
result
;
var
arr
=
r
.
result
;
this
.
checkList
=
arr
.
filter
(
function
(
item
)
{
delete
item
[
"id"
];
return
item
});
}
});
},
remove
(
index
)
{
this
.
checkList
.
splice
(
index
,
1
);
},
setRow
()
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
()
{},
addNew
()
{
let
obj
=
{
title
:
""
,
note
:
""
,
datatype
:
""
,
required
:
false
,
isunique
:
false
,
fieldType
:
3
,
categoryId
:
0
};
this
.
checkList
.
push
(
obj
);
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
...
...
pages/materiel/classification/edit.vue
View file @
be5ff771
...
...
@@ -33,14 +33,25 @@
</Col>
<Col
:span=
"24"
style=
"padding:20px 0 0px 10px;margin-bottom:10px;"
class=
"table-solt"
>
<Table
border
:columns=
"columns"
:data=
"checkList"
class=
"tableCommon"
height=
"300"
>
<template
slot-scope=
"
{ row, index }" slot="title">
<div
v-if=
"row.fieldType==1||row.fieldType==2"
>
{{
row
.
title
}}
</div>
<Input
v-if=
"row.fieldType==3"
v-model=
"row.title"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"note"
>
<Input
v-model=
"row.note"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
<div
v-if=
"row.fieldType==1"
>
{{
row
.
note
}}
</div>
<Input
v-model=
"row.note"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
v-else
/>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"datatype"
>
<
!--
<Input
v-model=
"row.datatype"
placeholder=
"请输入"
@
on-blur=
"setRow(row,index)"
/>
--
>
<Select
v-model=
"row.datatype"
style=
"width:200px"
@
on-change=
"setRow(row,index)"
>
<
div
v-if=
"row.fieldType==1"
>
{{
row
.
datatype
}}
</div
>
<Select
v-model=
"row.datatype"
v-else
>
<Option
v-for=
"item in cityList"
@
on-change=
"setRow(row,index)"
v-for=
"(item,index) in cityList"
:value=
"item.value"
:key=
"item.value"
>
{{
item
.
label
}}
</Option>
...
...
@@ -52,8 +63,15 @@
<
template
slot-scope=
"{ row, index }"
slot=
"required"
>
<Checkbox
v-model=
"row.required"
@
on-change=
"setRow(row,index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"isunique"
>
<Checkbox
v-model=
"row.isunique"
@
on-change=
"setRow(row,index)"
></Checkbox>
<
template
slot-scope=
"{ row, index }"
slot=
"isUnique"
>
<Checkbox
v-model=
"row.isUnique"
@
on-change=
"setRow(row,index)"
></Checkbox>
</
template
>
<
template
slot-scope=
"{ row, index }"
slot=
"action"
v-if=
"row.fieldType==2||row.fieldType==3"
>
<a
@
click=
"remove(index)"
style=
"color:#FF7A8B"
>
删除
</a>
</
template
>
</Table>
</Col>
...
...
@@ -73,6 +91,7 @@
<
script
>
import
Api
from
"./api"
;
export
default
{
props
:
[
"nodeInfo"
],
data
()
{
return
{
entity
:
{
...
...
@@ -143,6 +162,12 @@ export default {
key
:
"isunique"
,
align
:
"center"
,
slot
:
"isunique"
},
{
title
:
"操作"
,
slot
:
"action"
,
width
:
100
,
align
:
"center"
}
],
checkList
:
[],
...
...
@@ -151,13 +176,22 @@ export default {
}
};
},
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
mounted
()
{
this
.
tableData
();
this
.
get
();
},
methods
:
{
get
()
{
Api
.
get
({
id
:
this
.
nodeInfo
.
id
}).
then
(
r
=>
{
if
(
r
.
result
)
{
this
.
entity
=
r
.
result
;
}
});
},
tableData
()
{
let
conditions
=
[];
Api
.
listTable
({
conditions
:
conditions
}).
then
(
r
=>
{
...
...
@@ -167,11 +201,24 @@ export default {
}
});
},
remove
(
index
)
{
this
.
checkList
.
splice
(
index
,
1
);
},
setRow
()
{
this
.
$set
(
this
.
checkList
,
index
,
row
);
},
addNew
()
{},
addNew
()
{
let
obj
=
{
title
:
""
,
note
:
""
,
datatype
:
""
,
required
:
false
,
isunique
:
false
,
fieldType
:
3
,
categoryId
:
0
};
this
.
checkList
.
push
(
obj
);
},
handleSubmit
()
{
this
.
$refs
.
form
.
validate
(
v
=>
{
if
(
v
)
{
...
...
pages/materiel/classification/index.vue
View file @
be5ff771
...
...
@@ -56,7 +56,7 @@
<!--
<Product
:parent=
"parent"
/>
-->
</Content>
</Layout>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1000"
footer-hide
>
<Modal
v-model=
"modal"
:title=
"title"
width=
"1000"
footer-hide
:mask-closable=
"false"
>
<component
:is=
"detail"
:eid=
"curId"
:nodeInfo=
"nodeInfo"
@
on-close=
"cancel"
@
on-ok=
"ok"
/>
</Modal>
</div>
...
...
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