Ben Lin
2024-06-18 94b93ea7e7f83c678b1413fc9fc8642e69213647
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!--
 * @Description: file content
 * @Author: your name
 * @version: 
 * @Date: 2024-03-24 11:16:46
 * @LastEditors: your name
 * @LastEditTime: 2024-06-12 14:51:42
-->
<!--
 * @Author: Vben
 * @Description: logo component
-->
<template>
  <div class="anticon">
    <a-row class="enter-x">
      <a-col :md="24" :xs="24" :span="24">
        <BasicForm @register="registerForm" />
      </a-col>
    </a-row>
  </div>
</template>
<script lang="ts" setup>
import { onMounted } from 'vue';
import { Row, Col } from 'ant-design-vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { getTreeList, optionsListApi, prodListApi, getProdTreeList } from '/@/api/tigerapi/dept';
import { appFormDept } from './appFormDept.data';
import { useUserStore } from '/@/store/modules/user';
import { useGlobSetting } from '/@/hooks/setting';
 
const globSetting = useGlobSetting();
const ARow = Row;
const ACol = Col;
 
const [registerForm, { updateSchema, setFieldsValue }] = useForm({
  // labelWidth: 200,
  baseColProps: { span: 24 },
  schemas: appFormDept,
  showActionButtonGroup: false,
  actionColOptions: {
    span: 23,
  },
});
onMounted(() => {
  //globSetting.useOrg == 'Y' ? await getTreeList() : await getProdTreeList();
  Promise.all([getProdTreeList(), prodListApi(useUserStore().getUserInfo.userId)]).then((res) => {
    let treeData = res[0];
    treeData = treeData.filter((x) => res[1].Data.Items.some((item) => item.PROD_CODE == x.deptCode));
 
    updateSchema([
      {
        field: 'dept',
        componentProps: { treeData },
      },
    ]);
    setFieldsValue({
      dept: useUserStore().getUserInfo.prodCode,
      // globSetting.useOrg == 'Y'
      //   ? useUserStore().getUserInfo.orgCode
      //   : useUserStore().getUserInfo.prodCode,
    });
  });
});
</script>
<style lang="less" scoped>
@prefix-cls: ~'@{namespace}-app-logo';
 
.@{prefix-cls} {
  display: flex;
  align-items: center;
  padding-left: 7px;
  transition: all 0.2s ease;
  cursor: pointer;
 
  &.light {
    border-bottom: 1px solid @border-color-base;
  }
 
  &.collapsed-show-title {
    padding-left: 20px;
  }
 
  &.light &__title {
    color: @primary-color;
  }
 
  &.dark &__title {
    color: @white;
    font-size: 16px;
  }
 
  &__title {
    transition: all 0.5s;
    // font-size: 16px;
    font-weight: 700;
    line-height: normal;
  }
}
</style>