From 96861954b20822fb8c703eab9d8b8a8f6f2352a6 Mon Sep 17 00:00:00 2001 From: lb Date: Mon, 6 Mar 2023 09:47:35 +0800 Subject: [PATCH] add reportSheet and reportSheetCategory & update common.scss --- src/assets/scss/common.scss | 26 +++- src/views/modules/pms/reportSheet/config.js | 131 ++++++++++++++++++ src/views/modules/pms/reportSheet/index.vue | 32 +++++ .../modules/pms/reportSheetCategory/index.vue | 27 ++++ 4 files changed, 211 insertions(+), 5 deletions(-) create mode 100644 src/views/modules/pms/reportSheet/config.js create mode 100644 src/views/modules/pms/reportSheet/index.vue create mode 100644 src/views/modules/pms/reportSheetCategory/index.vue diff --git a/src/assets/scss/common.scss b/src/assets/scss/common.scss index 2596b03..583ee35 100644 --- a/src/assets/scss/common.scss +++ b/src/assets/scss/common.scss @@ -4,8 +4,7 @@ box-sizing: border-box; } body { - font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", - "微软雅黑", Arial, sans-serif; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; font-size: $--font-size-base; line-height: $base--line-height; color: $--color-text-primary; @@ -474,7 +473,7 @@ img { &:hover { color: #fff; background-color: rgba(11, 88, 255, 1); - .aui-sidebar__menu-icon-son{ + .aui-sidebar__menu-icon-son { background: #fff; border-radius: 4px; } @@ -604,13 +603,30 @@ img { padding: 0 10px; color: rgba(89, 89, 89, 1); &:focus, - &:hover, - &.is-active { + &:hover { &:after { display: block; } + > .el-icon-close { + color: rgba(89, 89, 89, 1); + + &:hover { + color: rgba(255, 255, 255, 1); + background-color: rgba(89, 89, 89, 1);; + } + } + } + + &.is-active { + &:after { + display: none; + } > .el-icon-close { color: rgba(255, 255, 255, 1); + + &:hover { + background-color: #0b58ff; + } } } &:after { diff --git a/src/views/modules/pms/reportSheet/config.js b/src/views/modules/pms/reportSheet/config.js new file mode 100644 index 0000000..17e4487 --- /dev/null +++ b/src/views/modules/pms/reportSheet/config.js @@ -0,0 +1,131 @@ +import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent"; +import switchBtn from "@/components/noTemplateComponents/switchBtn"; +import request from "@/utils/request"; +import { timeFilter } from '@/utils/filters' + +export default function () { + const tableProps = [ + { type: 'index', label: '序号' }, + { prop: "createTime", label: "添加时间", filter: timeFilter }, + { prop: "name", label: "报表名称" }, + { prop: "code", label: "报表分类" }, + // { prop: "factory", label: "所属工厂" }, + // { prop: "status", label: "产线状态", subcomponent: switchBtn }, // subcomponent + // TODO: 2023.2.3 产线状态切换功能不生效 + // { prop: "tvalue", label: "每小时下片数量" }, + // { prop: "description", label: "描述" }, + // { prop: "remark", label: "备注" }, + { + prop: "operations", + name: "操作", + fixed: "right", + width: 120, + subcomponent: TableOperaionComponent, + options: ["edit", { name: "delete", emitFull: true, permission: "pms:productionLine:delete" }], + }, + ]; + + const headFormFields = [ + { + prop: 'key', + label: "产线名称/编码", + input: true, + default: { value: "" }, + bind: { + placeholder: '请输入产线名称或编码' + } + }, + { + button: { + type: "primary", + name: "查询", + }, + }, + { + button: { + type: "primary", + name: "新增", + permission: "pms:productionLine:save" + }, + bind: { + plain: true, + } + }, + ]; + + /** + * dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件 + * 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js + * 此为后者的配置: + */ + const dialogJustFormConfigs = { + form: { + rows: [ + [ + { + input: true, + label: "产线名称", + prop: "name", + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { placeholder: "请输入产线名称" }, + }, + { + input: true, + label: "产线编码", + prop: "code", + rules: { required: true, message: "必填项不能为空", trigger: "blur" }, + elparams: { placeholder: "请输入产线编码" }, + }, + { + select: true, + label: "所属工厂", + prop: "factoryId", + fetchData: () => this.$http.get("/pms/factory/page", { params: { limit: 999, page: 1 } }), + option: [], + rules: { required: true, message: "必填项不能为空", trigger: "change" }, + }, + ], + // [ + // { + // input: true, + // label: "产线TT值", + // prop: "tvalue", + // rules: [ + // { required: true, message: "必填项不能为空", trigger: "blur" }, + // { type: "number", message: "数字", trigger: "blur", transform: (val) => Number(val) }, + // ], + // elparams: { placeholder: "设定TT值(每小时下片数量)" }, + // }, + // ], + [{ textarea: true, label: "描述信息", prop: "description", elparams: { placeholder: "描述信息" } }], + [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }], + ], + operations: [ + { name: "add", label: "保存", type: "primary", permission: "pms:productionLine:save", showOnEdit: false }, + { name: "update", label: "更新", type: "primary", permission: "pms:productionLine:update", showOnEdit: true }, + { name: "reset", label: "重置", type: "warning", showAlways: true }, + // { name: 'cancel', label: '取消', showAlways: true }, + ], + }, + }; + // 备注:弹窗弹出的时间和网速有关...... + + return { + dialogConfigs: dialogJustFormConfigs, + tableConfig: { + table: null, // 此处可省略,el-table 上的配置项 + column: tableProps, // el-column-item 上的配置项 + }, + headFormConfigs: { + rules: null, // 名称是由 BaseSearchForm.vue 组件固定的 + fields: headFormFields, // 名称是由 BaseSearchForm.vue 组件固定的 + }, + urls: { + base: "/pms/productionLine", + page: "/pms/productionLine/page", + // subase: '/pms/blenderStepParam', + // subpage: '/pms/blenderStepParam/page', + // more... + }, + }; +} diff --git a/src/views/modules/pms/reportSheet/index.vue b/src/views/modules/pms/reportSheet/index.vue new file mode 100644 index 0000000..1849dd7 --- /dev/null +++ b/src/views/modules/pms/reportSheet/index.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/src/views/modules/pms/reportSheetCategory/index.vue b/src/views/modules/pms/reportSheetCategory/index.vue new file mode 100644 index 0000000..54b1a19 --- /dev/null +++ b/src/views/modules/pms/reportSheetCategory/index.vue @@ -0,0 +1,27 @@ + + + + +