fujunling
2023-06-08 36c7ff87bec2f261b28859bfb9cb7c1692e3d0ed
Source/UBCS-WEB/src/views/modeling/original.vue
@@ -2,18 +2,10 @@
  <el-container>
    <el-main>
      <basic-container>
        <avue-crud v-model="form"
          ref="crud"
          :option="option"
          :data="data"
          @on-load="onLoad"
          :page.sync="page"
          @refresh-change="refreshChange"
          @row-click="rowClick">
               <template slot="radio"
                  slot-scope="{row}">
                      <el-radio v-model="selectRow"
                          :label="row.$index">&nbsp;
        <avue-crud v-model="form" ref="crud" :option="option" :data="data" @on-load="onLoad" :page.sync="page"
          @refresh-change="refreshChange" @row-click="rowClick">
          <template slot="radio" slot-scope="{row}">
            <el-radio v-model="selectRow" :label="row.$index">&nbsp;
                      </el-radio>
                </template>
          <template slot="menu">
@@ -21,24 +13,21 @@
             <el-button icon="el-icon-delete" size="small" type="text" @click="deleteSave">删除</el-button>
          </template>
         <template slot="menuLeft">
            <el-button size="small"
              type="primary"
              icon="el-icon-plus"
              @click="addSave">新&nbsp;&nbsp;增
            <el-button size="small" type="primary" icon="el-icon-plus" @click="addSave">新&nbsp;&nbsp;增
            </el-button>
            <el-button size="small"
                       plain
                       type="primary"
                       icon="el-icon-zoom-in"
                       @click="applyRangeOpen">查看使用范围
            <el-button size="small" plain type="primary" icon="el-icon-zoom-in" @click="applyRangeOpen">查看使用范围
            </el-button>
          </template>
          <template slot="typeValue" slot-scope="{row}">
            <el-tag>{{ row.typeValue }}</el-tag>
          </template>
        </avue-crud>
        <el-dialog :visible.sync="applyRange.display" append-to-body :title="applyRange.title" width="600px"
        <!-- <el-dialog :visible.sync="applyRange.display" append-to-body :title="applyRange.title" width="600px"
        @close="applyRangeClose">
            <avue-crud v-model="applyRange.model" :option="applyRange.option" :data="applyRange.data" class="applyRangeTable"
            ></avue-crud>
        </el-dialog>
        </el-dialog> -->
        <Versionpackage :rangeData="applyRangeData" ref="applyRange"></Versionpackage>
      </basic-container>
    </el-main>
    <el-aside>
@@ -148,6 +137,7 @@
  add,
  update, getPage, getApplyRange
} from "@/api/omd/OmdAttribute";
import Versionpackage from "./Versionpackage.vue";
export default {
  name: "original",
@@ -158,18 +148,19 @@
        currentPage: 1,
        total: 100
      },
      selectRow: '',
      selectRow: "",
      data: [],
      form:{},
      attribute: {
        nullable: true
      },
      applyRangeData: [],
      option: {
        height: "550px",
        headerAlign: 'center',
        headerAlign: "center",
        border: true,
        index: true,
        rowKey: 'id',
        rowKey: "id",
        tabs: true,
        stripe:true,
        indexFixed: false,
@@ -179,125 +170,86 @@
        editBtn:false,
        delBtn:false,
        column: [{
            label: '选择',
            prop: 'radio',
          label: "选择",
          prop: "radio",
            width: 60,
            hide: false,
            display: false
          },
          {
            label: '属性编号',
            prop: 'id',
            align: 'left',
        }, {
          label: "属性编号",
          prop: "id",
          align: "left",
            display: false,
            width: 200,
            required: true
          }, {
            label: '属性名称',
            prop: 'name',
            align: 'left',
          label: "属性名称",
          prop: "name",
          align: "left",
            display: false
          },
          {
            label: '标签',
            prop: 'hashtag',
        }, {
          label: "标签",
          prop: "hashtag",
            // hide: true,
            display: false
          },
          {
            label: '是否使用枚举',
            prop: 'usingDict',
            type: 'switch',
        }, {
          label: "是否使用枚举",
          prop: "usingDict",
          type: "switch",
            hide: true,
            labelWidth: 132,
            display: false,
            dicData: [{
              label: '是',
              value: 'true'
            label: "是",
            value: "true"
            }, {
              label: '否',
              value: 'false'
            label: "否",
            value: "false"
            }]
          },
          {
            label: '属性类型',
            prop: 'typeValue',
        }, {
          label: "属性类型",
          prop: "typeValue",
            display: false,
            // hide: true
          },
          {
            label: '默认值',
            prop: 'defaultValue',
        }, {
          label: "默认值",
          prop: "defaultValue",
            display: false
          },
          {
            label: '允许为空',
            prop: 'nullable',
            type: 'switch',
        }, {
          label: "允许为空",
          prop: "nullable",
          type: "switch",
            display: false,
            hide: true,
            labelWidth: 132,
            dicData: [{
              label: '否',
              value: 'false'
            label: "否",
            value: "false"
            }, {
              label: '是',
              value: 'true'
            label: "是",
            value: "true"
            }]
          },
          {
        }, {
            label: "长度",
            prop: "maxLength",
            hide: true,
            display: false
          },
          {
            label: '描述',
            prop: 'description',
        }, {
          label: "描述",
          prop: "description",
            type: "textarea",
            display: false
          },
        ]
      },
      applyRange: {
        model: "",
        title: "应用的业务类型",
        option: {
          height: 360,
          addBtn: false,
          refreshBtn: false,
          columnBtn: false,
          menu: false,
          border: true,
          reserveSelection: true,
          searchMenuSpan:8,
          searchShowBtn: false,
          highlightCurrentRow: true,
          column: [
            {
                label: '业务类型编号',
                prop: 'id',
                align: 'left',
              },
              {
                label: '业务类型名称',
                prop: 'name',
                align: 'left',
              },
          ]
        },
        data: [],
        display: false,
      },
      itemForm:{
        itemData: {},
        activeName: 'referTab',
        activeName: "referTab",
        form:{}
      }
    }
    };
  },
  created() {
  },
  methods: {
    refreshChange() {
@@ -314,7 +266,7 @@
    deleteSave(){
      remove(this.itemForm.itemData).then(res => {
        this.$message.success("删除成功");
      })
      });
    },
    onLoad(page, params = {}) {
      this.loading = true;
@@ -323,37 +275,36 @@
        this.page.total = data.total;
        this.data = data.records;
        this.loading = false;
        this.data = res.data.data.records
        this.data = res.data.data.records;
        this.itemData = this.data[0];
      })
      });
    },
    rowClick(row) {
      this.itemForm.itemData = row;
      this.selectRow = row.$index;
      this.attribute = row;
    }
    ,selectBtmType(){
    },
    selectBtmType() {
        this.referType.display = true;
        this.referType.title = "请选择" + this.referType.value
      this.referType.title = "请选择" + this.referType.value;
    },
    applyRangeOpen(){
        if (!this.selectRow){
      if (!this.selectRow && this.selectRow != 0) {
          this.$message({
            type:"warning",
            message: "请先选择属性"
          })
        });
        }
        var oid = this.data[this.selectRow].oid;
        getApplyRange(oid).then(res => {
            this.applyRange.data = res.data.data;
        })
        this.applyRange.display = true;
        this.applyRangeData = res.data.data;
        this.$refs.applyRange.rangeData = this.applyRangeData;
        this.$refs.applyRange.showDialog = true;
      });
    },
    applyRangeClose(){
      this.applyRange.data = [];
      this.applyRange.display = false;
    }
  },
  components: { Versionpackage }
}
</script>