wangting
2024-11-21 819430870fb02cd550b1d925261c16f14157affd
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/statusPool/index.vue
@@ -21,8 +21,7 @@
        </el-button>
        <el-button icon="el-icon-upload2" plain size="small" type="primary" @click="uploadClickHandler">导入
        </el-button>
        <el-button icon="el-icon-check" plain size="small" type="primary"
                   @click="checkViewClickHandler">查看使用范围
        <el-button icon="el-icon-view" plain size="small" type="primary"  @click="checkViewClickHandler">查看使用范围
        </el-button>
      </template>
@@ -31,6 +30,15 @@
        </el-button>
        <el-button icon="el-icon-delete" plain size="small" type="text" @click="delRowClickHandler(row)">删除
        </el-button>
      </template>
      <template #icon="{ row }">
          <span class="avue-icon avue-icon--small">
            <svg v-if="row.icon && row.icon.indexOf('#')==-1" aria-hidden="true">
              <use :xlink:href="row.icon"></use>
            </svg>
            <i v-else :class="row.icon"></i>
          </span>
      </template>
    </avue-crud>
@@ -41,10 +49,10 @@
      :visible.sync="visible"
      append-to-body="true"
      class="avue-dialog"
      width="40%"
      width="500px"
      @close="visibleCloseHandler"
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
      <el-form ref="form" :model="form" :rules="rules" label-width="80px" size="small">
        <el-row>
          <el-col :span="24">
            <el-form-item label="名称:" prop="id">
@@ -57,6 +65,12 @@
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="图标:" prop="icon">
              <avue-input-icon v-model="form.icon" :icon-list="iconList" placeholder="请选择图标">
              </avue-input-icon>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="描述:" prop="description">
              <el-input v-model="form.description" :rows="2" type="textarea"></el-input>
            </el-form-item>
@@ -64,14 +78,14 @@
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
         <el-button @click="visibleCloseHandler">取 消</el-button>
         <el-button type="primary" @click="addSaveHandler">确 定</el-button>
         <el-button @click="visibleCloseHandler">取 消</el-button>
        </span>
    </el-dialog>
    <!-- 导入 -->
    <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入"
                 @updata="getTreeList"></upload-file>
                 @updata="getList"></upload-file>
    <!-- 查看使用范围 -->
    <el-dialog
@@ -93,18 +107,19 @@
      </avue-crud>
    </el-dialog>
  </basic-container>
</template>
<script>
import {gridStatus, addSave, editSave, deleteStatus, exportStatus, listUsed} from "@/api/modeling/statusPool/api";
import func from "@/util/func";
import basicOption from "@/util/basic-option";
import iconList from "@/config/iconList";
export default {
  name: "index",
  data() {
    return {
      iconList: iconList,
      loading: false,
      data: [],
      option: {
@@ -118,6 +133,10 @@
            label: '名称',
            prop: 'id',
            sortable: true,
          },
          {
            label: '图标',
            prop: 'icon'
          },
          {
            label: '标签',
@@ -141,6 +160,7 @@
        searchMenuSpan: 8,
        refreshBtn: false,
        selection: false,
        header:false,
        column: [
          {
            label: '名称',
@@ -187,11 +207,10 @@
    }
  },
  created() {
    this.getTreeList();
    this.getList();
  },
  methods: {
    // 左侧树请求
    getTreeList() {
    getList() {
      gridStatus(this.page.currentPage, this.page.pageSize).then(res => {
        const data = res.data.data;
        this.data = data;
@@ -204,7 +223,7 @@
    // 表格刷新
    handleRefresh() {
      this.getTreeList();
      this.getList();
    },
    // 表格多选
@@ -215,13 +234,13 @@
    //  条数
    sizeChange(val) {
      this.page.pageSize = val;
      this.getTreeList();
      this.getList();
    },
    // 页码
    currentChange(val) {
      this.page.currentPage = val;
      this.getTreeList();
      this.getList();
    },
    // 行单选
@@ -267,7 +286,7 @@
        deleteStatus(this.selectList).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.obj);
            this.getTreeList();
            this.getList();
          }
        })
      }).catch(() => {
@@ -290,7 +309,7 @@
        deleteStatus(list).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.obj);
            this.getTreeList();
            this.getList();
          }
        })
      }).catch(() => {
@@ -323,14 +342,12 @@
            if (res.data.code === 200) {
              this.$message.success(res.data.obj);
              this.loading = true;
              this.getTreeList();
              this.getList();
              this.visible = false;
            } else {
              this.$message.error(res.data.obj);
            }
          }).catch(error => {
            this.$message.error(error);
          });
          })
        } else {
          return false;
        }
@@ -389,7 +406,6 @@
        this.checkViewData = this.checkViewDataSearch;
        return done();
      }
      ;
      this.checkViewData = this.checkViewData.filter(item => {
        return item.name && item.name.includes(name);