ludc
2023-05-14 b46cf401da847d7cca6269c6b2ffb04f6f72691a
Source/UBCS-WEB/src/views/omd/enum.vue
ÎļþÃû´Ó Source/UBCS-WEB/src/views/omd/dict.vue ÐÞ¸Ä
@@ -49,7 +49,7 @@
        <el-tag>{{ row.isSealed === 0 ? '否' : '是' }}</el-tag>
      </template>
    </avue-crud>
    <el-dialog :title="`[${dictValue}]枚举项配置`"
    <el-dialog :title="`[${name}]枚举项配置`"
               append-to-body
               :visible.sync="box"
               width="1000px">
@@ -80,7 +80,7 @@
            icon="el-icon-delete"
            v-if="permission.dict_delete"
            plain
            @click="handleDelete"
            @click="handleDeleteChild"
          >删 é™¤
          </el-button>
        </template>
@@ -103,23 +103,23 @@
</template>
<script>
  import {
    getParentList,
    getChildList,
    remove,
    update,
    add,
    getDict,
    getDictTree
  } from "@/api/omd/dict";
  import {optionParent, optionChild} from "@/const/omd/dict";
import {
  getParentList,
  getChildList,
  remove,
  update,
  add,
  getDict,
  getDictTree, addChild, updateChild, getDictChild, removeChild
} from "@/api/omd/enum";
  import {optionParent, optionChild} from "@/const/omd/enum";
  import {mapGetters} from "vuex";
  export default {
    data() {
      return {
        dictValue: '暂无',
        parentId: -1,
        parentoid: -1,
        formParent: {},
        formChild: {},
        selectionList: [],
@@ -158,7 +158,7 @@
      ids() {
        let ids = [];
        this.selectionList.forEach(ele => {
          ids.push(ele.id);
          ids.push(ele.oid);
        });
        return ids.join(",");
      }
@@ -168,18 +168,20 @@
    },
    methods: {
      initData() {
        getDictTree().then(res => {
          const column = this.findObject(this.optionChild.column, "parentId");
        getDictTree(this.pageParent.currentPage,
                    this.pageParent.pageSize,
                    this.query).then(res => {
          const column = this.findObject(this.optionChild.column, "parentoid");
          column.dicData = res.data.data;
        });
      },
      handleAdd(row) {
        this.formChild.dictValue = "";
        this.formChild.dictKey = "";
        this.formChild.value = "";
        this.formChild.name = "";
        this.formChild.sort = 0;
        this.formChild.isSealed = 0;
        this.formChild.remark = "";
        this.formChild.parentId = row.id;
        this.formChild.parentoid = row.oid;
        this.$refs.crudChild.rowAdd();
      },
      rowSave(row, done, loading) {
@@ -220,7 +222,7 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
            return remove(row.oid);
          })
          .then(() => {
            this.onLoadParent(this.pageParent);
@@ -232,13 +234,13 @@
      },
      handleRowClick(row) {
        this.query = {};
        this.parentId = row.id;
        this.dictValue = row.dictValue;
        this.parentId = row.oid;
        this.name = row.name;
        const code = this.findObject(this.optionChild.column, "code");
        const code = this.findObject(this.optionChild.column, "value");
        code.value = row.code;
        const parentId = this.findObject(this.optionChild.column, "parentId");
        parentId.value = row.id;
        // const parentoid = this.findObject(this.optionChild.column, "parentoid");
        this.parentoid = row.oid;
        this.box = true;
        this.onLoadChild(this.pageChild);
@@ -284,7 +286,7 @@
      },
      beforeOpen(done, type) {
        if (["edit", "view"].includes(type)) {
          getDict(this.formParent.id).then(res => {
          getDict(this.formParent.oid).then(res => {
            this.formParent = res.data.data;
          });
        }
@@ -300,7 +302,8 @@
        this.onLoadParent(this.pageParent, this.query);
      },
      rowSaveChild(row, done, loading) {
        add(row).then(() => {
        row.parentoid = this.parentoid;
        addChild(row).then(() => {
          this.onLoadChild(this.pageChild);
          this.$message({
            type: "success",
@@ -313,7 +316,7 @@
        });
      },
      rowUpdateChild(row, index, done, loading) {
        update(row).then(() => {
        updateChild(row).then(() => {
          this.onLoadChild(this.pageChild);
          this.$message({
            type: "success",
@@ -332,7 +335,7 @@
          type: "warning"
        })
          .then(() => {
            return remove(row.id);
            return removeChild(row.oid);
          })
          .then(() => {
            this.onLoadChild(this.pageChild);
@@ -370,7 +373,7 @@
          type: "warning"
        })
          .then(() => {
            return remove(this.ids);
            return removeChild(this.ids);
          })
          .then(() => {
            this.onLoadChild(this.pageChild);
@@ -386,7 +389,7 @@
          this.initData();
        }
        if (["edit", "view"].includes(type)) {
          getDict(this.formChild.id).then(res => {
          getDictChild(this.formChild.oid).then(res => {
            this.formChild = res.data.data;
          });
        }
@@ -429,7 +432,7 @@
        getChildList(
          page.currentPage,
          page.pageSize,
          this.parentId,
          this.parentoid,
          Object.assign(params, this.query)
        ).then(res => {
          this.dataChild = res.data.data;