前端eslint调整

This commit is contained in:
piexlMax
2023-09-14 18:47:47 +08:00
parent 636204bbaf
commit a4f86354d3
64 changed files with 3302 additions and 1096 deletions
+95 -27
View File
@@ -3,8 +3,15 @@
<warning-bar title="注:右上角头像下拉可切换角色" />
<div class="gva-table-box">
<div class="gva-btn-list">
<el-button type="primary" icon="plus" @click="addAuthority(0)">新增角色</el-button>
<el-icon class="cursor-pointer" @click="toDoc('https://www.bilibili.com/video/BV1kv4y1g7nT?p=8&vd_source=f2640257c21e3b547a790461ed94875e')"><VideoCameraFilled /></el-icon>
<el-button
type="primary"
icon="plus"
@click="addAuthority(0)"
>新增角色</el-button>
<el-icon
class="cursor-pointer"
@click="toDoc('https://www.bilibili.com/video/BV1kv4y1g7nT?p=8&vd_source=f2640257c21e3b547a790461ed94875e')"
><VideoCameraFilled /></el-icon>
</div>
<el-table
:data="tableData"
@@ -12,9 +19,22 @@
row-key="authorityId"
style="width: 100%"
>
<el-table-column label="角色ID" min-width="180" prop="authorityId" />
<el-table-column align="left" label="角色名称" min-width="180" prop="authorityName" />
<el-table-column align="left" label="操作" width="460">
<el-table-column
label="角色ID"
min-width="180"
prop="authorityId"
/>
<el-table-column
align="left"
label="角色名称"
min-width="180"
prop="authorityName"
/>
<el-table-column
align="left"
label="操作"
width="460"
>
<template #default="scope">
<el-button
icon="setting"
@@ -56,9 +76,20 @@
</el-table>
</div>
<!-- 新增角色弹窗 -->
<el-dialog v-model="dialogFormVisible" :title="dialogTitle">
<el-form ref="authorityForm" :model="form" :rules="rules" label-width="80px">
<el-form-item label="父级角色" prop="parentId">
<el-dialog
v-model="dialogFormVisible"
:title="dialogTitle"
>
<el-form
ref="authorityForm"
:model="form"
:rules="rules"
label-width="80px"
>
<el-form-item
label="父级角色"
prop="parentId"
>
<el-cascader
v-model="form.parentId"
style="width:100%"
@@ -69,31 +100,71 @@
filterable
/>
</el-form-item>
<el-form-item label="角色ID" prop="authorityId">
<el-input v-model="form.authorityId" :disabled="dialogType==='edit'" autocomplete="off" maxlength="15" />
<el-form-item
label="角色ID"
prop="authorityId"
>
<el-input
v-model="form.authorityId"
:disabled="dialogType==='edit'"
autocomplete="off"
maxlength="15"
/>
</el-form-item>
<el-form-item label="角色姓名" prop="authorityName">
<el-input v-model="form.authorityName" autocomplete="off" />
<el-form-item
label="角色姓名"
prop="authorityName"
>
<el-input
v-model="form.authorityName"
autocomplete="off"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDialog">取 消</el-button>
<el-button type="primary" @click="enterDialog">确 定</el-button>
<el-button
type="primary"
@click="enterDialog"
>确 定</el-button>
</div>
</template>
</el-dialog>
<el-drawer v-if="drawer" v-model="drawer" custom-class="auth-drawer" :with-header="false" size="40%" title="角色配置">
<el-tabs :before-leave="autoEnter" type="border-card">
<el-drawer
v-if="drawer"
v-model="drawer"
custom-class="auth-drawer"
:with-header="false"
size="40%"
title="角色配置"
>
<el-tabs
:before-leave="autoEnter"
type="border-card"
>
<el-tab-pane label="角色菜单">
<Menus ref="menus" :row="activeRow" @changeRow="changeRow" />
<Menus
ref="menus"
:row="activeRow"
@changeRow="changeRow"
/>
</el-tab-pane>
<el-tab-pane label="角色api">
<Apis ref="apis" :row="activeRow" @changeRow="changeRow" />
<Apis
ref="apis"
:row="activeRow"
@changeRow="changeRow"
/>
</el-tab-pane>
<el-tab-pane label="资源权限">
<Datas ref="datas" :authority="tableData" :row="activeRow" @changeRow="changeRow" />
<Datas
ref="datas"
:authority="tableData"
:row="activeRow"
@changeRow="changeRow"
/>
</el-tab-pane>
</el-tabs>
</el-drawer>
@@ -116,8 +187,12 @@ import WarningBar from '@/components/warningBar/warningBar.vue'
import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
import {toDoc} from "@/utils/doc";
import {VideoCameraFilled} from "@element-plus/icons-vue";
import { toDoc } from '@/utils/doc'
import { VideoCameraFilled } from '@element-plus/icons-vue'
defineOptions({
name: 'Authority'
})
const mustUint = (rule, value, callback) => {
if (!/^[0-9]*[1-9][0-9]*$/.test(value)) {
@@ -376,13 +451,6 @@ const editAuthority = (row) => {
</script>
<script>
export default {
name: 'Authority'
}
</script>
<style lang="scss">
.authority {
.el-input-number {
@@ -1,8 +1,16 @@
<template>
<div>
<div class="sticky top-0.5 z-10 bg-white">
<el-input v-model="filterText" class="w-3/5" placeholder="筛选" />
<el-button class="float-right" type="primary" @click="authApiEnter">确 定</el-button>
<el-input
v-model="filterText"
class="w-3/5"
placeholder="筛选"
/>
<el-button
class="float-right"
type="primary"
@click="authApiEnter"
>确 定</el-button>
</div>
<div class="tree-content">
<el-tree
@@ -20,17 +28,17 @@
</div>
</div>
</template>
<script>
export default {
name: 'Apis',
}
</script>
<script setup>
import { getAllApis } from '@/api/api'
import { UpdateCasbin, getPolicyPathByAuthorityId } from '@/api/casbin'
import { ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'Apis',
})
const props = defineProps({
row: {
default: function() {
@@ -134,4 +142,3 @@ watch(filterText, (val) => {
</script>
@@ -1,31 +1,56 @@
<template>
<div>
<warning-bar title="此功能仅用于创建角色和角色的many2many关系表,具体使用还须自己结合表实现业务,详情参考示例代码(客户示例)。此功能不建议使用,建议使用插件市场【组织管理功能(点击前往)】来管理资源权限。" href="https://plugin.gin-vue-admin.com/#/layout/newPluginInfo?id=36" />
<warning-bar
title="此功能仅用于创建角色和角色的many2many关系表,具体使用还须自己结合表实现业务,详情参考示例代码(客户示例)。此功能不建议使用,建议使用插件市场【组织管理功能(点击前往)】来管理资源权限。"
href="https://plugin.gin-vue-admin.com/#/layout/newPluginInfo?id=36"
/>
<div class="sticky top-0.5 z-10 bg-white my-4">
<el-button class="float-left" type="primary" @click="all">全选</el-button>
<el-button class="float-left" type="primary" @click="self">本角色</el-button>
<el-button class="float-left" type="primary" @click="selfAndChildren">本角色及子角色</el-button>
<el-button class="float-right" type="primary" @click="authDataEnter">确 定</el-button>
<el-button
class="float-left"
type="primary"
@click="all"
>全选</el-button>
<el-button
class="float-left"
type="primary"
@click="self"
>本角色</el-button>
<el-button
class="float-left"
type="primary"
@click="selfAndChildren"
>本角色及子角色</el-button>
<el-button
class="float-right"
type="primary"
@click="authDataEnter"
>确 定</el-button>
</div>
<div class="clear-both pt-4">
<el-checkbox-group v-model="dataAuthorityId" @change="selectAuthority">
<el-checkbox v-for="(item,key) in authoritys" :key="key" :label="item">{{ item.authorityName }}</el-checkbox>
<el-checkbox-group
v-model="dataAuthorityId"
@change="selectAuthority"
>
<el-checkbox
v-for="(item,key) in authoritys"
:key="key"
:label="item"
>{{ item.authorityName }}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</template>
<script>
export default {
name: 'Datas'
}
</script>
<script setup>
import { setDataAuthority } from '@/api/authority'
import WarningBar from '@/components/warningBar/warningBar.vue'
import { ref } from 'vue'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'Datas'
})
const props = defineProps({
row: {
default: function() {
@@ -1,8 +1,16 @@
<template>
<div>
<div class="sticky top-0.5 z-10 bg-white">
<el-input v-model="filterText" class="w-3/5" placeholder="筛选" />
<el-button class="float-right" type="primary" @click="relation">确 定</el-button>
<el-input
v-model="filterText"
class="w-3/5"
placeholder="筛选"
/>
<el-button
class="float-right"
type="primary"
@click="relation"
>确 定</el-button>
</div>
<div class="tree-content clear-both">
<el-tree
@@ -46,21 +54,37 @@
</template>
</el-tree>
</div>
<el-dialog v-model="btnVisible" title="分配按钮" destroy-on-close>
<el-dialog
v-model="btnVisible"
title="分配按钮"
destroy-on-close
>
<el-table
ref="btnTableRef"
:data="btnData"
row-key="ID"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<el-table-column label="按钮名称" prop="name" />
<el-table-column label="按钮备注" prop="desc" />
<el-table-column
type="selection"
width="55"
/>
<el-table-column
label="按钮名称"
prop="name"
/>
<el-table-column
label="按钮备注"
prop="desc"
/>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeDialog">取 消</el-button>
<el-button type="primary" @click="enterDialog">确 定</el-button>
<el-button
type="primary"
@click="enterDialog"
>确 定</el-button>
</div>
</template>
</el-dialog>
@@ -76,6 +100,10 @@ import { getAuthorityBtnApi, setAuthorityBtnApi } from '@/api/authorityBtn'
import { nextTick, ref, watch } from 'vue'
import { ElMessage } from 'element-plus'
defineOptions({
name: 'Menus'
})
const props = defineProps({
row: {
default: function() {
@@ -208,13 +236,6 @@ watch(filterText, (val) => {
</script>
<script>
export default {
name: 'Menus'
}
</script>
<style lang="scss" scoped>
.custom-tree-node{
span+span{