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`,
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
}

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

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

@ -18,7 +18,7 @@ import { cloneDeep } from 'lodash-es'
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({})
//
@ -165,7 +165,6 @@ function setShowSearch(value: boolean) {
showSearch.value = value
}
const newFilterOk = () => {
console.log('home', 'newFilterOk',filterModalRef.value);
filterModalRef.value.query(
filterModalRef.value.pagination.page,
filterModalRef.value.pagination.pageSize
@ -206,13 +205,16 @@ function editFilter(filter: any) {
function updateComponent(key, e) {
console.log("跟新值", key, e);
let tempobj = cloneDeep(asideValue);
tempobj[key] = e;
customObjRef.value = tempobj;
Object.assign(asideValue, tempobj);
// tempobj[key] = e;
// customObjRef.value = tempobj;
// Object.assign(asideValue, tempobj);
asideValue[key] = e;
customObjRef.value = cloneDeep(asideValue)
}
watch(asideValue, (newVal) => {
console.log("asideValue处理后", newVal);
console.log('asideValue--->',asideValue)
configStore.setAsideValue(newVal)
}, { deep: true })
</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>
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'] && typeof asideValue['izsimilarity'] == "string") {
range.value = asideValue['izsimilarity']
}else {
range.value = [0, 100];
console.log(asideValue,'asideValue',asideValue['izsimilarity'])
if (asideValue["izsimilarity"] && typeof asideValue["izsimilarity"] == "string") {
range.value = asideValue["izsimilarity"];
}
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 +49,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 +66,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 }

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

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

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