| 
@@ -2,6 +2,25 @@ | 
 | 
@@ -2,6 +2,25 @@ | 
| 
2
 | 
   <div class="step1">
 | 
2
 | 
   <div class="step1">
 | 
| 
3
 | 
     <div class="step1-form">
 | 
3
 | 
     <div class="step1-form">
 | 
| 
4
 | 
       <BasicForm @register="register">
 | 
4
 | 
       <BasicForm @register="register">
 | 
| 
 | 
   | 
5
 | 
+        <template #addOrg="{ model, field }">
 | 
| 
 | 
   | 
6
 | 
+          <div style="display: flex; align-items: center">
 | 
| 
 | 
   | 
7
 | 
+            <div style="width: 245px">
 | 
| 
 | 
   | 
8
 | 
+              <a-tree-select
 | 
| 
 | 
   | 
9
 | 
+                v-model:value="model[field]"
 | 
| 
 | 
   | 
10
 | 
+                show-search
 | 
| 
 | 
   | 
11
 | 
+                style="width: 100%"
 | 
| 
 | 
   | 
12
 | 
+                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
 | 
| 
 | 
   | 
13
 | 
+                placeholder="请选择组织"
 | 
| 
 | 
   | 
14
 | 
+                allow-clear
 | 
| 
 | 
   | 
15
 | 
+                tree-default-expand-all
 | 
| 
 | 
   | 
16
 | 
+                :tree-data="treeData"
 | 
| 
 | 
   | 
17
 | 
+              />
 | 
| 
 | 
   | 
18
 | 
+            </div>
 | 
| 
 | 
   | 
19
 | 
+            <div>
 | 
| 
 | 
   | 
20
 | 
+              <a-button type="link" @click="handleOpenOrgDrawer">新增组织</a-button>
 | 
| 
 | 
   | 
21
 | 
+            </div>
 | 
| 
 | 
   | 
22
 | 
+          </div>
 | 
| 
 | 
   | 
23
 | 
+        </template>
 | 
| 
5
 | 
         <template #iconSelect>
 | 
24
 | 
         <template #iconSelect>
 | 
| 
6
 | 
           <Upload
 | 
25
 | 
           <Upload
 | 
| 
7
 | 
             name="avatar"
 | 
26
 | 
             name="avatar"
 | 
 | 
@@ -86,10 +105,11 @@ | 
 | 
@@ -86,10 +105,11 @@ | 
| 
86
 | 
         <div ref="wrapRef" style="height: 300px; width: 90%" class="ml-6"></div>
 | 
105
 | 
         <div ref="wrapRef" style="height: 300px; width: 90%" class="ml-6"></div>
 | 
| 
87
 | 
       </div>
 | 
106
 | 
       </div>
 | 
| 
88
 | 
     </Modal>
 | 
107
 | 
     </Modal>
 | 
| 
 | 
   | 
108
 | 
+    <DeptDrawer @register="registerModal" @success="handleSuccess" />
 | 
| 
89
 | 
   </div>
 | 
109
 | 
   </div>
 | 
| 
90
 | 
 </template>
 | 
110
 | 
 </template>
 | 
| 
91
 | 
 <script lang="ts">
 | 
111
 | 
 <script lang="ts">
 | 
| 
92
 | 
-  import { defineComponent, ref, nextTick, unref, reactive } from 'vue';
 | 
112
 | 
+  import { defineComponent, ref, nextTick, unref, reactive, toRefs, onMounted } from 'vue';
 | 
| 
93
 | 
   import { BasicForm, useForm } from '/@/components/Form';
 | 
113
 | 
   import { BasicForm, useForm } from '/@/components/Form';
 | 
| 
94
 | 
   import { step1Schemas } from '../../config/data';
 | 
114
 | 
   import { step1Schemas } from '../../config/data';
 | 
| 
95
 | 
   import { useScript } from '/@/hooks/web/useScript';
 | 
115
 | 
   import { useScript } from '/@/hooks/web/useScript';
 | 
 | 
@@ -102,6 +122,10 @@ | 
 | 
@@ -102,6 +122,10 @@ | 
| 
102
 | 
   import icon from '/@/assets/images/wz.png';
 | 
122
 | 
   import icon from '/@/assets/images/wz.png';
 | 
| 
103
 | 
   import { useDebounceFn } from '@vueuse/core';
 | 
123
 | 
   import { useDebounceFn } from '@vueuse/core';
 | 
| 
104
 | 
   import { validatorLongitude, validatorLatitude } from '/@/utils/rules';
 | 
124
 | 
   import { validatorLongitude, validatorLatitude } from '/@/utils/rules';
 | 
| 
 | 
   | 
125
 | 
+  import { getOrganizationList } from '/@/api/system/system';
 | 
| 
 | 
   | 
126
 | 
+  import { copyTransFun } from '/@/utils/fnUtils';
 | 
| 
 | 
   | 
127
 | 
+  import { useDrawer } from '/@/components/Drawer';
 | 
| 
 | 
   | 
128
 | 
+  import DeptDrawer from '/@/views/system/organization/OrganizationDrawer.vue';
 | 
| 
105
 | 
 
 | 
129
 | 
 
 | 
