样式修改,页面组件修改

master
lzq 2026-01-14 16:48:08 +08:00
parent a22ec0b05f
commit 3da8974001
52 changed files with 3193 additions and 3879 deletions

View File

@ -1,3 +1,5 @@
# 应用名称
VITE_APP_NAME=(开发环境)再昇云收运处平台
# 后台服务地址
# VITE_HTTP_PROXY_TARGET=http://localhost:10086
# VITE_HTTP_PROXY_TARGET=http://192.168.2.124:10086

34
package-lock.json generated
View File

@ -31,6 +31,7 @@
"colorette": "^2.0.20",
"fflate": "^0.8.2",
"filesize": "^11.0.2",
"sass": "^1.97.2",
"stylus": "^0.64.0",
"typescript": "~5.8.3",
"typescript-plugin-css-modules": "^5.2.0",
@ -39,6 +40,7 @@
"unplugin-vue-components": "^29.0.0",
"vite": "^7.1.2",
"vite-plugin-vue-devtools": "^8.0.1",
"vue-component-type-helpers": "^3.2.2",
"vue-tsc": "^3.0.5"
}
},
@ -80,6 +82,7 @@
"integrity": "sha512-e7jT4DxYvIDLk1ZHmU/m/mB19rex9sv0c2ftBtjSBv+kVM/902eh0fINUzD7UwLLNR+jU585GxUJ8/EBfAM5fw==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@babel/code-frame": "^7.27.1",
"@babel/generator": "^7.28.5",
@ -1062,6 +1065,7 @@
"integrity": "sha512-lLt8KLHyl7IClc3RqRpRikz15eCfTRlAWL9leVzPyg5N87FfKE/7EWgWvpiL/z4Tf3dQCIqQb88TmHE0JTIDvA==",
"devOptional": true,
"license": "MIT",
"peer": true,
"dependencies": {
"c12": "^3.3.1",
"consola": "^3.4.2",
@ -1773,6 +1777,7 @@
"resolved": "https://registry.npmjs.org/@types/lodash-es/-/lodash-es-4.17.12.tgz",
"integrity": "sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==",
"license": "MIT",
"peer": true,
"dependencies": {
"@types/lodash": "*"
}
@ -1790,6 +1795,7 @@
"integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"undici-types": "~7.16.0"
}
@ -2443,6 +2449,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"baseline-browser-mapping": "^2.8.25",
"caniuse-lite": "^1.0.30001754",
@ -3740,13 +3747,15 @@
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-es": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz",
"integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==",
"license": "MIT"
"license": "MIT",
"peer": true
},
"node_modules/lodash-unified": {
"version": "1.0.3",
@ -4243,6 +4252,7 @@
"resolved": "https://registry.npmjs.org/pinia/-/pinia-3.0.4.tgz",
"integrity": "sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw==",
"license": "MIT",
"peer": true,
"dependencies": {
"@vue/devtools-api": "^7.7.7"
},
@ -4315,6 +4325,7 @@
}
],
"license": "MIT",
"peer": true,
"dependencies": {
"nanoid": "^3.3.11",
"picocolors": "^1.1.1",
@ -4598,9 +4609,9 @@
"optional": true
},
"node_modules/sass": {
"version": "1.94.2",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.94.2.tgz",
"integrity": "sha512-N+7WK20/wOr7CzA2snJcUSSNTCzeCGUTFY3OgeQP3mZ1aj9NMQ0mSTXwlrnd89j33zzQJGqIN52GIOmYrfq46A==",
"version": "1.97.2",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.97.2.tgz",
"integrity": "sha512-y5LWb0IlbO4e97Zr7c3mlpabcbBtS+ieiZ9iwDooShpFKWXf62zz5pEPdwrLYm+Bxn1fnbwFGzHuCLSA9tBmrw==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -4933,6 +4944,7 @@
"integrity": "sha512-ZIdT8eUv8tegmqy1tTIdJv9We2DumkNZFdCF5mz/Kpq3OcTaxSuCAYZge6HKK2CmNC02G1eJig2RV7XTw5hQrA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"@adobe/css-tools": "~4.3.3",
"debug": "^4.3.2",
@ -5013,6 +5025,7 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"devOptional": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
@ -5070,6 +5083,7 @@
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"devOptional": true,
"license": "Apache-2.0",
"peer": true,
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
@ -5532,6 +5546,7 @@
"integrity": "sha512-NL8jTlbo0Tn4dUEXEsUg8KeyG/Lkmc4Fnzb8JXN/Ykm9G4HNImjtABMJgkQoVjOBN/j2WAwDTRytdqJbZsah7w==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
"esbuild": "^0.25.0",
"fdir": "^6.5.0",
@ -5822,6 +5837,7 @@
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
"dev": true,
"license": "MIT",
"peer": true,
"engines": {
"node": ">=12"
},
@ -5841,6 +5857,7 @@
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.25.tgz",
"integrity": "sha512-YLVdgv2K13WJ6n+kD5owehKtEXwdwXuj2TTyJMsO7pSeKw2bfRNZGjhB7YzrpbMYj5b5QsUebHpOqR3R3ziy/g==",
"license": "MIT",
"peer": true,
"dependencies": {
"@vue/compiler-dom": "3.5.25",
"@vue/compiler-sfc": "3.5.25",
@ -5857,6 +5874,13 @@
}
}
},
"node_modules/vue-component-type-helpers": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/vue-component-type-helpers/-/vue-component-type-helpers-3.2.2.tgz",
"integrity": "sha512-x8C2nx5XlUNM0WirgfTkHjJGO/ABBxlANZDtHw2HclHtQnn+RFPTnbjMJn8jHZW4TlUam0asHcA14lf1C6Jb+A==",
"dev": true,
"license": "MIT"
},
"node_modules/vue-router": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.3.tgz",

View File

@ -33,6 +33,7 @@
"colorette": "^2.0.20",
"fflate": "^0.8.2",
"filesize": "^11.0.2",
"sass": "^1.97.2",
"stylus": "^0.64.0",
"typescript": "~5.8.3",
"typescript-plugin-css-modules": "^5.2.0",
@ -41,6 +42,7 @@
"unplugin-vue-components": "^29.0.0",
"vite": "^7.1.2",
"vite-plugin-vue-devtools": "^8.0.1",
"vue-component-type-helpers": "^3.2.2",
"vue-tsc": "^3.0.5"
}
}

View File

@ -0,0 +1,2 @@
//
@use 'element-plus/theme-chalk/src/dark/css-vars.scss' as *;

View File

@ -0,0 +1,34 @@
// https://github.com/element-plus/element-plus/blob/dev/packages/theme-chalk/src/common/var.scss
// Element
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
$colors: (
'white': #FFFFFF,
'black': #000000,
'success': (
'base': #13DEB9
),
'warning': (
'base': #FFAE1F
),
'danger': (
'base': #FF4D4F
),
'error': (
'base': #CF171D
)
),
$button: (
'hover-bg-color': var(--el-color-primary-light-9),
'hover-border-color': var(--el-color-primary),
'border-color': var(--el-color-primary),
'text-color': var(--el-color-primary)
),
$messagebox: (
'border-radius': '12px'
),
$popover: (
'padding': '14px',
'border-radius': '10px'
)
);

View File

@ -0,0 +1,569 @@
// Element Plus
:root {
--custom-radius: 5px;
//
--main-color: #1C6EFF;
--el-color-white: white !important;
--el-color-black: white !important;
--el-color-primary: #1C6EFF;
--el-button-hover-bg-color: #458FFF;
--el-button-hover-border-color: #458FFF;
--el-color-primary-light-3: #458FFF;
--el-color-danger: #CF171D;
//
// --el-border-color: #E4E4E7 !important; // DCDFE6
//
--el-font-weight-primary: 400 !important;
--el-component-custom-height: 32px !important;
--el-component-size: var(--el-component-custom-height) !important;
// ...
--el-border-radius-base: calc(var(--custom-radius) / 3 + 2px) !important;
--el-border-radius-small: calc(var(--custom-radius) / 3 + 4px) !important;
--el-messagebox-border-radius: calc(var(--custom-radius) / 3 + 4px) !important;
--el-popover-border-radius: calc(var(--custom-radius) / 3 + 4px) !important;
.region .el-radio-button__original-radio:checked + .el-radio-button__inner {
color: var(--theme-color);
}
}
// el-form-item
.el-form-item__label {
height: var(--el-component-custom-height) !important;
line-height: var(--el-component-custom-height) !important;
}
//
.el-date-range-picker {
--el-datepicker-inrange-bg-color: var(--art-gray-200) !important;
}
// el-card
html.dark .el-card {
--el-card-bg-color: var(--default-box-color) !important;
}
.el-pagination {
justify-content: center;
.el-pager {
li {
box-sizing: border-box;
font-weight: 400 !important;
border: 1px solid #E6EAEB;
transition: border-color 0.15s;
padding: 0 10px !important;
&:not(.is-active) {
background-color: transparent !important;
}
&:hover {
border-color: var(--main-color) !important;
}
}
}
.el-pagination__jump {
.el-input {
height: 32px;
}
}
}
//
.el-menu.el-menu--inline {
transition: max-height 0.26s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
.el-sub-menu {
position: relative;
}
.el-sub-menu .el-sub-menu__icon-arrow {
position: absolute;
top: 50%;
right: var(--el-menu-base-level-padding);
margin-top: -6px;
transition: transform var(--el-transition-duration);
font-size: 12px;
margin-right: 0;
display: block;
width: auto;
}
// item hover
.el-sub-menu__title,
.el-menu-item {
height: 42px !important;
margin-bottom: 4px;
line-height: 42px !important;
transition: background-color 0s !important;
width: calc(100% - 16px);
margin-left: 8px;
border-radius: 6px;
&:hover {
background-color: #F2F4F5 !important;
}
}
.menus:not(.el-menu--collapse) {
width: 230px;
}
.el-menu--collapse {
width: calc(16px + var(--el-menu-icon-width) + var(--el-menu-base-level-padding) * 2);
}
.el-menu-item.is-active {
background-color: rgb(238, 243, 255);
}
// -------------------------------- el-size=default start --------------------------------
// el-button
.el-button--default {
height: var(--el-component-custom-height) !important;
}
// circle
.el-button--default.is-circle {
width: var(--el-component-custom-height) !important;
}
// el-select
.el-select--default {
.el-select__wrapper {
min-height: var(--el-component-custom-height) !important;
}
}
// el-checkbox-button
.el-checkbox-button--default .el-checkbox-button__inner,
// el-radio-button
.el-radio-button--default .el-radio-button__inner {
padding: 10px 15px !important;
}
.el-scrollbar__bar.is-vertical {
width: 4px;
}
// -------------------------------- el-size=default end --------------------------------
.el-pagination.is-background .btn-next,
.el-pagination.is-background .btn-prev,
.el-pagination.is-background .el-pager li {
border-radius: 6px;
}
.el-popover {
min-width: 80px;
border-radius: var(--el-border-radius-small) !important;
}
.el-dialog {
border-radius: 100px !important;
border-radius: calc(var(--custom-radius) / 1.2 + 2px) !important;
overflow: hidden;
}
.el-dialog__header {
.el-dialog__title {
font-size: 16px;
}
}
.el-dialog__body {
padding: 25px 0 !important;
position: relative; // el-pagination relative el-pagination el-pagination__jump--small el-pagination__jump--small URL_ADDRESS.com/element-plus/element-plus/issues/5684#issuecomment-1176299275;
}
.el-dialog.el-dialog-border {
.el-dialog__body {
//
&::before,
//
&::after {
content: '';
position: absolute;
left: -16px;
width: calc(100% + 32px);
height: 1px;
background-color: var(--art-gray-300);
}
&::before {
top: 0;
}
&::after {
bottom: 0;
}
}
}
// el-message
.el-message {
background-color: var(--default-box-color) !important;
border: 0 !important;
box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 9px 28px 8px rgba(0, 0, 0, 0.05) !important;
p {
font-size: 13px;
}
}
// el-dropdown
.el-dropdown-menu {
padding: 6px !important;
border-radius: 10px !important;
border: none !important;
.el-dropdown-menu__item {
padding: 6px 16px !important;
border-radius: 6px !important;
&:hover:not(.is-disabled) {
color: var(--art-gray-900) !important;
background-color: var(--art-el-active-color) !important;
}
&:focus:not(.is-disabled) {
color: var(--art-gray-900) !important;
background-color: var(--art-gray-200) !important;
}
}
}
// selectdropdown
.el-select__popper,
.el-dropdown__popper {
margin-top: -6px !important;
.el-popper__arrow {
display: none;
}
}
.el-dropdown-selfdefine:focus {
outline: none !important;
}
//
@media screen and (max-width: 640px) {
.el-message-box,
.el-dialog {
width: calc(100% - 24px) !important;
}
.el-date-picker.has-sidebar.has-time {
width: calc(100% - 24px);
left: 12px !important;
}
.el-picker-panel *[slot='sidebar'],
.el-picker-panel__sidebar {
display: none;
}
.el-picker-panel *[slot='sidebar'] + .el-picker-panel__body,
.el-picker-panel__sidebar + .el-picker-panel__body {
margin-left: 0;
}
}
// el-button
.el-button {
&.el-button--text {
background-color: transparent !important;
padding: 0 !important;
span {
margin-left: 0 !important;
}
}
}
// el-tag
.el-tag {
font-weight: 500;
transition: all 0s !important;
&.el-tag--default {
height: 26px !important;
}
}
.el-checkbox-group {
&.el-table-filter__checkbox-group label.el-checkbox {
height: 17px !important;
.el-checkbox__label {
font-weight: 400 !important;
}
}
}
.el-radio--default {
//
.el-radio__input {
.el-radio__inner {
width: 16px;
height: 16px;
&::after {
width: 6px;
height: 6px;
}
}
}
}
.el-checkbox {
.el-checkbox__inner {
border-radius: 2px !important;
}
}
//
.el-checkbox--default {
.el-checkbox__inner {
width: 16px !important;
height: 16px !important;
border-radius: 4px !important;
&::before {
content: '';
height: 4px !important;
top: 5px !important;
background-color: #FFFFFF !important;
transform: scale(0.6) !important;
}
}
.is-checked {
.el-checkbox__inner {
&::after {
width: 3px;
height: 8px;
margin: auto;
border: 2px solid var(--el-checkbox-checked-icon-color);
border-left: 0;
border-top: 0;
transform: translate(-45%, -60%) rotate(45deg) scale(0.86) !important;
transform-origin: center;
}
}
}
}
.el-notification .el-notification__icon {
font-size: 22px !important;
}
// el-message-box
.el-message-box__headerbtn .el-message-box__close,
.el-dialog__headerbtn .el-dialog__close {
top: 7px;
right: 7px;
width: 30px;
height: 30px;
border-radius: 5px;
transition: all 0.3s;
&:hover {
background-color: var(--art-hover-color) !important;
color: var(--art-gray-900) !important;
}
}
.el-message-box {
padding: 25px 20px !important;
}
.el-message-box__title {
font-weight: 500 !important;
}
.el-table__column-filter-trigger i {
color: var(--theme-color) !important;
margin: -3px 0 0 2px;
}
// el-dropdown
.el-tooltip__trigger:focus-visible {
outline: unset;
}
// ipad
@media screen and (max-width: 1180px) {
.el-table-fixed-column--right {
padding-right: 0 !important;
}
}
.login-out-dialog {
padding: 30px 20px !important;
border-radius: 10px !important;
}
// dialog
.dialog-fade-enter-active {
.el-dialog:not(.is-draggable) {
animation: dialog-open 0.3s cubic-bezier(0.32, 0.14, 0.15, 0.86);
// el-dialog
.el-select__selected-item {
display: inline-block;
}
}
}
.dialog-fade-leave-active {
animation: fade-out 0.2s linear;
.el-dialog:not(.is-draggable) {
animation: dialog-close 0.5s;
}
}
@keyframes dialog-open {
0% {
opacity: 0;
transform: scale(0.2);
}
100% {
opacity: 1;
transform: scale(1);
}
}
@keyframes dialog-close {
0% {
opacity: 1;
transform: scale(1);
}
100% {
opacity: 0;
transform: scale(0.2);
}
}
//
@keyframes fade-out {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
// el-select
/* .el-select__popper:not(.el-tree-select__popper) {
.el-select-dropdown__list {
padding: 5px !important;
.el-select-dropdown__item {
height: 34px !important;
line-height: 34px !important;
border-radius: 6px !important;
&.is-selected {
color: var(--art-gray-900) !important;
font-weight: 400 !important;
background-color: var(--art-el-active-color) !important;
margin-bottom: 4px !important;
}
&:hover {
background-color: var(--art-hover-color) !important;
}
}
.el-select-dropdown__item:hover ~ .is-selected,
.el-select-dropdown__item.is-selected:has(~ .el-select-dropdown__item:hover) {
background-color: transparent !important;
}
}
} */
// el-tree-select
.el-tree-select__popper {
.el-select-dropdown__list {
padding: 5px !important;
.el-tree-node {
.el-tree-node__content {
height: 36px !important;
border-radius: 6px !important;
&:hover {
background-color: var(--art-gray-200) !important;
}
}
}
}
}
//
.el-button > span {
position: relative;
z-index: 10;
}
//
.el-color-picker__color {
border-radius: 2px !important;
}
//
.el-picker-panel {
.el-picker-panel__footer {
border-radius: 0 0 var(--el-border-radius-base) var(--el-border-radius-base);
}
}
//
.el-tree-node__content {
border-radius: 4px;
margin-bottom: 4px;
padding: 1px 0;
&:hover {
background-color: var(--art-hover-color) !important;
}
}
.dark {
.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
background-color: var(--art-gray-300) !important;
}
}
// hover
.menu-left-popper:focus-within,
.horizontal-menu-popper:focus-within {
box-shadow: none !important;
outline: none !important;
}
//
.el-input-number--default.is-controls-right {
.el-input-number__decrease,
.el-input-number__increase {
height: calc((var(--el-component-size) / 2)) !important;
}
}

View File

@ -0,0 +1 @@
@use './reset.scss';

View File

@ -0,0 +1,153 @@
// sass
/**
*
* @param {Number}
*/
@mixin ellipsis($rowCount: 1) {
@if $rowCount <=1 {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
} @else {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: $rowCount;
-webkit-box-orient: vertical;
}
}
/**
*
* @param {String}
*/
@mixin userSelect($value: none) {
user-select: $value;
-moz-user-select: $value;
-ms-user-select: $value;
-webkit-user-select: $value;
}
//
@mixin absoluteCenter() {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
margin: auto;
}
/**
* css3
*
*/
@mixin animation(
$from: (
width: 0px
),
$to: (
width: 100px
),
$name: mymove,
$animate: mymove 2s 1 linear infinite
) {
-webkit-animation: $animate;
-o-animation: $animate;
animation: $animate;
@keyframes #{$name} {
from {
@each $key, $value in $from {
#{$key}: #{$value};
}
}
to {
@each $key, $value in $to {
#{$key}: #{$value};
}
}
}
@-webkit-keyframes #{$name} {
from {
@each $key, $value in $from {
$key: $value;
}
}
to {
@each $key, $value in $to {
$key: $value;
}
}
}
}
//
@mixin circle($size: 11px, $bg: #FFFFFF) {
border-radius: 50%;
width: $size;
height: $size;
line-height: $size;
text-align: center;
background: $bg;
}
// placeholder
@mixin placeholder($color: #BBBBBB) {
// Firefox
&::-moz-placeholder {
color: $color;
opacity: 1;
}
// Internet Explorer 10+
&:-ms-input-placeholder {
color: $color;
}
// Safari and Chrome
&::-webkit-input-placeholder {
color: $color;
}
&:placeholder-shown {
text-overflow: ellipsis;
}
}
//IE8
@mixin betterTransparentize($color, $alpha) {
$c: rgba($color, $alpha);
$ie_c: ie_hex_str($c);
background: rgba($color, 1);
background: $c;
background: transparent \9
;
zoom: 1;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie_c}, endColorstr=#{$ie_c});
-ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie_c}, endColorstr=#{$ie_c})';
}
//
@mixin browserPrefix($propertyName, $value) {
@each $prefix in -webkit-, -moz-, -ms-, -o-, '' {
#{$prefix}#{$propertyName}: $value;
}
}
//
@mixin border($color: red) {
border: 1px solid $color;
}
//
@mixin backdropBlur() {
--tw-backdrop-blur: blur(30px);
-webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}

View File

