fix: fix eslint error

refactor/project
LiZhong 2 years ago
parent 5e52a9a191
commit ef3ce4d5bc

@ -1,4 +1,3 @@
// @ts-check
const antfu = require('@antfu/eslint-config').default
module.exports = antfu(
@ -10,21 +9,20 @@ module.exports = antfu(
'dist',
'/public',
'.husky',
'eslint.config.js',
],
},
{
rules: {
// 允许使用 debugger
'no-debugger': 'off',
'unused-imports/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'off',
'jsdoc/require-returns-description': 'off',
'eqeqeq': 'off',
'no-console': 'off',
'vue/custom-event-name-casing': 'off',
'vue/eqeqeq': 'off',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-restricted-syntax': [
// eslint-disable-next-line node/prefer-global/process
process.env.MODE === 'production' ? 2 : 0,
],
'array-callback-return': ['error', { allowImplicit: true }],

@ -1,17 +1,18 @@
<script lang="ts" setup>
import { dateZhCN, zhCN, NModalProvider } from "naive-ui";
import { computed, onMounted, nextTick, inject } from "vue";
import { AppProvider } from "@/components/Application";
import { lighten } from "@/utils/index";
import mouseTrapBind from "@/hooks/event/mouseTrapBind";
const mousetrap = inject("mousetrap") as any;
import { NModalProvider, dateZhCN, zhCN } from 'naive-ui'
import { computed, inject, nextTick, onMounted } from 'vue'
import { AppProvider } from '@/components/Application'
import { lighten } from '@/utils/index'
import mouseTrapBind from '@/hooks/event/mouseTrapBind'
const mousetrap = inject('mousetrap') as any
onMounted(() => {
mouseTrapBind(mousetrap);
});
mouseTrapBind(mousetrap)
})
const getThemeOverrides = computed(() => {
const theme = "#1980FF";
const lightenStr = lighten(theme, 6);
const theme = '#1980FF'
const lightenStr = lighten(theme, 6)
return {
common: {
@ -21,34 +22,34 @@ const getThemeOverrides = computed(() => {
primaryColorSuppl: theme,
},
Switch: {
railColorActive: "#07C984",
railColorActive: '#07C984',
},
Input: {
borderHover: "0px",
borderFocus: "0px",
boxShadowFocus: "#ff0000",
borderHover: '0px',
borderFocus: '0px',
boxShadowFocus: '#ff0000',
},
Tag: {
colorCheckedHover: "#507afd",
colorCheckedPressed: "#507afd",
colorCheckedHover: '#507afd',
colorCheckedPressed: '#507afd',
},
Slider: {
fillColor: "#1980FF",
dotBorderActive: "#1980FF",
fillColorHover: "#1980FF",
fillColor: '#1980FF',
dotBorderActive: '#1980FF',
fillColorHover: '#1980FF',
},
Card: {
padding: "0px",
padding: '0px',
},
Dropdown: {
optionColorHover: "#e8f2ff",
optionColorHover: '#e8f2ff',
},
Upload: {
draggerBorder: "1px dashed #1980FF",
draggerBorderHover: "1px dashed #1980FF",
draggerBorder: '1px dashed #1980FF',
draggerBorderHover: '1px dashed #1980FF',
},
};
});
}
})
</script>
<template>

