Commit 0f65ef1d authored by levante's avatar levante

bq add select

parent 257874f0
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
<span slot="action" slot-scope="text, record"> <span slot="action" slot-scope="text, record">
<span class="actionBtn" @click="toView(tbl, record)">查看 </span> <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-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 slot="overlay">
<a-menu-item key="0" v-if="$route.name == 'basicInfo' || $route.name == 'nonResidents'"> <a-menu-item key="0" v-if="$route.name == 'basicInfo' || $route.name == 'nonResidents'">
<a @click="$parent.toBul(record)"> 门牌幢 </a> <a @click="$parent.toBul(record)"> 门牌幢 </a>
......
...@@ -2,32 +2,15 @@ ...@@ -2,32 +2,15 @@
<div class="routerWapper"> <div class="routerWapper">
<div> <div>
<a-row> <a-row>
<!-- <a-col :span='1' v-if="triggerType == 'create'"> --> <a-button @click="backPage"> 返回 </a-button>
<!-- <a-col :span='16'> <a-button v-if="triggerType !== 'create' && triggerType !== 'loadParentLabel'" :offset='1' type='danger' @click="deleteLabel(labelId)">删除</a-button>
<a-row> <a-button type='primary' @click="preview()">预览</a-button>
<a-col :span='1'> <a-button type='primary' @click="save()">保存</a-button>
<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-row> </a-row>
</div> </div>
<a-divider type='horizontal' /> <a-divider type='horizontal' />
<div style="height: 580px; overflow-y: scroll"> <div style="height: 580px; overflow-y: scroll">
<a-form :form='labelForm'> <a-form :form='labelForm'>
<!-- {{loopContent.data}} -->
<a-form-item label='标签名' :label-col="{span:3}" :wrapper-col="{span:15}"> <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-input placeholder='请输入标签名' v-decorator="['labelName',{validateTrigger:'blur', initialValue: jsonData.labelName?jsonData.labelName: '', rules: [{required: true, message: '请填写标签名!'}]}]"></a-input>
</a-form-item> </a-form-item>
...@@ -48,12 +31,6 @@ ...@@ -48,12 +31,6 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </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-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-group v-decorator="['tableName',{validateTrigger:'blur', initialValue: jsonData.tableName?jsonData.tableName: '', rules: [{required: true, message: '请选择业务对象!'}]}]">
<a-radio value="tbl_community"> <a-radio value="tbl_community">
...@@ -72,33 +49,35 @@ ...@@ -72,33 +49,35 @@
</a-form-item> </a-form-item>
</a-form> </a-form>
<div style="background-color: #F0F2F5; height: 5px; "></div> <div style="background-color: #F0F2F5; height: 5px; "></div>
<!-- {{loopContent}} -->
<a-form :form='infoSettingForm' layout='inline'> <a-form :form='infoSettingForm' layout='inline'>
<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;">
<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}} -->
<a-row type='flex' style="font-weight: bold; font-size: 16px; margin-bottom: 20px; border-bottom: 1px solid lightgrey" align='middle'> <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'> <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-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 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='and'></a-select-option>
<a-select-option value='or'></a-select-option> <a-select-option value='or'></a-select-option>
<a-select-option value='ne'></a-select-option> <a-select-option value='ne'></a-select-option>
</a-select> </a-select>
</a-form-item> </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-form-item>
</a-row> </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-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: '请至少选择一项!'}]}]"> <a-select style="width: 80px" placeholder='请选择条件' v-decorator="['relation-' + index66 +'-' + index,{initialValue: item.relation, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
...@@ -124,9 +103,9 @@ ...@@ -124,9 +103,9 @@
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-select style="width: 80px" placeholder='区间' v-decorator="['codition-' + index66 +'-' + index,{initialValue: item.codition, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]"> <a-select style="width: 150px" 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='eq'>等于(精确)</a-select-option>
<a-select-option value='regex'>等于模糊</a-select-option> <a-select-option value='regex'>等于(模糊)</a-select-option>
<a-select-option value='ne'>不等于</a-select-option> <a-select-option value='ne'>不等于</a-select-option>
<a-select-option value='gt'>大于</a-select-option> <a-select-option value='gt'>大于</a-select-option>
<a-select-option value='gte'>大于等于</a-select-option> <a-select-option value='gte'>大于等于</a-select-option>
...@@ -135,42 +114,32 @@ ...@@ -135,42 +114,32 @@
<a-select-option value='btw'>区间</a-select-option> <a-select-option value='btw'>区间</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
{{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'">
<!-- {{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 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, 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-select>
</a-form-item> </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-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-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-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-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-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-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+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> </a-form-item>
</div> </div>
</div> </div>
...@@ -181,12 +150,13 @@ ...@@ -181,12 +150,13 @@
<a-button type="link" @click="addGroup"> <a-icon type="plus" />添加分组 </a-button> <a-button type="link" @click="addGroup"> <a-icon type="plus" />添加分组 </a-button>
</a-row> </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-row v-if="Object.keys(this.loopContent).length == 0" style="border: 1px solid pink; padding: 20px">
<a-icon type="info-circle" /> <a-icon type="info-circle" />
<span>请选择业务对象后填写筛选配置</span> <span>请选择业务对象后填写筛选配置</span>
</a-row> </a-row>
</div> </div>
<a-modal title='以下是预览结果,确定保存吗?' width='55%' v-model='resultModalVisible'> <a-modal title='以下是预览结果,确定保存吗?' width='55%' v-model='resultModalVisible'>
<template slot="footer"> <template slot="footer">
<a-button key="cancel" @click="handleResultCancel"> <a-button key="cancel" @click="handleResultCancel">
...@@ -198,17 +168,11 @@ ...@@ -198,17 +168,11 @@
</template> </template>
<a-table class="portalTable" size="small" row-key="id" :columns="columns[0][labelForm.getFieldValue('tableName')]" :dataSource="resultList"></a-table> <a-table class="portalTable" size="small" row-key="id" :columns="columns[0][labelForm.getFieldValue('tableName')]" :dataSource="resultList"></a-table>
</a-modal> </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'> <a-modal v-model='deleteVisible' @ok='handleDeleteOk' @cancel='handleCancelOk'>
确定删除标签【{{labelNameForDel}}】吗? 确定删除标签【{{labelNameForDel}}】吗?
</a-modal> </a-modal>
<a-modal width='400px' :bordered='true' title='提示' v-model='confirmVisible' @ok='handleConfirmVisible' @cancel='handleConfirmCancel'> <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> </a-modal>
</div> </div>
</template> </template>
...@@ -218,18 +182,12 @@ import Vue from 'vue' ...@@ -218,18 +182,12 @@ import Vue from 'vue'
export default { export default {
data() { data() {
return { return {
num: 0,
numRow: 0,
labelForm: this.$form.createForm(this), labelForm: this.$form.createForm(this),
infoSettingForm: this.$form.createForm(this), infoSettingForm: this.$form.createForm(this),
resultModalVisible: false, resultModalVisible: false,
loopContent: { loopContent: {},
// data: [{
// key: '',
// tableName: '',
// codition: 'eq',
// val: '',
// selMet: ''
// }],
},
objSelectOptions: [ objSelectOptions: [
{ {
name: '小区', name: '小区',
...@@ -264,35 +222,30 @@ export default { ...@@ -264,35 +222,30 @@ export default {
tbl_community: [ tbl_community: [
{ {
title: '小区名称', title: '小区名称',
// width: 240,
dataIndex: 'stNameFrst', dataIndex: 'stNameFrst',
key: 'stNameFrst', key: 'stNameFrst',
align: 'center', align: 'center',
}, },
{ {
title: '小区地址', title: '小区地址',
// width: 240,
dataIndex: 'addrFrst', dataIndex: 'addrFrst',
key: 'addrFrst', key: 'addrFrst',
align: 'center', align: 'center',
}, },
{ {
title: '房管办', title: '房管办',
// width: 240,
dataIndex: 'hoName', dataIndex: 'hoName',
key: 'hoName', key: 'hoName',
align: 'center', align: 'center',
}, },
{ {
title: '小区性质', title: '小区性质',
// width: 240,
dataIndex: 'stKindName', dataIndex: 'stKindName',
key: 'stKindName', key: 'stKindName',
align: 'center', align: 'center',
}, },
{ {
title: '小区类型', title: '小区类型',
// width: 240,
dataIndex: 'sectTypeName', dataIndex: 'sectTypeName',
key: 'sectTypeName', key: 'sectTypeName',
align: 'center', align: 'center',
...@@ -301,28 +254,24 @@ export default { ...@@ -301,28 +254,24 @@ export default {
tbl_building: [ tbl_building: [
{ {
title: '门牌地址', title: '门牌地址',
// width: 240,
dataIndex: 'unitAddr', dataIndex: 'unitAddr',
key: 'unitAddr', key: 'unitAddr',
align: 'center', align: 'center',
}, },
{ {
title: '门牌类型', title: '门牌类型',
// width: 240,
dataIndex: 'unitKindName', dataIndex: 'unitKindName',
key: 'unitKindName', key: 'unitKindName',
align: 'center', align: 'center',
}, },
{ {
title: '门牌所在路', title: '门牌所在路',
// width: 240,
dataIndex: 'uLoad', dataIndex: 'uLoad',
key: 'uLoad', key: 'uLoad',
align: 'center', align: 'center',
}, },
{ {
title: '门牌所在弄', title: '门牌所在弄',
// width: 240,
dataIndex: 'uLong', dataIndex: 'uLong',
key: 'uLong', key: 'uLong',
align: 'center', align: 'center',
...@@ -331,28 +280,24 @@ export default { ...@@ -331,28 +280,24 @@ export default {
tbl_prop_company: [ tbl_prop_company: [
{ {
title: '物业名称', title: '物业名称',
// width: 240,
dataIndex: 'cspName', dataIndex: 'cspName',
key: 'cspName', key: 'cspName',
align: 'center', align: 'center',
}, },
{ {
title: '物业联系人', title: '物业联系人',
// width: 240,
dataIndex: 'cspContacter', dataIndex: 'cspContacter',
key: 'cspContacter', key: 'cspContacter',
align: 'center', align: 'center',
}, },
{ {
title: '物业地址', title: '物业地址',
// width: 240,
dataIndex: 'cspAddr', dataIndex: 'cspAddr',
key: 'cspAddr', key: 'cspAddr',
align: 'center', align: 'center',
}, },
{ {
title: '注册地址', title: '注册地址',
// width: 240,
dataIndex: 'registerAddress', dataIndex: 'registerAddress',
key: 'registerAddress', key: 'registerAddress',
align: 'center', align: 'center',
...@@ -361,35 +306,30 @@ export default { ...@@ -361,35 +306,30 @@ export default {
tbl_industry_council: [ tbl_industry_council: [
{ {
title: '业委会名称', title: '业委会名称',
// width: 240,
dataIndex: 'hocName', dataIndex: 'hocName',
key: 'hocName', key: 'hocName',
align: 'center', align: 'center',
}, },
{ {
title: '业委会地址', title: '业委会地址',
// width: 240,
dataIndex: 'hocAddr', dataIndex: 'hocAddr',
key: 'hocAddr', key: 'hocAddr',
align: 'center', align: 'center',
}, },
{ {
title: '竞选时间', title: '竞选时间',
// width: 240,
dataIndex: 'electionDate', dataIndex: 'electionDate',
key: 'electionDate', key: 'electionDate',
align: 'center', align: 'center',
}, },
{ {
title: '开始时间', title: '开始时间',
// width: 240,
dataIndex: 'conStartDate', dataIndex: 'conStartDate',
key: 'conStartDate', key: 'conStartDate',
align: 'center', align: 'center',
}, },
{ {
title: '结束时间', title: '结束时间',
// width: 240,
dataIndex: 'conEndDate', dataIndex: 'conEndDate',
key: 'conEndDate', key: 'conEndDate',
align: 'center', align: 'center',
...@@ -403,7 +343,6 @@ export default { ...@@ -403,7 +343,6 @@ export default {
console.log('得到的' + this.labelId) console.log('得到的' + this.labelId)
this.getLabelDetail() this.getLabelDetail()
this.getParentLabelList() this.getParentLabelList()
// this.getKeyList()
this.initKeyList() this.initKeyList()
}, },
props: [ props: [
...@@ -428,20 +367,9 @@ export default { ...@@ -428,20 +367,9 @@ export default {
}, },
}, },
methods: { methods: {
clearForm(formToClear) {
console.log(formToClear)
this.infoSettingForm.resetFields(formToClear)
},
getSelectedProperty(val) {
console.log(val)
},
handleResultCancel() { handleResultCancel() {
this.resultModalVisible = !this.resultModalVisible this.resultModalVisible = !this.resultModalVisible
}, },
clearNextKey(col) {
console.log(col)
// console.log(this.infoSettingForm.resetFields());
},
cnonvertObj(options, tableName) { cnonvertObj(options, tableName) {
let tbRealName = '' let tbRealName = ''
switch (tableName) { switch (tableName) {
...@@ -480,46 +408,40 @@ export default { ...@@ -480,46 +408,40 @@ export default {
* key => 业务属性二级可选值 * key => 业务属性二级可选值
*/ */
checkIfSelectOptionAppears(options, formValue, key) { checkIfSelectOptionAppears(options, formValue, key) {
// console.log(options, formValue, key);
let findKey = options.find(item => (item.tblKey == 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 (findKey.dataType);
// str / date / select/ num
return true // return findKey.dataType
// if(findKey.dataType == 'str') {
// return false
// } else {
let resultList = [] // }
let obj = JSON.parse(findKey.selVals) if(!!findKey.pathUrl) {
for (const key in obj) { this.$ajax.get({
resultList.push({ url: this.$api.BASE_URL + findKey.pathUrl,
name: key, }).then(res => {
value: obj[key] 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 {dataType: findKey.dataType, selVals: findKey.selVals}
return resultList // return `【` + findKey.dataType + '-' +findKey.pathUrl + '-' + findKey.selVals + '】'
// 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() { handleResultOk() {
this.resultModalVisible = !this.resultModalVisible this.resultModalVisible = !this.resultModalVisible
if(Object.keys(this.loopContent).length == 0) { if(Object.keys(this.loopContent).length == 0) {
...@@ -559,11 +481,11 @@ export default { ...@@ -559,11 +481,11 @@ export default {
val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index], val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index],
codition: formData['codition-' + i + '-' +index], codition: formData['codition-' + i + '-' +index],
relation: !!formData['relation-' + i + '-' + index]? formData['relation-' + i + '-' + index]: 'and', relation: !!formData['relation-' + i + '-' + index]? formData['relation-' + i + '-' + index]: 'and',
selMet: formData['selMet-' + i + '-' + index]
}) })
}) })
innerResult.push({ innerResult.push({
'randomNum': formData['randomNum-' + i],
'serial': formData['groupName-' + i], 'serial': formData['groupName-' + i],
'relation': !!formData['relationWithGroup-' + i + '-0']? formData['relationWithGroup-' + i + '-0']: 'and', 'relation': !!formData['relationWithGroup-' + i + '-0']? formData['relationWithGroup-' + i + '-0']: 'and',
'labelSelConditionList': rowList 'labelSelConditionList': rowList
...@@ -598,16 +520,44 @@ export default { ...@@ -598,16 +520,44 @@ export default {
console.log(this.loopContent) console.log(this.loopContent)
Vue.set(this.loopContent, 'data', [ 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() this.$forceUpdate()
console.log(JSON.stringify(this.loopContent)) console.log(JSON.stringify(this.loopContent))
}, },
delGroup(key) { delGroup(index1, key) {
console.log(key) let loopGroup = this.loopContent // 有多少组
Vue.delete(this.loopContent.data, key) 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() this.$forceUpdate()
}, },
initKeyList() { initKeyList() {
...@@ -615,22 +565,6 @@ export default { ...@@ -615,22 +565,6 @@ export default {
this.initKey = this.labelForm.getFieldValue('tableName') this.initKey = this.labelForm.getFieldValue('tableName')
this.getKeyList(this.initKey) 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) { getKeyList(val) {
this.availableKeyList = [] this.availableKeyList = []
this.$ajax.get({ this.$ajax.get({
...@@ -679,7 +613,6 @@ export default { ...@@ -679,7 +613,6 @@ export default {
}) })
}, },
getInitialValueOne(val) { getInitialValueOne(val) {
// return ''
if(val.indexOf(',') > -1) { if(val.indexOf(',') > -1) {
return val.split(',')[0] return val.split(',')[0]
} else { } else {
...@@ -687,7 +620,6 @@ export default { ...@@ -687,7 +620,6 @@ export default {
} }
}, },
getInitialValueTwo(val) { getInitialValueTwo(val) {
// return ''
if(val.indexOf(',') > -1) { if(val.indexOf(',') > -1) {
return val.split(',')[1] return val.split(',')[1]
} else { } else {
...@@ -698,35 +630,26 @@ export default { ...@@ -698,35 +630,26 @@ export default {
this.finish = true this.finish = true
this.$emit('finish', this.finish) this.$emit('finish', this.finish)
}, },
// addInitRow() {
// this.loopContent.data.push({
// key: '',
// codition: 'eq',
// val: '',
// selMet: ''
// })
// },
addRow(whichGroup) { addRow(whichGroup) {
console.log(whichGroup) this.numRow ++
this.loopContent.data[whichGroup].labelSelConditionList.push({ this.loopContent.data[whichGroup].labelSelConditionList.push({
numRow: this.numRow,
key: '', key: '',
tableName: '', tableName: '',
codition: 'eq', codition: 'eq',
val: '', val: '',
relation: 'and', relation: 'and',
selMet: ''
}) })
this.$forceUpdate() this.$forceUpdate()
console.log(this.loopContent)
}, },
deleteRow(whichGroup, whichRow) { deleteRow(whichGroup, whichRow) {
console.log(whichGroup, whichRow) if(this.loopContent.data[whichGroup].labelSelConditionList.length == 1) {
this.loopContent.data[whichGroup].labelSelConditionList.splice(whichRow, 1) this.$message.error('请至少保留一个筛选条件,或删除分组!')
this.$forceUpdate() } else {
// console.log(JSON.stringify(this.loopContent.data)) this.loopContent.data[whichGroup].labelSelConditionList.splice(whichRow, 1)
// console.log(index) // this.loopContent.data[whichGroup].labelSelConditionList = this.loopContent.data[whichGroup].labelSelConditionList.filter(i => i.num !== whichRow)
// this.loopContent.data.splice(index, 1) this.$forceUpdate()
// console.log(JSON.stringify(this.loopContent.data)) }
}, },
deleteLabel(id) { deleteLabel(id) {
console.log(id, this.deleteVisible) console.log(id, this.deleteVisible)
...@@ -749,7 +672,7 @@ export default { ...@@ -749,7 +672,7 @@ export default {
this.deleteVisible = !this.deleteVisible this.deleteVisible = !this.deleteVisible
}, },
resetFormFields() { 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.resultList = []
this.labelForm.resetFields() this.labelForm.resetFields()
...@@ -809,14 +732,10 @@ export default { ...@@ -809,14 +732,10 @@ export default {
val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index], val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index],
codition: formData['codition-' + i + '-' +index], codition: formData['codition-' + i + '-' +index],
relation: !!formData['relation-' + i + '-' + index]? formData['relation-' + i + '-' + index]: 'and', 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({ innerResult.push({
'randomNum': Math.random(),
'serial': formData['groupName-' + i], 'serial': formData['groupName-' + i],
'relation': !!formData['relationWithGroup-' + i + '-0']? formData['relationWithGroup-' + i + '-0']: 'and', 'relation': !!formData['relationWithGroup-' + i + '-0']? formData['relationWithGroup-' + i + '-0']: 'and',
'labelSelConditionList': rowList 'labelSelConditionList': rowList
...@@ -838,10 +757,6 @@ export default { ...@@ -838,10 +757,6 @@ export default {
this.resultModalVisible = !this.resultModalVisible this.resultModalVisible = !this.resultModalVisible
this.resultList = this.$com.confirm(res, 'data.content', []) this.resultList = this.$com.confirm(res, 'data.content', [])
// this.resetFormFields()
// this.finish = true
// this.$emit('finish', this.finish)
} else { } else {
this.$message.success('发生错误!') this.$message.success('发生错误!')
} }
...@@ -886,11 +801,11 @@ export default { ...@@ -886,11 +801,11 @@ export default {
val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index], val: !formData['inputTwo-' + i+'-'+index] ? formData['inputOne-' + i+'-'+index] : formData['inputOne-' + i+'-'+index] + ',' + formData['inputTwo-' + i+'-'+index],
codition: formData['codition-' + i + '-' +index], codition: formData['codition-' + i + '-' +index],
relation: !!formData['relation-' + i + '-' + index]? formData['relation-' + i + '-' + index]: 'and', relation: !!formData['relation-' + i + '-' + index]? formData['relation-' + i + '-' + index]: 'and',
selMet: formData['selMet-' + i + '-' + index]
}) })
}) })
innerResult.push({ innerResult.push({
'randomNum': formData['randomNum-' + i],
'serial': formData['groupName-' + i], 'serial': formData['groupName-' + i],
'relation': !!formData['relationWithGroup-' + i + '-0']? formData['relationWithGroup-' + i + '-0']: 'and', 'relation': !!formData['relationWithGroup-' + i + '-0']? formData['relationWithGroup-' + i + '-0']: 'and',
'labelSelConditionList': rowList 'labelSelConditionList': rowList
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment