fix: 修改权限,路由代码,修改对应模块的路由跳转功能

This commit is contained in:
张洋川 2024-04-11 18:04:49 +08:00
parent cf5b8b76c4
commit 10c746c4f9
10 changed files with 284 additions and 166 deletions

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询安装包管理(新)列表
export function listINFO(query) {
return request({
url: '/deploy/INFO/list',
method: 'get',
params: query
})
}
// 查询安装包管理(新)详细
export function getINFO(id) {
return request({
url: '/deploy/INFO/' + id,
method: 'get'
})
}
// 新增安装包管理(新)
export function addINFO(data) {
return request({
url: '/deploy/INFO',
method: 'post',
data: data
})
}
// 修改安装包管理(新)
export function updateINFO(data) {
return request({
url: '/deploy/INFO',
method: 'put',
data: data
})
}
// 删除安装包管理(新)
export function delINFO(id) {
return request({
url: '/deploy/INFO/' + id,
method: 'delete'
})
}

View File

@ -160,7 +160,110 @@ export const dynamicRoutes = [
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
}
]
},
{
path: '/build/install',
component: Layout,
hidden: true,
permissions: ['build:install:add'],
children: [
{
path: 'add',
component: () => import('@/views/FDS/installationList/add'),
name: 'InstallAdd',
meta: { title: '新增安装包', activeMenu: '/build/installationList' }
}
]
},
{
path: '/build/install',
component: Layout,
hidden: true,
permissions: ['build:install:detail'],
children: [
{
path: 'detail',
component: () => import('@/views/FDS/installationList/detail'),
name: 'InstallDetail',
meta: { title: '安装包详情', activeMenu: '/build/installationList' }
}
]
},
{
path: '/build/publishList',
component: Layout,
hidden: true,
permissions: ['build:publishList:add'],
children: [
{
path: 'add',
component: () => import('@/views/FDS/publishList/add'),
name: 'PublishAdd',
meta: { title: '新增发布', activeMenu: '/build/publish' }
}
]
},
{
path: '/build/publishList',
component: Layout,
hidden: true,
permissions: ['build:publishList:detail'],
children: [
{
path: 'detail',
component: () => import('@/views/FDS/publishList/detail'),
name: 'PublishDetail',
meta: { title: '发布详情', activeMenu: '/build/publish' }
}
]
},
{
path: '/build/WhiteList',
component: Layout,
hidden: true,
permissions: ['build:WhiteList:add'],
children: [
{
path: 'add',
component: () => import('@/views/FDS/whiteListManagement/add'),
name: 'WhiteListAdd',
meta: { title: '新增白名单', activeMenu: '/build/whiteList' }
}
]
},
{
path: '/build/WhiteList',
component: Layout,
hidden: true,
permissions: ['build:WhiteList:detail'],
children: [
{
path: 'detail',
component: () => import('@/views/FDS/whiteListManagement/detail'),
name: 'WhiteListDetail',
meta: { title: '白名单详情', activeMenu: '/build/whiteList' }
}
]
},
{
path: '/build/WhiteList',
component: Layout,
hidden: true,
permissions: ['build:WhiteList:addConfig'],
children: [
{
path: 'addConfig',
component: () => import('@/views/FDS/whiteListManagement/addConfig'),
name: 'WhiteListAdd',
meta: { title: '新增白名单配置', activeMenu: '/build/whiteList' }
}
]
}
]
// 防止连续点击多次路由报错

View File

@ -26,7 +26,7 @@ const permission = {
},
SET_SIDEBAR_ROUTERS: (state, routes) => {
state.sidebarRouters = routes
},
}
},
actions: {
// 生成路由
@ -38,9 +38,12 @@ const permission = {
const rdata = JSON.parse(JSON.stringify(res.data))
const sidebarRoutes = filterAsyncRouter(sdata)
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
const asyncRoutes = filterDynamicRoutes(dynamicRoutes)
console.log(asyncRoutes)
console.log(dynamicRoutes)
rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true })
router.addRoutes(asyncRoutes);
router.addRoutes(asyncRoutes)
commit('SET_ROUTES', rewriteRoutes)
commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes))
commit('SET_DEFAULT_ROUTES', sidebarRoutes)

View File

@ -63,16 +63,13 @@
</el-form-item>
</el-form>
</div>
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitAddForm()"> </el-button>-->
<!-- <el-button @click="cancel"> </el-button>-->
<!-- </div>-->
</el-main>
</el-container>
</div>
</template>
<script>
import { addINFO, updateINFO } from '@/api/FDS/installList'
export default {
name: 'InstallAdd',
@ -132,35 +129,27 @@ export default {
},
computed: {},
mounted() {
console.log(this.$route)
this.activeTabs = this.$route.params.activeTabs
},
methods: {
/** 提交按钮 */
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
if (valid) {
if (this.form.configId != undefined) {
updateINFO(this.form).then(response => {
this.$modal.msgSuccess('修改成功')
this.closeModal()
})
} else {
addINFO(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.closeModal()
})
}
}
})
},
// submitAddForm: function() {
// this.$refs['form'].validate(valid => {
// if (valid) {
// if (this.form.configId != undefined) {
// updateConfig(this.form).then(response => {
// this.$modal.msgSuccess('')
// this.closeModal()
// })
// } else {
// addConfig(this.form).then(response => {
// this.$modal.msgSuccess('')
// this.closeModal()
// })
// }
// }
// })
// },
//
resetForm() {
this.$refs['elForm'].resetFields()

View File

@ -10,18 +10,18 @@
<el-form ref="form" :model="form" label-width="150px" size="mini">
<el-row>
<el-col :span="24">
<el-form-item label="上传方式:">{{ form.uploading_type }}</el-form-item>
<el-form-item label="上传方式:">{{ form.uploadingType }}</el-form-item>
<el-form-item
label="安装包名称:"
>{{ form.sys_apk_name }}
>{{ form.sysApkName }}
</el-form-item>
<el-form-item label="安装包文件名称:">{{ form.sys_apk }}</el-form-item>
<el-form-item label="安装包大小:">{{ form.sys_apk_size }}}</el-form-item>
<el-form-item label="适用系统:">{{ form.sys_type }}</el-form-item>
<el-form-item label="安装包文件名称:">{{ form.sysApk }}</el-form-item>
<el-form-item label="安装包大小:">{{ form.sysApkSize }}</el-form-item>
<el-form-item label="适用系统:">{{ form.sysApkSize }}</el-form-item>
<el-form-item v-if="activeTabs!='1'" label="适用模块:">登录模块</el-form-item>
<el-form-item label="上传时间:">{{ form.create_time }}</el-form-item>
<el-form-item label="上传状态:">已上传</el-form-item>
<el-form-item label="上传人员:">刮刮乐</el-form-item>
<el-form-item label="上传状态:">{{ form.uploadingStatus }}</el-form-item>
<el-form-item label="上传人员:">{{ form.created }}</el-form-item>
<el-form-item label="上传日志:">日志日志</el-form-item>
</el-col>
</el-row>
@ -34,6 +34,8 @@
</template>
<script>
import { getINFO } from '@/api/FDS/installList'
export default {
name: 'InstallDetail',
dicts: ['sys_yes_no'],
@ -41,12 +43,22 @@ export default {
return {
form: {},
tokenId: '',
//
activeTabs: '1'
activeTabs: '1',
id: ''
}
},
methods: {}
created() {
this.getInfo()
},
methods: {
/** 查询安装包管理详情 */
getInfo() {
this.loading = false
getINFO(this.id).then(response => {
this.form = response.rows
})
}
}
}
</script>
<style lang="scss" scoped>

View File