@ -1,5 +1,5 @@
import { http } from '@/utils/http/axios'
import type { BusinessParam, PageParam } from '/#/api'
import type { PageParam } from '/#/api'
/**
*
@ -26,7 +26,7 @@ export async function getPictureTypeList(): Promise<any> {
url: `/static/admin/web/distionary/bytypecode/izpicturetype`,
method: 'get',
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -72,7 +72,7 @@ export async function getTFList() {
method: 'get',
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -144,7 +144,7 @@ export async function getIztaskrromList(enabled: string) {
params: { enabled },
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -160,7 +160,7 @@ export async function getIztaskstatusList(enabled: string) {
params: { enabled },
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -190,7 +190,7 @@ export async function getIzfirmList(enabled: string) {
params: { enabled },
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -206,7 +206,7 @@ export async function getIzproductnameList(enabled: string) {
params: { enabled },
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -222,7 +222,7 @@ export async function getizcustomnameList(enabled: string) {
params: { enabled },
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -236,7 +236,7 @@ export async function getIzCustomtypeList(): Promise<any> {
method: 'get',
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -252,7 +252,7 @@ export async function getIzcustomlevel(enabled: string) {
params: { enabled },
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -268,7 +268,7 @@ export async function getIzprojecttypeList(enabled: string) {
params: { enabled },
})
const list = res.data&&res.data.length?res.data[0].distionaryList:[]
const list = res.data && res.data.length ? res.data[0].distionaryList : []
return list
}
@ -297,7 +297,7 @@ export async function getRejectList() {
method: 'get',
})
return res.data&&res.data.length?res.data[0].distionaryList:[]
return res.data && res.data.length ? res.data[0].distionaryList : []
}
/**
@ -310,7 +310,7 @@ export async function getBackList() {
method: 'get',
})
return res.data&&res.data.length?res.data[0].distionaryList:[]
return res.data && res.data.length ? res.data[0].distionaryList : []
}
/**
@ -363,7 +363,7 @@ export async function getRelationTypeList() {
method: 'get',
})
return res.data&&res.data.length?res.data[0].distionaryList:[]
return res.data && res.data.length ? res.data[0].distionaryList : []
}
/**
@ -375,7 +375,7 @@ export async function getizstatusList() {
url: `/static/admin/web/distionary/bytypecode/izstatus`,
method: 'get',
})
return res.data&&res.data.length?res.data[0].distionaryList:[]
return res.data && res.data.length ? res.data[0].distionaryList : []
}
/**
@ -387,5 +387,5 @@ export async function getizApprovalStatusList() {
url: `/static/admin/web/distionary/bytypecode/izApprovalStatus`,
method: 'get',
})
return res.data&&res.data.length?res.data[0].distionaryList:[]
return res.data && res.data.length ? res.data[0].distionaryList : []
}

@ -17,11 +17,11 @@ export async function getConditionList(page: PageParam, searchParam: FilterSearc
},
})
const { data: { records, pages,total } } = res
const { data: { records, pages, total } } = res
return {
pageCount: pages,
data: records,
total
total,
}
}
@ -135,7 +135,7 @@ export async function sort(searchid: string, reorder: number): Promise<void> {
* @param userId
* @returns
*/
export async function getfieldList(reviewType: number, userId: number): Promise<void> {
export async function getfieldList(reviewType: number, userId: number): Promise<void> {
return http.request({
url: `/ocr/user/field/queryFields`,
method: 'get',
@ -148,11 +148,11 @@ export async function sort(searchid: string, reorder: number): Promise<void> {
* @param reviewType
* @returns
*/
export async function getAllfieldList(reviewType: number): Promise<void> {
export async function getAllfieldList(reviewType: number): Promise<void> {
return http.request({
url: `/ocr/field/list`,
method: 'get',
params: { reviewType},
params: { reviewType },
})
}
@ -165,14 +165,10 @@ export async function sort(searchid: string, reorder: number): Promise<void> {
*
* @returns
*/
export async function savefield(reviewType: number,userId:string,userFieldFixed:string,userFieldUnFixed:string=''): Promise<void> {
export async function savefield(reviewType: number, userId: string, userFieldFixed: string, userFieldUnFixed: string = ''): Promise<void> {
return http.request({
url: `/ocr/user/field/saveOrUpdate`,
method: 'POST',
params: { reviewType,userId,userFieldFixed,userFieldUnFixed},
params: { reviewType, userId, userFieldFixed, userFieldUnFixed },
})
}

@ -79,7 +79,6 @@ export async function getToolsCount() {
})
}
/**
*
* @param note
@ -108,7 +107,7 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @param note
* @returns
*/
export async function oneClickCheckTaskPackage(params: Partial<CheckParam> = { search_history: '0' }) {
export async function oneClickCheckTaskPackage(params: Partial<CheckParam> = { search_history: '0' }) {
const notEmptyParams = pickBy(params, notEmpty)
Object.keys(notEmptyParams).forEach((key) => {
@ -131,8 +130,7 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @param note
* @returns
*/
export async function getLastCheckNo() {
export async function getLastCheckNo() {
return http.request({
url: `/ocr/checkDuplicate/getLastCheckNo`,
method: 'get',
@ -144,8 +142,7 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @param note
* @returns
*/
export async function getCheckDuplicateStatus(checkDuplicateNo) {
export async function getCheckDuplicateStatus(checkDuplicateNo) {
return http.request({
url: `/ocr/checkDuplicate/getCheckDuplicateStatus`,
method: 'get',
@ -158,8 +155,7 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @param note
* @returns
*/
export async function removeCheckDuplicate(checkDuplicateNo) {
export async function removeCheckDuplicate(checkDuplicateNo) {
return http.request({
url: `/ocr/checkDuplicate/removeCheckDuplicate`,
method: 'get',
@ -172,12 +168,11 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @param
* @returns
*/
export async function createPackage(params) {
export async function createPackage(params) {
return http.request({
url: `/ocr/ocrTaskPackage/createPackage`,
method: 'post',
params
params,
})
}
/**
@ -185,12 +180,11 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @param
* @returns
*/
export async function deletePackage(params) {
export async function deletePackage(params) {
return http.request({
url: `/ocr/ocrTaskPackage/deletePackage`,
method: 'get',
params
params,
})
}
/**
@ -270,10 +264,9 @@ export async function getPictureList(params: any): Promise<any> {
* @returns
*/
export async function getFilterList(params) {
return http.request({
url: `/ocr/ocrUsersearch/querySearchCondition`,
method: 'get',
params
params,
})
}

@ -6,7 +6,7 @@ import { ContentTypeEnum } from '@/enums/httpEnum'
*
* @returns
*/
export async function getCode(params: {phone: string,agentcode:string}) {
export async function getCode(params: { phone: string, agentcode: string }) {
const res = await http.request({
url: `/web/smslogin/sendcode`,
method: 'get',

@ -15,7 +15,7 @@ export async function getApprovalList(page: any) {
pageSize: page.pageSize,
currPage: page.pageNo,
keyword: page.keyword,
userSearchId:page.userSearchId
userSearchId: page.userSearchId,
},
})

@ -4,7 +4,7 @@ import { useMessage } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { audit } from '@/api/task/task'
const emit = defineEmits(['success','close'])
const emit = defineEmits(['success', 'close'])
const message = useMessage()
const loading = ref(false)
@ -42,11 +42,11 @@ function showModal(value) {
function closeModal() {
show.value = false
emit('close')
emit('close')
formData.disposeTypeId='262403670085013522'
formData.failCauseId= '260402999231251188'
formData.comment= ''
formData.disposeTypeId = '262403670085013522'
formData.failCauseId = '260402999231251188'
formData.comment = ''
}
defineExpose({
@ -118,9 +118,9 @@ async function handleSumbit(e: MouseEvent) {
}
}
})
formData.disposeTypeId='262403670085013522'
formData.failCauseId= '260402999231251188'
formData.comment= ''
formData.disposeTypeId = '262403670085013522'
formData.failCauseId = '260402999231251188'
formData.comment = ''
}
async function selectChange(id) {

@ -1,21 +1,21 @@
<template>
<div class="ip_box" :style="canClick?'cursor: pointer;':''">
<img :src="IPImg" />
</div>
</template>
<script setup>
import IPImg from "@/assets/images/IP.png";
import { defineProps } from "vue";
import { defineProps } from 'vue'
import IPImg from '@/assets/images/IP.png'
defineProps({
canClick: {
type: Boolean,
default: () => false,
},
});
})
</script>
<template>
<div class="ip_box" :style="canClick ? 'cursor: pointer;' : ''">
<img :src="IPImg">
</div>
</template>
<style scoped lang="less">
.ip_box {
position: fixed;

@ -72,9 +72,9 @@ async function getHistory() {
getHistory()
function goPath(item, id) {
const desiredObject = item.data.find(function (item) {
return item.id === id;
});
const desiredObject = item.data.find((item) => {
return item.id === id
})
router.push({ name: item.path, query: { id, searchContent: desiredObject.name } })
emit('close')
}
@ -97,8 +97,10 @@ function highlightText(text, query) {
<img src="../../assets/images/IP.png" alt="">
</div>
<div class="input_box">
<n-input v-model:value="value" placeholder="搜索任务ID、任务名称、提报人、拜访终端" type="text" @input="inputHandler"
@mousedown="handlerShowList">
<n-input
v-model:value="value" placeholder="搜索任务ID、任务名称、提报人、拜访终端" type="text" @input="inputHandler"
@mousedown="handlerShowList"
>
<template #prefix>
<SvgIcon name="magnifying-1" size="18" />
</template>
@ -111,16 +113,20 @@ function highlightText(text, query) {
</div>
<div class="flex history-list">
<div class="tag-wrap">
<div v-for="(item, index) of historyList" :key="index" class="tag"
@click="handlerHistory(item.historyname)">
<div
v-for="(item, index) of historyList" :key="index" class="tag"
@click="handlerHistory(item.historyname)"
>
{{ item.historyname }}
</div>
</div>
<SvgIcon class="icon-delete" name="delete-history" size="16" @click="deleteHistory" />
</div>
</div>
<div v-for="(item, index) in resultList" :key="index" class="list_classfiy_item"
:style="(index === resultList.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'">
<div
v-for="(item, index) in resultList" :key="index" class="list_classfiy_item"
:style="(index === resultList.length - 1) ? '' : 'border-bottom:1px solid #e4e4e4'"
>
<div class="list_title">
{{ item.title }}
</div>

@ -1,5 +1,5 @@
import { IzCustomlevel, IzCustomname, IzCustomtype, IzfirmVue, IzProductVue, IzProjecttype, IzProjectVue, IztaskrromVue, IztaskstatusVue, IzVisitcity, IzvisitproVue, PictureDownloadVue, PictureTypeVue, PictureUploadVue, PlanVue, ReportUserVue, SimilarityVue, TimeVue } from '@/views/home/aside/comp/items'
import type { Component } from 'vue'
import { IzCustomlevel, IzCustomname, IzCustomtype, IzProductVue, IzProjectVue, IzProjecttype, IzVisitcity, IzfirmVue, IztaskrromVue, IztaskstatusVue, IzvisitproVue, PictureDownloadVue, PictureTypeVue, PictureUploadVue, PlanVue, ReportUserVue, SimilarityVue, TimeVue } from '@/views/home/aside/comp/items'
export interface AsideEntity {
label: string

@ -1,6 +1,6 @@
import { defineAsyncComponent } from 'vue'
import type { AsideEntity } from './aside'
import { IzApprovalStatus, IzCustomlevel, IzCustomname, IzCustomtype, IzProductVue, IzProjectVue, IzProjecttype, IzShowAll, IzStatus, IzVisitcity, IzfirmVue, IztaskrromVue, IzvisitproVue, PictureDownloadVue, PlanVue, ReportUserVue, TimeVue } from '@/views/home/aside/comp/items'
import { defineAsyncComponent } from "vue"
export interface RowData {
id: string
@ -85,7 +85,7 @@ export const asideMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izupuser',
// component: ReportUserVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/ReportUser.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/ReportUser.vue')),
},
izproject: {
label: '所属项目',
@ -93,7 +93,7 @@ export const asideMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izproject',
// component: IzProjectVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzProject.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzProject.vue')),
},
izplan: {
label: '所属计划',
@ -101,7 +101,7 @@ export const asideMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izplan',
// component: PlanVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Plan.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/Plan.vue')),
},
izstatus: {
label: '审批状态',
@ -109,7 +109,7 @@ export const asideMap: Recordable<AsideEntity> = {
isDefaultFilter: false,
key: 'izstatus',
// component: IzStatus, // todo
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzStatus.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzStatus.vue')),
},
izyear: {
label: '提报时间',
@ -117,7 +117,7 @@ export const asideMap: Recordable<AsideEntity> = {
isDefaultFilter: false,
key: 'izyear',
// component: TimeVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Time.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/Time.vue')),
},
iztaskrrom: {
label: '任务来源',
@ -125,7 +125,7 @@ export const asideMap: Recordable<AsideEntity> = {
isDefaultFilter: false,
key: 'iztaskrrom',
// component: IztaskrromVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Iztaskrrom.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/Iztaskrrom.vue')),
},
izshowall: {
label: '显示全部任务数据',
@ -133,7 +133,7 @@ export const asideMap: Recordable<AsideEntity> = {
isDefaultFilter: false,
key: 'izshowall',
// component: IzShowAll,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzShowAll.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzShowAll.vue')),
inFilterList: false,
},
}
@ -146,7 +146,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izApprovalStatus',
// component: IzApprovalStatus, // todo
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzApprovalStatus.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzApprovalStatus.vue')),
},
izuptime: {
label: '提报时间',
@ -154,7 +154,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izuptime',
// component: TimeVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Time.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/Time.vue')),
},
izupuser: {
label: '提报人',
@ -162,7 +162,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izupuser',
// component: ReportUserVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/ReportUser.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/ReportUser.vue')),
},
iztaskrrom: {
label: '任务来源',
@ -170,7 +170,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'iztaskrrom',
// component: IztaskrromVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Iztaskrrom.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/Iztaskrrom.vue')),
},
izcustomname: {
label: '拜访客户',
@ -178,7 +178,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izcustomname',
// component: IzCustomname,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzCustomname.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzCustomname.vue')),
},
izcustomtype: {
label: '客户类型',
@ -186,7 +186,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izcustomtype',
// component: IzCustomtype,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzCustomtype.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzCustomtype.vue')),
},
izproject: {
label: '所属项目',
@ -194,7 +194,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izproject',
// component: IzProjectVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzProject.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzProject.vue')),
},
izvisitpro: {
label: '拜访省份/直辖市',
@ -202,7 +202,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izvisitpro',
// component: IzVisitcity,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzVisitcity.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzVisitcity.vue')),
},
izcustomlevel: {
label: '客户级别',
@ -210,7 +210,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izcustomlevel',
// component: IzCustomlevel,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzCustomlevel.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzCustomlevel.vue')),
},
izprojecttype: {
label: '项目类别',
@ -218,7 +218,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izprojecttype',
// component: IzProjecttype,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzProjecttype.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzProjecttype.vue')),
},
izproductname: {
label: '产品名称',
@ -226,7 +226,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izproductname',
// component: IzProductVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/IzProduct.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/IzProduct.vue')),
},
izvisitcity: {
label: '拜访城市',
@ -234,7 +234,7 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izvisitcity',
// component: IzvisitproVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Izvisitpro.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/Izvisitpro.vue')),
},
izfirm: {
label: '厂商',
@ -242,6 +242,6 @@ export const asideTaskMap: Recordable<AsideEntity> = {
isDefaultFilter: true,
key: 'izfirm',
// component: IzfirmVue,
component: defineAsyncComponent(() => import("@/views/home/aside/comp/items/Izfirm.vue")),
component: defineAsyncComponent(() => import('@/views/home/aside/comp/items/Izfirm.vue')),
},
}

@ -1,11 +1,11 @@
const commonKeyDown = (keyCode: number) => {
document.dispatchEvent(new KeyboardEvent('keydown', { keyCode }));
function commonKeyDown(keyCode: number) {
document.dispatchEvent(new KeyboardEvent('keydown', { keyCode }))
}
const c = () => {
commonKeyDown(27)
function c() {
commonKeyDown(27)
}
const initBind = (mousetrap) => {
mousetrap.bind('c', c)
function initBind(mousetrap) {
mousetrap.bind('c', c)
}
export default initBind;
export default initBind

@ -1,16 +1,15 @@
<script lang="ts" setup>
import { onBeforeMount, ref } from 'vue';
import { onBeforeMount, ref } from 'vue'
const emit = defineEmits<{
(e: 'commit')
}>()
const props = defineProps({
selectedTotal: {
type: Number,
default: () => 0,
}
},
})
const emit = defineEmits<{
(e: 'commit')
}>()
const show = ref(false)
const cardStyle = {
'width': '450px',

@ -3,36 +3,35 @@ import Masonry from 'masonry-layout'
import { useDialog, useMessage } from 'naive-ui'
import { computed, nextTick, onBeforeMount, onMounted, onUpdated, reactive, ref, unref, watch } from 'vue'
import { dubiousfilelist, removeFiles } from '@/api/task/task'
import { viewOptions } from '@/config/home'
import { useInfiniteScroll } from '@vueuse/core'
import imagesloaded from 'imagesloaded'
import { debounce, cloneDeep } from 'lodash-es'
import { cloneDeep, debounce } from 'lodash-es'
import ConfrimModal from './ConfrimModal.vue'
import { audit, dubiousfilelist, removeFiles } from '@/api/task/task'
import { viewOptions } from '@/config/home'
import { audit } from '@/api/task/task'
import NotPassed from '@/components/Approval/NotPassed.vue'
import { formatToDateHMS } from '@/utils/dateUtil'
import { off, on } from '@/utils/domUtils'
import ConfrimModal from "./ConfrimModal.vue"
const cardStyle = {
'--n-padding-bottom': '40px',
'--n-padding-left': '120px',
}
let startTime = 0;
let endTime = 0;
let startCalTime = false;
let startTime = 0
let endTime = 0
let startCalTime = false
const message = useMessage()
const timeRange = ref('desc')
const similarRange = ref('desc')
const batch = ref(false)
const imageRef = ref<ComponentElRef | null>();
let filterId = null;
const imageRef = ref<ComponentElRef | null>()
const filterId = null
const isTop = ref(false)
let sortObj: any = {
orderByUptime: 'desc'
};
orderByUptime: 'desc',
}
const timeOptions = [{
label: '升序',
@ -68,12 +67,12 @@ const viewLabel = computed(() => {
})
const maxHeight = computed(() => {
let height = "800";
const screenWidth = window.screen.width;
if(screenWidth <= 1920) {
height = "600";
}
return height + 'px';
let height = '800'
const screenWidth = window.screen.width
if (screenWidth <= 1920)
height = '600'
return `${height}px`
})
const masonryRef = ref<ComponentRef>(null)
@ -87,10 +86,10 @@ const pagination = reactive({
let loading = false
let _masonry: null | Masonry = null
const show = ref(false)
const selectedApproveItems = ref<any[]>([]); //
const dialog = useDialog();
let processItems: any[] = [];
const confrimModalRef = ref<any>();
const selectedApproveItems = ref<any[]>([]) //
const dialog = useDialog()
let processItems: any[] = []
const confrimModalRef = ref<any>()
const layout = debounce(() => {
if (!show.value)
@ -111,11 +110,11 @@ const layout = debounce(() => {
const scrollHeight = el.value!.scrollHeight
const clientHeight = el.value!.clientHeight
const top = scrollHeight - clientHeight - 20
if(isTop.value) {
if (isTop.value)
el.value!.scrollTo({ top: 0, behavior: 'instant' })
}else {
else
el.value!.scrollTo({ top, behavior: 'instant' })
}
// let height = 800 - 15;
// const screenWidth = window.screen.width;
// if(screenWidth <= 1920) {
@ -123,23 +122,23 @@ const layout = debounce(() => {
// }
// el.value!.scrollTo({ top: height, behavior: 'instant' })
loading = false
console.log("loading---------------", loading);
console.log("pagination.pageNo---------------", pagination.pageNo);
if(pagination.pageNo == 3) {
let timer;
if(timer) {
clearTimeout(timer);
}
console.log('loading---------------', loading)
console.log('pagination.pageNo---------------', pagination.pageNo)
if (pagination.pageNo == 3) {
let timer
if (timer)
clearTimeout(timer)
timer = setTimeout(() => {
isTop.value = false
console.log("isTop.value---------------", isTop.value);
console.log('isTop.value---------------', isTop.value)
}, 1000)
}
})
}, 300)
watch(viewMode, () => {
isTop.value = true;
isTop.value = true
layout()
})
@ -153,7 +152,7 @@ useInfiniteScroll(
el as any,
() => {
loading = false
console.log("加载了000000000000000---------------------------");
console.log('加载了000000000000000---------------------------')
loadMore()
},
{ distance: 10, canLoadMore: () => canloadMore },
@ -163,14 +162,14 @@ async function featchList() {
loading = true
try {
// const result = await dubiousfilelist({ ...pagination, orderbyname: timeRange.value })
console.log("pagination.pageNo------------", pagination.pageNo);
console.log('pagination.pageNo------------', pagination.pageNo)
const result = await dubiousfilelist({ ...pagination, ...sortObj })
// TODO
// result.data = Array.from({ length: 30 })
const { data, pageCount } = result
// canloadMore = pageCount >= pagination.pageNo && pageCount > 0;
canloadMore = data.pages >= pagination.pageNo && data.pages > 0;
console.log("canloadMore------------", canloadMore);
canloadMore = data.pages >= pagination.pageNo && data.pages > 0
console.log('canloadMore------------', canloadMore)
return result.data.records
// const list = data.map((item) => {
@ -181,32 +180,31 @@ async function featchList() {
// return list
}
catch (error) {
canloadMore = false;
canloadMore = false
return []
}
}
async function loadMore() {
console.log("执行l------------------------", loading, el.value, pagination.pageNo);
console.log('执行l------------------------', loading, el.value, pagination.pageNo)
if (loading || el.value == null)
return
// loading = true
pagination.pageNo = pagination.pageNo + 1;
pagination.pageNo = pagination.pageNo + 1
const more = await featchList()
console.log("more------------------------", more);
console.log('more------------------------', more)
listData.value.push(...more)
layout()
}
onUpdated(() => {
if(startCalTime) {
endTime = new Date().getTime();
if(endTime - startTime > 500) {
if (startCalTime) {
endTime = new Date().getTime()
if (endTime - startTime > 500)
createDom()
}
}else {
}
else {
removeDom()
}
// if(elwc.value) {
@ -220,8 +218,8 @@ let selectionBox: HTMLDivElement | null
const selectIds = ref<string[]>([])
function downHandler(event: MouseEvent) {
startTime = new Date().getTime();
startCalTime = true;
startTime = new Date().getTime()
startCalTime = true
if (!selectionBox)
return
@ -264,17 +262,14 @@ function imUpdateSelectIds(x: number, y: number, w: number, h: number) {
// selectedApproveItems.value.splice(tempApproveIndex, 1);
// }
})
selectedApproveItems.value = [];
selectedApproveItems.value = []
//
listData.value.map(item => {
if(selectIds.value.includes(String(item.pictureId))) {
item.checked = true;
selectedApproveItems.value.push(item);
listData.value.map((item) => {
if (selectIds.value.includes(String(item.pictureId))) {
item.checked = true
selectedApproveItems.value.push(item)
}
});
})
}
function isSelected(pictureId: number) {
@ -282,12 +277,12 @@ function isSelected(pictureId: number) {
}
function moveHandler(e: MouseEvent) {
if(startCalTime) {
endTime = new Date().getTime();
if(endTime - startTime > 500) {
if (startCalTime) {
endTime = new Date().getTime()
if (endTime - startTime > 500)
createDom()
}
}else {
}
else {
removeDom()
}
if (!selectionBox || !start)
@ -307,68 +302,66 @@ function moveHandler(e: MouseEvent) {
}
function createDom() {
let dom = document.createElement('div');
dom.className = "selection-box";
dom.style.width = "1px";
dom.style.border = "1px dotted black";
dom.style.position = "absolute";
dom.style.display = "block";
dom.style.zIndex = '9999';
document.body.appendChild(dom);
const dom = document.createElement('div')
dom.className = 'selection-box'
dom.style.width = '1px'
dom.style.border = '1px dotted black'
dom.style.position = 'absolute'
dom.style.display = 'block'
dom.style.zIndex = '9999'
document.body.appendChild(dom)
selectionBox = document.querySelector('.selection-box') as HTMLDivElement
}
function removeDom() {
let dom = document.getElementsByClassName("selection-box")[0];
if(dom) {
document.body.removeChild(dom);
}
const dom = document.getElementsByClassName('selection-box')[0]
if (dom)
document.body.removeChild(dom)
}
function upHandler(event: MouseEvent) {
endTime = new Date().getTime();
startCalTime = false;
if(endTime - startTime > 500) {
endTime = new Date().getTime()
startCalTime = false
if (endTime - startTime > 500)
createDom()
}else {
else
removeDom()
}
if (!selectionBox)
return
return
selectionBox.style.display = 'none'
start = null
if(selectionBox.style.width == "0px") {
if (selectionBox.style.width == '0px') {
removeDom()
if(event.target?.className.indexOf("n-checkbox-box__border") != -1 ) {
if (event.target?.className.indexOf('n-checkbox-box__border') != -1)
return
}
selectIds.value = []
selectedApproveItems.value.forEach((item) => (item.checked = false));
selectedApproveItems.value.length = 0;
listData.value.map(item => {
item.checked = false;
});
selectedApproveItems.value.forEach(item => (item.checked = false))
selectedApproveItems.value.length = 0
listData.value.map((item) => {
item.checked = false
})
// batch.value = false;
}
}
const gridHeight = computed(() => {
// return viewMode.value !== 'masonry' ? '157px' : ''
let height = "";
if (viewMode.value === "masonry") {
height = "";
} else if (viewMode.value === "horizontalVersion") {
height = "145px";
} else if (viewMode.value === "verticalVersion") {
height = "300px";
} else if (viewMode.value === "3:4") {
height = "240px";
}
return height;
let height = ''
if (viewMode.value === 'masonry')
height = ''
else if (viewMode.value === 'horizontalVersion')
height = '145px'
else if (viewMode.value === 'verticalVersion')
height = '300px'
else if (viewMode.value === '3:4')
height = '240px'
return height
})
function addListeners() {
// selectionBox.style['z-index'] = '-1'
on(el.value!, 'mousedown', downHandler)
on(el.value!, 'mousemove', moveHandler)
@ -391,7 +384,7 @@ function afterLeave() {
removeListeners()
}
onMounted(async() => {
onMounted(async () => {
show.value && addListeners()
removeDom()
})
@ -406,38 +399,38 @@ async function showModal() {
}
async function onChange() {
if(timeRange.value == "desc") {
timeRange.value = "asc";
}else {
timeRange.value = "desc";
}
if (timeRange.value == 'desc')
timeRange.value = 'asc'
else
timeRange.value = 'desc'
sortObj = {
// orderbyname: val,
orderByUptime: timeRange.value
orderByUptime: timeRange.value,
}
pagination.pageNo = 1;
canloadMore = true;
pagination.pageNo = 1
canloadMore = true
const list = await featchList()
listData.value = list
isTop.value = true;
isTop.value = true
layout()
}
async function onChangeView() {
if(similarRange.value == "desc") {
similarRange.value = "asc";
}else {
similarRange.value = "desc";
}
if (similarRange.value == 'desc')
similarRange.value = 'asc'
else
similarRange.value = 'desc'
sortObj = {
// orderbyname: val,
orderBySimilarity: similarRange.value
orderBySimilarity: similarRange.value,
}
pagination.pageNo = 1;
canloadMore = true;
pagination.pageNo = 1
canloadMore = true
const list = await featchList()
listData.value = list
isTop.value = true;
isTop.value = true
layout()
}
@ -465,17 +458,16 @@ function remove() {
confrimModalRef?.value?.showModal()
}
function setBatch(value) {
if (value && batch.value) {
batch.value = !value;
} else {
batch.value = value;
}
if (value && batch.value)
batch.value = !value
else
batch.value = value
if (value === false) {
selectIds.value = []
selectedApproveItems.value.forEach((item) => (item.checked = false));
selectedApproveItems.value.length = 0;
selectedApproveItems.value.forEach(item => (item.checked = false))
selectedApproveItems.value.length = 0
}
}
@ -485,26 +477,24 @@ defineExpose({
const notPassModalRef = ref(null)
const showActions = computed(() => {
return selectedApproveItems.value.length > 0 && batch;
});
return selectedApproveItems.value.length > 0 && batch
})
function onCheckChange(checked: any, item: any) {
item.checked = checked
const index = selectedApproveItems.value.indexOf(item);
const picIndex = selectIds.value.indexOf(item.pictureId);
const index = selectedApproveItems.value.indexOf(item)
const picIndex = selectIds.value.indexOf(item.pictureId)
if (index === -1 && checked) {
if (index === -1 && checked)
selectedApproveItems.value.push(item)
} else {
selectedApproveItems.value.splice(index, 1);
}
if (picIndex === -1 && checked) {
selectIds.value.push(item.pictureId);
} else {
selectIds.value.splice(picIndex, 1);
}
else
selectedApproveItems.value.splice(index, 1)
if (picIndex === -1 && checked)
selectIds.value.push(item.pictureId)
else
selectIds.value.splice(picIndex, 1)
setTimeout(() => {
nextTick(() => {
batch.value = true
@ -518,28 +508,29 @@ function rejectHandler() {
}
function reset() {
batch.value = false;
batch.value = false
// pagination.pageNo = 1;
pagination.pageNo = 1;
pagination.pageSize = 20;
selectIds.value = [];
selectedApproveItems.value.length = 0;
loading = false;
canloadMore = true;
layout();
pagination.pageNo = 1
pagination.pageSize = 20
selectIds.value = []
selectedApproveItems.value.length = 0
loading = false
canloadMore = true
layout()
}
function validate(items: any[]) {
if (items.length === 0) return "至少选中一个任务";
return null;
if (items.length === 0)
return '至少选中一个任务'
return null
}
function approvalHandler(items?: any) {
// if (batch.value) {
processItems = selectedApproveItems.value
processItems = selectedApproveItems.value
// }
// => => /
if (items !== undefined && !(items instanceof PointerEvent))
processItems = [items]
console.log("batch-------------",batch.value,selectedApproveItems.value,processItems);
console.log('batch-------------', batch.value, selectedApproveItems.value, processItems)
const msg = validate(processItems)
if (msg !== null) {
@ -586,9 +577,8 @@ function doAudit(param: any) {
message.info(res.message)
// emitter.emit('refresh')
refreshHandler()
}
else message.error(res.message)
else { message.error(res.message) }
})
}
function reloadList() {
@ -597,11 +587,11 @@ function reloadList() {
async function refreshHandler(filtersearchId?: any) {
// rao start
reset()
pagination.pageNo = 1;
pagination.pageNo = 1
const list = await featchList()
listData.value = list
layout()
// rao end
// rao end
// reset();
// if (filtersearchId) {
@ -613,53 +603,51 @@ async function refreshHandler(filtersearchId?: any) {
useInfiniteScroll(
el as any,
() => {
console.log("加载了333333333333333333333333---------------------------");
loadMore();
console.log('加载了333333333333333333333333---------------------------')
loadMore()
},
{ distance: 10, canLoadMore: () => canloadMore }
);
}, 300);
});
}
watch(() => show.value,
async(newVal) => {
if(show.value) {
pagination.pageNo = 1;
const list = await featchList()
listData.value = list
console.log("加载了1111111111111---------------------------", listData.value);
layout()
}
},
)
{ distance: 10, canLoadMore: () => canloadMore },
)
}, 300)
})
}
watch(() => show.value, async (newVal) => {
if (show.value) {
pagination.pageNo = 1
const list = await featchList()
listData.value = list
console.log('加载了1111111111111---------------------------', listData.value)
layout()
}
})
watch(() => pagination.pageNo,
(newVal, oldVal) => {
console.log("加载了22222222222222222---------------------------", newVal, oldVal, canloadMore);
if(newVal == oldVal) {
return
}
if((newVal == 1 || newVal == 2) && canloadMore) {
setTimeout(() => {
nextTick(() => {
loading = false
loadMore();
})
}, 500)
}
},
);
watch(() => pagination.pageNo, (newVal, oldVal) => {
console.log('加载了22222222222222222---------------------------', newVal, oldVal, canloadMore)
if (newVal == oldVal)
return
if ((newVal == 1 || newVal == 2) && canloadMore) {
setTimeout(() => {
nextTick(() => {
loading = false
loadMore()
})
}, 500)
}
})
</script>
<template>
<div>
<n-modal v-model:show="show" :mask-closable="false" style="position: relative;" transform-origin="center"
@after-enter="afterEnter" @after-leave="afterLeave">
<n-card ref="elwc" :style="cardStyle" class="card card-1" style="position: fixed;top:64px" :bordered="false" size="huge"
role="dialog" aria-modal="true">
<n-modal
v-model:show="show" :mask-closable="false" style="position: relative;" transform-origin="center"
@after-enter="afterEnter" @after-leave="afterLeave"
>
<n-card
ref="elwc" :style="cardStyle" class="card card-1" style="position: fixed;top:64px" :bordered="false" size="huge"
role="dialog" aria-modal="true"
>
<div class="wrapper">
<div class="wrapper-m32">
<SvgIcon name="recycle" size="16" />
@ -709,7 +697,7 @@ watch(() => pagination.pageNo,
<div class="remove" @click="remove">
移除可疑文件夹
</div>
<div class="wrapper-content-form-button" @click="setBatch(true)" v-show="!showActions">
<div v-show="!showActions" class="wrapper-content-form-button" @click="setBatch(true)">
<SvgIcon style="margin-right: 6px;" size="14" name="tf" />
批量审批
</div>
@ -731,32 +719,38 @@ watch(() => pagination.pageNo,
</div>
</div>
<div ref="el" class="scroll" :style="{height: maxHeight}">
<div ref="el" class="scroll" :style="{ height: maxHeight }">
<!-- <n-scrollbar :on-scroll="scrollHandler"> -->
<div ref="masonryRef" class="grid">
<div v-for="(item, index) in listData" :key="item.pictureId" :data-id="item.pictureId"
<div
v-for="(item, index) in listData" :key="item.pictureId" :data-id="item.pictureId"
:class="{ 'grid-item-selected': isSelected(item.pictureId) }" :style="{ height: gridHeight }"
class="grid-item">
class="grid-item"
>
<n-image
ref="imageRef"
:src="item.imgUrl"
:preview-src="item.imgUrl"
class="img "
ref="imageRef"
:src="item.imgUrl"
:preview-src="item.imgUrl"
class="img "
:class="{
'img-fit': viewMode === 'horizontalVersion',
'img-full': viewMode === '3:4' || viewMode === 'verticalVersion' }"
/>
<n-checkbox v-if="batch && item.historyStates === 1" v-model:checked="item.checked"
/>
<n-checkbox
v-if="batch && item.historyStates === 1" v-model:checked="item.checked"
style="position:absolute;left:20px;top:20px" @click.prevent.stop
@update:checked="onCheckChange($event, item)" />
@update:checked="onCheckChange($event, item)"
/>
<img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt="">
<img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png"
alt="">
<img
v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png"
alt=""
>
<div :class="{ 'percent-red': item.similarityScore === 100 }" class="percent">
{{ item.similarityScore }}<span class="percent-unit">%</span>
</div>
<div class="time" >
<div class="time">
<!-- <div class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="16" name="camera-time" />
<span>{{ item?.photoDateTimestamp ?
@ -769,13 +763,13 @@ watch(() => pagination.pageNo,
</div> -->
<div class="time-item" style="margin-bottom: 4px;">
<SvgIcon color="#FFF" size="16" name="camera" style="margin-right: 4px;" />
<span class="time-value">{{ item?.photoDateTimestamp ?
formatToDateHMS(Number(item.photoDateTimestamp)) : '-' }} </span>
<span class="time-value">{{ item?.photoDateTimestamp
? formatToDateHMS(Number(item.photoDateTimestamp)) : '-' }} </span>
</div>
<div class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="16" name="time" />
<span>{{ item.submitDateTimestamp ?
formatToDateHMS(Number(item.submitDateTimestamp)) : '-' }}</span>
<span>{{ item.submitDateTimestamp
? formatToDateHMS(Number(item.submitDateTimestamp)) : '-' }}</span>
</div>
</div>
</div>
@ -791,8 +785,7 @@ watch(() => pagination.pageNo,
</n-card>
</n-modal>
<NotPassed ref="notPassModalRef" @success="reloadList" />
<ConfrimModal ref="confrimModalRef" @commit="commit" :selectedTotal="selectIds.length" />
<ConfrimModal ref="confrimModalRef" :selected-total="selectIds.length" @commit="commit" />
</div>
</template>
@ -977,7 +970,6 @@ watch(() => pagination.pageNo,
}
}
.scroll {
overflow-y: auto;
// height: calc(100vh - 282px);
@ -1005,4 +997,5 @@ watch(() => pagination.pageNo,
height: 100%;
object-fit: cover;
}
}</style>
}
</style>

@ -14,7 +14,7 @@ defineExpose({
<template>
<div>
<n-modal v-model:show="show" :mask="false" :showMask="false" transform-origin="center">
<n-modal v-model:show="show" :mask="false" :show-mask="false" transform-origin="center">
<Search @close="show = false" />
</n-modal>
</div>

@ -9,7 +9,7 @@ const cardStyle = {
'width': '800px',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
'padding-bottom':'100px'
'padding-bottom': '100px',
}
function showModal() {
@ -102,7 +102,6 @@ defineExpose({
</div>
<div class="wrapper-request">
<table style="margin-left: 100px;">
<tr>
<td><div class="key" data-key="p p" /></td>
<td>通过</td>

@ -1,92 +1,92 @@
<script lang="ts" setup>
import { computed, inject, onMounted, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useUser } from "@/store/modules/user";
import { getImgUrl } from "@/utils/urlUtils";
import defaultAvatar from '@/assets/icons/avatar.svg';
import { computed, inject, onMounted, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useUser } from '@/store/modules/user'
import { getImgUrl } from '@/utils/urlUtils'
import defaultAvatar from '@/assets/icons/avatar.svg'
const emit = defineEmits<{
(e: "logout"): void;
}>();
(e: 'logout'): void
}>()
const router = useRouter();
const router = useRouter()
const userStore = useUser();
const userStore = useUser()
const useInfo = userStore.getUserInfo;
const useInfo = userStore.getUserInfo
const aiDisabled = ref(false);
const aiDisabled = ref(false)
function handleSelect(row) {
userStore.updateTenantId(row.key);
location.reload();
userStore.updateTenantId(row.key)
location.reload()
}
function logIt(e) {
return false;
return false
}
//
function goHome(e) {
router.push({ name: "home" });
router.push({ name: 'home' })
}
//
function goTask(e) {
router.push({ name: "task-main" });
router.push({ name: 'task-main' })
}
// AI
function goWorksheet(e) {
router.push({ name: "worksheet-main" });
router.push({ name: 'worksheet-main' })
}
//
function goFinal(e) {
router.push({ name: "final-main" });
router.push({ name: 'final-main' })
}
const mousetrap = inject("mousetrap") as any;
const mousetrap = inject('mousetrap') as any
onMounted(() => {
mousetrap.bind("g h", goHome);
mousetrap.bind("g t", goTask);
mousetrap.bind("g a", goWorksheet);
mousetrap.bind("g e", goFinal);
});
mousetrap.bind('g h', goHome)
mousetrap.bind('g t', goTask)
mousetrap.bind('g a', goWorksheet)
mousetrap.bind('g e', goFinal)
})
const showPopover = ref(false);
const popRef = ref(null);
const changeFlag = ref(false);
const showPopover = ref(false)
const popRef = ref(null)
const changeFlag = ref(false)
const iconName = computed(() => {
return showPopover.value ? "expand" : "collapse";
});
return showPopover.value ? 'expand' : 'collapse'
})
function handleUpdateShow(show: boolean) {
showPopover.value = show;
showPopover.value = show
}
function logOut() {
(popRef.value as any).setShow(false);
emit("logout");
(popRef.value as any).setShow(false)
emit('logout')
}
const currentCompanyName = computed(() => {
const tenantList = useInfo.tenantList;
const currentId = userStore.getTenantId;
const current = tenantList.find((item) => item.id === currentId);
return current.name || "name";
});
const tenantList = useInfo.tenantList
const currentId = userStore.getTenantId
const current = tenantList.find(item => item.id === currentId)
return current.name || 'name'
})
const options = computed(() => {
const tenantList = useInfo.tenantList;
const tenantList = useInfo.tenantList
return tenantList.map((item) => {
return {
label: item.name,
key: item.id,
};
});
});
}
})
})
</script>
<template>
@ -119,24 +119,28 @@ const options = computed(() => {
</div>
<div class="trigger">
<span>{{ currentCompanyName }}</span>
<span @click="changeFlag = !changeFlag" style="cursor: pointer"><SvgIcon name="switchCompany" size="24" /></span>
<span style="cursor: pointer" @click="changeFlag = !changeFlag"><SvgIcon name="switchCompany" size="24" /></span>
</div>
<div class="item">
<span>AI设置开关</span>
<n-switch v-model:value="aiDisabled" />
</div>
<div class="trigger">联系我们</div>
<div class="trigger">
联系我们
</div>
<n-divider style="margin-top: 0px; margin-bottom: 10px; padding: 0 22px" />
<div class="trigger" @click="logOut">退</div>
<div class="trigger" @click="logOut">
退出登录
</div>
<div
class="container sub-container"
v-show="changeFlag"
class="container sub-container"
style="position: absolute; right: 17vw; width: 11.5vw; padding: 24px 0"
>
<div
class="trigger"
v-for="option in options"
:key="option.key"
class="trigger"
@click="handleSelect(option)"
>
{{ option.label }}

@ -36,7 +36,7 @@ function getSvgName(item: MenuMixedOption) {
class="icon-button" :class="{ 'icon-button--selected': isSelect(item) }"
@click="handleClick(item)"
>
<SvgIcon color="#666666" :size="item.svgsize as number" :name="getSvgName(item)" />
<SvgIcon color="#666666" :size="item.svgsize as number" :name="getSvgName(item)" />
</button>
</template>
<span>{{ item.title }}</span>

@ -1,57 +1,57 @@
<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 { storage } from "@/utils/Storage";
import { CURRENT_USER } from "@/store/mutation-types";
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);
const userInfo = storage.get(CURRENT_USER);
menus.value = generatorMenu(asyncRouteStore.getMenus)
const userInfo = storage.get(CURRENT_USER)
if (userInfo && userInfo.frontmenuTList) {
menus.value = userInfo.frontmenuTList.map((item) => {
let v = {
const 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")
: "",
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.description,
@ -62,38 +62,39 @@ export default defineComponent({
path: item.resUrl,
name: item.resKey,
svgname: item.icon,
svgsize: item.resUrl == "/home" ? 60 : 22,
svgsize: item.resUrl == '/home' ? 60 : 22,
title: item.description,
};
return v;
});
}
return v
})
}
console.log(userInfo.frontmenuTList,'frontmenuTList');
console.log(menus.value,'menus')
updateSelectedKeys();
console.log(userInfo.frontmenuTList, 'frontmenuTList')
console.log(menus.value, 'menus')
updateSelectedKeys()
}
//
function clickMenuItem(key: string) {
console.log('clickMenuItem',key)
if (/http(s)?:/.test(key)) window.open(key);
else router.push({ name: key });
console.log('clickMenuItem', 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>

@ -1,17 +1,17 @@
<script lang="ts" setup>
import { computed, unref } from "vue";
import { Logo } from "./components/Logo";
import { MainView } from "./components/Main";
import { AsideMenu } from "./components/Menu";
import { PageHeader } from "./components/Header";
import { useProjectSetting } from "@/hooks/setting/useProjectSetting";
import { computed, unref } from 'vue'
import { Logo } from './components/Logo'
import { MainView } from './components/Main'
import { AsideMenu } from './components/Menu'
import { PageHeader } from './components/Header'
import { useProjectSetting } from '@/hooks/setting/useProjectSetting'
const { menuSetting } = useProjectSetting();
const { menuSetting } = useProjectSetting()
const leftMenuWidth = computed(() => {
const { minMenuWidth } = unref(menuSetting);
return minMenuWidth;
});
const { minMenuWidth } = unref(menuSetting)
return minMenuWidth
})
</script>
<template>

@ -16,7 +16,7 @@ async function bootstrap() {
setupGlobalProperties(app)
setupRouter(app)
await router.isReady()
const meta = document.createElement('meta')
const meta = document.createElement('meta')
meta.name = 'naive-ui-style'
document.head.appendChild(meta)
app.mount('#app', true)

@ -1,5 +1,5 @@
import { Layout } from '@/router/constant'
import type { RouteRecordRaw } from 'vue-router'
import { Layout } from '@/router/constant'
/**
* @param name , ,

@ -21,7 +21,7 @@ export const useAsideConfigStore = defineStore({
systemConfig: null,
customConfig: null,
asideValue: null,
searchValue: "",
searchValue: '',
isAllowDownload: true,
timeNum: 0,
filterConfig: [],

@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import { store } from '@/store'
import { getBackList, getBusinessList, getIzShowList, getIztaskstatusList, getPictureTypeList, getRegionList, getRejectList, getRelationTypeList, getTFList, getizstatusList, getizApprovalStatusList } from '@/api/dictionary'
import { getBackList, getBusinessList, getIzShowList, getIztaskstatusList, getPictureTypeList, getRegionList, getRejectList, getRelationTypeList, getTFList, getizApprovalStatusList, getizstatusList } from '@/api/dictionary'
export interface DictionaryState {
regionList: any
@ -104,32 +104,32 @@ export const useDictionaryStore = defineStore({
},
getizApprovalStatus: (state) => {
return state.izApprovalStatusList
}
},
},
actions: {
initData(){
initData() {
// this.fetchRegionList(); //废弃
this.fetchPictureTypeList();
this.fetchPersionList();
this.fetchPlanList();
this.fetchTFList();
this.fetchPictureTypeList()
this.fetchPersionList()
this.fetchPlanList()
this.fetchTFList()
// this.fetchIzShowList(); //废弃
this.fetchIzProjectList();
this.fetchIztaskrromList();
this.fetchIztaskstatusList();
this.fetchIzvisitproList();
this.fetchIzfirmList();
this.fetchIzproductnameList();
this.fetchizcustomnameList();
this.fetchIzCustomtypeList();
this.fetchIzcustomlevelList();
this.fetchizizprojecttypeList();
this.fetchizvisitcityList();
this.fetchRejectList();
this.fetchBackList();
this.fetchRelationTypeList();
this.fetchizstatusListt();
this.fetchizApprovalStatusList();
this.fetchIzProjectList()
this.fetchIztaskrromList()
this.fetchIztaskstatusList()
this.fetchIzvisitproList()
this.fetchIzfirmList()
this.fetchIzproductnameList()
this.fetchizcustomnameList()
this.fetchIzCustomtypeList()
this.fetchIzcustomlevelList()
this.fetchizizprojecttypeList()
this.fetchizvisitcityList()
this.fetchRejectList()
this.fetchBackList()
this.fetchRelationTypeList()
this.fetchizstatusListt()
this.fetchizApprovalStatusList()
},
settfList(config) {
this.tfList = config

@ -2,8 +2,8 @@ import { defineStore } from 'pinia'
import { store } from '@/store'
import { getFilter } from '@/api/home/filter'
import { getConfig } from '@/api/system/user'
import { asideMap } from "@/config/final";
import { cloneDeep, isEqual } from "lodash-es";
import { asideMap } from '@/config/final'
import { cloneDeep, isEqual } from 'lodash-es'
import type { AsideConfig } from '/#/api'
@ -25,7 +25,7 @@ export const useFinalStore = defineStore({
customConfig: null,
asideValue: null,
listKey: 0,
searchValue: "",
searchValue: '',
isAllowDownload: true,
timeNum: 0,
filterConfig: [],
@ -56,7 +56,7 @@ export const useFinalStore = defineStore({
actions: {
setSystemConfig(config: AsideConfig) {
this.systemConfig = config
console.log("systemConfig----------", config);
console.log('systemConfig----------', config)
},
setAsideValue(value) {
this.asideValue = value
@ -86,21 +86,21 @@ export const useFinalStore = defineStore({
// console.log("response.data----------", response.data);
// this.setSystemConfig(response.data)
// return response.data
let list: any = {};
let tempAsideMap = cloneDeep(asideMap);
Object.keys(tempAsideMap).map(key => {
list[key] = "Y";
});
console.log("setSystemConfig---------------", list);
this.setSystemConfig(list);
return list
const list: any = {}
const tempAsideMap = cloneDeep(asideMap)
Object.keys(tempAsideMap).map((key) => {
list[key] = 'Y'
})
console.log('setSystemConfig---------------', list)
this.setSystemConfig(list)
return list
},
// // 获取终审个性化配置
async fetchCustomConfig() {
const res = await getFilter(1)
const { data } = res
const list = data && data.searchcount ? data.searchcount.split(',') : [];
console.log("listkey---------------", list);
const list = data && data.searchcount ? data.searchcount.split(',') : []
console.log('listkey---------------', list)
this.customConfig = list
return list
},

@ -12,7 +12,7 @@ export const useTaskStore = defineStore({
packageid: '',
immersion: false,
inFile: false, // 是否进入文件夹
inFileId:"",
inFileId: '',
}),
getters: {
getActiveId: (state: TaskState) => state.activeId,

@ -28,7 +28,7 @@ export const useWorkOrderStore = defineStore({
this.currentIndex = index
const order = this.packageList[index]
this.activeId = orderId || order?.checkDuplicateId
this.dataId = dataId || order.id;
this.dataId = dataId || order.id
},
forward() {
const len = this.packageList.length

@ -201,7 +201,7 @@ const transform: AxiosTransform = {
// eslint-disable-next-line ts/no-use-before-define
const instance = http.getAxios()
const config = response.config
const whitelist = ['/api/captcha/captchatoken', '/api/captcha/captchaImage', '/api/backstage/adminlogin', '/api/oauthweb/token','/api/web/smslogin/login','/api/web/smslogin/sendcode','/api/ocr/sUser/selectSUser']
const whitelist = ['/api/captcha/captchatoken', '/api/captcha/captchaImage', '/api/backstage/adminlogin', '/api/oauthweb/token', '/api/web/smslogin/login', '/api/web/smslogin/sendcode', '/api/ocr/sUser/selectSUser']
const expirationTime = storage.get(TOKEN_EXPIRATION_TIME)
// console.log('剩余失效时间(分):', (expirationTime - Date.now()) / 1000 / 60, config.url)

@ -10,109 +10,110 @@ import {
shallowRef,
unref,
watch,
} from "vue";
import { CustomFilterModalVue, FilterModal, NewFilterModal } from "@/views/final/comp";
import Search from "@/views/home/aside/comp/Search.vue";
import AdvanceFilter from "@/views/home/aside/comp/AdvanceFilter.vue";
import { getViewportOffset } from "@/utils/domUtils";
import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn";
import { useFinal } from "@/store/modules/final";
import type { Filter } from "/#/home";
import type { AsideEntity } from "@/config/aside";
import { asideMap } from "@/config/final";
import type { AsideConfig } from "/#/api";
import emitter from "@/utils/mitt";
import { getFilterList } from "@/api/home/main";
import { cloneDeep, isEqual } from "lodash-es";
const emit = defineEmits(["inputChange"]);
const finalStore = useFinal();
} from 'vue'
import { cloneDeep, isEqual } from 'lodash-es'
import { CustomFilterModalVue, FilterModal, NewFilterModal } from '@/views/final/comp'
import Search from '@/views/home/aside/comp/Search.vue'
import AdvanceFilter from '@/views/home/aside/comp/AdvanceFilter.vue'
import { getViewportOffset } from '@/utils/domUtils'
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useFinal } from '@/store/modules/final'
import type { Filter } from '/#/home'
import type { AsideEntity } from '@/config/aside'
import { asideMap } from '@/config/final'
import type { AsideConfig } from '/#/api'
import emitter from '@/utils/mitt'
import { getFilterList } from '@/api/home/main'
const emit = defineEmits(['inputChange'])
const finalStore = useFinal()
//
const asideValue: Record<keyof typeof asideMap, any> = reactive({});
const asideValue: Record<keyof typeof asideMap, any> = reactive({})
// :
const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({});
const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({})
//
const showItems = shallowRef<{ key: string; config: AsideEntity }[]>([]);
const initAsideValueRef = ref<any>(null); // ()
const customObjRef = ref<any>(null); //
const customTempObjRef = ref<any>(null); // ()
const configFilterRef = ref<any>([]); //
const showItems = shallowRef<{ key: string, config: AsideEntity }[]>([])
const initAsideValueRef = ref<any>(null) // ()
const customObjRef = ref<any>(null) //
const customTempObjRef = ref<any>(null) // ()
const configFilterRef = ref<any>([]) //
initAsideValueRef.value = cloneDeep(asideMap);
initAsideValueRef.value = cloneDeep(asideMap)
onBeforeMount(async () => {
finalStore.fetchConfig();
finalStore.fetchCustomConfig();
});
finalStore.fetchConfig()
finalStore.fetchCustomConfig()
})
Object.keys(asideMap).forEach((key) => {
const { defaultValue, inFilterList } = asideMap[key];
if (inFilterList !== false) asideValue[key] = defaultValue;
});
const { defaultValue, inFilterList } = asideMap[key]
if (inFilterList !== false)
asideValue[key] = defaultValue
})
const filterModalRef:any = ref(null);
const newFilterModalRef = ref(null);
const customModalRef = ref(null);
const AdvanceFilterRef: any = ref(null);
const filterModalRef: any = ref(null)
const newFilterModalRef = ref(null)
const customModalRef = ref(null)
const AdvanceFilterRef: any = ref(null)
function showModal(modalRef: any) {
const modal = unref(modalRef)! as any;
modal.showModal();
const modal = unref(modalRef)! as any
modal.showModal()
}
const newFilterOk = () => {
function newFilterOk() {
filterModalRef.value.query(
filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize
);
filterModalRef.value.showModal();
};
filterModalRef.value.pagination.pageSize,
)
filterModalRef.value.showModal()
}
const mousetrap = inject("mousetrap") as any;
mousetrap.bind("[", collapseHandler);
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
onMounted(() => {
nextTick(() => {
computeSlideHeight();
});
});
computeSlideHeight()
})
})
const collapse = ref(false);
const collapse = ref(false)
function collapseHandler() {
collapse.value = !collapse.value;
collapse.value = !collapse.value
}
const asideWidth = computed(() => {
return collapse.value ? 0 : 308;
});
return collapse.value ? 0 : 308
})
const asideHeight = ref(500);
const asideHeight = ref(500)
const asideStyle = computed(() => {
return {
width: `${asideWidth.value}px`,
height: `${asideHeight.value}px`,
};
});
}
})
const collapseIcon = computed(() => {
return collapse.value ? "expand-cir" : "collapse-cir";
});
return collapse.value ? 'expand-cir' : 'collapse-cir'
})
function computeSlideHeight() {
const headEl = document.querySelector(".aside-header")!;
const { bottomIncludeBody } = getViewportOffset(headEl);
const height = bottomIncludeBody;
asideHeight.value = height - 24;
const headEl = document.querySelector('.aside-header')!
const { bottomIncludeBody } = getViewportOffset(headEl)
const height = bottomIncludeBody
asideHeight.value = height - 24
}
useWindowSizeFn(computeSlideHeight, 280);
useWindowSizeFn(computeSlideHeight, 280)
onBeforeMount(async () => {
finalStore.fetchCustomConfig();
});
finalStore.fetchCustomConfig()
})
nextTick(()=>{
nextTick(() => {
finalStore.$subscribe(() => {
// const customConfig = finalStore.getCustomConfig;
// console.log("customConfigaside---------------", customConfig);
@ -144,17 +145,18 @@ nextTick(()=>{
// }, []);
// console.log("showItems111111111---------------", items);
// showItems.value = items;
const config = finalStore.getSystemConfig;
const customConfig = finalStore.getCustomConfig;
const config = finalStore.getSystemConfig
const customConfig = finalStore.getCustomConfig
if (
configFilterRef.value.length > 0 &&
isEqual(configFilterRef.value, finalStore.getFilterConfig) &&
customObjRef.value &&
isEqual(customObjRef.value, customTempObjRef.value)
) {
return;
}
if (config == null || customConfig == null) return;
configFilterRef.value.length > 0
&& isEqual(configFilterRef.value, finalStore.getFilterConfig)
&& customObjRef.value
&& isEqual(customObjRef.value, customTempObjRef.value)
)
return
if (config == null || customConfig == null)
return
// console.log("config", config, "customConfig", customConfig);
/* rao
const showKeys = [...customConfig].filter(key => !asideMap[key].isDefaultFilter)// customConfig isDefaultFilter
@ -162,166 +164,171 @@ nextTick(()=>{
showKeys.unshift(...defaultKeys)
*/
let sortKeyList: any = [];
const sortKeyList: any = []
finalStore.getFilterConfig.map((item: any) => {
sortKeyList.push(item?.id);
});
const showKeys = [...sortKeyList];
sortKeyList.push(item?.id)
})
const showKeys = [...sortKeyList]
Object.keys(config).forEach((key) => {
if (key.startsWith("iz") && asideMap[key] !== undefined)
asideVisible[key] =
(showKeys.includes(key) || asideMap[key].isDefaultFilter) && config[key] === "Y";
});
if (key.startsWith('iz') && asideMap[key] !== undefined) {
asideVisible[key]
= (showKeys.includes(key) || asideMap[key].isDefaultFilter) && config[key] === 'Y'
}
})
if (customObjRef.value) {
//
Object.keys(customObjRef.value).map((key) => {
if (asideMap.hasOwnProperty(key)) {
const str = key.toLowerCase();
const str = key.toLowerCase()
// console.log("customObjRef.value[str]1111111111111", customObjRef.value[str]);
if (str == "izsimilarity") {
if (typeof customObjRef.value[str] == "string") {
customObjRef.value[str] = customObjRef.value[str].split(",");
}
asideValue[key] = customObjRef.value[str]; //
console.log("相似度2222222222", asideValue[key]);
} else if (str == "izyear") {
if (typeof customObjRef.value[str] == "string") {
let time = customObjRef.value[str].split("-");
time[0] = new Date(time[0]).getTime();
time[1] = new Date(time[1]).getTime();
customObjRef.value[str] = time;
if (str == 'izsimilarity') {
if (typeof customObjRef.value[str] == 'string')
customObjRef.value[str] = customObjRef.value[str].split(',')
asideValue[key] = customObjRef.value[str] //
console.log('相似度2222222222', asideValue[key])
}
else if (str == 'izyear') {
if (typeof customObjRef.value[str] == 'string') {
const time = customObjRef.value[str].split('-')
time[0] = new Date(time[0]).getTime()
time[1] = new Date(time[1]).getTime()
customObjRef.value[str] = time
}
asideValue[key] = customObjRef.value[str]; //
console.log("时间2222222222", asideValue[key]);
} else if (customObjRef.value[str]) {
console.log("customObjRef.value[str]222222", customObjRef.value[str]);
asideValue[key] = customObjRef.value[str] //
console.log('时间2222222222', asideValue[key])
}
else if (customObjRef.value[str]) {
console.log('customObjRef.value[str]222222', customObjRef.value[str])
// let list = customObjRef.value[str].split(',');
// console.log("list222222", list);
if (typeof customObjRef.value[str] == "string") {
customObjRef.value[str] = customObjRef.value[str].split(",");
asideValue[key] = customObjRef.value[str]; //
}else {
asideValue[key] = customObjRef.value[str]; //
if (typeof customObjRef.value[str] == 'string') {
customObjRef.value[str] = customObjRef.value[str].split(',')
asideValue[key] = customObjRef.value[str] //
}
} else {
asideValue[key] = null;
else {
asideValue[key] = customObjRef.value[str] //
}
}
else {
asideValue[key] = null
}
// asideMap[str].defaultValue = customObjRef.value[str];//
}
});
customTempObjRef.value = customObjRef.value;
console.log("asideValue直接处理后的结果", asideValue);
console.log("customTempObjRef.value", customTempObjRef.value);
let tempobj = cloneDeep(asideValue);
console.log("tempObj", tempobj);
finalStore.setAsideValue(tempobj);
})
customTempObjRef.value = customObjRef.value
console.log('asideValue直接处理后的结果', asideValue)
console.log('customTempObjRef.value', customTempObjRef.value)
const tempobj = cloneDeep(asideValue)
console.log('tempObj', tempobj)
finalStore.setAsideValue(tempobj)
}
// console.log("showKeys", showKeys);
const items = showKeys.reduce((acc, key) => {
const currentData = asideMap[key];
const render = currentData?.render;
const currentData = asideMap[key]
const render = currentData?.render
if (render !== false) {
const str = key?.toLowerCase();
const str = key?.toLowerCase()
const o = {
key: str,
config: asideMap[str],
};
return [...acc, o];
} else {
return acc;
}
return [...acc, o]
}
else {
return acc
}
}, []);
console.log("showItems=================================", items);
showItems.value = items;
configFilterRef.value = finalStore.getFilterConfig;
});
}, [])
console.log('showItems=================================', items)
showItems.value = items
configFilterRef.value = finalStore.getFilterConfig
})
})
watch(asideVisible, (newVal) => {
Object.keys(asideValue).forEach((key) => {
if (newVal[key] === false) asideValue[key] = asideMap[key].defaultValue;
});
});
if (newVal[key] === false)
asideValue[key] = asideMap[key].defaultValue
})
})
const asideEnter = ref(false);
const asideEnter = ref(false)
const showCollapse = computed(() => {
return collapse.value ? true : asideEnter.value;
});
return collapse.value ? true : asideEnter.value
})
const showSearch = ref(false);
const showSearch = ref(false)
function setShowSearch(value: boolean) {
showSearch.value = value;
if(!value){
showSearch.value = value
if (!value)
inputChange('')
}
}
// key
function scrollHandler(key: string) {
const element = document.querySelector(`#${key}`);
element?.scrollIntoView(true);
const element = document.querySelector(`#${key}`)
element?.scrollIntoView(true)
}
async function filterHandler(searchId: string) {
emitter.emit("filter-final", searchId);
const res = await getFilterList({ userSearchId: searchId });
emitter.emit('filter-final', searchId)
const res = await getFilterList({ userSearchId: searchId })
// console.log("", res);
if (res.code == "OK") {
let obj = res.data;
customObjRef.value = res.data;
let showKeys: any[] = [];
if (res.code == 'OK') {
const obj = res.data
customObjRef.value = res.data
const showKeys: any[] = []
Object.keys(obj).map((key) => {
if (asideMap.hasOwnProperty(key)) {
showKeys.push(key);
}
});
console.log("showKeys1111111111111111", showKeys);
finalStore.setCustomConfig(showKeys);
if (asideMap.hasOwnProperty(key))
showKeys.push(key)
})
console.log('showKeys1111111111111111', showKeys)
finalStore.setCustomConfig(showKeys)
}
}
function editFilter(filter: any) {
const modal = unref(newFilterModalRef)! as any;
modal.showModal();
modal.edit(filter);
const modal = unref(newFilterModalRef)! as any
modal.showModal()
modal.edit(filter)
}
// watch(asideValue, (newVal) => {
// finalStore.setAsideValue(newVal);
// });
const inputChange = (keyword) => {
emit("inputChange", keyword);
};
const handleOk = (item: any) => {
console.log("handleOk", item);
function inputChange(keyword) {
emit('inputChange', keyword)
}
function handleOk(item: any) {
console.log('handleOk', item)
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
filterHandler(item.id);
} else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选");
filterHandler("");
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname)
filterHandler(item.id)
}
};
else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced('高级筛选')
filterHandler('')
}
}
function updateComponent(key, e) {
console.log("跟新值", key, e);
console.log("tempAsideValue跟新值", finalStore.getAsideValue, asideValue);
console.log('跟新值', key, e)
console.log('tempAsideValue跟新值', finalStore.getAsideValue, asideValue)
// let tempAsideValue = finalStore.getAsideValue || asideValue;
let tempobj = cloneDeep(asideValue);
console.log(tempobj, "tempobj");
tempobj[key] = e;
console.log(tempobj, "tempobj After");
customObjRef.value = tempobj;
const tempobj = cloneDeep(asideValue)
console.log(tempobj, 'tempobj')
tempobj[key] = e
console.log(tempobj, 'tempobj After')
customObjRef.value = tempobj
// asideValue = Object.assign({}, asideValue, tempobj);
console.log("asideValue跟新值", tempobj);
finalStore.setAsideValue(tempobj);
console.log('asideValue跟新值', tempobj)
finalStore.setAsideValue(tempobj)
}
</script>
<template>
@ -343,18 +350,18 @@ function updateComponent(key, e) {
v-show="showSearch"
@select="scrollHandler"
@close="setShowSearch(false)"
@inputChange="inputChange"
@showSearch="setShowSearch(true)"
@input-change="inputChange"
@show-search="setShowSearch(true)"
/>
<!-- 高级筛选 -->
<AdvanceFilter
v-show="!showSearch"
ref="AdvanceFilterRef"
:type="1"
@select="filterHandler"
@update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)"
@show-filter="showModal(filterModalRef)"
ref="AdvanceFilterRef"
/>
</div>
@ -375,10 +382,10 @@ function updateComponent(key, e) {
ref="filterModalRef"
@edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)"
@handleOk="handleOk"
@handle-ok="handleOk"
/>
<!-- 新增过滤 -->
<NewFilterModal ref="newFilterModalRef" @onOk="newFilterOk" />
<NewFilterModal ref="newFilterModalRef" @on-ok="newFilterOk" />
</n-scrollbar>
</div>
</template>

@ -1,25 +1,23 @@
<script lang="ts" setup>
import { debounce, difference } from 'lodash-es'
import { computed, ref, watch, onMounted } from 'vue'
import { cloneDeep, debounce, difference, isEqual } from 'lodash-es'
import { computed, onMounted, ref, watch } from 'vue'
import { VueDraggable } from 'vue-draggable-plus'
import { setFilter } from '@/api/home/filter'
import { asideMap } from '@/config/final'
import { useFinal } from '@/store/modules/final'
import { cloneDeep, isEqual } from "lodash-es";
const show = ref(false)
const finalStore = useFinal()
const checkAll = ref(false)
const selectIds = ref<string[]>([])
const tempList = ref<string[]>([])
let extraCustomConfig :any = [];
const extraCustomConfig: any = []
Object.keys(asideMap).forEach((key) => {
const { isDefaultFilter } = asideMap[key];
if (isDefaultFilter) {
extraCustomConfig.push(key);
}
});
const { isDefaultFilter } = asideMap[key]
if (isDefaultFilter)
extraCustomConfig.push(key)
})
function showModal() {
show.value = true
@ -28,8 +26,8 @@ function showModal() {
const config = finalStore.getSystemConfig
const customConfig = finalStore.getCustomConfig
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',config, customConfig)
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',tempList.value, finalStore.getFilterConfig)
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------', config, customConfig)
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------', tempList.value, finalStore.getFilterConfig)
if (config == null || customConfig == null)
return
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
@ -37,7 +35,7 @@ function showModal() {
const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList)
console.log("tempList.value开启了lllllllllllllllllll", showList, hideList);
console.log('tempList.value开启了lllllllllllllllllll', showList, hideList)
if (tempList.value.length > 0)
finalStore.setFilterConfig(tempList.value)
@ -94,14 +92,13 @@ function generateDefaultList(config) {
function generatList(config, customConfig) {
const keys = Object.keys(config)
let onList: object[] = []
let offList: any = []
let showKeys = [];
const tempShowKeys = [...customConfig, ...extraCustomConfig];
tempShowKeys.map(item => {
if(!showKeys.includes(item)) {
showKeys.push(item);
}
});
const offList: any = []
const showKeys = []
const tempShowKeys = [...customConfig, ...extraCustomConfig]
tempShowKeys.map((item) => {
if (!showKeys.includes(item))
showKeys.push(item)
})
console.log('原始筛选条件showKeys', showKeys)
console.log('原始筛选条件config customConfig', config, customConfig)
// for (const key of keys) {
@ -125,22 +122,22 @@ function generatList(config, customConfig) {
// isChecked && selectIds.value.push(key)
// }
// }
Object.keys(asideMap).map(key => {
Object.keys(asideMap).map((key) => {
const name = asideMap[key]?.label
const isDefaultFilter = asideMap[key]?.isDefaultFilter
// Y
// if (!isDefaultFilter) {
const isChecked = asideMap[key].isDefaultFilter || showKeys.includes(key)
const isChecked = asideMap[key].isDefaultFilter || showKeys.includes(key)
offList.push({
id: key,
name: name || '未配置',
fix: isDefaultFilter,
checked: isChecked,
})
if (isChecked && !selectIds.value.includes(key))
isChecked && selectIds.value.push(key)
offList.push({
id: key,
name: name || '未配置',
fix: isDefaultFilter,
checked: isChecked,
})
if (isChecked && !selectIds.value.includes(key))
isChecked && selectIds.value.push(key)
// }
})
@ -173,7 +170,7 @@ function generatList(config, customConfig) {
const sortKeyList: any = []
finalStore.getFilterConfig.map((item: any) => {
console.log("tFilterConfig item000000000000000", item);
console.log('tFilterConfig item000000000000000', item)
sortKeyList.push(item.id)
})
console.log('原始筛选条件sortKeyList', sortKeyList)
@ -182,17 +179,15 @@ function generatList(config, customConfig) {
if (sortKeyList.length > 0) {
sortKeyList.map((key) => {
const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) {
if (tempItem)
sortList.push(tempItem)
}
})
}
else {
showKeys.map((key) => {
const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) {
if (tempItem)
sortList.push(tempItem)
}
})
}
console.log('原始筛选条件showList', sortList)
@ -240,9 +235,8 @@ async function handleSumbit(e: MouseEvent) {
const sortList: any = []
obj.map((key) => {
const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) {
if (tempItem)
sortList.push(tempItem)
}
})
console.log('finalStore.sortList提交---------------', sortList)
// setTimeout(() => {

@ -1,5 +1,6 @@
<script lang="ts" setup>
import {
computed,
defineOptions,
h,
nextTick,
@ -8,97 +9,98 @@ import {
reactive,
ref,
unref,
computed,
} from "vue";
import { NDataTable } from "naive-ui";
import type { DataTableColumns, DataTableRowKey } from "naive-ui";
import type { SortableEvent } from "sortablejs";
import Sortable from "sortablejs";
import { debounce } from "lodash-es";
import Action from "@/views/home/aside/comp/Action.vue";
import { deleteCondition, getConditionList, sort } from "@/api/home/filter";
import type { FilterSearchParam } from "/#/api";
} from 'vue'
import { NButton, NDataTable, useModal } from 'naive-ui'
import type { DataTableColumns, DataTableRowKey } from 'naive-ui'
import type { SortableEvent } from 'sortablejs'
import Sortable from 'sortablejs'
import { debounce } from 'lodash-es'
import Action from '@/views/home/aside/comp/Action.vue'
import { deleteCondition, getConditionList, sort } from '@/api/home/filter'
import type { FilterSearchParam } from '/#/api'
import SvgIcon from "@/components/Icon/SvgIcon.vue";
import SvgIcon from '@/components/Icon/SvgIcon.vue'
import { useModal, NButton } from "naive-ui";
const modal = useModal();
defineOptions({ name: "FilterModal" });
defineOptions({ name: 'FilterModal' })
const emit = defineEmits<{
(e: "showNewFilter"): void;
(e: "editFilter", filter: any): void;
}>();
(e: 'showNewFilter'): void
(e: 'editFilter', filter: any): void
}>()
const modal = useModal()
const show = ref(false);
const checkedRowKeys = ref([]);
const show = ref(false)
const checkedRowKeys = ref([])
const cardStyle = {
width: "800px",
height: "800px",
"--n-padding-bottom": "10px",
"--n-padding-left": "10px",
};
'width': '800px',
'height': '800px',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
}
interface RowData {
id: string;
searchname: string;
createby: string;
createtime: string;
updateby: string;
updatetime: string;
id: string
searchname: string
createby: string
createtime: string
updateby: string
updatetime: string
}
const columns: DataTableColumns<RowData> = [
{
type: "selection",
type: 'selection',
},
{
title: "操作",
key: "action",
title: '操作',
key: 'action',
render(row) {
return h(Action, {
options: [
{ label: "编辑", key: 1 },
{ label: "删除", key: 2 },
{ label: '编辑', key: 1 },
{ label: '删除', key: 2 },
],
id: row.id,
select,
});
})
},
},
{
title: "名称",
key: "searchname",
title: '名称',
key: 'searchname',
},
{
title: "创建者",
key: "createby",
title: '创建者',
key: 'createby',
},
{
title: "创建时间",
key: "createtime",
title: '创建时间',
key: 'createtime',
renderSorterIcon: ({ order }) => {
if (order === false) return h(SvgIcon, { name: "sort-2" });
if (order === "ascend") return h(SvgIcon, { name: "sort-1" });
if (order === "descend") return h(SvgIcon, { name: "sort-3" });
if (order === false)
return h(SvgIcon, { name: 'sort-2' })
if (order === 'ascend')
return h(SvgIcon, { name: 'sort-1' })
if (order === 'descend')
return h(SvgIcon, { name: 'sort-3' })
},
sorter: (row1, row2) =>
new Date(row1?.createtime).getTime() - new Date(row2?.createtime).getTime(),
},
{
title: "更新者",
key: "updateby",
title: '更新者',
key: 'updateby',
},
{
title: "更新时间",
key: "updatetime",
title: '更新时间',
key: 'updatetime',
},
];
]
const loading = ref(true);
const total = ref(0);
const loading = ref(true)
const total = ref(0)
const pagination = reactive({
page: 1,
pageCount: 1,
@ -106,220 +108,222 @@ const pagination = reactive({
showSizePicker: true,
pageSizes: [
{
label: "10 每页",
label: '10 每页',
value: 10,
},
{
label: "15 每页",
label: '15 每页',
value: 15,
},
{
label: "30 每页",
label: '30 每页',
value: 30,
},
{
label: "50 每页",
label: '50 每页',
value: 50,
},
],
showQuickJumper: true,
prefix: () => `${total.value} 条数据`,
});
const tableData = ref<Array<RowData>>([]);
const keyword = ref("");
})
const tableData = ref<Array<RowData>>([])
const keyword = ref('')
async function query(page: number, pageSize: number) {
const searchParam: FilterSearchParam = {
search_searchname: { value: keyword.value, op: "like", type: "string" },
};
const result = await getConditionList({ pageNo: page, pageSize }, searchParam, 1);
const { data, pageCount, total: totalCount } = result;
total.value = totalCount;
tableData.value = data;
pagination.page = page;
pagination.pageCount = pageCount;
loading.value = false;
search_searchname: { value: keyword.value, op: 'like', type: 'string' },
}
const result = await getConditionList({ pageNo: page, pageSize }, searchParam, 1)
const { data, pageCount, total: totalCount } = result
total.value = totalCount
tableData.value = data
pagination.page = page
pagination.pageCount = pageCount
loading.value = false
}
function afterLeave() {
pagination.page = 1;
pagination.pageCount = 1;
pagination.pageSize = 10;
pagination.page = 1
pagination.pageCount = 1
pagination.pageSize = 10
}
const selectionIds = ref<DataTableRowKey[]>([]);
const selectionIds = ref<DataTableRowKey[]>([])
const rowKey = (row: RowData) => row.id;
const rowKey = (row: RowData) => row.id
function rowProps(row: RowData) {
return {
"data-id": row.id,
};
'data-id': row.id,
}
}
function handleCheck(rowKeys: DataTableRowKey[]) {
selectionIds.value = rowKeys;
selectionIds.value = rowKeys
}
function select(key: number, id: string) {
switch (key) {
case 1:
editSelection(id);
break;
editSelection(id)
break
case 2:
const modalInst = modal.create({
title: "确认提示",
content: "确认删除该条过滤条件吗?",
positiveText: "确定",
negativeText: "取消",
preset: "dialog",
title: '确认提示',
content: '确认删除该条过滤条件吗?',
positiveText: '确定',
negativeText: '取消',
preset: 'dialog',
onPositiveClick: () => deleteSelection(id),
onNegativeClick: () => modalInst.destroy(),
});
})
break;
break
default:
break;
break
}
}
function editSelection(id = "") {
// eslint-disable-next-line dot-notation
function editSelection(id = '') {
// const $message = window["$message"];
// if (selectionIds.value.length === 0 || selectionIds.value.length > 1) {
// $message.error("");
// return;
// }
const selectedId = id;
const selectedId = id
const selectedFilter = tableData.value.find((item: any) => {
return item.id === selectedId;
});
return item.id === selectedId
})
emit("editFilter", selectedFilter);
closeModal();
emit('editFilter', selectedFilter)
closeModal()
}
function deleteSelection(id = "") {
// eslint-disable-next-line dot-notation
function deleteSelection(id = '') {
if (selectionIds.value.length === 0) {
deleteCondition({ ids: id }).then(() => {
query(pagination.page, pagination.pageSize);
});
return;
query(pagination.page, pagination.pageSize)
})
return
}
const modalInst = modal.create({
title: "确认提示",
content: "确认删除所选过滤条件吗?",
positiveText: "确定",
negativeText: "取消",
preset: "dialog",
title: '确认提示',
content: '确认删除所选过滤条件吗?',
positiveText: '确定',
negativeText: '取消',
preset: 'dialog',
onPositiveClick: () =>
deleteCondition({ ids: selectionIds.value.join(",") }).then(() => {
selectionIds.value = [];
query(pagination.page, pagination.pageSize);
deleteCondition({ ids: selectionIds.value.join(',') }).then(() => {
selectionIds.value = []
query(pagination.page, pagination.pageSize)
}),
onNegativeClick: () => modalInst.destroy(),
});
})
}
async function handlePageChange(currentPage) {
if (loading.value) return;
pagination.page = currentPage;
const { pageSize } = pagination;
await query(currentPage, pageSize);
if (loading.value)
return
pagination.page = currentPage
const { pageSize } = pagination
await query(currentPage, pageSize)
}
async function handlePageSizeChange(currentPageSize) {
if (loading.value) return;
if (loading.value)
return
const { page } = pagination;
pagination.pageSize = currentPageSize;
const { page } = pagination
pagination.pageSize = currentPageSize
await query(page, currentPageSize);
await query(page, currentPageSize)
}
function handleClick() {
emit("showNewFilter");
emit('showNewFilter')
// show.value = false;
closeModal();
closeModal()
}
let sortTable: Sortable | null = null;
const tableRef = ref<InstanceType<typeof NDataTable>>();
let sortTable: Sortable | null = null
const tableRef = ref<InstanceType<typeof NDataTable>>()
onMounted(() => {
nextTick(() => {
console.log(tableRef.value, "tableRef");
});
});
console.log(tableRef.value, 'tableRef')
})
})
async function showModal() {
show.value = true;
show.value = true
const { page, pageSize } = pagination;
await query(page, pageSize);
const { page, pageSize } = pagination
await query(page, pageSize)
nextTick(() => {
if (sortTable !== null) destory();
const el: HTMLDivElement = tableRef.value?.$el;
const tbody: HTMLElement | null = el.querySelector("tbody.n-data-table-tbody")!;
if (tbody) sortTable = Sortable.create(tbody, { onEnd, onMove });
});
if (sortTable !== null)
destory()
const el: HTMLDivElement = tableRef.value?.$el
const tbody: HTMLElement | null = el.querySelector('tbody.n-data-table-tbody')!
if (tbody)
sortTable = Sortable.create(tbody, { onEnd, onMove })
})
}
let relatedId = "";
let insertafter = false;
let relatedId = ''
let insertafter = false
// TODO: bug
function onEnd(event: SortableEvent) {
const data = unref(tableData);
const oldElem = data[event.oldIndex!];
data.splice(event.oldIndex!, 1);
data.splice(event.newIndex!, 0, oldElem);
const data = unref(tableData)
const oldElem = data[event.oldIndex!]
data.splice(event.oldIndex!, 1)
data.splice(event.newIndex!, 0, oldElem)
const dragId = oldElem.id;
const dragId = oldElem.id
const index = data.findIndex((item) => {
return item.id === relatedId;
});
return item.id === relatedId
})
// -1+1
const order = insertafter ? index - 1 : index + 1;
const order = insertafter ? index - 1 : index + 1
// console.log('dragid:', dragId, 'order:', order)
sort(dragId, order);
sort(dragId, order)
}
function onMove(evt: any) {
relatedId = evt.related?.dataset?.id;
insertafter = evt.willInsertAfter;
relatedId = evt.related?.dataset?.id
insertafter = evt.willInsertAfter
// console.log(`${evt.dragged.dataset.id},${evt.related}`, 'insertafter', evt.willInsertAfter)
}
function destory() {
sortTable && sortTable.destroy();
sortTable = null;
sortTable && sortTable.destroy()
sortTable = null
}
onUnmounted(() => {
destory();
});
destory()
})
function closeModal() {
show.value = false;
show.value = false
}
defineExpose({
showModal,
query,
pagination,
});
})
const inputHandler = debounce((word) => {
keyword.value = word;
query(1, 5);
}, 300);
keyword.value = word
query(1, 5)
}, 300)
const showSearch = computed(() => {
return selectionIds.value.length > 0;
});
return selectionIds.value.length > 0
})
</script>
<template>
@ -331,9 +335,9 @@ const showSearch = computed(() => {
v-model:show="show"
transform-origin="center"
display-directive="if"
@after-leave="afterLeave"
:mask-closable="false"
class="modal_wrapper"
@after-leave="afterLeave"
>
<n-card
:style="cardStyle"
@ -352,11 +356,10 @@ const showSearch = computed(() => {
'font-size': '16px',
'font-weight': '600',
}"
>基本信息</span
>
>基本信息</span>
</div>
</div>
<div class="wrapper-form" v-if="!showSearch">
<div v-if="!showSearch" class="wrapper-form">
<n-input
:style="{ width: '360px', border: '1px solid #cad2dd' }"
placeholder="请输入过滤条件名称搜索"
@ -366,31 +369,29 @@ const showSearch = computed(() => {
<SvgIcon size="14px" name="magnifying-1" />
</template>
</n-input>
<n-button type="info" @click="handleClick">
<NButton type="info" @click="handleClick">
创建
<template #icon>
<SvgIcon size="14px" name="creatFilter" />
</template>
</n-button>
</NButton>
</div>
<div class="wrapper-form" v-else>
<div v-else class="wrapper-form">
<div class="del_btn">
<n-button icon-placement="left" size="medium" @click="deleteSelection">
<NButton icon-placement="left" size="medium" @click="deleteSelection">
<template #icon>
<SvgIcon name="delete-history" size="16" />
</template>
删除</n-button
>
删除
</NButton>
</div>
<div class="msg">
<span
>已选中
<span>已选中
<span style="color: #507afd; font-size: 16px">{{
selectionIds.length
}}</span>
</span
>
</span>
<a @click="selectionIds = []">清空</a>
</div>
</div>
@ -405,19 +406,21 @@ const showSearch = computed(() => {
:loading="loading"
:pagination="pagination"
:row-key="rowKey"
:checked-row-keys="selectionIds"
@update:page="handlePageChange"
@update-page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck"
:checked-row-keys="selectionIds"
/>
</div>
</div>
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="closeModal"> </n-button>
<n-button secondary style="margin-left: 15px" @click="closeModal">
<NButton type="info" @click="closeModal">
确认
</NButton>
<NButton secondary style="margin-left: 15px" @click="closeModal">
取消
</n-button>
</NButton>
</div>
</template>
</n-card>

@ -1,188 +1,192 @@
<script lang="ts" setup>
import { reactive, ref, unref } from "vue";
import * as XLSX from "xlsx";
import { arrayEquals } from "@/utils/index";
import { generateUuid } from "@/utils/uuid";
import { reactive, ref, unref } from 'vue'
import * as XLSX from 'xlsx'
import { arrayEquals } from '@/utils/index'
import { generateUuid } from '@/utils/uuid'
const props = defineProps<{
onSuccess: Function;
headerConfig: string[];
}>();
onSuccess: Function
headerConfig: string[]
}>()
interface ExcelData {
header: string[] | null;
content: any[] | null;
header: string[] | null
content: any[] | null
}
interface ParseResults {
fileName: string;
results: any[];
uuid: string;
fileName: string
results: any[]
uuid: string
}
const cardStyle = {
width: "620px",
"--n-padding-bottom": "10px",
"--n-padding-left": "0px",
};
const inputRef = ref(null);
let loading = false;
const excelData: ExcelData = { header: null, content: null };
const excelDatas: ParseResults[] = reactive([]);
'width': '620px',
'--n-padding-bottom': '10px',
'--n-padding-left': '0px',
}
const inputRef = ref(null)
let loading = false
const excelData: ExcelData = { header: null, content: null }
const excelDatas: ParseResults[] = reactive([])
function generateData(content) {
excelData.header = props.headerConfig;
excelData.content = content;
props.onSuccess && props.onSuccess(excelData);
excelData.header = props.headerConfig
excelData.content = content
props.onSuccess && props.onSuccess(excelData)
}
function handleDrop(e) {
e.stopPropagation();
e.preventDefault();
if (loading) return;
const files = e.dataTransfer.files;
const rawFiles = Array.from(files);
e.stopPropagation()
e.preventDefault()
if (loading)
return
const files = e.dataTransfer.files
const rawFiles = Array.from(files)
// eslint-disable-next-line dot-notation
const $message = window["$message"];
const $message = window['$message']
if (!isExcel(rawFiles)) {
$message.error("Only supports upload .xlsx, .xls, .csv suffix files");
return false;
$message.error('Only supports upload .xlsx, .xls, .csv suffix files')
return false
}
uploadFiles(rawFiles);
e.stopPropagation();
e.preventDefault();
uploadFiles(rawFiles)
e.stopPropagation()
e.preventDefault()
}
async function uploadFiles(files) {
const inputEl: HTMLInputElement | null = unref(inputRef);
inputEl!.value = "";
const inputEl: HTMLInputElement | null = unref(inputRef)
inputEl!.value = ''
loading = true;
loading = true
for (const file of files) {
const fileData = await readFileData(file);
const message = validate(fileData);
const fileData = await readFileData(file)
const message = validate(fileData)
// TODO
if (message === undefined || true) {
const uuid = generateUuid();
const uuid = generateUuid()
excelDatas.push({
fileName: file.name,
results: (fileData as any).results,
uuid,
});
})
}
}
loading = false;
loading = false
}
function commitData() {
const mergeResults: any[] = [];
const mergeResults: any[] = []
if (excelDatas.length === 0) return;
if (excelDatas.length === 0)
return
excelDatas.forEach((item) => {
mergeResults.push(...item.results);
});
mergeResults.push(...item.results)
})
generateData(mergeResults);
generateData(mergeResults)
}
function validate(fileData) {
const { header } = fileData;
const { header } = fileData
//
const equal = arrayEquals(header, props.headerConfig);
const equal = arrayEquals(header, props.headerConfig)
if (!equal) return "表头不匹配";
if (!equal)
return '表头不匹配'
// TODO
}
function readFileData(file) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
const reader = new FileReader()
reader.onload = (e) => {
const data = e.target!.result;
const workbook = XLSX.read(data, { type: "array" });
const firstSheetName = workbook.SheetNames[0];
const worksheet = workbook.Sheets[firstSheetName];
const header = getHeaderRow(worksheet);
const results = XLSX.utils.sheet_to_json(worksheet);
resolve({ header, results });
};
reader.readAsArrayBuffer(file);
});
const data = e.target!.result
const workbook = XLSX.read(data, { type: 'array' })
const firstSheetName = workbook.SheetNames[0]
const worksheet = workbook.Sheets[firstSheetName]
const header = getHeaderRow(worksheet)
const results = XLSX.utils.sheet_to_json(worksheet)
resolve({ header, results })
}
reader.readAsArrayBuffer(file)
})
}
function handleDragover(e) {
e.stopPropagation();
e.preventDefault();
e.dataTransfer.dropEffect = "copy";
e.stopPropagation()
e.preventDefault()
e.dataTransfer.dropEffect = 'copy'
}
function handleUpload() {
(inputRef.value as any).click();
(inputRef.value as any).click()
}
function handleClick(e) {
const files = e.target.files;
const rawFiles = Array.from(files);
uploadFiles(rawFiles);
const files = e.target.files
const rawFiles = Array.from(files)
uploadFiles(rawFiles)
}
function getHeaderRow(sheet) {
const headers: string[] = [];
const range = XLSX.utils.decode_range(sheet["!ref"]);
let C;
const R = range.s.r;
const headers: string[] = []
const range = XLSX.utils.decode_range(sheet['!ref'])
let C
const R = range.s.r
/* start in the first row */
for (C = range.s.c; C <= range.e.c; ++C) {
/* walk every column in the range */
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })];
const cell = sheet[XLSX.utils.encode_cell({ c: C, r: R })]
/* find the cell in the first row */
let hdr = `UNKNOWN ${C}`; // <-- replace with your desired default
if (cell && cell.t) hdr = XLSX.utils.format_cell(cell);
headers.push(hdr);
let hdr = `UNKNOWN ${C}` // <-- replace with your desired default
if (cell && cell.t)
hdr = XLSX.utils.format_cell(cell)
headers.push(hdr)
}
return headers;
return headers
}
function isExcel(files) {
return files.every((file) => {
return /\.(xlsx|xls|csv)$/.test(file.name);
});
return /\.(xlsx|xls|csv)$/.test(file.name)
})
}
const show = ref(false);
const show = ref(false)
function showModal() {
show.value = true;
show.value = true
}
function closeModal() {
show.value = false;
show.value = false
}
async function handleSumbit(e: MouseEvent) {
e.preventDefault();
commitData();
closeModal();
e.preventDefault()
commitData()
closeModal()
}
defineExpose({
showModal,
});
})
function removeHandler(id: string) {
const index = excelDatas.findIndex((item) => item.uuid === id);
excelDatas.splice(index, 1);
const index = excelDatas.findIndex(item => item.uuid === id)
excelDatas.splice(index, 1)
}
function afterLeave() {
excelDatas.length = 0;
excelDatas.length = 0
}
</script>
@ -218,7 +222,7 @@ function afterLeave() {
type="file"
accept=".xlsx, .xls,.csv"
@change="handleClick"
/>
>
<SvgIcon
style="margin-top: 32px; margin-bottom: 13px"
size="45"
@ -226,9 +230,7 @@ function afterLeave() {
@click="handleUpload"
/>
<span class="wrapper-tip1">点击或拖拽审批文件到这里上传</span>
<span style="margin-top: 3px; margin-bottom: 19px" class="wrapper-tip2"
>支持上传格式.xls .xlsx .csv的文件</span
>
<span style="margin-top: 3px; margin-bottom: 19px" class="wrapper-tip2">支持上传格式.xls .xlsx .csv的文件</span>
</div>
<div
v-for="(item, index) in excelDatas"
@ -249,7 +251,9 @@ function afterLeave() {
</div>
<template #footer>
<div class="footer">
<n-button type="info" @click="handleSumbit"> </n-button>
<n-button type="info" @click="handleSumbit">
确认
</n-button>
</div>
</template>
</n-card>

@ -1,108 +1,108 @@
<script lang="ts" setup>
import type { FormInst, FormItemRule, FormRules } from "naive-ui";
import { computed, onBeforeMount, reactive, ref, unref, watch, defineEmits } from "vue";
import { asideMap } from "@/config/final";
import { useDictionary } from "@/store/modules/dictonary";
import { useConfig } from "@/store/modules/asideConfig";
import type { FilterCondition } from "/#/api";
import { addCondition, updateCondition } from "@/api/home/filter";
import { formatToDate2, formatToDate3 } from "@/utils/dateUtil";
type Status = "edit" | "new";
const emit = defineEmits(["onOk"]);
const show = ref(false);
const configStore = useConfig();
const dicStore = useDictionary();
const currentStatus = ref<Status>("new");
let currentEditId: string | null = null;
import type { FormInst, FormItemRule, FormRules } from 'naive-ui'
import { computed, defineEmits, onBeforeMount, reactive, ref, unref, watch } from 'vue'
import { asideMap } from '@/config/final'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import type { FilterCondition } from '/#/api'
import { addCondition, updateCondition } from '@/api/home/filter'
import { formatToDate2, formatToDate3 } from '@/utils/dateUtil'
type Status = 'edit' | 'new'
const emit = defineEmits(['onOk'])
const show = ref(false)
const configStore = useConfig()
const dicStore = useDictionary()
const currentStatus = ref<Status>('new')
let currentEditId: string | null = null
const modalTitle = computed(() => {
return currentStatus.value === "new" ? "新建过滤条件" : "编辑过滤条件";
});
return currentStatus.value === 'new' ? '新建过滤条件' : '编辑过滤条件'
})
const cardStyle = {
width: "800px",
"--n-padding-bottom": "10px",
"--n-padding-left": "10px",
};
'width': '800px',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
}
const noBorderInput = {
"--n-border": "0px",
"--n-border-hover": "0px",
"--n-border-pressed": "0px",
};
'--n-border': '0px',
'--n-border-hover': '0px',
'--n-border-pressed': '0px',
}
const formItemStyle = {
"--n-label-height": "0px",
"--n-feedback-height": "8px",
};
'--n-label-height': '0px',
'--n-feedback-height': '8px',
}
interface FormType {
name: string | null;
logic: string | null;
conditions: Condition[];
name: string | null
logic: string | null
conditions: Condition[]
}
interface Condition {
type: string | null;
operator: string | null;
result: any;
type: string | null
operator: string | null
result: any
}
interface Option {
label: string;
value: string;
label: string
value: string
}
const rules: FormRules = {
name: {
required: true,
message: "请输入过滤条件名称",
trigger: "blur",
message: '请输入过滤条件名称',
trigger: 'blur',
},
logic: {
required: true,
message: "请选择逻辑关系",
trigger: "blur",
message: '请选择逻辑关系',
trigger: 'blur',
},
conditions: {
required: true,
validator(rule: FormItemRule, value: Condition[]) {
for (const item of value) {
const { type, operator, result } = item;
const { type, operator, result } = item
if (type === null || operator === null || result === null)
return new Error("请选择过滤条件");
return new Error('请选择过滤条件')
}
return true;
return true
},
trigger: ["input", "blur"],
trigger: ['input', 'blur'],
},
};
}
const formRef = ref<FormInst | null>(null);
const formRef = ref<FormInst | null>(null)
const formValue = reactive<FormType>({
name: null,
logic: "and",
logic: 'and',
conditions: [
{
type: null,
operator: "eq",
operator: 'eq',
result: null,
},
],
});
})
function handleSumbit(e: MouseEvent) {
e.preventDefault();
e.preventDefault()
formRef.value?.validate((errors) => {
if (errors) return;
if (errors)
return
const list = formValue.conditions.map((item, index) => {
const { type, operator, result } = item;
const { type, operator, result } = item
return {
searchfield: type!,
@ -110,164 +110,165 @@ function handleSumbit(e: MouseEvent) {
searchvalue: formatValue(type!, result),
searchRelationType: formValue.logic!,
orderNum: index + 1,
};
});
}
})
const param: FilterCondition = {
searchname: formValue.name!,
type: 1,
ocrUsersearchchildList: list,
};
}
if (currentStatus.value === "new") addCondition(param);
else updateCondition({ id: currentEditId!, ...param });
closeModal();
});
if (currentStatus.value === 'new')
addCondition(param)
else updateCondition({ id: currentEditId!, ...param })
closeModal()
})
}
function formatValue(searchfield: string, searchvalue: any) {
if (searchfield === "izyear") {
const start = formatToDate2(searchvalue[0]);
const end = formatToDate2(searchvalue[1]);
return `${start}-${end}`;
if (searchfield === 'izyear') {
const start = formatToDate2(searchvalue[0])
const end = formatToDate2(searchvalue[1])
return `${start}-${end}`
}
return searchvalue;
return searchvalue
}
//
function unformatValue(searchfield: string, searchvalue: any) {
// 2022/01/03-2023/02/04
if (searchfield === "izyear") {
const dataStrs = searchvalue.split("-");
const start = formatToDate3(dataStrs[0]);
const end = formatToDate3(dataStrs[1]);
return [start, end];
if (searchfield === 'izyear') {
const dataStrs = searchvalue.split('-')
const start = formatToDate3(dataStrs[0])
const end = formatToDate3(dataStrs[1])
return [start, end]
}
return searchvalue;
return searchvalue
}
function createCondition() {
formValue.conditions.push({
type: null,
operator: "eq",
operator: 'eq',
result: null,
});
})
}
function removeCondition(index: number) {
formValue.conditions.splice(index, 1);
formValue.conditions.splice(index, 1)
}
function formLabel(index: number) {
return index === 0 ? "筛选条件" : "";
return index === 0 ? '筛选条件' : ''
}
const typeOptions = ref<Option[]>([]);
const typeOptions = ref<Option[]>([])
const operatorOptions = [
{
label: "等于",
value: "eq",
label: '等于',
value: 'eq',
},
{
label: "不等于",
value: "notEq",
label: '不等于',
value: 'notEq',
},
];
]
const logicOptions = ref([]);
const logicOptions = ref([])
onBeforeMount(() => {
dicStore.fetchRelationTypeList();
});
dicStore.fetchRelationTypeList()
})
watch(
() => dicStore.relationTypeList,
(newval) => {
logicOptions.value = newval;
}
);
logicOptions.value = newval
},
)
function showModal() {
show.value = true;
show.value = true
}
function closeModal() {
emit("onOk");
emit('onOk')
setTimeout(() => {
show.value = false;
}, 300);
show.value = false
}, 300)
}
function generateAllData(): Option[] {
const initVal: Option[] = [];
const initVal: Option[] = []
const list = Object.keys(asideMap).reduce((acc, value) => {
if (value.startsWith("iz") && asideMap[value]?.inFilterList !== false) {
const name = asideMap[value]?.label;
name &&
acc.push({
value,
label: name || "未配置",
});
if (value.startsWith('iz') && asideMap[value]?.inFilterList !== false) {
const name = asideMap[value]?.label
name
&& acc.push({
value,
label: name || '未配置',
})
}
return acc;
}, initVal);
return acc
}, initVal)
return list;
return list
}
typeOptions.value = generateAllData();
typeOptions.value = generateAllData()
function getOptions(key: string) {
const getterName = `get${key}`;
const options = unref(dicStore[getterName]);
return options || [];
const getterName = `get${key}`
const options = unref(dicStore[getterName])
return options || []
}
function leaveHandler() {
currentStatus.value = "new";
currentEditId = null;
currentStatus.value = 'new'
currentEditId = null
formValue.name = null;
formValue.name = null
formValue.conditions = [
{
type: null,
operator: "eq",
operator: 'eq',
result: null,
},
];
]
}
function edit(editFilter: any) {
currentStatus.value = "edit";
currentStatus.value = 'edit'
const { searchname, ocrUsersearchchildList, id } = editFilter;
currentEditId = id;
formValue.name = searchname;
const { searchname, ocrUsersearchchildList, id } = editFilter
currentEditId = id
formValue.name = searchname
formValue.conditions = ocrUsersearchchildList.map((item) => {
return {
type: item.searchfield,
operator: item.searchtype,
result: unformatValue(item.searchfield, item.searchvalue),
};
});
}
})
}
defineExpose({
showModal,
edit,
});
})
</script>
<template>
<n-modal
v-model:show="show"
transform-origin="center"
@after-leave="leaveHandler"
:mask-closable="false"
@after-leave="leaveHandler"
>
<n-card
:style="cardStyle"
@ -286,8 +287,7 @@ defineExpose({
'font-size': '16px',
'font-weight': '600',
}"
>基本信息</span
>
>基本信息</span>
</div>
</div>
<div class="wrapper-form">
@ -296,14 +296,14 @@ defineExpose({
<n-input
v-model:value="formValue.name"
:style="{ width: '780px' }"
@keydown.enter.prevent
placeholder="请输入过滤名称"
@keydown.enter.prevent
/>
</n-form-item>
<n-form-item path="logic" label="逻辑关系" v-show="false">
<n-form-item v-show="false" path="logic" label="逻辑关系">
<n-select
filterable
v-model:value="formValue.logic"
filterable
placeholder="请选择逻辑关系"
:options="logicOptions"
/>
@ -316,15 +316,15 @@ defineExpose({
:label="formLabel(index)"
>
<n-select
filterable
v-model:value="item.type"
filterable
placeholder="请选择筛选项名称"
:options="typeOptions"
@change="item.result = ''"
/>
<n-select
filterable
v-model:value="item.operator"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
@ -338,9 +338,9 @@ defineExpose({
/>
</n-space>
<n-select
filterable
v-else
v-model:value="item.result"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
@ -364,7 +364,9 @@ defineExpose({
</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>

@ -78,11 +78,11 @@ onBeforeMount(async () => {
</div>
<div class="wrapper-content">
<span>处理方式</span>
<n-select filterable v-model:value="selectBackId" style="margin-top: 10px;" :options="backOptions" />
<n-select v-model:value="selectBackId" filterable style="margin-top: 10px;" :options="backOptions" />
</div>
<div class="wrapper-content">
<span>不通过原因</span>
<n-select filterable v-model:value="selectRejectId" style="margin-top: 10px;" :options="reasonOptions" />
<n-select v-model:value="selectRejectId" filterable style="margin-top: 10px;" :options="reasonOptions" />
<n-input v-show="showOther" v-model:value="otherValue" type="textarea" placeholder="备注内容" style="margin-top: 10px;" />
</div>
</div>

@ -1,4 +1,5 @@
<script lang="ts" setup>
import console from 'node:console'
import type { DataTableColumns, DataTableRowKey, PaginationProps } from 'naive-ui'
import { NButton, NDataTable, useDialog, useMessage } from 'naive-ui'
import {
@ -41,9 +42,6 @@ import emitter from '@/utils/mitt'
import { formatToDateHMS } from '@/utils/dateUtil'
import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
import DataHeader from '@/components/DataHeader/index.vue'
import console from 'console'
const emit = defineEmits(['changeShow'])
function changeContent() {
@ -861,9 +859,9 @@ async function refreshHandler(searchId?: any) {
function filterTableData(keyword) {
pagination.page = 1
pagination.pageSize = 10
if (keyword) {
if (keyword)
query(pagination.page, pagination.pageSize, '', keyword)
} else { query(pagination.page, pagination.pageSize) }
else query(pagination.page, pagination.pageSize)
}
defineExpose({
@ -898,14 +896,18 @@ defineExpose({
取消
</NButton>
<img class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt=""
@click.stop="batchReject">
<img
class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt=""
@click.stop="batchReject"
>
<SvgIcon size="24" name="vs" />
<img class="btn-approval" src="@/assets/images/task/btn-pass.png" alt="" @click.stop="batchApproval">
</div>
<n-popover ref="popover" :style="{ padding: '0px' }" style="width: 148px" :show-arrow="false"
placement="bottom-start" trigger="click">
<n-popover
ref="popover" :style="{ padding: '0px' }" style="width: 148px" :show-arrow="false"
placement="bottom-start" trigger="click"
>
<template #trigger>
<div class="icon-wrap">
<SvgIcon size="20" name="more-blue" />
@ -948,10 +950,12 @@ defineExpose({
<SvgIcon style="cursor: pointer" size="18" name="column" @click="showModal(customTabelRef)" />
</div>
<div class="wrapper-content">
<NDataTable id="table" ref="tableRef" v-model:checked-row-keys="checkedRowKeys" remote :columns="columnsRef"
<NDataTable
id="table" ref="tableRef" v-model:checked-row-keys="checkedRowKeys" remote :columns="columnsRef"
:scroll-x="scrollX" :max-height="maxHeight" :data="tableData" :loading="loading" :pagination="pagination"
:row-key="rowKey" @update:page="handlePageChange" @update-page-size="handlePageSizeChange"
@update:checked-row-keys="handleCheck" @update:sorter="handleSorterChange" />
@update:checked-row-keys="handleCheck" @update:sorter="handleSorterChange"
/>
</div>
<CustomTabelModal ref="customTabelRef" @commit="commitHandler" />

@ -1,36 +1,36 @@
<script lang="ts" setup>
import { onMounted, ref } from "vue";
import testImg from "@/assets/images/test.png";
import {chunk} from 'lodash-es'
import { onMounted, ref } from 'vue'
import { chunk } from 'lodash-es'
import testImg from '@/assets/images/test.png'
const emit = defineEmits(["changeShow"]);
const emit = defineEmits(['changeShow'])
function changeContent() {
emit("changeShow");
emit('changeShow')
}
function initRem() {
const designWidth = 1440
const rempPx = 16
const scale = window.innerWidth / designWidth
document.documentElement.style.fontSize = `${scale * rempPx}px`
}
const initRem = () => {
const designWidth = 1440;
const rempPx = 16;
const scale = window.innerWidth / designWidth;
document.documentElement.style.fontSize = scale * rempPx + "px";
};
onMounted(() => {
initRem();
});
initRem()
})
const item = {
img: testImg,
checked: false,
title: "YP4567890545",
date: "2023-12-19 12:09:18",
};
const data = ref<any[]>([]);
title: 'YP4567890545',
date: '2023-12-19 12:09:18',
}
const data = ref<any[]>([])
onMounted(() => {
for (let i = 0; i < 8; i++) {
data.value.push(item as any);
}
data.value = chunk(data.value,4)
});
for (let i = 0; i < 8; i++)
data.value.push(item as any)
data.value = chunk(data.value, 4)
})
</script>
<template>
@ -48,11 +48,11 @@ onMounted(() => {
</div>
<div class="header_data">
<DataHeader :hasColor="true" />
<DataHeader :has-color="true" />
</div>
<div class="data_wrapper" v-for="(sitem,sindex) in data" :key="sindex">
<div class="item" v-for="(item, index) in sitem" :key="index">
<div v-for="(sitem, sindex) in data" :key="sindex" class="data_wrapper">
<div v-for="(item, index) in sitem" :key="index" class="item">
<div class="top">
<div
class="img"
@ -61,13 +61,17 @@ onMounted(() => {
<!-- <div class="check_box"><n-checkbox size="medium" label=" " /></div> -->
</div>
<div class="content">
<div class="title">任务ID{{ item.title }}</div>
<div class="date">{{ item.date }}</div>
<div class="title">
任务ID{{ item.title }}
</div>
<div class="date">
{{ item.date }}
</div>
<div class="tag_box">
<div
class="tag_item"
v-for="index in 2"
:key="index"
class="tag_item"
:style="index == 2 ? 'color:#02C984' : 'color:#507AFD'"
>
{{ index == 1 ? "待确认" : "张思" }}
@ -76,8 +80,12 @@ onMounted(() => {
</div>
</div>
<div class="bottom">
<div class="resovle_action">通过</div>
<div class="reject_action">不通过</div>
<div class="resovle_action">
通过
</div>
<div class="reject_action">
不通过
</div>
</div>
</div>
</div>

@ -5,7 +5,6 @@ import Content from './content/Content.vue'
import ListContent from './content/ListContent.vue'
import Robot from '@/components/Robot/index.vue'
defineOptions({
name: 'FinalMain',
})

@ -10,263 +10,268 @@ import {
shallowRef,
unref,
watch,
} from "vue";
import { CustomFilterModalVue, FilterModalVue, NewFilterModalVue } from "./comp/modals";
import Search from "./comp/Search.vue";
import AdvanceFilter from "./comp/AdvanceFilter.vue";
import { getViewportOffset } from "@/utils/domUtils";
import { useWindowSizeFn } from "@/hooks/event/useWindowSizeFn";
import { useConfig } from "@/store/modules/asideConfig";
import type { Filter } from "/#/home";
import type { AsideEntity } from "@/config/aside";
import { asideMap } from "@/config/aside";
import type { AsideConfig } from "/#/api";
import emitter from "@/utils/mitt";
import { getFilterList } from "@/api/home/main";
import dayjs from "dayjs";
import { cloneDeep, isEqual } from "lodash-es";
const configStore = useConfig();
} from 'vue'
import dayjs from 'dayjs'
import { cloneDeep, isEqual } from 'lodash-es'
import { CustomFilterModalVue, FilterModalVue, NewFilterModalVue } from './comp/modals'
import Search from './comp/Search.vue'
import AdvanceFilter from './comp/AdvanceFilter.vue'
import { getViewportOffset } from '@/utils/domUtils'
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useConfig } from '@/store/modules/asideConfig'
import type { Filter } from '/#/home'
import type { AsideEntity } from '@/config/aside'
import { asideMap } from '@/config/aside'
import type { AsideConfig } from '/#/api'
import emitter from '@/utils/mitt'
import { getFilterList } from '@/api/home/main'
const configStore = useConfig()
//
let asideValue: Record<keyof typeof asideMap, any> = reactive({});
const asideValue: Record<keyof typeof asideMap, any> = reactive({})
// :
const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({});
const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({})
//
const showItems = shallowRef<{ key: string; config: AsideEntity }[]>([]);
const showItems = shallowRef<{ key: string, config: AsideEntity }[]>([])
Object.keys(asideMap).forEach((key) => {
const entity = asideMap[key];
const { defaultValue } = entity;
asideValue[key] = defaultValue;
});
const filterModalRef: any = ref(null);
const newFilterModalRef = ref(null);
const customModalRef = ref(null);
const customObjRef = ref<any>(null); //
const customTempObjRef = ref<any>(null); // ()
const configFilterRef = ref<any>([]); //
const AdvanceFilterRef: any = ref(null);
const entity = asideMap[key]
const { defaultValue } = entity
asideValue[key] = defaultValue
})
const filterModalRef: any = ref(null)
const newFilterModalRef = ref(null)
const customModalRef = ref(null)
const customObjRef = ref<any>(null) //
const customTempObjRef = ref<any>(null) // ()
const configFilterRef = ref<any>([]) //
const AdvanceFilterRef: any = ref(null)
function showModal(modalRef: any) {
const modal = unref(modalRef)! as any;
modal.showModal();
const modal = unref(modalRef)! as any
modal.showModal()
}
onMounted(() => {
nextTick(() => {
computeSlideHeight();
let tempAsideValue = cloneDeep(asideValue);
computeSlideHeight()
const tempAsideValue = cloneDeep(asideValue)
// configStore.setAsideValue(tempAsideValue);
console.log("asideMap和asideValue", tempAsideValue);
});
});
console.log('asideMap和asideValue', tempAsideValue)
})
})
const collapse = ref(false);
const mousetrap = inject("mousetrap") as any;
mousetrap.bind("[", collapseHandler);
const collapse = ref(false)
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
function collapseHandler() {
collapse.value = !collapse.value;
collapse.value = !collapse.value
}
const asideWidth = computed(() => {
return collapse.value ? 0 : 308;
});
return collapse.value ? 0 : 308
})
const asideHeight = ref(500);
const asideHeight = ref(500)
const asideStyle = computed(() => {
return {
width: `${asideWidth.value}px`,
height: `${asideHeight.value}px`,
};
});
}
})
const collapseIcon = computed(() => {
return collapse.value ? "expand-cir" : "collapse-cir";
});
return collapse.value ? 'expand-cir' : 'collapse-cir'
})
function computeSlideHeight() {
const headEl = document.querySelector(".aside-header")!;
const { bottomIncludeBody } = getViewportOffset(headEl);
const height = bottomIncludeBody;
asideHeight.value = height - 24;
const headEl = document.querySelector('.aside-header')!
const { bottomIncludeBody } = getViewportOffset(headEl)
const height = bottomIncludeBody
asideHeight.value = height - 24
}
useWindowSizeFn(computeSlideHeight, 280);
useWindowSizeFn(computeSlideHeight, 280)
onBeforeMount(async () => {
configStore.fetchConfig();
configStore.fetchCustomConfig();
});
configStore.fetchConfig()
configStore.fetchCustomConfig()
})
nextTick(()=>{
nextTick(() => {
configStore.$subscribe(() => {
const config = configStore.getConfig;
const customConfig = configStore.getCustomConfig;
if (
configFilterRef.value.length > 0 &&
isEqual(configFilterRef.value, configStore.getFilterConfig) &&
customObjRef.value &&
isEqual(customObjRef.value, customTempObjRef.value)
) {
return;
}
if (config == null || customConfig == null) return;
// console.log("config", config, "customConfig", customConfig);
/* rao
const config = configStore.getConfig
const customConfig = configStore.getCustomConfig
if (
configFilterRef.value.length > 0
&& isEqual(configFilterRef.value, configStore.getFilterConfig)
&& customObjRef.value
&& isEqual(customObjRef.value, customTempObjRef.value)
)
return
if (config == null || customConfig == null)
return
// console.log("config", config, "customConfig", customConfig);
/* rao
const showKeys = [...customConfig].filter(key => !asideMap[key].isDefaultFilter)// customConfig isDefaultFilter
const defaultKeys = Object.keys(asideMap).filter(key => asideMap[key].isDefaultFilter)// asideMap isDefaultFilter
showKeys.unshift(...defaultKeys)
*/
let sortKeyList: any = [];
configStore.getFilterConfig.map((item: any) => {
sortKeyList.push(item?.id);
});
const showKeys = [...sortKeyList];
Object.keys(config).forEach((key) => {
if (key.startsWith("iz") && asideMap[key] !== undefined)
asideVisible[key] =
(showKeys.includes(key) || asideMap[key].isDefaultFilter) && config[key] === "Y";
});
if (customObjRef.value) {
const sortKeyList: any = []
configStore.getFilterConfig.map((item: any) => {
sortKeyList.push(item?.id)
})
const showKeys = [...sortKeyList]
Object.keys(config).forEach((key) => {
if (key.startsWith('iz') && asideMap[key] !== undefined) {
asideVisible[key]
= (showKeys.includes(key) || asideMap[key].isDefaultFilter) && config[key] === 'Y'
}
})
if (customObjRef.value) {
//
Object.keys(customObjRef.value).map((key) => {
if (asideMap.hasOwnProperty(key)) {
const str = key.toLowerCase();
// console.log("customObjRef.value[str]1111111111111", customObjRef.value[str]);
if (str == "izsimilarity") {
if (typeof customObjRef.value[str] == "string") {
customObjRef.value[str] = customObjRef.value[str].split(",");
Object.keys(customObjRef.value).map((key) => {
if (asideMap.hasOwnProperty(key)) {
const str = key.toLowerCase()
// console.log("customObjRef.value[str]1111111111111", customObjRef.value[str]);
if (str == 'izsimilarity') {
if (typeof customObjRef.value[str] == 'string')
customObjRef.value[str] = customObjRef.value[str].split(',')
asideValue[key] = customObjRef.value[str] //
console.log('相似度2222222222', asideValue[key])
}
asideValue[key] = customObjRef.value[str]; //
console.log("相似度2222222222", asideValue[key]);
} else if (str == "izyear") {
if (typeof customObjRef.value[str] == "string") {
let time = customObjRef.value[str].split("-");
time[0] = new Date(time[0]).getTime();
time[1] = new Date(time[1]).getTime();
customObjRef.value[str] = time;
else if (str == 'izyear') {
if (typeof customObjRef.value[str] == 'string') {
const time = customObjRef.value[str].split('-')
time[0] = new Date(time[0]).getTime()
time[1] = new Date(time[1]).getTime()
customObjRef.value[str] = time
}
asideValue[key] = customObjRef.value[str] //
console.log('时间2222222222', asideValue[key])
}
else if (str != 'izsimilarity' && str != 'izyear' && customObjRef.value[str]) {
console.log('customObjRef.value[str]222222', customObjRef.value[str])
// let list = customObjRef.value[str].split(',');
// console.log("list222222", list);
asideValue[key] = customObjRef.value[str] //
}
else {
asideValue[key] = null
}
asideValue[key] = customObjRef.value[str]; //
console.log("时间2222222222", asideValue[key]);
} else if (str != "izsimilarity" && str != "izyear" && customObjRef.value[str]) {
console.log("customObjRef.value[str]222222", customObjRef.value[str]);
// let list = customObjRef.value[str].split(',');
// console.log("list222222", list);
asideValue[key] = customObjRef.value[str]; //
} else {
asideValue[key] = null;
}
// asideMap[str].defaultValue = customObjRef.value[str];//
}
});
customTempObjRef.value = customObjRef.value;
console.log("asideValue直接处理后的结果", asideValue);
console.log("customTempObjRef.value", customTempObjRef.value);
let tempobj = cloneDeep(asideValue);
console.log("tempObj", tempobj);
configStore.setAsideValue(tempobj);
}
// console.log("showKeys", showKeys);
const items = showKeys.reduce((acc, key) => {
const currentData = asideMap[key];
const render = currentData?.render;
if (render !== false) {
const str = key?.toLowerCase();
const o = {
key: str,
config: asideMap[str],
};
return [...acc, o];
} else {
return acc;
}
})
customTempObjRef.value = customObjRef.value
console.log('asideValue直接处理后的结果', asideValue)
console.log('customTempObjRef.value', customTempObjRef.value)
const tempobj = cloneDeep(asideValue)
console.log('tempObj', tempobj)
configStore.setAsideValue(tempobj)
}
}, []);
console.log("showItems=================================", items);
showItems.value = items;
configFilterRef.value = configStore.getFilterConfig;
});
// console.log("showKeys", showKeys);
const items = showKeys.reduce((acc, key) => {
const currentData = asideMap[key]
const render = currentData?.render
if (render !== false) {
const str = key?.toLowerCase()
const o = {
key: str,
config: asideMap[str],
}
return [...acc, o]
}
else {
return acc
}
}, [])
console.log('showItems=================================', items)
showItems.value = items
configFilterRef.value = configStore.getFilterConfig
})
})
const asideEnter = ref(false);
const asideEnter = ref(false)
const showCollapse = computed(() => {
return collapse.value ? true : asideEnter.value;
});
return collapse.value ? true : asideEnter.value
})
const showSearch = ref(false);
const showSearch = ref(false)
function setShowSearch(value: boolean) {
showSearch.value = value;
showSearch.value = value
}
const newFilterOk = () => {
function newFilterOk() {
filterModalRef.value.query(
filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize
);
filterModalRef.value.showModal();
};
filterModalRef.value.pagination.pageSize,
)
filterModalRef.value.showModal()
}
// key
function scrollHandler(key: string) {
const element = document.querySelector(`#${key}`);
element?.scrollIntoView(true);
const element = document.querySelector(`#${key}`)
element?.scrollIntoView(true)
}
// ->
async function filterHandler(searchId: string) {
// emitter.emit('filter', searchId)
const res = await getFilterList({ userSearchId: searchId });
const res = await getFilterList({ userSearchId: searchId })
// console.log("", res);
if (res.code == "OK") {
let obj = res.data;
customObjRef.value = res.data;
let showKeys: any[] = [];
if (res.code == 'OK') {
const obj = res.data
customObjRef.value = res.data
const showKeys: any[] = []
Object.keys(obj).map((key) => {
if (asideMap.hasOwnProperty(key)) {
showKeys.push(key);
}
});
if (asideMap.hasOwnProperty(key))
showKeys.push(key)
})
// console.log(showKeys);
configStore.setCustomConfig(showKeys);
configStore.setCustomConfig(showKeys)
}
}
function editFilter(filter: any) {
const modal = unref(newFilterModalRef)! as any;
modal.showModal();
modal.edit(filter);
const modal = unref(newFilterModalRef)! as any
modal.showModal()
modal.edit(filter)
}
function updateComponent(key, e) {
console.log("跟新值", key, e);
console.log("tempAsideValue跟新值", configStore.getAsideValue, asideValue);
console.log('跟新值', key, e)
console.log('tempAsideValue跟新值', configStore.getAsideValue, asideValue)
// let tempAsideValue = configStore.getAsideValue || asideValue;
let tempobj = cloneDeep(asideValue);
console.log(tempobj, "tempobj");
tempobj[key] = e;
console.log(tempobj, "tempobj After");
customObjRef.value = tempobj;
const tempobj = cloneDeep(asideValue)
console.log(tempobj, 'tempobj')
tempobj[key] = e
console.log(tempobj, 'tempobj After')
customObjRef.value = tempobj
// asideValue = Object.assign({}, asideValue, tempobj);
console.log("asideValue跟新值", tempobj);
configStore.setAsideValue(tempobj);
console.log('asideValue跟新值', tempobj)
configStore.setAsideValue(tempobj)
}
const handleOk = (item: any) => {
console.log("handleOk", item);
function handleOk(item: any) {
console.log('handleOk', item)
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
filterHandler(item.id);
} else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选");
filterHandler("");
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname)
filterHandler(item.id)
}
else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced('高级筛选')
filterHandler('')
}
};
}
// watch(asideValue, (newVal) => {
// console.log("asideValue", newVal);
@ -297,12 +302,12 @@ const handleOk = (item: any) => {
<!-- 高级筛选 -->
<AdvanceFilter
v-show="!showSearch"
ref="AdvanceFilterRef"
:type="0"
@select="filterHandler"
@update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)"
@show-filter="showModal(filterModalRef)"
ref="AdvanceFilterRef"
/>
</div>
@ -321,10 +326,10 @@ const handleOk = (item: any) => {
ref="filterModalRef"
@edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)"
@handleOk="handleOk"
@handle-ok="handleOk"
/>
<!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @onOk="newFilterOk" />
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />
<!-- 筛选 -->
<CustomFilterModalVue ref="customModalRef" />
</n-scrollbar>

