src/views/jcsz/jsqd.vue
@@ -17,7 +17,13 @@
              <el-input v-model="form.RoleName" placeholder="请输入" style="width: 200px" />
            </el-form-item>
            <el-form-item label="角色类型" style=" display: flex;">
              <el-select v-model="form.RoleTypeCode" filterable style="width: 200px" placeholder="请选择">
              <el-select
                v-model="form.RoleTypeCode"
                :popper-append-to-body="false"
                filterable
                style="width: 200px"
                placeholder="请选择"
              >
                <el-option
                  v-for="item in RoleTypeCodeArr2"
                  :key="item.roletype_code"
@@ -148,6 +154,7 @@
      :visible.sync="dialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      @closed="handleClose"
      @close="handleClose"
    >
@@ -162,6 +169,7 @@
          <el-select
            v-model="dialogForm.RoleTypeCode"
            filterable
            :popper-append-to-body="false"
            style="width: 220px"
            placeholder="请选择"
          >
@@ -186,10 +194,11 @@
    </el-dialog>
    <!--    设置按钮对话框-->
    <el-dialog
      title="角色类型"
      title="设置"
      :visible.sync="settingDialogVisible"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      class="settingDialogVisible"
      @close="handleCloseSetting"
    >
@@ -200,12 +209,14 @@
      <el-table
        :data="RoleTypeCodeArr"
        border
        height="400"
        highlight-current-row
        :style="{width: 100+'%',height:tableHeight-300+'px'}"
        :header-cell-style="this.$headerCellStyle"
        :cell-style="this.$cellStyle"
        @sort-change="sortChangeOfSetting"
      >
        <!--        :style="{width: 100+'%',height:tableHeight-300+'px'}"-->
        <!--        <el-table-column-->
        <!--          type="selection"-->
        <!--          width="50"-->
@@ -236,7 +247,6 @@
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="{row}">
            <div class="operationClass">
              <el-button v-if="row.isVisible===0" type="text" @click="delSetting(row)">删除</el-button>
@@ -244,12 +254,6 @@
              <el-button v-if="row.isVisible===1" type="text" @click="formSettingCancel(row)">取消</el-button>
            </div>
          </template>
          <!--          <template v-for="item in RoleTypeCodeArr" slot-scope="{row}">-->
          <!--            <div :key="item.roletype_code" class="operationClass">-->
          <!--              <el-button v-if="item.isVisible" type="text" @click="formSettingSave(row)">保存</el-button>-->
          <!--              <el-button v-if="item.isVisible" type="text" @click="formSettingCancel(row)">取消</el-button>-->
          <!--            </div>-->
          <!--          </template>-->
        </el-table-column>
      </el-table>
      <!--分页-->
@@ -274,7 +278,8 @@
    <el-dialog
      title="角色关联用户"
      :visible.sync="userDialogVisible"
      width="90%"
      width="80%"
      :close-on-click-modal="false"
      top="15vh"
      class="userDialogVisible"
      @closed="handleCloseUser"
@@ -300,6 +305,8 @@
              ref="dialogCascaderUser"
              key="cascaderKey"
              filterable
              popper-class="elCascader"
              :append-to-body="false"
              :options="StuOrgArr"
              :props="defaultProps"
              class="userDialogVisibleInput"
@@ -312,6 +319,7 @@
            <el-select
              v-model="dialogFormUser.isrole"
              filterable
              :popper-append-to-body="false"
              style="width: 220px"
              placeholder="请选择"
              class="userDialogVisibleInput"
@@ -345,7 +353,7 @@
        :data="dialogFormUserTable"
        border
        highlight-current-row
        :style="{width: 100+'%',height:tableHeight-300+'px'}"
        height="300"
        :header-cell-style="this.$headerCellStyle"
        :cell-style="this.$cellStyle"
        :row-key="getRowKey"
@@ -416,6 +424,7 @@
      :visible.sync="dialogVisibleRight"
      width="50%"
      top="15vh"
      :close-on-click-modal="false"
      class="dialogVisibleRight"
      @closed="handleCloseRight"
      @close="handleCloseRight"
@@ -801,7 +810,9 @@
    },
    // 添加按钮
    addSetting() {
      const data = { roletype_code: '', roletype_name: '', isVisible: 1 }
      let number = Math.random() * Math.random()// 作为删除时的标识符
      number = number === 0 ? Math.random() * Math.random() : number
      const data = { roletype_code: '', roletype_name: '', isVisible: 1, number: number }
      this.RoleTypeCodeArr.unshift(data)
    },
    // 删除按钮
