WIP: 项目梳理 #186

Draft
lizhong wants to merge 6 commits from refactor/project into test

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,48 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredPackages">
<value>
<list size="15">
<item index="0" class="java.lang.String" itemvalue="PyMuPDF" />
<item index="1" class="java.lang.String" itemvalue="scikit-image" />
<item index="2" class="java.lang.String" itemvalue="shapely" />
<item index="3" class="java.lang.String" itemvalue="opencv-contrib-python" />
<item index="4" class="java.lang.String" itemvalue="opencv-python" />
<item index="5" class="java.lang.String" itemvalue="cython" />
<item index="6" class="java.lang.String" itemvalue="numpy" />
<item index="7" class="java.lang.String" itemvalue="attrdict" />
<item index="8" class="java.lang.String" itemvalue="imgaug" />
<item index="9" class="java.lang.String" itemvalue="premailer" />
<item index="10" class="java.lang.String" itemvalue="lxml" />
<item index="11" class="java.lang.String" itemvalue="visualdl" />
<item index="12" class="java.lang.String" itemvalue="openpyxl" />
<item index="13" class="java.lang.String" itemvalue="lanms-neo" />
<item index="14" class="java.lang.String" itemvalue="Polygon3" />
</list>
</value>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N806" />
<option value="N812" />
<option value="N801" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="image_tools.image_similarity.calculate" />
<option value="float.*" />
</list>
</option>
</inspection_tool>
<inspection_tool class="TsLint" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="Node.js Core" />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<option name="fix-on-save" value="true" />
</component>
</project>

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="$PROJECT_DIR$/../../../webutils/ai/PaddleOCR/.conda" project-jdk-type="Python SDK" />
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

11
components.d.ts vendored

@ -11,19 +11,30 @@ declare module 'vue' {
BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default'] BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default']
DataHeader: typeof import('./src/components/DataHeader/index.vue')['default'] DataHeader: typeof import('./src/components/DataHeader/index.vue')['default']
NAvatar: typeof import('naive-ui')['NAvatar'] NAvatar: typeof import('naive-ui')['NAvatar']
NBackTop: typeof import('naive-ui')['NBackTop']
NButton: typeof import('naive-ui')['NButton'] NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard']
NCheckbox: typeof import('naive-ui')['NCheckbox'] NCheckbox: typeof import('naive-ui')['NCheckbox']
NCollapse: typeof import('naive-ui')['NCollapse']
NCollapseItem: typeof import('naive-ui')['NCollapseItem']
NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDatePicker: typeof import('naive-ui')['NDatePicker']
NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDialogProvider: typeof import('naive-ui')['NDialogProvider']
NDivider: typeof import('naive-ui')['NDivider'] NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown'] NDropdown: typeof import('naive-ui')['NDropdown']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NForm: typeof import('naive-ui')['NForm'] NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem'] NFormItem: typeof import('naive-ui')['NFormItem']
NGi: typeof import('naive-ui')['NGi']
NGrid: typeof import('naive-ui')['NGrid']
NGridItem: typeof import('naive-ui')['NGridItem']
NImage: typeof import('naive-ui')['NImage']
NInput: typeof import('naive-ui')['NInput'] NInput: typeof import('naive-ui')['NInput']
NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NMessageProvider: typeof import('naive-ui')['NMessageProvider']
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NotPassed: typeof import('./src/components/NotPassed.vue')['default'] NotPassed: typeof import('./src/components/NotPassed.vue')['default']
NPopconfirm: typeof import('naive-ui')['NPopconfirm']
NPopover: typeof import('naive-ui')['NPopover'] NPopover: typeof import('naive-ui')['NPopover']
NPopselect: typeof import('naive-ui')['NPopselect'] NPopselect: typeof import('naive-ui')['NPopselect']
NProgress: typeof import('naive-ui')['NProgress'] NProgress: typeof import('naive-ui')['NProgress']

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

@ -48,6 +48,7 @@
"@commitlint/config-conventional": "^18.4.3", "@commitlint/config-conventional": "^18.4.3",
"@types/imagesloaded": "^4.1.6", "@types/imagesloaded": "^4.1.6",
"@types/lodash": "^4.14.197", "@types/lodash": "^4.14.197",
"@types/lodash-es": "^4.17.12",
"@types/masonry-layout": "^4.2.7", "@types/masonry-layout": "^4.2.7",
"@types/node": "^18.17.1", "@types/node": "^18.17.1",
"@types/sortablejs": "^1.15.7", "@types/sortablejs": "^1.15.7",

@ -100,6 +100,9 @@ devDependencies:
'@types/lodash': '@types/lodash':
specifier: ^4.14.197 specifier: ^4.14.197
version: 4.14.202 version: 4.14.202
'@types/lodash-es':
specifier: ^4.17.12
version: 4.17.12
'@types/masonry-layout': '@types/masonry-layout':
specifier: ^4.2.7 specifier: ^4.2.7
version: 4.2.7 version: 4.2.7
@ -1323,7 +1326,6 @@ packages:
resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==}
dependencies: dependencies:
'@types/lodash': 4.14.202 '@types/lodash': 4.14.202
dev: false
/@types/lodash@4.14.202: /@types/lodash@4.14.202:
resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==} resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==}

@ -0,0 +1,29 @@
#-------------------------------------------------------------------------------#
# Qodana analysis is configured by qodana.yaml file #
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
#-------------------------------------------------------------------------------#
version: "1.0"
#Specify inspection profile for code analysis
profile:
name: qodana.starter
#Enable inspections
#include:
# - name: <SomeEnabledInspectionId>
#Disable inspections
#exclude:
# - name: <SomeDisabledInspectionId>
# paths:
# - <path/where/not/run/inspection>
#Execute shell command before Qodana execution (Applied in CI/CD pipeline)
#bootstrap: sh ./prepare-qodana.sh
#Install IDE plugins before Qodana execution (Applied in CI/CD pipeline)
#plugins:
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)
#Specify Qodana linter for analysis (Applied in CI/CD pipeline)
linter: jetbrains/qodana-js:latest

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