@ -179,7 +179,8 @@
</div>
</template>
<script>
// import { listINFO, getINFO, delINFO, addINFO, updateINFO } from "@/api/deploy/INFO";
import { delINFO, listINFO } from '@/api/FDS/installList'
export default {
name: 'InstallationList',
dicts: ['sys_yes_no'],
@ -232,11 +233,11 @@ export default {
/** 查询安装包管理(新)列表 */
getList() {
this.loading = false
// listINFO(this.queryParams).then(response => {
// this.INFOList = response.rows
// this.total = response.total
// this.loading = false
// })
listINFO(this.queryParams).then(response => {
this.INFOList = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
@ -251,13 +252,12 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.$router.push({
path: 'install/add',
params: {
type: 'add',
activeTabs: this.activeTabs
}
})
const params = {
type: 'add',
activeTabs: this.activeTabs
}
this.$tab.openPage('新增安装包', '/build/install/add/', params)
},
//
handleSelectionChange(selection) {
@ -270,7 +270,7 @@ export default {
handleDelete(row) {
const configIds = row.id || this.ids
this.$modal.confirm('是否确认删除编号为"' + configIds + '"的数据项?').then(function() {
return delConfig(configIds)
return delINFO(configIds)
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
@ -279,27 +279,15 @@ export default {
},
/** 修改按钮操作 */
handleEdit(row) {
this.reset()
const configId = row.id || this.ids
getConfig(configId).then(response => {
this.form = response.data
this.$router.push({
path: 'install/add',
params: {
type: 'edit',
activeTabs: this.activeTabs
}
})
})
const params = {
type: 'edit',
activeTabs: this.activeTabs
}
this.$tab.openPage('编辑安装包', '/build/install/add/', params)
},
/** 查看详情弹窗 **/
handleDetail() {
this.$router.push({
path: 'install/detail',
params: {
activeTabs: this.activeTabs
}
})
handleDetail(row) {
this.$tab.openPage('编辑安装包', '/build/install/add/', row.id)
},
/** 切换TAB触发的事件 */
@ -317,16 +305,7 @@ export default {
this.$modal.msgSuccess('下载成功')
}).catch(() => {
})
},
/** 关闭新增弹出框*/
closeAdd() {
this.addOpen = false
this.getList()
},
closeAddConfig() {
this.detailOpen = false
}
}
}
</script>

View File

@ -302,12 +302,10 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
// 使ES6+
this.reset()
this.$router.push({
path: 'publist/add'
})
const params = {
type: 'add'
}
this.$tab.openPage('新增发布', '/build/publishList/add/', params)
},
//
handleSelectionChange(selection) {
@ -331,9 +329,7 @@ export default {
},
/**查看详情*/
handleDetail() {
this.$router.push({
path: 'publish/detail'
})
this.$tab.openPage('发布详情', '/build/publishList/detail/', '')
},
/**下载安装包*/
handleDownload() {
@ -341,7 +337,10 @@ export default {
},
/**********编辑*******/
handleEdit() {
const params = {
type: 'edit'
}
this.$tab.openPage('编辑发布', '/build/publishList/add/', params)
},
/** 发布操作*/
handlePublish() {

View File

@ -254,11 +254,10 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.$router.push({
path: 'whiteList/add',
const params = {
type: 'add'
})
}
this.$tab.openPage('新增白名单', '/build/WhiteList/add/', params)
},
//
handleSelectionChange(selection) {
@ -268,15 +267,10 @@ export default {
},
/** 修改按钮操作 */
handleEdit(row) {
this.reset()
const configId = row.configId || this.ids
getConfig(configId).then(response => {
this.form = response.data
this.$router.push({
path: 'whiteList/add',
type: 'edit'
})
})
const params = {
type: 'edit'
}
this.$tab.openPage('编辑白名单', '/build/WhiteList/add/', params)
},
/** 白名单配置弹窗 **/
@ -328,13 +322,11 @@ export default {
})
},
/** 查看详情按钮操作 */
handleDetail(row) {
if (row.type == 1) {
this.$router.push({
path: 'whiteList/detail'
})
this.$tab.openPage('白名单详情', '/build/WhiteList/detail/', '')
} else {
this.$router.push({
path: 'whiteList/equepDetail'

View File

@ -16,67 +16,66 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="activeTabs===1" label="安装包名称" prop="field103">
<el-input v-model="formData.field103" :style="{width: '100%'}" clearable placeholder="请输入安装包名称">
<el-form-item v-if="activeTabs===1" label="安装包名称" prop="sysApkName">
<el-input v-model="formData.sysApkName" :style="{width: '100%'}" clearable placeholder="请输入安装包名称">
</el-input>
</el-form-item>
<el-form-item v-else label="模块包名称" prop="field107">
<el-input v-model="formData.field107" :style="{width: '100%'}" clearable placeholder="请输入模块包名称">
</el-input>
</el-form-item>
<el-form-item label="版本号" prop="field104">
<el-input v-model="formData.field104" :style="{width: '100%'}" clearable placeholder="请输入版本号">
<el-form-item label="版本号" prop="version">
<el-input v-model="formData.version" :style="{width: '100%'}" clearable placeholder="请输入版本号">
</el-input>
</el-form-item>
<el-form-item label="安装包文件" prop="field101">
<el-upload ref="field101" :action="field101Action" :before-upload="field101BeforeUpload"
<el-form-item label="安装包文件" prop="sysApk">
<el-upload ref="sysApk" :action="field101Action" :before-upload="field101BeforeUpload"
:file-list="field101fileList"
>
<el-button icon="el-icon-upload" size="small" type="primary">上传文件</el-button>
</el-upload>
</el-form-item>
<el-form-item label="安装包大小" prop="field105">
<el-input v-model="formData.field105" :style="{width: '100%'}" clearable placeholder="请输入安装包大小">
<el-form-item label="安装包大小" prop="sysApkSize">
<el-input v-model="formData.sysApkSize" :style="{width: '100%'}" clearable placeholder="请输入安装包大小">
</el-input>
</el-form-item>
<el-form-item label="适用系统" prop="field106">
<el-radio-group v-model="formData.field106" size="medium">
<el-radio v-for="(item, index) in field106Options" :key="index" :disabled="item.disabled"
:label="item.value"
>{{ item.label }}
</el-radio>
</el-radio-group>
<el-form-item label="安装包类型" prop="sysType">
<el-select v-model="form.sysType" placeholder="请选择安装包类型">
<el-option
v-for="dict in dict.type.sys_apk_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item v-if="activeTabs!='1'" label="适用模块" prop="configName">-->
<!-- <el-select v-model="formData.field108" clearable placeholder="请选择对应的模块">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.sys_yes_no"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item v-if="activeTabs!='1'" label="适用模块" prop="configName">-->
<!-- <el-select v-model="formData.field108" clearable placeholder="请选择对应的模块">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.sys_yes_no"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item size="large">
<el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="resetForm">重置</el-button>
</el-form-item>
</el-form>
</div>
<!-- <div slot="footer" class="dialog-footer">-->
<!-- <el-button type="primary" @click="submitAddForm()"> </el-button>-->
<!-- <el-button @click="cancel"> </el-button>-->
<!-- </div>-->
</el-main>
</el-container>
</div>
</template>
<script>
import { addINFO, updateINFO } from '@/api/deploy/INFO'
export default {
name: 'InstallAdd',
dicts: ['sys_yes_no'],
dicts: ['sys_apk_uploading_type', 'uploading_status', 'sys_apk_type'],
data() {
return {
formData: {
@ -138,29 +137,26 @@ export default {
methods: {
/** 提交按钮 */
submitForm() {
this.$refs['elForm'].validate(valid => {
if (!valid) return
// TODO
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.id != null) {
let data = Object.assign({}, this.form)
delete data.explain
updateINFO(data).then(response => {
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
addINFO(this.form).then(response => {
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
})
},
// submitAddForm: function() {
// this.$refs['form'].validate(valid => {
// if (valid) {
// if (this.form.configId != undefined) {
// updateConfig(this.form).then(response => {
// this.$modal.msgSuccess('')
// this.closeModal()
// })
// } else {
// addConfig(this.form).then(response => {
// this.$modal.msgSuccess('')
// this.closeModal()
// })
// }
// }
// })
// },
//
resetForm() {
this.$refs['elForm'].resetFields()

View File

@ -179,9 +179,10 @@
</div>
</template>
<script>
// import { listINFO, getINFO, delINFO, addINFO, updateINFO } from "@/api/deploy/INFO";
import { listINFO } from '@/api/deploy/INFO'
export default {
name: 'InstallationList',
name: 'InstallationLis1t',
dicts: ['sys_yes_no'],
data() {
return {
@ -232,11 +233,11 @@ export default {
/** 查询安装包管理(新)列表 */
getList() {
this.loading = false
// listINFO(this.queryParams).then(response => {
// this.INFOList = response.rows
// this.total = response.total
// this.loading = false
// })
listINFO(this.queryParams).then(response => {
this.INFOList = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {