fangyuan
2023-01-05 71cfadcd79468058c75fd356faf2d1fb52f79deb
src/views/layout/components/Header/index.vue
@@ -56,35 +56,40 @@
      </div>
      <el-dialog :visible.sync="channelSettingVisible" width="25%" title="消息栏目设置" v-if="channelSettingVisible"
        :before-close="handleChannelClose">
        <el-table
            ref="multipleTable"
            :header-cell-style="{
            'font-size': '14px',
            'font-weight': '650',
            'line-height': '45px',
          }"
            :data="channelData"
            style="width: 100%"
        >  <el-table-column
      type="selection"
      width="55"
      >
    </el-table-column>
          <el-table-column prop="columnName" label="全部" min-width="5"  align="center">
        <el-table ref="multipleTable" :header-cell-style="{
                                        'font-size': '14px',
                                        'font-weight': '650',
                                        'line-height': '45px',
                                      }" :data="channelData" style="width: 100%" @selection-change="handleSelectionChange">
          <el-table-column width="55">
          </el-table-column>
          <el-table-column prop="columnName" label="全部" min-width="5" align="center">
            <!-- <template slot-scope="scope">{{ scope.row.id }}</template> -->
          </el-table-column>
          </el-table>
          <el-button type="button" @click="channelSetting">更新</el-button>
          <el-button type="button" @click="channelSetting">取消</el-button>
          <el-table-column label="启用" min-width="5">
            <template slot-scope="scope">
              <!-- @change="handleChangeStatus(scope.row)" -->
              <el-switch class="switchStyle"
              v-model="scope.row.isReceive"
              active-color="#3fef9a"
              inactive-color="#000212"
              :active-value="1"
              :inactive-value="0"
              @change="handleSelectionChange(scope.row)">
              </el-switch>
            </template>
          </el-table-column>
        </el-table>
        <el-button type="button" @click="cancelChannel">取消</el-button>
      </el-dialog>
      <el-dialog :visible.sync="updatePasswordDialog" width="40%" title="修改密码" v-if="updatePasswordDialog"
        :before-close="handleClose">
        <updatePassword />
      </el-dialog>
      <el-dialog :visible.sync="baseInformationVisible" width="35%" title="基本信息" v-if="baseInformationVisible"
        >
      <el-dialog :visible.sync="baseInformationVisible" width="35%" title="基本信息" v-if="baseInformationVisible">
        <el-form :model="info" class="info" label-width="6vw">
          <el-form-item label="用户ID" min-width="6">
            <el-input v-model="info.id"></el-input>
@@ -114,6 +119,7 @@
<script>
import updatePassword from "./updatePassword";
import users from "@/api/users";
import { Message } from "element-ui";
export default {
  components: {
@@ -123,8 +129,8 @@
    return {
      baseInformationVisible: false,
      updatePasswordDialog: false,
      channelSettingVisible:false,
      checked3:true,
      channelSettingVisible: false,
      checked3: true,
      menuLeftList: [
        {
          label: '驾驶舱',
@@ -155,13 +161,39 @@
      messageCounts: 0,
      keyword: '',
      info: null,
      show: false
      show: false,
      messageColumnSet: {
      }
    };
  },
  created() {
    this.setLoginInfo();
  },
  methods: {
    cancelChannel(){
      this.channelSettingVisible=false
    },
    handleSelectionChange(val) {
      const userInfo = JSON.parse(sessionStorage.getItem('user'));
      this.messageColumnSet.userId = userInfo.user.id
      this.messageColumnSet.messageColumnId = val.id
      if (val.isReceive == null) {
        this.messageColumnSet.isReceive = 1
      }
      if (val.isReceive == 1) {
        this.messageColumnSet.isReceive = 1
      }
      else if (val.isReceive == 0) {
        this.messageColumnSet.isReceive = 0
      }
      this.$axios({
        method: 'post',
        url: 'sccg/message_column_set/update',
        data: this.messageColumnSet
      }).then(res => {
        this.$message.success("订阅成功")
      })
    },
    baseInfo() {
      this.baseInformationVisible = true;
      const name = sessionStorage.getItem('name');
@@ -174,15 +206,16 @@
          this.info = res.data.user;
        })
    },
    channelSetting(){
      this.channelSettingVisible=true;
    channelSetting(row) {
      this.channelSettingVisible = true;
      const userInfo = JSON.parse(sessionStorage.getItem('user'));
      this.$axios({
        method: 'get',
        url: 'sccg/message_column/getShowColumn?'+'id='+userInfo.user.id
        url: 'sccg/message_column/getShowColumn?' + 'id=' + userInfo.user.id
      })
        .then(res => {
          this.channelData=res.data
          this.channelData = res.data
          // this.channelData.forEach(item=>{this.$refs.multipleTable.toggleRowSelection(item,true);console.log(this.$refs.multipleTable.toggleRowSelection(item,true))})
        })
    },
    handleChannelClose(done) {
@@ -260,10 +293,10 @@
        window.open('http://cockpit.patstech.net:28081/cockpit/dist/board.html#/share-board/zfu0LsJ9', '_blank');
      }
      if (data.id === '2f') {
        this.$router.push({path: "/home/video"})
        this.$router.push({ path: "/home/video" })
      }
      if (data.id === '3f') {
        this.$router.push({path: "/home/operate/casepool/pool"})
        this.$router.push({ path: "/home/operate/casepool/pool" })
      }
    }
  }