管道基础大数据平台系统开发-【前端】-新系統界面
1
Surpriseplus
2022-12-06 938493192a9a112e5eef0d98b46a30569ce98a59
src/views/datamanage/styleManage.vue
@@ -19,7 +19,7 @@
          <el-button
            @click="submitForm('ruleForm')"
            icon="el-icon-search"
            type="primary"
            class="primary"
            size="small"
            >{{ $t('common.iquery') }}</el-button
          >
@@ -31,7 +31,7 @@
            >{{ $t('common.empty') }}</el-button
          >
          <el-button  v-if="btnStatus.insert"
            @click="InsertFormdialog = true"
            @click="setInsertShow()"
            icon="el-icon-edit"
            type="success"
            size="small"
@@ -53,7 +53,7 @@
          <el-table
            :data="tableData"
            style="width: 100%"
            fit
            height="100%"
            @selection-change="handleSelectionChange"
          >
@@ -106,38 +106,6 @@
              prop="descr"
              :label="$t('dataManage.styleObj.descr')"
            />
            <!-- <el-table-column
              align="center"
              prop="fileGuid"
              :label="$t('dataManage.styleObj.fileguid')"
            />
            <el-table-column
              align="center"
              prop="viewGuid"
              :label="$t('dataManage.styleObj.viewguid')"
            />
            <el-table-column
              align="center"
              prop="createUser"
              :label="$t('dataManage.styleObj.createUser')"
            />
            <el-table-column
              align="center"
              prop="createTime"
              :label="$t('dataManage.styleObj.createTime')"
              :formatter="formatTime"
            />
            <el-table-column
              align="center"
              prop="updateUser"
              :label="$t('dataManage.styleObj.updateUser')"
            />
            <el-table-column
              align="center"
              prop="updateTime"
              :label="$t('dataManage.styleObj.updateTime')"
              :formatter="formatTime"
            /> -->
            <el-table-column
              align="center"
              prop="bak"
@@ -267,7 +235,7 @@
      </el-card>
    </div>
    <el-dialog
      title="修改详情"
      :title="$t('dataManage.styleObj.modifyStyleData')"
      top="2vh"
      style="overflow: hidden"
      :before-close="removeUpdate"
@@ -290,7 +258,13 @@
          :label="$t('dataManage.styleObj.dirid')"
          :label-width="formLabelWidth"
        >
          <el-input
         <el-cascader
              v-model="upform.dirid"
              :options="editcatalogOption"
              @change="catalogChange"
              :props="cascader" style="width:730px"
            ></el-cascader>
          <!-- <el-input
            v-model="upform.dirValue"
            disabled
            autocomplete="off"
@@ -300,13 +274,20 @@
            @click="showDirTree(1)"
            style="margin-left: 10px"
            ><i class="el-icon-plus"></i
          ></el-link>
          ></el-link> -->
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.styleObj.depid')"
          :label-width="formLabelWidth"
        >
          <el-input
          <el-cascader
              v-model="upform.depid"
              :options="editCompanyOption"
              @change="editcompanyChange"
              :props="cascader"
              style="width:730px"
            ></el-cascader>
          <!-- <el-input
            v-model="upform.depValue"
            disabled
            autocomplete="off"
@@ -316,7 +297,7 @@
            @click="showDepTree(1)"
            style="margin-left: 10px"
            ><i class="el-icon-plus"></i
          ></el-link>
          ></el-link> -->
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.styleObj.ver')"
@@ -371,7 +352,7 @@
            style="display: none"
            @change="editFile(0)"
          />
           <el-link
           <el-link
            :underline="false"
            @click="geteditFile(0)"
            style="margin-left: 10px"
@@ -399,7 +380,7 @@
            style="display: none"
            @change="editFile(1)"
          />
           <el-link
           <el-link
            :underline="false"
            @click="geteditFile(1)"
            style="margin-left: 10px"
@@ -421,8 +402,8 @@
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="removeUpdate">{{$t('common.close')}}</el-button>
        <el-button type="primary" @click="updateForm">{{$t('common.confirm')}}</el-button>
        <el-button type="info" @click="removeUpdate">{{$t('common.close')}}</el-button>
        <el-button class="primary" @click="updateForm">{{$t('common.confirm')}}</el-button>
      </div>
    </el-dialog>
    <el-dialog
@@ -430,6 +411,7 @@
      top="2vh"
      style="overflow: hidden"
      :visible.sync="InsertFormdialog"
      :before-close="handleClose"
    >
      <el-form :model="insertform">
        <el-form-item
