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>
<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>

View File

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

View File

@ -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) {

View File

@ -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;
}

View File

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

View File

@ -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-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'">
<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 :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'));
@ -61,8 +64,8 @@ const {
} = 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) => {

View File

@ -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');

View File

@ -1,14 +1,16 @@
<template>
<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">
@ -24,8 +26,8 @@
<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"
@ -56,15 +58,15 @@
</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'));

View File

@ -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>

View File

@ -1,8 +1,9 @@
<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') }}
</el-button>
@ -10,15 +11,11 @@
{{ $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">
@ -33,12 +30,18 @@
<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 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,7 +54,7 @@
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'));
@ -88,6 +91,6 @@ const onTabelRowDel = (row: any) => {
})
})
.catch(() => {});
.catch(() => { });
};
</script>

View File

@ -173,13 +173,6 @@ const generatorHandle = () => {
visible.value = false
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-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();