田源
2023-10-12 b4c7c6a738f44afadbc388bb774ac044e7fafe38
Source/UBCS-WEB/src/views/modeling/status.vue
@@ -11,36 +11,41 @@
                 @row-del="rowDel"
                 @refresh-change="refreshChange"
                 @search-reset="searchChange"
                 @search-change="searchChange">
                 @search-change="searchChange"
                 @row-click="rowClick">
        <template slot="menuLeft">
          <el-tooltip class="item" effect="dark" content="查找状态池使用范围" placement="top">
          <el-tooltip class="item" effect="dark" content="查找状态使用范围" placement="top">
            <el-button size="small"
                       plain
                       type="primary"
                       icon="el-icon-zoom-in"
                       @click="handleSearch">查看使用范围
                       @click="applyRangeSearch">查看使用范围
            </el-button>
          </el-tooltip>
        </template>>
        </template>
        <template slot="radio"
                  slot-scope="{row}">
          <el-radio v-model="selectRow"
                    :label="row.$index">&nbsp;
          </el-radio>
        </template>
      </avue-crud>
      <el-dialog title="查看使用范围"
                 append-to-body
                 :visible.sync="packageSearchBox"
                 width="1200px">
        <versionpackage></versionpackage>
      </el-dialog>
      <versionpackage :rangeData="applyRangeData" ref="applyRange"></versionpackage>
    </basic-container>
  </template>
  <script>
  import { getPage,add,update,remove } from '../../api/omd/status';
  import { getPage,add,update,remove,getApplyRange } from '../../api/omd/status';
  export default {
    name: "status",
    data(){
      return {
        //查看使用范围
        packageSearchBox:false,
        // 点击数据
        selectRow: '',
        selectRowData: {},
        //分页数据
        page: {
          pageSize: 10,
@@ -51,34 +56,71 @@
        ],
        form:{},
        option:{
          height:'auto',
          calcHeight:20,
          headerAlign:'center',
          align: 'center',
          columnBtn:false,
          border: true,
          index: true,
          searchMenuSpan:5,
          highlightCurrentRow: true,
          stripe:true,
          column:[
            {
              label: '选择',
              prop: 'radio',
              width: 120,
              display: false
            },
            {
              label:'英文名称',
              prop: 'id',
              search: true
              search: true,
              rules: [{
                required: true,
                message: '英文名称不能为空',
                trigger: 'blur'
              }]
            },
            {
              label:"中文名称",
              prop:"name",
              label:'中文名称',
              prop:'name',
              search:true,
              rules: [{
                required: true,
                message: '中文名称不能为空',
                trigger: 'blur'
              }]
            },
            {
              label: "描述",
              prop:"description",
              type:"textarea"
              label: '描述',
              prop:'description',
              type:'textarea'
            }
          ]
        }
        },
        applyRangeData: []
      }
    },
    methods:{
      handleSearch(){
        this.packageSearchBox=true
      rowClick(row){
        this.selectRow = row.$index;
        this.selectRowData = row;
      },
      applyRangeSearch(){
        if (!this.selectRow && this.selectRow != 0){
          console.log(this.selectRow);
          this.$message({
            type:"warning",
            message: "请先选择属性"
          })
        }
        getApplyRange(this.selectRowData.id).then(res => {
          this.applyRangeData = res.data.data;
          this.$refs.applyRange.rangeData = this.applyRangeData;
          this.$refs.applyRange.showDialog = true;
        })
      },
      getList() {
        this.loading = true;
@@ -121,10 +163,22 @@
        })
      },
      searchChange(params, done) {
        if (done) done();
        this.params = params;
        this.loading = true;
        this.page.currentPage = 1;
        this.getList();
        const p = {};
        if(params.id){
          p["id_like"] = params.id;
        }
        if(params.name){
          p["name_like"] = params.name
        }
        getPage(this.page.currentPage,this.page.pageSize,p).then(res => {
          const data = res.data.data
          this.loading = false;
          this.page.total = data.total;
          this.data = data.records;
          done();
        })
        this.$message.success('搜索成功')
      },
      refreshChange() {
@@ -134,8 +188,7 @@
    }
  }
  </script>
  <style scoped>
  </style>