@ -1,8 +1,8 @@
<script lang="ts" setup>
import type { DropdownMixedOption } from "naive-ui/es/dropdown/src/interface";
import type { PropType } from "vue";
import type { DropdownMixedOption } from 'naive-ui/es/dropdown/src/interface'
import type { PropType } from 'vue'
defineOptions({ name: "Action" });
defineOptions({ name: 'Action' })
const props = defineProps({
options: {
@ -16,12 +16,12 @@ const props = defineProps({
},
id: {
type: String,
default: "",
default: '',
},
});
const fun = (key) => {
props.select(key, props.id);
};
})
function fun(key) {
props.select(key, props.id)
}
</script>
<template>

@ -1,14 +1,14 @@
<script lang="ts" setup>
import { favorite, getConditionList, unfavorite, sort } from "@/api/home/filter";
import { asideMap } from "@/config/aside";
import { useInfiniteScroll } from "@vueuse/core";
import { debounce } from "lodash-es";
import { onMounted, reactive, ref, watch } from "vue";
import type { FilterSearchParam } from "/#/api";
import type { Filter, FilterEntity } from "/#/home";
import { VueDraggable } from "vue-draggable-plus";
import { useInfiniteScroll } from '@vueuse/core'
import { debounce } from 'lodash-es'
import { onMounted, reactive, ref, watch } from 'vue'
import type { FilterSearchParam } from '/#/api'
import type { Filter, FilterEntity } from '/#/home'
import { VueDraggable } from 'vue-draggable-plus'
import { asideMap } from '@/config/aside'
import { favorite, getConditionList, sort, unfavorite } from '@/api/home/filter'
defineOptions({ name: "AdvanceFilter" });
defineOptions({ name: 'AdvanceFilter' })
const props = defineProps({
type: {
@ -16,43 +16,42 @@ const props = defineProps({
default: 0,
required: true,
},
});
const ruleForm = reactive({
keyword: "",
});
const ruleformRef = ref();
})
const emit = defineEmits<{
(e: "show-filter"): void;
(e: "show-custom"): void;
(e: "update:search"): void;
(e: "select", id: string);
}>();
const data = ref<FilterEntity[]>([]);
const unData = ref<FilterEntity[]>([]);
const loading = ref(false);
const canloadMore = true;
const el = ref<HTMLDivElement | null>(null);
const popover = ref<ComponentRef | null>(null);
(e: 'show-filter'): void
(e: 'show-custom'): void
(e: 'update:search'): void
(e: 'select', id: string)
}>()
const ruleForm = reactive({
keyword: '',
})
const ruleformRef = ref()
const data = ref<FilterEntity[]>([])
const unData = ref<FilterEntity[]>([])
const loading = ref(false)
const canloadMore = true
const el = ref<HTMLDivElement | null>(null)
const popover = ref<ComponentRef | null>(null)
const pagination = reactive({
pageNo: 1,
pageSize: 300,
});
const keyword = ref("");
const currentlySelectedAdvanced = ref("高级筛选");
})
const keyword = ref('')
const currentlySelectedAdvanced = ref('高级筛选')
onMounted(() => {
// data.value = generateDefaultConfig()
});
})
//
function generateDefaultConfig(): FilterEntity[] {
return Object.keys(asideMap).reduce((acc, key) => {
const { label, defaultValue, isDefaultFilter } = asideMap[key];
const { label, defaultValue, isDefaultFilter } = asideMap[key]
if (isDefaultFilter === true) {
const config = {
id: "",
id: '',
name: label,
favorite: false,
isDefaultFilter,
@ -62,70 +61,75 @@ function generateDefaultConfig(): FilterEntity[] {
value: defaultValue,
},
],
};
return [...acc, config];
} else {
return acc;
}
return [...acc, config]
}
}, []);
else {
return acc
}
}, [])
}
useInfiniteScroll(
el as any,
() => {
loadMore();
loadMore()
},
{ distance: 10, interval: 300, canLoadMore: () => false }
);
const showClick = async () => {
getSearchedList("");
};
{ distance: 10, interval: 300, canLoadMore: () => false },
)
async function showClick() {
getSearchedList('')
}
async function loadMore() {
if (loading.value || el.value == null) return;
if (loading.value || el.value == null)
return
const more = await featchList();
const more = await featchList()
if (more.length === 0) return;
if (more.length === 0)
return
data.value.push(...more);
data.value.push(...more)
}
async function featchList() {
loading.value = true;
loading.value = true
try {
const searchParam: FilterSearchParam = {
search_searchname: { value: ruleForm.keyword, op: "like", type: "string" },
};
const result = await getConditionList(pagination, searchParam, props.type);
const { data } = result;
search_searchname: { value: ruleForm.keyword, op: 'like', type: 'string' },
}
const result = await getConditionList(pagination, searchParam, props.type)
const { data } = result
// pagination.pageNo += 1
// canloadMore = pageCount >= pagination.pageNo
const entityList = generateFilterEntityList(data);
return entityList;
} catch (error) {
return [];
} finally {
loading.value = false;
const entityList = generateFilterEntityList(data)
return entityList
}
catch (error) {
return []
}
finally {
loading.value = false
}
}
//
function generateFilterEntityList(data) {
const filterEntityList = data.map((item) => {
const { searchname, iztop, ocrUsersearchchildList, id, reorder } = item;
const { searchname, iztop, ocrUsersearchchildList, id, reorder } = item
const list = ocrUsersearchchildList.map((item) => {
const { searchfield, searchvalue } = item;
const { searchfield, searchvalue } = item
return {
key: searchfield,
value: searchvalue,
};
});
}
})
const reg = new RegExp(ruleForm.keyword, "gi");
const hilightText = searchname.replace(reg, `<span>${ruleForm.keyword}</span>`);
const reg = new RegExp(ruleForm.keyword, 'gi')
const hilightText = searchname.replace(reg, `<span>${ruleForm.keyword}</span>`)
return {
id,
@ -135,132 +139,130 @@ function generateFilterEntityList(data) {
filterList: list,
reorder,
searchname,
};
});
}
})
return filterEntityList;
return filterEntityList
}
function selectHandler(item: FilterEntity) {
(popover.value as any).setShow(false);
currentlySelectedAdvanced.value = item.searchname;
emit("select", item.id);
(popover.value as any).setShow(false)
currentlySelectedAdvanced.value = item.searchname
emit('select', item.id)
}
const inputHandler = debounce((word) => {
ruleForm.keyword = word;
ruleformRef.value.validate();
if (word.length < 2 && word) {
return;
}
getSearchedList(word);
}, 300);
ruleForm.keyword = word
ruleformRef.value.validate()
if (word.length < 2 && word)
return
getSearchedList(word)
}, 300)
function getSearchedList(word, isScroll = false) {
if (word) {
pagination.pageSize = 300;
}
if (!word) {
pagination.pageSize = 10;
}
if (isScroll) {
pagination.pageSize = 300;
}
ruleForm.keyword = word;
if (word)
pagination.pageSize = 300
if (!word)
pagination.pageSize = 10
if (isScroll)
pagination.pageSize = 300
ruleForm.keyword = word
featchList().then((list) => {
let dataArr: FilterEntity[] = [];
let unDataArr: FilterEntity[] = [];
const dataArr: FilterEntity[] = []
const unDataArr: FilterEntity[] = []
list.map((item) => {
if (item.favorite && !item.isDefaultFilter) {
dataArr.push(item);
}
if (!item.favorite && !item.isDefaultFilter) {
unDataArr.push(item);
}
});
if (item.favorite && !item.isDefaultFilter)
dataArr.push(item)
if (!item.favorite && !item.isDefaultFilter)
unDataArr.push(item)
})
data.value = dataArr.sort(
(a, b) => Number(new Date(a.createtime)) - Number(new Date(b.createtime))
);
(a, b) => Number(new Date(a.createtime)) - Number(new Date(b.createtime)),
)
unData.value = unDataArr.sort(
(a, b) => Number((a as any).reorder) - Number((b as any).reorder)
);
});
(a, b) => Number((a as any).reorder) - Number((b as any).reorder),
)
})
}
function favoriteHandler(event: MouseEvent, item: any) {
event.stopImmediatePropagation();
event.stopPropagation();
event.stopImmediatePropagation()
event.stopPropagation()
const { isDefaultFilter, id } = item;
const { isDefaultFilter, id } = item
if (!isDefaultFilter) {
item.favorite = true;
favorite(id);
item.favorite = true
favorite(id)
data.value.map((v, index) => {
if (v.id == id) {
sort(v.id, 0);
} else {
sort(v.id, index + 1);
}
});
if (v.id == id)
sort(v.id, 0)
else
sort(v.id, index + 1)
})
inputHandler(ruleForm.keyword);
inputHandler(ruleForm.keyword)
}
}
const rules = {
keyword: [
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (value.length >= 2) {
return true;
} else {
return new Error("搜索关键字最少为两个");
}
if (value.length >= 2)
return true
else
return new Error('搜索关键字最少为两个')
},
},
],
};
}
function unFavoriteHandler(event: MouseEvent, item) {
event.stopImmediatePropagation();
event.stopPropagation();
event.stopImmediatePropagation()
event.stopPropagation()
const { isDefaultFilter, id } = item;
const { isDefaultFilter, id } = item
if (!isDefaultFilter) {
item.favorite = false;
unfavorite(id);
inputHandler(ruleForm.keyword);
item.favorite = false
unfavorite(id)
inputHandler(ruleForm.keyword)
}
}
const handleScroll = (event) => {
let timer;
function handleScroll(event) {
let timer
if (timer) {
clearTimeout(timer);
} else {
clearTimeout(timer)
}
else {
timer = setTimeout(() => {
getSearchedList("", true);
}, 2000);
getSearchedList('', true)
}, 2000)
}
};
}
const moveEnd = () => {
function moveEnd() {
unData.value.map((v, index) => {
sort(v.id, index);
});
};
sort(v.id, index)
})
}
const setCurrentlySelectedAdvanced = (value: string) => {
currentlySelectedAdvanced.value = value;
};
function setCurrentlySelectedAdvanced(value: string) {
currentlySelectedAdvanced.value = value
}
defineExpose({
setCurrentlySelectedAdvanced,
});
})
</script>
<template>
@ -284,8 +286,7 @@ defineExpose({
font-size: 17px;
font-weight: 600;
"
>{{ currentlySelectedAdvanced }}</span
>
>{{ currentlySelectedAdvanced }}</span>
<SvgIcon
:style="{ marginLeft: '5px' }"
name="down"
@ -296,7 +297,7 @@ defineExpose({
</template>
<n-spin :show="loading">
<div class="wrapper-left-popover">
<n-form :rules="rules" ref="ruleformRef" :model="ruleForm">
<n-form ref="ruleformRef" :rules="rules" :model="ruleForm">
<n-form-item path="keyword">
<n-input
:style="{
@ -305,9 +306,9 @@ defineExpose({
'--n-height': '40px',
}"
placeholder="请输入关键词"
@input="inputHandler"
:value="ruleForm.keyword"
:minlength="2"
@input="inputHandler"
>
<template #prefix>
<SvgIcon size="14px" name="magnifying-1" />
@ -354,23 +355,23 @@ defineExpose({
style="margin-right: 3px"
@click="favoriteHandler($event, item)"
/>
<div v-html="item.name" style="color: #333333" />
<div style="color: #333333" v-html="item.name" />
</li>
<!-- filter=".draggable-li[draggable='false']" -->
<VueDraggable
@end="moveEnd"
v-model="unData"
class="draggable-ul"
:animation="150"
group="shared"
@end="moveEnd"
>
<li
v-for="(item, index) in unData"
:key="index"
style="display: flex; align-items: center"
@click="selectHandler(item)"
class="cursor-move draggable-li fix"
:draggable="true"
@click="selectHandler(item)"
>
<SvgIcon name="drag" size="10" style="margin-right: 3px" />
<SvgIcon
@ -392,7 +393,7 @@ defineExpose({
style="cursor: pointer !important; margin-right: 3px"
@click="favoriteHandler($event, item)"
/>
<div v-html="item.name" style="color: #333333" />
<div style="color: #333333" v-html="item.name" />
</li>
</VueDraggable>
</ul>

@ -1,16 +1,12 @@
<script lang="ts" setup>
import { nextTick, onMounted, ref, watch } from 'vue'
import { debounce } from 'lodash-es'
import { useRoute } from 'vue-router'
import { asideMap } from '@/config/aside'
import type { SearchEntity } from '/#/home'
import { useConfig } from '@/store/modules/asideConfig'
import { useRoute } from 'vue-router'
import { useFinal } from "@/store/modules/final";
const finalStore = useFinal();
import { useFinal } from '@/store/modules/final'
const route = useRoute()
const searchContent = route.query.searchContent as string;
defineOptions({ name: 'Search' })
const emit = defineEmits<{
@ -20,13 +16,17 @@ const emit = defineEmits<{
(e: 'showSearch'): void
}>()
const finalStore = useFinal()
const route = useRoute()
const searchContent = route.query.searchContent as string
const data = ref<SearchEntity[]>([])
const popover = ref<ComponentRef | null>(null)
const configStore = useConfig()
const searchKeyword = ref('')
const inputHandler = debounce((keyword) => {
searchKeyword.value = keyword;
searchKeyword.value = keyword
emit('inputChange', keyword)
}, 300)
@ -59,30 +59,25 @@ function selectHandler(item: SearchEntity) {
}
//
const searchName = () => {
configStore.setSearchValue(searchKeyword.value);
finalStore.setSearchValue(searchKeyword.value);
emit('inputChange', searchKeyword.value);
function searchName() {
configStore.setSearchValue(searchKeyword.value)
finalStore.setSearchValue(searchKeyword.value)
emit('inputChange', searchKeyword.value)
}
const close = () => {
searchKeyword.value = "";
configStore.setSearchValue(searchKeyword.value);
finalStore.setSearchValue(searchKeyword.value);
emit('close');
function close() {
searchKeyword.value = ''
configStore.setSearchValue(searchKeyword.value)
finalStore.setSearchValue(searchKeyword.value)
emit('close')
}
const initSerach = () => {
function initSerach() {
if (searchContent) {
emit('showSearch')
const id_param = searchContent.match(/-\d+-/);
const id_param = searchContent.match(/-\d+-/)
if (id_param) {
searchKeyword.value = id_param[0].slice(1, -1);
searchKeyword.value = id_param[0].slice(1, -1)
emit('inputChange', searchKeyword.value)
}
}
@ -94,13 +89,17 @@ onMounted(() => {
<template>
<div class="wrapper">
<n-popover ref="popover" :style="{ padding: '0px' }" style="width: 248px" :show-arrow="false"
placement="bottom-start" trigger="focus">
<n-popover
ref="popover" :style="{ padding: '0px' }" style="width: 248px" :show-arrow="false"
placement="bottom-start" trigger="focus"
>
<template #trigger>
<n-input v-model:value="searchKeyword" style="width: 260px;height: 32px;" placeholder="请输入你需要搜索的内容"
@input="inputHandler">
<n-input
v-model:value="searchKeyword" style="width: 260px;height: 32px;" placeholder="请输入你需要搜索的内容"
@input="inputHandler"
>
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" @click="searchName" style="cursor: pointer;" />
<SvgIcon size="14px" name="magnifying-1" style="cursor: pointer;" @click="searchName" />
</template>
</n-input>
</template>

@ -1,11 +1,11 @@
<script lang="ts" setup>
import { upload } from '@/api/home/main'
import { hideDownload } from '@/utils/image'
import { getImgUrl } from '@/utils/urlUtils'
import { useElementHover } from '@vueuse/core'
import type { GlobalThemeOverrides, UploadCustomRequestOptions } from 'naive-ui'
import { useThemeVars } from 'naive-ui'
import { computed, ref } from 'vue'
import { getImgUrl } from '@/utils/urlUtils'
import { hideDownload } from '@/utils/image'
import { upload } from '@/api/home/main'
const props = defineProps<{
value: string
@ -15,13 +15,11 @@ const emit = defineEmits<{
(e: 'update:value', value: string): void
}>()
const figureUrl = ref(props.value)
if (figureUrl.value && !figureUrl.value.includes('http'))
figureUrl.value = getImgUrl(figureUrl.value)
let figureUrl = ref(props.value)
if(figureUrl.value && figureUrl.value.indexOf('http') == -1) {
figureUrl.value = getImgUrl(figureUrl.value);
}
const uploadRef = ref(null);
const uploadRef = ref(null)
async function customRequest(data: UploadCustomRequestOptions) {
const result = await upload({ file: data.file.file as any })
@ -66,34 +64,35 @@ const imageGroupThemeOverrides = computed(() => {
})
//
const handleDragOver = (e) => {
e.preventDefault(); //
e.dataTransfer.dropEffect = 'copy'; //
};
function handleDragOver(e) {
e.preventDefault() //
e.dataTransfer.dropEffect = 'copy' //
}
//
const handleDragLeave = (e) => {
e.preventDefault(); //
};
function handleDragLeave(e) {
e.preventDefault() //
}
//
const handleDrop = async (e) => {
e.preventDefault(); //
const files = e.dataTransfer.files;
if( files[0] ){
async function handleDrop(e) {
e.preventDefault() //
const files = e.dataTransfer.files
if (files[0]) {
const result = await upload({ file: files[0] as any })
const imgUrl = getImgUrl(result.data)
figureUrl.value = imgUrl
emit('update:value', result.data)
}
};
}
</script>
<template>
<n-space>
<n-upload ref="uploadRef" directory-dnd :show-file-list="false" accept=".png,.jpg,.bmp"
:custom-request="customRequest" @dragover="handleDragOver" @dragleave="handleDragLeave" @drop="handleDrop">
<n-upload
ref="uploadRef" directory-dnd :show-file-list="false" accept=".png,.jpg,.bmp"
:custom-request="customRequest" @dragover="handleDragOver" @dragleave="handleDragLeave" @drop="handleDrop"
>
<n-upload-dragger class="wrapper">
<div v-show="!showFigure" class="wrapper-dragger">
<SvgIcon size="30" name="upload" />
@ -101,12 +100,14 @@ const handleDrop = async (e) => {
<span class="wrapper-tip2">上传格式为.png .jpg .bmp 20M以内</span>
</div>
<div v-show="showFigure" ref="figureRef" class="wrapper-figure">
<n-image ref="imageRef" :img-props="{ onClick: hideDownload }" :theme-overrides="imageGroupThemeOverrides"
width="288" height="116" :src="figureUrl" />
<n-image
ref="imageRef" :img-props="{ onClick: hideDownload }" :theme-overrides="imageGroupThemeOverrides"
width="288" height="116" :src="figureUrl"
/>
<div v-show="figureHovered" class="wrapper-figure-tools">
<SvgIcon size="28" name="view" @click="previewHandler" />
<div class="wrapper-figure-line" />
<SvgIcon size="28" name="white_delete" @click="clearHandler" />
<SvgIcon size="28" name="white_delete" @click="clearHandler" />
</div>
</div>
</n-upload-dragger>

@ -4,22 +4,6 @@ import type { FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izApprovalStatus'] && typeof asideValue['izApprovalStatus'] == "string") {
let list = asideValue['izApprovalStatus'].split(',');
formValue.value.plans = list;
console.log("formValue.value.izApprovalStatus", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -29,12 +13,29 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izApprovalStatus && typeof asideValue.izApprovalStatus == 'string') {
const list = asideValue.izApprovalStatus.split(',')
formValue.value.plans = list
console.log('formValue.value.izApprovalStatus', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -58,7 +59,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -66,8 +67,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择审核状态" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择审核状态" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,27 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izcustomlevel']) {
if(typeof asideValue['izcustomlevel'] == "string") {
let list = asideValue['izcustomlevel'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izcustomlevel'];
}
console.log("formValue.value.izcustomlevel", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -34,15 +13,38 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izcustomlevel) {
if (typeof asideValue.izcustomlevel == 'string') {
const list = asideValue.izcustomlevel.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izcustomlevel
}
console.log('formValue.value.izcustomlevel', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
console.log("formValue.value.izcustomlevel22222", formValue.value.plans);
console.log('formValue.value.izcustomlevel22222', formValue.value.plans)
const rules: FormRules = {
plans: [
@ -66,7 +68,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -74,8 +76,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访客户级别" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访客户级别" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izcustomname']) {
if(typeof asideValue['izcustomname'] == "string") {
let list = asideValue['izcustomname'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izcustomname'];
}
console.log("formValue.value.izcustomname", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izcustomname) {
if (typeof asideValue.izcustomname == 'string') {
const list = asideValue.izcustomname.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izcustomname
}
console.log('formValue.value.izcustomname', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -63,7 +65,7 @@ onBeforeMount(async () => {
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -71,8 +73,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访客户名称" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访客户名称" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izcustomtype']) {
if(typeof asideValue['izcustomtype'] == "string") {
let list = asideValue['izcustomtype'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izcustomtype'];
}
console.log("formValue.value.izcustomtype", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izcustomtype) {
if (typeof asideValue.izcustomtype == 'string') {
const list = asideValue.izcustomtype.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izcustomtype
}
console.log('formValue.value.izcustomtype', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -62,7 +64,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -70,8 +72,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访客户类型" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访客户类型" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izcustomtypes']) {
if(typeof asideValue['izcustomtypes'] == "string") {
let list = asideValue['izcustomtypes'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izcustomtypes'];
}
console.log("formValue.value.izcustomtypes", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izcustomtypes) {
if (typeof asideValue.izcustomtypes == 'string') {
const list = asideValue.izcustomtypes.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izcustomtypes
}
console.log('formValue.value.izcustomtypes', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -68,7 +70,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -76,8 +78,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择izcustomtype" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择izcustomtype" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izproductname']) {
if(typeof asideValue['izproductname'] == "string") {
let list = asideValue['izproductname'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izproductname'];
}
console.log("formValue.value.izproductname", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izproductname) {
if (typeof asideValue.izproductname == 'string') {
const list = asideValue.izproductname.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izproductname
}
console.log('formValue.value.izproductname', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -62,7 +64,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -70,8 +72,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择产品名称" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择产品名称" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -5,62 +5,66 @@ import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
if (isLoadValue.value) {
isLoadValue.value = false
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izproject']) {
if(typeof asideValue['izproject'] == "string") {
let list = asideValue['izproject'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izproject'];
const asideValue = configUseStore.getAsideValue
if (asideValue.izproject) {
if (typeof asideValue.izproject == 'string') {
const list = asideValue.izproject.split(',')
formValue.value.plans = list
}
console.log("formValue.value.izproject", formValue.value.plans);
}else {
formValue.value.plans = [];
else {
formValue.value.plans = asideValue.izproject
}
console.log('formValue.value.izproject', formValue.value.plans)
}
else {
formValue.value.plans = []
}
});
})
const finalStore = useFinal()
finalStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
if (isLoadValue.value) {
isLoadValue.value = false
return
}
let asideValue = finalStore.getAsideValue;
if(asideValue && asideValue['izproject']) {
if(typeof asideValue['izproject'] == "string") {
let list = asideValue['izproject'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izproject'];
const asideValue = finalStore.getAsideValue
if (asideValue && asideValue.izproject) {
if (typeof asideValue.izproject == 'string') {
const list = asideValue.izproject.split(',')
formValue.value.plans = list
}
console.log("formValue.value.izproject", formValue.value.plans);
}else {
formValue.value.plans = [];
else {
formValue.value.plans = asideValue.izproject
}
console.log('formValue.value.izproject', formValue.value.plans)
}
});
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -76,7 +80,7 @@ const options = ref([])
const configStore = useDictionary()
const labStyle = {
fontWeight: 'bold',
color: '#333333'
color: '#333333',
}
onBeforeMount(async () => {
@ -85,7 +89,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -93,8 +97,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择所属项目" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择所属项目" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -1,30 +1,9 @@
<script lang="ts" setup>
import { onBeforeMount, onMounted, ref } from 'vue'
import { onBeforeMount, onMounted, onUpdated, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { onUpdated } from 'vue';
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izprojecttype']) {
if(typeof asideValue['izprojecttype'] == "string") {
let list = asideValue['izprojecttype'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izprojecttype'];
}
console.log("formValue.value.izprojecttype", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -34,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izprojecttype) {
if (typeof asideValue.izprojecttype == 'string') {
const list = asideValue.izprojecttype.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izprojecttype
}
console.log('formValue.value.izprojecttype', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -63,7 +64,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -71,8 +72,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访项目类别" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访项目类别" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izsearch']) {
if(typeof asideValue['izsearch'] == "string") {
let list = asideValue['izsearch'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izsearch'];
}
console.log("formValue.value.izsearch", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izsearch) {
if (typeof asideValue.izsearch == 'string') {
const list = asideValue.izsearch.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izsearch
}
console.log('formValue.value.izsearch', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -68,7 +70,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -76,8 +78,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择IzSearch" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择IzSearch" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izsearchmanager']) {
if(typeof asideValue['izsearchmanager'] == "string") {
let list = asideValue['izsearchmanager'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izsearchmanager'];
}
console.log("formValue.value.izsearchmanager", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izsearchmanager) {
if (typeof asideValue.izsearchmanager == 'string') {
const list = asideValue.izsearchmanager.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izsearchmanager
}
console.log('formValue.value.izsearchmanager', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -68,7 +70,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -76,8 +78,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择IzSearchManager" multiple :options="options"
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择IzSearchManager" multiple :options="options"
@update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izshow']) {
if(typeof asideValue['izshow'] == "string") {
let list = asideValue['izshow'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izshow'];
}
console.log("formValue.value.izshow", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izshow) {
if (typeof asideValue.izshow == 'string') {
const list = asideValue.izshow.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izshow
}
console.log('formValue.value.izshow', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -62,7 +64,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -70,8 +72,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择分类" multiple :options="options"
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择分类" multiple :options="options"
@update:value="onChange"
/>
</n-form-item>

@ -5,62 +5,66 @@ import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
if (isLoadValue.value) {
isLoadValue.value = false
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izstatus']) {
if(typeof asideValue['izstatus'] == "string") {
let list = asideValue['izstatus'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izstatus'];
const asideValue = configUseStore.getAsideValue
if (asideValue.izstatus) {
if (typeof asideValue.izstatus == 'string') {
const list = asideValue.izstatus.split(',')
formValue.value.plans = list
}
console.log("formValue.value.izstatus", formValue.value.plans);
}else {
formValue.value.plans = [];
else {
formValue.value.plans = asideValue.izstatus
}
console.log('formValue.value.izstatus', formValue.value.plans)
}
else {
formValue.value.plans = []
}
});
})
const finalStore = useFinal()
finalStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
if (isLoadValue.value) {
isLoadValue.value = false
return
}
let asideValue = finalStore.getAsideValue;
if(asideValue && asideValue['izstatus']) {
if(typeof asideValue['izstatus'] == "string") {
let list = asideValue['izstatus'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izstatus'];
const asideValue = finalStore.getAsideValue
if (asideValue && asideValue.izstatus) {
if (typeof asideValue.izstatus == 'string') {
const list = asideValue.izstatus.split(',')
formValue.value.plans = list
}
console.log("formValue.value.izstatus", formValue.value.plans);
}else {
formValue.value.plans = [];
else {
formValue.value.plans = asideValue.izstatus
}
console.log('formValue.value.izstatus', formValue.value.plans)
}
});
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -84,7 +88,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -92,8 +96,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择审核状态" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择审核状态" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izvisitcity']) {
if(typeof asideValue['izvisitcity'] == "string") {
let list = asideValue['izvisitcity'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izvisitcity'];
}
console.log("formValue.value.izvisitcity", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izvisitcity) {
if (typeof asideValue.izvisitcity == 'string') {
const list = asideValue.izvisitcity.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izvisitcity
}
console.log('formValue.value.izvisitcity', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -62,7 +64,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -70,8 +72,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择发布地区" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择发布地区" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izfiled17']) {
if(typeof asideValue['izfiled17'] == "string") {
let list = asideValue['izfiled17'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izfiled17'];
}
console.log("formValue.value.izfiled17", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izfiled17) {
if (typeof asideValue.izfiled17 == 'string') {
const list = asideValue.izfiled17.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izfiled17
}
console.log('formValue.value.izfiled17', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -68,7 +70,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -76,8 +78,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访项目类别" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访项目类别" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izfiled2']) {
if(typeof asideValue['izfiled2'] == "string") {
let list = asideValue['izfiled2'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izfiled2'];
}
console.log("formValue.value.izfiled2", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izfiled2) {
if (typeof asideValue.izfiled2 == 'string') {
const list = asideValue.izfiled2.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izfiled2
}
console.log('formValue.value.izfiled2', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -68,7 +70,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -76,8 +78,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访客户类型" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访客户类型" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izfiled3']) {
if(typeof asideValue['izfiled3'] == "string") {
let list = asideValue['izfiled3'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izfiled3'];
}
console.log("formValue.value.izfiled3", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izfiled3) {
if (typeof asideValue.izfiled3 == 'string') {
const list = asideValue.izfiled3.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izfiled3
}
console.log('formValue.value.izfiled3', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -68,7 +70,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -76,8 +78,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访客户名称" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访客户名称" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izfiled6']) {
if(typeof asideValue['izfiled6'] == "string") {
let list = asideValue['izfiled6'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izfiled6'];
}
console.log("formValue.value.izfiled6", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izfiled6) {
if (typeof asideValue.izfiled6 == 'string') {
const list = asideValue.izfiled6.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izfiled6
}
console.log('formValue.value.izfiled6', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -68,7 +70,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -76,8 +78,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访客户级别" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访客户级别" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izfirm']) {
if(typeof asideValue['izfirm'] == "string") {
let list = asideValue['izfirm'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izfirm'];
}
console.log("formValue.value.izfirm", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izfirm) {
if (typeof asideValue.izfirm == 'string') {
const list = asideValue.izfirm.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izfirm
}
console.log('formValue.value.izfirm', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -62,7 +64,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -70,8 +72,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择厂商" multiple
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择厂商" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>

@ -5,64 +5,67 @@ import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
console.log("isLoadValue.value", isLoadValue.value,
"configUseStore.getAsideValue", configUseStore.getAsideValue);
if(isLoadValue.value) {
isLoadValue.value = false;
console.log('isLoadValue.value', isLoadValue.value, 'configUseStore.getAsideValue', configUseStore.getAsideValue)
if (isLoadValue.value) {
isLoadValue.value = false
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['iztaskrrom']) {
if(typeof asideValue['iztaskrrom'] == "string") {
let list = asideValue['iztaskrrom'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['iztaskrrom'];
const asideValue = configUseStore.getAsideValue
if (asideValue.iztaskrrom) {
if (typeof asideValue.iztaskrrom == 'string') {
const list = asideValue.iztaskrrom.split(',')
formValue.value.plans = list
}
console.log("formValue.value.iztaskrrom", formValue.value.plans);
}else {
formValue.value.plans = [];
else {
formValue.value.plans = asideValue.iztaskrrom
}
console.log('formValue.value.iztaskrrom', formValue.value.plans)
}
else {
formValue.value.plans = []
}
});
})
const finalStore = useFinal()
finalStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
if (isLoadValue.value) {
isLoadValue.value = false
return
}
let asideValue = finalStore.getAsideValue;
if(asideValue && asideValue['iztaskrrom']) {
if(typeof asideValue['iztaskrrom'] == "string") {
let list = asideValue['iztaskrrom'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['iztaskrrom'];
const asideValue = finalStore.getAsideValue
if (asideValue && asideValue.iztaskrrom) {
if (typeof asideValue.iztaskrrom == 'string') {
const list = asideValue.iztaskrrom.split(',')
formValue.value.plans = list
}
console.log("formValue.value.iztaskrrom", formValue.value.plans);
}else {
formValue.value.plans = [];
else {
formValue.value.plans = asideValue.iztaskrrom
}
console.log('formValue.value.iztaskrrom', formValue.value.plans)
}
});
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -86,7 +89,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -94,8 +97,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择任务来源" multiple :options="options"
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择任务来源" multiple :options="options"
@update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['iztaskstatus']) {
if(typeof asideValue['iztaskstatus'] == "string") {
let list = asideValue['iztaskstatus'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['iztaskstatus'];
}
console.log("formValue.value.iztaskstatus", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.iztaskstatus) {
if (typeof asideValue.iztaskstatus == 'string') {
const list = asideValue.iztaskstatus.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.iztaskstatus
}
console.log('formValue.value.iztaskstatus', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -62,7 +64,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -70,8 +72,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择任务状态" multiple :options="options"
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择任务状态" multiple :options="options"
@update:value="onChange"
/>
</n-form-item>

@ -4,26 +4,6 @@ import type { FormItemRule, FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izvisitpro']) {
if(typeof asideValue['izvisitpro'] == "string") {
let list = asideValue['izvisitpro'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izvisitpro'];
}
console.log("formValue.value.izvisitpro", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
@ -33,12 +13,34 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false
return
}
const asideValue = configUseStore.getAsideValue
if (asideValue.izvisitpro) {
if (typeof asideValue.izvisitpro == 'string') {
const list = asideValue.izvisitpro.split(',')
formValue.value.plans = list
}
else {
formValue.value.plans = asideValue.izvisitpro
}
console.log('formValue.value.izvisitpro', formValue.value.plans)
}
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value,
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -62,7 +64,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -70,8 +72,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择省份" multiple :options="options"
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择省份" multiple :options="options"
@update:value="onChange"
/>
</n-form-item>

@ -2,8 +2,6 @@
import { ref } from 'vue'
import { useConfig } from '@/store/modules/asideConfig'
const configStore = useConfig()
const props = defineProps({
value: {
type: Boolean,
@ -19,11 +17,13 @@ const emit = defineEmits<{
(e: 'update:value', value: boolean): void
}>()
const configStore = useConfig()
const download = ref(props.value)
function onChange(value: boolean) {
emit('update:value', value)
configStore.setIsAllowDownload(value);
configStore.setIsAllowDownload(value)
}
</script>

@ -5,62 +5,66 @@ import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
if (isLoadValue.value) {
isLoadValue.value = false
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izplan']) {
if(typeof asideValue['izplan'] == "string") {
let list = asideValue['izplan'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izplan'];
const asideValue = configUseStore.getAsideValue
if (asideValue.izplan) {
if (typeof asideValue.izplan == 'string') {
const list = asideValue.izplan.split(',')
formValue.value.plans = list
}
console.log("formValue.value.izplan", formValue.value.plans);
}else {
formValue.value.plans = [];
else {
formValue.value.plans = asideValue.izplan
}
console.log('formValue.value.izplan', formValue.value.plans)
}
else {
formValue.value.plans = []
}
});
})
const finalStore = useFinal()
finalStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
if (isLoadValue.value) {
isLoadValue.value = false
return
}
let asideValue = finalStore.getAsideValue;
if(asideValue && asideValue['izplan']) {
if(typeof asideValue['izplan'] == "string") {
let list = asideValue['izplan'].split(',');
formValue.value.plans = list;
}else {
formValue.value.plans = asideValue['izplan'];
const asideValue = finalStore.getAsideValue
if (asideValue && asideValue.izplan) {
if (typeof asideValue.izplan == 'string') {
const list = asideValue.izplan.split(',')
formValue.value.plans = list
}
console.log("formValue.value.izplan", formValue.value.plans);
}else {
formValue.value.plans = [];
else {
formValue.value.plans = asideValue.izplan
}
console.log('formValue.value.izplan', formValue.value.plans)
}
});
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
else {
formValue.value.plans = []
}
})
const formValue = ref({
plans: props.value || [],
})
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(',');
formValue.value.plans = list;
if (typeof formValue.value.plans == 'string') {
const list = formValue.value.plans.split(',')
formValue.value.plans = list
}
const rules: FormRules = {
plans: [
@ -84,7 +88,7 @@ onBeforeMount(async () => {
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -92,8 +96,9 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择计划" multiple :options="planOptons"
<n-select
v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择计划" multiple :options="planOptons"
@update:value="onChange"
/>
</n-form-item>

@ -5,66 +5,70 @@ import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
let asideValue = configUseStore.getAsideValue;
console.log("asideValue接受到的", asideValue);
if(isLoadValue.value) {
isLoadValue.value = false;
const asideValue = configUseStore.getAsideValue
console.log('asideValue接受到的', asideValue)
if (isLoadValue.value) {
isLoadValue.value = false
return
}
if(asideValue['izupuser']) {
if(typeof asideValue['izupuser'] == "string") {
let list = asideValue['izupuser'].split(',');
formValue.value.users = list;
}else {
formValue.value.users = asideValue['izupuser'];
if (asideValue.izupuser) {
if (typeof asideValue.izupuser == 'string') {
const list = asideValue.izupuser.split(',')
formValue.value.users = list
}
console.log("formValue.value.users1111111111", formValue.value.users);
}else {
formValue.value.users = [];
else {
formValue.value.users = asideValue.izupuser
}
console.log('formValue.value.users1111111111', formValue.value.users)
}
else {
formValue.value.users = []
}
});
})
const finalStore = useFinal()
finalStore.$subscribe(() => {
let asideValue = finalStore.getAsideValue;
console.log("asideValue接受到的", asideValue);
if(isLoadValue.value) {
isLoadValue.value = false;
const asideValue = finalStore.getAsideValue
console.log('asideValue接受到的', asideValue)
if (isLoadValue.value) {
isLoadValue.value = false
return
}
if(asideValue && asideValue['izupuser']) {
if(typeof asideValue['izupuser'] == "string") {
let list = asideValue['izupuser'].split(',');
formValue.value.users = list;
}else {
formValue.value.users = asideValue['izupuser'];
if (asideValue && asideValue.izupuser) {
if (typeof asideValue.izupuser == 'string') {
const list = asideValue.izupuser.split(',')
formValue.value.users = list
}
console.log("formValue.value.users222222222222222", formValue.value.users);
}else {
formValue.value.users = [];
else {
formValue.value.users = asideValue.izupuser
}
console.log('formValue.value.users222222222222222', formValue.value.users)
}
});
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
else {
formValue.value.users = []
}
})
const formValue = ref({
users: props.value || [],
})
if(typeof formValue.value.users == "string") {
let list = formValue.value.users.split(',');
formValue.value.users = list;
if (typeof formValue.value.users == 'string') {
const list = formValue.value.users.split(',')
formValue.value.users = list
}
console.log("formValue.value.users2222222222222", formValue.value.users);
console.log('formValue.value.users2222222222222', formValue.value.users)
const rules: FormRules = {
users: [
{
@ -88,8 +92,8 @@ onBeforeMount(async () => {
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
console.log("user选中 ", value);
isLoadValue.value = true;
console.log('user选中 ', value)
isLoadValue.value = true
emit('update:value', value)
}
</script>
@ -97,9 +101,10 @@ function onChange(value: Array<string>) {
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="users" :label-style="labStyle">
<n-select filterable
<n-select
v-model:value="formValue.users"
v-model:value="formValue.users" :max-tag-count="2" multiple placeholder="请选择提报人(可多选)"
filterable :max-tag-count="2" multiple placeholder="请选择提报人(可多选)"
:options="personOptions" @update:value="onChange"
/>
</n-form-item>

@ -1,47 +1,47 @@
<script lang="ts" setup>
import { ref } from "vue";
import { useConfig } from "@/store/modules/asideConfig";
import { ref } from 'vue'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig();
const props = defineProps<{
value: [number, number]
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false;
return;
}
let asideValue = configUseStore.getAsideValue;
if (asideValue["izsimilarity"]) {
range.value = asideValue["izsimilarity"];
} else {
range.value = [0, 100];
isLoadValue.value = false
return
}
console.log(range.value, "range.value");
const asideValue = configUseStore.getAsideValue
if (asideValue.izsimilarity)
range.value = asideValue.izsimilarity
else
range.value = [0, 100]
console.log(range.value, 'range.value')
// else {
// range.value = [0, 100];
// }
});
const props = defineProps<{
value: [number, number];
label: string;
}>();
const emit = defineEmits<{
(e: "update:value", value: string): void;
}>();
const range = ref<[number, number]>(props.value || []);
})
const range = ref<[number, number]>(props.value || [])
const marks = {
0: "0",
50: "50",
100: "100",
};
const isLoadValue = ref(false);
0: '0',
50: '50',
100: '100',
}
const isLoadValue = ref(false)
function onChange(value: number & number[]) {
range.value = value as any;
isLoadValue.value = true;
let valueStr = value.join("-");
emit("update:value", valueStr);
range.value = value as any
isLoadValue.value = true
const valueStr = value.join('-')
emit('update:value', valueStr)
}
</script>

@ -1,71 +1,67 @@
<script lang="ts" setup>
import dayjs from "dayjs";
import { onUpdated, watch } from "vue";
import { onMounted, ref } from "vue";
import { useConfig } from "@/store/modules/asideConfig";
import dayjs from 'dayjs'
import { onMounted, onUpdated, ref, watch } from 'vue'
import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final'
const configUseStore = useConfig();
const props = defineProps<{
value: [number, number] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: number[]): void
}>()
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false;
return;
isLoadValue.value = false
return
}
let asideValue = configUseStore.getAsideValue;
if (asideValue["izyear"]) {
time.value = asideValue["izyear"];
} else {
time.value = null;
}
});
const asideValue = configUseStore.getAsideValue
if (asideValue.izyear)
time.value = asideValue.izyear
else
time.value = null
})
const finalStore = useFinal()
finalStore.$subscribe(() => {
if (isLoadValue.value) {
isLoadValue.value = false;
return;
}
let asideValue = finalStore.getAsideValue;
console.log("asideValue izyear", asideValue);
if (asideValue && asideValue["izyear"]) {
time.value = asideValue["izyear"];
} else {
time.value = null;
isLoadValue.value = false
return
}
});
const asideValue = finalStore.getAsideValue
console.log('asideValue izyear', asideValue)
if (asideValue && asideValue.izyear)
time.value = asideValue.izyear
else
time.value = null
})
const props = defineProps<{
value: [number, number] | null;
label: string;
}>();
const emit = defineEmits<{
(e: "update:value", value: number[]): void;
}>();
const time = ref<[number, number] | null>(props.value);
const isLoadValue = ref(false);
const time = ref<[number, number] | null>(props.value)
const isLoadValue = ref(false)
function onChange(value: [number, number]) {
isLoadValue.value = true;
emit("update:value", value);
isLoadValue.value = true
emit('update:value', value)
}
onMounted(() => {
if (!props.value) {
//
const currentDate = dayjs();
const currentDate = dayjs()
//
const endDate = currentDate.toDate();
const startDate = currentDate.subtract(3, "month").toDate();
const endDate = currentDate.toDate()
const startDate = currentDate.subtract(3, 'month').toDate()
//
time.value = [startDate.getTime(), endDate.getTime()];
console.log("time init", startDate.getTime(), endDate.getTime());
time.value = [startDate.getTime(), endDate.getTime()]
console.log('time init', startDate.getTime(), endDate.getTime())
setTimeout(() => {
emit("update:value", [startDate.getTime(), endDate.getTime()]);
}, 300);
emit('update:value', [startDate.getTime(), endDate.getTime()])
}, 300)
}
});
})
</script>
<template>
@ -77,10 +73,12 @@ onMounted(() => {
v-model:value="time"
type="daterange"
:clearable="false"
@update:value="onChange"
placeholder="请选择"
@update:value="onChange"
>
<template #separator> </template>
<template #separator>
</template>
</n-date-picker>
</n-space>
</n-collapse-item>

@ -8,132 +8,137 @@ import {
reactive,
ref,
unref,
} from "vue";
import { NDataTable } from "naive-ui";
import type { DataTableColumns, DataTableRowKey } from "naive-ui";
import type { SortableEvent } from "sortablejs";
import Sortable from "sortablejs";
import { debounce } from "lodash-es";
import Action from "../Action.vue";
import { deleteCondition, getConditionList, sort } from "@/api/home/filter";
import type { FilterSearchParam } from "/#/api";
import selection from "naive-ui/es/_internal/selection";
import SvgIcon from "@/components/Icon/SvgIcon.vue";
import { useModal } from "naive-ui";
const modal = useModal();
defineOptions({ name: "FilterModal" });
const $message = window["$message"];
} from 'vue'
import { NDataTable, useModal } from 'naive-ui'
import type { DataTableColumns, DataTableRowKey } from 'naive-ui'
import type { SortableEvent } from 'sortablejs'
import Sortable from 'sortablejs'
import { debounce } from 'lodash-es'
import selection from 'naive-ui/es/_internal/selection'
import Action from '../Action.vue'
import { deleteCondition, getConditionList, sort } from '@/api/home/filter'
import type { FilterSearchParam } from '/#/api'
import SvgIcon from '@/components/Icon/SvgIcon.vue'
defineOptions({ name: 'FilterModal' })
const props = defineProps({
type: {
type: Number,
default: () => 0,
},
});
})
const emit = defineEmits<{
(e: "showNewFilter"): void;
(e: "editFilter", filter: any): void;
(e: "handleOk", item: any): void;
}>();
(e: 'showNewFilter'): void
(e: 'editFilter', filter: any): void
(e: 'handleOk', item: any): void
}>()
const show = ref(false);
const modal = useModal()
const $message = window.$message
const show = ref(false)
const cardStyle = {
width: "808px",
height: "840px",
"--n-padding-bottom": "10px",
"--n-padding-left": "10px",
};
'width': '808px',
'height': '840px',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
}
interface RowData {
id: string;
searchname: string;
createby: string;
createtime: string;
updateby: string;
updatetime: string;
id: string
searchname: string
createby: string
createtime: string
updateby: string
updatetime: string
}
function sortData(row) {
console.log("sortData", row);
if (row.order == "descend") {
console.log('sortData', row)
if (row.order == 'descend') {
tableData.value.sort(
(a, b) =>
new Date(a[row.columnKey]).getTime() - new Date(b[row.columnKey]).getTime()
);
} else if (row.order == "ascend") {
new Date(a[row.columnKey]).getTime() - new Date(b[row.columnKey]).getTime(),
)
}
else if (row.order == 'ascend') {
tableData.value.sort(
(a, b) =>
new Date(b[row.columnKey]).getTime() - new Date(a[row.columnKey]).getTime()
);
} else {
new Date(b[row.columnKey]).getTime() - new Date(a[row.columnKey]).getTime(),
)
}
else {
tableData.value.sort(
(a, b) => Number((a as any).reorder) - Number((b as any).reorder)
);
(a, b) => Number((a as any).reorder) - Number((b as any).reorder),
)
}
}
const columns: DataTableColumns<RowData> = [
{
type: "selection",
type: 'selection',
},
{
title: "操作",
key: "action",
title: '操作',
key: 'action',
render(row) {
return h(Action, {
options: [
{ label: "编辑", key: 1 },
{ label: "删除", key: 2 },
{ label: '编辑', key: 1 },
{ label: '删除', key: 2 },
],
id: row.id,
select,
});
})
},
},
// j
{
title: "名称",
key: "searchname",
title: '名称',
key: 'searchname',
ellipsis: {
tooltip: true,
},
},
{
title: "创建者",
key: "createby",
title: '创建者',
key: 'createby',
},
{
title: "创建时间",
key: "createtime",
title: '创建时间',
key: 'createtime',
width: 180,
renderSorterIcon: ({ order }) => {
if (order === false) return h(SvgIcon, { name: "sort-2" });
if (order === "ascend") return h(SvgIcon, { name: "sort-1" });
if (order === "descend") return h(SvgIcon, { name: "sort-3" });
if (order === false)
return h(SvgIcon, { name: 'sort-2' })
if (order === 'ascend')
return h(SvgIcon, { name: 'sort-1' })
if (order === 'descend')
return h(SvgIcon, { name: 'sort-3' })
},
sorter: (row1, row2) => {
// tableData.value.sort(
// (a, b) => new Date(a?.createtime).getTime() - new Date(b?.createtime).getTime()
// );
return new Date(row1?.createtime).getTime() - new Date(row2?.createtime).getTime();
return new Date(row1?.createtime).getTime() - new Date(row2?.createtime).getTime()
},
},
{
title: "更新者",
key: "updateby",
title: '更新者',
key: 'updateby',
},
{
title: "更新时间",
key: "updatetime",
title: '更新时间',
key: 'updatetime',
width: 180,
},
];
const total = ref(0);
const loading = ref(true);
]
const total = ref(0)
const loading = ref(true)
const pagination = reactive({
page: 1,
pageCount: 1,
@ -141,83 +146,83 @@ const pagination = reactive({
showSizePicker: true,
pageSizes: [
{
label: "10 每页",
label: '10 每页',
value: 10,
},
{
label: "15 每页",
label: '15 每页',
value: 15,
},
{
label: "30 每页",
label: '30 每页',
value: 30,
},
{
label: "50 每页",
label: '50 每页',
value: 50,
},
],
showQuickJumper: true,
prefix: () => `${total.value} 条数据`,
});
const tableData = ref<Array<RowData>>([]);
const keyword = ref("");
})
const tableData = ref<Array<RowData>>([])
const keyword = ref('')
async function query(page: number, pageSize: number) {
const searchParam: FilterSearchParam = {
search_searchname: { value: keyword.value, op: "like", type: "string" },
};
search_searchname: { value: keyword.value, op: 'like', type: 'string' },
}
const result = await getConditionList(
{ pageNo: page, pageSize },
searchParam,
props.type
);
const { data, pageCount, total: totalCount } = result;
tableData.value = data;
pagination.page = page;
total.value = totalCount;
pagination.pageCount = pageCount;
loading.value = false;
props.type,
)
const { data, pageCount, total: totalCount } = result
tableData.value = data
pagination.page = page
total.value = totalCount
pagination.pageCount = pageCount
loading.value = false
}
function afterLeave() {
pagination.page = 1;
pagination.pageCount = 1;
pagination.pageSize = 10;
pagination.page = 1
pagination.pageCount = 1
pagination.pageSize = 10
}
const selectionIds = ref<DataTableRowKey[]>([]);
const selectionIds = ref<DataTableRowKey[]>([])
const rowKey = (row: RowData) => row.id;
const rowKey = (row: RowData) => row.id
function rowProps(row: RowData) {
return {
"data-id": row.id,
};
'data-id': row.id,
}
}
function handleCheck(rowKeys: DataTableRowKey[]) {
selectionIds.value = rowKeys;
selectionIds.value = rowKeys
}
function select(key: number, id: string) {
switch (key) {
case 1:
editSelection(id);
break;
editSelection(id)
break
case 2:
const modalInst = modal.create({
title: "确认提示",
content: "确认删除该条过滤条件吗?",
positiveText: "确定",
negativeText: "取消",
preset: "dialog",
title: '确认提示',
content: '确认删除该条过滤条件吗?',
positiveText: '确定',
negativeText: '取消',
preset: 'dialog',
onPositiveClick: () => deleteSelection(id),
onNegativeClick: () => modalInst.destroy(),
});
break;
})
break
default:
break;
break
}
}
@ -227,145 +232,149 @@ function editSelection(id) {
// $message.error("");
// return;
// }
const selectedId = id;
const selectedId = id
const selectedFilter = tableData.value.find((item: any) => {
return item.id === selectedId;
});
return item.id === selectedId
})
emit("editFilter", selectedFilter);
closeModal();
emit('editFilter', selectedFilter)
closeModal()
}
function deleteSelection(id = "") {
function deleteSelection(id = '') {
if (selectionIds.value.length === 0) {
deleteCondition({ ids: id }).then(() => {
query(pagination.page, pagination.pageSize);
});
return;
query(pagination.page, pagination.pageSize)
})
return
}
const modalInst = modal.create({
title: "确认提示",
content: "确认删除所选过滤条件吗?",
positiveText: "确定",
negativeText: "取消",
preset: "dialog",
title: '确认提示',
content: '确认删除所选过滤条件吗?',
positiveText: '确定',
negativeText: '取消',
preset: 'dialog',
onPositiveClick: () =>
deleteCondition({ ids: selectionIds.value.join(",") }).then(() => {
selectionIds.value = [];
query(pagination.page, pagination.pageSize);
deleteCondition({ ids: selectionIds.value.join(',') }).then(() => {
selectionIds.value = []
query(pagination.page, pagination.pageSize)
}),
onNegativeClick: () => modalInst.destroy(),
});
})
}
async function handlePageChange(currentPage) {
if (loading.value) return;
pagination.page = currentPage;
const { pageSize } = pagination;
await query(currentPage, pageSize);
if (loading.value)
return
pagination.page = currentPage
const { pageSize } = pagination
await query(currentPage, pageSize)
}
async function handlePageSizeChange(currentPageSize) {
if (loading.value) return;
if (loading.value)
return
const { page } = pagination;
pagination.pageSize = currentPageSize;
await query(page, currentPageSize);
const { page } = pagination
pagination.pageSize = currentPageSize
await query(page, currentPageSize)
}
function handleClick() {
emit("showNewFilter");
closeModal();
emit('showNewFilter')
closeModal()
}
let sortTable: Sortable | null = null;
const tableRef = ref<InstanceType<typeof NDataTable>>();
let sortTable: Sortable | null = null
const tableRef = ref<InstanceType<typeof NDataTable>>()
async function showModal() {
show.value = true;
show.value = true
const { page, pageSize } = pagination;
await query(page, pageSize);
const { page, pageSize } = pagination
await query(page, pageSize)
nextTick(() => {
if (sortTable !== null) destory();
const el: HTMLDivElement = tableRef.value?.$el;
const tbody: HTMLElement | null = el.querySelector("tbody.n-data-table-tbody")!;
if (tbody) sortTable = Sortable.create(tbody, { onEnd, onMove });
});
if (sortTable !== null)
destory()
const el: HTMLDivElement = tableRef.value?.$el
const tbody: HTMLElement | null = el.querySelector('tbody.n-data-table-tbody')!
if (tbody)
sortTable = Sortable.create(tbody, { onEnd, onMove })
})
}
let relatedId = "";
let insertafter = false;
let relatedId = ''
let insertafter = false
// TODO: bug
function onEnd(event: SortableEvent) {
const data = unref(tableData);
const oldElem = data[event.oldIndex!];
data.splice(event.oldIndex!, 1);
data.splice(event.newIndex!, 0, oldElem);
const data = unref(tableData)
const oldElem = data[event.oldIndex!]
data.splice(event.oldIndex!, 1)
data.splice(event.newIndex!, 0, oldElem)
const dragId = oldElem.id;
const dragId = oldElem.id
const index = data.findIndex((item) => {
return item.id === relatedId;
});
return item.id === relatedId
})
// -1+1
const order = insertafter ? index - 1 : index + 1;
const order = insertafter ? index - 1 : index + 1
// console.log('dragid:', dragId, 'order:', order)
sort(dragId, order);
sort(dragId, order)
}
function onMove(evt: any) {
relatedId = evt.related?.dataset?.id;
insertafter = evt.willInsertAfter;
relatedId = evt.related?.dataset?.id
insertafter = evt.willInsertAfter
// console.log(`${evt.dragged.dataset.id},${evt.related}`, 'insertafter', evt.willInsertAfter)
}
function destory() {
sortTable && sortTable.destroy();
sortTable = null;
sortTable && sortTable.destroy()
sortTable = null
}
onUnmounted(() => {
destory();
});
destory()
})
function closeModal() {
selectionIds.value = [];
show.value = false;
selectionIds.value = []
show.value = false
}
defineExpose({
showModal,
query,
pagination,
});
})
const inputHandler = debounce((word) => {
keyword.value = word;
query(1, 5);
}, 300);
keyword.value = word
query(1, 5)
}, 300)
const showSearch = computed(() => {
return selectionIds.value.length > 0;
});
return selectionIds.value.length > 0
})
const handleOk = () => {
function handleOk() {
if (selectionIds.value.length > 1) {
$message.error("只能选择一条筛选条件");
return;
$message.error('只能选择一条筛选条件')
return
}
if (selectionIds.value.length == 1) {
const selectedId = selectionIds.value[0];
let item = tableData.value.find((v) => v.id == selectedId);
emit("handleOk", item);
}
if (selectionIds.value.length == 0) {
emit("handleOk", "");
const selectedId = selectionIds.value[0]
const item = tableData.value.find(v => v.id == selectedId)
emit('handleOk', item)
}
closeModal();
};
if (selectionIds.value.length == 0)
emit('handleOk', '')
closeModal()
}
</script>
<template>
@ -374,9 +383,9 @@ const handleOk = () => {
v-model:show="show"
transform-origin="center"
display-directive="if"
@after-leave="afterLeave"
:mask-closable="false"
class="modal_wrapper"
@after-leave="afterLeave"
>
<n-card
:style="cardStyle"
@ -396,8 +405,7 @@ const handleOk = () => {
'font-weight': '600',
}"
class="wrapper-info-title"
>基本信息</span
>
>基本信息</span>
</div>
</div>
@ -429,13 +437,11 @@ const handleOk = () => {
</n-button>
</div>
<div class="msg">
<span
>已选中
<span>已选中
<span style="color: #507afd; font-size: 16px">{{
selectionIds.length
}}</span>
</span
>
</span>
<a @click="selectionIds = []">清空</a>
</div>
</div>

@ -1,106 +1,107 @@
<script lang="ts" setup>
import type { FormInst, FormItemRule, FormRules } from "naive-ui";
import { computed, defineOptions, onBeforeMount, reactive, ref, unref, watch } from "vue";
import { asideMap } from "@/config/aside";
import { useDictionary } from "@/store/modules/dictonary";
import { useConfig } from "@/store/modules/asideConfig";
import type { FilterCondition } from "/#/api";
import { addCondition, updateCondition } from "@/api/home/filter";
import { formatToDate2, formatToDate3 } from "@/utils/dateUtil";
type Status = "edit" | "new";
const emit = defineEmits(["onOk"]);
const show = ref(false);
const configStore = useConfig();
const dicStore = useDictionary();
const currentStatus = ref<Status>("new");
let currentEditId: string | null = null;
import type { FormInst, FormItemRule, FormRules } from 'naive-ui'
import { computed, defineOptions, onBeforeMount, reactive, ref, unref, watch } from 'vue'
import { asideMap } from '@/config/aside'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import type { FilterCondition } from '/#/api'
import { addCondition, updateCondition } from '@/api/home/filter'
import { formatToDate2, formatToDate3 } from '@/utils/dateUtil'
type Status = 'edit' | 'new'
const emit = defineEmits(['onOk'])
const show = ref(false)
const configStore = useConfig()
const dicStore = useDictionary()
const currentStatus = ref<Status>('new')
let currentEditId: string | null = null
const modalTitle = computed(() => {
return currentStatus.value === "new" ? "新建过滤条件" : "编辑过滤条件";
});
return currentStatus.value === 'new' ? '新建过滤条件' : '编辑过滤条件'
})
const cardStyle = {
width: "800px",
"--n-padding-bottom": "10px",
"--n-padding-left": "10px",
};
'width': '800px',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
}
const noBorderInput = {
"--n-border": "0px",
"--n-border-hover": "0px",
"--n-border-pressed": "0px",
};
'--n-border': '0px',
'--n-border-hover': '0px',
'--n-border-pressed': '0px',
}
const formItemStyle = {
"--n-label-height": "0px",
"--n-feedback-height": "8px",
};
'--n-label-height': '0px',
'--n-feedback-height': '8px',
}
interface FormType {
name: string | null;
logic: string | null;
conditions: Condition[];
name: string | null
logic: string | null
conditions: Condition[]
}
interface Condition {
type: string | null;
operator: string | null;
result: any;
type: string | null
operator: string | null
result: any
}
interface Option {
label: string;
value: string;
label: string
value: string
}
const rules: FormRules = {
name: {
required: true,
message: "请输入过滤条件名称",
trigger: "blur",
message: '请输入过滤条件名称',
trigger: 'blur',
},
logic: {
required: true,
message: "请选择逻辑关系",
trigger: "blur",
message: '请选择逻辑关系',
trigger: 'blur',
},
conditions: {
required: true,
validator(rule: FormItemRule, value: Condition[]) {
for (const item of value) {
const { type, operator, result } = item;
const { type, operator, result } = item
if (type === null || operator === null || result === null)
return new Error("请选择过滤条件");
return new Error('请选择过滤条件')
}
return true;
return true
},
trigger: ["input", "blur"],
trigger: ['input', 'blur'],
},
};
}
const formRef = ref<FormInst | null>(null);
const formRef = ref<FormInst | null>(null)
const formValue = reactive<FormType>({
name: null,
logic: "and",
logic: 'and',
conditions: [
{
type: null,
operator: "eq",
operator: 'eq',
result: null,
},
],
});
})
function handleSumbit(e: MouseEvent) {
e.preventDefault();
e.preventDefault()
formRef.value?.validate((errors) => {
if (errors) return;
if (errors)
return
const list = formValue.conditions.map((item, index) => {
const { type, operator, result } = item;
const { type, operator, result } = item
return {
searchfield: type!,
@ -108,199 +109,202 @@ function handleSumbit(e: MouseEvent) {
searchvalue: formatValue(type!, result),
searchRelationType: formValue.logic!,
orderNum: index + 1,
};
});
}
})
const param: FilterCondition = {
searchname: formValue.name!,
type: 0,
ocrUsersearchchildList: list,
};
}
if (currentStatus.value === "new") addCondition(param);
else updateCondition({ id: currentEditId!, ...param });
closeModal();
});
if (currentStatus.value === 'new')
addCondition(param)
else updateCondition({ id: currentEditId!, ...param })
closeModal()
})
}
//
function formatValue(searchfield: string, searchvalue: any) {
if (searchfield === "izyear") {
const start = formatToDate2(searchvalue[0]);
const end = formatToDate2(searchvalue[1]);
return `${start}-${end}`;
if (searchfield === 'izyear') {
const start = formatToDate2(searchvalue[0])
const end = formatToDate2(searchvalue[1])
return `${start}-${end}`
}
if (searchfield === "izsimilarity" && Array.isArray(searchvalue))
return searchvalue.join(",");
if (searchfield === 'izsimilarity' && Array.isArray(searchvalue))
return searchvalue.join(',')
return searchvalue;
return searchvalue
}
//
function unformatValue(searchfield: string, searchvalue: any) {
// 2022/01/03-2023/02/04
if (searchfield === "izyear") {
const dataStrs = searchvalue.split("-");
const start = formatToDate3(dataStrs[0]);
const end = formatToDate3(dataStrs[1]);
return [start, end];
if (searchfield === 'izyear') {
const dataStrs = searchvalue.split('-')
const start = formatToDate3(dataStrs[0])
const end = formatToDate3(dataStrs[1])
return [start, end]
}
// 80,90
// if (searchfield === "izsimilarity") return searchvalue.split(",");
return searchvalue;
return searchvalue
}
function createCondition() {
formValue.conditions.push({
type: null,
operator: "eq",
operator: 'eq',
result: null,
});
})
}
function removeCondition(index: number) {
formValue.conditions.splice(index, 1);
formValue.conditions.splice(index, 1)
}
function formLabel(index: number) {
return index === 0 ? "筛选条件" : "";
return index === 0 ? '筛选条件' : ''
}
const typeOptions = ref<Option[]>([]);
const typeOptions = ref<Option[]>([])
const operatorOptions = [
{
label: "等于",
value: "eq",
label: '等于',
value: 'eq',
},
{
label: "不等于",
value: "notEq",
label: '不等于',
value: 'notEq',
},
];
]
const logicOptions = ref([]);
const logicOptions = ref([])
const similarityOptions = [
{
label: "80%-90%",
value: "80,90",
label: '80%-90%',
value: '80,90',
},
{
label: "95%-100%",
value: "95,100",
label: '95%-100%',
value: '95,100',
},
{
label: "100%-100%",
value: "100,100",
label: '100%-100%',
value: '100,100',
},
];
]
onBeforeMount(() => {
dicStore.fetchRelationTypeList();
});
dicStore.fetchRelationTypeList()
})
watch(
() => dicStore.relationTypeList,
(newval) => {
logicOptions.value = newval;
}
);
logicOptions.value = newval
},
)
function showModal() {
const list = generateAllData(configStore.systemConfig);
typeOptions.value = list;
show.value = true;
const list = generateAllData(configStore.systemConfig)
typeOptions.value = list
show.value = true
}
function closeModal() {
emit("onOk");
emit('onOk')
setTimeout(() => {
show.value = false;
}, 300);
show.value = false
}, 300)
}
function generateAllData(config): Option[] {
const initVal: Option[] = [];
const initVal: Option[] = []
const list = Object.keys(config).reduce((acc, value) => {
if (value.startsWith("iz") && asideMap[value]?.inFilterList !== false) {
const name = asideMap[value]?.label;
name &&
acc.push({
value,
label: name || "未配置",
});
if (value.startsWith('iz') && asideMap[value]?.inFilterList !== false) {
const name = asideMap[value]?.label
name
&& acc.push({
value,
label: name || '未配置',
})
}
return acc;
}, initVal);
return acc
}, initVal)
return list;
return list
}
watch(
() => configStore.systemConfig,
(newVal) => {
if (!newVal) return;
if (!newVal)
return
const list = generateAllData(newVal);
typeOptions.value = list;
}
);
const list = generateAllData(newVal)
typeOptions.value = list
},
)
function getOptions(key: string) {
if (key === "izsimilarity") return similarityOptions;
const getterName = `get${key}`;
const options = unref(dicStore[getterName]);
return options || [];
if (key === 'izsimilarity')
return similarityOptions
const getterName = `get${key}`
const options = unref(dicStore[getterName])
return options || []
}
function leaveHandler() {
currentStatus.value = "new";
currentEditId = null;
currentStatus.value = 'new'
currentEditId = null
formValue.name = null;
formValue.name = null
formValue.conditions = [
{
type: null,
operator: "eq",
operator: 'eq',
result: null,
},
];
]
}
function edit(editFilter: any) {
currentStatus.value = "edit";
console.log(editFilter, "editFilter");
const { searchname, ocrUsersearchchildList, id } = editFilter;
currentEditId = id;
formValue.name = searchname;
currentStatus.value = 'edit'
console.log(editFilter, 'editFilter')
const { searchname, ocrUsersearchchildList, id } = editFilter
currentEditId = id
formValue.name = searchname
formValue.conditions = ocrUsersearchchildList.map((item) => {
return {
type: item.searchfield,
operator: item.searchtype,
result: unformatValue(item.searchfield, item.searchvalue),
};
});
}
})
}
defineExpose({
showModal,
edit,
});
})
</script>
<template>
<n-modal
v-model:show="show"
transform-origin="center"
@after-leave="leaveHandler"
:mask-closable="false"
class="modal_wrapper"
@after-leave="leaveHandler"
>
<n-card
:style="cardStyle"
@ -319,20 +323,19 @@ defineExpose({
'font-size': '16px',
'font-weight': '600',
}"
>基本信息</span
>
>基本信息</span>
</div>
</div>
<div class="wrapper-form">
<n-form ref="formRef" :model="formValue" :rules="rules" >
<n-form-item path="name" label="标题" mergedRequireMarkPlacement="left">
<n-form ref="formRef" :model="formValue" :rules="rules">
<n-form-item path="name" label="标题" merged-require-mark-placement="left">
<!-- j -->
<n-input
v-model:value="formValue.name"
:style="{ width: '780px' }"
maxlength="15"
@keydown.enter.prevent
placeholder="请输入过滤名称"
@keydown.enter.prevent
/>
</n-form-item>
<n-form-item v-show="false" path="logic" label="逻辑关系">
@ -418,12 +421,12 @@ defineExpose({
y="0"
width="64"
height="64"
></rect>
/>
<path
d="M32,4 C16.5619675,4 4,16.5600322 4,32 C4,47.4399678 16.5600322,60 32,60 C47.4380325,60 60,47.4399678 60,32 C60,16.5600322 47.4399678,4 32,4 Z M43.4220132,40.6240021 C44.2020159,41.4079827 44.1999731,42.6720064 43.4180353,43.4520091 C43.0280877,43.8400215 42.5180487,44.0360166 42.0060745,44.0360166 C41.4920576,44.0360166 40.9800834,43.8400214 40.5900283,43.4480311 L31.9900014,34.8219862 L23.3620213,43.3580432 C22.9720737,43.7420776 22.4639699,43.9360301 21.9559737,43.9360301 C21.4400215,43.9360301 20.9260046,43.7379922 20.5340143,43.3420239 C19.7579895,42.5560005 19.7640102,41.2919768 20.5500336,40.5140169 L29.1680151,31.9900013 L20.5819648,23.3759978 C19.8019621,22.5939524 19.8040049,21.3279935 20.5859428,20.5479908 C21.3679882,19.7659454 22.6319043,19.7700309 23.4139498,20.5519687 L32.0119339,29.1759709 L40.639914,20.6400214 C41.4238946,19.8620614 42.6918962,19.8700173 43.467921,20.6560407 C44.2458809,21.4420641 44.2379251,22.708023 43.4519016,23.4840477 L34.8340277,32.0079559 L43.4220132,40.6240021 Z"
id="形状"
d="M32,4 C16.5619675,4 4,16.5600322 4,32 C4,47.4399678 16.5600322,60 32,60 C47.4380325,60 60,47.4399678 60,32 C60,16.5600322 47.4399678,4 32,4 Z M43.4220132,40.6240021 C44.2020159,41.4079827 44.1999731,42.6720064 43.4180353,43.4520091 C43.0280877,43.8400215 42.5180487,44.0360166 42.0060745,44.0360166 C41.4920576,44.0360166 40.9800834,43.8400214 40.5900283,43.4480311 L31.9900014,34.8219862 L23.3620213,43.3580432 C22.9720737,43.7420776 22.4639699,43.9360301 21.9559737,43.9360301 C21.4400215,43.9360301 20.9260046,43.7379922 20.5340143,43.3420239 C19.7579895,42.5560005 19.7640102,41.2919768 20.5500336,40.5140169 L29.1680151,31.9900013 L20.5819648,23.3759978 C19.8019621,22.5939524 19.8040049,21.3279935 20.5859428,20.5479908 C21.3679882,19.7659454 22.6319043,19.7700309 23.4139498,20.5519687 L32.0119339,29.1759709 L40.639914,20.6400214 C41.4238946,19.8620614 42.6918962,19.8700173 43.467921,20.6560407 C44.2458809,21.4420641 44.2379251,22.708023 43.4519016,23.4840477 L34.8340277,32.0079559 L43.4220132,40.6240021 Z"
fill="#DDDDDD"
></path>
/>
</g>
</g>
</g>

File diff suppressed because it is too large Load Diff

@ -1,54 +1,54 @@
<script lang="ts" setup>
import { defineOptions, onMounted, ref, onBeforeUnmount } from "vue";
import { useRouter } from "vue-router";
import { defineOptions, onBeforeUnmount, onMounted, ref } from 'vue'
import { useRouter } from 'vue-router'
defineOptions({ name: "ShortcutModal" });
defineOptions({ name: 'ShortcutModal' })
const emit = defineEmits<{
(e: "refresh", value: any);
(e: "cancel", value: any);
}>();
(e: 'refresh', value: any)
(e: 'cancel', value: any)
}>()
const show = ref(false);
const isFold = ref(false);
const router = useRouter();
const show = ref(false)
const isFold = ref(false)
const router = useRouter()
const cardStyle = {
width: "29vw",
"--n-padding-bottom": "10px",
"--n-padding-left": "10px",
};
'width': '29vw',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
}
function toggle() {
isFold.value = !isFold.value;
isFold.value = !isFold.value
}
function showModal() {
show.value = true;
show.value = true
}
function closeModal() {
show.value = false;
show.value = false
}
function refresh() {
emit("refresh", true);
emit('refresh', true)
}
function cancel() {
closeModal();
emit("cancel", true);
closeModal()
emit('cancel', true)
}
const time = ref();
const time = ref()
onMounted(() => {
time.value = setInterval(() => {
// console.log("00000000-----------");
show.value && refresh();
}, 5000);
});
show.value && refresh()
}, 5000)
})
onBeforeUnmount(() => {
clearInterval(time.value);
time.value = null;
});
clearInterval(time.value)
time.value = null
})
defineExpose({
showModal,
closeModal,
});
})
</script>
<template>
@ -75,13 +75,15 @@ defineExpose({
style="padding: 8px 8px 0 8px"
>
<div class="wrapper">
<div class="title">查重进度</div>
<div class="title">
查重进度
</div>
<div class="icon-list">
<svg-icon
size="16"
name="refresh"
@click="refresh"
style="margin-right: 16px; cursor: pointer"
@click="refresh"
/>
<svg-icon
v-show="!isFold"
@ -100,8 +102,8 @@ defineExpose({
<svg-icon
size="16"
name="close-none-border"
@click="cancel"
style="margin-right: 25.7px; cursor: pointer"
@click="cancel"
/>
</div>
</div>

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { defineOptions, ref } from 'vue';
import { useRouter } from 'vue-router';
import { defineOptions, ref } from 'vue'
import { useRouter } from 'vue-router'
defineOptions({ name: 'ShortcutModal' })
@ -9,7 +9,7 @@ const props = defineProps({
type: String,
default: '',
},
});
})
const show = ref(false)
const router = useRouter()
@ -26,11 +26,10 @@ function showModal() {
function closeModal(path) {
show.value = false
if(props.id) {
router.push(path + '?id=' + props.id)
}else {
if (props.id)
router.push(`${path}?id=${props.id}`)
else
router.push(path)
}
}
function closeIconModal() {
@ -43,7 +42,7 @@ defineExpose({
</script>
<template>
<div class="finish-package-modal" v-if="show">
<div v-if="show" class="finish-package-modal">
<!-- <n-modal v-model:show="show" :mask-closable="false" transform-origin="center" style="padding: 8px;">
<n-card :style="cardStyle" :bordered="false" size="huge" role="dialog" aria-modal="true">
<div style="display: flex;">
@ -67,10 +66,16 @@ defineExpose({
</n-card>
</n-modal> -->
<div class="header-box">
<div class="robot-box"><svg-icon size="80" name="robot-two" /></div>
<div class="robot-box">
<svg-icon size="80" name="robot-two" />
</div>
<div class="text-box">
<div class="msg-title">生成成功提示</div>
<div class="msg-text">AI助手已根据您的配置要求生成任务包</div>
<div class="msg-title">
生成成功提示
</div>
<div class="msg-text">
AI助手已根据您的配置要求生成任务包
</div>
</div>
<div class="close-box" @click="closeIconModal">
<svg-icon size="30" name="close-none-border" />

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { defineOptions, ref } from 'vue';
import { useRouter } from 'vue-router';
import { defineOptions, ref } from 'vue'
import { useRouter } from 'vue-router'
defineOptions({ name: 'ShortcutModal' })
@ -34,8 +34,12 @@ defineExpose({
<div style="display: flex;">
<div><svg-icon size="80" name="robot2" /></div>
<div style="height: 130px;text-align: center;margin-left: 20px;">
<div class="msg-title">生成任务提示</div>
<div class="msg-text">AI已根据您的配置要求生成任务包</div>
<div class="msg-title">
生成任务提示
</div>
<div class="msg-text">
AI已根据您的配置要求生成任务包
</div>
</div>
</div>
@ -78,5 +82,4 @@ defineExpose({
color: #666666;
line-height: 22px;
}
</style>

@ -1,81 +1,102 @@
<script lang="ts" setup>
import { onMounted, ref } from "vue";
import { getToolsCount } from "@/api/home/main";
import { onMounted, ref } from 'vue'
import { getToolsCount } from '@/api/home/main'
const emit = defineEmits<{
(e: "reject", params: any);
(e: "viewrepeat");
}>();
(e: 'reject', params: any)
(e: 'viewrepeat')
}>()
const show = ref(false);
const toolsData = ref({} as any);
const show = ref(false)
const toolsData = ref({} as any)
async function getData() {
const res = await getToolsCount();
toolsData.value = res.data || {};
if (res.code == "OK") {
showModal();
}
const res = await getToolsCount()
toolsData.value = res.data || {}
if (res.code == 'OK')
showModal()
}
onMounted(() => {
getData();
});
getData()
})
function showModal() {
show.value = true;
show.value = true
}
function closeModal() {
show.value = false;
show.value = false
}
async function reject() {
emit("reject", { a: "todo" });
closeModal();
emit('reject', { a: 'todo' })
closeModal()
}
async function viewRepeat(e: MouseEvent) {
emit("viewrepeat");
e.preventDefault();
closeModal();
emit('viewrepeat')
e.preventDefault()
closeModal()
}
defineExpose({
showModal,
});
})
</script>
<template>
<n-modal v-model:show="show" transform-origin="center" class="modal_wrap">
<div class="wrapper">
<div class="wrapper-hearder">
<div class="wrapper-title">欢迎登录智能AI审批工具</div>
<div class="wrapper-mark">某某有限公司-某某事业部-张小凡</div>
<div class="wrapper-title">
欢迎登录智能AI审批工具
</div>
<div class="wrapper-mark">
某某有限公司-某某事业部-张小凡
</div>
</div>
<div class="wrapper-content">
<div class="flex_box">
<div class="item">
<SvgIcon name="task_count" width="49" height="58" />
<div class="num_box">{{ toolsData?.total || 0 }}</div>
<div class="title_box">任务总数</div>
<div class="num_box">
{{ toolsData?.total || 0 }}
</div>
<div class="title_box">
任务总数
</div>
</div>
<div class="item">
<SvgIcon name="task_wait" width="49" height="58" />
<div class="num_box">{{ toolsData?.treat || 0 }}</div>
<div class="title_box">待审批</div>
<div class="num_box">
{{ toolsData?.treat || 0 }}
</div>
<div class="title_box">
待审批
</div>
</div>
<div class="item">
<SvgIcon name="task_over" width="49" height="58" />
<div class="num_box">{{ toolsData?.approvedCount || 0 }}</div>
<div class="title_box">已审批</div>
<div class="num_box">
{{ toolsData?.approvedCount || 0 }}
</div>
<div class="title_box">
已审批
</div>
</div>
<div class="item">
<SvgIcon name="modal_reImg" width="49" height="58" />
<div class="num_box">{{ toolsData?.repeat }}</div>
<div class="title_box">重复图片</div>
<div class="num_box">
{{ toolsData?.repeat }}
</div>
<div class="title_box">
重复图片
</div>
</div>
</div>
<div class="footer" @click="viewRepeat"></div>
<div class="footer" @click="viewRepeat">
我知道了
</div>
<!-- <div class="footer">
<SvgIcon
@click="viewRepeat"

@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { FormInst, FormRules } from 'naive-ui';
import { useMessage } from 'naive-ui';
import { ref } from 'vue';
import type { FormInst, FormRules } from 'naive-ui'
import { useMessage } from 'naive-ui'
import { ref } from 'vue'
const emit = defineEmits<{
(e: 'commit', value: any)
@ -77,11 +77,11 @@ function afterLeave() {
<span class="wrapper-title">生成任务包设置</span>
<div class="wrapper-bar">
<div class="wrapper-info">
<span :style="{ 'margin-left': '18px', 'font-size': '16px','font-weight':'600' }">基本信息</span>
<span :style="{ 'margin-left': '18px', 'font-size': '16px', 'font-weight': '600' }">基本信息</span>
</div>
</div>
<!-- require-mark-placement="left" -->
<n-form ref="formRef" :model="model" style="margin-top: 8px;" :rules="rules">
<n-form ref="formRef" :model="model" style="margin-top: 8px;" :rules="rules">
<n-form-item class="wrapper-task-package-name" path="packagename" label="任务包名称">
<n-input v-model:value="model.packagename" maxlength="12" @keydown.enter.prevent />
</n-form-item>

@ -1,50 +1,50 @@
<script lang="ts" setup>
import { ref } from "vue";
import { useConfig } from "@/store/modules/asideConfig";
import { ref } from 'vue'
import { useConfig } from '@/store/modules/asideConfig'
const emit = defineEmits<{
(e: "closeCallback", value: any);
}>();
(e: 'closeCallback', value: any)
}>()
const show = ref(false);
const show = ref(false)
const stys = {
width: "424px",
height: "232px",
"--n-padding-bottom": "20px",
"--n-padding-left": "0px",
background:
"linear-gradient(132deg, rgba(255, 255, 255, 0.32) 21%, rgba(152, 172, 255, 0.14) 100%)",
"border-radius": "4px",
"box-shadow": "0px 12px 48px 16px rgba(0, 0, 0, 0.03)",
"backdrop-filter": " blur(10px)",
};
'width': '424px',
'height': '232px',
'--n-padding-bottom': '20px',
'--n-padding-left': '0px',
'background':
'linear-gradient(132deg, rgba(255, 255, 255, 0.32) 21%, rgba(152, 172, 255, 0.14) 100%)',
'border-radius': '4px',
'box-shadow': '0px 12px 48px 16px rgba(0, 0, 0, 0.03)',
'backdrop-filter': ' blur(10px)',
}
function showModal() {
show.value = true;
show.value = true
}
function closeModal() {
show.value = false;
emit("closeCallback", true);
show.value = false
emit('closeCallback', true)
}
function closeOnlyModal() {
show.value = false;
show.value = false
}
defineExpose({
showModal,
closeModal,
closeOnlyModal,
});
})
const configStore = useConfig();
const percent = ref(0);
const configStore = useConfig()
const percent = ref(0)
configStore.$subscribe(() => {
percent.value = configStore.getTimeNum;
});
percent.value = configStore.getTimeNum
})
</script>
<template>
@ -58,8 +58,8 @@ configStore.$subscribe(() => {
<svg-icon
size="15"
name="close"
@click="closeModal"
style="position: absolute; right: 15.7px; top: 6px; cursor: pointer"
@click="closeModal"
/>
<div class="wrapper">
<svg-icon size="90" name="robot2" />

@ -1,14 +1,14 @@
<script lang="ts" setup>
import { ref } from 'vue'
import Aside from './aside/Aside.vue'
import Content from './content/Content.vue'
import Robot from '@/components/Robot/index.vue'
import {ref} from 'vue';
const contentRef:any = ref(null)
const showLoginModal = ()=>{
contentRef.value.showLoginSuccessModal();
}
const contentRef: any = ref(null)
function showLoginModal() {
contentRef.value.showLoginSuccessModal()
}
</script>
<template>
@ -17,7 +17,7 @@ const showLoginModal = ()=>{
<Aside />
<!-- 内容 -->
<Content ref="contentRef"/>
<Content ref="contentRef" />
<!-- 机器人 -->
<!-- <Robot :canClick="true" @click="showLoginModal"/> -->

@ -1,281 +1,285 @@
<script lang="ts" setup>
import { reactive, ref } from "vue";
import { useMessage } from "naive-ui";
import { forgetPassword, getCode, updateSUser } from "@/api/login/login";
import { reactive, ref } from 'vue'
import { useMessage } from 'naive-ui'
import { forgetPassword, getCode, updateSUser } from '@/api/login/login'
const emit = defineEmits(["close", "forget"]);
const emit = defineEmits(['close', 'forget'])
interface FormState {
enterprisecode?: string;
username: string;
password: string;
captcha: string;
enterprisecode?: string
username: string
password: string
captcha: string
}
interface FormForget {
agentcode: string;
loginname: string;
phone: string;
phonecode: string;
agentcode: string
loginname: string
phone: string
phonecode: string
}
interface FormSure {
newPassword: string;
rePasswrod: string;
loginname: string;
newPassword: string
rePasswrod: string
loginname: string
}
const formRef = ref();
const formRefSure = ref();
const formRef = ref()
const formRefSure = ref()
const message = useMessage();
const loading = ref(false);
const flag = ref(true);
const message = useMessage()
const loading = ref(false)
const flag = ref(true)
const formForget: FormForget = reactive({
agentcode: "",
loginname: "",
phone: "",
phonecode: "",
});
agentcode: '',
loginname: '',
phone: '',
phonecode: '',
})
const formInline: FormState = reactive({
enterprisecode: "",
username: "",
password: "",
captcha: "",
});
enterprisecode: '',
username: '',
password: '',
captcha: '',
})
const formSure: FormSure = reactive({
newPassword: "",
rePasswrod: "",
loginname: "13311111111",
});
const tab = ref(0);
const loginSuccess = ref(true);
const loginRejectMessge = ref("");
const countTime = ref("获取验证码");
newPassword: '',
rePasswrod: '',
loginname: '13311111111',
})
const tab = ref(0)
const loginSuccess = ref(true)
const loginRejectMessge = ref('')
const countTime = ref('获取验证码')
const rules = {
enterprisecode: [
{ required: true, message: "请输入企业编码", trigger: "blur" },
{ required: true, message: '请输入企业编码', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("企业") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('企业'))
return new Error(loginRejectMessge.value)
},
},
],
agentcode: [
{ required: true, message: "请输入企业编码", trigger: "blur" },
{ required: true, message: '请输入企业编码', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("企业") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('企业'))
return new Error(loginRejectMessge.value)
},
},
],
loginname: [
{ required: true, message: "请输入用户名", trigger: "blur" },
{ required: true, message: '请输入用户名', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("用户名") > -1||loginRejectMessge.value.indexOf("账号") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('用户名') || loginRejectMessge.value.includes('账号'))
return new Error(loginRejectMessge.value)
},
},
],
phone: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ required: true, message: '请输入手机号', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("手机号") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('手机号'))
return new Error(loginRejectMessge.value)
},
},
],
password: { required: true, message: "请输入密码", trigger: "blur" },
password: { required: true, message: '请输入密码', trigger: 'blur' },
phonecode: [
{ required: true, message: "请输入验证码", trigger: "blur" },
{ required: true, message: '请输入验证码', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("验证码") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('验证码'))
return new Error(loginRejectMessge.value)
},
},
],
newPassword: { required: true, message: "请输入新密码", trigger: "blur" },
newPassword: { required: true, message: '请输入新密码', trigger: 'blur' },
rePasswrod: [
{
required: true,
message: "请再次输入密码",
trigger: ["input", "blur"],
message: '请再次输入密码',
trigger: ['input', 'blur'],
},
{
validator: validatePasswordSame,
message: "两次密码输入不一致",
trigger: ["blur", "password-input"],
message: '两次密码输入不一致',
trigger: ['blur', 'password-input'],
},
],
};
}
function validatePasswordSame(rule: any, value: string): boolean {
if (Boolean(formSure.rePasswrod)) {
if (value == formSure.newPassword) {
return true;
} else {
return false;
}
} else {
return true;
if (formSure.rePasswrod) {
if (value == formSure.newPassword)
return true
else
return false
}
else {
return true
}
}
function handleSubmit(e) {
e.preventDefault();
loginSuccess.value = true;
e.preventDefault()
loginSuccess.value = true
formRef.value.validate(async (errors) => {
if (!errors) {
const { loginname, phone, phonecode, agentcode } = formForget;
loading.value = true;
const { loginname, phone, phonecode, agentcode } = formForget
loading.value = true
const params = {
loginname,
phone,
phonecode,
agentcode,
};
}
try {
const res = await forgetPassword(params);
if (res.code === "OK") {
loginSuccess.value = true;
formSure.loginname = res.data?.loginname;
tab.value = 1;
} else {
loginSuccess.value = false;
message.error(res.message);
loginRejectMessge.value = res.message;
formRef.value.validate();
const res = await forgetPassword(params)
if (res.code === 'OK') {
loginSuccess.value = true
formSure.loginname = res.data?.loginname
tab.value = 1
}
} finally {
loading.value = false;
else {
loginSuccess.value = false
message.error(res.message)
loginRejectMessge.value = res.message
formRef.value.validate()
}
}
finally {
loading.value = false
}
}
});
})
}
function handleSure(e) {
e.preventDefault();
e.preventDefault()
formRefSure.value.validate(async (errors) => {
if (!errors) {
const { newPassword, rePasswrod, loginname } = formSure;
loading.value = true;
const { newPassword, rePasswrod, loginname } = formSure
loading.value = true
const params = {
newPassword,
rePasswrod,
loginname,
};
}
try {
const res = await updateSUser(params);
if (res.code === "OK") {
message.success("修改成功");
tab.value = 0;
forget();
} else {
message.error(res.message);
const res = await updateSUser(params)
if (res.code === 'OK') {
message.success('修改成功')
tab.value = 0
forget()
}
else {
message.error(res.message)
}
} finally {
loading.value = false;
}
finally {
loading.value = false
}
}
});
})
}
function close() {
loading.value = false;
emit("close");
loading.value = false
emit('close')
}
function switchTab(type: number) {
tab.value = type;
tab.value = type
}
function computedForm() {
return !formForget.phonecode || !formForget.phone || !formForget.loginname || !formForget.agentcode;
return !formForget.phonecode || !formForget.phone || !formForget.loginname || !formForget.agentcode
}
function computedFormSure() {
return !formSure.newPassword || !formSure.rePasswrod;
return !formSure.newPassword || !formSure.rePasswrod
}
async function sendCode(value) {
if (!flag.value) return;
flag.value = false;
if(!(formForget.phone.length == 11)){
if (!flag.value)
return
}
flag.value = false
if (!(formForget.phone.length == 11))
return
const res = await getCode({
phone: formForget.phone,
agentcode: formForget.agentcode,
});
})
if (!res.data) {
message.error(res.message);
return;
message.error(res.message)
return
}
startCount();
startCount()
}
function startCount() {
let time = 60;
countTime.value = "60s";
let time = 60
countTime.value = '60s'
const timer = setInterval(() => {
countTime.value = `${--time}s`;
countTime.value = `${--time}s`
if (time === 0) {
clearInterval(timer);
countTime.value = "获取验证码";
flag.value = true;
clearInterval(timer)
countTime.value = '获取验证码'
flag.value = true
}
}, 1000);
}, 1000)
}
function forget() {
loading.value = false;
emit("forget");
loading.value = false
emit('forget')
}
</script>
<template>
<div class="form-login">
<img class="img-close" src="@/assets/images/login/close.png" alt="" @click="close" />
<img class="img-close" src="@/assets/images/login/close.png" alt="" @click="close">
<div class="flex justify-between header">
<div class="tab">忘记密码</div>
<div class="back" @click="forget">&lt; </div>
<div class="tab">
忘记密码
</div>
<div class="back" @click="forget">
&lt; 返回登录
</div>
</div>
<div v-if="tab === 0" class="form-1">
<n-form
@ -322,7 +326,7 @@ function forget() {
src="@/assets/images/login/phone.png"
alt=""
@click="close"
/>
>
</template>
</n-input>
</n-form-item>
@ -340,7 +344,7 @@ function forget() {
src="@/assets/images/login/auth.png"
alt=""
@click="close"
/>
>
</template>
<template #suffix>
<div

@ -1,344 +1,349 @@
<script lang="ts" setup>
import { computed, onMounted, reactive, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useMessage } from "naive-ui";
import { computed, onMounted, reactive, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useMessage } from 'naive-ui'
// import captcha from './captcha.vue'
import { PageEnum } from "@/enums/pageEnum";
import { useUserStore } from "@/store/modules/user";
import { ResultEnum } from "@/enums/httpEnum";
import { getCode, smsLogin } from "@/api/login/login";
import SvgIcon from "@/components/Icon/SvgIcon.vue";
import { PageEnum } from '@/enums/pageEnum'
import { useUserStore } from '@/store/modules/user'
import { ResultEnum } from '@/enums/httpEnum'
import { getCode, smsLogin } from '@/api/login/login'
import SvgIcon from '@/components/Icon/SvgIcon.vue'
const emit = defineEmits(["close", "forget"]);
const emit = defineEmits(['close', 'forget'])
interface FormState {
enterprisecode?: string;
username: string;
password: string;
enterprisecode?: string
username: string
password: string
}
interface FormSms {
agentcode: string;
phone: string;
phonecode: string;
agentcode: string
phone: string
phonecode: string
}
const formRef = ref();
const formRefSms = ref();
const message = useMessage();
const loading = ref(false);
const autoLogin = ref(false);
const LOGIN_NAME = PageEnum.BASE_LOGIN_NAME;
const userStore = useUserStore();
const router = useRouter();
const route = useRoute();
const show = ref(false);
const flag = ref(true);
const loginSuccess = ref(true);
const loginRejectMessge = ref("");
let formInline: FormState = reactive({
const formRef = ref()
const formRefSms = ref()
const message = useMessage()
const loading = ref(false)
const autoLogin = ref(false)
const LOGIN_NAME = PageEnum.BASE_LOGIN_NAME
const userStore = useUserStore()
const router = useRouter()
const route = useRoute()
const show = ref(false)
const flag = ref(true)
const loginSuccess = ref(true)
const loginRejectMessge = ref('')
const formInline: FormState = reactive({
// enterprisecode: "",
// username: "yanshi01",
// password: "123456",
enterprisecode: "",
username: "",
password: "",
});
let formSms: FormSms = reactive({
agentcode: "",
phone: "",
phonecode: "",
});
const tab = ref(0);
const countTime = ref("获取验证码");
enterprisecode: '',
username: '',
password: '',
})
const formSms: FormSms = reactive({
agentcode: '',
phone: '',
phonecode: '',
})
const tab = ref(0)
const countTime = ref('获取验证码')
const rules = {
enterprisecode: [
{ required: true, message: "请输入企业编码", trigger: "blur" },
{ required: true, message: '请输入企业编码', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("企业") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('企业'))
return new Error(loginRejectMessge.value)
},
},
],
agentcode: [
{ required: true, message: "请输入验证码", trigger: "blur" },
{ required: true, message: '请输入验证码', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("验证码") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('验证码'))
return new Error(loginRejectMessge.value)
},
},
],
phone: [
{ required: true, message: "请输入手机号", trigger: "blur" },
{ required: true, message: '请输入手机号', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("手机号") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('手机号'))
return new Error(loginRejectMessge.value)
},
},
],
phonecode: [
{ required: true, message: "请输入验证码", trigger: "blur" },
{ required: true, message: '请输入验证码', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (value.length < 4 && value.length > 0) {
return new Error("请正确填写4位手机短信验证码");
}
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("验证码") > -1) {
return new Error(loginRejectMessge.value);
}
if (value.length < 4 && value.length > 0)
return new Error('请正确填写4位手机短信验证码')
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('验证码'))
return new Error(loginRejectMessge.value)
},
},
],
username: [
{ required: true, message: "请输入账号", trigger: "blur" },
{ required: true, message: '请输入账号', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("账号") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('账号'))
return new Error(loginRejectMessge.value)
},
},
],
password: [
{ required: true, message: "请输入密码", trigger: "blur" },
{ required: true, message: '请输入密码', trigger: 'blur' },
{
trigger: ["blur", "input", "change"],
level: "error",
trigger: ['blur', 'input', 'change'],
level: 'error',
validator(_rule, value) {
if (loginSuccess.value || !value) {
return true;
}
if (loginRejectMessge.value.indexOf("密码") > -1) {
return new Error(loginRejectMessge.value);
}
if (loginSuccess.value || !value)
return true
if (loginRejectMessge.value.includes('密码'))
return new Error(loginRejectMessge.value)
},
},
],
captcha: [{ required: true, message: "请输入验证码", trigger: "blur" }],
};
captcha: [{ required: true, message: '请输入验证码', trigger: 'blur' }],
}
function handleSubmit(e) {
e.preventDefault();
loginSuccess.value = true;
e.preventDefault()
loginSuccess.value = true
formRef.value.validate(async (errors) => {
if (!errors) {
const { username, password, enterprisecode } = formInline;
message.loading("登录中...");
loading.value = true;
const { username, password, enterprisecode } = formInline
message.loading('登录中...')
loading.value = true
const params = {
username,
password,
codetoken: userStore.getCapToken,
agentcode: enterprisecode,
};
}
try {
const { code, message: msg } = await userStore.login(params);
loginRejectMessge.value = msg;
const { code, message: msg } = await userStore.login(params)
loginRejectMessge.value = msg
if (code === ResultEnum.SUCCESS) {
//
if (autoLogin.value) {
localStorage.setItem("LOGIN_FORM_PASS", JSON.stringify(formInline));
} else {
localStorage.removeItem("LOGIN_FORM_PASS");
}
loginSuccess.value = true;
const { data: userInfo } = await userStore.getInformation();
message.destroyAll();
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
if (route.name === LOGIN_NAME)
if (autoLogin.value)
localStorage.setItem('LOGIN_FORM_PASS', JSON.stringify(formInline))
else
localStorage.removeItem('LOGIN_FORM_PASS')
loginSuccess.value = true
const { data: userInfo } = await userStore.getInformation()
message.destroyAll()
const toPath = decodeURIComponent((route.query?.redirect || '/') as string)
if (route.name === LOGIN_NAME) {
if (userInfo.frontmenuTList && userInfo.frontmenuTList.length) {
message.success("登录成功,即将进入系统");
message.success('登录成功,即将进入系统')
router.replace(
userInfo.frontmenuTList ? userInfo.frontmenuTList[0]["resUrl"] : "/"
);
} else {
message.error("用户无菜单权限,请联系管理员");
userInfo.frontmenuTList ? userInfo.frontmenuTList[0].resUrl : '/',
)
}
else router.replace(toPath);
} else {
loginSuccess.value = false;
message.destroyAll();
message.info(msg || "登录失败");
formRef.value.validate();
else {
message.error('用户无菜单权限,请联系管理员')
}
}
else { router.replace(toPath) }
}
else {
loginSuccess.value = false
message.destroyAll()
message.info(msg || '登录失败')
formRef.value.validate()
}
} finally {
loading.value = false;
}
} else {
message.error("请填写完整信息,并且进行验证码校验");
finally {
loading.value = false
}
}
else {
message.error('请填写完整信息,并且进行验证码校验')
}
});
})
}
onMounted(() => {
let data: any = localStorage.getItem("LOGIN_FORM_SMS");
let data: any = localStorage.getItem('LOGIN_FORM_SMS')
if (data) {
data = JSON.parse(data) as any;
formSms.agentcode = data.agentcode;
formSms.phone = data.phone;
formSms.phonecode = "";
autoLogin.value = true;
data = JSON.parse(data) as any
formSms.agentcode = data.agentcode
formSms.phone = data.phone
formSms.phonecode = ''
autoLogin.value = true
}
data = localStorage.getItem("LOGIN_FORM_PASS");
data = localStorage.getItem('LOGIN_FORM_PASS')
if (data) {
data = JSON.parse(data) as any;
formInline.username = data.username;
formInline.password = "";
data = JSON.parse(data) as any
formInline.username = data.username
formInline.password = ''
// formInline.password = data.password;
formInline.enterprisecode = data.enterprisecode;
autoLogin.value = true;
formInline.enterprisecode = data.enterprisecode
autoLogin.value = true
}
});
})
function handleSmsSubmit(e) {
e.preventDefault();
loginSuccess.value = true;
e.preventDefault()
loginSuccess.value = true
formRefSms.value.validate(async (errors) => {
if (!errors) {
const { phone, agentcode, phonecode } = formSms;
message.loading("登录中...");
loading.value = true;
const { phone, agentcode, phonecode } = formSms
message.loading('登录中...')
loading.value = true
try {
const res = await smsLogin({
phone,
agentcode,
phonecode,
});
const { code, message: msg } = res;
loginRejectMessge.value = msg;
})
const { code, message: msg } = res
loginRejectMessge.value = msg
if (code === ResultEnum.SUCCESS) {
//
if (autoLogin.value) {
localStorage.setItem("LOGIN_FORM_SMS", JSON.stringify(formSms));
} else {
localStorage.removeItem("LOGIN_FORM_SMS");
}
loginSuccess.value = true;
if (autoLogin.value)
localStorage.setItem('LOGIN_FORM_SMS', JSON.stringify(formSms))
else
localStorage.removeItem('LOGIN_FORM_SMS')
loginSuccess.value = true
// const { code, message: msg } = await userStore.login(params)
await userStore.setStorageToken(res.data);
const { data: userInfo } = await userStore.getInformation();
message.destroyAll();
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
await userStore.setStorageToken(res.data)
const { data: userInfo } = await userStore.getInformation()
message.destroyAll()
const toPath = decodeURIComponent((route.query?.redirect || '/') as string)
if (route.name === LOGIN_NAME) {
if (userInfo.frontmenuTList && userInfo.frontmenuTList.length) {
message.success("登录成功,即将进入系统");
message.success('登录成功,即将进入系统')
router.replace(
userInfo.frontmenuTList ? userInfo.frontmenuTList[0]["resUrl"] : "/"
);
} else {
message.error("用户无菜单权限,请联系管理员");
userInfo.frontmenuTList ? userInfo.frontmenuTList[0].resUrl : '/',
)
}
else {
message.error('用户无菜单权限,请联系管理员')
}
} else {
router.replace(toPath);
}
} else {
message.destroyAll();
message.info(msg || "登录失败");
loginSuccess.value = false;
formRefSms.value.validate();
else {
router.replace(toPath)
}
}
} catch (e) {
} finally {
loading.value = false;
else {
message.destroyAll()
message.info(msg || '登录失败')
loginSuccess.value = false
formRefSms.value.validate()
}
}
catch (e) {
}
finally {
loading.value = false
}
} else {
message.error("请填写完整信息,并且进行验证码校验");
}
});
else {
message.error('请填写完整信息,并且进行验证码校验')
}
})
}
function close() {
loading.value = false;
emit("close");
loading.value = false
emit('close')
}
function switchTab(type: number) {
loading.value = false;
tab.value = type;
loading.value = false
tab.value = type
}
function computedForm() {
if (tab.value == 0) {
return !formInline.enterprisecode || !formInline.username || !formInline.password;
}
if (tab.value == 1) {
return !formSms.agentcode || !formSms.phone || !formSms.phonecode;
}
if (tab.value == 0)
return !formInline.enterprisecode || !formInline.username || !formInline.password
if (tab.value == 1)
return !formSms.agentcode || !formSms.phone || !formSms.phonecode
}
async function sendCode(value) {
if (!formSms.phone) return;
if (!formSms.phone)
return
if (!flag.value) return;
flag.value = false;
if (!flag.value)
return
flag.value = false
const res = await getCode({
phone: formSms.phone,
agentcode: formSms.agentcode,
});
if (res.code == "OK") {
startCount();
} else {
message.error(res.message);
}
})
if (res.code == 'OK')
startCount()
else
message.error(res.message)
}
function startCount() {
let time = 60;
countTime.value = "60s";
let time = 60
countTime.value = '60s'
const timer = setInterval(() => {
countTime.value = `${--time}s`;
countTime.value = `${--time}s`
if (time === 0) {
clearInterval(timer);
countTime.value = "重新获取";
flag.value = true;
clearInterval(timer)
countTime.value = '重新获取'
flag.value = true
}
}, 1000);
}, 1000)
}
function forget() {
loading.value = false;
emit("forget");
loading.value = false
emit('forget')
}
</script>
<template>
<div class="form-login">
<img class="img-close" src="@/assets/images/login/close.png" alt="" @click="close" />
<img class="img-close" src="@/assets/images/login/close.png" alt="" @click="close">
<div class="tab">
<div
:class="{ 'tab-item-active': tab === 0 }"
@ -373,7 +378,7 @@ function forget() {
maxlength="20"
>
<template #prefix>
<svg-icon size="20" name="enterprise" />
<SvgIcon size="20" name="enterprise" />
</template>
</n-input>
</n-form-item>
@ -385,7 +390,7 @@ function forget() {
maxlength="16"
>
<template #prefix>
<svg-icon size="20" name="account" />
<SvgIcon size="20" name="account" />
</template>
</n-input>
</n-form-item>
@ -399,7 +404,7 @@ function forget() {
maxlength="16"
>
<template #prefix>
<svg-icon size="20" name="password" />
<SvgIcon size="20" name="password" />
</template>
</n-input>
</n-form-item>
@ -411,8 +416,8 @@ function forget() {
size="large"
:loading="loading"
block
@click="handleSubmit"
:disabled="computedForm()"
@click="handleSubmit"
>
登录
</n-button>
@ -446,7 +451,7 @@ function forget() {
placeholder="请输入企业编码"
>
<template #prefix>
<svg-icon size="20" name="enterprise" />
<SvgIcon size="20" name="enterprise" />
</template>
</n-input>
</n-form-item>
@ -463,7 +468,7 @@ function forget() {
src="@/assets/images/login/phone.png"
alt=""
@click="close"
/>
>
</template>
</n-input>
</n-form-item>
@ -481,7 +486,7 @@ function forget() {
src="@/assets/images/login/auth.png"
alt=""
@click="close"
/>
>
</template>
<template #suffix>
<div
@ -505,8 +510,8 @@ function forget() {
size="large"
:loading="loading"
block
@click="handleSmsSubmit"
:disabled="computedForm()"
@click="handleSmsSubmit"
>
登录
</n-button>

@ -1,36 +1,37 @@
<script lang="ts" setup>
import Login from "./components/Login.vue";
import Forget from "./components/Forget.vue";
import { onMounted, nextTick, ref, onDeactivated } from "vue";
import { nextTick, onDeactivated, onMounted, ref } from 'vue'
import Login from './components/Login.vue'
import Forget from './components/Forget.vue'
onMounted(() => {
nextTick(() => {
initRem();
});
window.addEventListener("resize", () => {
initRem();
});
});
onDeactivated(()=>{
window.removeEventListener('resize',()=>{
initRem()
})
window.addEventListener('resize', () => {
initRem()
})
})
onDeactivated(() => {
window.removeEventListener('resize', () => {
})
})
const show = ref(false);
const ifLogin = ref(true);
const initRem = () => {
const designWidth = 1440;
const rempPx = 16;
const scale = window.innerWidth / designWidth;
document.documentElement.style.fontSize = scale * rempPx + "px";
};
const show = ref(false)
const ifLogin = ref(true)
function initRem() {
const designWidth = 1440
const rempPx = 16
const scale = window.innerWidth / designWidth
document.documentElement.style.fontSize = `${scale * rempPx}px`
}
function showLogin() {
show.value = true;
show.value = true
}
function close() {
show.value = false;
ifLogin.value = true;
show.value = false
ifLogin.value = true
}
</script>
@ -38,56 +39,84 @@ function close() {
<div class="wrap-login">
<div class="content">
<div class="header f-c-b">
<img class="img-logo" src="@/assets/images/login/logo.png" alt="" />
<div class="btn-login f-c-c" @click="showLogin"></div>
<img class="img-logo" src="@/assets/images/login/logo.png" alt="">
<div class="btn-login f-c-c" @click="showLogin">
登录
</div>
</div>
<div class="img-wrap f-s">
<img class="img-ai" src="../../assets/images/login/ai.png" alt="" />
<img class="img-ai" src="../../assets/images/login/ai.png" alt="">
<div class="right">
<div class="f-c">
<img class="img-item" src="../../assets/images/login/img-item-1.png" alt="" />
<img class="img-item" src="../../assets/images/login/img-item-2.png" alt="" />
<img class="img-item" src="../../assets/images/login/img-item-3.png" alt="" />
<img class="img-item" src="../../assets/images/login/img-item-4.png" alt="" />
<img class="img-item" src="../../assets/images/login/img-item-5.png" alt="" />
<img class="img-item" src="../../assets/images/login/img-item-1.png" alt="">
<img class="img-item" src="../../assets/images/login/img-item-2.png" alt="">
<img class="img-item" src="../../assets/images/login/img-item-3.png" alt="">
<img class="img-item" src="../../assets/images/login/img-item-4.png" alt="">
<img class="img-item" src="../../assets/images/login/img-item-5.png" alt="">
</div>
<div class="img-task">
Task approval
</div>
<div class="img-task">Task approval</div>
</div>
</div>
<div class="center-text f-c-b">
<img class="img-ip" src="../../assets/images/login/img-ip.png" alt="" />
<img class="img-text" src="../../assets/images/login/img-text.png" alt="" />
<img class="img-icon-1" src="../../assets/images/login/img-icon-1.png" alt="" />
<img class="img-ip" src="../../assets/images/login/img-ip.png" alt="">
<img class="img-text" src="../../assets/images/login/img-text.png" alt="">
<img class="img-icon-1" src="../../assets/images/login/img-icon-1.png" alt="">
</div>
<div class="text">
企业级 SaaS 智能审批解决方案
</div>
<img class="img-icon-2" src="../../assets/images/login/img-icon-2.png" alt="">
<div class="flex btn-login-2 f-c-c" @click="showLogin">
立即登录 <SvgIcon name="right_arrow" class="right_arrow" />
</div>
<div class="text">企业级 SaaS 智能审批解决方案</div>
<img class="img-icon-2" src="../../assets/images/login/img-icon-2.png" alt="" />
<div class="flex btn-login-2 f-c-c" @click="showLogin"> <SvgIcon name="right_arrow" class="right_arrow"/></div>
<div class="item-wrap f-c">
<div class="item">
<img class="item-img" src="../../assets/images/login/item-1.png" alt="" />
<div class="title">AI一键查重</div>
<div class="subtitle">一键查重生成任务包</div>
<img class="item-img" src="../../assets/images/login/item-1.png" alt="">
<div class="title">
AI一键查重
</div>
<div class="subtitle">
一键查重生成任务包
</div>
</div>
<div class="item">
<img class="item-img" src="../../assets/images/login/item-2.png" alt="" />
<div class="title">AI工单管理</div>
<div class="subtitle">智能批量辨识真假假图快速审批</div>
<img class="item-img" src="../../assets/images/login/item-2.png" alt="">
<div class="title">
AI工单管理
</div>
<div class="subtitle">
智能批量辨识真假假图快速审批
</div>
</div>
<div class="item">
<img class="item-img" src="../../assets/images/login/item-3.png" alt="" />
<div class="title">AI快速审批</div>
<div class="subtitle">智能图片比对批量审批一键确认</div>
<img class="item-img" src="../../assets/images/login/item-3.png" alt="">
<div class="title">
AI快速审批
</div>
<div class="subtitle">
智能图片比对批量审批一键确认
</div>
</div>
<div class="item">
<img class="item-img" src="../../assets/images/login/item-4.png" alt="" />
<div class="title">OCR</div>
<div class="subtitle">图片自动识别文档图片版面解析</div>
<img class="item-img" src="../../assets/images/login/item-4.png" alt="">
<div class="title">
OCR
</div>
<div class="subtitle">
图片自动识别文档图片版面解析
</div>
</div>
<div class="item">
<img class="item-img" src="../../assets/images/login/item-5.png" alt="" />
<div class="title">更多功能</div>
<div class="subtitle">探索更多功能</div>
<img class="item-img" src="../../assets/images/login/item-5.png" alt="">
<div class="title">
更多功能
</div>
<div class="subtitle">
探索更多功能
</div>
</div>
</div>
</div>
@ -95,7 +124,7 @@ function close() {
<Login v-if="ifLogin" @close="close" @forget="ifLogin = !ifLogin" />
<Forget v-else @close="close" @forget="ifLogin = !ifLogin" />
</n-modal>
<img class="item-footer" src="../../assets/images/login/footer.png" alt="" />
<img class="item-footer" src="../../assets/images/login/footer.png" alt="">
</div>
</template>

@ -1,81 +1,82 @@
<script>
import { reactive, toRefs, onMounted } from "vue";
import { onMounted, reactive, toRefs } from 'vue'
export default {
components: {},
setup() {
let state = reactive({});
const state = reactive({})
let methods = {
const methods = {
init() {
function getQueryParamsNew() {
const params = new URLSearchParams(window.location.search);
let paramsObj = {};
const params = new URLSearchParams(window.location.search)
const paramsObj = {}
for (const [key, value] of params.entries()) {
if (paramsObj.hasOwnProperty(key)) {
if (Array.isArray(paramsObj[key])) {
paramsObj[key].push(value);
} else {
paramsObj[key] = [paramsObj[key], value];
}
} else {
paramsObj[key] = value;
if (Array.isArray(paramsObj[key]))
paramsObj[key].push(value)
else
paramsObj[key] = [paramsObj[key], value]
}
else {
paramsObj[key] = value
}
}
return paramsObj;
return paramsObj
}
var queryParamsNew = getQueryParamsNew();
state.queryParamsNew = queryParamsNew;
const queryParamsNew = getQueryParamsNew()
state.queryParamsNew = queryParamsNew
const lng = queryParamsNew.lng; //
const lat = queryParamsNew.lat; //
const lng = queryParamsNew.lng //
const lat = queryParamsNew.lat //
//
const center = new qq.maps.LatLng(lat, lng);
const map = new qq.maps.Map(document.getElementById("map-container"), {
const center = new qq.maps.LatLng(lat, lng)
const map = new qq.maps.Map(document.getElementById('map-container'), {
center,
zoom: 15,
});
})
//
const marker = new qq.maps.Marker({
position: center,
map: map,
});
map,
})
//
const infoWin = new qq.maps.InfoWindow({
map: map,
map,
position: center,
});
})
infoWin.setContent(
`<div class="detailshow" >${queryParamsNew.name}</div>`
);
infoWin.open();
qq.maps.event.addListener(marker, "click", function () {
infoWin.open();
`<div class="detailshow" >${queryParamsNew.name}</div>`,
)
infoWin.open()
qq.maps.event.addListener(marker, 'click', () => {
infoWin.open()
infoWin.setContent(
`<div class="detailshow" >${queryParamsNew.name}</div>`
);
infoWin.setPosition(centerLatLng);
});
`<div class="detailshow" >${queryParamsNew.name}</div>`,
)
infoWin.setPosition(centerLatLng)
})
},
};
}
onMounted(() => {
methods.init();
});
methods.init()
})
return {
...toRefs(state),
...methods,
};
}
},
components: {},
};
}
</script>
<template>
<div class="mapmain">
<div id="map-container" style="width: 100%; height: 100%"></div>
<div id="map-container" style="width: 100%; height: 100%" />
</div>
</template>
<style >
<style>
.layout-sider {
display: none;
}

