Commit 61ba5f15 authored by Qiu Chuntao's avatar Qiu Chuntao

Optimization and modification

parent 7e12663a
Pipeline #11802 failed with stage
in 1 minute and 3 seconds
#include "custommoduleplugin.h" #include "custommoduleplugin.h"
#include "sysusermgt/sysusermgt.h" #include "sysusermgt/sysusermgt.h"
//#include "sysmainwindow/msysmainwindow.h"
QStringList TopSysPlugin::getClassList() QStringList TopSysPlugin::getClassList()
{ {
return QStringList()<< QStringLiteral("Musermgt"); return QStringList()<< QStringLiteral("SysUserMgt");
} }
TopClassAbs *TopSysPlugin::newClass(const QString &iClassName, TopClassAbs *TopSysPlugin::newClass(const QString &iClassName,
const QString &iModuleName, const QString &iModuleName,
const QVariantMap &iUrlPars) const QVariantMap &iUrlPars)
{ {
if (iClassName == QStringLiteral("Musermgt")) { if (iClassName == QStringLiteral("SysUserMgt")) {
return new Musermgt(iModuleName, iUrlPars, nullptr); return new SysUserMgt(iModuleName, iUrlPars, nullptr);
} }
return nullptr; return nullptr;
} }
This diff is collapsed.
#ifndef MUSERMGT #ifndef SYSUSERMGT
#define MUSERMGT #define SYSUSERMGT
#include <topcore/topclassabs.h> #include <topcore/topclassabs.h>
#include <tdatabaseutil/tsqlselectorv2.h> #include <tdatabaseutil/tsqlselectorv2.h>
...@@ -12,22 +12,14 @@ class TSearchEntry; ...@@ -12,22 +12,14 @@ class TSearchEntry;
class TPageTool; class TPageTool;
class TSplitter; class TSplitter;
class Musermgt : public TopClassAbs class SysUserMgt : public TopClassAbs
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit Musermgt(const QString &iModuleNameStr = QString(""), explicit SysUserMgt(const QString &iModuleNameStr = QString(""),
const QVariantMap &iUrlPars = QVariantMap(), const QVariantMap &iUrlPars = QVariantMap(),
QWidget *iParent = nullptr); QWidget *iParent = nullptr);
enum class NaviType { ~SysUserMgt();
None,
CategoryTreeView,
UiLoader,
AdvancedQuery,
NaviFilter,
CategoryTreeViewAndAdvancedQuery
};
~Musermgt();
public slots: public slots:
void refresh(bool iResetPageBol = true); //刷新表格信息 void refresh(bool iResetPageBol = true); //刷新表格信息
void refreshDetail(const QString &iUid); //刷新右侧详细信息 void refreshDetail(const QString &iUid); //刷新右侧详细信息
...@@ -53,12 +45,7 @@ signals: ...@@ -53,12 +45,7 @@ signals:
void detailSaved(const QVariant &iUid); //当详细表单数据保存时发送 void detailSaved(const QVariant &iUid); //当详细表单数据保存时发送
void selectionChanged(); //左侧表单选中条目变化时发送该信号 void selectionChanged(); //左侧表单选中条目变化时发送该信号
private: private:
void initAdvanceCfgMap();
void initTableView(); //初始化界面 void initTableView(); //初始化界面
Musermgt::NaviType str2NaviType(const QString &iType);
QVariantList parseCategoryConfig();
QVariantMap getDefaultQueryDataFromCfgMap();
private: private:
TSplitter *mBodySplitter = nullptr; TSplitter *mBodySplitter = nullptr;
TSplitter *mBodyWidget = nullptr; TSplitter *mBodyWidget = nullptr;
...@@ -69,12 +56,9 @@ private: ...@@ -69,12 +56,9 @@ private:
QWidget *mBodyWgt = nullptr; QWidget *mBodyWgt = nullptr;
QString mLastDetailUid; QString mLastDetailUid;
QString mDetailUid; QString mDetailUid;
NaviType mNaviType = NaviType::CategoryTreeView;
QWidget *mNaviView = nullptr;
QVariantMap mAdvancedQueryCfgMap;
bool IsDetailchange = false; bool IsDetailchange = false;
TopClassTableConf mTableConf; TopClassTableConf mTableConf;
QVariantList mSelectedItems; QVariantList mSelectedItems;
}; };
#endif //MUSERMGT #endif //SYSUSERMGT
# 模块标题 # 模块标题
sys_title: "Module Menu" sys_title: "User Management Module"
sys_title_en: "" sys_title_en: "User Management Module"
sys_title_zhcn: "模块菜单" sys_title_zhcn: "用户管理模块"
sys_title_zhtw: "" sys_title_zhtw: ""
# 模块图标(普通图标在font awesome中找 http://fontawesome.io/icons/) # 模块图标(普通图标在font awesome中找 http://fontawesome.io/icons/)
...@@ -63,7 +63,7 @@ desktop: { ...@@ -63,7 +63,7 @@ desktop: {
"title_en": "Custom module", "title_en": "Custom module",
"title_zhcn": "自定义模块", "title_zhcn": "自定义模块",
"title_zhtw": "自定义模块", "title_zhtw": "自定义模块",
"url_address": "Custom_module" "url_address": "user management-custom_module"
}, },
{ {
"route_type": "module", "route_type": "module",
...@@ -72,7 +72,7 @@ desktop: { ...@@ -72,7 +72,7 @@ desktop: {
"title_en": "Module configuration module", "title_en": "Module configuration module",
"title_zhcn": "模板配置模块", "title_zhcn": "模板配置模块",
"title_zhtw": "模板配置模块", "title_zhtw": "模板配置模块",
"url_address": "Module_configuration_module" "url_address": "user management-module_configuration_module"
}, },
] ]
}, },
......
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
name: "attr_data.age", name: "attr_data.age",
type: "IntLineEdit", type: "IntLineEdit",
title: self.ttr("Age"), title: self.ttr("Age"),
validate: function (obj, val, title, moment, self) { validate:function(obj, val, title, moment, self){
if (!val.match(new RegExp('^[0-9_]+$'))) { if (isNaN(val)) {
return [title + self.ttr(" can only contain [0-9]!"), 'Error']; return [title + self.ttr(" can only contain [0-9]!"), 'Error'];
} else if (parseInt(val) >= 100 || parseInt(val) <= 0) { } else if (parseInt(val) >= 100 || parseInt(val) <= 0) {
return [title + self.ttr("Are you sure you are a hundred years old?"), 'Error']; return [title + self.ttr("Are you sure you are a hundred years old?"), 'Error'];
} }
......
# 模块标题 # 模块标题
sys_title: "Custom module" sys_title: "User management-Custom module"
sys_title_en: "Custom module" sys_title_en: "User management-Custom module"
sys_title_zhcn: "自定义模块" sys_title_zhcn: "用户管理-自定义模块"
sys_title_zhtw: "" sys_title_zhtw: ""
# 模块图标 # 模块图标
sys_icon: "wpforms" sys_icon: "wpforms"
# 模块对应的插件DLL名称 # 模块对应的插件DLL名称
sys_plugin: "topikm6-custommodule-plugin" sys_plugin: "topikm6-custommodule-plugin"
# 模块对应的类名 # 模块对应的类名
sys_class: "Musermgt" sys_class: "SysUserMgt"
# 许可证验证键 # 许可证验证键
sys_license_key: "" sys_license_key: ""
# 打开模块的权限 # 打开模块的权限
...@@ -28,8 +28,7 @@ default_value : { ...@@ -28,8 +28,7 @@ default_value : {
# 主表格 # 主表格
view { view {
# 数据项, 默认包含表头中配置的数据项 # 数据项, 默认包含表头中配置的数据项
data_keys: ["id","username","fullname","status", data_keys: ["id", "username", "fullname", "status", "attr_data"]
"attr_data"]
# 主键 # 主键
primary_key: "id" primary_key: "id"
# 水平表头 # 水平表头
...@@ -54,8 +53,8 @@ view { ...@@ -54,8 +53,8 @@ view {
"search": "string" "search": "string"
}, },
{ {
"name": "status", "name": "Status",
"display": "status", "display": "Status",
"displayRole": "$status.text", "displayRole": "$status.text",
"size": 100, "size": 100,
"format": "enum(tpm-machine-maintenance-plan-status)" "format": "enum(tpm-machine-maintenance-plan-status)"
...@@ -78,8 +77,9 @@ view { ...@@ -78,8 +77,9 @@ view {
sort_by: "id DESC" sort_by: "id DESC"
# 数据集 # 数据集
data_set { data_set {
# 数据库表名 # 数据库表名
db_table_name: "sys_user" db_table_name: "sys_user"
db_filter: "" db_filter: ""
db_sql: ""
} }
} }
try { try {
this.reload(); this.reloadItem();
} catch(e) { } catch(e) {
print(e); print(e);
} }
...@@ -18,5 +18,5 @@ STYLE: "button_style=icon" ...@@ -18,5 +18,5 @@ STYLE: "button_style=icon"
LANG: "JavaScript" LANG: "JavaScript"
STATUS: "Release" STATUS: "Release"
VERSION: "1" VERSION: "1"
STATEHOOK: "return this.DetailModified() ? 'hide' : 'enable';" STATEHOOK: "return this.isDetailModified() ? 'hide' : 'enable';"
---ACTION---*/ ---ACTION---*/
\ No newline at end of file
...@@ -61,10 +61,10 @@ ...@@ -61,10 +61,10 @@
name: "attr_data.age", name: "attr_data.age",
type: "IntLineEdit", type: "IntLineEdit",
title: self.ttr("Age"), title: self.ttr("Age"),
validate: function (obj, val, title, moment, self) { validate:function(obj, val, title, moment, self){
if (!val.match(new RegExp('^[0-9_]+$'))) { if (isNaN(val)) {
return [title + self.ttr(" can only contain [0-9]!"), 'Error']; return [title + self.ttr(" can only contain [0-9]!"), 'Error'];
} else if (parseInt(val) >= 100 || parseInt(val) <= 0) { } else if ((parseInt(val) >= 100) || (parseInt(val) <= 0)) {
return [title + self.ttr("Are you sure you are a hundred years old?"), 'Error']; return [title + self.ttr("Are you sure you are a hundred years old?"), 'Error'];
} }
}, },
......
# 模块标题 # 模块标题
sys_title: "Module configuration module" sys_title: "User management-Module configuration module"
sys_title_en: "Module configuration module" sys_title_en: "User management-Module configuration module"
sys_title_zhcn: "模板配置模块" sys_title_zhcn: "用户管理-模板配置模块"
sys_title_zhtw: "" sys_title_zhtw: ""
# 模块图标 # 模块图标
sys_icon: "wpforms" sys_icon: "wpforms"
...@@ -27,13 +27,12 @@ navi: { ...@@ -27,13 +27,12 @@ navi: {
} }
default_value : { default_value : {
password: "123456" password: "123456",
} }
# 主表格 # 主表格
view { view {
# 数据项, 默认包含表头中配置的数据项 # 数据项, 默认包含表头中配置的数据项
data_keys: ["id","username","fullname","status", data_keys: ["id", "username", "fullname", "status", "attr_data"]
"attr_data"]
# 主键 # 主键
primary_key: "id" primary_key: "id"
# 水平表头 # 水平表头
...@@ -58,8 +57,8 @@ view { ...@@ -58,8 +57,8 @@ view {
"search": "string" "search": "string"
}, },
{ {
"name": "status", "name": "Status",
"display": "status", "display": "Status",
"displayRole": "$status.text", "displayRole": "$status.text",
"size": 100, "size": 100,
"format": "enum(tpm-machine-maintenance-plan-status)" "format": "enum(tpm-machine-maintenance-plan-status)"
...@@ -85,5 +84,6 @@ view { ...@@ -85,5 +84,6 @@ view {
# 数据库表名 # 数据库表名
db_table_name: "sys_user" db_table_name: "sys_user"
db_filter: "" db_filter: ""
db_sql: ""
} }
} }
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