@ -0,0 +1,50 @@
@charset "UTF-8";
html, :host {
-webkit-text-size-adjust: 100%;
tab-size: 4;
line-height: 1.5;
font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-feature-settings: var(--default-font-feature-settings, normal);
font-variation-settings: var(--default-font-variation-settings, normal);
-webkit-tap-highlight-color: transparent;
}
/*滚动条*/
/*滚动条整体部分,必须要设置*/
::-webkit-scrollbar {
width: 5px !important;
height: 0 !important;
}
/*滚动条的轨道*/
::-webkit-scrollbar-track {
background-color: #F2F4F5;
}
/*滚动条的滑块按钮*/
::-webkit-scrollbar-thumb {
border-radius: 5px;
background-color: #CCCCCC !important;
transition: all 0.2s;
-webkit-transition: all 0.2s;
}
::-webkit-scrollbar-thumb:hover {
background-color: #B0ABAB !important;
}
/*滚动条的上下两端的按钮*/
::-webkit-scrollbar-button {
height: 0;
width: 0;
}
.dark {
::-webkit-scrollbar-track {
background-color: #070707;
}
::-webkit-scrollbar-thumb {
background-color: #E6EAEB !important;
}
}

View File

@ -2,6 +2,7 @@ import type { App } from 'vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
export const elIcons = ElementPlusIconsVue
export type ElIconType = keyof typeof ElementPlusIconsVue
const install = (app: App): void => {
for (const [ key, component ] of Object.entries(ElementPlusIconsVue)) {

View File

@ -1,5 +1,3 @@
import type { ReactiveFlags } from 'vue'
/**
* Object.prototype.toString.call(obj)
*/
@ -64,7 +62,7 @@ function debounce<T extends any[]>(t: number, fn: (...args: T) => void) {
}
function clone<T = any>(value: T): T {
if (value === null || typeof value !== 'object') {
if (value === null || typeof value !== 'object' || typeof value === 'function') {
return value
}
const rawValue = isReactive(value) ? toRaw(value) : value
@ -79,47 +77,57 @@ function clone<T = any>(value: T): T {
}
const clonedObj = {} as T
Object.keys(rawValue).forEach((key) => {
clonedObj[key as keyof T] = clone(rawValue[key as keyof T])
const propValue = rawValue[key as keyof T]
if (typeof propValue !== 'function') {
clonedObj[key as keyof T] = clone(propValue)
}
})
return clonedObj as T
}
type ExtractRawType<T> =
// 匹配 reactive 响应式对象(通过 Vue 内置的 RAW 标记提取原始类型)
T extends { [ReactiveFlags.RAW]: infer RawValue }
? RawValue
// 递归处理数组(兼容 reactive([]) 场景)
: T extends Array<infer U>
? Array<ExtractRawType<U>>
// 递归处理嵌套对象(兼容 reactive({ a: { b: 1 } }) 场景)
: T extends object
? { [K in keyof T]: ExtractRawType<T[K]> }
// 非对象类型直接返回(如 string/number 等)
: T;
type PartialForObject<T> =
// 数组类型:直接返回原数组类型(不做 Partial
T extends Array<any>
? T
// 普通对象:做 Partial 处理
: T extends object
? Partial<T>
// 基本类型:直接返回
: T;
type ResetAble<T> = T & { $reset: (val?: Partial<ExtractRawType<T>>) => void }
export type ResetAble<T> = T & {
$reset: (val?: PartialForObject<T>) => void
$clone: () => T
}
function resetAble<T extends object>(target: T): ResetAble<T> {
function resetAble<T>(target: T): ResetAble<T> {
const initialData = clone(target) as T
const resetAbleTarget = target as ResetAble<T>
resetAbleTarget.$clone = () => clone(target) as T
resetAbleTarget.$reset = (val?: PartialForObject<T>) => {
const resetValue = val ?? (initialData as PartialForObject<T>)
(target as ResetAble<T>).$reset = (val?: Partial<ExtractRawType<T>>) => {
if (val == null) {
val = initialData
}
if (Array.isArray(val)) {
const arr = target as unknown as Array<unknown>
const initialArr = val as unknown as Array<unknown>
const initialArr = resetValue as unknown as Array<unknown>
arr.splice(0, arr.length, ...initialArr)
} else {
Object.keys(val).forEach((key) => {
(target as Record<string, unknown>)[key] = (val as Record<string, unknown>)[key]
const targetObj = target as Record<string, unknown>
const resetObj = resetValue as Record<string, unknown>
// 步骤1遍历重置值赋值到目标对象
Object.keys(resetObj).forEach((key) => {
targetObj[key] = resetObj[key]
})
Object.getOwnPropertyNames(target).forEach((key) => {
if (key !== '$reset' && !(key in val)) {
(target as Record<string, unknown>)[key] = undefined
// 步骤2清理目标对象中不存在于重置值的属性保留 $reset/$clone
Object.getOwnPropertyNames(targetObj).forEach((key) => {
if (key !== '$reset' && key !== '$clone' && !(key in resetObj)) {
targetObj[key] = undefined
}
})
});
}
}
return target as ResetAble<T>

View File

@ -201,7 +201,7 @@ const displayData = computed(() => {
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
background layout="total, prev, pager, next, sizes, jumper"
@change="paging"/>
</div>
</template>

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* 项目名称 再昇云 */
src: url('@/components/a-icon/iconfont.woff2?t=1766204567022') format('woff2'),
url('@/components/a-icon/iconfont.woff?t=1766204567022') format('woff'),
url('@/components/a-icon/iconfont.ttf?t=1766204567022') format('truetype');
src: url('@/components/a-icon/iconfont.woff2?t=1768370216119') format('woff2'),
url('@/components/a-icon/iconfont.woff?t=1768370216119') format('woff'),
url('@/components/a-icon/iconfont.ttf?t=1768370216119') format('truetype');
}
.iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-bell:before {
content: "\e7c4";
}
.icon-eye:before {
content: "\e64f";
}

View File

@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "4766680",
"name": "bell",
"font_class": "bell",
"unicode": "e7c4",
"unicode_decimal": 59332
},
{
"icon_id": "46407625",
"name": "eye",

View File

@ -5,6 +5,13 @@ export const icons = {
'css_prefix_text': 'icon-',
'description': '',
'glyphs': [
{
'icon_id': '4766680',
'name': 'bell',
'font_class': 'bell',
'unicode': 'e7c4',
'unicode_decimal': 59332,
},
{
'icon_id': '46407625',
'name': 'eye',

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,484 @@
<script generic="F extends G.PageParam,TT extends DefaultRow" lang="ts" setup>
import {
elIcons,
type ElIconType,
} from '@/common/element/element.ts'
import Page from '@/components/page/Page.vue'
import Utils, { type ResetAble } from '@/common/utils'
import Colls from '@/common/utils/colls.ts'
import Strings from '@/common/utils/strings.ts'
import type { R } from '@/common/utils/http-util.ts'
import type {
TableColumnCtx,
TableProps,
} from 'element-plus'
import type { DefaultRow } from 'element-plus/es/components/table/src/table/defaults'
import type { FormProps } from 'element-plus/es/components/form/src/form'
export interface ToolType {
icon?: ElIconType
type?: 'text' | 'default' | 'primary' | 'success' | 'warning' | 'info' | 'danger'
label?: string
action: () => void
}
export interface TableActionType<T> {
icon?: ElIconType
type?: 'text' | 'default' | 'primary' | 'success' | 'warning' | 'info' | 'danger'
label?: string | ((data: { row: T, column: TableColumnCtx, $index: number }) => string)
tooltip?: string | ((data: { row: T, column: TableColumnCtx, $index: number }) => string)
loading?: boolean
textBtn?: boolean
show?: (data: { row: T, column: TableColumnCtx, $index: number }) => boolean
action: (data: { row: T, column: TableColumnCtx, $index: number }) => Promise<boolean> | void
confirm?: {
title: string | ((data: { row: T, column: TableColumnCtx, $index: number }) => string)
width?: string
confirmButtonText?: string
cancelButtonText?: string
}
}
export interface ActionColumnType<T> {
width?: string
tableActions: TableActionType<T>[]
}
export type TablePropsType<T extends DefaultRow> = Omit<TableProps<T>, 'data' | 'headerRowClassName' | 'cellClassName' | 'context'>
export type FormPropsType = Partial<FormProps>
const props = withDefaults(
defineProps<{
defaultSearchForm?: F
paging: (param: F) => Promise<R<G.PageResult<TT>>>
actionColumn?: ActionColumnType<TT>
leftTools?: ToolType[]
rightTools?: Required<Omit<ToolType, 'type' | 'label'>>[]
tableProps?: TablePropsType<TT>
searchFormProps?: FormPropsType
simpleSearchFormProps?: FormPropsType
formStyle?: {
colCount?: number
vgap?: string
hgap?: string
}
}>(),
{
tableProps: {
// @ts-ignore
rowKey: 'id',
emptyText: '暂无数据',
},
// @ts-ignore
searchFormProps: {
inline: true,
} as FormPropsType,
// @ts-ignore
simpleSearchFormProps: {
inline: true,
} as FormPropsType,
formStyle: {
// @ts-ignore
colCount: 4,
vgap: '20px',
hgap: '20px',
},
},
)
const searchForm = Utils.resetAble(reactive<F>({
...(props.defaultSearchForm ?? {}),
current: 1,
size: 20,
} as F)) as ResetAble<F>
const tableData = Utils.resetAble(reactive<TT[]>([])) as ResetAble<TT[]>
const totalCount = ref(0)
const loading = ref<boolean>(false)
const showSearchForm = ref<boolean>(true)
function doReset() {
searchForm.$reset()
doSearch()
}
function doSearch() {
loading.value = true
props.paging(searchForm.$clone() as F)
.then((res) => {
totalCount.value = res.data?.total ?? 0
const records = res.data?.records ?? ([] as TT[])
tableData.$reset(records)
})
.finally(() => {
loading.value = false
})
}
function showSearchFormHandle() {
showSearchForm.value = !showSearchForm.value
searchForm.$reset()
}
function rowAction(data: { row: TT, column: TableColumnCtx, $index: number }, action: TableActionType<TT>) {
if (action.loading != null) {
action.loading = true
}
const result = action.action(data)
if (result instanceof Promise) {
result
.then(reload => {
if (reload) {
doSearch()
}
})
.finally(() => {
if (action.loading != null) {
action.loading = false
}
})
}
}
defineExpose({
doSearch,
})
onMounted(doSearch)
</script>
<template>
<Page class="form-page">
<div v-show="showSearchForm" class="search-form">
<ElScrollbar>
<ElForm v-bind="searchFormProps" @submit.prevent="doSearch">
<slot :searchForm="searchForm" name="searchFormItem"/>
<ElFormItem class="form-action-btn">
<ElButton :icon="elIcons.Search" :loading="loading" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="loading" @click="doReset"></ElButton>
</ElFormItem>
</ElForm>
</ElScrollbar>
</div>
<div class="data-list">
<div v-if="!Colls.isEmpty(leftTools) || !Colls.isEmpty(rightTools)" class="tool-bar">
<div class="tool-bar-left">
<template v-if="!Colls.isEmpty(leftTools)">
<ElButton v-for="(tool,i) in leftTools" :key="'tool-bar-left-'+i"
:icon="Strings.isBlank(tool.icon)?undefined:elIcons[tool.icon!]"
:type="tool.type ?? 'primary'"
@click="tool.action">
{{ tool.label }}
</ElButton>
</template>
</div>
<div class="tool-bar-right">
<ElForm v-bind="simpleSearchFormProps" @submit.prevent="doSearch">
<slot :searchForm="searchForm" name="simpleSearchFormItem"/>
<button style="display: none" type="submit"></button>
</ElForm>
<ElTooltip content="刷新" placement="top">
<ElButton :icon="elIcons.Refresh" :loading="loading" type="default" @click="doSearch"/>
</ElTooltip>
<template v-if="!Colls.isEmpty(rightTools)">
<ElButton v-for="(tool,i) in rightTools" :key="'tool-bar-right-'+i"
:icon="elIcons[tool.icon]"
@click="tool.action"/>
</template>
<ElTooltip :content="showSearchForm?'关闭高级搜索':'打开高级搜索'" placement="top">
<ElButton :class="{'filter-btn-active':showSearchForm} " :icon="elIcons.Filter" type="default" @click="showSearchFormHandle"/>
</ElTooltip>
</div>
</div>
<ElTable
v-loading="loading"
:data="tableData"
cell-class-name="table-cell"
class="table-list"
header-row-class-name="table-header"
v-bind="tableProps"
>
<slot name="columns"/>
<ElTableColumn v-if="!Colls.isEmpty(actionColumn)" :width="actionColumn?.width?? '180'" fixed="right" label="操作">
<template #default="scope">
<div class="action-btn">
<template v-for="(tableAction,i) in actionColumn!.tableActions.filter(it=>(it.show??true))" :key="'action-btn-'+i">
<ElPopconfirm
v-if="tableAction.confirm != null"
:cancel-button-text="tableAction.confirm.cancelButtonText?? '否'"
:confirm-button-text="tableAction.confirm.confirmButtonText?? '是'"
:title="typeof tableAction.confirm.title === 'function'?tableAction.confirm.title(scope):tableAction.confirm.title"
:width="tableAction.confirm.width?? '180'"
cancel-button-type="primary"
confirm-button-type="danger" placement="top" @confirm="rowAction(scope, tableAction)"
>
<template #reference>
<template v-if="tableAction.tooltip==null || (Strings.isBlank(typeof tableAction.tooltip === 'function'?tableAction.tooltip(scope):tableAction.tooltip))">
<ElButton
v-if="tableAction.textBtn"
:icon="tableAction.icon==null?undefined:elIcons[tableAction.icon]"
:loading="tableAction.loading"
:type="tableAction.type"
class="text-btn"
text>
{{ tableAction.label }}
</ElButton>
<ElButton
v-else
:icon="tableAction.icon==null?undefined:elIcons[tableAction.icon]"
:loading="tableAction.loading"
:type="tableAction.type"
class="icon-btn"/>
</template>
<div v-else>
<ElTooltip :content="typeof tableAction.tooltip === 'function'?tableAction.tooltip(scope):tableAction.tooltip" placement="top">
<ElButton
v-if="tableAction.textBtn"
:icon="tableAction.icon==null?undefined:elIcons[tableAction.icon]"
:loading="tableAction.loading"
:type="tableAction.type"
class="text-btn"
text>
{{ tableAction.label }}
</ElButton>
<ElButton
v-else
:icon="tableAction.icon==null?undefined:elIcons[tableAction.icon]"
:loading="tableAction.loading"
:type="tableAction.type"
class="icon-btn"/>
</ElTooltip>
</div>
</template>
</ElPopconfirm>
<template v-else>
<template v-if="tableAction.tooltip==null || (Strings.isBlank(typeof tableAction.tooltip === 'function'?tableAction.tooltip(scope):tableAction.tooltip))">
<ElButton
v-if="tableAction.textBtn"
:icon="tableAction.icon==null?undefined:elIcons[tableAction.icon]"
:loading="tableAction.loading"
:type="tableAction.type"
class="text-btn"
text
@click="rowAction(scope, tableAction)">{{ tableAction.label }}
</ElButton>
<ElButton
v-else
:icon="tableAction.icon==null?undefined:elIcons[tableAction.icon]"
:loading="tableAction.loading"
:type="tableAction.type"
class="icon-btn"
@click="rowAction(scope, tableAction)"/>
</template>
<ElTooltip v-else :content="typeof tableAction.tooltip === 'function'?tableAction.tooltip(scope):tableAction.tooltip" placement="top">
<ElButton
v-if="tableAction.textBtn"
:icon="tableAction.icon==null?undefined:elIcons[tableAction.icon]"
:loading="tableAction.loading"
:type="tableAction.type"
class="text-btn"
text
@click="rowAction(scope, tableAction)">{{ tableAction.label }}
</ElButton>
<ElButton
v-else
:icon="tableAction.icon==null?undefined:elIcons[tableAction.icon]"
:loading="tableAction.loading"
:type="tableAction.type"
class="icon-btn"
@click="rowAction(scope, tableAction)"/>
</ElTooltip>
</template>
</template>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:hide-on-single-page="false"
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
background
layout="total, prev, pager, next, sizes, jumper"
@change="doSearch"/>
<slot name="pageBody"/>
</div>
<slot/>
</Page>
</template>
<style lang="stylus" scoped>
.form-page {
.search-form {
border: 1px solid #00000014;
padding: 20px;
border-radius: 8px;
background-color: white;
//background-color: #FAFBFC;
//box-shadow: rgba(0, 0, 0, 0.12) 0px 0px 12px 0px;
max-height 242px
& > div {
max-height 168px
width 100%;
}
:deep(.el-form) {
display grid
grid-template-columns repeat(v-bind('formStyle.colCount'), 1fr)
grid-auto-flow: dense;
column-gap v-bind('formStyle.hgap');
row-gap v-bind('formStyle.vgap');
padding 5px
.el-form-item:not(.form-action-btn) {
background-color white
//border 1px solid #DCDFE6
border-radius: var(--el-input-border-radius, var(--el-border-radius-base));
box-shadow: 0 0 0 1px var(--el-input-border-color, var(--el-border-color));
padding: 1px;
margin 0
.el-form-item__label {
border-right 1px solid #DCDFE6
padding 1px 11px
}
.el-form-item__content {
.el-input {
.el-input__wrapper {
border-radius unset
box-shadow unset
}
}
.el-select {
.el-select__wrapper {
border-radius unset
box-shadow unset
}
}
}
}
.el-form-item.form-action-btn {
grid-column: 1 / -1;
margin: 0;
.el-form-item__content {
justify-content end
}
}
}
}
.data-list {
flex 1
display flex
flex-direction column
border: 1px solid #00000014;
padding: 15px 20px 20px 15px;
border-radius: 8px;
background-color: white;
gap 20px
//box-shadow: rgba(0, 0, 0, 0.12) 0px 0px 12px 0px;
min-height: calc(100% - 225px);
box-sizing: border-box;
.tool-bar {
display flex
justify-content space-between
//box-shadow: rgba(0, 0, 0, 0.12) 0px 0px 12px 0px;
//padding 10px
:deep(.el-form) {
.el-form-item {
margin: 0;
}
}
& > div:last-child {
display flex
gap 10px
:deep(.el-button--default) {
width 32px
color #4D5875
background-color #E6EAEB8B
border-color #E6EAEB8B
margin 0
&:hover {
color var(--main-color)
background-color #E6EAEB;
border-color #E6EAEB;
}
}
:deep(.el-button--default).filter-btn-active {
color var(--main-color)
}
}
}
.table-list {
flex 1;
width 100%
//box-shadow: rgba(0, 0, 0, 0.12) 0px 0px 12px 0px;
//padding 10px
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
gap: 10px;
.text-btn {
margin 0
}
.icon-btn {
margin 0
padding: 8px;
justify-content: center;
align-items: center;
}
}
}
}
}
</style>

View File

@ -12,13 +12,14 @@
.page-wrapper {
height 100%
width 100%;
overflow auto
padding 16px
overflow hidden
padding 5px
box-sizing border-box
box-shadow: rgba(30, 35, 43, 0.16) 0px 2px 10px 0px;
background-color: white;
//box-shadow: inset rgba(30, 35, 43, 0.16) 0px 0 10px 1px;
//background-color: white;
display flex
flex-direction column
gap 10px
}
</style>

View File

@ -5,7 +5,6 @@
// ------
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
import { GlobalComponents } from 'vue'
export {}
@ -15,8 +14,10 @@ declare module 'vue' {
ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
@ -43,6 +44,8 @@ declare module 'vue' {
ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
@ -68,8 +71,10 @@ declare global {
const ElAside: typeof import('element-plus/es')['ElAside']
const ElAvatar: typeof import('element-plus/es')['ElAvatar']
const ElButton: typeof import('element-plus/es')['ElButton']
const ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
const ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
const ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
const ElCol: typeof import('element-plus/es')['ElCol']
const ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
const ElContainer: typeof import('element-plus/es')['ElContainer']
const ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
@ -96,6 +101,8 @@ declare global {
const ElPopconfirm: typeof import('element-plus/es')['ElPopconfirm']
const ElRadio: typeof import('element-plus/es')['ElRadio']
const ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
const ElRow: typeof import('element-plus/es')['ElRow']
const ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
const ElSelect: typeof import('element-plus/es')['ElSelect']
const ElSwitch: typeof import('element-plus/es')['ElSwitch']
const ElTable: typeof import('element-plus/es')['ElTable']

2
src/dts/g.d.ts vendored
View File

@ -19,7 +19,7 @@ declare global {
records: T[]
}
interface PageParam {
interface PageParam extends Record<string, any> {
current?: number
size?: number
orders?: string

View File

@ -1,3 +1,4 @@
import '@/assets/scss/index.scss'
import { createApp } from 'vue'
import App from './App.vue'
import { Settings } from 'luxon'
@ -7,7 +8,7 @@ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
// import Ws from '@/common/ws/ws.ts'
import element from '@/common/element/element.ts'
import router from '@/common/router'
import '@/assets/css/index.css'
// import '@/assets/css/index.css'
createApp(App)
.use(element)

View File

@ -118,7 +118,7 @@ export default defineComponent(
return () => (
<>
<ElMenu default-active={defaultActive.value} collapse={isCollapse.value} style={{height: '100%', overflow: 'auto', '--el-menu-base-level-padding': '10px'}} class={[ styles.aMenus, 'menus' ]}>
<ElMenu default-active={defaultActive.value} collapse={isCollapse.value} style={{height: '100%', '--el-menu-base-level-padding': '10px', border: 'none'}} class={[ styles.aMenus, 'menus' ]}>
{{
default: () => menuTree.value.map(renderMenu),
}}

View File

@ -3,6 +3,7 @@ import AAside from '@/pages/a-frame/AAside.tsx'
import AAvatar from '@/pages/a-frame/AAvatar.vue'
import { appName } from '@/common'
import Evt from '@/common/utils/evt.ts'
import AIcon from '@/components/a-icon/AIcon.vue'
onMounted(() => {
Evt.emit('connect_ws')
@ -20,11 +21,23 @@ onUnmounted(() => {
<img alt="" src="@/assets/images/zsy.png"/>
<div>{{ appName }}</div>
</div>
<AAvatar/>
<div>
<div>
<ElButton text>
<AIcon name="bell"/>
</ElButton>
<ElButton text>
<AIcon name="settings"/>
</ElButton>
</div>
<AAvatar/>
</div>
</ElHeader>
<ElContainer>
<ElAside>
<AAside/>
<ElScrollbar class="a-scroll-bar">
<AAside/>
</ElScrollbar>
</ElAside>
<ElMain>
<RouterView #="{ Component }">
@ -69,6 +82,23 @@ onUnmounted(() => {
font-size: 1.5rem;
}
}
& > div:nth-child(2) {
height: 100%;
display: flex;
align-items: center;
box-sizing border-box
gap 20px
& > div:first-child {
display flex
gap 10px
& > button {
margin 0
}
}
}
}
& > section {
@ -79,20 +109,20 @@ onUnmounted(() => {
height 100%;
width auto
position relative
border-right: solid 1px var(--el-menu-border-color);
background-color white
padding: 10px 0;
}
& > main {
height 100%
width calc(100% - 300px)
padding 5px
padding 0
overflow auto
background-color #F7F9FC
//background-color #F7F9FC
background-color rgb(250, 251, 252)
}
}
}
</style>
<style>
.menus:not(.el-menu--collapse) {
width: 230px;
}
</style>

View File

@ -1,64 +1,27 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<!-- <ElFormItem label-width="90" label="Id">
<ElInput v-model="searchForm.id" placeholder="Id" />
</ElFormItem>
<ElFormItem label-width="90" label="用户">
<ElInput v-model="searchForm.userId" placeholder="用户" />
</ElFormItem> -->
<ElFormItem label-width="90" label="身份类型">
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{searchForm}">
<ElFormItem label="身份类型">
<el-select style="width: 200px" v-model="searchForm.identityCategory" placeholder="身份类型">
<el-option v-for="item in bizList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="客户姓名">
<ElInput v-model="searchForm.customerName" placeholder="客户姓名" />
</ElFormItem> -->
<ElFormItem label-width="90" label="结算方式">
<ElFormItem label="结算方式">
<el-select v-model="searchForm.settlementWay" placeholder="结算方式" style="width: 200px">
<el-option v-for="item in payList" :key="item.value" :label="item.label" :value="item.value"/>
</el-select>
</ElFormItem>
<!--
<ElFormItem label-width="90" label="客户联系电话">
<ElInput v-model="searchForm.phone" placeholder="客户联系电话" />
</ElFormItem>
<ElFormItem label-width="90" label="组织信息">
<ElInput v-model="searchForm.orgId" placeholder="组织信息" />
</ElFormItem>
<ElFormItem label-width="90" label="创建人">
<ElInput v-model="searchForm.creatorId" placeholder="创建人" />
</ElFormItem>
<ElFormItem label-width="90" label="修改人">
<ElInput v-model="searchForm.modifierId" placeholder="修改人" />
</ElFormItem>
<ElFormItem label-width="90" label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
</ElFormItem>
<ElFormItem label-width="90" label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
</ElFormItem> -->
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<!-- <ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton> -->
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<!-- <ElTableColumn label="Id" prop="id" /> -->
</template>
<template #columns>
<ElTableColumn label="账号" prop="username"/>
<ElTableColumn label="联系人" prop="nickname"/>
<ElTableColumn label="身份类型" prop="identityCategoryTxt"/>
<ElTableColumn label="组织信息" prop="orgId"/>
<ElTableColumn label="客户姓名" prop="customerName"/>
<!-- <ElTableColumn label="客户联系电话" prop="phone" /> -->
<ElTableColumn label="结算方式" prop="settlementWayTxt"/>
<ElTableColumn label="是否管理员">
<template #default="scope">
@ -67,92 +30,19 @@
</ElTableColumn>
<ElTableColumn label="联系电话" prop="phone"/>
<ElTableColumn label="创建时间" prop="regdate"/>
<!-- <ElTableColumn label="修改时间" prop="modifyTime" /> -->
<!-- <ElTableColumn label="是否删除" prop="deleted"/> -->
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination :page-size="pagination.size" :total="pagination.total" class="pagination" layout="prev, pager, next" @change="pageChangeHandler"/>
<CustomerForm ref="customerForm" @edit-succ="paging"/>
</Page>
</template>
<CustomerForm ref="customerForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import CustomerApi from '@/pages/cst/customer/customer-api.ts'
import CustomerForm from '@/pages/cst/customer/CustomerForm.vue'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
const tableData = ref<CustomerTypes.SearchCustomerResult[]>([])
let searchForm = reactive<CustomerTypes.SearchCustomerParam>({
current: 1,
size: 20,
})
const searching = ref(false)
const deling = ref(false)
const showSearchForm = ref(true)
const customerFormIns = useTemplateRef<InstanceType<typeof CustomerForm>>('customerForm')
const pagination = reactive<G.Pagination>({
total: 0,
current: 1,
size: 1,
})
function pageChangeHandler(currentPage: number, pageSize: number) {
searchForm.current = currentPage
searchForm.size = pageSize
paging()
}
function showDialog(data?: CustomerTypes.SearchCustomerResult) {
customerFormIns.value?.open(data)
}
function delHandler({row}: { row: CustomerTypes.SearchCustomerResult }) {
deling.value = true
CustomerApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
paging()
})
.finally(() => {
deling.value = false
})
}
function modifyHandler({row}: { row: CustomerTypes.SearchCustomerResult }) {
showDialog(row)
}
function reset() {
// Object.assign(searchForm, {});
searchForm = reactive<CustomerTypes.SearchCustomerParam>({
current: 1,
size: 20,
})
paging()
}
function paging() {
searching.value = true
CustomerApi.paging(searchForm)
.then((res) => {
tableData.value = res.data?.records ?? []
})
.finally(() => {
searching.value = false
})
}
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const payList = [
{
@ -191,67 +81,55 @@ const bizList = [
label: '司机',
},
]
const customerFormIns = useTemplateRef<InstanceType<typeof CustomerForm>>('customerForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
onMounted(() => {
paging()
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
customerFormIns.value?.open()
},
},
]
const actionColumn = reactive<ActionColumnType<CustomerTypes.SearchCustomerResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
customerFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return CustomerApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
function research() {
formPageIns.value?.doSearch()
}
function paging(param: CustomerTypes.SearchCustomerParam) {
return CustomerApi.paging(param)
}
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content flex-end
margin 0 0 20px 0
}
.pagination {
justify-content: end;
margin: 8px;
}
</style>

View File

@ -1,209 +1,88 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="司机姓名">
<ElInput v-model="searchForm.driverName" placeholder="司机姓名" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:paging="paging">
<template #searchFormItem="{searchForm}">
<ElFormItem label="归属用户">
<ElInput v-model="searchForm.userId" placeholder="归属用户"/>
</ElFormItem>
<!--<ElFormItem label-width="90" label="归属用户">
<ElInput v-model="searchForm.userId" placeholder="归属用户" />
<ElFormItem label="驾驶证编号">
<ElInput v-model="searchForm.drivingLicenceNo" placeholder="驾驶证编号"/>
</ElFormItem>
<ElFormItem label-width="90" label="手机号">
<ElInput v-model="searchForm.phone" placeholder="手机号" />
<ElFormItem label="司机姓名">
<ElInput v-model="searchForm.driverName" placeholder="司机姓名"/>
</ElFormItem>
<ElFormItem label-width="90" label="归属客户">
<ElInput v-model="searchForm.customerId" placeholder="归属客户" />
<ElFormItem label="手机号">
<ElInput v-model="searchForm.phone" placeholder="手机号"/>
</ElFormItem>
<ElFormItem label-width="90" label="归属公司">
<ElInput
v-model="searchForm.orgId"
placeholder="归属公司"/>
<ElFormItem label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="驾驶证编号">
<ElInput v-model="searchForm.drivingLicenceNo" placeholder="驾驶证编号" />
<ElFormItem label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="忙碌中">
<ElInput
v-model="searchForm.busy"
placeholder="忙碌中"/>
</ElFormItem>
<ElFormItem label-width="90" label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
</ElFormItem>
<ElFormItem label-width="90" label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
</ElFormItem> -->
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<div></div>
<!-- <ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton> -->
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<ElTableColumn label="司机名称" prop="driverName" />
<ElTableColumn label="归属公司" prop="orgName" />
<ElTableColumn label="驾驶证编号" prop="drivingLicenceNo" />
<ElTableColumn label="手机号" prop="phone" />
<ElTableColumn label="驾驶证有效期" prop="licenceStartTime" />
<ElTableColumn label="驾驶证有效期" prop="licenceEndTime" />
<ElTableColumn label="忙碌中" prop="busy">
<template #default="{ row }">
{{ row.busy ? "是" : "否" }}
</template>
</ElTableColumn>
<ElTableColumn label="创建时间" prop="createTime" width="170"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="170"/>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="showDetail(scope)"></ElButton>
<!-- <ElButton text type="primary" @click="modifyHandler(scope)"></ElButton> -->
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<DriverForm ref="driverForm" @edit-succ="paging" />
<DriverDetail ref="driverDetail" @edit-succ="paging" />
</Page>
</template>
<template #columns>
<ElTableColumn label="司机名称" prop="driverName"/>
<ElTableColumn label="归属公司" prop="orgName"/>
<ElTableColumn label="驾驶证编号" prop="drivingLicenceNo"/>
<ElTableColumn label="手机号" prop="phone"/>
<ElTableColumn label="驾驶证有效期" prop="licenceStartTime"/>
<ElTableColumn label="驾驶证有效期" prop="licenceEndTime"/>
<ElTableColumn label="忙碌中" prop="busy"/>
<ElTableColumn label="创建时间" prop="createTime"/>
<ElTableColumn label="修改时间" prop="modifyTime"/>
</template>
<DriverForm ref="driverForm" @edit-succ="research"/>
<DriverDetail ref="driverDetail" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import DriverApi from "@/pages/cst/driver/driver-api.ts";
import DriverForm from "@/pages/cst/driver/DriverForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import DriverDetail from "@/pages/cst/driver/DriverDetail.vue";
import DriverApi from '@/pages/cst/driver/driver-api.ts'
import DriverForm from '@/pages/cst/driver/DriverForm.vue'
import DriverDetail from '@/pages/cst/driver/DriverDetail.vue'
import FormPage, { type ActionColumnType } from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const driverDetailIns = useTemplateRef<InstanceType<typeof DriverDetail>>("driverDetail");
const totalCount = ref(0);
const tableData = ref<DriverTypes.SearchDriverResult[]>([]);
const searchForm = ref<DriverTypes.SearchDriverParam>({
current: 1,
size: 20,
});
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
// const driverFormIns = useTemplateRef<InstanceType<typeof DriverForm>>("driverForm");
const driverDetailIns = useTemplateRef<InstanceType<typeof DriverDetail>>('driverDetail')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
// function showDialog(data?: DriverTypes.SearchDriverResult) {
// driverFormIns.value?.open(data);
// }
const actionColumn = reactive<ActionColumnType<DriverTypes.SearchDriverResult>>({
tableActions: [
{
tooltip: '详情',
icon: 'Postcard',
action({row}) {
driverDetailIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return DriverApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
function delHandler({ row }: { row: DriverTypes.SearchDriverResult }) {
deling.value = true;
DriverApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function research() {
formPageIns.value?.doSearch()
}
// function modifyHandler({ row }: { row: DriverTypes.SearchDriverResult }) {
// showDialog(row);
// }
// function addHandler() {
// showDialog();
// }
function reset() {
searchForm.value = {
current: 1,
size: 20,
};
paging();
function paging(param: DriverTypes.SearchDriverParam) {
return DriverApi.paging(param)
}
function showDetail({ row }: { row: ProjectTypes.SearchProjectResult }) {
driverDetailIns.value?.open(row);
}
function paging() {
searching.value = true;
DriverApi.paging(searchForm.value)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.value = res.data?.records ?? [];
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,211 +1,104 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<!-- <ElFormItem label-width="90" label="主体类型GeTiHu 个体户、QiYe 企业">
<ElInput
v-model="searchForm.orgCategory"
placeholder="主体类型GeTiHu 个体户、QiYe 企业"/>
</ElFormItem> -->
<ElFormItem label-width="90" label="统一社会信用代码">
<ElInput v-model="searchForm.uscc" placeholder="统一社会信用代码" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:paging="paging">
<template #searchFormItem="{searchForm}">
<ElFormItem label="统一社会信用代码">
<ElInput v-model="searchForm.uscc" placeholder="统一社会信用代码"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="组织名称">
<ElInput v-model="searchForm.orgName" placeholder="组织名称" />
<ElFormItem label="组织名称">
<ElInput v-model="searchForm.orgName" placeholder="组织名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="法人名称">
<ElInput v-model="searchForm.legalRepresentative" placeholder="法人名称" />
<ElFormItem label="法人名称">
<ElInput v-model="searchForm.legalRepresentative" placeholder="法人名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="市">
<ElInput v-model="searchForm.cityName" placeholder="市" />
<ElFormItem label="市">
<ElInput v-model="searchForm.cityName" placeholder="市"/>
</ElFormItem>
<ElFormItem label-width="90" label="区县">
<ElInput v-model="searchForm.areaName" placeholder="区县" />
<ElFormItem label="区县">
<ElInput v-model="searchForm.areaName" placeholder="区县"/>
</ElFormItem>
<ElFormItem label-width="90" label="乡镇街道">
<ElInput v-model="searchForm.townName" placeholder="乡镇街道" />
<ElFormItem label="乡镇街道">
<ElInput v-model="searchForm.townName" placeholder="乡镇街道"/>
</ElFormItem>
<ElFormItem label-width="90" label="详细地址">
<ElInput v-model="searchForm.address" placeholder="详细地址" />
</ElFormItem> -->
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
<ElFormItem label="详细地址">
<ElInput v-model="searchForm.address" placeholder="详细地址"/>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<div></div>
<!-- <ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton> -->
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
</template>
<template #columns>
<!-- GeTiHu-个体户QiYe--企业 -->
<ElTableColumn label="主体类型" prop="orgCategoryTxt" />
<ElTableColumn label="主体类型" prop="orgCategoryTxt"/>
<!-- <ElTableColumn label="统一社会信用代码" prop="uscc" /> -->
<ElTableColumn label="组织名称" prop="orgName" width="140"/>
<ElTableColumn label="组织名称" prop="orgName" width="140"/>
<ElTableColumn label="营业执照" width="100px">
<template #default="{ row }">
<el-image :preview-src-list="[AppApi.fileUrl(row.businessLicense)]" :src="AppApi.fileUrl(row.businessLicense)" preview-teleported show-progress style="width: 60px; height: 60px" />
<el-image :preview-src-list="[AppApi.fileUrl(row.businessLicense)]" :src="AppApi.fileUrl(row.businessLicense)" preview-teleported show-progress style="width: 60px; height: 60px"/>
</template>
</ElTableColumn>
<ElTableColumn label="法人名称" prop="legalRepresentative" />
<ElTableColumn label="法人名称" prop="legalRepresentative"/>
<!-- <ElTableColumn label="法人身份证号" prop="idcard" />
<ElTableColumn label="身份证有效期" prop="idcardStartTime"/>
<ElTableColumn label="身份证有效期" prop="idcardEndTime"/> -->
<ElTableColumn label="身份证正面" prop="idcardFront" width="100">
<template #default="{ row }">
<el-image :preview-src-list="[AppApi.fileUrl(row.idcardFront)]" :src="AppApi.fileUrl(row.idcardFront)" preview-teleported show-progress style="width: 60px; height: 60px" />
<el-image :preview-src-list="[AppApi.fileUrl(row.idcardFront)]" :src="AppApi.fileUrl(row.idcardFront)" preview-teleported show-progress style="width: 60px; height: 60px"/>
</template>
</ElTableColumn>
<ElTableColumn label="身份证反面" prop="idcardBack" width="100">
<template #default="{ row }">
<el-image :preview-src-list="[AppApi.fileUrl(row.idcardBack)]" :src="AppApi.fileUrl(row.idcardBack)" preview-teleported show-progress style="width: 60px; height: 60px" />
<el-image :preview-src-list="[AppApi.fileUrl(row.idcardBack)]" :src="AppApi.fileUrl(row.idcardBack)" preview-teleported show-progress style="width: 60px; height: 60px"/>
</template>
</ElTableColumn>
<!-- <ElTableColumn label="省" prop="provinceName"/>
<ElTableColumn label="市" prop="cityName"/> -->
<ElTableColumn label="区县" prop="areaName" />
<ElTableColumn label="乡镇街道" prop="townName" />
<ElTableColumn label="详细地址" prop="address" width="180" />
<ElTableColumn label="区县" prop="areaName"/>
<ElTableColumn label="乡镇街道" prop="townName"/>
<ElTableColumn label="详细地址" prop="address" width="180"/>
<!-- <ElTableColumn label="经度" prop="lng" />
<ElTableColumn label="纬度" prop="lat" /> -->
<ElTableColumn label="创建时间" prop="createTime" width="140" />
<ElTableColumn label="修改时间" prop="modifyTime" width="140" />
<ElTableColumn label="操作" width="180" fixed="right">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<!-- <ElButton text type="primary" @click="modifyHandler(scope)"></ElButton> -->
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<OrgForm ref="orgForm" @edit-succ="paging" />
</Page>
<ElTableColumn label="创建时间" prop="createTime" width="140"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="140"/>
</template>
<OrgForm ref="orgForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import OrgApi from "@/pages/cst/org/org-api.ts";
import OrgForm from "@/pages/cst/org/OrgForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import Utils from "@/common/utils";
import AppApi from "@/common/app/app-api.ts";
import OrgApi from '@/pages/cst/org/org-api.ts'
import OrgForm from '@/pages/cst/org/OrgForm.vue'
import AppApi from '@/common/app/app-api.ts'
import FormPage, { type ActionColumnType } from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<OrgTypes.SearchOrgResult[]>([]));
const searchForm = Utils.resetAble(
reactive<OrgTypes.SearchOrgParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
// const orgFormIns = useTemplateRef<InstanceType<typeof OrgForm>>("orgForm");
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const actionColumn = reactive<ActionColumnType<OrgTypes.SearchOrgResult>>({
tableActions: [
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
OrgApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
// function showDialog(data?: OrgTypes.SearchOrgResult) {
// orgFormIns.value?.open(data);
// }
function delHandler({ row }: { row: OrgTypes.SearchOrgResult }) {
deling.value = true;
OrgApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function research() {
formPageIns.value?.doSearch()
}
// function modifyHandler({ row }: { row: OrgTypes.SearchOrgResult }) {
// showDialog(row);
// }
// function addHandler() {
// showDialog();
// }
function reset() {
searchForm.$reset();
paging();
function paging(param: OrgTypes.SearchOrgParam) {
return OrgApi.paging(param)
}
function paging() {
searching.value = true;
OrgApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,205 +1,76 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="项目名称">
<ElInput v-model="searchForm.projectName" placeholder="项目名称" />
</ElFormItem>
<ElFormItem label-width="90" label="运输工资">
<ElInput v-model="searchForm.orgName" placeholder="运输方客户" />
</ElFormItem>
<!-- <ElFormItem label-width="90" label="运输方组织 Id">
<FormPage
ref="formPage"
:action-column="actionColumn"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="项目名称">
<ElInput
v-model="searchForm.transOrgId"
placeholder="运输方组织 Id"/>
v-model="searchForm.projectName"
placeholder="项目名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="产废方/购买方客户 Id">
<ElFormItem label="区县">
<ElInput
v-model="searchForm.fringeCustomerId"
placeholder="产废方/购买方客户 Id"/>
v-model="searchForm.areaName"
placeholder="区县"/>
</ElFormItem>
<ElFormItem label-width="90" label="产废方/购买方组织 Id">
<ElFormItem label="乡镇街道">
<ElInput
v-model="searchForm.fringeOrgId"
placeholder="产废方/购买方组织 Id"/>
</ElFormItem> -->
<!-- <ElFormItem label-width="90" label="区县">
<ElInput v-model="searchForm.areaName" placeholder="区县" />
v-model="searchForm.townName"
placeholder="乡镇街道"/>
</ElFormItem>
<ElFormItem label-width="90" label="乡镇街道">
<ElInput v-model="searchForm.townName" placeholder="乡镇街道" />
<ElFormItem label="详细地址">
<ElInput
v-model="searchForm.address"
placeholder="详细地址"/>
</ElFormItem>
<ElFormItem label-width="90" label="详细地址">
<ElInput v-model="searchForm.address" placeholder="详细地址" />
</ElFormItem> -->
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<!-- <ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton> -->
<div></div>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<!-- <ElTableColumn label="Id" prop="id"/> -->
<ElTableColumn label="项目名称" prop="projectName" />
</template>
<template #columns>
<ElTableColumn label="项目名称" prop="projectName"/>
<!-- <ElTableColumn label="合同图片" prop="contractPicture"/> -->
<ElTableColumn label="运输方组织" prop="transOrgInfo.orgName" />
<ElTableColumn label="产废方/购买方组织" prop="fringeOrgInfo.orgName" width="200" />
<ElTableColumn label="运输方组织" prop="transOrgInfo.orgName"/>
<ElTableColumn label="产废方/购买方组织" prop="fringeOrgInfo.orgName"/>
<!-- <ElTableColumn label="市" prop="cityName"/> -->
<ElTableColumn label="区县" prop="areaName" />
<ElTableColumn label="乡镇街道" prop="townName" />
<ElTableColumn label="详细地址" prop="address" width="200" />
<ElTableColumn label="合同有效期" prop="contractStartDate" />
<ElTableColumn label="合同有效期" prop="contractEndDate" />
<ElTableColumn label="创建时间" prop="createTime" width="160" />
<ElTableColumn label="修改时间" prop="modifyTime" width="160" />
<ElTableColumn label="操作" width="180" fixed="right">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<!-- <ElButton text type="primary" @click="modifyHandler(scope)"></ElButton> -->
<ElButton text type="primary" @click="showDetail(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<ProjectForm ref="projectForm" @edit-succ="paging" />
<ProjectDetail ref="projectDetail" @edit-succ="paging" />
</Page>
<ElTableColumn label="区县" prop="areaName"/>
<ElTableColumn label="乡镇街道" prop="townName"/>
<ElTableColumn label="详细地址" prop="address"/>
<ElTableColumn label="合同有效期" prop="contractStartDate"/>
<ElTableColumn label="合同有效期" prop="contractEndDate"/>
<ElTableColumn label="创建时间" prop="createTime"/>
<ElTableColumn label="修改时间" prop="modifyTime"/>
</template>
<ProjectForm ref="projectForm" @edit-succ="research"/>
<ProjectDetail ref="projectDetail" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import ProjectApi from "@/pages/cst/project/project-api.ts";
import ProjectDetail from "@/pages/cst/project/ProjectDetail.vue";
import ProjectForm from "@/pages/cst/project/ProjectForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import ProjectApi from '@/pages/cst/project/project-api.ts'
import ProjectDetail from '@/pages/cst/project/ProjectDetail.vue'
import ProjectForm from '@/pages/cst/project/ProjectForm.vue'
import FormPage, { type ActionColumnType } from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = ref<ProjectTypes.SearchProjectResult[]>([]);
const searchForm = ref<ProjectTypes.SearchProjectParam>({
current: 1,
size: 20,
});
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
// const projectFormIns = useTemplateRef<InstanceType<typeof ProjectForm>>('projectForm')
const projectDetailIns = useTemplateRef<InstanceType<typeof ProjectDetail>>("projectDetail");
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const projectDetailIns = useTemplateRef<InstanceType<typeof ProjectDetail>>('projectDetail')
// function showDialog(data?: ProjectTypes.SearchProjectResult) {
// projectFormIns.value?.open(data)
// }
const actionColumn = reactive<ActionColumnType<ProjectTypes.SearchProjectResult>>({
tableActions: [
{
tooltip: '详情',
icon: 'Postcard',
action({row}) {
projectDetailIns.value?.open(row)
},
},
],
})
function delHandler({ row }: { row: ProjectTypes.SearchProjectResult }) {
deling.value = true;
ProjectApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function research() {
formPageIns.value?.doSearch()
}
function showDetail({ row }: { row: ProjectTypes.SearchProjectResult }) {
projectDetailIns.value?.open(row);
function paging(params: ProjectTypes.SearchProjectParam) {
return ProjectApi.paging(params)
}
// function modifyHandler({row}: { row: ProjectTypes.SearchProjectResult }) {
// showDialog(row)
// }
// function addHandler() {
// showDialog()
// }
function reset() {
searchForm.value = {
current: 1,
size: 20,
};
paging();
}
function paging() {
searching.value = true;
ProjectApi.paging(searchForm.value)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.value = res.data?.records ?? [];
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,193 +1,133 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging" label-width="70">
<ElFormItem label-width="90" label="站点名称">
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="站点名称">
<ElInput
v-model="searchForm.stationName"
placeholder="站点名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="详细地址">
<ElFormItem label="省">
<ElInput
v-model="searchForm.provinceName"
placeholder="请输入省"/>
</ElFormItem>
<ElFormItem label="市">
<ElInput
v-model="searchForm.cityName"
placeholder="请输入市"/>
</ElFormItem>
<ElFormItem label="区县">
<ElInput
v-model="searchForm.areaName"
placeholder="请输入区县"/>
</ElFormItem>
<ElFormItem label="乡镇街道">
<ElInput
v-model="searchForm.townName"
placeholder="请输入乡镇街道"/>
</ElFormItem>
<ElFormItem label="详细地址">
<ElInput
v-model="searchForm.address"
placeholder="详细地址"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
<ElFormItem label="经度">
<ElInput
v-model="searchForm.lng"
placeholder="经度"/>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
<ElTableColumn label="所属公司" prop="org.orgName"/>
<ElTableColumn label="站点名称" prop="stationName"/>
<ElTableColumn label="省" prop="provinceName"/>
<ElTableColumn label="市" prop="cityName"/>
<ElTableColumn label="区县" prop="areaName"/>
<ElTableColumn label="乡镇街道" prop="townName"/>
<ElTableColumn label="详细地址" prop="address" width="160px"/>
<ElTableColumn label="经度" prop="lng" width="100px"/>
<ElTableColumn label="纬度" prop="lat" width="100px"/>
<ElTableColumn label="创建时间" prop="createTime" width="170px"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="170px"/>
<ElTableColumn label="操作" width="180" fixed="right">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm
confirm-button-text="是"
cancel-button-text="否"
confirm-button-type="danger"
cancel-button-type="primary"
placement="top"
title="是否删除当前数据?"
width="180"
@confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
layout="->, sizes, total, prev, pager, next"
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:total="totalCount"
:page-sizes="[10, 20, 50, 100, 500]"
:hide-on-single-page="false"
:teleported="false"
@change="paging"/>
<StationForm ref="stationForm" @edit-succ="paging"/>
</Page>
<ElFormItem label="纬度">
<ElInput
v-model="searchForm.lat"
placeholder="纬度"/>
</ElFormItem>
<ElFormItem label="创建时间">
<ElInput
v-model="searchForm.createTime"
placeholder="创建时间"/>
</ElFormItem>
<ElFormItem label="修改时间">
<ElInput
v-model="searchForm.modifyTime"
placeholder="修改时间"/>
</ElFormItem>
</template>
<template #columns>
<ElTableColumn label="所属公司" prop="org.orgName"/>
<ElTableColumn label="站点名称" prop="stationName"/>
<ElTableColumn label="省" prop="provinceName"/>
<ElTableColumn label="市" prop="cityName"/>
<ElTableColumn label="区县" prop="areaName"/>
<ElTableColumn label="乡镇街道" prop="townName"/>
<ElTableColumn label="详细地址" prop="address" width="160px"/>
<ElTableColumn label="经度" prop="lng" width="100px"/>
<ElTableColumn label="纬度" prop="lat" width="100px"/>
<ElTableColumn label="创建时间" prop="createTime" width="170px"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="170px"/>
</template>
<StationForm ref="stationForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import StationApi from '@/pages/cst/station/station-api.ts'
import StationForm from '@/pages/cst/station/StationForm.vue'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import Utils from '@/common/utils'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0)
const tableData = Utils.resetAble(reactive<StationTypes.SearchStationResult[]>([]))
const searchForm = Utils.resetAble(reactive<StationTypes.SearchStationParam>({
current: 1,
size: 20,
}))
const searching = ref(false)
const deling = ref(false)
const showSearchForm = ref(true)
const stationFormIns = useTemplateRef<InstanceType<typeof StationForm>>('stationForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
function showDialog(data?: StationTypes.SearchStationResult) {
stationFormIns.value?.open(data)
}
function delHandler({row}: { row: StationTypes.SearchStationResult }) {
deling.value = true
StationApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
paging()
})
.finally(() => {
deling.value = false
})
}
function modifyHandler({row}: { row: StationTypes.SearchStationResult }) {
showDialog(row)
}
function addHandler() {
showDialog()
}
function reset() {
searchForm.$reset()
paging()
}
function paging() {
searching.value = true
StationApi.paging(searchForm)
.then(res => {
totalCount.value = res.data?.total ?? 0
tableData.$reset(res.data?.records ?? [])
})
.finally(() => {
searching.value = false
})
}
onMounted(() => {
paging()
const actionColumn = reactive<ActionColumnType<StationTypes.SearchStationResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
stationFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return StationApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
stationFormIns.value?.open()
},
},
]
function research() {
formPageIns.value?.doSearch()
}
function paging(params: StationTypes.SearchStationParam) {
return StationApi.paging(params)
}
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,28 +1,18 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="车牌">
<ElInput v-model="searchForm.licensePlate" placeholder="车牌" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="车牌">
<ElInput v-model="searchForm.licensePlate" placeholder="车牌"/>
</ElFormItem>
<ElFormItem label-width="90" label="车架号">
<ElInput v-model="searchForm.vnCode" placeholder="车架号" />
<ElFormItem label="车架号">
<ElInput v-model="searchForm.vnCode" placeholder="车架号"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<div></div>
<!-- <ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton> -->
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<ElTableColumn label="车牌" prop="licensePlate" width="100px"/>
</template>
<template #columns>
<ElTableColumn label="车牌" prop="licensePlate" width="100px"/>
<!-- <ElTableColumn label="行驶证图片" prop="truckLicense" /> -->
<ElTableColumn label="行驶证图片" width="100px">
<template #default="{ row }">
@ -32,7 +22,7 @@
show-progress style="width: 60px; height: 60px"/>
</template>
</ElTableColumn>
<ElTableColumn label="车架号" prop="vnCode" />
<ElTableColumn label="车架号" prop="vnCode"/>
<!-- <ElTableColumn label="合格证图片" prop="qualification" /> -->
<ElTableColumn label="合格证图片" width="100px">
<template #default="{ row }">
@ -42,170 +32,73 @@
<!-- <ElTableColumn label="最大载重(千克)" prop="carryingCapacity" /> -->
<ElTableColumn label="行驶证有效期" width="120px">
<template #default="{ row }"> {{ row.licenseStartDate }} ~ {{ row.licenseEndDate }} </template>
<template #default="{ row }"> {{ row.licenseStartDate }} ~ {{ row.licenseEndDate }}</template>
</ElTableColumn>
<ElTableColumn label="合格证有效期" width="120px">
<template #default="{ row }"> {{ row.qualificationStartDate }} ~ {{ row.qualificationEndDate }} </template>
<template #default="{ row }"> {{ row.qualificationStartDate }} ~ {{ row.qualificationEndDate }}</template>
</ElTableColumn>
<ElTableColumn label="车辆类型" prop="truckCategory" />
<ElTableColumn label="车辆类型" prop="truckCategory"/>
<ElTableColumn label="车辆图片" width="100px">
<template #default="{ row }">
<el-image :preview-src-list="[AppApi.fileUrl(row.picture)]" :src="AppApi.fileUrl(row.picture)" preview-teleported show-progress style="width: 60px; height: 60px"></el-image>
</template>
</ElTableColumn>
<ElTableColumn label="状态" prop="busy">
<template #default="{ row }">
{{ row.busy?'运输中':'空闲' }}
{{ row.busy ? '运输中' : '空闲' }}
</template>
</ElTableColumn>
<ElTableColumn label="创建时间" prop="createTime" width="100px"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="100px"/>
<ElTableColumn label="操作" width="180" fixed="right">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<!-- <ElButton text type="primary" @click="modifyHandler(scope)"></ElButton> -->
<ElButton text type="primary" @click="showDetail(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<TruckForm ref="truckForm" @edit-succ="paging" />
<TruckDetail ref="truckDetail" />
</Page>
<ElTableColumn label="创建时间" prop="createTime" width="100px"/>
</template>
<TruckForm ref="truckForm" @edit-succ="research"/>
<TruckDetail ref="truckDetail"/>
</FormPage>
</template>
<script lang="ts" setup>
import TruckApi from '@/pages/cst/truck/truck-api.ts'
import TruckForm from '@/pages/cst/truck/TruckForm.vue'
import TruckDetail from '@/pages/cst/truck/TruckDetail.vue'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import AppApi from '@/common/app/app-api.ts'
import FormPage, { type ActionColumnType } from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = ref<TruckTypes.SearchTruckResult[]>([]);
const searchForm = ref<TruckTypes.SearchTruckParam>({
current: 1,
size: 20,
});
const truckDetailIns = useTemplateRef<InstanceType<typeof TruckDetail>>('truckDetail')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
// const truckFormIns = useTemplateRef<InstanceType<typeof TruckForm>>("truckForm");
const truckDetailIns = useTemplateRef<InstanceType<typeof TruckDetail>>("truckDetail");
const actionColumn = reactive<ActionColumnType<TruckTypes.SearchTruckResult>>({
tableActions: [
{
tooltip: '详情',
icon: 'Postcard',
action({row}) {
truckDetailIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return TruckApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
// function showDialog(data?: TruckTypes.SearchTruckResult) {
// truckDetailIns.value?.open(data);
// }
function delHandler({ row }: { row: TruckTypes.SearchTruckResult }) {
deling.value = true;
TruckApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function research() {
formPageIns.value?.doSearch()
}
function showDetail({row}: { row: ProjectTypes.SearchProjectResult }) {
truckDetailIns.value?.open(row)
function paging(params: TruckTypes.SearchTruckParam) {
return TruckApi.paging(params)
}
// function modifyHandler({ row }: { row: TruckTypes.SearchTruckResult }) {
// showDialog(row);
// }
// function addHandler() {
// showDialog();
// }
function reset() {
searchForm.value = {
current: 1,
size: 20,
};
paging();
}
function paging() {
searching.value = true;
TruckApi.paging(searchForm.value)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.value = res.data?.records ?? [];
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,171 +1,88 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<!-- <ElFormItem label-width="90" label="业务类型">
<ElInput
v-model="searchForm.bizType"
placeholder="业务类型"/>
</ElFormItem> -->
<ElFormItem label-width="90" label="分类名称">
<ElInput v-model="searchForm.categoryName" placeholder="分类名称" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="分类名称">
<ElInput v-model="searchForm.categoryName" placeholder="分类名称"/>
</ElFormItem>
</template>
<template #simpleSearchFormItem="{ searchForm }">
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
<ElInput v-model="searchForm.categoryName" clearable placeholder="分类名称" @clear="research"/>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<ElTableColumn label="Id" prop="id" />
<ElTableColumn label="业务类型" prop="bizTypeName" />
<ElTableColumn label="分类名称" prop="categoryName" />
</template>
<template #columns>
<ElTableColumn label="业务类型" prop="bizTypeName"/>
<ElTableColumn label="分类名称" prop="categoryName"/>
<ElTableColumn label="图片" prop="picture">
<template #default="{ row }">
<el-image :preview-src-list="[AppApi.fileUrl(row.picture)]" :src="AppApi.fileUrl(row.picture)" preview-teleported show-progress style="width: 60px; height: 60px" />
<el-image :preview-src-list="[AppApi.fileUrl(row.picture)]" :src="AppApi.fileUrl(row.picture)" preview-teleported show-progress style="width: 60px; height: 60px"/>
</template>
</ElTableColumn>
<ElTableColumn label="创建时间" prop="createTime" />
<ElTableColumn label="修改时间" prop="modifyTime" />
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<GoodsCategoryForm ref="goodsCategoryForm" @edit-succ="paging" />
</Page>
<ElTableColumn label="创建时间" prop="createTime"/>
<ElTableColumn label="修改时间" prop="modifyTime"/>
</template>
<GoodsCategoryForm ref="goodsCategoryForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import GoodsCategoryApi from "@/pages/gds/goods-category/goods-category-api.ts";
import GoodsCategoryForm from "@/pages/gds/goods-category/GoodsCategoryForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import Utils from "@/common/utils";
import AppApi from "@/common/app/app-api.ts";
import type { ComponentExposed } from 'vue-component-type-helpers'
import GoodsCategoryApi from '@/pages/gds/goods-category/goods-category-api.ts'
import GoodsCategoryForm from '@/pages/gds/goods-category/GoodsCategoryForm.vue'
import AppApi from '@/common/app/app-api.ts'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<GoodsCategoryTypes.SearchGoodsCategoryResult[]>([]));
const searchForm = Utils.resetAble(
reactive<GoodsCategoryTypes.SearchGoodsCategoryParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
const goodsCategoryFormIns = useTemplateRef<InstanceType<typeof GoodsCategoryForm>>("goodsCategoryForm");
const goodsCategoryFormIns = useTemplateRef<InstanceType<typeof GoodsCategoryForm>>('goodsCategoryForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
goodsCategoryFormIns.value?.open()
},
},
]
const actionColumn = reactive<ActionColumnType<GoodsCategoryTypes.SearchGoodsCategoryResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
goodsCategoryFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return GoodsCategoryApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
function showDialog(data?: GoodsCategoryTypes.SearchGoodsCategoryResult) {
goodsCategoryFormIns.value?.open(data);
function research() {
formPageIns.value?.doSearch()
}
function delHandler({ row }: { row: GoodsCategoryTypes.SearchGoodsCategoryResult }) {
deling.value = true;
GoodsCategoryApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function paging(param: GoodsCategoryTypes.SearchGoodsCategoryParam) {
return GoodsCategoryApi.paging(param)
}
function modifyHandler({ row }: { row: GoodsCategoryTypes.SearchGoodsCategoryResult }) {
showDialog(row);
}
function addHandler() {
showDialog();
}
function reset() {
searchForm.$reset();
paging();
}
function paging() {
searching.value = true;
GoodsCategoryApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,234 +1,109 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="商品编码">
<ElInput v-model="searchForm.sn" placeholder="商品编码" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="商品编码">
<ElInput v-model="searchForm.sn" placeholder="商品编码"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称" />
<ElFormItem label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="规格">
<ElInput v-model="searchForm.specParams" placeholder="规格" />
<ElFormItem label="规格">
<ElInput v-model="searchForm.specParams" placeholder="规格"/>
</ElFormItem>
<!-- 字典代码unit -->
<ElFormItem label-width="90" label="计量单位">
<ElInput v-model="searchForm.unit" placeholder="计量单位" />
<ElFormItem label="计量单位">
<ElInput v-model="searchForm.unit" placeholder="计量单位"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="是否为成品">
<ElInput
v-model="searchForm.fg"
placeholder="是否为成品"/>
<ElFormItem label="备注">
<ElInput v-model="searchForm.memo" placeholder="备注"/>
</ElFormItem>
<ElFormItem label-width="90" label="是否为半成品">
<ElInput
v-model="searchForm.sfg"
placeholder="是否为半成品"/>
<ElFormItem label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="是否为原料">
<ElInput
v-model="searchForm.rg"
placeholder="是否为原料"/>
<ElFormItem label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="排序">
<ElInput
v-model="searchForm.sort"
placeholder="排序"/>
</ElFormItem>
<ElFormItem label-width="90" label="是否可用">
<ElInput
v-model="searchForm.canuse"
placeholder="是否可用"/>
</ElFormItem> -->
<ElFormItem label-width="90" label="备注">
<ElInput v-model="searchForm.memo" placeholder="备注" />
</ElFormItem>
<ElFormItem label-width="90" label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
</ElFormItem>
<ElFormItem label-width="90" label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<!-- <ElTableColumn label="产品类型" prop="goodsCategoryId" /> -->
<ElTableColumn label="商品编码" prop="sn" />
<ElTableColumn label="产品名称" prop="goodsName" />
<ElTableColumn label="规格" prop="specParams" />
</template>
<template #columns>
<ElTableColumn label="商品编码" prop="sn"/>
<ElTableColumn label="产品名称" prop="goodsName"/>
<ElTableColumn label="规格" prop="specParams"/>
<ElTableColumn label="图片" width="100">
<template #default="{ row }">
<el-image :preview-src-list="[AppApi.fileUrl(row.picture)]" :src="AppApi.fileUrl(row.picture)" preview-teleported show-progress style="width: 60px; height: 60px" />
<el-image :preview-src-list="[AppApi.fileUrl(row.picture)]" :src="AppApi.fileUrl(row.picture)" preview-teleported show-progress style="width: 60px; height: 60px"/>
</template>
</ElTableColumn>
<!-- <ElTableColumn label="计量单位" prop="unit" /> -->
<!-- <ElTableColumn label="是否为成品" width="100">
<template #default="{ row }">
{{ row.fg ? "是" : "否" }}
</template>
</ElTableColumn>
<ElTableColumn label="是否为半成品" width="120">
<template #default="{ row }">
{{ row.sfg ? "是" : "否" }}
</template>
</ElTableColumn>
<ElTableColumn label="是否为原料" prop="rg" width="100">
<template #default="{ row }">
{{ row.rg ? "是" : "否" }}
</template>
</ElTableColumn> -->
<ElTableColumn label="是否可用" prop="canuse">
<template #default="{ row }">
{{ row.canuse ? "是" : "否" }}
{{ row.canuse ? '是' : '否' }}
</template>
</ElTableColumn>
<ElTableColumn label="备注" prop="memo" />
<ElTableColumn label="创建时间" prop="createTime" width="160" />
<ElTableColumn label="修改时间" prop="modifyTime" width="160" />
<ElTableColumn label="操作" width="180" fixed="right">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<GoodsForm ref="goodsForm" @edit-succ="paging" />
</Page>
<ElTableColumn label="备注" prop="memo"/>
<ElTableColumn label="创建时间" prop="createTime" width="160"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="160"/>
</template>
<GoodsForm ref="goodsForm" @edit-succ="editSuccHandler"/>
</FormPage>
</template>
<script lang="ts" setup>
import GoodsApi from '@/pages/gds/goods/goods-api.ts'
import GoodsForm from '@/pages/gds/goods/GoodsForm.vue'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import Utils from '@/common/utils'
import AppApi from '@/common/app/app-api.ts'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<GoodsTypes.SearchGoodsResult[]>([]));
const searchForm = Utils.resetAble(
reactive<GoodsTypes.SearchGoodsParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
const goodsFormIns = useTemplateRef<InstanceType<typeof GoodsForm>>("goodsForm");
const goodsFormIns = useTemplateRef<InstanceType<typeof GoodsForm>>('goodsForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
function showDialog(data?: GoodsTypes.SearchGoodsResult) {
goodsFormIns.value?.open(data);
function editSuccHandler() {
formPageIns.value?.doSearch()
}
function delHandler({ row }: { row: GoodsTypes.SearchGoodsResult }) {
deling.value = true;
GoodsApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
}
const actionColumn = reactive<ActionColumnType<GoodsTypes.SearchGoodsResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
goodsFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return GoodsApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
goodsFormIns.value?.open()
},
},
]
function modifyHandler({ row }: { row: GoodsTypes.SearchGoodsResult }) {
showDialog(row);
function paging(param: GoodsTypes.SearchGoodsParam) {
return GoodsApi.paging(param)
}
function addHandler() {
showDialog();
}
function reset() {
searchForm.$reset();
paging();
}
function paging() {
searching.value = true;
GoodsApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,48 +1,36 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="编码">
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging"
:searchFormProps="{labelWidth:'100px',labelPosition:'left'}">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="编码">
<ElInput
v-model="searchForm.sn"
placeholder="编码"/>
</ElFormItem>
<ElFormItem label-width="90" label="终产品">
<ElFormItem label="终产品">
<ElInput
v-model="searchForm.goodsId"
placeholder="终产品"/>
</ElFormItem>
<ElFormItem label-width="90" label="工艺名称">
<ElFormItem label="工艺名称">
<ElInput
v-model="searchForm.craftName"
placeholder="工艺名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="工艺版本号">
<ElFormItem label="工艺版本号">
<ElInput
v-model="searchForm.craftVer"
placeholder="工艺版本号"/>
</ElFormItem>
<ElFormItem label-width="90" label="是否可用">
<ElFormItem label="是否可用">
<ElCheckbox v-model="searchForm.canuse"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
</template>
<template #columns>
<ElTableColumn label="编码" prop="sn"/>
<ElTableColumn label="产品名称" prop="goodsName"/>
<ElTableColumn label="产品编码" prop="goodsSn"/>
@ -55,143 +43,61 @@
</template>
</ElTableColumn>
<ElTableColumn label="备注" prop="memo"/>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElButton text type="primary" @click="configCraftFlow(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:hide-on-single-page="false"
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
@change="paging"/>
<CraftForm ref="craftForm" @edit-succ="paging"/>
<CraftFlow ref="craftFlow" @edit-succ="paging"/>
</Page>
</template>
<CraftForm ref="craftForm" @edit-succ="research"/>
<CraftFlow ref="craftFlow" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import CraftApi from '@/pages/mfg/craft/craft-api.ts'
import CraftForm from '@/pages/mfg/craft/CraftForm.vue'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import Utils from '@/common/utils'
import { ElMessage } from 'element-plus'
import CraftFlow from '@/pages/mfg/craft-flow/CraftFlow.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0)
const tableData = Utils.resetAble(reactive<CraftTypes.SearchCraftResult[]>([]))
const searchForm = Utils.resetAble(reactive<CraftTypes.SearchCraftParam>({
current: 1,
size: 20,
}))
const searching = ref(false)
const showSearchForm = ref(true)
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const craftFormIns = useTemplateRef<InstanceType<typeof CraftForm>>('craftForm')
const craftFlowIns = useTemplateRef<InstanceType<typeof CraftFlow>>('craftFlow')
function showDialog(data?: CraftTypes.SearchCraftResult) {
craftFormIns.value?.open(data)
function research() {
formPageIns.value?.doSearch()
}
function configCraftFlow(data?: CraftTypes.SearchCraftResult) {
craftFlowIns.value?.open(data)
function paging(param: CraftTypes.SearchCraftParam) {
return CraftApi.paging(param)
}
function addHandler() {
showDialog()
}
function reset() {
searchForm.$reset()
paging()
}
function paging() {
searching.value = true
CraftApi.paging(searchForm)
.then(res => {
totalCount.value = res.data?.total ?? 0
tableData.$reset(res.data?.records ?? [])
})
.finally(() => {
searching.value = false
})
}
function disabledCraftHandler(val: string | number | boolean, id: string) {
searching.value = true
CraftApi.disable(id, val as boolean)
.then(() => {
ElMessage.success(val ? '启用成功' : '禁用成功')
paging()
research()
})
}
onMounted(() => {
paging()
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
craftFormIns.value?.open()
},
},
]
const actionColumn = reactive<ActionColumnType<CraftTypes.SearchCraftResult>>({
tableActions: [
{
tooltip: '配置工艺流程',
icon: 'Edit',
action({row}) {
craftFlowIns.value?.open(row)
},
},
],
})
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,8 +1,10 @@
<template>
<Page class="dict-page">
<DictCategory @search-dict="searchDict"/>
<ElDivider direction="vertical"/>
<DictItem ref="dictItem"/>
<Page>
<div class="dict-page">
<DictCategory @search-dict="searchDict"/>
<ElDivider direction="vertical"/>
<DictItem ref="dictItem"/>
</div>
</Page>
</template>
<script lang="ts" setup>

View File

@ -56,7 +56,7 @@
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
background layout="total, prev, pager, next, sizes, jumper"
@change="paging"/>
<DictForm ref="dictForm" @edit-succ="paging"/>
</div>

View File

@ -1,133 +1,85 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="端点地址">
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="端点地址">
<ElInput
v-model="searchForm.endpointPath"
placeholder="端点地址"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
</template>
<template #columns>
<ElTableColumn label="请求方式" prop="requestMethod"/>
<ElTableColumn label="路由前缀" prop="routingPath"/>
<ElTableColumn label="端点地址" prop="endpointPath"/>
<ElTableColumn label="访问模式" prop="accessModelTxt"/>
<ElTableColumn label="备注" prop="memo"/>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm
cancel-button-text="否"
cancel-button-type="primary"
confirm-button-text="是"
confirm-button-type="danger"
placement="top"
title="是否删除当前数据?"
width="180"
@confirm="delHandler(scope)">
<template #reference>
<ElButton :loading="deling" text type="danger">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:hide-on-single-page="false"
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
@change="paging"/>
<EndpointForm ref="endpointForm" @edit-succ="paging"/>
</Page>
</template>
<EndpointForm ref="endpointForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import EndpointApi from '@/pages/sys/endpoint/endpoint-api.ts'
import EndpointForm from '@/pages/sys/endpoint/EndpointForm.vue'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0)
const tableData = ref<EndpointTypes.SearchEndpointResult[]>([])
const searchForm = ref<EndpointTypes.SearchEndpointParam>({
current: 1,
size: 20,
})
const searching = ref(false)
const deling = ref(false)
const showSearchForm = ref(true)
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const endpointFormIns = useTemplateRef<InstanceType<typeof EndpointForm>>('endpointForm')
function showDialog(data?: EndpointTypes.SearchEndpointResult) {
endpointFormIns.value?.open(data)
function research() {
formPageIns.value?.doSearch()
}
function delHandler({row}: { row: EndpointTypes.SearchEndpointResult }) {
deling.value = true
EndpointApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
paging()
})
.finally(() => {
deling.value = false
})
}
function modifyHandler({row}: { row: EndpointTypes.SearchEndpointResult }) {
showDialog(row)
}
function addHandler() {
showDialog()
}
function reset() {
searchForm.value = {
current: 1,
size: 20,
}
paging()
}
function paging() {
searching.value = true
EndpointApi.paging(searchForm.value)
.then(res => {
totalCount.value = res.data?.total ?? 0
tableData.value = res.data?.records ?? []
})
.finally(() => {
searching.value = false
})
}
onMounted(() => {
paging()
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
endpointFormIns.value?.open()
},
},
]
const actionColumn = reactive<ActionColumnType<EndpointTypes.SearchEndpointResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
endpointFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return EndpointApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
function paging(param: EndpointTypes.SearchEndpointParam) {
return EndpointApi.paging(param)
}
</script>
<style lang="stylus" scoped>

View File

@ -1,154 +1,43 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="表名称">
<FormPage
:action-column="actionColumn"
:paging="paging">
<template #searchFormItem="{searchForm}">
<ElFormItem label="表名称">
<ElInput
v-model="searchForm.tableName"
placeholder="表名称"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
</template>
<template #columns>
<ElTableColumn label="数据库名称" prop="tableSchema"/>
<ElTableColumn label="表名称" prop="tableName"/>
<ElTableColumn label="备注" prop="tableComment"/>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElButton text type="primary" @click="previewHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:hide-on-single-page="false"
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
@change="paging"/>
</template>
<CodePreview ref="codePreview"/>
</Page>
</FormPage>
</template>
<script lang="ts" setup>
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import CodePreview from '@/pages/sys/gen/db-table/CodePreview.vue'
import DbTableApi from '@/pages/sys/gen/db-table/db-table-api.ts'
import FormPage, { type ActionColumnType } from '@/components/page/FormPage.vue'
const totalCount = ref(0)
const tableData = ref<DbTableTypes.TableInfo[]>([])
const searchForm = ref<DbTableTypes.SearchTplParam>({
current: 1,
size: 20,
})
const searching = ref(false)
const showSearchForm = ref(true)
const codePreviewIns = useTemplateRef<InstanceType<typeof CodePreview>>('codePreview')
function showDialog(data?: DbTableTypes.TableInfo) {
codePreviewIns.value?.open(data)
}
function previewHandler({row}: { row: DbTableTypes.TableInfo }) {
showDialog(row)
}
function reset() {
searchForm.value = {
current: 1,
size: 20,
}
paging()
}
function paging() {
searching.value = true
DbTableApi.tablePaing(searchForm.value)
.then(res => {
totalCount.value = res.data?.total ?? 0
tableData.value = res.data.records ?? []
})
.finally(() => {
searching.value = false
})
}
onMounted(() => {
paging()
const actionColumn = reactive<ActionColumnType<DbTableTypes.TableInfo>>({
tableActions: [
{
tooltip: '预览',
icon: 'Edit',
action({row}: { row: DbTableTypes.TableInfo }) {
codePreviewIns.value?.open(row)
},
},
],
})
function paging(param: DbTableTypes.SearchTplParam) {
return DbTableApi.tablePaing(param)
}
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
.pagination {
justify-content: end;
margin: 8px;
}
</style>

View File

@ -1,16 +1,20 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="模板名称">
<FormPage
ref="formPage"
:action-column="actionColumn"
:default-search-form="defaultSearchForm"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{searchForm}">
<ElFormItem label="模板名称">
<ElInput
v-model="searchForm.tplName"
placeholder="模板名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="前端/后端">
<ElFormItem label="前端/后端">
<ElSelect
v-model="searchForm.lang"
placeholder="前端/后端"
style="width: 180px"
>
<ElOption
label="前端"
@ -20,22 +24,8 @@
value="java"/>
</ElSelect>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
</template>
<template #columns>
<ElTableColumn label="模板名称" prop="tplName"/>
<ElTableColumn label="前端/后端" prop="lang">
@ -49,165 +39,68 @@
<span>{{ (row.tpl != null && (row.tpl?.content?.length ?? 0) > 20) ? row.tpl!.content!.substring(0, 19) + '...' : row.tpl?.content }}</span>
</template>
</ElTableColumn>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<el-popconfirm
cancel-button-text="否"
cancel-button-type="primary"
confirm-button-text="是"
confirm-button-type="danger"
placement="top"
title="是否删除当前数据?"
width="180"
@confirm="delHandler(scope)">
<template #reference>
<ElButton :loading="deling" text type="danger">删除</ElButton>
</template>
</el-popconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:hide-on-single-page="false"
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
@change="paging"/>
<TplForm ref="tplForm" @edit-succ="paging"/>
</Page>
</template>
<TplForm ref="tplForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import TplApi from '@/pages/sys/gen/tpl/tpl-api.ts'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import TplForm from '@/pages/sys/gen/tpl/TplForm.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0)
const tableData = ref<TplTypes.SearchTplResult[]>([])
const searchForm = ref<TplTypes.SearchTplParam>({
current: 1,
size: 20,
const defaultSearchForm: TplTypes.SearchTplParam = {
orders: 'lang,tpl_name',
tpl: {},
})
const searching = ref(false)
const deling = ref(false)
const showSearchForm = ref(true)
}
const tplFormIns = useTemplateRef<InstanceType<typeof TplForm>>('tplForm')
function showDialog(data?: TplTypes.SearchTplResult) {
tplFormIns.value?.open(data)
}
function delHandler({row}: { row: TplTypes.SearchTplResult }) {
deling.value = true
TplApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
paging()
})
.finally(() => {
deling.value = false
})
}
function modifyHandler({row}: { row: TplTypes.SearchTplResult }) {
showDialog(row)
}
function addHandler() {
showDialog()
}
function reset() {
searchForm.value = {
current: 1,
size: 20,
orders: 'lang,tpl_name',
tpl: {},
}
paging()
}
function paging() {
searching.value = true
TplApi.paging(searchForm.value)
.then(res => {
totalCount.value = res.data?.total ?? 0
tableData.value = res.data?.records ?? []
})
.finally(() => {
searching.value = false
})
}
onMounted(() => {
paging()
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
tplFormIns.value?.open()
},
},
]
const actionColumn = reactive<ActionColumnType<TplTypes.SearchTplResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
tplFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return TplApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
function research() {
formPageIns.value?.doSearch()
}
function paging(param: TplTypes.SearchTplParam) {
return TplApi.paging(param)
}
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
.pagination {
justify-content: end;
margin: 8px;
}
</style>

View File

@ -12,15 +12,10 @@
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<!--
lazy
:load="treeLoad"
-->
<ElTable v-loading="searching"
:data="tableData"
lazy
@ -104,6 +99,7 @@ const deling = ref(false)
function showDialog(data?: MenuTypes.MenuForm) {
menuFormIns.value?.open(data)
}
function delHandler({row}: { row: MenuTypes.MenuForm, }) {
deling.value = true
@ -152,23 +148,23 @@ function treeLoad(row: MenuTypes.SysMenu, expanded: any, resolve: (data: MenuTyp
if (resolve == null && !expanded) return
searching.value = true
MenuApi.listAll({...searchForm.value, pid: row.id})
.then(res => {
if (resolve!=null){
resolve(res.data?.map(it => {
it.hasChildren = true
return it
}) ?? [])
} else {
dataTableIns.value?.updateKeyChildren(row.id, res.data?.map(it => {
it.hasChildren = true
it.children = []
return it
}) ?? [])
}
})
.finally(() => {
searching.value = false
})
.then(res => {
if (resolve != null) {
resolve(res.data?.map(it => {
it.hasChildren = true
return it
}) ?? [])
} else {
dataTableIns.value?.updateKeyChildren(row.id, res.data?.map(it => {
it.hasChildren = true
it.children = []
return it
}) ?? [])
}
})
.finally(() => {
searching.value = false
})
}
onMounted(() => {

View File

@ -1,211 +1,110 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="角色代码">
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="角色代码">
<ElInput
v-model="searchForm.roleCode"
placeholder="角色代码"/>
</ElFormItem>
<ElFormItem label-width="90" label="角色名称">
<ElFormItem label="角色名称">
<ElInput
v-model="searchForm.roleName"
placeholder="角色名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="备注">
<ElFormItem label="备注">
<ElInput
v-model="searchForm.memo"
placeholder="备注"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
</template>
<template #columns>
<ElTableColumn label="角色代码" prop="roleCode"/>
<ElTableColumn label="角色名称" prop="roleName"/>
<ElTableColumn label="备注" prop="memo"/>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm
v-if="scope.row.id != '1'"
cancel-button-text="否"
cancel-button-type="primary"
confirm-button-text="是"
confirm-button-type="danger"
placement="top"
title="是否删除当前数据?"
width="180"
@confirm="delHandler(scope)">
<template #reference>
<ElButton :loading="deling" text type="danger">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="bindResHandler(scope)"></ElButton>
<ElButton v-if="scope.row.id != '1'" text type="primary" @cl--ick="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:hide-on-single-page="false"
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
@change="paging"/>
<RoleForm ref="roleForm" @edit-succ="paging"/>
</template>
<RoleForm ref="roleForm" @edit-succ="research"/>
<BindRes ref="bindRes"/>
</Page>
</FormPage>
</template>
<script lang="ts" setup>
import RoleApi from '@/pages/sys/role/role-api.ts'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import RoleForm from '@/pages/sys/role/RoleForm.vue'
import { ElMessage } from 'element-plus'
import BindRes from '@/pages/sys/role/BindRes.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0)
const tableData = ref<RoleTypes.SearchRoleResult[]>([])
const searchForm = ref<RoleTypes.SearchRoleParam>({
current: 1,
size: 20,
})
const searching = ref(false)
const deling = ref(false)
const showSearchForm = ref(true)
const roleFormIns = useTemplateRef<InstanceType<typeof RoleForm>>('roleForm')
const bindResIns = useTemplateRef<InstanceType<typeof BindRes>>('bindRes')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
function showDialog(data?: RoleTypes.SearchRoleResult) {
roleFormIns.value?.open(data)
}
function delHandler({row}: { row: RoleTypes.SearchRoleResult }) {
if (row.id == '1') {
ElMessage.error('不能操作管理员')
return
}
deling.value = true
RoleApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
paging()
})
.finally(() => {
deling.value = false
})
}
function bindResHandler({row}: { row: RoleTypes.SearchRoleResult }) {
bindResIns.value?.open(row.id!)
}
function modifyHandler({row}: { row: RoleTypes.SearchRoleResult }) {
if (row.id == '1') {
ElMessage.error('不能操作管理员')
return
}
showDialog(row)
}
function addHandler() {
showDialog()
}
function reset() {
searchForm.value = {
current: 1,
size: 20,
}
paging()
}
function paging() {
searching.value = true
RoleApi.paging({
...searchForm.value,
})
.then(res => {
totalCount.value = res.data?.total ?? 0
tableData.value = res.data?.records ?? []
})
.finally(() => {
searching.value = false
})
}
onMounted(() => {
paging()
const actionColumn = reactive<ActionColumnType<RoleTypes.SearchRoleResult>>({
tableActions: [
{
tooltip: '资源',
icon: 'Edit',
show({row}) {
return row.id != '1'
},
action({row}: { row: RoleTypes.SearchRoleResult }) {
bindResIns.value?.open(row.id!)
},
},
{
tooltip: '编辑',
icon: 'Edit',
action({row}: { row: RoleTypes.SearchRoleResult }) {
if (row.id == '1') {
ElMessage.error('不能操作管理员')
return
}
roleFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}: { row: RoleTypes.SearchRoleResult }) {
if (row.id == '1') {
ElMessage.error('不能操作管理员')
return Promise.resolve(false)
}
return RoleApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
roleFormIns.value?.open()
},
},
]
function research() {
formPageIns.value?.doSearch()
}
function paging(params: RoleTypes.SearchRoleParam) {
return RoleApi.paging(params)
}
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,92 +1,18 @@
<script lang="ts" setup>
import Page from '@/components/page/Page.vue'
import SnConfigApi from '@/pages/sys/sn-config/sn-config-api.ts'
import { descConfig } from '@/pages/sys/sn-config/sn-config-util.ts'
import SnConfigForm from '@/pages/sys/sn-config/SnConfigForm.vue'
import Strings from '@/common/utils/strings.ts'
import { elIcons } from '@/common/element/element.ts'
const snConfigFormIns = useTemplateRef<InstanceType<typeof SnConfigForm>>('snConfigForm')
function addHandler() {
snConfigFormIns.value?.open()
}
function reset() {
searchForm.value = {}
searchHandler()
}
const searchForm = ref<SnConfigTypes.SearchSnConfigParam>({
snname: undefined,
sncode: undefined,
current: 1,
size: 20,
})
const searching = ref(false)
const totalCount = ref(0)
const datasource = ref<SnConfigTypes.SnConfigDetail[]>([])
function searchHandler() {
searching.value = true
SnConfigApi.paging(searchForm.value)
.then((res) => {
totalCount.value = res.data?.total ?? 0
datasource.value = res.data.records.map((it) => ({
key: it.id,
...it,
configDesc: descConfig(it.config).join('\n'),
}))
})
.finally(() => {
searching.value = false
})
}
function modify(record: SnConfigTypes.SnConfigDetail) {
snConfigFormIns.value?.open(record)
}
function del(record: SnConfigTypes.SnConfigDetail) {
console.log(record)
SnConfigApi.del(record.id)
.then(() => {
ElMessage.success('删除成功')
searchHandler()
})
}
onMounted(() => {
searchHandler()
})
</script>
<template>
<Page>
<ElForm class="search-form" inline @submit.prevent="searchHandler">
<ElFormItem :gutter="[0, 10]" label="规则名称">
<ElInput clearable control="snname" placeholder="请输入规则名称"/>
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="searchHandler">
<template #searchFormItem="{searchForm}">
<ElFormItem label="规则名称">
<ElInput v-model="searchForm.snname" clearable placeholder="请输入规则名称"/>
</ElFormItem>
<ElFormItem :gutter="[0, 10]" label="规则代码">
<ElInput clearable control="sncode" placeholder="请输入规则代码"/>
<ElFormItem label="规则代码">
<ElInput v-model="searchForm.sncode" clearable placeholder="请输入规则代码"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
</div>
<ElTable
v-loading="searching" :data="datasource"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
</template>
<template #columns>
<ElTableColumn label="规则名称" prop="snname" width="180"/>
<ElTableColumn label="规则代码" prop="sncode" width="170"/>
<ElTableColumn label="示例" prop="example" width="200"/>
@ -99,89 +25,69 @@ onMounted(() => {
</template>
</ElTableColumn>
<ElTableColumn label="备注" prop="memo" width="200"/>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<ElPopconfirm
cancel-button-text="否"
cancel-button-type="primary"
confirm-button-text="是"
confirm-button-type="danger"
placement="top"
title="是否删除当前数据?"
width="180"
@confirm="del(scope)">
<template #reference>
<ElButton text type="danger">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modify(scope.row)"></ElButton>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:hide-on-single-page="false"
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
@change="searchHandler"/>
<SnConfigForm ref="snConfigForm" @close="searchHandler"/>
</Page>
</template>
<SnConfigForm ref="snConfigForm" @close="research"/>
</FormPage>
</template>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
<script lang="ts" setup>
import SnConfigApi from '@/pages/sys/sn-config/sn-config-api.ts'
import SnConfigForm from '@/pages/sys/sn-config/SnConfigForm.vue'
import Strings from '@/common/utils/strings.ts'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
:deep(.table-header) {
color #454C59
const snConfigFormIns = useTemplateRef<InstanceType<typeof SnConfigForm>>('snConfigForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
function searchHandler(param: SnConfigTypes.SearchSnConfigParam) {
return SnConfigApi.paging(param)
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
const actionColumn = reactive<ActionColumnType<SnConfigTypes.SnConfigDetail>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
snConfigFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return SnConfigApi.del(row.id)
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
snConfigFormIns.value?.open()
},
},
]
function research() {
formPageIns.value?.doSearch()
}
</style>
</script>

View File

@ -1,26 +1,30 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="任务名称">
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{searchForm}">
<ElFormItem label="任务名称">
<ElInput
v-model="searchForm.taskName"
placeholder="任务名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="任务执行函数">
<ElFormItem label="任务执行函数">
<ElInput
v-model="searchForm.fn"
placeholder="任务执行函数"/>
</ElFormItem>
<ElFormItem label-width="90" label="调度方式">
<ElFormItem label="调度方式">
<ElSelect
v-model="searchForm.scheduleType"
clearable placeholder="请选择调度方式" style="width: 150px" @change="paging" @clear="paging">
<ElOption v-for="item in scheduleTypeList" :key="item.value" :label="item.label" :value="item.value"/>
</ElSelect>
</ElFormItem>
<ElFormItem label-width="90" label="内部任务">
<ElFormItem label="内部任务">
<ElCheckbox
@change="paging"
@change="research"
v-model="searchForm.builtin"
placeholder="内部任务"/>
</ElFormItem>
@ -30,21 +34,8 @@
<ElOption :value="false" label="启用"/>
</ElSelect>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
</template>
<template #columns>
<ElTableColumn label="任务名称" prop="taskName"/>
<ElTableColumn label="任务执行函数" prop="fn" show-overflow-tooltip width="150"/>
@ -72,201 +63,117 @@
</ElTableColumn>
<ElTableColumn label="备注" prop="memo"/>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<el-popconfirm
v-if="!scope.row.builtin"
cancel-button-type="primary"
cancel-button-text="否"
confirm-button-type="danger"
confirm-button-text="是"
placement="top"
title="是否删除当前数据?"
width="180"
@confirm="delHandler(scope)">
<template #reference>
<ElButton :loading="deling" text type="danger">删除</ElButton>
</template>
</el-popconfirm>
<ElButton v-if="!scope.row.builtin" text type="primary" @click="modifyHandler(scope)"></ElButton>
<ElButton v-if="!scope.row.builtin" text type="primary" @click="disable(scope)">{{ scope.row.disabled ? '' : '' }}</ElButton>
<ElButton v-if="!scope.row.disabled" text type="primary" @click="trigger(scope)"></ElButton>
<ElButton text type="primary" @click="showRecode(scope.row.id)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
class="pagination"
layout="prev, pager, next"
:page-size="pagination.size"
:total="pagination.total"
@change="pageChangeHandler"/>
<TaskForm ref="taskForm" @edit-succ="paging"/>
</template>
<TaskForm ref="taskForm" @edit-succ="research"/>
<ScheduleRecodePanel ref="scheduleRecodePanel"/>
</Page>
</FormPage>
</template>
<script lang="ts" setup>
import TaskApi from '@/pages/sys/task/task-api.ts'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import TaskForm from '@/pages/sys/task/TaskForm.vue'
import ScheduleRecodePanel from '@/pages/sys/task/schedule-recode/ScheduleRecodePanel.vue'
import Times from '@/common/utils/times.ts'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
function research() {
formPageIns.value?.doSearch()
}
const tableData = ref<TaskTypes.SearchTaskResult[]>([])
const searchForm = ref<TaskTypes.SearchTaskParam>({
current: 1,
size: 20,
builtin: false,
})
const searching = ref(false)
const deling = ref(false)
const showSearchForm = ref(true)
const taskFormIns = useTemplateRef<InstanceType<typeof TaskForm>>('taskForm')
const scheduleRecodePanelIns = useTemplateRef<InstanceType<typeof ScheduleRecodePanel>>('scheduleRecodePanel')
const pagination = reactive<G.Pagination>({
total: 0,
pages: 0,
current: 1,
size: 1,
})
const scheduleTypeList = [
{value: 'Manually', label: '手动'},
{value: 'Fixed', label: '固定周期'},
{value: 'Cron', label: '自定义'},
]
function pageChangeHandler(currentPage: number, pageSize: number) {
searchForm.value.current = currentPage
searchForm.value.size = pageSize
paging()
}
function showDialog(data?: TaskTypes.SearchTaskResult) {
taskFormIns.value?.open(data)
}
const actionColumn = reactive<ActionColumnType<TaskTypes.SearchTaskResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
show({row}) {
return !row.builtin
},
action({row}) {
taskFormIns.value?.open(row)
},
},
{
tooltip({row}) {
return row.disabled ? '启用' : '禁用'
},
show({row}) {
return !row.builtin
},
icon: 'Edit',
action({row}) {
return TaskApi.disable(row.id!, !row.disabled!)
.then(() => {
ElMessage.success(row.disabled ? '启用成功' : '禁用成功')
return true
})
},
},
{
tooltip: '执行一次',
icon: 'Edit',
show({row}) {
return !row.disabled
},
action({row}) {
TaskApi.trigger(row.id!)
.then(() => {
ElMessage.success('已提交触发请求')
})
},
},
{
tooltip: '调度记录',
icon: 'Edit',
action({row}) {
scheduleRecodePanelIns.value?.open(row.id!)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
this.loading = true
return TaskApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
function delHandler({row}: { row: TaskTypes.SearchTaskResult }) {
deling.value = true
TaskApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
paging()
})
.finally(() => {
deling.value = false
})
}
function modifyHandler({row}: { row: TaskTypes.SearchTaskResult }) {
showDialog(row)
}
function trigger({row}: { row: TaskTypes.SearchTaskResult }) {
TaskApi.trigger(row.id!)
.then(() => {
ElMessage.success('已提交触发请求')
})
}
function disable({row}: { row: TaskTypes.SearchTaskResult }) {
TaskApi.disable(row.id!, !row.disabled!)
.then(() => {
ElMessage.success(row.disabled ? '启用成功' : '禁用成功')
paging()
})
}
function addHandler() {
showDialog()
}
function reset() {
searchForm.value = {
current: 1,
size: 20,
builtin: false,
}
paging()
}
function paging() {
searching.value = true
TaskApi.paging(searchForm.value)
.then(res => {
tableData.value = res.data?.records ?? []
})
.finally(() => {
searching.value = false
})
}
function showRecode(id: string) {
scheduleRecodePanelIns.value?.open(id)
}
onMounted(() => {
paging()
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
taskFormIns.value?.open()
},
},
]
function paging(param: TaskTypes.SearchTaskParam) {
return TaskApi.paging(param)
}
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
.pagination {
justify-content: end;
margin: 8px;
}
</style>

View File

@ -40,6 +40,7 @@ declare global {
criticalTiming?: string
// 是否禁用
disabled?: boolean
builtin?: boolean
// 备注
memo?: string
}

View File

@ -1,31 +1,22 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="姓名">
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{searchForm}">
<ElFormItem label="姓名">
<ElInput
v-model="searchForm.nickname"
placeholder="姓名"/>
</ElFormItem>
<ElFormItem label-width="90" label="手机号">
<ElFormItem label="手机号">
<ElInput
v-model="searchForm.phone"
placeholder="手机号"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
</div>
<ElTable v-loading="searching" :data="tableData"
cell-class-name="table-cell"
class="table-list"
empty-text="暂无数据"
header-row-class-name="table-header"
row-key="id">
</template>
<template #columns>
<ElTableColumn label="姓名" prop="nickname"/>
<ElTableColumn label="头像" prop="avatar" width="60">
<template #default="{row}">
@ -55,35 +46,13 @@
</template>
</ElTableColumn>
<ElTableColumn label="注册时间" prop="account.regdate" width="170"/>
<ElTableColumn label="操作" width="180">
<template #default="scope">
<!-- <ElButton text type="danger" :loading="deling" @click="delHandler(scope)"></ElButton> -->
<div class="action-btn">
<ElButton text type="primary" @click="bindRoleHandler(scope)"></ElButton>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
<ElButton v-if="scope.row.id != '1'" text type="primary" @click="resetPasswd(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination
v-model:current-page="searchForm.current"
v-model:page-size="searchForm.size"
:hide-on-single-page="false"
:page-sizes="[10, 20, 50, 100, 500]"
:teleported="false"
:total="totalCount"
layout="->, sizes, total, prev, pager, next"
@change="paging"/>
</template>
<UserForm ref="userForm" @edit-succ="paging"/>
<BindRole ref="bindRole"/>
</Page>
</FormPage>
</template>
<script lang="ts" setup>
import UserApi from '@/pages/sys/user/user-api.ts'
import Page from '@/components/page/Page.vue'
import { elIcons } from '@/common/element/element.ts'
import UserForm from '@/pages/sys/user/UserForm.vue'
import {
type CheckboxValueType,
@ -92,76 +61,27 @@ import {
import AppApi from '@/common/app/app-api.ts'
import BindRole from '@/pages/sys/user/BindRole.vue'
import ClientUtil from '@/common/utils/client-util.ts'
import Utils from '@/common/utils'
import Strings from '@/common/utils/strings.ts'
import Avatar from '@/assets/images/avatar.png'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0)
const tableData = Utils.resetAble(reactive<UserTypes.SearchUserResult[]>([]))
const searchForm = Utils.resetAble(reactive<UserTypes.SearchUserParam>({
current: 1,
size: 20,
}))
const searching = ref(false)
// const deling = ref(false)
const showSearchForm = ref(true)
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const userFormIns = useTemplateRef<InstanceType<typeof UserForm>>('userForm')
const bindRoleIns = useTemplateRef<InstanceType<typeof BindRole>>('bindRole')
function showDialog(data?: UserTypes.SearchUserResult) {
userFormIns.value?.open(data)
}
/* function delHandler({row}: { row: UserTypes.SearchUserResult }) {
if (row.id == '1') {
ElMessage.error('不能删除管理员')
return
}
deling.value = true
UserApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
paging()
})
.finally(() => {
deling.value = false
})
} */
function modifyHandler({row}: { row: UserTypes.SearchUserResult }) {
showDialog(row)
}
function resetPasswd({row}: { row: UserTypes.SearchUserResult }) {
if (row.id == '1') {
ElMessage.error('不能修改管理员')
return
}
UserApi.resetPasswd(row.id!)
.then((res) => {
ElMessage.success(res.msg)
})
}
function bindRoleHandler({row}: { row: UserTypes.SearchUserResult }) {
bindRoleIns.value?.open(row.id!)
}
function addHandler() {
showDialog()
}
function reset() {
searchForm.$reset()
paging()
function research() {
formPageIns.value?.doSearch()
}
function clientChangeHandler(clients: CheckboxValueType[], data: UserTypes.SearchUserResult) {
searching.value = true
UserApi.bindClient(data.id!, clients as number[])
.then(() => {
ElMessage.success('修改成功')
paging()
research()
})
}
@ -170,87 +90,70 @@ function disabledUserHandler(val: string | number | boolean, id: string) {
ElMessage.error('不能操作管理员')
return
}
searching.value = true
UserApi.disable(id, val as boolean)
.then(() => {
ElMessage.success(val ? '禁用成功' : '启用成功')
paging()
research()
})
}
function paging() {
searching.value = true
UserApi.paging(searchForm)
const actionColumn = reactive<ActionColumnType<UserTypes.SearchUserResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
userFormIns.value?.open(row)
},
},
{
tooltip: '权限',
icon: 'Edit',
action({row}) {
bindRoleIns.value?.open(row.id!)
},
},
{
tooltip: '重置密码',
icon: 'Edit',
show({row}) {
return row.id != '1'
},
action({row}) {
if (row.id == '1') {
ElMessage.error('不能修改管理员')
return
}
UserApi.resetPasswd(row.id!)
.then((res) => {
ElMessage.success(res.msg)
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
userFormIns.value?.open()
},
},
]
function paging(param: UserTypes.SearchUserParam) {
return UserApi.paging(param)
.then(res => {
totalCount.value = res.data?.total ?? 0
tableData.$reset((res.data?.records ?? []).map(it => {
(res.data?.records ?? []).map(it => {
it.account.clients = ClientUtil.getClients(it.account.clientCode!).map(it => it.val)
return it
}))
})
.finally(() => {
searching.value = false
})
return res
})
}
onMounted(() => {
paging()
})
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
.avatar {
width: 100%;
height: 100%;

View File

@ -1,206 +1,110 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<!-- <ElFormItem label-width="90" label="Id">
<ElInput
v-model="searchForm.id"
placeholder="Id"/>
</ElFormItem> -->
<ElFormItem label-width="90" label="编号">
<ElInput v-model="searchForm.sn" placeholder="编号" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="编号">
<ElInput v-model="searchForm.sn" placeholder="编号"/>
</ElFormItem>
<ElFormItem label-width="90" label="仓库">
<ElInput v-model="searchForm.warehouseId" placeholder="仓库" />
<ElFormItem label="仓库">
<ElInput v-model="searchForm.warehouseId" placeholder="仓库"/>
</ElFormItem>
<ElFormItem label-width="90" label="存放位置">
<ElInput v-model="searchForm.location" placeholder="存放位置" />
<ElFormItem label="存放位置">
<ElInput v-model="searchForm.location" placeholder="存放位置"/>
</ElFormItem>
<ElFormItem label-width="90" label="入库时间">
<ElInput v-model="searchForm.inTime" placeholder="入库时间" />
<ElFormItem label="入库时间">
<ElInput v-model="searchForm.inTime" placeholder="入库时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="采购单">
<ElInput v-model="searchForm.orderId" placeholder="采购单" />
<ElFormItem label="采购单">
<ElInput v-model="searchForm.orderId" placeholder="采购单"/>
</ElFormItem>
<ElFormItem label-width="90" label="采购单单号">
<ElInput v-model="searchForm.orderSn" placeholder="采购单单号" />
<ElFormItem label="采购单单号">
<ElInput v-model="searchForm.orderSn" placeholder="采购单单号"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品分类 Id">
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类 Id" />
<ElFormItem label="产品分类 Id">
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类 Id"/>
</ElFormItem>
<ElFormItem label-width="90" label="分类名称">
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
<ElFormItem label="分类名称">
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称" />
<ElFormItem label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
</ElFormItem>
<ElFormItem label-width="90" label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
</ElFormItem> -->
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<ElTableColumn label="编号" prop="sn" />
<!-- <ElTableColumn label="责任人" prop="responsibleId" /> -->
<ElTableColumn label="仓库" prop="warehouseName" />
<ElTableColumn label="存放位置" prop="location" />
<ElTableColumn label="入库时间" prop="inTime" width="170px" />
<!-- <ElTableColumn label="采购单" prop="orderId" /> -->
<ElTableColumn label="采购单单号" prop="orderSn" width="170px" />
<!-- <ElTableColumn label="产品分类 Id" prop="goodsCategoryId" /> -->
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
<ElTableColumn label="产品名称" prop="goodsName" />
<ElTableColumn label="商品编码" prop="goodSn" width="100px" />
<ElTableColumn label="数量" prop="quantity" />
<ElTableColumn label="计量单位" prop="unit" />
<ElTableColumn label="备注" prop="memo" />
<ElTableColumn label="创建时间" prop="createTime" width="170px" />
<ElTableColumn label="修改时间" prop="modifyTime" width="170px" />
<ElTableColumn label="操作" width="180" fixed="right">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<InOrderForm ref="inOrderForm" @edit-succ="paging" />
</Page>
</template>
<template #columns>
<ElTableColumn label="编号" prop="sn"/>
<ElTableColumn label="仓库" prop="warehouseName"/>
<ElTableColumn label="存放位置" prop="location"/>
<ElTableColumn label="入库时间" prop="inTime" width="170px"/>
<ElTableColumn label="采购单单号" prop="orderSn" width="170px"/>
<ElTableColumn label="分类名称" prop="goodsCategoryName"/>
<ElTableColumn label="产品名称" prop="goodsName"/>
<ElTableColumn label="商品编码" prop="goodSn" width="100px"/>
<ElTableColumn label="数量" prop="quantity"/>
<ElTableColumn label="计量单位" prop="unit"/>
<ElTableColumn label="备注" prop="memo"/>
<ElTableColumn label="创建时间" prop="createTime" width="170px"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="170px"/>
</template>
<InOrderForm ref="inOrderForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import InOrderApi from "@/pages/wh/in-order/in-order-api.ts";
import InOrderForm from "@/pages/wh/in-order/InOrderForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import Utils from "@/common/utils";
import InOrderApi from '@/pages/wh/in-order/in-order-api.ts'
import InOrderForm from '@/pages/wh/in-order/InOrderForm.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<InOrderTypes.SearchInOrderResult[]>([]));
const searchForm = Utils.resetAble(
reactive<InOrderTypes.SearchInOrderParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
const inOrderFormIns = useTemplateRef<InstanceType<typeof InOrderForm>>("inOrderForm");
const inOrderFormIns = useTemplateRef<InstanceType<typeof InOrderForm>>('inOrderForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
const actionColumn = reactive<ActionColumnType<InOrderTypes.SearchInOrderResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
inOrderFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return InOrderApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
inOrderFormIns.value?.open()
},
},
]
function showDialog(data?: InOrderTypes.SearchInOrderResult) {
inOrderFormIns.value?.open(data);
function research() {
formPageIns.value?.doSearch()
}
function delHandler({ row }: { row: InOrderTypes.SearchInOrderResult }) {
deling.value = true;
InOrderApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function paging(param: InOrderTypes.SearchInOrderParam) {
return InOrderApi.paging(param)
}
function modifyHandler({ row }: { row: InOrderTypes.SearchInOrderResult }) {
showDialog(row);
}
function addHandler() {
showDialog();
}
function reset() {
searchForm.$reset();
paging();
}
function paging() {
searching.value = true;
InOrderApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,202 +1,120 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="Id">
<ElInput v-model="searchForm.id" placeholder="Id" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="Id">
<ElInput v-model="searchForm.id" placeholder="Id"/>
</ElFormItem>
<ElFormItem label-width="90" label="仓库 Id">
<ElInput v-model="searchForm.warehouseId" placeholder="仓库 Id" />
<ElFormItem label="仓库 Id">
<ElInput v-model="searchForm.warehouseId" placeholder="仓库 Id"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品 Id">
<ElInput v-model="searchForm.goodsId" placeholder="产品 Id" />
<ElFormItem label="产品 Id">
<ElInput v-model="searchForm.goodsId" placeholder="产品 Id"/>
</ElFormItem>
<ElFormItem label-width="90" label="存放位置">
<ElInput v-model="searchForm.location" placeholder="存放位置" />
<ElFormItem label="存放位置">
<ElInput v-model="searchForm.location" placeholder="存放位置"/>
</ElFormItem>
<ElFormItem label-width="90" label="当前库存数量">
<ElInput v-model="searchForm.stockQuantity" placeholder="当前库存数量" />
<ElFormItem label="当前库存数量">
<ElInput v-model="searchForm.stockQuantity" placeholder="当前库存数量"/>
</ElFormItem>
<ElFormItem label-width="90" label="锁定数量">
<ElInput v-model="searchForm.lockQuantity" placeholder="锁定数量" />
<ElFormItem label="锁定数量">
<ElInput v-model="searchForm.lockQuantity" placeholder="锁定数量"/>
</ElFormItem>
<ElFormItem label-width="90" label="总量">
<ElInput v-model="searchForm.totalQuantity" placeholder="总量" />
<ElFormItem label="总量">
<ElInput v-model="searchForm.totalQuantity" placeholder="总量"/>
</ElFormItem>
<ElFormItem label-width="90" label="剩余量">
<ElInput v-model="searchForm.remainingQuantity" placeholder="剩余量" />
<ElFormItem label="剩余量">
<ElInput v-model="searchForm.remainingQuantity" placeholder="剩余量"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="计量单位">
<!-- <ElFormItem label="计量单位">
<ElInput v-model="searchForm.unit" placeholder="计量单位字典代码unit" />
</ElFormItem> -->
<!-- <ElFormItem label-width="90" label="创建人 Id sys_user.id">
<!-- <ElFormItem label="创建人 Id sys_user.id">
<ElInput v-model="searchForm.creatorId" placeholder="创建人 Id sys_user.id" />
</ElFormItem>
<ElFormItem label-width="90" label="修改人 Id sys_user.id">
<ElFormItem label="修改人 Id sys_user.id">
<ElInput v-model="searchForm.modifierId" placeholder="修改人 Id sys_user.id" />
</ElFormItem> -->
<ElFormItem label-width="90" label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
<ElFormItem label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
<ElFormItem label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<!-- <ElTableColumn label="Id" prop="id" /> -->
<ElTableColumn label="仓库" prop="warehouseName" />
<ElTableColumn label="产品" prop="goodsName" />
<ElTableColumn label="存放位置" prop="location" />
</template>
<template #columns>
<ElTableColumn label="仓库" prop="warehouseName"/>
<ElTableColumn label="产品" prop="goodsName"/>
<ElTableColumn label="存放位置" prop="location"/>
<ElTableColumn label="当前库存数量" prop="stockQuantity" width="120"/>
<ElTableColumn label="锁定数量" prop="lockQuantity" />
<ElTableColumn label="总量" prop="totalQuantity" />
<ElTableColumn label="剩余量" prop="remainingQuantity" />
<ElTableColumn label="计量单位" prop="unit" />
<ElTableColumn label="创建时间" prop="createTime" width="180" />
<ElTableColumn label="修改时间" prop="modifyTime" width="180" />
<ElTableColumn label="操作" width="180" fixed="right">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<InventoryForm ref="inventoryForm" @edit-succ="paging" />
</Page>
<ElTableColumn label="锁定数量" prop="lockQuantity"/>
<ElTableColumn label="总量" prop="totalQuantity"/>
<ElTableColumn label="剩余量" prop="remainingQuantity"/>
<ElTableColumn label="计量单位" prop="unit"/>
<ElTableColumn label="创建时间" prop="createTime" width="180"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="180"/>
</template>
<InventoryForm ref="inventoryForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import InventoryApi from "@/pages/wh/inventory/inventory-api.ts";
import InventoryForm from "@/pages/wh/inventory/InventoryForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import Utils from "@/common/utils";
import InventoryApi from '@/pages/wh/inventory/inventory-api.ts'
import InventoryForm from '@/pages/wh/inventory/InventoryForm.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<InventoryTypes.SearchInventoryResult[]>([]));
const searchForm = Utils.resetAble(
reactive<InventoryTypes.SearchInventoryParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
const inventoryFormIns = useTemplateRef<InstanceType<typeof InventoryForm>>("inventoryForm");
const inventoryFormIns = useTemplateRef<InstanceType<typeof InventoryForm>>('inventoryForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
function showDialog(data?: InventoryTypes.SearchInventoryResult) {
inventoryFormIns.value?.open(data);
const actionColumn = reactive<ActionColumnType<InventoryTypes.SearchInventoryResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
inventoryFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return InventoryApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
inventoryFormIns.value?.open()
},
},
]
function research() {
formPageIns.value?.doSearch()
}
function delHandler({ row }: { row: InventoryTypes.SearchInventoryResult }) {
deling.value = true;
InventoryApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function paging(param: InventoryTypes.SearchInventoryParam) {
return InventoryApi.paging(param)
}
function modifyHandler({ row }: { row: InventoryTypes.SearchInventoryResult }) {
showDialog(row);
}
function addHandler() {
showDialog();
}
function reset() {
searchForm.$reset();
paging();
}
function paging() {
searching.value = true;
InventoryApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,231 +1,150 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging" label-width="100">
<ElFormItem label-width="90" label="Id">
<ElInput v-model="searchForm.id" placeholder="Id" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="Id">
<ElInput v-model="searchForm.id" placeholder="Id"/>
</ElFormItem>
<ElFormItem label-width="90" label="编号">
<ElInput v-model="searchForm.sn" placeholder="编号" />
<ElFormItem label="编号">
<ElInput v-model="searchForm.sn" placeholder="编号"/>
</ElFormItem>
<ElFormItem label-width="90" label="责任人">
<ElInput v-model="searchForm.responsibleId" placeholder="责任人" />
<ElFormItem label="责任人">
<ElInput v-model="searchForm.responsibleId" placeholder="责任人"/>
</ElFormItem>
<ElFormItem label-width="90" label="仓库">
<ElInput v-model="searchForm.warehouseId" placeholder="仓库" />
<ElFormItem label="仓库">
<ElInput v-model="searchForm.warehouseId" placeholder="仓库"/>
</ElFormItem>
<ElFormItem label-width="90" label="存放位置">
<ElInput v-model="searchForm.location" placeholder="存放位置" />
<ElFormItem label="存放位置">
<ElInput v-model="searchForm.location" placeholder="存放位置"/>
</ElFormItem>
<ElFormItem label-width="90" label="出库时间">
<ElInput v-model="searchForm.outTime" placeholder="出库时间" />
<ElFormItem label="出库时间">
<ElInput v-model="searchForm.outTime" placeholder="出库时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="销售单">
<ElInput v-model="searchForm.orderId" placeholder="销售单" />
<ElFormItem label="销售单">
<ElInput v-model="searchForm.orderId" placeholder="销售单"/>
</ElFormItem>
<ElFormItem label-width="90" label="销售单号wh_sales_order.sn">
<ElInput v-model="searchForm.orderSn" placeholder="销售单号wh_sales_order.sn" />
<ElFormItem label="销售单号wh_sales_order.sn">
<ElInput v-model="searchForm.orderSn" placeholder="销售单号wh_sales_order.sn"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品分类 Id">
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类 Id" />
<ElFormItem label="产品分类 Id">
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类 Id"/>
</ElFormItem>
<ElFormItem label-width="90" label="分类名称">
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
<ElFormItem label="分类名称">
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品 Id">
<ElInput v-model="searchForm.goodsId" placeholder="产品 Id" />
<ElFormItem label="产品 Id">
<ElInput v-model="searchForm.goodsId" placeholder="产品 Id"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称" />
<ElFormItem label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="商品编码">
<ElInput v-model="searchForm.goodSn" placeholder="商品编码" />
<ElFormItem label="商品编码">
<ElInput v-model="searchForm.goodSn" placeholder="商品编码"/>
</ElFormItem>
<ElFormItem label-width="90" label="数量">
<ElInput v-model="searchForm.quantity" placeholder="数量" />
<ElFormItem label="数量">
<ElInput v-model="searchForm.quantity" placeholder="数量"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="计量单位字典代码unit">
<!-- <ElFormItem label="计量单位字典代码unit">
<ElInput
v-model="searchForm.unit"
placeholder="计量单位字典代码unit"/>
</ElFormItem> -->
<ElFormItem label-width="90" label="备注">
<ElInput v-model="searchForm.memo" placeholder="备注" />
<ElFormItem label="备注">
<ElInput v-model="searchForm.memo" placeholder="备注"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="创建人 Id sys_user.id">
<!-- <ElFormItem label="创建人 Id sys_user.id">
<ElInput
v-model="searchForm.creatorId"
placeholder="创建人 Id sys_user.id"/>
</ElFormItem>
<ElFormItem label-width="90" label="修改人 Id sys_user.id">
<ElFormItem label="修改人 Id sys_user.id">
<ElInput
v-model="searchForm.modifierId"
placeholder="修改人 Id sys_user.id"/>
</ElFormItem> -->
<ElFormItem label-width="90" label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
<ElFormItem label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
<ElFormItem label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<!-- <ElTableColumn label="Id" prop="id"/> -->
<ElTableColumn label="编号" prop="sn" />
<ElTableColumn label="仓库" prop="warehouseName" />
<ElTableColumn label="存放位置" prop="location" />
<ElTableColumn label="出库时间" prop="outTime" width="170px" />
<ElTableColumn label="销售单号" prop="orderSn" width="140px"/>
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
<ElTableColumn label="产品名称" prop="goodsName" />
<ElTableColumn label="商品编码" prop="goodSn" width="100px" />
<ElTableColumn label="数量" prop="quantity" />
<ElTableColumn label="计量单位" prop="unit" />
<ElTableColumn label="备注" prop="memo" />
<ElTableColumn label="创建时间" prop="createTime" width="170px" />
<ElTableColumn label="修改时间" prop="modifyTime" width="170px" />
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<OutOrderForm ref="outOrderForm" @edit-succ="paging" />
</Page>
</template>
<template #columns>
<ElTableColumn label="编号" prop="sn"/>
<ElTableColumn label="仓库" prop="warehouseName"/>
<ElTableColumn label="存放位置" prop="location"/>
<ElTableColumn label="出库时间" prop="outTime" width="170px"/>
<ElTableColumn label="销售单号" prop="orderSn" width="140px"/>
<ElTableColumn label="分类名称" prop="goodsCategoryName"/>
<ElTableColumn label="产品名称" prop="goodsName"/>
<ElTableColumn label="商品编码" prop="goodSn" width="100px"/>
<ElTableColumn label="数量" prop="quantity"/>
<ElTableColumn label="计量单位" prop="unit"/>
<ElTableColumn label="备注" prop="memo"/>
<ElTableColumn label="创建时间" prop="createTime" width="170px"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="170px"/>
</template>
<OutOrderForm ref="outOrderForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import OutOrderApi from "@/pages/wh/out-order/out-order-api.ts";
import OutOrderForm from "@/pages/wh/out-order/OutOrderForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import Utils from "@/common/utils";
import OutOrderApi from '@/pages/wh/out-order/out-order-api.ts'
import OutOrderForm from '@/pages/wh/out-order/OutOrderForm.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<OutOrderTypes.SearchOutOrderResult[]>([]));
const searchForm = Utils.resetAble(
reactive<OutOrderTypes.SearchOutOrderParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
const outOrderFormIns = useTemplateRef<InstanceType<typeof OutOrderForm>>("outOrderForm");
const outOrderFormIns = useTemplateRef<InstanceType<typeof OutOrderForm>>('outOrderForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
function showDialog(data?: OutOrderTypes.SearchOutOrderResult) {
outOrderFormIns.value?.open(data);
const actionColumn = reactive<ActionColumnType<OutOrderTypes.SearchOutOrderResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
outOrderFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return OutOrderApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
outOrderFormIns.value?.open()
},
},
]
function research() {
formPageIns.value?.doSearch()
}
function delHandler({ row }: { row: OutOrderTypes.SearchOutOrderResult }) {
deling.value = true;
OutOrderApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function paging(param: OutOrderTypes.SearchOutOrderParam) {
return OutOrderApi.paging(param)
}
function modifyHandler({ row }: { row: OutOrderTypes.SearchOutOrderResult }) {
showDialog(row);
}
function addHandler() {
showDialog();
}
function reset() {
searchForm.$reset();
paging();
}
function paging() {
searching.value = true;
OutOrderApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,213 +1,118 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="编号">
<ElInput v-model="searchForm.sn" placeholder="编号" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElFormItem label="编号">
<ElInput v-model="searchForm.sn" placeholder="编号"/>
</ElFormItem>
<!-- JinXingZhong-进行中YiDaoHuo-已到货YiRuKu-已入库YiQuXiao-已取消 -->
<ElFormItem label-width="90" label="状态">
<ElInput v-model="searchForm.purchaseOrderStatus" placeholder="状态" />
<ElFormItem label="状态">
<ElInput v-model="searchForm.purchaseOrderStatus" placeholder="状态"/>
</ElFormItem>
<ElFormItem label-width="90" label="供货客户 Id">
<ElInput v-model="searchForm.customerId" placeholder="供货客户 Id" />
<ElFormItem label="供货客户 Id">
<ElInput v-model="searchForm.customerId" placeholder="供货客户 Id"/>
</ElFormItem>
<ElFormItem label-width="90" label="采购日期">
<ElInput v-model="searchForm.purchaseDate" placeholder="采购日期" />
<ElFormItem label="采购日期">
<ElInput v-model="searchForm.purchaseDate" placeholder="采购日期"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="到货日期">
<!-- <ElFormItem label="到货日期">
<ElInput v-model="searchForm.arrivalDate" placeholder="到货日期" />
</ElFormItem>
<ElFormItem label-width="90" label="产品分类 Id">
<ElFormItem label="产品分类 Id">
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类 Id" />
</ElFormItem>-->
<ElFormItem label-width="90" label="分类名称">
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
<ElFormItem label="分类名称">
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="产品 Id">
<!-- <ElFormItem label="产品 Id">
<ElInput v-model="searchForm.goodsId" placeholder="产品 Id" />
</ElFormItem> -->
<ElFormItem label-width="90" label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称" />
<ElFormItem label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="商品编码">
<ElInput v-model="searchForm.goodSn" placeholder="商品编码" />
<ElFormItem label="商品编码">
<ElInput v-model="searchForm.goodSn" placeholder="商品编码"/>
</ElFormItem>
<ElFormItem label-width="90" label="数量">
<ElInput v-model="searchForm.quantity" placeholder="数量" />
<ElFormItem label="数量">
<ElInput v-model="searchForm.quantity" placeholder="数量"/>
</ElFormItem>
<!-- <ElFormItem label-width="90" label="计量单位">
<ElInput v-model="searchForm.unit" placeholder="计量单位unit" />
</ElFormItem>
<ElFormItem label-width="90" label="总金额;单位:元">
<ElInput v-model="searchForm.totalMoney" placeholder="总金额;单位:元" />
</ElFormItem>
<ElFormItem label-width="90" label="备注">
<ElInput v-model="searchForm.memo" placeholder="备注" />
</ElFormItem> -->
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<!-- <ElTableColumn label="Id" prop="id" /> -->
<ElTableColumn label="编号" prop="sn" />
<!-- JinXingZhong--进行中YiDaoHuo--已到货YiRuKu--已入库YiQuXiao--已取消 -->
<ElTableColumn label="状态" prop="purchaseOrderStatus" />
<!-- <ElTableColumn label="供货客户 Id" prop="customerId" /> -->
<ElTableColumn label="采购日期" prop="purchaseDate" />
<ElTableColumn label="到货日期" prop="arrivalDate" />
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
<ElTableColumn label="产品名称" prop="goodsName" />
<ElTableColumn label="商品编码" prop="goodSn" />
<ElTableColumn label="数量" prop="quantity" />
<ElTableColumn label="计量单位" prop="unit" />
<ElTableColumn label="总金额(元)" prop="totalMoney" />
<ElTableColumn label="备注" prop="memo" />
<ElTableColumn label="创建时间" prop="createTime" />
<ElTableColumn label="修改时间" prop="modifyTime" />
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<PurchaseOrderForm ref="purchaseOrderForm" @edit-succ="paging" />
</Page>
</template>
<template #columns>
<ElTableColumn label="编号" prop="sn"/>
<ElTableColumn label="状态" prop="purchaseOrderStatus"/>
<ElTableColumn label="采购日期" prop="purchaseDate"/>
<ElTableColumn label="到货日期" prop="arrivalDate"/>
<ElTableColumn label="分类名称" prop="goodsCategoryName"/>
<ElTableColumn label="产品名称" prop="goodsName"/>
<ElTableColumn label="商品编码" prop="goodSn"/>
<ElTableColumn label="数量" prop="quantity"/>
<ElTableColumn label="计量单位" prop="unit"/>
<ElTableColumn label="总金额(元)" prop="totalMoney"/>
<ElTableColumn label="备注" prop="memo"/>
<ElTableColumn label="创建时间" prop="createTime"/>
<ElTableColumn label="修改时间" prop="modifyTime"/>
</template>
<PurchaseOrderForm ref="purchaseOrderForm" @edit-succ="paging"/>
</FormPage>
</template>
<script lang="ts" setup>
import PurchaseOrderApi from "@/pages/wh/purchase-order/purchase-order-api.ts";
import PurchaseOrderForm from "@/pages/wh/purchase-order/PurchaseOrderForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import Utils from "@/common/utils";
import PurchaseOrderApi from '@/pages/wh/purchase-order/purchase-order-api.ts'
import PurchaseOrderForm from '@/pages/wh/purchase-order/PurchaseOrderForm.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<PurchaseOrderTypes.SearchPurchaseOrderResult[]>([]));
const searchForm = Utils.resetAble(
reactive<PurchaseOrderTypes.SearchPurchaseOrderParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
const purchaseOrderFormIns = useTemplateRef<InstanceType<typeof PurchaseOrderForm>>("purchaseOrderForm");
const purchaseOrderFormIns = useTemplateRef<InstanceType<typeof PurchaseOrderForm>>('purchaseOrderForm')
function showDialog(data?: PurchaseOrderTypes.SearchPurchaseOrderResult) {
purchaseOrderFormIns.value?.open(data);
const actionColumn = reactive<ActionColumnType<PurchaseOrderTypes.SearchPurchaseOrderResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}: { row: PurchaseOrderTypes.SearchPurchaseOrderResult }) {
purchaseOrderFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}: { row: PurchaseOrderTypes.SearchPurchaseOrderResult }) {
this.loading = true
PurchaseOrderApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
paging()
})
.finally(() => {
this.loading = false
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
purchaseOrderFormIns.value?.open()
},
},
]
function paging(param: PurchaseOrderTypes.SearchPurchaseOrderParam) {
return PurchaseOrderApi.paging(param)
}
function delHandler({ row }: { row: PurchaseOrderTypes.SearchPurchaseOrderResult }) {
deling.value = true;
PurchaseOrderApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
}
function modifyHandler({ row }: { row: PurchaseOrderTypes.SearchPurchaseOrderResult }) {
showDialog(row);
}
function addHandler() {
showDialog();
}
function reset() {
searchForm.$reset();
paging();
}
function paging() {
searching.value = true;
PurchaseOrderApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,231 +1,152 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<!-- <ElFormItem label-width="90" label="Id">
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<!-- <ElFormItem label="Id">
<ElInput
v-model="searchForm.id"
placeholder="Id"/>
</ElFormItem> -->
<ElFormItem label-width="90" label="编号">
<ElInput v-model="searchForm.sn" placeholder="编号" />
<ElFormItem label="编号">
<ElInput v-model="searchForm.sn" placeholder="编号"/>
</ElFormItem>
<!-- JinXingZhong-进行中YiFaHuo-已发货YiChuKu-已出库YiQuXiao--已取消 - -->
<!-- <ElFormItem label-width="90" label="状态">
<!-- <ElFormItem label="状态">
<ElInput v-model="searchForm.salesOrderStatus" placeholder="状态" />
</ElFormItem> -->
<ElFormItem label-width="90" label="购买方客户">
<ElInput v-model="searchForm.customerId" placeholder="购买方客户" />
<ElFormItem label="购买方客户">
<ElInput v-model="searchForm.customerId" placeholder="购买方客户"/>
</ElFormItem>
<!-- JinXingZhong--进行中YiFaHuo--已发货YiChuKu--已出库YiQuXiao--已取消 -->
<!-- <ElFormItem label-width="90" label="下单日期">
<!-- <ElFormItem label="下单日期">
<ElInput v-model="searchForm.orderDate" placeholder="下单日期" />
</ElFormItem>
<ElFormItem label-width="90" label="发货日期">
<ElFormItem label="发货日期">
<ElInput v-model="searchForm.shipmentDate" placeholder="发货日期" />
</ElFormItem>
<ElFormItem label-width="90" label="产品分类">
<ElFormItem label="产品分类">
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类" />
</ElFormItem> -->
<ElFormItem label-width="90" label="分类名称">
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
<ElFormItem label="分类名称">
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品">
<ElInput v-model="searchForm.goodsId" placeholder="产品" />
<ElFormItem label="产品">
<ElInput v-model="searchForm.goodsId" placeholder="产品"/>
</ElFormItem>
<ElFormItem label-width="90" label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称" />
<ElFormItem label="产品名称">
<ElInput v-model="searchForm.goodsName" placeholder="产品名称"/>
</ElFormItem>
<ElFormItem label-width="90" label="商品编码">
<ElInput v-model="searchForm.goodSn" placeholder="商品编码" />
<ElFormItem label="商品编码">
<ElInput v-model="searchForm.goodSn" placeholder="商品编码"/>
</ElFormItem>
<ElFormItem label-width="90" label="数量">
<ElInput v-model="searchForm.quantity" placeholder="数量" />
<ElFormItem label="数量">
<ElInput v-model="searchForm.quantity" placeholder="数量"/>
</ElFormItem>
<!--<ElFormItem label-width="90" label="计量单位">
<!--<ElFormItem label="计量单位">
<ElInput v-model="searchForm.unit" placeholder="计量单位" />
</ElFormItem>
<ElFormItem label-width="90" label="总金额">
<ElFormItem label="总金额">
<ElInput v-model="searchForm.totalMoney" placeholder="总金额" />
</ElFormItem>
<ElFormItem label-width="90" label="备注">
<ElFormItem label="备注">
<ElInput v-model="searchForm.memo" placeholder="备注" />
</ElFormItem>
<ElFormItem label-width="90" label="创建人">
<ElFormItem label="创建人">
<ElInput v-model="searchForm.creatorId" placeholder="创建人" />
</ElFormItem>
<ElFormItem label-width="90" label="修改人">
<ElFormItem label="修改人">
<ElInput v-model="searchForm.modifierId" placeholder="修改人" />
</ElFormItem> -->
<ElFormItem label-width="90" label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
<ElFormItem label="创建时间">
<ElInput v-model="searchForm.createTime" placeholder="创建时间"/>
</ElFormItem>
<ElFormItem label-width="90" label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
<ElFormItem label="修改时间">
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间"/>
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
</template>
<template #columns>
<!-- <ElTableColumn label="Id" prop="id" /> -->
<ElTableColumn label="编号" prop="sn" />
<ElTableColumn label="状态" prop="salesOrderStatusTxt" />
<ElTableColumn label="编号" prop="sn"/>
<ElTableColumn label="状态" prop="salesOrderStatusTxt"/>
<!-- <ElTableColumn label="购买方客户" prop="customerId" /> -->
<ElTableColumn label="下单日期" prop="orderDate" width="100"/>
<ElTableColumn label="发货日期" prop="shipmentDate" width="100"/>
<ElTableColumn label="产品分类" prop="goodsCategoryId" />
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
<ElTableColumn label="下单日期" prop="orderDate" width="100"/>
<ElTableColumn label="发货日期" prop="shipmentDate" width="100"/>
<ElTableColumn label="产品分类" prop="goodsCategoryId"/>
<ElTableColumn label="分类名称" prop="goodsCategoryName"/>
<!-- <ElTableColumn label="产品" prop="goodsId" /> -->
<ElTableColumn label="产品名称" prop="goodsName" />
<ElTableColumn label="商品编码" prop="goodSn" width="100"/>
<ElTableColumn label="数量" prop="quantity" />
<ElTableColumn label="产品名称" prop="goodsName"/>
<ElTableColumn label="商品编码" prop="goodSn" width="100"/>
<ElTableColumn label="数量" prop="quantity"/>
<!-- <ElTableColumn label="计量单位" prop="unit" /> -->
<ElTableColumn label="总金额" prop="totalMoney" />
<ElTableColumn label="备注" prop="memo" />
<ElTableColumn label="总金额" prop="totalMoney"/>
<ElTableColumn label="备注" prop="memo"/>
<!-- <ElTableColumn label="创建人" prop="creatorId" />
<ElTableColumn label="修改人" prop="modifierId" /> -->
<ElTableColumn label="创建时间" prop="createTime" width="180"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="180"/>
<ElTableColumn label="操作" width="180" fixed="right">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<SalesOrderForm ref="salesOrderForm" @edit-succ="paging" />
</Page>
<ElTableColumn label="创建时间" prop="createTime" width="180"/>
<ElTableColumn label="修改时间" prop="modifyTime" width="180"/>
</template>
<SalesOrderForm ref="salesOrderForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import SalesOrderApi from "@/pages/wh/sales-order/sales-order-api.ts";
import SalesOrderForm from "@/pages/wh/sales-order/SalesOrderForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import Utils from "@/common/utils";
import SalesOrderApi from '@/pages/wh/sales-order/sales-order-api.ts'
import SalesOrderForm from '@/pages/wh/sales-order/SalesOrderForm.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<SalesOrderTypes.SearchSalesOrderResult[]>([]));
const searchForm = Utils.resetAble(
reactive<SalesOrderTypes.SearchSalesOrderParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
const salesOrderFormIns = useTemplateRef<InstanceType<typeof SalesOrderForm>>("salesOrderForm");
const salesOrderFormIns = useTemplateRef<InstanceType<typeof SalesOrderForm>>('salesOrderForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
function showDialog(data?: SalesOrderTypes.SearchSalesOrderResult) {
salesOrderFormIns.value?.open(data);
const actionColumn = reactive<ActionColumnType<SalesOrderTypes.SearchSalesOrderResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
salesOrderFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return SalesOrderApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
salesOrderFormIns.value?.open()
},
},
]
function research() {
formPageIns.value?.doSearch()
}
function delHandler({ row }: { row: SalesOrderTypes.SearchSalesOrderResult }) {
deling.value = true;
SalesOrderApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function paging(param: SalesOrderTypes.SearchSalesOrderParam) {
return SalesOrderApi.paging(param)
}
function modifyHandler({ row }: { row: SalesOrderTypes.SearchSalesOrderResult }) {
showDialog(row);
}
function addHandler() {
showDialog();
}
function reset() {
searchForm.$reset();
paging();
}
function paging() {
searching.value = true;
SalesOrderApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -1,164 +1,113 @@
<template>
<Page>
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
<ElFormItem label-width="90" label="仓库名称">
<ElInput v-model="searchForm.warehouseName" placeholder="仓库名称" />
</ElFormItem>
<ElFormItem label-width="90" label="位置">
<ElInput v-model="searchForm.location" placeholder="位置" />
</ElFormItem>
<ElFormItem>
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset"></ElButton>
</ElFormItem>
</ElForm>
<div class="tool-bar">
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler"></ElButton>
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
</div>
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
<ElTableColumn label="Id" prop="id" />
<ElTableColumn label="仓库名称" prop="warehouseName" />
<ElTableColumn label="位置" prop="location" />
<FormPage
ref="formPage"
:action-column="actionColumn"
:left-tools="leftTools"
:paging="paging">
<template #searchFormItem="{ searchForm }">
<ElForm inline @submit.prevent="paging">
<ElFormItem label="仓库名称">
<ElInput
v-model="searchForm.warehouseName"
placeholder="仓库名称"/>
</ElFormItem>
<ElFormItem label="位置">
<ElInput
v-model="searchForm.location"
placeholder="位置"/>
</ElFormItem>
<ElFormItem label="创建人 Id sys_user.id">
<ElInput
v-model="searchForm.creatorId"
placeholder="创建人 Id sys_user.id"/>
</ElFormItem>
<ElFormItem label="修改人 Idsys_user.id">
<ElInput
v-model="searchForm.modifierId"
placeholder="修改人 Idsys_user.id"/>
</ElFormItem>
<ElFormItem label="创建时间">
<ElInput
v-model="searchForm.createTime"
placeholder="创建时间"/>
</ElFormItem>
<ElFormItem label="修改时间">
<ElInput
v-model="searchForm.modifyTime"
placeholder="修改时间"/>
</ElFormItem>
</ElForm>
</template>
<template #columns>
<ElTableColumn label="Id" prop="id"/>
<ElTableColumn label="仓库名称" prop="warehouseName"/>
<ElTableColumn label="位置" prop="location"/>
<!-- <ElTableColumn label="创建人 Id sys_user.id" prop="creatorId"/>
<ElTableColumn label="修改人 Idsys_user.id" prop="modifierId"/> -->
<ElTableColumn label="创建时间" prop="createTime" />
<ElTableColumn label="修改时间" prop="modifyTime" />
<ElTableColumn label="操作" width="180">
<template #default="scope">
<div class="action-btn">
<ElPopconfirm confirm-button-text="" cancel-button-text="" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
<template #reference>
<ElButton text type="danger" :loading="deling">删除</ElButton>
</template>
</ElPopconfirm>
<ElButton text type="primary" @click="modifyHandler(scope)"></ElButton>
</div>
</template>
</ElTableColumn>
</ElTable>
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
<WarehouseForm ref="warehouseForm" @edit-succ="paging" />
</Page>
<ElTableColumn label="修改人 Idsys_user.id" prop="modifierId"/> -->
<ElTableColumn label="创建时间" prop="createTime"/>
<ElTableColumn label="修改时间" prop="modifyTime"/>
<!-- <ElTableColumn label="是否删除; 0-->未删除、1-->已删除" prop="deleted"/> -->
</template>
<WarehouseForm ref="warehouseForm" @edit-succ="research"/>
</FormPage>
</template>
<script lang="ts" setup>
import WarehouseApi from "@/pages/wh/warehouse/warehouse-api.ts";
import WarehouseForm from "@/pages/wh/warehouse/WarehouseForm.vue";
import Page from "@/components/page/Page.vue";
import { elIcons } from "@/common/element/element.ts";
import Utils from "@/common/utils";
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
import WarehouseForm from '@/pages/wh/warehouse/WarehouseForm.vue'
import FormPage, {
type ActionColumnType,
type ToolType,
} from '@/components/page/FormPage.vue'
import type { ComponentExposed } from 'vue-component-type-helpers'
const totalCount = ref(0);
const tableData = Utils.resetAble(reactive<WarehouseTypes.SearchWarehouseResult[]>([]));
const searchForm = Utils.resetAble(
reactive<WarehouseTypes.SearchWarehouseParam>({
current: 1,
size: 20,
})
);
const searching = ref(false);
const deling = ref(false);
const showSearchForm = ref(true);
const warehouseFormIns = useTemplateRef<InstanceType<typeof WarehouseForm>>("warehouseForm");
const warehouseFormIns = useTemplateRef<InstanceType<typeof WarehouseForm>>('warehouseForm')
const formPageIns = useTemplateRef<ComponentExposed<typeof FormPage>>('formPage')
function showDialog(data?: WarehouseTypes.SearchWarehouseResult) {
warehouseFormIns.value?.open(data);
const actionColumn = reactive<ActionColumnType<WarehouseTypes.SearchWarehouseResult>>({
tableActions: [
{
tooltip: '编辑',
icon: 'Edit',
action({row}) {
warehouseFormIns.value?.open(row)
},
},
{
icon: 'Delete',
loading: false,
type: 'danger',
tooltip: '删除',
confirm: {
title: '是否删除当前数据',
},
action({row}) {
return WarehouseApi.del([ row.id! ])
.then(() => {
ElMessage.success('删除成功')
return true
})
},
},
],
})
const leftTools: ToolType[] = [
{
icon: 'Plus',
label: '新建',
action() {
warehouseFormIns.value?.open()
},
},
]
function research() {
formPageIns.value?.doSearch()
}
function delHandler({ row }: { row: WarehouseTypes.SearchWarehouseResult }) {
deling.value = true;
WarehouseApi.del([row.id!])
.then(() => {
ElMessage.success("删除成功");
paging();
})
.finally(() => {
deling.value = false;
});
function paging(param: WarehouseTypes.SearchWarehouseParam) {
return WarehouseApi.paging(param)
}
function modifyHandler({ row }: { row: WarehouseTypes.SearchWarehouseResult }) {
showDialog(row);
}
function addHandler() {
showDialog();
}
function reset() {
searchForm.$reset();
paging();
}
function paging() {
searching.value = true;
WarehouseApi.paging(searchForm)
.then((res) => {
totalCount.value = res.data?.total ?? 0;
tableData.$reset(res.data?.records ?? []);
})
.finally(() => {
searching.value = false;
});
}
onMounted(() => {
paging();
});
</script>
<style lang="stylus" scoped>
.table-list {
flex 1;
margin 0 0 20px 0
width 100%
:deep(.table-header) {
color #454C59
th {
background-color #EDF1F7
font-weight 500
position relative
& > div {
display flex
gap 5px
align-items center
}
&:not(:first-child) > div::before {
position: absolute;
top: 50%;
left: 1px;
width: 1px;
background-color: #D3D7DE;
transform: translateY(-50%);
content: "";
height 50%
}
}
}
:deep(.table-cell) {
color #2F3540
}
.action-btn {
width 100%
display flex
flex-wrap wrap
& > button {
margin 0
}
}
}
.tool-bar {
display flex
justify-content space-between
margin 0 0 20px 0
}
</style>

View File

@ -15,11 +15,12 @@ import ElementPlus from 'unplugin-element-plus/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import { fileWatcher } from './plugin/file-watcher.ts'
import IconfontProcess from './plugin/iconfont-process.ts'
// import * as https from "node:https";
// https://vite.dev/config/
export default defineConfig((configEnv) => {
const env = loadEnv(configEnv.mode, process.cwd(), "");
const env = loadEnv(configEnv.mode, process.cwd(), '')
// const Agent = https.Agent;
// const agent = new Agent({
// keepAlive: true,
@ -34,7 +35,16 @@ export default defineConfig((configEnv) => {
},
css: {
modules: {
localsConvention: "camelCase",
localsConvention: 'camelCase',
},
preprocessorOptions: {
scss: {
additionalData: `
@use "@/assets/scss/el-ui.scss" as *;
@use "@/assets/scss/el-light.scss" as *;
@use "@/assets/scss/mixin.scss" as *;
`,
},
},
},
plugins: [
@ -42,33 +52,34 @@ export default defineConfig((configEnv) => {
vueJsx(),
VueDevTools(),
ElementPlus({
defaultLocale: "zh-cn",
defaultLocale: 'zh-cn',
useSource: true,
}),
AutoImport({
imports: ["vue", "vue-router", "pinia"],
dts: "./src/dts/auto-imports.d.ts",
resolvers: [ElementPlusResolver()],
imports: [ 'vue', 'vue-router', 'pinia' ],
dts: './src/dts/auto-imports.d.ts',
resolvers: [ ElementPlusResolver() ],
}),
Components({
dts: "./src/dts/components.d.ts",
dirs: ["./src/widgets"],
resolvers: [ElementPlusResolver()],
dts: './src/dts/components.d.ts',
dirs: [ './src/widgets' ],
resolvers: [ ElementPlusResolver() ],
}),
processHtml(env.VITE_APP_NAME),
fileWatcher(IconfontProcess),
zipDist(),
],
resolve: {
extensions: [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"],
extensions: [ '.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json' ],
alias: [
{
find: "@",
replacement: path.resolve(__dirname, "src"),
find: '@',
replacement: path.resolve(__dirname, 'src'),
},
],
},
server: {
host: "0.0.0.0",
host: '0.0.0.0',
port: 5173,
proxy: {
[env.VITE_HTTP_SERVER_BASE_URL]: {
@ -79,14 +90,14 @@ export default defineConfig((configEnv) => {
// agent,
changeOrigin: true,
rewrite: (path) => (env.VITE_HTTP_SERVER_BASE_URL == null || env.VITE_HTTP_SERVER_BASE_URL == "/" ? path : path.replace(new RegExp(env.VITE_HTTP_SERVER_BASE_URL), "")),
rewrite: (path) => (env.VITE_HTTP_SERVER_BASE_URL == null || env.VITE_HTTP_SERVER_BASE_URL == '/' ? path : path.replace(new RegExp(env.VITE_HTTP_SERVER_BASE_URL), '')),
} as ProxyOptions,
[env.VITE_WS_SERVER_BASE_URL]: {
ws: true,
target: env.VITE_WS_PROXY_TARGET,
rewrite: (path) => (env.VITE_WS_SERVER_BASE_URL == null || env.VITE_WS_SERVER_BASE_URL == "/" ? path : path.replace(new RegExp(env.VITE_WS_SERVER_BASE_URL), "")),
rewrite: (path) => (env.VITE_WS_SERVER_BASE_URL == null || env.VITE_WS_SERVER_BASE_URL == '/' ? path : path.replace(new RegExp(env.VITE_WS_SERVER_BASE_URL), '')),
} as ProxyOptions,
},
},
};
});
}
})