管道基础大数据平台系统开发-【前端】-新系統界面
王旭
2023-05-10 86cdd4e6eece0ee4679e62ae347ec003db7d7425
src/views/userManage/orgManage.vue
@@ -14,25 +14,19 @@
            node-key="id"
            :data="depList"
            :expand-on-click-node="false"
            :default-expand-all="true"
            :default-expanded-keys=openKey
            @node-click="handleNodeClick"
          >
          </el-tree>
        </div>
      </div>
      <div style="width: 80%;border: 1px solid #dcdfe6;
        width: 80%;
        height: 91%;
        border-radius: 5px;
        padding: 1%;
        overflow: auto;">
        <div style="display:flex;justify-content:space-between">
          <el-breadcrumb separator="/">
      <div class="right_menu subpage_Div">
        <div style="display:flex;justify-content:right;align-items: center;padding-bottom: 14px">
          <el-breadcrumb separator="/" style="display: none">
            <el-breadcrumb-item :to="{ path: '/' }">{{
            $t('dataManage.dictionaryManageObj.particulars')
          }}</el-breadcrumb-item>
          </el-breadcrumb>
          <div>
            <el-button
              v-if="menuStatus.insert"
@@ -41,7 +35,7 @@
              type="success"
              icon="el-icon-plus"
              size="small"
            >新增同级</el-button>
            >{{$t('operatManage.menuSetObj.insert')}}</el-button>
            <el-button
              v-if="menuStatus.insert"
              :disabled="itemdetail.pid == null ? true : false"
@@ -49,7 +43,7 @@
              type="success"
              icon="el-icon-plus"
              size="small"
            >新增子级</el-button>
            >{{$t('operatManage.menuSetObj.subInsert')}}</el-button>
                        <el-button
              v-if="menuStatus.delete"
              @click="setDelNode()"
@@ -57,7 +51,7 @@
              type="danger"
              icon="el-icon-delete"
              size="small"
            >删除</el-button>
            >{{$t('operatManage.menuSetObj.delete')}}</el-button>
            <el-button
              v-if="menuStatus.update"
              :disabled="itemdetail.pid == null ? true : false"
@@ -65,7 +59,7 @@
              type="info"
              icon="el-icon-top"
              size="small"
            >向上移动</el-button>
            >{{$t('operatManage.menuSetObj.moveUp')}}</el-button>
            <el-button
              v-if="menuStatus.update"
              :disabled="itemdetail.pid == null ? true : false"
@@ -73,13 +67,13 @@
              type="info"
              icon="el-icon-bottom"
              size="small"
            >向下移动</el-button>
            >{{$t('operatManage.menuSetObj.moveDown')}}</el-button>
          </div>
        </div>
        <div class="dividing-line"></div>
        <div class="form_box">
          <el-divider class="eldivider" />
          <el-form
            style="margin-top: 25px;  position: relative;"
<!--          <el-divider class="eldivider" />-->
          <el-form label-width="130px"
            :model="itemdetail"
            ref="itemdetail"
            :rules="rules"
@@ -92,6 +86,7 @@
                v-model="itemdetail.name"
                autocomplete="off"
                style="max-width: 400px;"
                :placeholder="$t('userManage.orgManageObj.nameHolder')"
              ></el-input>
            </el-form-item>
            <el-form-item
@@ -101,6 +96,7 @@
              <el-input
                v-model="itemdetail.sname"
                autocomplete="off"
                :placeholder="$t('userManage.orgManageObj.abbreviationHolder')"
                style="max-width: 400px;"
              ></el-input>
            </el-form-item>
@@ -120,9 +116,9 @@
              :label-width="formLabelWidth"
            >
              <el-input
                v-model="itemdetail.uncode"
                autocomplete="off"
                :placeholder="$t('userManage.orgManageObj.organizationCodeHolder')"
                style="max-width: 400px;"
              ></el-input>
            </el-form-item>
@@ -133,6 +129,7 @@
              <el-input
                v-model="itemdetail.addr"
                autocomplete="off"
                :placeholder="$t('userManage.orgManageObj.cmpanyAddressHolder')"
                style="max-width: 400px;"
              ></el-input>
            </el-form-item>
@@ -143,6 +140,7 @@
              <el-input
                v-model="itemdetail.contact"
                autocomplete="off"
                :placeholder="$t('userManage.orgManageObj.continformationHolder')"
                style="max-width: 400px;"
              ></el-input>
            </el-form-item>
@@ -152,6 +150,7 @@
            >
              <el-input
                v-model="itemdetail.fax"
                :placeholder="$t('userManage.orgManageObj.faxHolder')"
                autocomplete="off"
                style="max-width: 400px;"
              ></el-input>
@@ -162,6 +161,7 @@
            >
              <el-input
                v-model="itemdetail.email"
                :placeholder="$t('userManage.orgManageObj.EMailHolder')"
                autocomplete="off"
                style="max-width: 400px;"
              ></el-input>
@@ -172,6 +172,7 @@
            >
              <el-input
                v-model="itemdetail.post"
                :placeholder="$t('userManage.orgManageObj.postalCodeHolder')"
                autocomplete="off"
                style="max-width: 400px;"
              ></el-input>
@@ -182,6 +183,7 @@
            >
              <el-input
                v-model="itemdetail.website"
                :placeholder="$t('userManage.orgManageObj.WebsiteAddressHolder')"
                autocomplete="off"
                style="max-width: 400px;"
              ></el-input>
