fzq #31
11
.prettierrc
Normal file
11
.prettierrc
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"tabWidth": 2,
|
||||
"bracketSameLine": true,
|
||||
"embeddedLanguageFormatting": "auto",
|
||||
"printWidth": 180,
|
||||
"quoteProps": "consistent",
|
||||
"trailingComma": "none",
|
||||
"semi": false,
|
||||
"useTabs": true
|
||||
}
|
@ -76,7 +76,7 @@ export default {
|
||||
return data.name.indexOf(value) !== -1
|
||||
},
|
||||
getDeptList (id) {
|
||||
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
|
||||
return this.$http.get(this.$http.adornUrl('/sys/dept/list')).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ export default {
|
||||
return data.name.indexOf(value) !== -1
|
||||
},
|
||||
getDataList (id) {
|
||||
return this.$http.get('/sys/region/tree').then(({ data: res }) => {
|
||||
return this.$http.get(this.$http.adornUrl('/sys/region/tree')).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ export default {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
clearLoginInfo()
|
||||
this.$router.push({ name: 'login' })
|
||||
this.$router.push({ name: "Login" })
|
||||
}).catch(() => {})
|
||||
}).catch(() => {})
|
||||
}
|
||||
|
@ -1,9 +1,5 @@
|
||||
<template>
|
||||
<div
|
||||
v-loading.fullscreen.lock="loading"
|
||||
:element-loading-text="$t('loading')"
|
||||
:class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]"
|
||||
>
|
||||
<div v-loading.fullscreen.lock="loading" :element-loading-text="$t('loading')" :class="['aui-wrapper', { 'aui-sidebar--fold': $store.state.sidebarFold }]">
|
||||
<template v-if="!loading">
|
||||
<main-navbar />
|
||||
<main-sidebar />
|
||||
@ -15,104 +11,98 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MainNavbar from "./main-navbar";
|
||||
import MainSidebar from "./main-sidebar";
|
||||
import MainContent from "./main-content";
|
||||
import debounce from "lodash/debounce";
|
||||
import MainNavbar from './main-navbar'
|
||||
import MainSidebar from './main-sidebar'
|
||||
import MainContent from './main-content'
|
||||
import debounce from 'lodash/debounce'
|
||||
export default {
|
||||
provide() {
|
||||
return {
|
||||
// 刷新
|
||||
refresh() {
|
||||
this.$store.state.contentIsNeedRefresh = true;
|
||||
this.$store.state.contentIsNeedRefresh = true
|
||||
this.$nextTick(() => {
|
||||
this.$store.state.contentIsNeedRefresh = false;
|
||||
});
|
||||
},
|
||||
};
|
||||
this.$store.state.contentIsNeedRefresh = false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
};
|
||||
loading: true
|
||||
}
|
||||
},
|
||||
components: {
|
||||
MainNavbar,
|
||||
MainSidebar,
|
||||
MainContent,
|
||||
MainContent
|
||||
},
|
||||
watch: {
|
||||
$route: "routeHandle",
|
||||
$route: 'routeHandle'
|
||||
},
|
||||
created() {
|
||||
this.windowResizeHandle();
|
||||
this.routeHandle(this.$route);
|
||||
this.windowResizeHandle()
|
||||
this.routeHandle(this.$route)
|
||||
Promise.all([this.getUserInfo(), this.getPermissions()]).then(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 窗口改变大小
|
||||
windowResizeHandle() {
|
||||
this.$store.state.sidebarFold =
|
||||
document.documentElement["clientWidth"] <= 992 || false;
|
||||
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false
|
||||
window.addEventListener(
|
||||
"resize",
|
||||
'resize',
|
||||
debounce(() => {
|
||||
this.$store.state.sidebarFold =
|
||||
document.documentElement["clientWidth"] <= 992 || false;
|
||||
this.$store.state.sidebarFold = document.documentElement['clientWidth'] <= 992 || false
|
||||
}, 150)
|
||||
);
|
||||
)
|
||||
},
|
||||
// 路由, 监听
|
||||
routeHandle(route) {
|
||||
if (!route.meta.isTab) {
|
||||
return false;
|
||||
return false
|
||||
}
|
||||
var tab = this.$store.state.contentTabs.filter(
|
||||
(item) => item.name === route.name
|
||||
)[0];
|
||||
var tab = this.$store.state.contentTabs.filter(item => item.name === route.name)[0]
|
||||
if (!tab) {
|
||||
tab = {
|
||||
...window.SITE_CONFIG["contentTabDefault"],
|
||||
...window.SITE_CONFIG['contentTabDefault'],
|
||||
...route.meta,
|
||||
name: route.name,
|
||||
params: { ...route.params },
|
||||
query: { ...route.query },
|
||||
};
|
||||
this.$store.state.contentTabs = this.$store.state.contentTabs.concat(
|
||||
tab
|
||||
);
|
||||
query: { ...route.query }
|
||||
}
|
||||
this.$store.state.sidebarMenuActiveName = tab.menuId;
|
||||
this.$store.state.contentTabsActiveName = tab.name;
|
||||
this.$store.state.contentTabs = this.$store.state.contentTabs.concat(tab)
|
||||
}
|
||||
this.$store.state.sidebarMenuActiveName = tab.menuId
|
||||
this.$store.state.contentTabsActiveName = tab.name
|
||||
},
|
||||
// 获取当前管理员信息
|
||||
getUserInfo() {
|
||||
return this.$http
|
||||
.get(this.$http.adornUrl("/sys/user/info"))
|
||||
.get(this.$http.adornUrl('/sys/user/info'))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.$store.state.user.id = res.data.id;
|
||||
this.$store.state.user.name = res.data.username;
|
||||
this.$store.state.user.superAdmin = res.data.superAdmin;
|
||||
this.$store.state.user.id = res.data.id
|
||||
this.$store.state.user.name = res.data.username
|
||||
this.$store.state.user.superAdmin = res.data.superAdmin
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => {})
|
||||
},
|
||||
// 获取权限
|
||||
getPermissions() {
|
||||
return this.$http
|
||||
.get(this.$http.adornUrl("/sys/menu/permissions"))
|
||||
.get(this.$http.adornUrl('/sys/menu/permissions'))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg);
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
window.SITE_CONFIG["permissions"] = res.data;
|
||||
window.SITE_CONFIG['permissions'] = res.data
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
.catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="plc表iD" prop="plcId">
|
||||
<el-input v-model="dataForm.plcId" placeholder="plc表iD"></el-input>
|
||||
@ -49,8 +46,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
@ -69,47 +66,23 @@
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
plcId: [
|
||||
{ required: true, message: 'plc表iD不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备表id不能为空', trigger: 'blur' }
|
||||
],
|
||||
enabled: [
|
||||
{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
plcId: [{ required: true, message: 'plc表iD不能为空', trigger: 'blur' }],
|
||||
equipmentId: [{ required: true, message: '设备表id不能为空', trigger: 'blur' }],
|
||||
enabled: [{ required: true, message: '启用状态:0 、停用,1、启用不能为空', trigger: 'blur' }],
|
||||
remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
|
||||
valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
|
||||
creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
|
||||
creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
|
||||
createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
|
||||
updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
|
||||
updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
|
||||
updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
|
||||
version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
@ -119,7 +92,7 @@
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenplcconnect/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.plcId = data.equipmenplcConnect.plcId
|
||||
this.dataForm.equipmentId = data.equipmenplcConnect.equipmentId
|
||||
@ -139,28 +112,28 @@
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenplcconnect/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'plcId': this.dataForm.plcId,
|
||||
'equipmentId': this.dataForm.equipmentId,
|
||||
'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
|
||||
id: this.dataForm.id || undefined,
|
||||
plcId: this.dataForm.plcId,
|
||||
equipmentId: this.dataForm.equipmentId,
|
||||
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}) => {
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
@ -179,5 +152,5 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -1,8 +1,5 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新增' : '修改'"
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="visible">
|
||||
<el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
|
||||
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="80px">
|
||||
<el-form-item label="设备外部代码" prop="externalCode">
|
||||
<el-input v-model="dataForm.externalCode" placeholder="设备外部代码"></el-input>
|
||||
@ -61,8 +58,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
@ -85,59 +82,27 @@
|
||||
version: ''
|
||||
},
|
||||
dataRule: {
|
||||
externalCode: [
|
||||
{ required: true, message: '设备外部代码不能为空', trigger: 'blur' }
|
||||
],
|
||||
plcId: [
|
||||
{ required: true, message: 'plc id不能为空', trigger: 'blur' }
|
||||
],
|
||||
plc: [
|
||||
{ required: true, message: 'plc不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备id不能为空', trigger: 'blur' }
|
||||
],
|
||||
equipmentName: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: '状态,0正常 1计划停机 2故障不能为空', trigger: 'blur' }
|
||||
],
|
||||
logTime: [
|
||||
{ required: true, message: '记录时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
remark: [
|
||||
{ required: true, message: '备注不能为空', trigger: 'blur' }
|
||||
],
|
||||
valid: [
|
||||
{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorId: [
|
||||
{ required: true, message: '创建人不能为空', trigger: 'blur' }
|
||||
],
|
||||
creatorName: [
|
||||
{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterId: [
|
||||
{ required: true, message: '更新人不能为空', trigger: 'blur' }
|
||||
],
|
||||
updaterName: [
|
||||
{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }
|
||||
],
|
||||
updateTime: [
|
||||
{ required: true, message: '更新时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: '版本号不能为空', trigger: 'blur' }
|
||||
]
|
||||
externalCode: [{ required: true, message: '设备外部代码不能为空', trigger: 'blur' }],
|
||||
plcId: [{ required: true, message: 'plc id不能为空', trigger: 'blur' }],
|
||||
plc: [{ required: true, message: 'plc不能为空', trigger: 'blur' }],
|
||||
equipmentId: [{ required: true, message: '设备id不能为空', trigger: 'blur' }],
|
||||
equipmentName: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
|
||||
status: [{ required: true, message: '状态,0正常 1计划停机 2故障不能为空', trigger: 'blur' }],
|
||||
logTime: [{ required: true, message: '记录时间不能为空', trigger: 'blur' }],
|
||||
remark: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
|
||||
valid: [{ required: true, message: '删除标志,是否有效:1 可用 0不可用不能为空', trigger: 'blur' }],
|
||||
creatorId: [{ required: true, message: '创建人不能为空', trigger: 'blur' }],
|
||||
creatorName: [{ required: true, message: '创建人姓名不能为空', trigger: 'blur' }],
|
||||
createTime: [{ required: true, message: '创建时间不能为空', trigger: 'blur' }],
|
||||
updaterId: [{ required: true, message: '更新人不能为空', trigger: 'blur' }],
|
||||
updaterName: [{ required: true, message: '更新人姓名不能为空', trigger: 'blur' }],
|
||||
updateTime: [{ required: true, message: '更新时间不能为空', trigger: 'blur' }],
|
||||
version: [{ required: true, message: '版本号不能为空', trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init (id) {
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
@ -147,7 +112,7 @@
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenstatuslog/info/${this.dataForm.id}`),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams()
|
||||
}).then(({data}) => {
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataForm.externalCode = data.equipmenstatusLog.externalCode
|
||||
this.dataForm.plcId = data.equipmenstatusLog.plcId
|
||||
@ -171,32 +136,32 @@
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
if (valid) {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl(`/monitoring/equipmenstatuslog/${!this.dataForm.id ? 'save' : 'update'}`),
|
||||
method: 'post',
|
||||
data: this.$http.adornData({
|
||||
'id': this.dataForm.id || undefined,
|
||||
'externalCode': this.dataForm.externalCode,
|
||||
'plcId': this.dataForm.plcId,
|
||||
'plc': this.dataForm.plc,
|
||||
'equipmentId': this.dataForm.equipmentId,
|
||||
'equipmentName': this.dataForm.equipmentName,
|
||||
'status': this.dataForm.status,
|
||||
'logTime': this.dataForm.logTime,
|
||||
'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
|
||||
id: this.dataForm.id || undefined,
|
||||
externalCode: this.dataForm.externalCode,
|
||||
plcId: this.dataForm.plcId,
|
||||
plc: this.dataForm.plc,
|
||||
equipmentId: this.dataForm.equipmentId,
|
||||
equipmentName: this.dataForm.equipmentName,
|
||||
status: this.dataForm.status,
|
||||
logTime: this.dataForm.logTime,
|
||||
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}) => {
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
@ -215,5 +180,5 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -10,186 +10,37 @@
|
||||
<el-button v-if="$hasPermission('monitoring:equipment:delete')" type="danger" @click="deleteHandle()" :disabled="dataListSelections.length <= 0">批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
:data="dataList"
|
||||
border
|
||||
v-loading="dataListLoading"
|
||||
@selection-change="selectionChangeHandle"
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="50">
|
||||
<el-table :data="dataList" border v-loading="dataListLoading" @selection-change="selectionChangeHandle" style="width: 100%;">
|
||||
<el-table-column type="selection" header-align="center" align="center" width="50"> </el-table-column>
|
||||
<el-table-column prop="id" header-align="center" align="center" label="id"> </el-table-column>
|
||||
<el-table-column prop="code" header-align="center" align="center" label="编码"> </el-table-column>
|
||||
<el-table-column prop="name" header-align="center" align="center" label="设备名称"> </el-table-column>
|
||||
<el-table-column prop="enName" header-align="center" align="center" label="英文名称"> </el-table-column>
|
||||
<el-table-column prop="abbr" header-align="center" align="center" label="缩写"> </el-table-column>
|
||||
<el-table-column prop="enterTime" header-align="center" align="center" label="进厂日期"> </el-table-column>
|
||||
<el-table-column prop="productionTime" header-align="center" align="center" label="生产日期"> </el-table-column>
|
||||
<el-table-column prop="equipmentTypeId" header-align="center" align="center" label="设备类型,关联设备类型表"> </el-table-column>
|
||||
<el-table-column prop="groupId" header-align="center" align="center" label="分组id (关联 T_EQUIPMENT_GROUP)"> </el-table-column>
|
||||
<el-table-column prop="dataType" header-align="center" align="center" label="0:无类别,1:上片数据设备,2:下片数据设备"> </el-table-column>
|
||||
<el-table-column prop="tvalue" header-align="center" align="center" label="每小时生产数量"> </el-table-column>
|
||||
<el-table-column prop="processingTime" header-align="center" align="center" label="单件加工时间 s/件"> </el-table-column>
|
||||
<el-table-column prop="manufacturer" header-align="center" align="center" label="制造商"> </el-table-column>
|
||||
<el-table-column prop="spec" 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="externalCode" header-align="center" align="center" label="外部系统代码"> </el-table-column>
|
||||
<el-table-column prop="externalCodeStatis" header-align="center" align="center" label="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="id">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="编码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enName"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="英文名称">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="abbr"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="缩写">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="enterTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="进厂日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="productionTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="生产日期">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="equipmentTypeId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="设备类型,关联设备类型表">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="groupId"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="分组id (关联 T_EQUIPMENT_GROUP)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="dataType"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="0:无类别,1:上片数据设备,2:下片数据设备">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="tvalue"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="每小时生产数量">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="processingTime"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="单件加工时间 s/件">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="manufacturer"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="制造商">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="spec"
|
||||
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="externalCode"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="外部系统代码">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="externalCodeStatis"
|
||||
header-align="center"
|
||||
align="center"
|
||||
label="统一用的外部代码,代表用哪个设备的数据代替该设备,目前用于生产数量统计">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
header-align="center"
|
||||
align="center"
|
||||
width="150"
|
||||
label="操作">
|
||||
<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>
|
||||
@ -203,7 +54,8 @@
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
:page-size="pageSize"
|
||||
:total="totalPage"
|
||||
layout="total, sizes, prev, pager, next, jumper">
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
>
|
||||
</el-pagination>
|
||||
<!-- 弹窗, 新增 / 修改 -->
|
||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
||||
@ -211,9 +63,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './equipment-add-or-update'
|
||||
export default {
|
||||
data () {
|
||||
import AddOrUpdate from './equipment-add-or-update'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataForm: {
|
||||
key: ''
|
||||
@ -230,23 +82,23 @@
|
||||
components: {
|
||||
AddOrUpdate
|
||||
},
|
||||
activated () {
|
||||
activated() {
|
||||
console.log('activated')
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList () {
|
||||
getDataList() {
|
||||
this.dataListLoading = true
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipment/page'),
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
'page': this.pageIndex,
|
||||
'limit': this.pageSize,
|
||||
'key': this.dataForm.key
|
||||
page: this.pageIndex,
|
||||
limit: this.pageSize,
|
||||
key: this.dataForm.key
|
||||
})
|
||||
}).then(({data}) => {
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.dataList = data.list
|
||||
this.totalPage = data.total
|
||||
@ -258,30 +110,32 @@
|
||||
})
|
||||
},
|
||||
// 每页数
|
||||
sizeChangeHandle (val) {
|
||||
sizeChangeHandle(val) {
|
||||
this.pageSize = val
|
||||
this.pageIndex = 1
|
||||
this.getDataList()
|
||||
},
|
||||
// 当前页
|
||||
currentChangeHandle (val) {
|
||||
currentChangeHandle(val) {
|
||||
this.pageIndex = val
|
||||
this.getDataList()
|
||||
},
|
||||
// 多选
|
||||
selectionChangeHandle (val) {
|
||||
selectionChangeHandle(val) {
|
||||
this.dataListSelections = val
|
||||
},
|
||||
// 新增 / 修改
|
||||
addOrUpdateHandle (id) {
|
||||
addOrUpdateHandle(id) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id)
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
deleteHandle (id) {
|
||||
var ids = id ? [id] : this.dataListSelections.map(item => {
|
||||
deleteHandle(id) {
|
||||
var ids = id
|
||||
? [id]
|
||||
: this.dataListSelections.map(item => {
|
||||
return item.id
|
||||
})
|
||||
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
|
||||
@ -293,7 +147,7 @@
|
||||
url: this.$http.adornUrl('/monitoring/equipment/delete'),
|
||||
method: 'post',
|
||||
data: this.$http.adornData(ids, false)
|
||||
}).then(({data}) => {
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
@ -310,5 +164,5 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -72,7 +72,7 @@ export default {
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/schedule/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
this.$http.get(this.$http.adornUrl(`/sys/schedule/${this.dataForm.id}`)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ export default {
|
||||
},
|
||||
// 失败信息
|
||||
showErrorInfo (id) {
|
||||
this.$http.get(`/sys/scheduleLog/${id}`).then(({ data: res }) => {
|
||||
this.$http.get(this.$http.adornUrl(`/sys/scheduleLog/${id}`)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
@ -99,7 +99,7 @@
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
@ -126,63 +126,33 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
dataRule() {
|
||||
return {
|
||||
qiniuDomain: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qiniuAccessKey: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qiniuSecretKey: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qiniuBucketName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunDomain: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunEndPoint: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunAccessKeyId: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunAccessKeySecret: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
aliyunBucketName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudDomain: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudAppId: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudSecretId: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudSecretKey: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudBucketName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
qcloudRegion: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
qiniuDomain: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qiniuAccessKey: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qiniuSecretKey: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qiniuBucketName: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
aliyunDomain: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
aliyunEndPoint: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
aliyunAccessKeyId: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
aliyunAccessKeySecret: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
aliyunBucketName: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qcloudDomain: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qcloudAppId: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qcloudSecretId: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qcloudSecretKey: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qcloudBucketName: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
qcloudRegion: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dataForm.type' (val) {
|
||||
'dataForm.type'(val) {
|
||||
this.$refs['dataForm'].clearValidate()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
init() {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
@ -190,21 +160,27 @@ export default {
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get('/sys/oss/info').then(({ data: res }) => {
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(this.$http.adornUrl('/sys/oss/info'))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.dataForm = res.data
|
||||
}).catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
dataFormSubmitHandle: debounce(
|
||||
function() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http.post('/sys/oss', this.dataForm).then(({ data: res }) => {
|
||||
this.$http
|
||||
.post(this.$http.adornUrl('/sys/oss'), this.dataForm)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -217,9 +193,13 @@ export default {
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
.catch(() => {})
|
||||
})
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -14,7 +14,8 @@
|
||||
:highlight-current="true"
|
||||
:expand-on-click-node="false"
|
||||
accordion
|
||||
@current-change="deptListTreeCurrentChangeHandle">
|
||||
@current-change="deptListTreeCurrentChangeHandle"
|
||||
>
|
||||
</el-tree>
|
||||
</el-popover>
|
||||
<el-input v-model="dataForm.parentName" v-popover:deptListPopover :readonly="true" :placeholder="$t('dept.parentName')">
|
||||
@ -22,7 +23,8 @@
|
||||
v-if="$store.state.user.superAdmin === 1 && dataForm.pid !== '0'"
|
||||
slot="suffix"
|
||||
@click.stop="deptListTreeSetDefaultHandle()"
|
||||
class="el-icon-circle-close el-input__icon">
|
||||
class="el-icon-circle-close el-input__icon"
|
||||
>
|
||||
</i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@ -40,7 +42,7 @@
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
deptList: [],
|
||||
@ -55,19 +57,15 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
dataRule() {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
parentName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
]
|
||||
name: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
parentName: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
init() {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
@ -81,17 +79,22 @@ export default {
|
||||
})
|
||||
},
|
||||
// 获取部门列表
|
||||
getDeptList () {
|
||||
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
|
||||
getDeptList() {
|
||||
return this.$http
|
||||
.get(this.$http.adornUrl('/sys/dept/list'))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.deptList = res.data
|
||||
}).catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/dept/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(this.$http.adornUrl(`/sys/dept/${this.dataForm.id}`))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -103,26 +106,29 @@ export default {
|
||||
return this.deptListTreeSetDefaultHandle()
|
||||
}
|
||||
this.$refs.deptListTree.setCurrentKey(this.dataForm.pid)
|
||||
}).catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 上级部门树, 设置默认值
|
||||
deptListTreeSetDefaultHandle () {
|
||||
deptListTreeSetDefaultHandle() {
|
||||
this.dataForm.pid = '0'
|
||||
this.dataForm.parentName = this.$t('dept.parentNameDefault')
|
||||
},
|
||||
// 上级部门树, 选中
|
||||
deptListTreeCurrentChangeHandle (data) {
|
||||
deptListTreeCurrentChangeHandle(data) {
|
||||
this.dataForm.pid = data.id
|
||||
this.dataForm.parentName = data.name
|
||||
this.deptListVisible = false
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
dataFormSubmitHandle: debounce(
|
||||
function() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dept', this.dataForm).then(({ data: res }) => {
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dept', this.dataForm)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -135,9 +141,13 @@ export default {
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
.catch(() => {})
|
||||
})
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -24,7 +24,7 @@
|
||||
<script>
|
||||
import debounce from 'lodash/debounce'
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
@ -38,22 +38,16 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
dataRule() {
|
||||
return {
|
||||
dictLabel: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
dictValue: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
sort: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
]
|
||||
dictLabel: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
dictValue: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
sort: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
init() {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
@ -63,8 +57,10 @@ export default {
|
||||
})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/dict/data/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(this.$http.adornUrl(`/sys/dict/data/${this.dataForm.id}`))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -72,15 +68,18 @@ export default {
|
||||
...this.dataForm,
|
||||
...res.data
|
||||
}
|
||||
}).catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
dataFormSubmitHandle: debounce(
|
||||
function() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dict/data', this.dataForm).then(({ data: res }) => {
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/dict/data', this.dataForm)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -93,9 +92,13 @@ export default {
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
.catch(() => {})
|
||||
})
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -63,7 +63,7 @@ export default {
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/dict/type/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
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)
|
||||
}
|
||||
|
@ -20,7 +20,8 @@
|
||||
:highlight-current="true"
|
||||
:expand-on-click-node="false"
|
||||
accordion
|
||||
@current-change="menuListTreeCurrentChangeHandle">
|
||||
@current-change="menuListTreeCurrentChangeHandle"
|
||||
>
|
||||
</el-tree>
|
||||
</el-popover>
|
||||
<el-input v-model="dataForm.parentName" v-popover:menuListPopover :readonly="true" :placeholder="$t('menu.parentName')">
|
||||
@ -40,11 +41,7 @@
|
||||
<el-popover v-model="iconListVisible" ref="iconListPopover" placement="bottom-start" trigger="click" popper-class="mod-sys__menu-icon-popover">
|
||||
<div class="mod-sys__menu-icon-inner">
|
||||
<div class="mod-sys__menu-icon-list">
|
||||
<el-button
|
||||
v-for="(item, index) in iconList"
|
||||
:key="index"
|
||||
@click="iconListCurrentChangeHandle(item)"
|
||||
:class="{ 'is-active': dataForm.icon === item }">
|
||||
<el-button v-for="(item, index) in iconList" :key="index" @click="iconListCurrentChangeHandle(item)" :class="{ 'is-active': dataForm.icon === item }">
|
||||
<svg class="icon-svg" aria-hidden="true"><use :xlink:href="`#${item}`"></use></svg>
|
||||
</el-button>
|
||||
</div>
|
||||
@ -64,7 +61,7 @@
|
||||
import debounce from 'lodash/debounce'
|
||||
import { getIconList } from '@/utils'
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
menuList: [],
|
||||
@ -85,24 +82,20 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
dataRule () {
|
||||
dataRule() {
|
||||
return {
|
||||
name: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
|
||||
],
|
||||
parentName: [
|
||||
{ required: true, message: this.$t('validate.required'), trigger: 'change' }
|
||||
]
|
||||
name: [{ required: true, message: this.$t('validate.required'), trigger: 'blur' }],
|
||||
parentName: [{ required: true, message: this.$t('validate.required'), trigger: 'change' }]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dataForm.type' (val) {
|
||||
'dataForm.type'(val) {
|
||||
this.$refs['dataForm'].clearValidate()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
init() {
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
@ -116,17 +109,22 @@ export default {
|
||||
})
|
||||
},
|
||||
// 获取菜单列表
|
||||
getMenuList () {
|
||||
return this.$http.get('/sys/menu/list?type=0').then(({ data: res }) => {
|
||||
getMenuList() {
|
||||
return this.$http
|
||||
.get(this.$http.adornUrl('/sys/menu/list?type=0'))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
this.menuList = res.data
|
||||
}).catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/menu/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
getInfo() {
|
||||
this.$http
|
||||
.get(this.$http.adornUrl(`/sys/menu/${this.dataForm.id}`))
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -138,31 +136,34 @@ export default {
|
||||
return this.deptListTreeSetDefaultHandle()
|
||||
}
|
||||
this.$refs.menuListTree.setCurrentKey(this.dataForm.pid)
|
||||
}).catch(() => {})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
// 上级菜单树, 设置默认值
|
||||
deptListTreeSetDefaultHandle () {
|
||||
deptListTreeSetDefaultHandle() {
|
||||
this.dataForm.pid = '0'
|
||||
this.dataForm.parentName = this.$t('menu.parentNameDefault')
|
||||
},
|
||||
// 上级菜单树, 选中
|
||||
menuListTreeCurrentChangeHandle (data) {
|
||||
menuListTreeCurrentChangeHandle(data) {
|
||||
this.dataForm.pid = data.id
|
||||
this.dataForm.parentName = data.name
|
||||
this.menuListVisible = false
|
||||
},
|
||||
// 图标, 选中
|
||||
iconListCurrentChangeHandle (icon) {
|
||||
iconListCurrentChangeHandle(icon) {
|
||||
this.dataForm.icon = icon
|
||||
this.iconListVisible = false
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmitHandle: debounce(function () {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
dataFormSubmitHandle: debounce(
|
||||
function() {
|
||||
this.$refs['dataForm'].validate(valid => {
|
||||
if (!valid) {
|
||||
return false
|
||||
}
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/menu', this.dataForm).then(({ data: res }) => {
|
||||
this.$http[!this.dataForm.id ? 'post' : 'put']('/sys/menu', this.dataForm)
|
||||
.then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -175,9 +176,13 @@ export default {
|
||||
this.$emit('refreshDataList')
|
||||
}
|
||||
})
|
||||
}).catch(() => {})
|
||||
})
|
||||
}, 1000, { 'leading': true, 'trailing': false })
|
||||
.catch(() => {})
|
||||
})
|
||||
},
|
||||
1000,
|
||||
{ leading: true, trailing: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -56,7 +56,7 @@ export default {
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/params/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
this.$http.get(this.$http.adornUrl(`/sys/params/${this.dataForm.id}`)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ export default {
|
||||
},
|
||||
// 获取菜单列表
|
||||
getMenuList () {
|
||||
return this.$http.get('/sys/menu/select').then(({ data: res }) => {
|
||||
return this.$http.get(this.$http.adornUrl('/sys/menu/select')).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -95,7 +95,7 @@ export default {
|
||||
},
|
||||
// 获取部门列表
|
||||
getDeptList () {
|
||||
return this.$http.get('/sys/dept/list').then(({ data: res }) => {
|
||||
return this.$http.get(this.$http.adornUrl('/sys/dept/list')).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -104,7 +104,7 @@ export default {
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/role/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
this.$http.get(this.$http.adornUrl(`/sys/role/${this.dataForm.id}`)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ export default {
|
||||
},
|
||||
// 获取角色列表
|
||||
getRoleList () {
|
||||
return this.$http.get('/sys/role/list').then(({ data: res }) => {
|
||||
return this.$http.get(this.$http.adornUrl('/sys/role/list')).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
@ -150,7 +150,7 @@ export default {
|
||||
},
|
||||
// 获取信息
|
||||
getInfo () {
|
||||
this.$http.get(`/sys/user/${this.dataForm.id}`).then(({ data: res }) => {
|
||||
this.$http.get(this.$http.adornUrl(`/sys/user/${this.dataForm.id}`)).then(({ data: res }) => {
|
||||
if (res.code !== 0) {
|
||||
return this.$message.error(res.msg)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user