|
@@ -11,6 +11,14 @@
|
|
|
</el-select>
|
|
|
</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>
|
|
|
</template>
|
|
|
|
|
@@ -19,9 +27,11 @@ import { QuiskExpose } from "@/helper/mount";
|
|
|
import type { FormInstance, FormRules } from "element-plus";
|
|
|
import type { OrganizationType } from "@/request/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 { globalPasswordRex } from "@/util/regex";
|
|
|
+import * as regionData from 'china-area-data';
|
|
|
+
|
|
|
const baseFormRef = ref<FormInstance>();
|
|
|
|
|
|
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>({
|
|
|
async submit() {
|