Commit 332e6a82 authored by wanli's avatar wanli

update

parent 8d66a5dd
...@@ -82,7 +82,7 @@ class AppResource(object): ...@@ -82,7 +82,7 @@ class AppResource(object):
if package: if package:
package.app_path = epk_path package.app_path = epk_path
package.app_info = app_info package.app_info = app_info
package.update_by = user package.update_by = user.id
package.update_at = datetime.now() package.update_at = datetime.now()
db.session.commit() db.session.commit()
...@@ -117,13 +117,13 @@ class AppResource(object): ...@@ -117,13 +117,13 @@ class AppResource(object):
temp = [] temp = []
for item in result: for item in result:
temp.append(item.to_dict(only=["uuid", "app_name"])) temp.append(item.to_dict(only=["uuid", "app_name"]))
return temp, len(temp), "get app {}.".format("success" if temp else "fail") return (temp, len(temp)), ResponseCode.HTTP_SUCCESS
elif "scope_type" in params and params.get("scope_type") == "distinct": elif "scope_type" in params and params.get("scope_type") == "distinct":
result = db.session.query(AppModel, func.count(distinct(AppModel.name))).all() result = db.session.query(AppModel, func.count(distinct(AppModel.name))).all()
temp = [] temp = []
for item in result: for item in result:
temp.append(item) temp.append(item)
return temp, len(temp), "success" return (temp, len(temp)), ResponseCode.HTTP_SUCCESS
result = AppModel.query.filter_by(**temp).order_by(AppModel.sort).order_by(AppModel.create_at.desc()).paginate(params.get("pagenum", 1), params.get("pagesize", 10), error_out=False) result = AppModel.query.filter_by(**temp).order_by(AppModel.sort).order_by(AppModel.create_at.desc()).paginate(params.get("pagenum", 1), params.get("pagesize", 10), error_out=False)
...@@ -158,9 +158,9 @@ class AppResource(object): ...@@ -158,9 +158,9 @@ class AppResource(object):
params.update({ params.update({
'app_icon': params["app_icon"].replace(config.UPLOAD_ROOT_DIR, ""), 'app_icon': params["app_icon"].replace(config.UPLOAD_ROOT_DIR, ""),
'create_by': user, 'create_by': user.id,
'create_at': datetime.now(), 'create_at': datetime.now(),
'update_by': user, 'update_by': user.id,
'update_at': datetime.now(), 'update_at': datetime.now(),
}) })
...@@ -178,7 +178,7 @@ class AppResource(object): ...@@ -178,7 +178,7 @@ class AppResource(object):
# 在EPK目录下生成JSON文件 # 在EPK目录下生成JSON文件
with open(os.sep.join([os.path.dirname(epk_path), "epk.json"]), "w") as f: with open(os.sep.join([os.path.dirname(epk_path), "epk.json"]), "w") as f:
json.dump(app.to_dict(exclude=["uuid", "create_at", "update_at", "delete_at"]), f) json.dump(app.to_dict(), f)
for a in app_files: for a in app_files:
res = AnnexModel(app=app, title=os.path.basename(a), path=a, size=os.path.getsize(a), create_by=user, create_at=datetime.now(), update_by=user, update_at=datetime.now()) res = AnnexModel(app=app, title=os.path.basename(a), path=a, size=os.path.getsize(a), create_by=user, create_at=datetime.now(), update_by=user, update_at=datetime.now())
...@@ -251,7 +251,8 @@ class AppResource(object): ...@@ -251,7 +251,8 @@ class AppResource(object):
params.pop("app_icon") params.pop("app_icon")
for key, value in params.items(): for key, value in params.items():
if value != None: setattr(app, key, value) if value != None:
setattr(app, key, value)
app.update_by = jwt.get("id", "") app.update_by = jwt.get("id", "")
app.update_date = datetime.now() app.update_date = datetime.now()
db.session.commit() db.session.commit()
......
'''
Author: your name
Date: 2021-06-30 18:03:41
LastEditTime: 2021-07-12 11:32:08
LastEditors: your name
Description: In User Settings Edit
FilePath: \evm-store\tools\build_out\controllers\user.py
'''
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf_8 -*- # -*- coding: utf_8 -*-
......
This diff is collapsed.
This diff is collapsed.
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
"codemirror": "^5.59.2", "codemirror": "^5.59.2",
"core-js": "^3.9.0", "core-js": "^3.9.0",
"cropperjs": "^1.5.11", "cropperjs": "^1.5.11",
"eslint": "^7.30.0",
"npm-check-updates": "^11.7.1", "npm-check-updates": "^11.7.1",
"numeral": "^2.0.6", "numeral": "^2.0.6",
"plyr": "^3.6.4", "plyr": "^3.6.4",
...@@ -30,6 +31,7 @@ ...@@ -30,6 +31,7 @@
"@vue/cli-plugin-eslint": "^3.0.3", "@vue/cli-plugin-eslint": "^3.0.3",
"@vue/cli-service": "^3.0.3", "@vue/cli-service": "^3.0.3",
"babel-plugin-import": "^1.9.1", "babel-plugin-import": "^1.9.1",
"eslint-plugin-vue": "^7.13.0",
"less": "^3.8.1", "less": "^3.8.1",
"less-loader": "^4.1.0", "less-loader": "^4.1.0",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</template> </template>
<script> <script>
import { LocaleProvider, ConfigProvider } from "ant-design-vue"; import { LocaleProvider, ConfigProvider, Input } from "ant-design-vue";
export default { export default {
components: { components: {
LocaleProvider, LocaleProvider,
......
...@@ -39,6 +39,7 @@ export default { ...@@ -39,6 +39,7 @@ export default {
'menu.account.trigger': 'Trigger Error', 'menu.account.trigger': 'Trigger Error',
//--- //---
'menu.system': '系统管理', 'menu.system': '系统管理',
'menu.system.index': '系统管理',
'menu.system.setting': '系统设置', 'menu.system.setting': '系统设置',
'menu.system.setting.menu': '菜单管理', 'menu.system.setting.menu': '菜单管理',
'menu.system.setting.module': '模块管理', 'menu.system.setting.module': '模块管理',
...@@ -47,6 +48,9 @@ export default { ...@@ -47,6 +48,9 @@ export default {
'menu.system.setting.area': '行政区划', 'menu.system.setting.area': '行政区划',
'menu.system.role': '权限管理', 'menu.system.role': '权限管理',
'menu.system.admin': '系统管理员', 'menu.system.admin': '系统管理员',
'menu.application': '应用管理',
'menu.application.index': '应用列表',
'menu.application.manager': '应用打包',
//--- //---
'app.home.introduce': 'introduce', 'app.home.introduce': 'introduce',
'app.analysis.test': 'Gongzhuan No.{no} shop', 'app.analysis.test': 'Gongzhuan No.{no} shop',
......
...@@ -40,6 +40,7 @@ export default { ...@@ -40,6 +40,7 @@ export default {
'menu.account.trigger': '触发报错', 'menu.account.trigger': '触发报错',
//--- //---
'menu.system': '系统管理', 'menu.system': '系统管理',
'menu.system.index': '系统管理',
'menu.system.setting': '系统设置', 'menu.system.setting': '系统设置',
'menu.system.setting.menu': '菜单管理', 'menu.system.setting.menu': '菜单管理',
'menu.system.setting.module': '模块管理', 'menu.system.setting.module': '模块管理',
...@@ -49,6 +50,9 @@ export default { ...@@ -49,6 +50,9 @@ export default {
'menu.system.setting.file-manager': '文件管理', 'menu.system.setting.file-manager': '文件管理',
'menu.system.role': '权限管理', 'menu.system.role': '权限管理',
'menu.system.admin': '系统管理员', 'menu.system.admin': '系统管理员',
'menu.application': '应用管理',
'menu.application.index': '应用列表',
'menu.application.manager': '应用打包',
//--- //---
'app.home.introduce': '介绍', 'app.home.introduce': '介绍',
'app.analysis.test': '工专路 {no} 号店', 'app.analysis.test': '工专路 {no} 号店',
......
...@@ -37,61 +37,61 @@ const router = new Router({ ...@@ -37,61 +37,61 @@ const router = new Router({
{ path: '/dashboard/workplace', name: 'workplace', component: () => import('@/views/Dashboard/Workplace') }, { path: '/dashboard/workplace', name: 'workplace', component: () => import('@/views/Dashboard/Workplace') },
] ]
}, },
// { {
// path: '/form', path: '/form',
// name: 'form', name: 'form',
// icon: 'form', icon: 'form',
// component: BlankLayout, component: BlankLayout,
// children: [ children: [
// { path: '/form/basic-form', name: 'basicform', component: () => import('@/views/Dashboard/Analysis') }, { path: '/form/basic-form', name: 'basicform', component: () => import('@/views/Dashboard/Analysis') },
// { {
// path: '/form/step-form', path: '/form/step-form',
// name: 'stepform', name: 'stepform',
// component: BlankLayout, component: BlankLayout,
// hideChildrenInMenu: true, hideChildrenInMenu: true,
// children: [ children: [
// { {
// path: '/form/step-form/info', path: '/form/step-form/info',
// name: 'info', name: 'info',
// component: () => import('@/views/Dashboard/Analysis'), component: () => import('@/views/Dashboard/Analysis'),
// }, },
// ] ]
// }, },
// { path: '/form/advanced-form', name: 'advancedform', component: () => import('@/views/Dashboard/Analysis') }, { path: '/form/advanced-form', name: 'advancedform', component: () => import('@/views/Dashboard/Analysis') },
// ] ]
// }, },
// { {
// path: '/list', path: '/list',
// icon: 'table', icon: 'table',
// name: 'list', name: 'list',
// component: BlankLayout, component: BlankLayout,
// children: [ children: [
// { {
// path: '/list/search', path: '/list/search',
// name: 'searchlist', name: 'searchlist',
// component: BlankLayout, component: BlankLayout,
// children: [ children: [
// { {
// path: '/list/search/articles', path: '/list/search/articles',
// name: 'articles', name: 'articles',
// }, },
// { {
// path: '/list/search/projects', path: '/list/search/projects',
// name: 'projects', name: 'projects',
// }, },
// { {
// path: '/list/search/applications', path: '/list/search/applications',
// name: 'applications', name: 'applications',
// }, },
// ] ]
// } }
// ] ]
// }, },
// { {
// path: '/profile', path: '/profile',
// icon: 'profile', icon: 'profile',
// name: 'profile', name: 'profile',
// }, },
{ {
path: '/system', path: '/system',
name: 'system', name: 'system',
...@@ -148,7 +148,19 @@ const router = new Router({ ...@@ -148,7 +148,19 @@ const router = new Router({
}, },
] ]
}, },
{
path: '/application',
icon: 'table',
name: 'application',
// redirect: '/application/index',
component: BasicLayout,
children: [
{ path: '/application', redirect: '/application/index' },
{ path: '/application/index', component: () => import('@/views/Application/Index') },
{ path: '/application/manager', component: () => import('@/views/Application/Manager') },
{ path: '/application/form', component: () => import('@/views/Application/Form') },
],
}
] ]
}) })
......
import { menuNav } from '@/api/menu' import { menuNav } from "@/api/menu";
//从服务端获取 //从服务端获取
const mock = [ const mock = [
{ {
"id": "1044886626813353984", id: "1044886626813353984",
"parentId": "0", parentId: "0",
"name": "dashboard", name: "dashboard",
"path": '/dashboard', path: "/dashboard",
"icon": 'dashboard', icon: "dashboard",
"leaf": false, leaf: false,
"children": [{ children: [
"id": "1044886629921333248", {
"parentId": "1044886626813353984", id: "1044886629921333248",
"name": "analysis", parentId: "1044886626813353984",
"path": '/dashboard/analysis', name: "analysis",
"leaf": true, path: "/dashboard/analysis",
"children": [] leaf: true,
},{ children: [],
"id": "1044886629921333248", },
"parentId": "1044886626813353984", {
"name": "workplace", id: "1044886629921333248",
"path": '/dashboard/workplace', parentId: "1044886626813353984",
"leaf": true, name: "workplace",
"children": [] path: "/dashboard/workplace",
}] leaf: true,
}, children: [],
{ },
"id": "1044886626813353984", ],
"parentId": "0", },
"name": "system", {
"path": '/system', id: "1044886626813353984",
"icon": 'setting', parentId: "0",
"leaf": false, name: "system",
"children": [{ path: "/system",
"id": "1044886629921333248", icon: "setting",
"parentId": "1044886626813353984", leaf: false,
"name": "setting", children: [
"path": "/system/setting", {
"leaf": false, id: "1044886629921333248",
"children": [{ parentId: "1044886626813353984",
"id": "1044886630026190848", name: "setting",
"parentId": "1044886629921333248", path: "/system/setting",
"name": "menu", leaf: false,
"path": "/system/setting/menu", children: [
"leaf": true, {
"children": [] id: "1044886630026190848",
}, { parentId: "1044886629921333248",
"id": "1044886630122659840", name: "menu",
"parentId": "1044886629921333248", path: "/system/setting/menu",
"name": "module", leaf: true,
"path": "/system/setting/module", children: [],
"leaf": true, },
"children": [] {
}, { id: "1044886630122659840",
"id": "1044886630122659841", parentId: "1044886629921333248",
"parentId": "1044886629921333248", name: "module",
"name": "file-manager", path: "/system/setting/module",
"path": "/system/setting/file-manager", leaf: true,
"leaf": true, children: [],
"children": [] },
}] {
},{ id: "1044886630122659841",
"id": "1044886629921333248", parentId: "1044886629921333248",
"parentId": "1044886626813353984", name: "file-manager",
"name": "role", path: "/system/setting/file-manager",
"path": "/system/role", leaf: true,
"leaf": true, children: [],
},{ },
"id": "1044886629921333248", ],
"parentId": "1044886626813353984", },
"name": "admin", {
"path": "/system/admin", id: "1044886629921333248",
"leaf": true, parentId: "1044886626813353984",
}] name: "role",
}] path: "/system/role",
leaf: true,
},
{
id: "1044886629921333248",
parentId: "1044886626813353984",
name: "admin",
path: "/system/admin",
leaf: true,
},
],
},
{
id: "1044886626813353984",
icon: 'table',
parentId: "0",
name: "application",
path: "/application",
leaf: false,
children: [
{
id: "1044886629921333248",
parentId: "1044886626813353984",
name: "index",
path: "/application/index",
leaf: true,
children: [],
},
{
id: "1044886629921333248",
parentId: "1044886626813353984",
name: "manager",
path: "/application/manager",
leaf: true,
children: [],
},
],
},
];
const state = { const state = {
loading: false, loading: false,
menuNav: { menuNav: {
data: [] data: [],
} },
} };
const actions = { const actions = {
['getMenuNav']({ commit, state }, config) { ["getMenuNav"]({ commit, state }, config) {
state.loading = true state.loading = true;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
menuNav().then(response => { menuNav()
// console.log(mock); .then((response) => {
commit('setMenuNav', mock) // console.log(mock);
state.loading = false commit("setMenuNav", mock);
resolve() state.loading = false;
}).catch(error => { resolve();
state.loading = false
reject(error)
})
}) })
}, .catch((error) => {
} state.loading = false;
reject(error);
});
});
},
};
const mutations = { const mutations = {
['setMenuNav'](state, payload) { ["setMenuNav"](state, payload) {
state.menuNav = { state.menuNav = {
data: payload data: payload,
} };
} },
} };
const getters = { const getters = {
['getMenuNav'](state) { ["getMenuNav"](state) {
return state.menuNav; return state.menuNav;
}, },
['loading'](state) { ["loading"](state) {
return state.loading; return state.loading;
}, },
} };
export default { export default {
namespaced: true, namespaced: true,
state, state,
actions, actions,
mutations, mutations,
getters getters,
} };
\ No newline at end of file
<template>
<a-card :body-style="{padding: '24px 32px'}" :bordered="false">
<a-form>
<a-form-item
label="标题"
:labelCol="{span: 7}"
:wrapperCol="{span: 10}"
>
<a-input placeholder="给目标起个名字" />
</a-form-item>
<a-form-item
label="起止日期"
:labelCol="{span: 7}"
:wrapperCol="{span: 10}"
>
<a-range-picker style="width: 100%" />
</a-form-item>
<a-form-item
label="目标描述"
:labelCol="{span: 7}"
:wrapperCol="{span: 10}"
>
<a-textarea rows="4" placeholder="请输入你阶段性工作目标"/>
</a-form-item>
<a-form-item
:label="$t('metrics')"
:labelCol="{span: 7}"
:wrapperCol="{span: 10}"
>
<a-textarea rows="4" :placeholder="$t('metricsInput')"/>
</a-form-item>
<a-form-item
:label="$t('customer')"
:labelCol="{span: 7}"
:wrapperCol="{span: 10}"
:required="false"
>
<a-input :placeholder="$t('customerInput')"/>
</a-form-item>
<a-form-item
:label="$t('critics')"
:labelCol="{span: 7}"
:wrapperCol="{span: 10}"
:required="false"
>
<a-input :placeholder="$t('criticsInput')"/>
</a-form-item>
<a-form-item
:label="$t('weight')"
:labelCol="{span: 7}"
:wrapperCol="{span: 10}"
:required="false"
>
<a-input-number :min="0" :max="100"/>
<span>%</span>
</a-form-item>
<a-form-item
:label="$t('disclosure')"
:labelCol="{span: 7}"
:wrapperCol="{span: 10}"
:required="false"
:help="$t('disclosureDesc')"
>
<a-radio-group v-model="value">
<a-radio :value="1">{{$t('public')}}</a-radio>
<a-radio :value="2">{{$t('partially')}}</a-radio>
<a-radio :value="3">{{$t('private')}}</a-radio>
</a-radio-group>
<a-select mode="multiple" v-if="value === 2">
<a-select-option value="4">{{$t('colleague1')}}</a-select-option>
<a-select-option value="5">{{$t('colleague2')}}</a-select-option>
<a-select-option value="6">{{$t('colleague3')}}</a-select-option>
</a-select>
</a-form-item>
<a-form-item style="margin-top: 24px" :wrapperCol="{span: 10, offset: 7}">
<a-button type="primary">{{$t('submit')}}</a-button>
<a-button style="margin-left: 8px">{{$t('save')}}</a-button>
</a-form-item>
</a-form>
</a-card>
</template>
<script>
import {
Avatar,
Row,
Col,
Card,
List,
Button,
Form,
Icon,
Table,
Divider,
Dropdown,
Input,
Select,
Radio,
DatePicker,
InputNumber
} from "ant-design-vue";
import PageHeaderWrapper from "@/components/PageHeaderWrapper";
import DescriptionItem from "@/components/DescriptionItem";
export default {
name: 'BasicForm',
i18n: require('./i18n'),
data () {
return {
value: 1
}
},
components: {
Icon,
ATextarea: Input.TextArea,
ARadio: Radio,
ARadioGroup: Radio.Group,
AInputNumber: InputNumber,
AAvatar: Avatar,
ARow: Row,
ACol: Col,
ACard: Card,
ACardGrid: Card.Grid,
ACardMeta: Card.Meta,
AList: List,
AButton: Button,
AForm: Form,
AFormItem: Form.Item,
AIcon: Icon,
ATable: Table,
ADivider: Divider,
ADropdown: Dropdown,
AInput: Input,
ASelect: Select,
AOption: Select.Option,
ADescriptionItem: DescriptionItem,
APageHeaderWrapper: PageHeaderWrapper,
ARangePicker: DatePicker.RangePicker,
},
computed: {
desc() {
return this.$t('pageDesc')
}
},
}
</script>
<style scoped>
</style>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
module.exports = {
messages: {
CN: {
pageDesc:
"表单页用于向用户收集或验证信息,基础表单常见于数据项较少的表单场景。",
title: "标题",
titleInput: "给目标起个名字",
date: "起止日期",
describe: "目标描述",
describeInput: "请输入你阶段性工作目标",
metrics: "衡量标准",
metricsInput: "请输入衡量标准",
customer: "客户",
customerInput: "请描述你服务的客户,内部客户直接 @姓名/工号",
critics: "邀评人",
criticsInput: "请直接 @姓名/工号,最多可邀请 5 人",
weight: "权重",
disclosure: "目标公开",
disclosureDesc: "客户、邀评人默认被分享",
public: "公开",
partially: "部分公开",
private: "不公开",
submit: "提交",
save: "保存",
colleague1: "同事甲",
colleague2: "同事乙",
colleague3: "同事丙",
},
HK: {
pageDesc:
"表單頁用於向用戶收集或驗證信息,基礎表單常見於數據項較少的表單場景。",
title: "標題",
titleInput: "給目標起個名字",
date: "起止日期",
describe: "目標描述",
describeInput: "請輸入你階段性的工作目標",
metrics: "衡量標準",
metricsInput: "請輸入衡量標準",
customer: "客戶",
customerInput: "請描述你服務的客戶,內部客戶直接 @姓名/工號",
critics: "邀評人",
criticsInput: "請直接 @姓名/工號,最多可邀請 5 人",
weight: "圈中人",
disclosure: "目標公開",
disclosureDesc: "客戶、邀評人默認被分享",
public: "公開",
partially: "部分公開",
private: "不公開",
submit: "提交",
save: "保存",
colleague1: "同事甲",
colleague2: "同事乙",
colleague3: "同事丙",
},
US: {
pageDesc:
"Form pages are used to collect or verify information to users, and basic forms are common in scenarios where there are fewer data items.",
title: "Title",
titleInput: "Give the target a name",
date: "Start and end date",
describe: "Goal description",
describeInput: "Please enter your work goals",
metrics: "Metrics",
metricsInput: "Please enter a metric",
customer: "Customer",
customerInput:
"Please describe your customer service, internal customers directly @ Name / job number",
critics: "Inviting critics",
criticsInput:
"Please direct @ Name / job number, you can invite up to 5 people",
weight: "Weight",
disclosure: "Target disclosure",
disclosureDesc: "Customers and invitees are shared by default",
public: "Public",
partially: "Partially public",
private: "Private",
submit: "Submit",
save: "Save",
colleague1: "Colleague A",
colleague2: "Colleague B",
colleague3: "Colleague C",
},
},
};
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment