|
@@ -1,5 +1,6 @@
|
|
|
<template>
|
|
|
<el-form
|
|
|
+ class="save-form"
|
|
|
v-bind="{...$attrs, ...$props}"
|
|
|
v-on="$listeners"
|
|
|
ref="form"
|
|
@@ -11,14 +12,14 @@
|
|
|
import { Searchs } from '@/helpers'
|
|
|
export default {
|
|
|
name: 'save-form',
|
|
|
- props: ['model'],
|
|
|
+ props: ['model', 'save-key'],
|
|
|
data() {
|
|
|
return {
|
|
|
searchs: null
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- const searchs = new Searchs(this.$route.fullPath)
|
|
|
+ const searchs = new Searchs(this['save-key'] || this.$route.fullPath)
|
|
|
this.searchs = searchs
|
|
|
const active = searchs.get()
|
|
|
for (const key in active.form) {
|
|
@@ -29,6 +30,9 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ save(search = null, type = 'form') {
|
|
|
+ this.searchs.update(search, undefined, type)
|
|
|
+ },
|
|
|
validate(FC) {
|
|
|
this.$refs.form.validate(valid => {
|
|
|
FC(valid)
|
|
@@ -45,3 +49,24 @@ export default {
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
+<style lang="less" scoped>
|
|
|
+.save-form{
|
|
|
+ /deep/ .el-input__inner{
|
|
|
+ width: 180px;
|
|
|
+ }
|
|
|
+ /deep/ .el-form-item__content .el-col {
|
|
|
+ width: 180px;
|
|
|
+ }
|
|
|
+ /deep/ .el-col.line{
|
|
|
+ width: 15px!important;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+ /deep/ .el-date-editor--daterange{
|
|
|
+ width: 375px;
|
|
|
+ }
|
|
|
+ /deep/ .el-form-item__content .el-col:last-child .el-form-item{
|
|
|
+ margin-right: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|