fzq #31

Closed
fanzhiqin wants to merge 215 commits from fzq into test
71 changed files with 9508 additions and 12646 deletions
Showing only changes of commit b79efe0a19 - Show all commits

View File

@ -2,7 +2,6 @@
"singleQuote": true, "singleQuote": true,
"tabWidth": 2, "tabWidth": 2,
"bracketSameLine": true, "bracketSameLine": true,
"htmlWhitespaceSensitivity": "ignore",
"embeddedLanguageFormatting": "auto", "embeddedLanguageFormatting": "auto",
"printWidth": 180, "printWidth": 180,
"quoteProps": "consistent", "quoteProps": "consistent",

View File

@ -1,97 +1,95 @@
<template> <template>
<el-dialog <el-dialog :visible.sync="visible" :title="$t('updatePassword.title')" :close-on-click-modal="false" :close-on-press-escape="false" :append-to-body="true">
:visible.sync="visible" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
:title="$t('updatePassword.title')" <el-form-item :label="$t('updatePassword.username')">
:close-on-click-modal="false" <span>{{ $store.state.user.name }}</span>
:close-on-press-escape="false" </el-form-item>
:append-to-body="true"> <el-form-item prop="password" :label="$t('updatePassword.password')">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px"> <el-input v-model="dataForm.password" type="password" :placeholder="$t('updatePassword.password')"></el-input>
<el-form-item :label="$t('updatePassword.username')"> </el-form-item>
<span>{{ $store.state.user.name }}</span> <el-form-item prop="newPassword" :label="$t('updatePassword.newPassword')">
</el-form-item> <el-input v-model="dataForm.newPassword" type="password" :placeholder="$t('updatePassword.newPassword')"></el-input>
<el-form-item prop="password" :label="$t('updatePassword.password')"> </el-form-item>
<el-input v-model="dataForm.password" type="password" :placeholder="$t('updatePassword.password')"></el-input> <el-form-item prop="confirmPassword" :label="$t('updatePassword.confirmPassword')">
</el-form-item> <el-input v-model="dataForm.confirmPassword" type="password" :placeholder="$t('updatePassword.confirmPassword')"></el-input>
<el-form-item prop="newPassword" :label="$t('updatePassword.newPassword')"> </el-form-item>
<el-input v-model="dataForm.newPassword" type="password" :placeholder="$t('updatePassword.newPassword')"></el-input> </el-form>
</el-form-item> <template slot="footer">
<el-form-item prop="confirmPassword" :label="$t('updatePassword.confirmPassword')"> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-input v-model="dataForm.confirmPassword" type="password" :placeholder="$t('updatePassword.confirmPassword')"></el-input> <el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</el-form-item> </template>
</el-form> </el-dialog>
<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> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
import { clearLoginInfo } from '@/utils' import { clearLoginInfo } from '@/utils'
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
password: '', password: '',
newPassword: '', newPassword: '',
confirmPassword: '' confirmPassword: ''
} }
} }
}, },
computed: { computed: {
dataRule () { dataRule() {
var validateConfirmPassword = (rule, value, callback) => { var validateConfirmPassword = (rule, value, callback) => {
if (this.dataForm.newPassword !== value) { if (this.dataForm.newPassword !== value) {
return callback(new Error(this.$t('updatePassword.validate.confirmPassword'))) return callback(new Error(this.$t('updatePassword.validate.confirmPassword')))
} }
callback() callback()
} }
return { return {
password: [ password: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } newPassword: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
], confirmPassword: [
newPassword: [ { required: true, message: this.$t('validate.required'), trigger: 'blur' },
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { validator: validateConfirmPassword, trigger: 'blur' }
], ]
confirmPassword: [ }
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }, }
{ validator: validateConfirmPassword, trigger: 'blur' } },
] methods: {
} init() {
} this.visible = true
}, this.$nextTick(() => {
methods: { this.$refs['dataForm'].resetFields()
init () { })
this.visible = true },
this.$nextTick(() => { //
this.$refs['dataForm'].resetFields() dataFormSubmitHandle: debounce(
}) function() {
}, this.$refs['dataForm'].validate(valid => {
// if (!valid) {
dataFormSubmitHandle: debounce(function () { return false
this.$refs['dataForm'].validate((valid) => { }
if (!valid) { this.$http
return false .put('/sys/user/password', this.dataForm)
} .then(({ data: res }) => {
this.$http.put('/sys/user/password', this.dataForm).then(({ data: res }) => { if (res.code !== 0) {
if (res.code !== 0) { return this.$message.error(res.msg)
return this.$message.error(res.msg) }
} this.$message({
this.$message({ message: this.$t('prompt.success'),
message: this.$t('prompt.success'), type: 'success',
type: 'success', duration: 500,
duration: 500, onClose: () => {
onClose: () => { this.visible = false
this.visible = false clearLoginInfo()
clearLoginInfo() this.$router.replace({ name: 'login' })
this.$router.replace({ name: 'login' }) }
} })
}) })
}).catch(() => {}) .catch(() => {})
}) })
}, 1000, { 'leading': true, 'trailing': false }) },
} 1000,
{ leading: true, trailing: false }
)
}
} }
</script> </script>

View File

@ -1,103 +1,108 @@
<template> <template>
<nav class="aui-navbar" :class="`aui-navbar--${$store.state.navbarLayoutType}`"> <nav class="aui-navbar" :class="`aui-navbar--${$store.state.navbarLayoutType}`">
<div class="aui-navbar__header"> <div class="aui-navbar__header">
<h1 class="aui-navbar__brand" @click="$router.push({ name: 'home' })"> <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-lg" href="javascript:;">{{ $t('brand.lg') }}</a>
<a class="aui-navbar__brand-mini" href="javascript:;">{{ $t('brand.mini') }}</a> <a class="aui-navbar__brand-mini" href="javascript:;">{{ $t('brand.mini') }}</a>
</h1> </h1>
</div> </div>
<div class="aui-navbar__body"> <div class="aui-navbar__body">
<el-menu class="aui-navbar__menu mr-auto" mode="horizontal"> <el-menu class="aui-navbar__menu mr-auto" mode="horizontal">
<el-menu-item index="1" @click="$store.state.sidebarFold = !$store.state.sidebarFold"> <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> <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>
<el-menu-item index="2" @click="refresh()"> <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> <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-item>
</el-menu> </el-menu>
<el-menu class="aui-navbar__menu" mode="horizontal"> <el-menu class="aui-navbar__menu" mode="horizontal">
<el-menu-item index="2"> <el-menu-item index="2">
<a href="https://www.renren.io/" target="_blank"> <a href="https://www.renren.io/" target="_blank">
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#icon-earth"></use></svg> <svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#icon-earth"></use></svg>
</a> </a>
</el-menu-item> </el-menu-item>
<el-menu-item index="2"> <el-menu-item index="2">
<a href="https://gitee.com/renrenio/renren-security" target="_blank"> <a href="https://gitee.com/renrenio/renren-security" target="_blank">
<svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#gitee"></use></svg> <svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#gitee"></use></svg>
</a> </a>
</el-menu-item> </el-menu-item>
<el-menu-item index="4" @click="fullscreenHandle()"> <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> <svg class="icon-svg aui-navbar__icon-menu" aria-hidden="true"><use xlink:href="#icon-fullscreen"></use></svg>
</el-menu-item> </el-menu-item>
<el-menu-item index="5" class="aui-navbar__avatar"> <el-menu-item index="5" class="aui-navbar__avatar">
<el-dropdown placement="bottom" :show-timeout="0"> <el-dropdown placement="bottom" :show-timeout="0">
<span class="el-dropdown-link"> <span class="el-dropdown-link">
<img src="~@/assets/img/avatar.png"> <img src="~@/assets/img/avatar.png" />
<span>{{ $store.state.user.name }}</span> <span>{{ $store.state.user.name }}</span>
<i class="el-icon-arrow-down"></i> <i class="el-icon-arrow-down"></i>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}</el-dropdown-item> <el-dropdown-item @click.native="updatePasswordHandle()">{{ $t('updatePassword.title') }}</el-dropdown-item>
<el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item> <el-dropdown-item @click.native="logoutHandle()">{{ $t('logout') }}</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
</div> </div>
<!-- 弹窗, 修改密码 --> <!-- 弹窗, 修改密码 -->
<update-password v-if="updatePasswordVisible" ref="updatePassword"></update-password> <update-password v-if="updatePasswordVisible" ref="updatePassword"></update-password>
</nav> </nav>
</template> </template>
<script> <script>
import screenfull from 'screenfull' import screenfull from 'screenfull'
import UpdatePassword from './main-navbar-update-password' import UpdatePassword from './main-navbar-update-password'
import { clearLoginInfo } from '@/utils' import { clearLoginInfo } from '@/utils'
export default { export default {
inject: ['refresh'], inject: ['refresh'],
data () { data() {
return { return {
updatePasswordVisible: false, updatePasswordVisible: false,
messageTip: false messageTip: false
} }
}, },
components: { components: {
UpdatePassword UpdatePassword
}, },
methods: { methods: {
// //
fullscreenHandle () { fullscreenHandle() {
if (!screenfull.enabled) { if (!screenfull.enabled) {
return this.$message({ return this.$message({
message: this.$t('fullscreen.prompt'), message: this.$t('fullscreen.prompt'),
type: 'warning', type: 'warning',
duration: 500 duration: 500
}) })
} }
screenfull.toggle() screenfull.toggle()
}, },
// //
updatePasswordHandle () { updatePasswordHandle() {
this.updatePasswordVisible = true this.updatePasswordVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.updatePassword.init() this.$refs.updatePassword.init()
}) })
}, },
// 退 // 退
logoutHandle () { logoutHandle() {
this.$confirm(this.$t('prompt.info', { 'handle': this.$t('logout') }), this.$t('prompt.title'), { this.$confirm(this.$t('prompt.info', { handle: this.$t('logout') }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'), confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'), cancelButtonText: this.$t('cancel'),
type: 'warning' type: 'warning'
}).then(() => { })
this.$http.post(this.$http.adornUrl('/doLogout')).then(({ data: res }) => { .then(() => {
if (res.code !== 200) { this.$http
return this.$message.error(res.msg) .post(this.$http.adornUrl('/doLogout'))
} .then(({ data: res }) => {
clearLoginInfo() if (res.code !== 200) {
this.$router.push({ name: "Login" }) return this.$message.error(res.msg)
}).catch(() => {}) }
}).catch(() => {}) clearLoginInfo()
} this.$router.push({ name: 'Login' })
} })
.catch(() => {})
})
.catch(() => {})
}
}
} }
</script> </script>

View File

@ -1,38 +1,38 @@
<template> <template>
<el-submenu v-if="menu.children && menu.children.length >= 1" :index="menu.id" :popper-append-to-body="false"> <el-submenu v-if="menu.children && menu.children.length >= 1" :index="menu.id" :popper-append-to-body="false">
<template slot="title"> <template slot="title">
<svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"><use :xlink:href="`#${menu.icon}`"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"><use :xlink:href="`#${menu.icon}`"></use></svg>
<span>{{ menu.name }}</span> <span>{{ menu.name }}</span>
</template> </template>
<sub-menu v-for="item in menu.children" :key="item.id" :menu="item"></sub-menu> <sub-menu v-for="item in menu.children" :key="item.id" :menu="item"></sub-menu>
</el-submenu> </el-submenu>
<el-menu-item v-else :index="menu.id" @click="gotoRouteHandle(menu.id)"> <el-menu-item v-else :index="menu.id" @click="gotoRouteHandle(menu.id)">
<svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"><use :xlink:href="`#${menu.icon}`"></use></svg> <svg class="icon-svg aui-sidebar__menu-icon" aria-hidden="true"><use :xlink:href="`#${menu.icon}`"></use></svg>
<span>{{ menu.name }}</span> <span>{{ menu.name }}</span>
</el-menu-item> </el-menu-item>
</template> </template>
<script> <script>
import SubMenu from './main-sidebar-sub-menu' import SubMenu from './main-sidebar-sub-menu'
export default { export default {
name: 'sub-menu', name: 'sub-menu',
props: { props: {
menu: { menu: {
type: Object, type: Object,
required: true required: true
} }
}, },
components: { components: {
SubMenu SubMenu
}, },
methods: { methods: {
// menuId() // menuId()
gotoRouteHandle (menuId) { gotoRouteHandle(menuId) {
var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === menuId)[0] var route = window.SITE_CONFIG['dynamicMenuRoutes'].filter(item => item.meta.menuId === menuId)[0]
if (route) { if (route) {
this.$router.push({ name: route.name }) this.$router.push({ name: route.name })
} }
} }
} }
} }
</script> </script>

View File

@ -1,31 +1,33 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-home"> <div class="mod-home">
<h3>项目介绍</h3> <h3>项目介绍</h3>
<ul> <ul>
<li>renren-ui基于vueelement-ui构建开发实现<a href="https://gitee.com/renrenio/renren-ui" target="_blank">renren-security</a>后台管理前端功能提供一套更优的前端解决方案</li> <li>
<li>前后端分离通过token进行数据交互可独立部署</li> renren-ui基于vueelement-ui构建开发实现<a href="https://gitee.com/renrenio/renren-ui" target="_blank">renren-security</a>后台管理前端功能提供一套更优的前端解决方案
<li>动态菜单通过菜单管理统一管理访问路由</li> </li>
<li>演示地址<a href="http://demo.open.renren.io/renren-security" target="_blank">http://demo.open.renren.io/renren-security</a> (admin/admin)</li> <li>前后端分离通过token进行数据交互可独立部署</li>
</ul> <li>动态菜单通过菜单管理统一管理访问路由</li>
<h3>获取帮助</h3> <li>演示地址<a href="http://demo.open.renren.io/renren-security" target="_blank">http://demo.open.renren.io/renren-security</a> (admin/admin)</li>
<ul> </ul>
<li>官方社区<a href="https://www.renren.io/community" target="_blank">https://www.renren.io/community</a></li> <h3>获取帮助</h3>
<li>前端Git地址<a href="https://gitee.com/renrenio/renren-ui" target="_blank">https://gitee.com/renrenio/renren-ui</a></li> <ul>
<li>后台Git地址<a href="https://gitee.com/renrenio/renren-security" target="_blank">https://gitee.com/renrenio/renren-security</a></li> <li>官方社区<a href="https://www.renren.io/community" target="_blank">https://www.renren.io/community</a></li>
<li>如需关注项目最新动态请WatchStar项目同时也是对项目最好的支持</li> <li>前端Git地址<a href="https://gitee.com/renrenio/renren-ui" target="_blank">https://gitee.com/renrenio/renren-ui</a></li>
</ul> <li>后台Git地址<a href="https://gitee.com/renrenio/renren-security" target="_blank">https://gitee.com/renrenio/renren-security</a></li>
<h3>官方微信群</h3> <li>如需关注项目最新动态请WatchStar项目同时也是对项目最好的支持</li>
<ul> </ul>
<li>扫码下面的二维码关注人人开源公众号回复加群即可根据提示加入微信群</li> <h3>官方微信群</h3>
<li><img src="https://cdn.renren.io/f5cef202207132229319338.jpg" alt="微信群" /></li> <ul>
</ul> <li>扫码下面的二维码关注人人开源公众号回复加群即可根据提示加入微信群</li>
</div> <li><img src="https://cdn.renren.io/f5cef202207132229319338.jpg" alt="微信群" /></li>
</el-card> </ul>
</div>
</el-card>
</template> </template>
<style> <style>
.mod-home { .mod-home {
line-height: 1.5; line-height: 1.5;
} }
</style> </style>

View File

@ -1,253 +1,156 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenfile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmenfile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenfile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmenfile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label=""> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="equipmentId" header-align="center" align="center" label="设备ID"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="fileId" header-align="center" align="center" label="文件ID"> </el-table-column>
style="width: 100%;"> <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
<el-table-column <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
type="selection" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
header-align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
width="50"> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
<el-table-column <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
prop="id" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
header-align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
label=""> <el-table-column prop="typeCode" header-align="center" align="center" label="文件类型编号"> </el-table-column>
</el-table-column> <el-table-column prop="fileName" header-align="center" align="center" label="文件名字"> </el-table-column>
<el-table-column <el-table-column prop="fileUrl" header-align="center" align="center" label="下载地址"> </el-table-column>
prop="equipmentId" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
header-align="center" <template slot-scope="scope">
align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
label="设备ID"> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</el-table-column> </template>
<el-table-column </el-table-column>
prop="fileId" </el-table>
header-align="center" <el-pagination
align="center" @size-change="sizeChangeHandle"
label="文件ID"> @current-change="currentChangeHandle"
</el-table-column> :current-page="pageIndex"
<el-table-column :page-sizes="[10, 20, 50, 100]"
prop="description" :page-size="pageSize"
header-align="center" :total="totalPage"
align="center" layout="total, sizes, prev, pager, next, jumper"
label="描述"> >
</el-table-column> </el-pagination>
<el-table-column <!-- 弹窗, 新增 / 修改 -->
prop="enabled" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
header-align="center" </div>
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
prop="typeCode"
header-align="center"
align="center"
label="文件类型编号">
</el-table-column>
<el-table-column
prop="fileName"
header-align="center"
align="center"
label="文件名字">
</el-table-column>
<el-table-column
prop="fileUrl"
header-align="center"
align="center"
label="下载地址">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmenfile-add-or-update' import AddOrUpdate from './equipmenfile-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenfile/page'), url: this.$http.adornUrl('/monitoring/equipmenfile/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmenfile/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmenfile/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,235 +1,153 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmengroup:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmengroup:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmengroup:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmengroup:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="code" header-align="center" align="center" label="分组编码"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="name" header-align="center" align="center" label="分组名字"> </el-table-column>
style="width: 100%;"> <el-table-column prop="typeId" header-align="center" align="center" label="设备类型id"> </el-table-column>
<el-table-column <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
type="selection" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
header-align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
width="50"> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
<el-table-column <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
prop="id" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
header-align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
label="ID"> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
</el-table-column> <template slot-scope="scope">
<el-table-column <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
prop="code" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
header-align="center" </template>
align="center" </el-table-column>
label="分组编码"> </el-table>
</el-table-column> <el-pagination
<el-table-column @size-change="sizeChangeHandle"
prop="name" @current-change="currentChangeHandle"
header-align="center" :current-page="pageIndex"
align="center" :page-sizes="[10, 20, 50, 100]"
label="分组名字"> :page-size="pageSize"
</el-table-column> :total="totalPage"
<el-table-column layout="total, sizes, prev, pager, next, jumper"
prop="typeId" >
header-align="center" </el-pagination>
align="center" <!-- 弹窗, 新增 / 修改 -->
label="设备类型id"> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</el-table-column> </div>
<el-table-column
prop="description"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmengroup-add-or-update' import AddOrUpdate from './equipmengroup-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmengroup/page'), url: this.$http.adornUrl('/monitoring/equipmengroup/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmengroup/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmengroup/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,192 +1,163 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="报警信息ID关联T_equipment_group_alarm表" prop="alarmId">
:visible.sync="visible"> <el-input v-model="dataForm.alarmId" placeholder="报警信息ID关联T_equipment_group_alarm表"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="报警信息ID关联T_equipment_group_alarm表" prop="alarmId"> <el-form-item label="报警来源" prop="alarmSource">
<el-input v-model="dataForm.alarmId" placeholder="报警信息ID关联T_equipment_group_alarm表"></el-input> <el-input v-model="dataForm.alarmSource" placeholder="报警来源"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报警来源" prop="alarmSource"> <el-form-item label="报警详细内容" prop="alarmContent">
<el-input v-model="dataForm.alarmSource" placeholder="报警来源"></el-input> <el-input v-model="dataForm.alarmContent" placeholder="报警详细内容"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报警详细内容" prop="alarmContent"> <el-form-item label="报警设备id 关联equipment表" prop="alarmEquipmentId">
<el-input v-model="dataForm.alarmContent" placeholder="报警详细内容"></el-input> <el-input v-model="dataForm.alarmEquipmentId" placeholder="报警设备id 关联equipment表"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报警设备id 关联equipment表" prop="alarmEquipmentId"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.alarmEquipmentId" placeholder="报警设备id 关联equipment表"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
alarmId: '', alarmId: '',
alarmSource: '', alarmSource: '',
alarmContent: '', alarmContent: '',
alarmEquipmentId: '', alarmEquipmentId: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
alarmId: [ alarmId: [{ required: true, message: '报警信息ID关联T_equipment_group_alarm表不能为空', trigger: 'blur' }],
{ required: true, message: '报警信息ID关联T_equipment_group_alarm表不能为空', trigger: 'blur' } alarmSource: [{ required: true, message: '报警来源不能为空', trigger: 'blur' }],
], alarmContent: [{ required: true, message: '报警详细内容不能为空', trigger: 'blur' }],
alarmSource: [ alarmEquipmentId: [{ required: true, message: '报警设备id 关联equipment表不能为空', trigger: 'blur' }],
{ required: true, message: '报警来源不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
alarmContent: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '报警详细内容不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
alarmEquipmentId: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '报警设备id 关联equipment表不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
remark: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
{ required: true, message: '备注不能为空', trigger: 'blur' } }
], }
valid: [ },
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } methods: {
], init(id) {
creatorId: [ this.dataForm.id = id || 0
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
creatorName: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
createTime: [ url: this.$http.adornUrl(`/monitoring/equipmenalarmlog/info/${this.dataForm.id}`),
{ required: true, message: '创建时间不能为空', trigger: 'blur' } method: 'get',
], params: this.$http.adornParams()
updaterId: [ }).then(({ data }) => {
{ required: true, message: '更新人不能为空', trigger: 'blur' } if (data && data.code === 0) {
], this.dataForm.alarmId = data.equipmenalarmLog.alarmId
updaterName: [ this.dataForm.alarmSource = data.equipmenalarmLog.alarmSource
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.alarmContent = data.equipmenalarmLog.alarmContent
], this.dataForm.alarmEquipmentId = data.equipmenalarmLog.alarmEquipmentId
updateTime: [ this.dataForm.remark = data.equipmenalarmLog.remark
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.valid = data.equipmenalarmLog.valid
], this.dataForm.creatorId = data.equipmenalarmLog.creatorId
version: [ this.dataForm.creatorName = data.equipmenalarmLog.creatorName
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.createTime = data.equipmenalarmLog.createTime
] this.dataForm.updaterId = data.equipmenalarmLog.updaterId
} this.dataForm.updaterName = data.equipmenalarmLog.updaterName
} this.dataForm.updateTime = data.equipmenalarmLog.updateTime
}, this.dataForm.version = data.equipmenalarmLog.version
methods: { }
init (id) { })
this.dataForm.id = id || 0 }
this.visible = true })
this.$nextTick(() => { },
this.$refs['dataForm'].resetFields() //
if (this.dataForm.id) { dataFormSubmit() {
this.$http({ this.$refs['dataForm'].validate(valid => {
url: this.$http.adornUrl(`/monitoring/equipmenalarmlog/info/${this.dataForm.id}`), if (valid) {
method: 'get', this.$http({
params: this.$http.adornParams() url: this.$http.adornUrl(`/monitoring/equipmenalarmlog/${!this.dataForm.id ? 'save' : 'update'}`),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData({
this.dataForm.alarmId = data.equipmenalarmLog.alarmId id: this.dataForm.id || undefined,
this.dataForm.alarmSource = data.equipmenalarmLog.alarmSource alarmId: this.dataForm.alarmId,
this.dataForm.alarmContent = data.equipmenalarmLog.alarmContent alarmSource: this.dataForm.alarmSource,
this.dataForm.alarmEquipmentId = data.equipmenalarmLog.alarmEquipmentId alarmContent: this.dataForm.alarmContent,
this.dataForm.remark = data.equipmenalarmLog.remark alarmEquipmentId: this.dataForm.alarmEquipmentId,
this.dataForm.valid = data.equipmenalarmLog.valid remark: this.dataForm.remark,
this.dataForm.creatorId = data.equipmenalarmLog.creatorId valid: this.dataForm.valid,
this.dataForm.creatorName = data.equipmenalarmLog.creatorName creatorId: this.dataForm.creatorId,
this.dataForm.createTime = data.equipmenalarmLog.createTime creatorName: this.dataForm.creatorName,
this.dataForm.updaterId = data.equipmenalarmLog.updaterId createTime: this.dataForm.createTime,
this.dataForm.updaterName = data.equipmenalarmLog.updaterName updaterId: this.dataForm.updaterId,
this.dataForm.updateTime = data.equipmenalarmLog.updateTime updaterName: this.dataForm.updaterName,
this.dataForm.version = data.equipmenalarmLog.version updateTime: this.dataForm.updateTime,
} version: this.dataForm.version
}) })
} }).then(({ data }) => {
}) if (data && data.code === 0) {
}, this.$message({
// message: '操作成功',
dataFormSubmit () { type: 'success',
this.$refs['dataForm'].validate((valid) => { duration: 1500,
if (valid) { onClose: () => {
this.$http({ this.visible = false
url: this.$http.adornUrl(`/monitoring/equipmenalarmlog/${!this.dataForm.id ? 'save' : 'update'}`), this.$emit('refreshDataList')
method: 'post', }
data: this.$http.adornData({ })
'id': this.dataForm.id || undefined, } else {
'alarmId': this.dataForm.alarmId, this.$message.error(data.msg)
'alarmSource': this.dataForm.alarmSource, }
'alarmContent': this.dataForm.alarmContent, })
'alarmEquipmentId': this.dataForm.alarmEquipmentId, }
'remark': this.dataForm.remark, })
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId, }
'creatorName': this.dataForm.creatorName, }
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,183 +1,156 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="设备ID" prop="equipmentId">
:visible.sync="visible"> <el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="设备ID" prop="equipmentId"> <el-form-item label="属性名称" prop="attrName">
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input> <el-input v-model="dataForm.attrName" placeholder="属性名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="属性名称" prop="attrName"> <el-form-item label="属性值" prop="attrValue">
<el-input v-model="dataForm.attrName" placeholder="属性名称"></el-input> <el-input v-model="dataForm.attrValue" placeholder="属性值"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="属性值" prop="attrValue"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.attrValue" placeholder="属性值"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
equipmentId: '', equipmentId: '',
attrName: '', attrName: '',
attrValue: '', attrValue: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
equipmentId: [ equipmentId: [{ required: true, message: '设备ID不能为空', trigger: 'blur' }],
{ required: true, message: '设备ID不能为空', trigger: 'blur' } attrName: [{ required: true, message: '属性名称不能为空', trigger: 'blur' }],
], attrValue: [{ required: true, message: '属性值不能为空', trigger: 'blur' }],
attrName: [ remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
{ required: true, message: '属性名称不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
attrValue: [ creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '属性值不能为空', trigger: 'blur' } createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
], updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
remark: [ updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '备注不能为空', trigger: 'blur' } updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
], version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
valid: [ }
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } }
], },
creatorId: [ methods: {
{ required: true, message: '创建人不能为空', trigger: 'blur' } init(id) {
], this.dataForm.id = id || 0
creatorName: [ this.visible = true
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.$nextTick(() => {
], this.$refs['dataForm'].resetFields()
createTime: [ if (this.dataForm.id) {
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.$http({
], url: this.$http.adornUrl(`/monitoring/equipmenattr/info/${this.dataForm.id}`),
updaterId: [ method: 'get',
{ required: true, message: '更新人不能为空', trigger: 'blur' } params: this.$http.adornParams()
], }).then(({ data }) => {
updaterName: [ if (data && data.code === 0) {
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.equipmentId = data.equipmenattr.equipmentId
], this.dataForm.attrName = data.equipmenattr.attrName
updateTime: [ this.dataForm.attrValue = data.equipmenattr.attrValue
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.remark = data.equipmenattr.remark
], this.dataForm.valid = data.equipmenattr.valid
version: [ this.dataForm.creatorId = data.equipmenattr.creatorId
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.creatorName = data.equipmenattr.creatorName
] this.dataForm.createTime = data.equipmenattr.createTime
} this.dataForm.updaterId = data.equipmenattr.updaterId
} this.dataForm.updaterName = data.equipmenattr.updaterName
}, this.dataForm.updateTime = data.equipmenattr.updateTime
methods: { this.dataForm.version = data.equipmenattr.version
init (id) { }
this.dataForm.id = id || 0 })
this.visible = true }
this.$nextTick(() => { })
this.$refs['dataForm'].resetFields() },
if (this.dataForm.id) { //
this.$http({ dataFormSubmit() {
url: this.$http.adornUrl(`/monitoring/equipmenattr/info/${this.dataForm.id}`), this.$refs['dataForm'].validate(valid => {
method: 'get', if (valid) {
params: this.$http.adornParams() this.$http({
}).then(({data}) => { url: this.$http.adornUrl(`/monitoring/equipmenattr/${!this.dataForm.id ? 'save' : 'update'}`),
if (data && data.code === 0) { method: 'post',
this.dataForm.equipmentId = data.equipmenattr.equipmentId data: this.$http.adornData({
this.dataForm.attrName = data.equipmenattr.attrName id: this.dataForm.id || undefined,
this.dataForm.attrValue = data.equipmenattr.attrValue equipmentId: this.dataForm.equipmentId,
this.dataForm.remark = data.equipmenattr.remark attrName: this.dataForm.attrName,
this.dataForm.valid = data.equipmenattr.valid attrValue: this.dataForm.attrValue,
this.dataForm.creatorId = data.equipmenattr.creatorId remark: this.dataForm.remark,
this.dataForm.creatorName = data.equipmenattr.creatorName valid: this.dataForm.valid,
this.dataForm.createTime = data.equipmenattr.createTime creatorId: this.dataForm.creatorId,
this.dataForm.updaterId = data.equipmenattr.updaterId creatorName: this.dataForm.creatorName,
this.dataForm.updaterName = data.equipmenattr.updaterName createTime: this.dataForm.createTime,
this.dataForm.updateTime = data.equipmenattr.updateTime updaterId: this.dataForm.updaterId,
this.dataForm.version = data.equipmenattr.version updaterName: this.dataForm.updaterName,
} updateTime: this.dataForm.updateTime,
}) version: this.dataForm.version
} })
}) }).then(({ data }) => {
}, if (data && data.code === 0) {
// this.$message({
dataFormSubmit () { message: '操作成功',
this.$refs['dataForm'].validate((valid) => { type: 'success',
if (valid) { duration: 1500,
this.$http({ onClose: () => {
url: this.$http.adornUrl(`/monitoring/equipmenattr/${!this.dataForm.id ? 'save' : 'update'}`), this.visible = false
method: 'post', this.$emit('refreshDataList')
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, })
'equipmentId': this.dataForm.equipmentId, } else {
'attrName': this.dataForm.attrName, this.$message.error(data.msg)
'attrValue': this.dataForm.attrValue, }
'remark': this.dataForm.remark, })
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId, })
'creatorName': this.dataForm.creatorName, }
'createTime': this.dataForm.createTime, }
'updaterId': this.dataForm.updaterId, }
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,229 +1,152 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenattr:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmenattr:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenattr:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmenattr:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="equipmentId" header-align="center" align="center" label="设备ID"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="attrName" header-align="center" align="center" label="属性名称"> </el-table-column>
style="width: 100%;"> <el-table-column prop="attrValue" header-align="center" align="center" label="属性值"> </el-table-column>
<el-table-column <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
type="selection" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
header-align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
align="center" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
width="50"> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
</el-table-column> <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
<el-table-column <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
prop="id" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
header-align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
align="center" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
label="ID"> <template slot-scope="scope">
</el-table-column> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-table-column <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
prop="equipmentId" </template>
header-align="center" </el-table-column>
align="center" </el-table>
label="设备ID"> <el-pagination
</el-table-column> @size-change="sizeChangeHandle"
<el-table-column @current-change="currentChangeHandle"
prop="attrName" :current-page="pageIndex"
header-align="center" :page-sizes="[10, 20, 50, 100]"
align="center" :page-size="pageSize"
label="属性名称"> :total="totalPage"
</el-table-column> layout="total, sizes, prev, pager, next, jumper"
<el-table-column >
prop="attrValue" </el-pagination>
header-align="center" <!-- 弹窗, 新增 / 修改 -->
align="center" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
label="属性值"> </div>
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmenattr-add-or-update' import AddOrUpdate from './equipmenattr-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenattr/page'), url: this.$http.adornUrl('/monitoring/equipmenattr/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmenattr/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmenattr/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,219 +1,184 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="设备ID" prop="equipmentId">
:visible.sync="visible"> <el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="设备ID" prop="equipmentId"> <el-form-item label="文件ID" prop="fileId">
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input> <el-input v-model="dataForm.fileId" placeholder="文件ID"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件ID" prop="fileId"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.fileId" placeholder="文件ID"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="文件类型编号" prop="typeCode">
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件类型编号" prop="typeCode"> <el-form-item label="文件名字" prop="fileName">
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input> <el-input v-model="dataForm.fileName" placeholder="文件名字"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件名字" prop="fileName"> <el-form-item label="下载地址" prop="fileUrl">
<el-input v-model="dataForm.fileName" placeholder="文件名字"></el-input> <el-input v-model="dataForm.fileUrl" placeholder="下载地址"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="下载地址" prop="fileUrl"> </el-form>
<el-input v-model="dataForm.fileUrl" placeholder="下载地址"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
equipmentId: '', equipmentId: '',
fileId: '', fileId: '',
description: '', description: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '', version: '',
typeCode: '', typeCode: '',
fileName: '', fileName: '',
fileUrl: '' fileUrl: ''
}, },
dataRule: { dataRule: {
equipmentId: [ equipmentId: [{ required: true, message: '设备ID不能为空', trigger: 'blur' }],
{ required: true, message: '设备ID不能为空', trigger: 'blur' } fileId: [{ required: true, message: '文件ID不能为空', trigger: 'blur' }],
], description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
fileId: [ enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
{ required: true, message: '文件ID不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
description: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
enabled: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
remark: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
{ required: true, message: '备注不能为空', trigger: 'blur' } typeCode: [{ required: true, message: '文件类型编号不能为空', trigger: 'blur' }],
], fileName: [{ required: true, message: '文件名字不能为空', trigger: 'blur' }],
valid: [ fileUrl: [{ required: true, message: '下载地址不能为空', trigger: 'blur' }]
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } }
], }
creatorId: [ },
{ required: true, message: '创建人不能为空', trigger: 'blur' } methods: {
], init(id) {
creatorName: [ this.dataForm.id = id || 0
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
createTime: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '创建时间不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
updaterId: [ url: this.$http.adornUrl(`/monitoring/equipmenfile/info/${this.dataForm.id}`),
{ required: true, message: '更新人不能为空', trigger: 'blur' } method: 'get',
], params: this.$http.adornParams()
updaterName: [ }).then(({ data }) => {
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } if (data && data.code === 0) {
], this.dataForm.equipmentId = data.equipmenfile.equipmentId
updateTime: [ this.dataForm.fileId = data.equipmenfile.fileId
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.description = data.equipmenfile.description
], this.dataForm.enabled = data.equipmenfile.enabled
version: [ this.dataForm.remark = data.equipmenfile.remark
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.valid = data.equipmenfile.valid
], this.dataForm.creatorId = data.equipmenfile.creatorId
typeCode: [ this.dataForm.creatorName = data.equipmenfile.creatorName
{ required: true, message: '文件类型编号不能为空', trigger: 'blur' } this.dataForm.createTime = data.equipmenfile.createTime
], this.dataForm.updaterId = data.equipmenfile.updaterId
fileName: [ this.dataForm.updaterName = data.equipmenfile.updaterName
{ required: true, message: '文件名字不能为空', trigger: 'blur' } this.dataForm.updateTime = data.equipmenfile.updateTime
], this.dataForm.version = data.equipmenfile.version
fileUrl: [ this.dataForm.typeCode = data.equipmenfile.typeCode
{ required: true, message: '下载地址不能为空', trigger: 'blur' } this.dataForm.fileName = data.equipmenfile.fileName
] this.dataForm.fileUrl = data.equipmenfile.fileUrl
} }
} })
}, }
methods: { })
init (id) { },
this.dataForm.id = id || 0 //
this.visible = true dataFormSubmit() {
this.$nextTick(() => { this.$refs['dataForm'].validate(valid => {
this.$refs['dataForm'].resetFields() if (valid) {
if (this.dataForm.id) { this.$http({
this.$http({ url: this.$http.adornUrl(`/monitoring/equipmenfile/${!this.dataForm.id ? 'save' : 'update'}`),
url: this.$http.adornUrl(`/monitoring/equipmenfile/info/${this.dataForm.id}`), method: 'post',
method: 'get', data: this.$http.adornData({
params: this.$http.adornParams() id: this.dataForm.id || undefined,
}).then(({data}) => { equipmentId: this.dataForm.equipmentId,
if (data && data.code === 0) { fileId: this.dataForm.fileId,
this.dataForm.equipmentId = data.equipmenfile.equipmentId description: this.dataForm.description,
this.dataForm.fileId = data.equipmenfile.fileId enabled: this.dataForm.enabled,
this.dataForm.description = data.equipmenfile.description remark: this.dataForm.remark,
this.dataForm.enabled = data.equipmenfile.enabled valid: this.dataForm.valid,
this.dataForm.remark = data.equipmenfile.remark creatorId: this.dataForm.creatorId,
this.dataForm.valid = data.equipmenfile.valid creatorName: this.dataForm.creatorName,
this.dataForm.creatorId = data.equipmenfile.creatorId createTime: this.dataForm.createTime,
this.dataForm.creatorName = data.equipmenfile.creatorName updaterId: this.dataForm.updaterId,
this.dataForm.createTime = data.equipmenfile.createTime updaterName: this.dataForm.updaterName,
this.dataForm.updaterId = data.equipmenfile.updaterId updateTime: this.dataForm.updateTime,
this.dataForm.updaterName = data.equipmenfile.updaterName version: this.dataForm.version,
this.dataForm.updateTime = data.equipmenfile.updateTime typeCode: this.dataForm.typeCode,
this.dataForm.version = data.equipmenfile.version fileName: this.dataForm.fileName,
this.dataForm.typeCode = data.equipmenfile.typeCode fileUrl: this.dataForm.fileUrl
this.dataForm.fileName = data.equipmenfile.fileName })
this.dataForm.fileUrl = data.equipmenfile.fileUrl }).then(({ data }) => {
} if (data && data.code === 0) {
}) this.$message({
} message: '操作成功',
}) type: 'success',
}, duration: 1500,
// onClose: () => {
dataFormSubmit () { this.visible = false
this.$refs['dataForm'].validate((valid) => { this.$emit('refreshDataList')
if (valid) { }
this.$http({ })
url: this.$http.adornUrl(`/monitoring/equipmenfile/${!this.dataForm.id ? 'save' : 'update'}`), } else {
method: 'post', this.$message.error(data.msg)
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, })
'equipmentId': this.dataForm.equipmentId, }
'fileId': this.dataForm.fileId, })
'description': this.dataForm.description, }
'enabled': this.dataForm.enabled, }
'remark': this.dataForm.remark, }
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version,
'typeCode': this.dataForm.typeCode,
'fileName': this.dataForm.fileName,
'fileUrl': this.dataForm.fileUrl
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,192 +1,163 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="分组编码" prop="code">
:visible.sync="visible"> <el-input v-model="dataForm.code" placeholder="分组编码"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="分组编码" prop="code"> <el-form-item label="分组名字" prop="name">
<el-input v-model="dataForm.code" placeholder="分组编码"></el-input> <el-input v-model="dataForm.name" placeholder="分组名字"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="分组名字" prop="name"> <el-form-item label="设备类型id" prop="typeId">
<el-input v-model="dataForm.name" placeholder="分组名字"></el-input> <el-input v-model="dataForm.typeId" placeholder="设备类型id"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备类型id" prop="typeId"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.typeId" placeholder="设备类型id"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
code: '', code: '',
name: '', name: '',
typeId: '', typeId: '',
description: '', description: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
code: [ code: [{ required: true, message: '分组编码不能为空', trigger: 'blur' }],
{ required: true, message: '分组编码不能为空', trigger: 'blur' } name: [{ required: true, message: '分组名字不能为空', trigger: 'blur' }],
], typeId: [{ required: true, message: '设备类型id不能为空', trigger: 'blur' }],
name: [ description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
{ required: true, message: '分组名字不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
typeId: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '设备类型id不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
description: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
remark: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
{ required: true, message: '备注不能为空', trigger: 'blur' } }
], }
valid: [ },
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } methods: {
], init(id) {
creatorId: [ this.dataForm.id = id || 0
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
creatorName: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
createTime: [ url: this.$http.adornUrl(`/monitoring/equipmengroup/info/${this.dataForm.id}`),
{ required: true, message: '创建时间不能为空', trigger: 'blur' } method: 'get',
], params: this.$http.adornParams()
updaterId: [ }).then(({ data }) => {
{ required: true, message: '更新人不能为空', trigger: 'blur' } if (data && data.code === 0) {
], this.dataForm.code = data.equipmengroup.code
updaterName: [ this.dataForm.name = data.equipmengroup.name
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.typeId = data.equipmengroup.typeId
], this.dataForm.description = data.equipmengroup.description
updateTime: [ this.dataForm.remark = data.equipmengroup.remark
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.valid = data.equipmengroup.valid
], this.dataForm.creatorId = data.equipmengroup.creatorId
version: [ this.dataForm.creatorName = data.equipmengroup.creatorName
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.createTime = data.equipmengroup.createTime
] this.dataForm.updaterId = data.equipmengroup.updaterId
} this.dataForm.updaterName = data.equipmengroup.updaterName
} this.dataForm.updateTime = data.equipmengroup.updateTime
}, this.dataForm.version = data.equipmengroup.version
methods: { }
init (id) { })
this.dataForm.id = id || 0 }
this.visible = true })
this.$nextTick(() => { },
this.$refs['dataForm'].resetFields() //
if (this.dataForm.id) { dataFormSubmit() {
this.$http({ this.$refs['dataForm'].validate(valid => {
url: this.$http.adornUrl(`/monitoring/equipmengroup/info/${this.dataForm.id}`), if (valid) {
method: 'get', this.$http({
params: this.$http.adornParams() url: this.$http.adornUrl(`/monitoring/equipmengroup/${!this.dataForm.id ? 'save' : 'update'}`),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData({
this.dataForm.code = data.equipmengroup.code id: this.dataForm.id || undefined,
this.dataForm.name = data.equipmengroup.name code: this.dataForm.code,
this.dataForm.typeId = data.equipmengroup.typeId name: this.dataForm.name,
this.dataForm.description = data.equipmengroup.description typeId: this.dataForm.typeId,
this.dataForm.remark = data.equipmengroup.remark description: this.dataForm.description,
this.dataForm.valid = data.equipmengroup.valid remark: this.dataForm.remark,
this.dataForm.creatorId = data.equipmengroup.creatorId valid: this.dataForm.valid,
this.dataForm.creatorName = data.equipmengroup.creatorName creatorId: this.dataForm.creatorId,
this.dataForm.createTime = data.equipmengroup.createTime creatorName: this.dataForm.creatorName,
this.dataForm.updaterId = data.equipmengroup.updaterId createTime: this.dataForm.createTime,
this.dataForm.updaterName = data.equipmengroup.updaterName updaterId: this.dataForm.updaterId,
this.dataForm.updateTime = data.equipmengroup.updateTime updaterName: this.dataForm.updaterName,
this.dataForm.version = data.equipmengroup.version updateTime: this.dataForm.updateTime,
} version: this.dataForm.version
}) })
} }).then(({ data }) => {
}) if (data && data.code === 0) {
}, this.$message({
// message: '操作成功',
dataFormSubmit () { type: 'success',
this.$refs['dataForm'].validate((valid) => { duration: 1500,
if (valid) { onClose: () => {
this.$http({ this.visible = false
url: this.$http.adornUrl(`/monitoring/equipmengroup/${!this.dataForm.id ? 'save' : 'update'}`), this.$emit('refreshDataList')
method: 'post', }
data: this.$http.adornData({ })
'id': this.dataForm.id || undefined, } else {
'code': this.dataForm.code, this.$message.error(data.msg)
'name': this.dataForm.name, }
'typeId': this.dataForm.typeId, })
'description': this.dataForm.description, }
'remark': this.dataForm.remark, })
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId, }
'creatorName': this.dataForm.creatorName, }
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,237 +1,198 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="设备分组ID关联t_equipment_group" prop="equipmentGroupId">
:visible.sync="visible"> <el-input v-model="dataForm.equipmentGroupId" placeholder="设备分组ID关联t_equipment_group"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="设备分组ID关联t_equipment_group" prop="equipmentGroupId"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.equipmentGroupId" placeholder="设备分组ID关联t_equipment_group"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="报警类型 字典表关联label_value" prop="typeDictValue">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.typeDictValue" placeholder="报警类型 字典表关联label_value"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报警类型 字典表关联label_value" prop="typeDictValue"> <el-form-item label="报警级别 字典表关联label_value" prop="gradeDictValue">
<el-input v-model="dataForm.typeDictValue" placeholder="报警类型 字典表关联label_value"></el-input> <el-input v-model="dataForm.gradeDictValue" placeholder="报警级别 字典表关联label_value"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报警级别 字典表关联label_value" prop="gradeDictValue"> <el-form-item label="报警内容" prop="alarmContent">
<el-input v-model="dataForm.gradeDictValue" placeholder="报警级别 字典表关联label_value"></el-input> <el-input v-model="dataForm.alarmContent" placeholder="报警内容"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报警内容" prop="alarmContent"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.alarmContent" placeholder="报警内容"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="推送方式 0邮箱 1微信" prop="alarmNotify">
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <el-input v-model="dataForm.alarmNotify" placeholder="推送方式 0邮箱 1微信"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="推送方式 0邮箱 1微信" prop="alarmNotify"> </el-form>
<el-input v-model="dataForm.alarmNotify" placeholder="推送方式 0邮箱 1微信"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
equipmentGroupId: '', equipmentGroupId: '',
code: '', code: '',
typeDictValue: '', typeDictValue: '',
gradeDictValue: '', gradeDictValue: '',
alarmContent: '', alarmContent: '',
description: '', description: '',
externalCode: '', externalCode: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '', version: '',
alarmNotify: '' alarmNotify: ''
}, },
dataRule: { dataRule: {
equipmentGroupId: [ equipmentGroupId: [{ required: true, message: '设备分组ID关联t_equipment_group不能为空', trigger: 'blur' }],
{ required: true, message: '设备分组ID关联t_equipment_group不能为空', trigger: 'blur' } code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
], typeDictValue: [{ required: true, message: '报警类型 字典表关联label_value不能为空', trigger: 'blur' }],
code: [ gradeDictValue: [{ required: true, message: '报警级别 字典表关联label_value不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } alarmContent: [{ required: true, message: '报警内容不能为空', trigger: 'blur' }],
], description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
typeDictValue: [ externalCode: [{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' }],
{ required: true, message: '报警类型 字典表关联label_value不能为空', trigger: 'blur' } enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
], remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
gradeDictValue: [ valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
{ required: true, message: '报警级别 字典表关联label_value不能为空', trigger: 'blur' } creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
], creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
alarmContent: [ createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
{ required: true, message: '报警内容不能为空', trigger: 'blur' } updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
], updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
description: [ updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
], alarmNotify: [{ required: true, message: '推送方式 0邮箱 1微信不能为空', trigger: 'blur' }]
externalCode: [ }
{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' } }
], },
enabled: [ methods: {
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } init(id) {
], this.dataForm.id = id || 0
remark: [ this.visible = true
{ required: true, message: '备注不能为空', trigger: 'blur' } this.$nextTick(() => {
], this.$refs['dataForm'].resetFields()
valid: [ if (this.dataForm.id) {
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.$http({
], url: this.$http.adornUrl(`/monitoring/equipmengroupalarm/info/${this.dataForm.id}`),
creatorId: [ method: 'get',
{ required: true, message: '创建人不能为空', trigger: 'blur' } params: this.$http.adornParams()
], }).then(({ data }) => {
creatorName: [ if (data && data.code === 0) {
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.equipmentGroupId = data.equipmengroupAlarm.equipmentGroupId
], this.dataForm.code = data.equipmengroupAlarm.code
createTime: [ this.dataForm.typeDictValue = data.equipmengroupAlarm.typeDictValue
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.gradeDictValue = data.equipmengroupAlarm.gradeDictValue
], this.dataForm.alarmContent = data.equipmengroupAlarm.alarmContent
updaterId: [ this.dataForm.description = data.equipmengroupAlarm.description
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.externalCode = data.equipmengroupAlarm.externalCode
], this.dataForm.enabled = data.equipmengroupAlarm.enabled
updaterName: [ this.dataForm.remark = data.equipmengroupAlarm.remark
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.valid = data.equipmengroupAlarm.valid
], this.dataForm.creatorId = data.equipmengroupAlarm.creatorId
updateTime: [ this.dataForm.creatorName = data.equipmengroupAlarm.creatorName
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.createTime = data.equipmengroupAlarm.createTime
], this.dataForm.updaterId = data.equipmengroupAlarm.updaterId
version: [ this.dataForm.updaterName = data.equipmengroupAlarm.updaterName
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updateTime = data.equipmengroupAlarm.updateTime
], this.dataForm.version = data.equipmengroupAlarm.version
alarmNotify: [ this.dataForm.alarmNotify = data.equipmengroupAlarm.alarmNotify
{ required: true, message: '推送方式 0邮箱 1微信不能为空', trigger: 'blur' } }
] })
} }
} })
}, },
methods: { //
init (id) { dataFormSubmit() {
this.dataForm.id = id || 0 this.$refs['dataForm'].validate(valid => {
this.visible = true if (valid) {
this.$nextTick(() => { this.$http({
this.$refs['dataForm'].resetFields() url: this.$http.adornUrl(`/monitoring/equipmengroupalarm/${!this.dataForm.id ? 'save' : 'update'}`),
if (this.dataForm.id) { method: 'post',
this.$http({ data: this.$http.adornData({
url: this.$http.adornUrl(`/monitoring/equipmengroupalarm/info/${this.dataForm.id}`), id: this.dataForm.id || undefined,
method: 'get', equipmentGroupId: this.dataForm.equipmentGroupId,
params: this.$http.adornParams() code: this.dataForm.code,
}).then(({data}) => { typeDictValue: this.dataForm.typeDictValue,
if (data && data.code === 0) { gradeDictValue: this.dataForm.gradeDictValue,
this.dataForm.equipmentGroupId = data.equipmengroupAlarm.equipmentGroupId alarmContent: this.dataForm.alarmContent,
this.dataForm.code = data.equipmengroupAlarm.code description: this.dataForm.description,
this.dataForm.typeDictValue = data.equipmengroupAlarm.typeDictValue externalCode: this.dataForm.externalCode,
this.dataForm.gradeDictValue = data.equipmengroupAlarm.gradeDictValue enabled: this.dataForm.enabled,
this.dataForm.alarmContent = data.equipmengroupAlarm.alarmContent remark: this.dataForm.remark,
this.dataForm.description = data.equipmengroupAlarm.description valid: this.dataForm.valid,
this.dataForm.externalCode = data.equipmengroupAlarm.externalCode creatorId: this.dataForm.creatorId,
this.dataForm.enabled = data.equipmengroupAlarm.enabled creatorName: this.dataForm.creatorName,
this.dataForm.remark = data.equipmengroupAlarm.remark createTime: this.dataForm.createTime,
this.dataForm.valid = data.equipmengroupAlarm.valid updaterId: this.dataForm.updaterId,
this.dataForm.creatorId = data.equipmengroupAlarm.creatorId updaterName: this.dataForm.updaterName,
this.dataForm.creatorName = data.equipmengroupAlarm.creatorName updateTime: this.dataForm.updateTime,
this.dataForm.createTime = data.equipmengroupAlarm.createTime version: this.dataForm.version,
this.dataForm.updaterId = data.equipmengroupAlarm.updaterId alarmNotify: this.dataForm.alarmNotify
this.dataForm.updaterName = data.equipmengroupAlarm.updaterName })
this.dataForm.updateTime = data.equipmengroupAlarm.updateTime }).then(({ data }) => {
this.dataForm.version = data.equipmengroupAlarm.version if (data && data.code === 0) {
this.dataForm.alarmNotify = data.equipmengroupAlarm.alarmNotify this.$message({
} message: '操作成功',
}) type: 'success',
} duration: 1500,
}) onClose: () => {
}, this.visible = false
// this.$emit('refreshDataList')
dataFormSubmit () { }
this.$refs['dataForm'].validate((valid) => { })
if (valid) { } else {
this.$http({ this.$message.error(data.msg)
url: this.$http.adornUrl(`/monitoring/equipmengroupalarm/${!this.dataForm.id ? 'save' : 'update'}`), }
method: 'post', })
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, })
'equipmentGroupId': this.dataForm.equipmentGroupId, }
'code': this.dataForm.code, }
'typeDictValue': this.dataForm.typeDictValue, }
'gradeDictValue': this.dataForm.gradeDictValue,
'alarmContent': this.dataForm.alarmContent,
'description': this.dataForm.description,
'externalCode': this.dataForm.externalCode,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version,
'alarmNotify': this.dataForm.alarmNotify
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,264 +1,219 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="plc类型" prop="plcType">
:visible.sync="visible"> <el-input v-model="dataForm.plcType" placeholder="plc类型"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="plc类型" prop="plcType"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.plcType" placeholder="plc类型"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="plc名称ip+名称对应实时数据库表名)" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="plc名称ip+名称对应实时数据库表名)"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="plc名称ip+名称对应实时数据库表名)" prop="name"> <el-form-item label="英文名称" prop="enName">
<el-input v-model="dataForm.name" placeholder="plc名称ip+名称对应实时数据库表名)"></el-input> <el-input v-model="dataForm.enName" placeholder="英文名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="英文名称" prop="enName"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.enName" placeholder="英文名称"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="plc条码" prop="barcode">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.barcode" placeholder="plc条码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="plc条码" prop="barcode"> <el-form-item label="链接方式0 tcp1 udp等" prop="controlType">
<el-input v-model="dataForm.barcode" placeholder="plc条码"></el-input> <el-input v-model="dataForm.controlType" placeholder="链接方式0 tcp1 udp等"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="链接方式0 tcp1 udp等" prop="controlType"> <el-form-item label="是否监控 0 代表不监控, 1 代表监控" prop="monitor">
<el-input v-model="dataForm.controlType" placeholder="链接方式0 tcp1 udp等"></el-input> <el-input v-model="dataForm.monitor" placeholder="是否监控 0 代表不监控, 1 代表监控"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="是否监控 0 代表不监控, 1 代表监控" prop="monitor"> <el-form-item label="是否采集 0 代表不采集, 1 代表采集" prop="collection">
<el-input v-model="dataForm.monitor" placeholder="是否监控 0 代表不监控, 1 代表监控"></el-input> <el-input v-model="dataForm.collection" placeholder="是否采集 0 代表不采集, 1 代表采集"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="是否采集 0 代表不采集, 1 代表采集" prop="collection"> <el-form-item label="IP" prop="ip">
<el-input v-model="dataForm.collection" placeholder="是否采集 0 代表不采集, 1 代表采集"></el-input> <el-input v-model="dataForm.ip" placeholder="IP"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="IP" prop="ip"> <el-form-item label="端口号" prop="port">
<el-input v-model="dataForm.ip" placeholder="IP"></el-input> <el-input v-model="dataForm.port" placeholder="端口号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="端口号" prop="port"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.port" placeholder="端口号"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
plcType: '', plcType: '',
code: '', code: '',
name: '', name: '',
enName: '', enName: '',
description: '', description: '',
barcode: '', barcode: '',
controlType: '', controlType: '',
monitor: '', monitor: '',
collection: '', collection: '',
ip: '', ip: '',
port: '', port: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
plcType: [ plcType: [{ required: true, message: 'plc类型不能为空', trigger: 'blur' }],
{ required: true, message: 'plc类型不能为空', trigger: 'blur' } code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
], name: [{ required: true, message: 'plc名称ip+名称对应实时数据库表名)不能为空', trigger: 'blur' }],
code: [ enName: [{ required: true, message: '英文名称不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
], barcode: [{ required: true, message: 'plc条码不能为空', trigger: 'blur' }],
name: [ controlType: [{ required: true, message: '链接方式0 tcp1 udp等不能为空', trigger: 'blur' }],
{ required: true, message: 'plc名称ip+名称对应实时数据库表名)不能为空', trigger: 'blur' } monitor: [{ required: true, message: '是否监控 0 代表不监控, 1 代表监控不能为空', trigger: 'blur' }],
], collection: [{ required: true, message: '是否采集 0 代表不采集, 1 代表采集不能为空', trigger: 'blur' }],
enName: [ ip: [{ required: true, message: 'IP不能为空', trigger: 'blur' }],
{ required: true, message: '英文名称不能为空', trigger: 'blur' } port: [{ required: true, message: '端口号不能为空', trigger: 'blur' }],
], enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
description: [ remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
barcode: [ creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
{ required: true, message: 'plc条码不能为空', trigger: 'blur' } createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
], updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
controlType: [ updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '链接方式0 tcp1 udp等不能为空', trigger: 'blur' } updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
], version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
monitor: [ }
{ required: true, message: '是否监控 0 代表不监控, 1 代表监控不能为空', trigger: 'blur' } }
], },
collection: [ methods: {
{ required: true, message: '是否采集 0 代表不采集, 1 代表采集不能为空', trigger: 'blur' } init(id) {
], this.dataForm.id = id || 0
ip: [ this.visible = true
{ required: true, message: 'IP不能为空', trigger: 'blur' } this.$nextTick(() => {
], this.$refs['dataForm'].resetFields()
port: [ if (this.dataForm.id) {
{ required: true, message: '端口号不能为空', trigger: 'blur' } this.$http({
], url: this.$http.adornUrl(`/monitoring/equipmenplc/info/${this.dataForm.id}`),
enabled: [ method: 'get',
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } params: this.$http.adornParams()
], }).then(({ data }) => {
remark: [ if (data && data.code === 0) {
{ required: true, message: '备注不能为空', trigger: 'blur' } this.dataForm.plcType = data.equipmenplc.plcType
], this.dataForm.code = data.equipmenplc.code
valid: [ this.dataForm.name = data.equipmenplc.name
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.dataForm.enName = data.equipmenplc.enName
], this.dataForm.description = data.equipmenplc.description
creatorId: [ this.dataForm.barcode = data.equipmenplc.barcode
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.dataForm.controlType = data.equipmenplc.controlType
], this.dataForm.monitor = data.equipmenplc.monitor
creatorName: [ this.dataForm.collection = data.equipmenplc.collection
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.ip = data.equipmenplc.ip
], this.dataForm.port = data.equipmenplc.port
createTime: [ this.dataForm.enabled = data.equipmenplc.enabled
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.remark = data.equipmenplc.remark
], this.dataForm.valid = data.equipmenplc.valid
updaterId: [ this.dataForm.creatorId = data.equipmenplc.creatorId
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.creatorName = data.equipmenplc.creatorName
], this.dataForm.createTime = data.equipmenplc.createTime
updaterName: [ this.dataForm.updaterId = data.equipmenplc.updaterId
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.updaterName = data.equipmenplc.updaterName
], this.dataForm.updateTime = data.equipmenplc.updateTime
updateTime: [ this.dataForm.version = data.equipmenplc.version
{ required: true, message: '更新时间不能为空', trigger: 'blur' } }
], })
version: [ }
{ required: true, message: '版本号不能为空', trigger: 'blur' } })
] },
} //
} dataFormSubmit() {
}, this.$refs['dataForm'].validate(valid => {
methods: { if (valid) {
init (id) { this.$http({
this.dataForm.id = id || 0 url: this.$http.adornUrl(`/monitoring/equipmenplc/${!this.dataForm.id ? 'save' : 'update'}`),
this.visible = true method: 'post',
this.$nextTick(() => { data: this.$http.adornData({
this.$refs['dataForm'].resetFields() id: this.dataForm.id || undefined,
if (this.dataForm.id) { plcType: this.dataForm.plcType,
this.$http({ code: this.dataForm.code,
url: this.$http.adornUrl(`/monitoring/equipmenplc/info/${this.dataForm.id}`), name: this.dataForm.name,
method: 'get', enName: this.dataForm.enName,
params: this.$http.adornParams() description: this.dataForm.description,
}).then(({data}) => { barcode: this.dataForm.barcode,
if (data && data.code === 0) { controlType: this.dataForm.controlType,
this.dataForm.plcType = data.equipmenplc.plcType monitor: this.dataForm.monitor,
this.dataForm.code = data.equipmenplc.code collection: this.dataForm.collection,
this.dataForm.name = data.equipmenplc.name ip: this.dataForm.ip,
this.dataForm.enName = data.equipmenplc.enName port: this.dataForm.port,
this.dataForm.description = data.equipmenplc.description enabled: this.dataForm.enabled,
this.dataForm.barcode = data.equipmenplc.barcode remark: this.dataForm.remark,
this.dataForm.controlType = data.equipmenplc.controlType valid: this.dataForm.valid,
this.dataForm.monitor = data.equipmenplc.monitor creatorId: this.dataForm.creatorId,
this.dataForm.collection = data.equipmenplc.collection creatorName: this.dataForm.creatorName,
this.dataForm.ip = data.equipmenplc.ip createTime: this.dataForm.createTime,
this.dataForm.port = data.equipmenplc.port updaterId: this.dataForm.updaterId,
this.dataForm.enabled = data.equipmenplc.enabled updaterName: this.dataForm.updaterName,
this.dataForm.remark = data.equipmenplc.remark updateTime: this.dataForm.updateTime,
this.dataForm.valid = data.equipmenplc.valid version: this.dataForm.version
this.dataForm.creatorId = data.equipmenplc.creatorId })
this.dataForm.creatorName = data.equipmenplc.creatorName }).then(({ data }) => {
this.dataForm.createTime = data.equipmenplc.createTime if (data && data.code === 0) {
this.dataForm.updaterId = data.equipmenplc.updaterId this.$message({
this.dataForm.updaterName = data.equipmenplc.updaterName message: '操作成功',
this.dataForm.updateTime = data.equipmenplc.updateTime type: 'success',
this.dataForm.version = data.equipmenplc.version duration: 1500,
} onClose: () => {
}) this.visible = false
} this.$emit('refreshDataList')
}) }
}, })
// } else {
dataFormSubmit () { this.$message.error(data.msg)
this.$refs['dataForm'].validate((valid) => { }
if (valid) { })
this.$http({ }
url: this.$http.adornUrl(`/monitoring/equipmenplc/${!this.dataForm.id ? 'save' : 'update'}`), })
method: 'post', }
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, }
'plcType': this.dataForm.plcType,
'code': this.dataForm.code,
'name': this.dataForm.name,
'enName': this.dataForm.enName,
'description': this.dataForm.description,
'barcode': this.dataForm.barcode,
'controlType': this.dataForm.controlType,
'monitor': this.dataForm.monitor,
'collection': this.dataForm.collection,
'ip': this.dataForm.ip,
'port': this.dataForm.port,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,309 +1,254 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="plc连接表ID" prop="plcConId">
:visible.sync="visible"> <el-input v-model="dataForm.plcConId" placeholder="plc连接表ID"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="plc连接表ID" prop="plcConId"> <el-form-item label="类型status、data、constant" prop="type">
<el-input v-model="dataForm.plcConId" placeholder="plc连接表ID"></el-input> <el-input v-model="dataForm.type" placeholder="类型status、data、constant"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="类型status、data、constant" prop="type"> <el-form-item label="参数编码" prop="paramCode">
<el-input v-model="dataForm.type" placeholder="类型status、data、constant"></el-input> <el-input v-model="dataForm.paramCode" placeholder="参数编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="参数编码" prop="paramCode"> <el-form-item label="参数名称" prop="paramName">
<el-input v-model="dataForm.paramCode" placeholder="参数编码"></el-input> <el-input v-model="dataForm.paramName" placeholder="参数名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="参数名称" prop="paramName"> <el-form-item label="参数地址,对应实时数据库表的列名" prop="paramAddress">
<el-input v-model="dataForm.paramName" placeholder="参数名称"></el-input> <el-input v-model="dataForm.paramAddress" placeholder="参数地址,对应实时数据库表的列名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="参数地址,对应实时数据库表的列名" prop="paramAddress"> <el-form-item label="参数值类型int、long、boolean、string、list 暂不使用" prop="valueType">
<el-input v-model="dataForm.paramAddress" placeholder="参数地址,对应实时数据库表的列名"></el-input> <el-input v-model="dataForm.valueType" placeholder="参数值类型int、long、boolean、string、list 暂不使用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="参数值类型int、long、boolean、string、list 暂不使用" prop="valueType"> <el-form-item label="单位 关联数据字典表label_value" prop="unitDictValue">
<el-input v-model="dataForm.valueType" placeholder="参数值类型int、long、boolean、string、list 暂不使用"></el-input> <el-input v-model="dataForm.unitDictValue" placeholder="单位 关联数据字典表label_value"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="单位 关联数据字典表label_value" prop="unitDictValue"> <el-form-item label="最小值" prop="minValue">
<el-input v-model="dataForm.unitDictValue" placeholder="单位 关联数据字典表label_value"></el-input> <el-input v-model="dataForm.minValue" placeholder="最小值"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="最小值" prop="minValue"> <el-form-item label="最大值" prop="maxValue">
<el-input v-model="dataForm.minValue" placeholder="最小值"></el-input> <el-input v-model="dataForm.maxValue" placeholder="最大值"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="最大值" prop="maxValue"> <el-form-item label="参数设定标准值" prop="defaultValue">
<el-input v-model="dataForm.maxValue" placeholder="最大值"></el-input> <el-input v-model="dataForm.defaultValue" placeholder="参数设定标准值"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="参数设定标准值" prop="defaultValue"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.defaultValue" placeholder="参数设定标准值"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="0 代表不采集, 1 代表采集" prop="collection">
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <el-input v-model="dataForm.collection" placeholder="0 代表不采集, 1 代表采集"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="0 代表不采集, 1 代表采集" prop="collection"> <el-form-item label="采集周期s 暂不使用" prop="collectionCycle">
<el-input v-model="dataForm.collection" placeholder="0 代表不采集, 1 代表采集"></el-input> <el-input v-model="dataForm.collectionCycle" placeholder="采集周期s 暂不使用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="采集周期s 暂不使用" prop="collectionCycle"> <el-form-item label="上报周期s 暂不使用" prop="reportingCycle">
<el-input v-model="dataForm.collectionCycle" placeholder="采集周期s 暂不使用"></el-input> <el-input v-model="dataForm.reportingCycle" placeholder="上报周期s 暂不使用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上报周期s 暂不使用" prop="reportingCycle"> <el-form-item label="上报方式 暂不使用" prop="reportingMethod">
<el-input v-model="dataForm.reportingCycle" placeholder="上报周期s 暂不使用"></el-input> <el-input v-model="dataForm.reportingMethod" placeholder="上报方式 暂不使用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上报方式 暂不使用" prop="reportingMethod"> <el-form-item label="上报编码 暂不使用" prop="reportingCode">
<el-input v-model="dataForm.reportingMethod" placeholder="上报方式 暂不使用"></el-input> <el-input v-model="dataForm.reportingCode" placeholder="上报编码 暂不使用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上报编码 暂不使用" prop="reportingCode"> </el-form>
<el-input v-model="dataForm.reportingCode" placeholder="上报编码 暂不使用"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
plcConId: '', plcConId: '',
type: '', type: '',
paramCode: '', paramCode: '',
paramName: '', paramName: '',
paramAddress: '', paramAddress: '',
valueType: '', valueType: '',
unitDictValue: '', unitDictValue: '',
minValue: '', minValue: '',
maxValue: '', maxValue: '',
defaultValue: '', defaultValue: '',
description: '', description: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '', version: '',
collection: '', collection: '',
collectionCycle: '', collectionCycle: '',
reportingCycle: '', reportingCycle: '',
reportingMethod: '', reportingMethod: '',
reportingCode: '' reportingCode: ''
}, },
dataRule: { dataRule: {
plcConId: [ plcConId: [{ required: true, message: 'plc连接表ID不能为空', trigger: 'blur' }],
{ required: true, message: 'plc连接表ID不能为空', trigger: 'blur' } type: [{ required: true, message: '类型status、data、constant不能为空', trigger: 'blur' }],
], paramCode: [{ required: true, message: '参数编码不能为空', trigger: 'blur' }],
type: [ paramName: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }],
{ required: true, message: '类型status、data、constant不能为空', trigger: 'blur' } paramAddress: [{ required: true, message: '参数地址,对应实时数据库表的列名不能为空', trigger: 'blur' }],
], valueType: [{ required: true, message: '参数值类型int、long、boolean、string、list 暂不使用不能为空', trigger: 'blur' }],
paramCode: [ unitDictValue: [{ required: true, message: '单位 关联数据字典表label_value不能为空', trigger: 'blur' }],
{ required: true, message: '参数编码不能为空', trigger: 'blur' } minValue: [{ required: true, message: '最小值不能为空', trigger: 'blur' }],
], maxValue: [{ required: true, message: '最大值不能为空', trigger: 'blur' }],
paramName: [ defaultValue: [{ required: true, message: '参数设定标准值不能为空', trigger: 'blur' }],
{ required: true, message: '参数名称不能为空', trigger: 'blur' } description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
], enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
paramAddress: [ remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
{ required: true, message: '参数地址,对应实时数据库表的列名不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
valueType: [ creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '参数值类型int、long、boolean、string、list 暂不使用不能为空', trigger: 'blur' } createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
], updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
unitDictValue: [ updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '单位 关联数据字典表label_value不能为空', trigger: 'blur' } updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
], version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
minValue: [ collection: [{ required: true, message: '0 代表不采集, 1 代表采集不能为空', trigger: 'blur' }],
{ required: true, message: '最小值不能为空', trigger: 'blur' } collectionCycle: [{ required: true, message: '采集周期s 暂不使用不能为空', trigger: 'blur' }],
], reportingCycle: [{ required: true, message: '上报周期s 暂不使用不能为空', trigger: 'blur' }],
maxValue: [ reportingMethod: [{ required: true, message: '上报方式 暂不使用不能为空', trigger: 'blur' }],
{ required: true, message: '最大值不能为空', trigger: 'blur' } reportingCode: [{ required: true, message: '上报编码 暂不使用不能为空', trigger: 'blur' }]
], }
defaultValue: [ }
{ required: true, message: '参数设定标准值不能为空', trigger: 'blur' } },
], methods: {
description: [ init(id) {
{ required: true, message: '描述不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
enabled: [ this.$nextTick(() => {
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
remark: [ this.$http({
{ required: true, message: '备注不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/equipmenplcparam/info/${this.dataForm.id}`),
], method: 'get',
valid: [ params: this.$http.adornParams()
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
creatorId: [ this.dataForm.plcConId = data.equipmenplcParam.plcConId
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.dataForm.type = data.equipmenplcParam.type
], this.dataForm.paramCode = data.equipmenplcParam.paramCode
creatorName: [ this.dataForm.paramName = data.equipmenplcParam.paramName
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.paramAddress = data.equipmenplcParam.paramAddress
], this.dataForm.valueType = data.equipmenplcParam.valueType
createTime: [ this.dataForm.unitDictValue = data.equipmenplcParam.unitDictValue
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.minValue = data.equipmenplcParam.minValue
], this.dataForm.maxValue = data.equipmenplcParam.maxValue
updaterId: [ this.dataForm.defaultValue = data.equipmenplcParam.defaultValue
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.description = data.equipmenplcParam.description
], this.dataForm.enabled = data.equipmenplcParam.enabled
updaterName: [ this.dataForm.remark = data.equipmenplcParam.remark
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.valid = data.equipmenplcParam.valid
], this.dataForm.creatorId = data.equipmenplcParam.creatorId
updateTime: [ this.dataForm.creatorName = data.equipmenplcParam.creatorName
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.createTime = data.equipmenplcParam.createTime
], this.dataForm.updaterId = data.equipmenplcParam.updaterId
version: [ this.dataForm.updaterName = data.equipmenplcParam.updaterName
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updateTime = data.equipmenplcParam.updateTime
], this.dataForm.version = data.equipmenplcParam.version
collection: [ this.dataForm.collection = data.equipmenplcParam.collection
{ required: true, message: '0 代表不采集, 1 代表采集不能为空', trigger: 'blur' } this.dataForm.collectionCycle = data.equipmenplcParam.collectionCycle
], this.dataForm.reportingCycle = data.equipmenplcParam.reportingCycle
collectionCycle: [ this.dataForm.reportingMethod = data.equipmenplcParam.reportingMethod
{ required: true, message: '采集周期s 暂不使用不能为空', trigger: 'blur' } this.dataForm.reportingCode = data.equipmenplcParam.reportingCode
], }
reportingCycle: [ })
{ required: true, message: '上报周期s 暂不使用不能为空', trigger: 'blur' } }
], })
reportingMethod: [ },
{ required: true, message: '上报方式 暂不使用不能为空', trigger: 'blur' } //
], dataFormSubmit() {
reportingCode: [ this.$refs['dataForm'].validate(valid => {
{ required: true, message: '上报编码 暂不使用不能为空', trigger: 'blur' } if (valid) {
] this.$http({
} url: this.$http.adornUrl(`/monitoring/equipmenplcparam/${!this.dataForm.id ? 'save' : 'update'}`),
} method: 'post',
}, data: this.$http.adornData({
methods: { id: this.dataForm.id || undefined,
init (id) { plcConId: this.dataForm.plcConId,
this.dataForm.id = id || 0 type: this.dataForm.type,
this.visible = true paramCode: this.dataForm.paramCode,
this.$nextTick(() => { paramName: this.dataForm.paramName,
this.$refs['dataForm'].resetFields() paramAddress: this.dataForm.paramAddress,
if (this.dataForm.id) { valueType: this.dataForm.valueType,
this.$http({ unitDictValue: this.dataForm.unitDictValue,
url: this.$http.adornUrl(`/monitoring/equipmenplcparam/info/${this.dataForm.id}`), minValue: this.dataForm.minValue,
method: 'get', maxValue: this.dataForm.maxValue,
params: this.$http.adornParams() defaultValue: this.dataForm.defaultValue,
}).then(({data}) => { description: this.dataForm.description,
if (data && data.code === 0) { enabled: this.dataForm.enabled,
this.dataForm.plcConId = data.equipmenplcParam.plcConId remark: this.dataForm.remark,
this.dataForm.type = data.equipmenplcParam.type valid: this.dataForm.valid,
this.dataForm.paramCode = data.equipmenplcParam.paramCode creatorId: this.dataForm.creatorId,
this.dataForm.paramName = data.equipmenplcParam.paramName creatorName: this.dataForm.creatorName,
this.dataForm.paramAddress = data.equipmenplcParam.paramAddress createTime: this.dataForm.createTime,
this.dataForm.valueType = data.equipmenplcParam.valueType updaterId: this.dataForm.updaterId,
this.dataForm.unitDictValue = data.equipmenplcParam.unitDictValue updaterName: this.dataForm.updaterName,
this.dataForm.minValue = data.equipmenplcParam.minValue updateTime: this.dataForm.updateTime,
this.dataForm.maxValue = data.equipmenplcParam.maxValue version: this.dataForm.version,
this.dataForm.defaultValue = data.equipmenplcParam.defaultValue collection: this.dataForm.collection,
this.dataForm.description = data.equipmenplcParam.description collectionCycle: this.dataForm.collectionCycle,
this.dataForm.enabled = data.equipmenplcParam.enabled reportingCycle: this.dataForm.reportingCycle,
this.dataForm.remark = data.equipmenplcParam.remark reportingMethod: this.dataForm.reportingMethod,
this.dataForm.valid = data.equipmenplcParam.valid reportingCode: this.dataForm.reportingCode
this.dataForm.creatorId = data.equipmenplcParam.creatorId })
this.dataForm.creatorName = data.equipmenplcParam.creatorName }).then(({ data }) => {
this.dataForm.createTime = data.equipmenplcParam.createTime if (data && data.code === 0) {
this.dataForm.updaterId = data.equipmenplcParam.updaterId this.$message({
this.dataForm.updaterName = data.equipmenplcParam.updaterName message: '操作成功',
this.dataForm.updateTime = data.equipmenplcParam.updateTime type: 'success',
this.dataForm.version = data.equipmenplcParam.version duration: 1500,
this.dataForm.collection = data.equipmenplcParam.collection onClose: () => {
this.dataForm.collectionCycle = data.equipmenplcParam.collectionCycle this.visible = false
this.dataForm.reportingCycle = data.equipmenplcParam.reportingCycle this.$emit('refreshDataList')
this.dataForm.reportingMethod = data.equipmenplcParam.reportingMethod }
this.dataForm.reportingCode = data.equipmenplcParam.reportingCode })
} } else {
}) this.$message.error(data.msg)
} }
}) })
}, }
// })
dataFormSubmit () { }
this.$refs['dataForm'].validate((valid) => { }
if (valid) { }
this.$http({
url: this.$http.adornUrl(`/monitoring/equipmenplcparam/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'plcConId': this.dataForm.plcConId,
'type': this.dataForm.type,
'paramCode': this.dataForm.paramCode,
'paramName': this.dataForm.paramName,
'paramAddress': this.dataForm.paramAddress,
'valueType': this.dataForm.valueType,
'unitDictValue': this.dataForm.unitDictValue,
'minValue': this.dataForm.minValue,
'maxValue': this.dataForm.maxValue,
'defaultValue': this.dataForm.defaultValue,
'description': this.dataForm.description,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version,
'collection': this.dataForm.collection,
'collectionCycle': this.dataForm.collectionCycle,
'reportingCycle': this.dataForm.reportingCycle,
'reportingMethod': this.dataForm.reportingMethod,
'reportingCode': this.dataForm.reportingCode
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,228 +1,191 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="设备外部编码" prop="externalCode">
:visible.sync="visible"> <el-input v-model="dataForm.externalCode" placeholder="设备外部编码"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="设备外部编码" prop="externalCode"> <el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="dataForm.externalCode" placeholder="设备外部编码"></el-input> <el-input v-model="dataForm.equipmentName" placeholder="设备名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="equipmentName"> <el-form-item label="进入设备的数量" prop="inQuantity">
<el-input v-model="dataForm.equipmentName" placeholder="设备名称"></el-input> <el-input v-model="dataForm.inQuantity" placeholder="进入设备的数量"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="进入设备的数量" prop="inQuantity"> <el-form-item label="离开设备的数量若plc只记录一个生产数量也写入该字段" prop="outQuantity">
<el-input v-model="dataForm.inQuantity" placeholder="进入设备的数量"></el-input> <el-input v-model="dataForm.outQuantity" placeholder="离开设备的数量若plc只记录一个生产数量也写入该字段"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="离开设备的数量若plc只记录一个生产数量也写入该字段" prop="outQuantity"> <el-form-item label="" prop="okQuantity">
<el-input v-model="dataForm.outQuantity" placeholder="离开设备的数量若plc只记录一个生产数量也写入该字段"></el-input> <el-input v-model="dataForm.okQuantity" placeholder=""></el-input>
</el-form-item> </el-form-item>
<el-form-item label="" prop="okQuantity"> <el-form-item label="设备上报的报废数量" prop="nokQuantity">
<el-input v-model="dataForm.okQuantity" placeholder=""></el-input> <el-input v-model="dataForm.nokQuantity" placeholder="设备上报的报废数量"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备上报的报废数量" prop="nokQuantity"> <el-form-item label="" prop="description">
<el-input v-model="dataForm.nokQuantity" placeholder="设备上报的报废数量"></el-input> <el-input v-model="dataForm.description" placeholder=""></el-input>
</el-form-item> </el-form-item>
<el-form-item label="" prop="description"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.description" placeholder=""></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="生产数量的记录时间" prop="recordTime">
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <el-input v-model="dataForm.recordTime" placeholder="生产数量的记录时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="生产数量的记录时间" prop="recordTime"> </el-form>
<el-input v-model="dataForm.recordTime" placeholder="生产数量的记录时间"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
externalCode: '', externalCode: '',
equipmentName: '', equipmentName: '',
inQuantity: '', inQuantity: '',
outQuantity: '', outQuantity: '',
okQuantity: '', okQuantity: '',
nokQuantity: '', nokQuantity: '',
description: '', description: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '', version: '',
recordTime: '' recordTime: ''
}, },
dataRule: { dataRule: {
externalCode: [ externalCode: [{ required: true, message: '设备外部编码不能为空', trigger: 'blur' }],
{ required: true, message: '设备外部编码不能为空', trigger: 'blur' } equipmentName: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
], inQuantity: [{ required: true, message: '进入设备的数量不能为空', trigger: 'blur' }],
equipmentName: [ outQuantity: [{ required: true, message: '离开设备的数量若plc只记录一个生产数量也写入该字段不能为空', trigger: 'blur' }],
{ required: true, message: '设备名称不能为空', trigger: 'blur' } okQuantity: [{ required: true, message: '不能为空', trigger: 'blur' }],
], nokQuantity: [{ required: true, message: '设备上报的报废数量不能为空', trigger: 'blur' }],
inQuantity: [ description: [{ required: true, message: '不能为空', trigger: 'blur' }],
{ required: true, message: '进入设备的数量不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
outQuantity: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '离开设备的数量若plc只记录一个生产数量也写入该字段不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
okQuantity: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
nokQuantity: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
{ required: true, message: '设备上报的报废数量不能为空', trigger: 'blur' } recordTime: [{ required: true, message: '生产数量的记录时间不能为空', trigger: 'blur' }]
], }
description: [ }
{ required: true, message: '不能为空', trigger: 'blur' } },
], methods: {
remark: [ init(id) {
{ required: true, message: '备注不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
valid: [ this.$nextTick(() => {
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
creatorId: [ this.$http({
{ required: true, message: '创建人不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/equipmenquantity/info/${this.dataForm.id}`),
], method: 'get',
creatorName: [ params: this.$http.adornParams()
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
createTime: [ this.dataForm.externalCode = data.equipmenquantity.externalCode
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.equipmentName = data.equipmenquantity.equipmentName
], this.dataForm.inQuantity = data.equipmenquantity.inQuantity
updaterId: [ this.dataForm.outQuantity = data.equipmenquantity.outQuantity
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.okQuantity = data.equipmenquantity.okQuantity
], this.dataForm.nokQuantity = data.equipmenquantity.nokQuantity
updaterName: [ this.dataForm.description = data.equipmenquantity.description
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.remark = data.equipmenquantity.remark
], this.dataForm.valid = data.equipmenquantity.valid
updateTime: [ this.dataForm.creatorId = data.equipmenquantity.creatorId
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.creatorName = data.equipmenquantity.creatorName
], this.dataForm.createTime = data.equipmenquantity.createTime
version: [ this.dataForm.updaterId = data.equipmenquantity.updaterId
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updaterName = data.equipmenquantity.updaterName
], this.dataForm.updateTime = data.equipmenquantity.updateTime
recordTime: [ this.dataForm.version = data.equipmenquantity.version
{ required: true, message: '生产数量的记录时间不能为空', trigger: 'blur' } this.dataForm.recordTime = data.equipmenquantity.recordTime
] }
} })
} }
}, })
methods: { },
init (id) { //
this.dataForm.id = id || 0 dataFormSubmit() {
this.visible = true this.$refs['dataForm'].validate(valid => {
this.$nextTick(() => { if (valid) {
this.$refs['dataForm'].resetFields() this.$http({
if (this.dataForm.id) { url: this.$http.adornUrl(`/monitoring/equipmenquantity/${!this.dataForm.id ? 'save' : 'update'}`),
this.$http({ method: 'post',
url: this.$http.adornUrl(`/monitoring/equipmenquantity/info/${this.dataForm.id}`), data: this.$http.adornData({
method: 'get', id: this.dataForm.id || undefined,
params: this.$http.adornParams() externalCode: this.dataForm.externalCode,
}).then(({data}) => { equipmentName: this.dataForm.equipmentName,
if (data && data.code === 0) { inQuantity: this.dataForm.inQuantity,
this.dataForm.externalCode = data.equipmenquantity.externalCode outQuantity: this.dataForm.outQuantity,
this.dataForm.equipmentName = data.equipmenquantity.equipmentName okQuantity: this.dataForm.okQuantity,
this.dataForm.inQuantity = data.equipmenquantity.inQuantity nokQuantity: this.dataForm.nokQuantity,
this.dataForm.outQuantity = data.equipmenquantity.outQuantity description: this.dataForm.description,
this.dataForm.okQuantity = data.equipmenquantity.okQuantity remark: this.dataForm.remark,
this.dataForm.nokQuantity = data.equipmenquantity.nokQuantity valid: this.dataForm.valid,
this.dataForm.description = data.equipmenquantity.description creatorId: this.dataForm.creatorId,
this.dataForm.remark = data.equipmenquantity.remark creatorName: this.dataForm.creatorName,
this.dataForm.valid = data.equipmenquantity.valid createTime: this.dataForm.createTime,
this.dataForm.creatorId = data.equipmenquantity.creatorId updaterId: this.dataForm.updaterId,
this.dataForm.creatorName = data.equipmenquantity.creatorName updaterName: this.dataForm.updaterName,
this.dataForm.createTime = data.equipmenquantity.createTime updateTime: this.dataForm.updateTime,
this.dataForm.updaterId = data.equipmenquantity.updaterId version: this.dataForm.version,
this.dataForm.updaterName = data.equipmenquantity.updaterName recordTime: this.dataForm.recordTime
this.dataForm.updateTime = data.equipmenquantity.updateTime })
this.dataForm.version = data.equipmenquantity.version }).then(({ data }) => {
this.dataForm.recordTime = data.equipmenquantity.recordTime if (data && data.code === 0) {
} this.$message({
}) message: '操作成功',
} type: 'success',
}) duration: 1500,
}, onClose: () => {
// this.visible = false
dataFormSubmit () { this.$emit('refreshDataList')
this.$refs['dataForm'].validate((valid) => { }
if (valid) { })
this.$http({ } else {
url: this.$http.adornUrl(`/monitoring/equipmenquantity/${!this.dataForm.id ? 'save' : 'update'}`), this.$message.error(data.msg)
method: 'post', }
data: this.$http.adornData({ })
'id': this.dataForm.id || undefined, }
'externalCode': this.dataForm.externalCode, })
'equipmentName': this.dataForm.equipmentName, }
'inQuantity': this.dataForm.inQuantity, }
'outQuantity': this.dataForm.outQuantity, }
'okQuantity': this.dataForm.okQuantity,
'nokQuantity': this.dataForm.nokQuantity,
'description': this.dataForm.description,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version,
'recordTime': this.dataForm.recordTime
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,309 +1,254 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="编码" prop="code">
:visible.sync="visible"> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="设备名称" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="设备名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="name"> <el-form-item label="英文名称" prop="enName">
<el-input v-model="dataForm.name" placeholder="设备名称"></el-input> <el-input v-model="dataForm.enName" placeholder="英文名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="英文名称" prop="enName"> <el-form-item label="缩写" prop="abbr">
<el-input v-model="dataForm.enName" placeholder="英文名称"></el-input> <el-input v-model="dataForm.abbr" placeholder="缩写"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="缩写" prop="abbr"> <el-form-item label="进厂日期" prop="enterTime">
<el-input v-model="dataForm.abbr" placeholder="缩写"></el-input> <el-input v-model="dataForm.enterTime" placeholder="进厂日期"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="进厂日期" prop="enterTime"> <el-form-item label="生产日期" prop="productionTime">
<el-input v-model="dataForm.enterTime" placeholder="进厂日期"></el-input> <el-input v-model="dataForm.productionTime" placeholder="生产日期"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="生产日期" prop="productionTime"> <el-form-item label="设备类型,关联设备类型表" prop="equipmentTypeId">
<el-input v-model="dataForm.productionTime" placeholder="生产日期"></el-input> <el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型,关联设备类型表"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备类型,关联设备类型表" prop="equipmentTypeId"> <el-form-item label="分组id (关联 T_EQUIPMENT_GROUP" prop="groupId">
<el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型,关联设备类型表"></el-input> <el-input v-model="dataForm.groupId" placeholder="分组id (关联 T_EQUIPMENT_GROUP"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="分组id (关联 T_EQUIPMENT_GROUP" prop="groupId"> <el-form-item label="0:无类别1:上片数据设备2:下片数据设备" prop="dataType">
<el-input v-model="dataForm.groupId" placeholder="分组id (关联 T_EQUIPMENT_GROUP"></el-input> <el-input v-model="dataForm.dataType" placeholder="0:无类别1:上片数据设备2:下片数据设备"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="0:无类别1:上片数据设备2:下片数据设备" prop="dataType"> <el-form-item label="每小时生产数量" prop="tvalue">
<el-input v-model="dataForm.dataType" placeholder="0:无类别1:上片数据设备2:下片数据设备"></el-input> <el-input v-model="dataForm.tvalue" placeholder="每小时生产数量"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="每小时生产数量" prop="tvalue"> <el-form-item label="单件加工时间 s/件" prop="processingTime">
<el-input v-model="dataForm.tvalue" placeholder="每小时生产数量"></el-input> <el-input v-model="dataForm.processingTime" placeholder="单件加工时间 s/件"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="单件加工时间 s/件" prop="processingTime"> <el-form-item label="制造商" prop="manufacturer">
<el-input v-model="dataForm.processingTime" placeholder="单件加工时间 s/件"></el-input> <el-input v-model="dataForm.manufacturer" placeholder="制造商"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="制造商" prop="manufacturer"> <el-form-item label="规格" prop="spec">
<el-input v-model="dataForm.manufacturer" placeholder="制造商"></el-input> <el-input v-model="dataForm.spec" placeholder="规格"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="规格" prop="spec"> <el-form-item label="功能描述" prop="description">
<el-input v-model="dataForm.spec" placeholder="规格"></el-input> <el-input v-model="dataForm.description" placeholder="功能描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="功能描述" prop="description"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.description" placeholder="功能描述"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="外部系统代码" prop="externalCode">
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <el-input v-model="dataForm.externalCode" placeholder="外部系统代码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部系统代码" prop="externalCode"> <el-form-item label="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计" prop="externalCodeStatis">
<el-input v-model="dataForm.externalCode" placeholder="外部系统代码"></el-input> <el-input v-model="dataForm.externalCodeStatis" placeholder="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计" prop="externalCodeStatis"> </el-form>
<el-input v-model="dataForm.externalCodeStatis" placeholder="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
code: '', code: '',
name: '', name: '',
enName: '', enName: '',
abbr: '', abbr: '',
enterTime: '', enterTime: '',
productionTime: '', productionTime: '',
equipmentTypeId: '', equipmentTypeId: '',
groupId: '', groupId: '',
dataType: '', dataType: '',
tvalue: '', tvalue: '',
processingTime: '', processingTime: '',
manufacturer: '', manufacturer: '',
spec: '', spec: '',
description: '', description: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '', version: '',
externalCode: '', externalCode: '',
externalCodeStatis: '' externalCodeStatis: ''
}, },
dataRule: { dataRule: {
code: [ code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } name: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
], enName: [{ required: true, message: '英文名称不能为空', trigger: 'blur' }],
name: [ abbr: [{ required: true, message: '缩写不能为空', trigger: 'blur' }],
{ required: true, message: '设备名称不能为空', trigger: 'blur' } enterTime: [{ required: true, message: '进厂日期不能为空', trigger: 'blur' }],
], productionTime: [{ required: true, message: '生产日期不能为空', trigger: 'blur' }],
enName: [ equipmentTypeId: [{ required: true, message: '设备类型,关联设备类型表不能为空', trigger: 'blur' }],
{ required: true, message: '英文名称不能为空', trigger: 'blur' } groupId: [{ required: true, message: '分组id (关联 T_EQUIPMENT_GROUP不能为空', trigger: 'blur' }],
], dataType: [{ required: true, message: '0:无类别1:上片数据设备2:下片数据设备不能为空', trigger: 'blur' }],
abbr: [ tvalue: [{ required: true, message: '每小时生产数量不能为空', trigger: 'blur' }],
{ required: true, message: '缩写不能为空', trigger: 'blur' } processingTime: [{ required: true, message: '单件加工时间 s/件不能为空', trigger: 'blur' }],
], manufacturer: [{ required: true, message: '制造商不能为空', trigger: 'blur' }],
enterTime: [ spec: [{ required: true, message: '规格不能为空', trigger: 'blur' }],
{ required: true, message: '进厂日期不能为空', trigger: 'blur' } description: [{ required: true, message: '功能描述不能为空', trigger: 'blur' }],
], enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
productionTime: [ remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
{ required: true, message: '生产日期不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
equipmentTypeId: [ creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '设备类型,关联设备类型表不能为空', trigger: 'blur' } createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
], updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
groupId: [ updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '分组id (关联 T_EQUIPMENT_GROUP不能为空', trigger: 'blur' } updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
], version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
dataType: [ externalCode: [{ required: true, message: '外部系统代码不能为空', trigger: 'blur' }],
{ required: true, message: '0:无类别1:上片数据设备2:下片数据设备不能为空', trigger: 'blur' } externalCodeStatis: [{ required: true, message: '统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计不能为空', trigger: 'blur' }]
], }
tvalue: [ }
{ required: true, message: '每小时生产数量不能为空', trigger: 'blur' } },
], methods: {
processingTime: [ init(id) {
{ required: true, message: '单件加工时间 s/件不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
manufacturer: [ this.$nextTick(() => {
{ required: true, message: '制造商不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
spec: [ this.$http({
{ required: true, message: '规格不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/equipment/info/${this.dataForm.id}`),
], method: 'get',
description: [ params: this.$http.adornParams()
{ required: true, message: '功能描述不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
enabled: [ this.dataForm.code = data.equipment.code
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } this.dataForm.name = data.equipment.name
], this.dataForm.enName = data.equipment.enName
remark: [ this.dataForm.abbr = data.equipment.abbr
{ required: true, message: '备注不能为空', trigger: 'blur' } this.dataForm.enterTime = data.equipment.enterTime
], this.dataForm.productionTime = data.equipment.productionTime
valid: [ this.dataForm.equipmentTypeId = data.equipment.equipmentTypeId
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.dataForm.groupId = data.equipment.groupId
], this.dataForm.dataType = data.equipment.dataType
creatorId: [ this.dataForm.tvalue = data.equipment.tvalue
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.dataForm.processingTime = data.equipment.processingTime
], this.dataForm.manufacturer = data.equipment.manufacturer
creatorName: [ this.dataForm.spec = data.equipment.spec
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.description = data.equipment.description
], this.dataForm.enabled = data.equipment.enabled
createTime: [ this.dataForm.remark = data.equipment.remark
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.valid = data.equipment.valid
], this.dataForm.creatorId = data.equipment.creatorId
updaterId: [ this.dataForm.creatorName = data.equipment.creatorName
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.createTime = data.equipment.createTime
], this.dataForm.updaterId = data.equipment.updaterId
updaterName: [ this.dataForm.updaterName = data.equipment.updaterName
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.updateTime = data.equipment.updateTime
], this.dataForm.version = data.equipment.version
updateTime: [ this.dataForm.externalCode = data.equipment.externalCode
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.externalCodeStatis = data.equipment.externalCodeStatis
], }
version: [ })
{ required: true, message: '版本号不能为空', trigger: 'blur' } }
], })
externalCode: [ },
{ required: true, message: '外部系统代码不能为空', trigger: 'blur' } //
], dataFormSubmit() {
externalCodeStatis: [ this.$refs['dataForm'].validate(valid => {
{ required: true, message: '统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计不能为空', trigger: 'blur' } if (valid) {
] this.$http({
} url: this.$http.adornUrl(`/monitoring/equipment/${!this.dataForm.id ? 'save' : 'update'}`),
} method: 'post',
}, data: this.$http.adornData({
methods: { id: this.dataForm.id || undefined,
init (id) { code: this.dataForm.code,
this.dataForm.id = id || 0 name: this.dataForm.name,
this.visible = true enName: this.dataForm.enName,
this.$nextTick(() => { abbr: this.dataForm.abbr,
this.$refs['dataForm'].resetFields() enterTime: this.dataForm.enterTime,
if (this.dataForm.id) { productionTime: this.dataForm.productionTime,
this.$http({ equipmentTypeId: this.dataForm.equipmentTypeId,
url: this.$http.adornUrl(`/monitoring/equipment/info/${this.dataForm.id}`), groupId: this.dataForm.groupId,
method: 'get', dataType: this.dataForm.dataType,
params: this.$http.adornParams() tvalue: this.dataForm.tvalue,
}).then(({data}) => { processingTime: this.dataForm.processingTime,
if (data && data.code === 0) { manufacturer: this.dataForm.manufacturer,
this.dataForm.code = data.equipment.code spec: this.dataForm.spec,
this.dataForm.name = data.equipment.name description: this.dataForm.description,
this.dataForm.enName = data.equipment.enName enabled: this.dataForm.enabled,
this.dataForm.abbr = data.equipment.abbr remark: this.dataForm.remark,
this.dataForm.enterTime = data.equipment.enterTime valid: this.dataForm.valid,
this.dataForm.productionTime = data.equipment.productionTime creatorId: this.dataForm.creatorId,
this.dataForm.equipmentTypeId = data.equipment.equipmentTypeId creatorName: this.dataForm.creatorName,
this.dataForm.groupId = data.equipment.groupId createTime: this.dataForm.createTime,
this.dataForm.dataType = data.equipment.dataType updaterId: this.dataForm.updaterId,
this.dataForm.tvalue = data.equipment.tvalue updaterName: this.dataForm.updaterName,
this.dataForm.processingTime = data.equipment.processingTime updateTime: this.dataForm.updateTime,
this.dataForm.manufacturer = data.equipment.manufacturer version: this.dataForm.version,
this.dataForm.spec = data.equipment.spec externalCode: this.dataForm.externalCode,
this.dataForm.description = data.equipment.description externalCodeStatis: this.dataForm.externalCodeStatis
this.dataForm.enabled = data.equipment.enabled })
this.dataForm.remark = data.equipment.remark }).then(({ data }) => {
this.dataForm.valid = data.equipment.valid if (data && data.code === 0) {
this.dataForm.creatorId = data.equipment.creatorId this.$message({
this.dataForm.creatorName = data.equipment.creatorName message: '操作成功',
this.dataForm.createTime = data.equipment.createTime type: 'success',
this.dataForm.updaterId = data.equipment.updaterId duration: 1500,
this.dataForm.updaterName = data.equipment.updaterName onClose: () => {
this.dataForm.updateTime = data.equipment.updateTime this.visible = false
this.dataForm.version = data.equipment.version this.$emit('refreshDataList')
this.dataForm.externalCode = data.equipment.externalCode }
this.dataForm.externalCodeStatis = data.equipment.externalCodeStatis })
} } else {
}) this.$message.error(data.msg)
} }
}) })
}, }
// })
dataFormSubmit () { }
this.$refs['dataForm'].validate((valid) => { }
if (valid) { }
this.$http({
url: this.$http.adornUrl(`/monitoring/equipment/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'post',
data: this.$http.adornData({
'id': this.dataForm.id || undefined,
'code': this.dataForm.code,
'name': this.dataForm.name,
'enName': this.dataForm.enName,
'abbr': this.dataForm.abbr,
'enterTime': this.dataForm.enterTime,
'productionTime': this.dataForm.productionTime,
'equipmentTypeId': this.dataForm.equipmentTypeId,
'groupId': this.dataForm.groupId,
'dataType': this.dataForm.dataType,
'tvalue': this.dataForm.tvalue,
'processingTime': this.dataForm.processingTime,
'manufacturer': this.dataForm.manufacturer,
'spec': this.dataForm.spec,
'description': this.dataForm.description,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version,
'externalCode': this.dataForm.externalCode,
'externalCodeStatis': this.dataForm.externalCodeStatis
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,235 +1,153 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenalarmlog:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmenalarmlog:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenalarmlog:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmenalarmlog:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="alarmId" header-align="center" align="center" label="报警信息ID关联T_equipment_group_alarm表"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="alarmSource" header-align="center" align="center" label="报警来源"> </el-table-column>
style="width: 100%;"> <el-table-column prop="alarmContent" header-align="center" align="center" label="报警详细内容"> </el-table-column>
<el-table-column <el-table-column prop="alarmEquipmentId" header-align="center" align="center" label="报警设备id 关联equipment表"> </el-table-column>
type="selection" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
header-align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
width="50"> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
<el-table-column <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
prop="id" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
header-align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
label="ID"> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
</el-table-column> <template slot-scope="scope">
<el-table-column <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
prop="alarmId" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
header-align="center" </template>
align="center" </el-table-column>
label="报警信息ID关联T_equipment_group_alarm表"> </el-table>
</el-table-column> <el-pagination
<el-table-column @size-change="sizeChangeHandle"
prop="alarmSource" @current-change="currentChangeHandle"
header-align="center" :current-page="pageIndex"
align="center" :page-sizes="[10, 20, 50, 100]"
label="报警来源"> :page-size="pageSize"
</el-table-column> :total="totalPage"
<el-table-column layout="total, sizes, prev, pager, next, jumper"
prop="alarmContent" >
header-align="center" </el-pagination>
align="center" <!-- 弹窗, 新增 / 修改 -->
label="报警详细内容"> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</el-table-column> </div>
<el-table-column
prop="alarmEquipmentId"
header-align="center"
align="center"
label="报警设备id 关联equipment表">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmenalarmlog-add-or-update' import AddOrUpdate from './equipmenalarmlog-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenalarmlog/page'), url: this.$http.adornUrl('/monitoring/equipmenalarmlog/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmenalarmlog/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmenalarmlog/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,265 +1,159 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmengroupalarm:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmengroupalarm:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmengroupalarm:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmengroupalarm:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">
</el-form-item> 批量删除
</el-form> </el-button>
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="ID"></el-table-column>
style="width: 100%;"> <el-table-column prop="equipmentGroupId" header-align="center" align="center" label="设备分组ID关联t_equipment_group"></el-table-column>
<el-table-column <el-table-column prop="code" header-align="center" align="center" label="编码"></el-table-column>
type="selection" <el-table-column prop="typeDictValue" header-align="center" align="center" label="报警类型 字典表关联label_value"></el-table-column>
header-align="center" <el-table-column prop="gradeDictValue" header-align="center" align="center" label="报警级别 字典表关联label_value"></el-table-column>
align="center" <el-table-column prop="alarmContent" header-align="center" align="center" label="报警内容"></el-table-column>
width="50"> <el-table-column prop="description" header-align="center" align="center" label="描述"></el-table-column>
</el-table-column> <el-table-column prop="externalCode" header-align="center" align="center" label="外部编码,用于对照外部系统的编码"></el-table-column>
<el-table-column <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"></el-table-column>
prop="id" <el-table-column prop="remark" header-align="center" align="center" label="备注"></el-table-column>
header-align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"></el-table-column>
align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"></el-table-column>
label="ID"> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"></el-table-column>
</el-table-column> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"></el-table-column>
<el-table-column <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"></el-table-column>
prop="equipmentGroupId" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"></el-table-column>
header-align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"></el-table-column>
align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"></el-table-column>
label="设备分组ID关联t_equipment_group"> <el-table-column prop="alarmNotify" header-align="center" align="center" label="推送方式 0邮箱 1微信"></el-table-column>
</el-table-column> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<el-table-column <template slot-scope="scope">
prop="code" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
header-align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
align="center" </template>
label="编码"> </el-table-column>
</el-table-column> </el-table>
<el-table-column <el-pagination
prop="typeDictValue" @size-change="sizeChangeHandle"
header-align="center" @current-change="currentChangeHandle"
align="center" :current-page="pageIndex"
label="报警类型 字典表关联label_value"> :page-sizes="[10, 20, 50, 100]"
</el-table-column> :page-size="pageSize"
<el-table-column :total="totalPage"
prop="gradeDictValue" layout="total, sizes, prev, pager, next, jumper"
header-align="center" ></el-pagination>
align="center" <!-- 弹窗, 新增 / 修改 -->
label="报警级别 字典表关联label_value"> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</el-table-column> </div>
<el-table-column
prop="alarmContent"
header-align="center"
align="center"
label="报警内容">
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="externalCode"
header-align="center"
align="center"
label="外部编码,用于对照外部系统的编码">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
prop="alarmNotify"
header-align="center"
align="center"
label="推送方式 0邮箱 1微信">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmengroupalarm-add-or-update' import AddOrUpdate from './equipmengroupalarm-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmengroupalarm/page'), url: this.$http.adornUrl('/monitoring/equipmengroupalarm/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmengroupalarm/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmengroupalarm/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,283 +1,161 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenplc:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmenplc:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenplc:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmenplc:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="plcType" header-align="center" align="center" label="plc类型"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
style="width: 100%;"> <el-table-column prop="name" header-align="center" align="center" label="plc名称ip+名称对应实时数据库表名)"> </el-table-column>
<el-table-column <el-table-column prop="enName" header-align="center" align="center" label="英文名称"> </el-table-column>
type="selection" <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
header-align="center" <el-table-column prop="barcode" header-align="center" align="center" label="plc条码"> </el-table-column>
align="center" <el-table-column prop="controlType" header-align="center" align="center" label="链接方式0 tcp1 udp等"> </el-table-column>
width="50"> <el-table-column prop="monitor" header-align="center" align="center" label="是否监控 0 代表不监控, 1 代表监控"> </el-table-column>
</el-table-column> <el-table-column prop="collection" header-align="center" align="center" label="是否采集 0 代表不采集, 1 代表采集"> </el-table-column>
<el-table-column <el-table-column prop="ip" header-align="center" align="center" label="IP"> </el-table-column>
prop="id" <el-table-column prop="port" header-align="center" align="center" label="端口号"> </el-table-column>
header-align="center" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
align="center" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
label="id"> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
</el-table-column> <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
<el-table-column <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
prop="plcType" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
header-align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
align="center" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
label="plc类型"> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
</el-table-column> <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
<el-table-column <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
prop="code" <template slot-scope="scope">
header-align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
label="编码"> </template>
</el-table-column> </el-table-column>
<el-table-column </el-table>
prop="name" <el-pagination
header-align="center" @size-change="sizeChangeHandle"
align="center" @current-change="currentChangeHandle"
label="plc名称ip+名称对应实时数据库表名)"> :current-page="pageIndex"
</el-table-column> :page-sizes="[10, 20, 50, 100]"
<el-table-column :page-size="pageSize"
prop="enName" :total="totalPage"
header-align="center" layout="total, sizes, prev, pager, next, jumper"
align="center" >
label="英文名称"> </el-pagination>
</el-table-column> <!-- 弹窗, 新增 / 修改 -->
<el-table-column <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
prop="description" </div>
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="barcode"
header-align="center"
align="center"
label="plc条码">
</el-table-column>
<el-table-column
prop="controlType"
header-align="center"
align="center"
label="链接方式0 tcp1 udp等">
</el-table-column>
<el-table-column
prop="monitor"
header-align="center"
align="center"
label="是否监控 0 代表不监控, 1 代表监控">
</el-table-column>
<el-table-column
prop="collection"
header-align="center"
align="center"
label="是否采集 0 代表不采集, 1 代表采集">
</el-table-column>
<el-table-column
prop="ip"
header-align="center"
align="center"
label="IP">
</el-table-column>
<el-table-column
prop="port"
header-align="center"
align="center"
label="端口号">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmenplc-add-or-update' import AddOrUpdate from './equipmenplc-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenplc/page'), url: this.$http.adornUrl('/monitoring/equipmenplc/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmenplc/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmenplc/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,229 +1,154 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenplcconnect:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmenplcconnect:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenplcconnect:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmenplcconnect:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"
</el-form-item> >批量删除</el-button
</el-form> >
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
style="width: 100%;"> <el-table-column prop="plcId" header-align="center" align="center" label="plc表iD"> </el-table-column>
<el-table-column <el-table-column prop="equipmentId" header-align="center" align="center" label="设备表id"> </el-table-column>
type="selection" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
header-align="center" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
width="50"> <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
</el-table-column> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
<el-table-column <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
prop="id" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
header-align="center" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
label="id"> <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
</el-table-column> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<el-table-column <template slot-scope="scope">
prop="plcId" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
header-align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
align="center" </template>
label="plc表iD"> </el-table-column>
</el-table-column> </el-table>
<el-table-column <el-pagination
prop="equipmentId" @size-change="sizeChangeHandle"
header-align="center" @current-change="currentChangeHandle"
align="center" :current-page="pageIndex"
label="设备表id"> :page-sizes="[10, 20, 50, 100]"
</el-table-column> :page-size="pageSize"
<el-table-column :total="totalPage"
prop="enabled" layout="total, sizes, prev, pager, next, jumper"
header-align="center" >
align="center" </el-pagination>
label="启用状态:0 、停用1、启用"> <!-- 弹窗, 新增 / 修改 -->
</el-table-column> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-table-column </div>
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmenplcconnect-add-or-update' import AddOrUpdate from './equipmenplcconnect-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenplcconnect/page'), url: this.$http.adornUrl('/monitoring/equipmenplcconnect/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmenplcconnect/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmenplcconnect/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,313 +1,166 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenplcparam:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmenplcparam:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenplcparam:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmenplcparam:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="plcConId" header-align="center" align="center" label="plc连接表ID"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="type" header-align="center" align="center" label="类型status、data、constant"> </el-table-column>
style="width: 100%;"> <el-table-column prop="paramCode" header-align="center" align="center" label="参数编码"> </el-table-column>
<el-table-column <el-table-column prop="paramName" header-align="center" align="center" label="参数名称"> </el-table-column>
type="selection" <el-table-column prop="paramAddress" header-align="center" align="center" label="参数地址,对应实时数据库表的列名"> </el-table-column>
header-align="center" <el-table-column prop="valueType" header-align="center" align="center" label="参数值类型int、long、boolean、string、list 暂不使用"> </el-table-column>
align="center" <el-table-column prop="unitDictValue" header-align="center" align="center" label="单位 关联数据字典表label_value"> </el-table-column>
width="50"> <el-table-column prop="minValue" header-align="center" align="center" label="最小值"> </el-table-column>
</el-table-column> <el-table-column prop="maxValue" header-align="center" align="center" label="最大值"> </el-table-column>
<el-table-column <el-table-column prop="defaultValue" header-align="center" align="center" label="参数设定标准值"> </el-table-column>
prop="id" <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
header-align="center" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
align="center" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
label="ID"> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
</el-table-column> <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
<el-table-column <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
prop="plcConId" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
header-align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
align="center" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
label="plc连接表ID"> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
</el-table-column> <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
<el-table-column <el-table-column prop="collection" header-align="center" align="center" label="0 代表不采集, 1 代表采集"> </el-table-column>
prop="type" <el-table-column prop="collectionCycle" header-align="center" align="center" label="采集周期s 暂不使用"> </el-table-column>
header-align="center" <el-table-column prop="reportingCycle" header-align="center" align="center" label="上报周期s 暂不使用"> </el-table-column>
align="center" <el-table-column prop="reportingMethod" header-align="center" align="center" label="上报方式 暂不使用"> </el-table-column>
label="类型status、data、constant"> <el-table-column prop="reportingCode" header-align="center" align="center" label="上报编码 暂不使用"> </el-table-column>
</el-table-column> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<el-table-column <template slot-scope="scope">
prop="paramCode" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
header-align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
align="center" </template>
label="参数编码"> </el-table-column>
</el-table-column> </el-table>
<el-table-column <el-pagination
prop="paramName" @size-change="sizeChangeHandle"
header-align="center" @current-change="currentChangeHandle"
align="center" :current-page="pageIndex"
label="参数名称"> :page-sizes="[10, 20, 50, 100]"
</el-table-column> :page-size="pageSize"
<el-table-column :total="totalPage"
prop="paramAddress" layout="total, sizes, prev, pager, next, jumper"
header-align="center" >
align="center" </el-pagination>
label="参数地址,对应实时数据库表的列名"> <!-- 弹窗, 新增 / 修改 -->
</el-table-column> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-table-column </div>
prop="valueType"
header-align="center"
align="center"
label="参数值类型int、long、boolean、string、list 暂不使用">
</el-table-column>
<el-table-column
prop="unitDictValue"
header-align="center"
align="center"
label="单位 关联数据字典表label_value">
</el-table-column>
<el-table-column
prop="minValue"
header-align="center"
align="center"
label="最小值">
</el-table-column>
<el-table-column
prop="maxValue"
header-align="center"
align="center"
label="最大值">
</el-table-column>
<el-table-column
prop="defaultValue"
header-align="center"
align="center"
label="参数设定标准值">
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
prop="collection"
header-align="center"
align="center"
label="0 代表不采集, 1 代表采集">
</el-table-column>
<el-table-column
prop="collectionCycle"
header-align="center"
align="center"
label="采集周期s 暂不使用">
</el-table-column>
<el-table-column
prop="reportingCycle"
header-align="center"
align="center"
label="上报周期s 暂不使用">
</el-table-column>
<el-table-column
prop="reportingMethod"
header-align="center"
align="center"
label="上报方式 暂不使用">
</el-table-column>
<el-table-column
prop="reportingCode"
header-align="center"
align="center"
label="上报编码 暂不使用">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmenplcparam-add-or-update' import AddOrUpdate from './equipmenplcparam-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenplcparam/page'), url: this.$http.adornUrl('/monitoring/equipmenplcparam/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmenplcparam/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmenplcparam/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,259 +1,157 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenquantity:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmenquantity:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenquantity:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmenquantity:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="externalCode" header-align="center" align="center" label="设备外部编码"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="equipmentName" header-align="center" align="center" label="设备名称"> </el-table-column>
style="width: 100%;"> <el-table-column prop="inQuantity" header-align="center" align="center" label="进入设备的数量"> </el-table-column>
<el-table-column <el-table-column prop="outQuantity" header-align="center" align="center" label="离开设备的数量若plc只记录一个生产数量也写入该字段"> </el-table-column>
type="selection" <el-table-column prop="okQuantity" header-align="center" align="center" label=""> </el-table-column>
header-align="center" <el-table-column prop="nokQuantity" header-align="center" align="center" label="设备上报的报废数量"> </el-table-column>
align="center" <el-table-column prop="description" header-align="center" align="center" label=""> </el-table-column>
width="50"> <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
</el-table-column> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
<el-table-column <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
prop="id" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
header-align="center" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
label="id"> <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
<el-table-column <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
prop="externalCode" <el-table-column prop="recordTime" header-align="center" align="center" label="生产数量的记录时间"> </el-table-column>
header-align="center" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
align="center" <template slot-scope="scope">
label="设备外部编码"> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
</el-table-column> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
<el-table-column </template>
prop="equipmentName" </el-table-column>
header-align="center" </el-table>
align="center" <el-pagination
label="设备名称"> @size-change="sizeChangeHandle"
</el-table-column> @current-change="currentChangeHandle"
<el-table-column :current-page="pageIndex"
prop="inQuantity" :page-sizes="[10, 20, 50, 100]"
header-align="center" :page-size="pageSize"
align="center" :total="totalPage"
label="进入设备的数量"> layout="total, sizes, prev, pager, next, jumper"
</el-table-column> >
<el-table-column </el-pagination>
prop="outQuantity" <!-- 弹窗, 新增 / 修改 -->
header-align="center" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
align="center" </div>
label="离开设备的数量若plc只记录一个生产数量也写入该字段">
</el-table-column>
<el-table-column
prop="okQuantity"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="nokQuantity"
header-align="center"
align="center"
label="设备上报的报废数量">
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
prop="recordTime"
header-align="center"
align="center"
label="生产数量的记录时间">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmenquantity-add-or-update' import AddOrUpdate from './equipmenquantity-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenquantity/page'), url: this.$http.adornUrl('/monitoring/equipmenquantity/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmenquantity/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmenquantity/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,253 +1,158 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenstatuslog:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmenstatuslog:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmenstatuslog:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmenstatuslog:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"
</el-form-item> >批量删除</el-button
</el-form> >
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
style="width: 100%;"> <el-table-column prop="externalCode" header-align="center" align="center" label="设备外部代码"> </el-table-column>
<el-table-column <el-table-column prop="plcId" header-align="center" align="center" label="plc id"> </el-table-column>
type="selection" <el-table-column prop="plc" header-align="center" align="center" label="plc"> </el-table-column>
header-align="center" <el-table-column prop="equipmentId" header-align="center" align="center" label="设备id"> </el-table-column>
align="center" <el-table-column prop="equipmentName" header-align="center" align="center" label="设备名称"> </el-table-column>
width="50"> <el-table-column prop="status" header-align="center" align="center" label="状态0正常 1计划停机 2故障"> </el-table-column>
</el-table-column> <el-table-column prop="logTime" header-align="center" align="center" label="记录时间"> </el-table-column>
<el-table-column <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
prop="id" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
header-align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
align="center" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
label="id"> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
</el-table-column> <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
<el-table-column <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
prop="externalCode" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
header-align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
align="center" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
label="设备外部代码"> <template slot-scope="scope">
</el-table-column> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-table-column <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
prop="plcId" </template>
header-align="center" </el-table-column>
align="center" </el-table>
label="plc id"> <el-pagination
</el-table-column> @size-change="sizeChangeHandle"
<el-table-column @current-change="currentChangeHandle"
prop="plc" :current-page="pageIndex"
header-align="center" :page-sizes="[10, 20, 50, 100]"
align="center" :page-size="pageSize"
label="plc"> :total="totalPage"
</el-table-column> layout="total, sizes, prev, pager, next, jumper"
<el-table-column >
prop="equipmentId" </el-pagination>
header-align="center" <!-- 弹窗, 新增 / 修改 -->
align="center" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
label="设备id"> </div>
</el-table-column>
<el-table-column
prop="equipmentName"
header-align="center"
align="center"
label="设备名称">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="状态0正常 1计划停机 2故障">
</el-table-column>
<el-table-column
prop="logTime"
header-align="center"
align="center"
label="记录时间">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmenstatuslog-add-or-update' import AddOrUpdate from './equipmenstatuslog-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmenstatuslog/page'), url: this.$http.adornUrl('/monitoring/equipmenstatuslog/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmenstatuslog/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmenstatuslog/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,247 +1,155 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmentype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmentype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmentype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmentype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="name" header-align="center" align="center" label="名称"> </el-table-column>
style="width: 100%;"> <el-table-column prop="parentId" header-align="center" align="center" label="父类ID"> </el-table-column>
<el-table-column <el-table-column prop="parentName" header-align="center" align="center" label="父类名称"> </el-table-column>
type="selection" <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
header-align="center" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
align="center" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
width="50"> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
</el-table-column> <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
<el-table-column <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
prop="id" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
header-align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
align="center" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
label="ID"> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
</el-table-column> <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
<el-table-column <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
prop="code" <template slot-scope="scope">
header-align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
label="编码"> </template>
</el-table-column> </el-table-column>
<el-table-column </el-table>
prop="name" <el-pagination
header-align="center" @size-change="sizeChangeHandle"
align="center" @current-change="currentChangeHandle"
label="名称"> :current-page="pageIndex"
</el-table-column> :page-sizes="[10, 20, 50, 100]"
<el-table-column :page-size="pageSize"
prop="parentId" :total="totalPage"
header-align="center" layout="total, sizes, prev, pager, next, jumper"
align="center" >
label="父类ID"> </el-pagination>
</el-table-column> <!-- 弹窗, 新增 / 修改 -->
<el-table-column <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
prop="parentName" </div>
header-align="center"
align="center"
label="父类名称">
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmentype-add-or-update' import AddOrUpdate from './equipmentype-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmentype/page'), url: this.$http.adornUrl('/monitoring/equipmentype/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmentype/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmentype/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,253 +1,156 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:equipmentypefile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:equipmentypefile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:equipmentypefile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:equipmentypefile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="equipmentTypeId" header-align="center" align="center" label="设备类型ID"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="fileId" header-align="center" align="center" label="文件ID"> </el-table-column>
style="width: 100%;"> <el-table-column prop="typeCode" header-align="center" align="center" label="文件类型编码"> </el-table-column>
<el-table-column <el-table-column prop="fileName" header-align="center" align="center" label="文件名称"> </el-table-column>
type="selection" <el-table-column prop="fileUrl" header-align="center" align="center" label="下载地址"> </el-table-column>
header-align="center" <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
align="center" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
width="50"> <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
</el-table-column> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
<el-table-column <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
prop="id" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
header-align="center" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
label="ID"> <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
<el-table-column <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
prop="equipmentTypeId" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
header-align="center" <template slot-scope="scope">
align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
label="设备类型ID"> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</el-table-column> </template>
<el-table-column </el-table-column>
prop="fileId" </el-table>
header-align="center" <el-pagination
align="center" @size-change="sizeChangeHandle"
label="文件ID"> @current-change="currentChangeHandle"
</el-table-column> :current-page="pageIndex"
<el-table-column :page-sizes="[10, 20, 50, 100]"
prop="typeCode" :page-size="pageSize"
header-align="center" :total="totalPage"
align="center" layout="total, sizes, prev, pager, next, jumper"
label="文件类型编码"> >
</el-table-column> </el-pagination>
<el-table-column <!-- 弹窗, 新增 / 修改 -->
prop="fileName" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
header-align="center" </div>
align="center"
label="文件名称">
</el-table-column>
<el-table-column
prop="fileUrl"
header-align="center"
align="center"
label="下载地址">
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './equipmentypefile-add-or-update' import AddOrUpdate from './equipmentypefile-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipmentypefile/page'), url: this.$http.adornUrl('/monitoring/equipmentypefile/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/equipmentypefile/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/equipmentypefile/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,210 +1,177 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="编码" prop="code">
:visible.sync="visible"> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="父类ID" prop="parentId">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.parentId" placeholder="父类ID"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="父类ID" prop="parentId"> <el-form-item label="父类名称" prop="parentName">
<el-input v-model="dataForm.parentId" placeholder="父类ID"></el-input> <el-input v-model="dataForm.parentName" placeholder="父类名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="父类名称" prop="parentName"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.parentName" placeholder="父类名称"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
code: '', code: '',
name: '', name: '',
parentId: '', parentId: '',
parentName: '', parentName: '',
description: '', description: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
code: [ code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
], parentId: [{ required: true, message: '父类ID不能为空', trigger: 'blur' }],
name: [ parentName: [{ required: true, message: '父类名称不能为空', trigger: 'blur' }],
{ required: true, message: '名称不能为空', trigger: 'blur' } description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
], enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
parentId: [ remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
{ required: true, message: '父类ID不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
parentName: [ creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '父类名称不能为空', trigger: 'blur' } createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
], updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
description: [ updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
], version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
enabled: [ }
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } }
], },
remark: [ methods: {
{ required: true, message: '备注不能为空', trigger: 'blur' } init(id) {
], this.dataForm.id = id || 0
valid: [ this.visible = true
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.$nextTick(() => {
], this.$refs['dataForm'].resetFields()
creatorId: [ if (this.dataForm.id) {
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.$http({
], url: this.$http.adornUrl(`/monitoring/equipmentype/info/${this.dataForm.id}`),
creatorName: [ method: 'get',
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } params: this.$http.adornParams()
], }).then(({ data }) => {
createTime: [ if (data && data.code === 0) {
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.code = data.equipmentype.code
], this.dataForm.name = data.equipmentype.name
updaterId: [ this.dataForm.parentId = data.equipmentype.parentId
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.parentName = data.equipmentype.parentName
], this.dataForm.description = data.equipmentype.description
updaterName: [ this.dataForm.enabled = data.equipmentype.enabled
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.remark = data.equipmentype.remark
], this.dataForm.valid = data.equipmentype.valid
updateTime: [ this.dataForm.creatorId = data.equipmentype.creatorId
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.creatorName = data.equipmentype.creatorName
], this.dataForm.createTime = data.equipmentype.createTime
version: [ this.dataForm.updaterId = data.equipmentype.updaterId
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updaterName = data.equipmentype.updaterName
] this.dataForm.updateTime = data.equipmentype.updateTime
} this.dataForm.version = data.equipmentype.version
} }
}, })
methods: { }
init (id) { })
this.dataForm.id = id || 0 },
this.visible = true //
this.$nextTick(() => { dataFormSubmit() {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].validate(valid => {
if (this.dataForm.id) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/monitoring/equipmentype/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/monitoring/equipmentype/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'get', method: 'post',
params: this.$http.adornParams() data: this.$http.adornData({
}).then(({data}) => { id: this.dataForm.id || undefined,
if (data && data.code === 0) { code: this.dataForm.code,
this.dataForm.code = data.equipmentype.code name: this.dataForm.name,
this.dataForm.name = data.equipmentype.name parentId: this.dataForm.parentId,
this.dataForm.parentId = data.equipmentype.parentId parentName: this.dataForm.parentName,
this.dataForm.parentName = data.equipmentype.parentName description: this.dataForm.description,
this.dataForm.description = data.equipmentype.description enabled: this.dataForm.enabled,
this.dataForm.enabled = data.equipmentype.enabled remark: this.dataForm.remark,
this.dataForm.remark = data.equipmentype.remark valid: this.dataForm.valid,
this.dataForm.valid = data.equipmentype.valid creatorId: this.dataForm.creatorId,
this.dataForm.creatorId = data.equipmentype.creatorId creatorName: this.dataForm.creatorName,
this.dataForm.creatorName = data.equipmentype.creatorName createTime: this.dataForm.createTime,
this.dataForm.createTime = data.equipmentype.createTime updaterId: this.dataForm.updaterId,
this.dataForm.updaterId = data.equipmentype.updaterId updaterName: this.dataForm.updaterName,
this.dataForm.updaterName = data.equipmentype.updaterName updateTime: this.dataForm.updateTime,
this.dataForm.updateTime = data.equipmentype.updateTime version: this.dataForm.version
this.dataForm.version = data.equipmentype.version })
} }).then(({ data }) => {
}) if (data && data.code === 0) {
} this.$message({
}) message: '操作成功',
}, type: 'success',
// duration: 1500,
dataFormSubmit () { onClose: () => {
this.$refs['dataForm'].validate((valid) => { this.visible = false
if (valid) { this.$emit('refreshDataList')
this.$http({ }
url: this.$http.adornUrl(`/monitoring/equipmentype/${!this.dataForm.id ? 'save' : 'update'}`), })
method: 'post', } else {
data: this.$http.adornData({ this.$message.error(data.msg)
'id': this.dataForm.id || undefined, }
'code': this.dataForm.code, })
'name': this.dataForm.name, }
'parentId': this.dataForm.parentId, })
'parentName': this.dataForm.parentName, }
'description': this.dataForm.description, }
'enabled': this.dataForm.enabled, }
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,219 +1,184 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="设备类型ID" prop="equipmentTypeId">
:visible.sync="visible"> <el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型ID"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="设备类型ID" prop="equipmentTypeId"> <el-form-item label="文件ID" prop="fileId">
<el-input v-model="dataForm.equipmentTypeId" placeholder="设备类型ID"></el-input> <el-input v-model="dataForm.fileId" placeholder="文件ID"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件ID" prop="fileId"> <el-form-item label="文件类型编码" prop="typeCode">
<el-input v-model="dataForm.fileId" placeholder="文件ID"></el-input> <el-input v-model="dataForm.typeCode" placeholder="文件类型编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件类型编码" prop="typeCode"> <el-form-item label="文件名称" prop="fileName">
<el-input v-model="dataForm.typeCode" placeholder="文件类型编码"></el-input> <el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件名称" prop="fileName"> <el-form-item label="下载地址" prop="fileUrl">
<el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input> <el-input v-model="dataForm.fileUrl" placeholder="下载地址"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="下载地址" prop="fileUrl"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.fileUrl" placeholder="下载地址"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
equipmentTypeId: '', equipmentTypeId: '',
fileId: '', fileId: '',
typeCode: '', typeCode: '',
fileName: '', fileName: '',
fileUrl: '', fileUrl: '',
description: '', description: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
equipmentTypeId: [ equipmentTypeId: [{ required: true, message: '设备类型ID不能为空', trigger: 'blur' }],
{ required: true, message: '设备类型ID不能为空', trigger: 'blur' } fileId: [{ required: true, message: '文件ID不能为空', trigger: 'blur' }],
], typeCode: [{ required: true, message: '文件类型编码不能为空', trigger: 'blur' }],
fileId: [ fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
{ required: true, message: '文件ID不能为空', trigger: 'blur' } fileUrl: [{ required: true, message: '下载地址不能为空', trigger: 'blur' }],
], description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
typeCode: [ enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
{ required: true, message: '文件类型编码不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
fileName: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '文件名称不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
fileUrl: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '下载地址不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
description: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
{ required: true, message: '描述不能为空', trigger: 'blur' } }
], }
enabled: [ },
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } methods: {
], init(id) {
remark: [ this.dataForm.id = id || 0
{ required: true, message: '备注不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
valid: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
creatorId: [ url: this.$http.adornUrl(`/monitoring/equipmentypefile/info/${this.dataForm.id}`),
{ required: true, message: '创建人不能为空', trigger: 'blur' } method: 'get',
], params: this.$http.adornParams()
creatorName: [ }).then(({ data }) => {
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } if (data && data.code === 0) {
], this.dataForm.equipmentTypeId = data.equipmentypeFile.equipmentTypeId
createTime: [ this.dataForm.fileId = data.equipmentypeFile.fileId
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.typeCode = data.equipmentypeFile.typeCode
], this.dataForm.fileName = data.equipmentypeFile.fileName
updaterId: [ this.dataForm.fileUrl = data.equipmentypeFile.fileUrl
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.description = data.equipmentypeFile.description
], this.dataForm.enabled = data.equipmentypeFile.enabled
updaterName: [ this.dataForm.remark = data.equipmentypeFile.remark
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.valid = data.equipmentypeFile.valid
], this.dataForm.creatorId = data.equipmentypeFile.creatorId
updateTime: [ this.dataForm.creatorName = data.equipmentypeFile.creatorName
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.createTime = data.equipmentypeFile.createTime
], this.dataForm.updaterId = data.equipmentypeFile.updaterId
version: [ this.dataForm.updaterName = data.equipmentypeFile.updaterName
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updateTime = data.equipmentypeFile.updateTime
] this.dataForm.version = data.equipmentypeFile.version
} }
} })
}, }
methods: { })
init (id) { },
this.dataForm.id = id || 0 //
this.visible = true dataFormSubmit() {
this.$nextTick(() => { this.$refs['dataForm'].validate(valid => {
this.$refs['dataForm'].resetFields() if (valid) {
if (this.dataForm.id) { this.$http({
this.$http({ url: this.$http.adornUrl(`/monitoring/equipmentypefile/${!this.dataForm.id ? 'save' : 'update'}`),
url: this.$http.adornUrl(`/monitoring/equipmentypefile/info/${this.dataForm.id}`), method: 'post',
method: 'get', data: this.$http.adornData({
params: this.$http.adornParams() id: this.dataForm.id || undefined,
}).then(({data}) => { equipmentTypeId: this.dataForm.equipmentTypeId,
if (data && data.code === 0) { fileId: this.dataForm.fileId,
this.dataForm.equipmentTypeId = data.equipmentypeFile.equipmentTypeId typeCode: this.dataForm.typeCode,
this.dataForm.fileId = data.equipmentypeFile.fileId fileName: this.dataForm.fileName,
this.dataForm.typeCode = data.equipmentypeFile.typeCode fileUrl: this.dataForm.fileUrl,
this.dataForm.fileName = data.equipmentypeFile.fileName description: this.dataForm.description,
this.dataForm.fileUrl = data.equipmentypeFile.fileUrl enabled: this.dataForm.enabled,
this.dataForm.description = data.equipmentypeFile.description remark: this.dataForm.remark,
this.dataForm.enabled = data.equipmentypeFile.enabled valid: this.dataForm.valid,
this.dataForm.remark = data.equipmentypeFile.remark creatorId: this.dataForm.creatorId,
this.dataForm.valid = data.equipmentypeFile.valid creatorName: this.dataForm.creatorName,
this.dataForm.creatorId = data.equipmentypeFile.creatorId createTime: this.dataForm.createTime,
this.dataForm.creatorName = data.equipmentypeFile.creatorName updaterId: this.dataForm.updaterId,
this.dataForm.createTime = data.equipmentypeFile.createTime updaterName: this.dataForm.updaterName,
this.dataForm.updaterId = data.equipmentypeFile.updaterId updateTime: this.dataForm.updateTime,
this.dataForm.updaterName = data.equipmentypeFile.updaterName version: this.dataForm.version
this.dataForm.updateTime = data.equipmentypeFile.updateTime })
this.dataForm.version = data.equipmentypeFile.version }).then(({ data }) => {
} if (data && data.code === 0) {
}) this.$message({
} message: '操作成功',
}) type: 'success',
}, duration: 1500,
// onClose: () => {
dataFormSubmit () { this.visible = false
this.$refs['dataForm'].validate((valid) => { this.$emit('refreshDataList')
if (valid) { }
this.$http({ })
url: this.$http.adornUrl(`/monitoring/equipmentypefile/${!this.dataForm.id ? 'save' : 'update'}`), } else {
method: 'post', this.$message.error(data.msg)
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, })
'equipmentTypeId': this.dataForm.equipmentTypeId, }
'fileId': this.dataForm.fileId, })
'typeCode': this.dataForm.typeCode, }
'fileName': this.dataForm.fileName, }
'fileUrl': this.dataForm.fileUrl, }
'description': this.dataForm.description,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,210 +1,177 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="工厂编码" prop="code">
:visible.sync="visible"> <el-input v-model="dataForm.code" placeholder="工厂编码"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="工厂编码" prop="code"> <el-form-item label="工厂名称" prop="name">
<el-input v-model="dataForm.code" placeholder="工厂编码"></el-input> <el-input v-model="dataForm.name" placeholder="工厂名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="工厂名称" prop="name"> <el-form-item label="地址" prop="address">
<el-input v-model="dataForm.name" placeholder="工厂名称"></el-input> <el-input v-model="dataForm.address" placeholder="地址"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="地址" prop="address"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.address" placeholder="地址"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="外部系统编码" prop="externalCode">
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部系统编码" prop="externalCode"> </el-form>
<el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
code: '', code: '',
name: '', name: '',
address: '', address: '',
description: '', description: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '', version: '',
externalCode: '' externalCode: ''
}, },
dataRule: { dataRule: {
code: [ code: [{ required: true, message: '工厂编码不能为空', trigger: 'blur' }],
{ required: true, message: '工厂编码不能为空', trigger: 'blur' } name: [{ required: true, message: '工厂名称不能为空', trigger: 'blur' }],
], address: [{ required: true, message: '地址不能为空', trigger: 'blur' }],
name: [ description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
{ required: true, message: '工厂名称不能为空', trigger: 'blur' } enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
], remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
address: [ valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
{ required: true, message: '地址不能为空', trigger: 'blur' } creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
], creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
description: [ createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
], updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
enabled: [ updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
], externalCode: [{ required: true, message: '外部系统编码不能为空', trigger: 'blur' }]
remark: [ }
{ required: true, message: '备注不能为空', trigger: 'blur' } }
], },
valid: [ methods: {
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } init(id) {
], this.dataForm.id = id || 0
creatorId: [ this.visible = true
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.$nextTick(() => {
], this.$refs['dataForm'].resetFields()
creatorName: [ if (this.dataForm.id) {
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.$http({
], url: this.$http.adornUrl(`/monitoring/factory/info/${this.dataForm.id}`),
createTime: [ method: 'get',
{ required: true, message: '创建时间不能为空', trigger: 'blur' } params: this.$http.adornParams()
], }).then(({ data }) => {
updaterId: [ if (data && data.code === 0) {
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.code = data.factory.code
], this.dataForm.name = data.factory.name
updaterName: [ this.dataForm.address = data.factory.address
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.description = data.factory.description
], this.dataForm.enabled = data.factory.enabled
updateTime: [ this.dataForm.remark = data.factory.remark
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.valid = data.factory.valid
], this.dataForm.creatorId = data.factory.creatorId
version: [ this.dataForm.creatorName = data.factory.creatorName
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.createTime = data.factory.createTime
], this.dataForm.updaterId = data.factory.updaterId
externalCode: [ this.dataForm.updaterName = data.factory.updaterName
{ required: true, message: '外部系统编码不能为空', trigger: 'blur' } this.dataForm.updateTime = data.factory.updateTime
] this.dataForm.version = data.factory.version
} this.dataForm.externalCode = data.factory.externalCode
} }
}, })
methods: { }
init (id) { })
this.dataForm.id = id || 0 },
this.visible = true //
this.$nextTick(() => { dataFormSubmit() {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].validate(valid => {
if (this.dataForm.id) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/monitoring/factory/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/monitoring/factory/${!this.dataForm.id ? 'save' : 'update'}`),
method: 'get', method: 'post',
params: this.$http.adornParams() data: this.$http.adornData({
}).then(({data}) => { id: this.dataForm.id || undefined,
if (data && data.code === 0) { code: this.dataForm.code,
this.dataForm.code = data.factory.code name: this.dataForm.name,
this.dataForm.name = data.factory.name address: this.dataForm.address,
this.dataForm.address = data.factory.address description: this.dataForm.description,
this.dataForm.description = data.factory.description enabled: this.dataForm.enabled,
this.dataForm.enabled = data.factory.enabled remark: this.dataForm.remark,
this.dataForm.remark = data.factory.remark valid: this.dataForm.valid,
this.dataForm.valid = data.factory.valid creatorId: this.dataForm.creatorId,
this.dataForm.creatorId = data.factory.creatorId creatorName: this.dataForm.creatorName,
this.dataForm.creatorName = data.factory.creatorName createTime: this.dataForm.createTime,
this.dataForm.createTime = data.factory.createTime updaterId: this.dataForm.updaterId,
this.dataForm.updaterId = data.factory.updaterId updaterName: this.dataForm.updaterName,
this.dataForm.updaterName = data.factory.updaterName updateTime: this.dataForm.updateTime,
this.dataForm.updateTime = data.factory.updateTime version: this.dataForm.version,
this.dataForm.version = data.factory.version externalCode: this.dataForm.externalCode
this.dataForm.externalCode = data.factory.externalCode })
} }).then(({ data }) => {
}) if (data && data.code === 0) {
} this.$message({
}) message: '操作成功',
}, type: 'success',
// duration: 1500,
dataFormSubmit () { onClose: () => {
this.$refs['dataForm'].validate((valid) => { this.visible = false
if (valid) { this.$emit('refreshDataList')
this.$http({ }
url: this.$http.adornUrl(`/monitoring/factory/${!this.dataForm.id ? 'save' : 'update'}`), })
method: 'post', } else {
data: this.$http.adornData({ this.$message.error(data.msg)
'id': this.dataForm.id || undefined, }
'code': this.dataForm.code, })
'name': this.dataForm.name, }
'address': this.dataForm.address, })
'description': this.dataForm.description, }
'enabled': this.dataForm.enabled, }
'remark': this.dataForm.remark, }
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version,
'externalCode': this.dataForm.externalCode
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,247 +1,155 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:factory:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:factory:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:factory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:factory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="code" header-align="center" align="center" label="工厂编码"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="name" header-align="center" align="center" label="工厂名称"> </el-table-column>
style="width: 100%;"> <el-table-column prop="address" header-align="center" align="center" label="地址"> </el-table-column>
<el-table-column <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
type="selection" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
header-align="center" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
width="50"> <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
</el-table-column> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
<el-table-column <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
prop="id" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
header-align="center" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
label="id"> <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
</el-table-column> <el-table-column prop="externalCode" header-align="center" align="center" label="外部系统编码"> </el-table-column>
<el-table-column <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
prop="code" <template slot-scope="scope">
header-align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
label="工厂编码"> </template>
</el-table-column> </el-table-column>
<el-table-column </el-table>
prop="name" <el-pagination
header-align="center" @size-change="sizeChangeHandle"
align="center" @current-change="currentChangeHandle"
label="工厂名称"> :current-page="pageIndex"
</el-table-column> :page-sizes="[10, 20, 50, 100]"
<el-table-column :page-size="pageSize"
prop="address" :total="totalPage"
header-align="center" layout="total, sizes, prev, pager, next, jumper"
align="center" >
label="地址"> </el-pagination>
</el-table-column> <!-- 弹窗, 新增 / 修改 -->
<el-table-column <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
prop="description" </div>
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
prop="externalCode"
header-align="center"
align="center"
label="外部系统编码">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './factory-add-or-update' import AddOrUpdate from './factory-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/factory/page'), url: this.$http.adornUrl('/monitoring/factory/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.totalCount this.totalPage = data.data.totalCount
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/factory/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/factory/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,253 +1,156 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:producarrt:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:producarrt:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:producarrt:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:producarrt:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="name" header-align="center" align="center" label="名称"> </el-table-column>
style="width: 100%;"> <el-table-column prop="productId" header-align="center" align="center" label="产品id,关联产品表"> </el-table-column>
<el-table-column <el-table-column prop="value" header-align="center" align="center" label="属性值"> </el-table-column>
type="selection" <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
header-align="center" <el-table-column prop="externalCode" header-align="center" align="center" label="外部编码,用于对照外部系统的编码"> </el-table-column>
align="center" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
width="50"> <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
</el-table-column> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
<el-table-column <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
prop="id" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
header-align="center" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
label="ID"> <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
<el-table-column <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
prop="code" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
header-align="center" <template slot-scope="scope">
align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
label="编码"> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</el-table-column> </template>
<el-table-column </el-table-column>
prop="name" </el-table>
header-align="center" <el-pagination
align="center" @size-change="sizeChangeHandle"
label="名称"> @current-change="currentChangeHandle"
</el-table-column> :current-page="pageIndex"
<el-table-column :page-sizes="[10, 20, 50, 100]"
prop="productId" :page-size="pageSize"
header-align="center" :total="totalPage"
align="center" layout="total, sizes, prev, pager, next, jumper"
label="产品id,关联产品表"> >
</el-table-column> </el-pagination>
<el-table-column <!-- 弹窗, 新增 / 修改 -->
prop="value" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
header-align="center" </div>
align="center"
label="属性值">
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="externalCode"
header-align="center"
align="center"
label="外部编码,用于对照外部系统的编码">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './producarrt-add-or-update' import AddOrUpdate from './producarrt-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/producarrt/page'), url: this.$http.adornUrl('/monitoring/producarrt/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/producarrt/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/producarrt/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,219 +1,184 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="编码" prop="code">
:visible.sync="visible"> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="产品id,关联产品表" prop="productId">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.productId" placeholder="产品id,关联产品表"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="产品id,关联产品表" prop="productId"> <el-form-item label="属性值" prop="value">
<el-input v-model="dataForm.productId" placeholder="产品id,关联产品表"></el-input> <el-input v-model="dataForm.value" placeholder="属性值"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="属性值" prop="value"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.value" placeholder="属性值"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
code: '', code: '',
name: '', name: '',
productId: '', productId: '',
value: '', value: '',
description: '', description: '',
externalCode: '', externalCode: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
code: [ code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
], productId: [{ required: true, message: '产品id,关联产品表不能为空', trigger: 'blur' }],
name: [ value: [{ required: true, message: '属性值不能为空', trigger: 'blur' }],
{ required: true, message: '名称不能为空', trigger: 'blur' } description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
], externalCode: [{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' }],
productId: [ enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
{ required: true, message: '产品id,关联产品表不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
value: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '属性值不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
description: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
externalCode: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' } }
], }
enabled: [ },
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } methods: {
], init(id) {
remark: [ this.dataForm.id = id || 0
{ required: true, message: '备注不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
valid: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
creatorId: [ url: this.$http.adornUrl(`/monitoring/producarrt/info/${this.dataForm.id}`),
{ required: true, message: '创建人不能为空', trigger: 'blur' } method: 'get',
], params: this.$http.adornParams()
creatorName: [ }).then(({ data }) => {
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } if (data && data.code === 0) {
], this.dataForm.code = data.producarrt.code
createTime: [ this.dataForm.name = data.producarrt.name
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.productId = data.producarrt.productId
], this.dataForm.value = data.producarrt.value
updaterId: [ this.dataForm.description = data.producarrt.description
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.externalCode = data.producarrt.externalCode
], this.dataForm.enabled = data.producarrt.enabled
updaterName: [ this.dataForm.remark = data.producarrt.remark
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.valid = data.producarrt.valid
], this.dataForm.creatorId = data.producarrt.creatorId
updateTime: [ this.dataForm.creatorName = data.producarrt.creatorName
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.createTime = data.producarrt.createTime
], this.dataForm.updaterId = data.producarrt.updaterId
version: [ this.dataForm.updaterName = data.producarrt.updaterName
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updateTime = data.producarrt.updateTime
] this.dataForm.version = data.producarrt.version
} }
} })
}, }
methods: { })
init (id) { },
this.dataForm.id = id || 0 //
this.visible = true dataFormSubmit() {
this.$nextTick(() => { this.$refs['dataForm'].validate(valid => {
this.$refs['dataForm'].resetFields() if (valid) {
if (this.dataForm.id) { this.$http({
this.$http({ url: this.$http.adornUrl(`/monitoring/producarrt/${!this.dataForm.id ? 'save' : 'update'}`),
url: this.$http.adornUrl(`/monitoring/producarrt/info/${this.dataForm.id}`), method: 'post',
method: 'get', data: this.$http.adornData({
params: this.$http.adornParams() id: this.dataForm.id || undefined,
}).then(({data}) => { code: this.dataForm.code,
if (data && data.code === 0) { name: this.dataForm.name,
this.dataForm.code = data.producarrt.code productId: this.dataForm.productId,
this.dataForm.name = data.producarrt.name value: this.dataForm.value,
this.dataForm.productId = data.producarrt.productId description: this.dataForm.description,
this.dataForm.value = data.producarrt.value externalCode: this.dataForm.externalCode,
this.dataForm.description = data.producarrt.description enabled: this.dataForm.enabled,
this.dataForm.externalCode = data.producarrt.externalCode remark: this.dataForm.remark,
this.dataForm.enabled = data.producarrt.enabled valid: this.dataForm.valid,
this.dataForm.remark = data.producarrt.remark creatorId: this.dataForm.creatorId,
this.dataForm.valid = data.producarrt.valid creatorName: this.dataForm.creatorName,
this.dataForm.creatorId = data.producarrt.creatorId createTime: this.dataForm.createTime,
this.dataForm.creatorName = data.producarrt.creatorName updaterId: this.dataForm.updaterId,
this.dataForm.createTime = data.producarrt.createTime updaterName: this.dataForm.updaterName,
this.dataForm.updaterId = data.producarrt.updaterId updateTime: this.dataForm.updateTime,
this.dataForm.updaterName = data.producarrt.updaterName version: this.dataForm.version
this.dataForm.updateTime = data.producarrt.updateTime })
this.dataForm.version = data.producarrt.version }).then(({ data }) => {
} if (data && data.code === 0) {
}) this.$message({
} message: '操作成功',
}) type: 'success',
}, duration: 1500,
// onClose: () => {
dataFormSubmit () { this.visible = false
this.$refs['dataForm'].validate((valid) => { this.$emit('refreshDataList')
if (valid) { }
this.$http({ })
url: this.$http.adornUrl(`/monitoring/producarrt/${!this.dataForm.id ? 'save' : 'update'}`), } else {
method: 'post', this.$message.error(data.msg)
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, })
'code': this.dataForm.code, }
'name': this.dataForm.name, })
'productId': this.dataForm.productId, }
'value': this.dataForm.value, }
'description': this.dataForm.description, }
'externalCode': this.dataForm.externalCode,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,246 +1,205 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="编码" prop="code">
:visible.sync="visible"> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode"> <el-form-item label="规格" prop="specifications">
<el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input> <el-input v-model="dataForm.specifications" placeholder="规格"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="规格" prop="specifications"> <el-form-item label="单位value对应到数据字典label_value" prop="unitDictValue">
<el-input v-model="dataForm.specifications" placeholder="规格"></el-input> <el-input v-model="dataForm.unitDictValue" placeholder="单位value对应到数据字典label_value"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="单位value对应到数据字典label_value" prop="unitDictValue"> <el-form-item label="一单位的面积(平方米)" prop="area">
<el-input v-model="dataForm.unitDictValue" placeholder="单位value对应到数据字典label_value"></el-input> <el-input v-model="dataForm.area" placeholder="一单位的面积(平方米)"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="一单位的面积(平方米)" prop="area"> <el-form-item label="加工一单位产品需要的时间" prop="processTime">
<el-input v-model="dataForm.area" placeholder="一单位的面积(平方米)"></el-input> <el-input v-model="dataForm.processTime" placeholder="加工一单位产品需要的时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="加工一单位产品需要的时间" prop="processTime"> <el-form-item label="产品类型value对应到数据字典label_value" prop="typeDictValue">
<el-input v-model="dataForm.processTime" placeholder="加工一单位产品需要的时间"></el-input> <el-input v-model="dataForm.typeDictValue" placeholder="产品类型value对应到数据字典label_value"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="产品类型value对应到数据字典label_value" prop="typeDictValue"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.typeDictValue" placeholder="产品类型value对应到数据字典label_value"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
code: '', code: '',
name: '', name: '',
description: '', description: '',
externalCode: '', externalCode: '',
specifications: '', specifications: '',
unitDictValue: '', unitDictValue: '',
area: '', area: '',
processTime: '', processTime: '',
typeDictValue: '', typeDictValue: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
code: [ code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
], description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
name: [ externalCode: [{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' }],
{ required: true, message: '名称不能为空', trigger: 'blur' } specifications: [{ required: true, message: '规格不能为空', trigger: 'blur' }],
], unitDictValue: [{ required: true, message: '单位value对应到数据字典label_value不能为空', trigger: 'blur' }],
description: [ area: [{ required: true, message: '一单位的面积(平方米)不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } processTime: [{ required: true, message: '加工一单位产品需要的时间不能为空', trigger: 'blur' }],
], typeDictValue: [{ required: true, message: '产品类型value对应到数据字典label_value不能为空', trigger: 'blur' }],
externalCode: [ enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
specifications: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '规格不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
unitDictValue: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '单位value对应到数据字典label_value不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
area: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
{ required: true, message: '一单位的面积(平方米)不能为空', trigger: 'blur' } }
], }
processTime: [ },
{ required: true, message: '加工一单位产品需要的时间不能为空', trigger: 'blur' } methods: {
], init(id) {
typeDictValue: [ this.dataForm.id = id || 0
{ required: true, message: '产品类型value对应到数据字典label_value不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
enabled: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
remark: [ url: this.$http.adornUrl(`/monitoring/product/info/${this.dataForm.id}`),
{ required: true, message: '备注不能为空', trigger: 'blur' } method: 'get',
], params: this.$http.adornParams()
valid: [ }).then(({ data }) => {
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } if (data && data.code === 0) {
], this.dataForm.code = data.product.code
creatorId: [ this.dataForm.name = data.product.name
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.dataForm.description = data.product.description
], this.dataForm.externalCode = data.product.externalCode
creatorName: [ this.dataForm.specifications = data.product.specifications
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.unitDictValue = data.product.unitDictValue
], this.dataForm.area = data.product.area
createTime: [ this.dataForm.processTime = data.product.processTime
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.typeDictValue = data.product.typeDictValue
], this.dataForm.enabled = data.product.enabled
updaterId: [ this.dataForm.remark = data.product.remark
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.valid = data.product.valid
], this.dataForm.creatorId = data.product.creatorId
updaterName: [ this.dataForm.creatorName = data.product.creatorName
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.createTime = data.product.createTime
], this.dataForm.updaterId = data.product.updaterId
updateTime: [ this.dataForm.updaterName = data.product.updaterName
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.updateTime = data.product.updateTime
], this.dataForm.version = data.product.version
version: [ }
{ required: true, message: '版本号不能为空', trigger: 'blur' } })
] }
} })
} },
}, //
methods: { dataFormSubmit() {
init (id) { this.$refs['dataForm'].validate(valid => {
this.dataForm.id = id || 0 if (valid) {
this.visible = true this.$http({
this.$nextTick(() => { url: this.$http.adornUrl(`/monitoring/product/${!this.dataForm.id ? 'save' : 'update'}`),
this.$refs['dataForm'].resetFields() method: 'post',
if (this.dataForm.id) { data: this.$http.adornData({
this.$http({ id: this.dataForm.id || undefined,
url: this.$http.adornUrl(`/monitoring/product/info/${this.dataForm.id}`), code: this.dataForm.code,
method: 'get', name: this.dataForm.name,
params: this.$http.adornParams() description: this.dataForm.description,
}).then(({data}) => { externalCode: this.dataForm.externalCode,
if (data && data.code === 0) { specifications: this.dataForm.specifications,
this.dataForm.code = data.product.code unitDictValue: this.dataForm.unitDictValue,
this.dataForm.name = data.product.name area: this.dataForm.area,
this.dataForm.description = data.product.description processTime: this.dataForm.processTime,
this.dataForm.externalCode = data.product.externalCode typeDictValue: this.dataForm.typeDictValue,
this.dataForm.specifications = data.product.specifications enabled: this.dataForm.enabled,
this.dataForm.unitDictValue = data.product.unitDictValue remark: this.dataForm.remark,
this.dataForm.area = data.product.area valid: this.dataForm.valid,
this.dataForm.processTime = data.product.processTime creatorId: this.dataForm.creatorId,
this.dataForm.typeDictValue = data.product.typeDictValue creatorName: this.dataForm.creatorName,
this.dataForm.enabled = data.product.enabled createTime: this.dataForm.createTime,
this.dataForm.remark = data.product.remark updaterId: this.dataForm.updaterId,
this.dataForm.valid = data.product.valid updaterName: this.dataForm.updaterName,
this.dataForm.creatorId = data.product.creatorId updateTime: this.dataForm.updateTime,
this.dataForm.creatorName = data.product.creatorName version: this.dataForm.version
this.dataForm.createTime = data.product.createTime })
this.dataForm.updaterId = data.product.updaterId }).then(({ data }) => {
this.dataForm.updaterName = data.product.updaterName if (data && data.code === 0) {
this.dataForm.updateTime = data.product.updateTime this.$message({
this.dataForm.version = data.product.version message: '操作成功',
} type: 'success',
}) duration: 1500,
} onClose: () => {
}) this.visible = false
}, this.$emit('refreshDataList')
// }
dataFormSubmit () { })
this.$refs['dataForm'].validate((valid) => { } else {
if (valid) { this.$message.error(data.msg)
this.$http({ }
url: this.$http.adornUrl(`/monitoring/product/${!this.dataForm.id ? 'save' : 'update'}`), })
method: 'post', }
data: this.$http.adornData({ })
'id': this.dataForm.id || undefined, }
'code': this.dataForm.code, }
'name': this.dataForm.name, }
'description': this.dataForm.description,
'externalCode': this.dataForm.externalCode,
'specifications': this.dataForm.specifications,
'unitDictValue': this.dataForm.unitDictValue,
'area': this.dataForm.area,
'processTime': this.dataForm.processTime,
'typeDictValue': this.dataForm.typeDictValue,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,259 +1,157 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:productionline:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:productionline:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:productionline:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:productionline:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="factoryId" header-align="center" align="center" label="工厂表ID"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
style="width: 100%;"> <el-table-column prop="name" header-align="center" align="center" label="名称"> </el-table-column>
<el-table-column <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
type="selection" <el-table-column prop="status" header-align="center" align="center" label="产线状态"> </el-table-column>
header-align="center" <el-table-column prop="tvalue" header-align="center" align="center" label="每小时下片数量"> </el-table-column>
align="center" <el-table-column prop="externalCode" header-align="center" align="center" label="外部系统编码"> </el-table-column>
width="50"> <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
</el-table-column> <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
<el-table-column <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
prop="id" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
header-align="center" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
align="center" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
label="id"> <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
</el-table-column> <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
<el-table-column <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
prop="factoryId" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
header-align="center" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
align="center" <template slot-scope="scope">
label="工厂表ID"> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
</el-table-column> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
<el-table-column </template>
prop="code" </el-table-column>
header-align="center" </el-table>
align="center" <el-pagination
label="编码"> @size-change="sizeChangeHandle"
</el-table-column> @current-change="currentChangeHandle"
<el-table-column :current-page="pageIndex"
prop="name" :page-sizes="[10, 20, 50, 100]"
header-align="center" :page-size="pageSize"
align="center" :total="totalPage"
label="名称"> layout="total, sizes, prev, pager, next, jumper"
</el-table-column> >
<el-table-column </el-pagination>
prop="description" <!-- 弹窗, 新增 / 修改 -->
header-align="center" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
align="center" </div>
label="描述">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="产线状态">
</el-table-column>
<el-table-column
prop="tvalue"
header-align="center"
align="center"
label="每小时下片数量">
</el-table-column>
<el-table-column
prop="externalCode"
header-align="center"
align="center"
label="外部系统编码">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './productionline-add-or-update' import AddOrUpdate from './productionline-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/productionline/page'), url: this.$http.adornUrl('/monitoring/productionline/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/productionline/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/productionline/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,199 +1,149 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:productionlinerecsch:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:productionlinerecsch:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:productionlinerecsch:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:productionlinerecsch:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"
</el-form-item> >批量删除</el-button
</el-form> >
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
style="width: 100%;"> <el-table-column prop="productionLineId" header-align="center" align="center" label="产线id"> </el-table-column>
<el-table-column <el-table-column prop="inputNum" header-align="center" align="center" label="上一次记录时间至该条记录时间端内上片数量"> </el-table-column>
type="selection" <el-table-column prop="outputNum" header-align="center" align="center" label="上一次记录时间至该条记录时间端内下片数量"> </el-table-column>
header-align="center" <el-table-column prop="recordTime" header-align="center" align="center" label="记录时间"> </el-table-column>
align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
width="50"> <el-table-column prop="sumInputNum" header-align="center" align="center" label="该记录时间点的累计上片数量"> </el-table-column>
</el-table-column> <el-table-column prop="sumOutputNum" header-align="center" align="center" label="该记录时间点的累计下片数量"> </el-table-column>
<el-table-column <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
prop="id" <template slot-scope="scope">
header-align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
label="ID"> </template>
</el-table-column> </el-table-column>
<el-table-column </el-table>
prop="productionLineId" <el-pagination
header-align="center" @size-change="sizeChangeHandle"
align="center" @current-change="currentChangeHandle"
label="产线id"> :current-page="pageIndex"
</el-table-column> :page-sizes="[10, 20, 50, 100]"
<el-table-column :page-size="pageSize"
prop="inputNum" :total="totalPage"
header-align="center" layout="total, sizes, prev, pager, next, jumper"
align="center" >
label="上一次记录时间至该条记录时间端内上片数量"> </el-pagination>
</el-table-column> <!-- 弹窗, 新增 / 修改 -->
<el-table-column <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
prop="outputNum" </div>
header-align="center"
align="center"
label="上一次记录时间至该条记录时间端内下片数量">
</el-table-column>
<el-table-column
prop="recordTime"
header-align="center"
align="center"
label="记录时间">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="sumInputNum"
header-align="center"
align="center"
label="该记录时间点的累计上片数量">
</el-table-column>
<el-table-column
prop="sumOutputNum"
header-align="center"
align="center"
label="该记录时间点的累计下片数量">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './productionlinerecsch-add-or-update' import AddOrUpdate from './productionlinerecsch-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/productionlinerecsch/page'), url: this.$http.adornUrl('/monitoring/productionlinerecsch/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/productionlinerecsch/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/productionlinerecsch/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,228 +1,191 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="工厂表ID" prop="factoryId">
:visible.sync="visible"> <el-input v-model="dataForm.factoryId" placeholder="工厂表ID"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="工厂表ID" prop="factoryId"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.factoryId" placeholder="工厂表ID"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="产线状态" prop="status">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.status" placeholder="产线状态"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="产线状态" prop="status"> <el-form-item label="每小时下片数量" prop="tvalue">
<el-input v-model="dataForm.status" placeholder="产线状态"></el-input> <el-input v-model="dataForm.tvalue" placeholder="每小时下片数量"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="每小时下片数量" prop="tvalue"> <el-form-item label="外部系统编码" prop="externalCode">
<el-input v-model="dataForm.tvalue" placeholder="每小时下片数量"></el-input> <el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部系统编码" prop="externalCode"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
factoryId: '', factoryId: '',
code: '', code: '',
name: '', name: '',
description: '', description: '',
status: '', status: '',
tvalue: '', tvalue: '',
externalCode: '', externalCode: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
factoryId: [ factoryId: [{ required: true, message: '工厂表ID不能为空', trigger: 'blur' }],
{ required: true, message: '工厂表ID不能为空', trigger: 'blur' } code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
], name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
code: [ description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } status: [{ required: true, message: '产线状态不能为空', trigger: 'blur' }],
], tvalue: [{ required: true, message: '每小时下片数量不能为空', trigger: 'blur' }],
name: [ externalCode: [{ required: true, message: '外部系统编码不能为空', trigger: 'blur' }],
{ required: true, message: '名称不能为空', trigger: 'blur' } enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
], remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
description: [ valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
], creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
status: [ createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
{ required: true, message: '产线状态不能为空', trigger: 'blur' } updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
], updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
tvalue: [ updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
{ required: true, message: '每小时下片数量不能为空', trigger: 'blur' } version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
], }
externalCode: [ }
{ required: true, message: '外部系统编码不能为空', trigger: 'blur' } },
], methods: {
enabled: [ init(id) {
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
remark: [ this.$nextTick(() => {
{ required: true, message: '备注不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
valid: [ this.$http({
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/productionline/info/${this.dataForm.id}`),
], method: 'get',
creatorId: [ params: this.$http.adornParams()
{ required: true, message: '创建人不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
creatorName: [ this.dataForm.factoryId = data.productionLine.factoryId
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.code = data.productionLine.code
], this.dataForm.name = data.productionLine.name
createTime: [ this.dataForm.description = data.productionLine.description
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.status = data.productionLine.status
], this.dataForm.tvalue = data.productionLine.tvalue
updaterId: [ this.dataForm.externalCode = data.productionLine.externalCode
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.enabled = data.productionLine.enabled
], this.dataForm.remark = data.productionLine.remark
updaterName: [ this.dataForm.valid = data.productionLine.valid
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.creatorId = data.productionLine.creatorId
], this.dataForm.creatorName = data.productionLine.creatorName
updateTime: [ this.dataForm.createTime = data.productionLine.createTime
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.updaterId = data.productionLine.updaterId
], this.dataForm.updaterName = data.productionLine.updaterName
version: [ this.dataForm.updateTime = data.productionLine.updateTime
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.version = data.productionLine.version
] }
} })
} }
}, })
methods: { },
init (id) { //
this.dataForm.id = id || 0 dataFormSubmit() {
this.visible = true this.$refs['dataForm'].validate(valid => {
this.$nextTick(() => { if (valid) {
this.$refs['dataForm'].resetFields() this.$http({
if (this.dataForm.id) { url: this.$http.adornUrl(`/monitoring/productionline/${!this.dataForm.id ? 'save' : 'update'}`),
this.$http({ method: 'post',
url: this.$http.adornUrl(`/monitoring/productionline/info/${this.dataForm.id}`), data: this.$http.adornData({
method: 'get', id: this.dataForm.id || undefined,
params: this.$http.adornParams() factoryId: this.dataForm.factoryId,
}).then(({data}) => { code: this.dataForm.code,
if (data && data.code === 0) { name: this.dataForm.name,
this.dataForm.factoryId = data.productionLine.factoryId description: this.dataForm.description,
this.dataForm.code = data.productionLine.code status: this.dataForm.status,
this.dataForm.name = data.productionLine.name tvalue: this.dataForm.tvalue,
this.dataForm.description = data.productionLine.description externalCode: this.dataForm.externalCode,
this.dataForm.status = data.productionLine.status enabled: this.dataForm.enabled,
this.dataForm.tvalue = data.productionLine.tvalue remark: this.dataForm.remark,
this.dataForm.externalCode = data.productionLine.externalCode valid: this.dataForm.valid,
this.dataForm.enabled = data.productionLine.enabled creatorId: this.dataForm.creatorId,
this.dataForm.remark = data.productionLine.remark creatorName: this.dataForm.creatorName,
this.dataForm.valid = data.productionLine.valid createTime: this.dataForm.createTime,
this.dataForm.creatorId = data.productionLine.creatorId updaterId: this.dataForm.updaterId,
this.dataForm.creatorName = data.productionLine.creatorName updaterName: this.dataForm.updaterName,
this.dataForm.createTime = data.productionLine.createTime updateTime: this.dataForm.updateTime,
this.dataForm.updaterId = data.productionLine.updaterId version: this.dataForm.version
this.dataForm.updaterName = data.productionLine.updaterName })
this.dataForm.updateTime = data.productionLine.updateTime }).then(({ data }) => {
this.dataForm.version = data.productionLine.version if (data && data.code === 0) {
} this.$message({
}) message: '操作成功',
} type: 'success',
}) duration: 1500,
}, onClose: () => {
// this.visible = false
dataFormSubmit () { this.$emit('refreshDataList')
this.$refs['dataForm'].validate((valid) => { }
if (valid) { })
this.$http({ } else {
url: this.$http.adornUrl(`/monitoring/productionline/${!this.dataForm.id ? 'save' : 'update'}`), this.$message.error(data.msg)
method: 'post', }
data: this.$http.adornData({ })
'id': this.dataForm.id || undefined, }
'factoryId': this.dataForm.factoryId, })
'code': this.dataForm.code, }
'name': this.dataForm.name, }
'description': this.dataForm.description, }
'status': this.dataForm.status,
'tvalue': this.dataForm.tvalue,
'externalCode': this.dataForm.externalCode,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,138 +1,121 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="产线id" prop="productionLineId">
:visible.sync="visible"> <el-input v-model="dataForm.productionLineId" placeholder="产线id"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="产线id" prop="productionLineId"> <el-form-item label="上一次记录时间至该条记录时间端内上片数量" prop="inputNum">
<el-input v-model="dataForm.productionLineId" placeholder="产线id"></el-input> <el-input v-model="dataForm.inputNum" placeholder="上一次记录时间至该条记录时间端内上片数量"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上一次记录时间至该条记录时间端内上片数量" prop="inputNum"> <el-form-item label="上一次记录时间至该条记录时间端内下片数量" prop="outputNum">
<el-input v-model="dataForm.inputNum" placeholder="上一次记录时间至该条记录时间端内上片数量"></el-input> <el-input v-model="dataForm.outputNum" placeholder="上一次记录时间至该条记录时间端内下片数量"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="上一次记录时间至该条记录时间端内下片数量" prop="outputNum"> <el-form-item label="记录时间" prop="recordTime">
<el-input v-model="dataForm.outputNum" placeholder="上一次记录时间至该条记录时间端内下片数量"></el-input> <el-input v-model="dataForm.recordTime" placeholder="记录时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="记录时间" prop="recordTime"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.recordTime" placeholder="记录时间"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.sumInputNum" placeholder="该记录时间点的累计上片数量"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="该记录时间点的累计上片数量" prop="sumInputNum"> <el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum">
<el-input v-model="dataForm.sumInputNum" placeholder="该记录时间点的累计上片数量"></el-input> <el-input v-model="dataForm.sumOutputNum" placeholder="该记录时间点的累计下片数量"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="该记录时间点的累计下片数量" prop="sumOutputNum"> </el-form>
<el-input v-model="dataForm.sumOutputNum" placeholder="该记录时间点的累计下片数量"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
productionLineId: '', productionLineId: '',
inputNum: '', inputNum: '',
outputNum: '', outputNum: '',
recordTime: '', recordTime: '',
valid: '', valid: '',
sumInputNum: '', sumInputNum: '',
sumOutputNum: '' sumOutputNum: ''
}, },
dataRule: { dataRule: {
productionLineId: [ productionLineId: [{ required: true, message: '产线id不能为空', trigger: 'blur' }],
{ required: true, message: '产线id不能为空', trigger: 'blur' } inputNum: [{ required: true, message: '上一次记录时间至该条记录时间端内上片数量不能为空', trigger: 'blur' }],
], outputNum: [{ required: true, message: '上一次记录时间至该条记录时间端内下片数量不能为空', trigger: 'blur' }],
inputNum: [ recordTime: [{ required: true, message: '记录时间不能为空', trigger: 'blur' }],
{ required: true, message: '上一次记录时间至该条记录时间端内上片数量不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], sumInputNum: [{ required: true, message: '该记录时间点的累计上片数量不能为空', trigger: 'blur' }],
outputNum: [ sumOutputNum: [{ required: true, message: '该记录时间点的累计下片数量不能为空', trigger: 'blur' }]
{ required: true, message: '上一次记录时间至该条记录时间端内下片数量不能为空', trigger: 'blur' } }
], }
recordTime: [ },
{ required: true, message: '记录时间不能为空', trigger: 'blur' } methods: {
], init(id) {
valid: [ this.dataForm.id = id || 0
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
sumInputNum: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '该记录时间点的累计上片数量不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
sumOutputNum: [ url: this.$http.adornUrl(`/monitoring/productionlinerecsch/info/${this.dataForm.id}`),
{ required: true, message: '该记录时间点的累计下片数量不能为空', trigger: 'blur' } method: 'get',
] params: this.$http.adornParams()
} }).then(({ data }) => {
} if (data && data.code === 0) {
}, this.dataForm.productionLineId = data.productionLineRecSch.productionLineId
methods: { this.dataForm.inputNum = data.productionLineRecSch.inputNum
init (id) { this.dataForm.outputNum = data.productionLineRecSch.outputNum
this.dataForm.id = id || 0 this.dataForm.recordTime = data.productionLineRecSch.recordTime
this.visible = true this.dataForm.valid = data.productionLineRecSch.valid
this.$nextTick(() => { this.dataForm.sumInputNum = data.productionLineRecSch.sumInputNum
this.$refs['dataForm'].resetFields() this.dataForm.sumOutputNum = data.productionLineRecSch.sumOutputNum
if (this.dataForm.id) { }
this.$http({ })
url: this.$http.adornUrl(`/monitoring/productionlinerecsch/info/${this.dataForm.id}`), }
method: 'get', })
params: this.$http.adornParams() },
}).then(({data}) => { //
if (data && data.code === 0) { dataFormSubmit() {
this.dataForm.productionLineId = data.productionLineRecSch.productionLineId this.$refs['dataForm'].validate(valid => {
this.dataForm.inputNum = data.productionLineRecSch.inputNum if (valid) {
this.dataForm.outputNum = data.productionLineRecSch.outputNum this.$http({
this.dataForm.recordTime = data.productionLineRecSch.recordTime url: this.$http.adornUrl(`/monitoring/productionlinerecsch/${!this.dataForm.id ? 'save' : 'update'}`),
this.dataForm.valid = data.productionLineRecSch.valid method: 'post',
this.dataForm.sumInputNum = data.productionLineRecSch.sumInputNum data: this.$http.adornData({
this.dataForm.sumOutputNum = data.productionLineRecSch.sumOutputNum id: this.dataForm.id || undefined,
} productionLineId: this.dataForm.productionLineId,
}) inputNum: this.dataForm.inputNum,
} outputNum: this.dataForm.outputNum,
}) recordTime: this.dataForm.recordTime,
}, valid: this.dataForm.valid,
// sumInputNum: this.dataForm.sumInputNum,
dataFormSubmit () { sumOutputNum: this.dataForm.sumOutputNum
this.$refs['dataForm'].validate((valid) => { })
if (valid) { }).then(({ data }) => {
this.$http({ if (data && data.code === 0) {
url: this.$http.adornUrl(`/monitoring/productionlinerecsch/${!this.dataForm.id ? 'save' : 'update'}`), this.$message({
method: 'post', message: '操作成功',
data: this.$http.adornData({ type: 'success',
'id': this.dataForm.id || undefined, duration: 1500,
'productionLineId': this.dataForm.productionLineId, onClose: () => {
'inputNum': this.dataForm.inputNum, this.visible = false
'outputNum': this.dataForm.outputNum, this.$emit('refreshDataList')
'recordTime': this.dataForm.recordTime, }
'valid': this.dataForm.valid, })
'sumInputNum': this.dataForm.sumInputNum, } else {
'sumOutputNum': this.dataForm.sumOutputNum this.$message.error(data.msg)
}) }
}).then(({data}) => { })
if (data && data.code === 0) { }
this.$message({ })
message: '操作成功', }
type: 'success', }
duration: 1500, }
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,229 +1,154 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:qualityinspectiondet:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:qualityinspectiondet:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:qualityinspectiondet:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:qualityinspectiondet:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"
</el-form-item> >批量删除</el-button
</el-form> >
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
style="width: 100%;"> <el-table-column prop="typeId" header-align="center" align="center" label="检测类型id"> </el-table-column>
<el-table-column <el-table-column prop="content" header-align="center" align="center" label="检测内容"> </el-table-column>
type="selection" <el-table-column prop="code" header-align="center" align="center" label="检测编码"> </el-table-column>
header-align="center" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
width="50"> <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
</el-table-column> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
<el-table-column <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
prop="id" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
header-align="center" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
label="ID"> <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
</el-table-column> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<el-table-column <template slot-scope="scope">
prop="typeId" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
header-align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
align="center" </template>
label="检测类型id"> </el-table-column>
</el-table-column> </el-table>
<el-table-column <el-pagination
prop="content" @size-change="sizeChangeHandle"
header-align="center" @current-change="currentChangeHandle"
align="center" :current-page="pageIndex"
label="检测内容"> :page-sizes="[10, 20, 50, 100]"
</el-table-column> :page-size="pageSize"
<el-table-column :total="totalPage"
prop="code" layout="total, sizes, prev, pager, next, jumper"
header-align="center" >
align="center" </el-pagination>
label="检测编码"> <!-- 弹窗, 新增 / 修改 -->
</el-table-column> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-table-column </div>
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './qualityinspectiondet-add-or-update' import AddOrUpdate from './qualityinspectiondet-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/qualityinspectiondet/page'), url: this.$http.adornUrl('/monitoring/qualityinspectiondet/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/qualityinspectiondet/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/qualityinspectiondet/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,259 +1,159 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:qualityinspectionrecord:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:qualityinspectionrecord:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:qualityinspectionrecord:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:qualityinspectionrecord:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"
</el-form-item> >批量删除</el-button
</el-form> >
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
style="width: 100%;"> <el-table-column prop="inspectionDetId" header-align="center" align="center" label="检测内容id"> </el-table-column>
<el-table-column <el-table-column prop="inspectionDetContent" header-align="center" align="center" label="检测内容设备推送消息时可能无对应id只填这个字段"> </el-table-column>
type="selection" <el-table-column prop="productionId" header-align="center" align="center" label="产线id"> </el-table-column>
header-align="center" <el-table-column prop="sectionId" header-align="center" align="center" label="工段id"> </el-table-column>
align="center" <el-table-column prop="checkPerson" header-align="center" align="center" label="检测人员,可以多个"> </el-table-column>
width="50"> <el-table-column prop="checkTime" header-align="center" align="center" label="检测时间"> </el-table-column>
</el-table-column> <el-table-column prop="source" header-align="center" align="center" label="来源 1手动默认 2自动"> </el-table-column>
<el-table-column <el-table-column prop="explainText" header-align="center" align="center" label="描述"> </el-table-column>
prop="id" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
header-align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
label="ID"> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
<el-table-column <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
prop="inspectionDetId" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
header-align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
label="检测内容id"> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
</el-table-column> <template slot-scope="scope">
<el-table-column <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
prop="inspectionDetContent" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
header-align="center" </template>
align="center" </el-table-column>
label="检测内容设备推送消息时可能无对应id只填这个字段"> </el-table>
</el-table-column> <el-pagination
<el-table-column @size-change="sizeChangeHandle"
prop="productionId" @current-change="currentChangeHandle"
header-align="center" :current-page="pageIndex"
align="center" :page-sizes="[10, 20, 50, 100]"
label="产线id"> :page-size="pageSize"
</el-table-column> :total="totalPage"
<el-table-column layout="total, sizes, prev, pager, next, jumper"
prop="sectionId" >
header-align="center" </el-pagination>
align="center" <!-- 弹窗, 新增 / 修改 -->
label="工段id"> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</el-table-column> </div>
<el-table-column
prop="checkPerson"
header-align="center"
align="center"
label="检测人员,可以多个">
</el-table-column>
<el-table-column
prop="checkTime"
header-align="center"
align="center"
label="检测时间">
</el-table-column>
<el-table-column
prop="source"
header-align="center"
align="center"
label="来源 1手动默认 2自动">
</el-table-column>
<el-table-column
prop="explainText"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './qualityinspectionrecord-add-or-update' import AddOrUpdate from './qualityinspectionrecord-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/qualityinspectionrecord/page'), url: this.$http.adornUrl('/monitoring/qualityinspectionrecord/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/qualityinspectionrecord/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/qualityinspectionrecord/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,223 +1,153 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:qualityinspectiontype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:qualityinspectiontype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:qualityinspectiontype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:qualityinspectiontype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"
</el-form-item> >批量删除</el-button
</el-form> >
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
style="width: 100%;"> <el-table-column prop="name" header-align="center" align="center" label="检测类型名称"> </el-table-column>
<el-table-column <el-table-column prop="code" header-align="center" align="center" label="检测类型编码"> </el-table-column>
type="selection" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
header-align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
width="50"> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
<el-table-column <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
prop="id" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
header-align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
label="ID"> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
</el-table-column> <template slot-scope="scope">
<el-table-column <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
prop="name" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
header-align="center" </template>
align="center" </el-table-column>
label="检测类型名称"> </el-table>
</el-table-column> <el-pagination
<el-table-column @size-change="sizeChangeHandle"
prop="code" @current-change="currentChangeHandle"
header-align="center" :current-page="pageIndex"
align="center" :page-sizes="[10, 20, 50, 100]"
label="检测类型编码"> :page-size="pageSize"
</el-table-column> :total="totalPage"
<el-table-column layout="total, sizes, prev, pager, next, jumper"
prop="remark" >
header-align="center" </el-pagination>
align="center" <!-- 弹窗, 新增 / 修改 -->
label="备注"> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</el-table-column> </div>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './qualityinspectiontype-add-or-update' import AddOrUpdate from './qualityinspectiontype-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/qualityinspectiontype/page'), url: this.$http.adornUrl('/monitoring/qualityinspectiontype/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/qualityinspectiontype/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/qualityinspectiontype/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,183 +1,156 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="检测类型id" prop="typeId">
:visible.sync="visible"> <el-input v-model="dataForm.typeId" placeholder="检测类型id"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="检测类型id" prop="typeId"> <el-form-item label="检测内容" prop="content">
<el-input v-model="dataForm.typeId" placeholder="检测类型id"></el-input> <el-input v-model="dataForm.content" placeholder="检测内容"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检测内容" prop="content"> <el-form-item label="检测编码" prop="code">
<el-input v-model="dataForm.content" placeholder="检测内容"></el-input> <el-input v-model="dataForm.code" placeholder="检测编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检测编码" prop="code"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.code" placeholder="检测编码"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
typeId: '', typeId: '',
content: '', content: '',
code: '', code: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
typeId: [ typeId: [{ required: true, message: '检测类型id不能为空', trigger: 'blur' }],
{ required: true, message: '检测类型id不能为空', trigger: 'blur' } content: [{ required: true, message: '检测内容不能为空', trigger: 'blur' }],
], code: [{ required: true, message: '检测编码不能为空', trigger: 'blur' }],
content: [ remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
{ required: true, message: '检测内容不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
code: [ creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '检测编码不能为空', trigger: 'blur' } createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
], updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
remark: [ updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '备注不能为空', trigger: 'blur' } updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
], version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
valid: [ }
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } }
], },
creatorId: [ methods: {
{ required: true, message: '创建人不能为空', trigger: 'blur' } init(id) {
], this.dataForm.id = id || 0
creatorName: [ this.visible = true
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.$nextTick(() => {
], this.$refs['dataForm'].resetFields()
createTime: [ if (this.dataForm.id) {
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.$http({
], url: this.$http.adornUrl(`/monitoring/qualityinspectiondet/info/${this.dataForm.id}`),
updaterId: [ method: 'get',
{ required: true, message: '更新人不能为空', trigger: 'blur' } params: this.$http.adornParams()
], }).then(({ data }) => {
updaterName: [ if (data && data.code === 0) {
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.typeId = data.qualityInspectionDet.typeId
], this.dataForm.content = data.qualityInspectionDet.content
updateTime: [ this.dataForm.code = data.qualityInspectionDet.code
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.remark = data.qualityInspectionDet.remark
], this.dataForm.valid = data.qualityInspectionDet.valid
version: [ this.dataForm.creatorId = data.qualityInspectionDet.creatorId
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.creatorName = data.qualityInspectionDet.creatorName
] this.dataForm.createTime = data.qualityInspectionDet.createTime
} this.dataForm.updaterId = data.qualityInspectionDet.updaterId
} this.dataForm.updaterName = data.qualityInspectionDet.updaterName
}, this.dataForm.updateTime = data.qualityInspectionDet.updateTime
methods: { this.dataForm.version = data.qualityInspectionDet.version
init (id) { }
this.dataForm.id = id || 0 })
this.visible = true }
this.$nextTick(() => { })
this.$refs['dataForm'].resetFields() },
if (this.dataForm.id) { //
this.$http({ dataFormSubmit() {
url: this.$http.adornUrl(`/monitoring/qualityinspectiondet/info/${this.dataForm.id}`), this.$refs['dataForm'].validate(valid => {
method: 'get', if (valid) {
params: this.$http.adornParams() this.$http({
}).then(({data}) => { url: this.$http.adornUrl(`/monitoring/qualityinspectiondet/${!this.dataForm.id ? 'save' : 'update'}`),
if (data && data.code === 0) { method: 'post',
this.dataForm.typeId = data.qualityInspectionDet.typeId data: this.$http.adornData({
this.dataForm.content = data.qualityInspectionDet.content id: this.dataForm.id || undefined,
this.dataForm.code = data.qualityInspectionDet.code typeId: this.dataForm.typeId,
this.dataForm.remark = data.qualityInspectionDet.remark content: this.dataForm.content,
this.dataForm.valid = data.qualityInspectionDet.valid code: this.dataForm.code,
this.dataForm.creatorId = data.qualityInspectionDet.creatorId remark: this.dataForm.remark,
this.dataForm.creatorName = data.qualityInspectionDet.creatorName valid: this.dataForm.valid,
this.dataForm.createTime = data.qualityInspectionDet.createTime creatorId: this.dataForm.creatorId,
this.dataForm.updaterId = data.qualityInspectionDet.updaterId creatorName: this.dataForm.creatorName,
this.dataForm.updaterName = data.qualityInspectionDet.updaterName createTime: this.dataForm.createTime,
this.dataForm.updateTime = data.qualityInspectionDet.updateTime updaterId: this.dataForm.updaterId,
this.dataForm.version = data.qualityInspectionDet.version updaterName: this.dataForm.updaterName,
} updateTime: this.dataForm.updateTime,
}) version: this.dataForm.version
} })
}) }).then(({ data }) => {
}, if (data && data.code === 0) {
// this.$message({
dataFormSubmit () { message: '操作成功',
this.$refs['dataForm'].validate((valid) => { type: 'success',
if (valid) { duration: 1500,
this.$http({ onClose: () => {
url: this.$http.adornUrl(`/monitoring/qualityinspectiondet/${!this.dataForm.id ? 'save' : 'update'}`), this.visible = false
method: 'post', this.$emit('refreshDataList')
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, })
'typeId': this.dataForm.typeId, } else {
'content': this.dataForm.content, this.$message.error(data.msg)
'code': this.dataForm.code, }
'remark': this.dataForm.remark, })
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId, })
'creatorName': this.dataForm.creatorName, }
'createTime': this.dataForm.createTime, }
'updaterId': this.dataForm.updaterId, }
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,228 +1,191 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="检测内容id" prop="inspectionDetId">
:visible.sync="visible"> <el-input v-model="dataForm.inspectionDetId" placeholder="检测内容id"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="检测内容id" prop="inspectionDetId"> <el-form-item label="检测内容设备推送消息时可能无对应id只填这个字段" prop="inspectionDetContent">
<el-input v-model="dataForm.inspectionDetId" placeholder="检测内容id"></el-input> <el-input v-model="dataForm.inspectionDetContent" placeholder="检测内容设备推送消息时可能无对应id只填这个字段"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检测内容设备推送消息时可能无对应id只填这个字段" prop="inspectionDetContent"> <el-form-item label="产线id" prop="productionId">
<el-input v-model="dataForm.inspectionDetContent" placeholder="检测内容设备推送消息时可能无对应id只填这个字段"></el-input> <el-input v-model="dataForm.productionId" placeholder="产线id"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="产线id" prop="productionId"> <el-form-item label="工段id" prop="sectionId">
<el-input v-model="dataForm.productionId" placeholder="产线id"></el-input> <el-input v-model="dataForm.sectionId" placeholder="工段id"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="工段id" prop="sectionId"> <el-form-item label="检测人员,可以多个" prop="checkPerson">
<el-input v-model="dataForm.sectionId" placeholder="工段id"></el-input> <el-input v-model="dataForm.checkPerson" placeholder="检测人员,可以多个"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检测人员,可以多个" prop="checkPerson"> <el-form-item label="检测时间" prop="checkTime">
<el-input v-model="dataForm.checkPerson" placeholder="检测人员,可以多个"></el-input> <el-input v-model="dataForm.checkTime" placeholder="检测时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检测时间" prop="checkTime"> <el-form-item label="来源 1手动默认 2自动" prop="source">
<el-input v-model="dataForm.checkTime" placeholder="检测时间"></el-input> <el-input v-model="dataForm.source" placeholder="来源 1手动默认 2自动"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="来源 1手动默认 2自动" prop="source"> <el-form-item label="描述" prop="explainText">
<el-input v-model="dataForm.source" placeholder="来源 1手动默认 2自动"></el-input> <el-input v-model="dataForm.explainText" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="explainText"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.explainText" placeholder="描述"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
inspectionDetId: '', inspectionDetId: '',
inspectionDetContent: '', inspectionDetContent: '',
productionId: '', productionId: '',
sectionId: '', sectionId: '',
checkPerson: '', checkPerson: '',
checkTime: '', checkTime: '',
source: '', source: '',
explainText: '', explainText: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
inspectionDetId: [ inspectionDetId: [{ required: true, message: '检测内容id不能为空', trigger: 'blur' }],
{ required: true, message: '检测内容id不能为空', trigger: 'blur' } inspectionDetContent: [{ required: true, message: '检测内容设备推送消息时可能无对应id只填这个字段不能为空', trigger: 'blur' }],
], productionId: [{ required: true, message: '产线id不能为空', trigger: 'blur' }],
inspectionDetContent: [ sectionId: [{ required: true, message: '工段id不能为空', trigger: 'blur' }],
{ required: true, message: '检测内容设备推送消息时可能无对应id只填这个字段不能为空', trigger: 'blur' } checkPerson: [{ required: true, message: '检测人员,可以多个不能为空', trigger: 'blur' }],
], checkTime: [{ required: true, message: '检测时间不能为空', trigger: 'blur' }],
productionId: [ source: [{ required: true, message: '来源 1手动默认 2自动不能为空', trigger: 'blur' }],
{ required: true, message: '产线id不能为空', trigger: 'blur' } explainText: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
], remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
sectionId: [ valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
{ required: true, message: '工段id不能为空', trigger: 'blur' } creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
], creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
checkPerson: [ createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
{ required: true, message: '检测人员,可以多个不能为空', trigger: 'blur' } updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
], updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
checkTime: [ updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
{ required: true, message: '检测时间不能为空', trigger: 'blur' } version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
], }
source: [ }
{ required: true, message: '来源 1手动默认 2自动不能为空', trigger: 'blur' } },
], methods: {
explainText: [ init(id) {
{ required: true, message: '描述不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
remark: [ this.$nextTick(() => {
{ required: true, message: '备注不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
valid: [ this.$http({
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/qualityinspectionrecord/info/${this.dataForm.id}`),
], method: 'get',
creatorId: [ params: this.$http.adornParams()
{ required: true, message: '创建人不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
creatorName: [ this.dataForm.inspectionDetId = data.qualityInspectionRecord.inspectionDetId
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.inspectionDetContent = data.qualityInspectionRecord.inspectionDetContent
], this.dataForm.productionId = data.qualityInspectionRecord.productionId
createTime: [ this.dataForm.sectionId = data.qualityInspectionRecord.sectionId
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.checkPerson = data.qualityInspectionRecord.checkPerson
], this.dataForm.checkTime = data.qualityInspectionRecord.checkTime
updaterId: [ this.dataForm.source = data.qualityInspectionRecord.source
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.explainText = data.qualityInspectionRecord.explainText
], this.dataForm.remark = data.qualityInspectionRecord.remark
updaterName: [ this.dataForm.valid = data.qualityInspectionRecord.valid
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.creatorId = data.qualityInspectionRecord.creatorId
], this.dataForm.creatorName = data.qualityInspectionRecord.creatorName
updateTime: [ this.dataForm.createTime = data.qualityInspectionRecord.createTime
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.updaterId = data.qualityInspectionRecord.updaterId
], this.dataForm.updaterName = data.qualityInspectionRecord.updaterName
version: [ this.dataForm.updateTime = data.qualityInspectionRecord.updateTime
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.version = data.qualityInspectionRecord.version
] }
} })
} }
}, })
methods: { },
init (id) { //
this.dataForm.id = id || 0 dataFormSubmit() {
this.visible = true this.$refs['dataForm'].validate(valid => {
this.$nextTick(() => { if (valid) {
this.$refs['dataForm'].resetFields() this.$http({
if (this.dataForm.id) { url: this.$http.adornUrl(`/monitoring/qualityinspectionrecord/${!this.dataForm.id ? 'save' : 'update'}`),
this.$http({ method: 'post',
url: this.$http.adornUrl(`/monitoring/qualityinspectionrecord/info/${this.dataForm.id}`), data: this.$http.adornData({
method: 'get', id: this.dataForm.id || undefined,
params: this.$http.adornParams() inspectionDetId: this.dataForm.inspectionDetId,
}).then(({data}) => { inspectionDetContent: this.dataForm.inspectionDetContent,
if (data && data.code === 0) { productionId: this.dataForm.productionId,
this.dataForm.inspectionDetId = data.qualityInspectionRecord.inspectionDetId sectionId: this.dataForm.sectionId,
this.dataForm.inspectionDetContent = data.qualityInspectionRecord.inspectionDetContent checkPerson: this.dataForm.checkPerson,
this.dataForm.productionId = data.qualityInspectionRecord.productionId checkTime: this.dataForm.checkTime,
this.dataForm.sectionId = data.qualityInspectionRecord.sectionId source: this.dataForm.source,
this.dataForm.checkPerson = data.qualityInspectionRecord.checkPerson explainText: this.dataForm.explainText,
this.dataForm.checkTime = data.qualityInspectionRecord.checkTime remark: this.dataForm.remark,
this.dataForm.source = data.qualityInspectionRecord.source valid: this.dataForm.valid,
this.dataForm.explainText = data.qualityInspectionRecord.explainText creatorId: this.dataForm.creatorId,
this.dataForm.remark = data.qualityInspectionRecord.remark creatorName: this.dataForm.creatorName,
this.dataForm.valid = data.qualityInspectionRecord.valid createTime: this.dataForm.createTime,
this.dataForm.creatorId = data.qualityInspectionRecord.creatorId updaterId: this.dataForm.updaterId,
this.dataForm.creatorName = data.qualityInspectionRecord.creatorName updaterName: this.dataForm.updaterName,
this.dataForm.createTime = data.qualityInspectionRecord.createTime updateTime: this.dataForm.updateTime,
this.dataForm.updaterId = data.qualityInspectionRecord.updaterId version: this.dataForm.version
this.dataForm.updaterName = data.qualityInspectionRecord.updaterName })
this.dataForm.updateTime = data.qualityInspectionRecord.updateTime }).then(({ data }) => {
this.dataForm.version = data.qualityInspectionRecord.version if (data && data.code === 0) {
} this.$message({
}) message: '操作成功',
} type: 'success',
}) duration: 1500,
}, onClose: () => {
// this.visible = false
dataFormSubmit () { this.$emit('refreshDataList')
this.$refs['dataForm'].validate((valid) => { }
if (valid) { })
this.$http({ } else {
url: this.$http.adornUrl(`/monitoring/qualityinspectionrecord/${!this.dataForm.id ? 'save' : 'update'}`), this.$message.error(data.msg)
method: 'post', }
data: this.$http.adornData({ })
'id': this.dataForm.id || undefined, }
'inspectionDetId': this.dataForm.inspectionDetId, })
'inspectionDetContent': this.dataForm.inspectionDetContent, }
'productionId': this.dataForm.productionId, }
'sectionId': this.dataForm.sectionId, }
'checkPerson': this.dataForm.checkPerson,
'checkTime': this.dataForm.checkTime,
'source': this.dataForm.source,
'explainText': this.dataForm.explainText,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,174 +1,149 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="检测类型名称" prop="name">
:visible.sync="visible"> <el-input v-model="dataForm.name" placeholder="检测类型名称"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="检测类型名称" prop="name"> <el-form-item label="检测类型编码" prop="code">
<el-input v-model="dataForm.name" placeholder="检测类型名称"></el-input> <el-input v-model="dataForm.code" placeholder="检测类型编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="检测类型编码" prop="code"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.code" placeholder="检测类型编码"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
name: '', name: '',
code: '', code: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
name: [ name: [{ required: true, message: '检测类型名称不能为空', trigger: 'blur' }],
{ required: true, message: '检测类型名称不能为空', trigger: 'blur' } code: [{ required: true, message: '检测类型编码不能为空', trigger: 'blur' }],
], remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
code: [ valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
{ required: true, message: '检测类型编码不能为空', trigger: 'blur' } creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
], creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
remark: [ createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
{ required: true, message: '备注不能为空', trigger: 'blur' } updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
], updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
valid: [ updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
], }
creatorId: [ }
{ required: true, message: '创建人不能为空', trigger: 'blur' } },
], methods: {
creatorName: [ init(id) {
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
createTime: [ this.$nextTick(() => {
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
updaterId: [ this.$http({
{ required: true, message: '更新人不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/qualityinspectiontype/info/${this.dataForm.id}`),
], method: 'get',
updaterName: [ params: this.$http.adornParams()
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
updateTime: [ this.dataForm.name = data.qualityInspectionType.name
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.code = data.qualityInspectionType.code
], this.dataForm.remark = data.qualityInspectionType.remark
version: [ this.dataForm.valid = data.qualityInspectionType.valid
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.creatorId = data.qualityInspectionType.creatorId
] this.dataForm.creatorName = data.qualityInspectionType.creatorName
} this.dataForm.createTime = data.qualityInspectionType.createTime
} this.dataForm.updaterId = data.qualityInspectionType.updaterId
}, this.dataForm.updaterName = data.qualityInspectionType.updaterName
methods: { this.dataForm.updateTime = data.qualityInspectionType.updateTime
init (id) { this.dataForm.version = data.qualityInspectionType.version
this.dataForm.id = id || 0 }
this.visible = true })
this.$nextTick(() => { }
this.$refs['dataForm'].resetFields() })
if (this.dataForm.id) { },
this.$http({ //
url: this.$http.adornUrl(`/monitoring/qualityinspectiontype/info/${this.dataForm.id}`), dataFormSubmit() {
method: 'get', this.$refs['dataForm'].validate(valid => {
params: this.$http.adornParams() if (valid) {
}).then(({data}) => { this.$http({
if (data && data.code === 0) { url: this.$http.adornUrl(`/monitoring/qualityinspectiontype/${!this.dataForm.id ? 'save' : 'update'}`),
this.dataForm.name = data.qualityInspectionType.name method: 'post',
this.dataForm.code = data.qualityInspectionType.code data: this.$http.adornData({
this.dataForm.remark = data.qualityInspectionType.remark id: this.dataForm.id || undefined,
this.dataForm.valid = data.qualityInspectionType.valid name: this.dataForm.name,
this.dataForm.creatorId = data.qualityInspectionType.creatorId code: this.dataForm.code,
this.dataForm.creatorName = data.qualityInspectionType.creatorName remark: this.dataForm.remark,
this.dataForm.createTime = data.qualityInspectionType.createTime valid: this.dataForm.valid,
this.dataForm.updaterId = data.qualityInspectionType.updaterId creatorId: this.dataForm.creatorId,
this.dataForm.updaterName = data.qualityInspectionType.updaterName creatorName: this.dataForm.creatorName,
this.dataForm.updateTime = data.qualityInspectionType.updateTime createTime: this.dataForm.createTime,
this.dataForm.version = data.qualityInspectionType.version updaterId: this.dataForm.updaterId,
} updaterName: this.dataForm.updaterName,
}) updateTime: this.dataForm.updateTime,
} version: this.dataForm.version
}) })
}, }).then(({ data }) => {
// if (data && data.code === 0) {
dataFormSubmit () { this.$message({
this.$refs['dataForm'].validate((valid) => { message: '操作成功',
if (valid) { type: 'success',
this.$http({ duration: 1500,
url: this.$http.adornUrl(`/monitoring/qualityinspectiontype/${!this.dataForm.id ? 'save' : 'update'}`), onClose: () => {
method: 'post', this.visible = false
data: this.$http.adornData({ this.$emit('refreshDataList')
'id': this.dataForm.id || undefined, }
'name': this.dataForm.name, })
'code': this.dataForm.code, } else {
'remark': this.dataForm.remark, this.$message.error(data.msg)
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId, })
'creatorName': this.dataForm.creatorName, }
'createTime': this.dataForm.createTime, })
'updaterId': this.dataForm.updaterId, }
'updaterName': this.dataForm.updaterName, }
'updateTime': this.dataForm.updateTime, }
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,201 +1,170 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="编码" prop="code">
:visible.sync="visible"> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部编码,用于对照外部系统的编码" prop="externalCode"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.externalCode" placeholder="外部编码,用于对照外部系统的编码"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
code: '', code: '',
name: '', name: '',
description: '', description: '',
externalCode: '', externalCode: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
code: [ code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
], description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
name: [ externalCode: [{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' }],
{ required: true, message: '名称不能为空', trigger: 'blur' } enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
], remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
description: [ valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
], creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
externalCode: [ createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
{ required: true, message: '外部编码,用于对照外部系统的编码不能为空', trigger: 'blur' } updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
], updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
enabled: [ updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
], }
remark: [ }
{ required: true, message: '备注不能为空', trigger: 'blur' } },
], methods: {
valid: [ init(id) {
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
creatorId: [ this.$nextTick(() => {
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
creatorName: [ this.$http({
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/reporsheecategory/info/${this.dataForm.id}`),
], method: 'get',
createTime: [ params: this.$http.adornParams()
{ required: true, message: '创建时间不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
updaterId: [ this.dataForm.code = data.reporsheecategory.code
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.name = data.reporsheecategory.name
], this.dataForm.description = data.reporsheecategory.description
updaterName: [ this.dataForm.externalCode = data.reporsheecategory.externalCode
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.enabled = data.reporsheecategory.enabled
], this.dataForm.remark = data.reporsheecategory.remark
updateTime: [ this.dataForm.valid = data.reporsheecategory.valid
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.creatorId = data.reporsheecategory.creatorId
], this.dataForm.creatorName = data.reporsheecategory.creatorName
version: [ this.dataForm.createTime = data.reporsheecategory.createTime
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updaterId = data.reporsheecategory.updaterId
] this.dataForm.updaterName = data.reporsheecategory.updaterName
} this.dataForm.updateTime = data.reporsheecategory.updateTime
} this.dataForm.version = data.reporsheecategory.version
}, }
methods: { })
init (id) { }
this.dataForm.id = id || 0 })
this.visible = true },
this.$nextTick(() => { //
this.$refs['dataForm'].resetFields() dataFormSubmit() {
if (this.dataForm.id) { this.$refs['dataForm'].validate(valid => {
this.$http({ if (valid) {
url: this.$http.adornUrl(`/monitoring/reporsheecategory/info/${this.dataForm.id}`), this.$http({
method: 'get', url: this.$http.adornUrl(`/monitoring/reporsheecategory/${!this.dataForm.id ? 'save' : 'update'}`),
params: this.$http.adornParams() method: 'post',
}).then(({data}) => { data: this.$http.adornData({
if (data && data.code === 0) { id: this.dataForm.id || undefined,
this.dataForm.code = data.reporsheecategory.code code: this.dataForm.code,
this.dataForm.name = data.reporsheecategory.name name: this.dataForm.name,
this.dataForm.description = data.reporsheecategory.description description: this.dataForm.description,
this.dataForm.externalCode = data.reporsheecategory.externalCode externalCode: this.dataForm.externalCode,
this.dataForm.enabled = data.reporsheecategory.enabled enabled: this.dataForm.enabled,
this.dataForm.remark = data.reporsheecategory.remark remark: this.dataForm.remark,
this.dataForm.valid = data.reporsheecategory.valid valid: this.dataForm.valid,
this.dataForm.creatorId = data.reporsheecategory.creatorId creatorId: this.dataForm.creatorId,
this.dataForm.creatorName = data.reporsheecategory.creatorName creatorName: this.dataForm.creatorName,
this.dataForm.createTime = data.reporsheecategory.createTime createTime: this.dataForm.createTime,
this.dataForm.updaterId = data.reporsheecategory.updaterId updaterId: this.dataForm.updaterId,
this.dataForm.updaterName = data.reporsheecategory.updaterName updaterName: this.dataForm.updaterName,
this.dataForm.updateTime = data.reporsheecategory.updateTime updateTime: this.dataForm.updateTime,
this.dataForm.version = data.reporsheecategory.version version: this.dataForm.version
} })
}) }).then(({ data }) => {
} if (data && data.code === 0) {
}) this.$message({
}, message: '操作成功',
// type: 'success',
dataFormSubmit () { duration: 1500,
this.$refs['dataForm'].validate((valid) => { onClose: () => {
if (valid) { this.visible = false
this.$http({ this.$emit('refreshDataList')
url: this.$http.adornUrl(`/monitoring/reporsheecategory/${!this.dataForm.id ? 'save' : 'update'}`), }
method: 'post', })
data: this.$http.adornData({ } else {
'id': this.dataForm.id || undefined, this.$message.error(data.msg)
'code': this.dataForm.code, }
'name': this.dataForm.name, })
'description': this.dataForm.description, }
'externalCode': this.dataForm.externalCode, })
'enabled': this.dataForm.enabled, }
'remark': this.dataForm.remark, }
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,228 +1,191 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="分类关联report_sheet_category" prop="category">
:visible.sync="visible"> <el-input v-model="dataForm.category" placeholder="分类关联report_sheet_category"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="分类关联report_sheet_category" prop="category"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.category" placeholder="分类关联report_sheet_category"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="文件名称" prop="fileName">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件名称" prop="fileName"> <el-form-item label="链接地址" prop="url">
<el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input> <el-input v-model="dataForm.url" placeholder="链接地址"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="链接地址" prop="url"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.url" placeholder="链接地址"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="报表内容" prop="content">
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <el-input v-model="dataForm.content" placeholder="报表内容"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报表内容" prop="content"> </el-form>
<el-input v-model="dataForm.content" placeholder="报表内容"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
category: '', category: '',
code: '', code: '',
name: '', name: '',
fileName: '', fileName: '',
url: '', url: '',
description: '', description: '',
enabled: '', enabled: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '', version: '',
content: '' content: ''
}, },
dataRule: { dataRule: {
category: [ category: [{ required: true, message: '分类关联report_sheet_category不能为空', trigger: 'blur' }],
{ required: true, message: '分类关联report_sheet_category不能为空', trigger: 'blur' } code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
], name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
code: [ fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } url: [{ required: true, message: '链接地址不能为空', trigger: 'blur' }],
], description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
name: [ enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
{ required: true, message: '名称不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
fileName: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '文件名称不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
url: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '链接地址不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
description: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } content: [{ required: true, message: '报表内容不能为空', trigger: 'blur' }]
], }
enabled: [ }
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } },
], methods: {
remark: [ init(id) {
{ required: true, message: '备注不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
valid: [ this.$nextTick(() => {
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
creatorId: [ this.$http({
{ required: true, message: '创建人不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/reporsheet/info/${this.dataForm.id}`),
], method: 'get',
creatorName: [ params: this.$http.adornParams()
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
createTime: [ this.dataForm.category = data.reporsheet.category
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.dataForm.code = data.reporsheet.code
], this.dataForm.name = data.reporsheet.name
updaterId: [ this.dataForm.fileName = data.reporsheet.fileName
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.url = data.reporsheet.url
], this.dataForm.description = data.reporsheet.description
updaterName: [ this.dataForm.enabled = data.reporsheet.enabled
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.remark = data.reporsheet.remark
], this.dataForm.valid = data.reporsheet.valid
updateTime: [ this.dataForm.creatorId = data.reporsheet.creatorId
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.creatorName = data.reporsheet.creatorName
], this.dataForm.createTime = data.reporsheet.createTime
version: [ this.dataForm.updaterId = data.reporsheet.updaterId
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updaterName = data.reporsheet.updaterName
], this.dataForm.updateTime = data.reporsheet.updateTime
content: [ this.dataForm.version = data.reporsheet.version
{ required: true, message: '报表内容不能为空', trigger: 'blur' } this.dataForm.content = data.reporsheet.content
] }
} })
} }
}, })
methods: { },
init (id) { //
this.dataForm.id = id || 0 dataFormSubmit() {
this.visible = true this.$refs['dataForm'].validate(valid => {
this.$nextTick(() => { if (valid) {
this.$refs['dataForm'].resetFields() this.$http({
if (this.dataForm.id) { url: this.$http.adornUrl(`/monitoring/reporsheet/${!this.dataForm.id ? 'save' : 'update'}`),
this.$http({ method: 'post',
url: this.$http.adornUrl(`/monitoring/reporsheet/info/${this.dataForm.id}`), data: this.$http.adornData({
method: 'get', id: this.dataForm.id || undefined,
params: this.$http.adornParams() category: this.dataForm.category,
}).then(({data}) => { code: this.dataForm.code,
if (data && data.code === 0) { name: this.dataForm.name,
this.dataForm.category = data.reporsheet.category fileName: this.dataForm.fileName,
this.dataForm.code = data.reporsheet.code url: this.dataForm.url,
this.dataForm.name = data.reporsheet.name description: this.dataForm.description,
this.dataForm.fileName = data.reporsheet.fileName enabled: this.dataForm.enabled,
this.dataForm.url = data.reporsheet.url remark: this.dataForm.remark,
this.dataForm.description = data.reporsheet.description valid: this.dataForm.valid,
this.dataForm.enabled = data.reporsheet.enabled creatorId: this.dataForm.creatorId,
this.dataForm.remark = data.reporsheet.remark creatorName: this.dataForm.creatorName,
this.dataForm.valid = data.reporsheet.valid createTime: this.dataForm.createTime,
this.dataForm.creatorId = data.reporsheet.creatorId updaterId: this.dataForm.updaterId,
this.dataForm.creatorName = data.reporsheet.creatorName updaterName: this.dataForm.updaterName,
this.dataForm.createTime = data.reporsheet.createTime updateTime: this.dataForm.updateTime,
this.dataForm.updaterId = data.reporsheet.updaterId version: this.dataForm.version,
this.dataForm.updaterName = data.reporsheet.updaterName content: this.dataForm.content
this.dataForm.updateTime = data.reporsheet.updateTime })
this.dataForm.version = data.reporsheet.version }).then(({ data }) => {
this.dataForm.content = data.reporsheet.content if (data && data.code === 0) {
} this.$message({
}) message: '操作成功',
} type: 'success',
}) duration: 1500,
}, onClose: () => {
// this.visible = false
dataFormSubmit () { this.$emit('refreshDataList')
this.$refs['dataForm'].validate((valid) => { }
if (valid) { })
this.$http({ } else {
url: this.$http.adornUrl(`/monitoring/reporsheet/${!this.dataForm.id ? 'save' : 'update'}`), this.$message.error(data.msg)
method: 'post', }
data: this.$http.adornData({ })
'id': this.dataForm.id || undefined, }
'category': this.dataForm.category, })
'code': this.dataForm.code, }
'name': this.dataForm.name, }
'fileName': this.dataForm.fileName, }
'url': this.dataForm.url,
'description': this.dataForm.description,
'enabled': this.dataForm.enabled,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version,
'content': this.dataForm.content
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,259 +1,157 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:reporsheet:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:reporsheet:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:reporsheet:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:reporsheet:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="category" header-align="center" align="center" label="分类关联report_sheet_category"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
style="width: 100%;"> <el-table-column prop="name" header-align="center" align="center" label="名称"> </el-table-column>
<el-table-column <el-table-column prop="fileName" header-align="center" align="center" label="文件名称"> </el-table-column>
type="selection" <el-table-column prop="url" header-align="center" align="center" label="链接地址"> </el-table-column>
header-align="center" <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
align="center" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
width="50"> <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
</el-table-column> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
<el-table-column <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
prop="id" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
header-align="center" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
label="ID"> <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
<el-table-column <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
prop="category" <el-table-column prop="content" header-align="center" align="center" label="报表内容"> </el-table-column>
header-align="center" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
align="center" <template slot-scope="scope">
label="分类关联report_sheet_category"> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
</el-table-column> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
<el-table-column </template>
prop="code" </el-table-column>
header-align="center" </el-table>
align="center" <el-pagination
label="编码"> @size-change="sizeChangeHandle"
</el-table-column> @current-change="currentChangeHandle"
<el-table-column :current-page="pageIndex"
prop="name" :page-sizes="[10, 20, 50, 100]"
header-align="center" :page-size="pageSize"
align="center" :total="totalPage"
label="名称"> layout="total, sizes, prev, pager, next, jumper"
</el-table-column> >
<el-table-column </el-pagination>
prop="fileName" <!-- 弹窗, 新增 / 修改 -->
header-align="center" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
align="center" </div>
label="文件名称">
</el-table-column>
<el-table-column
prop="url"
header-align="center"
align="center"
label="链接地址">
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
prop="content"
header-align="center"
align="center"
label="报表内容">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './reporsheet-add-or-update' import AddOrUpdate from './reporsheet-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/reporsheet/page'), url: this.$http.adornUrl('/monitoring/reporsheet/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/reporsheet/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/reporsheet/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,241 +1,156 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:reporsheecategory:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:reporsheecategory:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:reporsheecategory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:reporsheecategory:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"
</el-form-item> >批量删除</el-button
</el-form> >
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
style="width: 100%;"> <el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
<el-table-column <el-table-column prop="name" header-align="center" align="center" label="名称"> </el-table-column>
type="selection" <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
header-align="center" <el-table-column prop="externalCode" header-align="center" align="center" label="外部编码,用于对照外部系统的编码"> </el-table-column>
align="center" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
width="50"> <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
</el-table-column> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
<el-table-column <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
prop="id" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
header-align="center" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
label="ID"> <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
<el-table-column <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
prop="code" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
header-align="center" <template slot-scope="scope">
align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
label="编码"> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</el-table-column> </template>
<el-table-column </el-table-column>
prop="name" </el-table>
header-align="center" <el-pagination
align="center" @size-change="sizeChangeHandle"
label="名称"> @current-change="currentChangeHandle"
</el-table-column> :current-page="pageIndex"
<el-table-column :page-sizes="[10, 20, 50, 100]"
prop="description" :page-size="pageSize"
header-align="center" :total="totalPage"
align="center" layout="total, sizes, prev, pager, next, jumper"
label="描述"> >
</el-table-column> </el-pagination>
<el-table-column <!-- 弹窗, 新增 / 修改 -->
prop="externalCode" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
header-align="center" </div>
align="center"
label="外部编码,用于对照外部系统的编码">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './reporsheecategory-add-or-update' import AddOrUpdate from './reporsheecategory-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/reporsheecategory/page'), url: this.$http.adornUrl('/monitoring/reporsheecategory/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/reporsheecategory/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/reporsheecategory/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,192 +1,163 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="文件类型编号" prop="typeCode">
:visible.sync="visible"> <el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="文件类型编号" prop="typeCode"> <el-form-item label="文件编号" prop="fileCode">
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input> <el-input v-model="dataForm.fileCode" placeholder="文件编号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件编号" prop="fileCode"> <el-form-item label="文件名称" prop="fileName">
<el-input v-model="dataForm.fileCode" placeholder="文件编号"></el-input> <el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件名称" prop="fileName"> <el-form-item label="文件路径URL" prop="fileUrl">
<el-input v-model="dataForm.fileName" placeholder="文件名称"></el-input> <el-input v-model="dataForm.fileUrl" placeholder="文件路径URL"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件路径URL" prop="fileUrl"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.fileUrl" placeholder="文件路径URL"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
typeCode: '', typeCode: '',
fileCode: '', fileCode: '',
fileName: '', fileName: '',
fileUrl: '', fileUrl: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
typeCode: [ typeCode: [{ required: true, message: '文件类型编号不能为空', trigger: 'blur' }],
{ required: true, message: '文件类型编号不能为空', trigger: 'blur' } fileCode: [{ required: true, message: '文件编号不能为空', trigger: 'blur' }],
], fileName: [{ required: true, message: '文件名称不能为空', trigger: 'blur' }],
fileCode: [ fileUrl: [{ required: true, message: '文件路径URL不能为空', trigger: 'blur' }],
{ required: true, message: '文件编号不能为空', trigger: 'blur' } remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
], valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
fileName: [ creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
{ required: true, message: '文件名称不能为空', trigger: 'blur' } creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
], createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
fileUrl: [ updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
{ required: true, message: '文件路径URL不能为空', trigger: 'blur' } updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
], updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
remark: [ version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
{ required: true, message: '备注不能为空', trigger: 'blur' } }
], }
valid: [ },
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } methods: {
], init(id) {
creatorId: [ this.dataForm.id = id || 0
{ required: true, message: '创建人不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
creatorName: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
createTime: [ url: this.$http.adornUrl(`/monitoring/sysfile/info/${this.dataForm.id}`),
{ required: true, message: '创建时间不能为空', trigger: 'blur' } method: 'get',
], params: this.$http.adornParams()
updaterId: [ }).then(({ data }) => {
{ required: true, message: '更新人不能为空', trigger: 'blur' } if (data && data.code === 0) {
], this.dataForm.typeCode = data.sysFile.typeCode
updaterName: [ this.dataForm.fileCode = data.sysFile.fileCode
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.fileName = data.sysFile.fileName
], this.dataForm.fileUrl = data.sysFile.fileUrl
updateTime: [ this.dataForm.remark = data.sysFile.remark
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.valid = data.sysFile.valid
], this.dataForm.creatorId = data.sysFile.creatorId
version: [ this.dataForm.creatorName = data.sysFile.creatorName
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.createTime = data.sysFile.createTime
] this.dataForm.updaterId = data.sysFile.updaterId
} this.dataForm.updaterName = data.sysFile.updaterName
} this.dataForm.updateTime = data.sysFile.updateTime
}, this.dataForm.version = data.sysFile.version
methods: { }
init (id) { })
this.dataForm.id = id || 0 }
this.visible = true })
this.$nextTick(() => { },
this.$refs['dataForm'].resetFields() //
if (this.dataForm.id) { dataFormSubmit() {
this.$http({ this.$refs['dataForm'].validate(valid => {
url: this.$http.adornUrl(`/monitoring/sysfile/info/${this.dataForm.id}`), if (valid) {
method: 'get', this.$http({
params: this.$http.adornParams() url: this.$http.adornUrl(`/monitoring/sysfile/${!this.dataForm.id ? 'save' : 'update'}`),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData({
this.dataForm.typeCode = data.sysFile.typeCode id: this.dataForm.id || undefined,
this.dataForm.fileCode = data.sysFile.fileCode typeCode: this.dataForm.typeCode,
this.dataForm.fileName = data.sysFile.fileName fileCode: this.dataForm.fileCode,
this.dataForm.fileUrl = data.sysFile.fileUrl fileName: this.dataForm.fileName,
this.dataForm.remark = data.sysFile.remark fileUrl: this.dataForm.fileUrl,
this.dataForm.valid = data.sysFile.valid remark: this.dataForm.remark,
this.dataForm.creatorId = data.sysFile.creatorId valid: this.dataForm.valid,
this.dataForm.creatorName = data.sysFile.creatorName creatorId: this.dataForm.creatorId,
this.dataForm.createTime = data.sysFile.createTime creatorName: this.dataForm.creatorName,
this.dataForm.updaterId = data.sysFile.updaterId createTime: this.dataForm.createTime,
this.dataForm.updaterName = data.sysFile.updaterName updaterId: this.dataForm.updaterId,
this.dataForm.updateTime = data.sysFile.updateTime updaterName: this.dataForm.updaterName,
this.dataForm.version = data.sysFile.version updateTime: this.dataForm.updateTime,
} version: this.dataForm.version
}) })
} }).then(({ data }) => {
}) if (data && data.code === 0) {
}, this.$message({
// message: '操作成功',
dataFormSubmit () { type: 'success',
this.$refs['dataForm'].validate((valid) => { duration: 1500,
if (valid) { onClose: () => {
this.$http({ this.visible = false
url: this.$http.adornUrl(`/monitoring/sysfile/${!this.dataForm.id ? 'save' : 'update'}`), this.$emit('refreshDataList')
method: 'post', }
data: this.$http.adornData({ })
'id': this.dataForm.id || undefined, } else {
'typeCode': this.dataForm.typeCode, this.$message.error(data.msg)
'fileCode': this.dataForm.fileCode, }
'fileName': this.dataForm.fileName, })
'fileUrl': this.dataForm.fileUrl, }
'remark': this.dataForm.remark, })
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId, }
'creatorName': this.dataForm.creatorName, }
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,235 +1,153 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:sysfile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:sysfile:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:sysfile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:sysfile:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="主键,自增"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="typeCode" header-align="center" align="center" label="文件类型编号"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="fileCode" header-align="center" align="center" label="文件编号"> </el-table-column>
style="width: 100%;"> <el-table-column prop="fileName" header-align="center" align="center" label="文件名称"> </el-table-column>
<el-table-column <el-table-column prop="fileUrl" header-align="center" align="center" label="文件路径URL"> </el-table-column>
type="selection" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
header-align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
align="center" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
width="50"> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
</el-table-column> <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
<el-table-column <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
prop="id" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
header-align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
align="center" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
label="主键,自增"> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
</el-table-column> <template slot-scope="scope">
<el-table-column <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
prop="typeCode" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
header-align="center" </template>
align="center" </el-table-column>
label="文件类型编号"> </el-table>
</el-table-column> <el-pagination
<el-table-column @size-change="sizeChangeHandle"
prop="fileCode" @current-change="currentChangeHandle"
header-align="center" :current-page="pageIndex"
align="center" :page-sizes="[10, 20, 50, 100]"
label="文件编号"> :page-size="pageSize"
</el-table-column> :total="totalPage"
<el-table-column layout="total, sizes, prev, pager, next, jumper"
prop="fileName" >
header-align="center" </el-pagination>
align="center" <!-- 弹窗, 新增 / 修改 -->
label="文件名称"> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</el-table-column> </div>
<el-table-column
prop="fileUrl"
header-align="center"
align="center"
label="文件路径URL">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './sysfile-add-or-update' import AddOrUpdate from './sysfile-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/sysfile/page'), url: this.$http.adornUrl('/monitoring/sysfile/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/sysfile/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/sysfile/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,223 +1,151 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:sysfiletype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:sysfiletype:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:sysfiletype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:sysfiletype:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="主键,自增"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="typeCode" header-align="center" align="center" label="文件类型编号"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="typeName" header-align="center" align="center" label="文件类型名称"> </el-table-column>
style="width: 100%;"> <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
<el-table-column <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
type="selection" <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
header-align="center" <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
align="center" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
width="50"> <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
</el-table-column> <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
<el-table-column <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
prop="id" <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
header-align="center" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
align="center" <template slot-scope="scope">
label="主键,自增"> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
</el-table-column> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
<el-table-column </template>
prop="typeCode" </el-table-column>
header-align="center" </el-table>
align="center" <el-pagination
label="文件类型编号"> @size-change="sizeChangeHandle"
</el-table-column> @current-change="currentChangeHandle"
<el-table-column :current-page="pageIndex"
prop="typeName" :page-sizes="[10, 20, 50, 100]"
header-align="center" :page-size="pageSize"
align="center" :total="totalPage"
label="文件类型名称"> layout="total, sizes, prev, pager, next, jumper"
</el-table-column> >
<el-table-column </el-pagination>
prop="remark" <!-- 弹窗, 新增 / 修改 -->
header-align="center" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
align="center" </div>
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './sysfiletype-add-or-update' import AddOrUpdate from './sysfiletype-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/sysfiletype/page'), url: this.$http.adornUrl('/monitoring/sysfiletype/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/sysfiletype/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/sysfiletype/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,174 +1,149 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="文件类型编号" prop="typeCode">
:visible.sync="visible"> <el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="文件类型编号" prop="typeCode"> <el-form-item label="文件类型名称" prop="typeName">
<el-input v-model="dataForm.typeCode" placeholder="文件类型编号"></el-input> <el-input v-model="dataForm.typeName" placeholder="文件类型名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件类型名称" prop="typeName"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.typeName" placeholder="文件类型名称"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
typeCode: '', typeCode: '',
typeName: '', typeName: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
typeCode: [ typeCode: [{ required: true, message: '文件类型编号不能为空', trigger: 'blur' }],
{ required: true, message: '文件类型编号不能为空', trigger: 'blur' } typeName: [{ required: true, message: '文件类型名称不能为空', trigger: 'blur' }],
], remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
typeName: [ valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
{ required: true, message: '文件类型名称不能为空', trigger: 'blur' } creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
], creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
remark: [ createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
{ required: true, message: '备注不能为空', trigger: 'blur' } updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
], updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
valid: [ updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
], }
creatorId: [ }
{ required: true, message: '创建人不能为空', trigger: 'blur' } },
], methods: {
creatorName: [ init(id) {
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.dataForm.id = id || 0
], this.visible = true
createTime: [ this.$nextTick(() => {
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.$refs['dataForm'].resetFields()
], if (this.dataForm.id) {
updaterId: [ this.$http({
{ required: true, message: '更新人不能为空', trigger: 'blur' } url: this.$http.adornUrl(`/monitoring/sysfiletype/info/${this.dataForm.id}`),
], method: 'get',
updaterName: [ params: this.$http.adornParams()
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } }).then(({ data }) => {
], if (data && data.code === 0) {
updateTime: [ this.dataForm.typeCode = data.sysFileType.typeCode
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.typeName = data.sysFileType.typeName
], this.dataForm.remark = data.sysFileType.remark
version: [ this.dataForm.valid = data.sysFileType.valid
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.creatorId = data.sysFileType.creatorId
] this.dataForm.creatorName = data.sysFileType.creatorName
} this.dataForm.createTime = data.sysFileType.createTime
} this.dataForm.updaterId = data.sysFileType.updaterId
}, this.dataForm.updaterName = data.sysFileType.updaterName
methods: { this.dataForm.updateTime = data.sysFileType.updateTime
init (id) { this.dataForm.version = data.sysFileType.version
this.dataForm.id = id || 0 }
this.visible = true })
this.$nextTick(() => { }
this.$refs['dataForm'].resetFields() })
if (this.dataForm.id) { },
this.$http({ //
url: this.$http.adornUrl(`/monitoring/sysfiletype/info/${this.dataForm.id}`), dataFormSubmit() {
method: 'get', this.$refs['dataForm'].validate(valid => {
params: this.$http.adornParams() if (valid) {
}).then(({data}) => { this.$http({
if (data && data.code === 0) { url: this.$http.adornUrl(`/monitoring/sysfiletype/${!this.dataForm.id ? 'save' : 'update'}`),
this.dataForm.typeCode = data.sysFileType.typeCode method: 'post',
this.dataForm.typeName = data.sysFileType.typeName data: this.$http.adornData({
this.dataForm.remark = data.sysFileType.remark id: this.dataForm.id || undefined,
this.dataForm.valid = data.sysFileType.valid typeCode: this.dataForm.typeCode,
this.dataForm.creatorId = data.sysFileType.creatorId typeName: this.dataForm.typeName,
this.dataForm.creatorName = data.sysFileType.creatorName remark: this.dataForm.remark,
this.dataForm.createTime = data.sysFileType.createTime valid: this.dataForm.valid,
this.dataForm.updaterId = data.sysFileType.updaterId creatorId: this.dataForm.creatorId,
this.dataForm.updaterName = data.sysFileType.updaterName creatorName: this.dataForm.creatorName,
this.dataForm.updateTime = data.sysFileType.updateTime createTime: this.dataForm.createTime,
this.dataForm.version = data.sysFileType.version updaterId: this.dataForm.updaterId,
} updaterName: this.dataForm.updaterName,
}) updateTime: this.dataForm.updateTime,
} version: this.dataForm.version
}) })
}, }).then(({ data }) => {
// if (data && data.code === 0) {
dataFormSubmit () { this.$message({
this.$refs['dataForm'].validate((valid) => { message: '操作成功',
if (valid) { type: 'success',
this.$http({ duration: 1500,
url: this.$http.adornUrl(`/monitoring/sysfiletype/${!this.dataForm.id ? 'save' : 'update'}`), onClose: () => {
method: 'post', this.visible = false
data: this.$http.adornData({ this.$emit('refreshDataList')
'id': this.dataForm.id || undefined, }
'typeCode': this.dataForm.typeCode, })
'typeName': this.dataForm.typeName, } else {
'remark': this.dataForm.remark, this.$message.error(data.msg)
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId, })
'creatorName': this.dataForm.creatorName, }
'createTime': this.dataForm.createTime, })
'updaterId': this.dataForm.updaterId, }
'updaterName': this.dataForm.updaterName, }
'updateTime': this.dataForm.updateTime, }
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,253 +1,156 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:workshopsection:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:workshopsection:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:workshopsection:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:workshopsection:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
:data="dataList" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
border <el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
v-loading="dataListLoading" <el-table-column prop="productionLineId" header-align="center" align="center" label="产线ID"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
style="width: 100%;"> <el-table-column prop="name" header-align="center" align="center" label="名称"> </el-table-column>
<el-table-column <el-table-column prop="description" header-align="center" align="center" label="描述"> </el-table-column>
type="selection" <el-table-column prop="enabled" header-align="center" align="center" label="启用状态:0 、停用1、启用"> </el-table-column>
header-align="center" <el-table-column prop="sort" header-align="center" align="center" label="排序"> </el-table-column>
align="center" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
width="50"> <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
</el-table-column> <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
<el-table-column <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
prop="id" <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
header-align="center" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
align="center" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
label="id"> <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
</el-table-column> <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
<el-table-column <el-table-column prop="externalCode" header-align="center" align="center" label="外部系统编码"> </el-table-column>
prop="productionLineId" <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
header-align="center" <template slot-scope="scope">
align="center" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
label="产线ID"> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</el-table-column> </template>
<el-table-column </el-table-column>
prop="code" </el-table>
header-align="center" <el-pagination
align="center" @size-change="sizeChangeHandle"
label="编码"> @current-change="currentChangeHandle"
</el-table-column> :current-page="pageIndex"
<el-table-column :page-sizes="[10, 20, 50, 100]"
prop="name" :page-size="pageSize"
header-align="center" :total="totalPage"
align="center" layout="total, sizes, prev, pager, next, jumper"
label="名称"> >
</el-table-column> </el-pagination>
<el-table-column <!-- 弹窗, 新增 / 修改 -->
prop="description" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
header-align="center" </div>
align="center"
label="描述">
</el-table-column>
<el-table-column
prop="enabled"
header-align="center"
align="center"
label="启用状态:0 、停用1、启用">
</el-table-column>
<el-table-column
prop="sort"
header-align="center"
align="center"
label="排序">
</el-table-column>
<el-table-column
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
prop="externalCode"
header-align="center"
align="center"
label="外部系统编码">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './workshopsection-add-or-update' import AddOrUpdate from './workshopsection-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/workshopsection/page'), url: this.$http.adornUrl('/monitoring/workshopsection/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/workshopsection/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/workshopsection/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,229 +1,154 @@
<template> <template>
<div class="mod-config"> <div class="mod-config">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input> <el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
<el-button v-if="$hasPermission('monitoring:workshopsectionequipment:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button> <el-button v-if="$hasPermission('monitoring:workshopsectionequipment:save')" type="primary" @click="addOrUpdateHandle()">新增</el-button>
<el-button v-if="$hasPermission('monitoring:workshopsectionequipment:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button> <el-button v-if="$hasPermission('monitoring:workshopsectionequipment:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0"
</el-form-item> >批量删除</el-button
</el-form> >
<el-table </el-form-item>
:data="dataList" </el-form>
border <el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
@selection-change="selectionChangeHandle" <el-table-column prop="id" header-align="center" align="center" label="ID"> </el-table-column>
style="width: 100%;"> <el-table-column prop="workshopSectionId" header-align="center" align="center" label="工段ID"> </el-table-column>
<el-table-column <el-table-column prop="equipmentId" header-align="center" align="center" label="设备ID"> </el-table-column>
type="selection" <el-table-column prop="sort" header-align="center" align="center" label="排序"> </el-table-column>
header-align="center" <el-table-column prop="remark" header-align="center" align="center" label="备注"> </el-table-column>
align="center" <el-table-column prop="valid" header-align="center" align="center" label="删除标志,是否有效:1 可用 0不可用"> </el-table-column>
width="50"> <el-table-column prop="creatorId" header-align="center" align="center" label="创建人"> </el-table-column>
</el-table-column> <el-table-column prop="creatorName" header-align="center" align="center" label="创建人姓名"> </el-table-column>
<el-table-column <el-table-column prop="createTime" header-align="center" align="center" label="创建时间"> </el-table-column>
prop="id" <el-table-column prop="updaterId" header-align="center" align="center" label="更新人"> </el-table-column>
header-align="center" <el-table-column prop="updaterName" header-align="center" align="center" label="更新人姓名"> </el-table-column>
align="center" <el-table-column prop="updateTime" header-align="center" align="center" label="更新时间"> </el-table-column>
label="ID"> <el-table-column prop="version" header-align="center" align="center" label="版本号"> </el-table-column>
</el-table-column> <el-table-column fixed="right" header-align="center" align="center" width="150" label="操作">
<el-table-column <template slot-scope="scope">
prop="workshopSectionId" <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
header-align="center" <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
align="center" </template>
label="工段ID"> </el-table-column>
</el-table-column> </el-table>
<el-table-column <el-pagination
prop="equipmentId" @size-change="sizeChangeHandle"
header-align="center" @current-change="currentChangeHandle"
align="center" :current-page="pageIndex"
label="设备ID"> :page-sizes="[10, 20, 50, 100]"
</el-table-column> :page-size="pageSize"
<el-table-column :total="totalPage"
prop="sort" layout="total, sizes, prev, pager, next, jumper"
header-align="center" >
align="center" </el-pagination>
label="排序"> <!-- 弹窗, 新增 / 修改 -->
</el-table-column> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
<el-table-column </div>
prop="remark"
header-align="center"
align="center"
label="备注">
</el-table-column>
<el-table-column
prop="valid"
header-align="center"
align="center"
label="删除标志,是否有效:1 可用 0不可用">
</el-table-column>
<el-table-column
prop="creatorId"
header-align="center"
align="center"
label="创建人">
</el-table-column>
<el-table-column
prop="creatorName"
header-align="center"
align="center"
label="创建人姓名">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
label="创建时间">
</el-table-column>
<el-table-column
prop="updaterId"
header-align="center"
align="center"
label="更新人">
</el-table-column>
<el-table-column
prop="updaterName"
header-align="center"
align="center"
label="更新人姓名">
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
label="更新时间">
</el-table-column>
<el-table-column
prop="version"
header-align="center"
align="center"
label="版本号">
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="150"
label="操作">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</template> </template>
<script> <script>
import AddOrUpdate from './workshopsectionequipment-add-or-update' import AddOrUpdate from './workshopsectionequipment-add-or-update'
export default { export default {
data () { data() {
return { return {
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false addOrUpdateVisible: false
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
activated () { activated() {
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/workshopsectionequipment/page'), url: this.$http.adornUrl('/monitoring/workshopsectionequipment/page'),
method: 'get', method: 'get',
params: this.$http.adornParams({ params: this.$http.adornParams({
'page': this.pageIndex, page: this.pageIndex,
'limit': this.pageSize, limit: this.pageSize,
'key': this.dataForm.key key: this.dataForm.key
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.data.list this.dataList = data.data.list
this.totalPage = data.data.total this.totalPage = data.data.total
} else { } else {
this.dataList = [] this.dataList = []
this.totalPage = 0 this.totalPage = 0
} }
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
selectionChangeHandle (val) { selectionChangeHandle(val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.init(id) this.$refs.addOrUpdate.init(id)
}) })
}, },
// //
deleteHandle (id) { deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id
return item.id ? [id]
}) : this.dataListSelections.map(item => {
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { return item.id
confirmButtonText: '确定', })
cancelButtonText: '取消', this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
type: 'warning' confirmButtonText: '确定',
}).then(() => { cancelButtonText: '取消',
this.$http({ type: 'warning'
url: this.$http.adornUrl('/monitoring/workshopsectionequipment/delete'), }).then(() => {
method: 'post', this.$http({
data: this.$http.adornData(ids, false) url: this.$http.adornUrl('/monitoring/workshopsectionequipment/delete'),
}).then(({data}) => { method: 'post',
if (data && data.code === 0) { data: this.$http.adornData(ids, false)
this.$message({ }).then(({ data }) => {
message: '操作成功', if (data && data.code === 0) {
type: 'success', this.$message({
duration: 1500, message: '操作成功',
onClose: () => { type: 'success',
this.getDataList() duration: 1500,
} onClose: () => {
}) this.getDataList()
} else { }
this.$message.error(data.msg) })
} } else {
}) this.$message.error(data.msg)
}) }
} })
} })
} }
}
}
</script> </script>

View File

@ -1,219 +1,184 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="产线ID" prop="productionLineId">
:visible.sync="visible"> <el-input v-model="dataForm.productionLineId" placeholder="产线ID"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="产线ID" prop="productionLineId"> <el-form-item label="编码" prop="code">
<el-input v-model="dataForm.productionLineId" placeholder="产线ID"></el-input> <el-input v-model="dataForm.code" placeholder="编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="编码" prop="code"> <el-form-item label="名称" prop="name">
<el-input v-model="dataForm.code" placeholder="编码"></el-input> <el-input v-model="dataForm.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="名称" prop="name"> <el-form-item label="描述" prop="description">
<el-input v-model="dataForm.name" placeholder="名称"></el-input> <el-input v-model="dataForm.description" placeholder="描述"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="description"> <el-form-item label="启用状态:0 、停用1、启用" prop="enabled">
<el-input v-model="dataForm.description" placeholder="描述"></el-input> <el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="启用状态:0 、停用1、启用" prop="enabled"> <el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.enabled" placeholder="启用状态:0 、停用1、启用"></el-input> <el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="sort"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> <el-form-item label="外部系统编码" prop="externalCode">
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="外部系统编码" prop="externalCode"> </el-form>
<el-input v-model="dataForm.externalCode" placeholder="外部系统编码"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
productionLineId: '', productionLineId: '',
code: '', code: '',
name: '', name: '',
description: '', description: '',
enabled: '', enabled: '',
sort: '', sort: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '', version: '',
externalCode: '' externalCode: ''
}, },
dataRule: { dataRule: {
productionLineId: [ productionLineId: [{ required: true, message: '产线ID不能为空', trigger: 'blur' }],
{ required: true, message: '产线ID不能为空', trigger: 'blur' } code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
], name: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
code: [ description: [{ required: true, message: '描述不能为空', trigger: 'blur' }],
{ required: true, message: '编码不能为空', trigger: 'blur' } enabled: [{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' }],
], sort: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
name: [ remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
{ required: true, message: '名称不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
description: [ creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '描述不能为空', trigger: 'blur' } createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
], updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
enabled: [ updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '启用状态:0 、停用1、启用不能为空', trigger: 'blur' } updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
], version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }],
sort: [ externalCode: [{ required: true, message: '外部系统编码不能为空', trigger: 'blur' }]
{ required: true, message: '排序不能为空', trigger: 'blur' } }
], }
remark: [ },
{ required: true, message: '备注不能为空', trigger: 'blur' } methods: {
], init(id) {
valid: [ this.dataForm.id = id || 0
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } this.visible = true
], this.$nextTick(() => {
creatorId: [ this.$refs['dataForm'].resetFields()
{ required: true, message: '创建人不能为空', trigger: 'blur' } if (this.dataForm.id) {
], this.$http({
creatorName: [ url: this.$http.adornUrl(`/monitoring/workshopsection/info/${this.dataForm.id}`),
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } method: 'get',
], params: this.$http.adornParams()
createTime: [ }).then(({ data }) => {
{ required: true, message: '创建时间不能为空', trigger: 'blur' } if (data && data.code === 0) {
], this.dataForm.productionLineId = data.workshopSection.productionLineId
updaterId: [ this.dataForm.code = data.workshopSection.code
{ required: true, message: '更新人不能为空', trigger: 'blur' } this.dataForm.name = data.workshopSection.name
], this.dataForm.description = data.workshopSection.description
updaterName: [ this.dataForm.enabled = data.workshopSection.enabled
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.sort = data.workshopSection.sort
], this.dataForm.remark = data.workshopSection.remark
updateTime: [ this.dataForm.valid = data.workshopSection.valid
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.creatorId = data.workshopSection.creatorId
], this.dataForm.creatorName = data.workshopSection.creatorName
version: [ this.dataForm.createTime = data.workshopSection.createTime
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.updaterId = data.workshopSection.updaterId
], this.dataForm.updaterName = data.workshopSection.updaterName
externalCode: [ this.dataForm.updateTime = data.workshopSection.updateTime
{ required: true, message: '外部系统编码不能为空', trigger: 'blur' } this.dataForm.version = data.workshopSection.version
] this.dataForm.externalCode = data.workshopSection.externalCode
} }
} })
}, }
methods: { })
init (id) { },
this.dataForm.id = id || 0 //
this.visible = true dataFormSubmit() {
this.$nextTick(() => { this.$refs['dataForm'].validate(valid => {
this.$refs['dataForm'].resetFields() if (valid) {
if (this.dataForm.id) { this.$http({
this.$http({ url: this.$http.adornUrl(`/monitoring/workshopsection/${!this.dataForm.id ? 'save' : 'update'}`),
url: this.$http.adornUrl(`/monitoring/workshopsection/info/${this.dataForm.id}`), method: 'post',
method: 'get', data: this.$http.adornData({
params: this.$http.adornParams() id: this.dataForm.id || undefined,
}).then(({data}) => { productionLineId: this.dataForm.productionLineId,
if (data && data.code === 0) { code: this.dataForm.code,
this.dataForm.productionLineId = data.workshopSection.productionLineId name: this.dataForm.name,
this.dataForm.code = data.workshopSection.code description: this.dataForm.description,
this.dataForm.name = data.workshopSection.name enabled: this.dataForm.enabled,
this.dataForm.description = data.workshopSection.description sort: this.dataForm.sort,
this.dataForm.enabled = data.workshopSection.enabled remark: this.dataForm.remark,
this.dataForm.sort = data.workshopSection.sort valid: this.dataForm.valid,
this.dataForm.remark = data.workshopSection.remark creatorId: this.dataForm.creatorId,
this.dataForm.valid = data.workshopSection.valid creatorName: this.dataForm.creatorName,
this.dataForm.creatorId = data.workshopSection.creatorId createTime: this.dataForm.createTime,
this.dataForm.creatorName = data.workshopSection.creatorName updaterId: this.dataForm.updaterId,
this.dataForm.createTime = data.workshopSection.createTime updaterName: this.dataForm.updaterName,
this.dataForm.updaterId = data.workshopSection.updaterId updateTime: this.dataForm.updateTime,
this.dataForm.updaterName = data.workshopSection.updaterName version: this.dataForm.version,
this.dataForm.updateTime = data.workshopSection.updateTime externalCode: this.dataForm.externalCode
this.dataForm.version = data.workshopSection.version })
this.dataForm.externalCode = data.workshopSection.externalCode }).then(({ data }) => {
} if (data && data.code === 0) {
}) this.$message({
} message: '操作成功',
}) type: 'success',
}, duration: 1500,
// onClose: () => {
dataFormSubmit () { this.visible = false
this.$refs['dataForm'].validate((valid) => { this.$emit('refreshDataList')
if (valid) { }
this.$http({ })
url: this.$http.adornUrl(`/monitoring/workshopsection/${!this.dataForm.id ? 'save' : 'update'}`), } else {
method: 'post', this.$message.error(data.msg)
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, })
'productionLineId': this.dataForm.productionLineId, }
'code': this.dataForm.code, })
'name': this.dataForm.name, }
'description': this.dataForm.description, }
'enabled': this.dataForm.enabled, }
'sort': this.dataForm.sort,
'remark': this.dataForm.remark,
'valid': this.dataForm.valid,
'creatorId': this.dataForm.creatorId,
'creatorName': this.dataForm.creatorName,
'createTime': this.dataForm.createTime,
'updaterId': this.dataForm.updaterId,
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version,
'externalCode': this.dataForm.externalCode
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,183 +1,156 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
:close-on-click-modal="false" <el-form-item label="工段ID" prop="workshopSectionId">
:visible.sync="visible"> <el-input v-model="dataForm.workshopSectionId" placeholder="工段ID"></el-input>
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px"> </el-form-item>
<el-form-item label="工段ID" prop="workshopSectionId"> <el-form-item label="设备ID" prop="equipmentId">
<el-input v-model="dataForm.workshopSectionId" placeholder="工段ID"></el-input> <el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备ID" prop="equipmentId"> <el-form-item label="排序" prop="sort">
<el-input v-model="dataForm.equipmentId" placeholder="设备ID"></el-input> <el-input v-model="dataForm.sort" placeholder="排序"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="排序" prop="sort"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.sort" placeholder="排序"></el-input> <el-input v-model="dataForm.remark" placeholder="备注"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid">
<el-input v-model="dataForm.remark" placeholder="备注"></el-input> <el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="删除标志,是否有效:1 可用 0不可用" prop="valid"> <el-form-item label="创建人" prop="creatorId">
<el-input v-model="dataForm.valid" placeholder="删除标志,是否有效:1 可用 0不可用"></el-input> <el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人" prop="creatorId"> <el-form-item label="创建人姓名" prop="creatorName">
<el-input v-model="dataForm.creatorId" placeholder="创建人"></el-input> <el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建人姓名" prop="creatorName"> <el-form-item label="创建时间" prop="createTime">
<el-input v-model="dataForm.creatorName" placeholder="创建人姓名"></el-input> <el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="更新人" prop="updaterId">
<el-input v-model="dataForm.createTime" placeholder="创建时间"></el-input> <el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人" prop="updaterId"> <el-form-item label="更新人姓名" prop="updaterName">
<el-input v-model="dataForm.updaterId" placeholder="更新人"></el-input> <el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新人姓名" prop="updaterName"> <el-form-item label="更新时间" prop="updateTime">
<el-input v-model="dataForm.updaterName" placeholder="更新人姓名"></el-input> <el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="更新时间" prop="updateTime"> <el-form-item label="版本号" prop="version">
<el-input v-model="dataForm.updateTime" placeholder="更新时间"></el-input> <el-input v-model="dataForm.version" placeholder="版本号"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="版本号" prop="version"> </el-form>
<el-input v-model="dataForm.version" placeholder="版本号"></el-input> <span slot="footer" class="dialog-footer">
</el-form-item> <el-button @click="visible = false">取消</el-button>
</el-form> <el-button type="primary" @click="dataFormSubmit()">确定</el-button>
<span slot="footer" class="dialog-footer"> </span>
<el-button @click="visible = false">取消</el-button> </el-dialog>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</span>
</el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: 0, id: 0,
workshopSectionId: '', workshopSectionId: '',
equipmentId: '', equipmentId: '',
sort: '', sort: '',
remark: '', remark: '',
valid: '', valid: '',
creatorId: '', creatorId: '',
creatorName: '', creatorName: '',
createTime: '', createTime: '',
updaterId: '', updaterId: '',
updaterName: '', updaterName: '',
updateTime: '', updateTime: '',
version: '' version: ''
}, },
dataRule: { dataRule: {
workshopSectionId: [ workshopSectionId: [{ required: true, message: '工段ID不能为空', trigger: 'blur' }],
{ required: true, message: '工段ID不能为空', trigger: 'blur' } equipmentId: [{ required: true, message: '设备ID不能为空', trigger: 'blur' }],
], sort: [{ required: true, message: '排序不能为空', trigger: 'blur' }],
equipmentId: [ remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
{ required: true, message: '设备ID不能为空', trigger: 'blur' } valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
], creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
sort: [ creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '排序不能为空', trigger: 'blur' } createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
], updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
remark: [ updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
{ required: true, message: '备注不能为空', trigger: 'blur' } updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
], version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
valid: [ }
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' } }
], },
creatorId: [ methods: {
{ required: true, message: '创建人不能为空', trigger: 'blur' } init(id) {
], this.dataForm.id = id || 0
creatorName: [ this.visible = true
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' } this.$nextTick(() => {
], this.$refs['dataForm'].resetFields()
createTime: [ if (this.dataForm.id) {
{ required: true, message: '创建时间不能为空', trigger: 'blur' } this.$http({
], url: this.$http.adornUrl(`/monitoring/workshopsectionequipment/info/${this.dataForm.id}`),
updaterId: [ method: 'get',
{ required: true, message: '更新人不能为空', trigger: 'blur' } params: this.$http.adornParams()
], }).then(({ data }) => {
updaterName: [ if (data && data.code === 0) {
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' } this.dataForm.workshopSectionId = data.workshopSectionEquipment.workshopSectionId
], this.dataForm.equipmentId = data.workshopSectionEquipment.equipmentId
updateTime: [ this.dataForm.sort = data.workshopSectionEquipment.sort
{ required: true, message: '更新时间不能为空', trigger: 'blur' } this.dataForm.remark = data.workshopSectionEquipment.remark
], this.dataForm.valid = data.workshopSectionEquipment.valid
version: [ this.dataForm.creatorId = data.workshopSectionEquipment.creatorId
{ required: true, message: '版本号不能为空', trigger: 'blur' } this.dataForm.creatorName = data.workshopSectionEquipment.creatorName
] this.dataForm.createTime = data.workshopSectionEquipment.createTime
} this.dataForm.updaterId = data.workshopSectionEquipment.updaterId
} this.dataForm.updaterName = data.workshopSectionEquipment.updaterName
}, this.dataForm.updateTime = data.workshopSectionEquipment.updateTime
methods: { this.dataForm.version = data.workshopSectionEquipment.version
init (id) { }
this.dataForm.id = id || 0 })
this.visible = true }
this.$nextTick(() => { })
this.$refs['dataForm'].resetFields() },
if (this.dataForm.id) { //
this.$http({ dataFormSubmit() {
url: this.$http.adornUrl(`/monitoring/workshopsectionequipment/info/${this.dataForm.id}`), this.$refs['dataForm'].validate(valid => {
method: 'get', if (valid) {
params: this.$http.adornParams() this.$http({
}).then(({data}) => { url: this.$http.adornUrl(`/monitoring/workshopsectionequipment/${!this.dataForm.id ? 'save' : 'update'}`),
if (data && data.code === 0) { method: 'post',
this.dataForm.workshopSectionId = data.workshopSectionEquipment.workshopSectionId data: this.$http.adornData({
this.dataForm.equipmentId = data.workshopSectionEquipment.equipmentId id: this.dataForm.id || undefined,
this.dataForm.sort = data.workshopSectionEquipment.sort workshopSectionId: this.dataForm.workshopSectionId,
this.dataForm.remark = data.workshopSectionEquipment.remark equipmentId: this.dataForm.equipmentId,
this.dataForm.valid = data.workshopSectionEquipment.valid sort: this.dataForm.sort,
this.dataForm.creatorId = data.workshopSectionEquipment.creatorId remark: this.dataForm.remark,
this.dataForm.creatorName = data.workshopSectionEquipment.creatorName valid: this.dataForm.valid,
this.dataForm.createTime = data.workshopSectionEquipment.createTime creatorId: this.dataForm.creatorId,
this.dataForm.updaterId = data.workshopSectionEquipment.updaterId creatorName: this.dataForm.creatorName,
this.dataForm.updaterName = data.workshopSectionEquipment.updaterName createTime: this.dataForm.createTime,
this.dataForm.updateTime = data.workshopSectionEquipment.updateTime updaterId: this.dataForm.updaterId,
this.dataForm.version = data.workshopSectionEquipment.version updaterName: this.dataForm.updaterName,
} updateTime: this.dataForm.updateTime,
}) version: this.dataForm.version
} })
}) }).then(({ data }) => {
}, if (data && data.code === 0) {
// this.$message({
dataFormSubmit () { message: '操作成功',
this.$refs['dataForm'].validate((valid) => { type: 'success',
if (valid) { duration: 1500,
this.$http({ onClose: () => {
url: this.$http.adornUrl(`/monitoring/workshopsectionequipment/${!this.dataForm.id ? 'save' : 'update'}`), this.visible = false
method: 'post', this.$emit('refreshDataList')
data: this.$http.adornData({ }
'id': this.dataForm.id || undefined, })
'workshopSectionId': this.dataForm.workshopSectionId, } else {
'equipmentId': this.dataForm.equipmentId, this.$message.error(data.msg)
'sort': this.dataForm.sort, }
'remark': this.dataForm.remark, })
'valid': this.dataForm.valid, }
'creatorId': this.dataForm.creatorId, })
'creatorName': this.dataForm.creatorName, }
'createTime': this.dataForm.createTime, }
'updaterId': this.dataForm.updaterId, }
'updaterName': this.dataForm.updaterName,
'updateTime': this.dataForm.updateTime,
'version': this.dataForm.version
})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
} else {
this.$message.error(data.msg)
}
})
}
})
}
}
}
</script> </script>

View File

@ -1,65 +1,58 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="$t('oss.upload')" :close-on-click-modal="false" :close-on-press-escape="false"> <el-dialog :visible.sync="visible" :title="$t('oss.upload')" :close-on-click-modal="false" :close-on-press-escape="false">
<el-upload <el-upload :action="url" :file-list="fileList" drag multiple :before-upload="beforeUploadHandle" :on-success="successHandle" class="text-center">
:action="url" <i class="el-icon-upload"></i>
:file-list="fileList" <div class="el-upload__text" v-html="$t('upload.text')"></div>
drag <div class="el-upload__tip" slot="tip">{{ $t('upload.tip', { format: 'jpg、png、gif' }) }}</div>
multiple </el-upload>
:before-upload="beforeUploadHandle" </el-dialog>
: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> </template>
<script> <script>
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
url: '', url: '',
num: 0, num: 0,
fileList: [] fileList: []
} }
}, },
methods: { methods: {
init () { init() {
this.visible = true this.visible = true
this.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}` this.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/upload?token=${Cookies.get('token')}`
this.num = 0 this.num = 0
this.fileList = [] this.fileList = []
}, },
// //
beforeUploadHandle (file) { beforeUploadHandle(file) {
if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') { 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' })) this.$message.error(this.$t('upload.tip', { format: 'jpg、png、gif' }))
return false return false
} }
this.num++ this.num++
}, },
// //
successHandle (res, file, fileList) { successHandle(res, file, fileList) {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.fileList = fileList this.fileList = fileList
this.num-- this.num--
if (this.num === 0) { if (this.num === 0) {
this.$message({ this.$message({
message: this.$t('prompt.success'), message: this.$t('prompt.success'),
type: 'success', type: 'success',
duration: 500, duration: 500,
onClose: () => { onClose: () => {
this.visible = false this.visible = false
this.$emit('refreshDataList') this.$emit('refreshDataList')
} }
}) })
} }
} }
} }
} }
</script> </script>

