11
heimawl
2023-08-07 66223fb36c73a4060b80f96b1d1596726a230f9c
src/views/system/label/index.vue
@@ -195,8 +195,8 @@
                <template slot-scope="scope">
                  <el-switch
                    v-model="scope.row.isupload"
                    :active-value="1"
                    :inactive-value="0"
                    :active-value="'1'"
                    :inactive-value="'0'"
                    active-color="#13ce66"
                    @change="handleStatusChange(scope.row)"
                  ></el-switch>
@@ -325,18 +325,21 @@
</template>
<script>
import { changetagcategory } from "@/api/system/label";
import {
  toamendtag,
  addapitag,
  detailstag,
  deletetag,
  changetagcategory,
  toamendtagcategory,
  addtagcategory,
  deletetagcategory,
  listtag,
  tagclassifylist,
} from "@/api/system/label";
  listbase_tag,
  getbase_tag,
  addbase_tag,
  updatebase_tag,
  delbase_tag,
} from "@/api/smartorpor/base_tag";
import {
  listbase_tagcategory,
  getbase_tagcategory,
  addbase_tagcategory,
  updatebase_tagcategory,
  delbase_tagcategory,
} from "@/api/smartorpor/base_tagcategory";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@@ -510,7 +513,7 @@
  methods: {
    /** 查询标签列表 */
    getList() {
      listtag(this.addDateRange(this.queryParams)).then((response) => {
      listbase_tag(this.addDateRange(this.queryParams)).then((response) => {
        console.log(response);
        this.total = response.total;
        this.userList = response.rows;
@@ -543,13 +546,16 @@
    // 添加/修改标签
    Maintenancetag() {
      if (this.lstamendtag) {
        toamendtag(this.addDateRange(this.tagform)).then((response) => {
        updatebase_tag(this.addDateRange(this.tagform)).then((response) => {
          console.log(response);
          this.lstamendtagVisible = false;
          this.getList();
        });
      } else {
        addapitag(this.addDateRange(this.tagform)).then((response) => {
        addbase_tag(this.addDateRange(this.tagform)).then((response) => {
          console.log(response);
          this.lstamendtagVisible = false;
          this.getList();
        });
      }
@@ -564,7 +570,7 @@
    // 获取标签分类
    gitclasify() {
      tagclassifylist(this.addDateRange(this.forms)).then((response) => {
      listbase_tagcategory(this.addDateRange(this.forms)).then((response) => {
        console.log(response);
        this.numberlb = response.total;
        this.editableTabs = response.rows;
@@ -574,14 +580,14 @@
    submitsidecolumn() {
      if (this.amendtag) {
        this.classifyform.tagcategoryid = this.idds;
        toamendtagcategory(this.addDateRange(this.classifyform)).then(
        updatebase_tagcategory(this.addDateRange(this.classifyform)).then(
          (response) => {
            console.log(response);
            this.gitclasify();
          }
        );
      } else {
        addtagcategory(this.addDateRange(this.classifyform)).then(
        addbase_tagcategory(this.addDateRange(this.classifyform)).then(
          (response) => {
            console.log(response);
            this.gitclasify();
@@ -597,7 +603,7 @@
    //删除分类
    deletefenlei(row) {
      if (this.deleteVisible) {
        deletetagcategory(this.idds).then((response) => {
        delbase_tagcategory(this.idds).then((response) => {
          console.log(response);
          this.gitclasify();
        });
@@ -637,17 +643,17 @@
    // 标签状态修改
    handleStatusChange(row) {
      console.log(row.isupload);
      let text = row.isupload == 0 ? "停用" : "启用";
      let text = row.isupload == "0" ? "停用" : "启用";
      this.$modal
        .confirm('确认要"' + text + '""' + row.tagname + '"标签吗?')
        .then(function () {
          return changetagcategory(row.tagid, row.isupload);
          return updatebase_tag(row);
        })
        .then(() => {
          this.$modal.msgSuccess(text + "成功");
        })
        .catch(function () {
          row.isupload = row.isupload == 0 ? 1 : 0;
          row.isupload = row.isupload == "0" ? "1" : "0";
        });
    },
    /** 搜索按钮操作 */
@@ -683,7 +689,7 @@
            : "是否确认删除选中的数据项?"
        )
        .then(function () {
          return deletetag(tagids);
          return delbase_tag(tagids);
        })
        .then(() => {
          this.getList();