@@ -835,14 +846,14 @@
      }
      const res = await RoleTypeAdd([data])
      if (res.code === '200') {
        this.$message.success('添加成功!')
        this.$message.success('保存成功!')
        await this.getRoleTypeSearch()
      }
    },
    // 设置表单取消事件
    formSettingCancel(row) {
      this.RoleTypeCodeArr.forEach((item, index) => {
        if (item.isVisible === 1 && item.roletype_code === row.roletype_code) {
        if (item.isVisible === 1 && item.number === row.number) {
          this.RoleTypeCodeArr.splice(index, 1)
        }
      })
@@ -963,31 +974,51 @@
      const rightPCArrFlag = res[0][0].flag
      const rightAPPArrFlag = res[1][0].flag
      let waitFlag = false// 回显等待是否放行
      // 1.第一种情况PC和APP都一次都没选中时    PC未选中,APP未选中
      if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'N') {
        pcIsSelected1 = true
        this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
      }
      // 2.第二种情况PC已选中,APP未选中
      if (rightPCArrFlag === 'Y' && rightAPPArrFlag === 'N') {
        pcIsSelected1 = true
        pcIsSelected2 = true
        setTimeout(() => {
          this.$nextTick(() => {
            $('input:checkbox').eq(0).prop('checked', true)// 自定义单选框回显
          })
        const interval = setInterval(() => {
          if ($('input:checkbox').length > 0) {
            waitFlag = true
          }
          if (waitFlag) {
            clearInterval(interval)
            this.$nextTick(() => {
              $("input[name='PC']").eq(0).prop('checked', true)// 自定义单选框回显
            })
          }
        }, 100)
        this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
      }
      // 3.第三种情况PC未选中,APP已选中
      if (rightPCArrFlag === 'N' && rightAPPArrFlag === 'Y') {
        appIsSelected1 = true
        appIsSelected2 = true
        setTimeout(() => {
          this.$nextTick(() => {
            $('input:checkbox').eq(1).prop('checked', true)// 自定义单选框回显
          })
        const interval = setInterval(() => {
          if ($('input:checkbox').length > 0) {
            waitFlag = true
          }
          if (waitFlag) {
            clearInterval(interval)
            this.$nextTick(() => {
              $("input[name='APP']").eq(0).prop('checked', true)// 自定义单选框回显
            })
          }
        }, 100)
        this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightAPPArr[0].code
      }
      // 4.第四种情况PC已选中,APP已选中
@@ -996,12 +1027,20 @@
        pcIsSelected2 = true
        appIsSelected1 = false
        appIsSelected2 = true
        setTimeout(() => {
          this.$nextTick(() => {
            $('input:checkbox').eq(0).prop('checked', true)// 自定义单选框回显
            $('input:checkbox').eq(1).prop('checked', true)// 自定义单选框回显
          })
        const interval = setInterval(() => {
          if ($('input:checkbox').length > 0) {
            waitFlag = true
          }
          if (waitFlag) {
            clearInterval(interval)
            this.$nextTick(() => {
              $("input[name='PC']").eq(0).prop('checked', true)// 自定义单选框回显
              $("input[name='APP']").eq(0).prop('checked', true)// 自定义单选框回显
            })
          }
        }, 100)
        this.dialogFormRight.rightCurrentCode = this.dialogFormRight.rightPCArr[0].code
      }
      this.dialogFormRight.rightOperationArr.push({
@@ -1278,11 +1317,16 @@
  height: 30px;
  display: flex;
  align-items: center;
  border: 1px solid $main_color;
  //border: 1px solid $main_color;
  border: none;
  padding: 0 20px;
}
::v-deep .el-button--info{
::v-deep .el-button--primary:hover {
  border: none;
}
::v-deep .el-button--info {
  //background-color: $main_color !important;
  height: 30px;
  display: flex;
@@ -1376,8 +1420,8 @@
    }
    input[type=checkbox]:checked::after {
      content: "✓";
      //content: "√";
      //content: "✓";
      content: "√";
      color: #fff;
      font-size: 12px;
      font-weight: bold;
@@ -1413,6 +1457,10 @@
::v-deep .el-input__inner {
  height: 30px;
  line-height: 30px;
}
::v-deep .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-table .caret-wrapper {
@@ -1473,12 +1521,55 @@
::v-deep .el-radio.is-bordered + .el-radio.is-bordered {
  margin: 10px 30px 0px 0;
}
.body ::v-deep .el-divider{
.body ::v-deep .el-divider {
  border: 1px solid #eee;
  width: 99%;
  margin: 10px auto;
}
.body ::v-deep .el-form-item{
.body ::v-deep .el-form-item {
  margin-bottom: 0;
}
::v-deep .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-select .el-input__inner:focus {
  border-color: $main_color;
}
::v-deep .el-select-dropdown__item.selected {
  color: $main_color;
}
::v-deep .el-textarea__inner:focus {
  border-color: $main_color;
}
</style>
<style lang="scss">
.elCascader {
  //.el-cascader-node.in-active-path, .el-cascader-node.is-active, .el-cascader-node.is-selectable.in-checked-path {
  //  color: #42b983 ;
  //}
  .el-cascader-node.is-selectable.in-checked-path {
    color: #42b983;
  }
  .el-radio__input.is-checked .el-radio__inner {
    background-color: #42b983;
    border-color: #42b983;
  }
  .el-radio__input.is-checked .el-radio__inner:hover {
    border-color: #42b983;
  }
  .el-input__inner {
    border-color: #42b983 !important;
  }
}
</style>