Commit 69b1542d authored by 李维's avatar 李维

添加内容复制

parent 34842ddc
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -147,7 +147,8 @@ ...@@ -147,7 +147,8 @@
<span style="display: inline-block; text-align: right; width: 100px;">分数:</span> <span style="display: inline-block; text-align: right; width: 100px;">分数:</span>
<input type="text" nz-input [(ngModel)]="it.score" (blur)="save" style="display: inline-block; width: 150px;"> <input type="text" nz-input [(ngModel)]="it.score" (blur)="save" style="display: inline-block; width: 150px;">
</div> </div>
<button nz-button nzType="danger" nzDanger nz-popconfirm nzPopconfirmTitle="删除后不可恢复,确定删除吗?" nzPopconfirmPlacement="bottom" (nzOnConfirm)="deleteHotZoneConfig(i)" style="position: absolute; right: 10px; bottom: 10px;">删除</button> <button nz-button nzType="primary" nz-popconfirm nzPopconfirmTitle="确定复制一个当前配置吗?" nzPopconfirmPlacement="bottom" (nzOnConfirm)="copyHotZoneConfig(i)" style="position: absolute; right: 80px; bottom: 10px;">复制</button>
<button nz-button nzType="danger" nz-popconfirm nzPopconfirmTitle="删除后不可恢复,确定删除吗?" nzPopconfirmPlacement="bottom" (nzOnConfirm)="deleteHotZoneConfig(i)" style="position: absolute; right: 10px; bottom: 10px;">删除</button>
</div> </div>
<button nz-button nzType="dashed" (click)="addHotZoneConfig()" class="add-btn"> <button nz-button nzType="dashed" (click)="addHotZoneConfig()" class="add-btn">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i> <i nz-icon nzType="plus-circle" nzTheme="outline"></i>
......
...@@ -79,6 +79,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni ...@@ -79,6 +79,13 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy, AfterViewIni
this.save() this.save()
} }
// 复制一个内容配置
copyHotZoneConfig(index) {
const copyItem = JSON.parse(JSON.stringify(this.item.hotZoneConfigArr[index]));
this.item.hotZoneConfigArr.splice(index, 0, copyItem)
this.save();
}
// 添加热区内容配置 // 添加热区内容配置
addHotZoneConfigItem(it) { addHotZoneConfigItem(it) {
if(!it.contentList) { if(!it.contentList) {
......
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