update scroll effect

This commit is contained in:
lb 2023-03-10 15:14:55 +08:00
parent 1e6cb676aa
commit c4b8a642ea
5 changed files with 25 additions and 20 deletions

View File

@ -72,7 +72,7 @@ export default {
created() {}, created() {},
mounted() { 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) => { this.headConfig.fields.forEach((field, index) => {
// field.prop // field.prop

View File

@ -81,7 +81,7 @@
<script> <script>
import { pick as __pick } from "@/utils/filters"; import { pick as __pick } from "@/utils/filters";
import Cookies, { get } from "js-cookie"; import Cookies from "js-cookie";
import moment from "moment"; import moment from "moment";
export default { export default {
@ -112,7 +112,7 @@ export default {
if (col.fetchData) if (col.fetchData)
col.fetchData().then(({ data: res }) => { 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 (res.code === 0 && res.data.list) {
if ("injectTo" in col) { if ("injectTo" in col) {
// //
@ -136,7 +136,7 @@ export default {
else if (col.fetchTreeData) { else if (col.fetchTreeData) {
// parentId 0 // parentId 0
col.fetchTreeData().then(({ data: res }) => { col.fetchTreeData().then(({ data: res }) => {
console.log("[DialogJustForm fetchTreeData -->]", res.data); // console.log("[DialogJustForm fetchTreeData -->]", res.data);
if (res.code === 0 && res.data) { if (res.code === 0 && res.data) {
if ("list" in res.data) { if ("list" in res.data) {
this.$set(col, "options", res.data.list); this.$set(col, "options", res.data.list);
@ -165,7 +165,7 @@ export default {
this.configs.form.rows.forEach((row) => { this.configs.form.rows.forEach((row) => {
row.forEach((col) => { row.forEach((col) => {
if ("injectTo" in col && Array.isArray(col.injectTo)) { if ("injectTo" in col && Array.isArray(col.injectTo)) {
console.log("watching options ..... ", col); // console.log("watching options ..... ", col);
col.injectTo.map((item) => { col.injectTo.map((item) => {
const unwatch = this.$watch( const unwatch = this.$watch(
() => this.dataForm[col.prop], () => this.dataForm[col.prop],
@ -230,7 +230,7 @@ export default {
if (excludeId && key === "id") return; if (excludeId && key === "id") return;
this.dataForm[key] = null; this.dataForm[key] = null;
}); });
console.log("[DialogJustForm resetForm()] clearing form..."); // console.log("[DialogJustForm resetForm()] clearing form...");
this.$refs.dataForm.clearValidate(); this.$refs.dataForm.clearValidate();
this.$emit("dialog-closed"); // this.$emit("dialog-closed"); //
this.watchList.map((unwatch) => unwatch()); this.watchList.map((unwatch) => unwatch());
@ -304,17 +304,17 @@ export default {
}, },
handleSwitchChange(val) { handleSwitchChange(val) {
console.log("[dialog] switch change: ", val, this.dataForm); // console.log("[dialog] switch change: ", val, this.dataForm);
}, },
handleComponentModelUpdate(propName, { subject, payload: { data } }) { handleComponentModelUpdate(propName, { subject, payload: { data } }) {
this.dataForm[propName] = JSON.stringify(data); this.dataForm[propName] = JSON.stringify(data);
console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]); // console.log("[DialogJustForm] handleComponentModelUpdate", this.dataForm[propName]);
}, },
addOrUpdate(method = "POST") { addOrUpdate(method = "POST") {
if ("parentId" in this.dataForm) { if ("parentId" in this.dataForm) {
console.log("[DialogJustForm parentId]", this.dataForm.parentId); // console.log("[DialogJustForm parentId]", this.dataForm.parentId);
// parentId cascader ["xxx"]xxx // parentId cascader ["xxx"]xxx
const lastItem = this.dataForm.parentId.length - 1; const lastItem = this.dataForm.parentId.length - 1;
this.dataForm.parentId = this.dataForm.parentId[lastItem]; this.dataForm.parentId = this.dataForm.parentId[lastItem];
@ -369,7 +369,7 @@ export default {
data: httpPayload, data: httpPayload,
}) })
.then(({ data: res }) => { .then(({ data: res }) => {
console.log("[add&update] res is: ", res); // console.log("[add&update] res is: ", res);
this.loadingStatus = false; this.loadingStatus = false;
if (res.code === 0) { if (res.code === 0) {
this.$message.success(method === "POST" ? "添加成功" : "更新成功"); this.$message.success(method === "POST" ? "添加成功" : "更新成功");
@ -394,7 +394,7 @@ export default {
}, },
handleBtnClick(payload) { handleBtnClick(payload) {
console.log("btn click payload: ", payload); // console.log("btn click payload: ", payload);
if ("name" in payload) { if ("name" in payload) {
switch (payload.name) { switch (payload.name) {
@ -415,7 +415,7 @@ export default {
}, },
handleUploadChange(file, fileList) { handleUploadChange(file, fileList) {
console.log("[Upload] handleUploadChange...", file, fileList); // console.log("[Upload] handleUploadChange...", file, fileList);
}, },
handleClose() { handleClose() {

View File

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

View File

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

View File

@ -1,9 +1,9 @@
<template> <template>
<div class="main-container"> <div class="main-container">
<div class="inner-sidebar"> <div class="inner-sidebar">
<a href="#ongoing" :class="{ active: activeTable === '#ongoing' }">进行中的订单</a> <a href="#ongoing" :class="{ active: activeTable === '#ongoing' }" @click.prevent="scrollTo('#ongoing')">进行中的订单</a>
<a href="#pending" :class="{ active: activeTable === '#pending' }">等待订单</a> <a href="#pending" :class="{ active: activeTable === '#pending' }" @click.prevent="scrollTo('#pending')">等待订单</a>
<a href="#finished" :class="{ active: activeTable === '#finished' }">完成订单</a> <a href="#finished" :class="{ active: activeTable === '#finished' }" @click.prevent="scrollTo('#finished')">完成订单</a>
</div> </div>
<div class="list-view-with-head-list"> <div class="list-view-with-head-list">
@ -103,6 +103,13 @@ export default {
}, },
}, },
methods: { methods: {
scrollTo(pos) {
const el = document.querySelector(pos)
window.scrollTo({
top: el.offsetTop - 16,
behavior: 'smooth'
})
},
// handleUp({ $index, row }) { // handleUp({ $index, row }) {
// console.log("row: ", $index, row); // console.log("row: ", $index, row);
// if ($index === 0) return; // if ($index === 0) return;