fix console waring

This commit is contained in:
lbw 2023-02-08 14:49:11 +08:00
parent 34d779b042
commit fb440f2b76
13 changed files with 154 additions and 230 deletions

View File

@ -2,27 +2,17 @@
<div> <div>
<template v-for="(item, index) in props.options"> <template v-for="(item, index) in props.options">
<template v-if="values.includes(item.value)"> <template v-if="values.includes(item.value)">
<span <span v-if="item.elTagType == 'default' || item.elTagType == ''" :key="item.value" :index="index"
v-if="item.elTagType == 'default' || item.elTagType == ''" :class="item.elTagClass">{{ item.label }}</span>
:key="item.value" <el-tag v-else :disable-transitions="true" :key="item.value" :index="index"
:index="index" :type="item.elTagType === 'primary' ? '' : item.elTagType" :class="item.elTagClass">{{ item.label }}</el-tag>
:class="item.elTagClass"
>{{ item.label }}</span>
<el-tag
v-else
:disable-transitions="true"
:key="item.value"
:index="index"
:type="item.elTagType === 'primary' ? '' : item.elTagType"
:class="item.elTagClass"
>{{ item.label }}</el-tag>
</template> </template>
</template> </template>
</div> </div>
</template> </template>
<script setup lang="ts" name="dict-tag"> <script setup lang="ts" name="dict-tag">
import {computed} from "vue"; import { computed } from "vue";
const props = defineProps({ const props = defineProps({
// //
@ -35,7 +25,6 @@ const props = defineProps({
}) })
const values = computed(() => { const values = computed(() => {
console.log(props.options,'options')
if (props.value !== null && typeof props.value !== 'undefined') { if (props.value !== null && typeof props.value !== 'undefined') {
return Array.isArray(props.value) ? props.value : [String(props.value)]; return Array.isArray(props.value) ? props.value : [String(props.value)];
} else { } else {
@ -46,7 +35,7 @@ const values = computed(() => {
</script> </script>
<style scoped> <style scoped>
.el-tag + .el-tag { .el-tag+.el-tag {
margin-left: 10px; margin-left: 10px;
} }
</style> </style>

View File

@ -98,7 +98,6 @@ export default {
* @description 刷新 * @description 刷新
* */ * */
const refresh = () => { const refresh = () => {
console.log(instance.value);
if (instance.value.refresh) { if (instance.value.refresh) {
instance.value.refresh() instance.value.refresh()
} }

View File

@ -203,7 +203,6 @@ export default {
} else { // } else { //
var x = e.touches[0].pageX; var x = e.touches[0].pageX;
} }
console.log(barArea);
startLeft.value = Math.floor(x - barArea.value.getBoundingClientRect().left); startLeft.value = Math.floor(x - barArea.value.getBoundingClientRect().left);
startMoveTime.value = +new Date(); // startMoveTime.value = +new Date(); //
if (isEnd.value == false) { if (isEnd.value == false) {

View File

@ -84,7 +84,6 @@ export function setFilterRouteEnd() {
let filterRouteEnd: any = formatTwoStageRoutes(formatFlatteningRoutes(dynamicRoutes)); let filterRouteEnd: any = formatTwoStageRoutes(formatFlatteningRoutes(dynamicRoutes));
// notFoundAndNoPower 防止 404、401 不在 layout 布局中不设置的话404、401 界面将全屏显示 // notFoundAndNoPower 防止 404、401 不在 layout 布局中不设置的话404、401 界面将全屏显示
// 关联问题 No match found for location with path 'xxx' // 关联问题 No match found for location with path 'xxx'
console.log(filterRouteEnd, 'filterRouteEnd')
filterRouteEnd[0].children = [...filterRouteEnd[0].children, ...notFoundAndNoPower]; filterRouteEnd[0].children = [...filterRouteEnd[0].children, ...notFoundAndNoPower];
return filterRouteEnd; return filterRouteEnd;
} }

View File

@ -49,7 +49,6 @@ export const useUserInfo = defineStore('userInfo', {
authBtnList: res.data.permissions, authBtnList: res.data.permissions,
}; };
this.userInfos = userInfo this.userInfos = userInfo
console.log(this.userInfos)
}) })
} }
}, },

View File

@ -1,31 +1,34 @@
<template> <template>
<div class="system-dept-container layout-padding"> <div class="layout-padding">
<el-card shadow="hover" class="layout-padding-auto"> <el-card shadow="hover" class="layout-padding-auto">
<div class="mb15"> <div class="mb15">
<el-input :placeholder="$t('sysdept.inputdeptNameTip')" style="max-width: 180px" v-model="state.queryForm.deptName"> </el-input> <el-input :placeholder="$t('sysdept.inputdeptNameTip')" style="max-width: 180px"
<el-button icon="search" type="primary" class="ml10" @click="getDataList"> v-model="state.queryForm.deptName"> </el-input>
{{ $t('common.queryBtn') }} <el-button icon="search" type="primary" class="ml10" @click="getDataList">
</el-button> {{ $t('common.queryBtn') }}
<el-button icon="folder-add" type="primary" class="ml10" @click="deptDialogRef.openDialog('add');" v-auth="'sys_dept_add'"> </el-button>
{{ $t('common.addBtn') }} <el-button icon="folder-add" type="primary" class="ml10" @click="deptDialogRef.openDialog('add');"
</el-button> v-auth="'sys_dept_add'">
</div> {{ $t('common.addBtn') }}
<el-table </el-button>
:data="state.dataList" </div>
v-loading="state.loading" <el-table :data="state.dataList" v-loading="state.loading" style="width: 100%" row-key="id"
style="width: 100%" default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
row-key="id" <el-table-column :label="$t('sysdept.name')" prop="name" width="400" show-overflow-tooltip>
default-expand-all </el-table-column>
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" <el-table-column :label="$t('sysdept.weight')" prop="weight" show-overflow-tooltip
> width="80"></el-table-column>
<el-table-column :label="$t('sysdept.name')" prop="name" width="400" show-overflow-tooltip> </el-table-column> <el-table-column prop="createTime" :label="$t('sysdept.createTime')"
<el-table-column :label="$t('sysdept.weight')" prop="weight" show-overflow-tooltip width="80"></el-table-column> show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" :label="$t('sysdept.createTime')" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('common.action')" show-overflow-tooltip width="200"> <el-table-column :label="$t('common.action')" show-overflow-tooltip width="200">
<template #default="scope"> <template #default="scope">
<el-button text type="primary" @click="onOpenAddDept('add',scope.row)" v-auth="'sys_dept_add'"> {{ $t('common.addBtn') }}</el-button> <el-button text type="primary" @click="onOpenAddDept('add', scope.row)" v-auth="'sys_dept_add'">
<el-button text type="primary" @click="onOpenEditDept('edit', scope.row)" v-auth="'sys_dept_edit'">{{$t('common.editBtn') }}</el-button> {{ $t('common.addBtn') }}</el-button>
<el-button text type="primary" @click="onTabelRowDel(scope.row)" v-auth="'sys_dept_del'"> {{ $t('common.delBtn') }}</el-button> <el-button text type="primary" @click="onOpenEditDept('edit', scope.row)"
v-auth="'sys_dept_edit'">{{ $t('common.editBtn') }}</el-button>
<el-button text type="primary" @click="onTabelRowDel(scope.row)" v-auth="'sys_dept_del'"> {{
$t('common.delBtn')
}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -35,10 +38,10 @@
</template> </template>
<script setup lang="ts" name="systemDept"> <script setup lang="ts" name="systemDept">
import {BasicTableProps, useTable} from "/@/hooks/table"; import { BasicTableProps, useTable } from "/@/hooks/table";
import {depttree,delObj} from "/@/api/admin/dept"; import { depttree, delObj } from "/@/api/admin/dept";
import {useMessage, useMessageBox} from "/@/hooks/message"; import { useMessage, useMessageBox } from "/@/hooks/message";
import {useI18n} from "vue-i18n"; import { useI18n } from "vue-i18n";
// //
const DeptForm = defineAsyncComponent(() => import('./form.vue')); const DeptForm = defineAsyncComponent(() => import('./form.vue'));
@ -48,21 +51,21 @@ const { t } = useI18n()
const deptDialogRef = ref(); const deptDialogRef = ref();
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
pageList: depttree, pageList: depttree,
queryForm: { queryForm: {
deptName: '' deptName: ''
}, },
isPage: false isPage: false
}); });
const { const {
getDataList getDataList
} = useTable(state) } = useTable(state)
// //
const onOpenAddDept = (type: string,row: any) => { const onOpenAddDept = (type: string, row: any) => {
deptDialogRef.value.openDialog(type,row?.id); deptDialogRef.value.openDialog(type, row?.id);
}; };
// //
const onOpenEditDept = (type: string, row: any) => { const onOpenEditDept = (type: string, row: any) => {
@ -70,14 +73,14 @@ const onOpenEditDept = (type: string, row: any) => {
}; };
// //
const onTabelRowDel = (row: any) => { const onTabelRowDel = (row: any) => {
useMessageBox().confirm(`${t('common.delConfirmText')}${row.name} ?`) useMessageBox().confirm(`${t('common.delConfirmText')}${row.name} ?`)
.then(() => { .then(() => {
delObj(row.id).then(() => { delObj(row.id).then(() => {
getDataList(); getDataList();
useMessage().success('删除成功'); useMessage().success('删除成功');
}).catch(err => { }).catch(err => {
useMessage().error(err.msg) useMessage().error(err.msg)
}) })
}) })
}; };

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="system-dic-dialog-container"> <div class="system-dic-dialog-container">
<el-dialog v-model="visible" :title="dataForm.id ? $t('common.editBtn') : $t('common.addBtn')" width="60%"> <el-dialog v-model="visible" :title="dataForm.id ? $t('common.editBtn') : $t('common.addBtn')" width="60%">
<el-form ref="dicDialogFormRef" :model="dataForm" label-width="90px" size="default"> <el-form ref="dicDialogFormRef" :model="dataForm" label-width="90px" size="default">
<el-row :gutter="35"> <el-row :gutter="35">
<el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24" class="mb20" v-if="dataForm.id"> <el-col :lg="12" :md="12" :sm="12" :xl="12" :xs="24" class="mb20" v-if="dataForm.id">
@ -36,10 +36,10 @@
</el-row> </el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="onCancel" size="default">{{ $t('common.cancelButtonText') }}</el-button> <el-button @click="onCancel" size="default">{{ $t('common.cancelButtonText') }}</el-button>
<el-button type="primary" @click="onSubmit" size="default">{{ $t('common.confirmButtonText') }}</el-button> <el-button type="primary" @click="onSubmit" size="default">{{ $t('common.confirmButtonText') }}</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
</div> </div>
@ -47,7 +47,7 @@
<script setup lang="ts" name="dict-item-form"> <script setup lang="ts" name="dict-item-form">
import { getItemObj, addItemObj, putItemObj } from '/@/api/admin/dict' import { getItemObj, addItemObj, putItemObj } from '/@/api/admin/dict'
import {useMessage} from "/@/hooks/message"; import { useMessage } from "/@/hooks/message";
// / // /
@ -64,7 +64,7 @@ const dataForm = reactive({
value: '', value: '',
label: '', label: '',
description: '', description: '',
sortOrder: '', sortOrder: 0,
remarks: '', remarks: '',
}) })
@ -77,7 +77,7 @@ const openDialog = (row: any) => {
dataForm.id = '' dataForm.id = ''
if (row?.id) { if (row?.id) {
getItemObj(row.id).then(res => { getItemObj(row.id).then(res => {
Object.assign(dataForm,res.data) Object.assign(dataForm, res.data)
}) })
} else { } else {
// 使 // 使
@ -106,7 +106,7 @@ const onSubmit = () => {
}).catch(err => { }).catch(err => {
useMessage().error(err.msg) useMessage().error(err.msg)
}) })
}else{ } else {
addItemObj(dataForm).then(() => { addItemObj(dataForm).then(() => {
closeDialog(); // closeDialog(); //
emit('refresh'); emit('refresh');

View File

@ -1,75 +1,77 @@
<template> <template>
<el-card shadow="hover" class="layout-padding-auto"> <div class="layout-padding">
<el-card shadow="hover" class="layout-padding-auto">
<el-row v-show="showSearch" class="mb8"> <el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true"> <el-form :model="state.queryForm" ref="queryRef" :inline="true">
<el-form-item label="类型" prop="dictType"> <el-form-item label="类型" prop="dictType">
<el-input placeholder="请输入类型" v-model="state.queryForm.dictType" <el-input placeholder="请输入类型" v-model="state.queryForm.dictType" style="max-width: 180px" />
style="max-width: 180px" />
</el-form-item> </el-form-item>
<el-form-item label="字典类型" prop="systemFlag"> <el-form-item label="字典类型" prop="systemFlag">
<el-select v-model="state.queryForm.systemFlag" clearable> <el-select v-model="state.queryForm.systemFlag" clearable>
<el-option v-for="(item,index) in dict_type" :label="item.label" :value="item.value" :key="index"></el-option> <el-option v-for="(item, index) in dict_type" :label="item.label" :value="item.value"
:key="index"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="ml2"> <el-form-item class="ml2">
<el-button icon="search" type="primary" @click="getDataList"> <el-button icon="search" type="primary" @click="getDataList">
{{ $t('common.queryBtn') }} {{ $t('common.queryBtn') }}
</el-button> </el-button>
<el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button> <el-button icon="Refresh" @click="resetQuery">{{ $t('common.resetBtn') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-row> </el-row>
<el-row> <el-row>
<div class="mb8" style="width: 100%"> <div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="ml10" @click="dicDialogRef.openDialog()"> <el-button icon="folder-add" type="primary" class="ml10" @click="dicDialogRef.openDialog()">
{{ $t('common.addBtn') }} {{ $t('common.addBtn') }}
</el-button> </el-button>
<el-button :disabled="multiple" icon="Delete" type="primary" class="ml10" <el-button :disabled="multiple" icon="Delete" type="primary" class="ml10" v-auth="'sys_dict_del'"
v-auth="'sys_dict_del'" @click="handleDelete(undefined)"> @click="handleDelete(undefined)">
{{ $t('common.delBtn') }} {{ $t('common.delBtn') }}
</el-button> </el-button>
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px" <right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
@queryTable="getDataList"></right-toolbar> @queryTable="getDataList"></right-toolbar>
</div> </div>
</el-row> </el-row>
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%"> <el-table :data="state.dataList" v-loading="state.loading" style="width: 100%">
<el-table-column type="index" label="序号" width="50" /> <el-table-column type="index" label="序号" width="50" />
<el-table-column prop="dictType" label="类型" show-overflow-tooltip></el-table-column> <el-table-column prop="dictType" label="类型" show-overflow-tooltip></el-table-column>
<el-table-column prop="description" label="描述" show-overflow-tooltip></el-table-column> <el-table-column prop="description" label="描述" show-overflow-tooltip></el-table-column>
<el-table-column prop="systemFlag" label="字典类型" show-overflow-tooltip> <el-table-column prop="systemFlag" label="字典类型" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<dict-tag :options="dict_type" :value="scope.row.systemFlag"></dict-tag> <dict-tag :options="dict_type" :value="scope.row.systemFlag"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remarks" label="备注信息" show-overflow-tooltip></el-table-column> <el-table-column prop="remarks" label="备注信息" show-overflow-tooltip></el-table-column>
<el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column> <el-table-column prop="createTime" label="创建时间" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="200"> <el-table-column label="操作" width="200">
<template #default="scope"> <template #default="scope">
<el-button text type="primary" @click="onOpenEditDic('edit', scope.row)">修改</el-button> <el-button text type="primary" @click="onOpenEditDic('edit', scope.row)">修改</el-button>
<el-button text type="primary" @click="onOpenEditDic('edit', scope.row)">修改</el-button> <el-button text type="primary" @click="onOpenEditDic('edit', scope.row)">修改</el-button>
<el-button text type="primary" @click="showDictITem(scope.row)">字典项</el-button> <el-button text type="primary" @click="showDictITem(scope.row)">字典项</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" /> <pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
</el-card> </el-card>
<DicDialog ref="dicDialogRef" @refresh="getDataList()" /> <DicDialog ref="dicDialogRef" @refresh="getDataList()" />
<dict-item-dialog ref="dictItemDialogRef"></dict-item-dialog> <dict-item-dialog ref="dictItemDialogRef"></dict-item-dialog>
</div>
</template> </template>
<script setup lang="ts" name="systemDic"> <script setup lang="ts" name="systemDic">
import {BasicTableProps, useTable} from "/@/hooks/table"; import { BasicTableProps, useTable } from "/@/hooks/table";
import {fetchList,delObj} from "/@/api/admin/dict"; import { fetchList, delObj } from "/@/api/admin/dict";
import {useMessage, useMessageBox} from "/@/hooks/message"; import { useMessage, useMessageBox } from "/@/hooks/message";
import {useDict} from "/@/hooks/dict"; import { useDict } from "/@/hooks/dict";
import {useI18n} from "vue-i18n"; import { useI18n } from "vue-i18n";
const { dict_type } = useDict('dict_type') const { dict_type } = useDict('dict_type')
// //
const DicDialog = defineAsyncComponent(() => import('./form.vue')); const DicDialog = defineAsyncComponent(() => import('./form.vue'));
const DictItemDialog = defineAsyncComponent(() => import('./dictItem/index.vue')) const DictItemDialog = defineAsyncComponent(() => import('./dictItem/index.vue'))
const { t } = useI18n() const { t } = useI18n()
// //
const dicDialogRef = ref(); const dicDialogRef = ref();
const dictItemDialogRef = ref() const dictItemDialogRef = ref()
@ -92,7 +94,7 @@ const {
// //
const onOpenEditDic = (type: string, row: any) => { const onOpenEditDic = (type: string, row: any) => {
dicDialogRef.value.openDialog(type, row); dicDialogRef.value.openDialog(type, row);
}; };
const showDictITem = (row: any) => { const showDictITem = (row: any) => {
@ -116,13 +118,13 @@ const handleDelete = (row: any) => {
} }
useMessageBox().confirm(t('common.delConfirmText') + row.postId) useMessageBox().confirm(t('common.delConfirmText') + row.postId)
.then(() => { .then(() => {
delObj(row.postId).then(() => { delObj(row.postId).then(() => {
getDataList(); getDataList();
useMessage().success(t('common.delSuccessText')); useMessage().success(t('common.delSuccessText'));
}).catch((err: any) => { }).catch((err: any) => {
useMessage().error(err.msg) useMessage().error(err.msg)
})
}) })
})
}; };
</script> </script>

View File

@ -1,4 +1,6 @@
<template> <template>
<div class="layout-padding">
<el-card class="layout-padding-auto" shadow="hover"> <el-card class="layout-padding-auto" shadow="hover">
<el-row v-show="showSearch" class="mb8"> <el-row v-show="showSearch" class="mb8">
<el-form :model="state.queryForm" ref="queryRef" :inline="true"> <el-form :model="state.queryForm" ref="queryRef" :inline="true">
@ -61,6 +63,7 @@
<pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle"> <pagination v-bind="state.pagination" @size-change="sizeChangeHandle" @current-change="currentChangeHandle">
</pagination> </pagination>
</el-card> </el-card>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>

View File

@ -1,44 +1,47 @@
<template> <template>
<div class="system-menu-container layout-pd"> <div class="layout-padding">
<el-card shadow="hover"> <el-card shadow="hover">
<div class="mb15"> <div class="mb15">
<el-input :placeholder="$t('sysmenu.inputNameTip')" style="max-width: 180px" v-model="state.queryForm.menuName"> </el-input> <el-input :placeholder="$t('sysmenu.inputNameTip')" style="max-width: 180px"
v-model="state.queryForm.menuName"> </el-input>
<el-button icon="search" type="primary" class="ml10" @click="getDataList"> <el-button icon="search" type="primary" class="ml10" @click="getDataList">
{{ $t('common.queryBtn') }} {{ $t('common.queryBtn') }}
</el-button> </el-button>
<el-button icon="folder-add" type="primary" class="ml10" @click="onOpenAddMenu" v-auth="'sys_menu_add'"> <el-button icon="folder-add" type="primary" class="ml10" @click="onOpenAddMenu" v-auth="'sys_menu_add'">
{{ $t('common.addBtn') }} {{ $t('common.addBtn') }}
</el-button> </el-button>
</div> </div>
<el-table <el-table :data="state.dataList" v-loading="state.loading" style="width: 100%" row-key="path"
:data="state.dataList" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
v-loading="state.loading" <el-table-column prop="name" :label="$t('sysmenu.name')" show-overflow-tooltip></el-table-column>
style="width: 100%" <el-table-column prop="sortOrder" :label="$t('sysmenu.sortOrder')"
row-key="path" show-overflow-tooltip></el-table-column>
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column prop="name" :label="$t('sysmenu.name')" show-overflow-tooltip ></el-table-column>
<el-table-column prop="sortOrder" :label="$t('sysmenu.sortOrder')" show-overflow-tooltip></el-table-column>
<el-table-column prop="path" :label="$t('sysmenu.path')" show-overflow-tooltip></el-table-column> <el-table-column prop="path" :label="$t('sysmenu.path')" show-overflow-tooltip></el-table-column>
<el-table-column :label="$t('sysmenu.menuType')" show-overflow-tooltip> <el-table-column :label="$t('sysmenu.menuType')" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.menuType === '0'" type="success">左菜单</el-tag> <el-tag v-if="scope.row.menuType === '0'" type="success">左菜单</el-tag>
<el-tag v-if="scope.row.menuType === '2'" type="success">顶菜单</el-tag> <el-tag v-if="scope.row.menuType === '2'" type="success">顶菜单</el-tag>
<el-tag v-if="scope.row.menuType === '1'" type="info">按钮</el-tag> <el-tag v-if="scope.row.menuType === '1'" type="info">按钮</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('sysmenu.keepAlive')" show-overflow-tooltip> <el-table-column :label="$t('sysmenu.keepAlive')" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.keepAlive === '0'" type="info">关闭</el-tag> <el-tag v-if="scope.row.keepAlive === '0'" type="info">关闭</el-tag>
<el-tag v-if="scope.row.keepAlive === '1'" type="success">开启</el-tag> <el-tag v-if="scope.row.keepAlive === '1'" type="success">开启</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="permission" :label="$t('sysmenu.permission')" :show-overflow-tooltip="true"></el-table-column> <el-table-column prop="permission" :label="$t('sysmenu.permission')"
:show-overflow-tooltip="true"></el-table-column>
<el-table-column :label="$t('common.action')" show-overflow-tooltip width="200"> <el-table-column :label="$t('common.action')" show-overflow-tooltip width="200">
<template #default="scope"> <template #default="scope">
<el-button text type="primary" @click="onOpenAddMenu('add')" v-auth="'sys_menu_add'"> {{ $t('common.addBtn') }}</el-button> <el-button text type="primary" @click="onOpenAddMenu('add')" v-auth="'sys_menu_add'"> {{
<el-button text type="primary" @click="onOpenEditMenu('edit', scope.row)" v-auth="'sys_menu_edit'">{{$t('common.editBtn') }}</el-button> $t('common.addBtn')
<el-button text type="primary" @click="onTabelRowDel(scope.row)" v-auth="'sys_menu_del'">{{ $t('common.delBtn') }}</el-button> }}</el-button>
<el-button text type="primary" @click="onOpenEditMenu('edit', scope.row)"
v-auth="'sys_menu_edit'">{{ $t('common.editBtn') }}</el-button>
<el-button text type="primary" @click="onTabelRowDel(scope.row)" v-auth="'sys_menu_del'">{{
$t('common.delBtn')
}}</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -51,23 +54,23 @@
import { RouteRecordRaw } from 'vue-router'; import { RouteRecordRaw } from 'vue-router';
import { pageList, delObj } from '/@/api/admin/menu' import { pageList, delObj } from '/@/api/admin/menu'
import { useTable, BasicTableProps } from "/@/hooks/table"; import { useTable, BasicTableProps } from "/@/hooks/table";
import {useMessage, useMessageBox} from "/@/hooks/message"; import { useMessage, useMessageBox } from "/@/hooks/message";
// //
const MenuDialog = defineAsyncComponent(() => import('./form.vue')); const MenuDialog = defineAsyncComponent(() => import('./form.vue'));
// //
const menuDialogRef = ref<InstanceType<typeof MenuDialog>>(); const menuDialogRef = ref<InstanceType<typeof MenuDialog>>();
const state: BasicTableProps = reactive<BasicTableProps>({ const state: BasicTableProps = reactive<BasicTableProps>({
pageList: pageList, // H pageList: pageList, // H
queryForm: { queryForm: {
menuName: '' menuName: ''
}, },
isPage: false isPage: false
}); });
const { const {
getDataList, getDataList,
} = useTable(state) } = useTable(state)
// //
@ -82,12 +85,12 @@ const onOpenEditMenu = (type: string, row: RouteRecordRaw) => {
const onTabelRowDel = (row: any) => { const onTabelRowDel = (row: any) => {
useMessageBox().confirm(`此操作将永久删除路由:${row.name}`) useMessageBox().confirm(`此操作将永久删除路由:${row.name}`)
.then(() => { .then(() => {
delObj(row.id).then(() => { delObj(row.id).then(() => {
useMessage().success('删除成功'); useMessage().success('删除成功');
getDataList() getDataList()
}) })
}) })
.catch(() => {}); .catch(() => { });
}; };
</script> </script>

View File

@ -173,13 +173,6 @@ const generatorHandle = () => {
visible.value = false visible.value = false
return return
} }
// //
// useGeneratorApi([dataForm.id]).then(() => {
// visible.value = false
// emit('refreshDataList')
// useMessage().success(t('common.addSuccessText'))
// })
}) })
} }

View File

@ -1,63 +0,0 @@
<template>
<div class="login-scan-container">
<div ref="qrcodeRef"></div>
<div class="font12 mt20 login-msg">
<i class="iconfont icon-saoyisao mr5"></i>
<span>{{ $t('scan.text') }}</span>
</div>
</div>
</template>
<script setup lang="ts" name="loginScan">
import { ref, onMounted, nextTick } from 'vue';
import QRCode from 'qrcodejs2-fixes';
//
const qrcodeRef = ref<HTMLElement | null>(null);
//
const initQrcode = () => {
nextTick(() => {
(<HTMLElement>qrcodeRef.value).innerHTML = '';
new QRCode(qrcodeRef.value, {
text: `https://qm.qq.com/cgi-bin/qm/qr?k=RdUY97Vx0T0vZ_1OOu-X1yFNkWgDwbjC&jump_from=webapi`,
width: 260,
height: 260,
colorDark: '#000000',
colorLight: '#ffffff',
});
});
};
//
onMounted(() => {
initQrcode();
});
</script>
<style scoped lang="scss">
.login-scan-animation {
opacity: 0;
animation-name: error-num;
animation-duration: 0.5s;
animation-fill-mode: forwards;
}
.login-scan-container {
padding: 0 20px 20px;
display: flex;
flex-direction: column;
text-align: center;
@extend .login-scan-animation;
animation-delay: 0.1s;
:deep(img) {
margin: auto;
}
.login-msg {
display: flex;
align-items: center;
justify-content: center;
color: var(--el-text-color-placeholder);
@extend .login-scan-animation;
animation-delay: 0.2s;
}
}
</style>

View File

@ -30,7 +30,6 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</div> </div>
<Scan v-if="state.isScan" />
<div class="login-content-main-sacn" @click="state.isScan = !state.isScan"> <div class="login-content-main-sacn" @click="state.isScan = !state.isScan">
<i class="iconfont" :class="state.isScan ? 'icon-diannao1' : 'icon-barcode-qr'"></i> <i class="iconfont" :class="state.isScan ? 'icon-diannao1' : 'icon-barcode-qr'"></i>
<div class="login-content-main-sacn-delta"></div> <div class="login-content-main-sacn-delta"></div>
@ -54,7 +53,6 @@ import loginBg from '/@/assets/login-bg.svg';
// //
const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue')); const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));
const Mobile = defineAsyncComponent(() => import('/@/views/login/component/mobile.vue')); const Mobile = defineAsyncComponent(() => import('/@/views/login/component/mobile.vue'));
const Scan = defineAsyncComponent(() => import('/@/views/login/component/scan.vue'));
// //
const storesThemeConfig = useThemeConfig(); const storesThemeConfig = useThemeConfig();