Merge branch 'al'

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

@ -1,72 +1,98 @@
<script lang="ts">
import { computed, defineComponent, onMounted, ref, unref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { IconGroup } from '../IconGroup'
import { useAsyncRouteStore } from '@/store/modules/asyncRoute'
import { generatorMenu } from '@/utils'
import { computed, defineComponent, onMounted, ref, unref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { IconGroup } from "../IconGroup";
import { useAsyncRouteStore } from "@/store/modules/asyncRoute";
import { generatorMenu } from "@/utils";
import { storage } from "@/utils/Storage";
import { CURRENT_USER } from "@/store/mutation-types";
export default defineComponent({
name: 'AppMenu',
name: "AppMenu",
components: { IconGroup },
emits: ['clickMenuItem'],
emits: ["clickMenuItem"],
setup(props, { emit }) {
//
const currentRoute = useRoute()
const router = useRouter()
const asyncRouteStore = useAsyncRouteStore()
const menus = ref<any[]>([])
const selectedSvg = ref<string>(currentRoute.meta.svgname as string)
const currentRoute = useRoute();
const router = useRouter();
const asyncRouteStore = useAsyncRouteStore();
const menus = ref<any[]>([]);
const selectedSvg = ref<string>(currentRoute.meta.svgname as string);
const getSelectedSvg = computed(() => {
return unref(selectedSvg)
})
return unref(selectedSvg);
});
//
watch(
() => currentRoute.fullPath,
() => {
updateMenu()
},
)
updateMenu();
}
);
function updateSelectedKeys() {
const svgname: string = (currentRoute.meta?.svgname as string) || ''
selectedSvg.value = svgname
const svgname: string = (currentRoute.meta?.svgname as string) || "";
selectedSvg.value = svgname;
}
function updateMenu() {
menus.value = generatorMenu(asyncRouteStore.getMenus)
updateSelectedKeys()
menus.value = generatorMenu(asyncRouteStore.getMenus);
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) {
if (/http(s)?:/.test(key))
window.open(key)
else
router.push({ name: key })
if (/http(s)?:/.test(key)) window.open(key);
else router.push({ name: key });
emit('clickMenuItem' as any, key)
emit("clickMenuItem" as any, key);
}
onMounted(() => {
updateMenu()
})
updateMenu();
});
return {
menus,
selectedSvg,
getSelectedSvg,
clickMenuItem,
}
};
},
})
});
</script>
<template>
<IconGroup
:options="menus"
:value="getSelectedSvg"
@update:value="clickMenuItem"
/>
<IconGroup :options="menus" :value="getSelectedSvg" @update:value="clickMenuItem" />
</template>

@ -29,7 +29,7 @@ const allCount = computed(() => {
});
const selectCount = computed(() => {
return `全部筛选(共${onList.value.length}个)`;
return `已选筛选(共${onList.value.length}个)`;
});
defineExpose({
@ -137,15 +137,13 @@ function onCheckAllChange(value) {
}
selectIds.value = value ? ids : [];
}
function onCheckChange(checked: any, item: any) {
const index = selectIds.value.indexOf(item.id);
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;
if (index === -1 && checked) selectIds.value.push(item.id);
else selectIds.value.splice(index, 1);
@ -267,17 +265,17 @@ const rightInputHandler = debounce((keyword) => {
<div>
<n-input placeholder="搜索关键字" @input="leftInputHandler">
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" />
<SvgIcon size="14px" name="magnifying-1" color="#999999" />
</template>
</n-input>
<n-scrollbar
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
>
<div class="draggable-ul">
<div class="draggable-li">
<div class="draggable-li" style="color:#666666">
<n-checkbox
v-model:checked="checkAll"
label="全"
label="全"
@update:checked="onCheckAllChange"
/>
</div>
@ -317,7 +315,7 @@ const rightInputHandler = debounce((keyword) => {
<div>
<n-input placeholder="搜索关键字" @input="rightInputHandler">
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" />
<SvgIcon size="14px" name="magnifying-1" color="#999999" />
</template>
</n-input>
<n-scrollbar
@ -339,7 +337,8 @@ const rightInputHandler = debounce((keyword) => {
:class="{ fix: item.fix }"
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>
<SvgIcon
v-if="!item.fix"
@ -358,7 +357,7 @@ const rightInputHandler = debounce((keyword) => {
</div>
<template #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>
@ -376,6 +375,7 @@ const rightInputHandler = debounce((keyword) => {
&-title {
font-weight: bold;
font-size: 16px;
color: #333333;
}
&-bar {
@ -416,6 +416,8 @@ const rightInputHandler = debounce((keyword) => {
height: 800px;
--n-padding-bottom: 20px;
--n-padding-left: 24px;
--n-padding-right: 24px;
--n-padding-top: 20px;
}
.textbtnStyle {
@ -426,6 +428,7 @@ const rightInputHandler = debounce((keyword) => {
.draggable-ul {
width: 100%;
overflow: hidden;
background: #f8f8f8;
.draggable-li {
width: 100%;
@ -449,14 +452,22 @@ const rightInputHandler = debounce((keyword) => {
--n-padding-top: 0px;
--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-size: 14px;
}
::v-deep(.n-scrollbar){
::v-deep(.n-scrollbar) {
border-top: none !important;
}
::v-deep(.n-button--info-type){
background: #507AFD !important;
::v-deep(.n-button--info-type) {
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>

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

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

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

Loading…
Cancel
Save