更新
This commit is contained in:
111
src/views/main-content.vue
Normal file
111
src/views/main-content.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<main :class="['aui-content', { 'aui-content--tabs': $route.meta.isTab }]">
|
||||
<!-- tab展示内容 -->
|
||||
<template v-if="$route.meta.isTab">
|
||||
<el-dropdown class="aui-content--tabs-tools">
|
||||
<i class="el-icon-arrow-down"></i>
|
||||
<el-dropdown-menu slot="dropdown" :show-timeout="0">
|
||||
<el-dropdown-item @click.native="tabRemoveHandle($store.state.contentTabsActiveName)">{{ $t('contentTabs.closeCurrent') }}</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="tabsCloseOtherHandle()">{{ $t('contentTabs.closeOther') }}</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="tabsCloseAllHandle()">{{ $t('contentTabs.closeAll') }}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-tabs v-model="$store.state.contentTabsActiveName" @tab-click="tabSelectedHandle" @tab-remove="tabRemoveHandle">
|
||||
<el-tab-pane
|
||||
v-for="item in $store.state.contentTabs"
|
||||
:key="item.name"
|
||||
:name="item.name"
|
||||
:label="item.title"
|
||||
:closable="item.name !== 'home'"
|
||||
:class="{ 'is-iframe': tabIsIframe(item.iframeURL) }">
|
||||
<template v-if="item.name === 'home'">
|
||||
<svg slot="label" class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true"><use xlink:href="#icon-home"></use></svg>
|
||||
</template>
|
||||
<div v-if="tabIsIframe(item.iframeURL)" style="width:100%;height:100%">
|
||||
<iframe :src="item.iframeURL" width="100%" height="100%" frameborder="0" scrolling="yes" style="position: relative"></iframe>
|
||||
<div class="zhegai" v-if="item.title==='数据报表'"></div>
|
||||
</div>
|
||||
<keep-alive v-else>
|
||||
<router-view v-if="item.name === $store.state.contentTabsActiveName" />
|
||||
</keep-alive>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
<!-- 其他方式, 展示内容 -->
|
||||
<template v-else>
|
||||
<keep-alive>
|
||||
<router-view />
|
||||
</keep-alive>
|
||||
</template>
|
||||
</main>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isURL } from '@/utils/validate'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
created(){
|
||||
},
|
||||
methods: {
|
||||
// tabs, 是否通过iframe展示
|
||||
tabIsIframe (url) {
|
||||
return isURL(url)
|
||||
},
|
||||
// tabs, 选中tab
|
||||
tabSelectedHandle (tab) {
|
||||
tab = this.$store.state.contentTabs.filter(item => item.name === tab.name)[0]
|
||||
if (tab) {
|
||||
this.$router.push({
|
||||
'name': tab.name,
|
||||
'params': { ...tab.params },
|
||||
'query': { ...tab.query }
|
||||
})
|
||||
}
|
||||
},
|
||||
// tabs, 删除tab
|
||||
tabRemoveHandle (tabName) {
|
||||
if (tabName === 'home') {
|
||||
return false
|
||||
}
|
||||
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name !== tabName)
|
||||
if (this.$store.state.contentTabs.length <= 0) {
|
||||
this.$store.state.sidebarMenuActiveName = this.$store.state.contentTabsActiveName = 'home'
|
||||
return false
|
||||
}
|
||||
// 当前选中tab被删除
|
||||
if (tabName === this.$store.state.contentTabsActiveName) {
|
||||
let tab = this.$store.state.contentTabs[this.$store.state.contentTabs.length - 1]
|
||||
this.$router.push({
|
||||
name: tab.name,
|
||||
params: { ...tab.params },
|
||||
query: { ...tab.query }
|
||||
})
|
||||
}
|
||||
},
|
||||
// tabs, 关闭其它
|
||||
tabsCloseOtherHandle () {
|
||||
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => {
|
||||
return item.name === 'home' || item.name === this.$store.state.contentTabsActiveName
|
||||
})
|
||||
},
|
||||
// tabs, 关闭全部
|
||||
tabsCloseAllHandle () {
|
||||
this.$store.state.contentTabs = this.$store.state.contentTabs.filter(item => item.name === 'home')
|
||||
this.$router.push({ name: 'home' })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.zhegai{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 47px;
|
||||
background: #fff;
|
||||
}
|
||||
</style>
|
||||
97
src/views/main-navbar-update-password.vue
Normal file
97
src/views/main-navbar-update-password.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:title="$t('updatePassword.title')"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
:append-to-body="true">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item :label="$t('updatePassword.username')">
|
||||
<span>{{ $store.state.user.name }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password" :label="$t('updatePassword.password')">
|
||||
<el-input v-model="dataForm.password" type="password" :placeholder="$t('updatePassword.password')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="newPassword" :label="$t('updatePassword.newPassword')">
|
||||
<el-input v-model="dataForm.newPassword" type="password" :placeholder="$t('updatePassword.newPassword')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="confirmPassword" :label="$t('updatePassword.confirmPassword')">
|
||||
<el-input v-model="dataForm.confirmPassword" type="password" :placeholder="$t('updatePassword.confirmPassword')"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template slot="footer">
|
||||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import { clearLoginInfo } from '@/utils'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
password: '',
|
||||
newPassword: '',
|
||||
confirmPassword: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
var validateConfirmPassword = (rule, value, callback) => {
|
||||
if (this.dataForm.newPassword !== value) {
|
||||
return callback(new Error(this.$t('updatePassword.validate.confirmPassword')))
|
||||
}
|
||||
callback()
|
||||
}
|
||||
return {
|
||||
password: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
newPassword: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
confirmPassword: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' },
|
||||
{ validator: validateConfirmPassword, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http.put('/sys/user/password', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
clearLoginInfo()
|
||||
this.$router.replace({ name: 'login' })
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
166
src/views/main-navbar.vue
Normal file
166
src/views/main-navbar.vue
Normal file
@@ -0,0 +1,166 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 14:57:51
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-08 16:36:10
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<nav class="aui-navbar" :class="`aui-navbar--${$store.state.navbarLayoutType}`">
|
||||
<div class="aui-navbar__header">
|
||||
<h1 class="aui-navbar__brand" @click="$router.push({ name: 'home' })">
|
||||
<a class="aui-navbar__brand-lg" href="javascript:;">{{ $t("brand.lg") }}</a>
|
||||
<a class="aui-navbar__brand-mini" href="javascript:;">{{ $t("brand.mini") }}</a>
|
||||
</h1>
|
||||
</div>
|
||||
<div class="aui-navbar__body">
|
||||
<el-menu class="aui-navbar__menu mr-auto" mode="horizontal">
|
||||
<el-menu-item index="1" @click="$store.state.sidebarFold = !$store.state.sidebarFold">
|
||||
<svg
|
||||
class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--switch"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<use xlink:href="#icon-outdent"></use>
|
||||
</svg>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="2" @click="refresh()">
|
||||
<svg
|
||||
class="icon-svg aui-navbar__icon-menu aui-navbar__icon-menu--refresh"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<use xlink:href="#icon-sync"></use>
|
||||
</svg>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
<el-menu class="aui-navbar__menu" mode="horizontal">
|
||||
<el-menu-item index="6" @click="$router.push({ name: 'home' })">
|
||||
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
|
||||
<use xlink:href="#icon-home"></use>
|
||||
</svg>
|
||||
</el-menu-item>
|
||||
<!-- <el-menu-item index="7">
|
||||
<el-dropdown trigger="click" class="international" @command="handleSetLanguage">
|
||||
<div>
|
||||
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
|
||||
<use xlink:href="#中英"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :disabled="language === 'zh-CN'" command="zh-CN">
|
||||
中文
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="language === 'en'" command="en">
|
||||
English
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-menu-item> -->
|
||||
<el-menu-item index="4" @click="fullscreenHandle()">
|
||||
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true">
|
||||
<use xlink:href="#icon-fullscreen"></use>
|
||||
</svg>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="5" class="aui-navbar__avatar">
|
||||
<el-dropdown placement="bottom" :show-timeout="0">
|
||||
<span class="el-dropdown-link">
|
||||
<img src="~@/assets/img/avatar.png" />
|
||||
<span>{{ $store.state.user.name }}</span>
|
||||
<i class="el-icon-arrow-down"></i>
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item @click.native="updatePasswordHandle()">
|
||||
<svg class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true">
|
||||
<use xlink:href="#修改密码"></use>
|
||||
</svg>
|
||||
{{ $t("updatePassword.title") }}</el-dropdown-item
|
||||
>
|
||||
<el-dropdown-item @click.native="logoutHandle()">
|
||||
<svg class="icon-svg aui-content--tabs-icon-nav" aria-hidden="true">
|
||||
<use xlink:href="#tuichu"></use>
|
||||
</svg>
|
||||
{{ $t("logout") }}</el-dropdown-item
|
||||
>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</div>
|
||||
<!-- 弹窗, 修改密码 -->
|
||||
<update-password v-if="updatePasswordVisible" ref="updatePassword"></update-password>
|
||||
</nav>
|
||||
</template>
|
||||
<script>
|
||||
import screenfull from "screenfull";
|
||||
import UpdatePassword from "./main-navbar-update-password";
|
||||
import { clearLoginInfo } from "@/utils";
|
||||
import { messages } from '@/i18n'
|
||||
import Cookies from "js-cookie";
|
||||
export default {
|
||||
inject: ["refresh"],
|
||||
data() {
|
||||
return {
|
||||
updatePasswordVisible: false,
|
||||
messageTip: false,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
UpdatePassword,
|
||||
},
|
||||
computed: {
|
||||
language() {
|
||||
return Cookies.get("language");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleSetLanguage(val) {
|
||||
Cookies.set("language", val);
|
||||
document.querySelector("html").setAttribute("lang", val);
|
||||
document.title = messages[val].brand.lg;
|
||||
window.location.reload();
|
||||
},
|
||||
// 全屏
|
||||
fullscreenHandle() {
|
||||
if (!screenfull.enabled) {
|
||||
return this.$message({
|
||||
message: this.$t("fullscreen.prompt"),
|
||||
type: "warning",
|
||||
duration: 500,
|
||||
});
|
||||
}
|
||||
screenfull.toggle();
|
||||
},
|
||||
// 修改密码
|
||||
updatePasswordHandle() {
|
||||
this.updatePasswordVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.updatePassword.init();
|
||||
});
|
||||
},
|
||||
// 退出
|
||||
logoutHandle() {
|
||||
this.$confirm(
|
||||
this.$t("prompt.info", { handle: this.$t("logout") }),
|
||||
this.$t("prompt.title"),
|
||||
{
|
||||
confirmButtonText: this.$t("confirm"),
|
||||
cancelButtonText: this.$t("cancel"),
|
||||
type: "warning",
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
this.$http
|
||||
.post("/logout")
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
clearLoginInfo();
|
||||
this.$router.push({ name: "login" });
|
||||
})
|
||||
.catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
46
src/views/main-sidebar-sub-menu.vue
Normal file
46
src/views/main-sidebar-sub-menu.vue
Normal file
@@ -0,0 +1,46 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-08 16:26:57
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-submenu v-if="menu.children && menu.children.length >= 1" :index="menu.id" :popper-append-to-body="false">
|
||||
<template slot="title">
|
||||
<svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"><use :xlink:href="`#${menu.icon}`"></use></svg>
|
||||
<span>{{ menu.name }}</span>
|
||||
</template>
|
||||
<sub-menu v-for="item in menu.children" :key="item.id" :menu="item"></sub-menu>
|
||||
</el-submenu>
|
||||
<el-menu-item v-else :index="menu.id" @click="gotoRouteHandle(menu.id)">
|
||||
<svg class="icon-svg aui-sidebar__menu-icon-son" aria-hidden="true"><use xlink:href="#椭圆形"></use></svg>
|
||||
<!-- <svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"><use :xlink:href="`#${menu.icon}`"></use></svg> -->
|
||||
<span>{{ menu.name }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SubMenu from './main-sidebar-sub-menu'
|
||||
export default {
|
||||
name: 'sub-menu',
|
||||
props: {
|
||||
menu: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
SubMenu
|
||||
},
|
||||
methods: {
|
||||
// 通过menuId与动态(菜单)路由进行匹配跳转至指定路由
|
||||
gotoRouteHandle (menuId) {
|
||||
var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === menuId)[0]
|
||||
if (route) {
|
||||
this.$router.push({ name: route.name })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
37
src/views/main-sidebar.vue
Normal file
37
src/views/main-sidebar.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-05 15:52:01
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<aside :class="['aui-sidebar', `aui-sidebar--${$store.state.sidebarLayoutSkin}`]">
|
||||
<div class="aui-sidebar__inner">
|
||||
<el-menu
|
||||
:default-active="$store.state.sidebarMenuActiveName"
|
||||
:collapse="$store.state.sidebarFold"
|
||||
:unique-opened="true"
|
||||
:collapseTransition="false"
|
||||
class="aui-sidebar__menu"
|
||||
>
|
||||
<sub-menu v-for="menu in $store.state.sidebarMenuList" :key="menu.id" :menu="menu" />
|
||||
</el-menu>
|
||||
</div>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SubMenu from "./main-sidebar-sub-menu";
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
components: {
|
||||
SubMenu,
|
||||
},
|
||||
created() {
|
||||
this.$store.state.sidebarMenuList = window.SITE_CONFIG["menuList"];
|
||||
},
|
||||
};
|
||||
</script>
|
||||
102
src/views/main.vue
Normal file
102
src/views/main.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<div v-loading.fullscreen.lock="loading" :element-loading-text="$t('loading')" :class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]">
|
||||
<template v-if="!loading">
|
||||
<main-navbar />
|
||||
<main-sidebar />
|
||||
<div class="aui-content__wrapper">
|
||||
<main-content v-if="!$store.state.contentIsNeedRefresh" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MainNavbar from './main-navbar'
|
||||
import MainSidebar from './main-sidebar'
|
||||
import MainContent from './main-content'
|
||||
import debounce from 'lodash/debounce'
|
||||
export default {
|
||||
provide () {
|
||||
return {
|
||||
// 刷新
|
||||
refresh () {
|
||||
this.$store.state.contentIsNeedRefresh = true
|
||||
this.$nextTick(() => {
|
||||
this.$store.state.contentIsNeedRefresh = false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
loading: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
MainNavbar,
|
||||
MainSidebar,
|
||||
MainContent
|
||||
},
|
||||
watch: {
|
||||
$route: 'routeHandle'
|
||||
},
|
||||
created () {
|
||||
this.windowResizeHandle()
|
||||
this.routeHandle(this.$route)
|
||||
Promise.all([
|
||||
this.getUserInfo(),
|
||||
this.getPermissions()
|
||||
]).then(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 窗口改变大小
|
||||
windowResizeHandle () {
|
||||
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false
|
||||
window.addEventListener('resize', debounce(() => {
|
||||
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false
|
||||
}, 150))
|
||||
},
|
||||
// 路由, 监听
|
||||
routeHandle (route) {
|
||||
if (!route.meta.isTab) {
|
||||
return false
|
||||
}
|
||||
var tab = this.$store.state.contentTabs.filter(item => item.name === route.name)[0]
|
||||
if (!tab) {
|
||||
tab = {
|
||||
...window.SITE_CONFIG['contentTabDefault'],
|
||||
...route.meta,
|
||||
'name': route.name,
|
||||
'params': { ...route.params },
|
||||
'query': { ...route.query }
|
||||
}
|
||||
this.$store.state.contentTabs = this.$store.state.contentTabs.concat(tab)
|
||||
}
|
||||
this.$store.state.sidebarMenuActiveName = tab.menuId
|
||||
this.$store.state.contentTabsActiveName = tab.name
|
||||
},
|
||||
// 获取当前管理员信息
|
||||
getUserInfo () {
|
||||
return this.$http.get('/sys/user/info').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$store.state.user.id = res.data.id
|
||||
this.$store.state.user.name = res.data.username
|
||||
this.$store.state.user.superAdmin = res.data.superAdmin
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 获取权限
|
||||
getPermissions () {
|
||||
return this.$http.get('/sys/menu/permissions').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
window.SITE_CONFIG['permissions'] = res.data
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
95
src/views/modules/code/components/equipmentInfo-add.vue
Normal file
95
src/views/modules/code/components/equipmentInfo-add.vue
Normal file
@@ -0,0 +1,95 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 10:53:27
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name"clearable placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="别名" prop="alias">
|
||||
<el-input v-model="dataForm.alias"clearable placeholder="别名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="英语名称" prop="en">
|
||||
<el-input v-model="dataForm.en"clearable placeholder="英语名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code"clearable placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="dataForm.status"clearable placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="description">
|
||||
<el-input v-model="dataForm.description"clearable placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/code/mtEquipmentInfo/",
|
||||
infoURL: "/code/mtEquipmentInfo",
|
||||
},
|
||||
isGetCode: true,
|
||||
dataForm: {
|
||||
id: "",
|
||||
name: "",
|
||||
code: "",
|
||||
alias: "",
|
||||
status: "",
|
||||
alias: "",
|
||||
description: "",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
value: "0",
|
||||
label: "初始化",
|
||||
},
|
||||
{
|
||||
value: "1",
|
||||
label: "损坏",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "工作中",
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
this.$http
|
||||
.get("/code/mtEquipmentInfo/getCode")
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.code = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
129
src/views/modules/code/components/mtTaskInfo-add.vue
Normal file
129
src/views/modules/code/components/mtTaskInfo-add.vue
Normal file
@@ -0,0 +1,129 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:56:23
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="任务编码" prop="taskCode">
|
||||
<el-input v-model="dataForm.taskCode"clearable placeholder="任务编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编码" prop="prodectCode">
|
||||
<el-input v-model="dataForm.prodectCode"clearable placeholder="产品编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="num">
|
||||
<el-input v-model="dataForm.num"clearable placeholder="数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="dataForm.unit"clearable placeholder="单位"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="dataForm.status"clearable placeholder="状态">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类型" prop="taskType">
|
||||
<el-select v-model="dataForm.taskType"clearable placeholder="任务类型">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="具体型号" prop="specModel">
|
||||
<el-input v-model="dataForm.specModel"clearable placeholder="具体型号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input v-model="dataForm.remarks"clearable placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/code/mtTaskInfo/",
|
||||
infoURL: "/code/mtTaskInfo",
|
||||
},
|
||||
isGetCode: true,
|
||||
dataForm: {
|
||||
id: "",
|
||||
taskCode: "",
|
||||
taskType: "",
|
||||
num: "",
|
||||
prodectCode: "",
|
||||
specModel: '',
|
||||
status: "",
|
||||
unit: "",
|
||||
remarks: "",
|
||||
},
|
||||
options1: [
|
||||
{
|
||||
value: 0,
|
||||
label: "出库",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "入库",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "移库",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: "接收数据",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "数据接收中",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "数据接收完成",
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: "等待接收数据",
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
taskCode: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
this.$http
|
||||
.get("/code/mtTaskInfo/getCode")
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.taskCode = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
179
src/views/modules/code/components/mtTaskInfoDet-add.vue
Normal file
179
src/views/modules/code/components/mtTaskInfoDet-add.vue
Normal file
@@ -0,0 +1,179 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 15:54:29
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="任务编码" prop="taskDetCode">
|
||||
<el-input v-model="dataForm.taskDetCode" clearable placeholder="任务编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="dateNum">
|
||||
<el-input v-model="dataForm.dateNum" clearable placeholder="批次号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="数量" prop="num">
|
||||
<el-input v-model="dataForm.num" clearable placeholder="数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="unit">
|
||||
<el-input v-model="dataForm.unit" clearable placeholder="单位"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="起点" prop="startPosition">
|
||||
<el-input v-model="dataForm.startPosition" clearable placeholder="起点"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="终点" prop="targetPosition">
|
||||
<el-input v-model="dataForm.targetPosition" clearable placeholder="终点"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="dataForm.status" clearable placeholder="状态">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务类型" prop="taskType">
|
||||
<el-select v-model="dataForm.taskType" clearable placeholder="任务类型">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否超高" prop="isHeight">
|
||||
<el-select v-model="dataForm.isHeight" clearable placeholder="是否超高">
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否超重" prop="isWeight">
|
||||
<el-select v-model="dataForm.isWeight" clearable placeholder="是否超重">
|
||||
<el-option
|
||||
v-for="item in options3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="具体型号" prop="specModel">
|
||||
<el-input v-model="dataForm.specModel" clearable placeholder="具体型号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remarks">
|
||||
<el-input v-model="dataForm.remarks" clearable placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/code/mtTaskInfoDet/",
|
||||
infoURL: "/code/mtTaskInfoDet",
|
||||
},
|
||||
isGetCode: true,
|
||||
dataForm: {
|
||||
id: "",
|
||||
taskDetCode: "",
|
||||
taskType: "",
|
||||
num: "",
|
||||
startPosition: "",
|
||||
targetPosition: "",
|
||||
dateNum: "",
|
||||
specModel: "",
|
||||
status: "",
|
||||
unit: "",
|
||||
remarks: "",
|
||||
},
|
||||
options1: [
|
||||
{
|
||||
value: 0,
|
||||
label: "出库",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "入库",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "移库",
|
||||
},
|
||||
],
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: "接收数据",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "数据接收中",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "数据接收完成",
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: "等待接收数据",
|
||||
},
|
||||
],
|
||||
options2: [
|
||||
{
|
||||
value: "0",
|
||||
label: "不超高",
|
||||
},
|
||||
{
|
||||
value: "1",
|
||||
label: "超高",
|
||||
},
|
||||
],
|
||||
options3: [
|
||||
{
|
||||
value: "0",
|
||||
label: "不超重",
|
||||
},
|
||||
{
|
||||
value: "1",
|
||||
label: "超重",
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
taskDetCode: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
this.$http
|
||||
.get("/code/mtTaskInfoDet/getCode")
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.taskDetCode = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
65
src/views/modules/code/components/mtWarehouse-add.vue
Normal file
65
src/views/modules/code/components/mtWarehouse-add.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:10:01
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="仓库名称" prop="whName">
|
||||
<el-input v-model="dataForm.whName"clearable placeholder="仓库名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库编码" prop="whCode">
|
||||
<el-input v-model="dataForm.whCode"clearable placeholder="仓库编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="dataForm.address"clearable placeholder="地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark"clearable placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/code/mtWarehouse/",
|
||||
infoURL: "/code/mtWarehouse",
|
||||
},
|
||||
isGetCode: true,
|
||||
dataForm: {
|
||||
id: "",
|
||||
whName: "",
|
||||
address: "",
|
||||
whCode: "",
|
||||
remark: "",
|
||||
},
|
||||
dataRule: {
|
||||
whName: [{ required: true, message: "仓库名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
this.$http
|
||||
.get("/code/mtWarehouse/getCode")
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.whCode = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -0,0 +1,133 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:33:43
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="dataForm.productName"clearable placeholder="产品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="批次号" prop="dateNum">
|
||||
<el-input v-model="dataForm.dateNum"clearable placeholder="批次号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="货物数量" prop="quantity">
|
||||
<el-input v-model="dataForm.quantity"clearable placeholder="货物数量"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否为空" prop="isEmpty">
|
||||
<el-select v-model="dataForm.isEmpty"clearable placeholder="请选择是否为空">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位状态" prop="status">
|
||||
<el-select v-model="dataForm.status"clearable placeholder="请选择库位状态">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="详细规格" prop="specModel">
|
||||
<el-input v-model="dataForm.specModel"clearable placeholder="详细规格"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位名称" prop="warehousePositionName">
|
||||
<el-input v-model="dataForm.warehousePositionName"clearable placeholder="库位名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark"clearable placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/code/mtWarehousePositionRelat/",
|
||||
infoURL: "/code/mtWarehousePositionRelat",
|
||||
},
|
||||
isGetCode: true,
|
||||
dataForm: {
|
||||
id: "",
|
||||
productName: "",
|
||||
quantity: "",
|
||||
dateNum: "",
|
||||
specModel: '',
|
||||
isEmpty: "",
|
||||
status: "",
|
||||
warehousePositionName: "",
|
||||
remark: "",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: "空",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "有货",
|
||||
},
|
||||
],
|
||||
options1: [
|
||||
{
|
||||
value: -1,
|
||||
label: "不可用",
|
||||
},
|
||||
{
|
||||
value: 0,
|
||||
label: "空库位",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "空货架",
|
||||
},
|
||||
{
|
||||
value: 2,
|
||||
label: "货物正常",
|
||||
},
|
||||
{
|
||||
value: 3,
|
||||
label: "货物预入库",
|
||||
},
|
||||
{
|
||||
value: 4,
|
||||
label: "货物预出库",
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
productName: [{ required: true, message: "产品名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
this.$http
|
||||
.get("/code/mtWarehousePositionRelat/getCode")
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.whCode = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
121
src/views/modules/code/components/mtWarehouseRank-add.vue
Normal file
121
src/views/modules/code/components/mtWarehouseRank-add.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:10:01
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item label="别名" prop="anotherName">
|
||||
<el-input v-model="dataForm.anotherName"clearable placeholder="别名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="列标" prop="columnCode">
|
||||
<el-input v-model="dataForm.columnCode"clearable placeholder="列标"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="行标" prop="rowCode">
|
||||
<el-input v-model="dataForm.rowCode"clearable placeholder="行标"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="库位编码" prop="positionCode">
|
||||
<el-input v-model="dataForm.positionCode"clearable placeholder="库位编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="方向" prop="direction">
|
||||
<el-select v-model="dataForm.direction"clearable placeholder="请选择方向">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否被占用" prop="isOccupy">
|
||||
<el-select v-model="dataForm.isOccupy"clearable placeholder="是否被占用">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域名称" prop="regionName">
|
||||
<el-input v-model="dataForm.regionName"clearable placeholder="区域名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="顺序号" prop="sequence">
|
||||
<el-input v-model="dataForm.sequence"clearable placeholder="顺序号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark"clearable placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/code/mtWarehouseRank/",
|
||||
infoURL: "/code/mtWarehouseRank",
|
||||
},
|
||||
isGetCode: true,
|
||||
dataForm: {
|
||||
id: "",
|
||||
anotherName: "",
|
||||
positionCode: "",
|
||||
columnCode: "",
|
||||
rowCode: '',
|
||||
direction: "",
|
||||
isOccupy:"",
|
||||
regionName: "",
|
||||
sequence: "",
|
||||
remark: "",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
value: "L",
|
||||
label: "左",
|
||||
},
|
||||
{
|
||||
value: "R",
|
||||
label: "右",
|
||||
},
|
||||
],
|
||||
options1: [
|
||||
{
|
||||
value: 0,
|
||||
label: "可用",
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: "被占用",
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
anotherName: [{ required: true, message: "别名不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
this.$http
|
||||
.get("/code/mtWarehouseRank/getCode")
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.positionCode = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
87
src/views/modules/code/components/mtWarehouseRegion-add.vue
Normal file
87
src/views/modules/code/components/mtWarehouseRegion-add.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:14:51
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="区域名称" prop="regionName">
|
||||
<el-input v-model="dataForm.regionName"clearable placeholder="区域名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域编码" prop="regionCode">
|
||||
<el-input v-model="dataForm.regionCode"clearable placeholder="区域编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="区域类型" prop="regionType">
|
||||
<el-select v-model="dataForm.regionType"clearable placeholder="请选择区域类型">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark"clearable placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/code/mtWarehouseRegion/",
|
||||
infoURL: "/code/mtWarehouseRegion",
|
||||
},
|
||||
isGetCode: true,
|
||||
dataForm: {
|
||||
id: "",
|
||||
regionName: "",
|
||||
regionCode: "",
|
||||
regionType: "",
|
||||
remark: "",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
value: "0",
|
||||
label: "普通库位",
|
||||
},
|
||||
{
|
||||
value: "1",
|
||||
label: "高库位",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "扩展库位",
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
regionName: [{ required: true, message: "区域名称不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
this.$http
|
||||
.get("/code/mtWarehouseRegion/getCode")
|
||||
.then(({ data: res }) => {
|
||||
this.dataForm.regionCode = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
100
src/views/modules/code/components/product-add.vue
Normal file
100
src/views/modules/code/components/product-add.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 10:40:35
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="产品全名" prop="productAllName">
|
||||
<el-input v-model="dataForm.productAllName"clearable placeholder="产品全名"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input v-model="dataForm.productName"clearable placeholder="产品名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编码" prop="productCode">
|
||||
<el-input v-model="dataForm.productCode"clearable placeholder="产品编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品类别" prop="productType">
|
||||
<el-select v-model="dataForm.productType"clearable placeholder="请选择产品类别">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="specModel">
|
||||
<el-input v-model="dataForm.specModel"clearable placeholder="规格型号"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="unitName">
|
||||
<el-input v-model="dataForm.unitName"clearable placeholder="单位名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="dataForm.remark"clearable placeholder="备注"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from "@/mixins/basic-add";
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: "/code/mtProduct/",
|
||||
infoURL: "/code/mtProduct",
|
||||
},
|
||||
isGetCode: true,
|
||||
dataForm: {
|
||||
id: "",
|
||||
productAllName: "",
|
||||
productCode: "",
|
||||
productName: "",
|
||||
productType: "",
|
||||
specModel: "",
|
||||
unitName: "",
|
||||
remark: "",
|
||||
},
|
||||
options: [
|
||||
{
|
||||
value: "1",
|
||||
label: "成品",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "半成品",
|
||||
},
|
||||
{
|
||||
value: "3",
|
||||
label: "原材料",
|
||||
},
|
||||
],
|
||||
dataRule: {
|
||||
productAllName: [{ required: true, message: "产品全名不能为空", trigger: "blur" }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
this.$http
|
||||
.get("/code/mtProduct/getCode")
|
||||
.then(({ data: res }) => {
|
||||
console.log(res)
|
||||
this.dataForm.productCode = res;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
33
src/views/modules/code/detInfoBtn.vue
Normal file
33
src/views/modules/code/detInfoBtn.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-03-03 15:25:53
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 15:33:07
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<span>
|
||||
<el-button type="text" size="small" @click="emitClick">子任务</el-button>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
emitClick() {
|
||||
this.$router.push({
|
||||
name: 'mtTaskInfoDet',
|
||||
query: {
|
||||
id: this.injectData.id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
118
src/views/modules/code/mtAlarmLog.vue
Normal file
118
src/views/modules/code/mtAlarmLog.vue
Normal file
@@ -0,0 +1,118 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 10:07:37
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
/>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import i18n from "@/i18n";
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "alarmCode",
|
||||
label: "报警编码",
|
||||
},
|
||||
{
|
||||
prop: "alarmContent",
|
||||
label: "报警内容",
|
||||
},
|
||||
{
|
||||
prop: "alarmGrade",
|
||||
label: "报警级别",
|
||||
},
|
||||
{
|
||||
prop: "alarmType",
|
||||
label: "报警类型",
|
||||
},
|
||||
{
|
||||
prop: "description",
|
||||
label: "描述",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/code/mtAlarmLog/page",
|
||||
exportUrl: "/code/mtAlarmLog/export",
|
||||
},
|
||||
tableProps,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "报警内容",
|
||||
placeholder: "报警内容",
|
||||
param: "alarmContent",
|
||||
},
|
||||
{
|
||||
type: "select",
|
||||
label: "报警等级",
|
||||
selectOptions: [
|
||||
{ id: "高", name: "高" },
|
||||
{ id: "中", name: "中" },
|
||||
{ id: "低", name: "低" },
|
||||
],
|
||||
param: "alarmGrade",
|
||||
defaultSelect: "",
|
||||
onchange: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.alarmContent = val.alarmContent;
|
||||
this.listQuery.alarmGrade = val.alarmGrade
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
111
src/views/modules/code/mtCommunLog.vue
Normal file
111
src/views/modules/code/mtCommunLog.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-09 14:26:09
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
/>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import i18n from "@/i18n";
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "content",
|
||||
label: "内容集",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "状态",
|
||||
filter: codeFilter('logStatus'),
|
||||
},
|
||||
{
|
||||
prop: "type",
|
||||
label: "通讯类型",
|
||||
filter: codeFilter('logType'),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/code/mtCommunLog/page",
|
||||
exportUrl: "/code/mtCommunLog/export",
|
||||
},
|
||||
tableProps,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "通讯类型",
|
||||
placeholder: "通讯类型",
|
||||
param: "alarmContent",
|
||||
},
|
||||
// {
|
||||
// type: "select",
|
||||
// label: "报警类型",
|
||||
// selectOptions: [
|
||||
// { id: "0", name: i18n.t("logLogin.status0") },
|
||||
// { id: "1", name: i18n.t("logLogin.status1") },
|
||||
// { id: "2", name: i18n.t("logLogin.status2") },
|
||||
// ],
|
||||
// param: "alarmType",
|
||||
// defaultSelect: "",
|
||||
// onchange: true,
|
||||
// width: 200,
|
||||
// },
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.alarmContent = val.alarmContent;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
174
src/views/modules/code/mtEquipmentInfo.vue
Normal file
174
src/views/modules/code/mtEquipmentInfo.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 15:53:16
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 10:54:25
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './components/equipmentInfo-add'
|
||||
import basicPage from '@/mixins/basic-page'
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "名称",
|
||||
},
|
||||
{
|
||||
prop: "code",
|
||||
label: "编码",
|
||||
},
|
||||
{
|
||||
prop: "alias",
|
||||
label: "别名",
|
||||
},
|
||||
{
|
||||
prop: "en",
|
||||
label: "英语名称",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "状态",
|
||||
filter: codeFilter('eStatus'),
|
||||
},
|
||||
{
|
||||
prop: "type",
|
||||
label: "设备类型",
|
||||
},
|
||||
{
|
||||
prop: "description",
|
||||
label: "备注",
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '/code/mtEquipmentInfo/page',
|
||||
deleteURL: '/code/mtEquipmentInfo',
|
||||
statusUrl: '/code/mtEquipmentInfo/status',
|
||||
exportUrl: '/code/mtEquipmentInfo/export'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "名称",
|
||||
placeholder: "请输入名称",
|
||||
param: "name",
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
label: "编码",
|
||||
placeholder: "请输入编码",
|
||||
param: "code",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.code = val.code;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle('设备管理')
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
174
src/views/modules/code/mtProduct.vue
Normal file
174
src/views/modules/code/mtProduct.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 15:53:16
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 10:29:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './components/product-add'
|
||||
import basicPage from '@/mixins/basic-page'
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "productAllName",
|
||||
label: "产品全名",
|
||||
},
|
||||
{
|
||||
prop: "productName",
|
||||
label: "产品名称",
|
||||
},
|
||||
{
|
||||
prop: "productCode",
|
||||
label: "产品编码",
|
||||
},
|
||||
{
|
||||
prop: "productType",
|
||||
label: "产品类别",
|
||||
filter: codeFilter('productType'),
|
||||
},
|
||||
{
|
||||
prop: "specModel",
|
||||
label: "规格型号",
|
||||
},
|
||||
{
|
||||
prop: "unitName",
|
||||
label: "单位名称",
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: "备注",
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '/code/mtProduct/page',
|
||||
deleteURL: '/code/mtProduct',
|
||||
statusUrl: '/code/mtProduct/status',
|
||||
exportUrl: '/code/mtProduct/export'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "名称",
|
||||
placeholder: "请输入名称",
|
||||
param: "name",
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
label: "编码",
|
||||
placeholder: "请输入编码",
|
||||
param: "code",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.code = val.code;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle('产品管理')
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
191
src/views/modules/code/mtTaskInfo.vue
Normal file
191
src/views/modules/code/mtTaskInfo.vue
Normal file
@@ -0,0 +1,191 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 15:53:16
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-09 11:04:11
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="120"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from "./components/mtTaskInfo-add";
|
||||
import detInfoBtn from './detInfoBtn'
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import codeFilter from "@/filters/code-filter";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "num",
|
||||
label: "数量",
|
||||
},
|
||||
{
|
||||
prop: "prodectCode",
|
||||
label: "产品编码",
|
||||
},
|
||||
{
|
||||
prop: "specModel",
|
||||
label: "型号",
|
||||
},
|
||||
{
|
||||
prop: "source",
|
||||
label: "来源",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "状态",
|
||||
filter: codeFilter("detStatus"),
|
||||
},
|
||||
{
|
||||
prop: "taskCode",
|
||||
label: "任务编码",
|
||||
},
|
||||
{
|
||||
prop: "taskType",
|
||||
label: "任务类型",
|
||||
filter: codeFilter("taskType"),
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
},
|
||||
{
|
||||
prop: "detInfo",
|
||||
label: "子任务",
|
||||
subcomponent: detInfoBtn,
|
||||
},
|
||||
// {
|
||||
// prop: "remarks",
|
||||
// label: "描述",
|
||||
// },
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "run",
|
||||
btnName: "执行",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/code/mtTaskInfo/page",
|
||||
deleteURL: "/code/mtTaskInfo",
|
||||
statusUrl: "/code/mtTaskInfo/status",
|
||||
exportUrl: "/code/mtTaskInfo/export",
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "产品编码",
|
||||
placeholder: "产品编码",
|
||||
param: "prodectCode",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.prodectCode = val.prodectCode;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = "新增";
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle("出入库");
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
btnFun(val){
|
||||
console.log('run')
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
209
src/views/modules/code/mtTaskInfoDet.vue
Normal file
209
src/views/modules/code/mtTaskInfoDet.vue
Normal file
@@ -0,0 +1,209 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 15:53:16
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 15:50:21
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from "./components/mtTaskInfoDet-add";
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import codeFilter from "@/filters/code-filter";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "dateNum",
|
||||
label: "批次号",
|
||||
},
|
||||
{
|
||||
prop: "isHeight",
|
||||
label: "是否超高",
|
||||
filter: codeFilter("isHeight"),
|
||||
},
|
||||
{
|
||||
prop: "isWeight",
|
||||
label: "是否超重",
|
||||
filter: codeFilter("isWeight"),
|
||||
},
|
||||
{
|
||||
prop: "num",
|
||||
label: "数量",
|
||||
},
|
||||
{
|
||||
prop: "specModel",
|
||||
label: "型号",
|
||||
},
|
||||
{
|
||||
prop: "startPosition",
|
||||
label: "起点",
|
||||
},
|
||||
{
|
||||
prop: "targetPosition",
|
||||
label: "终点",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "状态",
|
||||
filter: codeFilter("detStatus"),
|
||||
},
|
||||
{
|
||||
prop: "taskDetCode",
|
||||
label: "任务编码",
|
||||
},
|
||||
{
|
||||
prop: "taskType",
|
||||
label: "任务类型",
|
||||
filter: codeFilter("taskType"),
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
},
|
||||
{
|
||||
prop: "warehouseRankName",
|
||||
label: "库位名称",
|
||||
},
|
||||
// {
|
||||
// prop: "remarks",
|
||||
// label: "描述",
|
||||
// },
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/code/mtTaskInfoDet/page",
|
||||
deleteURL: "/code/mtTaskInfoDet",
|
||||
statusUrl: "/code/mtTaskInfoDet/status",
|
||||
exportUrl: "/code/mtTaskInfoDet/export",
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "产品编码",
|
||||
placeholder: "产品编码",
|
||||
param: "prodectCode",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "返回",
|
||||
name: "back",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
this.listQuery.taskId = this.$route.query.id;
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.prodectCode = val.prodectCode;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = "新增";
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle();
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle("任务详情");
|
||||
break;
|
||||
case "back":
|
||||
this.goback();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
goback() {
|
||||
this.$router.go(-1);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
133
src/views/modules/code/mtTaskInfoDetLog.vue
Normal file
133
src/views/modules/code/mtTaskInfoDetLog.vue
Normal file
@@ -0,0 +1,133 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 10:20:36
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
/>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import i18n from "@/i18n";
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "dateNum",
|
||||
label: "批次号",
|
||||
},
|
||||
{
|
||||
prop: "isHeight",
|
||||
label: "是否超高",
|
||||
filter: codeFilter('isHeight'),
|
||||
},
|
||||
{
|
||||
prop: "isWeight",
|
||||
label: "是否超重",
|
||||
filter: codeFilter('isWeight'),
|
||||
},
|
||||
{
|
||||
prop: "num",
|
||||
label: "数量",
|
||||
},
|
||||
{
|
||||
prop: "specModel",
|
||||
label: "型号",
|
||||
},
|
||||
{
|
||||
prop: "startPosition",
|
||||
label: "起点",
|
||||
},
|
||||
{
|
||||
prop: "targetPosition",
|
||||
label: "终点",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "状态",
|
||||
filter: codeFilter('detStatus'),
|
||||
},
|
||||
{
|
||||
prop: "taskDetCode",
|
||||
label: "任务编码",
|
||||
},
|
||||
{
|
||||
prop: "taskType",
|
||||
label: "任务类型",
|
||||
filter: codeFilter('taskType'),
|
||||
},
|
||||
{
|
||||
prop: "unit",
|
||||
label: "单位",
|
||||
},
|
||||
{
|
||||
prop: "warehouseRankName",
|
||||
label: "库位名称",
|
||||
},
|
||||
{
|
||||
prop: "remarks",
|
||||
label: "描述",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/code/mtTaskInfoDetLog/page",
|
||||
exportUrl: "/code/mtTaskInfoDetLog/export",
|
||||
},
|
||||
tableProps,
|
||||
formConfig: [
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
154
src/views/modules/code/mtWarehouse.vue
Normal file
154
src/views/modules/code/mtWarehouse.vue
Normal file
@@ -0,0 +1,154 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 15:53:16
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:14:24
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './components/mtWarehouse-add'
|
||||
import basicPage from '@/mixins/basic-page'
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "whName",
|
||||
label: "仓库名称",
|
||||
},
|
||||
{
|
||||
prop: "whCode",
|
||||
label: "仓库编码",
|
||||
},
|
||||
{
|
||||
prop: "address",
|
||||
label: "地址",
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: "备注",
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '/code/mtWarehouse/page',
|
||||
deleteURL: '/code/mtWarehouse',
|
||||
statusUrl: '/code/mtWarehouse/status',
|
||||
exportUrl: '/code/mtWarehouse/export'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "名称",
|
||||
placeholder: "请输入名称",
|
||||
param: "whName",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.whName = val.whName;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle('仓库管理')
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
183
src/views/modules/code/mtWarehousePositionRelat.vue
Normal file
183
src/views/modules/code/mtWarehousePositionRelat.vue
Normal file
@@ -0,0 +1,183 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 15:53:16
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:45:55
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './components/mtWarehousePositionRelat-add'
|
||||
import basicPage from '@/mixins/basic-page'
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "dateNum",
|
||||
label: "批次号",
|
||||
},
|
||||
{
|
||||
prop: "isEmpty",
|
||||
label: "是否为空",
|
||||
filter: codeFilter('isEmpty'),
|
||||
},
|
||||
{
|
||||
prop: "productName",
|
||||
label: "产品名称",
|
||||
},
|
||||
{
|
||||
prop: "productCode",
|
||||
label: "产品编码",
|
||||
},
|
||||
{
|
||||
prop: "quantity",
|
||||
label: "货物数量",
|
||||
},
|
||||
{
|
||||
prop: "specModel",
|
||||
label: "详细规格",
|
||||
},
|
||||
{
|
||||
prop: "warehousePositionName",
|
||||
label: "库位名称",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "库位状态",
|
||||
filter: codeFilter('positionStatus'),
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: "描述",
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '/code/mtWarehousePositionRelat/page',
|
||||
deleteURL: '/code/mtWarehousePositionRelat',
|
||||
statusUrl: '/code/mtWarehousePositionRelat/status',
|
||||
exportUrl: '/code/mtWarehousePositionRelat/export'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "产品名称",
|
||||
placeholder: "请输入产品名称",
|
||||
param: "productName",
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
label: "产品编码",
|
||||
placeholder: "请输入产品编码",
|
||||
param: "productCode",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.productName = val.productName;
|
||||
this.listQuery.productCode = val.productCode;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle('库位货物管理')
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
111
src/views/modules/code/mtWarehousePositionRelatLog.vue
Normal file
111
src/views/modules/code/mtWarehousePositionRelatLog.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 10:12:50
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
/>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import i18n from "@/i18n";
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "dateNum",
|
||||
label: "批次号",
|
||||
},
|
||||
{
|
||||
prop: "isEmpty",
|
||||
label: "是否为空",
|
||||
filter: codeFilter('isEmpty'),
|
||||
},
|
||||
{
|
||||
prop: "productName",
|
||||
label: "产品名称",
|
||||
},
|
||||
{
|
||||
prop: "quantity",
|
||||
label: "货物数量",
|
||||
},
|
||||
{
|
||||
prop: "specModel",
|
||||
label: "详细规格",
|
||||
},
|
||||
{
|
||||
prop: "warehousePositionName",
|
||||
label: "库位名称",
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: "库位状态",
|
||||
filter: codeFilter('positionStatus'),
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: "描述",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/code/mtWarehousePositionRelatLog/page",
|
||||
exportUrl: "/code/mtWarehousePositionRelatLog/export",
|
||||
},
|
||||
tableProps,
|
||||
formConfig: [
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
182
src/views/modules/code/mtWarehouseRank.vue
Normal file
182
src/views/modules/code/mtWarehouseRank.vue
Normal file
@@ -0,0 +1,182 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 15:53:16
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:46:17
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './components/mtWarehouseRank-add'
|
||||
import basicPage from '@/mixins/basic-page'
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "anotherName",
|
||||
label: "别名",
|
||||
},
|
||||
{
|
||||
prop: "columnCode",
|
||||
label: "列标",
|
||||
},
|
||||
{
|
||||
prop: "rowCode",
|
||||
label: "行标",
|
||||
},
|
||||
{
|
||||
prop: "regionName",
|
||||
label: "区域名称",
|
||||
},
|
||||
{
|
||||
prop: "direction",
|
||||
label: "方向",
|
||||
filter: codeFilter('direction'),
|
||||
},
|
||||
{
|
||||
prop: "isOccupy",
|
||||
label: "是否被占用",
|
||||
filter: codeFilter('isOccupy'),
|
||||
},
|
||||
{
|
||||
prop: "positionCode",
|
||||
label: "库位编码",
|
||||
},
|
||||
{
|
||||
prop: "sequence",
|
||||
label: "顺序号",
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: "备注",
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '/code/mtWarehouseRank/page',
|
||||
deleteURL: '/code/mtWarehouseRank',
|
||||
exportUrl: '/code/mtWarehouseRank/export'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "名称",
|
||||
placeholder: "请输入名称",
|
||||
param: "name",
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
label: "编码",
|
||||
placeholder: "请输入编码",
|
||||
param: "code",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.code = val.code;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle('库位管理')
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
162
src/views/modules/code/mtWarehouseRegion.vue
Normal file
162
src/views/modules/code/mtWarehouseRegion.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-08-22 15:53:16
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:32:46
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './components/mtWarehouseRegion-add'
|
||||
import basicPage from '@/mixins/basic-page'
|
||||
import codeFilter from '@/filters/code-filter'
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "createTime",
|
||||
label: "添加时间",
|
||||
},
|
||||
{
|
||||
prop: "regionName",
|
||||
label: "区域名称",
|
||||
},
|
||||
{
|
||||
prop: "regionCode",
|
||||
label: "区域编码",
|
||||
},
|
||||
{
|
||||
prop: "regionType",
|
||||
label: "区域类型",
|
||||
filter: codeFilter('regionType'),
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: "备注",
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
}
|
||||
];
|
||||
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '/code/mtWarehouseRegion/page',
|
||||
deleteURL: '/code/mtWarehouseRegion',
|
||||
statusUrl: '/code/mtWarehouseRegion/status',
|
||||
exportUrl: '/code/mtWarehouseRegion/export'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "名称",
|
||||
placeholder: "请输入名称",
|
||||
param: "name",
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
label: "编码",
|
||||
placeholder: "请输入编码",
|
||||
param: "code",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.code = val.code;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
case "export":
|
||||
this.exportHandle('仓库区域管理')
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
2608
src/views/modules/code/testdata.js
Normal file
2608
src/views/modules/code/testdata.js
Normal file
File diff suppressed because it is too large
Load Diff
192
src/views/modules/code/wareMonitor.vue
Normal file
192
src/views/modules/code/wareMonitor.vue
Normal file
@@ -0,0 +1,192 @@
|
||||
<!--
|
||||
* @Author: gtz
|
||||
* @Date: 2022-03-03 09:16:10
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-04-11 09:10:11
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-ck-wms-ui\src\views\dashboard\index.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="dashboard-container">
|
||||
<el-card class="dashboard-main">
|
||||
<el-row class="dashboard-title">
|
||||
<div class="dashboard-header-line" />
|
||||
<div class="dashboard-header-title">WMS库存信息</div>
|
||||
</el-row>
|
||||
<el-row class="dashboard-legend">
|
||||
<div v-for="item in cassetteStatusList" :key="'cassette' + item.id" class="dashboard-legend-cassette">
|
||||
<div class="dashboard-legend-cassette-cricle" :style="{background: item.color}" />
|
||||
{{ item.name }}
|
||||
</div>
|
||||
|
|
||||
<div v-for="item in portAttributeList" :key="'port' + item.id" class="dashboard-legend-port" :style="{background: item.color}">
|
||||
{{ item.name }}
|
||||
</div>
|
||||
<div class="dashboard-legend-search">
|
||||
<el-select v-model="current" size="mini" placeholder="请选择库存范围" @change="handleChange">
|
||||
<el-option v-for="item in totalPage" :key="'select' + item" :label="'第' + item + '页'" :value="item" />
|
||||
</el-select>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-row v-if="current * 80 < shelfList[0].rowList[0].portList.length" class="dashboard-layout" :gutter="12">
|
||||
<el-col v-for="item in 4" :key="'shelfbox' + item" class="dashboard-layout-shelf-box" :span="6">
|
||||
<el-row>
|
||||
<el-col v-for="(i, index) in shelfList" :key="item + 'shelf' + i.id" :span="12" class="dashboard-layout-shelf">
|
||||
<el-row>
|
||||
<el-col v-for="z in i.rowList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in 20" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}">
|
||||
<div v-if="z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0] ? cassetteStatusObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0].status] : ''}" />
|
||||
{{ z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="dashboard-layout-footer">
|
||||
{{ '第' + rowIndex[index] + '排(' + ((current - 1) * 4 + item) + ')' }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-else class="dashboard-layout" :gutter="12">
|
||||
<el-col v-for="item in Math.ceil((shelfList[0].rowList[0].portList.length - (current - 1) * 80) / 20)" :key="'shelfbox' + item" class="dashboard-layout-shelf-box" :span="6">
|
||||
<el-row>
|
||||
<el-col v-for="(i, index) in shelfList" :key="item + 'shelf' + i.id" :span="12" class="dashboard-layout-shelf">
|
||||
<el-row v-if="item < Math.ceil((shelfList[0].rowList[0].portList.length - (current - 1) * 80) / 20)">
|
||||
<el-col v-for="z in i.rowList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in 20" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}">
|
||||
<div v-if="z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0] ? cassetteStatusObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0].status] : ''}" />
|
||||
{{ z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row v-else>
|
||||
<el-col v-for="z in i.rowList" :key="item + 'shelf' + i + 'row' + z.id" :span="12" class="dashboard-layout-row">
|
||||
<div v-for="x in shelfList[0].rowList[0].portList.length - (item - 1) * 20 - (current - 1) * 80" :key="item + 'shelf' + i + 'row' + z + 'item' + x" class="dashboard-layout-item" :style="{background: portAttributeObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute], cursor: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? 'not-allowed' : 'pointer', color: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute === 3 ? '#A2A8B5' : ''}">
|
||||
<div v-if="z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3" class="dashboard-layout-item-cricle" :style="{background: z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0] ? cassetteStatusObj[z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].cassetteList[0].status] : ''}" />
|
||||
{{ z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].attribute !== 3 ? z.portList[(current - 1) * 80 + (item - 1) * 20 + (x - 1)].name : 'XXXX' }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="dashboard-layout-footer">
|
||||
{{ '第' + rowIndex[index] + '排(' + ((current - 1) * 4 + item) + ')' }}
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import testdata from './testdata'
|
||||
|
||||
export default {
|
||||
name: 'Dashboard',
|
||||
data () {
|
||||
return testdata
|
||||
},
|
||||
created () {
|
||||
console.log(this.shelfList)
|
||||
this.totalPage = Math.ceil(this.shelfList[0].rowList[0].portList.length / 80)
|
||||
},
|
||||
methods: {
|
||||
handleChange (v) {
|
||||
console.log(v)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.dashboard-container {
|
||||
background: #F2F4F9;
|
||||
min-height: calc(100vh - 134px);
|
||||
overflow-x: scroll;
|
||||
font-size: 14px;
|
||||
.dashboard-main {
|
||||
width: 100%;
|
||||
min-width: 1380px;
|
||||
background-color: #fff;
|
||||
border-radius: 8px;
|
||||
min-height: calc(100vh - 186px);
|
||||
.dashboard-title {
|
||||
.dashboard-header-line{
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background: #0B58FF;
|
||||
border-radius: 1px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
margin-right: 4px;
|
||||
}
|
||||
.dashboard-header-title{
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
font-family: PingFangSC-Regular, PingFang SC;
|
||||
font-weight: 400;
|
||||
color: #000000;
|
||||
line-height: 16px;
|
||||
}
|
||||
}
|
||||
.dashboard-legend {
|
||||
margin-top: 20px;
|
||||
.dashboard-legend-cassette {
|
||||
display: inline-block;
|
||||
margin-right: 24px;
|
||||
.dashboard-legend-cassette-cricle {
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
}
|
||||
.dashboard-legend-port {
|
||||
display: inline-block;
|
||||
height: 24px;
|
||||
line-height: 24px;
|
||||
border-radius: 4px;
|
||||
padding: 0 16px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
.dashboard-legend-search {
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.dashboard-layout {
|
||||
margin: 20px 0;
|
||||
.dashboard-layout-shelf-box {
|
||||
.dashboard-layout-footer {
|
||||
text-align: center;
|
||||
margin-top: 12px;
|
||||
}
|
||||
.dashboard-layout-shelf {
|
||||
padding: 0 8px;
|
||||
.dashboard-layout-row {
|
||||
padding: 0 1px;
|
||||
.dashboard-layout-item {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
height: 32px;
|
||||
box-shadow: 0px 3px 6px 0px rgba(166, 174, 190, 0.8);
|
||||
border-radius: 2px 4px 4px 2px;
|
||||
margin-bottom: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.dashboard-layout-item-cricle{
|
||||
display: inline-block;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 6px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
20
src/views/modules/home.vue
Normal file
20
src/views/modules/home.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-06 09:45:19
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-home">
|
||||
基础框架-1
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.mod-home {
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
106
src/views/modules/job/schedule-add-or-update.vue
Normal file
106
src/views/modules/job/schedule-add-or-update.vue
Normal file
@@ -0,0 +1,106 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="beanName" :label="$t('schedule.beanName')">
|
||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanNameTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="params" :label="$t('schedule.params')">
|
||||
<el-input v-model="dataForm.params" :placeholder="$t('schedule.params')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="cronExpression" :label="$t('schedule.cronExpression')">
|
||||
<el-popover v-model="cronPopover">
|
||||
<cron @change="changeCron" @close="cronPopover=false" i18n="cn"></cron>
|
||||
<el-input slot="reference" @click="cronPopover=true" v-model="dataForm.cronExpression" :placeholder="$t('schedule.cronExpressionTips')"></el-input>
|
||||
</el-popover>
|
||||
</el-form-item>
|
||||
<el-form-item prop="remark" :label="$t('schedule.remark')">
|
||||
<el-input v-model="dataForm.remark" :placeholder="$t('schedule.remark')"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template slot="footer">
|
||||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import { cron } from 'vue-cron'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: '',
|
||||
beanName: '',
|
||||
params: '',
|
||||
cronExpression: '',
|
||||
remark: '',
|
||||
status: 0
|
||||
},
|
||||
cronPopover: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
cron
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
beanName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
cronExpression: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
},
|
||||
changeCron (val) {
|
||||
this.dataForm.cronExpression = val
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/schedule/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = res.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/schedule', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
74
src/views/modules/job/schedule-log.vue
Normal file
74
src/views/modules/job/schedule-log.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="$t('schedule.log')" :close-on-click-modal="false" :close-on-press-escape="false" width="75%">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.jobId" :placeholder="$t('schedule.jobId')" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="dataListLoading"
|
||||
:data="dataList"
|
||||
border
|
||||
@sort-change="dataListSortChangeHandle"
|
||||
height="460"
|
||||
style="width: 100%;">
|
||||
<el-table-column prop="jobId" :label="$t('schedule.jobId')" header-align="center" align="center" width="80"></el-table-column>
|
||||
<el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="status" :label="$t('schedule.status')" header-align="center" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.statusLog1') }}</el-tag>
|
||||
<el-tag v-else type="danger" size="small" @click.native="showErrorInfo(scope.row.id)" style="cursor: pointer;">{{ $t('schedule.statusLog0') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="times" :label="$t('schedule.times')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="createDate" :label="$t('schedule.createDate')" header-align="center" align="center" width="180"></el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="limit"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="pageSizeChangeHandle"
|
||||
@current-change="pageCurrentChangeHandle">
|
||||
</el-pagination>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mixinViewModule from '@/mixins/view-module'
|
||||
export default {
|
||||
mixins: [mixinViewModule],
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
mixinViewModuleOptions: {
|
||||
getDataListURL: '/sys/scheduleLog/page',
|
||||
getDataListIsPage: true
|
||||
},
|
||||
dataForm: {
|
||||
jobId: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.visible = true
|
||||
this.getDataList()
|
||||
},
|
||||
// 失败信息
|
||||
showErrorInfo (id) {
|
||||
this.$http.get(`/sys/scheduleLog/${id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$alert(res.data.error)
|
||||
}).catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
196
src/views/modules/job/schedule.vue
Normal file
196
src/views/modules/job/schedule.vue
Normal file
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-job__schedule">
|
||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
||||
<el-form-item>
|
||||
<el-input v-model="dataForm.beanName" :placeholder="$t('schedule.beanName')" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="danger" @click="pauseHandle()">{{ $t('schedule.pauseBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="danger" @click="resumeHandle()">{{ $t('schedule.resumeBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="danger" @click="runHandle()">{{ $t('schedule.runBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button v-if="$hasPermission('sys:schedule:log')" type="success" @click="logHandle()">{{ $t('schedule.log') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="dataListLoading"
|
||||
:data="dataList"
|
||||
border
|
||||
@selection-change="dataListSelectionChangeHandle"
|
||||
@sort-change="dataListSortChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="beanName" :label="$t('schedule.beanName')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="params" :label="$t('schedule.params')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="cronExpression" :label="$t('schedule.cronExpression')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="remark" :label="$t('schedule.remark')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="status" :label="$t('schedule.status')" sortable="custom" header-align="center" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.status === 1" size="small">{{ $t('schedule.status1') }}</el-tag>
|
||||
<el-tag v-else size="small" type="danger">{{ $t('schedule.status0') }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="$hasPermission('sys:schedule:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:pause')" type="text" size="small" @click="pauseHandle(scope.row.id)">{{ $t('schedule.pause') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:resume')" type="text" size="small" @click="resumeHandle(scope.row.id)">{{ $t('schedule.resume') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:run')" type="text" size="small" @click="runHandle(scope.row.id)">{{ $t('schedule.run') }}</el-button>
|
||||
<el-button v-if="$hasPermission('sys:schedule:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="limit"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="pageSizeChangeHandle"
|
||||
@current-change="pageCurrentChangeHandle">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @successSubmit="getDataList"></add-or-update>
|
||||
<!-- 弹窗, 日志列表 -->
|
||||
<log v-if="logVisible" ref="log"></log>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mixinViewModule from '@/mixins/view-module'
|
||||
import AddOrUpdate from './schedule-add-or-update'
|
||||
import Log from './schedule-log'
|
||||
export default {
|
||||
mixins: [mixinViewModule],
|
||||
data () {
|
||||
return {
|
||||
mixinViewModuleOptions: {
|
||||
getDataListURL: '/sys/schedule/page',
|
||||
getDataListIsPage: true,
|
||||
deleteURL: '/sys/schedule',
|
||||
deleteIsBatch: true
|
||||
},
|
||||
dataForm: {
|
||||
beanName: ''
|
||||
},
|
||||
logVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
Log
|
||||
},
|
||||
methods: {
|
||||
// 暂停
|
||||
pauseHandle (id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.pause') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http.put('/sys/schedule/pause', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 恢复
|
||||
resumeHandle (id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.resume') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http.put('/sys/schedule/resume', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 执行
|
||||
runHandle (id) {
|
||||
if (!id && this.dataListSelections.length <= 0) {
|
||||
return this.$message({
|
||||
message: this.$t('prompt.deleteBatch'),
|
||||
type: 'warning',
|
||||
duration: 500
|
||||
})
|
||||
}
|
||||
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('schedule.run') }), this.$t('prompt.title'), {
|
||||
confirmButtonText: this.$t('confirm'),
|
||||
cancelButtonText: this.$t('cancel'),
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$http.put('/sys/schedule/run', id ? [id] : this.dataListSelections.map(item => item.id)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.getDataList()
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 日志列表
|
||||
logHandle () {
|
||||
this.logVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.log.init()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
225
src/views/modules/oss/oss-config.vue
Normal file
225
src/views/modules/oss/oss-config.vue
Normal file
@@ -0,0 +1,225 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="$t('oss.config')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item :label="$t('oss.type')" size="mini">
|
||||
<el-radio-group v-model="dataForm.type">
|
||||
<el-radio :label="1">{{ $t('oss.type1') }}</el-radio>
|
||||
<el-radio :label="2">{{ $t('oss.type2') }}</el-radio>
|
||||
<el-radio :label="3">{{ $t('oss.type3') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<template v-if="dataForm.type === 1">
|
||||
<el-form-item size="mini">
|
||||
<a href="https://s.qiniu.com/7Rfaym" target="_blank">免费申请(七牛)10GB储存空间</a>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qiniuDomain" :label="$t('oss.qiniuDomain')">
|
||||
<el-input v-model="dataForm.qiniuDomain" :placeholder="$t('oss.qiniuDomainTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qiniuPrefix" :label="$t('oss.qiniuPrefix')">
|
||||
<el-input v-model="dataForm.qiniuPrefix" :placeholder="$t('oss.qiniuPrefixTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qiniuAccessKey" :label="$t('oss.qiniuAccessKey')">
|
||||
<el-input v-model="dataForm.qiniuAccessKey" :placeholder="$t('oss.qiniuAccessKeyTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qiniuSecretKey" :label="$t('oss.qiniuSecretKey')">
|
||||
<el-input v-model="dataForm.qiniuSecretKey" :placeholder="$t('oss.qiniuSecretKeyTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qiniuBucketName" :label="$t('oss.qiniuBucketName')">
|
||||
<el-input v-model="dataForm.qiniuBucketName" :placeholder="$t('oss.qiniuBucketNameTips')"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else-if="dataForm.type === 2">
|
||||
<el-form-item size="mini">
|
||||
<a href="https://www.aliyun.com/minisite/goods?userCode=y93lfwbg" target="_blank">免费领取阿里云优惠券</a>
|
||||
</el-form-item>
|
||||
<el-form-item prop="aliyunDomain" :label="$t('oss.aliyunDomain')">
|
||||
<el-input v-model="dataForm.aliyunDomain" :placeholder="$t('oss.aliyunDomainTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="aliyunPrefix" :label="$t('oss.aliyunPrefix')">
|
||||
<el-input v-model="dataForm.aliyunPrefix" :placeholder="$t('oss.aliyunPrefixTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="aliyunEndPoint" :label="$t('oss.aliyunEndPoint')">
|
||||
<el-input v-model="dataForm.aliyunEndPoint" :placeholder="$t('oss.aliyunEndPointTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="aliyunAccessKeyId" :label="$t('oss.aliyunAccessKeyId')">
|
||||
<el-input v-model="dataForm.aliyunAccessKeyId" :placeholder="$t('oss.aliyunAccessKeyIdTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="aliyunAccessKeySecret" :label="$t('oss.aliyunAccessKeySecret')">
|
||||
<el-input v-model="dataForm.aliyunAccessKeySecret" :placeholder="$t('oss.aliyunAccessKeySecretTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="aliyunBucketName" :label="$t('oss.aliyunBucketName')">
|
||||
<el-input v-model="dataForm.aliyunBucketName" :placeholder="$t('oss.aliyunBucketNameTips')"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template v-else-if="dataForm.type === 3">
|
||||
<el-form-item size="mini">
|
||||
<a href="https://curl.qcloud.com/zt3xdYbZ" target="_blank">免费领取腾讯云优惠券</a>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qcloudDomain" :label="$t('oss.qcloudDomain')">
|
||||
<el-input v-model="dataForm.qcloudDomain" :placeholder="$t('oss.qcloudDomainTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qcloudPrefix" :label="$t('oss.qcloudPrefix')">
|
||||
<el-input v-model="dataForm.qcloudPrefix" :placeholder="$t('oss.qcloudPrefixTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qcloudAppId" :label="$t('oss.qcloudAppId')">
|
||||
<el-input v-model="dataForm.qcloudAppId" :placeholder="$t('oss.qcloudAppIdTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qcloudSecretId" :label="$t('oss.qcloudSecretId')">
|
||||
<el-input v-model="dataForm.qcloudSecretId" :placeholder="$t('oss.qcloudSecretIdTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qcloudSecretKey" :label="$t('oss.qcloudSecretKey')">
|
||||
<el-input v-model="dataForm.qcloudSecretKey" :placeholder="$t('oss.qcloudSecretKeyTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qcloudBucketName" :label="$t('oss.qcloudBucketName')">
|
||||
<el-input v-model="dataForm.qcloudBucketName" :placeholder="$t('oss.qcloudBucketNameTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="qcloudRegion" :label="$t('oss.qcloudRegion')">
|
||||
<el-select v-model="dataForm.qcloudRegion" clearable :placeholder="$t('oss.qcloudRegionTips')" class="w-percent-100">
|
||||
<el-option value="ap-beijing-1" :label="$t('oss.qcloudRegionBeijing1')"></el-option>
|
||||
<el-option value="ap-beijing" :label="$t('oss.qcloudRegionBeijing')"></el-option>
|
||||
<el-option value="ap-shanghai" :label="$t('oss.qcloudRegionShanghai')"></el-option>
|
||||
<el-option value="ap-guangzhou" :label="$t('oss.qcloudRegionGuangzhou')"></el-option>
|
||||
<el-option value="ap-chengdu" :label="$t('oss.qcloudRegionChengdu')"></el-option>
|
||||
<el-option value="ap-chongqing" :label="$t('oss.qcloudRegionChongqing')"></el-option>
|
||||
<el-option value="ap-singapore" :label="$t('oss.qcloudRegionSingapore')"></el-option>
|
||||
<el-option value="ap-hongkong" :label="$t('oss.qcloudRegionHongkong')"></el-option>
|
||||
<el-option value="na-toronto" :label="$t('oss.qcloudRegionToronto')"></el-option>
|
||||
<el-option value="eu-frankfurt" :label="$t('oss.qcloudRegionFrankfurt')"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
<template slot="footer">
|
||||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
type: 0,
|
||||
qiniuDomain: '',
|
||||
qiniuPrefix: '',
|
||||
qiniuAccessKey: '',
|
||||
qiniuSecretKey: '',
|
||||
qiniuBucketName: '',
|
||||
aliyunDomain: '',
|
||||
aliyunPrefix: '',
|
||||
aliyunEndPoint: '',
|
||||
aliyunAccessKeyId: '',
|
||||
aliyunAccessKeySecret: '',
|
||||
aliyunBucketName: '',
|
||||
qcloudDomain: '',
|
||||
qcloudPrefix: '',
|
||||
qcloudAppId: 0,
|
||||
qcloudSecretId: '',
|
||||
qcloudSecretKey: '',
|
||||
qcloudBucketName: '',
|
||||
qcloudRegion: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
qiniuDomain: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qiniuAccessKey: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qiniuSecretKey: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qiniuBucketName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunDomain: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunEndPoint: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunAccessKeyId: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunAccessKeySecret: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunBucketName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudDomain: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudAppId: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudSecretId: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudSecretKey: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudBucketName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudRegion: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dataForm.type' (val) {
|
||||
this.$refs['dataForm'].clearValidate()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.getInfo()
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get('/sys/oss/info').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = res.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http.post('/sys/oss', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
65
src/views/modules/oss/oss-upload.vue
Normal file
65
src/views/modules/oss/oss-upload.vue
Normal file
@@ -0,0 +1,65 @@
|
||||
<template>
|
||||
<el-dialog :visible.sync="visible" :title="$t('oss.upload')" :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-upload
|
||||
:action="url"
|
||||
:file-list="fileList"
|
||||
drag
|
||||
multiple
|
||||
:before-upload="beforeUploadHandle"
|
||||
:on-success="successHandle"
|
||||
class="text-center">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text" v-html="$t('upload.text')"></div>
|
||||
<div class="el-upload__tip" slot="tip">{{ $t('upload.tip', { 'format': 'jpg、png、gif' }) }}</div>
|
||||
</el-upload>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Cookies from 'js-cookie'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
url: '',
|
||||
num: 0,
|
||||
fileList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
this.visible = true
|
||||
this.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`
|
||||
this.num = 0
|
||||
this.fileList = []
|
||||
},
|
||||
// 上传之前
|
||||
beforeUploadHandle (file) {
|
||||
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') {
|
||||
this.$message.error(this.$t('upload.tip', { 'format': 'jpg、png、gif' }))
|
||||
return false
|
||||
}
|
||||
this.num++
|
||||
},
|
||||
// 上传成功
|
||||
successHandle (res, file, fileList) {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.fileList = fileList
|
||||
this.num--
|
||||
if (this.num === 0) {
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
88
src/views/modules/oss/oss.vue
Normal file
88
src/views/modules/oss/oss.vue
Normal file
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-oss__oss">
|
||||
<el-form :inline="true" :model="dataForm">
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="configHandle()">{{ $t('oss.config') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="uploadHandle()">{{ $t('oss.upload') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
v-loading="dataListLoading"
|
||||
:data="dataList"
|
||||
border
|
||||
@selection-change="dataListSelectionChangeHandle"
|
||||
@sort-change="dataListSortChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
||||
<el-table-column prop="url" :label="$t('oss.url')" header-align="center" align="center"></el-table-column>
|
||||
<el-table-column prop="createDate" :label="$t('oss.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
|
||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="limit"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="pageSizeChangeHandle"
|
||||
@current-change="pageCurrentChangeHandle">
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 云存储配置 -->
|
||||
<config v-if="configVisible" ref="config"></config>
|
||||
<!-- 弹窗, 上传文件 -->
|
||||
<upload v-if="uploadVisible" ref="upload" @successSubmit="getDataList"></upload>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mixinViewModule from '@/mixins/view-module'
|
||||
import Config from './oss-config'
|
||||
import Upload from './oss-upload'
|
||||
export default {
|
||||
mixins: [mixinViewModule],
|
||||
data () {
|
||||
return {
|
||||
mixinViewModuleOptions: {
|
||||
getDataListURL: '/sys/oss/page',
|
||||
getDataListIsPage: true,
|
||||
deleteURL: '/sys/oss',
|
||||
deleteIsBatch: true
|
||||
},
|
||||
dataForm: {},
|
||||
configVisible: false,
|
||||
uploadVisible: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Config,
|
||||
Upload
|
||||
},
|
||||
methods: {
|
||||
// 云存储配置
|
||||
configHandle () {
|
||||
this.configVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.config.init()
|
||||
})
|
||||
},
|
||||
// 上传文件
|
||||
uploadHandle () {
|
||||
this.uploadVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.upload.init()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
155
src/views/modules/sys/dept-add-or-update.vue
Normal file
155
src/views/modules/sys/dept-add-or-update.vue
Normal file
@@ -0,0 +1,155 @@
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
|
||||
<el-form-item prop="name" :label="$t('dept.name')">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('dept.name')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="parentName" :label="$t('dept.parentName')" class="dept-list">
|
||||
<el-popover v-model="deptListVisible" ref="deptListPopover" placement="bottom-start" trigger="click">
|
||||
<el-tree
|
||||
:data="deptList"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
node-key="id"
|
||||
ref="deptListTree"
|
||||
:highlight-current="true"
|
||||
:expand-on-click-node="false"
|
||||
accordion
|
||||
@current-change="deptListTreeCurrentChangeHandle">
|
||||
</el-tree>
|
||||
</el-popover>
|
||||
<el-input v-model="dataForm.parentName" v-popover:deptListPopover :readonly="true" :placeholder="$t('dept.parentName')">
|
||||
<i
|
||||
v-if="$store.state.user.superAdmin === 1 && dataForm.pid !== '0'"
|
||||
slot="suffix"
|
||||
@click.stop="deptListTreeSetDefaultHandle()"
|
||||
class="el-icon-circle-close el-input__icon">
|
||||
</i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sort" :label="$t('dept.sort')">
|
||||
<el-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('dept.sort')"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data () {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: '/sys/dept/',
|
||||
infoURL: '/sys/dept'
|
||||
},
|
||||
visible: false,
|
||||
deptList: [],
|
||||
deptListVisible: false,
|
||||
dataForm: {
|
||||
id: '',
|
||||
name: '',
|
||||
pid: '',
|
||||
parentName: '',
|
||||
sort: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
parentName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.getDeptList().then(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo()
|
||||
} else if (this.$store.state.user.superAdmin === 1) {
|
||||
this.deptListTreeSetDefaultHandle()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取部门列表
|
||||
getDeptList () {
|
||||
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.deptList = res.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/dept/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
if (this.dataForm.pid === '0') {
|
||||
return this.deptListTreeSetDefaultHandle()
|
||||
}
|
||||
this.$refs.deptListTree.setCurrentKey(this.dataForm.pid)
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 上级部门树, 设置默认值
|
||||
deptListTreeSetDefaultHandle () {
|
||||
this.dataForm.pid = '0'
|
||||
this.dataForm.parentName = this.$t('dept.parentNameDefault')
|
||||
},
|
||||
// 上级部门树, 选中
|
||||
deptListTreeCurrentChangeHandle (data) {
|
||||
this.dataForm.pid = data.id
|
||||
this.dataForm.parentName = data.name
|
||||
this.deptListVisible = false
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dept', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mod-sys__dept {
|
||||
.dept-list {
|
||||
.el-input__inner,
|
||||
.el-input__suffix {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
120
src/views/modules/sys/dept.vue
Normal file
120
src/views/modules/sys/dept.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-03-03 14:33:27
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__dept">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
row-key="id"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from "./dept-add-or-update";
|
||||
import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "name",
|
||||
label: i18n.t("dept.name"),
|
||||
},
|
||||
{
|
||||
prop: "parentName",
|
||||
label: i18n.t("dept.parentName"),
|
||||
},
|
||||
{
|
||||
prop: "sort",
|
||||
label: i18n.t("dept.sort"),
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/dept/list",
|
||||
deleteURL: "/sys/dept",
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
addDeleteURL:true,
|
||||
formConfig: [
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http
|
||||
.get(this.urlOptions.getDataListURL, {
|
||||
params: this.listQuery,
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.tableData = [];
|
||||
this.listQuery.total = 0;
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.tableData = res.data;
|
||||
this.listQuery.total = res.data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
103
src/views/modules/sys/dict-data-add-or-update.vue
Normal file
103
src/views/modules/sys/dict-data-add-or-update.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="dictValue" :label="$t('dict.dictValue')">
|
||||
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="dictLabel" :label="$t('dict.dictLabel')">
|
||||
<el-input v-model="dataForm.dictLabel" :placeholder="$t('dict.dictLabel')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sort" :label="$t('dict.sort')">
|
||||
<el-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('dict.sort')"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="remark" :label="$t('dict.remark')">
|
||||
<el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data () {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: '/sys/dict/data/',
|
||||
infoURL: '/sys/dict/data'
|
||||
},
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: '',
|
||||
dictTypeId: '',
|
||||
dictLabel: '',
|
||||
dictValue: '',
|
||||
sort: 0,
|
||||
remark: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
dictLabel: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
dictValue: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id,dictTypeId) {
|
||||
this.dataForm.id = id || "";
|
||||
this.dataForm.dictTypeId = dictTypeId || "";
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/dict/data/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dict/data', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
151
src/views/modules/sys/dict-data.vue
Normal file
151
src/views/modules/sys/dict-data.vue
Normal file
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from './dict-data-add-or-update'
|
||||
import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "dictValue",
|
||||
label: i18n.t("dict.dictValue"),
|
||||
},
|
||||
{
|
||||
prop: "dictLabel",
|
||||
label: i18n.t("dict.dictLabel"),
|
||||
},
|
||||
{
|
||||
prop: "sort",
|
||||
label: i18n.t("dict.sort"),
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: i18n.t("dict.remark"),
|
||||
},
|
||||
{
|
||||
prop: "createDate",
|
||||
label: i18n.t("dict.createDate"),
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/dict/data/page",
|
||||
deleteURL: "/sys/dict/data",
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
addDeleteURL:true,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("dict.dictValue"),
|
||||
placeholder: i18n.t("dict.dictValue"),
|
||||
param: "dictValue",
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("dict.dictLabel"),
|
||||
placeholder: i18n.t("dict.dictLabel"),
|
||||
param: "dictLabel",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created () {
|
||||
this.listQuery.dictTypeId = this.$route.params.dictTypeId || '0'
|
||||
this.getDataList()
|
||||
},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.dictValue = val.dictValue;
|
||||
this.listQuery.dictLabel = val.dictLabel;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id,this.listQuery.dictTypeId)
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
101
src/views/modules/sys/dict-type-add-or-update.vue
Normal file
101
src/views/modules/sys/dict-type-add-or-update.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="dictName" :label="$t('dict.dictName')">
|
||||
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="dictType" :label="$t('dict.dictType')">
|
||||
<el-input v-model="dataForm.dictType" :placeholder="$t('dict.dictType')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sort" :label="$t('dict.sort')">
|
||||
<el-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('dict.sort')"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="remark" :label="$t('dict.remark')">
|
||||
<el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data () {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: '/sys/dict/type/',
|
||||
infoURL: '/sys/dict/type'
|
||||
},
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: '',
|
||||
dictName: '',
|
||||
dictType: '',
|
||||
sort: 0,
|
||||
remark: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
dictName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
dictType: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/dict/type/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dict/type', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
33
src/views/modules/sys/dict-type-to.vue
Normal file
33
src/views/modules/sys/dict-type-to.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<span>
|
||||
<el-button type="text" size="small" @click="emitClick">{{ injectData.dictType }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addDynamicRoute } from '@/router'
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 子级
|
||||
emitClick () {
|
||||
// 路由参数
|
||||
const routeParams = {
|
||||
routeName: `${this.$route.name}__${this.injectData.id}`,
|
||||
title: `${this.$route.meta.title} - ${this.injectData.dictType}`,
|
||||
path: 'sys/dict-data',
|
||||
params: {
|
||||
dictTypeId: this.injectData.id
|
||||
}
|
||||
}
|
||||
// 动态路由
|
||||
addDynamicRoute(routeParams, this.$router)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
142
src/views/modules/sys/dict-type.vue
Normal file
142
src/views/modules/sys/dict-type.vue
Normal file
@@ -0,0 +1,142 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from './dict-type-add-or-update'
|
||||
import toDictType from './dict-type-to'
|
||||
import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "dictName",
|
||||
label: i18n.t("dict.dictName"),
|
||||
},
|
||||
{
|
||||
prop: "dictType",
|
||||
label: i18n.t("dict.dictType"),
|
||||
subcomponent: toDictType
|
||||
},
|
||||
{
|
||||
prop: "sort",
|
||||
label: i18n.t("dict.sort"),
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: i18n.t("dict.remark"),
|
||||
},
|
||||
{
|
||||
prop: "createDate",
|
||||
label: i18n.t("dict.createDate"),
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/dict/type/page",
|
||||
deleteURL: "/sys/dict/type",
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
addDeleteURL:true,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("dict.dictName"),
|
||||
placeholder: i18n.t("dict.dictName"),
|
||||
param: "dictName",
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("dict.dictType"),
|
||||
placeholder: i18n.t("dict.dictType"),
|
||||
param: "dictType",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.dictName = val.dictName;
|
||||
this.listQuery.dictType = val.dictType;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
121
src/views/modules/sys/log-error.vue
Normal file
121
src/views/modules/sys/log-error.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-05 15:29:06
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
/>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import i18n from "@/i18n";
|
||||
import Cookies from 'js-cookie'
|
||||
import qs from 'qs'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "requestUri",
|
||||
label: i18n.t("logError.requestUri"),
|
||||
},
|
||||
{
|
||||
prop: "requestMethod",
|
||||
label: i18n.t("logError.requestMethod"),
|
||||
},
|
||||
{
|
||||
prop: "requestParams",
|
||||
label: i18n.t("logError.requestParams"),
|
||||
},
|
||||
{
|
||||
prop: "ip",
|
||||
label: i18n.t("logError.ip"),
|
||||
},
|
||||
{
|
||||
prop: "userAgent",
|
||||
label: i18n.t("logError.userAgent"),
|
||||
},
|
||||
{
|
||||
prop: "createDate",
|
||||
label: i18n.t("logError.createDate"),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/log/error/page",
|
||||
exportUrl: "/sys/log/error/export",
|
||||
},
|
||||
tableProps,
|
||||
formConfig: [
|
||||
{
|
||||
type: "button",
|
||||
btnName: "导出",
|
||||
name: "export",
|
||||
color: "primary",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "export":
|
||||
this.exportHandle();
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
|
||||
// 导出
|
||||
exportHandle(name) {
|
||||
this.$http
|
||||
.get(this.urlOptions.exportURL, { responseType: "blob" })
|
||||
.then(({ data: res }) => {
|
||||
var date = new Date();
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var currentdate = year + "-" + month + "-" + strDate;
|
||||
const blob = new Blob([res]);
|
||||
const downloadElement = document.createElement("a");
|
||||
const href = window.URL.createObjectURL(blob); // 创建下载的链接
|
||||
downloadElement.href = href;
|
||||
downloadElement.download = `${name + currentdate}.xls`; // 下载后文件名
|
||||
document.body.appendChild(downloadElement);
|
||||
downloadElement.click(); // 点击下载
|
||||
document.body.removeChild(downloadElement); // 下载完成移除元素
|
||||
window.URL.revokeObjectURL(href);
|
||||
})
|
||||
.catch(() => { });
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
121
src/views/modules/sys/log-login.vue
Normal file
121
src/views/modules/sys/log-login.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-05 15:49:17
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
/>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import i18n from "@/i18n";
|
||||
import sysFilter from '@/filters/sys-filter'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "creatorName",
|
||||
label: i18n.t("logLogin.creatorName"),
|
||||
},
|
||||
{
|
||||
prop: "operation",
|
||||
label: i18n.t("logLogin.operation"),
|
||||
filter: sysFilter('logOperation'),
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: i18n.t("logLogin.status"),
|
||||
filter: sysFilter('logStatus'),
|
||||
},
|
||||
{
|
||||
prop: "ip",
|
||||
label: i18n.t("logLogin.ip"),
|
||||
},
|
||||
{
|
||||
prop: "userAgent",
|
||||
label: i18n.t("logLogin.userAgent"),
|
||||
},
|
||||
{
|
||||
prop: "createDate",
|
||||
label: i18n.t("logLogin.createDate"),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/log/login/page",
|
||||
deleteURL: "/sys/log/login",
|
||||
exportUrl: "/sys/log/login/export",
|
||||
},
|
||||
tableProps,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("logLogin.creatorName"),
|
||||
placeholder: i18n.t("logLogin.creatorName"),
|
||||
param: "creatorName",
|
||||
},
|
||||
{
|
||||
type: "select",
|
||||
label: "状态",
|
||||
selectOptions: [
|
||||
{ id: "0", name: i18n.t("logLogin.status0") },
|
||||
{ id: "1", name: i18n.t("logLogin.status1") },
|
||||
{ id: "2", name: i18n.t("logLogin.status2") },
|
||||
],
|
||||
param: "status",
|
||||
defaultSelect: "",
|
||||
onchange: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.creatorName = val.creatorName;
|
||||
this.listQuery.status = val.status;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
127
src/views/modules/sys/log-operation.vue
Normal file
127
src/views/modules/sys/log-operation.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-05 15:50:27
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
/>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import i18n from "@/i18n";
|
||||
import sysFilter from '@/filters/sys-filter'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "creatorName",
|
||||
label: i18n.t("logOperation.creatorName"),
|
||||
},
|
||||
{
|
||||
prop: "operation",
|
||||
label: i18n.t("logOperation.operation"),
|
||||
},
|
||||
{
|
||||
prop: "requestUri",
|
||||
label: i18n.t("logOperation.requestUri"),
|
||||
},
|
||||
{
|
||||
prop: "requestMethod",
|
||||
label: i18n.t("logOperation.requestMethod"),
|
||||
},
|
||||
{
|
||||
prop: "requestParams",
|
||||
label: i18n.t("logOperation.requestParams"),
|
||||
},
|
||||
{
|
||||
prop: "requestTime",
|
||||
label: i18n.t("logOperation.requestTime"),
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: i18n.t("logOperation.status"),
|
||||
filter: sysFilter('logStatus'),
|
||||
},
|
||||
{
|
||||
prop: "ip",
|
||||
label: i18n.t("logOperation.ip"),
|
||||
},
|
||||
{
|
||||
prop: "userAgent",
|
||||
label: i18n.t("logOperation.userAgent"),
|
||||
},
|
||||
{
|
||||
prop: "createDate",
|
||||
label: i18n.t("logOperation.createDate"),
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/log/operation/page",
|
||||
exportUrl: "/sys/log/operation/export",
|
||||
},
|
||||
tableProps,
|
||||
formConfig: [
|
||||
{
|
||||
type: "select",
|
||||
label: "状态",
|
||||
selectOptions: [
|
||||
{ id: "0", name: i18n.t("logOperation.status0") },
|
||||
{ id: "1", name: i18n.t("logOperation.status1") },
|
||||
],
|
||||
param: "status",
|
||||
defaultSelect: "",
|
||||
onchange: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.status = val.status;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
222
src/views/modules/sys/menu-add-or-update.vue
Normal file
222
src/views/modules/sys/menu-add-or-update.vue
Normal file
@@ -0,0 +1,222 @@
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="type" :label="$t('menu.type')" size="mini">
|
||||
<el-radio-group v-model="dataForm.type" :disabled="!!dataForm.id">
|
||||
<el-radio :label="0">{{ $t('menu.type0') }}</el-radio>
|
||||
<el-radio :label="1">{{ $t('menu.type1') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="name" :label="$t('menu.name')">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('menu.name')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="parentName" :label="$t('menu.parentName')" class="menu-list">
|
||||
<el-popover v-model="menuListVisible" ref="menuListPopover" placement="bottom-start" trigger="click">
|
||||
<el-tree
|
||||
:data="menuList"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
node-key="id"
|
||||
ref="menuListTree"
|
||||
:highlight-current="true"
|
||||
:expand-on-click-node="false"
|
||||
accordion
|
||||
@current-change="menuListTreeCurrentChangeHandle">
|
||||
</el-tree>
|
||||
</el-popover>
|
||||
<el-input v-model="dataForm.parentName" v-popover:menuListPopover :readonly="true" :placeholder="$t('menu.parentName')">
|
||||
<i v-if="dataForm.pid !== '0'" slot="suffix" @click.stop="deptListTreeSetDefaultHandle()" class="el-icon-circle-close el-input__icon"></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="dataForm.type === 0" prop="url" :label="$t('menu.url')">
|
||||
<el-input v-model="dataForm.url" :placeholder="$t('menu.url')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sort" :label="$t('menu.sort')">
|
||||
<el-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('menu.sort')"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item prop="permissions" :label="$t('menu.permissions')">
|
||||
<el-input v-model="dataForm.permissions" :placeholder="$t('menu.permissionsTips')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="dataForm.type === 0" prop="icon" :label="$t('menu.icon')" class="icon-list">
|
||||
<el-popover v-model="iconListVisible" ref="iconListPopover" placement="bottom-start" trigger="click" popper-class="mod-sys__menu-icon-popover">
|
||||
<div class="mod-sys__menu-icon-inner">
|
||||
<div class="mod-sys__menu-icon-list">
|
||||
<el-button
|
||||
v-for="(item, index) in iconList"
|
||||
:key="index"
|
||||
@click="iconListCurrentChangeHandle(item)"
|
||||
:class="{ 'is-active': dataForm.icon === item }">
|
||||
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${item}`"></use></svg>
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
<el-input v-model="dataForm.icon" v-popover:iconListPopover :readonly="true" :placeholder="$t('menu.icon')"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import { getIconList } from '@/utils'
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data () {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: '/sys/menu/',
|
||||
infoURL: '/sys/menu'
|
||||
},
|
||||
visible: false,
|
||||
menuList: [],
|
||||
menuListVisible: false,
|
||||
iconList: [],
|
||||
iconListVisible: false,
|
||||
dataForm: {
|
||||
id: '',
|
||||
type: 0,
|
||||
name: '',
|
||||
pid: '0',
|
||||
parentName: '',
|
||||
url: '',
|
||||
permissions: '',
|
||||
sort: 0,
|
||||
icon: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
parentName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dataForm.type' (val) {
|
||||
this.$refs['dataForm'].clearValidate()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.iconList = getIconList()
|
||||
this.dataForm.parentName = this.$t('menu.parentNameDefault')
|
||||
this.getMenuList().then(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取菜单列表
|
||||
getMenuList () {
|
||||
return this.$http.get('/sys/menu/list?type=0').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.menuList = res.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/menu/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
if (this.dataForm.pid === '0') {
|
||||
return this.deptListTreeSetDefaultHandle()
|
||||
}
|
||||
this.$refs.menuListTree.setCurrentKey(this.dataForm.pid)
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 上级菜单树, 设置默认值
|
||||
deptListTreeSetDefaultHandle () {
|
||||
this.dataForm.pid = '0'
|
||||
this.dataForm.parentName = this.$t('menu.parentNameDefault')
|
||||
},
|
||||
// 上级菜单树, 选中
|
||||
menuListTreeCurrentChangeHandle (data) {
|
||||
this.dataForm.pid = data.id
|
||||
this.dataForm.parentName = data.name
|
||||
this.menuListVisible = false
|
||||
},
|
||||
// 图标, 选中
|
||||
iconListCurrentChangeHandle (icon) {
|
||||
this.dataForm.icon = icon
|
||||
this.iconListVisible = false
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/menu', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mod-sys__menu {
|
||||
.menu-list,
|
||||
.icon-list {
|
||||
.el-input__inner,
|
||||
.el-input__suffix {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
&-icon-popover {
|
||||
width: 458px;
|
||||
overflow: hidden;
|
||||
}
|
||||
&-icon-inner {
|
||||
width: 478px;
|
||||
max-height: 258px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
&-icon-list {
|
||||
width: 458px;
|
||||
padding: 0;
|
||||
margin: -8px 0 0 -8px;
|
||||
> .el-button {
|
||||
padding: 8px;
|
||||
margin: 8px 0 0 8px;
|
||||
> span {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
134
src/views/modules/sys/menu.vue
Normal file
134
src/views/modules/sys/menu.vue
Normal file
@@ -0,0 +1,134 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-05 15:47:14
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__dept">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
row-key="id"
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from './menu-add-or-update'
|
||||
import i18n from "@/i18n";
|
||||
import sysFilter from '@/filters/sys-filter'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "name",
|
||||
label: i18n.t("menu.name"),
|
||||
},
|
||||
{
|
||||
prop: "icon",
|
||||
label: i18n.t("menu.icon"),
|
||||
},
|
||||
{
|
||||
prop: "type",
|
||||
label: i18n.t("menu.type"),
|
||||
filter: sysFilter('menuType'),
|
||||
},
|
||||
{
|
||||
prop: "sort",
|
||||
label: i18n.t("menu.sort"),
|
||||
},
|
||||
{
|
||||
prop: "url",
|
||||
label: i18n.t("menu.url"),
|
||||
},
|
||||
{
|
||||
prop: "permissions",
|
||||
label: i18n.t("menu.permissions"),
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '/sys/menu/list',
|
||||
deleteURL: '/sys/menu'
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
addDeleteURL:true,
|
||||
formConfig: [
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
this.dataListLoading = true;
|
||||
this.$http
|
||||
.get(this.urlOptions.getDataListURL, {
|
||||
params: this.listQuery,
|
||||
})
|
||||
.then(({ data: res }) => {
|
||||
this.dataListLoading = false;
|
||||
if (res.code !== 0) {
|
||||
this.tableData = [];
|
||||
this.listQuery.total = 0;
|
||||
return this.$message.error(res.msg);
|
||||
}
|
||||
this.tableData = res.data;
|
||||
this.listQuery.total = res.data.total;
|
||||
})
|
||||
.catch(() => {
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
101
src/views/modules/sys/params-add-or-update.vue
Normal file
101
src/views/modules/sys/params-add-or-update.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-05 14:40:11
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="paramCode" :label="$t('params.paramCode')">
|
||||
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="paramValue" :label="$t('params.paramValue')">
|
||||
<el-input v-model="dataForm.paramValue" :placeholder="$t('params.paramValue')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="remark" :label="$t('params.remark')">
|
||||
<el-input v-model="dataForm.remark" :placeholder="$t('params.remark')"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data () {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: '/sys/params/',
|
||||
infoURL: '/sys/params'
|
||||
},
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: '',
|
||||
paramCode: '',
|
||||
paramValue: '',
|
||||
remark: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
paramCode: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
paramValue: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/params/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/params', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
125
src/views/modules/sys/params.vue
Normal file
125
src/views/modules/sys/params.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from './params-add-or-update'
|
||||
import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "paramCode",
|
||||
label: i18n.t("params.paramCode"),
|
||||
},
|
||||
{
|
||||
prop: "paramValue",
|
||||
label: i18n.t("params.paramValue"),
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: i18n.t("params.remark"),
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/params/page",
|
||||
deleteURL: "/sys/params",
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
addDeleteURL:true,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("params.paramCode"),
|
||||
placeholder: i18n.t("params.paramCode"),
|
||||
param: "paramCode",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.paramCode = val.paramCode;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
148
src/views/modules/sys/role-add-or-update.vue
Normal file
148
src/views/modules/sys/role-add-or-update.vue
Normal file
@@ -0,0 +1,148 @@
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
|
||||
<el-form-item prop="name" :label="$t('role.name')">
|
||||
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="remark" :label="$t('role.remark')">
|
||||
<el-input v-model="dataForm.remark" :placeholder="$t('role.remark')"></el-input>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item size="mini" :label="$t('role.menuList')">
|
||||
<el-tree
|
||||
:data="menuList"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
node-key="id"
|
||||
ref="menuListTree"
|
||||
accordion
|
||||
show-checkbox>
|
||||
</el-tree>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item size="mini" :label="$t('role.deptList')">
|
||||
<el-tree
|
||||
:data="deptList"
|
||||
:props="{ label: 'name', children: 'children' }"
|
||||
node-key="id"
|
||||
ref="deptListTree"
|
||||
accordion
|
||||
show-checkbox>
|
||||
</el-tree>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data () {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: '/sys/role/',
|
||||
infoURL: '/sys/role'
|
||||
},
|
||||
visible: false,
|
||||
menuList: [],
|
||||
deptList: [],
|
||||
dataForm: {
|
||||
id: '',
|
||||
name: '',
|
||||
menuIdList: [],
|
||||
deptIdList: [],
|
||||
remark: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.$refs.menuListTree.setCheckedKeys([])
|
||||
this.$refs.deptListTree.setCheckedKeys([])
|
||||
Promise.all([
|
||||
this.getMenuList(),
|
||||
this.getDeptList()
|
||||
]).then(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取菜单列表
|
||||
getMenuList () {
|
||||
return this.$http.get('/sys/menu/select').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.menuList = res.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 获取部门列表
|
||||
getDeptList () {
|
||||
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.deptList = res.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/role/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
this.dataForm.menuIdList.forEach(item => this.$refs.menuListTree.setChecked(item, true))
|
||||
this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList)
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.dataForm.menuIdList = [
|
||||
...this.$refs.menuListTree.getHalfCheckedKeys(),
|
||||
...this.$refs.menuListTree.getCheckedKeys()
|
||||
]
|
||||
this.dataForm.deptIdList = this.$refs.deptListTree.getCheckedKeys()
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/role', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
125
src/views/modules/sys/role.vue
Normal file
125
src/views/modules/sys/role.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from './role-add-or-update'
|
||||
import i18n from "@/i18n";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "name",
|
||||
label: i18n.t("role.name"),
|
||||
},
|
||||
{
|
||||
prop: "remark",
|
||||
label: i18n.t("role.remark"),
|
||||
},
|
||||
{
|
||||
prop: "createDate",
|
||||
label: i18n.t("role.createDate"),
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: '/sys/role/page',
|
||||
deleteURL: '/sys/role',
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
addDeleteURL:true,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("role.name"),
|
||||
placeholder: i18n.t("role.name"),
|
||||
param: "name",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
213
src/views/modules/sys/user-add-or-update.vue
Normal file
213
src/views/modules/sys/user-add-or-update.vue
Normal file
@@ -0,0 +1,213 @@
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="120px">
|
||||
<el-form-item prop="username" :label="$t('user.username')">
|
||||
<el-input v-model="dataForm.username" :placeholder="$t('user.username')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="deptName" :label="$t('user.deptName')">
|
||||
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :dept-name.sync="dataForm.deptName"></ren-dept-tree>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password" :label="$t('user.password')" :class="{ 'is-required': !dataForm.id }">
|
||||
<el-input v-model="dataForm.password" type="password" :placeholder="$t('user.password')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="confirmPassword" :label="$t('user.confirmPassword')" :class="{ 'is-required': !dataForm.id }">
|
||||
<el-input v-model="dataForm.confirmPassword" type="password" :placeholder="$t('user.confirmPassword')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="realName" :label="$t('user.realName')">
|
||||
<el-input v-model="dataForm.realName" :placeholder="$t('user.realName')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="gender" :label="$t('user.gender')">
|
||||
<ren-radio-group v-model="dataForm.gender" dict-type="gender"></ren-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item prop="email" :label="$t('user.email')">
|
||||
<el-input v-model="dataForm.email" :placeholder="$t('user.email')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="mobile" :label="$t('user.mobile')">
|
||||
<el-input v-model="dataForm.mobile" :placeholder="$t('user.mobile')"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="roleIdList" :label="$t('user.roleIdList')" class="role-list">
|
||||
<el-select v-model="dataForm.roleIdList" multiple :placeholder="$t('user.roleIdList')">
|
||||
<el-option v-for="role in roleList" :key="role.id" :label="role.name" :value="role.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="status" :label="$t('user.status')" size="mini">
|
||||
<el-radio-group v-model="dataForm.status">
|
||||
<el-radio :label="0">{{ $t('user.status0') }}</el-radio>
|
||||
<el-radio :label="1">{{ $t('user.status1') }}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
import { isEmail, isMobile } from '@/utils/validate'
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data () {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: '/sys/user/',
|
||||
infoURL: '/sys/user'
|
||||
},
|
||||
visible: false,
|
||||
roleList: [],
|
||||
roleIdListDefault: [],
|
||||
dataForm: {
|
||||
id: '',
|
||||
username: '',
|
||||
deptId: '',
|
||||
deptName: '',
|
||||
password: '',
|
||||
confirmPassword: '',
|
||||
realName: '',
|
||||
gender: 0,
|
||||
email: '',
|
||||
mobile: '',
|
||||
roleIdList: [],
|
||||
status: 1
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
var validatePassword = (rule, value, callback) => {
|
||||
if (!this.dataForm.id && !/\S/.test(value)) {
|
||||
return callback(new Error(this.$t('validate.required')))
|
||||
}
|
||||
callback()
|
||||
}
|
||||
var validateConfirmPassword = (rule, value, callback) => {
|
||||
if (!this.dataForm.id && !/\S/.test(value)) {
|
||||
return callback(new Error(this.$t('validate.required')))
|
||||
}
|
||||
if (this.dataForm.password !== value) {
|
||||
return callback(new Error(this.$t('user.validate.confirmPassword')))
|
||||
}
|
||||
callback()
|
||||
}
|
||||
var validateEmail = (rule, value, callback) => {
|
||||
if (value && !isEmail(value)) {
|
||||
return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.email') })))
|
||||
}
|
||||
callback()
|
||||
}
|
||||
var validateMobile = (rule, value, callback) => {
|
||||
if (value && !isMobile(value)) {
|
||||
return callback(new Error(this.$t('validate.format', { 'attr': this.$t('user.mobile') })))
|
||||
}
|
||||
callback()
|
||||
}
|
||||
return {
|
||||
username: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
deptName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
],
|
||||
password: [
|
||||
{ validator: validatePassword, trigger: 'blur' }
|
||||
],
|
||||
confirmPassword: [
|
||||
{ validator: validateConfirmPassword, trigger: 'blur' }
|
||||
],
|
||||
realName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
email: [
|
||||
{ validator: validateEmail, trigger: 'blur' }
|
||||
],
|
||||
mobile: [
|
||||
{ validator: validateMobile, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || "";
|
||||
this.visible = true
|
||||
this.dataForm.deptId = ''
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.roleIdListDefault = []
|
||||
Promise.all([
|
||||
this.getRoleList()
|
||||
]).then(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.getInfo()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取角色列表
|
||||
getRoleList () {
|
||||
return this.$http.get('/sys/role/list').then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.roleList = res.data
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/user/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = {
|
||||
...this.dataForm,
|
||||
...res.data,
|
||||
roleIdList: []
|
||||
}
|
||||
// 角色配置, 区分是否为默认角色
|
||||
for (var i = 0; i < res.data.roleIdList.length; i++) {
|
||||
if (this.roleList.filter(item => item.id === res.data.roleIdList[i])[0]) {
|
||||
this.dataForm.roleIdList.push(res.data.roleIdList[i])
|
||||
continue
|
||||
}
|
||||
this.roleIdListDefault.push(res.data.roleIdList[i])
|
||||
}
|
||||
}).catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/user', {
|
||||
...this.dataForm,
|
||||
roleIdList: [
|
||||
...this.dataForm.roleIdList,
|
||||
...this.roleIdListDefault
|
||||
]
|
||||
}).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$message({
|
||||
message: this.$t('prompt.success'),
|
||||
type: 'success',
|
||||
duration: 500,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('successSubmit')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.mod-sys__user {
|
||||
.role-list {
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
145
src/views/modules/sys/user.vue
Normal file
145
src/views/modules/sys/user.vue
Normal file
@@ -0,0 +1,145 @@
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<div class="mod-sys__user">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit"></add-or-update>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
import AddOrUpdate from "./user-add-or-update";
|
||||
import i18n from "@/i18n";
|
||||
import sysFilter from '@/filters/sys-filter'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "username",
|
||||
label: i18n.t("user.username"),
|
||||
},
|
||||
{
|
||||
prop: "deptName",
|
||||
label: i18n.t("user.deptName"),
|
||||
},
|
||||
{
|
||||
prop: "email",
|
||||
label: i18n.t("user.email"),
|
||||
},
|
||||
{
|
||||
prop: "mobile",
|
||||
label: i18n.t("user.mobile"),
|
||||
},
|
||||
{
|
||||
prop: "gender",
|
||||
label: i18n.t("user.gender"),
|
||||
filter: sysFilter('sex'),
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
label: i18n.t("user.status"),
|
||||
filter: sysFilter('userStatus'),
|
||||
},
|
||||
{
|
||||
prop: "createDate",
|
||||
label: i18n.t("user.createDate"),
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/sys/user/page",
|
||||
deleteURL: "/sys/user",
|
||||
exportUrl: "/sys/user/export",
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
addDeleteURL:true,
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: i18n.t("user.username"),
|
||||
placeholder: i18n.t("user.username"),
|
||||
param: "username",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods:{
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.username = val.username;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
19
src/views/pages/404.vue
Normal file
19
src/views/pages/404.vue
Normal file
@@ -0,0 +1,19 @@
|
||||
<template>
|
||||
<div class="aui-wrapper aui-page__not-found">
|
||||
<div class="aui-content__wrapper">
|
||||
<div class="aui-content">
|
||||
<h2 class="title">400</h2>
|
||||
<p class="desc" v-html="$t('notFound.desc')"></p>
|
||||
<div class="btn-bar">
|
||||
<el-button @click="$router.go(-1)">{{ $t('notFound.back') }}</el-button>
|
||||
<el-button type="primary" @click="$router.push({ name: 'home' })">{{ $t('notFound.home') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
}
|
||||
</script>
|
||||
110
src/views/pages/login.vue
Normal file
110
src/views/pages/login.vue
Normal file
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div class="aui-wrapper aui-page__login">
|
||||
<div class="aui-content__wrapper">
|
||||
<main class="aui-content">
|
||||
<div class="login-header">
|
||||
<h2 class="login-brand">{{ $t('brand.lg') }}</h2>
|
||||
</div>
|
||||
<div class="login-body">
|
||||
<h3 class="login-title">{{ $t('login.title') }}</h3>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" status-icon>
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="dataForm.username" :placeholder="$t('login.username')">
|
||||
<span slot="prefix" class="el-input__icon">
|
||||
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-user"></use></svg>
|
||||
</span>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input v-model="dataForm.password" type="password" :placeholder="$t('login.password')">
|
||||
<span slot="prefix" class="el-input__icon">
|
||||
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-lock"></use></svg>
|
||||
</span>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="captcha">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="14">
|
||||
<el-input v-model="dataForm.captcha" :placeholder="$t('login.captcha')">
|
||||
<span slot="prefix" class="el-input__icon">
|
||||
<svg class="icon-svg" aria-hidden="true"><use xlink:href="#icon-safetycertificate"></use></svg>
|
||||
</span>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="10" class="login-captcha">
|
||||
<img :src="captchaPath" @click="getCaptcha()">
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="dataFormSubmitHandle()" class="w-percent-100">{{ $t('login.title') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="login-footer">
|
||||
<p>{{ $t('login.copyright') }}</p>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Cookies from 'js-cookie'
|
||||
import debounce from 'lodash/debounce'
|
||||
import { getUUID } from '@/utils'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
captchaPath: '',
|
||||
dataForm: {
|
||||
username: 'admin',
|
||||
password: 'admin',
|
||||
uuid: 'string',
|
||||
captcha: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
return {
|
||||
username: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
captcha: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getCaptcha()
|
||||
},
|
||||
methods: {
|
||||
// 获取验证码
|
||||
getCaptcha () {
|
||||
this.dataForm.uuid = getUUID()
|
||||
this.captchaPath = `${window.SITE_CONFIG['apiURL']}/captcha?uuid=${this.dataForm.uuid}`
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http.post('/login', this.dataForm).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
this.getCaptcha()
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
Cookies.set('token', res.data.token)
|
||||
this.$router.replace({ name: 'home' })
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
76
src/views/spc-basic/components/unitList-add.vue
Normal file
76
src/views/spc-basic/components/unitList-add.vue
Normal file
@@ -0,0 +1,76 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-05 10:54:13
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="编码" prop="code">
|
||||
<el-input v-model="dataForm.code"clearable placeholder="编码"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="dataForm.name"clearable placeholder="名称"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位分类" prop="type">
|
||||
<el-select
|
||||
v-model="dataForm.type"
|
||||
filterable
|
||||
clearable placeholder="请选择单位分类"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in typeArr"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from '@/mixins/basic-add'
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
submitURL: '/basic/unit/',
|
||||
infoURL: '/basic/unit'
|
||||
},
|
||||
dataForm: {
|
||||
id: '',
|
||||
code: '',
|
||||
name: '',
|
||||
type: ''
|
||||
},
|
||||
typeArr: [
|
||||
{
|
||||
name: '不可计数',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
name: '可计数',
|
||||
value: 1
|
||||
}
|
||||
],
|
||||
dataRule: {
|
||||
code: [
|
||||
{ required: true, message: '编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
{ required: true, message: '名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
type: [
|
||||
{ required: true, message: '单位分类不能为空', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
177
src/views/spc-basic/unitList.vue
Normal file
177
src/views/spc-basic/unitList.vue
Normal file
@@ -0,0 +1,177 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:40
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-06 09:54:57
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-card shadow="never" class="aui-card--fill">
|
||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.page"
|
||||
:limit="listQuery.limit"
|
||||
:table-data="tableData"
|
||||
>
|
||||
<method-btn
|
||||
v-if="tableBtn.length"
|
||||
slot="handleBtn"
|
||||
:width="80"
|
||||
label="操作"
|
||||
:method-list="tableBtn"
|
||||
@clickBtn="handleClick"
|
||||
/>
|
||||
</base-table>
|
||||
<pagination
|
||||
:limit.sync="listQuery.limit"
|
||||
:page.sync="listQuery.page"
|
||||
:total="listQuery.total"
|
||||
@pagination="getDataList"
|
||||
/>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<base-dialog
|
||||
:dialogTitle="addOrEditTitle"
|
||||
:dialogVisible="addOrUpdateVisible"
|
||||
@cancel="handleCancel"
|
||||
@confirm="handleConfirm"
|
||||
:before-close="handleCancel"
|
||||
>
|
||||
<add-or-update ref="addOrUpdate" @successSubmit="successSubmit" />
|
||||
</base-dialog>
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from "./components/unitList-add";
|
||||
import basicPage from "@/mixins/basic-page";
|
||||
|
||||
const tableProps = [
|
||||
{
|
||||
prop: "date",
|
||||
label: "日期",
|
||||
},
|
||||
{
|
||||
prop: "name",
|
||||
label: "姓名",
|
||||
},
|
||||
{
|
||||
prop: "sex",
|
||||
label: "性别",
|
||||
},
|
||||
{
|
||||
prop: "age",
|
||||
label: "年龄",
|
||||
},
|
||||
{
|
||||
prop: "address",
|
||||
label: "地址",
|
||||
},
|
||||
];
|
||||
const tableBtn = [
|
||||
{
|
||||
type: "edit",
|
||||
btnName: "编辑",
|
||||
},
|
||||
{
|
||||
type: "delete",
|
||||
btnName: "删除",
|
||||
},
|
||||
];
|
||||
export default {
|
||||
mixins: [basicPage],
|
||||
data() {
|
||||
return {
|
||||
urlOptions: {
|
||||
getDataListURL: "/basic/unit/page",
|
||||
deleteURL: "/basic/unit",
|
||||
statusUrl: "/basic/unit/status",
|
||||
exportUrl: "/basic/unit/export",
|
||||
},
|
||||
tableProps,
|
||||
tableBtn,
|
||||
tableData: [
|
||||
{
|
||||
date: "2016-05-02",
|
||||
name: "王小虎",
|
||||
sex: "男",
|
||||
id:111,
|
||||
age: 18,
|
||||
address: "上海市普陀区金沙江路 1518 弄",
|
||||
},
|
||||
{
|
||||
date: "2016-05-04",
|
||||
name: "王小虎",
|
||||
sex: "男",
|
||||
age: 18,
|
||||
address: "上海市普陀区金沙江路 1517 弄",
|
||||
},
|
||||
{
|
||||
date: "2016-05-01",
|
||||
name: "王小虎",
|
||||
sex: "男",
|
||||
age: 18,
|
||||
address: "上海市普陀区金沙江路 1519 弄",
|
||||
},
|
||||
{
|
||||
date: "2016-05-03",
|
||||
name: "王小虎",
|
||||
sex: "男",
|
||||
age: 18,
|
||||
address: "上海市普陀区金沙江路 1516 弄",
|
||||
},
|
||||
],
|
||||
formConfig: [
|
||||
{
|
||||
type: "input",
|
||||
label: "名称",
|
||||
placeholder: "请输入名称",
|
||||
param: "xm1",
|
||||
},
|
||||
{
|
||||
type: "input",
|
||||
label: "编码",
|
||||
placeholder: "请输入编码",
|
||||
param: "xm2",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "查询",
|
||||
name: "search",
|
||||
color: "primary",
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
btnName: "新增",
|
||||
name: "add",
|
||||
color: "primary",
|
||||
plain: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
methods: {
|
||||
//search-bar点击
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case "search":
|
||||
this.listQuery.xm1 = val.xm1;
|
||||
this.listQuery.xm2 = val.xm2;
|
||||
this.listQuery.page = 1;
|
||||
this.getDataList();
|
||||
break;
|
||||
case "add":
|
||||
this.addOrEditTitle = '新增'
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrUpdateHandle()
|
||||
break;
|
||||
default:
|
||||
console.log(val)
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user