allen преди 11 месеца
родител
ревизия
bea91236f1
променени са 3 файла, в които са добавени 104 реда и са изтрити 45 реда
  1. 1 1
      pdaaphm-admin/src/main/resources/application.yml
  2. 1 0
      pdaaphm-ui/package.json
  3. 102 44
      pdaaphm-ui/src/views/system/data/index.vue

+ 1 - 1
pdaaphm-admin/src/main/resources/application.yml

@@ -20,7 +20,7 @@ ruoyi:
 # 开发环境配置
 server:
   # 服务器的HTTP端口,默认为8080
-  port: 8080
+  port: 8088
   servlet:
     # 应用的访问路径
     context-path: /

+ 1 - 0
pdaaphm-ui/package.json

@@ -50,6 +50,7 @@
     "jsencrypt": "3.0.0-rc.1",
     "nprogress": "0.2.0",
     "papaparse": "^5.4.1",
+    "pdaaphm": "file:",
     "quill": "1.3.7",
     "screenfull": "5.0.2",
     "sortablejs": "1.10.2",

+ 102 - 44
pdaaphm-ui/src/views/system/data/index.vue

@@ -1,6 +1,13 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
       <el-form-item label="数据名称" prop="dataName">
         <el-input
           v-model="queryParams.dataName"
@@ -10,7 +17,11 @@
         />
       </el-form-item>
       <el-form-item label="数据类型" prop="dataType">
-        <el-select v-model="queryParams.dataType" placeholder="请选择数据类型" clearable>
+        <el-select
+          v-model="queryParams.dataType"
+          placeholder="请选择数据类型"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.biz_data_type"
             :key="dict.value"
@@ -20,8 +31,16 @@
         </el-select>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
@@ -34,7 +53,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['system:data:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -45,7 +65,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['system:data:edit']"
-        >修改</el-button>
+          >修改</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -56,7 +77,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['system:data:remove']"
-        >删除</el-button>
+          >删除</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -66,23 +88,38 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['system:data:export']"
-        >导出</el-button>
+          >导出</el-button
+        >
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
+    <el-table
+      v-loading="loading"
+      :data="dataList"
+      @selection-change="handleSelectionChange"
+    >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
       <el-table-column label="数据名称" align="center" prop="dataName" />
       <el-table-column label="数据类型" align="center" prop="dataType">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.biz_data_type" :value="scope.row.dataType"/>
+          <dict-tag
+            :options="dict.type.biz_data_type"
+            :value="scope.row.dataType"
+          />
         </template>
       </el-table-column>
       <el-table-column label="数据路径" align="center" prop="dataPath" />
       <el-table-column label="备注" align="center" prop="remark" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -90,20 +127,22 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['system:data:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['system:data:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -122,14 +161,19 @@
               v-for="dict in dict.type.biz_data_type"
               :key="dict.value"
               :label="dict.value"
-            >{{dict.label}}</el-radio>
+              >{{ dict.label }}</el-radio
+            >
           </el-radio-group>
         </el-form-item>
         <el-form-item label="数据路径" prop="dataPath">
-          <el-input v-model="form.dataPath" type="textarea" placeholder="请输入内容" />
+          <file-upload v-model="form.dataPath" />
         </el-form-item>
         <el-form-item label="备注" prop="remark">
-          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
+          <el-input
+            v-model="form.remark"
+            type="textarea"
+            placeholder="请输入内容"
+          />
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -141,11 +185,17 @@
 </template>
 
 <script>
-import { listData, getData, delData, addData, updateData } from "@/api/system/data";
+import {
+  listData,
+  getData,
+  delData,
+  addData,
+  updateData,
+} from "@/api/system/data";
 
 export default {
   name: "Data",
-  dicts: ['biz_data_type'],
+  dicts: ["biz_data_type"],
   data() {
     return {
       // 遮罩层
@@ -179,9 +229,9 @@ export default {
       // 表单校验
       rules: {
         dataType: [
-          { required: true, message: "数据类型不能为空", trigger: "change" }
+          { required: true, message: "数据类型不能为空", trigger: "change" },
         ],
-      }
+      },
     };
   },
   created() {
@@ -191,7 +241,7 @@ export default {
     /** 查询数据管理列表 */
     getList() {
       this.loading = true;
-      listData(this.queryParams).then(response => {
+      listData(this.queryParams).then((response) => {
         this.dataList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -213,7 +263,7 @@ export default {
         createTime: null,
         updateBy: null,
         updateTime: null,
-        remark: null
+        remark: null,
       };
       this.resetForm("form");
     },
@@ -229,9 +279,9 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.id);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -242,8 +292,8 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const id = row.id || this.ids
-      getData(id).then(response => {
+      const id = row.id || this.ids;
+      getData(id).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改数据管理";
@@ -251,16 +301,16 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.id != null) {
-            updateData(this.form).then(response => {
+            updateData(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addData(this.form).then(response => {
+            addData(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -272,19 +322,27 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除数据管理编号为"' + ids + '"的数据项?').then(function() {
-        return delData(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('是否确认删除数据管理编号为"' + ids + '"的数据项?')
+        .then(function () {
+          return delData(ids);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('system/data/export', {
-        ...this.queryParams
-      }, `data_${new Date().getTime()}.xlsx`)
-    }
-  }
+      this.download(
+        "system/data/export",
+        {
+          ...this.queryParams,
+        },
+        `data_${new Date().getTime()}.xlsx`
+      );
+    },
+  },
 };
 </script>