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 @@ + + + + + diff --git a/src/views/lease/leaseLogDetail.vue b/src/views/lease/leaseLogDetail.vue new file mode 100644 index 0000000..ea9fb87 --- /dev/null +++ b/src/views/lease/leaseLogDetail.vue @@ -0,0 +1,764 @@ + + + + diff --git a/src/views/lease/sign.vue b/src/views/lease/sign.vue index 0c30662..b2a1907 100644 --- a/src/views/lease/sign.vue +++ b/src/views/lease/sign.vue @@ -35,7 +35,11 @@ export default { }), }, ], - {}, + { + labelReplace: new Map([ + ["租赁合同", this.type === 'change' ? '补充协议' : '租赁合同'] + ]) + }, false ); let oldDialog = new CreateDialog( @@ -64,7 +68,7 @@ export default { ); return ( -
+
+ + +
+ 版权所有:无锡市交通产业集团有限公司 +
@@ -345,7 +350,7 @@ .show-pwd { position: absolute; - right: 10%; + right: 8%; top: 50%; transform: translate(0, -50%); font-size: 16px; @@ -374,6 +379,17 @@ ::v-deep .el-form-item--small.el-form-item { margin-bottom: 1.3vw; } + .copyright { + width: 100%; + text-align: center; + color: #fff; + line-height: 16px; + font-size: 16px; + + position: absolute; + left: 0; + bottom: 6vh; + } @media (max-width: 960px) { .title-img { diff --git a/src/views/system/menu.vue b/src/views/system/menu.vue index 5935635..7cca4e8 100644 --- a/src/views/system/menu.vue +++ b/src/views/system/menu.vue @@ -74,6 +74,14 @@ ghost >编辑 + @@ -209,6 +217,8 @@ { + let copyRow = deepCopy(row) + delete copyRow.auth_node_tags_array; + delete copyRow.children; + delete copyRow.id; + delete copyRow.auth_node_tags; + delete copyRow.created_at; + delete copyRow.updated_at; + let pathArr = copyRow.path.split("?") + let detailPath = `$${pathArr[0]}/detail/:id?` + if (pathArr[1]) { + detailPath += pathArr[1] + } + copyRow.path = detailPath; + copyRow.name += '详情' + copyRow.sortnumber++; + copyRow.url = value; + save(copyRow) + .then((response) => { + this.$Message.success("操作成功"); + this.load(); + }) + }) + }, addchildren(obj) { this.form = this.$options.data().form; if (obj) {