add techBox & fix bugs 0720
This commit is contained in:
父節點
c6504f0d3d
當前提交
ab24d8b558
30
src/components/noTemplateComponents/techBox.js
Normal file
30
src/components/noTemplateComponents/techBox.js
Normal file
@ -0,0 +1,30 @@
|
||||
export default {
|
||||
name: "TechBox",
|
||||
props: ["injectData"],
|
||||
data() {
|
||||
return {
|
||||
prop: this.injectData.head.prop,
|
||||
};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
const value = this.injectData[this.prop];
|
||||
return h(
|
||||
"span",
|
||||
{
|
||||
style: {
|
||||
backgroundColor: value ? "#a5e24bdb" : "#ff000066",
|
||||
position: "absolute",
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
padding: '0 10px',
|
||||
lineHeight: "2.1125",
|
||||
// TODO: 这块的 lineHeight 可以进一步精调,或采用translate将文本居中,以应对浏览器缩放至 33% 比例及以下的情况
|
||||
},
|
||||
},
|
||||
value
|
||||
);
|
||||
},
|
||||
};
|
@ -2,13 +2,15 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationC
|
||||
import TableTextComponent from "@/components/noTemplateComponents/detailComponent";
|
||||
import { timeFilter, dictFilter } from "@/utils/filters";
|
||||
// import switchBtn from "@/components/noTemplateComponents/switchBtn";
|
||||
import techBox from "@/components/noTemplateComponents/techBox";
|
||||
|
||||
export default function () {
|
||||
const tableProps = [
|
||||
{ type: "index", label: "序号" },
|
||||
{ prop: "code", label: "配方号" },
|
||||
{ prop: "name", label: "牌号" },
|
||||
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
||||
{ prop: "syncTime", label: "同步时间", filter: timeFilter },
|
||||
{ prop: "techCode", label: "烧制曲线", subcomponent: techBox },
|
||||
// { prop: "externalCode", label: "版本号" },
|
||||
// { prop: "specifications", label: "程序号" },
|
||||
// { prop: "unitDictValue", label: "砖型", filter: dictFilter("unit") },
|
||||
|
@ -2,7 +2,8 @@ import TableOperaionComponent from "@/components/noTemplateComponents/operationC
|
||||
import TableTextComponent from "@/components/noTemplateComponents/detailComponent";
|
||||
import request from "@/utils/request";
|
||||
import { timeFilter, dictFilter } from "@/utils/filters";
|
||||
import { getDictDataList } from '@/utils'
|
||||
import { getDictDataList } from "@/utils";
|
||||
import techBox from "@/components/noTemplateComponents/techBox";
|
||||
|
||||
export default function () {
|
||||
const tableProps = [
|
||||
@ -10,19 +11,30 @@ export default function () {
|
||||
{ prop: "name", label: "砖型名称" },
|
||||
{ prop: "code", label: "砖型编码" },
|
||||
{ prop: "externalCode", label: "砖型ID" },
|
||||
{ prop: "line", label: "中心线颜色", filter: dictFilter('line') },
|
||||
{ prop: "line", label: "中心线颜色", filter: dictFilter("line") },
|
||||
{ prop: "tequipmentTechCode1", label: "压制工艺", subcomponent: techBox },
|
||||
{ prop: "tequipmentTechCode2", label: "检测工艺", subcomponent: techBox },
|
||||
{ prop: "description", label: "长描述" },
|
||||
{ prop: "shortDesc", label: "短描述" },
|
||||
{ prop: "remark", label: "备注" },
|
||||
{ prop: "toggle-attachment-dialog", label: "查看附件", actionName: 'toggle-attachment-dialog', buttonContent: '查看附件', subcomponent: TableTextComponent },
|
||||
{ prop: "createTime", label: "添加时间", filter: timeFilter },
|
||||
{
|
||||
prop: "toggle-attachment-dialog",
|
||||
label: "查看附件",
|
||||
actionName: "toggle-attachment-dialog",
|
||||
buttonContent: "查看附件",
|
||||
subcomponent: TableTextComponent,
|
||||
},
|
||||
// { prop: "createTime", label: "添加时间", filter: timeFilter },
|
||||
{
|
||||
prop: "operations",
|
||||
name: "操作",
|
||||
fixed: "right",
|
||||
width: 90,
|
||||
subcomponent: TableOperaionComponent,
|
||||
options: [{ name: "edit", label: "编辑", icon: "edit-outline" }, { name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:shape:delete" }],
|
||||
options: [
|
||||
{ name: "edit", label: "编辑", icon: "edit-outline" },
|
||||
{ name: "delete", icon: "delete", label: "删除", emitFull: true, permission: "pms:shape:delete" },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@ -104,7 +116,7 @@ export default function () {
|
||||
input: true,
|
||||
label: "砖型ID",
|
||||
prop: "externalCode",
|
||||
rules: [{ type: 'number', trigger: "blur", message: "请输入数字类型", transform: val => Number(val) }],
|
||||
rules: [{ type: "number", trigger: "blur", message: "请输入数字类型", transform: (val) => Number(val) }],
|
||||
elparams: { placeholder: "外部编码" },
|
||||
},
|
||||
{ input: true, label: "短描述", prop: "shortDesc", elparams: { placeholder: "短描述" } },
|
||||
@ -114,16 +126,16 @@ export default function () {
|
||||
select: true,
|
||||
label: "中心线颜色",
|
||||
prop: "line",
|
||||
options: getDictDataList('line').map(_ => ({ label: _.dictLabel, value: _.dictValue })),
|
||||
options: getDictDataList("line").map((_) => ({ label: _.dictLabel, value: _.dictValue })),
|
||||
rules: { required: true, message: "必填项不能为空", trigger: "change" },
|
||||
},
|
||||
{
|
||||
upload: true,
|
||||
actionUrl: window.SITE_CONFIG['apiURL'] + '/pms/attachment/uploadFileFormData?typeCode=shape',
|
||||
actionUrl: window.SITE_CONFIG["apiURL"] + "/pms/attachment/uploadFileFormData?typeCode=shape",
|
||||
label: "上传资料",
|
||||
prop: "files",
|
||||
elparams: null
|
||||
}
|
||||
elparams: null,
|
||||
},
|
||||
],
|
||||
[{ textarea: true, label: "描述", prop: "description", elparams: { placeholder: "描述" } }],
|
||||
[{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
|
||||
|
載入中…
新增問題並參考
Block a user