-
-
-
-
- {{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
-
-
+
+
+
+
+ {{ detailMode ? "查看详情" : dataForm.id ? "编辑" : "新增" }}
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
- {{ operate.label }}
-
- 取消
-
-
+
+
+
+ {{
+ operate.label
+ }}
+
+ 取消
+
+
diff --git a/src/components/noTemplateComponents/richInput.js b/src/components/noTemplateComponents/richInput.js
index d1da305..4b90362 100644
--- a/src/components/noTemplateComponents/richInput.js
+++ b/src/components/noTemplateComponents/richInput.js
@@ -1,2 +1,65 @@
+import Quill from "quill"
+import 'quill/dist/quill.snow.css'
+
// 富文本组件
-export default {}
\ No newline at end of file
+export default {
+ name: 'QuillRichInput',
+ props: ['readonly', 'placeholder', 'scroll']
+ ,
+ data() {
+ return {
+ ReadOnlyMode: false,
+ Placeholder: '',
+ ScrollingContainer: null
+ }
+ },
+ watch: {
+ readonly(val) {
+ this.ReadOnlyMode = val
+ },
+ placeholder(val) {
+ this.Placeholder = val
+ },
+ scroll(val) {
+ this.ScrollingContainer = val
+ }
+ },
+ mounted() {
+ console.log('[Quill Editor] ref:', this.$refs['quill-editor'])
+ /** https://blog.csdn.net/qq_36947168/article/details/119486710 */
+ /** https://quilljs.com/docs/modules/toolbar/ */
+ const toolbarOptions = [
+ [{ 'font': [] }],
+ [{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
+ ['bold', 'italic', 'underline', 'strike'], // toggled buttons
+ ['blockquote', 'code-block'],
+
+ [{ 'header': 1 }, { 'header': 2 }], // custom button values
+ [{ 'list': 'ordered'}, { 'list': 'bullet' }],
+ [{ 'script': 'sub'}, { 'script': 'super' }], // superscript/subscript
+ [{ 'indent': '-1'}, { 'indent': '+1' }], // outdent/indent
+ [{ 'direction': 'rtl' }], // text direction
+
+ [{ 'header': [1, 2, 3, 4, 5, 6, false] }],
+
+ [{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
+ [{ 'align': [] }],
+
+ ['clean'] // remove formatting button
+ ];
+ // const editor = new Quill(this.$refs['quill-editor'], this.defaultConfig)
+ const editor = new Quill(this.$refs['quill-editor'], {
+ modules: {
+ toolbar: toolbarOptions
+ },
+ theme: 'snow',
+ readOnly: this.ReadOnlyMode,
+ placeholder: this.Placeholder,
+ scrollingContainer: this.ScrollingContainer
+ })
+ },
+ methods: {},
+ render: function (h) {
+ return h('div', { ref: 'quill-editor', domProps: { id: 'quill-editor' } })
+ }
+}
\ No newline at end of file
diff --git a/src/views/atomViews/ListViewWithHead.vue b/src/views/atomViews/ListViewWithHead.vue
index a9bb19b..b9e9198 100644
--- a/src/views/atomViews/ListViewWithHead.vue
+++ b/src/views/atomViews/ListViewWithHead.vue
@@ -129,10 +129,17 @@ export default {
// page 场景:
if ("list" in res.data) {
// real env:
- this.dataList = res.data.list.map((item) => ({
- ...item,
- id: item._id ?? item.id,
- }));
+ this.dataList = res.data.list.map((item) => {
+ // if (item.parentId || item.parendName) { /** && 也行 */
+ // // 如果需要树形结构的列表
+ // return this.reConstructDataList(res.data.list)
+ // } else {
+ return {
+ ...item,
+ id: item._id ?? item.id,
+ };
+ // }
+ });
// this.dataList = res.data.records;
this.totalPage = res.data.total;
} else if ("records" in res.data) {
@@ -151,6 +158,11 @@ export default {
});
},
+ /** 针对树形结构的列表,进行服务器端返回的数据重排 */
+ reConstructDataList(list) {
+ // const parentIndex = list.forEach()
+ },
+
/** 处理 HeadForm 的操作 */
handleHeadformOperate(payload) {
// 查询,导出,导入,等等
diff --git a/src/views/modules/pms/car/config.js b/src/views/modules/pms/car/config.js
new file mode 100644
index 0000000..b3cfb9d
--- /dev/null
+++ b/src/views/modules/pms/car/config.js
@@ -0,0 +1,112 @@
+import TableOperaionComponent from "@/components/noTemplateComponents/operationComponent";
+import switchBtn from "@/components/noTemplateComponents/switchBtn";
+import QuillRichInput from "@/components/noTemplateComponents/richInput";
+import request from "@/utils/request";
+import { dictFilter } from '@/utils/filters'
+
+export default function () {
+ const tableProps = [
+ { prop: "name", label: "窑车号" },
+ { prop: "code", label: "编码" },
+ { prop: "typeDictValue", label: "过渡车", filter: val => ['否', '是'](val) },
+ { prop: "status", label: "状态", subcomponent: switchBtn }, // subcomponent
+ { prop: "currentQty", label: "载量" },
+ { prop: "currentPos", label: "当前位置" },
+ { prop: "description", label: "描述" },
+ { prop: "remark", label: "备注" },
+ {
+ prop: "operations",
+ name: "操作",
+ fixed: "right",
+ width: 120,
+ subcomponent: TableOperaionComponent,
+ options: ["edit", { name: "delete", permission: "pms:car:delete" }],
+ },
+ ];
+
+ const headFormFields = [
+ {
+ prop: 'name',
+ label: "窑车号",
+ input: true,
+ default: { value: "" },
+ bind: {
+ // placeholder: '请输入产线名称或编码'
+ placeholder: '请输入料仓名称'
+ }
+ },
+ {
+ button: {
+ type: "primary",
+ name: "查询",
+ },
+ },
+ {
+ button: {
+ type: "primary",
+ name: "新增",
+ permission: "pms:materialStorage:save"
+ },
+ bind: {
+ plain: true,
+ }
+ },
+ ];
+
+ /**
+ * dialog config 有两个版本,一个适用于 DialogWithMenu 组件,另一个适用于 DialogJustForm 组件
+ * 适用于 DialogWithMenu 组件的配置示例详见 blenderStep/config.js
+ * 此为后者的配置:
+ */
+ const dialogJustFormConfigs = {
+ clickModalToClose: false,
+ form: {
+ rows: [
+ [
+ {
+ input: true,
+ label: "窑车号",
+ prop: "name",
+ rules: { required: true, message: "not empty", trigger: "blur" },
+ elparams: { placeholder: "请输入窑车号" },
+ },
+ {
+ input: true,
+ label: "编码",
+ prop: "code",
+ rules: { required: true, message: "not empty", trigger: "blur" },
+ elparams: { placeholder: "请输入料仓编码" },
+ },
+ ],
+ [{ component: QuillRichInput, label: "描述信息", prop: "description" }],
+ [{ input: true, label: "备注", prop: "remark", elparams: { placeholder: "备注" } }],
+ ],
+ operations: [
+ { name: "add", label: "保存", type: "primary", permission: "pms:car:save", showOnEdit: false },
+ { name: "update", label: "更新", type: "primary", permission: "pms:car: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/car",
+ page: "/pms/car/page",
+ // subase: '/pms/blenderStepParam',
+ // subpage: '/pms/blenderStepParam/page',
+ // more...
+ },
+ };
+}
diff --git a/src/views/modules/pms/car/index.vue b/src/views/modules/pms/car/index.vue
new file mode 100644
index 0000000..da21189
--- /dev/null
+++ b/src/views/modules/pms/car/index.vue
@@ -0,0 +1,32 @@
+