Merge branch 'al'

pull/1/head
刘释隆 1 year ago
commit 91c1ab823f

@ -1,72 +1,98 @@
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, onMounted, ref, unref, watch } from 'vue' import { computed, defineComponent, onMounted, ref, unref, watch } from "vue";
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from "vue-router";
import { IconGroup } from '../IconGroup' import { IconGroup } from "../IconGroup";
import { useAsyncRouteStore } from '@/store/modules/asyncRoute' import { useAsyncRouteStore } from "@/store/modules/asyncRoute";
import { generatorMenu } from '@/utils' import { generatorMenu } from "@/utils";
import { storage } from "@/utils/Storage";
import { CURRENT_USER } from "@/store/mutation-types";
export default defineComponent({ export default defineComponent({
name: 'AppMenu', name: "AppMenu",
components: { IconGroup }, components: { IconGroup },
emits: ['clickMenuItem'], emits: ["clickMenuItem"],
setup(props, { emit }) { setup(props, { emit }) {
// //
const currentRoute = useRoute() const currentRoute = useRoute();
const router = useRouter() const router = useRouter();
const asyncRouteStore = useAsyncRouteStore() const asyncRouteStore = useAsyncRouteStore();
const menus = ref<any[]>([]) const menus = ref<any[]>([]);
const selectedSvg = ref<string>(currentRoute.meta.svgname as string) const selectedSvg = ref<string>(currentRoute.meta.svgname as string);
const getSelectedSvg = computed(() => { const getSelectedSvg = computed(() => {
return unref(selectedSvg) return unref(selectedSvg);
}) });
// //
watch( watch(
() => currentRoute.fullPath, () => currentRoute.fullPath,
() => { () => {
updateMenu() updateMenu();
}, }
) );
function updateSelectedKeys() { function updateSelectedKeys() {
const svgname: string = (currentRoute.meta?.svgname as string) || '' const svgname: string = (currentRoute.meta?.svgname as string) || "";
selectedSvg.value = svgname selectedSvg.value = svgname;
} }
function updateMenu() { function updateMenu() {
menus.value = generatorMenu(asyncRouteStore.getMenus) menus.value = generatorMenu(asyncRouteStore.getMenus);
updateSelectedKeys() const userInfo = storage.get(CURRENT_USER);
if (userInfo && userInfo.frontmenuTList) {
menus.value = userInfo.frontmenuTList.map((item) => {
let v = {
component: () =>
item.resUrl == "/task"
? import("@/views/task/index.vue")
: item.resUrl == "/home"
? import("@/views/home/index.vue")
: item.resUrl == "/worksheet"
? import("@/views/worksheet/index.vue")
: item.resUrl == "/final"
? import("@/views/final/index.vue")
: "",
icon: undefined,
key: item.resKey,
label: item.name,
meta: {
title: item.name,
permissions: [item.resKey],
},
path: item.resUrl,
name: item.resKey,
svgname: item.icon,
svgsize: 32,
title: item.name,
};
return v;
});
}
updateSelectedKeys();
} }
// //
function clickMenuItem(key: string) { function clickMenuItem(key: string) {
if (/http(s)?:/.test(key)) if (/http(s)?:/.test(key)) window.open(key);
window.open(key) else router.push({ name: key });
else
router.push({ name: key })
emit('clickMenuItem' as any, key) emit("clickMenuItem" as any, key);
} }
onMounted(() => { onMounted(() => {
updateMenu() updateMenu();
}) });
return { return {
menus, menus,
selectedSvg, selectedSvg,
getSelectedSvg, getSelectedSvg,
clickMenuItem, clickMenuItem,
} };
}, },
}) });
</script> </script>
<template> <template>
<IconGroup <IconGroup :options="menus" :value="getSelectedSvg" @update:value="clickMenuItem" />
:options="menus"
:value="getSelectedSvg"
@update:value="clickMenuItem"
/>
</template> </template>

