fix: 修复问题 #215

Merged
liushilong merged 3 commits from fix/bug into test 1 year ago

@ -42,7 +42,7 @@
"vue3snippets.enable-compile-vue-file-on-did-save-code": true,
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint",
"[vue]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
"editor.defaultFormatter": "Wscats.vue"
},
"editor.formatOnSaveMode": "modifications"
}

9
components.d.ts vendored

@ -11,6 +11,7 @@ declare module 'vue' {
BasicModal: typeof import('./src/components/Modal/BasicModal.vue')['default']
DataHeader: typeof import('./src/components/DataHeader/index.vue')['default']
NAvatar: typeof import('naive-ui')['NAvatar']
NBackTop: typeof import('naive-ui')['NBackTop']
NButton: typeof import('naive-ui')['NButton']
NCard: typeof import('naive-ui')['NCard']
NCheckbox: typeof import('naive-ui')['NCheckbox']
@ -21,8 +22,11 @@ declare module 'vue' {
NDialogProvider: typeof import('naive-ui')['NDialogProvider']
NDivider: typeof import('naive-ui')['NDivider']
NDropdown: typeof import('naive-ui')['NDropdown']
NEllipsis: typeof import('naive-ui')['NEllipsis']
NEmpty: typeof import('naive-ui')['NEmpty']
NForm: typeof import('naive-ui')['NForm']
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']
@ -31,6 +35,7 @@ declare module 'vue' {
NModal: typeof import('naive-ui')['NModal']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NotPassed: typeof import('./src/components/NotPassed.vue')['default']
NPopconfirm: typeof import('naive-ui')['NPopconfirm']
NPopover: typeof import('naive-ui')['NPopover']
NPopselect: typeof import('naive-ui')['NPopselect']
NProgress: typeof import('naive-ui')['NProgress']
@ -40,7 +45,11 @@ declare module 'vue' {
NSpace: typeof import('naive-ui')['NSpace']
NSpin: typeof import('naive-ui')['NSpin']
NSwitch: typeof import('naive-ui')['NSwitch']
NTabPane: typeof import('naive-ui')['NTabPane']
NTabs: typeof import('naive-ui')['NTabs']
NTag: typeof import('naive-ui')['NTag']
NTimeline: typeof import('naive-ui')['NTimeline']
NTimelineItem: typeof import('naive-ui')['NTimelineItem']
NTooltip: typeof import('naive-ui')['NTooltip']
NUpload: typeof import('naive-ui')['NUpload']
NUploadDragger: typeof import('naive-ui')['NUploadDragger']

@ -53,7 +53,8 @@ const saveHandler = debounce(() => {
备注信息
</div>
<SvgIcon
size="24"
size="20"
color="#000000"
name="close-none-border"
class="close_box"
@click="emit('close')"

@ -33,13 +33,25 @@ Object.keys(asideMap).forEach((key) => {
extraCustomConfig.push(key)
})
function showModal() {
show.value = true
function showModal(type: boolean = true) {
show.value = type
//
const config = finalStore.getSystemConfig
const customConfig = finalStore.getCustomConfig
if (config == null || customConfig == null)
return
//
if (!type) {
const { showList, hideList } = generatList(config, customConfig)
onList.value = showList
offList.value = hideList
//
checkAll.value = hideList.every(item => item.checked)
//
offKeyword.value = ''
onKeyword.value = ''
return
}
if (tempList.value.length > 0 && isEqual(tempList.value, finalStore.getFilterConfig))
return
const { showList, hideList } = generatList(config, customConfig)
@ -221,6 +233,19 @@ async function handleSumbit(e: MouseEvent) {
function onCheckAllChange(value) {
const ids: string[] = []
if (value) {
offList.value.forEach((v) => {
if (!v.checked)
onList.value.push(v)
})
}
else {
onList.value = offList.value.filter(v => v.fix)
offList.value.map(v => ({
...v,
checked: v.fix,
}))
}
for (const item of offList.value) {
if (!item.fix) {
@ -228,7 +253,6 @@ function onCheckAllChange(value) {
ids.push(item.id)
}
}
selectIds.value = value ? ids : []
}
@ -478,7 +502,7 @@ onMounted(() => {
<n-button
secondary
style="margin-left: 15px; border: 1px solid #cad2dd"
@click="closeModal"
@click="showModal(false)"
>
取消
</n-button>

@ -3,7 +3,6 @@ import { difference } from 'lodash-es'
import { computed, onMounted, ref, watch } from 'vue'
import { VueDraggable } from 'vue-draggable-plus'
import { getAllfieldList, getfieldList, savefield } from '@/api/home/filter'
import { ColumnsMap } from '@/config/final'
import { useUser } from '@/store/modules/user'
const props = defineProps({
@ -39,8 +38,8 @@ onMounted(async () => {
*/
const userFieldFixed = useList.userFieldFixed?.split(',')
const userFieldUnFixed = useList.userFieldUnFixed?.split(',')
const mustList = []
allList?.map((v) => {
const mustList: any[] = []
allList?.forEach((v) => {
const item = {
name: v.fieldDesc,
id: v.name,
@ -73,67 +72,6 @@ const selectCount = computed(() => {
return `显示字段(共${onList.value.length}个)`
})
function generatList() {
const keys = Object.keys(ColumnsMap)
// const showStr = 'name'
// const showKeys = showStr.split(',').map((key: string) => key.toLowerCase())
for (const key of keys) {
const { title, fixed, fixLeft, width } = ColumnsMap[key]
const item = {
id: key,
title,
fix: fixed,
checked: ColumnsMap[key].fixed,
width,
}
if (!fixed)
offList.value.push(item)
if (fixLeft)
fixLeftList.value.push(item)
}
// showList = showKeys.reduce((acc, key) => {
// const config = {
// id: key,
// title: ColumnsMap[key].name || '',
// fix: ColumnsMap[key].fixed,
// }
// return [...acc, config]
// }, [])
const fixedList = generateDefaultList()
const filterList = fixedList.filter((item) => {
return !item.fixLeft
})
onList.value.unshift(...filterList)
offList.value.unshift(...fixedList)
}
function generateDefaultList() {
return Object.keys(ColumnsMap).reduce((acc, key) => {
const { title, fixed, fixLeft, width } = ColumnsMap[key]
if (fixed) {
const config = {
id: key,
title,
fix: true,
checked: true,
fixLeft,
width,
}
return [...acc, config]
}
else {
return acc
}
}, [])
}
const show = ref(false)
const checkAll = ref(false)
@ -152,10 +90,10 @@ async function handleSumbit(e: MouseEvent) {
const userInfo = userStore.getUserInfo
let userFieldFixed = ''
let userFieldUnFixed = ''
fixLeftList.value.map((v) => {
fixLeftList.value.forEach((v) => {
userFieldFixed += `${v.id},`
})
onList.value.map((v) => {
onList.value.forEach((v) => {
userFieldUnFixed += `${v.id},`
})
userFieldFixed = userFieldFixed.slice(0, userFieldFixed.length - 1)
@ -207,7 +145,7 @@ function onCheckAllChange(value) {
}
}
if (value) {
offList.value.map((v) => {
offList.value.forEach((v) => {
if (!v.checked)
onList.value.push(v)
})
@ -215,7 +153,7 @@ function onCheckAllChange(value) {
else {
onList.value = []
fixLeftList.value = []
offList.value.map((v) => {
offList.value.forEach((v) => {
if (v.fix)
fixLeftList.value.push(v)
})
@ -330,21 +268,21 @@ function removeHandler(id: string, type: 'fix' | 'unfix') {
offList.value[index].checked = false
}
else {
index == fixLeftList.value.findIndex(v => v.id == id)
index = fixLeftList.value.findIndex(v => v.id == id)
fixLeftList.value[index].checked = false
}
}
const indeterminate = computed(() => {
let baseNum = 0
offList.value.map((v) => {
if (v.fix)
baseNum += 1
})
return (
onList.value.length + fixLeftList.value.length - baseNum > 0
&& offList.value.length - baseNum
> onList.value.length + fixLeftList.value.length - baseNum
onList.value.length
+ fixLeftList.value.length
- offList.value.filter(v => v.fix).length
> 0
&& offList.value.length - offList.value.filter(v => v.fix).length
> onList.value.length
+ fixLeftList.value.length
- offList.value.filter(v => v.fix).length
)
})
</script>
@ -553,8 +491,7 @@ const indeterminate = computed(() => {
.textbtnStyle {
cursor: pointer;
color: #507AFD;
color: #507afd;
}
.drag-wrapper {
@ -615,7 +552,7 @@ const indeterminate = computed(() => {
::v-deep(.n-button--info-type) {
background: #507afd !important;
}
::v-deep(.n-button--default-type){
::v-deep(.n-button--default-type) {
border: 1px solid #cad2dd !important;
}
// ::v-deep(.n-card__content){

@ -166,20 +166,20 @@ function handleCheck(rowKeys: DataTableRowKey[]) {
}
function select(key: number, id: string) {
if (key == 1) {
if (key == 1)
editSelection(id)
}
else {
const modalInst = modal.create({
title: '确认提示',
content: '确认删除该条过滤条件吗?',
positiveText: '确定',
negativeText: '取消',
preset: 'dialog',
onPositiveClick: () => deleteSelection(id),
onNegativeClick: () => modalInst.destroy(),
})
}
else
deleteSelection(id)
// const modalInst = modal.create({
// title: "",
// content: "?",
// positiveText: "",
// negativeText: "",
// preset: "dialog",
// onPositiveClick: () => deleteSelection(id),
// onNegativeClick: () => modalInst.destroy(),
// });
}
function editSelection(id = '') {

@ -302,6 +302,7 @@ defineExpose({
v-model:value="formValue.name"
:style="{ width: '780px' }"
placeholder="请输入过滤名称"
maxlength="15"
@keydown.enter.prevent
/>
</n-form-item>

File diff suppressed because it is too large Load Diff

@ -1,16 +1,16 @@
<script lang="ts" setup>
import { onMounted, ref, reactive, unref, computed,watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import testImg from "@/assets/images/test.png";
import { chunk } from "lodash-es";
import type { RowData } from "@/config/final";
import { getFinalList } from "@/api/final";
import { useFinal } from "@/store/modules/final";
import { formatToDateHMS } from "@/utils/dateUtil";
import { useMessage, useDialog } from "naive-ui";
import { audit } from "@/api/task/task";
import NotPassed from "@/components/Approval/NotPassed.vue";
import { RepeatModal, RepeatTaskTableModal } from "../comp";
import { computed, onMounted, reactive, ref, unref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { chunk } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { RepeatModal, RepeatTaskTableModal } from '../comp'
import testImg from '@/assets/images/test.png'
import type { RowData } from '@/config/final'
import { getFinalList } from '@/api/final'
import { useFinal } from '@/store/modules/final'
import { formatToDateHMS } from '@/utils/dateUtil'
import { audit } from '@/api/task/task'
import NotPassed from '@/components/Approval/NotPassed.vue'
const emit = defineEmits(['changeShow'])
const dialog = useDialog()
@ -93,11 +93,11 @@ async function initData(
const asideParmas = unref(finalStore.getAsideValue)
// 使使
// let params = filterId ? { userSearchId: filterId } : asideParmas
let params = asideParmas;
if(params?.izshowall==false){
params.isFail=false
}
params = params?.izshowall ? {isFail:true} : params;
let params = asideParmas
if (params?.izshowall == false)
params.isFail = false
params = params?.izshowall ? { isFail: true } : params
const result = await getFinalList({
sortorder: sortorder.value,
@ -107,22 +107,21 @@ async function initData(
taskName,
...params,
});
const { data, pageCount, totalCount } = result;
console.log(data, pageCount, totalCount);
//tableData.value = tableData.value.concat(data);
tableData.value = data;
console.log(tableData.value);
total.value = totalCount;
pagination.page = page;
pagination.pageCount = Math.ceil(totalCount / pageSize);
loading.value = false;
})
const { data, pageCount, totalCount } = result
console.log(data, pageCount, totalCount)
// tableData.value = tableData.value.concat(data);
tableData.value = data
console.log(tableData.value)
total.value = totalCount
pagination.page = page
pagination.pageCount = Math.ceil(totalCount / pageSize)
loading.value = false
tableData.value.forEach((item) => {
item.showcheck = false;
if (isValidTimestamp(item.fromuptime)) {
item.fromuptime = formatToDateHMS(item.fromuptime);
}
});
item.showcheck = false
if (isValidTimestamp(item.fromuptime))
item.fromuptime = formatToDateHMS(item.fromuptime)
})
tableData.value = chunk(tableData.value, 4)
}
@ -177,15 +176,14 @@ async function query(
// tableData.value = tableData.value.concat(data);
tableData.value = newlist
// console.log(tableData.value);
total.value = totalCount;
pagination.page = page;
pagination.pageCount = Math.ceil(totalCount / pageSize);
loading.value = false;
total.value = totalCount
pagination.page = page
pagination.pageCount = Math.ceil(totalCount / pageSize)
loading.value = false
tableData.value.forEach((item) => {
if (isValidTimestamp(item.fromuptime)) {
item.fromuptime = formatToDateHMS(item.fromuptime);
}
});
if (isValidTimestamp(item.fromuptime))
item.fromuptime = formatToDateHMS(item.fromuptime)
})
tableData.value = chunk(tableData.value, 4)
}
@ -403,39 +401,44 @@ function checkBottom() {
}, 500)
}
function changesort(sortnamex) {
if (sortorder.value == "asc" && sortnamex == "submit_date_timestamp") {
sortorder.value = "desc";
sortname.value = "submit_date_timestamp";
}else if (sortorder.value == "desc" && sortnamex == "submit_date_timestamp") {
sortorder.value = "asc";
sortname.value = "submit_date_timestamp";
} else if (sortorder.value == "desc" && sortnamex == "similarity_score") {
sortorder.value = "asc";
sortname.value = "similarity_score";
} else if (sortorder.value == "asc" && sortnamex == "similarity_score") {
sortorder.value = "desc";
sortname.value = "similarity_score";
} else if (sortorder.value == "asc" && sortnamex == "field1") {
sortorder.value = "desc";
sortname.value = "field1";
} else if (sortorder.value == "desc" && sortnamex == "field1") {
sortorder.value = "asc";
sortname.value = "field1";
}
initData(1, 20);
num=1
if (sortorder.value == 'asc' && sortnamex == 'submit_date_timestamp') {
sortorder.value = 'desc'
sortname.value = 'submit_date_timestamp'
}
else if (sortorder.value == 'desc' && sortnamex == 'submit_date_timestamp') {
sortorder.value = 'asc'
sortname.value = 'submit_date_timestamp'
}
else if (sortorder.value == 'desc' && sortnamex == 'similarity_score') {
sortorder.value = 'asc'
sortname.value = 'similarity_score'
}
else if (sortorder.value == 'asc' && sortnamex == 'similarity_score') {
sortorder.value = 'desc'
sortname.value = 'similarity_score'
}
else if (sortorder.value == 'asc' && sortnamex == 'field1') {
sortorder.value = 'desc'
sortname.value = 'field1'
}
else if (sortorder.value == 'desc' && sortnamex == 'field1') {
sortorder.value = 'asc'
sortname.value = 'field1'
}
initData(1, 20)
num = 1
}
watch(
() => finalStore.asideValue,
(newVal, oldVal) => {
initData(1, 20);
initData(1, 20)
},
{ deep: true }
);
{ deep: true },
)
defineExpose({
initData,
});
})
</script>
<template>
@ -530,16 +533,13 @@ defineExpose({
<div class="wrapper-settings">
<div>
<div @click="changesort('submit_date_timestamp')">
<span>提报时间排序</span
><SvgIcon style="margin-left: 6px" name="sort" size="13" />
<span>提报时间排序</span><SvgIcon style="margin-left: 6px" name="sort" size="13" />
</div>
<div @click="changesort('similarity_score')">
<span>相似度排序</span
><SvgIcon style="margin-left: 6px" name="sort" size="13" />
<span>相似度排序</span><SvgIcon style="margin-left: 6px" name="sort" size="13" />
</div>
<div @click="changesort('field1')">
<span>提报人排序</span
><SvgIcon style="margin-left: 6px" name="sort" size="13" />
<span>提报人排序</span><SvgIcon style="margin-left: 6px" name="sort" size="13" />
</div>
</div>
<div style="width: 3vw">
@ -552,7 +552,7 @@ defineExpose({
/>
</div>
</div>
<div :class="tableData.length>4?'cotnet_wrapeer':'cotnet_wrapeertwo'" @scroll="checkBottom" ref="scrollContainer">
<div ref="scrollContainer" :class="tableData.length > 4 ? 'cotnet_wrapeer' : 'cotnet_wrapeertwo'" @scroll="checkBottom">
<div
v-for="(sitem, sindex) in tableData"
:key="sindex"
@ -590,12 +590,14 @@ defineExpose({
: `background:url(${item.imgUrl});background-size:100% 100%;background-repeat: no-repeat;`
"
@click="goDetail(item)"
><div class="percent" v-if="item.similarityscore != -1">
>
<div v-if="item.similarityscore != -1" class="percent">
<SvgIcon size="30" :name="item.similarityscore == 100 ? 'error_tag' : 'tag'" />
<div class="val">
{{ `${item.similarityscore}%` }}
</div>
</div></div>
</div>
</div>
<div v-show="item.states == 2" class="check_box">
<n-checkbox
size="medium"
@ -611,8 +613,8 @@ defineExpose({
</n-ellipsis>
</div>
<div class="date">
<n-ellipsis style="max-width: 100%"
>{{ item.fromuptime }}
<n-ellipsis style="max-width: 100%">
{{ item.fromuptime }}
</n-ellipsis>
</div>
<div class="tag_box">

@ -200,8 +200,7 @@ function favoriteHandler(event: MouseEvent, item: any) {
data.value.forEach((v, index) => {
if (v.id == id)
sort(v.id, 0)
else
sort(v.id, index + 1)
else sort(v.id, index + 1)
})
inputHandler(ruleForm.keyword)
@ -216,8 +215,7 @@ const rules = {
validator(_rule, value) {
if (value.length >= 2)
return true
else
return new Error('搜索关键字最少为两个')
else return new Error('搜索关键字最少为两个')
},
},
],
@ -277,14 +275,20 @@ defineExpose({
>
<template #trigger>
<div class="wrapper-left-dropdown" @click="showClick">
<span
style="
color: #333333;
font-weight: Medium;
font-size: 17px;
font-weight: 600;
"
>{{ currentlySelectedAdvanced }}</span>
<n-tooltip trigger="hover">
<template #trigger>
<span
style="
color: #333333;
font-weight: Medium;
font-size: 17px;
font-weight: 600;
"
>{{ currentlySelectedAdvanced }}</span>
</template>
{{ currentlySelectedAdvanced }}
</n-tooltip>
<SvgIcon
:style="{ marginLeft: '5px' }"
name="down"

@ -48,6 +48,8 @@ function showModal() {
}
function closeModal() {
offKeyword.value = ''
onKeyword.value = ''
show.value = false
}

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

@ -300,10 +300,9 @@ async function oneCheck() {
asideVal.upUserName = searchValue.value
if (asideVal.izyear && asideVal.izyear.length == 2) {
asideVal.izyear
= `${dayjs(asideVal.izyear[0]).format('YYYY/MM/DD')
}-${
dayjs(asideVal.izyear[1]).format('YYYY/MM/DD')}`
asideVal.izyear = `${dayjs(asideVal.izyear[0]).format('YYYY/MM/DD')}-${dayjs(
asideVal.izyear[1],
).format('YYYY/MM/DD')}`
}
if (asideVal.izsimilarity && typeof asideVal.izsimilarity != 'string')
asideVal.izsimilarity = asideVal.izsimilarity.join('-')
@ -327,8 +326,7 @@ async function oneCheck() {
if (checkTaskStatus.value === 2 || checkTaskStatus.value === 3) {
if (checkTaskStatus.value === 2)
message.success('任务执行完毕,正在刷新数据...')
else
message.error('查询异常')
else message.error('查询异常')
tasksLoadingModal.closeOnlyModal()
configStore.setTimeNum(100)
@ -566,8 +564,7 @@ function refresh(val?: any) {
isRefresh.value = false
if (checkTaskStatus.value === 2)
message.success('任务执行完毕,正在刷新数据...')
else
message.error('查询异常')
else message.error('查询异常')
if (timer.value)
clearInterval(timer.value)
@ -771,7 +768,15 @@ defineExpose({
{{ item.imgName }}
</n-tooltip>
</div>
<div class="icon-wrap" @click="previewHandler(index, $event)">
<div
class="icon-wrap"
@click="
($event) => {
previewHandler(index, $event);
hideDownload($event);
}
"
>
<SvgIcon
size="13"
name="magnifying-2"

@ -1002,7 +1002,9 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
class="img-wrapper"
:style="{
// 'background-image': `url(${item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl})`,
background: `url(${item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl}), url(${bgLoadingImg})`,
background: `url(${
item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl
}), url(${bgLoadingImg})`,
}"
/>
<div class="small-mark" />
@ -1228,7 +1230,9 @@ function sortHandler(orderby: 'similarityScore' | 'createdate') {
class="img-wrapper"
:style="{
// 'background-image': `url(${item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl})`,
background: `url(${item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl}), url(${bgLoadingImg})`,
background: `url(${
item.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgUrl
}), url(${bgLoadingImg})`,
}"
@mouseover="overTaskHandelr(item)"
@mouseleave="leaveTaskHandler"

@ -459,7 +459,15 @@ const moreThanSix = computed(() => {
</div>
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="handleSumbit">
<n-button
type="info"
@click="
($event) => {
handleSumbit($event);
getData();
}
"
>
确定
</n-button>
<n-button

@ -305,6 +305,7 @@ defineExpose({
v-model:value="formValue.name"
:style="{ width: '780px' }"
placeholder="请输入过滤名称"
maxlength="15"
@keydown.enter.prevent
/>
</n-form-item>

@ -17,10 +17,7 @@ import {
import PictureInfo from '../components/PictureInfo.vue'
import ConfrimModal from '../modal/ConfrimModal.vue'
import { audit, dubiousfileyd } from '@/api/task/task'
import {
getPictureSimilarityList,
getTaskDetailInfo,
} from '@/api/work/work'
import { getPictureSimilarityList, getTaskDetailInfo } from '@/api/work/work'
import NotPassed from '@/components/Approval/NotPassed.vue'
import { TASK_STATUS_OBJ } from '@/enums/index'
import { useWorkOrder } from '@/store/modules/workOrder'
@ -38,7 +35,11 @@ const dialog = useDialog()
const totalCount = ref(0)
let _imagesload: any
const bgLoadingImg = ref(bgLoading)
const imgbigshow = ref(true)
function changeimgbigshow() {
imgbigshow.value = !imgbigshow.value
}
function setBatch(value: boolean) {
if (value && batch.value)
batch.value = !value
@ -333,9 +334,7 @@ function onEsc(event: KeyboardEvent) {
const currentKTime = Date.now()
if (currentKTime - keyXLastTime < 500)
handleRejectMainImage()
else
keyXLastTime = currentKTime
else keyXLastTime = currentKTime
}
}
@ -624,7 +623,10 @@ defineExpose({
<!-- 左侧大图 图片信息 -->
<div
class="left"
:style="{ 'background-image': `url(${taskDetailInfo?.imgurl})` }"
:style="{
'background-image': `url(${taskDetailInfo?.imgurl})`,
'flex': imgbigshow ? '0.6' : '1',
}"
@click="previewHandler"
@mouseover="showAction"
@mouseleave="leaveTaskHandler"
@ -729,7 +731,39 @@ defineExpose({
/>
</div>
</div>
<PictureInfo :task-detail-info="taskDetailInfo" />
<!-- 缩放线 -->
<div
v-show="isFullScreen"
:style="{
position: 'fixed',
zIndex: 169,
background: 'rgb(80, 122, 253)',
right: imgbigshow ? '46%' : '16px',
marginTop: '5px',
width: '2px',
height: '350px',
}"
/>
<div
v-show="isFullScreen"
class="aside-collapse-btn"
:style="{
position: 'fixed',
right: imgbigshow ? '45%' : '0px',
top: '155px',
cursor: 'pointer',
zIndex: 170,
}"
>
<SvgIcon
:name="false ? 'expand-cir' : 'collapse-cir'"
size="40"
@click="changeimgbigshow"
/>
</div>
<PictureInfo v-show="imgbigshow" :task-detail-info="taskDetailInfo" />
</div>
<div
style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0"
@ -800,7 +834,11 @@ defineExpose({
>
<div
class="img-wrapper"
:style="{ background: `url(${item?.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgurl}), url(${bgLoadingImg})` }"
:style="{
background: `url(${
item?.serverThumbnailUrl ? item.serverThumbnailUrl : item.imgurl
}), url(${bgLoadingImg})`,
}"
/>
<div class="time-wrapper">
<div class="time">

Loading…
Cancel
Save