接口对接

This commit is contained in:
yuekuo
2023-04-19 16:04:44 +08:00
parent 7856fedaed
commit 35dd625a65
8 changed files with 42 additions and 8 deletions
+3
View File
@@ -71,5 +71,8 @@ Vue.config.productionTip = false
new Vue({
router,
store,
beforeCreate(){
Vue.prototype.$bus = this //安装全局事件总线
},
render: h => h(App)
}).$mount('#app')
@@ -4,15 +4,15 @@
<div class="form">
<el-form ref="form" :model="form" label-width="80px" :rules="rule">
<el-form-item label="上级标签">
<el-cascader v-model="form.label" placeholder="请选择上级标签" :options="cascaderOptions" filterable :props="{ checkStrictly: true }" clearable>
<el-cascader v-model="form.label" placeholder="请选择上级标签" :options="cascaderOptions" filterable :props="{ checkStrictly: true }" clearable >
</el-cascader>
</el-form-item>
<el-form-item label="标签名称" prop="name">
<el-input v-model="form.remark"></el-input>
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="排序">
<el-input v-model="form.remark"></el-input>
<el-input v-model="form.sort"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark"></el-input>
@@ -79,8 +79,9 @@ export default {
this.showAddOrUpdateLabel = true
this.form.label = node.parent.data.label
this.form.name = data.label
this.$refs.form.clearValidate('name',)
this.form={...this.form}
this.$refs.form.clearValidate('name')
console.log('hhh',node,data);
this.$forceUpdate()
} else {
this.form = {}
@@ -93,7 +94,8 @@ export default {
submitForm() {
this.$refs.form.validate((valid) => {
if (valid) {
this.$api.report.labelAdd({}).then(res => {
this.form.id=this.form.label[this.form.label.length - 1]
this.$api.report.labelAdd(this.form).then(res => {
})
this.dialogVisible = false
+7 -2
View File
@@ -40,17 +40,22 @@ import tabs from '../userCenter/processCenter/tabs.vue'
;
},
mounted () {
;
},
this.$bus.$on('clearForm',()=>{
this.form={}
});
},
methods: {
//查询
search() {
this.$bus.$emit('getSearchItem',this.form)
// this.$api.processCenter.search({})
this.tableData=[{createTime:'1999-10-1'}]
},
//重置
reset(){
this.form={}
this.$forceUpdate()
this.$bus.$emit('getSearchItem',this.form)
this.tableData=[{createTime:'3000-10-1'}]
// this.$api.processCenter.reset({})
}
@@ -63,6 +63,11 @@ export default {
default:[],
}
},
mounted () {
this.$bus.$on('getSearchItem',(data)=>{
console.log('22',data)
});
},
watch: {
secondData(newValue, oldValue) {
this.tableData=newValue
@@ -63,16 +63,25 @@ export default {
default:[],
}
},
watch: {
firstData(newValue, oldValue) {
this.tableData=newValue
}
},
mounted () {
this.$bus.$on('getSearchItem',(data)=>{
console.log('11',data)
});
},
methods: {
handle() {
alert(111);
},
},
beforeDestroy(){
this.$bus.$off('getSearchItem')
}
};
</script>
@@ -67,6 +67,11 @@ export default {
this.tableData=newValue
}
},
mounted () {
this.$bus.$on('getSearchItem',(data)=>{
console.log('44',data)
});
},
methods: {
view() {
this.$router.push({
@@ -85,6 +85,11 @@ export default {
this.tableData=newValue
}
},
mounted () {
this.$bus.$on('getSearchItem',(data)=>{
console.log('33',data)
});
},
methods: {
view() {
alert(111);
+1 -1
View File
@@ -66,7 +66,7 @@ export default {
},
methods: {
handleClick(tab, event) {
// console.log(tab, event);
this.$bus.$emit('clearForm')
}
}
}