update scroll effect
This commit is contained in:
parent
1e6cb676aa
commit
c4b8a642ea
@ -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 ,则为按钮之类的
|
||||||
|
@ -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() {
|
||||||
|
@ -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);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -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 },
|
||||||
},
|
},
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user