@ -1,32 +1,32 @@
<script lang="ts" setup>
import { computed, reactive, ref, toRefs } from "vue";
import { format } from "date-fns";
import { useRoute, useRouter } from "vue-router";
import { getMessageList, readAllMsg, readMsg } from "@/api/message/message";
import iconApproveActive from "@/assets/images/message/approve-active.png";
import iconApprove from "@/assets/images/message/approve.png";
import iconSystemActive from "@/assets/images/message/system-active.png";
import iconSystem from "@/assets/images/message/system.png";
import iconArrowActive from "@/assets/images/message/arrow-active.png";
import iconArrow from "@/assets/images/message/arrow.png";
import iconClear from "@/assets/images/message/clear.png";
import iconArrowDown from "@/assets/images/message/arrow-down.png";
const emit = defineEmits(["goDetail"]);
const router = useRouter();
const route = useRoute();
const hasNextPage = ref(false);
import { computed, reactive, ref, toRefs } from 'vue'
import { format } from 'date-fns'
import { useRoute, useRouter } from 'vue-router'
import { getMessageList, readAllMsg, readMsg } from '@/api/message/message'
import iconApproveActive from '@/assets/images/message/approve-active.png'
import iconApprove from '@/assets/images/message/approve.png'
import iconSystemActive from '@/assets/images/message/system-active.png'
import iconSystem from '@/assets/images/message/system.png'
import iconArrowActive from '@/assets/images/message/arrow-active.png'
import iconArrow from '@/assets/images/message/arrow.png'
import iconClear from '@/assets/images/message/clear.png'
import iconArrowDown from '@/assets/images/message/arrow-down.png'
const emit = defineEmits(['goDetail'])
const router = useRouter()
const route = useRoute()
const hasNextPage = ref(false)
const state = reactive({
tabList: [
{
name: "审批通知",
name: '审批通知',
icon: iconApprove,
activeIcon: iconApproveActive,
value: 1,
},
{
name: "系统消息",
name: '系统消息',
icon: iconSystem,
activeIcon: iconSystemActive,
value: 2,
@ -34,127 +34,134 @@ const state = reactive({
],
list: [] as any,
pageNo: 1,
});
})
const { list, tabList } = toRefs(state);
const { list, tabList } = toRefs(state)
const tab = ref(1);
const tab = ref(1)
const getStateText = computed(() => {
return (value) => (value == 1 ? "待审批" : value == 2 ? "通过" : "不通过");
});
return value => (value == 1 ? '待审批' : value == 2 ? '通过' : '不通过')
})
async function getList(type = "") {
async function getList(type = '') {
let res = await getMessageList({
pageNo: state.pageNo,
pageSize: "20",
pageSize: '20',
msgCategory: tab.value,
});
console.log("getMessageList", res.data);
if (type == "more") {
if (res.code == "OK") {
})
console.log('getMessageList', res.data)
if (type == 'more') {
if (res.code == 'OK') {
if (tab.value === 1) {
res.data.list.forEach((item) => {
item.tag = JSON.parse(item.busJson);
});
item.tag = JSON.parse(item.busJson)
})
}
state.list = state.list.concat(res.data.list);
state.pageNo++;
state.list = state.list.concat(res.data.list)
state.pageNo++
res = await getMessageList({
pageNo: state.pageNo,
pageSize: "20",
pageSize: '20',
msgCategory: tab.value,
});
})
}
hasNextPage.value = res.data.hasNextPage;
} else {
if (res.code === "OK") {
hasNextPage.value = res.data.hasNextPage;
hasNextPage.value = res.data.hasNextPage
}
else {
if (res.code === 'OK') {
hasNextPage.value = res.data.hasNextPage
if (tab.value === 1) {
res.data.list.forEach((item) => {
item.tag = JSON.parse(item.busJson);
});
item.tag = JSON.parse(item.busJson)
})
}
state.list = state.list.concat(res.data.list);
state.list = state.list.concat(res.data.list)
}
}
}
getList();
getList()
async function clearMsg() {
const res = await readAllMsg({ msgCategory: tab.value });
if (res.code === "OK") {
state.list = [];
state.pageNo = 1;
getList();
const res = await readAllMsg({ msgCategory: tab.value })
if (res.code === 'OK') {
state.list = []
state.pageNo = 1
getList()
}
}
function switchTab(type: number) {
tab.value = type;
state.list = [];
state.pageNo = 1;
getList();
tab.value = type
state.list = []
state.pageNo = 1
getList()
}
function goFinalDetail(row) {
console.log(row);
console.log(row)
router.push({
name: "final-detail",
name: 'final-detail',
query: { id: row.tag.fromId, packageid: row.packageid },
});
})
}
function goDetail(item) {
if (tab.value === 1) {
clearMsgOne(item.id);
goFinalDetail(item);
clearMsgOne(item.id)
goFinalDetail(item)
}
// emit('goDetail', item.id)
else {
router.push({ name: "message-detail", query: { id: item.id } });
router.push({ name: 'message-detail', query: { id: item.id } })
}
}
async function clearMsgOne(id) {
const res = await readMsg({ msgid: id });
const res = await readMsg({ msgid: id })
}
function getMore() {
state.pageNo += 1;
getList("more");
state.pageNo += 1
getList('more')
}
console.log(tabList);
console.log(tabList)
</script>
<template>
<div class="wrapper-message">
<div class="flex justify-between header">
<div class="header-title">消息通知</div>
<div class="header-title">
消息通知
</div>
<div class="clear" @click="clearMsg">
<img class="icon-clear" :src="iconClear" alt="" />
<img class="icon-clear" :src="iconClear" alt="">
清除未读
</div>
</div>
<div class="content">
<div class="slider">
<div v-for="item in tabList" :key="item.value" :class="{ 'item-active': tab === item.value }" class="flex item"
@click="switchTab(item.value)">
<div
v-for="item in tabList" :key="item.value" :class="{ 'item-active': tab === item.value }" class="flex item"
@click="switchTab(item.value)"
>
<div class="flex item-left align-center">
<img class="icon" :src="tab === item.value ? item.activeIcon : item.icon" alt="" />
<img class="icon" :src="tab === item.value ? item.activeIcon : item.icon" alt="">
<div :class="{ 'text-active': tab === item.value }" class="text">
{{ item.name }}
</div>
</div>
<img class="icon-arrow" :src="tab === item.value ? iconArrowActive : iconArrow" alt="" />
<img class="icon-arrow" :src="tab === item.value ? iconArrowActive : iconArrow" alt="">
<div v-if="tab === item.value" class="line" />
</div>
</div>
<div class="list">
<div v-for="(item, index) in list" :key="item.id" :class="{ pt0: index === 0, 'item-disabled': item.readFlag }"
class="item" @click="goDetail(item)">
<div
v-for="(item, index) in list" :key="item.id" :class="{ 'pt0': index === 0, 'item-disabled': item.readFlag }"
class="item" @click="goDetail(item)"
>
<div class="left">
<div class="num">
{{ format(item.sendTime, "dd") }}
@ -172,7 +179,9 @@ console.log(tabList);
{{ item.titile }}
</div>
<div v-if="tab === 1" class="status">
<div class="tag tag-blue">审批节点{{ item.tag.sendUserName }}</div>
<div class="tag tag-blue">
审批节点{{ item.tag.sendUserName }}
</div>
<div :class="item.tag.states === 3 ? 'tag-red' : 'tag-green'" class="tag">
审批状态{{ getStateText(item.tag.states) }}
</div>
@ -186,11 +195,13 @@ console.log(tabList);
<span class="time">{{ format(item.sendTime, "yyyy-MM-dd HH:mm:ss") }}</span>
</div>
</div>
<div class="look">查看</div>
<div class="look">
查看
</div>
</div>
<div v-if="hasNextPage" class="more" @click="getMore">
查看更多<img class="icon-more" :src="iconArrowDown" alt="" />
查看更多<img class="icon-more" :src="iconArrowDown" alt="">
</div>
</div>
</div>
@ -457,4 +468,5 @@ console.log(tabList);
// ::v-deep(.n-divider:not(.n-divider--vertical)) {
// margin-top: 12px;
// margin-bottom: 12px;
// }</style>
// }
</style>

