lihang
2023-07-13 a3c868db4d017961be2d394eadb7d428045d5adc
Source/UBCS-WEB/dist/src/views/system/PasswordManagement/Passwordvalue.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,131 @@
<template>
  <basic-container>
    <div class="headbox">
      <sapn>组合方式:</sapn>
      <el-select v-model="formInline.region" placeholder="活动区域" @change="selectchange">
        <el-option label="大写字母" value="0"></el-option>
        <el-option label="小写字母" value="1"></el-option>
        <el-option label="特殊字符" value="2"></el-option>
        <el-option label="数字" value="3"></el-option>
      </el-select>
    </div>
    <avue-crud ref="crud" v-model="form" :option="option" :data="data"  @row-save="rowSave" @row-update="rowUpdate" @row-del="rowDel" :page.sync="page" >
    </avue-crud>
  </basic-container>
</template>
<script>
import {getPage} from "@/api/system/passwordvalue";
export default {
  name: "passwords.vue",
  data() {
    return {
      form:{},
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 100
      },
      formInline:{
        user: '',
        region: ''
      },
      data: [],
      option:{
        headerAlign: 'center',
        align: 'center',
        border: true,
        index: true,
        rowKey:'id',
        column:[
          {
            label: '名称',
            prop: 'name',
            align: 'left',
          },
          {
            label: '描述',
            prop: 'text',
          }
        ]
      }
      // option:{},
      // option1:{
      //   column:[
      //     {
      //       label:'姓名',
      //       prop:'name',
      //       search:true
      //     }
      //   ]
      // },
      // option2:{
      //   column:[
      //     {
      //       label:'用户名',
      //       prop:'username',
      //       search:true
      //     }, {
      //       label:'密码',
      //       prop:'password',
      //       type:'password',
      //       search:true
      //     }, {
      //       label:'姓名',
      //       prop:'name',
      //       search:true
      //     }
      //   ]
      // },
    }
  },
  created() {
    this.onLoad()
  },
  methods:{
    rowDel(row,index,done){
      done(row)
      console.log(row,index,done)
      console.log(done)
    },
    rowSave(row,done){
      console.log(row,done)
    },
    rowUpdate(row,index,done){
      done(row)
    },
    //下拉菜单切换,显示不同的密码取值方式
    selectchange(){
      if(this.formInline.region=="shanghai"){
        this.option=this.option1;
      }else{
        this.option=this.option2;
      }
      this.$refs.crud.refreshTable()
    },
    onLoad(page, params = {}) {
      // this.loading = true;
      getPage(this.page.currentPage, this.page.pageSize, Object.assign(params, this.query)).then(res => {
        // const data = res.data.data;
        // this.page.total = data.total;
        // this.data = data.records;
        // this.loading = false;
        // this.selectionClear();
        console.log(res)
        // this.data=res.data.data.content
      });
    }
  }
}
</script>
<style lang="scss">
.headbox{
  margin-bottom: 20px;
}
</style>