@@ -448,7 +430,14 @@
          :label="$t('dataManage.styleObj.dirid')"
          :label-width="formLabelWidth"
        >
          <el-input
        <el-cascader
              v-model="insertform.dirid"
              :options="catalogOption"
              @change="catalogChange"
              :props="cascader"
              style="width:730px"
            ></el-cascader>
          <!-- <el-input
            v-model="insertform.dirValue"
            disabled
            autocomplete="off"
@@ -458,13 +447,20 @@
            @click="showDirTree(0)"
            style="margin-left: 10px"
            ><i class="el-icon-plus"></i
          ></el-link>
          ></el-link> -->
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.styleObj.depid')"
          :label-width="formLabelWidth"
        >
          <el-input
          <el-cascader
              v-model="insertform.depid"
              :options="companyOption"
              @change="companyChange"
              :props="cascader"
              style="width:730px"
            ></el-cascader>
          <!-- <el-input
            v-model="insertform.depValue"
            disabled
            autocomplete="off"
@@ -474,7 +470,7 @@
            @click="showDepTree(0)"
            style="margin-left: 10px"
            ><i class="el-icon-plus"></i
          ></el-link>
          ></el-link> -->
        </el-form-item>
        <el-form-item
          :label="$t('dataManage.styleObj.ver')"
@@ -580,8 +576,8 @@
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="insertFromDataClose">{{$t('common.close')}}</el-button>
        <el-button type="primary" @click="insertFromData">{{$t('common.confirm')}}</el-button>
        <el-button type="info" @click="insertFromDataClose">{{$t('common.close')}}</el-button>
        <el-button  class="primary" @click="insertFromData">{{$t('common.confirm')}}</el-button>
      </div>
    </el-dialog>
    <div class="leftTree" v-if="showDirCata">