@ -1,5 +1,5 @@
import { http } from '@/utils/http/axios' import { http } from '@/utils/http/axios'
import type { BusinessParam, PageParam } from '/#/api' import type { PageParam } from '/#/api'
/** /**
* *
@ -274,7 +274,6 @@ export async function getIzprojecttypeList(enabled: string) {
/** /**
* *
* @param enabled
* @returns * @returns
*/ */
export async function getIzvisitcityList() { export async function getIzvisitcityList() {

@ -65,6 +65,7 @@ export async function repetitionTask() {
/** /**
* *
* @param params
* @returns * @returns
*/ */
export async function getRepeatList(params: FinalParam) { export async function getRepeatList(params: FinalParam) {

@ -3,8 +3,12 @@ import type { FilterCondition, FilterParam, FilterSearchParam, FilterUpdate, Pag
/** /**
* *
* @param params *
* @returns 1 * @param page
* @param searchParam
* @param type
* @returns
*
*/ */
export async function getConditionList(page: PageParam, searchParam: FilterSearchParam, type: number): Promise<any> { export async function getConditionList(page: PageParam, searchParam: FilterSearchParam, type: number): Promise<any> {
const res = await http.request({ const res = await http.request({
@ -21,7 +25,7 @@ export async function getConditionList(page: PageParam, searchParam: FilterSearc
return { return {
pageCount: pages, pageCount: pages,
data: records, data: records,
total total,
} }
} }
@ -52,7 +56,7 @@ export async function updateCondition(params: FilterUpdate) {
/** /**
* *
* @param params * @param { ids: string } params
* @returns * @returns
*/ */
export async function deleteCondition(params: { ids: string }) { export async function deleteCondition(params: { ids: string }) {
@ -90,7 +94,7 @@ export async function setFilter(params: FilterParam): Promise<void> {
/** /**
* *
* @param params * @param searchid
* @returns * @returns
*/ */
export async function favorite(searchid: string): Promise<void> { export async function favorite(searchid: string): Promise<void> {
@ -103,7 +107,7 @@ export async function favorite(searchid: string): Promise<void> {
/** /**
* *
* @param params * @param searchid
* @returns * @returns
*/ */
export async function unfavorite(searchid: string): Promise<void> { export async function unfavorite(searchid: string): Promise<void> {
@ -172,7 +176,3 @@ export async function sort(searchid: string, reorder: number): Promise<void> {
params: { reviewType, userId, userFieldFixed, userFieldUnFixed }, params: { reviewType, userId, userFieldFixed, userFieldUnFixed },
}) })
} }

@ -79,7 +79,6 @@ export async function getToolsCount() {
}) })
} }
/** /**
* *
* @param note * @param note
@ -132,7 +131,6 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @returns * @returns
*/ */
export async function getLastCheckNo() { export async function getLastCheckNo() {
return http.request({ return http.request({
url: `/ocr/checkDuplicate/getLastCheckNo`, url: `/ocr/checkDuplicate/getLastCheckNo`,
method: 'get', method: 'get',
@ -145,7 +143,6 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @returns * @returns
*/ */
export async function getCheckDuplicateStatus(checkDuplicateNo) { export async function getCheckDuplicateStatus(checkDuplicateNo) {
return http.request({ return http.request({
url: `/ocr/checkDuplicate/getCheckDuplicateStatus`, url: `/ocr/checkDuplicate/getCheckDuplicateStatus`,
method: 'get', method: 'get',
@ -159,7 +156,6 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @returns * @returns
*/ */
export async function removeCheckDuplicate(checkDuplicateNo) { export async function removeCheckDuplicate(checkDuplicateNo) {
return http.request({ return http.request({
url: `/ocr/checkDuplicate/removeCheckDuplicate`, url: `/ocr/checkDuplicate/removeCheckDuplicate`,
method: 'get', method: 'get',
@ -173,11 +169,10 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @returns * @returns
*/ */
export async function createPackage(params) { export async function createPackage(params) {
return http.request({ return http.request({
url: `/ocr/ocrTaskPackage/createPackage`, url: `/ocr/ocrTaskPackage/createPackage`,
method: 'post', method: 'post',
params params,
}) })
} }
/** /**
@ -186,11 +181,10 @@ export async function oneClickCheck(params: Partial<CheckParam> = { search_histo
* @returns * @returns
*/ */
export async function deletePackage(params) { export async function deletePackage(params) {
return http.request({ return http.request({
url: `/ocr/ocrTaskPackage/deletePackage`, url: `/ocr/ocrTaskPackage/deletePackage`,
method: 'get', method: 'get',
params params,
}) })
} }
/** /**
@ -270,10 +264,9 @@ export async function getPictureList(params: any): Promise<any> {
* @returns * @returns
*/ */
export async function getFilterList(params) { export async function getFilterList(params) {
return http.request({ return http.request({
url: `/ocr/ocrUsersearch/querySearchCondition`, url: `/ocr/ocrUsersearch/querySearchCondition`,
method: 'get', method: 'get',
params params,
}) })
} }

@ -1,7 +1,4 @@
import qs from 'qs'
import { http } from '@/utils/http/axios' import { http } from '@/utils/http/axios'
import type { ApprovalParam, PageParam } from '/#/api'
import { ContentTypeEnum } from '@/enums/httpEnum'
/** /**
* *
@ -15,7 +12,7 @@ export async function getApprovalList(page: any) {
pageSize: page.pageSize, pageSize: page.pageSize,
currPage: page.pageNo, currPage: page.pageNo,
keyword: page.keyword, keyword: page.keyword,
userSearchId:page.userSearchId userSearchId: page.userSearchId,
}, },
}) })

@ -22,7 +22,6 @@ const cardStyle = {
} }
function showModal(value) { function showModal(value) {
console.log(value)
state.detail = value state.detail = value
show.value = true show.value = true
} }
@ -54,8 +53,6 @@ async function handleSumbit(e: MouseEvent) {
// selectRejectId.value === 'other' // selectRejectId.value === 'other'
// emit('commit', unref(comomitValue), unref(selectBackId), showOther.value) // emit('commit', unref(comomitValue), unref(selectBackId), showOther.value)
console.log(state.detail)
console.log(comomitValue)
const param = { const param = {
formid: [state.detail.id], formid: [state.detail.id],
taskId: ['66b06dda-e673-11ee-a934-0242bc74e4f3'], taskId: ['66b06dda-e673-11ee-a934-0242bc74e4f3'],
@ -87,7 +84,6 @@ onBeforeMount(async () => {
}) })
async function selectChange(id) { async function selectChange(id) {
console.log(id, 'selectChange')
selectItem.value = reasonOptions.value.find(v => v.id == id) selectItem.value = reasonOptions.value.find(v => v.id == id)
} }
</script> </script>

@ -30,9 +30,7 @@ function initHandler() {
queryNote().then((res) => { queryNote().then((res) => {
if (res.data) if (res.data)
note.value = res.data.notecontent note.value = res.data.notecontent
}).catch(e => console.error('Quill file -> Error in initHandler function', e))
console.log('note:', note.value)
}).catch(e => console.log(e))
} }
const saveHandler = debounce(() => { const saveHandler = debounce(() => {

@ -1,21 +1,21 @@
<template>
<div class="ip_box" :style="canClick?'cursor: pointer;':''">
<img :src="IPImg" />
</div>
</template>
<script setup> <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({ defineProps({
canClick: { canClick: {
type: Boolean, type: Boolean,
default: () => false, default: () => false,
}, },
}); })
</script> </script>
<template>
<div class="ip_box" :style="canClick ? 'cursor: pointer;' : ''">
<img :src="IPImg">
</div>
</template>
<style scoped lang="less"> <style scoped lang="less">
.ip_box { .ip_box {
position: fixed; position: fixed;

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

@ -1,52 +0,0 @@
export const asideMap: Recordable<AsideEntity> = {
izupuser: {
label: '',
defaultValue: null,
isDefaultFilter: true,
key: 'izupuser',
component: ReportUserVue,
},
izproject: {
label: '',
defaultValue: null,
isDefaultFilter: true,
key: 'izproject',
component: IzProjectVue,
},
izplan: {
label: '',
defaultValue: null,
isDefaultFilter: true,
key: 'izplan',
component: PlanVue,
},
izstatus: {
label: '',
defaultValue: null,
isDefaultFilter: false,
key: 'izstatus',
component: PlanVue, // todo
},
izyear: {
label: '',
defaultValue: null,
isDefaultFilter: false,
key: 'izyear',
component: TimeVue,
},
iztaskrrom: {
label: '',
defaultValue: null,
isDefaultFilter: false,
key: 'iztaskrrom',
component: IztaskrromVue,
},
izshowall: {
label: '',
defaultValue: true,
isDefaultFilter: false,
key: 'izshowall',
component: PictureDownloadVue,
inFilterList: false,
},
}

@ -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 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 { export interface AsideEntity {
label: string label: string

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

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

@ -122,8 +122,6 @@ const layout = debounce(() => {
// } // }
// el.value!.scrollTo({ top: height, behavior: 'instant' }) // el.value!.scrollTo({ top: height, behavior: 'instant' })
loading = false loading = false
console.log('loading---------------', loading)
console.log('pagination.pageNo---------------', pagination.pageNo)
if (pagination.pageNo == 3) { if (pagination.pageNo == 3) {
let timer let timer
if (timer) if (timer)
@ -131,7 +129,6 @@ const layout = debounce(() => {
timer = setTimeout(() => { timer = setTimeout(() => {
isTop.value = false isTop.value = false
console.log('isTop.value---------------', isTop.value)
}, 1000) }, 1000)
} }
}) })
@ -152,7 +149,6 @@ useInfiniteScroll(
el as any, el as any,
() => { () => {
loading = false loading = false
console.log('加载了000000000000000---------------------------')
loadMore() loadMore()
}, },
{ distance: 10, canLoadMore: () => canloadMore }, { distance: 10, canLoadMore: () => canloadMore },
@ -162,22 +158,14 @@ async function featchList() {
loading = true loading = true
try { try {
// const result = await dubiousfilelist({ ...pagination, orderbyname: timeRange.value }) // const result = await dubiousfilelist({ ...pagination, orderbyname: timeRange.value })
console.log('pagination.pageNo------------', pagination.pageNo)
const result = await dubiousfilelist({ ...pagination, ...sortObj }) const result = await dubiousfilelist({ ...pagination, ...sortObj })
// TODO // TODO
// result.data = Array.from({ length: 30 }) // result.data = Array.from({ length: 30 })
const { data, pageCount } = result const { data, pageCount } = result
// canloadMore = pageCount >= pagination.pageNo && pageCount > 0; // canloadMore = pageCount >= pagination.pageNo && pageCount > 0;
canloadMore = data.pages >= pagination.pageNo && data.pages > 0 canloadMore = data.pages >= pagination.pageNo && data.pages > 0
console.log('canloadMore------------', canloadMore)
return result.data.records return result.data.records
// const list = data.map((item) => {
// return {
// imgUrl: randomUrl(),
// }
// })
// return list
} }
catch (error) { catch (error) {
canloadMore = false canloadMore = false
@ -186,14 +174,12 @@ async function featchList() {
} }
async function loadMore() { async function loadMore() {
console.log('执行l------------------------', loading, el.value, pagination.pageNo)
if (loading || el.value == null) if (loading || el.value == null)
return return
// loading = true // loading = true
pagination.pageNo = pagination.pageNo + 1 pagination.pageNo = pagination.pageNo + 1
const more = await featchList() const more = await featchList()
console.log('more------------------------', more)
listData.value.push(...more) listData.value.push(...more)
layout() layout()
} }
@ -246,21 +232,6 @@ function imUpdateSelectIds(x: number, y: number, w: number, h: number) {
if (rect.right > x && rect.bottom > y && rect.left < x + w && rect.top < y + h) if (rect.right > x && rect.bottom > y && rect.left < x + w && rect.top < y + h)
index === -1 && selectIds.value.push(item.dataset.id!) index === -1 && selectIds.value.push(item.dataset.id!)
else index !== -1 && selectIds.value.splice(index, 1) else index !== -1 && selectIds.value.splice(index, 1)
// let tempApproveIndex = -1;
// selectedApproveItems.value.map((approveItem, approveIndex) => {
// console.log("approveItem and item", approveItem, item );
// if(approveItem.selfId == item.dataset.id) {
// tempApproveIndex = approveIndex;
// }
// })
// if (tempApproveIndex === -1 && item.className.indexOf('grid-item-selected') != -1) {
// let tempItem: any = cloneDeep(item);
// tempItem.selfId = item.dataset.id;
// selectedApproveItems.value.push(tempItem)
// } else {
// selectedApproveItems.value.splice(tempApproveIndex, 1);
// }
}) })
selectedApproveItems.value = [] selectedApproveItems.value = []
// //
@ -451,7 +422,6 @@ async function commit() {
} }
} }
function remove() { function remove() {
// console.log("finally-selectedApproveItems------------", selectedApproveItems.value);
if (!selectIds.value || selectIds.value.length === 0) { if (!selectIds.value || selectIds.value.length === 0) {
message.error('至少选中一个') message.error('至少选中一个')
return return
@ -531,7 +501,6 @@ function approvalHandler(items?: any) {
// => => / // => => /
if (items !== undefined && !(items instanceof PointerEvent)) if (items !== undefined && !(items instanceof PointerEvent))
processItems = [items] processItems = [items]
console.log('batch-------------', batch.value, selectedApproveItems.value, processItems)
const msg = validate(processItems) const msg = validate(processItems)
if (msg !== null) { if (msg !== null) {
@ -604,7 +573,6 @@ async function refreshHandler(filtersearchId?: any) {
useInfiniteScroll( useInfiniteScroll(
el as any, el as any,
() => { () => {
console.log('加载了333333333333333333333333---------------------------')
loadMore() loadMore()
}, },
{ distance: 10, canLoadMore: () => canloadMore }, { distance: 10, canLoadMore: () => canloadMore },
@ -618,13 +586,11 @@ watch(() => show.value, async (newVal) => {
pagination.pageNo = 1 pagination.pageNo = 1
const list = await featchList() const list = await featchList()
listData.value = list listData.value = list
console.log('加载了1111111111111---------------------------', listData.value)
layout() layout()
} }
}) })
watch(() => pagination.pageNo, (newVal, oldVal) => { watch(() => pagination.pageNo, (newVal, oldVal) => {
console.log('加载了22222222222222222---------------------------', newVal, oldVal, canloadMore)
if (newVal == oldVal) if (newVal == oldVal)
return return

@ -14,7 +14,7 @@ defineExpose({
<template> <template>
<div> <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" /> <Search @close="show = false" />
</n-modal> </n-modal>
</div> </div>

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

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

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

@ -85,7 +85,6 @@ export function createRouterGuards(router: Router) {
router.afterEach((to, _, failure) => { router.afterEach((to, _, failure) => {
document.title = (to?.meta?.title as string) || document.title document.title = (to?.meta?.title as string) || document.title
if (isNavigationFailure(failure)) { if (isNavigationFailure(failure)) {
// console.log('failed navigation', failure)
} }
const asyncRouteStore = useAsyncRoute() const asyncRouteStore = useAsyncRoute()
// 在这里设置需要缓存的组件名称 // 在这里设置需要缓存的组件名称
@ -108,7 +107,6 @@ export function createRouterGuards(router: Router) {
}) })
router.onError((error) => { router.onError((error) => {
// eslint-disable-next-line no-console console.error(error, '路由错误')
console.log(error, '路由错误')
}) })
} }

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

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

@ -1,6 +1,6 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { store } from '@/store' 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 { export interface DictionaryState {
regionList: any regionList: any
@ -104,32 +104,32 @@ export const useDictionaryStore = defineStore({
}, },
getizApprovalStatus: (state) => { getizApprovalStatus: (state) => {
return state.izApprovalStatusList return state.izApprovalStatusList
} },
}, },
actions: { actions: {
initData() { initData() {
// this.fetchRegionList(); //废弃 // this.fetchRegionList(); //废弃
this.fetchPictureTypeList(); this.fetchPictureTypeList()
this.fetchPersionList(); this.fetchPersionList()
this.fetchPlanList(); this.fetchPlanList()
this.fetchTFList(); this.fetchTFList()
// this.fetchIzShowList(); //废弃 // this.fetchIzShowList(); //废弃
this.fetchIzProjectList(); this.fetchIzProjectList()
this.fetchIztaskrromList(); this.fetchIztaskrromList()
this.fetchIztaskstatusList(); this.fetchIztaskstatusList()
this.fetchIzvisitproList(); this.fetchIzvisitproList()
this.fetchIzfirmList(); this.fetchIzfirmList()
this.fetchIzproductnameList(); this.fetchIzproductnameList()
this.fetchizcustomnameList(); this.fetchizcustomnameList()
this.fetchIzCustomtypeList(); this.fetchIzCustomtypeList()
this.fetchIzcustomlevelList(); this.fetchIzcustomlevelList()
this.fetchizizprojecttypeList(); this.fetchizizprojecttypeList()
this.fetchizvisitcityList(); this.fetchizvisitcityList()
this.fetchRejectList(); this.fetchRejectList()
this.fetchBackList(); this.fetchBackList()
this.fetchRelationTypeList(); this.fetchRelationTypeList()
this.fetchizstatusListt(); this.fetchizstatusListt()
this.fetchizApprovalStatusList(); this.fetchizApprovalStatusList()
}, },
settfList(config) { settfList(config) {
this.tfList = config this.tfList = config

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

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

@ -150,7 +150,6 @@ export const useUserStore = defineStore({
}, },
// 刷新token // 刷新token
async refreshToken() { async refreshToken() {
// console.log('refresh token!')
const response = await refreshToken() const response = await refreshToken()
const { data: token, code } = response const { data: token, code } = response
if (code === ResultEnum.SUCCESS) if (code === ResultEnum.SUCCESS)

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

@ -203,7 +203,6 @@ const transform: AxiosTransform = {
const config = response.config 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) const expirationTime = storage.get(TOKEN_EXPIRATION_TIME)
// console.log('剩余失效时间(分):', (expirationTime - Date.now()) / 1000 / 60, config.url)
if (expirationTime && (expirationTime - Date.now()) <= 0 && !whitelist.includes(config.url as string)) { if (expirationTime && (expirationTime - Date.now()) <= 0 && !whitelist.includes(config.url as string)) {
if (!isRefreshingToken) { if (!isRefreshingToken) {
@ -231,7 +230,6 @@ const transform: AxiosTransform = {
} }
else { else {
return new Promise((resolve) => { return new Promise((resolve) => {
// console.log('刷新token中暂存此请求', config.url)
requests.push((token) => { requests.push((token) => {
(config as Recordable).headers.logintoken = token (config as Recordable).headers.logintoken = token
resolve(instance(config)) // 执行请求, resolve(instance(config)) // 执行请求,

@ -115,36 +115,6 @@ onBeforeMount(async () => {
nextTick(() => { nextTick(() => {
finalStore.$subscribe(() => { finalStore.$subscribe(() => {
// const customConfig = finalStore.getCustomConfig;
// console.log("customConfigaside---------------", customConfig);
// if (customConfig === null) return;
// const showKeys: string[] = [...customConfig];
// // const defaultKeys = Object.keys(asideMap).filter(
// // (key) => asideMap[key].isDefaultFilter
// // );
// // showKeys.unshift(...defaultKeys);
// Object.keys(asideMap).forEach((key) => {
// //
// if (key.startsWith("iz"))
// asideVisible[key] =
// asideMap[key] && (showKeys.includes(key) || asideMap[key].isDefaultFilter);
// });
// const items = showKeys.reduce((acc, key) => {
// if (asideMap[key]) {
// const config = {
// key,
// config: asideMap[key],
// };
// return [...acc, config];
// } else {
// return acc;
// }
// }, []);
// console.log("showItems111111111---------------", items);
// showItems.value = items;
const config = finalStore.getSystemConfig const config = finalStore.getSystemConfig
const customConfig = finalStore.getCustomConfig const customConfig = finalStore.getCustomConfig
if ( if (
@ -157,13 +127,6 @@ nextTick(() => {
if (config == null || customConfig == null) if (config == null || customConfig == null)
return 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)
*/
const sortKeyList: any = [] const sortKeyList: any = []
finalStore.getFilterConfig.forEach((item: any) => { finalStore.getFilterConfig.forEach((item: any) => {
sortKeyList.push(item?.id) sortKeyList.push(item?.id)
@ -188,7 +151,6 @@ nextTick(() => {
customObjRef.value[str] = customObjRef.value[str].split(',') customObjRef.value[str] = customObjRef.value[str].split(',')
asideValue[key] = customObjRef.value[str] // asideValue[key] = customObjRef.value[str] //
console.log('相似度2222222222', asideValue[key])
} }
else if (str == 'izyear') { else if (str == 'izyear') {
if (typeof customObjRef.value[str] == 'string') { if (typeof customObjRef.value[str] == 'string') {
@ -198,12 +160,8 @@ nextTick(() => {
customObjRef.value[str] = time customObjRef.value[str] = time
} }
asideValue[key] = customObjRef.value[str] // asideValue[key] = customObjRef.value[str] //
console.log('时间2222222222', asideValue[key])
} }
else if (customObjRef.value[str]) { 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') { if (typeof customObjRef.value[str] == 'string') {
customObjRef.value[str] = customObjRef.value[str].split(',') customObjRef.value[str] = customObjRef.value[str].split(',')
asideValue[key] = customObjRef.value[str] // asideValue[key] = customObjRef.value[str] //
@ -215,17 +173,12 @@ nextTick(() => {
else { else {
asideValue[key] = null asideValue[key] = null
} }
// asideMap[str].defaultValue = customObjRef.value[str];//
} }
}) })
customTempObjRef.value = customObjRef.value customTempObjRef.value = customObjRef.value
console.log('asideValue直接处理后的结果', asideValue)
console.log('customTempObjRef.value', customTempObjRef.value)
const tempobj = cloneDeep(asideValue) const tempobj = cloneDeep(asideValue)
console.log('tempObj', tempobj)
finalStore.setAsideValue(tempobj) finalStore.setAsideValue(tempobj)
} }
// console.log("showKeys", showKeys);
const items = showKeys.reduce((acc, key) => { const items = showKeys.reduce((acc, key) => {
const currentData = asideMap[key] const currentData = asideMap[key]
const render = currentData?.render const render = currentData?.render
@ -242,7 +195,6 @@ nextTick(() => {
return acc return acc
} }
}, []) }, [])
console.log('showItems=================================', items)
showItems.value = items showItems.value = items
configFilterRef.value = finalStore.getFilterConfig configFilterRef.value = finalStore.getFilterConfig
}) })
@ -276,7 +228,6 @@ function scrollHandler(key: string) {
} }
async function filterHandler(searchId: string) { async function filterHandler(searchId: string) {
// emitter.emit("filter-final", searchId);
const res = await getFilterList({ userSearchId: searchId }) const res = await getFilterList({ userSearchId: searchId })
// console.log("", res); // console.log("", res);
if (res.code == 'OK') { if (res.code == 'OK') {
@ -288,7 +239,6 @@ async function filterHandler(searchId: string) {
if (Object.prototype.hasOwnProperty.call(asideMap, key)) if (Object.prototype.hasOwnProperty.call(asideMap, key))
showKeys.push(key) showKeys.push(key)
}) })
console.log('showKeys1111111111111111', showKeys)
finalStore.setCustomConfig(showKeys) finalStore.setCustomConfig(showKeys)
} }
} }
@ -307,7 +257,6 @@ function inputChange(keyword) {
emit('inputChange', keyword) emit('inputChange', keyword)
} }
function handleOk(item: any) { function handleOk(item: any) {
console.log('handleOk', item)
if (item) { if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname) AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname)
filterHandler(item.id) filterHandler(item.id)
@ -319,27 +268,17 @@ function handleOk(item: any) {
} }
function updateComponent(key, e) { function updateComponent(key, e) {
console.log('跟新值', key, e)
console.log('tempAsideValue跟新值', finalStore.getAsideValue, asideValue)
// let tempAsideValue = finalStore.getAsideValue || asideValue; // let tempAsideValue = finalStore.getAsideValue || asideValue;
const tempobj = cloneDeep(asideValue) const tempobj = cloneDeep(asideValue)
console.log(tempobj, 'tempobj')
tempobj[key] = e tempobj[key] = e
console.log(tempobj, 'tempobj After')
customObjRef.value = tempobj customObjRef.value = tempobj
// asideValue = Object.assign({}, asideValue, tempobj); // asideValue = Object.assign({}, asideValue, tempobj);
console.log('asideValue跟新值', tempobj)
finalStore.setAsideValue(tempobj) finalStore.setAsideValue(tempobj)
} }
</script> </script>
<template> <template>
<div <div class="aside" :style="asideStyle" @mouseenter="asideEnter = true" @mouseleave="asideEnter = false">
class="aside"
:style="asideStyle"
@mouseenter="asideEnter = true"
@mouseleave="asideEnter = false"
>
<div v-show="showCollapse" class="aside-collapse"> <div v-show="showCollapse" class="aside-collapse">
<div class="aside-collapse-btn" @click="collapseHandler"> <div class="aside-collapse-btn" @click="collapseHandler">
<SvgIcon :name="collapseIcon" size="40" /> <SvgIcon :name="collapseIcon" size="40" />
@ -368,12 +307,8 @@ function updateComponent(key, e) {
</div> </div>
<component <component
:is="item.config.component" :is="item.config.component" v-for="(item, index) in showItems" :id="item.key" :key="index"
v-for="(item, index) in showItems" v-model:value="asideValue[item.key]" :label="item.config.label"
:id="item.key"
:key="index"
v-model:value="asideValue[item.key]"
:label="item.config.label"
@update:value="(e) => updateComponent(item.key, e)" @update:value="(e) => updateComponent(item.key, e)"
/> />
@ -435,17 +370,11 @@ function updateComponent(key, e) {
right: -20px; right: -20px;
} }
::v-deep(.n-collapse ::v-deep(.n-collapse .n-collapse-item.n-collapse-item--right-arrow-placement .n-collapse-item__header .n-collapse-item-arrow) {
.n-collapse-item.n-collapse-item--right-arrow-placement
.n-collapse-item__header
.n-collapse-item-arrow) {
margin-left: 8px; margin-left: 8px;
} }
::v-deep(.n-collapse ::v-deep(.n-collapse .n-collapse-item .n-collapse-item__header .n-collapse-item__header-main) {
.n-collapse-item
.n-collapse-item__header
.n-collapse-item__header-main) {
font-weight: bold; font-weight: bold;
justify-content: space-between; justify-content: space-between;
} }
@ -458,18 +387,11 @@ function updateComponent(key, e) {
border-top: 0px; border-top: 0px;
} }
::v-deep(.n-collapse ::v-deep(.n-collapse .n-collapse-item .n-collapse-item__content-wrapper .n-collapse-item__content-inner) {
.n-collapse-item
.n-collapse-item__content-wrapper
.n-collapse-item__content-inner) {
padding-top: 10px; padding-top: 10px;
} }
::v-deep(.n-scrollbar ::v-deep(.n-scrollbar > .n-scrollbar-rail.n-scrollbar-rail--vertical > .n-scrollbar-rail__scrollbar, .n-scrollbar + .n-scrollbar-rail.n-scrollbar-rail--vertical > .n-scrollbar-rail__scrollbar) {
> .n-scrollbar-rail.n-scrollbar-rail--vertical
> .n-scrollbar-rail__scrollbar, .n-scrollbar
+ .n-scrollbar-rail.n-scrollbar-rail--vertical
> .n-scrollbar-rail__scrollbar) {
width: 0px; width: 0px;
} }
} }

@ -1,25 +1,30 @@
<script lang="ts" setup> <script lang="ts" setup>
import { debounce, difference } from 'lodash-es' import { cloneDeep, debounce, difference, isEqual } from 'lodash-es'
import { computed, ref, watch, onMounted } from 'vue' import { computed, onMounted, ref, watch } from 'vue'
import { VueDraggable } from 'vue-draggable-plus' import { VueDraggable } from 'vue-draggable-plus'
import { setFilter } from '@/api/home/filter' import { setFilter } from '@/api/home/filter'
import { asideMap } from '@/config/final' import { asideMap } from '@/config/final'
import { useFinal } from '@/store/modules/final' import { useFinal } from '@/store/modules/final'
import { cloneDeep, isEqual } from "lodash-es";
const show = ref(false) const show = ref(false)
const finalStore = useFinal() const finalStore = useFinal()
const checkAll = ref(false) const checkAll = ref(false)
const selectIds = ref<string[]>([]) const selectIds = ref<string[]>([])
const tempList = ref<string[]>([]) const tempList = ref<string[]>([])
let extraCustomConfig :any = []; const extraCustomConfig: any = []
//
const offList = ref<any[]>([])
//
const onList = ref<any[]>([])
const offKeyword = ref('')
const onKeyword = ref('')
Object.keys(asideMap).forEach((key) => { Object.keys(asideMap).forEach((key) => {
const { isDefaultFilter } = asideMap[key]; const { isDefaultFilter } = asideMap[key]
if (isDefaultFilter) { if (isDefaultFilter)
extraCustomConfig.push(key); extraCustomConfig.push(key)
} })
});
function showModal() { function showModal() {
show.value = true show.value = true
@ -28,8 +33,6 @@ function showModal() {
const config = finalStore.getSystemConfig const config = finalStore.getSystemConfig
const customConfig = finalStore.getCustomConfig const customConfig = finalStore.getCustomConfig
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',config, customConfig)
console.log('开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',tempList.value, finalStore.getFilterConfig)
if (config == null || customConfig == null) if (config == null || customConfig == null)
return return
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig)) if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
@ -37,7 +40,6 @@ function showModal() {
const { showList, hideList } = generatList(config, customConfig) const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList) tempList.value = cloneDeep(showList)
console.log("tempList.value开启了lllllllllllllllllll", showList, hideList);
if (tempList.value.length > 0) if (tempList.value.length > 0)
finalStore.setFilterConfig(tempList.value) finalStore.setFilterConfig(tempList.value)
@ -54,11 +56,6 @@ function closeModal() {
show.value = false show.value = false
} }
//
const offList = ref<any[]>([])
//
const onList = ref<any[]>([])
const allCount = computed(() => { const allCount = computed(() => {
return `全部筛选(共${offList.value.length}个)` return `全部筛选(共${offList.value.length}个)`
}) })
@ -92,40 +89,16 @@ function generateDefaultList(config) {
} }
function generatList(config, customConfig) { function generatList(config, customConfig) {
const keys = Object.keys(config)
let onList: object[] = [] let onList: object[] = []
let offList: any = [] const offList: any = []
let showKeys = []; const showKeys: any[] = []
const tempShowKeys = [...customConfig, ...extraCustomConfig]; const tempShowKeys = [...customConfig, ...extraCustomConfig]
tempShowKeys.map(item => { tempShowKeys.forEach((item) => {
if(!showKeys.includes(item)) { if (!showKeys.includes(item))
showKeys.push(item); showKeys.push(item)
} })
});
console.log('原始筛选条件showKeys', showKeys) Object.keys(asideMap).forEach((key) => {
console.log('原始筛选条件config customConfig', config, customConfig)
// for (const key of keys) {
// if (!key.startsWith('iz') || config[key] === 'N' || asideMap[key] === undefined)
// continue
// const name = asideMap[key]?.label
// const isDefaultFilter = asideMap[key]?.isDefaultFilter
// // Y
// if (!isDefaultFilter) {
// 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)
// }
// }
Object.keys(asideMap).map(key => {
const name = asideMap[key]?.label const name = asideMap[key]?.label
const isDefaultFilter = asideMap[key]?.isDefaultFilter const isDefaultFilter = asideMap[key]?.isDefaultFilter
@ -161,43 +134,30 @@ function generatList(config, customConfig) {
return acc return acc
} }
}, []) }, [])
console.log('原始筛选条件onList', onList)
const fixedList = generateDefaultList(config) const fixedList = generateDefaultList(config)
// offList.unshift(...fixedList)
console.log('原始筛选条件fixedList', fixedList)
onList.unshift(...fixedList) onList.unshift(...fixedList)
console.log('原始筛选条件customConfig', customConfig)
// onListcustomConfig // onListcustomConfig
const tempOnList = cloneDeep(onList) const tempOnList = cloneDeep(onList)
console.log('原始筛选条件tempOnList', tempOnList)
const sortKeyList: any = [] const sortKeyList: any = []
finalStore.getFilterConfig.map((item: any) => { finalStore.getFilterConfig.forEach((item: any) => {
console.log("tFilterConfig item000000000000000", item);
sortKeyList.push(item.id) sortKeyList.push(item.id)
}) })
console.log('原始筛选条件sortKeyList', sortKeyList)
console.log('原始筛选条件showKeys', showKeys)
const sortList: any = [] const sortList: any = []
if (sortKeyList.length > 0) { if (sortKeyList.length > 0) {
sortKeyList.map((key) => { sortKeyList.forEach((key) => {
const tempItem = tempOnList.find(item => item.id == key) const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) { if (tempItem)
sortList.push(tempItem) sortList.push(tempItem)
}
}) })
} }
else { else {
showKeys.map((key) => { showKeys.forEach((key) => {
const tempItem = tempOnList.find(item => item.id == key) const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) { if (tempItem)
sortList.push(tempItem) sortList.push(tempItem)
}
}) })
} }
console.log('原始筛选条件showList', sortList)
console.log('原始筛选条件hideList', offList)
console.log('原始筛选条件configStore.getFilterConfig', finalStore.getFilterConfig)
// return { showList: onList, hideList: offList } // return { showList: onList, hideList: offList }
return { showList: sortList, hideList: offList } return { showList: sortList, hideList: offList }
} }
@ -208,20 +168,16 @@ finalStore.$subscribe(() => {
if (config == null || customConfig == null) if (config == null || customConfig == null)
return return
console.log('订阅tempList.value-----------', tempList.value)
console.log('订阅finalStore.getFilterConfig-----------', finalStore.getFilterConfig)
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig)) if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
return return
const { showList, hideList } = generatList(config, customConfig) const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList) tempList.value = cloneDeep(showList)
console.log('订阅克隆条件', tempList.value)
if (tempList.value.length > 0) if (tempList.value.length > 0)
finalStore.setFilterConfig(tempList.value) finalStore.setFilterConfig(tempList.value)
// setTimeout(() => { // setTimeout(() => {
// }, 500); // }, 500);
console.log('订阅showList, hideList-----------', showList, hideList)
onList.value = showList onList.value = showList
offList.value = hideList offList.value = hideList
}) })
@ -234,17 +190,13 @@ async function handleSumbit(e: MouseEvent) {
await setFilter({ searchcount: param, type: 1 }) await setFilter({ searchcount: param, type: 1 })
const obj = await finalStore.fetchCustomConfig() const obj = await finalStore.fetchCustomConfig()
console.log('obj-------------------------------', obj)
const tempOnList = cloneDeep(onList.value) const tempOnList = cloneDeep(onList.value)
console.log('提交筛选条件tempOnList', tempOnList)
const sortList: any = [] const sortList: any = []
obj.map((key) => { obj.forEach((key) => {
const tempItem = tempOnList.find(item => item.id == key) const tempItem = tempOnList.find(item => item.id == key)
if(tempItem) { if (tempItem)
sortList.push(tempItem) sortList.push(tempItem)
}
}) })
console.log('finalStore.sortList提交---------------', sortList)
// setTimeout(() => { // setTimeout(() => {
if (sortList.length > 0) if (sortList.length > 0)
finalStore.setFilterConfig(sortList) finalStore.setFilterConfig(sortList)
@ -359,9 +311,6 @@ function removeHandler(id: string) {
onList.value.splice(index, 1) onList.value.splice(index, 1)
} }
const offKeyword = ref('')
const onKeyword = ref('')
const leftInputHandler = debounce((keyword) => { const leftInputHandler = debounce((keyword) => {
offKeyword.value = keyword offKeyword.value = keyword
}, 300) }, 300)
@ -370,19 +319,6 @@ const rightInputHandler = debounce((keyword) => {
onKeyword.value = keyword onKeyword.value = keyword
}, 300) }, 300)
// async function getfield() {
// let res
// res = await getAllfieldList(3)
// const userStore = useUser()
// const userInfo = userStore.getUserInfo
// res = await getfieldList(3, userInfo.id)
// }
function onMove(e) {
// e
if (e?.related?.className?.indexOf('fix') !== -1)
return false
}
onMounted(() => { onMounted(() => {
// getfield() // getfield()
}) })

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

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

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

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

@ -54,14 +54,6 @@ async function query() {
sortname: '', sortname: '',
}) })
const { data } = result const { data } = result
// console.log(data)
// // const list = []
// // data.forEach((items) => {
// // items.repeatedTaskList.forEach((item) => {
// // list.push(item)
// // })
// // })
// console.log(data)
emit('reject', data) emit('reject', data)
closeModal() closeModal()
} }

@ -190,8 +190,6 @@ async function query(page: number, pageSize: number) {
pageNo: pagination.page, pageNo: pagination.page,
sortname: '', sortname: '',
}) })
console.log(666666)
console.log(result)
const { data, pageCount, totalCount } = result const { data, pageCount, totalCount } = result
total.value = totalCount total.value = totalCount
@ -288,7 +286,6 @@ function batchApproval() {
message.error(msg) message.error(msg)
return return
} }
console.log(items)
const list: any = [] const list: any = []
items.forEach((item) => { items.forEach((item) => {
list.push({ list.push({

@ -483,7 +483,6 @@ const message = useMessage()
const finalStore = useFinal() const finalStore = useFinal()
async function query(page: number, pageSize: number, filterId?: any, taskName?: string) { async function query(page: number, pageSize: number, filterId?: any, taskName?: string) {
console.log('query', taskName)
const asideParmas = unref(finalStore.getAsideValue) const asideParmas = unref(finalStore.getAsideValue)
// 使使 // 使使
// let params = filterId ? { userSearchId: filterId } : asideParmas // let params = filterId ? { userSearchId: filterId } : asideParmas
@ -498,7 +497,7 @@ async function query(page: number, pageSize: number, filterId?: any, taskName?:
taskName, taskName,
...params, ...params,
}) })
const { data, pageCount, totalCount } = result const { data, totalCount } = result
tableData.value = data tableData.value = data
total.value = totalCount total.value = totalCount
pagination.page = page pagination.page = page
@ -749,7 +748,6 @@ function batchApproval() {
message.error(msg) message.error(msg)
return return
} }
console.log(items)
const list: any = [] const list: any = []
items.forEach((item) => { items.forEach((item) => {
list.push({ list.push({
@ -774,7 +772,6 @@ function batchApproval() {
// //
function repeatBatchReject(items) { function repeatBatchReject(items) {
console.log(items)
rejectHandler(items) rejectHandler(items)
} }
@ -860,18 +857,19 @@ async function refreshHandler(searchId?: any) {
if (id_param) if (id_param)
searchKeyword = id_param[0].slice(1, -1) searchKeyword = id_param[0].slice(1, -1)
} }
console.log('refreshHandler', searchKeyword)
query(pagination.page, pagination.pageSize, searchId, searchKeyword) query(pagination.page, pagination.pageSize, searchId, searchKeyword)
} }
function filterTableData(keyword) { function filterTableData(keyword) {
pagination.page = 1 pagination.page = 1
pagination.pageSize = 10 pagination.pageSize = 10
if (keyword) if (keyword) {
query(pagination.page, pagination.pageSize, '', keyword) query(pagination.page, pagination.pageSize, '', keyword)
else }
else {
query(pagination.page, pagination.pageSize) query(pagination.page, pagination.pageSize)
} }
}
defineExpose({ defineExpose({
filterTableData, filterTableData,
@ -883,20 +881,10 @@ defineExpose({
<div class="wrapper-header"> <div class="wrapper-header">
<div class="wrapper-header-left"> <div class="wrapper-header-left">
<span class="wrapper-header-font">任务管理列表</span> <span class="wrapper-header-font">任务管理列表</span>
<SvgIcon <SvgIcon style="cursor: pointer" size="16" name="list-mode" @click="changeContent" />
style="cursor: pointer"
size="16"
name="list-mode"
@click="changeContent"
/>
</div> </div>
<div> <div>
<SvgIcon <SvgIcon style="margin-right: 6px" size="13" name="summary" @click="showModal(repeatModalRef)" />
style="margin-right: 6px"
size="13"
name="summary"
@click="showModal(repeatModalRef)"
/>
<NButton class="xjcc" text @click="showModal(repeatModalRef)"> <NButton class="xjcc" text @click="showModal(repeatModalRef)">
小结查重 小结查重
</NButton> </NButton>
@ -916,27 +904,16 @@ defineExpose({
</NButton> </NButton>
<img <img
class="btn-approval btn-left" class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt=""
src="@/assets/images/task/btn-not-pass.png"
alt=""
@click.stop="batchReject" @click.stop="batchReject"
> >
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
<img <img class="btn-approval" src="@/assets/images/task/btn-pass.png" alt="" @click.stop="batchApproval">
class="btn-approval"
src="@/assets/images/task/btn-pass.png"
alt=""
@click.stop="batchApproval"
>
</div> </div>
<n-popover <n-popover
ref="popover" ref="popover" :style="{ padding: '0px' }" style="width: 148px" :show-arrow="false"
:style="{ padding: '0px' }" placement="bottom-start" trigger="click"
style="width: 148px"
:show-arrow="false"
placement="bottom-start"
trigger="click"
> >
<template #trigger> <template #trigger>
<div class="icon-wrap"> <div class="icon-wrap">
@ -977,46 +954,22 @@ defineExpose({
</div> </div>
</div> --> </div> -->
<div class="wrapper-settings"> <div class="wrapper-settings">
<SvgIcon <SvgIcon style="cursor: pointer" size="18" name="column" @click="showModal(customTabelRef)" />
style="cursor: pointer"
size="18"
name="column"
@click="showModal(customTabelRef)"
/>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<NDataTable <NDataTable
id="table" id="table" ref="tableRef" v-model:checked-row-keys="checkedRowKeys" remote :columns="columnsRef"
ref="tableRef" :scroll-x="scrollX" :max-height="maxHeight" :data="tableData" :loading="loading" :pagination="pagination"
v-model:checked-row-keys="checkedRowKeys" :row-key="rowKey" @update:page="handlePageChange" @update-page-size="handlePageSizeChange"
remote @update:checked-row-keys="handleCheck" @update:sorter="handleSorterChange"
: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"
/> />
</div> </div>
<CustomTabelModal ref="customTabelRef" @commit="commitHandler" /> <CustomTabelModal ref="customTabelRef" @commit="commitHandler" />
<ImportExcelModal <ImportExcelModal ref="importExcelRef" :on-success="sucessHandler" :header-config="headRules" />
ref="importExcelRef"
:on-success="sucessHandler"
:header-config="headRules"
/>
<NotPassed ref="notPassModalRef" @success="reload" /> <NotPassed ref="notPassModalRef" @success="reload" />
<RepeatModal <RepeatModal ref="repeatModalRef" @reject="repeatBatchReject" @viewrepeat="showModal(repeatTaskTableModalRef)" />
ref="repeatModalRef"
@reject="repeatBatchReject"
@viewrepeat="showModal(repeatTaskTableModalRef)"
/>
<RepeatTaskTableModal ref="repeatTaskTableModalRef" /> <RepeatTaskTableModal ref="repeatTaskTableModalRef" />
</div> </div>
</template> </template>

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

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

@ -9,9 +9,7 @@ import {
ref, ref,
shallowRef, shallowRef,
unref, unref,
watch,
} from 'vue' } from 'vue'
import dayjs from 'dayjs'
import { cloneDeep, isEqual } from 'lodash-es' import { cloneDeep, isEqual } from 'lodash-es'
import { CustomFilterModalVue, FilterModalVue, NewFilterModalVue } from './comp/modals' import { CustomFilterModalVue, FilterModalVue, NewFilterModalVue } from './comp/modals'
import Search from './comp/Search.vue' import Search from './comp/Search.vue'
@ -19,11 +17,9 @@ import AdvanceFilter from './comp/AdvanceFilter.vue'
import { getViewportOffset } from '@/utils/domUtils' import { getViewportOffset } from '@/utils/domUtils'
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn' import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useConfig } from '@/store/modules/asideConfig' import { useConfig } from '@/store/modules/asideConfig'
import type { Filter } from '/#/home'
import type { AsideEntity } from '@/config/aside' import type { AsideEntity } from '@/config/aside'
import { asideMap } from '@/config/aside' import { asideMap } from '@/config/aside'
import type { AsideConfig } from '/#/api' import type { AsideConfig } from '/#/api'
import emitter from '@/utils/mitt'
import { getFilterList } from '@/api/home/main' import { getFilterList } from '@/api/home/main'
const configStore = useConfig() const configStore = useConfig()
@ -57,9 +53,7 @@ function showModal(modalRef: any) {
onMounted(() => { onMounted(() => {
nextTick(() => { nextTick(() => {
computeSlideHeight() computeSlideHeight()
const tempAsideValue = cloneDeep(asideValue)
// configStore.setAsideValue(tempAsideValue); // configStore.setAsideValue(tempAsideValue);
console.log('asideMap和asideValue', tempAsideValue)
}) })
}) })
@ -115,7 +109,6 @@ nextTick(() => {
if (config == null || customConfig == null) if (config == null || customConfig == null)
return return
// console.log("config", config, "customConfig", customConfig);
/* rao /* rao
const showKeys = [...customConfig].filter(key => !asideMap[key].isDefaultFilter)// customConfig isDefaultFilter const showKeys = [...customConfig].filter(key => !asideMap[key].isDefaultFilter)// customConfig isDefaultFilter
const defaultKeys = Object.keys(asideMap).filter(key => asideMap[key].isDefaultFilter)// asideMap isDefaultFilter const defaultKeys = Object.keys(asideMap).filter(key => asideMap[key].isDefaultFilter)// asideMap isDefaultFilter
@ -143,13 +136,11 @@ nextTick(() => {
// if (asideMap.hasOwnProperty(key)) { // if (asideMap.hasOwnProperty(key)) {
if (Object.prototype.hasOwnProperty.call(customObjRef.value, key)) { if (Object.prototype.hasOwnProperty.call(customObjRef.value, key)) {
const str = key.toLowerCase() const str = key.toLowerCase()
// console.log("customObjRef.value[str]1111111111111", customObjRef.value[str]);
if (str == 'izsimilarity') { if (str == 'izsimilarity') {
if (typeof customObjRef.value[str] == 'string') if (typeof customObjRef.value[str] == 'string')
customObjRef.value[str] = customObjRef.value[str].split(',') customObjRef.value[str] = customObjRef.value[str].split(',')
asideValue[key] = customObjRef.value[str] // asideValue[key] = customObjRef.value[str] //
console.log('相似度2222222222', asideValue[key])
} }
else if (str == 'izyear') { else if (str == 'izyear') {
if (typeof customObjRef.value[str] == 'string') { if (typeof customObjRef.value[str] == 'string') {
@ -159,16 +150,13 @@ nextTick(() => {
customObjRef.value[str] = time customObjRef.value[str] = time
} }
asideValue[key] = customObjRef.value[str] // asideValue[key] = customObjRef.value[str] //
console.log('时间2222222222', asideValue[key])
} }
else if ( else if (
str != 'izsimilarity' str != 'izsimilarity'
&& str != 'izyear' && str != 'izyear'
&& customObjRef.value[str] && customObjRef.value[str]
) { ) {
console.log('customObjRef.value[str]222222', customObjRef.value[str])
// let list = customObjRef.value[str].split(','); // let list = customObjRef.value[str].split(',');
// console.log("list222222", list);
asideValue[key] = customObjRef.value[str] // asideValue[key] = customObjRef.value[str] //
} }
else { else {
@ -179,13 +167,9 @@ nextTick(() => {
return key return key
}) })
customTempObjRef.value = customObjRef.value customTempObjRef.value = customObjRef.value
console.log('asideValue直接处理后的结果', asideValue)
console.log('customTempObjRef.value', customTempObjRef.value)
const tempobj = cloneDeep(asideValue) const tempobj = cloneDeep(asideValue)
console.log('tempObj', tempobj)
configStore.setAsideValue(tempobj) configStore.setAsideValue(tempobj)
} }
// console.log("showKeys", showKeys);
const items = showKeys.reduce((acc, key) => { const items = showKeys.reduce((acc, key) => {
const currentData = asideMap[key] const currentData = asideMap[key]
const render = currentData?.render const render = currentData?.render
@ -202,7 +186,6 @@ nextTick(() => {
return acc return acc
} }
}, []) }, [])
console.log('showItems=================================', items)
showItems.value = items showItems.value = items
configFilterRef.value = configStore.getFilterConfig configFilterRef.value = configStore.getFilterConfig
}) })
@ -236,7 +219,6 @@ function scrollHandler(key: string) {
async function filterHandler(searchId: string) { async function filterHandler(searchId: string) {
// emitter.emit('filter', searchId) // emitter.emit('filter', searchId)
const res = await getFilterList({ userSearchId: searchId }) const res = await getFilterList({ userSearchId: searchId })
// console.log("", res);
if (res.code == 'OK') { if (res.code == 'OK') {
const obj = res.data const obj = res.data
customObjRef.value = res.data customObjRef.value = res.data
@ -249,7 +231,6 @@ async function filterHandler(searchId: string) {
return key return key
}) })
// console.log(showKeys);
configStore.setCustomConfig(showKeys) configStore.setCustomConfig(showKeys)
} }
} }
@ -261,21 +242,14 @@ function editFilter(filter: any) {
} }
function updateComponent(key, e) { function updateComponent(key, e) {
console.log('跟新值', key, e)
console.log('tempAsideValue跟新值', configStore.getAsideValue, asideValue)
// let tempAsideValue = configStore.getAsideValue || asideValue;
const tempobj = cloneDeep(asideValue) const tempobj = cloneDeep(asideValue)
console.log(tempobj, 'tempobj')
tempobj[key] = e tempobj[key] = e
console.log(tempobj, 'tempobj After')
customObjRef.value = tempobj customObjRef.value = tempobj
// asideValue = Object.assign({}, asideValue, tempobj); // asideValue = Object.assign({}, asideValue, tempobj);
console.log('asideValue跟新值', tempobj)
configStore.setAsideValue(tempobj) configStore.setAsideValue(tempobj)
} }
function handleOk(item: any) { function handleOk(item: any) {
console.log('handleOk', item)
if (item) { if (item) {
AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname) AdvanceFilterRef.value.setCurrentlySelectedAdvanced(item.searchname)
filterHandler(item.id) filterHandler(item.id)
@ -285,20 +259,10 @@ function handleOk(item: any) {
filterHandler('') filterHandler('')
} }
} }
// watch(asideValue, (newVal) => {
// console.log("asideValue", newVal);
// configStore.setAsideValue(newVal)
// }, { deep: true })
</script> </script>
<template> <template>
<div <div class="aside" :style="asideStyle" @mouseenter="asideEnter = true" @mouseleave="asideEnter = false">
class="aside"
:style="asideStyle"
@mouseenter="asideEnter = true"
@mouseleave="asideEnter = false"
>
<div v-show="showCollapse" class="aside-collapse"> <div v-show="showCollapse" class="aside-collapse">
<div class="aside-collapse-btn" @click="collapseHandler"> <div class="aside-collapse-btn" @click="collapseHandler">
<SvgIcon :name="collapseIcon" size="40" /> <SvgIcon :name="collapseIcon" size="40" />
@ -307,38 +271,24 @@ function handleOk(item: any) {
<n-scrollbar trigger="none"> <n-scrollbar trigger="none">
<div class="aside-header"> <div class="aside-header">
<!-- 搜索跳转模块 --> <!-- 搜索跳转模块 -->
<Search <Search v-show="showSearch" @select="scrollHandler" @close="setShowSearch(false)" />
v-show="showSearch"
@select="scrollHandler"
@close="setShowSearch(false)"
/>
<!-- 高级筛选 --> <!-- 高级筛选 -->
<AdvanceFilter <AdvanceFilter
v-show="!showSearch" v-show="!showSearch" ref="AdvanceFilterRef" :type="0" @select="filterHandler"
ref="AdvanceFilterRef" @update:search="setShowSearch(true)" @show-custom="showModal(customModalRef)"
:type="0"
@select="filterHandler"
@update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)"
@show-filter="showModal(filterModalRef)" @show-filter="showModal(filterModalRef)"
/> />
</div> </div>
<component <component
:is="item.config?.component" :is="item.config?.component" v-for="item in showItems" :id="item.key" :key="item.key"
v-for="item in showItems" v-model:value="asideValue[item.key]" :label="item.config?.label"
:id="item.key"
:key="item.key"
v-model:value="asideValue[item.key]"
:label="item.config?.label"
@update:value="(e) => updateComponent(item.key, e)" @update:value="(e) => updateComponent(item.key, e)"
/> />
<!-- 过滤列表 --> <!-- 过滤列表 -->
<FilterModalVue <FilterModalVue
ref="filterModalRef" ref="filterModalRef" @edit-filter="editFilter" @show-new-filter="showModal(newFilterModalRef)"
@edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)"
@handle-ok="handleOk" @handle-ok="handleOk"
/> />
<!-- 新增过滤 --> <!-- 新增过滤 -->
@ -392,17 +342,11 @@ function handleOk(item: any) {
right: -20px; right: -20px;
} }
::v-deep(.n-collapse ::v-deep(.n-collapse .n-collapse-item.n-collapse-item--right-arrow-placement .n-collapse-item__header .n-collapse-item-arrow) {
.n-collapse-item.n-collapse-item--right-arrow-placement
.n-collapse-item__header
.n-collapse-item-arrow) {
margin-left: 8px; margin-left: 8px;
} }
::v-deep(.n-collapse ::v-deep(.n-collapse .n-collapse-item .n-collapse-item__header .n-collapse-item__header-main) {
.n-collapse-item
.n-collapse-item__header
.n-collapse-item__header-main) {
font-weight: bold; font-weight: bold;
justify-content: space-between; justify-content: space-between;
} }
@ -415,18 +359,11 @@ function handleOk(item: any) {
border-top: 0px; border-top: 0px;
} }
::v-deep(.n-collapse ::v-deep(.n-collapse .n-collapse-item .n-collapse-item__content-wrapper .n-collapse-item__content-inner) {
.n-collapse-item
.n-collapse-item__content-wrapper
.n-collapse-item__content-inner) {
padding-top: 10px; padding-top: 10px;
} }
::v-deep(.n-scrollbar ::v-deep(.n-scrollbar > .n-scrollbar-rail.n-scrollbar-rail--vertical > .n-scrollbar-rail__scrollbar, .n-scrollbar + .n-scrollbar-rail.n-scrollbar-rail--vertical > .n-scrollbar-rail__scrollbar) {
> .n-scrollbar-rail.n-scrollbar-rail--vertical
> .n-scrollbar-rail__scrollbar, .n-scrollbar
+ .n-scrollbar-rail.n-scrollbar-rail--vertical
> .n-scrollbar-rail__scrollbar) {
width: 0px; width: 0px;
} }
} }

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

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

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

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

@ -1,30 +1,9 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onBeforeMount, onMounted, ref } from 'vue' import { onBeforeMount, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui' import type { FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary' import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig' 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<{ const props = defineProps<{
value: string[] | null value: string[] | null
label: string label: string
@ -37,12 +16,34 @@ const emit = defineEmits<{
const formValue = ref({ const formValue = ref({
plans: props.value, plans: props.value,
}) })
const isLoadValue = ref(false)
const configUseStore = useConfig()
if(typeof formValue.value.plans == "string") { configUseStore.$subscribe(() => {
let list = formValue.value.plans.split(','); if (isLoadValue.value) {
formValue.value.plans = list; 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
}
}
else {
formValue.value.plans = []
}
})
if (typeof formValue.value.plans == 'string') {
const list = (formValue.value.plans as string).split(',')
formValue.value.plans = list
} }
console.log("formValue.value.izcustomlevel22222", formValue.value.plans);
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
@ -64,9 +65,8 @@ onBeforeMount(async () => {
const list = await configStore.fetchIzcustomlevelList() const list = await configStore.fetchIzcustomlevelList()
options.value = list options.value = list
}) })
const isLoadValue = ref(false)
function onChange(value: Array<string>) { function onChange(value: Array<string>) {
isLoadValue.value = true; isLoadValue.value = true
emit('update:value', value) emit('update:value', value)
} }
</script> </script>
@ -74,8 +74,9 @@ function onChange(value: Array<string>) {
<template> <template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules"> <n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle"> <n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable <n-select
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择拜访客户级别" multiple v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择拜访客户级别" multiple
:options="options" @update:value="onChange" :options="options" @update:value="onChange"
/> />
</n-form-item> </n-form-item>

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

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

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

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

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

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

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

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

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

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

@ -1,29 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onBeforeMount, onMounted, ref } from 'vue' import { onBeforeMount, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui' import type { FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary' import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig' import { useConfig } from '@/store/modules/asideConfig'
import { isString } from '@/utils/is'
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<{ const props = defineProps<{
value: string[] | null value: string[] | null
label: string label: string
@ -33,12 +14,35 @@ const emit = defineEmits<{
(e: 'update:value', value: string[]): void (e: 'update:value', value: string[]): void
}>() }>()
const configUseStore = useConfig()
const formValue = ref({ const formValue = ref({
plans: props.value, plans: props.value,
}) })
if(typeof formValue.value.plans == "string") {
let list = formValue.value.plans.split(','); const isLoadValue = ref(false)
formValue.value.plans = list; 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
}
}
else {
formValue.value.plans = []
}
})
if (isString(formValue.value.plans)) {
const list = (formValue.value.plans as string).split(',')
formValue.value.plans = list
} }
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
@ -60,9 +64,8 @@ onBeforeMount(async () => {
const list = await configStore.fetchizvisitcityList() const list = await configStore.fetchizvisitcityList()
options.value = list options.value = list
}) })
const isLoadValue = ref(false)
function onChange(value: Array<string>) { function onChange(value: Array<string>) {
isLoadValue.value = true; isLoadValue.value = true
emit('update:value', value) emit('update:value', value)
} }
</script> </script>
@ -70,8 +73,9 @@ function onChange(value: Array<string>) {
<template> <template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules"> <n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle"> <n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable <n-select
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择发布地区" multiple v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择发布地区" multiple
:options="options" @update:value="onChange" :options="options" @update:value="onChange"
/> />
</n-form-item> </n-form-item>

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

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

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

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

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

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

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

@ -1,29 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onBeforeMount, onMounted, ref } from 'vue' import { onBeforeMount, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui' import type { FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary' import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig' import { useConfig } from '@/store/modules/asideConfig'
import { isString } from '@/utils/is'
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<{ const props = defineProps<{
value: string[] | null value: string[] | null
label: string label: string
@ -36,9 +17,31 @@ const emit = defineEmits<{
const formValue = ref({ const formValue = ref({
plans: props.value, plans: props.value,
}) })
if(typeof formValue.value.plans == "string") { const configUseStore = useConfig()
let list = formValue.value.plans.split(','); const isLoadValue = ref(false)
formValue.value.plans = list;
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
}
}
else {
formValue.value.plans = []
}
})
if (isString(formValue.value.plans)) {
const list = (formValue.value.plans as string).split(',')
formValue.value.plans = list
} }
const rules: FormRules = { const rules: FormRules = {
plans: [ plans: [
@ -60,9 +63,8 @@ onBeforeMount(async () => {
const list = await configStore.fetchIzvisitproList() const list = await configStore.fetchIzvisitproList()
options.value = list options.value = list
}) })
const isLoadValue = ref(false)
function onChange(value: Array<string>) { function onChange(value: Array<string>) {
isLoadValue.value = true; isLoadValue.value = true
emit('update:value', value) emit('update:value', value)
} }
</script> </script>
@ -70,8 +72,9 @@ function onChange(value: Array<string>) {
<template> <template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules"> <n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle"> <n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable <n-select
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择省份" multiple :options="options" v-model:value="formValue.plans"
filterable :max-tag-count="2" placeholder="请选择省份" multiple :options="options"
@update:value="onChange" @update:value="onChange"
/> />
</n-form-item> </n-form-item>

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

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

@ -1,70 +1,71 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onBeforeMount, onMounted, onUpdated, ref } from 'vue' import { onBeforeMount, ref } from 'vue'
import type { FormItemRule, FormRules } from 'naive-ui' import type { FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary' import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig' import { useConfig } from '@/store/modules/asideConfig'
import { useFinal } from '@/store/modules/final' import { useFinal } from '@/store/modules/final'
import { isString } from '@/utils/is'
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const configUseStore = useConfig() const configUseStore = useConfig()
const formValue = ref({
users: props.value || [],
})
const isLoadValue = ref(false)
configUseStore.$subscribe(() => { configUseStore.$subscribe(() => {
let asideValue = configUseStore.getAsideValue; const asideValue = configUseStore.getAsideValue
console.log("asideValue接受到的", asideValue);
if (isLoadValue.value) { if (isLoadValue.value) {
isLoadValue.value = false; isLoadValue.value = false
return return
} }
if(asideValue['izupuser']) { if (asideValue.izupuser) {
if(typeof asideValue['izupuser'] == "string") { if (typeof asideValue.izupuser == 'string') {
let list = asideValue['izupuser'].split(','); const list = asideValue.izupuser.split(',')
formValue.value.users = list; formValue.value.users = list
}else { }
formValue.value.users = asideValue['izupuser']; else {
formValue.value.users = asideValue.izupuser
} }
console.log("formValue.value.users1111111111", formValue.value.users);
}else {
formValue.value.users = [];
} }
}); else {
formValue.value.users = []
}
})
const finalStore = useFinal() const finalStore = useFinal()
finalStore.$subscribe(() => { finalStore.$subscribe(() => {
let asideValue = finalStore.getAsideValue; const asideValue = finalStore.getAsideValue
console.log("asideValue接受到的", asideValue);
if (isLoadValue.value) { if (isLoadValue.value) {
isLoadValue.value = false; isLoadValue.value = false
return return
} }
if(asideValue && asideValue['izupuser']) { if (asideValue && asideValue.izupuser) {
if(typeof asideValue['izupuser'] == "string") { if (typeof asideValue.izupuser == 'string') {
let list = asideValue['izupuser'].split(','); const list = asideValue.izupuser.split(',')
formValue.value.users = list; formValue.value.users = list
}else {
formValue.value.users = asideValue['izupuser'];
} }
console.log("formValue.value.users222222222222222", formValue.value.users); else {
}else { formValue.value.users = asideValue.izupuser
formValue.value.users = []; }
}
else {
formValue.value.users = []
} }
});
const props = defineProps<{
value: string[] | null
label: string
}>()
const emit = defineEmits<{
(e: 'update:value', value: string[]): void
}>()
const formValue = ref({
users: props.value || [],
}) })
if(typeof formValue.value.users == "string") { if (typeof formValue.value.users == 'string') {
let list = formValue.value.users.split(','); const list = isString(formValue.value.users) ? (formValue.value.users as string).split(',') : []
formValue.value.users = list; formValue.value.users = list
} }
console.log("formValue.value.users2222222222222", formValue.value.users);
const rules: FormRules = { const rules: FormRules = {
users: [ users: [
{ {
@ -86,10 +87,8 @@ onBeforeMount(async () => {
personOptions.value = personList personOptions.value = personList
}) })
const isLoadValue = ref(false)
function onChange(value: Array<string>) { function onChange(value: Array<string>) {
console.log("user选中 ", value); isLoadValue.value = true
isLoadValue.value = true;
emit('update:value', value) emit('update:value', value)
} }
</script> </script>
@ -97,9 +96,10 @@ function onChange(value: Array<string>) {
<template> <template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules"> <n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="users" :label-style="labStyle"> <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" :options="personOptions" @update:value="onChange"
/> />
</n-form-item> </n-form-item>

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

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

@ -29,15 +29,9 @@ function showModal() {
const config = configStore.getConfig const config = configStore.getConfig
const customConfig = configStore.getCustomConfig const customConfig = configStore.getCustomConfig
if (config == null || customConfig == null) if (config == null || customConfig == null) { return }
return if (tempList.value.length > 0 && isEqual(tempList.value, configStore.getFilterConfig)) { return }
if (tempList.value.length > 0 && isEqual(tempList.value, configStore.getFilterConfig))
return
console.log(
'开启了啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦筛选条件----------------',
customConfig,
)
const { showList, hideList } = generatList(config, customConfig) const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList) tempList.value = cloneDeep(showList)
if (tempList.value.length > 0) if (tempList.value.length > 0)
@ -46,7 +40,7 @@ function showModal() {
onList.value = showList onList.value = showList
offList.value = hideList offList.value = hideList
// //
checkAll.value = hideList.every(item => item.checked) checkAll.value = hideList.every((item: any) => item.checked)
// //
offKeyword.value = '' offKeyword.value = ''
onKeyword.value = '' onKeyword.value = ''
@ -136,17 +130,14 @@ function generatList(config, customConfig) {
const fixedList = generateDefaultList(config) const fixedList = generateDefaultList(config)
offList.unshift(...fixedList) offList.unshift(...fixedList)
onList.unshift(...fixedList) onList.unshift(...fixedList)
console.log('原始筛选条件customConfig', customConfig)
// onListcustomConfig // onListcustomConfig
const tempOnList = cloneDeep(onList) const tempOnList = cloneDeep(onList)
console.log('原始筛选条件tempOnList', tempOnList)
const sortKeyList: any = [] const sortKeyList: any = []
configStore.getFilterConfig.map((item: any) => { configStore.getFilterConfig.map((item: any) => {
sortKeyList.push(item?.id) sortKeyList.push(item?.id)
return item return item
}) })
console.log('原始筛选条件sortKeyList', sortKeyList)
const sortList: any = [] const sortList: any = []
if (sortKeyList.length > 0) { if (sortKeyList.length > 0) {
sortKeyList.map((key) => { sortKeyList.map((key) => {
@ -162,8 +153,6 @@ function generatList(config, customConfig) {
return key return key
}) })
} }
console.log('原始筛选条件sortList', sortList)
console.log('原始筛选条件configStore.getFilterConfig', configStore.getFilterConfig)
// return { showList: onList, hideList: offList } // return { showList: onList, hideList: offList }
return { showList: sortList, hideList: offList } return { showList: sortList, hideList: offList }
} }
@ -172,16 +161,11 @@ configStore.$subscribe(() => {
const config = configStore.getConfig const config = configStore.getConfig
const customConfig = configStore.getCustomConfig const customConfig = configStore.getCustomConfig
if (config == null || customConfig == null) if (config == null || customConfig == null) { return }
return if (tempList.value.length > 0 && isEqual(tempList.value, configStore.getFilterConfig)) { return }
console.log('tempList.value-----------', tempList.value)
console.log('configStore.getFilterConfig-----------', configStore.getFilterConfig)
if (tempList.value.length > 0 && isEqual(tempList.value, configStore.getFilterConfig))
return
const { showList, hideList } = generatList(config, customConfig) const { showList, hideList } = generatList(config, customConfig)
tempList.value = cloneDeep(showList) tempList.value = cloneDeep(showList)
console.log('克隆条件', tempList.value)
if (tempList.value.length > 0) if (tempList.value.length > 0)
configStore.setFilterConfig(tempList.value) configStore.setFilterConfig(tempList.value)
@ -201,16 +185,13 @@ async function handleSumbit(e: MouseEvent) {
await setFilter({ searchcount: param, type: 0 }) await setFilter({ searchcount: param, type: 0 })
const obj = await configStore.fetchCustomConfig() const obj = await configStore.fetchCustomConfig()
console.log('obj-------------------------------', obj)
const tempOnList = cloneDeep(onList.value) const tempOnList = cloneDeep(onList.value)
console.log('原始筛选条件tempOnList', tempOnList)
const sortList: any = [] const sortList: any = []
obj.map((key) => { obj.map((key) => {
const tempItem = tempOnList.find(item => item.id == key) const tempItem = tempOnList.find(item => item.id == key)
sortList.push(tempItem) sortList.push(tempItem)
return key return key
}) })
console.log('configStore.sortList---------------', sortList)
// setTimeout(() => { // setTimeout(() => {
if (sortList.length > 0) if (sortList.length > 0)
configStore.setFilterConfig(sortList) configStore.setFilterConfig(sortList)
@ -336,16 +317,10 @@ const rightInputHandler = debounce((keyword) => {
}, 300) }, 300)
async function getfield() { async function getfield() {
let res await getAllfieldList(3)
res = await getAllfieldList(3)
const userStore = useUser() const userStore = useUser()
const userInfo = userStore.getUserInfo const userInfo = userStore.getUserInfo
res = await getfieldList(3, userInfo.id) await getfieldList(3, userInfo.id)
}
function onMove(e) {
// e
if (e?.related?.className?.indexOf('fix') !== -1)
return false
} }
onMounted(() => { onMounted(() => {
@ -355,13 +330,7 @@ onMounted(() => {
<template> <template>
<n-modal v-model:show="show" transform-origin="center" :mask-closable="false"> <n-modal v-model:show="show" transform-origin="center" :mask-closable="false">
<n-card <n-card class="cardstyle" :bordered="false" size="huge" role="dialog" aria-modal="true">
class="cardstyle"
:bordered="false"
size="huge"
role="dialog"
aria-modal="true"
>
<div class="wrapper"> <div class="wrapper">
<span class="wrapper-title">自定义筛选</span> <span class="wrapper-title">自定义筛选</span>
<div class="wrapper-bar"> <div class="wrapper-bar">
@ -373,10 +342,7 @@ onMounted(() => {
<n-grid cols="24" class="mt-4 proCard" responsive="screen" :x-gap="24"> <n-grid cols="24" class="mt-4 proCard" responsive="screen" :x-gap="24">
<n-grid-item span="11"> <n-grid-item span="11">
<NCard <NCard
:title="allCount" :title="allCount" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small"
class="dragcardStyle"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false" :bordered="false"
> >
<div class="input_wrap"> <div class="input_wrap">
@ -385,29 +351,20 @@ onMounted(() => {
<SvgIcon size="14px" name="magnifying-1-color999" /> <SvgIcon size="14px" name="magnifying-1-color999" />
</template> </template>
</n-input> </n-input>
<n-scrollbar <n-scrollbar style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px">
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px"
>
<div class="draggable-ul"> <div class="draggable-ul">
<div class="draggable-li"> <div class="draggable-li">
<n-checkbox <n-checkbox
v-model:checked="checkAll" v-model:checked="checkAll" label="全选" :indeterminate="!checkAll"
label="全选"
:indeterminate="!checkAll"
@update:checked="onCheckAllChange" @update:checked="onCheckAllChange"
/> />
</div> </div>
<div <div
v-for="item in offList" v-for="item in offList" v-show="item.name.includes(offKeyword)" :key="item.id"
v-show="item.name.includes(offKeyword)" :class="{ 'disable-check': item.fix }" class="draggable-li"
:key="item.id"
:class="{ 'disable-check': item.fix }"
class="draggable-li"
> >
<n-checkbox <n-checkbox
v-model:checked="item.checked" v-model:checked="item.checked" :label="item.name" :disabled="item.fix"
:label="item.name"
:disabled="item.fix"
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
</div> </div>
@ -421,10 +378,7 @@ onMounted(() => {
</n-grid-item> </n-grid-item>
<n-grid-item span="11"> <n-grid-item span="11">
<NCard <NCard
:title="selectCount" :title="selectCount" class="dragcardStyle" :segmented="{ content: true, footer: true }" size="small"
class="dragcardStyle"
:segmented="{ content: true, footer: true }"
size="small"
:bordered="false" :bordered="false"
> >
<template #header-extra> <template #header-extra>
@ -436,31 +390,17 @@ onMounted(() => {
<SvgIcon size="14px" name="magnifying-1-color999" /> <SvgIcon size="14px" name="magnifying-1-color999" />
</template> </template>
</n-input> </n-input>
<n-scrollbar <n-scrollbar style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px" class="scroll">
style="max-height: 500px; border: 1px solid #cad2dd; border-radius: 2px" <VueDraggable v-model="onList" class="draggable-ul" :animation="150" group="shared">
class="scroll"
>
<VueDraggable
v-model="onList"
class="draggable-ul"
:animation="150"
group="shared"
>
<div <div
v-for="item in onList" v-for="item in onList" v-show="item.name.includes(onKeyword)" :key="item.id" :draggable="true"
v-show="item.name.includes(onKeyword)"
:key="item.id"
:draggable="true"
class="cursor-move draggable-li" class="cursor-move draggable-li"
> >
<SvgIcon name="drag" size="24" /> <SvgIcon name="drag" size="24" />
<span class="ml-2">{{ item.name }}</span> <span class="ml-2">{{ item.name }}</span>
<SvgIcon <SvgIcon
v-if="!item.fix" v-if="!item.fix" size="16px" style="display: block; margin-left: auto; cursor: pointer"
size="16px" name="clear" @click="removeHandler(item.id)"
style="display: block; margin-left: auto; cursor: pointer"
name="clear"
@click="removeHandler(item.id)"
/> />
</div> </div>
</VueDraggable> </VueDraggable>
@ -475,11 +415,7 @@ onMounted(() => {
<n-button type="info" @click="handleSumbit"> <n-button type="info" @click="handleSumbit">
确定 确定
</n-button> </n-button>
<n-button <n-button secondary style="margin-left: 15px; border: 1px solid #cad2dd" @click="closeModal">
secondary
style="margin-left: 15px; border: 1px solid #cad2dd"
@click="closeModal"
>
取消 取消
</n-button> </n-button>
</div> </div>
@ -508,9 +444,11 @@ onMounted(() => {
&-footer { &-footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
.n-button--info-type { .n-button--info-type {
background: #507afd !important; background: #507afd !important;
} }
.n-button--default-type { .n-button--default-type {
background: #fff !important; background: #fff !important;
color: #333333; color: #333333;
@ -537,6 +475,7 @@ onMounted(() => {
.dragcardStyle { .dragcardStyle {
--n-padding-bottom: 0px !important; --n-padding-bottom: 0px !important;
--n-padding-left: 0px !important; --n-padding-left: 0px !important;
::v-deep(.n-card__content) { ::v-deep(.n-card__content) {
padding-left: 0 !important; padding-left: 0 !important;
padding-right: 0 !important; padding-right: 0 !important;
@ -586,32 +525,39 @@ onMounted(() => {
--n-padding-top: 0px; --n-padding-top: 0px;
--n-padding-bottom: 12px; --n-padding-bottom: 12px;
} }
::v-deep(.n-card > .n-card-header .n-card-header__main) { ::v-deep(.n-card > .n-card-header .n-card-header__main) {
font-weight: lighter !important; font-weight: lighter !important;
font-size: 14px; font-size: 14px;
color: #666; color: #666;
} }
::v-deep(.n-scrollbar) { ::v-deep(.n-scrollbar) {
border-left: 1px solid #cad2dd !important; border-left: 1px solid #cad2dd !important;
border-right: 1px solid #cad2dd !important; border-right: 1px solid #cad2dd !important;
border-bottom: 1px solid #e8e8e8 !important; border-bottom: 1px solid #e8e8e8 !important;
border-top: 1px solid #e8e8e8 !important; border-top: 1px solid #e8e8e8 !important;
} }
::v-deep(.n-card__content) { ::v-deep(.n-card__content) {
padding: 20px 24px 0 24px !important; padding: 20px 24px 0 24px !important;
} }
::v-deep(.n-card__footer) { ::v-deep(.n-card__footer) {
padding: 0 24px 16px 24px !important; padding: 0 24px 16px 24px !important;
} }
::v-deep(.n-input .n-input-wrapper) { ::v-deep(.n-input .n-input-wrapper) {
height: 44px !important; height: 44px !important;
border: 1px solid #cad2dd !important; border: 1px solid #cad2dd !important;
border-bottom: none !important; border-bottom: none !important;
// margin-bottom: -3px; // margin-bottom: -3px;
.n-input__input input { .n-input__input input {
height: 44px !important; height: 44px !important;
} }
} }
::v-deep(.n-button--info-type) { ::v-deep(.n-button--info-type) {
background: #507afd !important; background: #507afd !important;
} }

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

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

File diff suppressed because it is too large Load Diff

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

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

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

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

@ -1,7 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { FormInst, FormRules } from 'naive-ui'; import type { FormInst, FormRules } from 'naive-ui'
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui'
import { ref } from 'vue'; import { ref } from 'vue'
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'commit', value: any) (e: 'commit', value: any)

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

@ -1,14 +1,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue'
import Aside from './aside/Aside.vue' import Aside from './aside/Aside.vue'
import Content from './content/Content.vue' import Content from './content/Content.vue'
import Robot from '@/components/Robot/index.vue' import Robot from '@/components/Robot/index.vue'
import {ref} from 'vue';
const contentRef: any = ref(null) const contentRef: any = ref(null)
const showLoginModal = ()=>{ function showLoginModal() {
contentRef.value.showLoginSuccessModal(); contentRef.value.showLoginSuccessModal()
} }
</script> </script>
<template> <template>

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

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

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

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

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

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

@ -1,6 +1,6 @@
<script lang="ts" setup> <script lang="ts" setup>
import { format } from 'date-fns' import { format } from 'date-fns'
import { computed,watch ,ref} from 'vue' import { computed, ref, watch } from 'vue'
defineOptions({ name: 'ListItem' }) defineOptions({ name: 'ListItem' })
@ -27,7 +27,6 @@ const svgName = computed(() => {
watch( watch(
() => props.listItem, () => props.listItem,
(newVal) => { (newVal) => {
console.log(props.listItem)
listItem.value = newVal listItem.value = newVal
}, },
) )

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

Loading…
Cancel
Save