mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +08:00
fix console waring
This commit is contained in:
parent
34d779b042
commit
fb440f2b76
@ -2,27 +2,17 @@
|
||||
<div>
|
||||
<template v-for="(item, index) in props.options">
|
||||
<template v-if="values.includes(item.value)">
|
||||
<span
|
||||
v-if="item.elTagType == 'default' || item.elTagType == ''"
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
: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>
|
||||
<span v-if="item.elTagType == 'default' || item.elTagType == ''" :key="item.value" :index="index"
|
||||
: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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="dict-tag">
|
||||
import {computed} from "vue";
|
||||
import { computed } from "vue";
|
||||
|
||||
const props = defineProps({
|
||||
// 数据
|
||||
@ -35,7 +25,6 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const values = computed(() => {
|
||||
console.log(props.options,'options')
|
||||
if (props.value !== null && typeof props.value !== 'undefined') {
|
||||
return Array.isArray(props.value) ? props.value : [String(props.value)];
|
||||
} else {
|
||||
@ -46,7 +35,7 @@ const values = computed(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-tag + .el-tag {
|
||||
.el-tag+.el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -98,7 +98,6 @@ export default {
|
||||
* @description 刷新
|
||||
* */
|
||||
const refresh = () => {
|
||||
console.log(instance.value);
|
||||
if (instance.value.refresh) {
|
||||
instance.value.refresh()
|
||||
}
|
||||
|
@ -203,7 +203,6 @@ export default {
|
||||
} else { //兼容移动端
|
||||
var x = e.touches[0].pageX;
|
||||
}
|
||||
console.log(barArea);
|
||||
startLeft.value = Math.floor(x - barArea.value.getBoundingClientRect().left);
|
||||
startMoveTime.value = +new Date(); //开始滑动的时间
|
||||
if (isEnd.value == false) {
|
||||
|
@ -84,7 +84,6 @@ export function setFilterRouteEnd() {
|
||||
let filterRouteEnd: any = formatTwoStageRoutes(formatFlatteningRoutes(dynamicRoutes));
|
||||
// notFoundAndNoPower 防止 404、401 不在 layout 布局中,不设置的话,404、401 界面将全屏显示
|
||||
// 关联问题 No match found for location with path 'xxx'
|
||||
console.log(filterRouteEnd, 'filterRouteEnd')
|
||||
filterRouteEnd[0].children = [...filterRouteEnd[0].children, ...notFoundAndNoPower];
|
||||
return filterRouteEnd;
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ export const useUserInfo = defineStore('userInfo', {
|
||||
authBtnList: res.data.permissions,
|
||||
};
|
||||
this.userInfos = userInfo
|
||||
console.log(this.userInfos)
|
||||
})
|
||||
}
|
||||
},
|
||||
|
@ -1,31 +1,34 @@
|
||||
<template>
|
||||
<div class="system-dept-container layout-padding">
|
||||
<div class="layout-padding">
|
||||
<el-card shadow="hover" class="layout-padding-auto">
|
||||
<div class="mb15">
|
||||
<el-input :placeholder="$t('sysdept.inputdeptNameTip')" style="max-width: 180px" v-model="state.queryForm.deptName"> </el-input>
|
||||
<el-button icon="search" type="primary" class="ml10" @click="getDataList">
|
||||
{{ $t('common.queryBtn') }}
|
||||
</el-button>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="deptDialogRef.openDialog('add');" v-auth="'sys_dept_add'">
|
||||
{{ $t('common.addBtn') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
style="width: 100%"
|
||||
row-key="id"
|
||||
default-expand-all
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
>
|
||||
<el-table-column :label="$t('sysdept.name')" prop="name" width="400" show-overflow-tooltip> </el-table-column>
|
||||
<el-table-column :label="$t('sysdept.weight')" prop="weight" show-overflow-tooltip width="80"></el-table-column>
|
||||
<el-table-column prop="createTime" :label="$t('sysdept.createTime')" show-overflow-tooltip></el-table-column>
|
||||
<div class="mb15">
|
||||
<el-input :placeholder="$t('sysdept.inputdeptNameTip')" style="max-width: 180px"
|
||||
v-model="state.queryForm.deptName"> </el-input>
|
||||
<el-button icon="search" type="primary" class="ml10" @click="getDataList">
|
||||
{{ $t('common.queryBtn') }}
|
||||
</el-button>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="deptDialogRef.openDialog('add');"
|
||||
v-auth="'sys_dept_add'">
|
||||
{{ $t('common.addBtn') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%" row-key="id"
|
||||
default-expand-all :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||
<el-table-column :label="$t('sysdept.name')" prop="name" width="400" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('sysdept.weight')" prop="weight" show-overflow-tooltip
|
||||
width="80"></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">
|
||||
<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="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>
|
||||
<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="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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -35,10 +38,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemDept">
|
||||
import {BasicTableProps, useTable} from "/@/hooks/table";
|
||||
import {depttree,delObj} from "/@/api/admin/dept";
|
||||
import {useMessage, useMessageBox} from "/@/hooks/message";
|
||||
import {useI18n} from "vue-i18n";
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { depttree, delObj } from "/@/api/admin/dept";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useI18n } from "vue-i18n";
|
||||
|
||||
// 引入组件
|
||||
const DeptForm = defineAsyncComponent(() => import('./form.vue'));
|
||||
@ -48,21 +51,21 @@ const { t } = useI18n()
|
||||
const deptDialogRef = ref();
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
pageList: depttree,
|
||||
queryForm: {
|
||||
deptName: ''
|
||||
},
|
||||
isPage: false
|
||||
pageList: depttree,
|
||||
queryForm: {
|
||||
deptName: ''
|
||||
},
|
||||
isPage: false
|
||||
});
|
||||
|
||||
|
||||
const {
|
||||
getDataList
|
||||
getDataList
|
||||
} = useTable(state)
|
||||
|
||||
// 打开新增菜单弹窗
|
||||
const onOpenAddDept = (type: string,row: any) => {
|
||||
deptDialogRef.value.openDialog(type,row?.id);
|
||||
const onOpenAddDept = (type: string, row: any) => {
|
||||
deptDialogRef.value.openDialog(type, row?.id);
|
||||
};
|
||||
// 打开编辑菜单弹窗
|
||||
const onOpenEditDept = (type: string, row: any) => {
|
||||
@ -70,14 +73,14 @@ const onOpenEditDept = (type: string, row: any) => {
|
||||
};
|
||||
// 删除当前行
|
||||
const onTabelRowDel = (row: any) => {
|
||||
useMessageBox().confirm(`${t('common.delConfirmText')}:${row.name} ?`)
|
||||
useMessageBox().confirm(`${t('common.delConfirmText')}:${row.name} ?`)
|
||||
.then(() => {
|
||||
delObj(row.id).then(() => {
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
}).catch(err => {
|
||||
useMessage().error(err.msg)
|
||||
})
|
||||
delObj(row.id).then(() => {
|
||||
getDataList();
|
||||
useMessage().success('删除成功');
|
||||
}).catch(err => {
|
||||
useMessage().error(err.msg)
|
||||
})
|
||||
|
||||
})
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<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-row :gutter="35">
|
||||
<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-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel" size="default">{{ $t('common.cancelButtonText') }}</el-button>
|
||||
<el-button type="primary" @click="onSubmit" size="default">{{ $t('common.confirmButtonText') }}</el-button>
|
||||
</span>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="onCancel" size="default">{{ $t('common.cancelButtonText') }}</el-button>
|
||||
<el-button type="primary" @click="onSubmit" size="default">{{ $t('common.confirmButtonText') }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
<script setup lang="ts" name="dict-item-form">
|
||||
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: '',
|
||||
label: '',
|
||||
description: '',
|
||||
sortOrder: '',
|
||||
sortOrder: 0,
|
||||
remarks: '',
|
||||
})
|
||||
|
||||
@ -77,7 +77,7 @@ const openDialog = (row: any) => {
|
||||
dataForm.id = ''
|
||||
if (row?.id) {
|
||||
getItemObj(row.id).then(res => {
|
||||
Object.assign(dataForm,res.data)
|
||||
Object.assign(dataForm, res.data)
|
||||
})
|
||||
} else {
|
||||
// 清空表单,此项需加表单验证才能使用
|
||||
@ -106,7 +106,7 @@ const onSubmit = () => {
|
||||
}).catch(err => {
|
||||
useMessage().error(err.msg)
|
||||
})
|
||||
}else{
|
||||
} else {
|
||||
addItemObj(dataForm).then(() => {
|
||||
closeDialog(); // 关闭弹窗
|
||||
emit('refresh');
|
||||
|
@ -1,75 +1,77 @@
|
||||
<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-form :model="state.queryForm" ref="queryRef" :inline="true">
|
||||
<el-form-item label="类型" prop="dictType">
|
||||
<el-input placeholder="请输入类型" v-model="state.queryForm.dictType"
|
||||
style="max-width: 180px" />
|
||||
<el-input placeholder="请输入类型" v-model="state.queryForm.dictType" style="max-width: 180px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典类型" prop="systemFlag">
|
||||
<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-form-item>
|
||||
<el-form-item class="ml2">
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
<el-button icon="search" type="primary" @click="getDataList">
|
||||
{{ $t('common.queryBtn') }}
|
||||
</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>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<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') }}
|
||||
</el-button>
|
||||
<el-button :disabled="multiple" icon="Delete" type="primary" class="ml10"
|
||||
v-auth="'sys_dict_del'" @click="handleDelete(undefined)">
|
||||
<el-button :disabled="multiple" icon="Delete" type="primary" class="ml10" v-auth="'sys_dict_del'"
|
||||
@click="handleDelete(undefined)">
|
||||
{{ $t('common.delBtn') }}
|
||||
</el-button>
|
||||
<right-toolbar v-model:showSearch="showSearch" class="ml10" style="float: right;margin-right: 20px"
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
@queryTable="getDataList"></right-toolbar>
|
||||
</div>
|
||||
</el-row>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%">
|
||||
<el-table-column type="index" label="序号" width="50" />
|
||||
<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="systemFlag" label="字典类型" show-overflow-tooltip>
|
||||
<el-table :data="state.dataList" v-loading="state.loading" style="width: 100%">
|
||||
<el-table-column type="index" label="序号" width="50" />
|
||||
<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="systemFlag" label="字典类型" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<dict-tag :options="dict_type" :value="scope.row.systemFlag"></dict-tag>
|
||||
</template>
|
||||
</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="remarks" 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">
|
||||
<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="showDictITem(scope.row)">字典项</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table-column label="操作" width="200">
|
||||
<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="showDictITem(scope.row)">字典项</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" v-bind="state.pagination" />
|
||||
</el-card>
|
||||
<DicDialog ref="dicDialogRef" @refresh="getDataList()" />
|
||||
<dict-item-dialog ref="dictItemDialogRef"></dict-item-dialog>
|
||||
|
||||
</el-card>
|
||||
<DicDialog ref="dicDialogRef" @refresh="getDataList()" />
|
||||
<dict-item-dialog ref="dictItemDialogRef"></dict-item-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemDic">
|
||||
import {BasicTableProps, useTable} from "/@/hooks/table";
|
||||
import {fetchList,delObj} from "/@/api/admin/dict";
|
||||
import {useMessage, useMessageBox} from "/@/hooks/message";
|
||||
import {useDict} from "/@/hooks/dict";
|
||||
import {useI18n} from "vue-i18n";
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table";
|
||||
import { fetchList, delObj } from "/@/api/admin/dict";
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message";
|
||||
import { useDict } from "/@/hooks/dict";
|
||||
import { useI18n } from "vue-i18n";
|
||||
const { dict_type } = useDict('dict_type')
|
||||
// 引入组件
|
||||
const DicDialog = defineAsyncComponent(() => import('./form.vue'));
|
||||
const DictItemDialog = defineAsyncComponent(() => import('./dictItem/index.vue'))
|
||||
const { t } = useI18n()
|
||||
const { t } = useI18n()
|
||||
// 定义变量内容
|
||||
const dicDialogRef = ref();
|
||||
const dictItemDialogRef = ref()
|
||||
@ -92,7 +94,7 @@ const {
|
||||
|
||||
// 打开修改字典弹窗
|
||||
const onOpenEditDic = (type: string, row: any) => {
|
||||
dicDialogRef.value.openDialog(type, row);
|
||||
dicDialogRef.value.openDialog(type, row);
|
||||
};
|
||||
|
||||
const showDictITem = (row: any) => {
|
||||
@ -116,13 +118,13 @@ const handleDelete = (row: any) => {
|
||||
}
|
||||
|
||||
useMessageBox().confirm(t('common.delConfirmText') + row.postId)
|
||||
.then(() => {
|
||||
delObj(row.postId).then(() => {
|
||||
getDataList();
|
||||
useMessage().success(t('common.delSuccessText'));
|
||||
}).catch((err: any) => {
|
||||
useMessage().error(err.msg)
|
||||
})
|
||||
.then(() => {
|
||||
delObj(row.postId).then(() => {
|
||||
getDataList();
|
||||
useMessage().success(t('common.delSuccessText'));
|
||||
}).catch((err: any) => {
|
||||
useMessage().error(err.msg)
|
||||
})
|
||||
})
|
||||
};
|
||||
</script>
|
||||
|
@ -1,4 +1,6 @@
|
||||
<template>
|
||||
<div class="layout-padding">
|
||||
|
||||
<el-card class="layout-padding-auto" shadow="hover">
|
||||
<el-row v-show="showSearch" class="mb8">
|
||||
<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>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
@ -1,44 +1,47 @@
|
||||
<template>
|
||||
<div class="system-menu-container layout-pd">
|
||||
<div class="layout-padding">
|
||||
<el-card shadow="hover">
|
||||
<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">
|
||||
{{ $t('common.queryBtn') }}
|
||||
{{ $t('common.queryBtn') }}
|
||||
</el-button>
|
||||
<el-button icon="folder-add" type="primary" class="ml10" @click="onOpenAddMenu" v-auth="'sys_menu_add'">
|
||||
{{ $t('common.addBtn') }}
|
||||
{{ $t('common.addBtn') }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
:data="state.dataList"
|
||||
v-loading="state.loading"
|
||||
style="width: 100%"
|
||||
row-key="path"
|
||||
: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 :data="state.dataList" v-loading="state.loading" style="width: 100%" row-key="path"
|
||||
: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 :label="$t('sysmenu.menuType')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<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 === '1'" type="info">按钮</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('sysmenu.keepAlive')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.keepAlive === '0'" type="info">关闭</el-tag>
|
||||
<el-tag v-if="scope.row.keepAlive === '1'" type="success">开启</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="permission" :label="$t('sysmenu.permission')" :show-overflow-tooltip="true"></el-table-column>
|
||||
<el-table-column :label="$t('sysmenu.menuType')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<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 === '1'" type="info">按钮</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('sysmenu.keepAlive')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.keepAlive === '0'" type="info">关闭</el-tag>
|
||||
<el-tag v-if="scope.row.keepAlive === '1'" type="success">开启</el-tag>
|
||||
</template>
|
||||
</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">
|
||||
<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="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>
|
||||
<el-button text type="primary" @click="onOpenAddMenu('add')" v-auth="'sys_menu_add'"> {{
|
||||
$t('common.addBtn')
|
||||
}}</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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -51,23 +54,23 @@
|
||||
import { RouteRecordRaw } from 'vue-router';
|
||||
import { pageList, delObj } from '/@/api/admin/menu'
|
||||
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 menuDialogRef = ref<InstanceType<typeof MenuDialog>>();
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
pageList: pageList, // H
|
||||
queryForm: {
|
||||
menuName: ''
|
||||
},
|
||||
isPage: false
|
||||
pageList: pageList, // H
|
||||
queryForm: {
|
||||
menuName: ''
|
||||
},
|
||||
isPage: false
|
||||
});
|
||||
|
||||
|
||||
const {
|
||||
getDataList,
|
||||
getDataList,
|
||||
} = useTable(state)
|
||||
|
||||
// 打开新增菜单弹窗
|
||||
@ -82,12 +85,12 @@ const onOpenEditMenu = (type: string, row: RouteRecordRaw) => {
|
||||
const onTabelRowDel = (row: any) => {
|
||||
useMessageBox().confirm(`此操作将永久删除路由:${row.name}`)
|
||||
.then(() => {
|
||||
delObj(row.id).then(() => {
|
||||
useMessage().success('删除成功');
|
||||
getDataList()
|
||||
})
|
||||
delObj(row.id).then(() => {
|
||||
useMessage().success('删除成功');
|
||||
getDataList()
|
||||
})
|
||||
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
};
|
||||
</script>
|
||||
|
@ -173,13 +173,6 @@ const generatorHandle = () => {
|
||||
visible.value = false
|
||||
return
|
||||
}
|
||||
|
||||
// // 生成代码,自定义路径
|
||||
// useGeneratorApi([dataForm.id]).then(() => {
|
||||
// visible.value = false
|
||||
// emit('refreshDataList')
|
||||
// useMessage().success(t('common.addSuccessText'))
|
||||
// })
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -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>
|
@ -30,7 +30,6 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
<Scan v-if="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>
|
||||
<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 Mobile = defineAsyncComponent(() => import('/@/views/login/component/mobile.vue'));
|
||||
const Scan = defineAsyncComponent(() => import('/@/views/login/component/scan.vue'));
|
||||
|
||||
// 定义变量内容
|
||||
const storesThemeConfig = useThemeConfig();
|
||||
|
Loading…
Reference in New Issue
Block a user