wangting
2024-12-10 d63e6915b164ff94738f1848295406db79da45a7
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue
@@ -35,8 +35,8 @@
        </div>
        <div style="display: flex;justify-content:left;margin-top: 15px;">
          <div class="descBox" style="width: 40%">
            <el-descriptions :column="1" border class="margin-top" size="medium" title="属性信息">
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
            <el-descriptions :column="2" border class="margin-top" size="medium" title="属性信息">
              <el-descriptions-item :span="12" :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
                <template slot="label">
                  名称
@@ -50,7 +50,19 @@
                </template>
                <el-tag v-if="nodeRow.name">{{ nodeRow.name }}</el-tag>
              </el-descriptions-item>
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
              <el-descriptions-item  :contentStyle="descriptionOption.contentStyle+';min-width: 100px;'"
                                    :labelStyle="descriptionOption.labelStyle">
                <template slot="label">
                  图标
                </template>
                <span class="avue-icon avue-icon--small" style="display: block">
                  <svg v-if="nodeRow.imageName && nodeRow.imageName.indexOf('#')==0" aria-hidden="true">
                    <use :xlink:href="nodeRow.imageName"></use>
                  </svg>
                  <i v-else :class="nodeRow.imageName"></i>
                </span>
              </el-descriptions-item>
              <el-descriptions-item :span="12" :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
                <template slot="label">
                  实现类
@@ -60,7 +72,7 @@
                  <el-tag style="max-width: 100%;overflow: hidden;display: block">{{ nodeRow.implClass }}</el-tag>
                </el-tooltip>
              </el-descriptions-item>
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
              <el-descriptions-item :span="12" :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
                <template slot="label">
                  描述
@@ -69,7 +81,7 @@
              </el-descriptions-item>
            </el-descriptions>
          </div>
          <div class="descBox" style="width: 25%;">
          <div class="descBox" style="width: 24%;">
            <el-descriptions :column="1" border class="margin-top" size="medium" title="版本规则">
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
@@ -121,7 +133,7 @@
            </el-descriptions>
          </div>
          <div class="descBox" style="width: calc(35% - 40px);margin-right: 0">
          <div class="descBox" style="width: calc(36% - 40px);margin-right: 0">
            <el-descriptions :column="1" border class="margin-top" size="medium" title="生命周期">
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
@@ -129,6 +141,16 @@
                  生命周期
                </template>
                <el-tag v-if="nodeRow.lifeCycleId">{{ nodeRow.lifeCycleId }}</el-tag>
              </el-descriptions-item>
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
                <template slot="label">
                  备选生命周期
                </template>
                <div v-if="nodeRow.lifeCycleIds">
                  <el-tag v-for="item in nodeRow.lifeCycleIds.split(',')" style="margin-right: 5px;">{{ item }}</el-tag>
                </div>
              </el-descriptions-item>
            </el-descriptions>
          </div>
@@ -158,20 +180,29 @@
            <el-form-item label="类型名称:" prop="id">
              <el-input v-model="form.id" :readOnly="title === 'edit'"></el-input>
            </el-form-item>
            <el-form-item label="标签:">
              <el-input v-model="form.name"></el-input>
            </el-form-item>
            <el-form-item label="继承自:">
            <el-row :span="24">
              <el-col :span="12">
                <el-form-item label="标签:" prop="name">
                  <el-input v-model="form.name"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="图标:" prop="imageName">
                  <input-icon v-model="form.imageName" placeholder="请选择图标"></input-icon>
                </el-form-item>
              </el-col>
            </el-row>
            <el-form-item label="继承自:" prop="fName">
              <avue-input-tree :disabled="title === 'add'"
                               v-model="form.fName"
                               placeholder="请选择业务类型"
                               :props="{label: 'id', value: 'id',children: 'children'}"
                               :dic="inheritTreeData"></avue-input-tree>
            </el-form-item>
            <el-form-item label="实现类:">
            <el-form-item label="实现类:" prop="implClass">
              <el-input v-model="form.implClass"></el-input>
            </el-form-item>
            <el-form-item label="描述">
            <el-form-item label="描述" prop="description">
              <el-input v-model="form.description" :rows="2" type="textarea"></el-input>
            </el-form-item>
          </div>
@@ -215,7 +246,7 @@
                           :props="{label: 'id', value: 'id'}"
                           :dic="lifeData"></avue-select>
            </el-form-item>
            <el-form-item label="备选生命周期列表:" label-width="138px">
            <el-form-item label="备选生命周期列表:" label-width="138px" prop="subLifeCycleIdList">
              <avue-select multiple
                           :filterable="true"
                           v-model="form.subLifeCycleIdList"
@@ -229,17 +260,18 @@
        </div>
      </el-form>
      <div class="bottomForm">
        <h3 style="margin-bottom: 10px;">属性池列表</h3>
        <avue-crud
          size="mini"
          :data="dialogAttrData"
          :option="dialogAttrOption"
          @row-del="dialogBottomAttrDel">
          <template slot="menuLeft">
            <el-button icon="el-icon-plus" size="small" type="primary" @click="addDialogClickHandler">创建</el-button>
            <h3 style="display: inline-block;margin-right: 20px;margin-bottom: 10px;">属性池列表</h3>
            <el-button icon="el-icon-plus" size="mini" type="primary" @click="addDialogClickHandler">创建</el-button>
          </template>
        </avue-crud>
      </div>
      <span slot="footer" class="dialog-footer avue-dialog__footer">
      <span slot="footer" class="dialog-footer">
         <el-button type="primary" @click="addDialogSavaHandler">确 定</el-button>
         <el-button @click="addDialogClose">取 消</el-button>
        </span>
