mirror of
https://github.com/tengge1/ShadowEditor.git
synced 2026-01-25 15:08:11 +00:00
窗口优化。
This commit is contained in:
parent
a458512fef
commit
cfbb9d49f1
@ -14,7 +14,7 @@ class AuthorityManagementWindow extends React.Component {
|
||||
data: [],
|
||||
selected: null,
|
||||
keyword: '',
|
||||
mask: false
|
||||
mask: true
|
||||
};
|
||||
|
||||
this.update = this.update.bind(this);
|
||||
@ -68,9 +68,6 @@ class AuthorityManagementWindow extends React.Component {
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({
|
||||
mask: true
|
||||
});
|
||||
fetch(`${app.options.server}/api/Role/List?pageSize=10000`).then(response => {
|
||||
response.json().then(json => {
|
||||
this.setState({
|
||||
|
||||
@ -12,7 +12,7 @@ class LoginWindow extends React.Component {
|
||||
|
||||
this.state = {
|
||||
username: '',
|
||||
password: '',
|
||||
password: ''
|
||||
};
|
||||
|
||||
this.handleChange = this.handleChange.bind(this);
|
||||
@ -28,16 +28,17 @@ class LoginWindow extends React.Component {
|
||||
title={_t('Login')}
|
||||
style={{ width: '320px', height: '200px' }}
|
||||
mask={false}
|
||||
onClose={this.handleClose}>
|
||||
onClose={this.handleClose}
|
||||
>
|
||||
<Content>
|
||||
<Form>
|
||||
<FormControl>
|
||||
<Label>{_t('Username')}</Label>
|
||||
<Input name={'username'} value={username} onChange={this.handleChange}></Input>
|
||||
<Input name={'username'} value={username} onChange={this.handleChange} />
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<Label>{_t('Password')}</Label>
|
||||
<Input name={'password'} type={'password'} value={password} onChange={this.handleChange}></Input>
|
||||
<Input name={'password'} type={'password'} value={password} onChange={this.handleChange} />
|
||||
</FormControl>
|
||||
</Form>
|
||||
</Content>
|
||||
@ -50,7 +51,7 @@ class LoginWindow extends React.Component {
|
||||
|
||||
handleChange(value, name) {
|
||||
this.setState({
|
||||
[name]: value,
|
||||
[name]: value
|
||||
});
|
||||
}
|
||||
|
||||
@ -60,7 +61,7 @@ class LoginWindow extends React.Component {
|
||||
fetch(`/api/Login/Login`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body: `Username=${username}&Password=${password}`
|
||||
}).then(response => {
|
||||
|
||||
@ -14,7 +14,7 @@ class RegisterWindow extends React.Component {
|
||||
username: '',
|
||||
password: '',
|
||||
confirmPassword: '',
|
||||
name: '',
|
||||
name: ''
|
||||
};
|
||||
|
||||
this.handleChange = this.handleChange.bind(this);
|
||||
@ -30,24 +30,25 @@ class RegisterWindow extends React.Component {
|
||||
title={_t('Register')}
|
||||
style={{ width: '400px', height: '240px' }}
|
||||
mask={false}
|
||||
onClose={this.handleClose}>
|
||||
onClose={this.handleClose}
|
||||
>
|
||||
<Content>
|
||||
<Form>
|
||||
<FormControl>
|
||||
<Label>{_t('Username')}</Label>
|
||||
<Input name={'username'} value={username} onChange={this.handleChange}></Input>
|
||||
<Input name={'username'} value={username} onChange={this.handleChange} />
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<Label>{_t('Password')}</Label>
|
||||
<Input name={'password'} type={'password'} value={password} onChange={this.handleChange}></Input>
|
||||
<Input name={'password'} type={'password'} value={password} onChange={this.handleChange} />
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<Label>{_t('Confirm Password')}</Label>
|
||||
<Input name={'confirmPassword'} type={'password'} value={confirmPassword} onChange={this.handleChange}></Input>
|
||||
<Input name={'confirmPassword'} type={'password'} value={confirmPassword} onChange={this.handleChange} />
|
||||
</FormControl>
|
||||
<FormControl>
|
||||
<Label>{_t('Name')}</Label>
|
||||
<Input name={'name'} onChange={this.handleChange} onChange={this.handleChange}></Input>
|
||||
<Input name={'name'} onChange={this.handleChange} onChange={this.handleChange} />
|
||||
</FormControl>
|
||||
</Form>
|
||||
</Content>
|
||||
@ -60,7 +61,7 @@ class RegisterWindow extends React.Component {
|
||||
|
||||
handleChange(value, name) {
|
||||
this.setState({
|
||||
[name]: value,
|
||||
[name]: value
|
||||
});
|
||||
}
|
||||
|
||||
@ -70,7 +71,7 @@ class RegisterWindow extends React.Component {
|
||||
fetch(`/api/Login/Login`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
body: `Username=${username}&Password=${password}`
|
||||
}).then(response => {
|
||||
|
||||
@ -17,7 +17,7 @@ class RoleManageWindow extends React.Component {
|
||||
total: 0,
|
||||
selected: null,
|
||||
keyword: '',
|
||||
mask: false,
|
||||
mask: false
|
||||
};
|
||||
|
||||
this.update = this.update.bind(this);
|
||||
@ -47,17 +47,18 @@ class RoleManageWindow extends React.Component {
|
||||
title={_t('Role Management')}
|
||||
style={{ width: '600px', height: '400px' }}
|
||||
mask={false}
|
||||
onClose={this.handleClose}>
|
||||
onClose={this.handleClose}
|
||||
>
|
||||
<Content>
|
||||
<Toolbar>
|
||||
<Button onClick={this.handleAdd}>{_t('Create')}</Button>
|
||||
<Button onClick={this.handleEdit}>{_t('Edit')}</Button>
|
||||
<Button onClick={this.handleDelete}>{_t('Delete')}</Button>
|
||||
<ToolbarFiller></ToolbarFiller>
|
||||
<SearchField placeholder={_t('Search Content')} onInput={this.handleSearch}></SearchField>
|
||||
<ToolbarFiller />
|
||||
<SearchField placeholder={_t('Search Content')} onInput={this.handleSearch} />
|
||||
</Toolbar>
|
||||
<DataGrid data={data}
|
||||
pages={true}
|
||||
pages
|
||||
pageSize={pageSize}
|
||||
pageNum={pageNum}
|
||||
total={total}
|
||||
@ -70,12 +71,13 @@ class RoleManageWindow extends React.Component {
|
||||
onNextPage={this.handleNextPage}
|
||||
onLastPage={this.handleLastPage}
|
||||
onRefresh={this.handleRefresh}
|
||||
keyField={'ID'}>
|
||||
<Column type={'number'} title={'#'}></Column>
|
||||
<Column field={'Name'} title={_t('Name')}></Column>
|
||||
<Column field={'CreateTime'} title={_t('Create Date')} width={120} align={'center'} renderer={this.renderDate}></Column>
|
||||
<Column field={'UpdateTime'} title={_t('Update Date')} width={120} align={'center'} renderer={this.renderDate}></Column>
|
||||
<Column field={'Status'} title={_t('Status')} width={80} align={'center'} renderer={this.renderStatus}></Column>
|
||||
keyField={'ID'}
|
||||
>
|
||||
<Column type={'number'} title={'#'} />
|
||||
<Column field={'Name'} title={_t('Name')} />
|
||||
<Column field={'CreateTime'} title={_t('Create Date')} width={120} align={'center'} renderer={this.renderDate} />
|
||||
<Column field={'UpdateTime'} title={_t('Update Date')} width={120} align={'center'} renderer={this.renderDate} />
|
||||
<Column field={'Status'} title={_t('Status')} width={80} align={'center'} renderer={this.renderStatus} />
|
||||
</DataGrid>
|
||||
</Content>
|
||||
</Window>;
|
||||
@ -87,7 +89,7 @@ class RoleManageWindow extends React.Component {
|
||||
|
||||
update(pageSize, pageNum, keyword = '') {
|
||||
this.setState({
|
||||
mask: true,
|
||||
mask: true
|
||||
});
|
||||
fetch(`${app.options.server}/api/Role/List?pageSize=${pageSize}&pageNum=${pageNum}&keyword=${keyword}`).then(response => {
|
||||
response.json().then(json => {
|
||||
@ -98,7 +100,7 @@ class RoleManageWindow extends React.Component {
|
||||
total: json.Data.total,
|
||||
data: json.Data.rows,
|
||||
keyword: keyword,
|
||||
mask: false,
|
||||
mask: false
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -106,7 +108,7 @@ class RoleManageWindow extends React.Component {
|
||||
|
||||
handleAdd() {
|
||||
const win = app.createElement(EditRoleWindow, {
|
||||
callback: this.handleRefresh,
|
||||
callback: this.handleRefresh
|
||||
});
|
||||
app.addElement(win);
|
||||
}
|
||||
@ -177,7 +179,7 @@ class RoleManageWindow extends React.Component {
|
||||
|
||||
handleSelect(selected) {
|
||||
this.setState({
|
||||
selected: selected.ID,
|
||||
selected: selected.ID
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ class UserManageWindow extends React.Component {
|
||||
total: 0,
|
||||
selected: null,
|
||||
keyword: '',
|
||||
mask: false,
|
||||
mask: false
|
||||
};
|
||||
|
||||
this.update = this.update.bind(this);
|
||||
@ -47,17 +47,18 @@ class UserManageWindow extends React.Component {
|
||||
title={_t('User Management')}
|
||||
style={{ width: '600px', height: '400px' }}
|
||||
mask={false}
|
||||
onClose={this.handleClose}>
|
||||
onClose={this.handleClose}
|
||||
>
|
||||
<Content>
|
||||
<Toolbar>
|
||||
<Button onClick={this.handleAdd}>{_t('Create')}</Button>
|
||||
<Button onClick={this.handleEdit}>{_t('Edit')}</Button>
|
||||
<Button onClick={this.handleDelete}>{_t('Delete')}</Button>
|
||||
<ToolbarFiller></ToolbarFiller>
|
||||
<SearchField placeholder={_t('Search Content')} onInput={this.handleSearch}></SearchField>
|
||||
<ToolbarFiller />
|
||||
<SearchField placeholder={_t('Search Content')} onInput={this.handleSearch} />
|
||||
</Toolbar>
|
||||
<DataGrid data={data}
|
||||
pages={true}
|
||||
pages
|
||||
pageSize={pageSize}
|
||||
pageNum={pageNum}
|
||||
total={total}
|
||||
@ -70,13 +71,14 @@ class UserManageWindow extends React.Component {
|
||||
onNextPage={this.handleNextPage}
|
||||
onLastPage={this.handleLastPage}
|
||||
onRefresh={this.handleRefresh}
|
||||
keyField={'ID'}>
|
||||
<Column type={'number'} title={'#'}></Column>
|
||||
<Column field={'Username'} title={_t('Username')}></Column>
|
||||
<Column field={'Name'} title={_t('Name')}></Column>
|
||||
<Column field={'CreateTime'} title={_t('Create Date')} width={120} align={'center'} renderer={this.renderDate}></Column>
|
||||
<Column field={'UpdateTime'} title={_t('Update Date')} width={120} align={'center'} renderer={this.renderDate}></Column>
|
||||
<Column field={'Status'} title={_t('Status')} width={80} align={'center'} renderer={this.renderStatus}></Column>
|
||||
keyField={'ID'}
|
||||
>
|
||||
<Column type={'number'} title={'#'} />
|
||||
<Column field={'Username'} title={_t('Username')} />
|
||||
<Column field={'Name'} title={_t('Name')} />
|
||||
<Column field={'CreateTime'} title={_t('Create Date')} width={120} align={'center'} renderer={this.renderDate} />
|
||||
<Column field={'UpdateTime'} title={_t('Update Date')} width={120} align={'center'} renderer={this.renderDate} />
|
||||
<Column field={'Status'} title={_t('Status')} width={80} align={'center'} renderer={this.renderStatus} />
|
||||
</DataGrid>
|
||||
</Content>
|
||||
</Window>;
|
||||
@ -88,7 +90,7 @@ class UserManageWindow extends React.Component {
|
||||
|
||||
update(pageSize, pageNum, keyword = '') {
|
||||
this.setState({
|
||||
mask: true,
|
||||
mask: true
|
||||
});
|
||||
fetch(`${app.options.server}/api/User/List?pageSize=${pageSize}&pageNum=${pageNum}&keyword=${keyword}`).then(response => {
|
||||
response.json().then(json => {
|
||||
@ -99,7 +101,7 @@ class UserManageWindow extends React.Component {
|
||||
total: json.Data.total,
|
||||
data: json.Data.rows,
|
||||
keyword: keyword,
|
||||
mask: false,
|
||||
mask: false
|
||||
});
|
||||
});
|
||||
});
|
||||
@ -107,7 +109,7 @@ class UserManageWindow extends React.Component {
|
||||
|
||||
handleAdd() {
|
||||
const win = app.createElement(EditUserWindow, {
|
||||
callback: this.handleRefresh,
|
||||
callback: this.handleRefresh
|
||||
});
|
||||
app.addElement(win);
|
||||
}
|
||||
@ -179,7 +181,7 @@ class UserManageWindow extends React.Component {
|
||||
|
||||
handleSelect(selected) {
|
||||
this.setState({
|
||||
selected: selected.ID,
|
||||
selected: selected.ID
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user