Explorar el Código

优化修改所在位置页面,新增节点“新增”按钮

LinWuTai hace 1 año
padre
commit
d4aed54466
Se han modificado 1 ficheros con 7 adiciones y 4 borrados
  1. 7 4
      ruoyi-ui/src/views/asset/location/index.vue

+ 7 - 4
ruoyi-ui/src/views/asset/location/index.vue

@@ -54,6 +54,7 @@
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['asset:location:edit']">修改</el-button>
+          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleAdd(scope.row)" v-hasPermi="['asset:location:add']">新增</el-button>
           <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['asset:location:remove']">删除</el-button>
         </template>
       </el-table-column>
@@ -202,11 +203,13 @@ export default {
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
-    handleAdd() {
+    handleAdd(row) {
       this.reset()
-      // if (row != undefined) {
-      //   this.form.parentId = row.deptId
-      // }
+      if (row.id) {
+        this.form.parentId = row.id
+      } else if (this.queryParams.parentId) {
+        this.form.parentId = Number(this.queryParams.parentId)
+      }
       this.open = true
       this.title = '添加所属位置'
       // listDept().then((response) => {