| 
106
 | 
   export default defineComponent({
 | 
130
 | 
   export default defineComponent({
 | 
| 
107
 | 
     components: {
 | 
131
 | 
     components: {
 | 
 | 
@@ -117,6 +141,7 @@ | 
 | 
@@ -117,6 +141,7 @@ | 
| 
117
 | 
       Row,
 | 
141
 | 
       Row,
 | 
| 
118
 | 
       Col,
 | 
142
 | 
       Col,
 | 
| 
119
 | 
       LoadingOutlined,
 | 
143
 | 
       LoadingOutlined,
 | 
| 
 | 
   | 
144
 | 
+      DeptDrawer,
 | 
| 
120
 | 
     },
 | 
145
 | 
     },
 | 
| 
121
 | 
     props: {
 | 
146
 | 
     props: {
 | 
| 
122
 | 
       isUpdate: {
 | 
147
 | 
       isUpdate: {
 | 
 | 
@@ -125,6 +150,27 @@ | 
 | 
@@ -125,6 +150,27 @@ | 
| 
125
 | 
     },
 | 
150
 | 
     },
 | 
| 
126
 | 
     emits: ['next'],
 | 
151
 | 
     emits: ['next'],
 | 
| 
127
 | 
     setup(props, { emit }) {
 | 
152
 | 
     setup(props, { emit }) {
 | 
| 
 | 
   | 
153
 | 
+      const orgData: any = reactive({
 | 
| 
 | 
   | 
154
 | 
+        treeData: [],
 | 
| 
 | 
   | 
155
 | 
+      });
 | 
| 
 | 
   | 
156
 | 
+      const getOrganizationListFunc = async () => {
 | 
| 
 | 
   | 
157
 | 
+        const data = await getOrganizationList();
 | 
| 
 | 
   | 
158
 | 
+        copyTransFun(data as any as any[]);
 | 
| 
 | 
   | 
159
 | 
+        orgData.treeData = data;
 | 
| 
 | 
   | 
160
 | 
+      };
 | 
| 
 | 
   | 
161
 | 
+      onMounted(async () => {
 | 
| 
 | 
   | 
162
 | 
+        await getOrganizationListFunc();
 | 
| 
 | 
   | 
163
 | 
+      });
 | 
| 
 | 
   | 
164
 | 
+      const { treeData } = toRefs(orgData);
 | 
| 
 | 
   | 
165
 | 
+      const [registerModal, { openDrawer }] = useDrawer();
 | 
| 
 | 
   | 
166
 | 
+      const handleOpenOrgDrawer = () => {
 | 
| 
 | 
   | 
167
 | 
+        openDrawer(true, {
 | 
| 
 | 
   | 
168
 | 
+          isUpdate: false,
 | 
| 
 | 
   | 
169
 | 
+        });
 | 
| 
 | 
   | 
170
 | 
+      };
 | 
| 
 | 
   | 
171
 | 
+      const handleSuccess = async () => {
 | 
| 
 | 
   | 
172
 | 
+        await getOrganizationListFunc();
 | 
| 
 | 
   | 
173
 | 
+      };
 | 
| 
128
 | 
       const redirectPosition = () => {
 | 
174
 | 
       const redirectPosition = () => {
 | 
| 
129
 | 
         if (positionState.longitude && positionState.latitude) {
 | 
175
 | 
         if (positionState.longitude && positionState.latitude) {
 | 
| 
130
 | 
           var pt = new BMap.Point(positionState.longitude, positionState.latitude);
 | 
176
 | 
           var pt = new BMap.Point(positionState.longitude, positionState.latitude);
 | 
 | 
@@ -152,6 +198,7 @@ | 
 | 
@@ -152,6 +198,7 @@ | 
| 
152
 | 
       async function nextStep() {
 | 
198
 | 
       async function nextStep() {
 | 
| 
153
 | 
         try {
 | 
199
 | 
         try {
 | 
| 
154
 | 
           let values = await validate();
 | 
200
 | 
           let values = await validate();
 | 
| 
 | 
   | 
201
 | 
+          console.log(values);
 | 
| 
155
 | 
           values = { devicePic: devicePic.value, ...positionState, ...values };
 | 
202
 | 
           values = { devicePic: devicePic.value, ...positionState, ...values };
 | 
| 
156
 | 
           delete values.icon;
 | 
203
 | 
           delete values.icon;
 | 
| 
157
 | 
           delete values.deviceAddress;
 | 
204
 | 
           delete values.deviceAddress;
 | 
 | 
@@ -400,6 +447,10 @@ | 
 | 
@@ -400,6 +447,10 @@ | 
| 
400
 | 
         loading,
 | 
447
 | 
         loading,
 | 
| 
401
 | 
         rules,
 | 
448
 | 
         rules,
 | 
| 
402
 | 
         redirectPosition,
 | 
449
 | 
         redirectPosition,
 | 
| 
 | 
   | 
450
 | 
+        treeData,
 | 
| 
 | 
   | 
451
 | 
+        registerModal,
 | 
| 
 | 
   | 
452
 | 
+        handleOpenOrgDrawer,
 | 
| 
 | 
   | 
453
 | 
+        handleSuccess,
 | 
| 
403
 | 
       };
 | 
454
 | 
       };
 | 
| 
404
 | 
     },
 | 
455
 | 
     },
 | 
| 
405
 | 
   });
 | 
456
 | 
   });
 |