View File

@ -1,48 +1,43 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-oss__oss"> <div class="mod-oss__oss">
<el-form :inline="true" :model="dataForm"> <el-form :inline="true" :model="dataForm">
<el-form-item> <el-form-item>
<el-button type="primary" @click="configHandle()">{{ $t('oss.config') }}</el-button> <el-button type="primary" @click="configHandle()">{{ $t('oss.config') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="uploadHandle()">{{ $t('oss.upload') }}</el-button> <el-button type="primary" @click="uploadHandle()">{{ $t('oss.upload') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
:data="dataList" <el-table-column prop="url" :label="$t('oss.url')" header-align="center" align="center"></el-table-column>
border <el-table-column prop="createDate" :label="$t('oss.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
@selection-change="dataListSelectionChangeHandle" <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
@sort-change="dataListSortChangeHandle" <template slot-scope="scope">
style="width: 100%;"> <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> </template>
<el-table-column prop="url" :label="$t('oss.url')" header-align="center" align="center"></el-table-column> </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>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-pagination
<template slot-scope="scope"> :current-page="page"
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> :page-sizes="[10, 20, 50, 100]"
</template> :page-size="limit"
</el-table-column> :total="total"
</el-table> layout="total, sizes, prev, pager, next, jumper"
<el-pagination @size-change="pageSizeChangeHandle"
:current-page="page" @current-change="pageCurrentChangeHandle"
:page-sizes="[10, 20, 50, 100]" >
:page-size="limit" </el-pagination>
:total="total" <!-- 弹窗, 云存储配置 -->
layout="total, sizes, prev, pager, next, jumper" <config v-if="configVisible" ref="config"></config>
@size-change="pageSizeChangeHandle" <!-- 弹窗, 上传文件 -->
@current-change="pageCurrentChangeHandle"> <upload v-if="uploadVisible" ref="upload" @refreshDataList="getDataList"></upload>
</el-pagination> </div>
<!-- 弹窗, 云存储配置 --> </el-card>
<config v-if="configVisible" ref="config"></config>
<!-- 弹窗, 上传文件 -->
<upload v-if="uploadVisible" ref="upload" @refreshDataList="getDataList"></upload>
</div>
</el-card>
</template> </template>
<script> <script>
@ -50,39 +45,39 @@ import mixinViewModule from '@/mixins/view-module'
import Config from './oss-config' import Config from './oss-config'
import Upload from './oss-upload' import Upload from './oss-upload'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/oss/page', getDataListURL: '/sys/oss/page',
getDataListIsPage: true, getDataListIsPage: true,
deleteURL: '/sys/oss', deleteURL: '/sys/oss',
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: {}, dataForm: {},
configVisible: false, configVisible: false,
uploadVisible: false uploadVisible: false
} }
}, },
components: { components: {
Config, Config,
Upload Upload
}, },
methods: { methods: {
// //
configHandle () { configHandle() {
this.configVisible = true this.configVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.config.init() this.$refs.config.init()
}) })
}, },
// //
uploadHandle () { uploadHandle() {
this.uploadVisible = true this.uploadVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.upload.init() this.$refs.upload.init()
}) })
} }
} }
} }
</script> </script>

View File

@ -1,43 +1,43 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dept"> <div class="mod-sys__dept">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:dept:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('sys:dept:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;">
<el-table-column prop="name" :label="$t('dept.name')" header-align="center" min-width="150"></el-table-column> <el-table-column prop="name" :label="$t('dept.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="parentName" :label="$t('dept.parentName')" header-align="center" align="center"></el-table-column> <el-table-column prop="parentName" :label="$t('dept.parentName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="sort" :label="$t('dept.sort')" header-align="center" align="center" width="80"></el-table-column> <el-table-column prop="sort" :label="$t('dept.sort')" header-align="center" align="center" width="80"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="$hasPermission('sys:dept:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> <el-button v-if="$hasPermission('sys:dept:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:dept:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> <el-button v-if="$hasPermission('sys:dept:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './dept-add-or-update' import AddOrUpdate from './dept-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/dept/list', getDataListURL: '/sys/dept/list',
deleteURL: '/sys/dept' deleteURL: '/sys/dept'
} }
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
} }
} }
</script> </script>

View File

@ -1,96 +1,91 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dict"> <div class="mod-sys__dict">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')" clearable></el-input> <el-input v-model="dataForm.dictValue" :placeholder="$t('dict.dictValue')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input v-model="dataForm.dictLabel" :placeholder="$t('dict.dictLabel')" clearable></el-input> <el-input v-model="dataForm.dictLabel" :placeholder="$t('dict.dictLabel')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
:data="dataList" <el-table-column prop="dictValue" :label="$t('dict.dictValue')" header-align="center" align="center"></el-table-column>
border <el-table-column prop="dictLabel" :label="$t('dict.dictLabel')" header-align="center" align="center"></el-table-column>
@selection-change="dataListSelectionChangeHandle" <el-table-column prop="sort" :label="$t('dict.sort')" sortable="custom" header-align="center" align="center"></el-table-column>
@sort-change="dataListSortChangeHandle" <el-table-column prop="remark" :label="$t('dict.remark')" header-align="center" align="center"></el-table-column>
style="width: 100%;"> <el-table-column prop="createDate" :label="$t('dict.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<el-table-column prop="dictValue" :label="$t('dict.dictValue')" header-align="center" align="center"></el-table-column> <template slot-scope="scope">
<el-table-column prop="dictLabel" :label="$t('dict.dictLabel')" header-align="center" align="center"></el-table-column> <el-button v-if="$hasPermission('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-table-column prop="sort" :label="$t('dict.sort')" sortable="custom" header-align="center" align="center"></el-table-column> <el-button v-if="$hasPermission('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-table-column prop="remark" :label="$t('dict.remark')" header-align="center" align="center"></el-table-column> </template>
<el-table-column prop="createDate" :label="$t('dict.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> </el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> </el-table>
<template slot-scope="scope"> <el-pagination
<el-button v-if="$hasPermission('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> :current-page="page"
<el-button v-if="$hasPermission('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> :page-sizes="[10, 20, 50, 100]"
</template> :page-size="limit"
</el-table-column> :total="total"
</el-table> layout="total, sizes, prev, pager, next, jumper"
<el-pagination @size-change="pageSizeChangeHandle"
:current-page="page" @current-change="pageCurrentChangeHandle"
:page-sizes="[10, 20, 50, 100]" >
:page-size="limit" </el-pagination>
:total="total" <!-- 弹窗, 新增 / 修改 -->
layout="total, sizes, prev, pager, next, jumper" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
@size-change="pageSizeChangeHandle" </div>
@current-change="pageCurrentChangeHandle"> </el-card>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './dict-data-add-or-update' import AddOrUpdate from './dict-data-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
createdIsNeed: false, createdIsNeed: false,
getDataListURL: '/sys/dict/data/page', getDataListURL: '/sys/dict/data/page',
getDataListIsPage: true, getDataListIsPage: true,
deleteURL: '/sys/dict/data', deleteURL: '/sys/dict/data',
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: { dataForm: {
dictTypeId: '0', dictTypeId: '0',
dictLabel: '', dictLabel: '',
dictValue: '' dictValue: ''
} }
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
created () { created() {
this.dataForm.dictTypeId = this.$route.params.dictTypeId || '0' this.dataForm.dictTypeId = this.$route.params.dictTypeId || '0'
this.getDataList() this.getDataList()
}, },
methods: { methods: {
// / // /
addOrUpdateHandle (id) { addOrUpdateHandle(id) {
this.addOrUpdateVisible = true this.addOrUpdateVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.addOrUpdate.dataForm.id = id this.$refs.addOrUpdate.dataForm.id = id
this.$refs.addOrUpdate.dataForm.dictTypeId = this.dataForm.dictTypeId this.$refs.addOrUpdate.dataForm.dictTypeId = this.dataForm.dictTypeId
this.$refs.addOrUpdate.init() this.$refs.addOrUpdate.init()
}) })
} }
} }
} }
</script> </script>

