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
9b6cb7dd
Commit
9b6cb7dd
authored
Jun 17, 2020
by
周远喜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态表单
parent
7667d67e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
7 deletions
+94
-7
dtSpan.vue
components/page/dtSpan.vue
+5
-1
add.vue
pages/materiel/classification/add.vue
+1
-1
add.vue
pages/materiel/masterData/add.vue
+2
-2
edit.vue
pages/materiel/masterData/edit.vue
+84
-2
masterData.vue
pages/materiel/masterData/masterData.vue
+2
-1
No files found.
components/page/dtSpan.vue
View file @
9b6cb7dd
<
template
>
<
template
>
<div>
<div>
<span
v-if=
"type=='date'"
>
{{
value
.
substr
(
0
,
10
)
}}
</span>
<span
v-if=
"type=='date'"
>
<Tooltip
:content=
"value"
>
{{
value
.
substr
(
0
,
10
)
}}
</Tooltip>
</span>
<span
v-else
>
{{
value
.
substr
(
0
,
19
)
}}
</span>
<span
v-else
>
{{
value
.
substr
(
0
,
19
)
}}
</span>
</div>
</div>
</
template
>
</
template
>
...
...
pages/materiel/classification/add.vue
View file @
9b6cb7dd
...
@@ -177,7 +177,7 @@ export default {
...
@@ -177,7 +177,7 @@ export default {
async
fetch
({
store
,
params
})
{
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
},
moun
ted
()
{
crea
ted
()
{
this
.
tableData
();
this
.
tableData
();
},
},
methods
:
{
methods
:
{
...
...
pages/materiel/masterData/add.vue
View file @
9b6cb7dd
...
@@ -52,9 +52,9 @@
...
@@ -52,9 +52,9 @@
<Input
v-if=
"li.dataType==8"
type=
"textarea"
v-model=
"entity[li.field]"
></Input>
<Input
v-if=
"li.dataType==8"
type=
"textarea"
v-model=
"entity[li.field]"
></Input>
</FormItem>
</FormItem>
</Col>
</Col>
<Col
:span=
"24"
>
<
!--
<
Col
:span=
"24"
>
<div
v-html=
"entity"
></div>
<div
v-html=
"entity"
></div>
</Col>
</Col>
-->
<Col
:span=
"24"
style=
"text-align: right;"
>
<Col
:span=
"24"
style=
"text-align: right;"
>
<FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
...
...
pages/materiel/masterData/edit.vue
View file @
9b6cb7dd
...
@@ -32,13 +32,34 @@
...
@@ -32,13 +32,34 @@
<FormItem
label=
"描述"
prop=
"description"
>
<FormItem
label=
"描述"
prop=
"description"
>
<Input
v-model=
"entity.description"
type=
"textarea"
placeholder=
"请输入..."
></Input>
<Input
v-model=
"entity.description"
type=
"textarea"
placeholder=
"请输入..."
></Input>
</FormItem>
</FormItem>
</Col>
</Row>
<div>
<h4>
扩展属性
</h4>
</div>
<Row>
<Col
v-for=
"li in fileds"
:key=
"li.field"
:span=
"li.span"
>
<FormItem
:label=
"li.title"
:prop=
"li.name"
>
<Input
v-if=
"li.dataType==0"
v-model=
"entity[li.field]"
></Input>
<InputNumber
v-if=
"li.dataType==1||li.dataType==2"
v-model=
"entity[li.field]"
class=
"w100"
></InputNumber>
<Dictionary
v-if=
"li.dataType==3"
v-model=
"entity[li.field]"
:code=
"li.note"
></Dictionary>
<Input
v-if=
"li.dataType==4"
v-model=
"entity[li.filed]"
></Input>
<DatePicker
v-if=
"li.dataType==5"
v-model=
"entity[li.field]"
type=
"date"
:placeholder=
"'选择'+li.title"
></DatePicker>
<InputFile
v-if=
"li.dataType==6"
v-model=
"entity[li.field]"
></InputFile>
<!--
<files
ref=
"refFile"
:parms=
"parms"
fileFormat
:Photos=
"true"
@
clickItem=
"clickData"
/>
-->
<InputFile
v-if=
"li.dataType==7"
v-model=
"entity[li.field]"
></InputFile>
<Input
v-if=
"li.dataType==8"
type=
"textarea"
v-model=
"entity[li.field]"
></Input>
</FormItem>
</Col>
</Col>
<!--
<Col
:span=
"24"
>
<div
v-html=
"entity"
></div>
</Col>
-->
<Col
:span=
"24"
style=
"text-align: right;"
>
<Col
:span=
"24"
style=
"text-align: right;"
>
<FormItem>
<FormItem>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
type=
"primary"
@
click=
"handleSubmit"
:disabled=
"disabled"
>
保存
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
<Button
@
click=
"handleClose"
class=
"ml20"
>
取消
</Button>
</FormItem>
</FormItem>
</Col>
</Col>
</Row>
</Row>
</Form>
</Form>
</div>
</div>
...
@@ -53,11 +74,11 @@ export default {
...
@@ -53,11 +74,11 @@ export default {
entity
:
{
entity
:
{
id
:
this
.
eid
,
id
:
this
.
eid
,
code
:
0
,
code
:
0
,
codeRuleId
:
this
.
nodeInfo
.
codeRuleId
,
categoryId
:
this
.
nodeInfo
.
categoryId
,
//左侧树点击的id
categoryId
:
this
.
nodeInfo
.
categoryId
,
//左侧树点击的id
customProperties
:
{},
customProperties
:
{},
rootCategoryId
:
this
.
nodeInfo
.
rootCategoryId
//左侧树点击的数据的最顶层id
rootCategoryId
:
this
.
nodeInfo
.
rootCategoryId
//左侧树点击的数据的最顶层id
},
},
checkList
:
[],
disabled
:
false
,
disabled
:
false
,
rules
:
{
rules
:
{
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
name
:
[{
required
:
true
,
message
:
"必填"
,
trigger
:
"blur"
}]
...
@@ -67,10 +88,43 @@ export default {
...
@@ -67,10 +88,43 @@ export default {
async
fetch
({
store
,
params
})
{
async
fetch
({
store
,
params
})
{
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
await
store
.
dispatch
(
"loadDictionary"
);
// 加载数据字典
},
},
created
()
{
this
.
initFiled
();
},
mounted
()
{
mounted
()
{
this
.
get
();
this
.
get
();
},
},
methods
:
{
methods
:
{
initFiled
()
{
let
conditions
=
[
{
conditionalType
:
"Equal"
,
fieldName
:
"categoryId"
,
fieldValue
:
this
.
nodeInfo
.
rootCategoryId
}
];
Api
.
listTable
({
conditions
:
conditions
,
sortBy
:
'id'
,
isDesc
:
false
}).
then
(
r
=>
{
if
(
r
.
result
)
{
this
.
fileds
=
r
.
result
.
filter
(
function
(
item
)
{
item
.
span
=
12
;
if
(
item
.
dataType
>
4
){
item
.
span
=
24
}
delete
item
[
"id"
];
return
item
.
fieldType
!=
1
;
});
this
.
fileds
.
map
(
u
=>
{
let
v
=
''
;
if
(
u
.
dataType
==
1
||
u
.
dataType
==
2
){
v
=
0
;
}
// this.$set(this.entity.customProperties,u.filed,v)
this
.
$set
(
this
.
entity
,
u
.
filed
,
v
)
})
}
});
},
get
()
{
get
()
{
Api
.
get
({
id
:
this
.
eid
}).
then
(
r
=>
{
Api
.
get
({
id
:
this
.
eid
}).
then
(
r
=>
{
if
(
r
.
result
)
{
if
(
r
.
result
)
{
...
@@ -78,7 +132,35 @@ export default {
...
@@ -78,7 +132,35 @@ export default {
}
}
});
});
},
},
tableData
()
{
let
conditions
=
[
{
conditionalType
:
"In"
,
fieldName
:
"fieldType"
,
fieldValue
:
"1,2"
},
{
conditionalType
:
"Equal"
,
fieldName
:
"categoryId"
,
fieldValue
:
"0"
}
];
Api
.
listTable
({
conditions
:
conditions
,
sortBy
:
"id"
,
isDesc
:
false
}).
then
(
r
=>
{
if
(
r
.
result
)
{
var
arr
=
r
.
result
;
this
.
checkList
=
arr
.
filter
(
function
(
item
)
{
item
.
mid
=
item
.
id
;
delete
item
[
"id"
];
//删除属性id
return
item
;
});
}
});
},
remove
(
index
,
row
)
{
remove
(
index
,
row
)
{
// if (row.add == 0) {
// if (row.add == 0) {
...
...
pages/materiel/masterData/masterData.vue
View file @
9b6cb7dd
...
@@ -141,7 +141,8 @@ export default {
...
@@ -141,7 +141,8 @@ export default {
key
:
"creationTime"
,
key
:
"creationTime"
,
title
:
"创建时间"
,
title
:
"创建时间"
,
hide
:
false
,
hide
:
false
,
align
:
"left"
align
:
"left"
,
type
:
"date"
},
},
{
{
key
:
"creatorUserId"
,
key
:
"creatorUserId"
,
...
...
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