@@ -193,24 +195,24 @@
              <el-input
                v-model="itemdetail.bak"
                autocomplete="off"
                :placeholder="$t('userManage.orgManageObj.remarksHolder')"
                style="max-width: 400px;"
              ></el-input>
            </el-form-item>
            <div
              class="btnBox"
              v-if="menuStatus.update"
            >
              <el-button
                type="primary"
                size="small"
                @click="updDep('itemdetail')"
              >{{ $t('common.submit') }}</el-button>
              <el-button
                size="small"
                @click="reset('itemdetail')"
              >{{
                $t('common.cancel')
              }}</el-button>
            <div v-if="menuStatus.update">
              <el-form-item>
                <el-button
                    type="primary"
                    size="small"
                    @click="updDep('itemdetail')"
                >{{ $t('common.submit') }}</el-button>
                <el-button
                    size="small"
                    @click="reset('itemdetail')"
                >{{
                    $t('common.cancel')
                  }}</el-button>
              </el-form-item>
            </div>
          </el-form>
        </div>
@@ -219,10 +221,9 @@
    </div>
    <el-dialog
      top="2vh"
      :title="$t('common.append')"
      :visible.sync="dialogFormVisible"
      :before-close="handleClose"
    >
     <div style="height: 500px; overflow: auto">
      <el-form
@@ -240,6 +241,7 @@
            v-model="ruleForm.name"
            autocomplete="off"
            style="width:85%"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.name')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -250,6 +252,7 @@
            v-model="ruleForm.sname"
            autocomplete="off"
            style="width:85%"
             :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.abbreviation')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -260,6 +263,7 @@
            v-model="ruleForm.code"
            autocomplete="off"
            style="width:85%"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.unitCode')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -270,6 +274,7 @@
            v-model="ruleForm.uncode"
            autocomplete="off"
            style="width:85%"
            :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.organizationCode')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -280,6 +285,7 @@
            v-model="ruleForm.addr"
            autocomplete="off"
            style="width:85%"
             :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.cmpanyAddress')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -290,6 +296,7 @@
            v-model="ruleForm.contact"
            autocomplete="off"
            style="width:85%"
            :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.continformation')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -300,6 +307,7 @@
            v-model="ruleForm.fax"
            autocomplete="off"
            style="width:85%"
              :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.fax')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -310,6 +318,7 @@
            v-model="ruleForm.email"
            autocomplete="off"
            style="width:85%"
            :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.EMail')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -320,6 +329,7 @@
            v-model="ruleForm.post"
            autocomplete="off"
            style="width:85%"
            :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.postalCode')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -330,6 +340,7 @@
            v-model="ruleForm.website"
            autocomplete="off"
            style="width:85%"
            :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.WebsiteAddress')"
          ></el-input>
        </el-form-item>
        <el-form-item
@@ -340,6 +351,7 @@
            v-model="ruleForm.bak"
            autocomplete="off"
            style="width:85%"
            :placeholder="$t('shuJuGuanLi.shuJuJianSuo.valuetwo')+$t('userManage.orgManageObj.remarks')"
          ></el-input>
        </el-form-item>
      </el-form>
@@ -442,6 +454,7 @@
        name: [{ required: true, validator: validName, trigger: 'blur' }],
      },
      newNode: null,
      openKey: [1],
    };
  },
  methods: {
@@ -587,11 +600,15 @@
      // console.log(node);
    },
    resetForm(formName) {
      this.dialogFormVisible = false;
      this.$nextTick(() => {
        this.ruleForm = {};
        this.$refs[formName].resetFields();
      });
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.dialogFormVisible = false;
          this.$nextTick(() => {
            this.ruleForm = {};
            this.$refs[formName].resetFields();
          });
        })
        .catch((_) => { });
    },
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
@@ -637,6 +654,7 @@
        .then(() => {
          //兄弟重新排序
          const parent = node.parent;
          this.openKey.push(parent.id)
          const children = parent.data.children || parent.data;
          children.splice(data.orderNum - 1, 1);
          children.forEach((item, index) => {
@@ -651,7 +669,6 @@
            updateDepTrees(children),
          ])
            .then((res) => {
              console.log(res);
              if (res[0].code == 200 && res[1].code == 200) {
                this.$message({
                  type: 'success',
@@ -781,6 +798,7 @@
        });
    },
    handleNodeClick(data, node) {
      this.openKey.push(data.id)
      this.newNode = node
      this.backUpData = JSON.stringify(data);
      this.itemdetail = JSON.parse(JSON.stringify(data));
@@ -848,6 +866,13 @@
        }
      }
    },
    handleClose() {
      this.$confirm("关闭后无法保存,是否关闭?")
        .then((_) => {
          this.dialogFormVisible = false
        })
        .catch((_) => { });
    },
  },
  mounted() {
    this.getMenuTree();
@@ -862,6 +887,9 @@
    //   }
    // }
  },
  beforeDestroy() {
    this.openKey = [1]
  }
};
</script>
<style lang="less" scoped>
@@ -869,7 +897,7 @@
.menuSettings_box {
  height: 98%;
  width: 98%;
  padding: 1%;
  padding:0.5% 1%;
  .cataLogContent {
    width: 100%;
@@ -879,29 +907,33 @@
  }
  .left_Tree {
    width: 15%;
    height: 91%;
    //height: 94%;
    height: 100%;
    border-radius: 5px;
    padding: 1%;
    overflow-y: auto;
    border-right: 1px solid  #dcdfe6;
  }
  .right_menu {
    width: 80%;
    height: 91%;
    //height: 91%;
    height: 98%;
    border-radius: 5px;
    padding: 1%;
    overflow: auto;
    .el-input {
      width: 400px;
    .form_box {
      box-sizing: border-box;
      padding-top: 22px;
      width: 100%;
      .el-input {
        width: 400px;
      }
    }
  }
}
.btnBox{
  position: absolute;
  bottom: 0;
  right: 0;
  //position: absolute;
  //bottom: 0;
  //right: 0;
}
</style>