loulijun2021
2022-08-05 d33eacc1f85ac3a736b33ba4713a19aae466d711
src/views/jcsz/jsqd.vue
@@ -47,17 +47,16 @@
      <div style="margin-left: 10px;display: flex">
        <el-button type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">新增</el-button>
        <el-button type="primary" icon="el-icon-setting" @click="settingButton">设置</el-button>
        <!--        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>-->
        <el-button type="primary" icon="el-icon-upload2" @click="upload">导入</el-button>
      </div>
      <el-divider />
      <div class="elTableDiv">
        <el-table
          :data="tableData"
          border
          stripe
          :height="tableHeight+'px'"
          :style="{width: 100+'%',height:tableHeight+'px'}"
          :style="{width: 100+'%',height: tableHeight+'px'}"
          highlight-current-row
          :header-cell-style="this.$headerCellStyle"
          :cell-style="this.$cellStyle"
@@ -72,24 +71,29 @@
            prop="RowNum"
            width="50"
            label="序号"
            fixed
          />
          <el-table-column
            prop="role_code"
            label="角色编码"
            sortable="custom"
            min-width="110"
          />
          <el-table-column
            prop="role_name"
            label="角色名称"
            sortable="custom"
            min-width="110"
          />
          <el-table-column
            prop="roletype_name"
            label="角色类型"
            sortable="custom"
            min-width="110"
          />
          <el-table-column
            prop="description"
            min-width="160"
            label="角色描述"
            sortable="custom"
          />
@@ -97,10 +101,12 @@
            prop="lm_user"
            label="创建人员"
            sortable="custom"
            width="110"
          />
          <el-table-column
            prop="lm_date"
            label="创建时间"
            min-width="160"
            sortable="custom"
          />
          <el-table-column
@@ -111,7 +117,7 @@
          >
            <template slot-scope="{row}">
              <i v-if="row.is_user==='Y'" class="el-icon-user-solid" @click="userClick(row)" />
              <i v-if="row.is_user==='N'" class="el-icon-user-solid" style="color: #E4E7ED" @click="userClick(row)" />
              <i v-if="row.is_user==='N'" class="el-icon-user-solid" style="color: rgb(180 ,181, 185)" @click="userClick(row)" />
            </template>
          </el-table-column>
          <el-table-column
@@ -122,11 +128,13 @@
          >
            <template slot-scope="{row}">
              <i v-if="row.is_right==='Y'" class="el-icon-share" @click="rightClick(row)" />
              <i v-if="row.is_right==='N'" class="el-icon-share" style="color: #E4E7ED" @click="rightClick(row)" />
              <i v-if="row.is_right==='N'" class="el-icon-share" style="color: rgb(180 ,181, 185)" @click="rightClick(row)" />
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            fixed="right"
            width="120"
          >
            <template slot-scope="{row}">
              <div class="operationClass">
@@ -280,10 +288,10 @@
    <el-dialog
      title="角色关联用户"
      :visible.sync="userDialogVisible"
      width="1500px"
      width="900px"
      :close-on-click-modal="false"
      top="15vh"
      :fullscreen="isFullscreen"
      :fullscreen="isIpad"
      class="userDialogVisible"
      @closed="handleCloseUser"
      @close="handleCloseUser"
@@ -298,10 +306,16 @@
      <div style="display: flex;min-height: 50px">
        <el-form ref="dialogFormUser" inline :model="dialogFormUser" label-width="80px">
          <el-form-item label="用户编码">
            <el-input v-model="dialogFormUser.usercode" style="width: 200px" />
            <el-input
              v-model="dialogFormUser.usercode"
              :style="{width:isIpad? '180px':'200px'}"
            />
          </el-form-item>
          <el-form-item label="用户名称">
            <el-input v-model="dialogFormUser.username" style="width: 200px" />
            <el-input
              v-model="dialogFormUser.username"
              :style="{width:isIpad? '180px':'200px'}"
            />
          </el-form-item>
          <el-form-item label="所属组织">
            <el-cascader
@@ -312,7 +326,7 @@
              :append-to-body="false"
              :options="StuOrgArr"
              :props="defaultProps"
              style="width: 200px;"
              :style="{width:isIpad? '180px':'200px'}"
              @change="dialogCascaderChange"
            />