@ -29,7 +29,7 @@ const allCount = computed(() => {
}); });
const selectCount = computed(() => { const selectCount = computed(() => {
return `全部筛选(共${onList.value.length}个)`; return `已选筛选(共${onList.value.length}个)`;
}); });
defineExpose({ defineExpose({
@ -137,15 +137,13 @@ function onCheckAllChange(value) {
} }
selectIds.value = value ? ids : []; selectIds.value = value ? ids : [];
} }
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
const index = selectIds.value.indexOf(item.id); const index = selectIds.value.indexOf(item.id);
item.checked = checked; item.checked = checked;
let currentIndex = offList.value.findIndex(v=>v.id == item.id) let currentIndex = offList.value.findIndex((v) => v.id == item.id);
offList.value[currentIndex].checked = item.checked; offList.value[currentIndex].checked = item.checked;
if (index === -1 && checked) selectIds.value.push(item.id); if (index === -1 && checked) selectIds.value.push(item.id);
else selectIds.value.splice(index, 1); else selectIds.value.splice(index, 1);
@ -267,17 +265,17 @@ const rightInputHandler = debounce((keyword) => {
<div> <div>
<n-input placeholder="搜索关键字" @input="leftInputHandler"> <n-input placeholder="搜索关键字" @input="leftInputHandler">
<template #suffix> <template #suffix>
<SvgIcon size="14px" name="magnifying-1" /> <SvgIcon size="14px" name="magnifying-1" color="#999999" />
</template> </template>
</n-input> </n-input>
<n-scrollbar <n-scrollbar
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px" style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
> >
<div class="draggable-ul"> <div class="draggable-ul">
<div class="draggable-li"> <div class="draggable-li" style="color:#666666">
<n-checkbox <n-checkbox
v-model:checked="checkAll" v-model:checked="checkAll"
label="全" label="全"
@update:checked="onCheckAllChange" @update:checked="onCheckAllChange"
/> />
</div> </div>
@ -317,7 +315,7 @@ const rightInputHandler = debounce((keyword) => {
<div> <div>
<n-input placeholder="搜索关键字" @input="rightInputHandler"> <n-input placeholder="搜索关键字" @input="rightInputHandler">
<template #suffix> <template #suffix>
<SvgIcon size="14px" name="magnifying-1" /> <SvgIcon size="14px" name="magnifying-1" color="#999999" />
</template> </template>
</n-input> </n-input>
<n-scrollbar <n-scrollbar
@ -339,7 +337,8 @@ const rightInputHandler = debounce((keyword) => {
:class="{ fix: item.fix }" :class="{ fix: item.fix }"
class="cursor-move draggable-li" class="cursor-move draggable-li"
> >
<SvgIcon v-show="!item.fix" name="drag" size="24" /> <!-- v-show="!item.fix" 判断是否为固定值 -->
<SvgIcon name="drag" size="14" />
<span class="ml-2">{{ item.name }}</span> <span class="ml-2">{{ item.name }}</span>
<SvgIcon <SvgIcon
v-if="!item.fix" v-if="!item.fix"
@ -358,7 +357,7 @@ const rightInputHandler = debounce((keyword) => {
</div> </div>
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">
<n-button type="info" @click="handleSumbit"> </n-button> <n-button type="info" @click="handleSumbit"> </n-button>
<n-button secondary style="margin-left: 15px" @click="closeModal"> <n-button secondary style="margin-left: 15px" @click="closeModal">
取消 取消
</n-button> </n-button>
@ -376,6 +375,7 @@ const rightInputHandler = debounce((keyword) => {
&-title { &-title {
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 16px;
color: #333333;
} }
&-bar { &-bar {
@ -416,6 +416,8 @@ const rightInputHandler = debounce((keyword) => {
height: 800px; height: 800px;
--n-padding-bottom: 20px; --n-padding-bottom: 20px;
--n-padding-left: 24px; --n-padding-left: 24px;
--n-padding-right: 24px;
--n-padding-top: 20px;
} }
.textbtnStyle { .textbtnStyle {
@ -426,6 +428,7 @@ const rightInputHandler = debounce((keyword) => {
.draggable-ul { .draggable-ul {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
background: #f8f8f8;
.draggable-li { .draggable-li {
width: 100%; width: 100%;
@ -449,14 +452,22 @@ const rightInputHandler = debounce((keyword) => {
--n-padding-top: 0px; --n-padding-top: 0px;
--n-padding-bottom: 12px; --n-padding-bottom: 12px;
} }
::v-deep(.n-card > .n-card-header .n-card-header__main){ ::v-deep(.n-card > .n-card-header .n-card-header__main) {
font-weight: lighter !important; font-weight: lighter !important;
font-size: 14px; font-size: 14px;
} }
::v-deep(.n-scrollbar){ ::v-deep(.n-scrollbar) {
border-top: none !important; border-top: none !important;
} }
::v-deep(.n-button--info-type){ ::v-deep(.n-button--info-type) {
background: #507AFD !important; background: #507afd !important;
}
::v-deep(.n-card__footer) {
padding: 0 16px 16px 16px !important;
}
::v-deep(.n-button--default-type) {
border: 1px solid #cad2dd !important;
color: #333333;
background: #ffffff;
} }
</style> </style>

@ -96,14 +96,12 @@ function handleSubmit(e) {
if (res.code === "OK") { if (res.code === "OK") {
formSure.loginname = res.data?.loginname; formSure.loginname = res.data?.loginname;
tab.value = 1; tab.value = 1;
}else{ } else {
message.error(res.message); message.error(res.message);
} }
} finally { } finally {
loading.value = false; loading.value = false;
} }
} else {
message.error("请填写完整信息");
} }
}); });
} }
@ -123,13 +121,16 @@ function handleSure(e) {
try { try {
const res = await updateSUser(params); const res = await updateSUser(params);
if (res.code === "OK") message.success("修改成功"); if (res.code === "OK") {
else message.error(res.message); message.success("修改成功");
tab.value = 0;
forget();
} else {
message.error(res.message);
}
} finally { } finally {
loading.value = false; loading.value = false;
} }
} else {
message.error("请填写完整信息");
} }
}); });
} }
@ -257,7 +258,10 @@ function forget() {
</template> </template>
<template #suffix> <template #suffix>
<div <div
:class="{ 'code-count': countTime !== '获取验证码'|| !(formForget.phone.length == 11) }" :class="{
'code-count':
countTime !== '获取验证码' || !(formForget.phone.length == 11),
}"
class="code" class="code"
@click="sendCode" @click="sendCode"
> >
@ -296,6 +300,7 @@ function forget() {
type="password" type="password"
show-password-on="click" show-password-on="click"
placeholder="请输入8-16位密码必须包含英文及数字" placeholder="请输入8-16位密码必须包含英文及数字"
maxlength="16"
> >
<template #prefix> <template #prefix>
<svg-icon size="20" name="password" /> <svg-icon size="20" name="password" />
@ -309,6 +314,7 @@ function forget() {
type="password" type="password"
show-password-on="click" show-password-on="click"
placeholder="请再次确认输入新密码" placeholder="请再次确认输入新密码"
maxlength="16"
> >
<template #prefix> <template #prefix>
<svg-icon size="20" name="password" /> <svg-icon size="20" name="password" />
@ -403,21 +409,21 @@ function forget() {
} }
.order-last { .order-last {
font-size: .875rem; font-size: 0.875rem;
font-family: PingFang SC, PingFang SC-Regular; font-family: PingFang SC, PingFang SC-Regular;
font-weight: Regular; font-weight: Regular;
color: #507afd; color: #507afd;
} }
.code { .code {
font-size: .9375rem; font-size: 0.9375rem;
font-family: PingFang SC, PingFang SC-Regular; font-family: PingFang SC, PingFang SC-Regular;
font-weight: Regular; font-weight: Regular;
color: #507afd; color: #507afd;
margin-left: .75rem; margin-left: 0.75rem;
cursor: pointer; cursor: pointer;
&-count { &-count {
font-size: .875rem; font-size: 0.875rem;
color: #999999; color: #999999;
} }
} }
@ -426,7 +432,7 @@ function forget() {
// color: #FF4E4F !important; // color: #FF4E4F !important;
} }
.back { .back {
font-size: .9375rem; font-size: 0.9375rem;
font-family: PingFang SC, PingFang SC-Medium; font-family: PingFang SC, PingFang SC-Medium;
font-weight: Medium; font-weight: Medium;
text-align: center; text-align: center;

@ -63,7 +63,9 @@ const rules = {
if (loginSuccess.value || !value) { if (loginSuccess.value || !value) {
return true; return true;
} }
if (loginRejectMessge.value.indexOf("企业") > -1) {
return new Error(loginRejectMessge.value); return new Error(loginRejectMessge.value);
}
}, },
}, },
], ],
@ -76,7 +78,9 @@ const rules = {
if (loginSuccess.value || !value) { if (loginSuccess.value || !value) {
return true; return true;
} }
if (loginRejectMessge.value.indexOf("验证码") > -1) {
return new Error(loginRejectMessge.value); return new Error(loginRejectMessge.value);
}
}, },
}, },
], ],
@ -89,7 +93,9 @@ const rules = {
if (loginSuccess.value || !value) { if (loginSuccess.value || !value) {
return true; return true;
} }
if (loginRejectMessge.value.indexOf("手机号") > -1) {
return new Error(loginRejectMessge.value); return new Error(loginRejectMessge.value);
}
}, },
}, },
], ],
@ -105,7 +111,9 @@ const rules = {
if (loginSuccess.value || !value) { if (loginSuccess.value || !value) {
return true; return true;
} }
if (loginRejectMessge.value.indexOf("验证码") > -1) {
return new Error(loginRejectMessge.value); return new Error(loginRejectMessge.value);
}
}, },
}, },
], ],
@ -118,7 +126,9 @@ const rules = {
if (loginSuccess.value || !value) { if (loginSuccess.value || !value) {
return true; return true;
} }
if (loginRejectMessge.value.indexOf("账号") > -1) {
return new Error(loginRejectMessge.value); return new Error(loginRejectMessge.value);
}
}, },
}, },
], ],
@ -131,7 +141,9 @@ const rules = {
if (loginSuccess.value || !value) { if (loginSuccess.value || !value) {
return true; return true;
} }
if (loginRejectMessge.value.indexOf("密码") > -1) {
return new Error(loginRejectMessge.value); return new Error(loginRejectMessge.value);
}
}, },
}, },
], ],
@ -140,6 +152,7 @@ const rules = {
function handleSubmit(e) { function handleSubmit(e) {
e.preventDefault(); e.preventDefault();
console.log(formRef.value,'formRef')
loginSuccess.value = true; loginSuccess.value = true;
formRef.value.validate(async (errors) => { formRef.value.validate(async (errors) => {
if (!errors) { if (!errors) {
@ -174,6 +187,7 @@ function handleSubmit(e) {
loginSuccess.value = false; loginSuccess.value = false;
message.destroyAll(); message.destroyAll();
message.info(msg || "登录失败"); message.info(msg || "登录失败");
formRef.value.validate();
} }
} finally { } finally {
loading.value = false; loading.value = false;
@ -230,6 +244,7 @@ function handleSmsSubmit(e) {
} }
loginSuccess.value = true; loginSuccess.value = true;
// const { code, message: msg } = await userStore.login(params) // const { code, message: msg } = await userStore.login(params)
await userStore.setStorageToken(res.data);
await userStore.getInformation(); await userStore.getInformation();
message.destroyAll(); message.destroyAll();
const toPath = decodeURIComponent((route.query?.redirect || "/") as string); const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
@ -240,6 +255,7 @@ function handleSmsSubmit(e) {
message.destroyAll(); message.destroyAll();
message.info(msg || "登录失败"); message.info(msg || "登录失败");
loginSuccess.value = false; loginSuccess.value = false;
formRefSms.value.validate();
} }
} catch (e) { } catch (e) {
} finally { } finally {

@ -356,7 +356,7 @@ const queryData = (value, type) => {
aria-modal="true" aria-modal="true"
> >
<div class="wrapper"> <div class="wrapper">
<span class="wrapper-title">自定义任务字段</span> <span class="wrapper-title">自定义任务卡片字段</span>
<div class="wrapper-bar"> <div class="wrapper-bar">
<div class="wrapper-info"> <div class="wrapper-info">
<span :style="{ 'margin-left': '18px' }">字段信息</span> <span :style="{ 'margin-left': '18px' }">字段信息</span>
@ -430,7 +430,7 @@ const queryData = (value, type) => {
</template> </template>
</n-input> </n-input>
<div class="draggable-title">系统默认</div> <div class="draggable-title">系统默认</div>
<div class="draggable-ul"> <div class="draggable-ul" style="border-bottom:none">
<div <div
v-for="item in fixShowList" v-for="item in fixShowList"
:key="item.id" :key="item.id"

Loading…
Cancel
Save