@ -10,6 +10,7 @@ import {
unref,
watch,
} from 'vue'
import { useRoute } from 'vue-router'
import CustomFieldModal from '../modal/CustomFieldModal.vue'
import AdvanceFilter from '../../home/aside/comp/AdvanceFilter.vue'
import { FilterModalVue } from '../../home/aside/comp/modals'
@ -17,22 +18,19 @@ import NewFilterModalVue from '../modal/NewFilterModal.vue'
import TaskList from './TaskList.vue'
import type { AsideEntity } from '@/config/aside'
import { useUser } from '@/store/modules/user'
import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { getAllfieldList, getConditionList, getfieldList } from '@/api/home/filter'
import { useTaskStore } from '@/store/modules/task'
import emitter from '@/utils/mitt'
import { useConfig } from '@/store/modules/asideConfig'
import { getConditionList } from "@/api/home/filter";
import type { FilterSearchParam } from "/#/api";
import { useRoute } from 'vue-router'
import type { FilterSearchParam } from '/#/api'
const route = useRoute()
const searchContent = route.query.searchContent as string;
const searchContent = route.query.searchContent as string
const CustomFieldModalRef = ref(null)
const collapse = ref(false)
const taskStore = useTaskStore()
const taskListRef: any = ref(null)
const AdvanceFilterRef: any = ref(null);
const AdvanceFilterRef: any = ref(null)
//
const showFieldList = ref<any[]>([])
const search = ref('')
@ -135,33 +133,35 @@ async function getshowFieldList() {
onMounted(() => {
getshowFieldList()
window.addEventListener("keydown", handleKeydown);
window.addEventListener('keydown', handleKeydown)
init()
})
async function init() {
try {
const searchParam: FilterSearchParam = {
search_searchname: { value: "", op: "like", type: "string" },
};
const result = await getConditionList(1, searchParam, 2);
const { data } = result;
search_searchname: { value: '', op: 'like', type: 'string' },
}
const result = await getConditionList(1, searchParam, 2)
const { data } = result
if (data[0]) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(data[0].searchname);
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(data[0].searchname)
setTimeout(() => {
filterHandler(data[0].id)
}, 1000);
//filterHandler(data[0].id);
}, 1000)
// filterHandler(data[0].id);
}
// pagination.pageNo += 1
} catch (error) {
return [];
} finally {
}
//currentlySelectedAdvanced.value=""
catch (error) {
return []
}
finally {
}
// currentlySelectedAdvanced.value=""
}
function handleKeydown(event) {
if (event.key === "s") setShowSearch(true)
if (event.key === 's')
setShowSearch(true)
}
// key
function scrollHandler(key: string) {
@ -191,8 +191,8 @@ function newFilterOk() {
filterModalRef.value.query(
filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize,
);
filterModalRef.value.showModal();
)
filterModalRef.value.showModal()
}
onBeforeMount(async () => {
configStore.fetchConfig()
@ -206,27 +206,28 @@ defineExpose({
setAsideItemName,
})
const initSerach = () => {
function initSerach() {
if (searchContent) {
setShowSearch(true);
const id_param = searchContent.match(/-\d+-/);
setShowSearch(true)
const id_param = searchContent.match(/-\d+-/)
if (id_param) {
search.value = id_param[0].slice(1, -1);
inputHandler(id_param[0].slice(1, -1));
search.value = id_param[0].slice(1, -1)
inputHandler(id_param[0].slice(1, -1))
}
}
}
initSerach();
initSerach()
const handleOk = (item: any) => {
function handleOk(item: any) {
if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname);
filterHandler(item.id);
} else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced("高级筛选");
filterHandler("");
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname)
filterHandler(item.id)
}
};
else {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced('高级筛选')
filterHandler('')
}
}
</script>
<template>
@ -259,8 +260,10 @@ const handleOk = (item: any) => {
</div>
</div> -->
<!-- 高级筛选 -->
<AdvanceFilter v-show="!showSearch" :type="2" @select="filterHandler" @update:search="setShowSearch(true)"
@show-custom="showModal(CustomFieldModalRef)" @show-filter="showModal(filterModalRef)" ref="AdvanceFilterRef" />
<AdvanceFilter
v-show="!showSearch" ref="AdvanceFilterRef" :type="2" @select="filterHandler"
@update:search="setShowSearch(true)" @show-custom="showModal(CustomFieldModalRef)" @show-filter="showModal(filterModalRef)"
/>
<div v-show="showSearch" class="warpper">
<n-input v-model:value="search" style="flex: 1; height: 32px" placeholder="请输入你需要搜索的内容" @input="inputHandler">
@ -275,8 +278,10 @@ const handleOk = (item: any) => {
<!-- calc(100vh - 146px) -->
<CustomFieldModal ref="CustomFieldModalRef" :review-type="reviewType" @on-ok="getshowFieldList" />
<!-- 过滤列表 -->
<FilterModalVue ref="filterModalRef" :type="2" @edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)" @handleOk="handleOk" />
<FilterModalVue
ref="filterModalRef" :type="2" @edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)" @handle-ok="handleOk"
/>
<!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />
</div>

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { format } from 'date-fns'
import { computed,watch ,ref} from 'vue'
import { computed, ref, watch } from 'vue'
defineOptions({ name: 'ListItem' })

