Commit feb46543 authored by Gakki's avatar Gakki

增加添加标签和点击已有标签的按钮变化

parent 08bc56e5
...@@ -201,6 +201,6 @@ export default { ...@@ -201,6 +201,6 @@ export default {
get_specialInspection: '/service-documents-ddd/statistical/specialInspection', //行业督查数字 get_specialInspection: '/service-documents-ddd/statistical/specialInspection', //行业督查数字
get_month_check: 'service-documents-ddd/dashboard/house/month', get_month_check: 'service-documents-ddd/dashboard/house/month',
GET_LABEL_LIST: MOCK_URL + '/service-customkey-ddd/labels', // 获取标签列表 GET_LABEL_LIST: MOCK_URL + '/service-customkey-ddd/label/tree', // 获取标签列表
GET_LABEL_DETAIL: MOCK_URL + '/service-customkey-ddd/label/{id}' // 查看标签详情
} }
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</span> </span>
<span slot="charges" slot-scope="text, record"> <span slot="charges" slot-scope="text, record">
{{!!text? text + + `(元/月·㎡)` : '无数据'}} {{!!text? text + `(元/月·㎡)` : '无数据'}}
</span> </span>
</a-table> </a-table>
</div> </div>
......
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
</div> </div>
<div v-if="$route.name=='lvot'"> <div v-if="$route.name=='lvot'">
<a-row> <a-row>
<a-col :span='5' class="layoutMargin layoutPadding"> <a-col :span='4' class="layoutMargin layoutPadding">
<a-row> <a-row>
<a-button size='small' type="default"> <a-icon type="plus" />添加标签 </a-button> <a-button size='small' type="default" @click="addLabel"> <a-icon type="plus" />添加标签 </a-button>
</a-row> </a-row>
<a-tree <a-tree
:tree-data="treeData" :tree-data="treeData"
...@@ -21,8 +21,9 @@ ...@@ -21,8 +21,9 @@
/> />
</a-col> </a-col>
<a-col :span='1'></a-col> <a-col :span='1'></a-col>
<a-col :span='17' class="layoutMargin layoutPadding"> <a-col :span='18' class="layoutMargin layoutPadding">
<RightPanel /> <RightPanel v-if="currentState == 'create'" :trigger-type='currentState' />
<EmptyRightPanel v-else />
</a-col> </a-col>
</a-row> </a-row>
</div> </div>
...@@ -32,6 +33,7 @@ ...@@ -32,6 +33,7 @@
<script> <script>
import RightPanel from '@/views/label/labelRightSide.vue' import RightPanel from '@/views/label/labelRightSide.vue'
import EmptyRightPanel from '@/views/label/labelRightSideEmpty.vue'
const treeData = [] const treeData = []
...@@ -39,6 +41,7 @@ export default { ...@@ -39,6 +41,7 @@ export default {
name: 'lvot', name: 'lvot',
components: { components: {
RightPanel, RightPanel,
EmptyRightPanel
}, },
data() { data() {
return { return {
...@@ -49,6 +52,7 @@ export default { ...@@ -49,6 +52,7 @@ export default {
key: 'id' key: 'id'
}, },
selectedKeys: [], selectedKeys: [],
currentState: null
} }
}, },
mounted() { mounted() {
...@@ -74,6 +78,9 @@ export default { ...@@ -74,6 +78,9 @@ export default {
onCheck(checkedKeys, info) { onCheck(checkedKeys, info) {
console.log('onCheck', checkedKeys, info) console.log('onCheck', checkedKeys, info)
}, },
addLabel() {
this.currentState = 'create'
}
}, },
} }
</script> </script>
......
...@@ -2,14 +2,17 @@ ...@@ -2,14 +2,17 @@
<div class="routerWapper"> <div class="routerWapper">
<div> <div>
<a-row> <a-row>
<a-col :span='1'> <a-col :span='1' v-if="triggerType == 'create'">
<a-button type='default'>返回</a-button>
</a-col>
<a-col :span='1' v-else>
<a-button type='default'>删除</a-button> <a-button type='default'>删除</a-button>
</a-col> </a-col>
<a-col :span='1' :offset='1'> <a-col :span='1' :offset='1'>
<a-button type='default'>编辑</a-button> <a-button type='default'>编辑</a-button>
</a-col> </a-col>
<a-col :span='1' :offset='1'> <a-col :span='1' :offset='1'>
<a-button type='primary' @click="save()">添加</a-button> <a-button type='primary' @click="save()">保存</a-button>
</a-col> </a-col>
<a-col :span='19'></a-col> <a-col :span='19'></a-col>
</a-row> </a-row>
...@@ -33,24 +36,24 @@ ...@@ -33,24 +36,24 @@
<a-form :form='infoSettingForm' layout='inline'> <a-form :form='infoSettingForm' layout='inline'>
<div v-for="(item, index) in loopContent.data" :key='index'> <div v-for="(item, index) in loopContent.data" :key='index'>
<a-form-item v-if="!!item.relation"> <a-form-item v-if="!!item.relation">
<a-select style="width: 160px" placeholder='请选择条件' v-decorator="['relation' + index,{initialValue: item.relation, validateTrigger:'blur',rules: []}]"> <a-select style="width: 120px" placeholder='请选择条件' v-decorator="['relation' + index,{initialValue: item.relation, validateTrigger:'blur',rules: []}]">
<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-else style="margin-left: 160px"></a-form-item> <a-form-item v-else style="margin-left: 120px"></a-form-item>
<a-form-item> <a-form-item>
<a-select style="width: 160px" placeholder='请选择业务属性' v-decorator="['businessProperty' + index,{initialValue: item.businessProperty, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]"> <a-select style="width: 120px" placeholder='请选择业务属性' v-decorator="['businessProperty' + index,{initialValue: item.businessProperty, validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option value='sx1'>属性一</a-select-option> <a-select-option value='sx1'>属性一</a-select-option>
<a-select-option value='sx2'>属性二</a-select-option> <a-select-option value='sx2'>属性二</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-select style="width: 160px" placeholder='区间' v-decorator="['range' + index,{validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]"> <a-select style="width: 120px" placeholder='区间' v-decorator="['range' + index,{validateTrigger:'blur',rules: [{required: true, message: '请至少选择一项!'}]}]">
<a-select-option value='equals'>等于</a-select-option> <a-select-option value='equals'>等于</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>
...@@ -94,6 +97,9 @@ export default { ...@@ -94,6 +97,9 @@ export default {
}, },
mounted() { mounted() {
}, },
props: [
'triggerType'
],
methods: { methods: {
addRow() { addRow() {
this.loopContent.data.push({ this.loopContent.data.push({
...@@ -116,32 +122,15 @@ export default { ...@@ -116,32 +122,15 @@ export default {
if(!err) { if(!err) {
let loopCounts = this.loopContent.data.length let loopCounts = this.loopContent.data.length
let formData = this.infoSettingForm.getFieldsValue() let formData = this.infoSettingForm.getFieldsValue()
// console.log(loopCounts)
// console.log(formData)
for(let i = 0; i < loopCounts; i++) { for(let i = 0; i < loopCounts; i++) {
// for(let j = 0; j < Object.keys(formData).length; j++) {
// if(Object.keys(formData)[j].indexOf(i) > -1){
// }
// }
if(formData['inputTwo' + i] !== undefined) {
this.jsonData.push({
key: formData['businessProperty'+i],
val: formData['inputOne' + i],
condition: formData['range'+i],
relation: formData['relation' + i],
})
} else { // 区间值
this.jsonData.push({ this.jsonData.push({
key: formData['businessProperty'+i], key: formData['businessProperty'+i],
val1: formData['inputOne' + i], val: !formData['inputTwo' + i] ? formData['inputOne' + i] : formData['inputOne' + i] + ',' + formData['inputTwo' + i],
val2: formData['inputTwo' + i],
condition: formData['range'+i], condition: formData['range'+i],
relation: formData['relation' + i], relation: formData['relation' + i],
}) })
} }
}
console.log(JSON.stringify(this.jsonData)) console.log(JSON.stringify(this.jsonData))
} }
......
<template>
<div>
请先在左侧选择一个标签或添加标签。
</div>
</template>
<script>
export default {
}
</script>
\ No newline at end of file
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