feat: 登录盐放local里&表格行hover显示编辑按钮
This commit is contained in:
parent
93dd304453
commit
c60f7ffc8d
|
@ -9,7 +9,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onBeforeMount, onMounted, watchEffect } from 'vue';
|
import { computed, onBeforeMount, onMounted } from 'vue';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
|
import enUS from '@arco-design/web-vue/es/locale/lang/en-us';
|
||||||
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
|
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="ms-base-tale">
|
<div class="ms-base-table">
|
||||||
<select-all
|
<select-all
|
||||||
v-if="attrs.selectable && attrs.showSelectAll"
|
v-if="attrs.selectable && attrs.showSelectAll"
|
||||||
class="custom-action"
|
class="custom-action"
|
||||||
|
@ -101,7 +101,7 @@
|
||||||
</slot>
|
</slot>
|
||||||
</div>
|
</div>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
<div>
|
<div class="edit-icon">
|
||||||
<MsIcon
|
<MsIcon
|
||||||
v-if="item.editType && editActiveKey !== `${item.dataIndex}${rowIndex}` && !record.deleted"
|
v-if="item.editType && editActiveKey !== `${item.dataIndex}${rowIndex}` && !record.deleted"
|
||||||
class="ml-2 cursor-pointer"
|
class="ml-2 cursor-pointer"
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
const editActiveKey = ref<string>('');
|
const editActiveKey = ref<string>('');
|
||||||
// 编辑input的Ref
|
// 编辑input的Ref
|
||||||
const currentInputRef = ref();
|
const currentInputRef = ref();
|
||||||
const { rowKey, editKey }: Partial<MsTableProps<any>> = attrs;
|
const { rowKey }: Partial<MsTableProps<any>> = attrs;
|
||||||
// 第一行表格合并
|
// 第一行表格合并
|
||||||
const currentSpanMethod = ({
|
const currentSpanMethod = ({
|
||||||
rowIndex,
|
rowIndex,
|
||||||
|
@ -369,7 +369,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.ms-base-tale {
|
.ms-base-table {
|
||||||
position: relative;
|
position: relative;
|
||||||
.custom-action {
|
.custom-action {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -386,5 +386,20 @@
|
||||||
.ms-table-edit-active {
|
.ms-table-edit-active {
|
||||||
color: rgb(var(--primary-5));
|
color: rgb(var(--primary-5));
|
||||||
}
|
}
|
||||||
|
.edit-icon {
|
||||||
|
color: rgb(var(--primary-7));
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
:deep(.arco-table-hover) {
|
||||||
|
:not(.arco-table-dragging) {
|
||||||
|
.arco-table-tr:not(.arco-table-tr-empty):not(.arco-table-tr-summary):hover {
|
||||||
|
.arco-table-td:not(.arco-table-col-fixed-left):not(.arco-table-col-fixed-right) {
|
||||||
|
.edit-icon {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default function useUser() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const setSalt = (salt: string) => {
|
const setSalt = (salt: string) => {
|
||||||
userStore.setSalt(salt);
|
localStorage.setItem('salt', salt);
|
||||||
};
|
};
|
||||||
|
|
||||||
const isLoginPage = () => {
|
const isLoginPage = () => {
|
||||||
|
|
|
@ -29,7 +29,6 @@ const useUserStore = defineStore('user', {
|
||||||
id: undefined,
|
id: undefined,
|
||||||
certification: undefined,
|
certification: undefined,
|
||||||
role: '',
|
role: '',
|
||||||
salt: '',
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
getters: {
|
getters: {
|
||||||
|
@ -105,10 +104,6 @@ const useUserStore = defineStore('user', {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 加盐
|
|
||||||
setSalt(salt: string) {
|
|
||||||
this.$patch({ salt });
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,4 @@ export interface UserState {
|
||||||
role: RoleType;
|
role: RoleType;
|
||||||
lastOrganizationId?: string;
|
lastOrganizationId?: string;
|
||||||
lastProjectId?: string;
|
lastProjectId?: string;
|
||||||
// 盐
|
|
||||||
salt: string;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
if (!errors) {
|
if (!errors) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const publicKey = userStore.salt;
|
const publicKey = localStorage.getItem('salt') || '';
|
||||||
await userStore.login({
|
await userStore.login({
|
||||||
username: encrypted(values.username, publicKey),
|
username: encrypted(values.username, publicKey),
|
||||||
password: encrypted(values.password, publicKey),
|
password: encrypted(values.password, publicKey),
|
||||||
|
|
Loading…
Reference in New Issue