feat: 接口对接完善

bak
刘释隆 1 year ago
parent 0a8af82120
commit 44c3c50a0e

@ -1,10 +1,10 @@
<script lang="ts" setup>
import { computed, ref, watch } from 'vue'
import { VueDraggable } from 'vue-draggable-plus'
import { debounce, difference } from 'lodash-es'
import { setFilter } from '@/api/home/filter'
import { asideMap } from '@/config/final'
import { useFinal } from '@/store/modules/final'
import { debounce, difference } from 'lodash-es'
import { computed, ref, watch } from 'vue'
import { VueDraggable } from 'vue-draggable-plus'
const show = ref(false)
const checkAll = ref(false)

@ -1,8 +1,10 @@
<script lang="ts" setup>
import { computed, ref, watch } from 'vue'
import { difference } from 'lodash-es'
import { VueDraggable } from 'vue-draggable-plus'
import { ColumnsMap } from '@/config/final'
import { getAllfieldList, getfieldList } from "@/api/home/filter";
import { ColumnsMap } from '@/config/final';
import { useUser } from "@/store/modules/user";
import { difference } from 'lodash-es';
import { computed, onMounted, ref, watch } from 'vue';
import { VueDraggable } from 'vue-draggable-plus';
const emit = defineEmits<{
(e: 'commit', columns: any[])
@ -13,6 +15,42 @@ const offList = ref<any[]>([])
//
const fixLeftList = ref<any[]>([])
const onList = ref<any[]>([])
const props = defineProps({
reviewType: {
type: Number,
default: () => 0,
require: true,
},
})
onMounted(async()=>{
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let res;
res = await getAllfieldList(props.reviewType); //
const allList = res.data;
res = await getfieldList(props.reviewType, userInfo.id); //
const useList = res.data;
console.log(allList,useList,'useList')
/**
* name 标题
* id 键值
* fix 是否默认
* checked 是否选中
*/
allList.map((v) => {
let item = {
name: v.fieldDesc,
id: v.name,
fix: v.isrequired == 2,
checked:
v.isrequired == 2 ||
Boolean(useList.userField?.toLowerCase().indexOf(v.name)>-1),
};
offList.value.push(item)
});
})
const allCount = computed(() => {
return `全部字段(共${offList.value.length - 1}个)`
@ -129,7 +167,7 @@ defineExpose({
showModal,
})
generatList()
// generatList()
const selectIds = ref<string[]>([])

@ -1,19 +1,19 @@
<script lang="ts" setup>
import { computed, h, nextTick, onMounted, reactive, ref, unref } from 'vue'
import { NDataTable, useDialog, useMessage } from 'naive-ui'
import type { DataTableColumns, DataTableRowKey, PaginationProps } from 'naive-ui'
import { Action, CustomTabelModal, ImportExcelModal, RepeatModal, RepeatTaskTableModal } from '../comp'
import ConfrimModal from '@/views/task/modal/ConfrimModal.vue'
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { getViewportOffset } from '@/utils/domUtils'
import { getFinalList } from '@/api/final'
import { audit } from '@/api/task/task'
import SvgIcon from '@/components/Icon/SvgIcon.vue'
import type { RowData } from '@/config/final'
import { findKey, headRules } from '@/config/final'
import { getFinalList } from '@/api/final'
import { isBoolean } from '@/utils/is'
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
import { useUser } from '@/store/modules/user'
import { getViewportOffset } from '@/utils/domUtils'
import { isBoolean } from '@/utils/is'
import ConfrimModal from '@/views/task/modal/ConfrimModal.vue'
import type { DataTableColumns, DataTableRowKey, PaginationProps } from 'naive-ui'
import { NDataTable, useDialog, useMessage } from 'naive-ui'
import { computed, h, nextTick, onMounted, reactive, ref, unref } from 'vue'
import { Action, CustomTabelModal, ImportExcelModal, RepeatModal, RepeatTaskTableModal } from '../comp'
import type { ApprovalParam } from '/#/api'
import { audit } from '@/api/task/task'
import SvgIcon from '@/components/Icon/SvgIcon.vue'
const columns: DataTableColumns<RowData> = [
{

@ -1,11 +1,11 @@
<script lang="ts" setup>
import { onMounted, reactive, ref } from 'vue'
import { favorite, getConditionList, unfavorite } from '@/api/home/filter'
import { asideMap } from '@/config/aside'
import { useInfiniteScroll } from '@vueuse/core'
import { debounce } from 'lodash-es'
import { asideMap } from '@/config/aside'
import { favorite, getConditionList, unfavorite } from '@/api/home/filter'
import type { Filter, FilterEntity } from '/#/home'
import { onMounted, reactive, ref } from 'vue'
import type { FilterSearchParam } from '/#/api'
import type { Filter, FilterEntity } from '/#/home'
defineOptions({ name: 'AdvanceFilter' })

@ -391,7 +391,7 @@ function previewHandler(event: MouseEvent) {
</n-tabs>
<ConfrimModal ref="confrimModalRef" @commit="reject" />
<BatchModal ref="batchModalRef" @reject="rejectHandler" @approval="approvalHandler" />
<CustomSettingModal ref="CustomSettingModalRef" />
<CustomSettingModal ref="CustomSettingModalRef" :reviewType="3"/>
</div>
</template>

@ -1,6 +1,43 @@
<script lang="ts" setup>
import { getAllfieldList, getfieldList, savefield } from "@/api/home/filter";
import { ReportInfoConfig } from "@/config/workorder";
import { ref } from "vue";
import { useUser } from "@/store/modules/user";
import { defineProps, onMounted, ref } from "vue";
const props = defineProps({
reviewType: {
type: Number,
default: () => 3,
require: true,
},
})
onMounted(async () => {
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let res;
res = await getAllfieldList(props.reviewType); //
const allList = res.data;
res = await getfieldList(props.reviewType, userInfo.id); //
const useList = res.data;
/**
* name 标题
* id 键值
* fix 是否默认
* checked 是否选中
*/
allList.map((v) => {
let item = {
name: v.fieldDesc,
id: v.name,
fix: v.isrequired == 2,
checked:
v.isrequired == 2 ||
Boolean(useList.userField?.toLowerCase().indexOf(v.name)>-1),
};
offList.value.push(item)
});
});
const offList = ref<any[]>([]);
function generatList() {
@ -59,6 +96,15 @@ function closeModal() {
}
async function handleSumbit(e: MouseEvent) {
const userStore = useUser();
const userInfo = userStore.getUserInfo;
let userField = "";
offList.value.map((v) => {
if(v.checked){
userField += `${v.id},`;
}
});
savefield(props.reviewType, userInfo.id, userField);
e.preventDefault();
closeModal();
}
@ -67,7 +113,7 @@ defineExpose({
showModal,
});
generatList();
// generatList();
const selectIds = ref<string[]>([]);

@ -100,11 +100,9 @@ function closeModal() {
async function handleSumbit(e: MouseEvent) {
const userStore = useUser();
const userInfo = userStore.getUserInfo;
console.log(onList.value, "onList");
console.log(offList.value, "offList");
let userField = "";
onList.value.map((v, index) => {
userField += `${v.id}${index == onList.value.length - 1 ? "" : ","}`;
onList.value.map((v) => {
userField += `${v.id},`;
});
savefield(props.reviewType, userInfo.id, userField);
e.preventDefault();
@ -240,7 +238,7 @@ onMounted(async () => {
fix: v.isrequired == 2,
checked:
v.isrequired == 2 ||
Boolean(useList.userField?.toLowerCase().indexOf(v.name)),
Boolean(useList.userField?.toLowerCase().indexOf(v.name)>-1),
};
if (item.checked) {
onList.value.push(item);

Loading…
Cancel
Save