@@ -323,7 +337,7 @@
              v-model="dialogFormUser.isrole"
              filterable
              :popper-append-to-body="false"
              style="width: 200px"
              :style="{width:isIpad? '180px':'200px'}"
              placeholder="请选择"
            >
              <el-option
@@ -355,7 +369,7 @@
        :data="dialogFormUserTable"
        border
        highlight-current-row
        height="300"
        height="370"
        :header-cell-style="this.$headerCellStyle"
        :cell-style="this.$cellStyle"
        :row-key="getRowKey"
@@ -426,7 +440,7 @@
      :visible.sync="dialogVisibleRight"
      width="800px"
      top="15vh"
      :fullscreen="isFullscreen"
      :fullscreen="isIpad"
      :close-on-click-modal="false"
      class="dialogVisibleRight"
      @closed="handleCloseRight"
@@ -497,11 +511,16 @@
        </div>
      </span>
    </el-dialog>
    <!--导入组件-->
    <import-picker ref="importPickerFunc" :shows.sync="shows" :title="title_value" :colos="colos" :code="code" />
  </div>
</template>
<script>
import Pagination from '@/components/Pagination'
import ImportPicker from '@/components/ImportPicker'
import {
  AddUpdateRole,
  DeleteRole, RoleAssociationRight,
@@ -517,7 +536,7 @@
export default {
  name: 'JSQD',
  components: {
    Pagination
    Pagination, ImportPicker
  },
  data() {
    const validateName = (rule, value, callback) => {
@@ -531,15 +550,8 @@
        }
      }
    }
    // const validateTypeCode = (rule, value, callback) => {
    //   if (!value) {
    //     return callback(new Error('请选择上级'))
    //   } else {
    //     callback()
    //   }
    // }
    return {
      isFullscreen: false,
      isIpad: false,
      mainHeight: 0,
      tableHeight: 0,
      form: {
@@ -635,24 +647,42 @@
        value: 'code'
      },
      PCTrue: false, // 是否展示
      APPTrue: false// 是否展示
      APPTrue: false, // 是否展示
      title_value: '数据导入 / 角色清单',
      code: '1',
      shows: false
    }
  },
  watch: {
    shows() {
      if (!this.shows) {
        this.getRoleSearch()
      }
    }
  },
  created() {
    this.getRoleSearch()
    this.getRoleTypeSearch2()
    this.getUserOrganization()
    this.handleRequest()
  },
  mounted() {
    window.addEventListener('resize', this.getHeight)
    this.getHeight()
  },
  methods: {
    handleRequest() {
      this.getRoleSearch().then(res => {
        if (res.code === '200') {
          this.getRoleTypeSearch2()
          this.getUserOrganization()
        }
      })
    },
    // 获取角色清单
    async getRoleSearch() {
      const res = await RoleSearch(this.form)
      this.tableData = res.data
      this.total = res.count
      return { code: res.code }
    },
    // 获取用户类型
    async getRoleTypeSearch() {
@@ -700,10 +730,6 @@
      this.formSetting.order = order
      this.formSetting.prop = prop
      this.getRoleTypeSearch()
    },
    upload() {
    },
    // 查询
    search() {
@@ -794,11 +820,13 @@
    // 获取页面高度
    getHeight() {
      this.$nextTick(() => {
        console.log(window.innerHeight)
        console.log(window.innerHeight)
        this.mainHeight = window.innerHeight - 250
        this.tableHeight = this.mainHeight - 100
        // this.isFullscreen = window.innerHeight < 800
        this.tableHeight = this.mainHeight - 50
        if (window.innerHeight < 769) {
          this.tableHeight = this.tableHeight - 50
        }
        this.isIpad = window.innerHeight < 769 && window.innerWidth < 1367
      })
    },
    /* 设置模块*/
@@ -1423,6 +1451,14 @@
          this.dialogFormRight.rightAPPArrSelected = ['APP']
        }
      }
    },
    // 导入按钮
    upload() {
      this.shows = true
      this.$refs.importPickerFunc.newDataFunc()
    },
    colos() {
      this.shows = false
    }
  }