|
@@ -14,6 +14,7 @@ export default {
|
|
|
data() {
|
|
|
const { FormColumns } = useColumns();
|
|
|
const rules = this.$init.rules([...FormColumns]);
|
|
|
+ console.log(rules, "rules");
|
|
|
const params = this.$init.params(FormColumns);
|
|
|
return {
|
|
|
visible: false,
|
|
@@ -26,13 +27,6 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
- isAdd: {
|
|
|
- get() {
|
|
|
- if (this.params.id) return false;
|
|
|
- return true;
|
|
|
- },
|
|
|
- set() {},
|
|
|
- },
|
|
|
title: {
|
|
|
get() {
|
|
|
if (this.option === "edit") {
|
|
@@ -76,15 +70,12 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
},
|
|
|
- // 重置表单数据
|
|
|
- handleResetData() {
|
|
|
- this.params = this.$init.params(this.FormColumns);
|
|
|
- this.$refs["authprivAdd"].clearValidate();
|
|
|
- },
|
|
|
// 取消
|
|
|
handleCancel() {
|
|
|
- this.handleResetData();
|
|
|
+ this.params = this.$init.params(this.FormColumns);
|
|
|
+ this.$refs["authprivAdd"].resetFields();
|
|
|
this.setVisible(false);
|
|
|
+ this.$emit("close");
|
|
|
},
|
|
|
// 确定
|
|
|
handleConfirm(formName) {
|
|
@@ -138,10 +129,6 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- beforeClose(done) {
|
|
|
- this.handleResetData();
|
|
|
- done();
|
|
|
- },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -153,8 +140,7 @@ export default {
|
|
|
:visible.sync="visible"
|
|
|
:close-on-click-modal="false"
|
|
|
:close-on-press-escape="false"
|
|
|
- :before-close="beforeClose"
|
|
|
- @close="$emit('close')"
|
|
|
+ @close="handleCancel"
|
|
|
>
|
|
|
<el-super-form
|
|
|
v-model="params"
|
|
@@ -168,15 +154,6 @@ export default {
|
|
|
label-position="right"
|
|
|
style="padding: 20px"
|
|
|
>
|
|
|
- <!-- <template slot="puOrgName" slot-scope="scope">
|
|
|
- <component
|
|
|
- v-bind="scope.attr"
|
|
|
- v-model="scope.row[scope.item.key]"
|
|
|
- :size="$attrs.size"
|
|
|
- :source.sync="scope.row"
|
|
|
- >
|
|
|
- </component
|
|
|
- ></template> -->
|
|
|
</el-super-form>
|
|
|
<div slot="footer" v-if="this.option !== 'check'">
|
|
|
<el-button
|