Browse Source

feat: save

gemercheung 5 months ago
parent
commit
c23cd34755
3 changed files with 1708 additions and 1200 deletions
  1. 1 0
      package.json
  2. 1679 1199
      pnpm-lock.yaml
  3. 28 1
      src/view/organization-edit.vue

+ 1 - 0
package.json

@@ -13,6 +13,7 @@
     "@element-plus/icons-vue": "^2.3.1",
     "@element-plus/icons-vue": "^2.3.1",
     "@types/node": "^20.12.2",
     "@types/node": "^20.12.2",
     "@types/three": "^0.170.0",
     "@types/three": "^0.170.0",
+    "china-area-data": "^5.0.1",
     "element-plus": "^2.6.3",
     "element-plus": "^2.6.3",
     "gl-matrix": "^3.4.3",
     "gl-matrix": "^3.4.3",
     "js-base64": "^3.7.7",
     "js-base64": "^3.7.7",

File diff suppressed because it is too large
+ 1679 - 1199
pnpm-lock.yaml


+ 28 - 1
src/view/organization-edit.vue

@@ -11,6 +11,14 @@
       </el-select>
       </el-select>
     </el-form-item>
     </el-form-item>
 
 
+    <el-form-item label="行政区划" prop="type" required>
+      <!-- <el-select style="width: 300px" v-model="data.type">
+        <el-option :value="Number(key)" :label="type" v-for="(type, key) in OrganizationTypeDesc" /> -->
+      <!-- </el-select> -->
+      <el-cascader style="width: 300px" v-model="selectedArea" :options="options" :props="cityProps" placeholder="请选择省市区" clearable
+         @change="handleChange" />
+    </el-form-item>
+
   </el-form>
   </el-form>
 </template>
 </template>
 
 
@@ -19,9 +27,11 @@ import { QuiskExpose } from "@/helper/mount";
 import type { FormInstance, FormRules } from "element-plus";
 import type { FormInstance, FormRules } from "element-plus";
 import type { OrganizationType } from "@/request/organization";
 import type { OrganizationType } from "@/request/organization";
 import { OrganizationTypeDesc } from '@/store/organization'
 import { OrganizationTypeDesc } from '@/store/organization'
-import { ref, reactive, unref, watchEffect } from "vue";
+import { ref, reactive, unref, watchEffect, onMounted } from "vue";
 import { user } from '@/store/user'
 import { user } from '@/store/user'
 import { globalPasswordRex } from "@/util/regex";
 import { globalPasswordRex } from "@/util/regex";
+import * as regionData from 'china-area-data';
+
 const baseFormRef = ref<FormInstance>();
 const baseFormRef = ref<FormInstance>();
 
 
 const rules = reactive<FormRules>({
 const rules = reactive<FormRules>({
@@ -71,6 +81,23 @@ watchEffect(() => {
   }
   }
 
 
 })
 })
+const selectedArea = ref([]);
+const options = ref([]);
+const cityProps = {
+  value: 'value',
+  label: 'label',
+  children: 'children',
+};
+// 初始化数据(已处理为 Element 需要的格式)
+onMounted(() => {
+  options.value = regionData;
+  console.log('regionData', regionData)
+});
+
+// 处理选择事件
+const handleChange = (value) => {
+  console.log('选中的省市区编码:', value);
+};
 
 
 defineExpose<QuiskExpose>({
 defineExpose<QuiskExpose>({
   async submit() {
   async submit() {