Merge pull request 'feat: 审批状态展示添加,任务审批审批状态字段变更,完善逻辑' (#69) from feat/task_select into test

Reviewed-on: #69
pull/70/head^2
刘释隆 1 year ago
commit f3433010de

@ -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
} }

@ -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: '提报时间',

@ -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
},
}, },
}) })

@ -18,7 +18,7 @@ import { cloneDeep } from 'lodash-es'
const configStore = useConfig() const configStore = useConfig()
// //
const asideValue: Record<keyof typeof asideMap, any> = reactive({}) let asideValue: Record<keyof typeof asideMap, any> = reactive({})
// : // :
const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({}) const asideVisible: Partial<Record<keyof AsideConfig, boolean>> = reactive({})
// //
@ -165,7 +165,6 @@ function setShowSearch(value: boolean) {
showSearch.value = value showSearch.value = value
} }
const newFilterOk = () => { const newFilterOk = () => {
console.log('home', 'newFilterOk',filterModalRef.value);
filterModalRef.value.query( filterModalRef.value.query(
filterModalRef.value.pagination.page, filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize filterModalRef.value.pagination.pageSize
@ -206,13 +205,16 @@ function editFilter(filter: any) {
function updateComponent(key, e) { function updateComponent(key, e) {
console.log("跟新值", key, e); console.log("跟新值", key, e);
let tempobj = cloneDeep(asideValue); let tempobj = cloneDeep(asideValue);
tempobj[key] = e; // tempobj[key] = e;
customObjRef.value = tempobj; // customObjRef.value = tempobj;
Object.assign(asideValue, tempobj); // Object.assign(asideValue, tempobj);
asideValue[key] = e;
customObjRef.value = cloneDeep(asideValue)
} }
watch(asideValue, (newVal) => { watch(asideValue, (newVal) => {
console.log("asideValue处理后", newVal); console.log("asideValue处理后", newVal);
console.log('asideValue--->',asideValue)
configStore.setAsideValue(newVal) configStore.setAsideValue(newVal)
}, { deep: true }) }, { deep: true })
</script> </script>

@ -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,42 +1,46 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref } from "vue";
import { useConfig } from '@/store/modules/asideConfig' import { useConfig } from "@/store/modules/asideConfig";
const configUseStore = useConfig() const 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'] && typeof asideValue['izsimilarity'] == "string") { console.log(asideValue,'asideValue',asideValue['izsimilarity'])
range.value = asideValue['izsimilarity'] if (asideValue["izsimilarity"] && typeof asideValue["izsimilarity"] == "string") {
}else { range.value = asideValue["izsimilarity"];
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 +49,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>
@ -57,6 +67,6 @@ function onChange(value: number & number[]) {
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 }

@ -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>

@ -182,7 +182,8 @@ const operatorOptions = [
const logicOptions = ref([]); const logicOptions = ref([]);
onBeforeMount(() => { onBeforeMount(() => {
dicStore.fetchRelationTypeList(); // dicStore.fetchRelationTypeList();
dicStore.initData();
}); });
watch( watch(

@ -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;
} }
@ -510,7 +542,20 @@ onMounted(async () => {
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