Browse Source

区域树

yangyuxuan 4 months ago
parent
commit
9815ab68d4

+ 9 - 0
src/api/PreventionResponsible/index.ts

@@ -61,3 +61,12 @@ export function deleteData(id) {
     method: 'delete'
   });
 }
+
+//获取区划树
+export function getRegionalTree(id) {
+  return request({
+    url: `/api/system/area/tree2/${id}`,
+    method: 'get',
+    params: data
+  });
+}

+ 0 - 17
src/types/components.d.ts

@@ -24,24 +24,16 @@ declare module 'vue' {
     DistributionMap: typeof import('./../components/Map/YztMap/DistributionMap.vue')['default']
     DrawMap: typeof import('./../components/Map/YztMap/DrawMap.vue')['default']
     Editor: typeof import('./../components/Editor/index.vue')['default']
-    ElAnchor: typeof import('element-plus/es')['ElAnchor']
-    ElAnchorLink: typeof import('element-plus/es')['ElAnchorLink']
     ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
-    ElCard: typeof import('element-plus/es')['ElCard']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCheckboxButton: typeof import('element-plus/es')['ElCheckboxButton']
     ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElCol: typeof import('element-plus/es')['ElCol']
-    ElCollapse: typeof import('element-plus/es')['ElCollapse']
-    ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
-    ElContainer: typeof import('element-plus/es')['ElContainer']
     ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
-    ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
-    ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
     ElDialog: typeof import('element-plus/es')['ElDialog']
     ElDivider: typeof import('element-plus/es')['ElDivider']
     ElDrawer: typeof import('element-plus/es')['ElDrawer']
@@ -51,29 +43,22 @@ declare module 'vue' {
     ElEmpty: typeof import('element-plus/es')['ElEmpty']
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
-    ElHeader: typeof import('element-plus/es')['ElHeader']
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
     ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
     ElLink: typeof import('element-plus/es')['ElLink']
-    ElMain: typeof import('element-plus/es')['ElMain']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
     ElRadio: typeof import('element-plus/es')['ElRadio']
-    ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
     ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
-    ElSegmented: typeof import('element-plus/es')['ElSegmented']
     ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
-    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
     ElSlider: typeof import('element-plus/es')['ElSlider']
-    ElSpace: typeof import('element-plus/es')['ElSpace']
     ElStep: typeof import('element-plus/es')['ElStep']
     ElSteps: typeof import('element-plus/es')['ElSteps']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
@@ -100,8 +85,6 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
-    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
-    IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
     IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']

+ 8 - 8
src/views/knowledge/HiddenStandards/PdfViewer.vue

@@ -7,7 +7,7 @@
     </div>
     <div class="pdf-preview"  v-loading="pdfLoading" element-loading-text="正在加载中..."
          element-loading-background="rgba(122, 122, 122, 0.0)">
-      <vue-pdf-embed v-if="show" :source="state.source" class="vue-pdf-embed" :page="state.pageNum" @loaded="handleDocument" />
+      <vue-pdf-embed v-show="show" :source="state.source" class="vue-pdf-embed" :page="state.pageNum" @loaded="handleDocument" />
     </div>
   </div>
 </template>
@@ -63,24 +63,24 @@ canvas {
   // overflow-y: auto;
   .page-tool {
     position: fixed;
-    bottom: 0.3vw;
+    bottom: 20px;
     left: 0%;
-    padding-left: 0.25vw;
-    padding-right: 0.25vw;
+    padding-left: 15px;
+    padding-right: 15px;
     display: flex;
     align-items: center;
     background: rgb(66, 66, 66);
     color: white;
-    border-radius: 0.9vw;
+    border-radius: 5px;
     z-index: 999!important;
     cursor: pointer;
     margin-left: 50%;
     transform: translateX(-50%);
   }
   .page-tool-item {
-    font-size: 0.6vw;
-    padding: 0.5vw 0.9vw;
-    padding-left: 0.1vw;
+    font-size: 14px;
+    padding: 5px 19px;
+    padding-left: 15px;
     cursor: pointer;
   }
   .pdf-preview{

+ 6 - 0
src/views/knowledge/HiddenStandards/index.vue

@@ -217,6 +217,12 @@ const downloadPdf = (file: any) => {
   download2(baseUrl + '/file/download/' + file.file_name, file.file_name_desc);
 };
 
+let dialogRef = ref();
+let dialogHeight = computed(() => {
+  console.log(dialogRef.value);
+  debugger
+  return '19';
+})
 onMounted(() => {
   fetchWorkrData();
 });

+ 24 - 9
src/views/setting/PreventionResponsible/index.vue

@@ -9,13 +9,14 @@
               ref="deptTreeRef"
               class="mt-2"
               node-key="id"
-              :data="deptOptions"
-              :props="{ label: 'label', children: 'children' }"
+              :props="defaultProps"
               :expand-on-click-node="false"
               :filter-node-method="filterNode"
               highlight-current
-              default-expand-all
               @node-click="handleNodeClick"
+              :default-expanded-keys="treeExpandelKeys"
+              :load="loadNode"
+              lazy
             />
           </el-col>
           <el-col :lg="20" :xs="24">
@@ -107,7 +108,7 @@
 <script setup lang="ts">
 import api from '@/api/system/user';
 import { UserForm, UserQuery, UserVO } from '@/api/system/user/types';
-import { deleteData, getTableList } from '@/api/PreventionResponsible/index';
+import { deleteData, getRegionalTree, getTableList } from '@/api/PreventionResponsible/index';
 import { DeptVO } from '@/api/system/dept/types';
 import { RoleVO } from '@/api/system/role/types';
 import { PostQuery, PostVO } from '@/api/system/post/types';
@@ -231,9 +232,24 @@ watchEffect(
 );
 
 /** 查询部门下拉树结构 */
-const getTreeSelect = async () => {
-  const res = await api.deptTreeSelect();
-  deptOptions.value = res.data;
+const treeExpandelKeys = ref([2]);
+interface Tree {
+  id: string;
+  name: string;
+  children?: Tree[];
+}
+let defaultProps = reactive({
+  label: "label",
+  children: "children",
+  isLeaf: 'isShowSelect',
+});
+const loadNode = (node: Node, resolve: (data: Tree[]) => void) => {
+  const id = node.level === 0 ? "1" : node.data.id;
+  fetchData(resolve, id);
+};
+const fetchData = async (resolve, id) => {
+  let res = await getRegionalTree(id);
+  return resolve(res.data);
 };
 
 /** 查询用户列表 */
@@ -251,7 +267,7 @@ const getList = async () => {
 
 /** 节点单击事件 */
 const handleNodeClick = (data: DeptVO) => {
-  queryParams.value.deptId = data.id;
+  queryParams.value.area_code = data.id;
   handleQuery();
 };
 
@@ -389,7 +405,6 @@ const handleShowUploadDetails = () => {
   showUploadDetails.value = true;
 };
 let onMounted1 = onMounted(() => {
-  getTreeSelect(); // 初始化部门数据
   getList(); // 初始化列表数据
   proxy?.getConfigKey('sys.user.initPassword').then((response) => {
     initPassword.value = response.data;