Commit 379e5d5c authored by asdf's avatar asdf

表单复制功能

parent 29638ee1
This diff is collapsed.
......@@ -29,10 +29,10 @@
"cnpm": "^6.1.1",
"compressing": "^1.5.0",
"ng-zorro-antd": "^8.5.2",
"node-sass": "^4.0.0",
"rxjs": "~6.5.4",
"spark-md5": "^3.0.0",
"tslib": "^1.10.0",
"node-sass": "^4.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
......
......@@ -91,15 +91,10 @@
<div style="text-align: right; padding-right: 10px;">
<span *ngIf="i==0" style="margin-bottom: 10px;margin-right: 20px;">是否是主页? : </span>
<nz-switch *ngIf="i==0" style="margin-bottom: 10px;margin-right: 200px;" [(ngModel)]="contentObj.haveCover" (ngModelChange)="onCoverSwitchChange()"></nz-switch>
<button style="margin-bottom: 10px;margin-right: 20px;" nz-button nzType="default" (click)="onCopyData(i)">
<span>复制数据</span>
</button>
<span style="margin-bottom: 10px;margin-right: 20px;">粘贴内容: </span>
<input style="width: 300px; margin-bottom: 10px;margin-right: 20px;" type="text" nz-input
[(ngModel)]="pasteString" (blur)="onPasteDataDone(i)">
<button style="margin-bottom: 10px;margin-right: 20px;" nz-button nzType="default" (click)="onPasteData(i)">
<span>粘贴数据</span>
<button style="margin-bottom: 10px;margin-right: 20px;" nz-button nzType="primary" (click)="onCopyData(i)">
<span>复制本页</span>
</button>
<button style="margin-right: 20px;" nz-button nzType="danger"
(click)="deleteItem(contentObj.dataArray, i)">
<span>删除本页</span>
......
......@@ -31,7 +31,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
contentObj = {
"version": "1.1",
haveCover:false,
haveCover: false,
bgm_url: "",
dataArray: []
}
......@@ -161,7 +161,7 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.saveItem();
setTimeout(() => {
window.scrollTo(0, document.body.scrollHeight);
},1)
}, 1)
}
onImageUploadSuccessByItem(e, item, key) {
......@@ -232,18 +232,11 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
this.save();
}
onCopyData(index) {
this.copyIndex = index;
}
onPasteData(index) {
let item = this.contentObj.dataArray[this.copyIndex];
this.pasteString = JSON.stringify(item);
this.contentObj.dataArray[index] = item;
this.contentObj.dataArray.push(this.contentObj.dataArray[index]);
this.save();
}
onPasteDataDone(index) {
}
onCoverSwitchChange(){
onCoverSwitchChange() {
console.log(this.contentObj.haveCover)
this.save();
}
......
......@@ -32,7 +32,7 @@
},
"ajv": {
"version": "6.12.6",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1605562626436&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.6.tgz?cache=0&sync_timestamp=1606043237802&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.6.tgz",
"integrity": "sha1-uvWmLoArB9l3A0WG+MO69a3ybfQ=",
"requires": {
"fast-deep-equal": "^3.1.1",
......@@ -135,9 +135,9 @@
}
},
"binary-mirror-config": {
"version": "1.27.0",
"resolved": "https://registry.npm.taobao.org/binary-mirror-config/download/binary-mirror-config-1.27.0.tgz?cache=0&sync_timestamp=1598346125743&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbinary-mirror-config%2Fdownload%2Fbinary-mirror-config-1.27.0.tgz",
"integrity": "sha1-ZGcy++7YOfuE7mfcqiHL8IWmWNU="
"version": "1.28.0",
"resolved": "https://registry.npm.taobao.org/binary-mirror-config/download/binary-mirror-config-1.28.0.tgz?cache=0&sync_timestamp=1605751778609&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbinary-mirror-config%2Fdownload%2Fbinary-mirror-config-1.28.0.tgz",
"integrity": "sha1-kKkid+vmWBzaCzS+YufPam7YotE="
},
"block-stream": {
"version": "0.0.9",
......@@ -286,7 +286,7 @@
},
"commander": {
"version": "2.10.0",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.10.0.tgz?cache=0&sync_timestamp=1603599644384&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.10.0.tgz",
"resolved": "https://registry.npm.taobao.org/commander/download/commander-2.10.0.tgz?cache=0&sync_timestamp=1605992729751&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcommander%2Fdownload%2Fcommander-2.10.0.tgz",
"integrity": "sha1-4fXTJF3iRtGlygRwL6GtG9fkBf4=",
"requires": {
"graceful-readlink": ">= 1.0.0"
......@@ -340,7 +340,7 @@
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1603284220908&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1605791507452&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz",
"integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
"requires": {
"ms": "2.0.0"
......@@ -744,7 +744,7 @@
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&sync_timestamp=1603284220908&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.1.0.tgz?cache=0&sync_timestamp=1605791507452&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.1.0.tgz",
"integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=",
"requires": {
"ms": "2.0.0"
......@@ -772,9 +772,9 @@
},
"dependencies": {
"debug": {
"version": "3.2.6",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.2.6.tgz?cache=0&sync_timestamp=1603284220908&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.2.6.tgz",
"integrity": "sha1-6D0X3hbYp++3cX7b5fsQE17uYps=",
"version": "3.2.7",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-3.2.7.tgz?cache=0&sync_timestamp=1605791507452&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-3.2.7.tgz",
"integrity": "sha1-clgLfpFF+zm2Z2+cXl+xALk0F5o=",
"requires": {
"ms": "^2.1.1"
}
......@@ -1123,9 +1123,9 @@
}
},
"npm": {
"version": "6.14.8",
"resolved": "https://registry.npm.taobao.org/npm/download/npm-6.14.8.tgz",
"integrity": "sha1-ZO91Q0Vjm8A1mC7D9gk1PIU5Azw=",
"version": "6.14.9",
"resolved": "https://registry.npm.taobao.org/npm/download/npm-6.14.9.tgz?cache=0&sync_timestamp=1605904151951&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnpm%2Fdownload%2Fnpm-6.14.9.tgz",
"integrity": "sha1-0rQjdWK/2VaJJJ4sKHRwDtlS7YI=",
"requires": {
"JSONStream": "^1.3.5",
"abbrev": "~1.1.1",
......@@ -1207,7 +1207,7 @@
"npm-pick-manifest": "^3.0.2",
"npm-profile": "^4.0.4",
"npm-registry-fetch": "^4.0.7",
"npm-user-validate": "~1.0.0",
"npm-user-validate": "^1.0.1",
"npmlog": "~4.1.2",
"once": "~1.4.0",
"opener": "^1.5.1",
......@@ -1278,16 +1278,6 @@
"humanize-ms": "^1.2.1"
}
},
"ajv": {
"version": "5.5.2",
"bundled": true,
"requires": {
"co": "^4.6.0",
"fast-deep-equal": "^1.0.0",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.3.0"
}
},
"ansi-align": {
"version": "2.0.0",
"bundled": true,
......@@ -1573,10 +1563,6 @@
"mkdirp": "~0.5.0"
}
},
"co": {
"version": "4.6.0",
"bundled": true
},
"code-point-at": {
"version": "1.1.0",
"bundled": true
......@@ -1965,10 +1951,6 @@
"version": "1.3.0",
"bundled": true
},
"fast-deep-equal": {
"version": "1.1.0",
"bundled": true
},
"fast-json-stable-stringify": {
"version": "2.0.0",
"bundled": true
......@@ -2253,11 +2235,31 @@
"bundled": true
},
"har-validator": {
"version": "5.1.0",
"version": "5.1.5",
"bundled": true,
"requires": {
"ajv": "^5.3.0",
"ajv": "^6.12.3",
"har-schema": "^2.0.0"
},
"dependencies": {
"ajv": {
"version": "6.12.6",
"bundled": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"fast-deep-equal": {
"version": "3.1.3",
"bundled": true
},
"json-schema-traverse": {
"version": "0.4.1",
"bundled": true
}
}
},
"has": {
......@@ -2500,10 +2502,6 @@
"version": "0.2.3",
"bundled": true
},
"json-schema-traverse": {
"version": "0.3.1",
"bundled": true
},
"json-stringify-safe": {
"version": "5.0.1",
"bundled": true
......@@ -3074,7 +3072,7 @@
}
},
"npm-user-validate": {
"version": "1.0.0",
"version": "1.0.1",
"bundled": true
},
"npmlog": {
......@@ -3949,6 +3947,19 @@
"xdg-basedir": "^3.0.0"
}
},
"uri-js": {
"version": "4.4.0",
"bundled": true,
"requires": {
"punycode": "^2.1.0"
},
"dependencies": {
"punycode": {
"version": "2.1.1",
"bundled": true
}
}
},
"url-parse-lax": {
"version": "1.0.0",
"bundled": true,
......@@ -4396,9 +4407,9 @@
},
"dependencies": {
"debug": {
"version": "4.2.0",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-4.2.0.tgz?cache=0&sync_timestamp=1603284220908&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.2.0.tgz",
"integrity": "sha1-fxUPk5IOlMWPVXTC/QGjEQ7/5/E=",
"version": "4.3.1",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-4.3.1.tgz?cache=0&sync_timestamp=1605791507452&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.3.1.tgz",
"integrity": "sha1-8NIpxQXgxtjEmsVT0bE9wYP2su4=",
"requires": {
"ms": "2.1.2"
}
......@@ -4471,9 +4482,9 @@
},
"dependencies": {
"debug": {
"version": "4.2.0",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-4.2.0.tgz?cache=0&sync_timestamp=1603284220908&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.2.0.tgz",
"integrity": "sha1-fxUPk5IOlMWPVXTC/QGjEQ7/5/E=",
"version": "4.3.1",
"resolved": "https://registry.npm.taobao.org/debug/download/debug-4.3.1.tgz?cache=0&sync_timestamp=1605791507452&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.3.1.tgz",
"integrity": "sha1-8NIpxQXgxtjEmsVT0bE9wYP2su4=",
"requires": {
"ms": "2.1.2"
}
......@@ -4927,7 +4938,7 @@
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz",
"resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz?cache=0&sync_timestamp=1605962474035&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.4.0.tgz",
"integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4="
},
"validate-npm-package-license": {
......
......@@ -12,7 +12,7 @@
"license": "ISC",
"dependencies": {
"cnpm": "^6.1.1",
"node-sass": "^4.0.0",
"compressing": "^1.5.0"
"compressing": "^1.5.0",
"node-sass": "^4.0.0"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment