|
@@ -14,12 +14,13 @@
|
|
|
</el-icon>删除</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
- <template v-slot:type="scope">{{ getStateLabel(scope.row.type) }}</template>
|
|
|
+ <template v-slot:type="scope">{{ getTypeLabel(scope.row.type) }}</template>
|
|
|
+ <template v-slot:group="scope">{{ getGroupLabel(scope.row.group) }}</template>
|
|
|
<template v-slot:createTime="scope">{{ dateUtils.getDate(scope.row.createTime) }}</template>
|
|
|
<template v-slot:operation="scope">
|
|
|
- <!-- <el-button type="primary" size="small" icon="Edit" @click="edit(scope.row)">
|
|
|
+ <el-button type="primary" size="small" icon="Edit" @click="edit(scope.row)">
|
|
|
编辑
|
|
|
- </el-button> -->
|
|
|
+ </el-button>
|
|
|
<el-button @click="del(scope.row)" type="danger" size="small" icon="Delete">
|
|
|
删除
|
|
|
</el-button>
|
|
@@ -32,13 +33,21 @@
|
|
|
<el-form-item label="白名单值" prop="value">
|
|
|
<el-input v-model="ruleForm.value" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="白名单类型" prop="type">
|
|
|
+ <el-form-item label="白名单值类型" prop="type">
|
|
|
<el-radio-group v-model="ruleForm.type">
|
|
|
<el-radio :label="0">IP</el-radio>
|
|
|
<el-radio :label="1">账号</el-radio>
|
|
|
<el-radio :label="2">角色</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="白名单分组" prop="group">
|
|
|
+ <el-radio-group v-model="ruleForm.group">
|
|
|
+ <el-radio :label="0">程序</el-radio>
|
|
|
+ <el-radio :label="1">策划</el-radio>
|
|
|
+ <el-radio :label="2">测试</el-radio>
|
|
|
+ <el-radio :label="3">运营</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<span class="dialog-footer">
|
|
@@ -91,7 +100,7 @@ const tableData = ref([])
|
|
|
const tableHeader = ref([])
|
|
|
const upload = ref<UploadInstance>()
|
|
|
|
|
|
-const tableColumn = ["value","type"]
|
|
|
+const tableColumn = ["value","type","group"]
|
|
|
const beforeUploadAction = (file, fileLi) => {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
const reader = new FileReader()
|
|
@@ -184,7 +193,7 @@ const column = [
|
|
|
{ name: 'value', label: '白名单值', inSearch: true, valueType: 'input'},
|
|
|
{
|
|
|
name: 'type',
|
|
|
- label: '白名单类型',
|
|
|
+ label: '白名单值类型',
|
|
|
slot: true,
|
|
|
inSearch: true,
|
|
|
options: [
|
|
@@ -197,23 +206,60 @@ const column = [
|
|
|
label: '账号',
|
|
|
},
|
|
|
{
|
|
|
- value: 1,
|
|
|
+ value: 2,
|
|
|
label: '角色',
|
|
|
}
|
|
|
],
|
|
|
valueType: 'select',
|
|
|
},
|
|
|
+ {
|
|
|
+ name: 'group',
|
|
|
+ label: '白名单分组',
|
|
|
+ slot: true,
|
|
|
+ inSearch: true,
|
|
|
+ options: [
|
|
|
+ {
|
|
|
+ value: 0,
|
|
|
+ label: '程序',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 1,
|
|
|
+ label: '策划',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 2,
|
|
|
+ label: '测试',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: 3,
|
|
|
+ label: '运营',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ valueType: 'select',
|
|
|
+ },
|
|
|
{ name: 'createTime', label: '白名单创建时间', slot: true },
|
|
|
{ name: 'operation', slot: true, fixed: 'right', width: 200, label: '操作' },
|
|
|
]
|
|
|
|
|
|
-const getStateLabel = (val) => {
|
|
|
+const getTypeLabel = (val) => {
|
|
|
if (val == 0) {
|
|
|
return 'IP'
|
|
|
} else if (val == 1) {
|
|
|
return '账号'
|
|
|
} else if (val == 2) {
|
|
|
- return '角色'
|
|
|
+ return '测试'
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const getGroupLabel = (val) => {
|
|
|
+ if (val == 0) {
|
|
|
+ return '程序'
|
|
|
+ } else if (val == 1) {
|
|
|
+ return '策划'
|
|
|
+ } else if (val == 2) {
|
|
|
+ return '测试'
|
|
|
+ } else if (val == 3) {
|
|
|
+ return '运营'
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -223,7 +269,8 @@ const formSize = ref('default')
|
|
|
const ruleFormRef = ref<FormInstance>()
|
|
|
const ruleForm = reactive({
|
|
|
value: null,
|
|
|
- type: null
|
|
|
+ type: null,
|
|
|
+ group: null
|
|
|
})
|
|
|
|
|
|
const rules = reactive({
|
|
@@ -237,7 +284,14 @@ const rules = reactive({
|
|
|
type: [
|
|
|
{
|
|
|
required: true,
|
|
|
- message: '请选择白名单类型',
|
|
|
+ message: '请选择白名单值类型',
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ group: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: '请选择白名单分组',
|
|
|
trigger: 'change',
|
|
|
},
|
|
|
],
|
|
@@ -363,6 +417,7 @@ const edit = (row) => {
|
|
|
dialogVisible.value = true
|
|
|
ruleForm.type = row.type
|
|
|
ruleForm.value = row.value
|
|
|
+ ruleForm.group = row.group
|
|
|
}
|
|
|
|
|
|
const del = (row) => {
|
|
@@ -399,7 +454,7 @@ const reset = () => {
|
|
|
}
|
|
|
|
|
|
const onSubmit = (val) => {
|
|
|
- if ((val.value == null || val.value == "") && val.type == null) {
|
|
|
+ if ((val.value == null || val.value == "") && val.type == null && val.group == null) {
|
|
|
ElMessage.warning('请输入查询条件')
|
|
|
return
|
|
|
}
|