sunxuewei 2 years ago
parent
commit
ceebd11f5c

+ 2 - 1
.eslintrc.js

@@ -1,7 +1,8 @@
1 1
 module.exports = {
2 2
   root: true,
3 3
   env: {
4
-    node: true
4
+    node: true,
5
+    "vue/setup-compiler-macros": true
5 6
   },
6 7
   extends: [
7 8
     "plugin:vue/vue3-essential",

+ 10 - 0
src/api/common.ts

@@ -0,0 +1,10 @@
1
+import request from "@/api";
2
+
3
+// 附件下载
4
+export function downloadAttachment(fileName: string) {
5
+  return request({
6
+    url: `/admin/sysFile/${fileName}`,
7
+    method: "get",
8
+    responseType: "blob"
9
+  });
10
+}

+ 1 - 1
src/components/Pagination/index.vue

@@ -15,7 +15,7 @@
15 15
 </template>
16 16
 
17 17
 <script setup lang="ts">
18
-import { computed, defineProps, defineEmits } from "vue";
18
+import { computed } from "vue";
19 19
 
20 20
 const props = defineProps({
21 21
   total: {

+ 129 - 0
src/components/uploadFile/filePreview.vue

@@ -0,0 +1,129 @@
1
+<template>
2
+  <div class="upload_button">
3
+    <el-button :loading="preLoading" class="preview" :icon="View" plain @click="handlePreview">预览</el-button>
4
+    <el-button :loading="downloading" class="download" :icon="Download" @click="handleDownload">下载</el-button>
5
+    <el-button type="danger" class="delete" :icon="Delete" plain @click="removeAudio">删除</el-button>
6
+  </div>
7
+
8
+  <el-dialog :title="fileShow.fileName" v-model="dialogVisible" width="50%" top="20px" append-to-body destroy-on-close>
9
+    <div class="mti-file-container">
10
+      <img :src="fileShow.src" alt="图片加载失败" />
11
+    </div>
12
+  </el-dialog>
13
+</template>
14
+
15
+<script setup lang="ts">
16
+import { ref } from "vue";
17
+import { ElMessage } from "element-plus";
18
+import { View, Download, Delete } from "@element-plus/icons-vue";
19
+
20
+import { downloadAttachment } from "@/api/common";
21
+
22
+const props = defineProps({
23
+  file: {
24
+    type: Object,
25
+    default() {
26
+      return {};
27
+    }
28
+  }
29
+});
30
+
31
+const emit = defineEmits(["removeFile"]);
32
+
33
+const preLoading = ref(false);
34
+const downloading = ref(false);
35
+const dialogVisible = ref(false);
36
+const fileShow = ref({
37
+  src: "",
38
+  type: "",
39
+  fileName: ""
40
+});
41
+// 预览
42
+const handlePreview = () => {
43
+  preLoading.value = true;
44
+  downloadAttachment(props.file.fileId).then((res: any) => {
45
+    console.log(props.file);
46
+    if (props.file.fileType === "pdf" || props.file.fileType === "PDF") {
47
+      const blob = new Blob([res], { type: "application/pdf;charset=UTF-8" });
48
+      const bFile = URL.createObjectURL(blob);
49
+      preLoading.value = false;
50
+      window.open(bFile);
51
+    } else {
52
+      const bFile = URL.createObjectURL(res);
53
+      fileShow.value = {
54
+        src: bFile,
55
+        type: props.file.type,
56
+        fileName: props.file.fileName
57
+      };
58
+      preLoading.value = false;
59
+      dialogVisible.value = true;
60
+    }
61
+  });
62
+};
63
+
64
+// 下载
65
+const handleDownload = () => {
66
+  downloadAttachment(props.file.fileId).then((res) => {
67
+    downloading.value = true;
68
+    const blob: any = res;
69
+    const a = document.createElement("a");
70
+    a.style.display = "none";
71
+    a.download = decodeURI(props.file.fileName);
72
+    try {
73
+      a.href = window.URL.createObjectURL(blob);
74
+    } catch (err) {
75
+      ElMessage.warning("暂无文件信息.请通知开发人员导入文件模版");
76
+    }
77
+    a.click();
78
+    a.remove();
79
+    downloading.value = false;
80
+    window.setTimeout(function () {
81
+      window.URL.revokeObjectURL(blob);
82
+    }, 0);
83
+  });
84
+};
85
+
86
+// 删除
87
+const removeAudio = () => {
88
+  emit("removeFile", props.file.fileId);
89
+};
90
+</script>
91
+
92
+<style lang="scss" scoped>
93
+.mti-file-container {
94
+  width: 100%;
95
+  overflow-x: auto;
96
+  overflow-y: auto;
97
+  img {
98
+    width: 100%;
99
+  }
100
+}
101
+
102
+.upload_button {
103
+  display: flex;
104
+  align-items: center;
105
+  justify-content: space-between;
106
+  :deep(.el-button) {
107
+    height: 32px;
108
+    border-width: 1px;
109
+    border-style: solid;
110
+    margin-left: 10px;
111
+    background: #fff;
112
+    font-size: 14px;
113
+    font-family: SourceHanSansCN-Regular, SourceHanSansCN;
114
+    font-weight: 400;
115
+  }
116
+  .delete {
117
+    color: #dc281e;
118
+    border-color: #df3d34;
119
+  }
120
+  .preview {
121
+    color: #088a4e;
122
+    border-color: #088a4e;
123
+  }
124
+  .download {
125
+    color: #4069f2;
126
+    border-color: #4069f2;
127
+  }
128
+}
129
+</style>

+ 161 - 0
src/components/uploadFile/index.vue

@@ -0,0 +1,161 @@
1
+<template>
2
+  <el-form-item :label="title">
3
+    <el-upload
4
+      class="upload-demo"
5
+      action="/admin/sysFile/uploadVoucher"
6
+      :headers="headers"
7
+      :data="fileData"
8
+      :show-file-list="false"
9
+      :before-upload="beforeUpload"
10
+      :on-error="handleUploadErr"
11
+      :on-success="handleAvatarSuccess"
12
+    >
13
+      <el-button type="primary" :loading="uploading">上传附件</el-button>
14
+      <template #tip>
15
+        <div class="el-upload__tip">只可上传图片,大小不可超过20M</div>
16
+      </template>
17
+    </el-upload>
18
+  </el-form-item>
19
+
20
+  <el-row v-for="item in uploadList" :key="item.fileId">
21
+    <el-col :span="24">
22
+      <el-form-item label="附件名">
23
+        <div class="file_item">
24
+          <div class="file_item_detail">
25
+            <el-input v-model="item.fileName" readonly placeholder="文件名" />
26
+            <filePreview :file="item" @removeFile="removeFile" />
27
+          </div>
28
+        </div>
29
+      </el-form-item>
30
+    </el-col>
31
+  </el-row>
32
+</template>
33
+
34
+<script setup lang="ts">
35
+import filePreview from "./filePreview.vue";
36
+
37
+import { computed, ref } from "vue";
38
+import { useStore } from "vuex";
39
+import { ElMessage } from "element-plus";
40
+import type { UploadProps } from "element-plus";
41
+
42
+const store = useStore();
43
+const props = defineProps({
44
+  title: {
45
+    type: String,
46
+    default: "附件信息"
47
+  },
48
+  maxLength: {
49
+    type: Number,
50
+    default: 1
51
+  },
52
+  fileList: {
53
+    // 文件列表
54
+    type: Array,
55
+    default() {
56
+      return [];
57
+    }
58
+  }
59
+});
60
+const emit = defineEmits(["update:fileList"]);
61
+
62
+const uploadList = computed({
63
+  get() {
64
+    return props.fileList;
65
+  },
66
+  set(val) {
67
+    emit("update:fileList", val);
68
+  }
69
+});
70
+const headers = {
71
+  Authorization: "Bearer " + store.getters.access_token
72
+};
73
+const fileData = {
74
+  bucket: "reservoir"
75
+};
76
+
77
+const uploading = ref(false);
78
+
79
+// 上传前对附件进行的操作
80
+const beforeUpload: UploadProps["beforeUpload"] = (file) => {
81
+  if (props.maxLength > 0 && uploadList.value.length === props.maxLength) {
82
+    ElMessage.warning(`附件最多上传${props.maxLength}个`);
83
+    return false;
84
+  }
85
+  uploading.value = true;
86
+  const typeList = ".pdf.jpg.png.gif.jpeg.PDF.JPG.PNG.GIF.JPEG";
87
+  const { name, type } = fileNameDispose(file.name);
88
+  if (!typeList.includes(type)) {
89
+    ElMessage.error("不支持此类型,请重新上传。");
90
+    uploading.value = false;
91
+    return false;
92
+  }
93
+  if (name.length > 30) {
94
+    ElMessage.error("文件名不可超30字,请重新命名后再上传。");
95
+    uploading.value = false;
96
+    return false;
97
+  }
98
+  const isLt20M = file.size / 1024 / 1024 < 20;
99
+  if (!isLt20M) {
100
+    ElMessage.error("文件大小不可超过 20MB。");
101
+    uploading.value = false;
102
+    return false;
103
+  }
104
+  return true;
105
+};
106
+
107
+// 获取上传附件的名字和类型
108
+const fileNameDispose = (name: string) => {
109
+  const arr = name.split(".");
110
+  if (arr.length === 2) {
111
+    return { name: arr[0], type: arr[1] };
112
+  } else {
113
+    const type = arr.splice(arr.length - 1, 1)[0];
114
+    const name = arr.join(".");
115
+    return { name, type };
116
+  }
117
+};
118
+
119
+// 上传失败时的回调
120
+const handleUploadErr = () => {
121
+  uploading.value = false;
122
+  ElMessage.error("文件上传失败,请重新上传。");
123
+};
124
+
125
+// 上传成功后的回调
126
+const handleAvatarSuccess: UploadProps["onSuccess"] = (res) => {
127
+  if (res.code === 0) {
128
+    const data = res.data;
129
+    const param = {
130
+      fileType: fileNameDispose(data.fileCustomizeName).type,
131
+      fileName: data.fileCustomizeName,
132
+      fileId: data.fileName,
133
+      bucket: data.bucketName
134
+    };
135
+    uploadList.value.push(param);
136
+    uploading.value = false;
137
+  }
138
+};
139
+
140
+// 删除附件
141
+const removeFile = (fileId: string) => {
142
+  uploadList.value.splice(
143
+    uploadList.value.findIndex((item: any) => item.fileId === fileId),
144
+    1
145
+  );
146
+};
147
+</script>
148
+
149
+<style lang="scss" scoped>
150
+.file_item {
151
+  width: 100%;
152
+  &_detail {
153
+    display: flex;
154
+    align-items: center;
155
+    justify-content: space-between;
156
+    :deep(.el-input__inner) {
157
+      flex: 1;
158
+    }
159
+  }
160
+}
161
+</style>

+ 2 - 3
src/main.ts

@@ -5,8 +5,8 @@ import router from "./router";
5 5
 
6 6
 import "./styles/common.scss";
7 7
 
8
-import ElementPlus from 'element-plus'
9
-import 'element-plus/dist/index.css'
8
+import ElementPlus from "element-plus";
9
+import "element-plus/dist/index.css";
10 10
 import zhCn from "element-plus/es/locale/lang/zh-cn";
11 11
 
12 12
 import "./permission";
@@ -44,5 +44,4 @@ app.use(router);
44 44
 app.use(ElementPlus, {
45 45
   locale: zhCn
46 46
 });
47
-app.use(ElementPlus)
48 47
 app.mount("#app");

+ 0 - 184
src/router/avue-router copy.ts

@@ -1,184 +0,0 @@
1
-import { ITagType } from "@/const/interface_type";
2
-import { RouterOptions } from "vue-router";
3
-
4
-export default {
5
-  install: (router: any, store: any) => {
6
-    function isURL(s: string) {
7
-      return /^http[s]?:\/\/.*/.test(s);
8
-    }
9
-
10
-    function objToform(obj: any) {
11
-      const result: any = [];
12
-      Object.keys(obj).forEach((ele) => {
13
-        result.push(`${ele}=${obj[ele]}`);
14
-      });
15
-      return result.join("&");
16
-    }
17
-    router.$avueRouter = {
18
-      // 全局配置
19
-      $website: store.getters.website,
20
-      $defaultTitle: "中央应急物资储备管理系统",
21
-      routerList: [],
22
-      group: "",
23
-      // 设置标题
24
-      setTitle: function (title: string) {
25
-        title = title ? `${title}——${this.$defaultTitle}` : this.$defaultTitle;
26
-        document.title = title;
27
-      },
28
-      closeTag: (value: string) => {
29
-        const tag = value || store.getters.tag;
30
-        store.commit("DEL_TAG", tag);
31
-      },
32
-      // 关闭当前标签,并打开最后一个tag
33
-      openLastTag: (value: ITagType) => {
34
-        const tag = value || store.getters.tag;
35
-        store.commit("DEL_TAG", tag);
36
-        const tagList = store.getters.tagList;
37
-        const lastLen = tagList.length - 1;
38
-        const last = tagList[lastLen];
39
-        router.push({
40
-          path: last.value
41
-        });
42
-      },
43
-      // 处理路由
44
-      getPath: function (params: any) {
45
-        const { src } = params;
46
-        let result = src || "/";
47
-        if (src.includes("http") || src.includes("https")) {
48
-          result = `/myiframe/urlPath?${objToform(params)}`;
49
-        }
50
-        return result;
51
-      },
52
-      // 正则处理路由
53
-      vaildPath: function (list: any, path: any) {
54
-        let result = false;
55
-        list.forEach((ele: any) => {
56
-          if (new RegExp("^" + ele + ".*", "g").test(path)) {
57
-            result = true;
58
-          }
59
-        });
60
-        return result;
61
-      },
62
-      // 设置路由值
63
-      getValue: function (route: any) {
64
-        let value = "";
65
-        if (route.query.src) {
66
-          value = route.query.src;
67
-        } else {
68
-          value = route.path;
69
-        }
70
-        return value;
71
-      },
72
-      // 动态路由
73
-      formatRoutes: function (aMenu = [], first: any) {
74
-        const aRouter: any = [];
75
-        const propsConfig = this.$website.menu.props;
76
-        const propsDefault = {
77
-          label: propsConfig.label || "label",
78
-          path: propsConfig.path || "path",
79
-          icon: propsConfig.icon || "icon",
80
-          children: propsConfig.children || "children",
81
-          meta: propsConfig.meta || "meta"
82
-        };
83
-        if (aMenu.length === 0) return;
84
-        for (let i = 0; i < aMenu.length; i++) {
85
-          const oMenu: any = aMenu[i];
86
-          if (this.routerList.includes(oMenu[propsDefault.path])) return;
87
-          const path = (() => {
88
-            if (!oMenu[propsDefault.path]) {
89
-              return;
90
-            } else if (first) {
91
-              return oMenu[propsDefault.path].replace("/index", "");
92
-            } else {
93
-              return oMenu[propsDefault.path];
94
-            }
95
-          })();
96
-
97
-          // 特殊处理组件
98
-          const component = "views" + oMenu.path;
99
-
100
-          const name = oMenu[propsDefault.label];
101
-
102
-          const icon = oMenu[propsDefault.icon];
103
-
104
-          const children = oMenu[propsDefault.children];
105
-
106
-          const meta = {
107
-            keepAlive: Number(oMenu["keepAlive"]) === 1
108
-          };
109
-          const isChild = children.length !== 0;
110
-          const oRouter = {
111
-            path: path,
112
-            component(resolve: any) {
113
-              // 判断是否为首路由
114
-              if (first) {
115
-                require(["@/layout/index"], resolve);
116
-                // import("@/layout/index.vue");
117
-
118
-                // 判断是否为多层路由
119
-              } else if (isChild && !first) {
120
-                require(["@/layout/components/layout.vue"], resolve);
121
-                // import("@/layout/components/layout.vue");
122
-
123
-                // 判断是否为最终的页面视图
124
-              } else {
125
-                require([`@/${component}.vue`], resolve);
126
-                // import(`@/${component}.vue`);
127
-              }
128
-            },
129
-            name: name,
130
-            icon: icon,
131
-            meta: meta,
132
-            redirect: (() => {
133
-              if (!isChild && first && !isURL(path)) return `${path}/index`;
134
-              else return "";
135
-            })(),
136
-            // 处理是否为一级路由
137
-            children: !isChild
138
-              ? (() => {
139
-                  if (first) {
140
-                    if (!isURL(path)) oMenu[propsDefault.path] = `${path}/index`;
141
-                    return [
142
-                      {
143
-                        component(resolve: any) {
144
-                          require([`../${component}.vue`], resolve);
145
-                        },
146
-                        icon: icon,
147
-                        name: name,
148
-                        meta: meta,
149
-                        path: "index"
150
-                      }
151
-                    ];
152
-                  }
153
-                  return [];
154
-                })()
155
-              : (() => {
156
-                  return this.formatRoutes(children, false);
157
-                })()
158
-          };
159
-          aRouter.push(oRouter);
160
-        }
161
-        if (first) {
162
-          if (!this.routerList.includes(aRouter[0][propsDefault.path])) {
163
-            const addRoutes = (routes: any, parentName?: string) => {
164
-              routes.forEach((item: any) => {
165
-                if (parentName) {
166
-                  router.addRoute(parentName, item);
167
-                } else {
168
-                  router.addRoute(item);
169
-                }
170
-                if (item.children?.length > 0) {
171
-                  addRoutes(item.children, item.name);
172
-                }
173
-              });
174
-            };
175
-            addRoutes(aRouter);
176
-            this.routerList.push(aRouter[0][propsDefault.path]);
177
-          }
178
-        } else {
179
-          return aRouter;
180
-        }
181
-      }
182
-    };
183
-  }
184
-};

+ 0 - 95
src/router/index_静态路由.ts

@@ -1,95 +0,0 @@
1
-import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
2
-const layout = () => import("@/layout/index.vue");
3
-
4
-const routes: Array<RouteRecordRaw> = [
5
-  {
6
-    path: "/",
7
-    redirect: "/login"
8
-  },
9
-  {
10
-    path: "/login",
11
-    name: "login",
12
-    component: () => import("@/views/login/index.vue")
13
-  },
14
-  {
15
-    path: "/InformationFilling",
16
-    name: "InformationFilling",
17
-    redirect: "/InformationFilling/outWarehouseInfo",
18
-    component: layout,
19
-    children: [
20
-      {
21
-        path: "outWarehouseInfo",
22
-        name: "outWarehouseInfo",
23
-        component: () => import("@/views/InformationFilling/outWarehouseInfo/index.vue")
24
-      },
25
-      {
26
-        path: "enterWarehouseInfo",
27
-        name: "enterWarehouseInfo",
28
-        component: () => import("@/views/InformationFilling/enterWarehouseInfo/index.vue")
29
-      }
30
-    ]
31
-  },
32
-  {
33
-    path: "/InformationAudit",
34
-    name: "InformationAudit",
35
-    component: layout,
36
-    children: [
37
-      {
38
-        path: "outWarehouseAudit",
39
-        name: "outWarehouseAudit",
40
-        component: () => import("@/views/InformationAudit/outWarehouseAudit/index.vue")
41
-      },
42
-      {
43
-        path: "enterWarehouseAudit",
44
-        name: "enterWarehouseAudit",
45
-        component: () => import("@/views/InformationAudit/enterWarehouseAudit/index.vue")
46
-      }
47
-    ]
48
-  },
49
-  {
50
-    path: "/dataStatistics",
51
-    name: "dataStatistics",
52
-    component: layout,
53
-    children: [
54
-      {
55
-        path: "reliefMaterial",
56
-        name: "reliefMaterial",
57
-        component: () => import("@/views/dataStatistics/reliefMaterial/index.vue")
58
-      },
59
-      {
60
-        path: "floodPrevention",
61
-        name: "floodPrevention",
62
-        component: () => import("@/views/dataStatistics/floodPrevention/index.vue")
63
-      },
64
-      {
65
-        path: "droughtResistant",
66
-        name: "droughtResistant",
67
-        component: () => import("@/views/dataStatistics/droughtResistant/index.vue")
68
-      },
69
-      {
70
-        path: "emergencySupplies",
71
-        name: "emergencySupplies",
72
-        component: () => import("@/views/dataStatistics/emergencySupplies/index.vue")
73
-      }
74
-    ]
75
-  },
76
-  {
77
-    path: "/admin",
78
-    name: "权限管理",
79
-    component: layout,
80
-    children: [
81
-      {
82
-        path: "menu",
83
-        name: "菜单管理",
84
-        component: () => import("@/views/admin/menu/index.vue")
85
-      }
86
-    ]
87
-  }
88
-];
89
-
90
-const router = createRouter({
91
-  history: createWebHashHistory(),
92
-  routes
93
-});
94
-
95
-export default router;

+ 1 - 1
src/views/DataVisualization/detailPage/components/crkjl.vue

@@ -28,7 +28,7 @@
28 28
 </template>
29 29
 
30 30
 <script setup lang="ts">
31
-import { defineProps, onMounted, ref, reactive, toRefs, defineExpose } from "vue";
31
+import { onMounted, ref, reactive, toRefs } from "vue";
32 32
 import { getRecords } from "@/api/keshihua/detail";
33 33
 import { useRoute } from "vue-router";
34 34
 

+ 2 - 2
src/views/DataVisualization/detailPage/components/shjl.vue

@@ -62,7 +62,7 @@
62 62
 </template>
63 63
 
64 64
 <script setup lang="ts">
65
-import { reactive, toRefs, defineProps, onMounted, ref } from "vue";
65
+import { reactive, toRefs, onMounted, ref } from "vue";
66 66
 import { useRoute } from "vue-router";
67 67
 import { getLossRecord } from "@/api/keshihua/detail";
68 68
 
@@ -150,7 +150,7 @@ onMounted(() => {
150 150
   color: rgb(255, 255, 255);
151 151
 }
152 152
 
153
-::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td {
153
+:deep(.el-table--striped .el-table__body tr.el-table__row--striped td) {
154 154
   /* background: red; */
155 155
   backdrop-filter: blur(10px);
156 156
   background: transparent;

+ 1 - 1
src/views/DataVisualization/detailPage/components/wzcb.vue

@@ -12,7 +12,7 @@
12 12
 </template>
13 13
 
14 14
 <script setup lang="ts">
15
-import { defineProps, onMounted, ref } from "vue";
15
+import { onMounted, ref } from "vue";
16 16
 
17 17
 const props = defineProps({ msg: String });
18 18
 const tableData = [

+ 2 - 2
src/views/DataVisualization/detailPage/components/wzcbqk.vue

@@ -46,7 +46,7 @@
46 46
 </template>
47 47
 
48 48
 <script setup lang="ts">
49
-import { reactive, toRefs, defineProps, onMounted, ref } from "vue";
49
+import { reactive, toRefs, onMounted, ref } from "vue";
50 50
 import { getMaterial } from "@/api/keshihua/detail";
51 51
 import { useRoute } from "vue-router";
52 52
 
@@ -158,7 +158,7 @@ onMounted(() => {
158 158
   color: rgb(255, 255, 255);
159 159
 }
160 160
 
161
-::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td {
161
+:deep(.el-table--striped .el-table__body tr.el-table__row--striped td) {
162 162
   /* background: red; */
163 163
   backdrop-filter: blur(10px);
164 164
   background: transparent;

+ 171 - 162
src/views/DataVisualization/home/components/wzdyqk.vue

@@ -1,220 +1,224 @@
1 1
 <!-- 物资调用情况 -->
2 2
 
3 3
 <template>
4
-    <div class="box">
5
-        <div class="table">
6
-            <el-table highlight-current-row="false" class="eltable" stripe
7
-                :header-cell-style="{ background: 'transparent' }" :data="tableData"
8
-                style="width: 100%  ;height: 100%; border: none;  background: transparent;">
9
-                <el-table-column style="background: transparent; border: none;" fixed prop="date" label="省份名称" />
10
-                <el-table-column style="background: transparent; border: none;" prop="name" label="数量" />
11
-                <el-table-column style="background: transparent; border: none;" prop="state" label="价值(万元)" />
12
-            </el-table>
13
-        </div>
14
-        <div class="title">物资调用情况</div>
15
-        <el-select v-model="selectData" :teleported="false" popper-class="popperClass" class="select" size="small"
16
-            placeholder="请选择" style="width: 150px ; height: 21px;">
17
-            <el-option value="1" label="全部" />
18
-            <el-option value="2" label="被服" />
19
-            <el-option value="3" label="床具" />
20
-            <el-option value="4" label="帐篷" />
21
-            <el-option value="5" label="抢险物料" />
22
-            <el-option value="6" label="救生器材" />
23
-        </el-select>
24
-        <el-button size="small" class="Btnin" style="background: transparent;">调用</el-button>
25
-        <el-button size="small" class="Btnout" style="background: transparent;">调出</el-button>
4
+  <div class="box">
5
+    <div class="table">
6
+      <el-table
7
+        highlight-current-row="false"
8
+        class="eltable"
9
+        stripe
10
+        :header-cell-style="{ background: 'transparent' }"
11
+        :data="tableData"
12
+        style="width: 100%; height: 100%; border: none; background: transparent"
13
+      >
14
+        <el-table-column style="background: transparent; border: none" fixed prop="date" label="省份名称" />
15
+        <el-table-column style="background: transparent; border: none" prop="name" label="数量" />
16
+        <el-table-column style="background: transparent; border: none" prop="state" label="价值(万元)" />
17
+      </el-table>
26 18
     </div>
19
+    <div class="title">物资调用情况</div>
20
+    <el-select
21
+      v-model="selectData"
22
+      :teleported="false"
23
+      popper-class="popperClass"
24
+      class="select"
25
+      size="small"
26
+      placeholder="请选择"
27
+      style="width: 150px; height: 21px"
28
+    >
29
+      <el-option value="1" label="全部" />
30
+      <el-option value="2" label="被服" />
31
+      <el-option value="3" label="床具" />
32
+      <el-option value="4" label="帐篷" />
33
+      <el-option value="5" label="抢险物料" />
34
+      <el-option value="6" label="救生器材" />
35
+    </el-select>
36
+    <el-button size="small" class="Btnin" style="background: transparent">调用</el-button>
37
+    <el-button size="small" class="Btnout" style="background: transparent">调出</el-button>
38
+  </div>
27 39
 </template>
28 40
 
29 41
 <script setup lang="ts">
30 42
 import * as echarts from "echarts";
31 43
 import { onMounted, ref } from "vue";
32 44
 import header from "./header.vue";
33
-let selectData = ref('1')
45
+let selectData = ref("1");
34 46
 const tableData = [
35
-    {
36
-        date: '河北',
37
-        name: '4442',
38
-        state: '2222',
39
-    },
40
-    {
41
-        date: '河北',
42
-        name: '4442',
43
-        state: '2222',
44
-    },
45
-    {
46
-        date: '河北',
47
-        name: '4442',
48
-        state: '2222',
49
-    },
50
-    {
51
-        date: '河北',
52
-        name: '4442',
53
-        state: '2222',
54
-    },
55
-    {
56
-        date: '河北',
57
-        name: '4442',
58
-        state: '2222',
59
-    },
60
-    {
61
-        date: '河北',
62
-        name: '4442',
63
-        state: '2222',
64
-    },
65
-
66
-]
47
+  {
48
+    date: "河北",
49
+    name: "4442",
50
+    state: "2222"
51
+  },
52
+  {
53
+    date: "河北",
54
+    name: "4442",
55
+    state: "2222"
56
+  },
57
+  {
58
+    date: "河北",
59
+    name: "4442",
60
+    state: "2222"
61
+  },
62
+  {
63
+    date: "河北",
64
+    name: "4442",
65
+    state: "2222"
66
+  },
67
+  {
68
+    date: "河北",
69
+    name: "4442",
70
+    state: "2222"
71
+  },
72
+  {
73
+    date: "河北",
74
+    name: "4442",
75
+    state: "2222"
76
+  }
77
+];
67 78
 function Btnin() {
68
-    console.log('调用');
69
-
79
+  console.log("调用");
70 80
 }
71 81
 function Btnout() {
72
-    console.log('调出');
82
+  console.log("调出");
73 83
 }
74 84
 
75 85
 onMounted(() => {
76
-    //     window.addEventListener("resize", () => {
77
-    //     myChart.resize();
78
-    //   });
79
-})
86
+  //     window.addEventListener("resize", () => {
87
+  //     myChart.resize();
88
+  //   });
89
+});
80 90
 </script>
81 91
 
82 92
 <style scoped>
83 93
 .btn {
84
-    width: 10%;
85
-    height: 10%;
86
-    /* background: pink; */
87
-    position: absolute;
88
-    border: 1px solid rgba(255, 255, 255, 0.2);
89
-    border-radius: 3px;
90
-    color: white;
91
-    text-align: center;
92
-
93
-    font-size: 12px;
94
+  width: 10%;
95
+  height: 10%;
96
+  /* background: pink; */
97
+  position: absolute;
98
+  border: 1px solid rgba(255, 255, 255, 0.2);
99
+  border-radius: 3px;
100
+  color: white;
101
+  text-align: center;
94 102
 
103
+  font-size: 12px;
95 104
 }
96 105
 
97 106
 .Btnin {
98
-    position: absolute;
99
-    right: 40%;
100
-    top: 20%;
101
-    color: white;
102
-    border: 1px solid rgba(255, 255, 255, 0.2);
107
+  position: absolute;
108
+  right: 40%;
109
+  top: 20%;
110
+  color: white;
111
+  border: 1px solid rgba(255, 255, 255, 0.2);
103 112
 }
104 113
 
105 114
 .Btnout {
106
-    position: absolute;
107
-    right: 28%;
108
-    top: 20%;
109
-    color: white;
110
-    border: 1px solid rgba(255, 255, 255, 0.2);
115
+  position: absolute;
116
+  right: 28%;
117
+  top: 20%;
118
+  color: white;
119
+  border: 1px solid rgba(255, 255, 255, 0.2);
111 120
 }
112 121
 
113 122
 :deep(.select .el-select-dropdown) {
114
-    background: rgba(132, 159, 228, 0.2) !important;
115
-
123
+  background: rgba(132, 159, 228, 0.2) !important;
116 124
 }
117 125
 
118 126
 :deep(.select .el-select-dropdown .el-select-dropdown__item) {
119
-    /* background: rgba(12,21,44,0.2); */
127
+  /* background: rgba(12,21,44,0.2); */
120 128
 }
121 129
 
122 130
 .el-select-dropdown__item.selected,
123 131
 .el-select-dropdown__item:hover,
124 132
 .el-select-dropdown__item.hover {
125
-    color: #fff;
126
-    background: #409EFF;
133
+  color: #fff;
134
+  background: #409eff;
127 135
 }
128 136
 
129 137
 .select {
130
-    position: absolute;
131
-    left: 14%;
132
-    top: 20%;
133
-    /* height: 10%; */
138
+  position: absolute;
139
+  left: 14%;
140
+  top: 20%;
141
+  /* height: 10%; */
134 142
 }
135 143
 
136 144
 :deep(.el-popper.is-light) {
137
-    background: #307cbf;
138
-    border: 1px solid #273f70;
145
+  background: #307cbf;
146
+  border: 1px solid #273f70;
139 147
 }
140 148
 
141 149
 :deep(.el-select-dropdown__item.hover) {
142
-    background: transparent;
143
-    border: none;
144
-    color: #04FAA0;
150
+  background: transparent;
151
+  border: none;
152
+  color: #04faa0;
145 153
 }
146 154
 
147
-
148 155
 :deep(.el-select-dropdown__item) {
149
-    background: transparent;
150
-    border: none;
151
-    color: #fff;
156
+  background: transparent;
157
+  border: none;
158
+  color: #fff;
152 159
 }
153 160
 
154 161
 :deep(.el-popper.is-light .el-popper__arrow::before) {
155
-    border: 1px solid #4778d9;
156
-    background: #4778d9;
157
-    right: 0;
162
+  border: 1px solid #4778d9;
163
+  background: #4778d9;
164
+  right: 0;
158 165
 }
159 166
 
160 167
 :deep(.el-select__wrapper) {
161
-    /* position: absolute; */
162
-    /* width: 50%; */
163
-    /* height: 4%; */
164
-    /* left: 20%;
168
+  /* position: absolute; */
169
+  /* width: 50%; */
170
+  /* height: 4%; */
171
+  /* left: 20%;
165 172
     top:; */
166
-    background: transparent !important;
167
-    border: rgba(255, 255, 255, 0.2) 1px solid !important;
168
-    box-shadow: none;
169
-
173
+  background: transparent !important;
174
+  border: rgba(255, 255, 255, 0.2) 1px solid !important;
175
+  box-shadow: none;
170 176
 }
171 177
 
172 178
 .box {
173
-    width: 100%;
174
-    height: 100%;
175
-    position: relative;
179
+  width: 100%;
180
+  height: 100%;
181
+  position: relative;
176 182
 }
177 183
 
178 184
 .box .table {
179
-    position: absolute;
180
-    bottom: 6%;
181
-    left: 14%;
182
-    width: 80%;
183
-    height: 67%;
184
-    /* background: pink; */
185
-    z-index: 22;
186
-    background-color: transparent;
185
+  position: absolute;
186
+  bottom: 6%;
187
+  left: 14%;
188
+  width: 80%;
189
+  height: 67%;
190
+  /* background: pink; */
191
+  z-index: 22;
192
+  background-color: transparent;
187 193
 }
188 194
 
189
-
190 195
 .title {
191
-    font-size: 20px;
192
-    color: red;
193
-    position: absolute;
194
-    left: 14%;
195
-    top: 6%;
196
-    font-weight: 700;
197
-    background: linear-gradient(to bottom, #ffffff, rgb(29, 233, 234));
198
-    -webkit-background-clip: text;
199
-    -webkit-text-fill-color: transparent;
196
+  font-size: 20px;
197
+  color: red;
198
+  position: absolute;
199
+  left: 14%;
200
+  top: 6%;
201
+  font-weight: 700;
202
+  background: linear-gradient(to bottom, #ffffff, rgb(29, 233, 234));
203
+  -webkit-background-clip: text;
204
+  -webkit-text-fill-color: transparent;
200 205
 }
201 206
 
202 207
 .el-table {
203
-    background: transparent;
208
+  background: transparent;
204 209
 }
205 210
 
206 211
 :deep(.el-table) {
207
-    background: transparent;
212
+  background: transparent;
208 213
 }
209 214
 
210 215
 /*最外层透明*/
211 216
 :deep(.el-table),
212 217
 :deep(.el-table__expanded-cell) {
213
-    background-color: transparent;
214
-    color: rgba(255, 255, 255, 0.5);
215
-    opacity: 0.8;
216
-    font-size: 12px;
217
-
218
+  background-color: transparent;
219
+  color: rgba(255, 255, 255, 0.5);
220
+  opacity: 0.8;
221
+  font-size: 12px;
218 222
 }
219 223
 
220 224
 /* :deep(.el-table__body tr.current-row>td.el-table__cell ){
@@ -227,57 +231,62 @@ onMounted(() => {
227 231
 :deep(.el-table th),
228 232
 :deep(.el-table tr),
229 233
 :deep(.el-table td) {
230
-    background-color: transparent;
231
-    color: rgb(255, 255, 255);
234
+  background-color: transparent;
235
+  color: rgb(255, 255, 255);
232 236
 }
233 237
 
234
-::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td {
235
-    /* background: red; */
236
-    backdrop-filter: blur(10px);
237
-    background: rgba(34, 62, 165, 0.3);
238
+:deep(.el-table--striped .el-table__body tr.el-table__row--striped td) {
239
+  /* background: red; */
240
+  backdrop-filter: blur(10px);
241
+  background: rgba(34, 62, 165, 0.3);
238 242
 }
239 243
 
240
-:deep(.el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf, .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf) {
241
-    border: none !important;
244
+:deep(
245
+    .el-table td.el-table__cell,
246
+    .el-table th.el-table__cell.is-leaf,
247
+    .el-table td.el-table__cell,
248
+    .el-table th.el-table__cell.is-leaf
249
+  ) {
250
+  border: none !important;
242 251
 }
243 252
 
244 253
 :deep(.el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf) {
245
-    border: none !important;
254
+  border: none !important;
246 255
 }
247 256
 
248
-.el-table tbody tr:hover>td {
249
-    background-color: transparent !important
257
+.el-table tbody tr:hover > td {
258
+  background-color: transparent !important;
250 259
 }
251 260
 
252
-.el-table__body tr.hover-row.current-row>td.el-table__cell,
253
-.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,
254
-.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,
255
-.el-table__body tr.hover-row>td.el-table__cell {
256
-    background-color: transparent !important;
261
+.el-table__body tr.hover-row.current-row > td.el-table__cell,
262
+.el-table__body tr.hover-row.el-table__row--striped.current-row > td.el-table__cell,
263
+.el-table__body tr.hover-row.el-table__row--striped > td.el-table__cell,
264
+.el-table__body tr.hover-row > td.el-table__cell {
265
+  background-color: transparent !important;
257 266
 }
258 267
 
259 268
 :deep(.el-table tbody tr:hover > td) {
260
-    background-color: transparent !important
269
+  background-color: transparent !important;
261 270
 }
262 271
 
263 272
 .el-table td.el-table__cell,
264 273
 .el-table th.el-table__cell.is-leaf {
265
-    border-bottom: none;
274
+  border-bottom: none;
266 275
 }
267 276
 
268 277
 :deep(.el-table_row > td) {
269
-    border: non;
278
+  border: non;
270 279
 }
271 280
 
272 281
 :deep(.el-table) {
273
-    --el-table-border-color: transparent;
282
+  --el-table-border-color: transparent;
274 283
 }
275 284
 
276 285
 :deep(.el-table--striped .el-table__body tr.el-table__row--striped.current-row td.el-table__cell) {
277
-    background-color: transparent !important;
286
+  background-color: transparent !important;
278 287
 }
279 288
 
280 289
 :deep(.el-table__body tr.current-row > td.el-table__cell) {
281
-    background-color: transparent !important;
290
+  background-color: transparent !important;
282 291
 }
283
-</style>
292
+</style>

+ 4 - 4
src/views/InformationAudit/outWarehouseAudit/detail.vue

@@ -105,7 +105,7 @@ import { Search } from "@element-plus/icons-vue";
105 105
 import { ElMessage, ElMessageBox } from "element-plus";
106 106
 import { useRouter, useRoute } from "vue-router";
107 107
 import { useDict } from "@/hooks/dict";
108
-// import { closeTagAndOpenLastTag } from '@/router/Routermethods';
108
+import { closeTagAndOpenLastTag } from "@/router/Routermethods";
109 109
 import store from "@/store";
110 110
 
111 111
 const { outdound_type, is_available, province_ch } = useDict("outdound_type", "is_available", "province_ch");
@@ -209,9 +209,9 @@ const handleReturn = () => {
209 209
 };
210 210
 // 返回
211 211
 const handleBack = () => {
212
-  store.commit("DEL_TAG", store.getters.tag);
213
-  router.push("/InformationAudit/outWarehouseAudit");
214
-  // closeTagAndOpenLastTag()
212
+  // store.commit("DEL_TAG", store.getters.tag);
213
+  // router.push("/InformationAudit/outWarehouseAudit");
214
+  closeTagAndOpenLastTag();
215 215
 };
216 216
 
217 217
 // 附件相关

+ 72 - 27
src/views/admin/dept/index.vue

@@ -58,7 +58,7 @@
58 58
       /> -->
59 59
 
60 60
       <el-dialog v-model="dialogVisible" :title="title" width="50%" :before-close="dialogClose">
61
-        <el-form :model="form" ref="formRef" :rules="formRules" label-width="80px">
61
+        <el-form :model="form" ref="formRef" :rules="formRules" label-width="80px" class="whole_form">
62 62
           <el-row>
63 63
             <el-col :span="8">
64 64
               <el-form-item label="上级部门" prop="parentId">
@@ -74,6 +74,18 @@
74 74
           </el-row>
75 75
           <el-row>
76 76
             <el-col :span="12">
77
+              <el-form-item label="法人信息">
78
+                <el-input v-model="form.legalPerson" placeholder="请输入负责人" clearable />
79
+              </el-form-item>
80
+            </el-col>
81
+            <el-col :span="12">
82
+              <el-form-item label="联系电话">
83
+                <el-input v-model="form.deptPhone" placeholder="请输入联系电话" clearable />
84
+              </el-form-item>
85
+            </el-col>
86
+          </el-row>
87
+          <el-row>
88
+            <el-col :span="12">
77 89
               <el-form-item label="部门名称" prop="name">
78 90
                 <el-input v-model="form.name" placeholder="请输入部门名称" clearable />
79 91
               </el-form-item>
@@ -94,6 +106,26 @@
94 106
             </el-col>
95 107
           </el-row>
96 108
           <el-row>
109
+            <el-col :span="24">
110
+              <el-form-item label="地址">
111
+                <el-cascader
112
+                  clearable
113
+                  v-model="form.deptMergeAddress"
114
+                  placeholder="请选择"
115
+                  :options="addressOption"
116
+                  :props="{ value: 'code', label: 'name' }"
117
+                />
118
+              </el-form-item>
119
+            </el-col>
120
+          </el-row>
121
+          <el-row>
122
+            <el-col :span="24">
123
+              <el-form-item label="详细地址">
124
+                <el-input v-model="form.deptAddress" placeholder="请输入详细地址" clearable />
125
+              </el-form-item>
126
+            </el-col>
127
+          </el-row>
128
+          <el-row>
97 129
             <el-col :span="12">
98 130
               <el-form-item label="经度" prop="longitude">
99 131
                 <el-input v-model="form.longitude" placeholder="请输入部门经度" clearable />
@@ -114,19 +146,8 @@
114 146
               </el-form-item>
115 147
             </el-col>
116 148
           </el-row>
117
-          <!-- <el-row>
118
-            <el-col :span="8">
119
-              <el-form-item label="负责人">
120
-                <el-input v-model="form.roleDesc" placeholder="请输入角色描述" clearable />
121
-              </el-form-item>
122
-            </el-col>
123
-          </el-row>
149
+          <!--
124 150
           <el-row>
125
-            <el-col :span="24">
126
-              <el-form-item label="联系电话">
127
-                <el-input v-model="form.roleDesc" placeholder="请输入角色描述" clearable />
128
-              </el-form-item>
129
-            </el-col>
130 151
           </el-row>
131 152
           <el-row>
132 153
             <el-col :span="24">
@@ -149,6 +170,11 @@
149 170
               </el-form-item>
150 171
             </el-col>
151 172
           </el-row>
173
+          <el-row>
174
+            <el-col :span="24">
175
+              <uploadFile title="库区图" v-model:fileList="form.fileList" />
176
+            </el-col>
177
+          </el-row>
152 178
         </el-form>
153 179
         <template #footer>
154 180
           <el-row class="btn_center">
@@ -163,6 +189,8 @@
163 189
 </template>
164 190
 
165 191
 <script setup lang="ts">
192
+import uploadFile from "@/components/uploadFile/index.vue";
193
+
166 194
 import { nextTick, ref } from "vue";
167 195
 import { ElMessage, ElMessageBox } from "element-plus";
168 196
 import type { FormInstance, FormRules } from "element-plus";
@@ -171,6 +199,7 @@ import { Search, EditPen, Plus, Edit, Delete } from "@element-plus/icons-vue";
171 199
 import { useDict } from "@/hooks/dict";
172 200
 import { ITablePage } from "@/const/interface_type";
173 201
 import { timestampToTime, getValueLabel, getValueListLabel } from "@/utils/util";
202
+import { getAddress } from "@/api/basicInfo/index";
174 203
 import { getDeptList, getDeptObj, addDeptObj, putDeptObj, delDeptObj } from "@/api/admin";
175 204
 
176 205
 interface ISearchList {
@@ -194,11 +223,12 @@ const form = ref<any>({
194 223
   parentId: "",
195 224
   name: "",
196 225
   abbreviationName: "",
197
-  sortOrder: "",
226
+  sortOrder: undefined,
198 227
   deptType: "",
199 228
   longitude: "",
200 229
   dimension: "",
201
-  warehouseType: []
230
+  warehouseType: [],
231
+  fileList: []
202 232
 });
203 233
 const formRef = ref<FormInstance>();
204 234
 const formRules = ref<FormRules>({
@@ -207,10 +237,18 @@ const formRules = ref<FormRules>({
207 237
   deptType: [{ required: true, message: "部门类型不能为空", trigger: "change" }],
208 238
   sortOrder: [{ required: true, message: "请选择排序", trigger: "blur" }]
209 239
 });
240
+
241
+const addressOption = ref([]); // 地址
210 242
 const deptOptions = ref<any>([]); // 部门目录
211 243
 
212 244
 const { dept_type, del_type, warehouse_type } = useDict("dept_type", "del_type", "warehouse_type");
213 245
 
246
+getAddress().then((res: any) => {
247
+  if (res.code === 0) {
248
+    addressOption.value = res.data;
249
+  }
250
+});
251
+
214 252
 // 搜索/获取列表
215 253
 const getList = () => {
216 254
   tableLoading.value = true;
@@ -285,15 +323,25 @@ const filterList = (arr: any) => {
285 323
   return filterData;
286 324
 };
287 325
 
326
+// 处理参数
327
+const trimParam = () => {
328
+  const data = {
329
+    ...form.value
330
+  };
331
+  data.warehouseType = data.warehouseType ? JSON.stringify(data.warehouseType) : "[]";
332
+  data.deptProvince = data.deptMergeAddress[0];
333
+  data.deptCity = data.deptMergeAddress[1];
334
+  data.deptArea = data.deptMergeAddress[2];
335
+  data.deptMergeAddress = JSON.stringify(data.deptMergeAddress);
336
+  data.fileList = JSON.stringify(data.fileList);
337
+  return data;
338
+};
339
+
288 340
 // 保存添加
289 341
 const addDept = () => {
290 342
   formRef.value?.validate((valid: boolean) => {
291 343
     if (valid) {
292
-      const data = {
293
-        ...form.value
294
-      };
295
-      data.warehouseType = data.warehouseType ? JSON.stringify(data.warehouseType) : "[]";
296
-      addDeptObj(data).then((res: any) => {
344
+      addDeptObj(trimParam()).then((res: any) => {
297 345
         if (res.code === 0) {
298 346
           ElMessage.success("创建成功");
299 347
           clearDialogData();
@@ -311,11 +359,7 @@ const addDept = () => {
311 359
 const saveDept = () => {
312 360
   formRef.value?.validate((valid: boolean) => {
313 361
     if (valid) {
314
-      const data = {
315
-        ...form.value
316
-      };
317
-      data.warehouseType = data.warehouseType ? JSON.stringify(data.warehouseType) : "[]";
318
-      putDeptObj(data).then((res: any) => {
362
+      putDeptObj(trimParam()).then((res: any) => {
319 363
         if (res.code === 0) {
320 364
           ElMessage.success("编辑成功");
321 365
           clearDialogData();
@@ -357,11 +401,12 @@ const clearDialogData = () => {
357 401
   form.value = {
358 402
     parentId: "",
359 403
     name: "",
360
-    sortOrder: "",
404
+    sortOrder: undefined,
361 405
     deptType: "",
362 406
     longitude: "",
363 407
     dimension: "",
364
-    warehouseType: []
408
+    warehouseType: [],
409
+    fileList: []
365 410
   };
366 411
   formRef.value?.clearValidate();
367 412
 };

+ 53 - 59
src/views/basic/basicIndex/index.vue

@@ -42,13 +42,14 @@
42 42
                 v-model="ruleForm.name"
43 43
                 placeholder="请选择"
44 44
                 :options="addressOption"
45
-                :props="{ value: 'code',label: 'name' }"
45
+                :props="{ value: 'code', label: 'name' }"
46 46
                 style="width: 100%"
47
-                @change="handleChange"></el-cascader>
48
-              </el-col>
49
-              <el-col :span="12">
50
-                <el-input v-model="ruleForm.deptAddress" />
51
-              </el-col>
47
+                @change="handleChange"
48
+              ></el-cascader>
49
+            </el-col>
50
+            <el-col :span="12">
51
+              <el-input v-model="ruleForm.deptAddress" />
52
+            </el-col>
52 53
           </el-form-item>
53 54
         </el-col>
54 55
         <el-col :span="12">
@@ -87,87 +88,80 @@
87 88
 </template>
88 89
 
89 90
 <script setup lang="ts">
90
-import { reactive, ref } from 'vue'
91
-import type { FormInstance, FormRules } from 'element-plus'
92
-import { Plus } from '@element-plus/icons-vue'
91
+import { reactive, ref } from "vue";
92
+import type { FormInstance, FormRules } from "element-plus";
93
+import { Plus } from "@element-plus/icons-vue";
93 94
 import { getAddress, deptDetail } from "@/api/basicInfo/index";
94
-import type { UploadProps } from 'element-plus'
95
-import { useDict } from '@/hooks/dict';
96
-const { warehouse_type } = useDict('warehouse_type');
95
+import type { UploadProps } from "element-plus";
96
+import { useDict } from "@/hooks/dict";
97
+const { warehouse_type } = useDict("warehouse_type");
97 98
 
98 99
 //附件部分
99
-const myHeader = { Authorization: "Bearer " + sessionStorage.getItem("access_token") }
100
-const fileUrl = "/admin/sysFile/uploadVoucher"
100
+const myHeader = { Authorization: "Bearer " + sessionStorage.getItem("access_token") };
101
+const fileUrl = "/admin/sysFile/uploadVoucher";
101 102
 let paramsData = reactive({
102 103
   bucket: "bound"
103 104
 });
104
-const formSize = ref('default')
105
-const ruleFormRef = ref<FormInstance>()
106
-const ruleForm = ref({})
107
-
105
+const formSize = ref("default");
106
+const ruleFormRef = ref<FormInstance>();
107
+const ruleForm = ref({});
108 108
 
109 109
 const submitForm = async (formEl: FormInstance | undefined) => {
110
-  if (!formEl) return
110
+  if (!formEl) return;
111 111
   await formEl.validate((valid, fields) => {
112 112
     if (valid) {
113
-      console.log('submit!')
113
+      console.log("submit!");
114 114
     } else {
115
-      console.log('error submit!', fields)
115
+      console.log("error submit!", fields);
116 116
     }
117
-  })
118
-}
119
-const addressOption = ref([])
117
+  });
118
+};
119
+const addressOption = ref([]);
120 120
 const createdMth = async () => {
121 121
   getAddress().then((res: any) => {
122 122
     if (res.code === 0) {
123
-      addressOption.value = res.data
123
+      addressOption.value = res.data;
124 124
     }
125 125
   });
126
-  const deptId = JSON.parse(sessionStorage.getItem("userInfo")).deptId
127
-  let deptData = await deptDetail(deptId)
128
-  ruleForm.value = deptData.data
129
-  if(deptData.data.parentId != '0'){
130
-    let parentDept = await deptDetail(deptData.data.parentId)
131
-    ruleForm.value.gljg = parentDept.data.abbreviationName
126
+  const deptId = JSON.parse(sessionStorage.getItem("userInfo")).deptId;
127
+  let deptData = await deptDetail(deptId);
128
+  ruleForm.value = deptData.data;
129
+  if (deptData.data.parentId != "0") {
130
+    let parentDept = await deptDetail(deptData.data.parentId);
131
+    ruleForm.value.gljg = parentDept.data.abbreviationName;
132 132
   }
133
-
134
-
135
-}
136
-createdMth()
133
+};
134
+createdMth();
137 135
 const handleChange = (value) => {
138
-  console.log(JSON.stringify(value))
139
-}
136
+  console.log(JSON.stringify(value));
137
+};
140 138
 const resetForm = (formEl: FormInstance | undefined) => {
141
-  if (!formEl) return
142
-  formEl.resetFields()
143
-}
139
+  if (!formEl) return;
140
+  formEl.resetFields();
141
+};
144 142
 
145 143
 const options = Array.from({ length: 10000 }).map((_, idx) => ({
146 144
   value: `${idx + 1}`,
147
-  label: `${idx + 1}`,
148
-}))
145
+  label: `${idx + 1}`
146
+}));
149 147
 
150 148
 /*----------------------库区图-----------------*/
151
-const imageUrl = ref('')
149
+const imageUrl = ref("");
152 150
 
153
-const handleAvatarSuccess: UploadProps['onSuccess'] = (
154
-  response,
155
-  uploadFile
156
-) => {
157
-  imageUrl.value = URL.createObjectURL(uploadFile.raw!)
158
-}
151
+const handleAvatarSuccess: UploadProps["onSuccess"] = (response, uploadFile) => {
152
+  imageUrl.value = URL.createObjectURL(uploadFile.raw!);
153
+};
159 154
 
160
-const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
161
-  if (rawFile.type !== 'image/jpeg') {
162
-    ElMessage.error('Avatar picture must be JPG format!')
163
-    return false
155
+const beforeAvatarUpload: UploadProps["beforeUpload"] = (rawFile) => {
156
+  if (rawFile.type !== "image/jpeg") {
157
+    ElMessage.error("Avatar picture must be JPG format!");
158
+    return false;
164 159
   } else if (rawFile.size / 1024 / 1024 > 2) {
165
-    ElMessage.error('Avatar picture size can not exceed 2MB!')
166
-    return false
160
+    ElMessage.error("Avatar picture size can not exceed 2MB!");
161
+    return false;
167 162
   }
168
-  return true
169
-}
170
-
163
+  return true;
164
+};
171 165
 </script>
172 166
 
173 167
 <style lang="scss" scoped>
@@ -203,4 +197,4 @@ const beforeAvatarUpload: UploadProps['beforeUpload'] = (rawFile) => {
203 197
   height: 178px;
204 198
   text-align: center;
205 199
 }
206
-</style>
200
+</style>

+ 0 - 142
src/views/dataStatistics/floodPrevention/index.vue

@@ -1,142 +0,0 @@
1
-<!-- 防汛物资储备价值表 -->
2
-<template>
3
-  <basic-container>
4
-    <el-form class="whole_form">
5
-      <el-row :gutter="20">
6
-        <el-col :span="8">
7
-          <el-form-item label="省份">
8
-            <el-input />
9
-          </el-form-item>
10
-        </el-col>
11
-        <el-col :span="8">
12
-          <el-form-item label="物资分类">
13
-            <el-input />
14
-          </el-form-item>
15
-        </el-col>
16
-        <el-col :span="8">
17
-          <el-button type="primary">搜索</el-button>
18
-          <el-button>清空</el-button>
19
-        </el-col>
20
-      </el-row>
21
-    </el-form>
22
-
23
-    <el-table :data="tableData" stripe border :span-method="arraySpanMethod">
24
-      <el-table-column type="index" label="序号" header-align="center" align="center" />
25
-      <el-table-column prop="upidName" label="省份" header-align="center" align="center" />
26
-      <el-table-column prop="username" label="储备仓库" header-align="center" align="center" />
27
-      <template v-for="item in headerName" :key="item">
28
-        <el-table-column :label="item.dmUpname" header-align="center" align="center">
29
-          <template v-for="iten in item.children" :key="iten">
30
-            <el-table-column :label="iten.dmUpname" header-align="center" align="center">
31
-              <el-table-column :prop="iten.dmUpcode" :label="iten.units" header-align="center" align="center" />
32
-            </el-table-column>
33
-          </template>
34
-        </el-table-column>
35
-      </template>
36
-      <el-table-column prop="" label="汇总" header-align="center" align="center" />
37
-      <el-table-column prop="" label="实际库存汇总" header-align="center" align="center" />
38
-    </el-table>
39
-  </basic-container>
40
-</template>
41
-
42
-<script setup lang="ts">
43
-import { ref } from "vue";
44
-
45
-import { handleTree } from "@/utils/util";
46
-import { getDroughtResistantList, getDroughtResistantHeader } from "@/api/dataStatistics/index";
47
-
48
-const headerName: any = ref([]);
49
-const headerProps: any = ref([]);
50
-const tableData: any = ref([]);
51
-const mergeObj: any = ref({});
52
-
53
-// getSpanArr方法
54
-const getSpanArr = (data: any) => {
55
-  headerProps.value.forEach((key: any) => {
56
-    let count = 0; // 用来记录需要合并行的起始位置
57
-    mergeObj.value[key] = []; // 记录每一列的合并信息
58
-    data.forEach((item: any, index: number) => {
59
-      // index == 0表示数据为第一行,直接 push 一个 1
60
-      if (index === 0) {
61
-        mergeObj.value[key].push(1);
62
-      } else {
63
-        // 判断当前行是否与上一行其值相等 如果相等 在 count 记录的位置其值 +1 表示当前行需要合并 并push 一个 0 作为占位
64
-        if (item[key] === data[index - 1][key]) {
65
-          mergeObj.value[key][count] += 1;
66
-          mergeObj.value[key].push(0);
67
-        } else {
68
-          // 如果当前行和上一行其值不相等
69
-          count = index; // 记录当前位置
70
-          mergeObj.value[key].push(1); // 重新push 一个 1
71
-        }
72
-      }
73
-    });
74
-  });
75
-};
76
-
77
-// 获取表格数据
78
-const getList = () => {
79
-  getDroughtResistantList({}).then((res: any) => {
80
-    if (res.code === 0) {
81
-      tableData.value = res.data
82
-        .map((item: any) => {
83
-          item.map.upidName = item.upidName;
84
-          item.map.username = item.username;
85
-          return item.map;
86
-        })
87
-        .filter((item: any) => {
88
-          headerProps.value.filter((ite: any) => {
89
-            if (!item[ite]) {
90
-              item[ite] = 0;
91
-            }
92
-          });
93
-          return item;
94
-        });
95
-      setTimeout(() => {
96
-        getSpanArr(tableData.value);
97
-      }, 300);
98
-    }
99
-  });
100
-};
101
-
102
-// 获取表头数据
103
-getDroughtResistantHeader({
104
-  dmUpcode0: "100"
105
-}).then((res: any) => {
106
-  if (res.code === 0) {
107
-    res.data
108
-      .map((item: any) => {
109
-        const parent = {
110
-          dmUpcode: item.dmUpcode1,
111
-          dmUpname: item.dmUpname1
112
-        };
113
-        const own = {
114
-          dmUpcode: item.dmUpcode2,
115
-          dmUpname: item.dmUpname2,
116
-          units: item.dmUpname3
117
-        };
118
-        return [parent, own];
119
-      })
120
-      .forEach((item: any) => {
121
-        headerName.value.push(...item);
122
-      });
123
-    headerName.value = handleTree(headerName.value, "dmUpcode");
124
-    headerProps.value = res.data.map((item: any) => item.dmUpcode2);
125
-    headerProps.value.unshift("upidName", "username");
126
-  }
127
-  getList();
128
-});
129
-
130
-const arraySpanMethod = ({ row, column, rowIndex, columnIndex }: any) => {
131
-  // 判断列的属性
132
-  if (headerProps.value.indexOf(column.property) !== -1) {
133
-    // 判断其值是不是为0
134
-    if (mergeObj.value[column.property][rowIndex]) {
135
-      return [mergeObj.value[column.property][rowIndex], 1];
136
-    } else {
137
-      // 如果为0则为需要合并的行
138
-      return [0, 0];
139
-    }
140
-  }
141
-};
142
-</script>

+ 9 - 1
vue.config.js

@@ -21,7 +21,7 @@ module.exports = defineConfig({
21 21
         }
22 22
       },
23 23
       "/api": {
24
-        target: 'http://192.168.1.108:8083',
24
+        target: "http://192.168.1.108:8083",
25 25
         ws: true,
26 26
         changeOrigin: true,
27 27
         pathRewrite: {
@@ -32,5 +32,13 @@ module.exports = defineConfig({
32 32
   },
33 33
   chainWebpack: (config) => {
34 34
     config.resolve.alias.set("@", path.resolve(__dirname, "src"));
35
+    config.plugin("define").tap((definitions) => {
36
+      Object.assign(definitions[0], {
37
+        __VUE_OPTIONS_API__: "true",
38
+        __VUE_PROD_DEVTOOLS__: false,
39
+        __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
40
+      });
41
+      return definitions;
42
+    });
35 43
   }
36 44
 });