Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pc
Project
Project
Details
Activity
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
wbx-PCAndMobi
pc
Commits
9faecc9a
Commit
9faecc9a
authored
May 14, 2021
by
levante
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签选项动态添加
parent
a04a98be
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
7 deletions
+64
-7
labelRightSide.vue
src/views/label/labelRightSide.vue
+64
-7
No files found.
src/views/label/labelRightSide.vue
View file @
9faecc9a
...
...
@@ -98,7 +98,7 @@
</a-form-item>
<a-form-item>
<a-select
style=
"width: 180px"
placeholder=
'请选择业务属性'
v-decorator=
"['key-' + index66 +'-' + index,
{initialValue: item.key, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select
@
change=
"item.val = ''"
style=
"width: 180px"
placeholder=
'请选择业务属性'
v-decorator=
"['key-' + index66 +'-' + index,
{initialValue: item.key, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option
v-for=
"(item1) in cnonvertObj(availableKeyList, infoSettingForm.getFieldValue('tableName-' + index66 +'-' + index))"
:key=
'item1.id'
:value=
'item1.tblKey'
>
{{
item1
.
tblKeyName
}}
</a-select-option>
</a-select>
</a-form-item>
...
...
@@ -117,15 +117,26 @@
</a-form-item>
<!-- 可以是输入框或者选择框 -->
<a-form-item>
<!--
{{
availableKeyList
}}
{{
infoSettingForm
.
getFieldValue
(
'tableName-'
+
index66
+
'-'
+
index
)
}}
{{
infoSettingForm
.
getFieldValue
(
'key-'
+
index66
+
'-'
+
index
)
}}
-->
<a-form-item
v-if=
"checkIfSelectOptionAppears(availableKeyList, infoSettingForm.getFieldValue('tableName-' + index66 +'-' + index), infoSettingForm.getFieldValue('key-' + index66 +'-' + index))"
>
<!--
{{
checkIfSelectOptionAppears
(
availableKeyList
,
infoSettingForm
.
getFieldValue
(
'tableName-'
+
index66
+
'-'
+
index
),
infoSettingForm
.
getFieldValue
(
'key-'
+
index66
+
'-'
+
index
))
}}
-->
<!--
{{
availableKeyList
.
find
(
item
=>
item
.
tblKey
==
'stKind'
)
}}
-->
<!--
{{
availableKeyList
.
find
(
item
=>
item
.
tblKey
==
"stKind"
).
selVals
}}
-->
<a-select
style=
"width: 100px"
placeholder=
'请选择'
v-decorator=
"['inputOne-' + index66 +'-' + index,
{initialValue: item.val, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option
v-for=
"(item1) in cnonvertObjSecond()"
:key=
'item1.id'
:value=
'item1.tblKey'
>
{{
item1
.
tblKeyName
}}
</a-select-option>
<a-select-option
v-for=
"(item1, index) in JSON.parse(availableKeyList.find(item=>item.tblKey == infoSettingForm.getFieldValue('key-' + index66 +'-' + index)).selVals)"
:key=
'item1'
:value=
"item1"
>
{{
index
}}
</a-select-option>
<!--
<a-select-option
v-for=
"(item1) in
JSON.parse((availableKeyList.find(item=>item.tblKey == infoSettingForm.getFieldValue('val-' + index66 +'-' + index))).selVals)
"
:key=
'item1'
:value=
"item1.value"
>
{{
item1
.
name
}}
</a-select-option>
-->
</a-select>
</a-form-item>
<
!--
<a-form-item
>
<
a-form-item
v-else
>
<a-input
style=
"width: 100px"
placeholder=
'请输入'
v-decorator=
"['inputOne-' + index66 +'-' + index,
{initialValue: getInitialValueOne(item.val), validateTrigger:'blur',rules: [],}]">
</a-input>
</a-form-item>
-->
</a-form-item>
<a-form-item
v-if=
"infoSettingForm.getFieldValue('codition-'+index66 +'-' + index) == 'btw'"
>
<a-input
style=
"width: 100px"
placeholder=
'请输入'
v-decorator=
"['inputTwo-' + index66 +'-' + index,
{initialValue: getInitialValueTwo(item.val), validateTrigger:'blur',rules: []}]">
</a-input>
...
...
@@ -398,8 +409,9 @@ export default {
},
},
methods
:
{
getValueOptions
(
availbleOptions
,
neededKey
)
{
clearForm
(
formToClear
)
{
console
.
log
(
formToClear
);
this
.
infoSettingForm
.
resetFields
(
formToClear
)
},
getSelectedProperty
(
val
)
{
console
.
log
(
val
);
...
...
@@ -443,6 +455,51 @@ export default {
return
optionsPush
},
/**
* options => 所有可选择项目
* formValue => 业务属性
* key => 业务属性二级可选值
*/
checkIfSelectOptionAppears
(
options
,
formValue
,
key
)
{
// console.log(options, formValue, key);
let
findKey
=
options
.
find
(
item
=>
(
item
.
tblKey
==
key
))
if
(
!
findKey
||
!
findKey
.
selVals
)
return
false
return
true
let
resultList
=
[]
let
obj
=
JSON
.
parse
(
findKey
.
selVals
)
for
(
const
key
in
obj
)
{
resultList
.
push
({
name
:
key
,
value
:
obj
[
key
]
})
}
console
.
log
(
resultList
)
return
resultList
// for(let i = 0; i
<
options
.
length
;
i
++
)
{
// if(options[i].tblKey == key) {
// if(options[i].tblKey == null) {
// console.log(JSON.parse(options[i].selVals));
// let resultList = []
// let obj = JSON.parse(options[i].selVals)
// for (const key in obj) {
// resultList.push({
// name: key,
// value: obj[key]
// })
// }
// return resultList
// // return JSON.parse(options[i].selVals)
// } else {
// return null
// }
// }
// }
},
cnonvertObjSecond
()
{},
handleResultOk
()
{
this
.
resultModalVisible
=
!
this
.
resultModalVisible
...
...
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