@@ -589,10 +585,10 @@
        <style-dir-tree></style-dir-tree>
      </div>
      <div class="btnBox">
        <el-button type="primary" size="small" @click="selectDirCataName">{{
        <el-button class="primary" size="small" @click="selectDirCataName">{{
          $t('common.confirm')
        }}</el-button>
        <el-button type="primary" size="small" @click="showDirCata = false">{{
        <el-button type="info" size="small" @click="showDirCata = false">{{
          $t('common.close')
        }}</el-button>
      </div>
@@ -602,10 +598,10 @@
        <style-dep-tree></style-dep-tree>
      </div>
      <div class="btnBox">
        <el-button type="primary" size="small" @click="selectDepCataName">{{
        <el-button class="primary" size="small" @click="selectDepCataName">{{
          $t('common.confirm')
        }}</el-button>
        <el-button type="primary" size="small" @click="showDepCata = false">{{
        <el-button type="info" size="small" @click="showDepCata = false">{{
          $t('common.close')
        }}</el-button>
      </div>
@@ -626,6 +622,8 @@
  deleteStyles,
  updateStyle,
  upload_style,
  queryDepTree,
  selectdirTab
} from "../../api/api";
export default {
  name: "styleManage",
@@ -672,11 +670,24 @@
        insert: false,
        update: false,
      },
      companyOption:[],
      catalogOption:[],
      editCompanyOption:[],
      editcatalogOption:[],
       cascader: {
        label: 'name',
        value: 'id',
        children: 'children',
        checkStrictly: true,
        emitPath: false,
      },
    };
  },
  created() {
    this.getRoleTabelData();
    this.showPermsBtn();
     this.getQueryDepTree();this.getSelectdirTab();
  },
  methods: {
    showPermsBtn() {
@@ -687,10 +698,13 @@
        .map((item) => (this.btnStatus[item.tag.substr(1)] = true));
    },
    filesReset() {
      document.getElementById("insertFile").reset();
      document.getElementById("insertimageFile").reset();
      this.guidFile = null;
      this.fileGuid = null;
      // document.getElementById("insertFile").reset();
      // document.getElementById("insertimageFile").reset();
         document.getElementById("insertFile").value = "";
            document.getElementById("insertimageFile").value = "";
      this.guidFile = '';
      this.fileGuid = '';
    },
    getInsertFile(res) {
      if (res == 0) {
@@ -882,8 +896,19 @@
    },
    insertFromDataClose() {
      this.InsertFormdialog = false;
      this.insertform = {};
       this.insertform= {
        fileGuid: null,
        viewGuid: null,
      }
      this.filesReset();
    },
    handleClose(){
     this.InsertFormdialog = false;
     this.insertform= {
        fileGuid: null,
        viewGuid: null,
      }
        this.filesReset();
    },
    async insertFromData() {
      if (this.insertform.dirid == null || this.insertform.depid == null) {
@@ -902,8 +927,10 @@
      const data = await insertStyle(this.insertform);
      if (data.code == 200) {
        this.InsertFormdialog = false;
        this.insertform = {};
     this.insertform= {
        fileGuid: null,
        viewGuid: null,
      }
        this.filesReset();
        this.$message({
          message: "添加成功!",
@@ -969,7 +996,7 @@
      if (!val || !val.length) return;
      var formData = new FormData();
      formData.append("file0", val[0]);
      var res = $.ajax(serverUrl + "Style/Upload", {
      var res = $.ajax( + "/style/upload", {
        type: "post",
        data: formData,
        async: false,
@@ -996,7 +1023,7 @@
      if (!val || !val.length) return;
      var formData = new FormData();
      formData.append("file0", val[0]);
      var res = $.ajax(serverUrl + "Style/Upload", {
      var res = $.ajax(BASE_URL + "/style/upload", {
        type: "post",
        data: formData,
        async: false,
@@ -1107,7 +1134,7 @@
      this.upflag = false;
      this.dialogFormVisible = false;
      this.upform = {};
      this.filesReset();
      // this.filesReset();
    },
    submitForm(formName) {
      this.getRoleTabelData();
@@ -1144,6 +1171,7 @@
    },
    handleEdit(index, row) {
      this.upflag = true;
      this.dialogFormVisible = true;
      this.upform = row;
@@ -1169,12 +1197,62 @@
    },
    // 获取多选
    ShowWindowFly(res) {
      window.open(
        ifreamUrl + "/LFWeb/poper.html?name=" + res,
        "",
        "height=800, width=1500, top=150, left=350, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no"
      );
    // ShowWindowFly(res) {
    //   window.open(
    //     ifreamUrl + "/LFWeb/poper.html?name=" + res,
    //     "",
    //     "height=800, width=1500, top=150, left=350, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no"
    //   );
    // },
     catalogChange(res) {
      this.insertform.dirid = res;
      this.upform.dirid =res;
    },
    editcompanyChange(res){
this.upform.depid = res;
    },
    companyChange(res){
        this.insertform.depid = res;
    },
    //新增数据
    setInsertShow(){
this.InsertFormdialog = true;
    },
    //目录列表获取
    async getSelectdirTab() {
      const res = await selectdirTab();
      if (res.code != 200) {
        this.$message.error('目录列表获取失败');
        return;
      }
      this.insertform.dirid = 1;
      this.upform.dirid = 1;
 this.catalogOption = this.treeData(res.result);
 this.editcatalogOption= this.treeData(res.result);
    },
      //单位列表获取
    async getQueryDepTree() {
      const res = await queryDepTree();
      if (res.code != 200) {
        this.$message.error('单位列表获取失败');
        return;
      }
      this.insertform.depid = 1;
            this.upform.depid = 1;
      this.companyOption = this.treeData(res.result);
      this.editCompanyOption= this.treeData(res.result);
    },
    //树列表生成
    treeData(source) {
      let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆
      return cloneData.filter((father) => {
        // 循环所有项
        let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据
        branchArr.length > 0 ? (father.children = branchArr) : ''; // 给父级添加一个children属性,并赋值
        return father.pid == 0; // 返回一级菜单
      });
    },
  },
};
@@ -1182,10 +1260,10 @@
<style lang="less" scoped>
//@import url(); 引入公共css类
.authorityManagement_box {
  background: rgb(240, 242, 245);
  border-radius: 10px;
  height: 100%;
  padding: 10px;
  height: 81%;
  width: 97%;
  position: absolute;
  box-sizing: border-box;
  .el-input {
@@ -1194,7 +1272,7 @@
  .searchComp {
    margin: 10px auto;
    background: #fff;
    border-radius: 5px;
    border: 1px solid rgb(202, 201, 204);
    .el-form-item {
@@ -1212,7 +1290,7 @@
    left: 800px;
    width: 400px;
    height: 600px;
    background: #f0f2f5;
    background: #303030;
    border: 1px solid #000;
    .treeBox {
      height: 550px;
@@ -1235,72 +1313,81 @@
      width: 100%;
      .table_box {
        width: 100%;
        height: 93%;
        height: 90%;
        margin: 0 auto;
        overflow: auto;
        background: #fff;
        // .el-table {
        //   height: 100%;
        //   // overflow: auto;
        // }
        // .el-table /deep/ .el-table__header-wrapper tr th {
        //   background-color: rgb(255, 255, 255) !important;
        //   color: rgb(0, 0, 0);
        // }
        // // 修改每行样式:
        // .el-table /deep/ .el-table__row {
        //   background-color: rgba(255, 255, 255) !important;
        //   color: rgb(0, 0, 0);
        // }
        // .el-table /deep/ .el-table__body tr.current-row > td {
        //   background-color: rgb(211, 211, 211) !important;
        // }
        // .el-table /deep/ .el-table__body tr:hover > td {
        //   background-color: rgb(211, 211, 211) !important;
        // }
        // // 修改表格每行边框的样式:
        // .el-table /deep/ td,
        // .el-table /deep/ th.is-leaf {
        //   border-bottom: 1px solid #eee;
        //   border-right: 1px solid #eee;
        // }
        // .el-table /deep/ .el-table__cell {
        //   padding: 0;
        // }
        // // 设置表格每行的高度:
        // .el-table /deep/ .el-table__header tr,
        // .el-table /deep/ .el-table__header th {
        //   height: 40px;
        // }
        // .el-table__body tr,
        // .el-table__body td {
        //   height: 40px;
        //   padding: 0;
        // }
        // // 设置表格边框颜色:
 /*修改table 表体的背景颜色和文字颜色*/
  /deep/ .el-table {
    background-color: transparent;
        // .el-table--border::after,
        // .el-table--group::after {
        //   width: 0;
        // }
        // .el-table::before {
        //   height: 0;
        // }
        //   a {
        //     color: #000;
        //   }
    th,
    td {
      background-color: transparent;
    }
    .el-table__expanded-cell {
      background-color: transparent !important;
    }
    // 表头背景色
    th.el-table__cell {
      background-color: #303030;
      color: #fff;
    }
    tr > td {
      background-color: #303030;
      color: #fff;
    }
    // hover效果
    tr:hover > td {
      background-color: rgba(255, 255, 255, 0.3) !important;
    }
    tbody tr:hover {
      background-color: rgba(255, 255, 255, 0.3) !important;
      // text-align: center;
    }
    // 滚动条宽高
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      /*滚动条宽度*/
      height: 5px;
      /*滚动条高度*/
    }
    /*定义滚动条轨道 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-track {
      box-shadow: 0px 1px 3px #216fe6 inset;
      /*滚动条的背景区域的内阴影*/
      border-radius: 10px;
    }
    /*定义滑块 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-thumb {
      box-shadow: 0px 1px 3px #216fe6 inset;
      border-radius: 6px;
      background-color: #216fe6;
    }
  }
      }
    }
  }
  .infoBox {
    width: 500px;
    border: 1px solid #eee;
    position: absolute;
    z-index: 100;
    top: 15%;
    right: 25%;
    background-color: #fff;
    background-color: #303030;
    .el-card {
      color: white;
      background-color: transparent;
      span {
        font-size: 16px;
@@ -1309,7 +1396,7 @@
    }
    .contentBox {
      margin: 0 aotu 10px;
      height: 600px;
      height: 500px;
      overflow: auto;
      p {
        // background-color: #bfa;
@@ -1345,31 +1432,80 @@
      background: #ededed;
    }
  }
   .pagination_box {
    margin-top: 20px;
    /deep/.el-input__inner {
      background-color: transparent !important;
      border: 1px solid;
      color: white;
    }
    /deep/.el-pagination__total {
      color: white;
    }
    /deep/.el-pagination__jump {
      color: white;
    }
    /deep/.el-pager li.active {
      color: #409eff;
    }
    /deep/.el-pager li {
      color: white;
      background: transparent;
    }
    /deep/.el-pager li {
      color: white;
    }
    /deep/.btn-prev {
      background: transparent;
    }
    /deep/.btn-next {
      background: transparent;
    }
    /deep/.btn-next i {
      color: white;
    }
    /deep/.btn-prev i {
      color: white;
    }
  }
 /deep/.el-form-item__label {
    color: white;
  }
  // 设置输入框的背景色、字体颜色、边框属性设置;
  /deep/.el-input__inner {
    background-color: transparent !important ;
    color: #fff;
    border: 1px solid;
  }
  /deep/ .el-dialog {
    background: #303030;
  }
  /deep/.el-range-editor.is-active,
  .el-range-editor.is-active:hover,
  .el-select .el-input.is-focus .el-input__inner {
    border: 1px solid;
  }
  /deep/.el-dialog__title {
    color: white;
  }
  /deep/ .el-select .el-input__inner {
    border-color: #fff !important;
  }
  /deep/.el-cascader .el-input__inner {
    border-color: #fff !important;
  }
  .primary {
    background: #409eff;
    border: #409eff;
    color: white;
  }
  .el-icon-plus{
    color: white;
  }
  .el-icon-upload2{
    color: white;
  }
}
</style>
<style>
/* 整体样式 */
.el-table__body-wrapper::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
/* 滚动条 */
.el-table__body-wrapper::-webkit-scrollbar-thumb {
  background-color: #b3d8ff;
  border-radius: 6px;
}
/* 滚动条鼠标经过样式 */
.el-table__body-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: #66b1ff;
  border-radius: 8px;
}
/* 滚动条轨道 */
.el-table__body-wrapper::-webkit-scrollbar-track-piece {
  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: #ededed;
}
</style>