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
0f65ef1d
Commit
0f65ef1d
authored
May 19, 2021
by
levante
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bq add select
parent
257874f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
200 deletions
+114
-200
tableAndMutWithoutMulSel.vue
src/views/components/tableAndMutWithoutMulSel.vue
+0
-1
labelRightSide.vue
src/views/label/labelRightSide.vue
+114
-199
No files found.
src/views/components/tableAndMutWithoutMulSel.vue
View file @
0f65ef1d
...
...
@@ -21,7 +21,6 @@
<span
slot=
"action"
slot-scope=
"text, record"
>
<span
class=
"actionBtn"
@
click=
"toView(tbl, record)"
>
查看
</span>
<a-dropdown
:trigger=
"['click']"
v-if=
"customKeyEnable == 'true' || $route.name=='basicInfo' || $route.name=='propertyInfo' || $route.name=='indCous'"
>
<a
class=
"ant-dropdown-link"
href=
"#"
>
| 更多
<a-icon
type=
"down"
/></a>
<a-menu
slot=
"overlay"
>
<a-menu-item
key=
"0"
v-if=
"$route.name == 'basicInfo' || $route.name == 'nonResidents'"
>
<a
@
click=
"$parent.toBul(record)"
>
门牌幢
</a>
...
...
src/views/label/labelRightSide.vue
View file @
0f65ef1d
...
...
@@ -2,32 +2,15 @@
<div
class=
"routerWapper"
>
<div>
<a-row>
<!--
<a-col
:span=
'1'
v-if=
"triggerType == 'create'"
>
-->
<!--
<a-col
:span=
'16'
>
<a-row>
<a-col
:span=
'1'
>
<div
class=
"detailOperations"
>
-->
<a-button
@
click=
"backPage"
>
返回
</a-button>
<!--
</div>
</a-col>
<a-col
:span=
'1'
v-if=
"triggerType !== 'create' && triggerType !== 'loadParentLabel'"
:offset=
'1'
>
-->
<a-button
v-if=
"triggerType !== 'create' && triggerType !== 'loadParentLabel'"
:offset=
'1'
type=
'danger'
@
click=
"deleteLabel(labelId)"
>
删除
</a-button>
<!--
</a-col>
<a-col
:span=
'1'
:offset=
'1'
>
-->
<a-button
type=
'primary'
@
click=
"preview()"
>
预览
</a-button>
<!--
</a-col>
<a-col
:span=
'1'
:offset=
'1'
>
-->
<a-button
type=
'primary'
@
click=
"save()"
>
保存
</a-button>
<!--
</a-col>
<a-col
:span=
'18'
></a-col>
</a-row>
-->
<!--
</a-col>
-->
<a-button
@
click=
"backPage"
>
返回
</a-button>
<a-button
v-if=
"triggerType !== 'create' && triggerType !== 'loadParentLabel'"
:offset=
'1'
type=
'danger'
@
click=
"deleteLabel(labelId)"
>
删除
</a-button>
<a-button
type=
'primary'
@
click=
"preview()"
>
预览
</a-button>
<a-button
type=
'primary'
@
click=
"save()"
>
保存
</a-button>
</a-row>
</div>
<a-divider
type=
'horizontal'
/>
<div
style=
"height: 580px; overflow-y: scroll"
>
<a-form
:form=
'labelForm'
>
<!--
{{
loopContent
.
data
}}
-->
<a-form-item
label=
'标签名'
:label-col=
"
{span:3}" :wrapper-col="{span:15}">
<a-input
placeholder=
'请输入标签名'
v-decorator=
"['labelName',
{validateTrigger:'blur', initialValue: jsonData.labelName?jsonData.labelName: '', rules: [{required: true, message: '请填写标签名!'}]}]">
</a-input>
</a-form-item>
...
...
@@ -48,12 +31,6 @@
</a-form-item>
</a-col>
</a-row>
<!--
<a-form-item
label=
'标记对象'
:label-col=
"
{span:3}" :wrapper-col="{span:15}">
<a-select
placeholder=
'请选择业务对象'
@
change=
'handleObjChange'
v-decorator=
"['tableName',
{validateTrigger:'blur', initialValue: jsonData.tableName?jsonData.tableName: '', rules: [{required: true, message: '请选择业务对象!'}]}]">
<a-select-option
value=
'tbl_community'
>
小区
</a-select-option>
<a-select-option
value=
'tbl_building'
>
门牌幢
</a-select-option>
</a-select>
</a-form-item>
-->
<a-form-item
label=
'标记对象'
:label-col=
"
{span:3}" :wrapper-col="{span:15}">
<a-radio-group
v-decorator=
"['tableName',
{validateTrigger:'blur', initialValue: jsonData.tableName?jsonData.tableName: '', rules: [{required: true, message: '请选择业务对象!'}]}]">
<a-radio
value=
"tbl_community"
>
...
...
@@ -72,33 +49,35 @@
</a-form-item>
</a-form>
<div
style=
"background-color: #F0F2F5; height: 5px; "
></div>
<!--
{{
loopContent
}}
-->
<a-form
:form=
'infoSettingForm'
layout=
'inline'
>
<div
v-for=
"(item66, index66) in loopContent.data"
:key=
"index66"
style=
"padding: 20px;border-left: 5px solid #F0F2F5; border-right: 5px solid #F0F2F5; border-bottom: 5px solid #F0F2F5;"
>
<!--
{{
index66
}}
-->
<div
v-for=
"(item66, index66) in loopContent.data"
:key=
"item66.randomNum"
style=
"padding: 20px;border-left: 5px solid #F0F2F5; border-right: 5px solid #F0F2F5; border-bottom: 5px solid #F0F2F5;"
>
<a-row
type=
'flex'
style=
"font-weight: bold; font-size: 16px; margin-bottom: 20px; border-bottom: 1px solid lightgrey"
align=
'middle'
>
<!--
{{
item66
}}
-->
<a-col
:span=
'21'
>
<span
style=
"font-weight: bold"
>
{{
item66
.
serial
}}
</span>
</a-col>
<a-col
:span=
'3'
v-if=
"index66 !== 0"
>
<a-button
style=
"color: darkred"
type=
"link"
@
click=
"delGroup(index66)"
><a-icon
type=
"delete"
/>
删除分组
</a-button>
</a-col>
</a-row>
<div
style=
"width: 90%; padding: 20px; margin-bottom: 20px"
>
<div
v-for=
"(item, index) in item66.labelSelConditionList"
:key=
'index'
style=
"margin-bottom: 20px"
>
<a-row>
<a-form-item
v-if=
"index == 0 && index66 !== 0"
style=
"margin-bottom: 20px"
>
<a-form-item>
<a-input
style=
"width: 80px"
placeholder=
'分组名'
v-decorator=
"['groupName-' + index66,
{initialValue: item66.serial, validateTrigger:'blur',rules: []}]">
</a-input>
</a-form-item>
<a-form-item
v-if=
"index66 !== 0"
style=
"margin-bottom: 20px"
>
<a-select
style=
"width: 80px"
placeholder=
'与上组关系'
v-decorator=
"['relationWithGroup-' + index66 + '-0',
{initialValue: item66.relation, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option
value=
'and'
>
与
</a-select-option>
<a-select-option
value=
'or'
>
或
</a-select-option>
<a-select-option
value=
'ne'
>
非
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
v-if=
"index == 0"
>
<a-input
style=
"width: 80px"
placeholder=
'分组名'
v-decorator=
"['groupName-' + index66,
{initialValue: item66.serial, validateTrigger:'blur',rules: []}]">
</a-input>
<a-form-item
v-show=
"false"
>
<a-input
style=
"width: 80px"
placeholder=
'randomId'
v-decorator=
"['randomNum-' + index66,
{initialValue: item66.randomNum, validateTrigger:'blur',rules: []}]">
</a-input>
</a-form-item>
</a-row>
</a-col>
<a-col
:span=
'3'
v-if=
"index66 !== 0"
>
<a-button
style=
"color: darkred"
type=
"link"
@
click=
"delGroup(index66, item66.randomNum)"
><a-icon
type=
"delete"
/>
删除分组
</a-button>
</a-col>
</a-row>
<div
style=
"width: 90%; padding: 20px; margin-bottom: 20px"
>
<div
v-for=
"(item, index) in item66.labelSelConditionList"
:key=
'index'
style=
"margin-bottom: 20px"
>
<a-form-item
v-if=
"index !== 0"
>
<a-select
style=
"width: 80px"
placeholder=
'请选择条件'
v-decorator=
"['relation-' + index66 +'-' + index,
{initialValue: item.relation, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
...
...
@@ -124,9 +103,9 @@
</a-form-item>
<a-form-item>
<a-select
style=
"width:
8
0px"
placeholder=
'区间'
v-decorator=
"['codition-' + index66 +'-' + index,
{initialValue: item.codition, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option
value=
'eq'
>
等于
精确
</a-select-option>
<a-select-option
value=
'regex'
>
等于
模糊
</a-select-option>
<a-select
style=
"width:
15
0px"
placeholder=
'区间'
v-decorator=
"['codition-' + index66 +'-' + index,
{initialValue: item.codition, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option
value=
'eq'
>
等于
(精确)
</a-select-option>
<a-select-option
value=
'regex'
>
等于
(模糊)
</a-select-option>
<a-select-option
value=
'ne'
>
不等于
</a-select-option>
<a-select-option
value=
'gt'
>
大于
</a-select-option>
<a-select-option
value=
'gte'
>
大于等于
</a-select-option>
...
...
@@ -135,42 +114,32 @@
<a-select-option
value=
'btw'
>
区间
</a-select-option>
</a-select>
</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
}}
-->
{{
checkIfSelectOptionAppears
(
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)).dataType == 'select'"
>
<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, 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
v-else
>
<a-form-item
v-else
-if=
"checkIfSelectOptionAppears(availableKeyList, infoSettingForm.getFieldValue('tableName-' + index66 +'-' + index), infoSettingForm.getFieldValue('key-' + index66 +'-' + index)).dataType == 'str'"
>
<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
v-else-if=
"checkIfSelectOptionAppears(availableKeyList, infoSettingForm.getFieldValue('tableName-' + index66 +'-' + index), infoSettingForm.getFieldValue('key-' + index66 +'-' + index)).dataType == 'num'"
>
<a-input-number
style=
"width: 100px"
placeholder=
'请输入'
v-decorator=
"['inputOne-' + index66 +'-' + index,
{initialValue: getInitialValueOne(item.val), validateTrigger:'blur',rules: [],}]">
</a-input-number>
</a-form-item>
<a-form-item
v-else-if=
"checkIfSelectOptionAppears(availableKeyList, infoSettingForm.getFieldValue('tableName-' + index66 +'-' + index), infoSettingForm.getFieldValue('key-' + index66 +'-' + index)).dataType == 'date'"
>
<a-date-picker
style=
"width: 100px"
placeholder=
'请选择'
v-decorator=
"['inputOne-' + index66 +'-' + index,
{initialValue: getInitialValueOne(item.val), validateTrigger:'blur',rules: [],}]">
</a-date-picker>
</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>
</a-form-item>
<a-form-item>
<a-select
v-if=
"infoSettingForm.getFieldValue('codition-'+index66 +'-' + index) == 'eq' || infoSettingForm.getFieldValue('codition-'+index66 +'-' + index) == 'regex' || infoSettingForm.getFieldValue('codition-'+index66 +'-' + index) == undefined"
style=
"width: 80px"
placeholder=
'查询方式'
v-decorator=
"['selMet-' + index66 +'-' + index,
{initialValue: item.selMet, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option
value=
'equels'
>
精确
</a-select-option>
<a-select-option
value=
'like'
>
模糊
</a-select-option>
</a-select>
</a-form-item>
<!--
{{
index
+
`,`
+
loopContent
.
data
[
index66
].
labelSelConditionList
.
length
}}
-->
<a-form-item>
<a-icon
v-if=
"index+1 == loopContent.data[index66].labelSelConditionList.length"
theme=
'filled'
style=
"color:lightgreen;"
type=
"plus-circle"
@
click=
"addRow(index66)"
/>
<a-icon
v-if=
"index !== 0 && index+1 == loopContent.data[index66].labelSelConditionList.length"
theme=
'filled'
style=
"color:red; margin-left: 5px"
type=
"minus-circle"
@
click=
"deleteRow(index66, index)"
/>
<a-icon
theme=
'filled'
style=
"color:red; margin-left: 5px"
type=
"minus-circle"
@
click=
"deleteRow(index66, index)"
/>
</a-form-item>
</div>
</div>
...
...
@@ -181,12 +150,13 @@
<a-button
type=
"link"
@
click=
"addGroup"
>
<a-icon
type=
"plus"
/>
添加分组
</a-button>
</a-row>
<!--
<a-button
type=
'link'
v-if=
"loopContent.data.length == 0"
@
click=
"addInitRow()"
><a-icon
type=
"plus"
/>
新增配置
</a-button>
-->
<a-row
v-if=
"Object.keys(this.loopContent).length == 0"
style=
"border: 1px solid pink; padding: 20px"
>
<a-icon
type=
"info-circle"
/>
<span>
请选择业务对象后填写筛选配置
</span>
</a-row>
</div>
<a-modal
title=
'以下是预览结果,确定保存吗?'
width=
'55%'
v-model=
'resultModalVisible'
>
<template
slot=
"footer"
>
<a-button
key=
"cancel"
@
click=
"handleResultCancel"
>
...
...
@@ -198,17 +168,11 @@
</
template
>
<a-table
class=
"portalTable"
size=
"small"
row-key=
"id"
:columns=
"columns[0][labelForm.getFieldValue('tableName')]"
:dataSource=
"resultList"
></a-table>
</a-modal>
<!-- <div v-if="resultList.length > 0">
<a-divider type='horizontal' />
<a-row style="font-weight: bold">筛选结果</a-row>
<a-table class="portalTable" size="small" row-key="id" :columns="columns" :dataSource="resultList"></a-table>
</div> -->
<a-modal
v-model=
'deleteVisible'
@
ok=
'handleDeleteOk'
@
cancel=
'handleCancelOk'
>
确定删除标签【{{labelNameForDel}}】吗?
</a-modal>
<a-modal
width=
'400px'
:bordered=
'true'
title=
'提示'
v-model=
'confirmVisible'
@
ok=
'handleConfirmVisible'
@
cancel=
'handleConfirmCancel'
>
确定保存吗?
<!-- <a-table class="portalTable" size="small" row-key="id" :columns="columns" :dataSource="resultList"></a-table> -->
</a-modal>
</div>
</template>
...
...
@@ -218,18 +182,12 @@ import Vue from 'vue'
export
default
{
data
()
{
return
{
num
:
0
,
numRow
:
0
,
labelForm
:
this
.
$form
.
createForm
(
this
),
infoSettingForm
:
this
.
$form
.
createForm
(
this
),
resultModalVisible
:
false
,
loopContent
:
{
// data: [{
// key: '',
// tableName: '',
// codition: 'eq',
// val: '',
// selMet: ''
// }],
},
loopContent
:
{},
objSelectOptions
:
[
{
name
:
'小区'
,
...
...
@@ -264,35 +222,30 @@ export default {
tbl_community
:
[
{
title
:
'小区名称'
,
// width: 240,
dataIndex
:
'stNameFrst'
,
key
:
'stNameFrst'
,
align
:
'center'
,
},
{
title
:
'小区地址'
,
// width: 240,
dataIndex
:
'addrFrst'
,
key
:
'addrFrst'
,
align
:
'center'
,
},
{
title
:
'房管办'
,
// width: 240,
dataIndex
:
'hoName'
,
key
:
'hoName'
,
align
:
'center'
,
},
{
title
:
'小区性质'
,
// width: 240,
dataIndex
:
'stKindName'
,
key
:
'stKindName'
,
align
:
'center'
,
},
{
title
:
'小区类型'
,
// width: 240,
dataIndex
:
'sectTypeName'
,
key
:
'sectTypeName'
,
align
:
'center'
,
...
...
@@ -301,28 +254,24 @@ export default {
tbl_building
:
[
{
title
:
'门牌地址'
,
// width: 240,
dataIndex
:
'unitAddr'
,
key
:
'unitAddr'
,
align
:
'center'
,
},
{
title
:
'门牌类型'
,
// width: 240,
dataIndex
:
'unitKindName'
,
key
:
'unitKindName'
,
align
:
'center'
,
},
{
title
:
'门牌所在路'
,
// width: 240,
dataIndex
:
'uLoad'
,
key
:
'uLoad'
,
align
:
'center'
,
},
{
title
:
'门牌所在弄'
,
// width: 240,
dataIndex
:
'uLong'
,
key
:
'uLong'
,
align
:
'center'
,
...
...
@@ -331,28 +280,24 @@ export default {
tbl_prop_company
:
[
{
title
:
'物业名称'
,
// width: 240,
dataIndex
:
'cspName'
,
key
:
'cspName'
,
align
:
'center'
,
},
{
title
:
'物业联系人'
,
// width: 240,
dataIndex
:
'cspContacter'
,
key
:
'cspContacter'
,
align
:
'center'
,
},
{
title
:
'物业地址'
,
// width: 240,
dataIndex
:
'cspAddr'
,
key
:
'cspAddr'
,
align
:
'center'
,
},
{
title
:
'注册地址'
,
// width: 240,
dataIndex
:
'registerAddress'
,
key
:
'registerAddress'
,
align
:
'center'
,
...
...
@@ -361,35 +306,30 @@ export default {
tbl_industry_council
:
[
{
title
:
'业委会名称'
,
// width: 240,
dataIndex
:
'hocName'
,
key
:
'hocName'
,
align
:
'center'
,
},
{
title
:
'业委会地址'
,
// width: 240,
dataIndex
:
'hocAddr'
,
key
:
'hocAddr'
,
align
:
'center'
,
},
{
title
:
'竞选时间'
,
// width: 240,
dataIndex
:
'electionDate'
,
key
:
'electionDate'
,
align
:
'center'
,
},
{
title
:
'开始时间'
,
// width: 240,
dataIndex
:
'conStartDate'
,
key
:
'conStartDate'
,
align
:
'center'
,
},
{
title
:
'结束时间'
,
// width: 240,
dataIndex
:
'conEndDate'
,
key
:
'conEndDate'
,
align
:
'center'
,
...
...
@@ -403,7 +343,6 @@ export default {
console
.
log
(
'得到的'
+
this
.
labelId
)
this
.
getLabelDetail
()
this
.
getParentLabelList
()
// this.getKeyList()
this
.
initKeyList
()
},
props
:
[
...
...
@@ -428,20 +367,9 @@ export default {
},
},
methods
:
{
clearForm
(
formToClear
)
{
console
.
log
(
formToClear
)
this
.
infoSettingForm
.
resetFields
(
formToClear
)
},
getSelectedProperty
(
val
)
{
console
.
log
(
val
)
},
handleResultCancel
()
{
this
.
resultModalVisible
=
!
this
.
resultModalVisible
},
clearNextKey
(
col
)
{
console
.
log
(
col
)
// console.log(this.infoSettingForm.resetFields());
},
cnonvertObj
(
options
,
tableName
)
{
let
tbRealName
=
''
switch
(
tableName
)
{
...
...
@@ -480,46 +408,40 @@ export default {
* key => 业务属性二级可选值
*/
checkIfSelectOptionAppears
(
options
,
formValue
,
key
)
{
// console.log(options, formValue, key);
let
findKey
=
options
.
find
(
item
=>
(
item
.
tblKey
==
key
))
let
pushSels
=
[]
// 如果是false则为输入框
if
(
!
findKey
)
return
false
// 是选择框,日期框的情况
/**
* dataType == select,读pathUrl有没有值, 没值则selVal肯定有值
*/
if
(
!
findKey
||
!
findKey
.
selVals
)
return
false
return
true
// return (findKey.dataType);
// str / date / select/ num
// return findKey.dataType
// if(findKey.dataType == 'str') {
// return false
// } else {
let
resultList
=
[]
let
obj
=
JSON
.
parse
(
findKey
.
selVals
)
for
(
const
key
in
obj
)
{
resultList
.
push
({
name
:
key
,
value
:
obj
[
key
]
// }
if
(
!!
findKey
.
pathUrl
)
{
this
.
$ajax
.
get
({
url
:
this
.
$api
.
BASE_URL
+
findKey
.
pathUrl
,
}).
then
(
res
=>
{
if
(
res
.
code
==
200
)
{
pushSels
=
res
.
data
.
content
console
.
log
(
pushSels
);
return
{
dataType
:
findKey
.
dataType
,
selVals
:
pushSels
}
}
})
}
else
{
return
{
dataType
:
findKey
.
dataType
,
selVals
:
findKey
.
selVals
}
}
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
// }
// }
// }
// return {dataType: findKey.dataType, selVals: findKey.selVals}
// return `【` + findKey.dataType + '-' +findKey.pathUrl + '-' + findKey.selVals + '】'
},
cnonvertObjSecond
()
{},
handleResultOk
()
{
this
.
resultModalVisible
=
!
this
.
resultModalVisible
if
(
Object
.
keys
(
this
.
loopContent
).
length
==
0
)
{
...
...
@@ -559,11 +481,11 @@ export default {
val
:
!
formData
[
'inputTwo-'
+
i
+
'-'
+
index
]
?
formData
[
'inputOne-'
+
i
+
'-'
+
index
]
:
formData
[
'inputOne-'
+
i
+
'-'
+
index
]
+
','
+
formData
[
'inputTwo-'
+
i
+
'-'
+
index
],
codition
:
formData
[
'codition-'
+
i
+
'-'
+
index
],
relation
:
!!
formData
[
'relation-'
+
i
+
'-'
+
index
]?
formData
[
'relation-'
+
i
+
'-'
+
index
]:
'and'
,
selMet
:
formData
[
'selMet-'
+
i
+
'-'
+
index
]
})
})
innerResult
.
push
({
'randomNum'
:
formData
[
'randomNum-'
+
i
],
'serial'
:
formData
[
'groupName-'
+
i
],
'relation'
:
!!
formData
[
'relationWithGroup-'
+
i
+
'-0'
]?
formData
[
'relationWithGroup-'
+
i
+
'-0'
]:
'and'
,
'labelSelConditionList'
:
rowList
...
...
@@ -598,16 +520,44 @@ export default {
console
.
log
(
this
.
loopContent
)
Vue
.
set
(
this
.
loopContent
,
'data'
,
[
...
this
.
loopContent
.
data
,
{
serial
:
'新分组'
,
relation
:
'and'
,
labelSelConditionList
:
[
{
key
:
''
,
val
:
''
,
tableName
:
''
,
codition
:
'eq'
,
selMet
:
'
'
,
relation
:
''
}
]
}
...
this
.
loopContent
.
data
,
{
randomNum
:
Math
.
random
().
toString
(),
serial
:
'新分组'
,
relation
:
'and'
,
labelSelConditionList
:
[
{
key
:
''
,
val
:
''
,
tableName
:
''
,
codition
:
'eq
'
,
relation
:
''
}
]
}
])
this
.
$forceUpdate
()
console
.
log
(
JSON
.
stringify
(
this
.
loopContent
))
},
delGroup
(
key
)
{
console
.
log
(
key
)
Vue
.
delete
(
this
.
loopContent
.
data
,
key
)
delGroup
(
index1
,
key
)
{
let
loopGroup
=
this
.
loopContent
// 有多少组
let
innerResult
=
[]
let
formData
=
this
.
infoSettingForm
.
getFieldsValue
()
loopGroup
.
data
.
forEach
((
item
,
i
)
=>
{
let
rowList
=
[]
item
.
labelSelConditionList
.
forEach
((
ele
,
index
)
=>
{
// console.log(formData)
rowList
.
push
({
key
:
formData
[
'key-'
+
i
+
'-'
+
index
],
tableName
:
formData
[
'tableName-'
+
i
+
'-'
+
index
],
val
:
!
formData
[
'inputTwo-'
+
i
+
'-'
+
index
]
?
formData
[
'inputOne-'
+
i
+
'-'
+
index
]
:
formData
[
'inputOne-'
+
i
+
'-'
+
index
]
+
','
+
formData
[
'inputTwo-'
+
i
+
'-'
+
index
],
codition
:
formData
[
'codition-'
+
i
+
'-'
+
index
],
relation
:
!!
formData
[
'relation-'
+
i
+
'-'
+
index
]?
formData
[
'relation-'
+
i
+
'-'
+
index
]:
'and'
,
})
})
innerResult
.
push
({
'randomNum'
:
formData
[
'randomNum-'
+
i
],
'serial'
:
formData
[
'groupName-'
+
i
],
'relation'
:
!!
formData
[
'relationWithGroup-'
+
i
+
'-0'
]?
formData
[
'relationWithGroup-'
+
i
+
'-0'
]:
'and'
,
'labelSelConditionList'
:
rowList
})
})
this
.
loopContent
.
data
=
innerResult
this
.
loopContent
.
data
=
this
.
loopContent
.
data
.
filter
(
i
=>
i
.
randomNum
!==
key
)
this
.
$forceUpdate
()
},
initKeyList
()
{
...
...
@@ -615,22 +565,6 @@ export default {
this
.
initKey
=
this
.
labelForm
.
getFieldValue
(
'tableName'
)
this
.
getKeyList
(
this
.
initKey
)
},
handleObjChange
(
val
)
{
// 确定插入到哪一行
console
.
log
(
val
)
// let needValue = this.labelForm.getFieldValue('tableName')
// this.getKeyList(needValue)
// this.loopContent = {data: [{
// key: '',
// codition: 'eq',
// val: '',
// selMet: ''
// }]}
// this.infoSettingForm.resetFields()
// 重置key表项的值为空 或 业务对象干脆disable掉
},
getKeyList
(
val
)
{
this
.
availableKeyList
=
[]
this
.
$ajax
.
get
({
...
...
@@ -679,7 +613,6 @@ export default {
})
},
getInitialValueOne
(
val
)
{
// return ''
if
(
val
.
indexOf
(
','
)
>
-
1
)
{
return
val
.
split
(
','
)[
0
]
}
else
{
...
...
@@ -687,7 +620,6 @@ export default {
}
},
getInitialValueTwo
(
val
)
{
// return ''
if
(
val
.
indexOf
(
','
)
>
-
1
)
{
return
val
.
split
(
','
)[
1
]
}
else
{
...
...
@@ -698,35 +630,26 @@ export default {
this
.
finish
=
true
this
.
$emit
(
'finish'
,
this
.
finish
)
},
// addInitRow() {
// this.loopContent.data.push({
// key: '',
// codition: 'eq',
// val: '',
// selMet: ''
// })
// },
addRow
(
whichGroup
)
{
console
.
log
(
whichGroup
)
this
.
numRow
++
this
.
loopContent
.
data
[
whichGroup
].
labelSelConditionList
.
push
({
numRow
:
this
.
numRow
,
key
:
''
,
tableName
:
''
,
codition
:
'eq'
,
val
:
''
,
relation
:
'and'
,
selMet
:
''
})
this
.
$forceUpdate
()
console
.
log
(
this
.
loopContent
)
},
deleteRow
(
whichGroup
,
whichRow
)
{
console
.
log
(
whichGroup
,
whichRow
)
this
.
loopContent
.
data
[
whichGroup
].
labelSelConditionList
.
splice
(
whichRow
,
1
)
this
.
$forceUpdate
()
// console.log(JSON.stringify(this.loopContent.data)
)
// console.log(index
)
// this.loopContent.data.splice(index, 1
)
// console.log(JSON.stringify(this.loopContent.data))
if
(
this
.
loopContent
.
data
[
whichGroup
].
labelSelConditionList
.
length
==
1
)
{
this
.
$message
.
error
(
'请至少保留一个筛选条件,或删除分组!'
)
}
else
{
this
.
loopContent
.
data
[
whichGroup
].
labelSelConditionList
.
splice
(
whichRow
,
1
)
// this.loopContent.data[whichGroup].labelSelConditionList = this.loopContent.data[whichGroup].labelSelConditionList.filter(i => i.num !== whichRow
)
this
.
$forceUpdate
(
)
}
},
deleteLabel
(
id
)
{
console
.
log
(
id
,
this
.
deleteVisible
)
...
...
@@ -749,7 +672,7 @@ export default {
this
.
deleteVisible
=
!
this
.
deleteVisible
},
resetFormFields
()
{
this
.
loopContent
.
data
=
[
{
serial
:
'新分组'
,
relation
:
'and'
,
labelSelConditionList
:
[
{
key
:
''
,
val
:
''
,
tableName
:
''
,
codition
:
'eq'
,
selMet
:
'
'
,
relation
:
''
}
]
}
]
this
.
loopContent
.
data
=
[
{
randomNum
:
Math
.
random
(),
serial
:
'新分组'
,
relation
:
'and'
,
labelSelConditionList
:
[
{
key
:
''
,
val
:
''
,
tableName
:
''
,
codition
:
'eq
'
,
relation
:
''
}
]
}
]
this
.
resultList
=
[]
this
.
labelForm
.
resetFields
()
...
...
@@ -809,14 +732,10 @@ export default {
val
:
!
formData
[
'inputTwo-'
+
i
+
'-'
+
index
]
?
formData
[
'inputOne-'
+
i
+
'-'
+
index
]
:
formData
[
'inputOne-'
+
i
+
'-'
+
index
]
+
','
+
formData
[
'inputTwo-'
+
i
+
'-'
+
index
],
codition
:
formData
[
'codition-'
+
i
+
'-'
+
index
],
relation
:
!!
formData
[
'relation-'
+
i
+
'-'
+
index
]?
formData
[
'relation-'
+
i
+
'-'
+
index
]:
'and'
,
selMet
:
formData
[
'selMet-'
+
i
+
'-'
+
index
]
})
})
// console.log(!!formData['relationWithGroup-' + i + '-0']? formData['relationWithGroup-' + i + '-0']: 'and');
// relationWithGroup-0-0
innerResult
.
push
({
'randomNum'
:
Math
.
random
(),
'serial'
:
formData
[
'groupName-'
+
i
],
'relation'
:
!!
formData
[
'relationWithGroup-'
+
i
+
'-0'
]?
formData
[
'relationWithGroup-'
+
i
+
'-0'
]:
'and'
,
'labelSelConditionList'
:
rowList
...
...
@@ -838,10 +757,6 @@ export default {
this
.
resultModalVisible
=
!
this
.
resultModalVisible
this
.
resultList
=
this
.
$com
.
confirm
(
res
,
'data.content'
,
[])
// this.resetFormFields()
// this.finish = true
// this.$emit('finish', this.finish)
}
else
{
this
.
$message
.
success
(
'发生错误!'
)
}
...
...
@@ -886,11 +801,11 @@ export default {
val
:
!
formData
[
'inputTwo-'
+
i
+
'-'
+
index
]
?
formData
[
'inputOne-'
+
i
+
'-'
+
index
]
:
formData
[
'inputOne-'
+
i
+
'-'
+
index
]
+
','
+
formData
[
'inputTwo-'
+
i
+
'-'
+
index
],
codition
:
formData
[
'codition-'
+
i
+
'-'
+
index
],
relation
:
!!
formData
[
'relation-'
+
i
+
'-'
+
index
]?
formData
[
'relation-'
+
i
+
'-'
+
index
]:
'and'
,
selMet
:
formData
[
'selMet-'
+
i
+
'-'
+
index
]
})
})
innerResult
.
push
({
'randomNum'
:
formData
[
'randomNum-'
+
i
],
'serial'
:
formData
[
'groupName-'
+
i
],
'relation'
:
!!
formData
[
'relationWithGroup-'
+
i
+
'-0'
]?
formData
[
'relationWithGroup-'
+
i
+
'-0'
]:
'and'
,
'labelSelConditionList'
:
rowList
...
...
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