|
|
@ -1,229 +1,253 @@ |
|
|
|
import { Component, OnInit, Inject } from '@angular/core'; |
|
|
|
import { Component, OnInit, Inject } from "@angular/core"; |
|
|
|
import { HttpClient } from '@angular/common/http'; |
|
|
|
import { HttpClient } from "@angular/common/http"; |
|
|
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
import { |
|
|
|
import { AddMatLibrary } from './addmatlibrary.component' |
|
|
|
MatDialog, |
|
|
|
import { EditMatLibrary } from './editmatlibrary.component' |
|
|
|
MatDialogRef, |
|
|
|
import { AddOriginalCopy } from './addoriginalcopy.component' |
|
|
|
MAT_DIALOG_DATA, |
|
|
|
import { MatTableDataSource } from '@angular/material/table'; |
|
|
|
} from "@angular/material/dialog"; |
|
|
|
import { EditOriginalCopy } from './editoriginalcopy.component' |
|
|
|
import { AddMatLibrary } from "./addmatlibrary.component"; |
|
|
|
import { SelectOriginalCopy } from './selectoriginalcopy.component' |
|
|
|
import { EditMatLibrary } from "./editmatlibrary.component"; |
|
|
|
import { MatSnackBar,MatSnackBarConfig } from '@angular/material/snack-bar'; |
|
|
|
import { AddOriginalCopy } from "./addoriginalcopy.component"; |
|
|
|
import format from 'date-fns/format'; |
|
|
|
import { MatTableDataSource } from "@angular/material/table"; |
|
|
|
|
|
|
|
import { EditOriginalCopy } from "./editoriginalcopy.component"; |
|
|
|
|
|
|
|
import { SelectOriginalCopy } from "./selectoriginalcopy.component"; |
|
|
|
|
|
|
|
import { MatSnackBar, MatSnackBarConfig } from "@angular/material/snack-bar"; |
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-material-bank', |
|
|
|
selector: "app-material-bank", |
|
|
|
templateUrl: './material-bank.component.html', |
|
|
|
templateUrl: "./material-bank.component.html", |
|
|
|
styleUrls: ['./material-bank.component.scss'] |
|
|
|
styleUrls: ["./material-bank.component.scss"], |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class MaterialBankComponent implements OnInit { |
|
|
|
export class MaterialBankComponent implements OnInit { |
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } |
|
|
|
private http: HttpClient, |
|
|
|
|
|
|
|
public dialog: MatDialog, |
|
|
|
|
|
|
|
public snackBar: MatSnackBar |
|
|
|
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.http.get('/api/AssetLibraries').subscribe(data=>{ |
|
|
|
this.http.get("/api/AssetLibraries").subscribe((data) => { |
|
|
|
this.material = data[0] |
|
|
|
this.material = data[0]; |
|
|
|
this.allMaterialBank = data |
|
|
|
this.allMaterialBank = data; |
|
|
|
this.getSourceMaterial() |
|
|
|
this.getSourceMaterial(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
allMaterialBank: any = []; //所有素材库
|
|
|
|
allMaterialBank: any = []; //所有素材库
|
|
|
|
material:any={name:''}; //选中的素材库
|
|
|
|
material: any = { name: "" }; //选中的素材库
|
|
|
|
materialIndex: any = 0; //选中的素材库index
|
|
|
|
materialIndex: any = 0; //选中的素材库index
|
|
|
|
|
|
|
|
|
|
|
|
sourceMaterial: any; //素材库对应所有原件
|
|
|
|
sourceMaterial: any; //素材库对应所有原件
|
|
|
|
Original: any; //选中的原件
|
|
|
|
Original: any; //选中的原件
|
|
|
|
OriginalIndex: any = null; //选中的原件index
|
|
|
|
OriginalIndex: any = null; //选中的原件index
|
|
|
|
isshow = true//左侧列表的显示隐藏
|
|
|
|
isshow = true; //左侧列表的显示隐藏
|
|
|
|
|
|
|
|
|
|
|
|
//收起左侧列表
|
|
|
|
//收起左侧列表
|
|
|
|
showlist() { |
|
|
|
showlist() { |
|
|
|
this.isshow = !this.isshow |
|
|
|
this.isshow = !this.isshow; |
|
|
|
} |
|
|
|
} |
|
|
|
//获取所有素材库
|
|
|
|
//获取所有素材库
|
|
|
|
getMaterialBank() { |
|
|
|
getMaterialBank() { |
|
|
|
this.http.get('/api/AssetLibraries').subscribe(data=>{ |
|
|
|
this.http.get("/api/AssetLibraries").subscribe((data) => { |
|
|
|
this.allMaterialBank = data |
|
|
|
this.allMaterialBank = data; |
|
|
|
this.material = data[this.materialIndex] |
|
|
|
this.material = data[this.materialIndex]; |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获得指定素材库所有原件
|
|
|
|
//获得指定素材库所有原件
|
|
|
|
getSourceMaterial() { |
|
|
|
getSourceMaterial() { |
|
|
|
this.sourceMaterial = null |
|
|
|
this.sourceMaterial = null; |
|
|
|
if (this.material) { |
|
|
|
if (this.material) { |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
libraryId:this.material.id |
|
|
|
libraryId: this.material.id, |
|
|
|
} |
|
|
|
}; |
|
|
|
this.http.get('/api/Assets',{ |
|
|
|
this.http |
|
|
|
params:data |
|
|
|
.get("/api/Assets", { |
|
|
|
}).subscribe(data=>{ |
|
|
|
params: data, |
|
|
|
this.sourceMaterial = data |
|
|
|
|
|
|
|
this.Original = data[this.OriginalIndex] |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.subscribe((data) => { |
|
|
|
|
|
|
|
this.sourceMaterial = data; |
|
|
|
|
|
|
|
this.Original = data[this.OriginalIndex]; |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//选中素材库
|
|
|
|
//选中素材库
|
|
|
|
add(e, index) { |
|
|
|
add(e, index) { |
|
|
|
this.Original = null |
|
|
|
this.Original = null; |
|
|
|
this.OriginalIndex = null |
|
|
|
this.OriginalIndex = null; |
|
|
|
if (this.materialIndex != index) { |
|
|
|
if (this.materialIndex != index) { |
|
|
|
this.material = e |
|
|
|
this.material = e; |
|
|
|
this.materialIndex = index |
|
|
|
this.materialIndex = index; |
|
|
|
this.getSourceMaterial() |
|
|
|
this.getSourceMaterial(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//选中原件
|
|
|
|
//选中原件
|
|
|
|
addOriginal(e, index) { |
|
|
|
addOriginal(e, index) { |
|
|
|
this.Original = e |
|
|
|
this.Original = e; |
|
|
|
this.OriginalIndex = index |
|
|
|
this.OriginalIndex = index; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//打开查看属性弹窗
|
|
|
|
//打开查看属性弹窗
|
|
|
|
viewProperties() { |
|
|
|
viewProperties() { |
|
|
|
if (this.Original) { |
|
|
|
if (this.Original) { |
|
|
|
let data = this.Original |
|
|
|
let data = this.Original; |
|
|
|
const dialogRef = this.dialog.open(attributeComponent, |
|
|
|
const dialogRef = this.dialog.open(attributeComponent, { |
|
|
|
{width: '1000px',data}); |
|
|
|
width: "1000px", |
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
data, |
|
|
|
(data)=>{if(data){this.getSourceMaterial()}} |
|
|
|
}); |
|
|
|
) |
|
|
|
dialogRef.afterClosed().subscribe((data) => { |
|
|
|
|
|
|
|
if (data) { |
|
|
|
|
|
|
|
this.getSourceMaterial(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = "top"; |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000; |
|
|
|
this.snackBar.open('请选择原件','确定',config); |
|
|
|
this.snackBar.open("请选择原件", "确定", config); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增素材库
|
|
|
|
//新增素材库
|
|
|
|
addmatlibrary() { |
|
|
|
addmatlibrary() { |
|
|
|
let data = this.allMaterialBank || [] |
|
|
|
let data = this.allMaterialBank || []; |
|
|
|
const dialogRef = this.dialog.open(AddMatLibrary, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(AddMatLibrary, { |
|
|
|
width: '260px', |
|
|
|
//调用open方法打开对话框并且携带参数过去
|
|
|
|
data |
|
|
|
width: "260px", |
|
|
|
|
|
|
|
data, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe((data) => { |
|
|
|
|
|
|
|
this.getMaterialBank(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
|
|
|
|
data=>{ |
|
|
|
|
|
|
|
this.getMaterialBank () |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//编辑素材库
|
|
|
|
//编辑素材库
|
|
|
|
editmatlibrary() { |
|
|
|
editmatlibrary() { |
|
|
|
const dialogRef = this.dialog.open(EditMatLibrary, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(EditMatLibrary, { |
|
|
|
width: '260px', |
|
|
|
//调用open方法打开对话框并且携带参数过去
|
|
|
|
data: {allMaterialBank:this.allMaterialBank,material:this.material} |
|
|
|
width: "260px", |
|
|
|
|
|
|
|
data: { allMaterialBank: this.allMaterialBank, material: this.material }, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
dialogRef.afterClosed().subscribe((data) => { |
|
|
|
|
|
|
|
this.getMaterialBank(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
|
|
|
|
data=>{ |
|
|
|
|
|
|
|
this.getMaterialBank () |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除素材库
|
|
|
|
//删除素材库
|
|
|
|
delete() { |
|
|
|
delete() { |
|
|
|
var isdeleted = confirm(`确定要删除${this.material.name}素材库吗?`) |
|
|
|
var isdeleted = confirm(`确定要删除${this.material.name}素材库吗?`); |
|
|
|
if (isdeleted) { |
|
|
|
if (isdeleted) { |
|
|
|
//请求删除接口
|
|
|
|
//请求删除接口
|
|
|
|
this.http.delete(`/api/AssetLibraries/${this.material.id}`).subscribe( data=>{
|
|
|
|
this.http |
|
|
|
this.materialIndex -= 1//删除之后焦点前移
|
|
|
|
.delete(`/api/AssetLibraries/${this.material.id}`) |
|
|
|
this.getMaterialBank () |
|
|
|
.subscribe((data) => { |
|
|
|
}) |
|
|
|
this.materialIndex -= 1; //删除之后焦点前移
|
|
|
|
|
|
|
|
this.getMaterialBank(); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//禁启用素材库
|
|
|
|
//禁启用素材库
|
|
|
|
disabled() { |
|
|
|
disabled() { |
|
|
|
let newdate = new Date(); |
|
|
|
let newdate = new Date(); |
|
|
|
let time = format(newdate, 'yyyy-MM-dd')
|
|
|
|
function getDate(date) { |
|
|
|
|
|
|
|
//date是传过来的时间戳,注意需为13位,10位需*1000
|
|
|
|
|
|
|
|
//也可以不传,获取的就是当前时间
|
|
|
|
|
|
|
|
var time = new Date(date); |
|
|
|
|
|
|
|
var year = time.getFullYear(); //年
|
|
|
|
|
|
|
|
var month = ("0" + (time.getMonth() + 1)).slice(-2); //月
|
|
|
|
|
|
|
|
var day = ("0" + time.getDate()).slice(-2); //日
|
|
|
|
|
|
|
|
var mydate = year + "-" + month + "-" + day; |
|
|
|
|
|
|
|
return mydate; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
let time = getDate(newdate); |
|
|
|
if (this.material.enabled) { |
|
|
|
if (this.material.enabled) { |
|
|
|
this.http.put(`/api/AssetLibraries/${this.material.id}`,{ |
|
|
|
this.http |
|
|
|
|
|
|
|
.put(`/api/AssetLibraries/${this.material.id}`, { |
|
|
|
id: this.material.id, |
|
|
|
id: this.material.id, |
|
|
|
name: this.material.name, |
|
|
|
name: this.material.name, |
|
|
|
order: this.material.order, |
|
|
|
order: this.material.order, |
|
|
|
tag: this.material.tag, |
|
|
|
tag: this.material.tag, |
|
|
|
enabled: false, |
|
|
|
enabled: false, |
|
|
|
modifiedTime: time |
|
|
|
modifiedTime: time, |
|
|
|
}).subscribe(data=>{ |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
|
|
|
this.snackBar.open('禁用成功','确定',config); |
|
|
|
|
|
|
|
this.getMaterialBank () |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.subscribe((data) => { |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = "top"; |
|
|
|
|
|
|
|
config.duration = 3000; |
|
|
|
|
|
|
|
this.snackBar.open("禁用成功", "确定", config); |
|
|
|
|
|
|
|
this.getMaterialBank(); |
|
|
|
|
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.http.put(`/api/AssetLibraries/${this.material.id}`,{ |
|
|
|
this.http |
|
|
|
|
|
|
|
.put(`/api/AssetLibraries/${this.material.id}`, { |
|
|
|
id: this.material.id, |
|
|
|
id: this.material.id, |
|
|
|
name: this.material.name, |
|
|
|
name: this.material.name, |
|
|
|
order: this.material.order, |
|
|
|
order: this.material.order, |
|
|
|
tag: this.material.tag, |
|
|
|
tag: this.material.tag, |
|
|
|
enabled: true, |
|
|
|
enabled: true, |
|
|
|
modifiedTime: time |
|
|
|
modifiedTime: time, |
|
|
|
}).subscribe(data=>{ |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
|
|
|
this.snackBar.open('启用成功','确定',config); |
|
|
|
|
|
|
|
this.getMaterialBank () |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.subscribe((data) => { |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = "top"; |
|
|
|
|
|
|
|
config.duration = 3000; |
|
|
|
|
|
|
|
this.snackBar.open("启用成功", "确定", config); |
|
|
|
|
|
|
|
this.getMaterialBank(); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//新增素材原件
|
|
|
|
//新增素材原件
|
|
|
|
addoriginalcopy(node) { |
|
|
|
addoriginalcopy(node) { |
|
|
|
const dialogRef = this.dialog.open(AddOriginalCopy, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(AddOriginalCopy, { |
|
|
|
|
|
|
|
//调用open方法打开对话框并且携带参数过去
|
|
|
|
// height:"715px",
|
|
|
|
// height:"715px",
|
|
|
|
width: "640px", |
|
|
|
width: "640px", |
|
|
|
data: {allMaterialBank:this.allMaterialBank,node:node,sourceMaterial:this.sourceMaterial} |
|
|
|
data: { |
|
|
|
|
|
|
|
allMaterialBank: this.allMaterialBank, |
|
|
|
|
|
|
|
node: node, |
|
|
|
|
|
|
|
sourceMaterial: this.sourceMaterial, |
|
|
|
|
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
dialogRef.afterClosed().subscribe((data) => { |
|
|
|
data=>{ |
|
|
|
|
|
|
|
if (data) { |
|
|
|
if (data) { |
|
|
|
this.getSourceMaterial () |
|
|
|
this.getSourceMaterial(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
//修改素材原件
|
|
|
|
//修改素材原件
|
|
|
|
editoriginalcopy(node) { |
|
|
|
editoriginalcopy(node) { |
|
|
|
if (this.Original) { |
|
|
|
if (this.Original) { |
|
|
|
const dialogRef = this.dialog.open(EditOriginalCopy, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(EditOriginalCopy, { |
|
|
|
|
|
|
|
//调用open方法打开对话框并且携带参数过去
|
|
|
|
// height:"590px",
|
|
|
|
// height:"590px",
|
|
|
|
width: "640px", |
|
|
|
width: "640px", |
|
|
|
data: {allMaterialBank:this.allMaterialBank,node:node,Original:this.Original} |
|
|
|
data: { |
|
|
|
|
|
|
|
allMaterialBank: this.allMaterialBank, |
|
|
|
|
|
|
|
node: node, |
|
|
|
|
|
|
|
Original: this.Original, |
|
|
|
|
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
dialogRef.afterClosed().subscribe((data) => { |
|
|
|
data=>{ |
|
|
|
|
|
|
|
if (data) { |
|
|
|
if (data) { |
|
|
|
this.getSourceMaterial () |
|
|
|
this.getSourceMaterial(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = "top"; |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000; |
|
|
|
this.snackBar.open('请选择原件','确定',config); |
|
|
|
this.snackBar.open("请选择原件", "确定", config); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//禁启用原件
|
|
|
|
//禁启用原件
|
|
|
|
disableoriginal(material) { |
|
|
|
disableoriginal(material) { |
|
|
|
if (this.Original) { |
|
|
|
if (this.Original) { |
|
|
|
this.http.put(`/api/Assets/${this.Original.id}`,{ |
|
|
|
this.http |
|
|
|
|
|
|
|
.put(`/api/Assets/${this.Original.id}`, { |
|
|
|
id: this.Original.id, |
|
|
|
id: this.Original.id, |
|
|
|
name: this.Original.name, |
|
|
|
name: this.Original.name, |
|
|
|
width: this.Original.width, |
|
|
|
width: this.Original.width, |
|
|
@ -237,118 +261,126 @@ export class MaterialBankComponent implements OnInit { |
|
|
|
order: this.Original.order, |
|
|
|
order: this.Original.order, |
|
|
|
enabled: !this.Original.enabled, |
|
|
|
enabled: !this.Original.enabled, |
|
|
|
propertyInfos: this.Original.propertyInfos, |
|
|
|
propertyInfos: this.Original.propertyInfos, |
|
|
|
fireElementId:this.Original.fireElementId |
|
|
|
fireElementId: this.Original.fireElementId, |
|
|
|
}).subscribe((data)=>{ |
|
|
|
|
|
|
|
this.getSourceMaterial () |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.subscribe((data) => { |
|
|
|
|
|
|
|
this.getSourceMaterial(); |
|
|
|
|
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = "top"; |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000; |
|
|
|
this.snackBar.open('请选择原件','确定',config); |
|
|
|
this.snackBar.open("请选择原件", "确定", config); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除原件
|
|
|
|
//删除原件
|
|
|
|
deleteoriginal(material) { |
|
|
|
deleteoriginal(material) { |
|
|
|
if (this.Original) { |
|
|
|
if (this.Original) { |
|
|
|
var isdeleted = confirm(`确定要删除当前原件吗?`) |
|
|
|
var isdeleted = confirm(`确定要删除当前原件吗?`); |
|
|
|
if (isdeleted) { |
|
|
|
if (isdeleted) { |
|
|
|
//请求删除接口
|
|
|
|
//请求删除接口
|
|
|
|
this.http.delete(`/api/Assets`,{ |
|
|
|
this.http |
|
|
|
|
|
|
|
.delete(`/api/Assets`, { |
|
|
|
params: { |
|
|
|
params: { |
|
|
|
libraryId: material.id, |
|
|
|
libraryId: material.id, |
|
|
|
id:this.Original.id |
|
|
|
id: this.Original.id, |
|
|
|
} |
|
|
|
}, |
|
|
|
}).subscribe( data=>{
|
|
|
|
|
|
|
|
this.getSourceMaterial () |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.subscribe((data) => { |
|
|
|
|
|
|
|
this.getSourceMaterial(); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = "top"; |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000; |
|
|
|
this.snackBar.open('请选择原件','确定',config); |
|
|
|
this.snackBar.open("请选择原件", "确定", config); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//选择原件素材 material为当前素材库的信息
|
|
|
|
//选择原件素材 material为当前素材库的信息
|
|
|
|
selectoriginal(material) { |
|
|
|
selectoriginal(material) { |
|
|
|
const dialogRef = this.dialog.open(SelectOriginalCopy, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(SelectOriginalCopy, { |
|
|
|
|
|
|
|
//调用open方法打开对话框并且携带参数过去
|
|
|
|
// height:"525px",
|
|
|
|
// height:"525px",
|
|
|
|
data: {allMaterialBank:this.allMaterialBank,material:material} |
|
|
|
data: { allMaterialBank: this.allMaterialBank, material: material }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
dialogRef.afterClosed().subscribe((data) => { |
|
|
|
data=>{ |
|
|
|
|
|
|
|
if (data) { |
|
|
|
if (data) { |
|
|
|
this.getSourceMaterial () |
|
|
|
this.getSourceMaterial(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//原件对应所有属性弹窗
|
|
|
|
//原件对应所有属性弹窗
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-attribute', |
|
|
|
selector: "app-attribute", |
|
|
|
templateUrl: './attribute.html', |
|
|
|
templateUrl: "./attribute.html", |
|
|
|
styleUrls: ['./material-bank.component.scss'] |
|
|
|
styleUrls: ["./material-bank.component.scss"], |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class attributeComponent { |
|
|
|
export class attributeComponent { |
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog, |
|
|
|
private http: HttpClient, |
|
|
|
|
|
|
|
public dialog: MatDialog, |
|
|
|
public dialogRef: MatDialogRef<attributeComponent>, |
|
|
|
public dialogRef: MatDialogRef<attributeComponent>, |
|
|
|
@Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) { } |
|
|
|
@Inject(MAT_DIALOG_DATA) public data, |
|
|
|
|
|
|
|
public snackBar: MatSnackBar |
|
|
|
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
if (this.data.propertyInfos == null) { |
|
|
|
if (this.data.propertyInfos == null) { |
|
|
|
this.data.propertyInfos = [] |
|
|
|
this.data.propertyInfos = []; |
|
|
|
} |
|
|
|
} |
|
|
|
this.setIndex() |
|
|
|
this.setIndex(); |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos) |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
displayedColumns = ['checked', 'name', 'type', 'default','required','physicalUnit','operation']; |
|
|
|
displayedColumns = [ |
|
|
|
|
|
|
|
"checked", |
|
|
|
|
|
|
|
"name", |
|
|
|
|
|
|
|
"type", |
|
|
|
|
|
|
|
"default", |
|
|
|
|
|
|
|
"required", |
|
|
|
|
|
|
|
"physicalUnit", |
|
|
|
|
|
|
|
"operation", |
|
|
|
|
|
|
|
]; |
|
|
|
dataSource: any = []; //当前原件属性渲染table
|
|
|
|
dataSource: any = []; //当前原件属性渲染table
|
|
|
|
dataSourceIndex: any = []; //选中属性的index
|
|
|
|
dataSourceIndex: any = []; //选中属性的index
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//封装函数每次更改,重新获取下标
|
|
|
|
//封装函数每次更改,重新获取下标
|
|
|
|
setIndex() { |
|
|
|
setIndex() { |
|
|
|
if (this.data.propertyInfos) { |
|
|
|
if (this.data.propertyInfos) { |
|
|
|
this.data.propertyInfos.forEach((item, index) => { |
|
|
|
this.data.propertyInfos.forEach((item, index) => { |
|
|
|
item.index = index |
|
|
|
item.index = index; |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//点击checked框获取当前属性index
|
|
|
|
//点击checked框获取当前属性index
|
|
|
|
checkedChange(e, index) { |
|
|
|
checkedChange(e, index) { |
|
|
|
if (e.checked) { |
|
|
|
if (e.checked) { |
|
|
|
this.dataSourceIndex.push(index) |
|
|
|
this.dataSourceIndex.push(index); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.dataSourceIndex.splice(this.dataSourceIndex.findIndex(item=>item==index),1) |
|
|
|
this.dataSourceIndex.splice( |
|
|
|
|
|
|
|
this.dataSourceIndex.findIndex((item) => item == index), |
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//上移
|
|
|
|
//上移
|
|
|
|
toTop() { |
|
|
|
toTop() { |
|
|
|
if (this.dataSourceIndex.length) { |
|
|
|
if (this.dataSourceIndex.length) { |
|
|
|
let index = this.dataSourceIndex[this.dataSourceIndex.length-1] |
|
|
|
let index = this.dataSourceIndex[this.dataSourceIndex.length - 1]; |
|
|
|
if (index != 0) { |
|
|
|
if (index != 0) { |
|
|
|
let data = this.data.propertyInfos[index] |
|
|
|
let data = this.data.propertyInfos[index]; |
|
|
|
this.data.propertyInfos[index]=this.data.propertyInfos[index-1] |
|
|
|
this.data.propertyInfos[index] = this.data.propertyInfos[index - 1]; |
|
|
|
this.data.propertyInfos[index-1] = data |
|
|
|
this.data.propertyInfos[index - 1] = data; |
|
|
|
this.dataSourceIndex[this.dataSourceIndex.length-1] = index-1 |
|
|
|
this.dataSourceIndex[this.dataSourceIndex.length - 1] = index - 1; |
|
|
|
this.setIndex() |
|
|
|
this.setIndex(); |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos) |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -356,89 +388,85 @@ export class attributeComponent { |
|
|
|
//下移
|
|
|
|
//下移
|
|
|
|
toBottom() { |
|
|
|
toBottom() { |
|
|
|
if (this.dataSourceIndex.length) { |
|
|
|
if (this.dataSourceIndex.length) { |
|
|
|
let index = this.dataSourceIndex[this.dataSourceIndex.length-1] |
|
|
|
let index = this.dataSourceIndex[this.dataSourceIndex.length - 1]; |
|
|
|
if (index != this.data.propertyInfos.length - 1) { |
|
|
|
if (index != this.data.propertyInfos.length - 1) { |
|
|
|
let data = this.data.propertyInfos[index] |
|
|
|
let data = this.data.propertyInfos[index]; |
|
|
|
this.data.propertyInfos[index]=this.data.propertyInfos[index+1] |
|
|
|
this.data.propertyInfos[index] = this.data.propertyInfos[index + 1]; |
|
|
|
this.data.propertyInfos[index+1] = data |
|
|
|
this.data.propertyInfos[index + 1] = data; |
|
|
|
this.dataSourceIndex[this.dataSourceIndex.length-1] = index+1 |
|
|
|
this.dataSourceIndex[this.dataSourceIndex.length - 1] = index + 1; |
|
|
|
this.setIndex() |
|
|
|
this.setIndex(); |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos) |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增属性弹窗
|
|
|
|
//新增属性弹窗
|
|
|
|
add() { |
|
|
|
add() { |
|
|
|
const dialogRef = this.dialog.open(addAttributeComponent); |
|
|
|
const dialogRef = this.dialog.open(addAttributeComponent); |
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
dialogRef.afterClosed().subscribe((data) => { |
|
|
|
(data)=>{ |
|
|
|
|
|
|
|
if (data) { |
|
|
|
if (data) { |
|
|
|
this.data.propertyInfos.push(data) |
|
|
|
this.data.propertyInfos.push(data); |
|
|
|
this.setIndex() |
|
|
|
this.setIndex(); |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos)} |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//编辑属性弹窗
|
|
|
|
//编辑属性弹窗
|
|
|
|
edit(e) { |
|
|
|
edit(e) { |
|
|
|
|
|
|
|
let data = this.data.propertyInfos[e]; |
|
|
|
let data = this.data.propertyInfos[e] |
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(editAttribute, { data }); |
|
|
|
const dialogRef = this.dialog.open(editAttribute, { data }); |
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
dialogRef.afterClosed().subscribe((data) => { |
|
|
|
data=>{ |
|
|
|
|
|
|
|
if (data) { |
|
|
|
if (data) { |
|
|
|
this.data.propertyInfos[data.index] = data |
|
|
|
this.data.propertyInfos[data.index] = data; |
|
|
|
this.setIndex() |
|
|
|
this.setIndex(); |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos)} |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos); |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//显示
|
|
|
|
//显示
|
|
|
|
visible(e) { |
|
|
|
visible(e) { |
|
|
|
this.data.propertyInfos[e].visible = true |
|
|
|
this.data.propertyInfos[e].visible = true; |
|
|
|
} |
|
|
|
} |
|
|
|
//隐藏
|
|
|
|
//隐藏
|
|
|
|
noVisible(e) { |
|
|
|
noVisible(e) { |
|
|
|
this.data.propertyInfos[e].visible = false |
|
|
|
this.data.propertyInfos[e].visible = false; |
|
|
|
} |
|
|
|
} |
|
|
|
//启用
|
|
|
|
//启用
|
|
|
|
enabled(e) { |
|
|
|
enabled(e) { |
|
|
|
this.data.propertyInfos[e].enabled = true |
|
|
|
this.data.propertyInfos[e].enabled = true; |
|
|
|
} |
|
|
|
} |
|
|
|
//禁用
|
|
|
|
//禁用
|
|
|
|
noEnabled(e) { |
|
|
|
noEnabled(e) { |
|
|
|
this.data.propertyInfos[e].enabled = false |
|
|
|
this.data.propertyInfos[e].enabled = false; |
|
|
|
} |
|
|
|
} |
|
|
|
//删除
|
|
|
|
//删除
|
|
|
|
delete(e) { |
|
|
|
delete(e) { |
|
|
|
let isTrue = confirm('您确定要删除吗') |
|
|
|
let isTrue = confirm("您确定要删除吗"); |
|
|
|
if (isTrue) { |
|
|
|
if (isTrue) { |
|
|
|
this.data.propertyInfos.splice(e,1) |
|
|
|
this.data.propertyInfos.splice(e, 1); |
|
|
|
this.setIndex() |
|
|
|
this.setIndex(); |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos) |
|
|
|
this.dataSource = new MatTableDataSource<any>(this.data.propertyInfos); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//原件属性保存
|
|
|
|
//原件属性保存
|
|
|
|
preservation() { |
|
|
|
preservation() { |
|
|
|
if (this.data.propertyInfos.length) { |
|
|
|
if (this.data.propertyInfos.length) { |
|
|
|
this.data.propertyInfos.forEach(item => { |
|
|
|
this.data.propertyInfos.forEach((item) => { |
|
|
|
delete item.index |
|
|
|
delete item.index; |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.submit() |
|
|
|
this.submit(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.submit() |
|
|
|
this.submit(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//提交保存
|
|
|
|
//提交保存
|
|
|
|
submit() { |
|
|
|
submit() { |
|
|
|
this.http.put(`/api/Assets/${this.data.id}`,{ |
|
|
|
this.http |
|
|
|
|
|
|
|
.put(`/api/Assets/${this.data.id}`, { |
|
|
|
id: this.data.id, |
|
|
|
id: this.data.id, |
|
|
|
name: this.data.name, |
|
|
|
name: this.data.name, |
|
|
|
width: this.data.width, |
|
|
|
width: this.data.width, |
|
|
@ -457,86 +485,85 @@ export class attributeComponent { |
|
|
|
order: this.data.order, |
|
|
|
order: this.data.order, |
|
|
|
enabled: this.data.enabled, |
|
|
|
enabled: this.data.enabled, |
|
|
|
propertyInfos: this.data.propertyInfos, |
|
|
|
propertyInfos: this.data.propertyInfos, |
|
|
|
fireElementId:this.data.fireElementId |
|
|
|
fireElementId: this.data.fireElementId, |
|
|
|
}).subscribe(data=>{ |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
|
|
|
this.dialogRef.close('success') |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
.subscribe((data) => { |
|
|
|
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
|
|
|
config.verticalPosition = "top"; |
|
|
|
|
|
|
|
config.duration = 3000; |
|
|
|
|
|
|
|
this.snackBar.open("保存成功", "确定", config); |
|
|
|
|
|
|
|
this.dialogRef.close("success"); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增属性弹窗
|
|
|
|
//新增属性弹窗
|
|
|
|
export interface Food { |
|
|
|
export interface Food { |
|
|
|
value: number; |
|
|
|
value: number; |
|
|
|
viewValue: string; |
|
|
|
viewValue: string; |
|
|
|
} |
|
|
|
} |
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-addAttribute', |
|
|
|
selector: "app-addAttribute", |
|
|
|
templateUrl: './addAttribute.html', |
|
|
|
templateUrl: "./addAttribute.html", |
|
|
|
styleUrls: ['./material-bank.component.scss'] |
|
|
|
styleUrls: ["./material-bank.component.scss"], |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class addAttributeComponent { |
|
|
|
export class addAttributeComponent { |
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog, |
|
|
|
private http: HttpClient, |
|
|
|
public dialogRef: MatDialogRef<addAttributeComponent>,) { } |
|
|
|
public dialog: MatDialog, |
|
|
|
|
|
|
|
public dialogRef: MatDialogRef<addAttributeComponent> |
|
|
|
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void {} |
|
|
|
ngOnInit(): void {} |
|
|
|
|
|
|
|
|
|
|
|
//定义属性数据
|
|
|
|
//定义属性数据
|
|
|
|
propertyType: Food[] = [ |
|
|
|
propertyType: Food[] = [ |
|
|
|
{value:0, viewValue: '单行文本'}, |
|
|
|
{ value: 0, viewValue: "单行文本" }, |
|
|
|
{value:1, viewValue: '多行文本'}, |
|
|
|
{ value: 1, viewValue: "多行文本" }, |
|
|
|
{value:2, viewValue: '数值'}, |
|
|
|
{ value: 2, viewValue: "数值" }, |
|
|
|
{value:3, viewValue: '图片'}, |
|
|
|
{ value: 3, viewValue: "图片" }, |
|
|
|
{value:4, viewValue: '图片数量'}, |
|
|
|
{ value: 4, viewValue: "图片数量" }, |
|
|
|
{value:5, viewValue: '方向'}, |
|
|
|
{ value: 5, viewValue: "方向" }, |
|
|
|
{value:6, viewValue: '布尔值'}, |
|
|
|
{ value: 6, viewValue: "布尔值" }, |
|
|
|
{value:7, viewValue: '供给区域'}, |
|
|
|
{ value: 7, viewValue: "供给区域" }, |
|
|
|
{value:8, viewValue: '供给类型'}] |
|
|
|
{ value: 8, viewValue: "供给类型" }, |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
//提交表单
|
|
|
|
//提交表单
|
|
|
|
onSubmit(e) { |
|
|
|
onSubmit(e) { |
|
|
|
e.order = 0 |
|
|
|
e.order = 0; |
|
|
|
e.enabled = true |
|
|
|
e.enabled = true; |
|
|
|
e.visible = true |
|
|
|
e.visible = true; |
|
|
|
e.required = e.required=='true'? true: false, |
|
|
|
(e.required = e.required == "true" ? true : false), this.dialogRef.close(e); |
|
|
|
this.dialogRef.close(e) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//编辑属性弹窗
|
|
|
|
//编辑属性弹窗
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-editAttribute', |
|
|
|
selector: "app-editAttribute", |
|
|
|
templateUrl: './editAttribute.html', |
|
|
|
templateUrl: "./editAttribute.html", |
|
|
|
styleUrls: ['./material-bank.component.scss'] |
|
|
|
styleUrls: ["./material-bank.component.scss"], |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class editAttribute { |
|
|
|
export class editAttribute { |
|
|
|
|
|
|
|
constructor( |
|
|
|
constructor(private http:HttpClient,public dialog: MatDialog, |
|
|
|
private http: HttpClient, |
|
|
|
|
|
|
|
public dialog: MatDialog, |
|
|
|
public dialogRef: MatDialogRef<editAttribute>, |
|
|
|
public dialogRef: MatDialogRef<editAttribute>, |
|
|
|
@Inject(MAT_DIALOG_DATA) public data,) { } |
|
|
|
@Inject(MAT_DIALOG_DATA) public data |
|
|
|
|
|
|
|
) {} |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.propertyName = this.data.propertyName |
|
|
|
this.propertyName = this.data.propertyName; |
|
|
|
this.propertyValue = this.data.propertyValue |
|
|
|
this.propertyValue = this.data.propertyValue; |
|
|
|
this.propertyType = this.data.propertyType |
|
|
|
this.propertyType = this.data.propertyType; |
|
|
|
this.required = String(this.data.required) |
|
|
|
this.required = String(this.data.required); |
|
|
|
this.ruleName = this.data.ruleName |
|
|
|
this.ruleName = this.data.ruleName; |
|
|
|
this.ruleValue = this.data.ruleValue |
|
|
|
this.ruleValue = this.data.ruleValue; |
|
|
|
this.physicalUnit = this.data.physicalUnit |
|
|
|
this.physicalUnit = this.data.physicalUnit; |
|
|
|
this.tag = this.data.tag} |
|
|
|
this.tag = this.data.tag; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
propertyName:any |
|
|
|
propertyName: any; |
|
|
|
propertyValue: any; |
|
|
|
propertyValue: any; |
|
|
|
propertyType: number; |
|
|
|
propertyType: number; |
|
|
|
required: any; |
|
|
|
required: any; |
|
|
@ -547,26 +574,23 @@ export class editAttribute { |
|
|
|
|
|
|
|
|
|
|
|
//定义属性数据
|
|
|
|
//定义属性数据
|
|
|
|
type: Food[] = [ |
|
|
|
type: Food[] = [ |
|
|
|
{value:0, viewValue: '单行文本'}, |
|
|
|
{ value: 0, viewValue: "单行文本" }, |
|
|
|
{value:1, viewValue: '多行文本'}, |
|
|
|
{ value: 1, viewValue: "多行文本" }, |
|
|
|
{value:2, viewValue: '数值'}, |
|
|
|
{ value: 2, viewValue: "数值" }, |
|
|
|
{value:3, viewValue: '图片'}, |
|
|
|
{ value: 3, viewValue: "图片" }, |
|
|
|
{value:4, viewValue: '图片数量'}, |
|
|
|
{ value: 4, viewValue: "图片数量" }, |
|
|
|
{value:5, viewValue: '方向'}, |
|
|
|
{ value: 5, viewValue: "方向" }, |
|
|
|
{value:6, viewValue: '布尔值'}, |
|
|
|
{ value: 6, viewValue: "布尔值" }, |
|
|
|
{value:7, viewValue: '供给区域'}, |
|
|
|
{ value: 7, viewValue: "供给区域" }, |
|
|
|
{value:8, viewValue: '供给类型'}] |
|
|
|
{ value: 8, viewValue: "供给类型" }, |
|
|
|
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
|
|
//提交表单
|
|
|
|
//提交表单
|
|
|
|
onSubmit(e) { |
|
|
|
onSubmit(e) { |
|
|
|
e.order = 0 |
|
|
|
e.order = 0; |
|
|
|
e.enabled = this.data.enabled |
|
|
|
e.enabled = this.data.enabled; |
|
|
|
e.visible = this.data.visible |
|
|
|
e.visible = this.data.visible; |
|
|
|
e.index = this.data.index |
|
|
|
e.index = this.data.index; |
|
|
|
e.required = e.required=='true'? true: false, |
|
|
|
(e.required = e.required == "true" ? true : false), this.dialogRef.close(e); |
|
|
|
this.dialogRef.close(e) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |