add prettierrc & 一些全局替换

This commit is contained in:
lb 2022-08-04 15:42:36 +08:00
parent d4e7bda03b
commit 8b060b8bf1
18 changed files with 1274 additions and 1483 deletions

11
.prettierrc Normal file
View File

@ -0,0 +1,11 @@
{
"singleQuote": true,
"tabWidth": 2,
"bracketSameLine": true,
"embeddedLanguageFormatting": "auto",
"printWidth": 180,
"quoteProps": "consistent",
"trailingComma": "none",
"semi": false,
"useTabs": true
}

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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(() => {})
}

View File

@ -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>

View File

@ -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>
@ -69,42 +66,18 @@
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' }]
}
}
},
@ -140,25 +113,25 @@
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
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 }) => {
if (data && data.code === 0) {

View File

@ -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>
@ -85,54 +82,22 @@
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' }]
}
}
},
@ -172,29 +137,29 @@
},
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
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 }) => {
if (data && data.code === 0) {

View File

@ -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>
@ -242,9 +94,9 @@
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 }) => {
if (data && data.code === 0) {
@ -281,7 +133,9 @@
},
//
deleteHandle(id) {
var ids = id ? [id] : this.dataListSelections.map(item => {
var ids = id
? [id]
: this.dataListSelections.map(item => {
return item.id
})
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {

View File

@ -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)
}

View File

@ -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)
}

View File

@ -128,51 +128,21 @@ export default {
computed: {
dataRule() {
return {
qiniuDomain: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qiniuAccessKey: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qiniuSecretKey: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qiniuBucketName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
aliyunDomain: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
aliyunEndPoint: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
aliyunAccessKeyId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
aliyunAccessKeySecret: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
aliyunBucketName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qcloudDomain: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qcloudAppId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qcloudSecretId: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qcloudSecretKey: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qcloudBucketName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
qcloudRegion: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
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' }]
}
}
},
@ -191,20 +161,26 @@ export default {
},
//
getInfo() {
this.$http.get('/sys/oss/info').then(({ data: res }) => {
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>

View File

@ -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>
@ -57,12 +59,8 @@ export default {
computed: {
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' }]
}
}
},
@ -82,16 +80,21 @@ 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)
}
this.deptList = res.data
}).catch(() => {})
})
.catch(() => {})
},
//
getInfo() {
this.$http.get(`/sys/dept/${this.dataForm.id}`).then(({ data: res }) => {
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,7 +106,8 @@ export default {
return this.deptListTreeSetDefaultHandle()
}
this.$refs.deptListTree.setCurrentKey(this.dataForm.pid)
}).catch(() => {})
})
.catch(() => {})
},
// ,
deptListTreeSetDefaultHandle() {
@ -117,12 +121,14 @@ export default {
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>

View File

@ -40,15 +40,9 @@ export default {
computed: {
dataRule() {
return {
dictLabel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
dictValue: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
sort: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
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' }]
}
}
},
@ -64,7 +58,9 @@ export default {
},
//
getInfo() {
this.$http.get(`/sys/dict/data/${this.dataForm.id}`).then(({ data: res }) => {
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>

View File

@ -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)
}

View File

@ -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>
@ -87,12 +84,8 @@ export default {
computed: {
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' }]
}
}
},
@ -117,16 +110,21 @@ export default {
},
//
getMenuList() {
return this.$http.get('/sys/menu/list?type=0').then(({ data: res }) => {
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 }) => {
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,7 +136,8 @@ export default {
return this.deptListTreeSetDefaultHandle()
}
this.$refs.menuListTree.setCurrentKey(this.dataForm.pid)
}).catch(() => {})
})
.catch(() => {})
},
// ,
deptListTreeSetDefaultHandle() {
@ -157,12 +156,14 @@ export default {
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>

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}