style: eslint ignored

This commit is contained in:
devezhao 2020-02-25 18:40:42 +08:00
parent ac299c34f2
commit e857bb5feb
32 changed files with 288 additions and 101 deletions

View file

@ -91,9 +91,12 @@
"$stopEvent": true,
"$addResizeHandler": true,
"$lang": true,
"$empty": true
"$empty": true,
"$mp": true
},
"rules": {
"react/jsx-no-target-blank": 0,
"react/prop-types": 0,
"strict": 0,
"no-redeclare": 0,
"indent": [2, 2],

View file

@ -82,12 +82,12 @@
<div class="col-md-12 col-xl-6 col-lg-8">
<div class="float-left">
<div class="file-select">
<input type="file" class="inputfile" id="upload-input" accept=".xlsx,.xls" data-maxsize="20971520">
<input type="file" class="inputfile" id="upload-input" accept=".xlsx,.xls,.csv" data-maxsize="52428800">
<label for="upload-input" class="btn-secondary"><i class="zmdi zmdi-upload"></i><span>选择文件</span></label>
</div>
</div>
<div class="float-left ml-2 pt-1">
<div class="text-bold text-italic J_upload-input"></div>
<div class="float-left ml-2" style="padding-top:8px">
<u class="text-bold J_upload-input"></u>
</div>
<div class="clearfix"></div>
<div class="form-text mb-0">

View file

@ -1,4 +1,10 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
// ~
class MemberAddDlg extends RbFormHandler {

View file

@ -1,5 +1,9 @@
/* eslint-disable react/jsx-no-target-blank */
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
//
class BaseChart extends React.Component {

View file

@ -1,5 +1,11 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable react/no-string-refs */
let dashid = null
let dash_editable = false
$(document).ready(function () {

View file

@ -1,4 +1,10 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
var wpc = window.__PageConfig
let fieldsCache
let activeNode

View file

@ -1,3 +1,10 @@
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
$(document).ready(function () {
$('.J_add').click(() => renderRbcomp(<ApprovalEdit />))
renderRbcomp(<ApprovalList />, 'dataList')
@ -53,12 +60,6 @@ class ApprovalEdit extends ConfigFormDlg {
renderFrom() {
return <React.Fragment>
<div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">流程名称</label>
<div className="col-sm-7">
<input type="text" className="form-control form-control-sm" data-id="name" onChange={this.handleChange} value={this.state.name || ''} />
</div>
</div>
{!this.props.id && <div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">选择应用实体</label>
<div className="col-sm-7">
@ -70,6 +71,12 @@ class ApprovalEdit extends ConfigFormDlg {
</div>
</div>
}
<div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">流程名称</label>
<div className="col-sm-7">
<input type="text" className="form-control form-control-sm" data-id="name" onChange={this.handleChange} value={this.state.name || ''} />
</div>
</div>
{this.props.id && <div className="form-group row">
<div className="col-sm-7 offset-sm-3">
<label className="custom-control custom-control-sm custom-checkbox custom-control-inline mb-0">

View file

@ -1,5 +1,11 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable no-undef */
const wpc = window.__PageConfig
$(document).ready(function () {
renderRbcomp(<LevelBoxes id={wpc.id} />, 'boxes')
@ -311,12 +317,12 @@ class DlgImports extends RbModalHandler {
const name = e.currentTarget.dataset.name
const url = `${rb.baseUrl}/admin/entityhub/classification/imports/start?dest=${this.props.id}&file=${$encode(file)}`
const that = this
RbAlert.create(`<strong>${name}</strong><br>请注意,导入将导致现有数据被清空。<br>如当前分类数据已被使用则不建议导入。确认导入吗?`, {
RbAlert.create(`<strong>${name}</strong><br>仅支持导入到空的分类数据中。开始导入吗?`, {
html: true,
confirm: function () {
this.hide()
that.setState({ inProgress: true })
that.__mpro = new Mprogress({ template: 2, start: true, parent: '.rbmodal .modal-body' })
that.__mp = new Mprogress({ template: 2, start: true })
$.post(url, (res) => {
if (res.error_code === 0) that.__checkState(res.data)
else RbHighbar.error(res.error_msg || '导入失败')
@ -329,7 +335,7 @@ class DlgImports extends RbModalHandler {
$.get(`${rb.baseUrl}/commons/task/state?taskid=${taskid}`, (res) => {
if (res.error_code === 0) {
if (res.data.hasError) {
this.__mpro.end()
this.__mp.end()
RbHighbar.error(res.data.hasError)
return
}
@ -337,10 +343,10 @@ class DlgImports extends RbModalHandler {
const cp = res.data.progress
if (cp >= 1) {
RbHighbar.success('导入完成')
this.__mpro.end()
this.__mp.end()
setTimeout(() => location.reload(), 1500)
} else {
this.__mpro.set(cp)
this.__mp.set(cp)
setTimeout(() => this.__checkState(taskid), 1000)
}
}

View file

@ -1,5 +1,11 @@
let fields_cached
let ientry = {
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
const ientry = {
file: null,
entity: null,
repeat_opt: 1,
@ -7,12 +13,14 @@ let ientry = {
owning_user: null,
fields_mapping: null
}
let fields_cached
let import_inprogress = false
let import_taskid
$(document).ready(() => {
init_upload()
let fileds_render = (entity) => {
const fileds_render = (entity) => {
if (!entity) return
let el = $('#repeatFields').empty()
$.get(`${rb.baseUrl}/admin/datas/data-importer/import-fields?entity=${entity}`, (res) => {
@ -32,12 +40,13 @@ $(document).ready(() => {
ientry.entity = entity
})
}
$.get(`${rb.baseUrl}/commons/metadata/entities?slave=true`, (res) => {
$(res.data).each(function () {
$('<option value="' + this.name + '">' + this.label + '</option>').appendTo('#toEntity')
})
let entityS2 = $('#toEntity').select2({
const entityS2 = $('#toEntity').select2({
allowClear: false
}).on('change', function () {
fileds_render($(this).val())
@ -60,7 +69,7 @@ $(document).ready(() => {
url: rb.baseUrl + '/commons/search/search',
delay: 300,
data: function (params) {
let query = {
const query = {
entity: 'User',
qfields: 'loginName,fullName,email,quickCode',
q: params.term
@ -68,7 +77,7 @@ $(document).ready(() => {
return query
},
processResults: function (data) {
let rs = data.data.map((item) => { return item })
const rs = data.data.map((item) => { return item })
return { results: rs }
}
}
@ -98,9 +107,13 @@ const init_upload = () => {
postUrl: rb.baseUrl + '/filex/upload?temp=yes',
onSelectError: function (field, error) {
if (error === 'ErrorType') RbHighbar.create('请上传 Excel/CSV 文件')
else if (error === 'ErrorMaxSize') RbHighbar.create('文件不能大于 20M')
else if (error === 'ErrorMaxSize') RbHighbar.create('文件不能大于 50M')
},
onClientLoad: function () {
$mp.start()
},
onSuccess: function (d) {
$mp.end()
d = JSON.parse(d.currentTarget.response)
if (d.error_code === 0) {
ientry.file = d.data
@ -135,11 +148,12 @@ const step_mapping = () => {
if (!ientry.file) { RbHighbar.create('请上传数据文件'); return }
if (ientry.repeat_opt !== 3 && (!ientry.repeat_fields || ientry.repeat_fields.length === 0)) { RbHighbar.create('请选择重复判断字段'); return }
let btn = $('.J_step1-btn').button('loading')
const $btn = $('.J_step1-btn').button('loading')
$.get(`${rb.baseUrl}/admin/datas/data-importer/check-file?file=${$encode(ientry.file)}`, (res) => {
btn.button('reset')
$btn.button('reset')
if (res.error_code > 0) { RbHighbar.create(res.error_msg); return }
let _data = res.data
const _data = res.data
if (_data.preview.length < 2 || _data.preview[0].length === 0) { RbHighbar.create('上传的文件无有效数据'); return }
render_fieldsMapping(_data.preview[0], fields_cached)
@ -151,9 +165,9 @@ const step_mapping = () => {
const step_import = () => {
let fm = {}
$('#fieldsMapping tbody>tr').each(function () {
let _this = $(this)
let col = _this.data('col')
let field = _this.find('select').val()
const _this = $(this)
const col = _this.data('col')
const field = _this.find('select').val()
if (field) fm[field] = col
})
$(fields_cached).each((idx, item) => {
@ -202,7 +216,7 @@ const import_state = (taskid, inLoad) => {
return
}
let _data = res.data
const _data = res.data
$('.J_import_time').text(sec_to_time(~~_data.elapsedTime / 1000))
if (_data.isCompleted === true) {
@ -240,8 +254,8 @@ const import_cancel = () => {
//
const render_fieldsMapping = (columns, fields) => {
let fields_map = {}
let fields_select = $('<select><option value="">无</option></select>')
const fields_map = {}
const fields_select = $('<select><option value="">无</option></select>')
$(fields).each((idx, item) => {
let canNull = item.nullable === false ? ' [必填]' : ''
if (item.defaultValue) canNull = ''
@ -249,22 +263,22 @@ const render_fieldsMapping = (columns, fields) => {
fields_map[item.name] = item
})
let tbody = $('#fieldsMapping tbody').empty()
const $tbody = $('#fieldsMapping tbody').empty()
$(columns).each(function (idx, item) {
let tr = $('<tr data-col="' + idx + '"></tr>').appendTo(tbody)
const $tr = $('<tr data-col="' + idx + '"></tr>').appendTo($tbody)
$('<td><em>#' + (idx + 1) + '</em> ' + item + '<i class="zmdi zmdi-arrow-right"></i></td>').appendTo(tr)
let td = $('<td></td>').appendTo(tr)
fields_select.clone().appendTo(td)
$('<td class="pl-3"></td>').appendTo(tr)
const $td = $('<td></td>').appendTo($tr)
fields_select.clone().appendTo($td)
$('<td class="pl-3"></td>').appendTo($tr)
})
$('#fieldsMapping tbody select').select2({
placeholder: '无'
}).on('change', function () {
let val = $(this).val()
let toel = $(this).parents('td').next()
const val = $(this).val()
const toel = $(this).parents('td').next()
if (val) {
toel.parent().addClass('table-active')
let meta = fields_map[val]
const meta = fields_map[val]
if (meta.defaultValue) toel.text('默认 : ' + meta.defaultValue)
else toel.text('')
} else {
@ -274,7 +288,7 @@ const render_fieldsMapping = (columns, fields) => {
})
}
var sec_to_time = function (s) {
const sec_to_time = function (s) {
if (!s || s <= 0) return '00:00:00'
let hh = Math.floor(s / 3600)
let mm = Math.floor(s / 60) % 60

View file

@ -5,8 +5,6 @@ rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable react/jsx-no-target-blank */
$(document).ready(function () {
$('.J_add').click(() => renderRbcomp(<ReporEdit />))
renderRbcomp(<ReportList />, 'dataList')
@ -62,12 +60,6 @@ class ReporEdit extends ConfigFormDlg {
renderFrom() {
return <React.Fragment>
<div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">报表名称</label>
<div className="col-sm-7">
<input type="text" className="form-control form-control-sm" data-id="name" onChange={this.handleChange} value={this.state.name || ''} />
</div>
</div>
{!this.props.id && <React.Fragment>
<div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">选择应用实体</label>
@ -79,7 +71,7 @@ class ReporEdit extends ConfigFormDlg {
</select>
</div>
</div>
<div className="form-group row">
<div className="form-group row pb-1">
<label className="col-sm-3 col-form-label text-sm-right">模板文件</label>
<div className="col-sm-9">
<div className="float-left">
@ -89,16 +81,23 @@ class ReporEdit extends ConfigFormDlg {
</div>
</div>
<div className="float-left ml-2" style={{ paddingTop: 8 }}>
{this.state.uploadFileName && <div className="text-bold">{this.state.uploadFileName}</div>}
{this.state.uploadFileName && <u className="text-bold">{this.state.uploadFileName}</u>}
</div>
<div className="clearfix"></div>
{(this.state.invalidVars || []).length > 0 && <div className="text-danger">
存在无效字段 {`{${this.state.invalidVars.join('} {')}}`} 建议修改
</div>}
<p className="form-text mt-0 mb-1">如何编写模板文件<a href="https://getrebuild.com/docs/admin/excel-admin" target="_blank" className="link">查看帮助</a></p>
{(this.state.invalidVars || []).length > 0 &&
<p className="form-text text-danger mt-0 mb-1">存在无效字段 {`{${this.state.invalidVars.join('} {')}}`} 建议修改</p>
}
</div>
</div>
</React.Fragment>
}
<div className="form-group row">
<label className="col-sm-3 col-form-label text-sm-right">报表名称</label>
<div className="col-sm-7">
<input type="text" className="form-control form-control-sm" data-id="name" onChange={this.handleChange} value={this.state.name || ''} />
</div>
</div>
{this.props.id &&
<div className="form-group row">
<div className="col-sm-7 offset-sm-3">
@ -126,6 +125,9 @@ class ReporEdit extends ConfigFormDlg {
if (error === 'ErrorType') RbHighbar.create('请上传 Excel 文件')
else if (error === 'ErrorMaxSize') RbHighbar.create('文件不能大于 5M')
},
onClientLoad: function () {
$mp.start()
},
onSuccess: function (d) {
d = JSON.parse(d.currentTarget.response)
if (d.error_code === 0) {
@ -144,6 +146,7 @@ class ReporEdit extends ConfigFormDlg {
if (!file || !entity) return
$.get(`${rb.baseUrl}/admin/datas/data-reports/check-template?file=${file}&entity=${entity}`, (res) => {
$mp.end()
if (res.error_code === 0) {
let fileName = $fileCutName(file)
this.setState({

View file

@ -1,3 +1,10 @@
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
$(document).ready(function () {
let sbtn = $('.btn-primary').click(function () {
let entityLabel = $val('#entityLabel'),
@ -91,9 +98,9 @@ class MetaschemaList extends React.Component {
confirm: function () {
this.hide()
that.setState({ inProgress: true })
let mpro = new Mprogress({ template: 3, start: true })
$mp.start()
$.post(url, (res) => {
mpro.end()
$mp.end()
if (res.error_code === 0) {
RbHighbar.success('导入完成')
setTimeout(() => { parent.location.href = `../../entity/${res.data}/base` }, 1500)

View file

@ -1,4 +1,9 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
const EMOJIS = { '赞': 'rb_zan.png', '握手': 'rb_woshou.png', '耶': 'rb_ye.png', '抱拳': 'rb_baoquan.png', 'OK': 'rb_ok.png', '拍手': 'rb_paishou.png', '拜托': 'rb_baituo.png', '差评': 'rb_chaping.png', '微笑': 'rb_weixiao.png', '撇嘴': 'rb_piezui.png', '花痴': 'rb_huachi.png', '发呆': 'rb_fadai.png', '得意': 'rb_deyi.png', '大哭': 'rb_daku.png', '害羞': 'rb_haixiu.png', '闭嘴': 'rb_bizui.png', '睡着': 'rb_shuizhao.png', '敬礼': 'rb_jingli.png', '崇拜': 'rb_chongbai.png', '抱抱': 'rb_baobao.png', '忍住不哭': 'rb_renzhubuku.png', '尴尬': 'rb_ganga.png', '发怒': 'rb_fanu.png', '调皮': 'rb_tiaopi.png', '开心': 'rb_kaixin.png', '惊讶': 'rb_jingya.png', '呵呵': 'rb_hehe.png', '思考': 'rb_sikao.png', '哭笑不得': 'rb_kuxiaobude.png', '抓狂': 'rb_zhuakuang.png', '呕吐': 'rb_outu.png', '偷笑': 'rb_touxiao.png', '笑哭了': 'rb_xiaokule.png', '白眼': 'rb_baiyan.png', '傲慢': 'rb_aoman.png', '饥饿': 'rb_jie.png', '困': 'rb_kun.png', '吓': 'rb_xia.png', '流汗': 'rb_liuhan.png', '憨笑': 'rb_hanxiao.png', '悠闲': 'rb_youxian.png', '奋斗': 'rb_fendou.png', '咒骂': 'rb_zhouma.png', '疑问': 'rb_yiwen.png', '嘘': 'rb_xu.png', '晕': 'rb_yun.png', '惊恐': 'rb_jingkong.png', '衰': 'rb_shuai.png', '骷髅': 'rb_kulou.png', '敲打': 'rb_qiaoda.png', '再见': 'rb_zaijian.png', '无语': 'rb_wuyu.png', '抠鼻': 'rb_koubi.png', '鼓掌': 'rb_guzhang.png', '糗大了': 'rb_qiudale.png', '猥琐的笑': 'rb_weisuodexiao.png', '哼': 'rb_heng.png', '不爽': 'rb_bushuang.png', '打哈欠': 'rb_dahaqian.png', '鄙视': 'rb_bishi.png', '委屈': 'rb_weiqu.png', '安慰': 'rb_anwei.png', '坏笑': 'rb_huaixiao.png', '亲亲': 'rb_qinqin.png', '冷汗': 'rb_lenghan.png', '可怜': 'rb_kelian.png', '生病': 'rb_shengbing.png', '愉快': 'rb_yukuai.png', '幸灾乐祸': 'rb_xingzailehuo.png', '大便': 'rb_dabian.png', '干杯': 'rb_ganbei.png', '钱': 'rb_qian.png' }

View file

@ -1,5 +1,9 @@
/* eslint-disable react/jsx-no-target-blank */
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* global converEmoji, FeedsEditor */
const FeedsSorts = { newer: '最近发布', older: '最早发布', modified: '最近修改' }

View file

@ -1,4 +1,9 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* global autosize, EMOJIS */
// ~
@ -195,7 +200,7 @@ class FeedsEditor extends React.Component {
let mp
$createUploader(this._imageInput, (res) => {
if (!mp) mp = new Mprogress({ template: 1, start: true })
if (!mp) mp = new Mprogress({ template: 2, start: true })
mp.set(res.percent / 100)
}, (res) => {
if (mp) mp.end()
@ -204,7 +209,7 @@ class FeedsEditor extends React.Component {
this.setState({ images: images })
})
$createUploader(this._fileInput, (res) => {
if (!mp) mp = new Mprogress({ template: 1, start: true })
if (!mp) mp = new Mprogress({ template: 2, start: true })
mp.set(res.percent / 100)
}, (res) => {
if (mp) mp.end()

View file

@ -1,4 +1,9 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable react/jsx-no-undef */
class RbFeeds extends React.Component {

View file

@ -1,4 +1,10 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
// ~~ /
const TYPE_DOCS = ['.doc', '.docx', '.rtf', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf']

View file

@ -1,7 +1,13 @@
/* eslint-disable react/prop-types */
/* global filesList */
//
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* global filesList */
//
const __DEFAULT_ALL = 1
// ~

View file

@ -1,8 +1,12 @@
/* eslint-disable react/jsx-no-target-blank */
/* eslint-disable react/prop-types */
/* global filesList */
//
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* global filesList */
//
const __DEFAULT_ALL = 'ALL'
let __FolderData = []
@ -126,7 +130,7 @@ class FileUploadDlg extends RbFormHandler {
componentDidMount() {
let mp
$createUploader(this._upload, (res) => {
if (!mp) mp = new Mprogress({ template: 1, start: true })
if (!mp) mp = new Mprogress({ template: 2, start: true })
mp.set(res.percent / 100)
}, (res) => {
if (mp) mp.end()

View file

@ -1,5 +1,9 @@
/* eslint-disable react/jsx-no-target-blank */
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable no-unused-vars */
const PAGE_SIZE = 40

View file

@ -1,4 +1,10 @@
/* eslint-disable react/jsx-no-target-blank */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
$(document).ready(() => {
let mList = <MessageList lazy={true} />
if (window.__PageConfig && window.__PageConfig.type === 'Approval') mList = <ApprovalList />
@ -61,7 +67,6 @@ class MessageList extends React.Component {
}
componentDidMount() {
// eslint-disable-next-line react/prop-types
if (this.props.lazy !== true) this.fetchList()
$('.read-all').click(() => this.makeRead('ALL'))
}

View file

@ -1,4 +1,10 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
const wpc = window.__PageConfig
$(document).ready(() => {
renderRbcomp(<PreviewTable data={wpc.content} />, 'preview-table')

View file

@ -1,4 +1,9 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
// ~~

View file

@ -1,6 +1,10 @@
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable no-unused-vars */
/* eslint-disable react/jsx-no-target-blank */
/* eslint-disable react/prop-types */
//
class ApprovalProcessor extends React.Component {

View file

@ -1,5 +1,11 @@
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable no-unused-vars */
/* eslint-disable react/prop-types */
// ~~
class DlgAssign extends RbModalHandler {
constructor(props) {

View file

@ -1,5 +1,10 @@
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable no-unused-vars */
/* eslint-disable react/prop-types */
// ~~ Modal iFrame
class RbModal extends React.Component {

View file

@ -1,6 +1,12 @@
const wpc = window.__PageConfig || {}
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable react/no-string-refs */
/* eslint-disable react/prop-types */
const wpc = window.__PageConfig || {}
const COLUMN_MIN_WIDTH = 30
const COLUMN_MAX_WIDTH = 800
@ -1148,7 +1154,7 @@ class BatchUpdate extends BatchOperator {
that.disabled(true)
$.post(`${rb.baseUrl}/app/${that.props.entity}/batch-update/submit?dr=${that.state.dataRange}`, JSON.stringify(_data), (res) => {
if (res.error_code === 0) {
const mp = new Mprogress({ template: 2, start: true, parent: '.rbmodal .modal-body' })
const mp = new Mprogress({ template: 1, start: true })
that.__checkState(res.data, mp)
} else {
that.disabled(false)

View file

@ -1,4 +1,11 @@
//
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
// ~~
class RbFormAvatar extends RbFormElement {
constructor(props) {
@ -28,7 +35,7 @@ class RbFormAvatar extends RbFormElement {
} else {
let mp
$createUploader(this._fieldValue__input, (res) => {
if (!mp) mp = new Mprogress({ template: 1, start: true })
if (!mp) mp = new Mprogress({ template: 2, start: true })
mp.set(res.percent / 100) // 0.x
}, (res) => {
mp.end()

View file

@ -1,5 +1,9 @@
/* eslint-disable react/prop-types */
/* eslint-disable react/jsx-no-target-blank */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
// ~~
class RbFormModal extends React.Component {
@ -671,7 +675,7 @@ class RbFormImage extends RbFormElement {
} else {
let mp
$createUploader(this._fieldValue__input, (res) => {
if (!mp) mp = new Mprogress({ template: 1, start: true })
if (!mp) mp = new Mprogress({ template: 2, start: true })
mp.set(res.percent / 100) // 0.x
}, (res) => {
mp.end()

View file

@ -4,8 +4,8 @@ Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reser
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* eslint-disable no-unused-vars */
// PAGE INITIAL
$(function () {
var t = $('.rb-scroller')
@ -493,3 +493,26 @@ var $pgt = {
SlaveView: 'SlaveView',
SlaveList: 'SlaveList'
}
// 加载状态条
var $mp = {
__timer: null,
__mp: null,
// 开始
start: function () {
$mp.__timer = setTimeout(function () {
$mp.__mp = new Mprogress({ template: 3, start: true })
}, 600)
},
// 结束
end: function () {
if ($mp.__timer) {
clearTimeout($mp.__timer)
$mp.__timer = null
}
if ($mp.__mp) {
$mp.__mp.end()
$mp.__mp = null
}
}
}

View file

@ -1,6 +1,11 @@
/* eslint-disable react/jsx-no-target-blank */
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
/* global RepeatedViewer */
const wpc = window.__PageConfig || {}
//~~

View file

@ -1,4 +1,9 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
class _ChangeHandler extends React.Component {

View file

@ -1,4 +1,9 @@
/* eslint-disable react/prop-types */
/*
Copyright (c) REBUILD <https://getrebuild.com/> and its owners. All rights reserved.
rebuild is dual-licensed under commercial and open source licenses (GPLv3).
See LICENSE and COMMERCIAL in the project root for license information.
*/
const _INSTALL_STATES = {
10: ['zmdi-settings zmdi-hc-spin', '正在完成 ...'],