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`, url: `/static/admin/web/distionary/bytypecode/izstatus`,
method: 'get', 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 return res.data[0].distionaryList
} }

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

@ -1,5 +1,5 @@
import type { AsideEntity } from './aside' 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 { export interface RowData {
id: string id: string
@ -137,8 +137,8 @@ export const asideTaskMap: Recordable<AsideEntity> = {
label: '审批状态', label: '审批状态',
defaultValue: null, defaultValue: null,
isDefaultFilter: true, isDefaultFilter: true,
key: 'izstatus', key: 'izApprovalStatus',
component: IzStatus, // todo component: IzApprovalStatus, // todo
}, },
izuptime: { izuptime: {
label: '提报时间', label: '提报时间',

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

@ -1,6 +1,6 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { store } from '@/store' import { store } from '@/store'
import { getBackList, getBusinessList, getIzShowList, getIztaskstatusList, getPictureTypeList, getRegionList, getRejectList, getRelationTypeList, getTFList, getizstatusList } from '@/api/dictionary' import { getBackList, getBusinessList, getIzShowList, getIztaskstatusList, getPictureTypeList, getRegionList, getRejectList, getRelationTypeList, getTFList, getizstatusList, getizApprovalStatusList } from '@/api/dictionary'
export interface DictionaryState { export interface DictionaryState {
regionList: any regionList: any
@ -24,6 +24,7 @@ export interface DictionaryState {
backList: any backList: any
relationTypeList: any relationTypeList: any
izstatusList: any izstatusList: any
izApprovalStatusList: any
} }
export const useDictionaryStore = defineStore({ export const useDictionaryStore = defineStore({
@ -50,6 +51,7 @@ export const useDictionaryStore = defineStore({
backList: null, backList: null,
relationTypeList: null, relationTypeList: null,
izstatusList: null, izstatusList: null,
izApprovalStatusList: null,
}), }),
getters: { getters: {
getRegionList: (state) => { getRegionList: (state) => {
@ -100,8 +102,35 @@ export const useDictionaryStore = defineStore({
getizstatus: (state) => { getizstatus: (state) => {
return state.izstatusList return state.izstatusList
}, },
getizApprovalStatus: (state) => {
return state.izApprovalStatusList
}
}, },
actions: { 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) { settfList(config) {
this.tfList = config this.tfList = config
}, },
@ -231,6 +260,12 @@ export const useDictionaryStore = defineStore({
this.izstatusList = generateOptions2(list, 'codeno', 'name') this.izstatusList = generateOptions2(list, 'codeno', 'name')
return this.izstatusList 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 asideValue[key] = defaultValue
}) })
const filterModalRef = ref(null) const filterModalRef:any = ref(null)
const newFilterModalRef = ref(null) const newFilterModalRef = ref(null)
const customModalRef = ref(null) const customModalRef = ref(null)
const customObjRef = ref<any>(null) // const customObjRef = ref<any>(null) //
@ -192,6 +192,12 @@ const showSearch = ref(false)
function setShowSearch(value: boolean) { function setShowSearch(value: boolean) {
showSearch.value = value showSearch.value = value
} }
const newFilterOk = () => {
filterModalRef.value.query(
filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize
);
};
// key // key
function scrollHandler(key: string) { function scrollHandler(key: string) {
@ -243,7 +249,12 @@ function updateComponent(key, e) {
</script> </script>
<template> <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 v-show="showCollapse" class="aside-collapse">
<div class="aside-collapse-btn" @click="collapseHandler"> <div class="aside-collapse-btn" @click="collapseHandler">
<SvgIcon :name="collapseIcon" size="40" /> <SvgIcon :name="collapseIcon" size="40" />
@ -252,11 +263,19 @@ function updateComponent(key, e) {
<n-scrollbar trigger="none"> <n-scrollbar trigger="none">
<div class="aside-header"> <div class="aside-header">
<!-- 搜索跳转模块 --> <!-- 搜索跳转模块 -->
<Search v-show="showSearch" @select="scrollHandler" @close="setShowSearch(false)" /> <Search
v-show="showSearch"
@select="scrollHandler"
@close="setShowSearch(false)"
/>
<!-- 高级筛选 --> <!-- 高级筛选 -->
<AdvanceFilter <AdvanceFilter
v-show="!showSearch" :type="0" @select="filterHandler" @update:search="setShowSearch(true)" v-show="!showSearch"
@show-custom="showModal(customModalRef)" @show-filter="showModal(filterModalRef)" :type="0"
@select="filterHandler"
@update:search="setShowSearch(true)"
@show-custom="showModal(customModalRef)"
@show-filter="showModal(filterModalRef)"
/> />
</div> </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" /> <CustomFilterModalVue ref="customModalRef" />
</n-scrollbar> </n-scrollbar>
@ -280,7 +303,7 @@ function updateComponent(key, e) {
display: flex; display: flex;
position: relative; position: relative;
flex-direction: column; flex-direction: column;
background: #FFF; background: #fff;
border: 1px solid #efeff5; border: 1px solid #efeff5;
border-radius: 3px; border-radius: 3px;
box-sizing: border-box; box-sizing: border-box;
@ -317,11 +340,17 @@ function updateComponent(key, e) {
right: -20px; 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; 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; font-weight: bold;
justify-content: space-between; justify-content: space-between;
} }
@ -334,11 +363,18 @@ function updateComponent(key, e) {
border-top: 0px; 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; 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; width: 0px;
} }
} }

@ -156,12 +156,16 @@ const inputHandler = debounce((word) => {
getSearchedList(word); getSearchedList(word);
}, 300); }, 300);
function getSearchedList(word) { function getSearchedList(word, isScroll = false) {
if (word) { if (word) {
pagination.pageSize = 300; pagination.pageSize = 300;
} else { }
if (!word) {
pagination.pageSize = 10; pagination.pageSize = 10;
} }
if (isScroll) {
pagination.pageSize = 300;
}
ruleForm.keyword = word; ruleForm.keyword = word;
featchList().then((list) => { featchList().then((list) => {
let dataArr: FilterEntity[] = []; let dataArr: FilterEntity[] = [];
@ -233,9 +237,16 @@ function unFavoriteHandler(event: MouseEvent, item) {
} }
} }
const handleScroll= (event)=>{ const handleScroll = (event) => {
console.log(event) let timer;
} if (timer) {
clearTimeout(timer);
} else {
timer = setTimeout(() => {
getSearchedList("", true);
}, 2000);
}
};
const moveEnd = () => { const moveEnd = () => {
unData.value.map((v, index) => { unData.value.map((v, index) => {
@ -438,7 +449,7 @@ const moveEnd = () => {
align-items: center; align-items: center;
} }
} }
::v-deep(.wrapper-left-popover .n-form-item){ ::v-deep(.wrapper-left-popover .n-form-item) {
display: block !important; display: block !important;
} }
</style> </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> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from "vue";
import { useConfig } from '@/store/modules/asideConfig' import { useConfig } from "@/store/modules/asideConfig";
const configUseStore = useConfig() const configUseStore = useConfig();
configUseStore.$subscribe(() => { configUseStore.$subscribe(() => {
if(isLoadValue.value) { if (isLoadValue.value) {
isLoadValue.value = false; isLoadValue.value = false;
return return;
} }
let asideValue = configUseStore.getAsideValue; let asideValue = configUseStore.getAsideValue;
if(asideValue['izsimilarity']) { if(asideValue['izsimilarity']) {
@ -15,28 +15,33 @@ configUseStore.$subscribe(() => {
}else { }else {
range.value = [0, 100]; range.value = [0, 100];
} }
console.log(range.value, 'range.value')
// else {
// range.value = [0, 100];
// }
}); });
const props = defineProps<{ const props = defineProps<{
value: [number, number] value: [number, number];
label: string label: string;
}>() }>();
const emit = defineEmits<{ 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 = { const marks = {
0: '0', 0: "0",
50: '50', 50: "50",
100: '100', 100: "100",
} };
const isLoadValue = ref(false) const isLoadValue = ref(false);
function onChange(value: number & number[]) { function onChange(value: number & number[]) {
range.value = value as any;
isLoadValue.value = true; isLoadValue.value = true;
let valueStr = value.join('-'); let valueStr = value.join("-");
emit('update:value', valueStr) emit("update:value", valueStr);
} }
</script> </script>
@ -45,7 +50,13 @@ function onChange(value: number & number[]) {
<n-collapse :default-expanded-names="['1']" arrow-placement="right"> <n-collapse :default-expanded-names="['1']" arrow-placement="right">
<n-collapse-item :title="label" name="1"> <n-collapse-item :title="label" name="1">
<n-space vertical> <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-space>
</n-collapse-item> </n-collapse-item>
</n-collapse> </n-collapse>
@ -56,7 +67,7 @@ function onChange(value: number & number[]) {
.wrapper { .wrapper {
padding: 10px; padding: 10px;
} }
::v-deep(.n-collapse-item-arrow){ ::v-deep(.n-collapse-item-arrow) {
color: #999999 !important;; color: #999999 !important;
} }
</style> </style>

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

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

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

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

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

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

@ -485,63 +485,6 @@ function reloadList() {
<SvgIcon style="cursor: pointer; margin-left: 30px" name="t2" @click.stop="rejectHandler" /> <SvgIcon style="cursor: pointer; margin-left: 30px" name="t2" @click.stop="rejectHandler" />
</div> </div>
</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> <PictureInfo :taskDetailInfo="taskDetailInfo"></PictureInfo>
</div> </div>
<div style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0"> <div style="display: flex; justify-content: space-between; padding: 12px 0px 3px 0">
@ -661,6 +604,39 @@ function reloadList() {
margin-left: 6px; 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 {
font-size: 20px; font-size: 20px;

@ -91,8 +91,15 @@ function generateDefaultList() {
} }
const show = ref(false); 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() { function showModal() {
show.value = true; show.value = true;
} }
@ -221,11 +228,22 @@ function removeHandler(id: string) {
}); });
if (index !== -1) onList.value.splice(index, 1); 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; 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 userStore = useUser();
const userInfo = userStore.getUserInfo; const userInfo = userStore.getUserInfo;
let res; let res;
@ -249,8 +267,8 @@ onMounted(async () => {
fix: v.isrequired == 2, fix: v.isrequired == 2,
checked: checked:
v.isrequired == 2 || v.isrequired == 2 ||
Boolean(userFieldFixed?.find(v2=>v2==v.name)) || Boolean(userFieldFixed?.find((v2) => v2 == v.name)) ||
Boolean(userFieldUnFixed?.find(v2=>v2==v.name)) Boolean(userFieldUnFixed?.find((v2) => v2 == v.name)),
}; };
if (item.fix) { if (item.fix) {
fixList.value.push(item); 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> </script>
@ -311,11 +344,12 @@ onMounted(async () => {
</template> </template>
</n-input> </n-input>
<div class="draggable-ul"> <div class="draggable-ul">
<div class="draggable-li"> <div class="draggable-li" :class="{ checkAll: indeterminate }">
<n-checkbox <n-checkbox
v-model:checked="checkAll" v-model:checked="checkAll"
label="全部" label="全部"
@update:checked="onCheckAllChange" @update:checked="onCheckAllChange"
:indeterminate="indeterminate"
/> />
</div> </div>
<div class="content"> <div class="content">
@ -396,7 +430,7 @@ onMounted(async () => {
<template #footer> <template #footer>
<div class="wrapper-footer"> <div class="wrapper-footer">
<n-button type="info" @click="handleSumbit"> </n-button> <n-button type="info" @click="handleSumbit"> </n-button>
<n-button secondary style="margin-left: 15px" @click="closeModal"> <n-button secondary style="margin-left: 15px" @click="getData();closeModal();">
取消 取消
</n-button> </n-button>
</div> </div>
@ -484,7 +518,7 @@ onMounted(async () => {
color: #333; color: #333;
display: flex; display: flex;
align-items: center; align-items: center;
border-bottom: 1px solid #E8E8E8; border-bottom: 1px solid #e8e8e8;
} }
.disable-check { .disable-check {
@ -492,9 +526,7 @@ onMounted(async () => {
} }
} }
::v-deep( ::v-deep(.n-card.n-card--content-segmented > .n-card__content:not(:first-child)) {
.n-card.n-card--content-segmented > .n-card__content:not(:first-child)
) {
border: 0px; border: 0px;
} }
@ -502,15 +534,28 @@ onMounted(async () => {
--n-padding-top: 0px; --n-padding-top: 0px;
--n-padding-bottom: 12px; --n-padding-bottom: 12px;
} }
::v-deep(.n-card > .n-card-header .n-card-header__main){ ::v-deep(.n-card > .n-card-header .n-card-header__main) {
font-weight: lighter !important; font-weight: lighter !important;
font-size: 14px; font-size: 14px;
} }
::v-deep(.n-scrollbar){ ::v-deep(.n-scrollbar) {
border-top: none !important; border-top: none !important;
} }
::v-deep(.n-button--info-type){ ::v-deep(.n-button--info-type) {
background: #507AFD !important; 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> </style>

Loading…
Cancel
Save