View File

@ -1,100 +1,103 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="dictName" :label="$t('dict.dictName')"> <el-form-item prop="dictName" :label="$t('dict.dictName')">
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input> <el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="dictType" :label="$t('dict.dictType')"> <el-form-item prop="dictType" :label="$t('dict.dictType')">
<el-input v-model="dataForm.dictType" :placeholder="$t('dict.dictType')"></el-input> <el-input v-model="dataForm.dictType" :placeholder="$t('dict.dictType')"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="sort" :label="$t('dict.sort')"> <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-input-number v-model="dataForm.sort" controls-position="right" :min="0" :label="$t('dict.sort')"></el-input-number>
</el-form-item> </el-form-item>
<el-form-item prop="remark" :label="$t('dict.remark')"> <el-form-item prop="remark" :label="$t('dict.remark')">
<el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input> <el-input v-model="dataForm.remark" :placeholder="$t('dict.remark')"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> <el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
dictName: '', dictName: '',
dictType: '', dictType: '',
sort: 0, sort: 0,
remark: '' remark: ''
} }
} }
}, },
computed: { computed: {
dataRule () { dataRule() {
return { return {
dictName: [ dictName: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
{ 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' }]
dictType: [ }
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } }
], },
sort: [ methods: {
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } init() {
] this.visible = true
} this.$nextTick(() => {
} this.$refs['dataForm'].resetFields()
}, if (this.dataForm.id) {
methods: { this.getInfo()
init () { }
this.visible = true })
this.$nextTick(() => { },
this.$refs['dataForm'].resetFields() //
if (this.dataForm.id) { getInfo() {
this.getInfo() this.$http
} .get(this.$http.adornUrl(`/sys/dict/type/${this.dataForm.id}`))
}) .then(({ data: res }) => {
}, if (res.code !== 0) {
// return this.$message.error(res.msg)
getInfo () { }
this.$http.get(this.$http.adornUrl(`/sys/dict/type/${this.dataForm.id}`)).then(({ data: res }) => { this.dataForm = {
if (res.code !== 0) { ...this.dataForm,
return this.$message.error(res.msg) ...res.data
} }
this.dataForm = { })
...this.dataForm, .catch(() => {})
...res.data },
} //
}).catch(() => {}) dataFormSubmitHandle: debounce(
}, function() {
// this.$refs['dataForm'].validate(valid => {
dataFormSubmitHandle: debounce(function () { if (!valid) {
this.$refs['dataForm'].validate((valid) => { return false
if (!valid) { }
return false this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dict/type', this.dataForm)
} .then(({ data: res }) => {
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dict/type', this.dataForm).then(({ data: res }) => { if (res.code !== 0) {
if (res.code !== 0) { return this.$message.error(res.msg)
return this.$message.error(res.msg) }
} this.$message({
this.$message({ message: this.$t('prompt.success'),
message: this.$t('prompt.success'), type: 'success',
type: 'success', duration: 500,
duration: 500, onClose: () => {
onClose: () => { this.visible = false
this.visible = false this.$emit('refreshDataList')
this.$emit('refreshDataList') }
} })
}) })
}).catch(() => {}) .catch(() => {})
}) })
}, 1000, { 'leading': true, 'trailing': false }) },
} 1000,
{ leading: true, trailing: false }
)
}
} }
</script> </script>

