src/SSCMS.Web/wwwroot/sitefiles/assets/js/admin/cms/materialLayerGroupAdd.js

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

var $url = '/cms/material/layerGroupAdd';
var $urlUpdate = $url + '/actions/update';

var data = utils.init({
  siteId: utils.getQueryInt('siteId'),
  groupId: utils.getQueryInt('groupId'),
  materialType: utils.getQueryString('materialType'),
  form: {
    groupName: ''
  }
});

var methods = {
  apiGet: function () {
    var $this = this;

    utils.loading(this, true);
    $api.get($url, {
      params: {
        siteId: this.siteId,
        groupId: this.groupId
      }
    }).then(function (response) {
      var res = response.data;

      $this.form.groupName = res.value;
    }).catch(function (error) {
      utils.error(error);
    }).then(function () {
      utils.loading($this, false);
    });
  },

  apiSubmit: function () {
    var $this = this;

    utils.loading(this, true);
    if (this.groupId === 0) {
      $api.post($url, {
        siteId: this.siteId,
        materialType: this.materialType,
        groupName: this.form.groupName,
      }).then(function (response) {
        var res = response.data;

        utils.success('素材分组添加成功!');
        parent.$vue.runUpdateGroups(res.groups);
        utils.closeLayer();
      }).catch(function (error) {
        utils.error(error);
      }).then(function () {
        utils.loading($this, false);
      });
    } else {
      $api.post($urlUpdate, {
        siteId: this.siteId,
        groupId: this.groupId,
        groupName: this.form.groupName
      }).then(function (response) {
        var res = response.data;
后面还有 39 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。