展示区域

This commit is contained in:
caoyang
2022-02-18 12:05:06 +08:00
parent 73ae892ea0
commit f77853ca33
2 changed files with 27 additions and 13 deletions
@@ -67,7 +67,7 @@
<a-form-model-item label="展示区域" prop="showArea"> <a-form-model-item label="展示区域" prop="showArea">
<a-select placeholder="请选择展示区域" @change="handleChange"> <a-select placeholder="请选择展示区域" @change="handleChange">
<a-select-option v-for="(item,index) in areaOptions" :key="item.id" :value="item.id"> <a-select-option v-for="(item,index) in areaOptions" :key="item.id" :value="item.id">
{{item.showarea}} {{item.showArea}}
</a-select-option> </a-select-option>
</a-select> </a-select>
<!-- <j-dict-select-tag type="list" v-model="form.showArea" dictCode="" placeholder="请选择展示区域" />--> <!-- <j-dict-select-tag type="list" v-model="form.showArea" dictCode="" placeholder="请选择展示区域" />-->
@@ -79,7 +79,6 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<p class="tag-info">其它模块展示</p> <p class="tag-info">其它模块展示</p>
<a-divider dashed /> <a-divider dashed />
<a-col :span="24"> <a-col :span="24">
@@ -279,7 +278,7 @@
let params = {}; let params = {};
getAction(`tag/onlCgformTag/queryShowArea`,params).then((res)=>{ getAction(`tag/onlCgformTag/queryShowArea`,params).then((res)=>{
if(res.success){ if(res.success){
this.areaOptions=res.success.records this.areaOptions=res.result
} }
}); });
}, },
@@ -102,7 +102,7 @@
</template> </template>
<script> <script>
import { getAction, postAction, deleteAction } from '@/api/manage' import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
// import tabTable from './tabTable' // import tabTable from './tabTable'
import dicList from '../dialog/dicList' import dicList from '../dialog/dicList'
export default { export default {
@@ -176,7 +176,8 @@
typeVisible:{}, typeVisible:{},
dicVisible:false, dicVisible:false,
dictVal:'', dictVal:'',
record: { } record: {},
isEdit:1,
} }
}, },
computed:{ computed:{
@@ -212,11 +213,12 @@
this.loadData() this.loadData()
}, },
handleAdd(){ handleAdd(){
this.isEdit=1
this.contentVisible=true this.contentVisible=true
this.form={} this.form={}
}, },
hideModal(){ hideModal(){
// console.log('form',this.form)
let params={ let params={
...this.form, ...this.form,
is_tag_dict: 1, is_tag_dict: 1,
@@ -225,13 +227,25 @@
this.$refs.ruleForm.validate((valid)=>{ this.$refs.ruleForm.validate((valid)=>{
// console.log('valide',valide) // console.log('valide',valide)
if(valid){ if(valid){
postAction(`sys/dict/add`,params).then(res=>{ if(this.isEdit==1){
if(res.success){ params.id=''
this.loadData() postAction(`sys/dict/add`,params).then(res=>{
this.contentVisible=false if(res.success){
this.form={} this.loadData()
} this.contentVisible=false
}) this.form={}
}
})
}else if(this.isEdit==0){
putAction(`sys/dict/edit`,params).then(res=>{
if(res.success){
this.loadData()
this.contentVisible=false
this.form={}
}
})
}
} }
@@ -262,6 +276,7 @@
}, },
//编辑 //编辑
actionEdit(val){ actionEdit(val){
this.isEdit=0
this.form={...val} this.form={...val}
this.contentVisible=true this.contentVisible=true
}, },