View File

@ -1,60 +1,55 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__dict"> <div class="mod-sys__dict">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')" clearable></el-input> <el-input v-model="dataForm.dictName" :placeholder="$t('dict.dictName')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-input v-model="dataForm.dictType" :placeholder="$t('dict.dictType')" clearable></el-input> <el-input v-model="dataForm.dictType" :placeholder="$t('dict.dictType')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('sys:dict:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button v-if="$hasPermission('sys:dict:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
:data="dataList" <el-table-column prop="dictName" :label="$t('dict.dictName')" header-align="center" align="center"></el-table-column>
border <el-table-column prop="dictType" :label="$t('dict.dictType')" header-align="center" align="center">
@selection-change="dataListSelectionChangeHandle" <template slot-scope="scope">
@sort-change="dataListSortChangeHandle" <el-button type="text" @click="childHandle(scope.row)">{{ scope.row.dictType }}</el-button>
style="width: 100%;"> </template>
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> </el-table-column>
<el-table-column prop="dictName" :label="$t('dict.dictName')" header-align="center" align="center"></el-table-column> <el-table-column prop="sort" :label="$t('dict.sort')" sortable="custom" header-align="center" align="center"></el-table-column>
<el-table-column prop="dictType" :label="$t('dict.dictType')" header-align="center" align="center"> <el-table-column prop="remark" :label="$t('dict.remark')" header-align="center" align="center"></el-table-column>
<template slot-scope="scope"> <el-table-column prop="createDate" :label="$t('dict.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<el-button type="text" @click="childHandle(scope.row)">{{ scope.row.dictType }}</el-button> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
</template> <template slot-scope="scope">
</el-table-column> <el-button v-if="$hasPermission('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-table-column prop="sort" :label="$t('dict.sort')" sortable="custom" header-align="center" align="center"></el-table-column> <el-button v-if="$hasPermission('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-table-column prop="remark" :label="$t('dict.remark')" header-align="center" align="center"></el-table-column> </template>
<el-table-column prop="createDate" :label="$t('dict.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> </el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> </el-table>
<template slot-scope="scope"> <el-pagination
<el-button v-if="$hasPermission('sys:dict:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> :current-page="page"
<el-button v-if="$hasPermission('sys:dict:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> :page-sizes="[10, 20, 50, 100]"
</template> :page-size="limit"
</el-table-column> :total="total"
</el-table> layout="total, sizes, prev, pager, next, jumper"
<el-pagination @size-change="pageSizeChangeHandle"
:current-page="page" @current-change="pageCurrentChangeHandle"
:page-sizes="[10, 20, 50, 100]" >
:page-size="limit" </el-pagination>
:total="total" <!-- 弹窗, 新增 / 修改 -->
layout="total, sizes, prev, pager, next, jumper" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
@size-change="pageSizeChangeHandle" </div>
@current-change="pageCurrentChangeHandle"> </el-card>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template> </template>
<script> <script>
@ -62,40 +57,40 @@ import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './dict-type-add-or-update' import AddOrUpdate from './dict-type-add-or-update'
import { addDynamicRoute } from '@/router' import { addDynamicRoute } from '@/router'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/dict/type/page', getDataListURL: '/sys/dict/type/page',
getDataListIsPage: true, getDataListIsPage: true,
deleteURL: '/sys/dict/type', deleteURL: '/sys/dict/type',
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: { dataForm: {
id: '0', id: '0',
dictName: '', dictName: '',
dictType: '' dictType: ''
} }
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
}, },
methods: { methods: {
// //
childHandle (row) { childHandle(row) {
// //
const routeParams = { const routeParams = {
routeName: `${this.$route.name}__${row.id}`, routeName: `${this.$route.name}__${row.id}`,
title: `${this.$route.meta.title} - ${row.dictType}`, title: `${this.$route.meta.title} - ${row.dictType}`,
path: 'sys/dict-data', path: 'sys/dict-data',
params: { params: {
dictTypeId: row.id dictTypeId: row.id
} }
} }
// //
addDynamicRoute(routeParams, this.$router) addDynamicRoute(routeParams, this.$router)
} }
} }
} }
</script> </script>

