Quellcode durchsuchen

update scroll effect

docs_0727
lb vor 1 Jahr
Ursprung
Commit
c4b8a642ea
5 geänderte Dateien mit 25 neuen und 20 gelöschten Zeilen
  1. +1
    -1
      src/views/modules/pms/order/components/BaseSearchForm.vue
  2. +11
    -11
      src/views/modules/pms/order/components/DialogJustForm.vue
  3. +1
    -1
      src/views/modules/pms/order/components/ListSectionWithHead.vue
  4. +2
    -4
      src/views/modules/pms/order/config.js
  5. +10
    -3
      src/views/modules/pms/order/index.vue

+ 1
- 1
src/views/modules/pms/order/components/BaseSearchForm.vue Datei anzeigen

@@ -72,7 +72,7 @@ export default {

created() {},
mounted() {
console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));
// console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));

this.headConfig.fields.forEach((field, index) => {
// 没有 field.prop ,则为按钮之类的


+ 11
- 11
src/views/modules/pms/order/components/DialogJustForm.vue Datei anzeigen

@@ -81,7 +81,7 @@

<script>
import { pick as __pick } from "@/utils/filters";
import Cookies, { get } from "js-cookie";
import Cookies from "js-cookie";
import moment from "moment";

export default {
@@ -112,7 +112,7 @@ export default {

if (col.fetchData)
col.fetchData().then(({ data: res }) => {
console.log("[DialogJustForm fetchData -->]", res.data.list);
// console.log("[DialogJustForm fetchData -->]", res.data.list);
if (res.code === 0 && res.data.list) {
if ("injectTo" in col) {
// 保存完整的数据列表
@@ -136,7 +136,7 @@ export default {
else if (col.fetchTreeData) {
// 获取设备类型时触发的,用于前端构建属性结构,约定,parentId 为0时是顶级节点
col.fetchTreeData().then(({ data: res }) => {
console.log("[DialogJustForm fetchTreeData -->]", res.data);
// console.log("[DialogJustForm fetchTreeData -->]", res.data);
if (res.code === 0 && res.data) {
if ("list" in res.data) {
this.$set(col, "options", res.data.list);
@@ -165,7 +165,7 @@ export default {
this.configs.form.rows.forEach((row) => {
row.forEach((col) => {
if ("injectTo" in col && Array.isArray(col.injectTo)) {
console.log("watching options ..... ", col);
// console.log("watching options ..... ", col);
col.injectTo.map((item) => {
const unwatch = this.$watch(
() => this.dataForm[col.prop],
@@ -230,7 +230,7 @@ export default {
if (excludeId && key === "id") return;
this.dataForm[key] = null;
});
console.log("[DialogJustForm resetForm()] clearing form...");
// console.log("[DialogJustForm resetForm()] clearing form...");
this.$refs.dataForm.clearValidate();
this.$emit("dialog-closed"); // 触发父组件销毁自己
this.watchList.map((unwatch) => unwatch());
@@ -304,17 +304,17 @@ export default {
},

handleSwitchChange(val) {
console.log("[dialog] switch change: ", val, this.dataForm);
// console.log("[dialog] switch change: ", val, this.dataForm);
},

handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
// console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
},

addOrUpdate(method = "POST") {
if ("parentId" in this.dataForm) {
console.log("[DialogJustForm parentId]", this.dataForm.parentId);
// console.log("[DialogJustForm parentId]", this.dataForm.parentId);
// 对特殊的键做特殊处理,如 parentId 是一个 cascader,获取的值是 ["xxx"],后端只需要xxx
const lastItem = this.dataForm.parentId.length - 1;
this.dataForm.parentId = this.dataForm.parentId[lastItem];
@@ -369,7 +369,7 @@ export default {
data: httpPayload,
})
.then(({ data: res }) => {
console.log("[add&update] res is: ", res);
// console.log("[add&update] res is: ", res);
this.loadingStatus = false;
if (res.code === 0) {
this.$message.success(method === "POST" ? "添加成功" : "更新成功");
@@ -394,7 +394,7 @@ export default {
},

handleBtnClick(payload) {
console.log("btn click payload: ", payload);
// console.log("btn click payload: ", payload);

if ("name" in payload) {
switch (payload.name) {
@@ -415,7 +415,7 @@ export default {
},

handleUploadChange(file, fileList) {
console.log("[Upload] handleUploadChange...", file, fileList);
// console.log("[Upload] handleUploadChange...", file, fileList);
},

handleClose() {


+ 1
- 1
src/views/modules/pms/order/components/ListSectionWithHead.vue Datei anzeigen

@@ -335,7 +335,7 @@ export default {
this.renderDialog = true;
this.$nextTick(() => {
console.log("init dialog", row_id, detail_mode);
// console.log("init dialog", row_id, detail_mode);
this.$refs["order-dialog"].init(/** some args... */ row_id, detail_mode);
});
},


+ 2
- 4
src/views/modules/pms/order/config.js Datei anzeigen

@@ -188,10 +188,6 @@ export default function () {
orderStatusMap: ["等待", "确认", "生产", "暂停", "结束", "接受", "拒绝"],
};
},
methods: {},
mounted() {
console.log("this.modelValue", this.modelValue);
},
render: function (h) {
return h(
"span",
@@ -320,6 +316,7 @@ export default function () {
prop: "press",
options: [],
optionLabel: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
fetchData: () => this.$http.get("/pms/equipment/page", { params: { limit: 999, page: 1, name: "" } }),
elparams: { placeholder: "请选择压机号", filterable: true },
},
@@ -368,6 +365,7 @@ export default function () {
prop: "blender",
options: [],
optionLabel: "code",
rules: { required: true, message: "必填项不能为空", trigger: "blur" },
fetchData: () => this.$http.get("/pms/equipment/page", { params: { limit: 999, page: 1, name: "" } }),
elparams: { placeholder: "请选择混料机号", filterable: true },
},


+ 10
- 3
src/views/modules/pms/order/index.vue Datei anzeigen

@@ -1,9 +1,9 @@
<template>
<div class="main-container">
<div class="inner-sidebar">
<a href="#ongoing" :class="{ active: activeTable === '#ongoing' }">进行中的订单</a>
<a href="#pending" :class="{ active: activeTable === '#pending' }">等待订单</a>
<a href="#finished" :class="{ active: activeTable === '#finished' }">完成订单</a>
<a href="#ongoing" :class="{ active: activeTable === '#ongoing' }" @click.prevent="scrollTo('#ongoing')">进行中的订单</a>
<a href="#pending" :class="{ active: activeTable === '#pending' }" @click.prevent="scrollTo('#pending')">等待订单</a>
<a href="#finished" :class="{ active: activeTable === '#finished' }" @click.prevent="scrollTo('#finished')">完成订单</a>
</div>

<div class="list-view-with-head-list">
@@ -103,6 +103,13 @@ export default {
},
},
methods: {
scrollTo(pos) {
const el = document.querySelector(pos)
window.scrollTo({
top: el.offsetTop - 16,
behavior: 'smooth'
})
},
// handleUp({ $index, row }) {
// console.log("row: ", $index, row);
// if ($index === 0) return;


Laden…
Abbrechen
Speichern