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

(开头部分) 2KB

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

var $url = '/cms/create/createFile';

var data = utils.init({
  siteId: utils.getQueryInt('siteId'),
  isAllChecked: false,
  allTemplates: null,
  templates: null,
  checkedTemplateIds: [],
  filterText: ''
});

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

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

      $this.allTemplates = $this.templates = res.templates;
    }).catch(function (error) {
      utils.error(error);
    }).then(function () {
      utils.loading($this, false);
    })
  },

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

    utils.loading(this, true);
    $api.post($url, {
      siteId: this.siteId,
      templateIds: this.checkedTemplateIds
    }).then(function (response) {
      location.href = utils.getCmsUrl('createStatus', {siteId: $this.siteId});
    }).catch(function (error) {
      utils.error(error);
    });
  },

  filterNode: function(value, data) {
    if (!value) return true;
    if (value.text) {
      return data.label.indexOf(value.text) !== -1;
    }
    return true;
  },

  selectAll: function (val) {
    if (val) {
      this.checkedTemplateIds = _.map(this.templates, function(t) {
        return t.id;
      });
    } else {
      this.checkedTemplateIds = [];
后面还有 39 行代码,解锁后查看完整代码

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

AI 解读

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

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