From cc4a9beae6919d7ce73274d7d4cddfc63ed5724c Mon Sep 17 00:00:00 2001
From: xy <271556543@qq.com>
Date: Fri, 9 Aug 2024 18:13:46 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=AF=94=E5=B7=AE=E5=BC=82=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/utils/createDialog.js | 39 +-
src/views/lease/leaseLog.vue | 657 +++++++++++++++++++++++++
src/views/lease/leaseLogDetail.vue | 764 +++++++++++++++++++++++++++++
src/views/lease/sign.vue | 8 +-
src/views/login/index.vue | 18 +-
src/views/system/menu.vue | 36 ++
6 files changed, 1509 insertions(+), 13 deletions(-)
create mode 100644 src/views/lease/leaseLog.vue
create mode 100644 src/views/lease/leaseLogDetail.vue
diff --git a/src/utils/createDialog.js b/src/utils/createDialog.js
index 1fcc6a2..4f2688b 100644
--- a/src/utils/createDialog.js
+++ b/src/utils/createDialog.js
@@ -16,6 +16,17 @@ export class CreateDialog {
render: () => {}
}
]
+ options: {
+ disabled: [boolean],
+ width: [string,number],
+ labelPosition: [string],
+ size: [string],
+ labelReplace: [Map] , //like [oldVal, newVal],
+ fromData: [string] , //form数据源
+ fromFile: [string], //file数据源
+ notUseRules: [boolean],
+ formRef: [string]
+ }
*/
this.self = self;
this.$createElement = self.$createElement;
@@ -38,7 +49,7 @@ export class CreateDialog {
let that = this.self;
let props = {};
if (info.edit_input === "file" || info.edit_input === "files") {
- props.fileList = that.file[info.field];
+ props.fileList = this.options.fromFile ? that[this.options.fromFile][info.field] : that.file[info.field];
props.beforeUpload = (file) => {
if (file.size / 1000 > (50 * 1024)) {
that.$message({
@@ -139,14 +150,14 @@ export class CreateDialog {
"el-form",
{
class: "form-body",
- ref: "elForm",
+ ref: this.options.formRef || "elForm",
style: {
"padding-right": "12px",
},
props: {
model: this.options.disabled ? that.originalForm : that.form,
labelWidth: this.options.labelWidth || "100px",
- rules: that.rules,
+ rules: this.options.notUseRules ? {} : that.rules,
labelPosition: this.options.labelPosition || "top",
size: this.options.size || "small",
disabled: this.options.disabled
@@ -168,7 +179,7 @@ export class CreateDialog {
width: "100%",
},
props: {
- label: i.name,
+ label: this.options.labelReplace ? (this.options.labelReplace.get(i.name) || i.name) : i.name,
prop: i.field,
required:
i.validation instanceof Array
@@ -190,7 +201,7 @@ export class CreateDialog {
...addPropsMap.get(i.edit_input),
...this.extraProps(i),
placeholder: i.help,
- value: this.options.disabled ? that.originalForm[i.field] : that.form[i.field],
+ value: this.options.fromData ? that[this.options.fromData][i.field] : (this.options.disabled ? that.originalForm[i.field] : that.form[i.field]),
readonly: that.type === "show",
//disabled: that.type === 'show',
},
@@ -202,11 +213,19 @@ export class CreateDialog {
e
) => {
if (i.field) {
- that.form[i.field] = e;
- that.form = Object.assign(
- {},
- that.form
- );
+ if (this.options.fromData) {
+ that[this.options.fromData][i.field] = e;
+ that[this.options.fromData] = Object.assign(
+ {},
+ that[this.options.fromData]
+ );
+ } else {
+ that.form[i.field] = e;
+ that.form = Object.assign(
+ {},
+ that.form
+ );
+ }
}
},
},
diff --git a/src/views/lease/leaseLog.vue b/src/views/lease/leaseLog.vue
new file mode 100644
index 0000000..903218d
--- /dev/null
+++ b/src/views/lease/leaseLog.vue
@@ -0,0 +1,657 @@
+
+ 条件{{ index + 1 }}