feat: 修改bug

pull/70/head
raofuzi 1 year ago
commit ca78247917

@ -377,6 +377,17 @@ export async function getizstatusList() {
url: `/static/admin/web/distionary/bytypecode/izstatus`,
method: 'get',
})
return res.data[0].distionaryList
}
/**
* ()
* @returns
*/
export async function getizApprovalStatusList() {
const res = await http.request({
url: `/static/admin/web/distionary/bytypecode/izApprovalStatus`,
method: 'get',
})
return res.data[0].distionaryList
}

@ -74,10 +74,10 @@ export async function getRepeatList(params: FinalParam) {
params,
})
const { data: { records, totalPage, totalCount } } = res
const { data: { records, total, pages } } = res
return {
pageCount: 3,
pageCount: pages,
data: records,
totalCount: 20,
totalCount: total,
}
}

@ -1,5 +1,5 @@
import type { AsideEntity } from './aside'
import { IzProjectVue, IzStatus, IztaskrromVue, PictureDownloadVue, PlanVue, ReportUserVue, TimeVue, IzCustomname, IzCustomtype, IzVisitcity, IzCustomlevel, IzProjecttype, IzProductVue, IzvisitproVue, IzfirmVue } from '@/views/home/aside/comp/items'
import { IzApprovalStatus, IzProjectVue, IzStatus, IztaskrromVue, PictureDownloadVue, PlanVue, ReportUserVue, TimeVue, IzCustomname, IzCustomtype, IzVisitcity, IzCustomlevel, IzProjecttype, IzProductVue, IzvisitproVue, IzfirmVue } from '@/views/home/aside/comp/items'
export interface RowData {
id: string
@ -137,8 +137,8 @@ export const asideTaskMap: Recordable<AsideEntity> = {
label: '审批状态',
defaultValue: null,
isDefaultFilter: true,
key: 'izstatus',
component: IzStatus, // todo
key: 'izApprovalStatus',
component: IzApprovalStatus, // todo
},
izuptime: {
label: '提报时间',

@ -460,7 +460,7 @@ function refreshHandler() {
class="wrapper-content-item-img"
:class="{ 'wrapper-content-item-img-fit': viewMode !== 'masonry' }" :src="item.imgUrl"
> -->
<n-image :src="item.imgurl" class="img "
<n-image :src="item.imgUrl" class="img "
:class="{ 'img-fit': viewMode === 'horizontalVersion', 'img-full': viewMode === '3:4' || viewMode === 'verticalVersion' }" />
<n-checkbox v-if="batch" v-model:checked="item.checked" style="position:absolute;left:20px;top:20px"
@click.prevent @update:checked="onCheckChange($event, item)" />

@ -1,6 +1,6 @@
import { defineStore } from 'pinia'
import { store } from '@/store'
import { getBackList, getBusinessList, getIzShowList, getIztaskstatusList, getPictureTypeList, getRegionList, getRejectList, getRelationTypeList, getTFList, getizstatusList } from '@/api/dictionary'
import { getBackList, getBusinessList, getIzShowList, getIztaskstatusList, getPictureTypeList, getRegionList, getRejectList, getRelationTypeList, getTFList, getizstatusList, getizApprovalStatusList } from '@/api/dictionary'
export interface DictionaryState {
regionList: any
@ -24,6 +24,7 @@ export interface DictionaryState {
backList: any
relationTypeList: any
izstatusList: any
izApprovalStatusList: any
}
export const useDictionaryStore = defineStore({
@ -50,6 +51,7 @@ export const useDictionaryStore = defineStore({
backList: null,
relationTypeList: null,
izstatusList: null,
izApprovalStatusList: null,
}),
getters: {
getRegionList: (state) => {
@ -100,8 +102,35 @@ export const useDictionaryStore = defineStore({
getizstatus: (state) => {
return state.izstatusList
},
getizApprovalStatus: (state) => {
return state.izApprovalStatusList
}
},
actions: {
initData(){
this.fetchRegionList();
this.fetchPictureTypeList();
this.fetchPersionList();
this.fetchPlanList();
this.fetchTFList();
this.fetchIzShowList();
this.fetchIzProjectList();
this.fetchIztaskrromList();
this.fetchIztaskstatusList();
this.fetchIzvisitproList();
this.fetchIzfirmList();
this.fetchIzproductnameList();
this.fetchizcustomnameList();
this.fetchIzCustomtypeList();
this.fetchIzcustomlevelList();
this.fetchizizprojecttypeList();
this.fetchizvisitcityList();
this.fetchRejectList();
this.fetchBackList();
this.fetchRelationTypeList();
this.fetchizstatusListt();
this.fetchizApprovalStatusList();
},
settfList(config) {
this.tfList = config
},
@ -231,6 +260,12 @@ export const useDictionaryStore = defineStore({
this.izstatusList = generateOptions2(list, 'codeno', 'name')
return this.izstatusList
},
// 审核状态(任务审核模块)
async fetchizApprovalStatusList() {
const list = await getizApprovalStatusList()
this.izApprovalStatusList = generateOptions2(list, 'codeno', 'name')
return this.izApprovalStatusList
},
},
})

File diff suppressed because it is too large Load Diff

@ -30,7 +30,7 @@ Object.keys(asideMap).forEach((key) => {
asideValue[key] = defaultValue
})
const filterModalRef = ref(null)
const filterModalRef:any = ref(null)
const newFilterModalRef = ref(null)
const customModalRef = ref(null)
const customObjRef = ref<any>(null) //
@ -192,6 +192,12 @@ const showSearch = ref(false)
function setShowSearch(value: boolean) {
showSearch.value = value
}
const newFilterOk = () => {
filterModalRef.value.query(
filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize
);
};
// key
function scrollHandler(key: string) {
@ -243,7 +249,12 @@ function updateComponent(key, e) {
</script>
<template>
<div class="aside" :style="asideStyle" @mouseenter="asideEnter = true" @mouseleave="asideEnter = false">
<div
class="aside"
:style="asideStyle"
@mouseenter="asideEnter = true"
@mouseleave="asideEnter = false"
>
<div v-show="showCollapse" class="aside-collapse">
<div class="aside-collapse-btn" @click="collapseHandler">
<SvgIcon :name="collapseIcon" size="40" />
@ -252,11 +263,19 @@ function updateComponent(key, e) {
<n-scrollbar trigger="none">
<div class="aside-header">
<!-- 搜索跳转模块 -->
<Search v-show="showSearch" @select="scrollHandler" @close="setShowSearch(false)" />
<Search
v-show="showSearch"
@select="scrollHandler"
@close="setShowSearch(false)"
/>
<!-- 高级筛选 -->
<AdvanceFilter
v-show="!showSearch" :type="0" @select="filterHandler" @update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)" @show-filter="showModal(filterModalRef)"
v-show="!showSearch"
:type="0"
@select="filterHandler"
@update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)"
@show-filter="showModal(filterModalRef)"
/>
</div>
@ -266,9 +285,13 @@ function updateComponent(key, e) {
/>
<!-- 过滤列表 -->
<FilterModalVue ref="filterModalRef" @edit-filter="editFilter" @show-new-filter="showModal(newFilterModalRef)" />
<FilterModalVue
ref="filterModalRef"
@edit-filter="editFilter"
@show-new-filter="showModal(newFilterModalRef)"
/>
<!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" />
<NewFilterModalVue ref="newFilterModalRef" @onOk="newFilterOk" />
<!-- 筛选 -->
<CustomFilterModalVue ref="customModalRef" />
</n-scrollbar>
@ -280,7 +303,7 @@ function updateComponent(key, e) {
display: flex;
position: relative;
flex-direction: column;
background: #FFF;
background: #fff;
border: 1px solid #efeff5;
border-radius: 3px;
box-sizing: border-box;
@ -317,11 +340,17 @@ function updateComponent(key, e) {
right: -20px;
}
::v-deep(.n-collapse .n-collapse-item.n-collapse-item--right-arrow-placement .n-collapse-item__header .n-collapse-item-arrow) {
::v-deep(.n-collapse
.n-collapse-item.n-collapse-item--right-arrow-placement
.n-collapse-item__header
.n-collapse-item-arrow) {
margin-left: 8px;
}
::v-deep(.n-collapse .n-collapse-item .n-collapse-item__header .n-collapse-item__header-main) {
::v-deep(.n-collapse
.n-collapse-item
.n-collapse-item__header
.n-collapse-item__header-main) {
font-weight: bold;
justify-content: space-between;
}
@ -334,11 +363,18 @@ function updateComponent(key, e) {
border-top: 0px;
}
::v-deep(.n-collapse .n-collapse-item .n-collapse-item__content-wrapper .n-collapse-item__content-inner) {
::v-deep(.n-collapse
.n-collapse-item
.n-collapse-item__content-wrapper
.n-collapse-item__content-inner) {
padding-top: 10px;
}
::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) {
::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) {
width: 0px;
}
}

@ -156,12 +156,16 @@ const inputHandler = debounce((word) => {
getSearchedList(word);
}, 300);
function getSearchedList(word) {
function getSearchedList(word, isScroll = false) {
if (word) {
pagination.pageSize = 300;
} else {
}
if (!word) {
pagination.pageSize = 10;
}
if (isScroll) {
pagination.pageSize = 300;
}
ruleForm.keyword = word;
featchList().then((list) => {
let dataArr: FilterEntity[] = [];
@ -233,9 +237,16 @@ function unFavoriteHandler(event: MouseEvent, item) {
}
}
const handleScroll= (event)=>{
console.log(event)
}
const handleScroll = (event) => {
let timer;
if (timer) {
clearTimeout(timer);
} else {
timer = setTimeout(() => {
getSearchedList("", true);
}, 2000);
}
};
const moveEnd = () => {
unData.value.map((v, index) => {
@ -438,7 +449,7 @@ const moveEnd = () => {
align-items: center;
}
}
::v-deep(.wrapper-left-popover .n-form-item){
::v-deep(.wrapper-left-popover .n-form-item) {
display: block !important;
}
</style>

@ -0,0 +1,77 @@
<script lang="ts" setup>
import { onBeforeMount, onMounted, ref } from 'vue'
import type { FormRules } from 'naive-ui'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
const configUseStore = useConfig()
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
isLoadValue.value = false;
return
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izApprovalStatus'] && typeof asideValue['izApprovalStatus'] == "string") {
let list = asideValue['izApprovalStatus'].split(',');
formValue.value.plans = list;
console.log("formValue.value.izApprovalStatus", formValue.value.plans);
}else {
formValue.value.plans = [];
}
});
const props = defineProps<{
value: string[] | null
label: string
}>()
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(',');
formValue.value.plans = list;
}
const rules: FormRules = {
plans: [
{
required: false,
type: 'array',
trigger: ['blur', 'change'],
},
],
}
const options = ref([])
const configStore = useDictionary()
const labStyle = {
fontWeight: 'bold',
}
onBeforeMount(async () => {
const list = await configStore.fetchizApprovalStatusList()
options.value = list
})
const isLoadValue = ref(false)
function onChange(value: Array<string>) {
isLoadValue.value = true;
emit('update:value', value)
}
</script>
<template>
<n-form :model="formValue" style="padding: 0px 10px;" :rules="rules">
<n-form-item :label="label" path="plans" :label-style="labStyle">
<n-select filterable
v-model:value="formValue.plans" :max-tag-count="2" placeholder="请选择审核状态" multiple
:options="options" @update:value="onChange"
/>
</n-form-item>
</n-form>
</template>
<style lang="less" scoped></style>

@ -1,13 +1,13 @@
<script lang="ts" setup>
import { ref } from 'vue'
import { useConfig } from '@/store/modules/asideConfig'
import { ref } from "vue";
import { useConfig } from "@/store/modules/asideConfig";
const configUseStore = useConfig()
const configUseStore = useConfig();
configUseStore.$subscribe(() => {
if(isLoadValue.value) {
if (isLoadValue.value) {
isLoadValue.value = false;
return
return;
}
let asideValue = configUseStore.getAsideValue;
if(asideValue['izsimilarity']) {
@ -15,28 +15,33 @@ configUseStore.$subscribe(() => {
}else {
range.value = [0, 100];
}
console.log(range.value, 'range.value')
// else {
// range.value = [0, 100];
// }
});
const props = defineProps<{
value: [number, number]
label: string
}>()
value: [number, number];
label: string;
}>();
const emit = defineEmits<{
(e: 'update:value', value: string): void
}>()
(e: "update:value", value: string): void;
}>();
const range = ref<[number, number]>(props.value || [])
const range = ref<[number, number]>(props.value || []);
const marks = {
0: '0',
50: '50',
100: '100',
}
const isLoadValue = ref(false)
0: "0",
50: "50",
100: "100",
};
const isLoadValue = ref(false);
function onChange(value: number & number[]) {
range.value = value as any;
isLoadValue.value = true;
let valueStr = value.join('-');
emit('update:value', valueStr)
let valueStr = value.join("-");
emit("update:value", valueStr);
}
</script>
@ -45,7 +50,13 @@ function onChange(value: number & number[]) {
<n-collapse :default-expanded-names="['1']" arrow-placement="right">
<n-collapse-item :title="label" name="1">
<n-space vertical>
<n-slider v-model:value="range" range :marks="marks" :step="10" @update-value="onChange" />
<n-slider
v-model:value="range"
range
:marks="marks"
:step="10"
@update-value="onChange"
/>
</n-space>
</n-collapse-item>
</n-collapse>
@ -56,7 +67,7 @@ function onChange(value: number & number[]) {
.wrapper {
padding: 10px;
}
::v-deep(.n-collapse-item-arrow){
color: #999999 !important;;
::v-deep(.n-collapse-item-arrow) {
color: #999999 !important;
}
</style>

@ -19,6 +19,7 @@ import RegionVue from './Region.vue'
import ReportUserVue from './ReportUser.vue'
import SimilarityVue from './Similarity.vue'
import TimeVue from './Time.vue'
import IzApprovalStatus from './IzApprovalStatus.vue'
export { IzProjecttype, IzStatus, IzVisitcity, IzCustomlevel, IzCustomtype, IzCustomname, IzfirmVue, IzProductVue, IzvisitproVue, IztaskstatusVue, IztaskrromVue, IzProjectVue, PictureDownloadVue, PictureUploadVue, PlaceHolderVue, RegionVue, SimilarityVue, ReportUserVue, PlanVue, PictureTypeVue, TimeVue }
export { IzProjecttype, IzStatus, IzVisitcity, IzCustomlevel, IzCustomtype, IzCustomname, IzfirmVue, IzProductVue, IzvisitproVue, IztaskstatusVue, IztaskrromVue, IzProjectVue, PictureDownloadVue, PictureUploadVue, PlaceHolderVue, RegionVue, SimilarityVue, ReportUserVue, PlanVue, PictureTypeVue, TimeVue, IzApprovalStatus }

@ -1,105 +1,107 @@
<script lang="ts" setup>
import type { FormInst, FormItemRule, FormRules } from 'naive-ui'
import { computed, defineOptions, onBeforeMount, reactive, ref, unref, watch } from 'vue'
import { asideMap } from '@/config/aside'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import type { FilterCondition } from '/#/api'
import { addCondition, updateCondition } from '@/api/home/filter'
import { formatToDate2, formatToDate3 } from '@/utils/dateUtil'
type Status = 'edit' | 'new'
const show = ref(false)
const configStore = useConfig()
const dicStore = useDictionary()
const currentStatus = ref<Status>('new')
let currentEditId: string | null = null
import type { FormInst, FormItemRule, FormRules } from "naive-ui";
import { computed, defineOptions, onBeforeMount, reactive, ref, unref, watch } from "vue";
import { asideMap } from "@/config/aside";
import { useDictionary } from "@/store/modules/dictonary";
import { useConfig } from "@/store/modules/asideConfig";
import type { FilterCondition } from "/#/api";
import { addCondition, updateCondition } from "@/api/home/filter";
import { formatToDate2, formatToDate3 } from "@/utils/dateUtil";
type Status = "edit" | "new";
const show = ref(false);
const configStore = useConfig();
const dicStore = useDictionary();
const currentStatus = ref<Status>("new");
let currentEditId: string | null = null;
const emit = defineEmits(["onOk"]);
const modalTitle = computed(() => {
return currentStatus.value === 'new' ? '新建过滤条件' : '编辑过滤条件'
})
return currentStatus.value === "new" ? "新建过滤条件" : "编辑过滤条件";
});
const cardStyle = {
'width': '800px',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
}
width: "800px",
"--n-padding-bottom": "10px",
"--n-padding-left": "10px",
};
const noBorderInput = {
'--n-border': '0px',
'--n-border-hover': '0px',
'--n-border-pressed': '0px',
}
"--n-border": "0px",
"--n-border-hover": "0px",
"--n-border-pressed": "0px",
};
const formItemStyle = {
'--n-label-height': '0px',
'--n-feedback-height': '8px',
}
"--n-label-height": "0px",
"--n-feedback-height": "8px",
};
interface FormType {
name: string | null
logic: string | null
conditions: Condition[]
name: string | null;
logic: string | null;
conditions: Condition[];
}
interface Condition {
type: string | null
operator: string | null
result: any
type: string | null;
operator: string | null;
result: any;
}
interface Option {
label: string
value: string
label: string;
value: string;
}
const rules: FormRules = {
name: {
required: true,
message: '请输入过滤条件名称',
trigger: 'blur',
message: "请输入过滤条件名称",
trigger: "blur",
},
logic: {
required: true,
message: '请选择逻辑关系',
trigger: 'blur',
message: "请选择逻辑关系",
trigger: "blur",
},
conditions: {
required: true,
validator(rule: FormItemRule, value: Condition[]) {
for (const item of value) {
const { type, operator, result } = item
const { type, operator, result } = item;
if (type === null || operator === null || result === null)
return new Error('请选择过滤条件')
return new Error("请选择过滤条件");
}
return true
return true;
},
trigger: ['input', 'blur'],
trigger: ["input", "blur"],
},
}
};
const formRef = ref<FormInst | null>(null)
const formRef = ref<FormInst | null>(null);
const formValue = reactive<FormType>({
name: null,
logic: 'where',
conditions: [{
type: null,
operator: 'eq',
result: null,
}],
})
logic: "where",
conditions: [
{
type: null,
operator: "eq",
result: null,
},
],
});
function handleSumbit(e: MouseEvent) {
e.preventDefault()
e.preventDefault();
formRef.value?.validate((errors) => {
if (errors)
return
if (errors) return;
const list = formValue.conditions.map((item, index) => {
const { type, operator, result } = item
const { type, operator, result } = item;
return {
searchfield: type!,
@ -107,191 +109,202 @@ function handleSumbit(e: MouseEvent) {
searchvalue: formatValue(type!, result),
searchRelationType: formValue.logic!,
orderNum: index + 1,
}
})
};
});
const param: FilterCondition = {
searchname: formValue.name!,
type: 0,
ocrUsersearchchildList: list,
}
if (currentStatus.value === 'new')
addCondition(param)
else
updateCondition({ id: currentEditId!, ...param })
closeModal()
})
};
if (currentStatus.value === "new") addCondition(param);
else updateCondition({ id: currentEditId!, ...param });
emit("onOk");
setTimeout(() => {
closeModal();
}, 300);
});
}
//
function formatValue(searchfield: string, searchvalue: any) {
if (searchfield === 'izyear') {
const start = formatToDate2(searchvalue[0])
const end = formatToDate2(searchvalue[1])
return `${start}-${end}`
if (searchfield === "izyear") {
const start = formatToDate2(searchvalue[0]);
const end = formatToDate2(searchvalue[1]);
return `${start}-${end}`;
}
if (searchfield === 'izsimilarity' && Array.isArray(searchvalue))
return searchvalue.join(',')
if (searchfield === "izsimilarity" && Array.isArray(searchvalue))
return searchvalue.join(",");
return searchvalue
return searchvalue;
}
//
function unformatValue(searchfield: string, searchvalue: any) {
// 2022/01/03-2023/02/04
if (searchfield === 'izyear') {
const dataStrs = searchvalue.split('-')
const start = formatToDate3(dataStrs[0])
const end = formatToDate3(dataStrs[1])
return [start, end]
if (searchfield === "izyear") {
const dataStrs = searchvalue.split("-");
const start = formatToDate3(dataStrs[0]);
const end = formatToDate3(dataStrs[1]);
return [start, end];
}
// 80,90
if (searchfield === 'izsimilarity')
return searchvalue.split(',')
if (searchfield === "izsimilarity") return searchvalue.split(",");
return searchvalue
return searchvalue;
}
function createCondition() {
formValue.conditions.push({
type: null,
operator: 'eq',
operator: "eq",
result: null,
})
});
}
function removeCondition(index: number) {
formValue.conditions.splice(index, 1)
formValue.conditions.splice(index, 1);
}
function formLabel(index: number) {
return index === 0 ? '筛选条件' : ''
return index === 0 ? "筛选条件" : "";
}
const typeOptions = ref<Option[]>([])
const typeOptions = ref<Option[]>([]);
const operatorOptions = [
{
label: '等于',
value: 'eq',
label: "等于",
value: "eq",
},
{
label: '不等于',
value: 'notEq',
label: "不等于",
value: "notEq",
},
]
];
const logicOptions = ref([])
const logicOptions = ref([]);
const similarityOptions = [
{
label: '80%-90%',
label: "80%-90%",
value: [80, 90],
},
{
label: '95%-100%',
label: "95%-100%",
value: [95, 100],
},
{
label: '100%-100%',
label: "100%-100%",
value: [100, 100],
},
]
];
onBeforeMount(() => {
dicStore.fetchRelationTypeList()
})
dicStore.fetchRelationTypeList();
});
watch(() => dicStore.relationTypeList, (newval) => {
logicOptions.value = newval
})
watch(
() => dicStore.relationTypeList,
(newval) => {
logicOptions.value = newval;
}
);
function showModal() {
const list = generateAllData(configStore.systemConfig)
typeOptions.value = list
show.value = true
const list = generateAllData(configStore.systemConfig);
typeOptions.value = list;
show.value = true;
}
function closeModal() {
show.value = false
show.value = false;
}
function generateAllData(config): Option[] {
const initVal: Option[] = []
const initVal: Option[] = [];
const list = Object.keys(config).reduce((acc, value) => {
if (value.startsWith('iz') && asideMap[value]?.inFilterList !== false) {
const name = asideMap[value]?.label
name && acc.push({
value,
label: name || '未配置',
})
if (value.startsWith("iz") && asideMap[value]?.inFilterList !== false) {
const name = asideMap[value]?.label;
name &&
acc.push({
value,
label: name || "未配置",
});
}
return acc
}, initVal)
return acc;
}, initVal);
return list
return list;
}
watch(() => configStore.systemConfig, (newVal) => {
if (!newVal)
return
watch(
() => configStore.systemConfig,
(newVal) => {
if (!newVal) return;
const list = generateAllData(newVal)
typeOptions.value = list
})
const list = generateAllData(newVal);
typeOptions.value = list;
}
);
function getOptions(key: string) {
if (key === 'izsimilarity')
return similarityOptions
if (key === "izsimilarity") return similarityOptions;
const getterName = `get${key}`
const options = unref(dicStore[getterName])
return options || []
const getterName = `get${key}`;
const options = unref(dicStore[getterName]);
return options || [];
}
function leaveHandler() {
currentStatus.value = 'new'
currentEditId = null
currentStatus.value = "new";
currentEditId = null;
formValue.name = null
formValue.name = null;
formValue.conditions = [
{
type: null,
operator: 'eq',
operator: "eq",
result: null,
},
]
];
}
function edit(editFilter: any) {
currentStatus.value = 'edit'
currentStatus.value = "edit";
const { searchname, ocrUsersearchchildList, id } = editFilter
currentEditId = id
formValue.name = searchname
const { searchname, ocrUsersearchchildList, id } = editFilter;
currentEditId = id;
formValue.name = searchname;
formValue.conditions = ocrUsersearchchildList.map((item) => {
return {
type: item.searchfield,
operator: item.searchtype,
result: unformatValue(item.searchfield, item.searchvalue),
}
})
};
});
}
defineExpose({
showModal,
edit,
})
});
</script>
<template>
<n-modal v-model:show="show" transform-origin="center" @after-leave="leaveHandler">
<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 class="wrapper">
<span class="wrapper-title">{{ modalTitle }}</span>
<div class="wrapper-bar">
@ -302,32 +315,61 @@ defineExpose({
<div class="wrapper-form">
<n-form ref="formRef" :model="formValue" :rules="rules">
<n-form-item path="name" label="标题">
<n-input v-model:value="formValue.name" :style="{ width: '780px' }" @keydown.enter.prevent />
<n-input
v-model:value="formValue.name"
:style="{ width: '780px' }"
@keydown.enter.prevent
/>
</n-form-item>
<n-form-item path="logic" label="逻辑关系" v-show="false">
<n-select filterable v-model:value="formValue.logic" placeholder="请选择逻辑关系" :options="logicOptions" />
<n-select
filterable
v-model:value="formValue.logic"
placeholder="请选择逻辑关系"
:options="logicOptions"
/>
</n-form-item>
<n-form-item
v-for="(item, index) in formValue.conditions" :key="index" :style="formItemStyle"
path="conditions" :label="formLabel(index)"
v-for="(item, index) in formValue.conditions"
:key="index"
:style="formItemStyle"
path="conditions"
:label="formLabel(index)"
>
<n-select filterable
v-model:value="item.type" placeholder="请选择筛选项名称" :options="typeOptions"
<n-select
filterable
v-model:value="item.type"
placeholder="请选择筛选项名称"
:options="typeOptions"
/>
<n-select filterable
v-model:value="item.operator" style="margin-left: 8px;" placeholder="请选择"
<n-select
filterable
v-model:value="item.operator"
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izyear'">
<n-date-picker
v-model:value="item.result" style="margin-left: 8px;width: 240px;" type="daterange"
v-model:value="item.result"
style="margin-left: 8px; width: 240px"
type="daterange"
clearable
/>
</n-space>
<n-select filterable
v-else v-model:value="item.result" style="margin-left: 8px;" placeholder="请选择" :options="getOptions(item.type!)"
<n-select
filterable
v-else
v-model:value="item.result"
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
/>
<n-button :style="noBorderInput" icon-placement="right" @click="removeCondition(index)">
<n-button
:style="noBorderInput"
icon-placement="right"
@click="removeCondition(index)"
>
<template #icon>
<SvgIcon size="24" name="close" />
</template>
@ -337,15 +379,13 @@ defineExpose({
</div>
<div class="wrapper-new" @click="createCondition">
<span>+</span>
<span style="margin-left:8px">添加筛选条件</span>
<span style="margin-left: 8px">添加筛选条件</span>
</div>
</div>
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="handleSumbit">
保存
</n-button>
<n-button secondary style="margin-left:15px" @click="closeModal">
<n-button type="info" @click="handleSumbit"> </n-button>
<n-button secondary style="margin-left: 15px" @click="closeModal">
取消
</n-button>
</div>
@ -402,7 +442,7 @@ defineExpose({
position: relative;
&:before {
background-color: #1980FF;
background-color: #1980ff;
content: "";
width: 5px;
border-radius: 2px;

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { debounce } from "lodash-es";
import { debounce } from 'lodash-es'
import {
computed,
inject,
@ -9,89 +9,89 @@ import {
shallowRef,
unref,
watch,
} from "vue";
import CustomFieldModal from "../modal/CustomFieldModal.vue";
import AdvanceFilter from "../../home/aside/comp/AdvanceFilter.vue";
import { FilterModalVue } from "../../home/aside/comp/modals";
import NewFilterModalVue from "../modal/NewFilterModal.vue";
import TaskList from "./TaskList.vue";
import type { AsideEntity } from "@/config/aside";
import { useUser } from "@/store/modules/user";
import { getAllfieldList, getfieldList } from "@/api/home/filter";
import { useTaskStore } from "@/store/modules/task";
import emitter from "@/utils/mitt";
import { useConfig } from "@/store/modules/asideConfig";
} from 'vue'
import CustomFieldModal from '../modal/CustomFieldModal.vue'
import AdvanceFilter from '../../home/aside/comp/AdvanceFilter.vue'
import { FilterModalVue } from '../../home/aside/comp/modals'
import NewFilterModalVue from '../modal/NewFilterModal.vue'
import TaskList from './TaskList.vue'
import type { AsideEntity } from '@/config/aside'
import { useUser } from '@/store/modules/user'
import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { useTaskStore } from '@/store/modules/task'
import emitter from '@/utils/mitt'
import { useConfig } from '@/store/modules/asideConfig'
const CustomFieldModalRef = ref(null);
const collapse = ref(false);
const taskStore = useTaskStore();
const taskListRef: any = ref(null);
const CustomFieldModalRef = ref(null)
const collapse = ref(false)
const taskStore = useTaskStore()
const taskListRef: any = ref(null)
//
const showFieldList = ref<any[]>([]);
const search = ref("");
const showFieldList = ref<any[]>([])
const search = ref('')
function collapseHandler() {
collapse.value = !collapse.value;
collapse.value = !collapse.value
}
const mousetrap = inject("mousetrap") as any;
mousetrap.bind("[", collapseHandler);
const mousetrap = inject('mousetrap') as any
mousetrap.bind('[', collapseHandler)
const asideWidth = computed(() => {
return collapse.value ? 0 : 308;
});
return collapse.value ? 0 : 308
})
const asideStyle = computed(() => {
return {
width: `${asideWidth.value}px`,
};
});
}
})
const collapseIcon = computed(() => {
return collapse.value ? "expand-cir" : "collapse-cir";
});
return collapse.value ? 'expand-cir' : 'collapse-cir'
})
const asideEnter = ref(false);
const asideEnter = ref(false)
const showCollapse = computed(() => {
return collapse.value ? true : asideEnter.value;
});
return collapse.value ? true : asideEnter.value
})
watch(
() => taskStore.immersion,
() => {
collapse.value = true;
}
);
collapse.value = true
},
)
function showFilter() {
const modal = unref(CustomFieldModalRef)! as any;
modal.showModal();
const modal = unref(CustomFieldModalRef)! as any
modal.showModal()
}
const showSearch = ref(false);
const showSearch = ref(false)
function setShowSearch(value: boolean) {
if (!value) {
console.log("setShowSearch", value);
search.value = "";
taskListRef.value.search("");
return;
console.log('setShowSearch', value)
search.value = ''
taskListRef.value.search('')
return
}
showSearch.value = value;
showSearch.value = value
}
const inputHandler = debounce((word) => {
(taskListRef.value as any).search(word);
}, 500);
(taskListRef.value as any).search(word)
}, 500)
const reviewType = 2;
const reviewType = 2
async function getshowFieldList() {
showFieldList.value = [];
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let res;
res = await getAllfieldList(reviewType); //
const allList = res.data;
res = await getfieldList(reviewType, userInfo.id); //
const useList = res.data;
showFieldList.value = []
const userStore = useUser()
const userInfo = userStore.getUserInfo
let res
res = await getAllfieldList(reviewType) //
const allList = res.data
res = await getfieldList(reviewType, userInfo.id) //
const useList = res.data
/**
* name 标题
* id 键值
@ -99,19 +99,20 @@ async function getshowFieldList() {
* checked 是否选中
*/
if (useList?.userFieldFixed) {
useList?.userFieldFixed?.split(",").map((v) => {
let item = allList.find((v2) => v2.name == v);
useList?.userFieldFixed?.split(',').map((v) => {
let item = allList.find(v2 => v2.name == v)
if (item) {
item = {
name: item.fieldDesc,
id: item.name,
fix: item.isrequired == 2,
checked: true,
};
showFieldList.value.push(item);
}
showFieldList.value.push(item)
}
});
} else {
})
}
else {
//
allList?.map((v) => {
if (v.isrequired == 2) {
@ -120,58 +121,58 @@ async function getshowFieldList() {
id: v.name,
fix: v.isrequired == 2,
checked: true,
};
showFieldList.value.push(item);
}
showFieldList.value.push(item)
}
});
})
}
}
onMounted(() => {
getshowFieldList();
});
getshowFieldList()
})
// key
function scrollHandler(key: string) {
const element = document.querySelector(`#${key}`);
element?.scrollIntoView(true);
const element = document.querySelector(`#${key}`)
element?.scrollIntoView(true)
}
//
function filterHandler(searchId: string) {
emitter.emit("filter", searchId);
emitter.emit('filter', searchId)
}
function showModal(modalRef: any) {
const modal = unref(modalRef)! as any;
modal.showModal();
const modal = unref(modalRef)! as any
modal.showModal()
}
//
const showItems = shallowRef<{ key: string; config: AsideEntity }[]>([]);
const filterModalRef: any = ref(null);
const newFilterModalRef = ref(null);
const customModalRef = ref(null);
const showItems = shallowRef<{ key: string, config: AsideEntity }[]>([])
const filterModalRef: any = ref(null)
const newFilterModalRef = ref(null)
const customModalRef = ref(null)
function editFilter(filter: any) {
const modal = unref(newFilterModalRef)! as any;
modal.showModal();
modal.edit(filter);
const modal = unref(newFilterModalRef)! as any
modal.showModal()
modal.edit(filter)
}
const configStore = useConfig();
const newFilterOk = () => {
const configStore = useConfig()
function newFilterOk() {
filterModalRef.value.query(
filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize
);
};
filterModalRef.value.pagination.pageSize,
)
}
onBeforeMount(async () => {
configStore.fetchConfig();
configStore.fetchCustomConfig();
});
configStore.fetchConfig()
configStore.fetchCustomConfig()
})
function setAsideItemName(text) {
taskListRef.value.setStatusName(text);
taskListRef.value.setStatusName(text)
}
defineExpose({
setAsideItemName,
});
})
</script>
<template>
@ -186,7 +187,8 @@ defineExpose({
<SvgIcon :name="collapseIcon" size="40" />
</div>
</div>
<div class="aside-header">
<div class="aside-header" :style="`display:${asideWidth == 0?'none':''}`" >
<!-- <div v-show="!showSearch" class="warpper">
<div class="left">
<svg-icon name="all-worksheet" size="32" />
@ -255,7 +257,7 @@ defineExpose({
@show-new-filter="showModal(newFilterModalRef)"
/>
<!-- 新增过滤 -->
<NewFilterModalVue ref="newFilterModalRef" @onOk="newFilterOk" />
<NewFilterModalVue ref="newFilterModalRef" @on-ok="newFilterOk" />
</div>
</template>

@ -33,7 +33,7 @@ const selectItems = ref<any[]>([])
const message = useMessage()
const dialog = useDialog()
const notPassModalRef = ref(null)
const batchModalRef = ref(null)
const batchModalRef: any = ref(null)
const totalCount = ref(0)
const taskId: any = ref('') // id
const packageId: any = ref('') // id
@ -61,7 +61,7 @@ const showActions = computed(() => {
const taskpagination = reactive({
pageNo: 1,
pageSize: 10,
pageSize: 30,
})
const taskStore = useTask()
const overTask = ref<any>(null)
@ -165,6 +165,8 @@ function approvalHandler(items?: any) {
return
}
console.log(processItems)
const list: any = []
processItems.forEach((item) => {
list.push({
@ -198,7 +200,7 @@ function approvalHandler(items?: any) {
function rejectHandler(items?: any) {
const modal = unref(notPassModalRef)! as any
modal.showModal(selectItems.value)
modal.showModal(items)
}
function singleRejectHandler() {
@ -213,13 +215,14 @@ function doAudit(param: any) {
message.success(res.message)
setBatch(false)
reloadList(param, '通过')
batchModalRef.value.reload()
}
})
}
function showModal(modalRef: any) {
const modal = unref(modalRef)! as any
modal.showModal()
modal.showModal(taskId.value)
}
function forwardHandler() {
@ -429,7 +432,7 @@ function switchBatch() {
class="btn-approval btn-left"
src="@/assets/images/task/btn-not-pass.png"
alt=""
@click.stop="rejectHandler"
@click.stop="rejectHandler(selectItems)"
>
<SvgIcon size="24" name="vs" />
<img
@ -639,13 +642,18 @@ function switchBatch() {
<History :data="taskDetailInfo" />
</n-tab-pane>
</n-tabs>
<NotPassed ref="notPassModalRef" @success="(param) => reloadList(param, '不通过')" />
<NotPassed
ref="notPassModalRef" @success="(param) => {
batchModalRef.value.reload()
reloadList(param, '不通过')
}"
/>
<BatchModal
ref="batchModalRef"
@reject="rejectHandler"
@approval="approvalHandler"
/>
<CustomSettingModal ref="CustomSettingModalRef" @onOk="getDetail"/>
<CustomSettingModal ref="CustomSettingModalRef" @on-ok="getDetail" />
</div>
</template>

@ -25,6 +25,7 @@ const cardStyle = {
const totalCount = ref(0)
const timeRange = ref('all')
const taskId = ref('')
const timeLabel = computed(() => {
const item = timeOptions.find((option) => {
return option.value === timeRange.value
@ -110,9 +111,8 @@ useInfiniteScroll(
async function loadMore() {
if (loading.value || el.value == null)
return
const taskId = taskStore.getActiveId
if (!taskId)
if (!taskId.value)
return
const more = await fetchList()
@ -241,7 +241,9 @@ onMounted(() => {
show.value && addListeners()
})
function showModal() {
function showModal(value) {
taskId.value = value
refreshHandler()
show.value = true
}
@ -249,10 +251,6 @@ function closeModal(event: MouseEvent) {
show.value = false
}
defineExpose({
showModal,
})
function forwardHandler() {
taskStore.forward()
}
@ -312,13 +310,15 @@ function reset() {
layout()
}
function onChange() {
reload()
}
async function refreshHandler() {
reset()
const taskId = taskStore.getActiveId
if (!taskId)
if (!taskId.value)
return
taskDetailInfo.value = await getTaskDetailInfo(taskId, '')
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, '')
nextTick(() => {
useInfiniteScroll(
@ -332,12 +332,23 @@ async function refreshHandler() {
}
watch(() => taskStore.activeId, async (newValue, oldValue) => {
taskId.value = taskStore.activeId
selectIds.value = []
refreshHandler()
})
function switchBatch() {
setBatch(!batch.value)
}
function reload() {
selectIds.value = []
refreshHandler()
}
defineExpose({
showModal,
reload,
})
</script>
<template>
@ -356,7 +367,7 @@ function switchBatch() {
<span style="margin-left: 8px;">任务审批</span>
</div>
<div class="wrapper-title wrapper-m32">
<span>任务ID:{{ taskStore.getActiveId }}</span>
<span>任务ID:{{ taskDetailInfo.fromtaskname }}</span>
<SvgIcon size="22" class="forward" name="arrow-left" @click="backHandler" />
<SvgIcon size="22" class="back" name="arrow-right" @click="forwardHandler" />
</div>
@ -386,19 +397,32 @@ function switchBatch() {
<td>
{{ taskDetailInfo?.createusername }}
</td>
<td>{{ TASK_STATUS_OBJ[taskDetailInfo?.states] }}</td>
<td>
<div
class="status-tag"
:class="{
'status-tag-red': taskDetailInfo?.userapprove?.statshis === 3,
'status-tag-green': taskDetailInfo?.userapprove?.statshis === 2,
}"
>
{{ TASK_STATUS_OBJ[taskDetailInfo?.userapprove?.statshis] }}
</div>
</td>
<td>{{ taskDetailInfo?.ocrPicture?.createTime }}</td>
<td>{{ taskDetailInfo?.fromsourceid }}</td>
<td>{{ taskDetailInfo?.pictureInfo?.source }}</td>
<td>{{ totalCount }}</td>
</tr>
</tbody>
</table>
</div>
<div class="title wrapper-m32">
相似图片
</div>
<div class="wrapper-content">
<div class="wrapper-content-form wrapper-m32">
<div>
<n-popselect v-model:value="timeRange" :options="timeOptions" trigger="click">
<n-popselect v-model:value="timeRange" :options="timeOptions" trigger="click" @change="onChange">
<div class="wrapper-content-form-dropdown">
<span>{{ timeLabel || '时间模式' }}</span>
<SvgIcon class="wrapper-content-form-dropdown-gap" name="arrow-botton" size="14" />
@ -500,6 +524,16 @@ function switchBatch() {
position: relative;
}
.title{
font-size: 18px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
text-align: left;
color: #333333;
margin-top: 14px;
margin-bottom: 24px;
}
.small-mark{
width: 100%;
height: 36px;
@ -544,6 +578,29 @@ function switchBatch() {
}
}
.status-tag{
display: inline-block;
padding: 0 12px;
height: 22px;
background: #ffc671;
border-radius: 12px;
align-items: center;
justify-content: center;
font-size: 13px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
text-align: left;
color: #ffffff;
}
.status-tag-green{
background: #53c21d;
}
.status-tag-red{
background: #e45656;
}
.close {
position: absolute;
right: -90px;
@ -610,11 +667,16 @@ function switchBatch() {
text-align: center;
font-weight: bold;
text-align: left;
font-size: 14px;
font-family: PingFang SC, PingFang SC-Medium;
font-weight: 500;
text-align: left;
color: #333333;
}
}
&-m32 {
margin-left: 32px;
margin-left: 19px;
}
&-content {

@ -260,7 +260,17 @@ function removeHandler(id: string) {
offList.value[index].checked = false;
offShowList.value = cloneDeep(offList.value);
}
const initData = ()=>{
offList.value = [];
onList.value = [];
fixList.value = [];
offShowList.value = [];
onShowList.value = [];
fixShowList.value = [];
selectIds.value = [];
}
const getData = async (type = "") => {
initData();
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let res;
@ -478,7 +488,7 @@ const queryData = (value, type) => {
<template #footer>
<div class="wrapper-footer">
<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="getData();closeModal()">
取消
</n-button>
</div>

@ -1,106 +1,107 @@
<script lang="ts" setup>
import type { FormInst, FormItemRule, FormRules } from 'naive-ui'
import { computed, onBeforeMount, reactive, ref, unref, watch } from 'vue'
import { asideTaskMap as asideMap } from '@/config/final'
import { useDictionary } from '@/store/modules/dictonary'
import { useConfig } from '@/store/modules/asideConfig'
import type { FilterCondition } from '/#/api'
import { addCondition, updateCondition } from '@/api/home/filter'
import { formatToDate2, formatToDate3 } from '@/utils/dateUtil'
type Status = 'edit' | 'new'
const show = ref(false)
const configStore = useConfig()
const dicStore = useDictionary()
const currentStatus = ref<Status>('new')
let currentEditId: string | null = null
const emit = defineEmits(['onOk'])
import type { FormInst, FormItemRule, FormRules } from "naive-ui";
import { computed, onBeforeMount, reactive, ref, unref, watch } from "vue";
import { asideTaskMap as asideMap } from "@/config/final";
import { useDictionary } from "@/store/modules/dictonary";
import { useConfig } from "@/store/modules/asideConfig";
import type { FilterCondition } from "/#/api";
import { addCondition, updateCondition } from "@/api/home/filter";
import { formatToDate2, formatToDate3 } from "@/utils/dateUtil";
type Status = "edit" | "new";
const show = ref(false);
const configStore = useConfig();
const dicStore = useDictionary();
const currentStatus = ref<Status>("new");
let currentEditId: string | null = null;
const emit = defineEmits(["onOk"]);
const modalTitle = computed(() => {
return currentStatus.value === 'new' ? '新建过滤条件' : '编辑过滤条件'
})
return currentStatus.value === "new" ? "新建过滤条件" : "编辑过滤条件";
});
const cardStyle = {
'width': '800px',
'--n-padding-bottom': '10px',
'--n-padding-left': '10px',
}
width: "800px",
"--n-padding-bottom": "10px",
"--n-padding-left": "10px",
};
const noBorderInput = {
'--n-border': '0px',
'--n-border-hover': '0px',
'--n-border-pressed': '0px',
}
"--n-border": "0px",
"--n-border-hover": "0px",
"--n-border-pressed": "0px",
};
const formItemStyle = {
'--n-label-height': '0px',
'--n-feedback-height': '8px',
}
"--n-label-height": "0px",
"--n-feedback-height": "8px",
};
interface FormType {
name: string | null
logic: string | null
conditions: Condition[]
name: string | null;
logic: string | null;
conditions: Condition[];
}
interface Condition {
type: string | null
operator: string | null
result: any
type: string | null;
operator: string | null;
result: any;
}
interface Option {
label: string
value: string
label: string;
value: string;
}
const rules: FormRules = {
name: {
required: true,
message: '请输入过滤条件名称',
trigger: 'blur',
message: "请输入过滤条件名称",
trigger: "blur",
},
logic: {
required: true,
message: '请选择逻辑关系',
trigger: 'blur',
message: "请选择逻辑关系",
trigger: "blur",
},
conditions: {
required: true,
validator(rule: FormItemRule, value: Condition[]) {
for (const item of value) {
const { type, operator, result } = item
const { type, operator, result } = item;
if (type === null || operator === null || result === null)
return new Error('请选择过滤条件')
return new Error("请选择过滤条件");
}
return true
return true;
},
trigger: ['input', 'blur'],
trigger: ["input", "blur"],
},
}
};
const formRef = ref<FormInst | null>(null)
const formRef = ref<FormInst | null>(null);
const formValue = reactive<FormType>({
name: null,
logic: 'where',
conditions: [{
type: null,
operator: 'eq',
result: null,
}],
})
logic: "where",
conditions: [
{
type: null,
operator: "eq",
result: null,
},
],
});
function handleSumbit(e: MouseEvent) {
e.preventDefault()
e.preventDefault();
formRef.value?.validate((errors) => {
if (errors)
return
if (errors) return;
const list = formValue.conditions.map((item, index) => {
const { type, operator, result } = item
const { type, operator, result } = item;
return {
searchfield: type!,
@ -108,157 +109,168 @@ function handleSumbit(e: MouseEvent) {
searchvalue: formatValue(type!, result),
searchRelationType: formValue.logic!,
orderNum: index + 1,
}
})
};
});
const param: FilterCondition = {
searchname: formValue.name!,
type: 2,
ocrUsersearchchildList: list,
}
if (currentStatus.value === 'new')
addCondition(param)
else
updateCondition({ id: currentEditId!, ...param })
closeModal()
emit('onOk')
})
};
if (currentStatus.value === "new") addCondition(param);
else updateCondition({ id: currentEditId!, ...param });
emit("onOk");
setTimeout(() => {
closeModal();
}, 300);
});
}
function formatValue(searchfield: string, searchvalue: any) {
if (searchfield === 'izuptime') {
const start = formatToDate2(searchvalue[0])
const end = formatToDate2(searchvalue[1])
return `${start}-${end}`
if (searchfield === "izuptime") {
const start = formatToDate2(searchvalue[0]);
const end = formatToDate2(searchvalue[1]);
return `${start}-${end}`;
}
return searchvalue
return searchvalue;
}
//
function unformatValue(searchfield: string, searchvalue: any) {
// 2022/01/03-2023/02/04
if (searchfield === 'izuptime') {
const dataStrs = searchvalue.split('-')
const start = formatToDate3(dataStrs[0])
const end = formatToDate3(dataStrs[1])
return [start, end]
if (searchfield === "izuptime") {
const dataStrs = searchvalue.split("-");
const start = formatToDate3(dataStrs[0]);
const end = formatToDate3(dataStrs[1]);
return [start, end];
}
return searchvalue
return searchvalue;
}
function createCondition() {
formValue.conditions.push({
type: null,
operator: 'eq',
operator: "eq",
result: null,
})
});
}
function removeCondition(index: number) {
formValue.conditions.splice(index, 1)
formValue.conditions.splice(index, 1);
}
function formLabel(index: number) {
return index === 0 ? '筛选条件' : ''
return index === 0 ? "筛选条件" : "";
}
const typeOptions = ref<Option[]>([])
const typeOptions = ref<Option[]>([]);
const operatorOptions = [
{
label: '等于',
value: 'eq',
label: "等于",
value: "eq",
},
{
label: '不等于',
value: 'notEq',
label: "不等于",
value: "notEq",
},
]
];
const logicOptions = ref([])
const logicOptions = ref([]);
onBeforeMount(() => {
dicStore.fetchRelationTypeList()
})
watch(() => dicStore.relationTypeList, (newval) => {
logicOptions.value = newval
})
// dicStore.fetchRelationTypeList();
dicStore.initData();
});
watch(
() => dicStore.relationTypeList,
(newval) => {
logicOptions.value = newval;
}
);
function showModal() {
show.value = true
show.value = true;
}
function closeModal() {
show.value = false
show.value = false;
}
function generateAllData(): Option[] {
const initVal: Option[] = []
const initVal: Option[] = [];
const list = Object.keys(asideMap).reduce((acc, value) => {
if (value.startsWith('iz') && asideMap[value]?.inFilterList !== false) {
const name = asideMap[value]?.label
name && acc.push({
value,
label: name || '未配置',
})
if (value.startsWith("iz") && asideMap[value]?.inFilterList !== false) {
const name = asideMap[value]?.label;
name &&
acc.push({
value,
label: name || "未配置",
});
}
return acc
}, initVal)
return acc;
}, initVal);
return list
return list;
}
typeOptions.value = generateAllData()
typeOptions.value = generateAllData();
function getOptions(key: string) {
const getterName = `get${key}`
const options = unref(dicStore[getterName])
return options || []
const getterName = `get${key}`;
const options = unref(dicStore[getterName]);
return options || [];
}
function leaveHandler() {
currentStatus.value = 'new'
currentEditId = null
currentStatus.value = "new";
currentEditId = null;
formValue.name = null
formValue.name = null;
formValue.conditions = [
{
type: null,
operator: 'eq',
operator: "eq",
result: null,
},
]
];
}
function edit(editFilter: any) {
currentStatus.value = 'edit'
currentStatus.value = "edit";
const { searchname, ocrUsersearchchildList, id } = editFilter
currentEditId = id
formValue.name = searchname
const { searchname, ocrUsersearchchildList, id } = editFilter;
currentEditId = id;
formValue.name = searchname;
formValue.conditions = ocrUsersearchchildList.map((item) => {
return {
type: item.searchfield,
operator: item.searchtype,
result: unformatValue(item.searchfield, item.searchvalue),
}
})
};
});
}
defineExpose({
showModal,
edit,
})
});
</script>
<template>
<n-modal v-model:show="show" transform-origin="center" @after-leave="leaveHandler">
<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 class="wrapper">
<span class="wrapper-title">{{ modalTitle }}</span>
<div class="wrapper-bar">
@ -269,32 +281,61 @@ defineExpose({
<div class="wrapper-form">
<n-form ref="formRef" :model="formValue" :rules="rules">
<n-form-item path="name" label="标题">
<n-input v-model:value="formValue.name" :style="{ width: '780px' }" @keydown.enter.prevent />
<n-input
v-model:value="formValue.name"
:style="{ width: '780px' }"
@keydown.enter.prevent
/>
</n-form-item>
<n-form-item path="logic" label="逻辑关系" v-show="false">
<n-select filterable v-model:value="formValue.logic" placeholder="请选择逻辑关系" :options="logicOptions" />
<n-select
filterable
v-model:value="formValue.logic"
placeholder="请选择逻辑关系"
:options="logicOptions"
/>
</n-form-item>
<n-form-item
v-for="(item, index) in formValue.conditions" :key="index" :style="formItemStyle"
path="conditions" :label="formLabel(index)"
v-for="(item, index) in formValue.conditions"
:key="index"
:style="formItemStyle"
path="conditions"
:label="formLabel(index)"
>
<n-select filterable
v-model:value="item.type" placeholder="请选择筛选项名称" :options="typeOptions"
<n-select
filterable
v-model:value="item.type"
placeholder="请选择筛选项名称"
:options="typeOptions"
/>
<n-select filterable
v-model:value="item.operator" style="margin-left: 8px;" placeholder="请选择"
<n-select
filterable
v-model:value="item.operator"
style="margin-left: 8px"
placeholder="请选择"
:options="operatorOptions"
/>
<n-space v-if="item.type === 'izuptime'">
<n-date-picker
v-model:value="item.result" style="margin-left: 8px;width: 240px;" type="daterange"
v-model:value="item.result"
style="margin-left: 8px; width: 240px"
type="daterange"
clearable
/>
</n-space>
<n-select filterable
v-else v-model:value="item.result" style="margin-left: 8px;" placeholder="请选择" :options="getOptions(item.type!)"
<n-select
filterable
v-else
v-model:value="item.result"
style="margin-left: 8px"
placeholder="请选择"
:options="getOptions(item.type!)"
/>
<n-button :style="noBorderInput" icon-placement="right" @click="removeCondition(index)">
<n-button
:style="noBorderInput"
icon-placement="right"
@click="removeCondition(index)"
>
<template #icon>
<SvgIcon size="24" name="close" />
</template>
@ -304,15 +345,13 @@ defineExpose({
</div>
<div class="wrapper-new" @click="createCondition">
<span>+</span>
<span style="margin-left:8px">添加筛选条件</span>
<span style="margin-left: 8px">添加筛选条件</span>
</div>
</div>
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="handleSumbit">
保存
</n-button>
<n-button secondary style="margin-left:15px" @click="closeModal">
<n-button type="info" @click="handleSumbit"> </n-button>
<n-button secondary style="margin-left: 15px" @click="closeModal">
取消
</n-button>
</div>
@ -369,7 +408,7 @@ defineExpose({
position: relative;
&:before {
background-color: #1980FF;
background-color: #1980ff;
content: "";
width: 5px;
border-radius: 2px;

@ -485,63 +485,6 @@ function reloadList() {
<SvgIcon style="cursor: pointer; margin-left: 30px" name="t2" @click.stop="rejectHandler" />
</div>
</div>
<!-- 右侧任务 标题信息 -->
<!-- <div class="right">
<n-scrollbar style="max-height: 100%">
<n-ellipsis style="max-width: 350px">任务ID{{ taskDetailInfo.taskname }}</n-ellipsis>
<div class="tags">
<div class="tag tag-submiting" v-if="taskDetailInfo.historyStates == '1'"></div>
<div class="tag tag-submited" v-else-if="taskDetailInfo.historyStates == 2 || taskDetailInfo.workStatus == 3">已审批</div>
<div class="tag tag-passed" v-if="taskDetailInfo.historyStates == 2">{{
TASK_STATUS_OBJ[taskDetailInfo.historyStates] }}</div>
<div class="tag tag-not-passed" v-else-if="taskDetailInfo.workStatus == 3">{{
TASK_STATUS_OBJ[taskDetailInfo.historyStates]
}}</div>
</div>
<n-divider class="divider-line" />
<div class="property">
<span class="property-name top" style=" color: #666666">图片大小
</span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo && taskDetailInfo?.pictureInfo?.imgSize&&
(taskDetailInfo?.pictureInfo?.imgSize / 1000).toFixed(2) }}KB</span>
</div>
<div class="property">
<span class="property-name top" style=" color: #666666">图片格式
</span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo?.imgFormat }}</span>
</div>
<div class="property">
<span class="property-name top" style=" color: #666666">图片尺寸
</span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo?.imgMeasure }}</span>
</div>
<div class="property">
<span class="property-name top" style=" color: #666666">色彩空间
</span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo?.imgSpace }}</span>
</div>
<div class="property">
<span class="property-name top" style=" color: #666666">提报人
</span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.upname || "-" }}</span>
</div>
<div class="property">
<span class="property-name top" style=" color: #666666">创建时间
</span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.pictureInfo && taskDetailInfo?.pictureInfo.createTime }}</span>
</div>
<div class="property">
<span class="property-name top" style=" color: #666666">提报时间
</span>
<span style=" color: #333333; font-size: 16px">{{ taskDetailInfo?.submitDateTimestamp &&
format(taskDetailInfo?.submitDateTimestamp, 'yyyy-MM-dd HH:mm:ss') || '-' }}</span>
</div>
<div v-for="key in Object.keys(propertys)" :key="key" class="property">
<span class="property-name">{{ fieldMap[key] }}</span>
<span class="property-content">{{ propertys[key] }}</span>
</div>
</n-scrollbar>
</div> -->
<PictureInfo :taskDetailInfo="taskDetailInfo"></PictureInfo>
</div>
<div style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0">
@ -661,6 +604,39 @@ function reloadList() {
margin-left: 6px;
}
}
.right {
display: flex;
align-items: center;
.btn {
width: 118px;
height: 36px;
background: linear-gradient(135deg, #5b85f8, #3c6cf0);
border-radius: 17px;
box-shadow: 0px 2px 6px 0px rgba(116, 153, 253, 0.3);
display: flex;
align-items: center;
justify-content: center;
color: #fff;
margin-right: 6px;
cursor: pointer;
}
.batch {
display: flex;
align-items: center;
.btn-approval {
width: 68px;
height: 28px;
cursor: pointer;
}
.btn-left {
margin-left: 16px;
}
}
}
.font {
font-size: 20px;

@ -91,8 +91,15 @@ function generateDefaultList() {
}
const show = ref(false);
const checkAll = ref(false);
const checkAll = computed(() => {
let baseNum = 0;
offList.value.map((v) => {
if (v.fix) {
baseNum += 1;
}
});
return onList.value.length == offList.value.length - baseNum;
});
function showModal() {
show.value = true;
}
@ -221,11 +228,22 @@ function removeHandler(id: string) {
});
if (index !== -1) onList.value.splice(index, 1);
index = offList.value.findIndex(v=>v.id==id);
index = offList.value.findIndex((v) => v.id == id);
offList.value[index].checked = false;
}
onMounted(async () => {
const initData = () => {
offList.value = [];
onList.value = [];
fixList.value = [];
// offShowList.value = [];
// onShowList.value = [];
// fixShowList.value = [];
selectIds.value = [];
};
const getData = async () => {
initData();
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let res;
@ -249,8 +267,8 @@ onMounted(async () => {
fix: v.isrequired == 2,
checked:
v.isrequired == 2 ||
Boolean(userFieldFixed?.find(v2=>v2==v.name)) ||
Boolean(userFieldUnFixed?.find(v2=>v2==v.name))
Boolean(userFieldFixed?.find((v2) => v2 == v.name)) ||
Boolean(userFieldUnFixed?.find((v2) => v2 == v.name)),
};
if (item.fix) {
fixList.value.push(item);
@ -274,8 +292,23 @@ onMounted(async () => {
}
}
});
console.log(offList.value,'offList.value');
console.log(useList, 'useList');
};
onMounted(async () => {
getData();
});
const indeterminate = computed(() => {
let baseNum = 0;
offList.value.map((v) => {
if (v.fix) {
baseNum += 1;
}
});
return (
onList.value.length > 0 &&
offList.value.length - baseNum > onList.value.length
);
});
</script>
@ -311,11 +344,12 @@ onMounted(async () => {
</template>
</n-input>
<div class="draggable-ul">
<div class="draggable-li">
<div class="draggable-li" :class="{ checkAll: indeterminate }">
<n-checkbox
v-model:checked="checkAll"
label="全部"
@update:checked="onCheckAllChange"
:indeterminate="indeterminate"
/>
</div>
<div class="content">
@ -377,7 +411,7 @@ onMounted(async () => {
:class="{ fix: item.fix }"
class="cursor-move draggable-item"
>
<SvgIcon name="drag" size="24" />
<SvgIcon name="drag" size="24" />
<span class="ml-2">{{ item.name }}</span>
<SvgIcon
v-if="!item.fix"
@ -396,7 +430,7 @@ onMounted(async () => {
<template #footer>
<div class="wrapper-footer">
<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="getData();closeModal();">
取消
</n-button>
</div>
@ -484,7 +518,7 @@ onMounted(async () => {
color: #333;
display: flex;
align-items: center;
border-bottom: 1px solid #E8E8E8;
border-bottom: 1px solid #e8e8e8;
}
.disable-check {
@ -492,9 +526,7 @@ onMounted(async () => {
}
}
::v-deep(
.n-card.n-card--content-segmented > .n-card__content:not(:first-child)
) {
::v-deep(.n-card.n-card--content-segmented > .n-card__content:not(:first-child)) {
border: 0px;
}
@ -502,15 +534,28 @@ onMounted(async () => {
--n-padding-top: 0px;
--n-padding-bottom: 12px;
}
::v-deep(.n-card > .n-card-header .n-card-header__main){
::v-deep(.n-card > .n-card-header .n-card-header__main) {
font-weight: lighter !important;
font-size: 14px;
}
::v-deep(.n-scrollbar){
::v-deep(.n-scrollbar) {
border-top: none !important;
}
::v-deep(.n-button--info-type){
background: #507AFD !important;
::v-deep(.n-button--info-type) {
background: #507afd !important;
}
::v-deep(.checkAll .n-checkbox.n-checkbox--indeterminate .n-checkbox-box) {
background: none;
border: none;
}
::v-deep(.checkAll .n-checkbox-box__border) {
border: 1px solid #e8e8e8 !important;
}
::v-deep(.checkAll .n-checkbox-icon) {
border: 3px solid #fff;
background: #1980ff;
}
::v-deep(.checkAll .n-checkbox-icon svg) {
display: none !important;
}
</style>

Loading…
Cancel
Save