|
@@ -1,9 +1,7 @@
|
|
|
<template>
|
|
|
<el-form
|
|
|
- ref="form"
|
|
|
- :model="model"
|
|
|
- :rules="rules"
|
|
|
- :inline="inline"
|
|
|
+ v-bind="{...$attrs, ...$props}"
|
|
|
+ v-on="$listeners"
|
|
|
>
|
|
|
<slot/>
|
|
|
</el-form>
|
|
@@ -12,16 +10,16 @@
|
|
|
import { saveToStorage, getSearchs } from '@/helpers'
|
|
|
export default {
|
|
|
name: 'save-form',
|
|
|
- props: ['model', 'rules', 'formProps', 'inline'],
|
|
|
+ props: ['model'],
|
|
|
mounted() {
|
|
|
const searchs = getSearchs(this.$route.fullPath)
|
|
|
for (const key in searchs) {
|
|
|
if (searchs.hasOwnProperty(key)) {
|
|
|
- const item = searchs[key];
|
|
|
+ const item = searchs[key]
|
|
|
this.model[key] = item
|
|
|
}
|
|
|
}
|
|
|
- console.log(this.$refs.form)
|
|
|
+ console.log(this)
|
|
|
console.log(getSearchs(this.$route.fullPath))
|
|
|
},
|
|
|
methods: {
|
|
@@ -34,6 +32,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ resetFields() {
|
|
|
+ this.$refs.form.resetFields()
|
|
|
+ saveToStorage(this.$route.fullPath, this.model)
|
|
|
+ }
|
|
|
},
|
|
|
}
|
|
|
</script>
|