View File

@ -1,65 +1,73 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-error"> <div class="mod-sys__log-error">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button> <el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table-column prop="requestUri" :label="$t('logError.requestUri')" header-align="center" align="center"></el-table-column> <el-table-column prop="requestUri" :label="$t('logError.requestUri')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestMethod" :label="$t('logError.requestMethod')" header-align="center" align="center"></el-table-column> <el-table-column prop="requestMethod" :label="$t('logError.requestMethod')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestParams" :label="$t('logError.requestParams')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> <el-table-column
<el-table-column prop="ip" :label="$t('logError.ip')" header-align="center" align="center"></el-table-column> prop="requestParams"
<el-table-column prop="userAgent" :label="$t('logError.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> :label="$t('logError.requestParams')"
<el-table-column prop="createDate" :label="$t('logError.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> header-align="center"
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> align="center"
<template slot-scope="scope"> width="150"
<el-button type="text" size="small" @click="infoHandle(scope.row.errorInfo)">{{ $t('logError.errorInfo') }}</el-button> :show-overflow-tooltip="true"
</template> ></el-table-column>
</el-table-column> <el-table-column prop="ip" :label="$t('logError.ip')" header-align="center" align="center"></el-table-column>
</el-table> <el-table-column prop="userAgent" :label="$t('logError.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-pagination <el-table-column prop="createDate" :label="$t('logError.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
:current-page="page" <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
:page-sizes="[10, 20, 50, 100]" <template slot-scope="scope">
:page-size="limit" <el-button type="text" size="small" @click="infoHandle(scope.row.errorInfo)">{{ $t('logError.errorInfo') }}</el-button>
:total="total" </template>
layout="total, sizes, prev, pager, next, jumper" </el-table-column>
@size-change="pageSizeChangeHandle" </el-table>
@current-change="pageCurrentChangeHandle"> <el-pagination
</el-pagination> :current-page="page"
</div> :page-sizes="[10, 20, 50, 100]"
</el-card> :page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"
>
</el-pagination>
</div>
</el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/log/error/page', getDataListURL: '/sys/log/error/page',
getDataListIsPage: true, getDataListIsPage: true,
exportURL: '/sys/log/error/export' exportURL: '/sys/log/error/export'
} }
} }
}, },
methods: { methods: {
// //
infoHandle (info) { infoHandle(info) {
this.$alert(info, this.$t('logError.errorInfo'), { this.$alert(info, this.$t('logError.errorInfo'), {
customClass: 'mod-sys__log-error-view-info' customClass: 'mod-sys__log-error-view-info'
}) })
} }
} }
} }
</script> </script>
<style lang="scss"> <style lang="scss">
.mod-sys__log-error { .mod-sys__log-error {
&-view-info { &-view-info {
width: 80%; width: 80%;
} }
} }
</style> </style>

