fix: 优化白名单页面和安装包页面的逻辑,字段,删除多次弹窗的逻辑,控制组件显隐的判断
This commit is contained in:
parent
8a0e6b5a34
commit
97cf321b57
@ -1,11 +1,10 @@
|
||||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
/* Layout */
|
||||
import Layout from '@/layout'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
/**
|
||||
* Note: 路由配置项
|
||||
*
|
||||
@ -20,12 +19,12 @@ import Layout from '@/layout'
|
||||
* roles: ['admin', 'common'] // 访问路由的角色权限
|
||||
* permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限
|
||||
* meta : {
|
||||
noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
|
||||
title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
|
||||
icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
|
||||
activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
|
||||
}
|
||||
noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
|
||||
title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
|
||||
icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
|
||||
breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
|
||||
activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
|
||||
}
|
||||
*/
|
||||
|
||||
// 公共路由
|
||||
@ -161,12 +160,25 @@ export const dynamicRoutes = [
|
||||
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/publishLish/add',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'index/:jobId(\\d+)',
|
||||
component: () => import('@/views/monitor/job/log'),
|
||||
name: 'PublishAdd',
|
||||
meta: { title: '新建发布', activeMenu: '/FDS/publishList' }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
// 防止连续点击多次路由报错
|
||||
let routerPush = Router.prototype.push;
|
||||
let routerReplace = Router.prototype.replace;
|
||||
let routerPush = Router.prototype.push
|
||||
let routerReplace = Router.prototype.replace
|
||||
// push
|
||||
Router.prototype.push = function push(location) {
|
||||
return routerPush.call(this, location).catch(err => err)
|
||||
|
@ -1,21 +1,20 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<el-tabs v-model="activeTabs">
|
||||
<el-tabs v-model="activeTabs" type="card" @tab-click="handleClickTabs">
|
||||
<el-tab-pane
|
||||
:key="item.name"
|
||||
v-for="item in packTabs"
|
||||
:key="item.name"
|
||||
:label="item.title"
|
||||
:name="item.name"
|
||||
>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||
<el-form-item label="安装包名称" prop="installpackName">
|
||||
<el-input
|
||||
v-model="queryParams.installpackName"
|
||||
placeholder="请输入安装包名称"
|
||||
clearable
|
||||
placeholder="请输入安装包名称"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
@ -23,14 +22,14 @@
|
||||
<el-form-item label="版本" prop="versions">
|
||||
<el-input
|
||||
v-model="queryParams.versions"
|
||||
placeholder="请输入版本"
|
||||
clearable
|
||||
placeholder="请输入版本"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传方式" prop="uploadMode">
|
||||
<el-select v-model="queryParams.uploadMode" placeholder="请选择上传方式" clearable>
|
||||
<el-select v-model="queryParams.uploadMode" clearable placeholder="请选择上传方式">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
@ -42,16 +41,16 @@
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 240px"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="configType">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-select v-model="queryParams.status" clearable placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
@ -61,7 +60,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -69,188 +68,164 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:config:add']"
|
||||
>新建</el-button>
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>新建
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:config:delete']"
|
||||
>批量删除</el-button>
|
||||
:disabled="multiple"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="info"
|
||||
@click="handleDelete"
|
||||
>批量删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange" v-if="activeTabs==1">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="安装包名称" align="center" prop="configId" />
|
||||
<el-table-column label="版本号" align="center" prop="configName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="安装包大小" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="上传方式" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center" prop="configType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType"/>
|
||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<template v-if="activeTabs=='1'">
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<el-table-column align="center" label="离线包名称" prop="configId"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="版本" prop="configName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="平台" prop="configValue"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="创建人" prop="configValue"/>
|
||||
</template>
|
||||
<template v-if="activeTabs=='2'">
|
||||
<el-table-column align="center" label="安装包名称" prop="configId"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="configName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="安装包大小" prop="configKey"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="上传方式" prop="configValue"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="创建人" prop="configValue"/>
|
||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column align="center" label="状态" prop="configType">
|
||||
<template slot-scope="scopeA">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scopeA.row.type"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="250">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleDownload(scope.row)"
|
||||
v-hasPermi="['system:config:dowmload']"
|
||||
>下载安装包</el-button>
|
||||
<el-button
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)"
|
||||
@click="handleDownload(scope.row)"
|
||||
>下载安装包
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['system:config:detail']"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
@click="handleEdit(scope.row)"
|
||||
>编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:config:detail']"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleDetail(scope.row)"
|
||||
>详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:config:delete']"
|
||||
>删除</el-button>
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange" v-else>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="离线包名称" align="center" prop="configId" />
|
||||
<el-table-column label="版本" align="center" prop="configName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="平台" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="状态" align="center" prop="configType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleDownload(scope.row)"
|
||||
v-hasPermi="['system:config:dowmload']"
|
||||
>下载安装包</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleEdit(scope.row)"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>编辑</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['system:config:detail']"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:config:delete']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<pagination
|
||||
v-if="activeTabs==1"
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<pagination
|
||||
v-else
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 上传APP安装包的弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="addOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="上传方式" prop="configName">
|
||||
<el-dialog :title="title" :visible.sync="addOpen" append-to-body width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="上传方式" prop="debug">
|
||||
<el-radio-group v-model="form.debug">
|
||||
<el-radio
|
||||
:key="1"
|
||||
:label="在线上传"
|
||||
>在线上传</el-radio>
|
||||
label="1"
|
||||
>在线上传
|
||||
</el-radio>
|
||||
<el-radio
|
||||
:key="2"
|
||||
:label="离线上传"
|
||||
>离线上传</el-radio>
|
||||
|
||||
label="2"
|
||||
>离线上传
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item :label="activeTabs==1?'安装包名称':'模块包名称'" prop="configKey">
|
||||
<el-input v-model="form.configKey" :placeholder="activeTabs==1?'请输入安装包名称':'请输入模块包名称'" />
|
||||
<el-form-item :label="activeTabs=='1'?'安装包名称':'模块包名称'" prop="configKey">
|
||||
<el-input v-model="form.configKey" :placeholder="activeTabs=='1'?'请输入安装包名称':'请输入模块包名称'"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入版本号" />
|
||||
<el-form-item label="版本号">
|
||||
<el-input v-model="form.configName" placeholder="请输入版本号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="安装包文件" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入安装包版本号" />
|
||||
<el-form-item label="安装包文件">
|
||||
<el-upload
|
||||
ref="whiteListFiles"
|
||||
:auto-upload="true"
|
||||
:before-remove="beforeRemove"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:file-list="fileList"
|
||||
:headers="{tokenId: tokenId}"
|
||||
:multiple="false"
|
||||
:on-success="handleSuccess"
|
||||
accept=".zip"
|
||||
action="https://jsonplaceholder.typicode.com/posts/"
|
||||
class="upload"
|
||||
>
|
||||
<el-button slot="trigger" size="small" type="primary">上传文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="安装包大小" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入安装包版本号" />
|
||||
<el-form-item label="安装包大小">
|
||||
<el-input v-model="form.configName" placeholder="请输入安装包版本号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="适用系统" prop="configName">
|
||||
<el-radio-group v-model="form.debug">
|
||||
<el-form-item label="适用系统">
|
||||
<el-radio-group v-model="form.platform">
|
||||
<el-radio
|
||||
:key="1"
|
||||
:label="Android"
|
||||
>Android</el-radio>
|
||||
label="Android"
|
||||
>Android
|
||||
</el-radio>
|
||||
<el-radio
|
||||
:key="2"
|
||||
:label="鸿蒙"
|
||||
>鸿蒙</el-radio>
|
||||
|
||||
label="鸿蒙"
|
||||
>鸿蒙
|
||||
</el-radio>
|
||||
<el-radio
|
||||
:key="3"
|
||||
:label="IOS"
|
||||
>IOS</el-radio>
|
||||
label="IOS"
|
||||
>IOS
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="适用模块" prop="configName" v-if="activeTabs!=1">
|
||||
<el-select v-model="queryParams.uploadMode" placeholder="请选择对应的模块" clearable>
|
||||
<el-form-item v-if="activeTabs!='1'" label="适用模块" prop="configName">
|
||||
<el-select v-model="queryParams.uploadMode" clearable placeholder="请选择对应的模块">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
@ -262,23 +237,24 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm(2)">保 存</el-button>
|
||||
<el-button @click="cancel(2)">取 消</el-button>
|
||||
<el-button @click="addOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 安装包详情弹窗 -->
|
||||
<el-dialog title="安装包详情" :visible.sync="detailOpen" width="700px" append-to-body>
|
||||
<el-dialog :visible.sync="detailOpen" append-to-body title="安装包详情" width="700px">
|
||||
<el-form ref="form" :model="form" label-width="150px" size="mini">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="上传方式:">离线上传</el-form-item>
|
||||
<el-form-item
|
||||
label="安装包名称:"
|
||||
>安装包11111</el-form-item>
|
||||
>安装包11111
|
||||
</el-form-item>
|
||||
<el-form-item label="安装包文件名称:">安装包1111.excel</el-form-item>
|
||||
<el-form-item label="安装包大小:">58.1kb</el-form-item>
|
||||
<el-form-item label="适用系统:">安卓</el-form-item>
|
||||
<el-form-item label="适用模块:" v-if="activeTabs!=1">登录模块</el-form-item>
|
||||
<el-form-item v-if="activeTabs!='1'" label="适用模块:">登录模块</el-form-item>
|
||||
<el-form-item label="上传时间:">上传时间2024-04-07 17:43</el-form-item>
|
||||
<el-form-item label="上传状态:">已上传</el-form-item>
|
||||
<el-form-item label="上传人员:">刮刮乐</el-form-item>
|
||||
@ -293,9 +269,10 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
|
||||
import { addConfig, delConfig, getConfig, listConfig, updateConfig } from '@/api/system/config'
|
||||
|
||||
export default {
|
||||
name: "installationList",
|
||||
name: 'installationList',
|
||||
dicts: ['sys_yes_no'],
|
||||
data() {
|
||||
return {
|
||||
@ -312,13 +289,20 @@ export default {
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 参数表格数据
|
||||
|
||||
dataList: [],
|
||||
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示安装包上传弹出框
|
||||
addOpen: false,
|
||||
// 是否显示安装包详情弹出框
|
||||
detailOpen:false,
|
||||
detailOpen: false,
|
||||
tokenId: '',
|
||||
// 文件存放的路径
|
||||
fileList: [],
|
||||
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
@ -334,46 +318,58 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
configName: [
|
||||
{ required: true, message: "上传方式不能为空", trigger: "change" }
|
||||
{ required: true, message: '上传方式不能为空', trigger: 'change' }
|
||||
],
|
||||
configKey: [
|
||||
{ required: true, message: "安装包名称不能为空", trigger: "blur" }
|
||||
],
|
||||
{ required: true, message: '安装包名称不能为空', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
// 当前选中的安装包方式 1=APP安装包,2=H5模块包
|
||||
activeTabs:1,
|
||||
activeTabs: '1',
|
||||
|
||||
packTabs:[{
|
||||
name:1,
|
||||
title:'APP安装包'
|
||||
},{
|
||||
name:2,
|
||||
packTabs: [{
|
||||
name: '1',
|
||||
title: 'APP安装包'
|
||||
}, {
|
||||
name: '2',
|
||||
title: 'H5模块包'
|
||||
}]
|
||||
};
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询参数列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.loading = true
|
||||
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.configList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
this.dataList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
}
|
||||
);
|
||||
)
|
||||
},
|
||||
|
||||
/** 查询参数列表 */
|
||||
getConfigList() {
|
||||
this.loading = true
|
||||
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.configList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel(type) {
|
||||
if (type===1){
|
||||
this.addOpen= false
|
||||
}else {
|
||||
if (type === 1) {
|
||||
this.addOpen = false
|
||||
} else {
|
||||
this.configOpen = false
|
||||
}
|
||||
this.reset();
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
@ -382,70 +378,121 @@ export default {
|
||||
configName: undefined,
|
||||
configKey: undefined,
|
||||
configValue: undefined,
|
||||
configType: "Y",
|
||||
configType: 'Y',
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.dateRange = []
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.addOpen = true;
|
||||
this.title = "上传安装包";
|
||||
this.reset()
|
||||
this.addOpen = true
|
||||
this.title = '上传安装包'
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.configId)
|
||||
this.single = selection.length!=1
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.configId != undefined) {
|
||||
updateConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.addOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.addOpen = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.addOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.addOpen = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const configIds = row.configId || this.ids;
|
||||
const configIds = row.configId || this.ids
|
||||
this.$modal.confirm('是否确认删除编号为"' + configIds + '"的数据项?').then(function() {
|
||||
return delConfig(configIds);
|
||||
return delConfig(configIds)
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleEdit(row) {
|
||||
this.reset()
|
||||
const configId = row.configId || this.ids
|
||||
getConfig(configId).then(response => {
|
||||
this.form = response.data
|
||||
this.addOpen = true
|
||||
this.title = '修改安装包'
|
||||
})
|
||||
},
|
||||
/** 查看详情弹窗 **/
|
||||
handleDetail() {
|
||||
this.detailOpen = true;
|
||||
this.detailOpen = true
|
||||
},
|
||||
|
||||
/** 在上传之前进行校验 */
|
||||
beforeAvatarUpload(file) {
|
||||
const formatList = file.name.split('.')
|
||||
const isFormat = formatList[formatList.length - 1] === 'zip'
|
||||
if (!isFormat) {
|
||||
this.$message.error(`上传格式只能是名称后缀为.zip的压缩文件!`)
|
||||
}
|
||||
},
|
||||
/** 上传文件 */
|
||||
handleSuccess(file) {
|
||||
this.fileList = []
|
||||
const nameList = file.context.path.split('/')
|
||||
this.fileList.push({
|
||||
name: file.context.name || nameList[nameList.length - 1],
|
||||
url: file.context.path
|
||||
})
|
||||
this.addFormData.path = file.context.path
|
||||
},
|
||||
beforeRemove(files, filesList) {
|
||||
return this.$confirm(`确定要移除${files.name}?`)
|
||||
},
|
||||
|
||||
/** 切换TAB触发的事件 */
|
||||
handleClickTabs(e) {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
/** 下载按钮 */
|
||||
handleDownload(row) {
|
||||
const configIds = row.configId || this.ids
|
||||
this.$modal.confirm('是否确认下载编号为"' + configIds + '"的数据项?').then(function() {
|
||||
return delConfig(configIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('下载成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||
<el-form-item label="选择APP" prop="configName">
|
||||
<el-select v-model="queryParams.configType" placeholder="请选择APP" clearable>
|
||||
<el-select v-model="queryParams.configType" clearable placeholder="请选择APP">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
@ -14,8 +14,8 @@
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input
|
||||
v-model="queryParams.version"
|
||||
placeholder="请输入版本号"
|
||||
clearable
|
||||
placeholder="请输入版本号"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
@ -24,18 +24,18 @@
|
||||
<el-form-item label="公开时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 240px"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="状态" prop="configType">
|
||||
<el-select v-model="queryParams.configType" placeholder="请选择状态" clearable>
|
||||
<el-select v-model="queryParams.configType" clearable placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
@ -45,7 +45,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -53,84 +53,90 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-hasPermi="['system:config:add']"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:config:add']"
|
||||
>新增</el-button>
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
:disabled="multiple"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="info"
|
||||
@click="handlePublish"
|
||||
>批量发布</el-button>
|
||||
>批量发布
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:config:add']"
|
||||
>批量删除</el-button>
|
||||
:disabled="multiple"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="info"
|
||||
@click="handleDelete"
|
||||
>批量删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="APP" align="center" prop="configId" />
|
||||
<el-table-column label="文件类型" align="center" prop="configName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="版本号" align="center" prop="version" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="子版本号" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<el-table-column align="center" label="APP" prop="configId"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="文件类型" prop="configName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="版本号" prop="version"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="子版本号" prop="configValue"/>
|
||||
<el-table-column
|
||||
prop="platform"
|
||||
label="系统"
|
||||
min-width="80"
|
||||
> <template scope="scope">
|
||||
<div>{{ scope.row.platform === '0'?'安卓':'IOS' }}</div>
|
||||
</template>
|
||||
prop="platform"
|
||||
>
|
||||
<template scope="scope">
|
||||
<div>{{ scope.row.platform === '0' ? '安卓' : 'IOS' }}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="公开版" align="center" prop="createTime" width="180">
|
||||
<el-table-column align="center" label="公开版" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="tagsView" class="drawer-switch" disabled/>
|
||||
<el-switch v-model="scope.row.tagsView" class="drawer-switch" disabled/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="强制更新" align="center" prop="createTime" width="180">
|
||||
<el-table-column align="center" label="强制更新" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="tagsView" class="drawer-switch" disabled/>
|
||||
<el-switch v-model="scope.row.tagsView" class="drawer-switch" disabled/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="上传时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column align="center" label="上传时间" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="发布环境" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="发布环境" prop="configValue"/>
|
||||
|
||||
<el-table-column label="发布状态" align="center" prop="configType">
|
||||
<el-table-column align="center" label="发布状态" prop="configType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="公开时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column align="center" label="公开时间" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="更新说明" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="更新说明" prop="remark"/>
|
||||
<el-table-column
|
||||
align="center"
|
||||
label="二维码"
|
||||
@ -147,121 +153,124 @@
|
||||
<img :src="'data:image/jpg;base64,'+ scope.row.qrCode">
|
||||
<p v-if="scopeC.row.verifyCode">密码:{{ scope.row.verifyCode }}</p>
|
||||
</div>
|
||||
<!-- <img slot="reference" src="@/assets/code.png" class="table-qr">-->
|
||||
<!-- <img slot="reference" src="@/assets/code.png" class="table-qr">-->
|
||||
</el-popover>
|
||||
<div v-else>-</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>下架</el-button>
|
||||
<el-button
|
||||
icon="el-icon-bottom"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
@click="handleDown(scope.row)"
|
||||
>下架
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>详情</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>下载安装包</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:config:remove']"
|
||||
>删除</el-button>
|
||||
@click="handleEdit(scope.row)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-dropdown size="mini"
|
||||
@command="(command) => handleCommand(command, scope.row)"
|
||||
>
|
||||
<el-button icon="el-icon-d-arrow-right" size="mini" type="text">更多</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item v-hasPermi="['system:user:resetPwd']" command="handleDetail"
|
||||
icon="el-icon-view"
|
||||
>详情
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-hasPermi="['system:user:edit']" command="handleDownload"
|
||||
icon="el-icon-download"
|
||||
>下载安装包
|
||||
</el-dropdown-item>
|
||||
|
||||
<el-dropdown-item v-hasPermi="['system:user:edit']" command="handleDelete"
|
||||
icon="el-icon-delete"
|
||||
>删除
|
||||
</el-dropdown-item>
|
||||
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 新增白名单弹出框 -->
|
||||
<el-dialog :title="title" :visible.sync="addOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="白名单名称" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="请输入参数名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="白名单类型" prop="configKey">
|
||||
<el-input v-model="form.configKey" placeholder="请输入参数键名" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm(1)">保 存</el-button>
|
||||
<el-button @click="cancel(1)">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- <el-dialog :title="title" :visible.sync="addOpen" append-to-body width="500px">-->
|
||||
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
|
||||
<!-- <el-form-item label="白名单名称" prop="configName">-->
|
||||
<!-- <el-input v-model="form.configName" placeholder="请输入参数名称"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="白名单类型" prop="configKey">-->
|
||||
<!-- <el-input v-model="form.configKey" placeholder="请输入参数键名"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="备注" prop="remark">-->
|
||||
<!-- <el-input v-model="form.remark" placeholder="请输入内容" type="textarea"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="primary" @click="submitForm(1)">保 存</el-button>-->
|
||||
<!-- <el-button @click="cancel(1)">取 消</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
|
||||
|
||||
<!-- 白名单配置弹出框 -->
|
||||
<el-dialog :title="title" :visible.sync="configOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="添加方式" prop="configName">
|
||||
<el-radio-group v-model="form.debug">
|
||||
<el-radio
|
||||
:key="1"
|
||||
:label="手动添加"
|
||||
>手动添加</el-radio>
|
||||
<el-radio
|
||||
:key="2"
|
||||
:label="批量添加"
|
||||
>批量添加</el-radio>
|
||||
<!-- <el-dialog :title="title" :visible.sync="configOpen" append-to-body width="500px">-->
|
||||
<!-- <el-form ref="form" :model="form" :rules="rules" label-width="80px">-->
|
||||
<!-- <el-form-item label="添加方式" prop="configName">-->
|
||||
<!-- <el-radio-group v-model="form.debug">-->
|
||||
<!-- <el-radio-->
|
||||
<!-- :key="1"-->
|
||||
<!-- :label="手动添加"-->
|
||||
<!-- >手动添加-->
|
||||
<!-- </el-radio>-->
|
||||
<!-- <el-radio-->
|
||||
<!-- :key="2"-->
|
||||
<!-- :label="批量添加"-->
|
||||
<!-- >批量添加-->
|
||||
<!-- </el-radio>-->
|
||||
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="白名单类型" prop="configKey">
|
||||
<el-input v-model="form.configKey" placeholder="请选择白名单类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="白名单ID" prop="configName">
|
||||
<el-input v-model="form.configName" placeholder="输入用户ID" />
|
||||
</el-form-item>
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="白名单类型" prop="configKey">-->
|
||||
<!-- <el-input v-model="form.configKey" placeholder="请选择白名单类型"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="白名单ID" prop="configName">-->
|
||||
<!-- <el-input v-model="form.configName" placeholder="输入用户ID"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm(2)">保 存</el-button>
|
||||
<el-button @click="cancel(2)">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- <el-form-item label="备注" prop="remark">-->
|
||||
<!-- <el-input v-model="form.remark" placeholder="请输入备注" type="textarea"/>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-form>-->
|
||||
<!-- <div slot="footer" class="dialog-footer">-->
|
||||
<!-- <el-button type="primary" @click="submitForm(2)">保 存</el-button>-->
|
||||
<!-- <el-button @click="cancel(2)">取 消</el-button>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-dialog>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
|
||||
import { addConfig, delConfig, getConfig, listConfig, updateConfig } from '@/api/system/config'
|
||||
|
||||
export default {
|
||||
name: "Config",
|
||||
name: 'Config',
|
||||
dicts: ['sys_yes_no'],
|
||||
data() {
|
||||
return {
|
||||
@ -280,11 +289,11 @@ export default {
|
||||
// 参数表格数据
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示新增白名单弹出框
|
||||
addOpen: false,
|
||||
// 是否显示白名单配置弹出框
|
||||
configOpen:false,
|
||||
configOpen: false,
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
@ -300,39 +309,39 @@ export default {
|
||||
// 表单校验
|
||||
rules: {
|
||||
configName: [
|
||||
{ required: true, message: "参数名称不能为空", trigger: "blur" }
|
||||
{ required: true, message: '参数名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
configKey: [
|
||||
{ required: true, message: "参数键名不能为空", trigger: "blur" }
|
||||
{ required: true, message: '参数键名不能为空', trigger: 'blur' }
|
||||
],
|
||||
configValue: [
|
||||
{ required: true, message: "参数键值不能为空", trigger: "blur" }
|
||||
{ required: true, message: '参数键值不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询参数列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.loading = true
|
||||
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.configList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
this.configList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
}
|
||||
);
|
||||
)
|
||||
},
|
||||
// 取消按钮
|
||||
cancel(type) {
|
||||
if (type===1){
|
||||
this.addOpen= false
|
||||
}else {
|
||||
if (type === 1) {
|
||||
this.addOpen = false
|
||||
} else {
|
||||
this.configOpen = false
|
||||
}
|
||||
this.reset();
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
@ -341,89 +350,118 @@ export default {
|
||||
configName: undefined,
|
||||
configKey: undefined,
|
||||
configValue: undefined,
|
||||
configType: "Y",
|
||||
configType: 'Y',
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.dateRange = []
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
// this.addOpen = true;
|
||||
// this.title = "新增白名单";
|
||||
const type= 'add'
|
||||
this.$router.push("publishList/add" + type);
|
||||
this.reset()
|
||||
// 使用ES6+语法
|
||||
this.reset()
|
||||
const type = 'add'
|
||||
this.$router.push({
|
||||
name: 'PublishAdd'
|
||||
})
|
||||
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.configId)
|
||||
this.single = selection.length!=1
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.reset()
|
||||
const configId = row.configId || this.ids
|
||||
getConfig(configId).then(response => {
|
||||
this.form = response.data;
|
||||
this.addOpen = true;
|
||||
this.title = "修改白名单";
|
||||
});
|
||||
this.form = response.data
|
||||
this.addOpen = true
|
||||
this.title = '修改白名单'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.configId != undefined) {
|
||||
updateConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.addOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.addOpen = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.addOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.addOpen = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const configIds = row.configId || this.ids;
|
||||
this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?').then(function() {
|
||||
return delConfig(configIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
async handleDelete(row) {
|
||||
const configIds = row.configId || this.ids
|
||||
try {
|
||||
await this.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?')
|
||||
await delConfig(configIds)
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
} catch (error) {
|
||||
console.error('删除失败', error)
|
||||
// 可以添加更多的错误处理逻辑,如用户提示等
|
||||
}
|
||||
},
|
||||
// /** 导出按钮操作 */
|
||||
// handleExport() {
|
||||
// this.download('system/config/export', {
|
||||
// ...this.queryParams
|
||||
// }, `config_${new Date().getTime()}.xlsx`)
|
||||
// },
|
||||
// /** 刷新缓存按钮操作 */
|
||||
// handleRefreshCache() {
|
||||
// refreshCache().then(() => {
|
||||
// this.$modal.msgSuccess("刷新成功");
|
||||
// });
|
||||
// }
|
||||
/**查看详情*/
|
||||
handleDetail() {
|
||||
|
||||
},
|
||||
/**下载安装包*/
|
||||
handleDownload() {
|
||||
|
||||
},
|
||||
/**********编辑*******/
|
||||
handleEdit() {
|
||||
|
||||
},
|
||||
|
||||
/** 发布操作*/
|
||||
handlePublish() {
|
||||
|
||||
},
|
||||
|
||||
// 更多操作触发
|
||||
handleCommand(command, row) {
|
||||
switch (command) {
|
||||
case 'handleDetail':
|
||||
this.handleDetail(row)
|
||||
break
|
||||
case 'handleDownload':
|
||||
this.handleDownload(row)
|
||||
break
|
||||
|
||||
case 'handleDelete':
|
||||
this.handleDelete(row)
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="90px">
|
||||
<el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="90px" size="small">
|
||||
<el-form-item label="名单类型" prop="whiteListType">
|
||||
<el-input
|
||||
v-model="queryParams.whiteListType"
|
||||
placeholder="请输入名单类型"
|
||||
clearable
|
||||
placeholder="请输入名单类型"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
@ -13,8 +13,8 @@
|
||||
<el-form-item label="名称" prop="whiteListName">
|
||||
<el-input
|
||||
v-model="queryParams.whiteListName"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
placeholder="请输入名称"
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
@ -22,16 +22,16 @@
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
style="width: 240px"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="configType">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
|
||||
<el-select v-model="queryParams.status" clearable placeholder="请选择状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_yes_no"
|
||||
:key="dict.value"
|
||||
@ -41,7 +41,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@ -49,115 +49,136 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:config:add']"
|
||||
>新增</el-button>
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="info"
|
||||
@click="handlePublish"
|
||||
>批量发布</el-button>
|
||||
>批量发布
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
icon="el-icon-plus"
|
||||
plain
|
||||
size="mini"
|
||||
type="info"
|
||||
@click="handleDelete"
|
||||
>批量删除</el-button>
|
||||
>批量删除
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="白名单名称" align="center" prop="configId" />
|
||||
<el-table-column label="说明" align="center" prop="configName" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="白名单类型" align="center" prop="configKey" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="数量" align="center" prop="configValue" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<el-table-column align="center" type="selection" width="55"/>
|
||||
<el-table-column align="center" label="白名单名称" prop="configId"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="说明" prop="configName"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="白名单类型" prop="configKey"/>
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="数量" prop="configValue"/>
|
||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="configType">
|
||||
<el-table-column align="center" label="状态" prop="configType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.configType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column :show-overflow-tooltip="true" align="center" label="备注" prop="remark"/>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>下架</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleDown(scope.row)"
|
||||
>下架
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>预览</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleView(scope.row)"
|
||||
>预览
|
||||
</el-button>
|
||||
<el-button
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>发布</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handlePublish(scope.row)"
|
||||
>发布
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:config:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
@click="handleConfig(scope.row)"
|
||||
>名单配置
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-hasPermi="['system:config:edit']"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleEdit(scope.row)"
|
||||
>修改
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['system:config:remove']"
|
||||
>删除</el-button>
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
type="text"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 新增白名单弹出框 -->
|
||||
<el-dialog :title="title" :visible.sync="addOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="白名单名称" prop="configName">
|
||||
<el-input v-model="form.whiteListName" placeholder="请输入白名单名称" />
|
||||
<el-dialog :title="title" :visible.sync="addOpen" append-to-body width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="白名单名称" prop="whiteListName">
|
||||
<el-input v-model="form.whiteListName" placeholder="请输入白名单名称"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="白名单类型" prop="configKey">
|
||||
<el-input v-model="form.whiteListType" placeholder="请选择白名单类型" />
|
||||
<el-form-item label="白名单类型" prop="whiteListType">
|
||||
<el-select v-model="form.whiteListType" 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 label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" placeholder="请输入内容" type="textarea"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -166,28 +187,45 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 白名单配置弹出框 -->
|
||||
<el-dialog :title="title" :visible.sync="configOpen" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="configForm" :rules="configRules" label-width="80px">
|
||||
<el-dialog :title="title" :visible.sync="configOpen" append-to-body width="500px">
|
||||
<el-form ref="form" :model="configForm" :rules="configRules" label-width="120px">
|
||||
<el-form-item label="添加方式" prop="configName">
|
||||
<el-radio-group v-model="configForm.addMode">
|
||||
<el-radio
|
||||
:key="1"
|
||||
:label="手动添加"
|
||||
>手动添加</el-radio>
|
||||
:label="1"
|
||||
>手动添加
|
||||
</el-radio>
|
||||
<el-radio
|
||||
:key="2"
|
||||
:label="批量添加"
|
||||
>批量添加</el-radio>
|
||||
:label="2"
|
||||
>批量添加
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="白名单类型" prop="whiteListType">
|
||||
<el-input v-model="form.whiteListType" placeholder="请选择白名单类型" />
|
||||
<el-input v-model="configForm.whiteListType" placeholder="请选择白名单类型"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="白名单ID" prop="whitelistIds">
|
||||
<el-input v-model="form.whitelistIds" type="textarea" placeholder="请输入用户ID" />
|
||||
<el-form-item v-if="configForm.addMode==1" label="白名单ID" prop="whitelistIds">
|
||||
<el-input v-model="configForm.whitelistIds" placeholder="请输入白名单ID" type="textarea"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-else-if="configForm.addMode==2" label="白名单文件">
|
||||
<el-upload
|
||||
ref="whiteListFiles"
|
||||
:auto-upload="true"
|
||||
:before-remove="beforeRemove"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
:file-list="fileList"
|
||||
:headers="{tokenId: tokenId}"
|
||||
:multiple="false"
|
||||
:on-success="handleSuccess"
|
||||
accept=".txt"
|
||||
action="https://jsonplaceholder.typicode.com/posts/"
|
||||
class="upload"
|
||||
>
|
||||
<el-button slot="trigger" size="small" type="primary">上传文件</el-button>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
<el-input v-model="configForm.remark" placeholder="请输入备注" type="textarea"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -199,12 +237,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addConfig, delConfig, getConfig, updateConfig } from '@/api/system/config'
|
||||
|
||||
import { Document11691998078000list } from '@/api/FDS/whiteList'
|
||||
import { addConfig, delConfig, getConfig, listConfig, updateConfig } from '@/api/system/config'
|
||||
|
||||
export default {
|
||||
name: "WhiteList",
|
||||
name: 'WhiteList',
|
||||
dicts: ['sys_yes_no'],
|
||||
data() {
|
||||
return {
|
||||
@ -223,11 +259,11 @@ export default {
|
||||
// 参数表格数据
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
title: '',
|
||||
// 是否显示新增白名单弹出框
|
||||
addOpen: false,
|
||||
// 是否显示白名单配置弹出框
|
||||
configOpen:false,
|
||||
configOpen: false,
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
@ -236,58 +272,63 @@ export default {
|
||||
pageSize: 10,
|
||||
whiteListName: undefined,
|
||||
whiteListType: undefined,
|
||||
status:undefined
|
||||
status: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 白名单配置表单参数
|
||||
configForm: {},
|
||||
configForm: {
|
||||
addMode: 1,
|
||||
whiteListType: undefined,
|
||||
whitelistIds: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
whiteListName: [
|
||||
{ required: true, message: "白名单名称不能为空", trigger: "blur" }
|
||||
{ required: true, message: '白名单名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
whiteListType: [
|
||||
{ required: true, message: "白名单类型不能为空", trigger: "change" }
|
||||
],
|
||||
{ required: true, message: '白名单类型不能为空', trigger: 'change' }
|
||||
]
|
||||
},
|
||||
// 白名单配置表单验证
|
||||
configRules: {
|
||||
addMode: [
|
||||
{ required: true, message: "添加方式不能为空", trigger: "change" }
|
||||
{ required: true, message: '添加方式不能为空', trigger: 'change' }
|
||||
],
|
||||
whiteListType: [
|
||||
{ required: true, message: "白名单类型不能为空", trigger: "change" }
|
||||
{ required: true, message: '白名单类型不能为空', trigger: 'change' }
|
||||
],
|
||||
whitelistIds: [
|
||||
{ required: true, message: "白名单名称不能为空", trigger: "blur" }
|
||||
],
|
||||
{ required: true, message: '白名单名称不能为空', trigger: 'blur' }
|
||||
]
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
/** 查询参数列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
Document11691998078000list(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.configList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
this.loading = true
|
||||
listConfig(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.configList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
}
|
||||
);
|
||||
)
|
||||
},
|
||||
// 取消按钮
|
||||
cancel(type) {
|
||||
if (type===1){
|
||||
this.addOpen= false
|
||||
}else {
|
||||
if (type === 1) {
|
||||
this.addOpen = false
|
||||
} else {
|
||||
this.configOpen = false
|
||||
}
|
||||
this.reset();
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
@ -296,100 +337,168 @@ export default {
|
||||
configName: undefined,
|
||||
configKey: undefined,
|
||||
configValue: undefined,
|
||||
configType: "Y",
|
||||
configType: 'Y',
|
||||
remark: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
this.dateRange = []
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.addOpen = true;
|
||||
this.title = "新增白名单";
|
||||
this.reset()
|
||||
this.addOpen = true
|
||||
this.title = '新增白名单'
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.configId)
|
||||
this.single = selection.length!=1
|
||||
this.single = selection.length != 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
handleEdit(row) {
|
||||
this.reset()
|
||||
const configId = row.configId || this.ids
|
||||
getConfig(configId).then(response => {
|
||||
this.form = response.data;
|
||||
this.addOpen = true;
|
||||
this.title = "修改白名单";
|
||||
});
|
||||
this.form = response.data
|
||||
this.addOpen = true
|
||||
this.title = '修改白名单'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitAddForm: function() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.configId != undefined) {
|
||||
updateConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.addOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.addOpen = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.addOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.addOpen = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
/** 白名单配置提交 **/
|
||||
submitConfigForm:function() {
|
||||
this.$refs["configForm"].validate(valid => {
|
||||
submitConfigForm: function() {
|
||||
this.$refs['configForm'].validate(valid => {
|
||||
if (valid) {
|
||||
addConfig(this.configForm).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.configOpen = false;
|
||||
this.getList();
|
||||
});
|
||||
addConfig(this.configForm).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.configOpen = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
/** 白名单配置弹窗 **/
|
||||
handleConfig(row) {
|
||||
this.reset()
|
||||
const configId = row.configId || this.ids
|
||||
getConfig(configId).then(response => {
|
||||
this.configForm = response.data
|
||||
this.configForm.addMode = 1
|
||||
this.configOpen = true
|
||||
this.title = '白名单配置'
|
||||
})
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const configIds = row.configId || this.ids;
|
||||
const configIds = row.configId || this.ids
|
||||
this.$modal.confirm('是否确认删除编号为"' + configIds + '"的数据项?').then(function() {
|
||||
return delConfig(configIds);
|
||||
return delConfig(configIds)
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
/** 发布按钮操作 */
|
||||
handlePublish() {
|
||||
const configIds = row.configId || this.ids;
|
||||
const configIds = row.configId || this.ids
|
||||
this.$modal.confirm('是否确认发布编号为"' + configIds + '"的数据项?').then(function() {
|
||||
return delConfig(configIds);
|
||||
|
||||
//这里写发布操作
|
||||
return delConfig(configIds)
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("发布成功");
|
||||
}).catch(() => {});
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('发布成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
/** 下架按钮操作 */
|
||||
handleDown() {
|
||||
const configIds = row.configId || this.ids
|
||||
this.$modal.confirm('是否确认下架编号为"' + configIds + '"的数据项?').then(function() {
|
||||
//这里写发布操作
|
||||
return delConfig(configIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('下架成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
/** 预览按钮操作 */
|
||||
handleView() {
|
||||
const configIds = row.configId || this.ids
|
||||
this.$modal.confirm('是否确认预览编号为"' + configIds + '"的数据项?').then(function() {
|
||||
//这里写发布操作
|
||||
return delConfig(configIds)
|
||||
}).then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('预览成功')
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
|
||||
/** 在上传之前进行校验 */
|
||||
beforeAvatarUpload(file) {
|
||||
const formatList = file.name.split('.')
|
||||
const isFormat = file.type === 'text/plain' || formatList[formatList.length - 1] === 'txt'
|
||||
if (!isFormat) {
|
||||
this.$message.error(`上传格式只能是名称后缀为.txt的文本文件!`)
|
||||
}
|
||||
const isLt2M = file.size / 1024 / 1024 < 5
|
||||
if (!isLt2M) {
|
||||
this.$message.error(`上传文件大小不能超过5M!`)
|
||||
}
|
||||
return isLt2M && isFormat
|
||||
},
|
||||
/** 上传文件 */
|
||||
handleSuccess(file) {
|
||||
this.fileList = []
|
||||
const nameList = file.context.path.split('/')
|
||||
this.fileList.push({
|
||||
name: file.context.name || nameList[nameList.length - 1],
|
||||
url: file.context.path
|
||||
})
|
||||
this.addFormData.path = file.context.path
|
||||
},
|
||||
beforeRemove(files, filesList) {
|
||||
return this.$confirm(`确定要移除${files.name}?`)
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user