Remove Chinese comments

This commit is contained in:
pycook 2020-02-21 23:14:26 +08:00
parent 2ed10069f1
commit c305aaaef6
25 changed files with 63 additions and 1396 deletions

View File

@ -1,7 +1,7 @@
import { axios } from '@/utils/request'
/**
* 获取 所有的 ci_types
* get all CI Type
* @param parameter
* @returns {AxiosPromise}
*/
@ -14,7 +14,7 @@ export function getCITypes (parameter) {
}
/**
* 获取 某个 ci_types
* get a CI Type
* @param CITypeName
* @param parameter
* @returns {AxiosPromise}
@ -28,7 +28,7 @@ export function getCIType (CITypeName, parameter) {
}
/**
* 创建 ci_type
* Create CI Type
* @param data
* @returns {AxiosPromise}
*/
@ -41,7 +41,7 @@ export function createCIType (data) {
}
/**
* 更新 ci_type
* Update CI Type
* @param CITypeId
* @param data
* @returns {AxiosPromise}
@ -55,7 +55,7 @@ export function updateCIType (CITypeId, data) {
}
/**
* 删除 ci_type
* Delete CI Type
* @param CITypeId
* @returns {AxiosPromise}
*/
@ -67,7 +67,7 @@ export function deleteCIType (CITypeId) {
}
/**
* 获取 某个 ci_type 的分组
* Gets a grouping of a CI Type
* @param CITypeId
* @param data
* @returns {AxiosPromise}
@ -81,7 +81,7 @@ export function getCITypeGroupById (CITypeId, data) {
}
/**
* 保存 某个 ci_type 的分组
* Save a group of CI Type
* @param CITypeId
* @param data
* @returns {AxiosPromise}
@ -95,7 +95,7 @@ export function createCITypeGroupById (CITypeId, data) {
}
/**
* 修改 某个 ci_type 的分组
* Changes the grouping of a CI Type
* @param groupId
* @param data
* @returns {AxiosPromise}
@ -109,7 +109,7 @@ export function updateCITypeGroupById (groupId, data) {
}
/**
* 删除 某个 ci_type 的分组
* Removes a group for a CI Type
* @param groupId
* @param data
* @returns {AxiosPromise}

View File

@ -30,7 +30,7 @@ export function getCITypeAttributesById (CITypeId, parameter) {
}
/**
* update attribute
* Update attribute
* @param attrId
* @param data
* @returns {AxiosPromise}
@ -44,7 +44,7 @@ export function updateAttributeById (attrId, data) {
}
/**
* add attribute
* Add attribute
* @param data
* @returns {AxiosPromise}
*/
@ -57,7 +57,7 @@ export function createAttribute (data) {
}
/**
* search attributes or get all attributes
* Search attributes or get all attributes
* @param data
* @returns {AxiosPromise}
*/
@ -70,7 +70,7 @@ export function searchAttributes (params) {
}
/**
* delete attribute
* Delete attribute
* @param attrId
* @returns {AxiosPromise}
*/
@ -82,7 +82,7 @@ export function deleteAttributesById (attrId) {
}
/**
* bind attribute
* Bind attribute
* @param CITypeId
* @param data
* @returns {AxiosPromise}
@ -96,7 +96,7 @@ export function createCITypeAttributes (CITypeId, data) {
}
/**
* update CI Type attribute
* Update CI Type attribute
* @param CITypeId
* @param data
* @returns {AxiosPromise}
@ -110,7 +110,7 @@ export function updateCITypeAttributesById (CITypeId, data) {
}
/**
* delete CI Type attribute
* Delete CI Type attribute
* @param CITypeId
* @param data
* @returns {AxiosPromise}

View File

@ -42,26 +42,25 @@ export function writeExcel (columns, name) {
return s
}
// 判断一个数组元素是否都为空的
// Determines whether an array element is empty
export function any (ArrayList) {
let flag = false
for (let i = 0; i < ArrayList.length; i++) {
if (ArrayList[i]) {
ArrayList.forEach(item => {
if (item) {
flag = true
return flag
}
}
})
return false
}
// 去除一个二维数组 底下为空的部分
export function filterNull (twoDimArray) {
console.log(twoDimArray)
const newArray = []
for (let i = 0; i < twoDimArray.length; i++) {
if (any(twoDimArray[i])) {
newArray.push(twoDimArray[i])
twoDimArray.forEach(item => {
if (any(item)) {
newArray.push(item)
}
}
})
return newArray
}

View File

@ -32,7 +32,7 @@ export function deleteCI (ciId) {
})
}
// 获取单个ci实例
// Get a single CI instance
export function getCIById (ciId) {
return axios({
url: urlPrefix + `/ci/${ciId}`,

View File

@ -1,15 +1,18 @@
/**
* 项目默认配置项
* primaryColor - 默认主题色, 如果修改颜色不生效请清理 localStorage
* navTheme - sidebar theme ['dark', 'light'] 两种主题
* colorWeak - 色盲模式
* layout - 整体布局方式 ['sidemenu', 'topmenu'] 两种布局
* fixedHeader - 固定 Header : boolean
* fixSiderbar - 固定左侧菜单栏 boolean
* autoHideHeader - 向下滚动时隐藏 Header : boolean
* contentWidth - 内容区布局 流式 | 固定
* Project default configuration items
* showLocale - Whether to display the Chinese and English switch buttons: boolean
* defaultLang - Default display language: zh-CN | en-US
* useSSO - Whether to use single sign-on: boolean
* primaryColor - Default theme color, clean up localStorage if changing color does not take effect
* navTheme - sidebar theme ['dark', 'light']
* colorWeak - Color blindness mode
* layout - Overall layout ['sidemenu', 'topmenu']
* fixedHeader - Fix Header: boolean
* fixSiderbar - Fix the left menu bar: boolean
* autoHideHeader - Hide header as you scroll down: boolean
* contentWidth - Content area layout: streaming | fixed
*
* storageOptions: {} - Vue-ls 插件配置项 (localStorage/sessionStorage)
* storageOptions: {} - Vue-ls Plug-in configuration item (localStorage/sessionStorage)
*
*/

View File

@ -1,145 +0,0 @@
路由/菜单说明
====
配置文件路径
----
`@/config/router.config.js`
格式和说明
----
```javascript
/**
* 路由配置说明
* 建议sider menu 请不要超过三级菜单若超过三级菜单则应该设计为顶部主菜单 配合左侧次级菜单
*
**/
{
redirect: noredirect,
name: 'router-name',
hidden: true,
meta: {
title: 'title',
icon: 'a-icon',
keepAlive: true,
hiddenHeaderContent: true,
}
}
```
`{ Route }` 对象
| 参数 | 说明 | 类型 | 默认值 |
| -------- | ----------------------------------------- | ------- | ------ |
| hidden | 控制路由是否显示在 sidebar | boolean | false |
| redirect | 重定向地址, 访问这个路由时,自定进行重定向 | string | - |
| name | 路由名称, 必须设置,且不能重名 | string | - |
| meta | 路由元信息路由附带扩展信息 | object | {} |
| hideChildrenInMenu | 强制菜单显示为Item而不是SubItem(配合 meta.hidden) | boolean | - |
`{ Meta }` 路由元信息对象
| 参数 | 说明 | 类型 | 默认值 |
| ------------------- | ------------------------------------------------------------ | ------- | ------ |
| title | 路由标题, 用于显示面包屑, 页面标题 *推荐设置 | string | - |
| icon | 路由在 menu 上显示的图标 | [string,svg] | - |
| keepAlive | 缓存该路由 | boolean | false |
| hidden | 配合`hideChildrenInMenu`使用用于隐藏菜单时提供递归到父菜单显示 选中菜单项_可参考 个人页 配置方式_ | boolean | false |
| hiddenHeaderContent | *特殊 隐藏 [PageHeader](https://github.com/sendya/ant-design-pro-vue/blob/master/src/components/layout/PageHeader.vue#L14) 组件中的页面带的 面包屑和页面标题栏 | boolean | false |
| permission | 与项目提供的权限拦截匹配的权限如果不匹配则会被禁止访问该路由页面 | array | [] |
> 路由自定义 `Icon` 请引入自定义 `svg` Icon 文件然后传递给路由的 `meta.icon` 参数即可
路由例子
----
```ecmascript 6
const asyncRouterMap = [
{
path: '/',
name: 'index',
component: BasicLayout,
meta: { title: '首页' },
redirect: '/dashboard/analysis',
children: [
{
path: '/dashboard',
component: RouteView,
name: 'dashboard',
redirect: '/dashboard/workplace',
meta: {title: '仪表盘', icon: 'dashboard', permission: ['dashboard']},
children: [
{
path: '/dashboard/analysis',
name: 'Analysis',
component: () => import('@/views/dashboard/Analysis'),
meta: {title: '分析页', permission: ['dashboard']}
},
{
path: '/dashboard/monitor',
name: 'Monitor',
hidden: true,
component: () => import('@/views/dashboard/Monitor'),
meta: {title: '监控页', permission: ['dashboard']}
},
{
path: '/dashboard/workplace',
name: 'Workplace',
component: () => import('@/views/dashboard/Workplace'),
meta: {title: '工作台', permission: ['dashboard']}
}
]
},
// result
{
path: '/result',
name: 'result',
component: PageView,
redirect: '/result/success',
meta: { title: '结果页', icon: 'check-circle-o', permission: [ 'result' ] },
children: [
{
path: '/result/success',
name: 'ResultSuccess',
component: () => import(/* webpackChunkName: "result" */ '@/views/result/Success'),
// 该页面隐藏面包屑和页面标题栏
meta: { title: '成功', hiddenHeaderContent: true, permission: [ 'result' ] }
},
{
path: '/result/fail',
name: 'ResultFail',
component: () => import(/* webpackChunkName: "result" */ '@/views/result/Error'),
// 该页面隐藏面包屑和页面标题栏
meta: { title: '失败', hiddenHeaderContent: true, permission: [ 'result' ] }
}
]
},
...
]
},
]
```
> 1. 请注意 `component: () => import('..') ` 方式引入路由的页面组件为 懒加载模式具体可以看 [Vue 官方文档](https://router.vuejs.org/zh/guide/advanced/lazy-loading.html)
> 2. 增加新的路由应该增加在 '/' (index) 路由的 `children`
> 3. 子路由的父级路由必须有 `router-view` 才能让子路由渲染出来请仔细查阅 vue-router 文档
> 4. `permission` 可以进行自定义修改只需要对这个模块进行自定义修改即可 [src/store/modules/permission.js#L10](https://github.com/sendya/ant-design-pro-vue/blob/master/src/store/modules/permission.js#L10)
附权限路由结构
![权限结构](https://static-2.loacg.com/open/static/github/permissions.png)
第二种前端路由由后端动态生成的设计可以前往官网文档 https://pro.loacg.com/docs/authority-management 参考

View File

@ -10,7 +10,7 @@ const i18n = {
}
},
actions: {
// 设置界面语言
// Setting language
SetLang ({ commit }, lang) {
return new Promise(resolve => {
commit('SET_LANG', lang)

View File

@ -1,7 +1,7 @@
import { generatorDynamicRouter, constantRouterMap } from '@/config/router.config'
/**
* 过滤账户是否拥有某一个权限并将菜单从加载列表移除
* Filters if the account has a permission and removes the menu from the load list
*
* @param permission
* @param route

View File

@ -33,7 +33,7 @@ const user = {
},
actions: {
// 登录
// login
Login ({ commit }, userInfo) {
return new Promise((resolve, reject) => {
login(userInfo).then(response => {
@ -46,7 +46,7 @@ const user = {
})
},
// 获取用户信息
// get user info
GetInfo ({ commit }) {
return new Promise((resolve, reject) => {
getInfo().then(response => {
@ -73,7 +73,7 @@ const user = {
})
},
// 登出
// logout
Logout ({ commit, state }) {
return new Promise((resolve) => {
commit('SET_TOKEN', '')

View File

@ -1,288 +0,0 @@
<template>
<div class="page-header-index-wide page-header-wrapper-grid-content-main">
<a-row :gutter="24">
<a-col :md="24" :lg="7">
<a-card :bordered="false">
<div class="account-center-avatarHolder">
<div class="avatar">
<img :src="avatar()">
</div>
<div class="username">{{ nickname() }}</div>
<div class="bio">海纳百川有容乃大</div>
</div>
<div class="account-center-detail">
<p>
<i class="title"></i>交互专家
</p>
<p>
<i class="group"></i>蚂蚁金服某某某事业群某某平台部某某技术部UED
</p>
<p>
<i class="address"></i>
<span>浙江省</span>
<span>杭州市</span>
</p>
</div>
<a-divider/>
<div class="account-center-tags">
<div class="tagsTitle">标签</div>
<div>
<template v-for="(tag, index) in tags">
<a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
<a-tag
:key="tag"
:closable="index !== 0"
:afterClose="() => handleTagClose(tag)"
>{{ `${tag.slice(0, 20)}...` }}</a-tag>
</a-tooltip>
<a-tag
v-else
:key="tag"
:closable="index !== 0"
:afterClose="() => handleTagClose(tag)"
>{{ tag }}</a-tag>
</template>
<a-input
v-if="tagInputVisible"
ref="tagInput"
type="text"
size="small"
:style="{ width: '78px' }"
:value="tagInputValue"
@change="handleInputChange"
@blur="handleTagInputConfirm"
@keyup.enter="handleTagInputConfirm"
/>
<a-tag v-else @click="showTagInput" style="background: #fff; borderStyle: dashed;">
<a-icon type="plus"/>New Tag
</a-tag>
</div>
</div>
<a-divider :dashed="true"/>
<div class="account-center-team">
<div class="teamTitle">团队</div>
<a-spin :spinning="teamSpinning">
<div class="members">
<a-row>
<a-col :span="12" v-for="(item, index) in teams" :key="index">
<a>
<a-avatar size="small" :src="item.avatar"/>
<span class="member">{{ item.name }}</span>
</a>
</a-col>
</a-row>
</div>
</a-spin>
</div>
</a-card>
</a-col>
<a-col :md="24" :lg="17">
<a-card
style="width:100%"
:bordered="false"
:tabList="tabListNoTitle"
:activeTabKey="noTitleKey"
@tabChange="key => handleTabChange(key, 'noTitleKey')"
>
<article-page v-if="noTitleKey === 'article'"></article-page>
<app-page v-else-if="noTitleKey === 'app'"></app-page>
<project-page v-else-if="noTitleKey === 'project'"></project-page>
</a-card>
</a-col>
</a-row>
</div>
</template>
<script>
import { PageView, RouteView } from '@/layouts'
import { AppPage, ArticlePage, ProjectPage } from './page'
import { mapGetters } from 'vuex'
export default {
components: {
RouteView,
PageView,
AppPage,
ArticlePage,
ProjectPage
},
data () {
return {
tags: ['很有想法的', '专注设计', '辣~', '大长腿', '川妹子', '海纳百川'],
tagInputVisible: false,
tagInputValue: '',
teams: [],
teamSpinning: true,
tabListNoTitle: [
{
key: 'article',
tab: '文章(8)'
},
{
key: 'app',
tab: '应用(8)'
},
{
key: 'project',
tab: '项目(8)'
}
],
noTitleKey: 'app'
}
},
mounted () {
this.getTeams()
},
methods: {
...mapGetters(['nickname', 'avatar']),
getTeams () {
this.$http.get('/workplace/teams').then(res => {
this.teams = res.result
this.teamSpinning = false
})
},
handleTabChange (key, type) {
this[type] = key
},
handleTagClose (removeTag) {
const tags = this.tags.filter(tag => tag !== removeTag)
this.tags = tags
},
showTagInput () {
this.tagInputVisible = true
this.$nextTick(() => {
this.$refs.tagInput.focus()
})
},
handleInputChange (e) {
this.tagInputValue = e.target.value
},
handleTagInputConfirm () {
const inputValue = this.tagInputValue
let tags = this.tags
if (inputValue && !tags.includes(inputValue)) {
tags = [...tags, inputValue]
}
Object.assign(this, {
tags,
tagInputVisible: false,
tagInputValue: ''
})
}
}
}
</script>
<style lang="less" scoped>
.page-header-wrapper-grid-content-main {
width: 100%;
height: 100%;
min-height: 100%;
transition: 0.3s;
.account-center-avatarHolder {
text-align: center;
margin-bottom: 24px;
& > .avatar {
margin: 0 auto;
width: 104px;
height: 104px;
margin-bottom: 20px;
border-radius: 50%;
overflow: hidden;
img {
height: 100%;
width: 100%;
}
}
.username {
color: rgba(0, 0, 0, 0.85);
font-size: 20px;
line-height: 28px;
font-weight: 500;
margin-bottom: 4px;
}
}
.account-center-detail {
p {
margin-bottom: 8px;
padding-left: 26px;
position: relative;
}
i {
position: absolute;
height: 14px;
width: 14px;
left: 0;
top: 4px;
background: url(https://gw.alipayobjects.com/zos/rmsportal/pBjWzVAHnOOtAUvZmZfy.svg);
}
.title {
background-position: 0 0;
}
.group {
background-position: 0 -22px;
}
.address {
background-position: 0 -44px;
}
}
.account-center-tags {
.ant-tag {
margin-bottom: 8px;
}
}
.account-center-team {
.members {
a {
display: block;
margin: 12px 0;
line-height: 24px;
height: 24px;
.member {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
line-height: 24px;
max-width: 100px;
vertical-align: top;
margin-left: 12px;
transition: all 0.3s;
display: inline-block;
}
&:hover {
span {
color: #1890ff;
}
}
}
}
}
.tagsTitle,
.teamTitle {
font-weight: 500;
color: rgba(0, 0, 0, 0.85);
margin-bottom: 12px;
}
}
</style>

View File

@ -1,113 +0,0 @@
<template>
<div class="app-list">
<a-list
:grid="{ gutter: 24, lg: 3, md: 2, sm: 1, xs: 1 }"
:dataSource="dataSource">
<a-list-item slot="renderItem" slot-scope="item">
<a-card :hoverable="true">
<a-card-meta>
<div style="margin-bottom: 3px" slot="title">{{ item.title }}</div>
<a-avatar class="card-avatar" slot="avatar" :src="item.avatar" size="small"/>
<div class="meta-cardInfo" slot="description">
<div>
<p>活跃用户</p>
<p>
<span>{{ item.activeUser }}<span></span></span>
</p>
</div>
<div>
<p>新增用户</p>
<p>{{ item.newUser | NumberFormat }}</p>
</div>
</div>
</a-card-meta>
<template class="ant-card-actions" slot="actions">
<a>
<a-icon type="download"/>
</a>
<a>
<a-icon type="edit"/>
</a>
<a>
<a-icon type="share-alt"/>
</a>
<a>
<a-dropdown>
<a class="ant-dropdown-link" href="javascript:;">
<a-icon type="ellipsis"/>
</a>
<a-menu slot="overlay">
<a-menu-item>
<a href="javascript:;">1st menu item</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;">2nd menu item</a>
</a-menu-item>
<a-menu-item>
<a href="javascript:;">3rd menu item</a>
</a-menu-item>
</a-menu>
</a-dropdown>
</a>
</template>
</a-card>
</a-list-item>
</a-list>
</div>
</template>
<script>
const dataSource = []
for (let i = 0; i < 11; i++) {
dataSource.push({
title: 'Alipay',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/WdGqmHpayyMjiEhcKoVE.png',
activeUser: 17,
newUser: 1700
})
}
export default {
name: 'Article',
components: {},
data () {
return {
dataSource
}
}
}
</script>
<style lang="less" scoped>
.app-list {
.meta-cardInfo {
zoom: 1;
margin-top: 16px;
> div {
position: relative;
text-align: left;
float: left;
width: 50%;
p {
line-height: 32px;
font-size: 24px;
margin: 0;
&:first-child {
color: rgba(0, 0, 0, .45);
font-size: 12px;
line-height: 20px;
margin-bottom: 4px;
}
}
}
}
}
</style>

View File

@ -1,75 +0,0 @@
<template>
<a-list
size="large"
rowKey="id"
:loading="loading"
itemLayout="vertical"
:dataSource="data"
>
<a-list-item :key="item.id" slot="renderItem" slot-scope="item">
<template slot="actions">
<icon-text type="star-o" :text="item.star" />
<icon-text type="like-o" :text="item.like" />
<icon-text type="message" :text="item.message" />
</template>
<a-list-item-meta>
<a slot="title" href="https://vue.ant.design/">{{ item.title }}</a>
<template slot="description">
<span>
<a-tag>Ant Design</a-tag>
<a-tag>设计语言</a-tag>
<a-tag>蚂蚁金服</a-tag>
</span>
</template>
</a-list-item-meta>
<article-list-content :description="item.description" :owner="item.owner" :avatar="item.avatar" :href="item.href" :updateAt="item.updatedAt" />
</a-list-item>
<div slot="footer" v-if="data.length > 0" style="text-align: center; margin-top: 16px;">
<a-button @click="loadMore" :loading="loadingMore">加载更多</a-button>
</div>
</a-list>
</template>
<script>
import { ArticleListContent } from '@/components'
import IconText from '@/views/list/search/components/IconText'
export default {
name: 'Article',
components: {
IconText,
ArticleListContent
},
data () {
return {
loading: true,
loadingMore: false,
data: []
}
},
mounted () {
this.getList()
},
methods: {
getList () {
this.$http.get('/list/article').then(res => {
console.log('res', res)
this.data = res.result
this.loading = false
})
},
loadMore () {
this.loadingMore = true
this.$http.get('/list/article').then(res => {
this.data = this.data.concat(res.result)
}).finally(() => {
this.loadingMore = false
})
}
}
}
</script>
<style scoped>
</style>

View File

@ -1,109 +0,0 @@
<template>
<div class="ant-pro-pages-account-projects-cardList">
<a-list :loading="loading" :data-source="data" :grid="{ gutter: 24, xxl: 3, xl: 2, lg: 2, md: 2, sm: 2, xs: 1 }">
<a-list-item slot="renderItem" slot-scope="item">
<a-card class="ant-pro-pages-account-projects-card" hoverable>
<img slot="cover" :src="item.cover" :alt="item.title" />
<a-card-meta :title="item.title">
<template slot="description">
<ellipsis :length="50">{{ item.description }}</ellipsis>
</template>
</a-card-meta>
<div class="cardItemContent">
<span>{{ item.updatedAt | fromNow }}</span>
<div class="avatarList">
<avatar-list size="mini">
<avatar-list-item
v-for="(member, i) in item.members"
:key="`${item.id}-avatar-${i}`"
:src="member.avatar"
:tips="member.name"
/>
</avatar-list>
</div>
</div>
</a-card>
</a-list-item>
</a-list>
</div>
</template>
<script>
import moment from 'moment'
import { TagSelect, StandardFormRow, Ellipsis, AvatarList } from '@/components'
const TagSelectOption = TagSelect.Option
const AvatarListItem = AvatarList.AvatarItem
export default {
name: 'Project',
components: {
AvatarList,
AvatarListItem,
Ellipsis,
TagSelect,
TagSelectOption,
StandardFormRow
},
data () {
return {
data: [],
form: this.$form.createForm(this),
loading: true
}
},
filters: {
fromNow (date) {
return moment(date).fromNow()
}
},
mounted () {
this.getList()
},
methods: {
handleChange (value) {
console.log(`selected ${value}`)
},
getList () {
this.$http.get('/list/article', { params: { count: 8 } }).then(res => {
console.log('res', res)
this.data = res.result
this.loading = false
})
}
}
}
</script>
<style lang="less" scoped>
.ant-pro-pages-account-projects-cardList {
margin-top: 24px;
/deep/ .ant-card-meta-title {
margin-bottom: 4px;
}
/deep/ .ant-card-meta-description {
height: 44px;
overflow: hidden;
line-height: 22px;
}
.cardItemContent {
display: flex;
height: 20px;
margin-top: 16px;
margin-bottom: -4px;
line-height: 20px;
> span {
flex: 1 1;
color: rgba(0,0,0,.45);
font-size: 12px;
}
/deep/ .ant-pro-avatar-list {
flex: 0 1 auto;
}
}
}
</style>

View File

@ -1,5 +0,0 @@
import AppPage from './App'
import ArticlePage from './Article'
import ProjectPage from './Project'
export { AppPage, ArticlePage, ProjectPage }

View File

@ -1,109 +0,0 @@
<template>
<a-modal
title="修改头像"
:visible="visible"
:maskClosable="false"
:confirmLoading="confirmLoading"
:width="800"
@cancel="cancelHandel">
<a-row>
<a-col :xs="24" :md="12" :style="{height: '350px'}">
<vue-cropper
ref="cropper"
:img="options.img"
:info="true"
:autoCrop="options.autoCrop"
:autoCropWidth="options.autoCropWidth"
:autoCropHeight="options.autoCropHeight"
:fixedBox="options.fixedBox"
@realTime="realTime"
>
</vue-cropper>
</a-col>
<a-col :xs="24" :md="12" :style="{height: '350px'}">
<div class="avatar-upload-preview">
<img :src="previews.url" :style="previews.img"/>
</div>
</a-col>
</a-row>
<template slot="footer">
<a-button key="back" @click="cancelHandel">{{ $t('button.cancel') }}</a-button>
<a-button key="submit" type="primary" :loading="confirmLoading" @click="okHandel">保存</a-button>
</template>
</a-modal>
</template>
<script>
// import { VueCropper } from 'vue-cropper'
export default {
/*
components: {
VueCropper
},
*/
data () {
return {
visible: false,
id: null,
confirmLoading: false,
options: {
img: '/avatar2.jpg',
autoCrop: true,
autoCropWidth: 200,
autoCropHeight: 200,
fixedBox: true
},
previews: {}
}
},
methods: {
edit (id) {
this.visible = true
this.id = id
/* 获取原始头像 */
},
close () {
this.id = null
this.visible = false
},
cancelHandel () {
this.close()
},
okHandel () {
const vm = this
vm.confirmLoading = true
setTimeout(() => {
vm.confirmLoading = false
vm.close()
vm.$message.success('上传头像成功')
}, 2000)
},
realTime (data) {
this.previews = data
}
}
}
</script>
<style lang="less" scoped>
.avatar-upload-preview {
position: absolute;
top: 50%;
transform: translate(50%, -50%);
width: 180px;
height: 180px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
}
</style>

View File

@ -1,161 +0,0 @@
<template>
<div class="account-settings-info-view">
<a-row :gutter="16">
<a-col :md="24" :lg="16">
<a-form layout="vertical">
<a-form-item
label="昵称"
>
<a-input placeholder="给自己起个名字" />
</a-form-item>
<a-form-item
label="Bio"
>
<a-textarea rows="4" placeholder="You are not alone."/>
</a-form-item>
<a-form-item
label="电子邮件"
:required="false"
>
<a-input placeholder="exp@admin.com"/>
</a-form-item>
<a-form-item
label="加密方式"
:required="false"
>
<a-select defaultValue="aes-256-cfb">
<a-select-option value="aes-256-cfb">aes-256-cfb</a-select-option>
<a-select-option value="aes-128-cfb">aes-128-cfb</a-select-option>
<a-select-option value="chacha20">chacha20</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label="连接密码"
:required="false"
>
<a-input placeholder="h3gSbecd"/>
</a-form-item>
<a-form-item
label="登录密码"
:required="false"
>
<a-input placeholder="密码"/>
</a-form-item>
<a-form-item>
<a-button type="primary">提交</a-button>
<a-button style="margin-left: 8px">保存</a-button>
</a-form-item>
</a-form>
</a-col>
<a-col :md="24" :lg="8" :style="{ minHeight: '180px' }">
<div class="ant-upload-preview" @click="$refs.modal.edit(1)" >
<a-icon type="cloud-upload-o" class="upload-icon"/>
<div class="mask">
<a-icon type="plus" />
</div>
<img :src="option.img"/>
</div>
</a-col>
</a-row>
<avatar-modal ref="modal">
</avatar-modal>
</div>
</template>
<script>
import AvatarModal from './AvatarModal'
export default {
components: {
AvatarModal
},
data () {
return {
// cropper
preview: {},
option: {
img: '/avatar2.jpg',
info: true,
size: 1,
outputType: 'jpeg',
canScale: false,
autoCrop: true,
// 只有自动截图开启 宽度高度才生效
autoCropWidth: 180,
autoCropHeight: 180,
fixedBox: true,
// 开启宽度和高度比例
fixed: true,
fixedNumber: [1, 1]
}
}
},
methods: {
}
}
</script>
<style lang="less" scoped>
.avatar-upload-wrapper {
height: 200px;
width: 100%;
}
.ant-upload-preview {
position: relative;
margin: 0 auto;
width: 100%;
max-width: 180px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
.upload-icon {
position: absolute;
top: 0;
right: 10px;
font-size: 1.4rem;
padding: 0.5rem;
background: rgba(222, 221, 221, 0.7);
border-radius: 50%;
border: 1px solid rgba(0, 0, 0, 0.2);
}
.mask {
opacity: 0;
position: absolute;
background: rgba(0,0,0,0.4);
cursor: pointer;
transition: opacity 0.4s;
&:hover {
opacity: 1;
}
i {
font-size: 2rem;
position: absolute;
top: 50%;
left: 50%;
margin-left: -1rem;
margin-top: -1rem;
color: #d6d6d6;
}
}
img, .mask {
width: 100%;
max-width: 180px;
height: 100%;
border-radius: 50%;
overflow: hidden;
}
}
</style>

View File

@ -1,25 +0,0 @@
<template>
<a-list
itemLayout="horizontal"
:dataSource="data"
>
</a-list>
</template>
<script>
export default {
data () {
return {
data: []
}
},
methods: {
}
}
</script>
<style scoped>
</style>

View File

@ -1,75 +0,0 @@
<script>
import { colorList } from '@/components/SettingDrawer/settingConfig'
import ASwitch from 'ant-design-vue/es/switch'
import AList from 'ant-design-vue/es/list'
import AListItem from 'ant-design-vue/es/list/Item'
import { mixin } from '@/utils/mixin'
const Meta = AListItem.Meta
export default {
components: {
AListItem,
AList,
ASwitch,
Meta
},
mixins: [mixin],
data () {
return {
}
},
filters: {
themeFilter (theme) {
const themeMap = {
'dark': '暗色',
'light': '白色'
}
return themeMap[theme]
}
},
methods: {
colorFilter (color) {
const c = colorList.filter(o => o.color === color)[0]
return c && c.key
},
onChange (checked) {
if (checked) {
this.$store.dispatch('ToggleTheme', 'dark')
} else {
this.$store.dispatch('ToggleTheme', 'light')
}
}
},
render () {
return (
<AList itemLayout="horizontal">
<AListItem>
<Meta>
<a slot="title">风格配色</a>
<span slot="description">
整体风格配色设置
</span>
</Meta>
<div slot="actions">
<ASwitch checkedChildren="暗色" unCheckedChildren="白色" defaultChecked={this.navTheme === 'dark' && true || false} onChange={this.onChange} />
</div>
</AListItem>
<AListItem>
<Meta>
<a slot="title">主题色</a>
<span slot="description">
页面风格配色 <a domPropsInnerHTML={ this.colorFilter(this.primaryColor) }/>
</span>
</Meta>
</AListItem>
</AList>
)
}
}
</script>
<style scoped>
</style>

View File

@ -1,155 +0,0 @@
<template>
<div class="page-header-index-wide">
<a-card :bordered="false" :bodyStyle="{ padding: '16px 0', height: '100%' }" :style="{ height: '100%' }">
<div class="account-settings-info-main" :class="device">
<div class="account-settings-info-left">
<a-menu
:mode="device == 'mobile' ? 'horizontal' : 'inline'"
:style="{ border: '0', width: device == 'mobile' ? '560px' : 'auto'}"
:selectedKeys="selectedKeys"
type="inner"
@openChange="onOpenChange"
>
<a-menu-item key="/account/settings/base">
<router-link :to="{ name: 'BaseSettings' }">
基本设置
</router-link>
</a-menu-item>
<a-menu-item key="/account/settings/security">
<router-link :to="{ name: 'SecuritySettings' }">
安全设置
</router-link>
</a-menu-item>
<a-menu-item key="/account/settings/custom">
<router-link :to="{ name: 'CustomSettings' }">
个性化
</router-link>
</a-menu-item>
<a-menu-item key="/account/settings/binding">
<router-link :to="{ name: 'BindingSettings' }">
账户绑定
</router-link>
</a-menu-item>
<a-menu-item key="/account/settings/notification">
<router-link :to="{ name: 'NotificationSettings' }">
新消息通知
</router-link>
</a-menu-item>
</a-menu>
</div>
<div class="account-settings-info-right">
<div class="account-settings-info-title">
<span>{{ $route.meta.title }}</span>
</div>
<route-view></route-view>
</div>
</div>
</a-card>
</div>
</template>
<script>
import { PageView, RouteView } from '@/layouts'
import { mixinDevice } from '@/utils/mixin.js'
export default {
components: {
RouteView,
PageView
},
mixins: [mixinDevice],
data () {
return {
// horizontal inline
mode: 'inline',
openKeys: [],
selectedKeys: [],
// cropper
preview: {},
option: {
img: '/avatar2.jpg',
info: true,
size: 1,
outputType: 'jpeg',
canScale: false,
autoCrop: true,
// 只有自动截图开启 宽度高度才生效
autoCropWidth: 180,
autoCropHeight: 180,
fixedBox: true,
// 开启宽度和高度比例
fixed: true,
fixedNumber: [1, 1]
},
pageTitle: ''
}
},
created () {
this.updateMenu()
},
methods: {
onOpenChange (openKeys) {
this.openKeys = openKeys
},
updateMenu () {
const routes = this.$route.matched.concat()
this.selectedKeys = [ routes.pop().path ]
}
},
watch: {
'$route' (val) {
this.updateMenu()
}
}
}
</script>
<style lang="less" scoped>
.account-settings-info-main {
width: 100%;
display: flex;
height: 100%;
overflow: auto;
&.mobile {
display: block;
.account-settings-info-left {
border-right: unset;
border-bottom: 1px solid #e8e8e8;
width: 100%;
height: 50px;
overflow-x: auto;
overflow-y: scroll;
}
.account-settings-info-right {
padding: 20px 40px;
}
}
.account-settings-info-left {
border-right: 1px solid #e8e8e8;
width: 224px;
}
.account-settings-info-right {
flex: 1 1;
padding: 8px 40px;
.account-settings-info-title {
color: rgba(0,0,0,.85);
font-size: 20px;
font-weight: 500;
line-height: 28px;
margin-bottom: 12px;
}
.account-settings-info-view {
padding-top: 12px;
}
}
}
</style>

View File

@ -1,25 +0,0 @@
<template>
<a-list
itemLayout="horizontal"
:dataSource="data"
>
</a-list>
</template>
<script>
export default {
data () {
return {
data: []
}
},
methods: {
}
}
</script>
<style scoped>
</style>

View File

@ -1,41 +0,0 @@
<template>
<a-list
itemLayout="horizontal"
:dataSource="data"
>
<a-list-item slot="renderItem" slot-scope="item, index" :key="index">
<a-list-item-meta>
<a slot="title">{{ item.title }}</a>
<span slot="description">
<span class="security-list-description">{{ item.description }}</span>
<span v-if="item.value"> : </span>
<span class="security-list-value">{{ item.value }}</span>
</span>
</a-list-item-meta>
<template v-if="item.actions">
<a slot="actions" @click="item.actions.callback">{{ item.actions.title }}</a>
</template>
</a-list-item>
</a-list>
</template>
<script>
export default {
data () {
return {
data: [
{ title: '账户密码', description: '当前密码强度', value: '', actions: { title: '修改', callback: () => { this.$message.info('This is a normal message') } } },
{ title: '密保手机', description: '已绑定手机', value: '138****8293', actions: { title: '修改', callback: () => { this.$message.success('This is a message of success') } } },
{ title: '密保问题', description: '未设置密保问题,密保问题可有效保护账户安全', value: '', actions: { title: '设置', callback: () => { this.$message.error('This is a message of error') } } },
{ title: '备用邮箱', description: '已绑定邮箱', value: 'ant***sign.com', actions: { title: '修改', callback: () => { this.$message.warning('This is message of warning') } } },
{ title: 'MFA 设备', description: '未绑定 MFA 设备,绑定后,可以进行二次确认', value: '', actions: { title: '绑定', callback: () => { this.$message.info('This is a normal message') } } }
]
}
}
}
</script>
<style scoped>
</style>

View File

@ -64,7 +64,7 @@ export default {
},
uploadData () {
if (this.ciType < 0) {
alert('尚未选择模板类型!')
alert('CI Type not yet selected!')
return
}
this.beginLoad = false

View File

@ -36,42 +36,35 @@ export default {
maxRows: 90,
maxCols: 90,
rowHeaders: true,
// minSpareCols: 2, //列留白
// minSpareCols: 2,
colHeaders: aliasList,
minSpareRows: 2, // 行留白
// autoWrapRow: true, // 自动换行
// 自定义右键菜单可汉化默认布尔值
minSpareRows: 2,
// autoWrapRow: true,
contextMenu: {
items: {
row_above: {
name: '上方插入一行'
name: 'insert a line at the top'
},
row_below: {
name: '下方插入一行'
name: 'insert a line at the bottom'
},
moverow: {
name: '删除行'
name: 'Delete rows'
},
unfreeze_column: {
name: '取消列固定'
name: 'Uncolumn fixation'
},
hsep1: '---------', // 提供分隔线
hsep1: '---------',
hsep2: '---------'
}
},
// width: '100%',
// fillHandle: true, // 选中拖拽复制 possible values: true, false, "horizontal", "vertical"
fixedColumnsLeft: 0, // 固定左边列数
fixedRowsTop: 0, // 固定上边列数
manualColumnFreeze: true, // 手动固定列
// manualColumnMove: true, // 手动移动列
// manualRowMove: true, // 手动移动行
// manualColumnResize: true, // 手工更改列距
// manualRowResize: true, // 手动更改行距
comments: true, // 添加注释
customBorders: [], // 添加边框
columnSorting: true, // 排序
stretchH: 'all', // 根据宽度横向扩展last:只扩展最后一列none默认不扩展
fixedColumnsLeft: 0,
fixedRowsTop: 0,
manualColumnFreeze: true,
comments: true,
customBorders: [],
columnSorting: true,
stretchH: 'all',
afterChange: function (changes, source) {
if (changes !== null) {
document.getElementById('upload-button').disabled = false

View File

@ -6,7 +6,7 @@
<a-form-item :label="$t('batch.modelType')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select
:placeholder="$t('batch.pleaseSelectModelType')"
v-decorator="['ciTypes', { rules: [{required: true, message: '模板类型必须选择'}] }]"
v-decorator="['ciTypes', { rules: [{required: true, message: 'CI Type must be selected'}] }]"
@change="selectCiType"
>
<a-select-option v-for="ciType in ciTypeList" :key="ciType.name" :value="ciType.id">{{ ciType.alias }}</a-select-option>
@ -54,7 +54,6 @@ export default {
},
methods: {
selectCiType (el) {
// 当选择好模板类型时的回调函数
this.downLoadButtonDis = false
this.selectNum = el
getCITypeAttributesById(el).then(res => {

View File

@ -1,11 +1,10 @@
<template>
<div>
<h4>&nbsp;<span style="color: blue">{{ total }}</span> ,已完成 <span style="color: lightgreen">{{ complete }}</span>
,失败 <span style="color: red">{{ errorNum }} </span></h4>
<h4>A total of <span style="color: blue">{{ total }}</span>, <span style="color: lightgreen">{{ complete }}</span> completed, <span style="color: red">{{ errorNum }} </span>failed</h4>
<a-progress :percent="mPercent"/>
<div class="my-box">
<span>错误信息</span>
<span>Error message:</span>
<ol>
<li :key="item" v-for="item in errorItems">{{ item }}</li>
</ol>
@ -73,7 +72,7 @@ export default {
}).catch(err => {
this.errorNum += 1
console.log(err)
this.errorItems.push(itemUniqueName + ': ' + (((err.response || {}).data || {}).message || '请求出现错误,请稍后再试'))
this.errorItems.push(itemUniqueName + ': ' + (((err.response || {}).data || {}).message || this.$t('tip.requestFailed')))
})
this.complete += 1
}