View File

@ -1,71 +1,72 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-login"> <div class="mod-sys__log-login">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.creatorName" :placeholder="$t('logLogin.creatorName')" clearable></el-input> <el-input v-model="dataForm.creatorName" :placeholder="$t('logLogin.creatorName')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select v-model="dataForm.status" :placeholder="$t('logLogin.status')" clearable> <el-select v-model="dataForm.status" :placeholder="$t('logLogin.status')" clearable>
<el-option :label="$t('logLogin.status0')" :value="0"></el-option> <el-option :label="$t('logLogin.status0')" :value="0"></el-option>
<el-option :label="$t('logLogin.status1')" :value="1"></el-option> <el-option :label="$t('logLogin.status1')" :value="1"></el-option>
<el-option :label="$t('logLogin.status2')" :value="2"></el-option> <el-option :label="$t('logLogin.status2')" :value="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button> <el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table-column prop="creatorName" :label="$t('logLogin.creatorName')" header-align="center" align="center"></el-table-column> <el-table-column prop="creatorName" :label="$t('logLogin.creatorName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="operation" :label="$t('logLogin.operation')" header-align="center" align="center"> <el-table-column prop="operation" :label="$t('logLogin.operation')" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.operation === 0 ? $t('logLogin.operation0') : $t('logLogin.operation1') }} {{ scope.row.operation === 0 ? $t('logLogin.operation0') : $t('logLogin.operation1') }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" :label="$t('logLogin.status')" sortable="custom" header-align="center" align="center"> <el-table-column prop="status" :label="$t('logLogin.status')" sortable="custom" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('logLogin.status0') }}</el-tag> <el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('logLogin.status0') }}</el-tag>
<el-tag v-else-if="scope.row.status === 1" size="small" type="success">{{ $t('logLogin.status1') }}</el-tag> <el-tag v-else-if="scope.row.status === 1" size="small" type="success">{{ $t('logLogin.status1') }}</el-tag>
<el-tag v-else size="small" type="warning">{{ $t('logLogin.status2') }}</el-tag> <el-tag v-else size="small" type="warning">{{ $t('logLogin.status2') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="ip" :label="$t('logLogin.ip')" header-align="center" align="center"></el-table-column> <el-table-column prop="ip" :label="$t('logLogin.ip')" header-align="center" align="center"></el-table-column>
<el-table-column prop="userAgent" :label="$t('logLogin.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="userAgent" :label="$t('logLogin.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="createDate" :label="$t('logLogin.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> <el-table-column prop="createDate" :label="$t('logLogin.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
:current-page="page" :current-page="page"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="limit" :page-size="limit"
:total="total" :total="total"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle" @size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle"
</el-pagination> >
</div> </el-pagination>
</el-card> </div>
</el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/log/login/page', getDataListURL: '/sys/log/login/page',
getDataListIsPage: true, getDataListIsPage: true,
exportURL: '/sys/log/login/export' exportURL: '/sys/log/login/export'
}, },
dataForm: { dataForm: {
creatorName: '', creatorName: '',
status: '' status: ''
} }
} }
} }
} }
</script> </script>

View File

@ -1,69 +1,77 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__log-operation"> <div class="mod-sys__log-operation">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-select v-model="dataForm.status" :placeholder="$t('logOperation.status')" clearable> <el-select v-model="dataForm.status" :placeholder="$t('logOperation.status')" clearable>
<el-option :label="$t('logOperation.status0')" :value="0"></el-option> <el-option :label="$t('logOperation.status0')" :value="0"></el-option>
<el-option :label="$t('logOperation.status1')" :value="1"></el-option> <el-option :label="$t('logOperation.status1')" :value="1"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button> <el-button type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" border @sort-change="dataListSortChangeHandle" style="width: 100%;">
<el-table-column prop="creatorName" :label="$t('logOperation.creatorName')" header-align="center" align="center"></el-table-column> <el-table-column prop="creatorName" :label="$t('logOperation.creatorName')" header-align="center" align="center"></el-table-column>
<el-table-column prop="operation" :label="$t('logOperation.operation')" header-align="center" align="center"></el-table-column> <el-table-column prop="operation" :label="$t('logOperation.operation')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestUri" :label="$t('logOperation.requestUri')" header-align="center" align="center"></el-table-column> <el-table-column prop="requestUri" :label="$t('logOperation.requestUri')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestMethod" :label="$t('logOperation.requestMethod')" header-align="center" align="center"></el-table-column> <el-table-column prop="requestMethod" :label="$t('logOperation.requestMethod')" header-align="center" align="center"></el-table-column>
<el-table-column prop="requestParams" :label="$t('logOperation.requestParams')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> <el-table-column
<el-table-column prop="requestTime" :label="$t('logOperation.requestTime')" sortable="custom" header-align="center" align="center"> prop="requestParams"
<template slot-scope="scope"> :label="$t('logOperation.requestParams')"
{{ `${scope.row.requestTime}ms` }} header-align="center"
</template> align="center"
</el-table-column> width="150"
<el-table-column prop="status" :label="$t('logOperation.status')" sortable="custom" header-align="center" align="center"> :show-overflow-tooltip="true"
<template slot-scope="scope"> ></el-table-column>
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('logOperation.status0') }}</el-tag> <el-table-column prop="requestTime" :label="$t('logOperation.requestTime')" sortable="custom" header-align="center" align="center">
<el-tag v-else size="small" type="success">{{ $t('logOperation.status1') }}</el-tag> <template slot-scope="scope">
</template> {{ `${scope.row.requestTime}ms` }}
</el-table-column> </template>
<el-table-column prop="ip" :label="$t('logOperation.ip')" header-align="center" align="center"></el-table-column> </el-table-column>
<el-table-column prop="userAgent" :label="$t('logOperation.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="status" :label="$t('logOperation.status')" sortable="custom" header-align="center" align="center">
<el-table-column prop="createDate" :label="$t('logOperation.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> <template slot-scope="scope">
</el-table> <el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('logOperation.status0') }}</el-tag>
<el-pagination <el-tag v-else size="small" type="success">{{ $t('logOperation.status1') }}</el-tag>
:current-page="page" </template>
:page-sizes="[10, 20, 50, 100]" </el-table-column>
:page-size="limit" <el-table-column prop="ip" :label="$t('logOperation.ip')" header-align="center" align="center"></el-table-column>
:total="total" <el-table-column prop="userAgent" :label="$t('logOperation.userAgent')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
layout="total, sizes, prev, pager, next, jumper" <el-table-column prop="createDate" :label="$t('logOperation.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
@size-change="pageSizeChangeHandle" </el-table>
@current-change="pageCurrentChangeHandle"> <el-pagination
</el-pagination> :current-page="page"
</div> :page-sizes="[10, 20, 50, 100]"
</el-card> :page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"
>
</el-pagination>
</div>
</el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/log/operation/page', getDataListURL: '/sys/log/operation/page',
getDataListIsPage: true, getDataListIsPage: true,
exportURL: '/sys/log/operation/export' exportURL: '/sys/log/operation/export'
}, },
dataForm: { dataForm: {
status: '' status: ''
} }
} }
} }
} }
</script> </script>

View File

@ -1,55 +1,55 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__menu"> <div class="mod-sys__menu">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:menu:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('sys:menu:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" row-key="id" border style="width: 100%;">
<el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column> <el-table-column prop="name" :label="$t('menu.name')" header-align="center" min-width="150"></el-table-column>
<el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center"> <el-table-column prop="icon" :label="$t('menu.icon')" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg> <svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${scope.row.icon}`"></use></svg>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="type" :label="$t('menu.type')" header-align="center" align="center"> <el-table-column prop="type" :label="$t('menu.type')" header-align="center" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.type === 0" size="small">{{ $t('menu.type0') }}</el-tag> <el-tag v-if="scope.row.type === 0" size="small">{{ $t('menu.type0') }}</el-tag>
<el-tag v-else size="small" type="info">{{ $t('menu.type1') }}</el-tag> <el-tag v-else size="small" type="info">{{ $t('menu.type1') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column> <el-table-column prop="sort" :label="$t('menu.sort')" header-align="center" align="center"></el-table-column>
<el-table-column prop="url" :label="$t('menu.url')" header-align="center" align="center" width="150" :show-overflow-tooltip="true" ></el-table-column> <el-table-column prop="url" :label="$t('menu.url')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="permissions" :label="$t('menu.permissions')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="permissions" :label="$t('menu.permissions')" header-align="center" align="center" width="150" :show-overflow-tooltip="true"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="$hasPermission('sys:menu:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> <el-button v-if="$hasPermission('sys:menu:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:menu:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> <el-button v-if="$hasPermission('sys:menu:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div> </div>
</el-card> </el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './menu-add-or-update' import AddOrUpdate from './menu-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/menu/list', getDataListURL: '/sys/menu/list',
deleteURL: '/sys/menu' deleteURL: '/sys/menu'
} }
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
} }
} }
</script> </script>

View File

@ -1,93 +1,98 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="paramCode" :label="$t('params.paramCode')"> <el-form-item prop="paramCode" :label="$t('params.paramCode')">
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input> <el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="paramValue" :label="$t('params.paramValue')"> <el-form-item prop="paramValue" :label="$t('params.paramValue')">
<el-input v-model="dataForm.paramValue" :placeholder="$t('params.paramValue')"></el-input> <el-input v-model="dataForm.paramValue" :placeholder="$t('params.paramValue')"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="remark" :label="$t('params.remark')"> <el-form-item prop="remark" :label="$t('params.remark')">
<el-input v-model="dataForm.remark" :placeholder="$t('params.remark')"></el-input> <el-input v-model="dataForm.remark" :placeholder="$t('params.remark')"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template slot="footer"> <template slot="footer">
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> <el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
</template> </template>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: '', id: '',
paramCode: '', paramCode: '',
paramValue: '', paramValue: '',
remark: '' remark: ''
} }
} }
}, },
computed: { computed: {
dataRule () { dataRule() {
return { return {
paramCode: [ paramCode: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } paramValue: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
], }
paramValue: [ }
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } },
] methods: {
} init() {
} this.visible = true
}, this.$nextTick(() => {
methods: { this.$refs['dataForm'].resetFields()
init () { if (this.dataForm.id) {
this.visible = true this.getInfo()
this.$nextTick(() => { }
this.$refs['dataForm'].resetFields() })
if (this.dataForm.id) { },
this.getInfo() //
} getInfo() {
}) this.$http
}, .get(this.$http.adornUrl(`/sys/params/${this.dataForm.id}`))
// .then(({ data: res }) => {
getInfo () { if (res.code !== 0) {
this.$http.get(this.$http.adornUrl(`/sys/params/${this.dataForm.id}`)).then(({ data: res }) => { return this.$message.error(res.msg)
if (res.code !== 0) { }
return this.$message.error(res.msg) this.dataForm = {
} ...this.dataForm,
this.dataForm = { ...res.data
...this.dataForm, }
...res.data })
} .catch(() => {})
}).catch(() => {}) },
}, //
// dataFormSubmitHandle: debounce(
dataFormSubmitHandle: debounce(function () { function() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate(valid => {
if (!valid) { if (!valid) {
return false return false
} }
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/params', this.dataForm).then(({ data: res }) => { this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/params', this.dataForm)
if (res.code !== 0) { .then(({ data: res }) => {
return this.$message.error(res.msg) if (res.code !== 0) {
} return this.$message.error(res.msg)
this.$message({ }
message: this.$t('prompt.success'), this.$message({
type: 'success', message: this.$t('prompt.success'),
duration: 500, type: 'success',
onClose: () => { duration: 500,
this.visible = false onClose: () => {
this.$emit('refreshDataList') this.visible = false
} this.$emit('refreshDataList')
}) }
}).catch(() => {}) })
}) })
}, 1000, { 'leading': true, 'trailing': false }) .catch(() => {})
} })
},
1000,
{ leading: true, trailing: false }
)
}
} }
</script> </script>

View File

@ -1,67 +1,68 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__params"> <div class="mod-sys__params">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')" clearable></el-input> <el-input v-model="dataForm.paramCode" :placeholder="$t('params.paramCode')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:params:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('sys:params:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:params:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button v-if="$hasPermission('sys:params:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
<el-table-column prop="paramCode" :label="$t('params.paramCode')" header-align="center" align="center"></el-table-column> <el-table-column prop="paramCode" :label="$t('params.paramCode')" header-align="center" align="center"></el-table-column>
<el-table-column prop="paramValue" :label="$t('params.paramValue')" header-align="center" align="center"></el-table-column> <el-table-column prop="paramValue" :label="$t('params.paramValue')" header-align="center" align="center"></el-table-column>
<el-table-column prop="remark" :label="$t('params.remark')" header-align="center" align="center"></el-table-column> <el-table-column prop="remark" :label="$t('params.remark')" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-if="$hasPermission('sys:params:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> <el-button v-if="$hasPermission('sys:params:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-button v-if="$hasPermission('sys:params:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> <el-button v-if="$hasPermission('sys:params:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination
:current-page="page" :current-page="page"
:page-sizes="[10, 20, 50, 100]" :page-sizes="[10, 20, 50, 100]"
:page-size="limit" :page-size="limit"
:total="total" :total="total"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle" @size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle"> @current-change="pageCurrentChangeHandle"
</el-pagination> >
<!-- 弹窗, 新增 / 修改 --> </el-pagination>
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <!-- 弹窗, 新增 / 修改 -->
</div> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</el-card> </div>
</el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './params-add-or-update' import AddOrUpdate from './params-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/params/page', getDataListURL: '/sys/params/page',
getDataListIsPage: true, getDataListIsPage: true,
deleteURL: '/sys/params', deleteURL: '/sys/params',
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: { dataForm: {
paramCode: '' paramCode: ''
} }
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
} }
} }
</script> </script>

View File

@ -1,148 +1,141 @@
<template> <template>
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> <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 :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" label-width="120px">
<el-form-item prop="name" :label="$t('role.name')"> <el-form-item prop="name" :label="$t('role.name')">
<el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input> <el-input v-model="dataForm.name" :placeholder="$t('role.name')"></el-input>
</el-form-item> </el-form-item>
<el-form-item prop="remark" :label="$t('role.remark')"> <el-form-item prop="remark" :label="$t('role.remark')">
<el-input v-model="dataForm.remark" :placeholder="$t('role.remark')"></el-input> <el-input v-model="dataForm.remark" :placeholder="$t('role.remark')"></el-input>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item size="mini" :label="$t('role.menuList')"> <el-form-item size="mini" :label="$t('role.menuList')">
<el-tree <el-tree :data="menuList" :props="{ label: 'name', children: 'children' }" node-key="id" ref="menuListTree" accordion show-checkbox> </el-tree>
:data="menuList" </el-form-item>
:props="{ label: 'name', children: 'children' }" </el-col>
node-key="id" <el-col :span="12">
ref="menuListTree" <el-form-item size="mini" :label="$t('role.deptList')">
accordion <el-tree :data="deptList" :props="{ label: 'name', children: 'children' }" node-key="id" ref="deptListTree" accordion show-checkbox> </el-tree>
show-checkbox> </el-form-item>
</el-tree> </el-col>
</el-form-item> </el-row>
</el-col> </el-form>
<el-col :span="12"> <template slot="footer">
<el-form-item size="mini" :label="$t('role.deptList')"> <el-button @click="visible = false">{{ $t('cancel') }}</el-button>
<el-tree <el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button>
:data="deptList" </template>
:props="{ label: 'name', children: 'children' }" </el-dialog>
node-key="id"
ref="deptListTree"
accordion
show-checkbox>
</el-tree>
</el-form-item>
</el-col>
</el-row>
</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> </template>
<script> <script>
import debounce from 'lodash/debounce' import debounce from 'lodash/debounce'
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
menuList: [], menuList: [],
deptList: [], deptList: [],
dataForm: { dataForm: {
id: '', id: '',
name: '', name: '',
menuIdList: [], menuIdList: [],
deptIdList: [], deptIdList: [],
remark: '' remark: ''
} }
} }
}, },
computed: { computed: {
dataRule () { dataRule() {
return { return {
name: [ name: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } }
] }
} },
} methods: {
}, init() {
methods: { this.visible = true
init () { this.$nextTick(() => {
this.visible = true this.$refs['dataForm'].resetFields()
this.$nextTick(() => { this.$refs.menuListTree.setCheckedKeys([])
this.$refs['dataForm'].resetFields() this.$refs.deptListTree.setCheckedKeys([])
this.$refs.menuListTree.setCheckedKeys([]) Promise.all([this.getMenuList(), this.getDeptList()]).then(() => {
this.$refs.deptListTree.setCheckedKeys([]) if (this.dataForm.id) {
Promise.all([ this.getInfo()
this.getMenuList(), }
this.getDeptList() })
]).then(() => { })
if (this.dataForm.id) { },
this.getInfo() //
} getMenuList() {
}) return this.$http
}) .get(this.$http.adornUrl('/sys/menu/select'))
}, .then(({ data: res }) => {
// if (res.code !== 0) {
getMenuList () { return this.$message.error(res.msg)
return this.$http.get(this.$http.adornUrl('/sys/menu/select')).then(({ data: res }) => { }
if (res.code !== 0) { this.menuList = res.data
return this.$message.error(res.msg) })
} .catch(() => {})
this.menuList = res.data },
}).catch(() => {}) //
}, getDeptList() {
// return this.$http
getDeptList () { .get(this.$http.adornUrl('/sys/dept/list'))
return this.$http.get(this.$http.adornUrl('/sys/dept/list')).then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.deptList = res.data this.deptList = res.data
}).catch(() => {}) })
}, .catch(() => {})
// },
getInfo () { //
this.$http.get(this.$http.adornUrl(`/sys/role/${this.dataForm.id}`)).then(({ data: res }) => { getInfo() {
if (res.code !== 0) { this.$http
return this.$message.error(res.msg) .get(this.$http.adornUrl(`/sys/role/${this.dataForm.id}`))
} .then(({ data: res }) => {
this.dataForm = { if (res.code !== 0) {
...this.dataForm, return this.$message.error(res.msg)
...res.data }
} this.dataForm = {
this.dataForm.menuIdList.forEach(item => this.$refs.menuListTree.setChecked(item, true)) ...this.dataForm,
this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList) ...res.data
}).catch(() => {}) }
}, this.dataForm.menuIdList.forEach(item => this.$refs.menuListTree.setChecked(item, true))
// this.$refs.deptListTree.setCheckedKeys(this.dataForm.deptIdList)
dataFormSubmitHandle: debounce(function () { })
this.$refs['dataForm'].validate((valid) => { .catch(() => {})
if (!valid) { },
return false //
} dataFormSubmitHandle: debounce(
this.dataForm.menuIdList = [ function() {
...this.$refs.menuListTree.getHalfCheckedKeys(), this.$refs['dataForm'].validate(valid => {
...this.$refs.menuListTree.getCheckedKeys() if (!valid) {
] return false
this.dataForm.deptIdList = this.$refs.deptListTree.getCheckedKeys() }
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/role', this.dataForm).then(({ data: res }) => { this.dataForm.menuIdList = [...this.$refs.menuListTree.getHalfCheckedKeys(), ...this.$refs.menuListTree.getCheckedKeys()]
if (res.code !== 0) { this.dataForm.deptIdList = this.$refs.deptListTree.getCheckedKeys()
return this.$message.error(res.msg) this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/role', this.dataForm)
} .then(({ data: res }) => {
this.$message({ if (res.code !== 0) {
message: this.$t('prompt.success'), return this.$message.error(res.msg)
type: 'success', }
duration: 500, this.$message({
onClose: () => { message: this.$t('prompt.success'),
this.visible = false type: 'success',
this.$emit('refreshDataList') duration: 500,
} onClose: () => {
}) this.visible = false
}).catch(() => {}) this.$emit('refreshDataList')
}) }
}, 1000, { 'leading': true, 'trailing': false }) })
} })
.catch(() => {})
})
},
1000,
{ leading: true, trailing: false }
)
}
} }
</script> </script>

View File

@ -1,73 +1,68 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__role"> <div class="mod-sys__role">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.name" :placeholder="$t('role.name')" clearable></el-input> <el-input v-model="dataForm.name" :placeholder="$t('role.name')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:role:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('sys:role:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:role:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button v-if="$hasPermission('sys:role:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
:data="dataList" <el-table-column prop="name" :label="$t('role.name')" header-align="center" align="center"></el-table-column>
border <el-table-column prop="remark" :label="$t('role.remark')" header-align="center" align="center"></el-table-column>
@selection-change="dataListSelectionChangeHandle" <el-table-column prop="createDate" :label="$t('role.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
@sort-change="dataListSortChangeHandle" <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
style="width: 100%;"> <template slot-scope="scope">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <el-button v-if="$hasPermission('sys:role:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
<el-table-column prop="name" :label="$t('role.name')" header-align="center" align="center"></el-table-column> <el-button v-if="$hasPermission('sys:role:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
<el-table-column prop="remark" :label="$t('role.remark')" header-align="center" align="center"></el-table-column> </template>
<el-table-column prop="createDate" :label="$t('role.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> </el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> </el-table>
<template slot-scope="scope"> <el-pagination
<el-button v-if="$hasPermission('sys:role:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> :current-page="page"
<el-button v-if="$hasPermission('sys:role:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> :page-sizes="[10, 20, 50, 100]"
</template> :page-size="limit"
</el-table-column> :total="total"
</el-table> layout="total, sizes, prev, pager, next, jumper"
<el-pagination @size-change="pageSizeChangeHandle"
:current-page="page" @current-change="pageCurrentChangeHandle"
:page-sizes="[10, 20, 50, 100]" >
:page-size="limit" </el-pagination>
:total="total" <!-- 弹窗, 新增 / 修改 -->
layout="total, sizes, prev, pager, next, jumper" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
@size-change="pageSizeChangeHandle" </div>
@current-change="pageCurrentChangeHandle"> </el-card>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './role-add-or-update' import AddOrUpdate from './role-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/role/page', getDataListURL: '/sys/role/page',
getDataListIsPage: true, getDataListIsPage: true,
deleteURL: '/sys/role', deleteURL: '/sys/role',
deleteIsBatch: true deleteIsBatch: true
}, },
dataForm: { dataForm: {
name: '' name: ''
} }
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
} }
} }
</script> </script>

View File

@ -1,98 +1,93 @@
<template> <template>
<el-card shadow="never" class="aui-card--fill"> <el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__user"> <div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.username" :placeholder="$t('user.username')" clearable></el-input> <el-input v-model="dataForm.username" :placeholder="$t('user.username')" clearable></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select> <ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree> <ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button> <el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> <el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> <el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button> <el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" @sort-change="dataListSortChangeHandle" style="width: 100%;">
v-loading="dataListLoading" <el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
:data="dataList" <el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column>
border <el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column>
@selection-change="dataListSelectionChangeHandle" <el-table-column prop="email" :label="$t('user.email')" header-align="center" align="center"></el-table-column>
@sort-change="dataListSortChangeHandle" <el-table-column prop="mobile" :label="$t('user.mobile')" sortable="custom" header-align="center" align="center"></el-table-column>
style="width: 100%;"> <el-table-column prop="gender" :label="$t('user.gender')" sortable="custom" header-align="center" align="center">
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> <template slot-scope="scope">
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column> {{ $getDictLabel('gender', scope.row.gender) }}
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column> </template>
<el-table-column prop="email" :label="$t('user.email')" header-align="center" align="center"></el-table-column> </el-table-column>
<el-table-column prop="mobile" :label="$t('user.mobile')" sortable="custom" header-align="center" align="center"></el-table-column> <el-table-column prop="status" :label="$t('user.status')" sortable="custom" header-align="center" align="center">
<el-table-column prop="gender" :label="$t('user.gender')" sortable="custom" header-align="center" align="center"> <template slot-scope="scope">
<template slot-scope="scope"> <el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('user.status0') }}</el-tag>
{{ $getDictLabel("gender", scope.row.gender) }} <el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="status" :label="$t('user.status')" sortable="custom" header-align="center" align="center"> <el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
<template slot-scope="scope"> <el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('user.status0') }}</el-tag> <template slot-scope="scope">
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag> <el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
</template> <el-button v-if="$hasPermission('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
</el-table-column> </template>
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column> </el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> </el-table>
<template slot-scope="scope"> <el-pagination
<el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> :current-page="page"
<el-button v-if="$hasPermission('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> :page-sizes="[10, 20, 50, 100]"
</template> :page-size="limit"
</el-table-column> :total="total"
</el-table> layout="total, sizes, prev, pager, next, jumper"
<el-pagination @size-change="pageSizeChangeHandle"
:current-page="page" @current-change="pageCurrentChangeHandle"
:page-sizes="[10, 20, 50, 100]" >
:page-size="limit" </el-pagination>
:total="total" <!-- 弹窗, 新增 / 修改 -->
layout="total, sizes, prev, pager, next, jumper" <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
@size-change="pageSizeChangeHandle" </div>
@current-change="pageCurrentChangeHandle"> </el-card>
</el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
</div>
</el-card>
</template> </template>
<script> <script>
import mixinViewModule from '@/mixins/view-module' import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './user-add-or-update' import AddOrUpdate from './user-add-or-update'
export default { export default {
mixins: [mixinViewModule], mixins: [mixinViewModule],
data () { data() {
return { return {
mixinViewModuleOptions: { mixinViewModuleOptions: {
getDataListURL: '/sys/user/page', getDataListURL: '/sys/user/page',
getDataListIsPage: true, getDataListIsPage: true,
deleteURL: '/sys/user', deleteURL: '/sys/user',
deleteIsBatch: true, deleteIsBatch: true,
exportURL: '/sys/user/export' exportURL: '/sys/user/export'
}, },
dataForm: { dataForm: {
username: '', username: '',
deptId: '', deptId: '',
gender: '' gender: ''
} }
} }
}, },
components: { components: {
AddOrUpdate AddOrUpdate
} }
} }
</script> </script>

View File

@ -1,19 +1,18 @@
<template> <template>
<div class="aui-wrapper aui-page__not-found"> <div class="aui-wrapper aui-page__not-found">
<div class="aui-content__wrapper"> <div class="aui-content__wrapper">
<div class="aui-content"> <div class="aui-content">
<h2 class="title">400</h2> <h2 class="title">400</h2>
<p class="desc" v-html="$t('notFound.desc')"></p> <p class="desc" v-html="$t('notFound.desc')"></p>
<div class="btn-bar"> <div class="btn-bar">
<el-button @click="$router.go(-1)">{{ $t('notFound.back') }}</el-button> <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> <el-button type="primary" @click="$router.push({ name: 'home' })">{{ $t('notFound.home') }}</el-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {}
}
</script> </script>