@@ -271,8 +303,8 @@
      >
      </avue-crud>
      <span slot="footer" class="dialog-footer">
         <el-button @click="dialogAttrClose">取 消</el-button>
         <el-button type="primary" @click="dialogAttrAddClickHandler">确 定</el-button>
         <el-button @click="dialogAttrClose">取 消</el-button>
        </span>
    </el-dialog>
@@ -496,6 +528,7 @@
        index: false,
        selection: false,
        refreshBtn: false,
        header:false,
        column: [
          {
            label: '类型名',
@@ -577,12 +610,16 @@
        height: 450,
        searchMenuSpan: 8,
        header: false,
        selectable:function(row){
          return row.selectable;
        },
        column: [
          {
            label: '属性名',
            prop: 'id',
            sortable: true,
            search: true,
            width:260
          },
          {
            label: '属性类型',
@@ -594,6 +631,7 @@
            label: '初始值',
            prop: 'defaultValue',
            sortable: true,
            width: 200
          },
          {
            label: '说明',
@@ -610,6 +648,9 @@
          {required: true, message: '请输类型名称', trigger: 'blur'},
          {validator: this.validateEnglishOnly, trigger: 'blur'}
        ],
        imageName:[
          {required: true, message: '请选择图标', trigger: 'submit'},
        ],
        revLevel: [
          {required: true, message: '请选择版本规则', trigger: 'blur'},
        ],
@@ -623,8 +664,10 @@
        editBtn: false,
        refreshBtn: false,
        selection: false,
        height: 210,
        height: 220,
        addBtn: false,
        gridBtn:false,
        columnBtn:false,
        menuWidth:100,
        // index:false,
        column: [
@@ -632,12 +675,14 @@
            label: '属性名',
            prop: 'id',
            sortable: true,
            width:260,
          },
          {
            prop: 'btmTypeId',
            label: '业务类型',
            sortable: true
            sortable: true,
            width: 200
          },
          {
            label: '属性类型',
@@ -649,7 +694,7 @@
            label: '初始值',
            prop: 'defaultValue',
            sortable: true,
            width:150,
            width:200,
          },
          {
            label: '说明',
@@ -673,22 +718,26 @@
          {
            prop: 'id',
            label: '属性名',
            sortable: true
            sortable: true,
            width:260
          },
          {
            prop: 'btmTypeId',
            label: '业务类型',
            sortable: true
            sortable: true,
            width:200
          },
          {
            prop: 'attributeDataType',
            label: '属性类型',
            sortable: true
            sortable: true,
            width:150
          },
          {
            prop: 'defaultValue',
            label: '默认值',
            sortable: true
            sortable: true,
            width: 200
          },
          {
            prop: 'description',
@@ -734,8 +783,8 @@
        }
      ],
      descriptionOption: {
        labelStyle: 'text-align:center;width:100px;',
        contentStyle: 'max-width:200px;text-align:center;word-break;break-all;'
        labelStyle: 'text-align:center;width:110px;',
        contentStyle: 'min-width:200px;text-align:center;word-break:break-all;'
      },
      icons: {
        id: 'el-icon-finished',
@@ -880,7 +929,7 @@
      this.form = {...this.nodeRow};
      this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 字符串false转换为布尔值
      // this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id;
      this.form.subLifeCycleIdList = this.nodeRow.lifeCycleIds.split(',');
      this.form.subLifeCycleIdList = this.nodeRow.lifeCycleIds?this.nodeRow.lifeCycleIds.split(','):[];
      this.dialogAttrData = this.nodeRow.attributes ? JSON.parse(this.nodeRow.attributes) : [];
      function  processChildren(item,fName) {
        if (item.children && item.children.length > 0) {
@@ -929,8 +978,11 @@
    // 查询属性池列表数据
    getAttrDialogDta() {
      gridAttribute(this.attrPage.currentPage, this.attrPage.pageSize, this.searchAttrParams).then(res => {
        const data = res.data.data;
        this.dialogAttrSaveData = data;
        const data = res.data.data.map(item=>{
          item.selectable=!this.dialogAttrData.some(existingItem => existingItem.id === item.id);
          return item;
        });
        this.dialogAttrSaveData=data;
        this.attrPage.total = res.data.total;
        this.dialogAttrLoading = false;
      }).catch(err => {
@@ -951,7 +1003,9 @@
    // 添加属性池 行点击
    dialogAttrRowClickHandler(row) {
      if(!row.selectable){
        return;
      }
      func.rowClickHandler(
        row,
        this.$refs.dialogAttrCrud,
@@ -999,35 +1053,15 @@
    // 添加属性池 保存
    dialogAttrAddClickHandler() {
      let hasDuplicate = false;
      // 先创建一个临时数组来存储不重复的项
      const newItems = [];
      this.dialogAttrSelectList.forEach(item => {
        const exists = this.dialogAttrData.some(existingItem => existingItem.id === item.id);
        if (exists) {
          hasDuplicate = true;
          return;
        }
        // 如果没有重复项,则将该项添加到临时数组中
        newItems.push({
        this.dialogAttrData.push({
          id: item.id,
          attributeDataType: item.attributeDataType,
          defaultValue: item.defaultValue,
          description: item.description
        });
      });
      if (hasDuplicate) {
        this.$message.error('请检查是否有添加重复项!');
      } else {
        // 如果没有重复项,将新项添加到 dialogAttrData
        this.dialogAttrData.push(...newItems);
        this.attrPollDialogVisible = false;
      }
      this.attrPollDialogVisible = false;
    },
    // 属性池删除
@@ -1411,7 +1445,7 @@
.dialogForm > div {
  border: 1px solid #EBEEF5;
  border-radius: 2px;
  padding: 25px 20px 5px 10px; /* 上 右 下 左 */
  padding: 15px 20px 0 10px; /* 上 右 下 左 */
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
}