Commit f279b26b authored by Gakki's avatar Gakki

so far

parent 259fb578
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
</a-col> </a-col>
<a-col :span='1'></a-col> <a-col :span='1'></a-col>
<a-col :span='18' class="layoutMargin layoutPadding"> <a-col :span='18' class="layoutMargin layoutPadding">
<RightPanel v-if="currentState == 'create'" :trigger-type='currentState' /> <RightPanel v-if="currentState == 'create'" :trigger-type='currentState' @finish='getFinishState' />
<RightPanel v-else-if="currentState == 'loadChildLabel'" :trigger-type='currentState' :label-id='labelId' /> <RightPanel v-else-if="currentState == 'loadChildLabel'" :trigger-type='currentState' :label-id='labelId' @finish='getFinishState'/>
<EmptyRightPanel v-else /> <EmptyRightPanel v-else />
</a-col> </a-col>
</a-row> </a-row>
...@@ -61,6 +61,11 @@ export default { ...@@ -61,6 +61,11 @@ export default {
this.getLabelList() this.getLabelList()
}, },
methods: { methods: {
getFinishState(state) {
if(state == true) {
this.currentState = null
}
},
getLabelList() { getLabelList() {
this.$ajax.get({ this.$ajax.get({
url: this.$api.GET_LABEL_LIST, url: this.$api.GET_LABEL_LIST,
......
<template> <template>
<div class="routerWapper"> <div class="routerWapper">
<div> <div>
{{triggerType}} - {{labelId}} {{triggerType}} - {{labelId}} - {{finish}}
<a-row> <a-row>
<a-col :span='1' v-if="triggerType == 'create'"> <a-col :span='1' v-if="triggerType == 'create'">
<a-button type='default' @click="backPage()">返回</a-button> <a-button type='default' @click="backPage()">返回</a-button>
...@@ -77,16 +77,15 @@ ...@@ -77,16 +77,15 @@
<a-select-option value='like'>模糊</a-select-option> <a-select-option value='like'>模糊</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
{{loopContent.data.length}}
{{index}}
<a-form-item> <a-form-item>
<a-icon v-if="index+1 == loopContent.data.length" theme='filled' style="color:lightgreen;" type="plus-circle" @click="addRow()" /> <a-icon v-if="index+1 == loopContent.data.length" theme='filled' style="color:lightgreen;" type="plus-circle" @click="addRow()" />
<a-icon v-if="index+1 == loopContent.data.length" theme='filled' style="color:red; margin-left: 5px" type="minus-circle" @click="deleteRow(index)" /> <a-icon v-if="index+1 == loopContent.data.length" theme='filled' style="color:red; margin-left: 5px" type="minus-circle" @click="deleteRow(index)" />
</a-form-item> </a-form-item>
</div> </div>
</a-form> </a-form>
<a-button type='link' v-if="loopContent.data.length == 0" @click="addInitRow()">新增配置</a-button>
<a-modal :visible='deleteVisible' @ok='handleDeleteOk' @cancel='handleCancelOk'> <a-modal :visible='deleteVisible' @ok='handleDeleteOk' @cancel='handleCancelOk'>
确定删除该标签吗? 确定删除该标签{{labelId}}吗?
</a-modal> </a-modal>
</div> </div>
</template> </template>
...@@ -106,7 +105,8 @@ export default { ...@@ -106,7 +105,8 @@ export default {
}] }]
}, },
jsonData: [], jsonData: [],
deleteVisible: false deleteVisible: false,
finish: false
} }
}, },
mounted() { mounted() {
...@@ -152,6 +152,14 @@ export default { ...@@ -152,6 +152,14 @@ export default {
backPage(){ // 返回按钮 backPage(){ // 返回按钮
this.$router.back() this.$router.back()
}, },
addInitRow() {
this.loopContent.data.push({
key: '',
codition: 'equels',
val: '',
selMet: ''
})
},
addRow() { addRow() {
this.loopContent.data.push({ this.loopContent.data.push({
key: '', key: '',
...@@ -180,12 +188,13 @@ export default { ...@@ -180,12 +188,13 @@ export default {
this.deleteVisible = !this.deleteVisible this.deleteVisible = !this.deleteVisible
}, },
resetFormFields() { resetFormFields() {
this.loopContent.data = [{ // this.loopContent.data = [{
key: '', // key: '',
codition: 'equels', // codition: 'equels',
val: '', // val: '',
selMet: '' // selMet: ''
}] // }]
this.loopContent.data = []
}, },
save() { save() {
this.jsonData = [] this.jsonData = []
...@@ -209,6 +218,8 @@ export default { ...@@ -209,6 +218,8 @@ export default {
} }
}) })
this.resetFormFields() this.resetFormFields()
this.finish = true
this.$emit('finish', this.finish)
}, },
}, },
} }
......
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