File diff suppressed because it is too large Load Diff

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { ref, watch } from "vue";
import * as XLSX from "xlsx";
import { ref, watch } from 'vue'
import * as XLSX from 'xlsx'
defineProps({
data: {
@ -11,21 +11,23 @@ defineProps({
type: Array as any,
default: () => [[]],
},
});
const emit = defineEmits(["showModal", "getrowValue"]);
})
const emit = defineEmits(['showModal', 'getrowValue'])
function showActionsModal() {
emit("showModal");
emit('showModal')
}
function getrowvalue(row) {
emit("getrowValue", row);
emit('getrowValue', row)
}
</script>
<template>
<div class="info-header">
<div class="left_box">
<div class="title">填报信息</div>
<div class="title">
填报信息
</div>
</div>
<div class="right_box" @click="showActionsModal">
自定义设置
@ -42,10 +44,9 @@ function getrowvalue(row) {
:class="item[0].blue ? 'blue' : ''"
@click="getrowvalue(item[0])"
>
<span :style="item[0].label == '定位信息'?{cursor:'pointer'}:{}" v-show="item[0].label == '定位信息'">
<SvgIcon class="icon" size="16" name="lctname"
/></span>
<span :style="item[0].label == '定位信息'?{cursor:'pointer'}:{}"> {{ item[0].value }}</span>
<span v-show="item[0].label == '定位信息'" :style="item[0].label == '定位信息' ? { cursor: 'pointer' } : {}">
<SvgIcon class="icon" size="16" name="lctname" /></span>
<span :style="item[0].label == '定位信息' ? { cursor: 'pointer' } : {}"> {{ item[0].value }}</span>
</td>
<th v-if="item && item.length > 1">
{{ item[1].label }}
@ -55,10 +56,10 @@ function getrowvalue(row) {
:class="item[1].blue ? 'blue' : ''"
@click="getrowvalue(item[1])"
>
<span :style="item[0].label == '定位信息'?{cursor:'pointer'}:{}" v-show="item[1].label == '定位信息'">
<span v-show="item[1].label == '定位信息'" :style="item[0].label == '定位信息' ? { cursor: 'pointer' } : {}">
<SvgIcon class="icon" size="16" name="lctname" />
</span>
<span :style="item[1].label == '定位信息'?{cursor:'pointer'}:{}"> {{ item[1].value }}</span>
<span :style="item[1].label == '定位信息' ? { cursor: 'pointer' } : {}"> {{ item[1].value }}</span>
</td>
</tr>
</table>

@ -1,14 +1,14 @@
<script lang="ts" setup>
import { ref } from "vue";
import Aside from "./aside/Aside.vue";
import Content from "./content/Content.vue";
import DataHeader from "@/components/DataHeader/index.vue";
import { ref } from 'vue'
import Aside from './aside/Aside.vue'
import Content from './content/Content.vue'
import DataHeader from '@/components/DataHeader/index.vue'
import Robot from '@/components/Robot/index.vue'
const asideRef: any = ref(null);
const asideRef: any = ref(null)
function setAsideItemName(text) {
asideRef.value.setAsideItemName(text);
asideRef.value.setAsideItemName(text)
}
</script>
@ -19,7 +19,7 @@ function setAsideItemName(text) {
</div>
<div class="main">
<!-- 侧边 -->
<Aside ref="asideRef" />
<Aside ref="asideRef" />
<!-- 内容 -->
<Content @set-aside-item-name="setAsideItemName" />

@ -254,18 +254,15 @@ function afterLeave() {
onMounted(() => {
show.value && addListeners()
window.addEventListener("keydown", handleKeydown);
window.addEventListener('keydown', handleKeydown)
})
//
function handleKeydown(event) {
//
if (event.keyCode === 67) {
show.value=false
// batchModalRef.value.closeModal()
}
if (event.keyCode === 67)
show.value = false
// batchModalRef.value.closeModal()
}
function showModal(value) {
taskId.value = value
@ -408,7 +405,8 @@ const gridHeight = computed(() => {
defineExpose({
showModal,
reload,closeModal
reload,
closeModal,
})
</script>
@ -544,40 +542,40 @@ defineExpose({
:style="{ height: gridHeight }"
class="grid-item"
>
<n-image
ref="imageRef"
class="img"
<n-image
ref="imageRef"
class="img"
:class="{
'img-fit': viewMode === 'horizontalVersion',
'img-full': viewMode === '3:4' || viewMode === 'verticalVersion',
}"
:class="{
'img-fit': viewMode === 'horizontalVersion',
'img-full': viewMode === '3:4' || viewMode === 'verticalVersion',
}"
:src="item.serverThumbnailUrl"
/>
<div class="small-mark" />
<div class="time">
<div v-if="item.photoDateTimestamp" class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="14" name="camera-time" />
<span>{{ formatToDateHMS(Number(item.photoDateTimestamp) || 0) }}</span>
</div>
<div v-if="item.submitDateTimestamp" class="time-item time-item2">
<SvgIcon class="svg-time" color="#FFF" size="14" name="submit-time" />
<span>{{ formatToDateHMS(Number(item.submitDateTimestamp) || 0) }}</span>
</div>
:src="item.serverThumbnailUrl"
/>
<div class="small-mark" />
<div class="time">
<div v-if="item.photoDateTimestamp" class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="14" name="camera-time" />
<span>{{ formatToDateHMS(Number(item.photoDateTimestamp) || 0) }}</span>
</div>
<img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt="">
<img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt="">
<div class="check">
<n-checkbox
v-show="batch && item.historyStates === 1"
v-model:checked="item.checked" @click.prevent
@update:checked="onCheckChange($event, item)"
/>
</div>
<div :class="{ 'percent-red': item.similarityScore === 100 }" class="percent">
{{ item.similarityScore }}<span class="percent-unit">%</span>
<div v-if="item.submitDateTimestamp" class="time-item time-item2">
<SvgIcon class="svg-time" color="#FFF" size="14" name="submit-time" />
<span>{{ formatToDateHMS(Number(item.submitDateTimestamp) || 0) }}</span>
</div>
</div>
<img v-if="item.historyStates === 2" class="tag-status" src="@/assets/images/task/tag-pass.png" alt="">
<img v-if="item.historyStates === 3" class="tag-status" src="@/assets/images/task/tag-not-pass.png" alt="">
<div class="check">
<n-checkbox
v-show="batch && item.historyStates === 1"
v-model:checked="item.checked" @click.prevent
@update:checked="onCheckChange($event, item)"
/>
</div>
<div :class="{ 'percent-red': item.similarityScore === 100 }" class="percent">
{{ item.similarityScore }}<span class="percent-unit">%</span>
</div>
</div>
</div>
<!-- </n-scrollbar> -->

@ -63,13 +63,10 @@ onBeforeMount(async () => {
// })
})
async function selectChange(id){
console.log(id,'selectChange')
selectItem.value = reasonOptions.value.find(v=>v.id == id);
async function selectChange(id) {
console.log(id, 'selectChange')
selectItem.value = reasonOptions.value.find(v => v.id == id)
}
</script>
<template>
@ -86,22 +83,19 @@ async function selectChange(id){
</div>
<div class="wrapper-content">
<span>处理方式</span>
<n-select filterable v-model:value="selectBackId" style="margin-top: 10px;" :options="backOptions" />
<n-select v-model:value="selectBackId" filterable style="margin-top: 10px;" :options="backOptions" />
</div>
<div class="wrapper-content">
<span>不通过原因</span>
<n-select filterable v-model:value="selectRejectId" @change="selectChange" style="margin-top: 10px;" :options="reasonOptions" />
<n-select v-model:value="selectRejectId" filterable style="margin-top: 10px;" :options="reasonOptions" @change="selectChange" />
<n-input v-show="showOther" v-model:value="otherValue" type="textarea" placeholder="备注内容" style="margin-top: 10px;" />
</div>
<!-- <div class="wrapper-content">
<n-input
type="textarea"
placeholder="备注内容" v-model="showOther"></n-input>
</div> -->
</div>
<template #footer>
<div class="wrapper-footer">

@ -1,12 +1,11 @@
<script lang="ts" setup>
import { cloneDeep, difference } from "lodash-es";
import { computed, defineEmits, defineProps, onMounted, ref, watch } from "vue";
import { VueDraggable } from "vue-draggable-plus";
import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter";
import { workPackageMap } from "@/config/workorder";
import { useUser } from "@/store/modules/user";
import { useMessage } from "naive-ui";
const message = useMessage();
import { cloneDeep, difference } from 'lodash-es'
import { computed, defineEmits, defineProps, onMounted, ref, watch } from 'vue'
import { VueDraggable } from 'vue-draggable-plus'
import { useMessage } from 'naive-ui'
import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
import { workPackageMap } from '@/config/workorder'
import { useUser } from '@/store/modules/user'
const props = defineProps({
reviewType: {
@ -14,352 +13,370 @@ const props = defineProps({
default: () => 1,
require: true,
},
});
})
const emit = defineEmits(["onOk"]);
const emit = defineEmits(['onOk'])
const message = useMessage()
//
const offList = ref<any[]>([]);
const offList = ref<any[]>([])
//
const onList = ref<any[]>([]);
const onList = ref<any[]>([])
//
const fixList = ref<any[]>([]);
const fixList = ref<any[]>([])
const offShowList = ref<any[]>([]);
const onShowList = ref<any[]>([]);
const fixShowList = ref<any[]>([]);
const offShowList = ref<any[]>([])
const onShowList = ref<any[]>([])
const fixShowList = ref<any[]>([])
const allCount = computed(() => {
return `全部字段(共${offList.value.length - 1}个)`;
});
return `全部字段(共${offList.value.length - 1}个)`
})
const selectCount = computed(() => {
return `显示字段(共${onList.value.length}个)`;
});
return `显示字段(共${onList.value.length}个)`
})
function generatList() {
const keys = Object.keys(workPackageMap);
let showList: object[] = [];
const hideList: object[] = [];
const showStr = "status";
const showKeys = showStr.split(",").map((key: string) => key.toLowerCase());
const keys = Object.keys(workPackageMap)
let showList: object[] = []
const hideList: object[] = []
const showStr = 'status'
const showKeys = showStr.split(',').map((key: string) => key.toLowerCase())
for (const key of keys) {
const name = workPackageMap[key]?.label;
const isDefault = workPackageMap[key]?.isDefault;
const name = workPackageMap[key]?.label
const isDefault = workPackageMap[key]?.isDefault
// Y
if (!isDefault) {
hideList.push({
id: key,
name: name || "未配置",
name: name || '未配置',
fix: isDefault,
checked: workPackageMap[key].isDefault,
});
})
}
}
showList = showKeys.reduce((acc, key) => {
const config = {
id: key,
name: workPackageMap[key].label || "未配置",
name: workPackageMap[key].label || '未配置',
fix: workPackageMap[key].isDefault,
};
return [...acc, config];
}, []);
}
return [...acc, config]
}, [])
const fixedList = generateDefaultList();
const fixedList = generateDefaultList()
hideList.unshift(...fixedList);
showList.unshift(...fixedList);
hideList.unshift(...fixedList)
showList.unshift(...fixedList)
onList.value = showList;
offList.value = hideList;
return { showList, hideList };
onList.value = showList
offList.value = hideList
return { showList, hideList }
}
function generateDefaultList() {
return Object.keys(workPackageMap).reduce((acc, key) => {
const { label, isDefault } = workPackageMap[key];
const { label, isDefault } = workPackageMap[key]
if (isDefault) {
const config = {
id: key,
name: label || "未配置",
name: label || '未配置',
fix: true,
checked: true,
};
return [...acc, config];
} else {
return acc;
}
return [...acc, config]
}
}, []);
else {
return acc
}
}, [])
}
const show = ref(false);
const show = ref(false)
const checkAll = computed(() => {
let baseNum = 0;
let baseNum = 0
offList.value.map((v) => {
if (v.fix) baseNum += 1;
});
return onList.value.length == offList.value.length - baseNum;
});
if (v.fix)
baseNum += 1
})
return onList.value.length == offList.value.length - baseNum
})
function showModal() {
show.value = true;
show.value = true
}
function closeModal() {
show.value = false;
show.value = false
}
async function handleSumbit(e: MouseEvent) {
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let userFieldFixed = "";
const userStore = useUser()
const userInfo = userStore.getUserInfo
let userFieldFixed = ''
fixList.value.map((v) => {
userFieldFixed += `${v.id},`;
});
userFieldFixed += `${v.id},`
})
onList.value.map((v) => {
userFieldFixed += `${v.id},`;
});
userFieldFixed = userFieldFixed.slice(0, userFieldFixed.length - 1);
savefield(props.reviewType, userInfo.id, userFieldFixed);
e.preventDefault();
closeModal();
emit("onOk");
userFieldFixed += `${v.id},`
})
userFieldFixed = userFieldFixed.slice(0, userFieldFixed.length - 1)
savefield(props.reviewType, userInfo.id, userFieldFixed)
e.preventDefault()
closeModal()
emit('onOk')
}
defineExpose({
showModal,
});
})
// generatList();
const selectIds = ref<string[]>([]);
const selectIds = ref<string[]>([])
function onCheckAllChange(value) {
const ids: string[] = [];
const ids: string[] = []
for (const item of offList.value) {
if (!item.fix) {
item.checked = value;
ids.push(item.id);
item.checked = value
ids.push(item.id)
}
}
for (const item of offShowList.value) {
if (!item.fix) item.checked = value;
if (!item.fix)
item.checked = value
}
selectIds.value = value ? ids : [];
selectIds.value = value ? ids : []
if (value) {
offList.value.map((v) => {
if (!v.checked) onList.value.push(v);
});
onShowList.value = cloneDeep(onList.value);
} else {
onList.value = [];
onShowList.value = [];
if (!v.checked)
onList.value.push(v)
})
onShowList.value = cloneDeep(onList.value)
}
else {
onList.value = []
onShowList.value = []
}
}
function onCheckChange(checked: any, item: any) {
const index = selectIds.value.indexOf(item.id);
const index = selectIds.value.indexOf(item.id)
// TODO
// if (index == -1 && selectIds.value.length >= 6) {
// item.checked = false;
// message.error("6");
// return;
// }
item.checked = checked;
const currentIndex = offList.value.findIndex((v) => v.id == item.id);
offList.value[currentIndex].checked = checked;
if (index === -1 && checked) {
selectIds.value.push(item.id);
} else {
selectIds.value.splice(index, 1);
}
item.checked = checked
const currentIndex = offList.value.findIndex(v => v.id == item.id)
offList.value[currentIndex].checked = checked
if (index === -1 && checked)
selectIds.value.push(item.id)
else
selectIds.value.splice(index, 1)
}
const showIds = computed(() => {
return onList.value.map((item) => {
return item.id;
});
});
return item.id
})
})
watch(
() => selectIds.value.length,
(newVal, oldVal) => {
if (newVal === oldVal) return;
if (newVal === oldVal)
return
const action = newVal > oldVal ? "add" : "remove";
const diff =
action === "add"
const action = newVal > oldVal ? 'add' : 'remove'
const diff
= action === 'add'
? difference(selectIds.value, showIds.value)
: difference(showIds.value, selectIds.value);
: difference(showIds.value, selectIds.value)
if (diff.length === 0) return;
if (diff.length === 0)
return
if (action === "add") {
if (action === 'add') {
for (const item of offList.value) {
if (!item.fix && diff.includes(item.id)) {
onList.value.push({
id: item.id,
name: item.name || "未配置",
name: item.name || '未配置',
fix: item.fix || false,
});
})
}
}
onShowList.value = cloneDeep(onList.value);
} else {
const list = onList.value;
onShowList.value = cloneDeep(onList.value)
}
else {
const list = onList.value
for (let index = 0; index < list.length; index++) {
const item = list[index];
const item = list[index]
if (!item.fix && diff.includes(item.id)) {
list.splice(index, 1);
onShowList.value.splice(index, 1);
index--;
list.splice(index, 1)
onShowList.value.splice(index, 1)
index--
}
}
console.log(onShowList.value, list, "onShowList");
console.log(onShowList.value, list, 'onShowList')
}
}
);
},
)
watch(
() => showIds.value.length,
(newVal, oldVal) => {
if (newVal === oldVal) return;
if (newVal === oldVal)
return
const diff = difference(selectIds.value, showIds.value);
const diff = difference(selectIds.value, showIds.value)
if (diff.length === 0) return;
if (diff.length === 0)
return
for (const item of offList.value) {
if (!item.fix && diff.includes(item.id)) {
const index = selectIds.value.indexOf(item.id);
item.checked = false;
selectIds.value.splice(index, 1);
const index = selectIds.value.indexOf(item.id)
item.checked = false
selectIds.value.splice(index, 1)
}
}
}
);
},
)
function clearDragSource() {
onList.value = onList.value.filter((item) => {
return item.fix === true;
});
onShowList.value = cloneDeep(onList.value);
return item.fix === true
})
onShowList.value = cloneDeep(onList.value)
}
function removeHandler(id: string) {
let index = onList.value.findIndex((item) => {
return item.id === id;
});
return item.id === id
})
if (index !== -1) {
onList.value.splice(index, 1);
onShowList.value.splice(index, 1);
onList.value.splice(index, 1)
onShowList.value.splice(index, 1)
}
index = offList.value.findIndex((v) => v.id == id);
offList.value[index].checked = false;
offShowList.value = cloneDeep(offList.value);
index = offList.value.findIndex(v => v.id == id)
offList.value[index].checked = false
offShowList.value = cloneDeep(offList.value)
}
function initData() {
offList.value = [];
onList.value = [];
fixList.value = [];
offShowList.value = [];
onShowList.value = [];
fixShowList.value = [];
selectIds.value = [];
offList.value = []
onList.value = []
fixList.value = []
offShowList.value = []
onShowList.value = []
fixShowList.value = []
selectIds.value = []
}
async function getData(type = "") {
initData();
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let res;
res = await getAllfieldList(props.reviewType); //
const allList = res.data;
res = await getfieldList(props.reviewType, userInfo.id); //
const useList = res.data;
async function getData(type = '') {
initData()
const userStore = useUser()
const userInfo = userStore.getUserInfo
let res
res = await getAllfieldList(props.reviewType) //
const allList = res.data
res = await getfieldList(props.reviewType, userInfo.id) //
const useList = res.data
/**
* name 标题
* id 键值
* fix 是否默认
* checked 是否选中
*/
const userFieldFixed = useList?.userFieldFixed?.split(",");
const userFieldUnFixed = useList?.userFieldUnFixed?.split(",");
if (!type || type == "off") {
offList.value = [];
const userFieldFixed = useList?.userFieldFixed?.split(',')
const userFieldUnFixed = useList?.userFieldUnFixed?.split(',')
if (!type || type == 'off') {
offList.value = []
allList?.map((v) => {
const item = {
name: v.fieldDesc,
id: v.name,
fix: v.isrequired == 2,
checked:
v.isrequired == 2 ||
Boolean(userFieldFixed?.find((v2) => v2 == v.name)) ||
Boolean(userFieldUnFixed?.find((v2) => v2 == v.name)),
};
if (item.fix) fixList.value.push(item);
else offList.value.push(item);
});
offList.value.unshift(...fixList.value);
v.isrequired == 2
|| Boolean(userFieldFixed?.find(v2 => v2 == v.name))
|| Boolean(userFieldUnFixed?.find(v2 => v2 == v.name)),
}
if (item.fix)
fixList.value.push(item)
else offList.value.push(item)
})
offList.value.unshift(...fixList.value)
}
if (!type || type == "on") {
useList?.userFieldFixed?.split(",").map((v) => {
let item = allList.find((v2) => v2.name == v);
if (!type || type == 'on') {
useList?.userFieldFixed?.split(',').map((v) => {
let item = allList.find(v2 => v2.name == v)
if (item) {
item = {
name: item.fieldDesc,
id: item.name,
fix: item.isrequired == 2,
checked: true,
};
selectIds.value.push(item.id);
if (!item.fix) onList.value.push(item);
}
selectIds.value.push(item.id)
if (!item.fix)
onList.value.push(item)
}
});
})
}
offShowList.value = cloneDeep(offList.value);
fixShowList.value = cloneDeep(fixList.value);
onShowList.value = cloneDeep(onList.value);
offShowList.value = cloneDeep(offList.value)
fixShowList.value = cloneDeep(fixList.value)
onShowList.value = cloneDeep(onList.value)
}
onMounted(() => getData());
onMounted(() => getData())
const indeterminate = computed(() => {
let baseNum = 0;
let baseNum = 0
offList.value.map((v) => {
if (v.fix) baseNum += 1;
});
if (v.fix)
baseNum += 1
})
return (
onShowList.value.length > 0 &&
offShowList.value.length - baseNum > onShowList.value.length
);
});
onShowList.value.length > 0
&& offShowList.value.length - baseNum > onShowList.value.length
)
})
function queryData(value, type) {
if (value) {
if (type == "off") {
offShowList.value = offList.value.filter((item) => item.name.includes(value));
} else {
onShowList.value = onList.value.filter((item) => item.name.includes(value));
fixShowList.value = fixList.value.filter((item) => item.name.includes(value));
if (type == 'off') {
offShowList.value = offList.value.filter(item => item.name.includes(value))
}
else {
onShowList.value = onList.value.filter(item => item.name.includes(value))
fixShowList.value = fixList.value.filter(item => item.name.includes(value))
}
} else {
}
else {
// getData(type);
if (type == "off") {
offShowList.value = cloneDeep(offList.value);
} else {
onShowList.value = cloneDeep(onList.value);
fixShowList.value = cloneDeep(fixList.value);
if (type == 'off') {
offShowList.value = cloneDeep(offList.value)
}
else {
onShowList.value = cloneDeep(onList.value)
fixShowList.value = cloneDeep(fixList.value)
}
}
}
const moreThanSix = computed(() => {
return selectIds.value.length >= 6;
});
return selectIds.value.length >= 6
})
</script>
<template>
@ -445,7 +462,9 @@ const moreThanSix = computed(() => {
<SvgIcon size="14px" name="magnifying-1" />
</template>
</n-input>
<div class="draggable-title">系统默认</div>
<div class="draggable-title">
系统默认
</div>
<div class="draggable-ul" style="border-bottom: none">
<div
v-for="item in fixShowList"
@ -456,7 +475,9 @@ const moreThanSix = computed(() => {
<span class="ml-2">{{ item.name }}</span>
</div>
</div>
<div class="draggable-title" style="border-top: none">自定义配置</div>
<div class="draggable-title" style="border-top: none">
自定义配置
</div>
<VueDraggable
v-model="onList"
class="draggable-ul"
@ -487,7 +508,9 @@ const moreThanSix = computed(() => {
</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"

@ -1,107 +1,107 @@
<script lang="ts" setup>
import type { FormInst, FormItemRule, FormRules } from "naive-ui";
import { computed, onBeforeMount, reactive, ref, unref, watch } from "vue";
import { asideTaskMap } from "@/config/final";
import { useDictionary } from "@/store/modules/dictonary";
import { useConfig } from "@/store/modules/asideConfig";
import type { FilterCondition } from "/#/api";
import { addCondition, updateCondition } from "@/api/home/filter";
import { formatToDate2, formatToDate3 } from "@/utils/dateUtil";
type Status = "edit" | "new";
const show = ref(false);
const configStore = useConfig();
const dicStore = useDictionary();
const currentStatus = ref<Status>("new");
let currentEditId: string | null = null;
const emit = defineEmits(["onOk"]);
import type { FormInst, FormItemRule, FormRules } from 'naive-ui'
import { computed, onBeforeMount, reactive, ref, unref, watch } from 'vue'
import { asideTaskMap } from '@/config/final'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import type { FilterCondition } from '/#/api'
import { addCondition, updateCondition } from '@/api/home/filter'
import { formatToDate2, formatToDate3 } from '@/utils/dateUtil'
type Status = 'edit' | 'new'
const emit = defineEmits(['onOk'])
const show = ref(false)
const configStore = useConfig()
const dicStore = useDictionary()
const currentStatus = ref<Status>('new')
let currentEditId: string | null = null
const modalTitle = computed(() => {
return currentStatus.value === "new" ? "新建过滤条件" : "编辑过滤条件";
});
return currentStatus.value === 'new' ? '新建过滤条件' : '编辑过滤条件'
})
const cardStyle = {
width: "800px",
"--n-padding-bottom": "10px",
"--n-padding-left": "10px",
};
'width': '800px',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
}
const noBorderInput = {
"--n-border": "0px",
"--n-border-hover": "0px",
"--n-border-pressed": "0px",
};
'--n-border': '0px',
'--n-border-hover': '0px',
'--n-border-pressed': '0px',
}
const formItemStyle = {
"--n-label-height": "0px",
"--n-feedback-height": "8px",
};
'--n-label-height': '0px',
'--n-feedback-height': '8px',
}
interface FormType {
name: string | null;
logic: string | null;
conditions: Condition[];
name: string | null
logic: string | null
conditions: Condition[]
}
interface Condition {
type: string | null;
operator: string | null;
result: any;
type: string | null
operator: string | null
result: any
}
interface Option {
label: string;
value: string;
label: string
value: string
}
const rules: FormRules = {
name: {
required: true,
message: "请输入过滤条件名称",
trigger: "blur",
message: '请输入过滤条件名称',
trigger: 'blur',
},
logic: {
required: true,
message: "请选择逻辑关系",
trigger: "blur",
message: '请选择逻辑关系',
trigger: 'blur',
},
conditions: {
required: true,
validator(rule: FormItemRule, value: Condition[]) {
for (const item of value) {
const { type, operator, result } = item;
const { type, operator, result } = item
if (type === null || operator === null || result === null)
return new Error("请选择过滤条件");
return new Error('请选择过滤条件')
}
return true;
return true
},
trigger: ["input", "blur"],
trigger: ['input', 'blur'],
},
};
}
const formRef = ref<FormInst | null>(null);
const formRef = ref<FormInst | null>(null)
const formValue = reactive<FormType>({
name: null,
logic: "and",
logic: 'and',
conditions: [
{
type: null,
operator: "eq",
operator: 'eq',
result: null,
},
],
});
})
function handleSumbit(e: MouseEvent) {
e.preventDefault();
e.preventDefault()
formRef.value?.validate((errors) => {
if (errors) return;
if (errors)
return
const list = formValue.conditions.map((item, index) => {
const { type, operator, result } = item;
const { type, operator, result } = item
return {
searchfield: type!,
@ -109,168 +109,169 @@ function handleSumbit(e: MouseEvent) {
searchvalue: formatValue(type!, result),
searchRelationType: formValue.logic!,
orderNum: index + 1,
};
});
}
})
const param: FilterCondition = {
searchname: formValue.name!,
type: 2,
ocrUsersearchchildList: list,
};
}
if (currentStatus.value === "new") addCondition(param);
else updateCondition({ id: currentEditId!, ...param });
closeModal();
});
if (currentStatus.value === 'new')
addCondition(param)
else updateCondition({ id: currentEditId!, ...param })
closeModal()
})
}
function formatValue(searchfield: string, searchvalue: any) {
if (searchfield === "izuptime") {
const start = formatToDate2(searchvalue[0]);
const end = formatToDate2(searchvalue[1]);
return `${start}-${end}`;
if (searchfield === 'izuptime') {
const start = formatToDate2(searchvalue[0])
const end = formatToDate2(searchvalue[1])
return `${start}-${end}`
}
return searchvalue;
return searchvalue
}
//
function unformatValue(searchfield: string, searchvalue: any) {
// 2022/01/03-2023/02/04
if (searchfield === "izuptime") {
const dataStrs = searchvalue.split("-");
const start = formatToDate3(dataStrs[0]);
const end = formatToDate3(dataStrs[1]);
return [start, end];
if (searchfield === 'izuptime') {
const dataStrs = searchvalue.split('-')
const start = formatToDate3(dataStrs[0])
const end = formatToDate3(dataStrs[1])
return [start, end]
}
return searchvalue;
return searchvalue
}
function createCondition() {
formValue.conditions.push({
type: null,
operator: "eq",
operator: 'eq',
result: null,
});
})
}
function removeCondition(index: number) {
formValue.conditions.splice(index, 1);
formValue.conditions.splice(index, 1)
}
function formLabel(index: number) {
return index === 0 ? "筛选条件" : "";
return index === 0 ? '筛选条件' : ''
}
const typeOptions = ref<Option[]>([]);
const typeOptions = ref<Option[]>([])
const operatorOptions = [
{
label: "等于",
value: "eq",
label: '等于',
value: 'eq',
},
{
label: "不等于",
value: "notEq",
label: '不等于',
value: 'notEq',
},
];
]
const logicOptions = ref([]);
const logicOptions = ref([])
onBeforeMount(() => {
// dicStore.fetchRelationTypeList();
dicStore.initData();
});
dicStore.initData()
})
watch(
() => dicStore.relationTypeList,
(newval) => {
logicOptions.value = newval;
}
);
logicOptions.value = newval
},
)
function showModal() {
show.value = true;
show.value = true
}
function closeModal() {
emit("onOk");
emit('onOk')
setTimeout(() => {
show.value = false;
}, 300);
show.value = false
}, 300)
}
function generateAllData(): Option[] {
const initVal: Option[] = [];
console.log(asideTaskMap,'asideTaskMap')
const initVal: Option[] = []
console.log(asideTaskMap, 'asideTaskMap')
const list = Object.keys(asideTaskMap).reduce((acc, value) => {
if (value.startsWith("iz") && asideTaskMap[value]?.inFilterList !== false) {
const name = asideTaskMap[value]?.label;
name &&
acc.push({
value,
label: name || "未配置",
});
if (value.startsWith('iz') && asideTaskMap[value]?.inFilterList !== false) {
const name = asideTaskMap[value]?.label
name
&& acc.push({
value,
label: name || '未配置',
})
}
return acc;
}, initVal);
return acc
}, initVal)
return list;
return list
}
typeOptions.value = generateAllData();
typeOptions.value = generateAllData()
function getOptions(key: string) {
console.log('key',key,'getOptions');
console.log(formValue.conditions,'formValue.conditions')
const getterName = `get${key}`;
const options = unref(dicStore[getterName]);
return options || [];
console.log('key', key, 'getOptions')
console.log(formValue.conditions, 'formValue.conditions')
const getterName = `get${key}`
const options = unref(dicStore[getterName])
return options || []
}
function leaveHandler() {
currentStatus.value = "new";
currentEditId = null;
currentStatus.value = 'new'
currentEditId = null
formValue.name = null;
formValue.name = null
formValue.conditions = [
{
type: null,
operator: "eq",
operator: 'eq',
result: null,
},
];
]
}
function edit(editFilter: any) {
currentStatus.value = "edit";
currentStatus.value = 'edit'
const { searchname, ocrUsersearchchildList, id } = editFilter;
currentEditId = id;
formValue.name = searchname;
const { searchname, ocrUsersearchchildList, id } = editFilter
currentEditId = id
formValue.name = searchname
formValue.conditions = ocrUsersearchchildList.map((item) => {
return {
type: item.searchfield,
operator: item.searchtype,
result: unformatValue(item.searchfield, item.searchvalue),
};
});
}
})
}
defineExpose({
showModal,
edit,
});
})
</script>
<template>
<n-modal
v-model:show="show"
transform-origin="center"
@after-leave="leaveHandler"
class="modal_wrapper"
@after-leave="leaveHandler"
>
<n-card
:style="cardStyle"
@ -289,8 +290,7 @@ defineExpose({
'font-size': '16px',
'font-weight': '600',
}"
>基本信息</span
>
>基本信息</span>
</div>
</div>
<div class="wrapper-form">
@ -299,14 +299,14 @@ defineExpose({
<n-input
v-model:value="formValue.name"
:style="{ width: '780px' }"
@keydown.enter.prevent
placeholder="请输入过滤名称"
@keydown.enter.prevent
/>
</n-form-item>
<n-form-item path="logic" label="逻辑关系" v-show="false">
<n-form-item v-show="false" path="logic" label="逻辑关系">
<n-select
filterable
v-model:value="formValue.logic"
filterable
placeholder="请选择逻辑关系"
:options="logicOptions"
/>
@ -319,15 +319,15 @@ defineExpose({
:label="formLabel(index)"
>
<n-select
filterable
v-model:value="item.type"
filterable
placeholder="请选择筛选项名称"
:options="typeOptions"
@update="item.result = ''"
/>
<n-select
filterable
v-model:value="item.operator"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
@ -341,9 +341,9 @@ defineExpose({
/>
</n-space>
<n-select
filterable
v-else
v-model:value="item.result"
filterable
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
@ -367,7 +367,9 @@ defineExpose({
</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>

@ -11,6 +11,7 @@ import {
unref,
watch,
} from 'vue'
import { useRoute } from 'vue-router'
import CustomFieldModalVue from '../modal/CustomFieldModal.vue'
import WorkSheetList from './WorkSheetList.vue'
import { getAllfieldList, getfieldList } from '@/api/home/filter'
@ -18,14 +19,12 @@ import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useUser } from '@/store/modules/user'
import { useWorkOrder } from '@/store/modules/workOrder'
import { getViewportOffset } from '@/utils/domUtils'
import { useRoute } from 'vue-router'
const route = useRoute()
const searchContent = route.query.searchContent;
console.log(searchContent);
defineOptions({ name: 'AsideContent' })
const emit = defineEmits(['ApprovalOver'])
const route = useRoute()
const searchContent = route.query.searchContent
console.log(searchContent)
const collapse = ref(false)
const workStore = useWorkOrder()
const filterModalRef = ref(null)
@ -40,7 +39,7 @@ function collapseHandler() {
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
const searchKeyword = ref(searchContent ? searchContent : '')
const searchKeyword = ref(searchContent || '')
const asideWidth = computed(() => {
return collapse.value ? 0 : 308
@ -183,14 +182,18 @@ if (searchContent) {
<span style="margin-left: 8px; color: #333333">所有任务包</span>
</div>
<div class="right">
<SvgIcon style="cursor: pointer; margin-left: 10px" size="18" name="magnifying-1"
@click="setShowSearch(true)" />
<SvgIcon
style="cursor: pointer; margin-left: 10px" size="18" name="magnifying-1"
@click="setShowSearch(true)"
/>
<SvgIcon style="cursor: pointer; margin-left: 10px" size="18" name="filter" @click="showFilter" />
</div>
</div>
<div v-show="showSearch" class="warpper">
<n-input v-model:value="searchKeyword" style="flex: 1; height: 32px" placeholder="请输入你需要搜索的内容"
@input="inputHandler">
<n-input
v-model:value="searchKeyword" style="flex: 1; height: 32px" placeholder="请输入你需要搜索的内容"
@input="inputHandler"
>
<template #suffix>
<SvgIcon size="14px" name="magnifying-1" />
</template>
@ -198,8 +201,10 @@ if (searchContent) {
<SvgIcon size="16px" style="margin-left: 6px; cursor: pointer" name="clear" @click="setShowSearch(false)" />
</div>
</div>
<WorkSheetList ref="packageListRef" class="work-sheet-list" :show-field-list="showFieldList" :dicts="dicts"
@approval-over="ApprovalOver" />
<WorkSheetList
ref="packageListRef" class="work-sheet-list" :show-field-list="showFieldList" :dicts="dicts"
@approval-over="ApprovalOver"
/>
<CustomFieldModalVue ref="filterModalRef" :review-type="1" @on-ok="getshowFieldList" />
</div>
</template>

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { format } from 'date-fns'
import { computed, onMounted, ref, watch } from 'vue'
import { computed, onMounted, ref } from 'vue'
import type { PackageListItem } from '/#/workorder'
import { useDialog } from 'naive-ui'
@ -24,7 +24,7 @@ const props = defineProps({
},
mouseOverTask: {
type: Object,
default: () => [],
default: () => {},
},
})
const emit = defineEmits(['dismisClick'])
@ -57,9 +57,6 @@ function handleDismissTask() {
})
popconfirmRef.value[0]?.setShow(false) // popconfirm
}
watch(() => props.mouseOverTask, (value) => {
console.log(props)
})
onMounted(async () => {
})
@ -111,7 +108,7 @@ onMounted(async () => {
</li>
<li v-else-if="item.id === 'createTime'">
生成时间<n-ellipsis style="max-width: 170px">
{{ listItem.createTime && format(listItem.createTime, "yyyy-MM-dd HH:mm:ss") || '全部' }}
{{ listItem.createTime && format(listItem.createTime as unknown as (number | Date), "yyyy-MM-dd HH:mm:ss") || '全部' }}
</n-ellipsis>
</li>
<li v-else-if="item.id === 'submit_date_timestamp'">

@ -6,22 +6,22 @@
</n-spin>
-->
<script lang="ts" setup>
import { audit } from '@/api/task/task';
import { audit } from '@/api/task/task'
import {
getPictureSimilarityList
} from "@/api/work/work";
import NotPassed from '@/components/Approval/NotPassed.vue';
import { useWorkOrder } from "@/store/modules/workOrder";
import { isEmpty } from "@/utils";
import { formatToDateHMS } from "@/utils/dateUtil";
import emitter from '@/utils/mitt';
import { useInfiniteScroll } from "@vueuse/core";
import imagesloaded from "imagesloaded";
import { clone, debounce } from "lodash-es";
import { useDialog, useMessage } from "naive-ui";
import { onMounted, onUnmounted, onUpdated, reactive, ref, toRefs, unref, watch } from "vue";
import ConfrimModal from "../modal/ConfrimModal.vue";
import type { ApprovalParam, SimilarityPictureSortParam } from "/#/api";
getPictureSimilarityList,
} from '@/api/work/work'
import NotPassed from '@/components/Approval/NotPassed.vue'
import { useWorkOrder } from '@/store/modules/workOrder'
import { isEmpty } from '@/utils'
import { formatToDateHMS } from '@/utils/dateUtil'
import emitter from '@/utils/mitt'
import { useInfiniteScroll } from '@vueuse/core'
import imagesloaded from 'imagesloaded'
import { clone, debounce } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { onMounted, onUnmounted, onUpdated, reactive, ref, toRefs, unref, watch } from 'vue'
import ConfrimModal from '../modal/ConfrimModal.vue'
import type { ApprovalParam, SimilarityPictureSortParam } from '/#/api'
const props = defineProps({
taskDetailInfo: {
@ -36,7 +36,7 @@ const props = defineProps({
type: Boolean,
default: () => (false),
},
});
})
const emit = defineEmits<{
(e: 'toggle', loading: boolean)
@ -44,169 +44,167 @@ const emit = defineEmits<{
const { taskDetailInfo, el, loading } = toRefs(props)
const batch = ref(false); //
const selectItems = ref<any[]>([]);
const message = useMessage();
const dialog = useDialog();
const totalCount = ref(0);
let _imagesload: any;
const batch = ref(false) //
const selectItems = ref<any[]>([])
const message = useMessage()
const dialog = useDialog()
const totalCount = ref(0)
let _imagesload: any
function setBatch(value: boolean) {
if (value && batch.value) {
batch.value = !value;
} else {
batch.value = value;
}
if (value && batch.value)
batch.value = !value
else
batch.value = value
if (value === false) {
selectItems.value.forEach((item) => (item.checked = false));
selectItems.value.length = 0;
selectItems.value.forEach(item => (item.checked = false))
selectItems.value.length = 0
}
}
function onCheckChange(checked: any, item: any) {
const index = selectItems.value.indexOf(item);
item.checked = checked;
const index = selectItems.value.indexOf(item)
item.checked = checked
if (index === -1 && checked) selectItems.value.push(item);
else selectItems.value.splice(index, 1);
if (index === -1 && checked)
selectItems.value.push(item)
else selectItems.value.splice(index, 1)
}
const taskpagination = reactive({
pageNo: 1,
pageSize: 10,
});
})
const sortBy: SimilarityPictureSortParam = {
orderType: "desc",
orderName: "similarityScore",
};
const workStore = useWorkOrder();
const selectTask = ref<any>(null);
const overTask = ref<any>(null);
const confrimModalRef = ref(null);
const listData = ref<any[]>([]);
const selectedSortName = ref('');
orderType: 'desc',
orderName: 'similarityScore',
}
const workStore = useWorkOrder()
const selectTask = ref<any>(null)
const overTask = ref<any>(null)
const confrimModalRef = ref(null)
const listData = ref<any[]>([])
const selectedSortName = ref('')
const notPassModalRef = ref(null)
const canLoadMore = ref(true);
const canLoadMore = ref(true)
let processItems: any[] = [];
let processItems: any[] = []
function validate(items: any[]) {
if (items.length === 0) return "至少选中一个任务";
if (items.length === 0)
return '至少选中一个任务'
return null;
return null
}
function reset() {
taskpagination.pageNo = 0;
taskpagination.pageSize = 20;
listData.value.length = 0;
taskpagination.pageNo = 0
taskpagination.pageSize = 20
listData.value.length = 0
emit('toggle', false)
canLoadMore.value = true;
canLoadMore.value = true
}
async function refreshHandler() {
reset();
console.log('refreshHandler')
reset()
useInfiniteScroll(
el as any,
() => {
console.log(el)
console.log(11111111)
loadMore();
loadMore()
},
{ distance: 10, interval: 1500, canLoadMore: () => canLoadMore.value }
);
{ distance: 10, interval: 1500, canLoadMore: () => canLoadMore.value },
)
}
async function loadMore() {
if (loading.value || el.value == null) return;
const more = await fetchList();
listData.value.push(...more);
if (loading.value || el.value == null)
return
const more = await fetchList()
listData.value.push(...more)
}
async function fetchList() {
console.log(3333)
emit('toggle', true)
try {
taskpagination.pageNo += 1;
taskpagination.pageNo += 1
const { data, total, pageCount } = await getPictureSimilarityList(
{ ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId, pictureId: taskDetailInfo.value.id }
);
totalCount.value = total;
canLoadMore.value = pageCount >= taskpagination.pageNo && pageCount > 0;
return data;
} catch (error) {
canLoadMore.value = false;
return [];
{ ...taskpagination, ...sortBy, checkDuplicateId: workStore.activeId, pictureId: taskDetailInfo.value.id },
)
totalCount.value = total
canLoadMore.value = pageCount >= taskpagination.pageNo && pageCount > 0
return data
}
catch (error) {
canLoadMore.value = false
return []
}
}
const layout = debounce(() => {
if (el.value == null) return;
if (el.value == null)
return
_imagesload = imagesloaded(".grid-item");
_imagesload = imagesloaded('.grid-item')
_imagesload.on("done", (instance) => {
if (!el.value) return;
_imagesload.on('done', (instance) => {
if (!el.value)
return
emit('toggle', false)
});
})
_imagesload.on("fail", (instance) => {
message.error("图片错误");
_imagesload.on('fail', (instance) => {
message.error('图片错误')
emit('toggle', false)
});
}, 300);
})
}, 300)
watch(
() => taskDetailInfo.value.id,
async (newValue, oldValue) => {
if (newValue !== oldValue) {
if (isEmpty(taskDetailInfo.value.id)) {
listData.value.length = 0;
totalCount.value = 0;
return;
listData.value.length = 0
totalCount.value = 0
return
}
refreshHandler()
}
}, { deep: true, immediate: true }
);
},
{ deep: true, immediate: true },
)
//
async function handleSelect(item: any) {
const packageid = workStore.getActiveId;
const packageid = workStore.getActiveId
if (isEmpty(packageid)) {
listData.value.length = 0;
totalCount.value = 0;
return;
listData.value.length = 0
totalCount.value = 0
}
}
async function sortHandler(orderby: "similarityScore" | "createdate") {
selectedSortName.value = orderby;
sortBy.orderName = orderby;
sortBy.orderType = sortBy.orderType === "asc" ? "desc" : "asc";
refreshHandler();
async function sortHandler(orderby: 'similarityScore' | 'createdate') {
selectedSortName.value = orderby
sortBy.orderName = orderby
sortBy.orderType = sortBy.orderType === 'asc' ? 'desc' : 'asc'
refreshHandler()
}
function overTaskHandelr(item: any) {
if (item?.historyStates === 2 || item?.historyStates == 3) {
overTask.value = null;
return;
overTask.value = null
return
}
if (validate([item]) == null && batch.value === false) overTask.value = item;
if (validate([item]) == null && batch.value === false)
overTask.value = item
}
function leaveTaskHandler() {
overTask.value = null;
overTask.value = null
}
function singleRejectHandler(item) {
const modal = unref(notPassModalRef)! as any
modal.showModal([item])
@ -272,7 +270,7 @@ function doAudit(param: any) {
emitter.emit('refresh')
refreshHandler()
}
else message.error(res.message)
else { message.error(res.message) }
})
}
@ -301,12 +299,12 @@ onMounted(async () => {
})
onUpdated(() => {
layout();
});
layout()
})
onUnmounted(() => {
workStore.reset();
});
workStore.reset()
})
</script>
<template>
@ -314,31 +312,36 @@ onUnmounted(() => {
<div style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0">
<div>
<span
style="font-size: 18px; font-weight: Medium;color: #333333;font-family: PingFang SC, PingFang SC-Medium;">任务包图片</span>
style="font-size: 18px; font-weight: Medium;color: #333333;font-family: PingFang SC, PingFang SC-Medium;"
>任务包图片</span>
</div>
<div style="display: flex; align-items: center;font-size: 14px;margin-right: 25px;color:#323233">
<div style="cursor: pointer" @click="sortHandler('createdate')">
<span>时间排序</span>
<SvgIcon style="margin-left: 5px" name="sort" size="12" v-show="selectedSortName !== 'createdate'" />
<SvgIcon style="margin-left: 5px" name="active-sort" size="12" v-show="selectedSortName === 'createdate'" />
<SvgIcon v-show="selectedSortName !== 'createdate'" style="margin-left: 5px" name="sort" size="12" />
<SvgIcon v-show="selectedSortName === 'createdate'" style="margin-left: 5px" name="active-sort" size="12" />
</div>
<div style="margin-left: 15px; cursor: pointer" @click="sortHandler('similarityScore')">
<span>相似度排序</span>
<SvgIcon style="margin-left: 5px" name="sort" size="12" v-show="selectedSortName !== 'similarityScore'" />
<SvgIcon style="margin-left: 5px" name="active-sort" size="12"
v-show="selectedSortName === 'similarityScore'" />
<SvgIcon v-show="selectedSortName !== 'similarityScore'" style="margin-left: 5px" name="sort" size="12" />
<SvgIcon
v-show="selectedSortName === 'similarityScore'" style="margin-left: 5px" name="active-sort"
size="12"
/>
</div>
</div>
</div>
<div class="wrapper-list">
<div v-for="(item, index) in listData" :key="index" :class="{ 'item-selected': item === selectTask }"
class="grid-item" @click="handleSelect(item)" @mouseover="overTaskHandelr(item)" @mouseleave="leaveTaskHandler">
<div
v-for="(item, index) in listData" :key="index" :class="{ 'item-selected': item === selectTask }"
class="grid-item" @click="handleSelect(item)" @mouseover="overTaskHandelr(item)" @mouseleave="leaveTaskHandler"
>
<div class="img-wrapper" :style="{ 'background-image': `url(${item.imgurl})` }" />
<div class="time-wrapper">
<div class="time">
<SvgIcon color="#FFF" size="16" name="camera" />
<span class="current-time">{{ item.photoDateTimestamp ? formatToDateHMS(Number(item.photoDateTimestamp) ||
0) : '-'
<span class="current-time">{{ item.photoDateTimestamp ? formatToDateHMS(Number(item.photoDateTimestamp)
|| 0) : '-'
}}</span>
</div>
<div class="time">
@ -349,8 +352,10 @@ onUnmounted(() => {
</div>
</div>
<div class="check">
<n-checkbox v-show="batch && item.historyStates !== 2 && item.historyStates !== 3"
v-model:checked="item.checked" @click.stop @update:checked="onCheckChange($event, item)" />
<n-checkbox
v-show="batch && item.historyStates !== 2 && item.historyStates !== 3"
v-model:checked="item.checked" @click.stop @update:checked="onCheckChange($event, item)"
/>
</div>
<div class="percent" :class="{ 'percent-red': item?.maxSimilarity >= 100 }">
<div class="val">
@ -358,10 +363,10 @@ onUnmounted(() => {
</div>
</div>
<div class="pass-status" v-if="item.historyStates === 2">
<div v-if="item.historyStates === 2" class="pass-status">
<SvgIcon name="pass-icon" style="width:52;height:24px" />
</div>
<div class="pass-status" v-else-if="item.historyStates === 3">
<div v-else-if="item.historyStates === 3" class="pass-status">
<SvgIcon name="no-pass-icon" style="width:52;height:24px" />
</div>
<div v-show="overTask && overTask.id === item.id" class="action">
@ -372,7 +377,6 @@ onUnmounted(() => {
</div>
<NotPassed ref="notPassModalRef" @success="reloadList" />
<ConfrimModal ref="confrimModalRef" @commit="reject" />
</div>
</template>
@ -480,7 +484,6 @@ onUnmounted(() => {
}
}
.action {
position: absolute;
z-index: 5;
@ -495,11 +498,9 @@ onUnmounted(() => {
background-color: rgba(0, 0, 0, 0.48);
}
}
}
::v-deep(.n-divider:not(.n-divider--vertical)) {
margin-top: 12px;
margin-bottom: 12px;

@ -105,7 +105,7 @@ function previewHandler(event: MouseEvent) {
<div class="check">
<n-checkbox
v-show="batch && taskDetailInfo?.userapprove?.statshis === 1"
v-model:checked="taskDetailInfo?.checked"
v-model:checked="taskDetailInfo.checked"
@click.stop
@update:checked="onCheckChange($event, taskDetailInfo)"
/>

@ -1,18 +1,17 @@
<script lang="ts" setup>
import DataHeader from "@/components/DataHeader/index.vue";
import { ref } from "vue";
import Aside from "./aside/Aside.vue";
import Content from "./content/Content.vue";
import { useWorkOrder } from "@/store/modules/workOrder";
import { ref } from 'vue'
import Aside from './aside/Aside.vue'
import Content from './content/Content.vue'
import DataHeader from '@/components/DataHeader/index.vue'
import { useWorkOrder } from '@/store/modules/workOrder'
import Robot from '@/components/Robot/index.vue'
const workStore = useWorkOrder();
const contentRef: any = ref(null);
const ApprovalOver = (packageId) => {
const id: string = workStore.getActiveId;
contentRef.value.queryDetail(id);
};
const workStore = useWorkOrder()
const contentRef: any = ref(null)
function ApprovalOver(packageId) {
const id: string = workStore.getActiveId
contentRef.value.queryDetail(id)
}
</script>
<template>
@ -22,7 +21,7 @@ const ApprovalOver = (packageId) => {
</div>
<div class="main">
<!-- 侧边 -->
<Aside @ApprovalOver="ApprovalOver" />
<Aside @approval-over="ApprovalOver" />
<!-- 内容 -->
<Content ref="contentRef" />

@ -1,52 +1,52 @@
<script lang="ts" setup>
import { nextTick, onDeactivated, onMounted, reactive, ref, toRefs } from "vue";
import { format } from "date-fns";
import { NButton, NDataTable, useDialog, useMessage } from "naive-ui";
import { aiApprovaltools, aiApprovaltoolsClearmark, setTF } from "@/api/work/work";
import { audit } from "@/api/task/task";
import { getToolsCount } from "@/api/home/main";
import { storage } from "@/utils/Storage";
import { CURRENT_USER } from "@/store/mutation-types";
import { nextTick, onDeactivated, onMounted, reactive, ref, toRefs } from 'vue'
import { format } from 'date-fns'
import { NButton, NDataTable, useDialog, useMessage } from 'naive-ui'
import { aiApprovaltools, aiApprovaltoolsClearmark, setTF } from '@/api/work/work'
import { audit } from '@/api/task/task'
import { getToolsCount } from '@/api/home/main'
import { storage } from '@/utils/Storage'
import { CURRENT_USER } from '@/store/mutation-types'
const emit = defineEmits<{
(e: "reject", params?: any);
(e: "notPass", params: any);
}>();
(e: 'reject', params?: any)
(e: 'notPass', params: any)
}>()
const message = useMessage()
const dialog = useDialog();
const dialog = useDialog()
const state: any = reactive({
detail: {},
packageid: "",
});
const { detail } = toRefs(state);
packageid: '',
})
const { detail } = toRefs(state)
const cardStyle = {
width: "450px",
"--n-padding-bottom": "10px",
"--n-padding-left": "0px",
};
'width': '450px',
'--n-padding-bottom': '10px',
'--n-padding-left': '0px',
}
const show = ref(false);
const show = ref(false)
function showModal(id) {
state.packageid = id;
getDetail(id);
state.packageid = id
getDetail(id)
}
async function getDetail(id) {
// const userInfo = storage.get(CURRENT_USER);
// const nodeType = userInfo.nodeType;
// id = "264627119490116380";
const res = await aiApprovaltools({ taskid: id });
if (res.code === "OK") {
state.detail = res.data;
if(Number(res.data.pendingApprovaCount) > 0){
show.value = true;
}
const res = await aiApprovaltools({ taskid: id })
if (res.code === 'OK') {
state.detail = res.data
if (Number(res.data.pendingApprovaCount) > 0)
show.value = true
}
}
const handleReject = async () => {
async function handleReject() {
const param = {
result: false,
comment: '',
@ -57,71 +57,73 @@ const handleReject = async () => {
flowTaskInfoList: state.detail.flowTaskInfoList,
}
const res = await audit(param)
if(res.code == 'OK'){
if (res.code == 'OK')
message.success(res.message)
}else{
else
message.error(res.message)
}
emit('reject',state.packageid)
closeModal();
};
emit('reject', state.packageid)
closeModal()
}
async function clearMark() {
const res = await aiApprovaltoolsClearmark({ taskid: state.packageid });
if (res.code === "OK") closeModal();
const res = await aiApprovaltoolsClearmark({ taskid: state.packageid })
if (res.code === 'OK')
closeModal()
}
function closeModal() {
show.value = false;
show.value = false
}
async function reject() {
// emit('reject', { a: 'todo' })
// closeModal()
dialog.info({
title: "确认提示",
content: "确认设置成假吗?",
positiveText: "确定",
negativeText: "取消",
title: '确认提示',
content: '确认设置成假吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: async () => {
// TODO
// const result = await resetApproval()
clearMark();
clearMark()
},
onNegativeClick: () => {},
});
})
}
async function viewRepeat(e: MouseEvent) {
emit("notPass", {
emit('notPass', {
id: state.packageid,
detail: state.detail,
});
e.preventDefault();
closeModal();
})
e.preventDefault()
closeModal()
}
const initRem = () => {
const designWidth = 1440;
const rempPx = 16;
const scale = window.innerWidth / designWidth;
document.documentElement.style.fontSize = scale * rempPx + "px";
};
function initRem() {
const designWidth = 1440
const rempPx = 16
const scale = window.innerWidth / designWidth
document.documentElement.style.fontSize = `${scale * rempPx}px`
}
onMounted(() => {
nextTick(() => {
initRem();
});
window.addEventListener("resize", () => {
initRem();
});
});
initRem()
})
window.addEventListener('resize', () => {
initRem()
})
})
onDeactivated(() => {
window.removeEventListener("resize", () => {});
});
window.removeEventListener('resize', () => {})
})
defineExpose({
showModal,
});
})
</script>
<template>
@ -131,7 +133,9 @@ defineExpose({
<SvgIcon style="cursor: pointer" name="cut-down" width="32" @click="closeModal" />
</div>
<div class="wrapper-hearder">
<div class="wrapper-title">智能AI审批工具</div>
<div class="wrapper-title">
智能AI审批工具
</div>
<div class="wrapper-mark">
{{ detail.tenantUserName || "部门信息" }}
</div>
@ -140,10 +144,12 @@ defineExpose({
<div class="item">
<div class="imgwrapper" />
<div class="content">
<div class="task_id">{{ detail.packageName }}</div>
<div class="task_id">
{{ detail.packageName }}
</div>
<div class="tag_box">
<div class="tag_item error">
<span style="color: red"><SvgIcon name="error_icon" size="14"/></span> 重复图片({{
<span style="color: red"><SvgIcon name="error_icon" size="14" /></span> 重复图片({{
detail.similarComplete || 0
}})
</div>

@ -1,64 +1,76 @@
<script lang="ts" setup>
import { ref } from "vue";
import { ref } from 'vue'
const emit = defineEmits<{
(e: "reject", params: any);
(e: "viewrepeat");
}>();
(e: 'reject', params: any)
(e: 'viewrepeat')
}>()
const cardStyle = {
width: "450px",
"--n-padding-bottom": "10px",
"--n-padding-left": "0px",
};
'width': '450px',
'--n-padding-bottom': '10px',
'--n-padding-left': '0px',
}
const show = ref(false);
const show = ref(false)
function showModal() {
show.value = true;
show.value = true
}
function closeModal() {
show.value = false;
show.value = false
}
async function reject() {
emit("reject", { a: "todo" });
closeModal();
emit('reject', { a: 'todo' })
closeModal()
}
async function viewRepeat(e: MouseEvent) {
emit("viewrepeat");
e.preventDefault();
closeModal();
emit('viewrepeat')
e.preventDefault()
closeModal()
}
defineExpose({
showModal,
});
})
</script>
<template>
<n-modal :show="true" transform-origin="center" class="modal_wrap">
<div class="wrapper">
<div class="closed">
<SvgIcon style="cursor: pointer" name="cut-down" width="32" @click="closeModal"/>
<SvgIcon style="cursor: pointer" name="cut-down" width="32" @click="closeModal" />
</div>
<div class="wrapper-hearder">
<div class="wrapper-title">智能AI审批工具</div>
<div class="wrapper-mark">某某有限公司-某某事业部-张小凡</div>
<div class="wrapper-title">
智能AI审批工具
</div>
<div class="wrapper-mark">
某某有限公司-某某事业部-张小凡
</div>
</div>
<div class="wrapper-content">
<n-scrollbar style="height: 200px">
<div v-for="i in 1" :key="i" class="item">
<div class="imgwrapper" />
<div class="content">
<div class="task_id">任务IDYPW34567890-2995</div>
<div class="task_id">
任务IDYPW34567890-2995
</div>
<div class="tag_box">
<div class="tag_item">基线任务</div>
<div class="tag_item error">中日友好医院</div>
<div class="tag_item">
基线任务
</div>
<div class="tag_item error">
中日友好医院
</div>
</div>
<div class="time_box">
2023-09-17 13:09:10
</div>
<div class="time_box">2023-09-17 13:09:10</div>
</div>
</div>
</n-scrollbar>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save