@ctsy/template
v0.0.162
Published
# 配置目录参数
Downloads
109
Readme
碳素云后台模板库
配置目录参数
// export class MenuConfig {
// BackgroundColor: string = "none"
// TextColor = "#fff"
// ActiveTextColor = "#ffd04b"
// }
Store.commit("set_menu_config", {
BackgroundColor: "#111",
TextColor: "white",
ActiveTextColor: "#ffd04b",
});
使用外键关联
注册外键接口数据
Store.dispatch("set_foreign_config", {
Code: "Family",
Search: MasterApi.FamilyApi.search.bind(MasterApi.FamilyApi),
All: false,
PK: "FID",
L: [],
Value: 0,
});
使用外键数据
new Ctsy.ViewConfigFields({
Name: "计费方案",
Code: "BGID",
Desc: "",
Column: {
width: 70,
fixed: "left",
},
Type: Ctsy.ViewConfigFieldsType.ForeignTableAll,
Default: 0,
Show: new Ctsy.ViewConfigFieldsShow(),
Foreign: Object.assign(new Ctsy.ViewConfig(), {
Name: "计费方案",
Code: "BillingGroup",
PK: "BGID",
Title: "Title",
Format: (v: any) => {
// console.log(v);
return `${v.Title}(${v.Price})`;
},
Fields: [
new Ctsy.ViewConfigFields({
Name: "名称",
Code: "Title",
}),
new Ctsy.ViewConfigFields({
Name: "单价",
Code: "Price",
}),
// new Ctsy.ViewConfigFields({
// Name: "生效时间",
// Code: "STime"
// }),
// new Ctsy.ViewConfigFields({
// Name: "失效时间",
// Code: "ETime"
// })
],
// Search: MasterApi.BillingGroupApi.search.bind(
// MasterApi.BillingGroupApi
// ),
}),
}),