Commit d5a6f1f9 authored by ‘oliver.hui’'s avatar ‘oliver.hui’

first

parents
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
/.qmake.cache
/.qmake.stash
# qtcreator generated files
*.pro.user*
# xemacs temporary files
*.flc
# Vim temporary files
.*.swp
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Python byte code
*.pyc
# Binaries
# --------
*.dll
*.exe
# TopLinker
# ----------------------------------------------------------------------------
**/dist/
!src/class/plugin/*.qm
# SINCPM
sincpm-lock.json
\ No newline at end of file
# Stages
stages:
- build
- test
- publish
# Cache
cache:
paths:
- dist/
# Jobs
windows_develop:
stage: build
only:
- develop
tags:
- win7
- ikm
variables:
QT_BIN: C:/DevTools/Qt5.6.3/5.6.3/msvc2015/bin
QTCREATOR_BIN: C:/DevTools/Qt5.6.3/Tools/QtCreator/bin
script:
- python ci/build.py -p $CI_PROJECT_DIR/src/class/$CI_PROJECT_NAME.pro -b $CI_PROJECT_DIR/build/$CI_COMMIT_REF_NAME/$CI_JOB_NAME -m release
linux_develop:
stage: build
only:
- develop
tags:
- centos6
- ikm
variables:
QT_BIN: /opt/Qt5.6.3/5.6.3/gcc_64/bin
script:
- python ci/build.py -p $CI_PROJECT_DIR/src/class/$CI_PROJECT_NAME.pro -b $CI_PROJECT_DIR/build/$CI_COMMIT_REF_NAME/$CI_JOB_NAME -m release
windows_master:
stage: build
only:
- master
tags:
- win7
- ikm
variables:
QT_BIN: C:/DevTools/Qt5.6.3/5.6.3/msvc2015/bin
QTCREATOR_BIN: C:/DevTools/Qt5.6.3/Tools/QtCreator/bin
script:
- python ci/build.py -p $CI_PROJECT_DIR/src/class/$CI_PROJECT_NAME.pro -b $CI_PROJECT_DIR/build/$CI_COMMIT_REF_NAME/$CI_JOB_NAME -m release
- python ci/build.py -p $CI_PROJECT_DIR/src/class/$CI_PROJECT_NAME.pro -b $CI_PROJECT_DIR/build/$CI_COMMIT_REF_NAME/$CI_JOB_NAME -m debug
- python ci/publish.py -p topikm6-topsys
- python ci/publish.py -p topikm6-topsys-debug
- python ci/publish_module.py
- python ci/update_yuque_releasenotes.py
linux_master:
stage: build
only:
- master
tags:
- centos6
- ikm
variables:
QT_BIN: /opt/Qt5.6.3/5.6.3/gcc_64/bin
script:
- python ci/build.py -p $CI_PROJECT_DIR/src/class/$CI_PROJECT_NAME.pro -b $CI_PROJECT_DIR/build/$CI_COMMIT_REF_NAME/$CI_JOB_NAME -m release
- python ci/publish.py -p topikm6-topsys
This diff is collapsed.
# topikm6-topsys
[![pipeline status](http://gitlab.topibd.net/topikm6/topikm6-topsys/badges/master/pipeline.svg)](http://gitlab.topibd.net/topikm6/topikm6-topsys/commits/master)
[![pipeline status](http://gitlab.topibd.net/topikm6/topikm6-topsys/badges/develop/pipeline.svg)](http://gitlab.topibd.net/topikm6/topikm6-topsys/commits/develop)
## 1. 项目描述
- 项目简介
系统设置模组
- 模块列表
| 中文模块名 | 英文模块名 | URL | Class |
| ---------- | ------------------ | ------------------------ | --------------------- |
| 用户管理 | User Management | SYS-USER-MGT | SysUserMgt |
| 角色管理 | Role Management | SYS-ROLE-MGT | SysRoleMgt |
| 联系人管理 | Contact Management | SYS-CONTACT-MGT | SysContactMgt |
| 通讯组管理 | Contact Group | SYS-COMMU-GROUP-MGT | SysCommuGroupMgt |
| 模块配置 | Module Setting | SYS-MODULE-CONF-MGT | SysModuleConfMgt |
| 配置管理 | Config Management | SYS-CONFIG-MGT | SysConfigMgtV2 |
| 宏控制台 | Macro Console | SYS-MACRO-CONSOLE | SysMacroConsole |
| 后台日志 | Log Console | SYS-LOG-CONSOLE | SysLogConsole |
| 图表开发者 | Chart Developer | SYS-CHART-DEVELOPER-MGT | SysChartDeveloperMgt |
| 图表导航 | Chart Navigation | SYS-CHART-NAVIGATION-MGT | SysChartNavigationMgt |
| 枚举管理 | Enum Management | SYS-ENUM-LIST-MGT | SysEnumListMgt |
## 2. 环境搭建
- Qt 5.6.3
- Visual Studio 2015
- sincpm
## 3.编译和运行
1. 双击sincpm-update.bat,自动下载库文件到dist目录;
2. 使用Qt Creator打开./src/class/xxx.pro,左下角选择构建:Debug,运行:main;
3. 项目 -> 运行 命令行参数:-u admin -p admin -P module_name,指定用户名、密码、打开的模块;
4. 执行qmake,会自动将 class/misc/topikm.cfg 拷贝到 /dist/topikm/config/topikm.cfg;
5. 运行;
## 4. 开发
- 编码风格指南:https://toplinker.yuque.com/sar5up/hvqucf/tg4gb6
- TopIKM框架使用:https://toplinker.yuque.com/sar5up/hvqucf
- TopIKM6接口文档:http://139.196.104.13:8888
## 5. 发布和部署
- 参考发布文档:https://toplinker.yuque.com/sar5up/hvqucf/mqemgz
## 6. 项目文档
## 7. 参考文档
## 8. 常见问题
\ No newline at end of file
'''
@File: build.py
@Description: CI Build Script
@Author: leon.li(l2m2lq@gmail.com)
@Date: 2019-09-12 08:53:45
'''
import argparse
import sys
import qtciutil
import os
import subprocess
def sincpm_bin(cmd):
return qtciutil.common_cmd('SINCPM_BIN', cmd)
def sincpm_update():
# check sincpm.json if exists
ci_script_dir = os.path.dirname(os.path.realpath(__file__))
filepath = os.path.join(ci_script_dir, "../sincpm.json")
if not os.path.isfile(filepath):
raise qtciutil.QtCiUtilError("no sincpm.json found.")
# get platform infomation
qt_verison_str = qtciutil.qt_version()
qmake_spec_str = qtciutil.qmake_spec()
compiler_str = qmake_spec_str.split('-')[1]
if compiler_str == 'g++':
compiler_str = 'gcc'
os_system = qtciutil.platform_system()
arch_str = 'x64'
if os_system == 'windows':
arch_str = 'x86'
# sincpm update
update_args = [sincpm_bin('sincpm'), 'update']
update_args.append('--os=%s' % os_system)
update_args.append('--qt=%s' % qt_verison_str)
update_args.append('--compiler=%s' % compiler_str)
update_args.append('--arch=%s' % arch_str)
print("update_args: ", update_args)
pinfo = subprocess.run(update_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if pinfo.returncode != 0:
raise qtciutil.QtCiUtilError("sincpm update failed.")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build Arg Parser')
parser.add_argument('--pro_file', '-p', type=str, required=True,
help='pro path', metavar='$CI_PROJECT_DIR/src/something.pro')
parser.add_argument('--build_dir', '-b', type=str, required=True,
help='build directory', metavar='$CI_PROJECT_DIR/build')
parser.add_argument('--mode', '-m', type=str, required=True,
help='debug or release', metavar='release')
args = vars(parser.parse_args())
pro_file = args['pro_file']
build_dir = args['build_dir']
mode = args['mode']
sincpm_update()
qtciutil.build(pro_file, build_dir, mode)
{
"hook": "http://139.196.104.13:9181/api/_/ci/getMailConfig"
}
\ No newline at end of file
'''
@File: publish.py
@Description: CI Publish Script
@Author: leon.li(l2m2lq@gmail.com)
@Date: 2019-09-12 14:05:07
'''
import platform
import os
import argparse
import sys
import subprocess
import glob
import re
import json
import qtciutil
def sincpm_bin(cmd):
return qtciutil.common_cmd('SINCPM_BIN', cmd)
def sincpm_publish(pkg_name):
# check sincpm.json if exists
ci_script_dir = os.path.dirname(os.path.realpath(__file__))
filepath = os.path.join(ci_script_dir, "../sincpm.json")
if not os.path.isfile(filepath):
raise qtciutil.QtCiUtilError("no sincpm.json found.")
# get platform infomation
qt_verison_str = qtciutil.qt_version()
qmake_spec_str = qtciutil.qmake_spec()
compiler_str = qmake_spec_str.split('-')[1]
if compiler_str == 'g++':
compiler_str = 'gcc'
os_system = qtciutil.platform_system()
arch_str = 'x64'
if os_system == 'windows':
arch_str = 'x86'
# sincpm package
package_args = [sincpm_bin('sincpm'), 'package']
package_args.append('--os=%s' % os_system)
package_args.append('--qt=%s' % qt_verison_str)
package_args.append('--compiler=%s' % compiler_str)
package_args.append('--arch=%s' % arch_str)
package_args.append(pkg_name)
print("package_args: ", package_args)
pinfo = subprocess.run(package_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if pinfo.returncode != 0:
raise qtciutil.QtCiUtilError("sincpm pakcage failed.")
output = pinfo.stdout.decode('utf-8')
print("sincpm pakcage output: %s" % output)
m = re.search(r'package to "(.*)/(.*)"', output)
if not m:
raise qtciutil.QtCiUtilError("sincpm package failed. No expected output.")
# sincpm upload
local_dir = m.group(1)
pkg_dir = m.group(2)
os.chdir(local_dir)
pinfo = subprocess.run([sincpm_bin('sincpm'), 'upload', pkg_dir],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# if pinfo.returncode != 0:
# raise qtciutil.QtCiUtilError("sincpm upload failed.")
m = re.search(r'error: ', pinfo.stdout.decode('utf-8'), re.IGNORECASE)
if m:
raise qtciutil.QtCiUtilError("The upload result contains an error message.")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Publish Arg Parser')
parser.add_argument('--package_name', '-p', type=str, required=True,
help='package name', metavar='topikm6-tpm')
args = vars(parser.parse_args())
package_name = args['package_name']
sincpm_publish(package_name)
print("Successfully published.")
\ No newline at end of file
'''
@File: publish_module.py
@Description: Moudle Publish Script
@Author: leon.li(l2m2lq@gmail.com)
@Date: 2020-02-11 15:08:46
'''
import platform
import os
import time
import argparse
import sys
import subprocess
import glob
import re
import shutil
import json
import requests
import urllib
import qtciutil
from dingdinghelper import DingDingHelper
dingding_cfg = {
"msgurl": "https://oapi.dingtalk.com/robot/send?access_token=e02a2c7de529ca83ba5d4e6f6c37b31f53152b3dc54d30653ed2235723027651",
"corpid": "ding428c9b6bb8962a4d35c2f4657eb6378f",
"corpsecret": "L8v6TYuSnjq8VsErPiCoJdWU19T5Embn1P8KW7IyO3_FkJw_ZLPqdKt6blQwwd34",
"spaceid": 483476421
}
def _parser_readme(readme_filepath):
if not os.path.isfile(readme_filepath):
raise qtciutil.QtCiUtilError("No %s found." % readme_filepath)
with open(readme_filepath, 'r', encoding='utf-8') as f:
content = f.read()
m = re.search(r'^#(.*)\n', content)
if not m:
raise qtciutil.QtCiUtilError('The README file is not in the right format.')
return m[1]
def _parser_changelog(changelog_filepath):
if not os.path.isfile(changelog_filepath):
raise qtciutil.QtCiUtilError("No %s found." % changelog_filepath)
with open(changelog_filepath, 'r', encoding='utf-8') as f:
content = f.read()
m = re.search(r'^##\s*(\d+\.\d+.\d+)\s.*\n((.+\n)+)', content)
if not m:
raise qtciutil.QtCiUtilError('The CHANGELOG file is not in the right format.')
return (m[1], m[2])
def _parser_module_config(module_json_filepath):
if not os.path.isfile(module_json_filepath):
raise qtciutil.QtCiUtilError("No %s found." % module_json_filepath)
with open(module_json_filepath, 'r', encoding='utf-8') as f:
content = f.read()
moduleconf_json = json.loads(content)
tmp_name = moduleconf_json.get('module_name', '')
hook = moduleconf_json.get('hook', '')
database_names = []
if (hook != ''):
param = urllib.parse.urlencode({'module_name': tmp_name}, quote_via=urllib.parse.quote)
r = requests.get(hook, params=param)
if (r.status_code != 200):
exit(1)
database_names = []
hook_ret = r.json()
hook_data = hook_ret.get('data', {})
for key in hook_data:
urls = key.split('/')
urls.reverse()
database_names.append(urls[1])
return ', '.join(database_names)
def package():
"""
TopMES-6.1.1-rc.2-upgrade-202002052311.zip
|--TopMES-6.1.1-rc.2-upgrade-202002052311.pkg
|--CHANGELOG.md
|--README.md
"""
dist_dir = os.path.join(ci_script_dir, '../dist/')
os.environ["PATH"] = os.environ['QT_BIN'] + os.pathsep + os.environ["PATH"]
package_name = '{name}-{version}-upgrade-{dt}'.format(
name=module_name,
version=version,
dt = time.strftime("%Y%m%d%H%M")
)
archive_dir = os.path.join(ci_script_dir, '../archive/')
packaging_dist = os.path.join(ci_script_dir, '../archive/%s/' % package_name)
if os.path.isdir(archive_dir):
shutil.rmtree(archive_dir, ignore_errors=True)
os.makedirs(packaging_dist)
package_program_filepath = ''
package_config_filepath = os.path.join(ci_script_dir, 'upgrade-package-{}.json'.format(platform.system().lower()))
# modify release_note
module_json_filepath = os.path.join(ci_script_dir, '../module.json')
with open(module_json_filepath, 'r', encoding= 'utf-8') as f:
moduleconf_content = f.read()
moduleconf_json = json.loads(moduleconf_content)
moduleconf_json['version'] = version
moduleconf_json['change_log'] = changelog
moduleconf_json['is_module'] = 1
moduleconf_json['remark'] = 'Update package is automatically published by CI.'
with open(package_config_filepath, 'r', encoding= 'utf-8') as f:
package_config_content = f.read()
content_json = json.loads(package_config_content)
content_str = json.dumps(moduleconf_json, ensure_ascii=False)
content_json['release_note'] = content_str
with open(package_config_filepath, 'w', encoding='utf-8') as f:
json.dump(content_json, f, ensure_ascii=False, indent=4)
package_output_filepath = "%s/%s.pkg" % (packaging_dist, package_name)
if platform.system() == 'Windows':
package_program_filepath = dist_dir + "/topikm/qt5.6.3-win32-msvc2015/bin/TopUpgradePackager.exe"
elif platform.system() == 'Linux':
package_program_filepath = dist_dir + "/topikm/qt5.6.3-linuxx86_64/bin/TopUpgradePackager"
package_args = [
package_program_filepath,
'-c', package_config_filepath,
'-d', package_output_filepath,
'-H', 'yes'
]
pinfo = subprocess.run(package_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if pinfo.returncode != 0:
raise qtciutil.QtCiUtilError("package failed. %s" % pinfo.stdout.decode('utf-8'))
# Copy README.md and CHANGELOG.md
shutil.copy(os.path.join(ci_script_dir, '../README.md'), packaging_dist)
shutil.copy(os.path.join(ci_script_dir, '../CHANGELOG.md'), packaging_dist)
# upload to database
upload_program_filepath = ''
if platform.system() == 'Windows':
upload_program_filepath = dist_dir + "/topikm/qt5.6.3-win32-msvc2015/bin/PackageUploaderPlus.exe"
elif platform.system() == 'Linux':
upload_program_filepath = dist_dir + "/topikm/qt5.6.3-linuxx86_64/bin/PackageUploaderPlus"
upload_args = [
upload_program_filepath,
'-u', package_output_filepath,
module_json_filepath
]
pinfo = subprocess.run(upload_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if pinfo.returncode != 0:
print(pinfo.returncode)
print(pinfo.stderr)
print(pinfo.stdout)
raise qtciutil.QtCiUtilError("upload failed. %s" % pinfo.stdout.decode('utf-8'))
os.chdir(os.path.join(ci_script_dir, '../archive/'))
if platform.system() == 'Linux':
shutil.make_archive(package_name, 'gztar', base_dir=package_name)
archive_filepath = os.path.join(os.getcwd(), package_name + ".tar.gz")
elif platform.system() == 'Windows':
shutil.make_archive(package_name, 'zip', base_dir=package_name)
archive_filepath = os.path.join(os.getcwd(), package_name + ".zip")
else:
raise qtciutil.QtCiUtilError('This platform is currently not supported.')
return archive_filepath
def sendToDingding(archive_filepath):
ding = DingDingHelper()
ding.msgurl = dingding_cfg["msgurl"]
ding.corpid = dingding_cfg["corpid"]
ding.corpsecret = dingding_cfg["corpsecret"]
r = requests.get("http://139.196.104.13:9181/api/_/dingding/getCookie")
if r.status_code != 200:
exit(1)
r_data = json.loads(r.content)
ding.cookie = r_data["data"].rstrip()
spacepath = '/topmes/update/{os}/{module_name}/'.format(
module_name = module_name,
os = platform.system().lower()
)
ding.upload_file(archive_filepath, dingding_cfg["spaceid"], spacepath)
msg = []
msg.append("{module_name} {version} {os} 发布".format(
module_name =module_name,
version = version,
os = platform.system()
))
msg.append(changelog)
msg.append("模组升级包已上传至钉盘目录{dir}下。".format(dir=spacepath))
if len(database_name) > 0:
msg.append("已自动上传到以下数据库:\n{dbname}\n可在产品中点击系统->模组版本查看,若失败请手动升级。".format(dbname=database_name))
print('\n'.join(msg))
ding.send_msg('\n'.join(msg))
if __name__ == "__main__":
global ci_script_dir
global module_name
global version
global changelog
global database_name
ci_script_dir = os.path.dirname(os.path.realpath(__file__))
module_name = _parser_readme(os.path.join(ci_script_dir, '../README.md')).strip()
print("module_name: %s" % module_name)
changelog_info = _parser_changelog(os.path.join(ci_script_dir, '../CHANGELOG.md'))
version = changelog_info[0]
print("version: %s" % version)
changelog = changelog_info[1]
print("changelog: %s" % changelog)
database_name = _parser_module_config(os.path.join(ci_script_dir, '../module.json'))
archive_filepath = package()
print("archive_filepath: %s" % archive_filepath)
sendToDingding(archive_filepath)
\ No newline at end of file
'''
@File: test.py
@Description: CI Test Script
@Author: leon.li(l2m2lq@gmail.com)
@Date: 2019-09-12 14:04:39
'''
import argparse
import qtciutil
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build Arg Parser')
parser.add_argument('--pro_file', '-p', type=str, required=True,
help='pro path', metavar='$CI_PROJECT_DIR/test/something.pro')
parser.add_argument('--build_dir', '-b', type=str, required=True,
help='build directory', metavar='$CI_PROJECT_DIR/build')
parser.add_argument('--dist_dir', '-d', type=str, required=True,
help='dist directory', metavar='$CI_PROJECT_DIR/dist')
args = vars(parser.parse_args())
pro_file = args['pro_file']
build_dir = args['build_dir']
dist_dir = args['dist_dir']
qtciutil.unit_test(pro_file, build_dir, dist_dir)
\ No newline at end of file
'''
@File: update_yuque_releasenotes.py
@Description: Auto update releasenotes document on Yuque
@Author: leon.li(l2m2lq@gmail.com)
@Date: 2020-04-03 09:08:03
'''
import requests, os, json, re
import smtplib
from email.mime.text import MIMEText
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.header import Header
from email import encoders
def beautify(changelog):
"""
beautify for Yuque markdown content
"""
v1 = re.sub(r'BUG#(\d+)', r'BUG[#\1](http://zentao.topibd.net/zentao/bug-view-\1.html)', changelog, flags=re.IGNORECASE)
v2 = re.sub(r'需求#(\d+)', r'需求[#\1](http://zentao.topibd.net/zentao/story-view-\1.html)', v1)
return v2
def beautify2(changelog):
"""
beautify for mail content
"""
v0 = '<br />'.join(changelog.split('\n'))
v1 = re.sub(r'BUG#(\d+)', r'BUG<a href=http://zentao.topibd.net/zentao/bug-view-\1.html>#\1</a>', v0, flags=re.IGNORECASE)
v2 = re.sub(r'需求#(\d+)', r'需求<a href=http://zentao.topibd.net/zentao/story-view-\1.html>#\1</a>', v1)
return v2
def update_yuque(repo_id, doc_id, *, body):
headers = {
'X-Auth-Token': yuque_info['token'],
'Content-Type': 'application/x-www-form-urlencoded'
}
base_url = yuque_info['api_base_url']
url = f'{base_url}/repos/{repo_id}/docs/{doc_id}'
print(url)
data = {
'format': 'markdown',
'body': body
}
response = requests.request(method='PUT', url=url, headers=headers, data=data, timeout=yuque_info['timeout'])
if response.status_code != 200:
print(f'Update yuque doc failed. status_code = {response.status_code}, response = {response.text}')
def _parser_changelog(changelog_filepath):
with open(changelog_filepath, 'r', encoding='utf-8') as f:
content = f.read()
m = re.search(r'^##\s*(\d+\.\d+.\d+)\s.*\n((.+\n)+)', content)
return (m[1], m[2])
def send_mail(to, cc):
smtp = smtplib.SMTP(mail_info['host'], mail_info['port'])
smtp.connect(mail_info['host'], mail_info['port'])
smtp.login(mail_info['user'], mail_info['password'])
message = MIMEMultipart()
message['Subject'] = Header(f'{module_info["module_name_zhcn"]}模组 {changelog_info[0]} 发布', 'utf-8')
message['From'] = mail_info['user']
message['To'] = ','.join(to)
if cc:
message['Cc'] = ','.join(cc)
contents = []
contents.append('Dear All, ')
contents.append('')
contents.append(f'<b>{module_info["module_name_zhcn"]} {changelog_info[0]} 发布</b>')
contents.append(f'{beautify2(changelog_info[1])}')
contents.append(f'历史版本信息请移步<a href={yuque_info["releasenotes_url"]}>语雀</a>查看')
contents.append('')
message.attach(MIMEText('<br />'.join(contents), 'html', 'utf-8'))
smtp.sendmail(
mail_info['user'],
to + cc,
message.as_string()
)
smtp.quit()
def run():
global module_info
global yuque_info
global mail_info
global changelog_info
with open(os.path.join(ci_script_dir, '../module.json'), 'r', encoding='utf-8') as f:
module_info = json.load(f)
with open(os.path.join(ci_script_dir, 'yuque.json'), 'r', encoding='utf-8') as f:
yuque_info = json.load(f)
with open(os.path.join(ci_script_dir, 'mail.json'), 'r', encoding='utf-8') as f:
mail_config_info = json.load(f)
r = requests.get(mail_config_info["hook"])
if r.status_code != 200:
print(f'get mail list failed. status_code: {r.status_code}')
return
r_data = json.loads(r.content)
mail_info = r_data["data"]
changelog_filepath = os.path.join(ci_script_dir, '../CHANGELOG.md')
changelog_info = _parser_changelog(changelog_filepath)
with open(changelog_filepath, 'r', encoding='utf-8') as f:
content = f.read()
update_yuque(yuque_info['repo_id'], yuque_info['doc_id'], body=beautify(content))
send_mail(mail_info["to"], mail_info["cc"])
if __name__ == "__main__":
global ci_script_dir
ci_script_dir = os.path.dirname(os.path.realpath(__file__))
run()
\ No newline at end of file
{
"dev": {
"module": {
"delete": [],
"normal": [
{
"path": "${pwd}/../src/module/TOPSYS",
"search_keys": [ "*" ]
}
]
},
"enum": {
"delete": [],
"normal": [
{
"path": "${pwd}/../src/module/TOPSYS/__sys_enum__/",
"search_keys": [ "*.conf" ],
"recursively": true
}
]
},
"permission": {
"delete": [],
"normal": [
{
"path": "${pwd}/../src/module/TOPSYS/__sys_permission__/",
"search_keys": [ "*.conf" ],
"recursively": true
}
]
}
},
"file": {
"normal": [
{
"path": "${pwd}/../dist/topikm/qt5.6.3-linuxx86_64/language/",
"search_keys": [
"*topsys*.qm"
],
"recursively": true
},
{
"path": "${pwd}/../dist/topikm/qt5.6.3-linuxx86_64/resource/",
"search_keys": [
"*topsys*.rcc"
],
"recursively": true
},
{
"path": "${pwd}/../dist/topikm/qt5.6.3-linuxx86_64/bin/",
"search_keys": [
"*topsys*.so"
],
"recursively": false
}
]
},
"release_note": "Update package is automatically published by CI."
}
\ No newline at end of file
{
"dev": {
"module": {
"delete": [],
"normal": [
{
"path": "${pwd}/../src/module/TOPSYS",
"search_keys": [ "*" ]
}
]
},
"enum": {
"delete": [],
"normal": [
{
"path": "${pwd}/../src/module/TOPSYS/__sys_enum__/",
"search_keys": [ "*.conf" ],
"recursively": true
}
]
},
"permission": {
"delete": [],
"normal": [
{
"path": "${pwd}/../src/module/TOPSYS/__sys_permission__/",
"search_keys": [ "*.conf" ],
"recursively": true
}
]
}
},
"file": {
"normal": [
{
"path": "${pwd}/../dist/topikm/qt5.6.3-win32-msvc2015/language/",
"search_keys": [
"*topsys*.qm"
],
"recursively": true
},
{
"path": "${pwd}/../dist/topikm/qt5.6.3-win32-msvc2015/resource/",
"search_keys": [
"*topsys*.rcc"
],
"recursively": true
},
{
"path": "${pwd}/../dist/topikm/qt5.6.3-win32-msvc2015/bin/plugins",
"search_keys": [
"*topsys*.dll"
],
"recursively": false
}
]
},
"release_note": "Update package is automatically published by CI."
}
\ No newline at end of file
{
"token": "s5OC55N6JBunYpuoSI8Z9J77MMj4yaBBAZDEfW6M",
"api_base_url": "https://toplinker.yuque.com/api/v2",
"releasenotes_url": "https://toplinker.yuque.com/toplinker/vtgsv9/ug6hnr",
"repo_id": 902137,
"doc_id": 5827785,
"timeout": 10
}
\ No newline at end of file
{
"module_name": "TopSYS",
"module_name_en": "System Config",
"module_name_zhcn": "系统设置",
"module_name_zhtw": "系統設置",
"hook": "http://139.196.104.13:9181/api/_/ci/getModuleConfig"
}
\ No newline at end of file
@echo off
sincpm update --os=windows --arch=x86 --compiler=msvc2015 --qt=5.6.3
\ No newline at end of file
#!/bin/bash
sincpm update --os=linux --arch=x64 --compiler=gcc --qt=5.6.3
\ No newline at end of file
[
{
"name": "topikm6-topsys",
"version": "6.2.28",
"os": "windows",
"arch": "x86",
"compiler": "msvc2015",
"qt": "5.6.3",
"noqt": false,
"devDependencies": {
"topikm6-frame": "^6.0.0",
"topikm6-templateclass": "^1.0.0"
},
"prefix": "dist/topikm/qt5.6.3-win32-msvc2015/",
"dist_comment": "The following dist is written like this for compatibility with the topikm6 directory structure.",
"dist": "dist/topikm/qt5.6.3-win32-msvc2015/",
"dependencies": {
"topikm6-frame": "^6.0.0",
"topikm6-templateclass": "^1.0.0"
},
"packageFiles": [
"/bin/plugins/topikm6-topsys-plugin.dll",
"/bin/plugins/topikm6-topsys-plugin.lib",
"/bin/plugins/topikm6-topsys-plugin.pdb",
"/language/topikm6_topsys_en.qm",
"/language/topikm6_topsys_zhcn.qm",
"/language/topikm6_topsys_zhtw.qm",
"/resource/res/topsys.rcc"
]
},
{
"name": "topikm6-topsys",
"version": "6.2.28",
"os": "linux",
"arch": "x64",
"compiler": "gcc",
"qt": "5.6.3",
"noqt": false,
"devDependencies": {
"topikm6-frame": "^6.0.0",
"topikm6-templateclass": "^1.0.0"
},
"prefix": "dist/topikm/qt5.6.3-linuxx86_64/",
"dist_comment": "The following dist is written like this for compatibility with the topikm6 directory structure.",
"dist": "dist/topikm/qt5.6.3-linuxx86_64/",
"dependencies": {
"topikm6-frame": "^6.0.0",
"topikm6-templateclass": "^1.0.0"
},
"packageFiles": [
"/bin/libtopikm6-topsys-plugin.so",
"/language/topikm6_topsys_en.qm",
"/language/topikm6_topsys_zhcn.qm",
"/language/topikm6_topsys_zhtw.qm",
"/resource/res/topsys.rcc"
]
},
{
"name": "topikm6-topsys-debug",
"version": "6.2.28",
"os": "windows",
"arch": "x86",
"compiler": "msvc2015",
"qt": "5.6.3",
"noqt": false,
"devDependencies": {
"topikm6-frame-debug": "^6.0.0",
"topikm6-templateclass-debug": "^1.0.0"
},
"prefix": "dist/topikm/qt5.6.3-win32-msvc2015/",
"dist_comment": "The following dist is written like this for compatibility with the topikm6 directory structure.",
"dist": "dist/topikm/qt5.6.3-win32-msvc2015/",
"dependencies": {
"topikm6-frame-debug": "^6.0.0",
"topikm6-templateclass-debug": "^1.0.0"
},
"packageFiles": [
"/bin_dbg/plugins/topikm6-topsys-plugind.dll",
"/bin_dbg/plugins/topikm6-topsys-plugind.lib",
"/bin_dbg/plugins/topikm6-topsys-plugind.pdb",
"/language/topikm6_topsys_en.qm",
"/language/topikm6_topsys_zhcn.qm",
"/language/topikm6_topsys_zhtw.qm",
"/resource/res/topsys.rcc"
]
}
]
\ No newline at end of file
IDI_ICON1 ICON DISCARDABLE "applogo.ico"
#include <QApplication>
#include <toputil/topmain.h>
int main(int argc, char *argv[])
{
return TopMain::appExec(argc, argv);
}
############################### COPYRIGHT ##################################
# #
# Copyright (c) 2009-2017 TopLinker Co.,Ltd. (http://www.toplinker.net) #
# ALL RIGHTS RESERVED #
# #
# The entire contents of this file is protected by copyright law and #
# international treaties. Unauthorized reproduction, reverse-engineering #
# and distribution of all or any portion of the code contained in this #
# file is strictly prohibited and may result in severe civil and #
# criminal penalties and will be prosecuted to the maximum extent #
# possible under the law. #
# #
# RESTRICTIONS #
# #
# THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED #
# FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE #
# COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE #
# AVAILABLE TO OTHER INDIVIDUALS WITHOUT WRITTEN CONSENT #
# AND PERMISSION FROM DEVELOPER MACHINES #
# #
# CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON #
# ADDITIONAL RESTRICTIONS. #
# #
#############################################################################
QT += widgets
TARGET = Top
TEMPLATE = app
SOURCES += main.cpp
RC_FILE = appicon.rc
OTHER_FILES += \
appicon.rc
LIB_LIST = tsec tbaseutil tdatabaseutil twidget topcore toputil
linux {
LIB_LIST = tscintilla tsec tbaseutil thoconwrapper boost_locale boost_system boost_thread tsec quazip twidget QtitanBase QtitanGrid tchart tdatabaseutil xl texcelxs topcore toputil
}
win32 {
LIBS += -ldbghelp
}
DIST_DIR = $$PWD/../../../dist
include(../shared/shared.pri)
LIBS += -L$$DESTDIR
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 45 45" style="enable-background:new 0 0 45 45;" xml:space="preserve">
<g>
<path d="M11.27,32.46L11.27,32.46c-0.81,0-1.46,0.66-1.46,1.46v4.41c0,0.81,0.66,1.46,1.46,1.46h0c0.81,0,1.46-0.66,1.46-1.46
v-4.41C12.74,33.11,12.08,32.46,11.27,32.46z"/>
<path d="M18.85,28.16L18.85,28.16c-0.81,0-1.46,0.66-1.46,1.46v8.71c0,0.81,0.66,1.46,1.46,1.46h0c0.81,0,1.46-0.66,1.46-1.46
v-8.71C20.31,28.81,19.66,28.16,18.85,28.16z"/>
<path d="M26.42,24.55L26.42,24.55c-0.81,0-1.46,0.66-1.46,1.46v12.32c0,0.81,0.66,1.46,1.46,1.46h0c0.81,0,1.46-0.66,1.46-1.46
V26.01C27.89,25.2,27.23,24.55,26.42,24.55z"/>
<path d="M34,30.44L34,30.44c-0.81,0-1.46,0.66-1.46,1.46v6.42c0,0.81,0.66,1.46,1.46,1.46h0c0.81,0,1.46-0.66,1.46-1.46v-6.42
C35.46,31.1,34.8,30.44,34,30.44z"/>
<path d="M41.73,20.28c-0.24-0.32-0.63-0.54-1.06-0.54h-6.22c-1.84-2.49-4.44-4.38-7.46-5.34c1.93-1.4,3.19-3.65,3.19-6.21
c0-4.25-3.44-7.69-7.69-7.69c-4.25,0-7.69,3.44-7.69,7.69c0,2.56,1.27,4.82,3.19,6.21c-3.02,0.96-5.61,2.85-7.46,5.34H4.06
c0,0,0,0,0,0c0,0,0,0,0,0c-0.73,0-1.33,0.59-1.33,1.33V42.9c0,0.44,0.21,0.82,0.54,1.06c0.25,0.32,0.63,0.54,1.06,0.54h36.61
c0,0,0,0,0,0c0,0,0,0,0,0c0.73,0,1.33-0.59,1.33-1.33V21.35C42.27,20.91,42.06,20.53,41.73,20.28z M17.01,8.19
c0-3.03,2.46-5.49,5.49-5.49c3.03,0,5.49,2.46,5.49,5.49c0,3.03-2.46,5.49-5.49,5.49C19.47,13.68,17.01,11.22,17.01,8.19z
M22.5,15.95c3.53,0,6.71,1.46,8.99,3.79H13.51C15.79,17.41,18.97,15.95,22.5,15.95z M39.61,41.83H5.39V22.42h34.22V41.83z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 45 45" style="enable-background:new 0 0 45 45;" xml:space="preserve">
<g>
<path d="M42.92,15.33C45.2,9.66,44.99,5.1,42.43,2.54c-3.11-3.11-9.95-2.7-15.96,0.97c-0.33,0.17-0.56,0.47-0.66,0.83
c-0.09,0.36-0.03,0.73,0.17,1.04c0.17,0.33,0.47,0.56,0.83,0.66c0.36,0.09,0.73,0.03,1.04-0.17c5.39-3.25,10.71-3.25,12.58-1.38
c1.73,1.73,1.66,5.25-0.14,9.82c-0.75,1.84-1.76,3.76-2.98,5.7c-1.66-2.21-3.57-4.43-5.74-6.6C20.38,2.2,7.66-2.57,2.55,2.54
C-1.2,6.24,0.37,14.09,5.87,22.4c-5.5,8.32-7.07,16.15-3.33,19.89c1.38,1.38,3.32,2.08,5.67,2.08c3.95,0,9.02-1.91,14.29-5.37
c5.25,3.47,10.32,5.37,14.26,5.37c2.28,0,4.22-0.62,5.67-1.94c3.71-3.76,2.14-11.62-3.38-19.96
C40.66,20.05,41.98,17.64,42.92,15.33z M4.48,40.43c-2.36-2.41-1.35-8.45,3.1-15.59c1.68,2.24,3.62,4.49,5.82,6.67
c2.2,2.2,4.45,4.12,6.7,5.79C12.97,41.83,6.86,42.85,4.48,40.43z M22.48,35.68c-2.33-1.68-4.74-3.7-7.14-6.1
c-2.42-2.4-4.45-4.81-6.14-7.14c1.69-2.38,3.72-4.84,6.14-7.3c1.24-1.25,2.56-2.42,3.87-3.53c0.56-0.5,0.62-1.36,0.14-1.94
c-0.5-0.56-1.36-0.62-1.94-0.14c-1.31,1.18-2.7,2.42-4.01,3.73c-2.22,2.22-4.17,4.49-5.85,6.75C3.07,12.94,2.07,6.89,4.48,4.48
c3.46-3.45,14.38,0.07,25.09,10.85c2.29,2.29,4.33,4.7,6.07,7.12c-1.74,2.42-3.78,4.83-6.07,7.12
C27.19,31.97,24.8,33.99,22.48,35.68z M40.29,30.61c1.8,4.49,1.87,8.09,0.14,9.82c-2.41,2.36-8.46,1.35-15.53-3.11
c2.24-1.66,4.49-3.57,6.68-5.74c2.14-2.14,4.06-4.38,5.75-6.64C38.54,26.87,39.54,28.78,40.29,30.61z"/>
<polygon points="19.64,25.27 20.53,32.46 28.51,16.4 12.45,24.39 "/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 45 45" style="enable-background:new 0 0 45 45;" xml:space="preserve">
<g>
<path d="M8.07,5.28c0.36,0,1.06-0.4,2.1-1.2v5.59c0,0.33,0.08,0.58,0.23,0.74c0.15,0.17,0.35,0.25,0.6,0.25
c0.56,0,0.84-0.41,0.84-1.23V2.4c0-0.29-0.07-0.53-0.2-0.69c-0.13-0.17-0.31-0.25-0.52-0.25c-0.19,0-0.32,0.04-0.39,0.11
c-0.07,0.07-0.22,0.27-0.45,0.59c-0.23,0.32-0.49,0.61-0.79,0.87C9.19,3.28,8.8,3.52,8.3,3.76C7.97,3.91,7.74,4.04,7.61,4.14
c-0.13,0.1-0.2,0.25-0.2,0.46c0,0.18,0.07,0.34,0.2,0.48C7.74,5.21,7.9,5.28,8.07,5.28z"/>
<path d="M12.67,25.63H9.41c0.1-0.16,0.21-0.29,0.31-0.41c0.23-0.28,0.66-0.68,1.29-1.19c0.63-0.51,1.07-0.89,1.34-1.13
c0.27-0.24,0.53-0.57,0.78-0.99c0.26-0.42,0.38-0.89,0.38-1.41c0-0.33-0.06-0.65-0.18-0.95c-0.12-0.31-0.29-0.58-0.52-0.81
c-0.22-0.23-0.48-0.42-0.77-0.55c-0.45-0.2-0.99-0.3-1.63-0.3c-0.53,0-0.99,0.08-1.38,0.23c-0.39,0.16-0.72,0.36-0.97,0.62
C7.8,19,7.61,19.28,7.48,19.59c-0.13,0.31-0.19,0.61-0.19,0.9c0,0.24,0.07,0.42,0.21,0.56c0.14,0.14,0.31,0.21,0.52,0.21
c0.24,0,0.42-0.08,0.54-0.23c0.12-0.15,0.23-0.36,0.33-0.64c0.1-0.28,0.17-0.45,0.21-0.51c0.31-0.48,0.74-0.72,1.29-0.72
c0.26,0,0.5,0.06,0.72,0.18c0.22,0.12,0.39,0.28,0.52,0.49c0.13,0.21,0.19,0.45,0.19,0.72c0,0.25-0.06,0.5-0.18,0.75
c-0.12,0.26-0.29,0.51-0.52,0.75c-0.23,0.24-0.51,0.49-0.85,0.73c-0.19,0.13-0.51,0.4-0.96,0.81c-0.45,0.41-0.95,0.9-1.5,1.48
c-0.13,0.14-0.26,0.34-0.37,0.58c-0.11,0.25-0.17,0.45-0.17,0.6c0,0.23,0.09,0.44,0.26,0.61c0.17,0.17,0.42,0.26,0.73,0.26h4.6
c0.28,0,0.48-0.07,0.62-0.21c0.14-0.14,0.2-0.31,0.2-0.52c0-0.23-0.09-0.41-0.26-0.54C13.24,25.7,13,25.63,12.67,25.63z"/>
<path d="M12.87,39.05c-0.22-0.22-0.49-0.42-0.81-0.59c0.33-0.28,0.59-0.56,0.77-0.86c0.18-0.29,0.27-0.64,0.27-1.05
c0-0.31-0.06-0.6-0.18-0.87c-0.12-0.27-0.31-0.51-0.55-0.71c-0.24-0.21-0.53-0.36-0.85-0.47c-0.33-0.11-0.69-0.16-1.09-0.16
c-0.46,0-0.87,0.06-1.24,0.19c-0.37,0.13-0.68,0.3-0.93,0.51c-0.25,0.21-0.44,0.44-0.57,0.67c-0.13,0.24-0.19,0.46-0.19,0.67
c0,0.22,0.07,0.4,0.21,0.53c0.14,0.13,0.29,0.2,0.45,0.2c0.14,0,0.26-0.02,0.37-0.07c0.11-0.05,0.18-0.12,0.22-0.2
c0.07-0.16,0.15-0.33,0.23-0.51c0.08-0.18,0.17-0.33,0.27-0.44c0.09-0.11,0.22-0.21,0.38-0.28c0.16-0.07,0.37-0.1,0.62-0.1
c0.37,0,0.66,0.11,0.88,0.34c0.22,0.23,0.33,0.5,0.33,0.81c0,0.41-0.14,0.73-0.41,0.95c-0.27,0.22-0.6,0.33-0.97,0.33H9.81
c-0.29,0-0.51,0.06-0.66,0.18c-0.15,0.12-0.22,0.28-0.22,0.48c0,0.2,0.06,0.36,0.18,0.47c0.12,0.11,0.3,0.17,0.52,0.17
c0.05,0,0.16-0.01,0.33-0.02c0.17-0.02,0.3-0.02,0.38-0.02c0.47,0,0.83,0.14,1.09,0.41c0.26,0.27,0.39,0.65,0.39,1.13
c0,0.32-0.08,0.61-0.23,0.86c-0.15,0.25-0.35,0.43-0.58,0.56c-0.24,0.13-0.48,0.19-0.74,0.19c-0.44,0-0.79-0.14-1.03-0.42
c-0.24-0.28-0.47-0.7-0.69-1.27c-0.03-0.09-0.1-0.18-0.21-0.24c-0.11-0.07-0.22-0.1-0.33-0.1c-0.23,0-0.42,0.07-0.57,0.22
c-0.15,0.15-0.23,0.34-0.23,0.58c0,0.18,0.06,0.42,0.19,0.7c0.13,0.28,0.32,0.56,0.57,0.82c0.25,0.26,0.57,0.48,0.96,0.66
c0.39,0.18,0.83,0.26,1.32,0.26c0.48,0,0.93-0.08,1.33-0.23c0.4-0.15,0.75-0.37,1.04-0.64c0.29-0.27,0.51-0.58,0.66-0.93
c0.15-0.35,0.22-0.71,0.22-1.08c0-0.31-0.06-0.6-0.17-0.87C13.25,39.52,13.09,39.28,12.87,39.05z"/>
<path d="M1.99,0.5H1.75C1.06,0.5,0.5,1.06,0.5,1.75v8.63c0,0.69,0.56,1.25,1.25,1.25h0.24c0.69,0,1.25-0.56,1.25-1.25V1.75
C3.24,1.06,2.68,0.5,1.99,0.5z"/>
<path d="M1.99,16.94H1.75c-0.69,0-1.25,0.56-1.25,1.25v8.63c0,0.69,0.56,1.25,1.25,1.25h0.24c0.69,0,1.25-0.56,1.25-1.25v-8.63
C3.24,17.5,2.68,16.94,1.99,16.94z"/>
<path d="M1.99,33.38H1.75c-0.69,0-1.25,0.56-1.25,1.25v8.63c0,0.69,0.56,1.25,1.25,1.25h0.24c0.69,0,1.25-0.56,1.25-1.25v-8.63
C3.24,33.93,2.68,33.38,1.99,33.38z"/>
<path d="M43.14,11.63c0.69,0,1.25-0.56,1.25-1.25V1.75c0-0.69-0.56-1.25-1.25-1.25H19.33c-0.69,0-1.25,0.56-1.25,1.25v8.63
c0,0.69,0.56,1.25,1.25,1.25h10.47v5.31H19.33c-0.69,0-1.25,0.56-1.25,1.25v8.63c0,0.69,0.56,1.25,1.25,1.25h10.47v5.31H19.33
c-0.69,0-1.25,0.56-1.25,1.25v8.63c0,0.69,0.56,1.25,1.25,1.25h23.81c0.69,0,1.25-0.56,1.25-1.25v-8.63c0-0.69-0.56-1.25-1.25-1.25
H32.67v-5.31h10.47c0.69,0,1.25-0.56,1.25-1.25v-8.63c0-0.69-0.56-1.25-1.25-1.25H32.67v-5.31H43.14z M41.69,41.69h-20.9v-5.5h20.9
V41.69z M41.69,25.25h-20.9v-5.5h20.9V25.25z M20.79,3.31h20.9v5.5h-20.9V3.31z"/>
</g>
</svg>
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1653644478727" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3408" width="64" height="64" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M947.2 921.6h-870.4C34.4576 921.6 0 887.1424 0 844.8v-665.6C0 136.8576 34.4576 102.4 76.8 102.4h870.4c42.3424 0 76.8 34.4576 76.8 76.8v665.6c0 42.3424-34.4576 76.8-76.8 76.8zM76.8 153.6a25.6 25.6 0 0 0-25.6 25.6v665.6a25.6 25.6 0 0 0 25.6 25.6h870.4a25.6 25.6 0 0 0 25.6-25.6v-665.6a25.6 25.6 0 0 0-25.6-25.6h-870.4z" fill="#000000" p-id="3409"></path><path d="M486.4 307.2h-307.2a25.6 25.6 0 0 1 0-51.2h307.2a25.6 25.6 0 0 1 0 51.2zM486.4 460.8h-307.2a25.6 25.6 0 0 1 0-51.2h307.2a25.6 25.6 0 0 1 0 51.2zM486.4 563.2h-307.2a25.6 25.6 0 0 1 0-51.2h307.2a25.6 25.6 0 0 1 0 51.2zM486.4 665.6h-307.2a25.6 25.6 0 0 1 0-51.2h307.2a25.6 25.6 0 0 1 0 51.2zM435.2 768h-256a25.6 25.6 0 0 1 0-51.2h256a25.6 25.6 0 0 1 0 51.2zM918.6816 335.0528l-41.6256-30.2592-15.9232-48.9472h-51.456l-41.6256-30.2592-41.6256 30.2592h-51.456l-15.9232 48.9472-41.6256 30.2592 15.9232 48.9472-15.9232 48.9472 41.6256 30.2592 6.7584 20.7872c-0.1024 0.8192-0.1024 1.5872-0.1024 2.4064v256a25.6 25.6 0 0 0 43.7248 18.1248l58.6752-58.6752 58.6752 58.6752a25.2928 25.2928 0 0 0 27.904 5.5296 25.6 25.6 0 0 0 15.8208-23.6544v-256A36.2496 36.2496 0 0 0 870.4 483.9936l6.7584-20.7872 41.6256-30.2592-15.9232-48.9472 15.9232-48.9472z m-241.152 19.5584l24.9856-18.176 9.5744-29.3888h30.9248L768 288.8704l24.9856 18.176h30.9248l9.5744 29.3888 24.9856 18.176-9.5744 29.3888 9.5744 29.3888-24.9856 18.176-9.5744 29.3888h-30.9248L768 479.1296l-24.9856-18.176h-30.9248l-9.5744-29.3888-24.9856-18.176 9.5744-29.3888-9.5744-29.3888z m108.5952 292.864a25.6 25.6 0 0 0-36.1984 0l-33.0752 33.0752v-168.448h9.5744l41.6256 30.2592 41.6256-30.2592h9.5744v168.448l-33.0752-33.0752z" fill="#000000" p-id="3410"></path></svg>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 23.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 45 45" style="enable-background:new 0 0 45 45;" xml:space="preserve">
<g>
<path d="M30.49,25.89c0.5-0.5,0.5-1.3,0-1.78l-7.09-7.09c-0.24-0.24-0.56-0.37-0.89-0.37c-0.33,0-0.67,0.13-0.89,0.37l-7.22,7.22
c-0.5,0.5-0.5,1.3,0,1.8c0.24,0.24,0.57,0.37,0.89,0.37c0.33,0,0.65-0.13,0.89-0.37l4.98-5v17.33c0,0.7,0.57,1.26,1.26,1.26
s1.26-0.57,1.26-1.26V20.87l5.02,5.02C29.19,26.39,29.99,26.39,30.49,25.89z"/>
<path d="M41.44,19.16c-1.43-1.45-3.17-2.42-5.1-2.86c-0.65-2.74-2.07-5.18-4.14-7.11c-2.64-2.46-6.08-3.81-9.69-3.81
c-3.36,0-6.61,1.19-9.16,3.35c-2.01,1.69-3.52,3.97-4.33,6.46C4.04,16.37,0.5,20.81,0.5,26.02c0,2.89,1.09,5.62,3.07,7.69
c1.98,2.08,4.65,3.3,7.56,3.44h4.57c0.69,0,1.25-0.56,1.25-1.25s-0.56-1.25-1.25-1.25l-4.51,0C8.98,34.56,6.91,33.61,5.37,32
c-1.53-1.61-2.38-3.73-2.38-5.97c0-4.26,3.03-7.85,7.21-8.54l0.8-0.13l0.2-0.78c0.6-2.3,1.93-4.41,3.75-5.94
c2.11-1.78,4.79-2.76,7.56-2.76c2.98,0,5.81,1.12,7.99,3.14c1.89,1.75,3.12,4.03,3.56,6.57l0.16,0.9l0.9,0.12
c1.72,0.24,3.29,1.03,4.54,2.3c1.51,1.53,2.34,3.55,2.34,5.68c0,2.15-0.84,4.18-2.36,5.7c-1.53,1.53-3.49,2.34-5.68,2.34h-4.97
c-0.69,0-1.25,0.56-1.25,1.25s0.56,1.25,1.25,1.25h4.97c2.82,0,5.46-1.09,7.44-3.07c1.99-1.99,3.09-4.64,3.09-7.46
C44.5,23.79,43.41,21.16,41.44,19.16z"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.0.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="图层_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 45 45" style="enable-background:new 0 0 45 45;" xml:space="preserve">
<path d="M23.2,4.6c-0.5-0.3-1.2-0.3-1.7,0L6.2,13.2l15.3,8.6c0.5,0.3,1.2,0.3,1.7,0l15.3-8.6L23.2,4.6L23.2,4.6z M19.8,1.3
c1.6-0.9,3.6-0.9,5.2,0l15.3,8.6c2.5,1.4,2.5,5.1,0,6.6l-2.5,1.4l2.5,1.4c2.5,1.4,2.5,5.1,0,6.6l-2.5,1.4l2.5,1.4
c2.5,1.4,2.5,5.1,0,6.6L25,43.7c-1.6,0.9-3.6,0.9-5.2,0L4.5,35.1C2,33.7,2,30,4.5,28.6L7,27.2l-2.5-1.4c-2.5-1.4-2.5-5.1,0-6.6
L7,17.8l-2.5-1.4C2,15,2,11.3,4.5,9.9C4.5,9.9,19.8,1.3,19.8,1.3z M10.8,20l-4.5,2.5l15.3,8.6c0.5,0.3,1.2,0.3,1.7,0l15.3-8.6L34,20
L25,25c-1.6,0.9-3.6,0.9-5.2,0L10.8,20z M10.8,29.3l-4.5,2.5l15.3,8.6c0.5,0.3,1.2,0.3,1.7,0l15.3-8.6L34,29.3l-9,5.1
c-1.6,0.9-3.6,0.9-5.2,0L10.8,29.3z"/>
</svg>
TEMPLATE = aux
DIST_DIR = $$PWD/../../../dist
include(../shared/shared.pri)
COPY=cp
win32: COPY=copy
SHELL_SUFFIX=sh
win32: SHELL_SUFFIX=bat
!exists($$system_path($${TOPIKM_SDKPATH})) {
mkpath($$system_path($${TOPIKM_SDKPATH}))
}
# 复制topikm.cfg
!exists($$system_path($${DIST_DIR}/topikm/config)) {
mkpath($$system_path($${DIST_DIR}/topikm/config))
}
!exists($$system_path($${DIST_DIR}/topikm/config/topikm.cfg)) {
system($${COPY} topikm.cfg $$system_path($${DIST_DIR}/topikm/config/))
}
# 编译rcc到目标目
!exists($$system_path($${TOPIKM_SDKPATH}\resource\res)) {
mkpath($$system_path($${TOPIKM_SDKPATH}\resource\res))
}
system($${QTBIN}/rcc -binary res.qrc -o $${TOPIKM_SDKPATH}/resource/res/topsys.rcc)
DISTFILES += \
topikm.cfg
RESOURCES += \
res.qrc
<RCC>
<qresource prefix="/topsys">
<file>icon/chart_dev.svg</file>
<file>icon/chart_navi.svg</file>
<file>icon/enum_mgt.svg</file>
<file>icon/module_upload.svg</file>
<file>icon/module_version.svg</file>
<file>icon/license.svg</file>
</qresource>
</RCC>
{
"debug_mode": "5",
"http_url": "http://139.196.104.13:9181/api/TOPMES6_PRODUCT_V6/ikm6",
"module_dirs_dev": [
"../../../src/module/TOPSYS",
"../../../src/module/DEMO"
],
"module_dirs_prod": [],
"module_dirs_project": [],
"product_category": "topsys"
}
@echo off
%QTBIN%/lupdate plugin.pro
############################### COPYRIGHT ##################################
# #
# Copyright (c) 2009-2021 TopLinker Co.,Ltd. (http://www.topibd.com) #
# ALL RIGHTS RESERVED #
# #
# The entire contents of this file is protected by copyright law and #
# international treaties. Unauthorized reproduction, reverse-engineering #
# and distribution of all or any portion of the code contained in this #
# file is strictly prohibited and may result in severe civil and #
# criminal penalties and will be prosecuted to the maximum extent #
# possible under the law. #
# #
# RESTRICTIONS #
# #
# THE SOURCE CODE CONTAINED WITHIN THIS FILE AND ALL RELATED #
# FILES OR ANY PORTION OF ITS CONTENTS SHALL AT NO TIME BE #
# COPIED, TRANSFERRED, SOLD, DISTRIBUTED, OR OTHERWISE MADE #
# AVAILABLE TO OTHER INDIVIDUALS WITHOUT WRITTEN CONSENT #
# AND PERMISSION FROM DEVELOPER MACHINES #
# #
# CONSULT THE END USER LICENSE AGREEMENT FOR INFORMATION ON #
# ADDITIONAL RESTRICTIONS. #
# #
#############################################################################
TARGET = $$qtLibraryTarget(topikm6-topsys-plugin)
QT += core sql widgets script network xml scripttools printsupport
win32 {
QT += axcontainer
}
TEMPLATE = lib
CONFIG += plugin
SOURCES += \
topsysplugin.cpp
HEADERS += \
topsysplugin.h
LIB_LIST = tsec tbaseutil tdatabaseutil twidget topcore toputil tchart texcelxs
win32 {
LIB_LIST += tole
}
win32 {
LIBS += -ldbghelp
LIBS += -luser32
}
include(sysmainwindow/sysmainwindow.pri)
include(sysusermgt/sysusermgt.pri)
include(sysusermgtv1/sysusermgtv1.pri)
include(sysusermgtv2/sysusermgtv2.pri)
include(sysrolemgt/sysrolemgt.pri)
include(sysmoduleconfmgt/sysmoduleconfmgt.pri)
include(sysenumlistmgt/sysenumlistmgt.pri)
include(syscommugroupmgt/syscommugroupmgt.pri)
include(syslogconsole/syslogconsole.pri)
include(sysmacroconsole/sysmacroconsole.pri)
include(sysconfigmgt/sysconfigmgt.pri)
include(sysmainwindowv2/sysmainwindowv2.pri)
include(syscontactmgt/syscontactmgt.pri)
include(syschartdevelopermgt/syschartdevelopermgt.pri)
include(syschartnavigationmgt/syschartnavigationmgt.pri)
DIST_DIR = $$PWD/../../../dist
include(../shared/shared.pri)
INCLUDEPATH += ../lib
LIBS += -L$$DESTDIR
win32 {
LIBS += -L$${DESTDIR}/plugins
}
win32{
DESTDIR = $${DESTDIR}/plugins
}
TRANSLATIONS += topikm6_topsys_zhcn.ts \
topikm6_topsys_en.ts \
topikm6_topsys_zhtw.ts
QM_LIST = $$PWD/*.qm
DEST_LANGUAGE_PATH = $$system_path($${TOPIKM_SDKPATH}/language)
!exists($${DEST_LANGUAGE_PATH}) {
mkpath($${DEST_LANGUAGE_PATH})
}
for(qm, QM_LIST) {
win32{
system(copy $$system_path($${qm}) $${DEST_LANGUAGE_PATH})
}
else{
system(cp $$system_path($${qm}) $${DEST_LANGUAGE_PATH})
}
}
# Version
CONFIG += skip_target_version_ext
VERSION = 6.2.28.0
QMAKE_TARGET_PRODUCT = topikm6-topsys
QMAKE_TARGET_COMPANY = TopLinker Co.,Ltd.
QMAKE_TARGET_COPYRIGHT = Copyright(C) 2021 TopLinker
This diff is collapsed.
#ifndef SYSCHARTDEVELOPER_H
#define SYSCHARTDEVELOPER_H
#include <topcore/topclassabs.h>
#include <topcore/topclasshelper.h>
class TTabWidget;
class TSqlSelectorV2;
class TSplitter;
class QVBoxLayout;
class TCodeEdit;
class TTableView;
class TUiLoader;
class TSearchEntry;
class SysChartDeveloper: public TopClassAbs
{
Q_OBJECT
public:
explicit SysChartDeveloper(const QString &iModuleName = QString(""),
const QVariantMap &iUrlPars = QVariantMap(),
QWidget *iParent = nullptr);
~SysChartDeveloper();
public slots:
void refresh();
void refreshDatasource();
void refreshGraph();
void refreshDatasourceInfo();
void refreshGraphInfo();
void saveData();
void clearData();
void saveDatasource();
void saveGraph();
void setSpecifiedClass(const QString &iClassName);
QString specifiedClass();
QVariantList selectedDatasrcDataMaps() const;
QVariantList selectedGraphDataMaps() const;
QVariantList selectedDatasrcItems() const;
QVariantList selectedGraphItems() const;
QVariantMap detailDataMap() const;
void setDatasourceModified(const bool &iFlag = true);
void setGraphModified(const bool &iFlag = true);
bool isDatasourceModified() const;
bool isGraphModified() const;
private slots:
void dataModified(bool iFlag = true);
void datasourceModified(bool iFlag = true);
void graphModified(bool iFlag = true);
void onDataSelectionChanged();
void onGraphSelectionChanged();
protected:
void uidChangeEvent(const QString &iUidStr) override;
private:
void initUi();
void initTopWidget();
void initBottomWidget();
void initDatasourceTab();
void initGraphTab();
TSqlSelectorV2 getSqlSelector();
private:
TTabWidget *mTabNavigation = nullptr;
TTabWidget *mTabDataGraph = nullptr;
TSplitter *mMainSplitter = nullptr;
QVBoxLayout *mMainLayout;
TCodeEdit *mEdtGraph = nullptr;
TCodeEdit *mEdtParam = nullptr;
TTableView *mDatasourceTable = nullptr;
TTableView *mGraphTable = nullptr;
QWidget *mDatasourceWgt = nullptr;
QWidget *mGraphWgt = nullptr;
TSearchEntry *mSearchEntryData = nullptr;
TSearchEntry *mSearchEntryGraph = nullptr;
TUiLoader *mUiLoaderData = nullptr;
TUiLoader *mUiLoaderGraph = nullptr;
TopClassTableConf mTableConf;
QString mSpecifiedClass;
QVariantMap mDetailDataMap;
bool mDatasourceModified = false;
bool mGraphModified = false;
};
#endif // SYSCHARTDEVELOPER_H
This diff is collapsed.
#ifndef SYSCHARTDEVELOPERMGT_H
#define SYSCHARTDEVELOPERMGT_H
#pragma execution_character_set("utf-8")
#include <topcore/topclassabs.h>
#include <topcore/topclasshelper.h>
#include <tdatabaseutil/tsqlselectorv2.h>
#include <QFileDialog>
class QVBoxLayout;
class TSplitter;
class TTableViewV2;
class TSearchEntry;
class TUiLoader;
class TPageTool;
class TDialog;
class TWidget;
class TSqlSelectorV2;
class TTableView;
class SysChartDeveloper;
class SysChartNavigation;
class SysChartDeveloperMgt: public TopClassAbs
{
Q_OBJECT
public:
explicit SysChartDeveloperMgt(const QString &iModuleName = QString(""),
const QVariantMap &iUrlPars = QVariantMap(),
QWidget *iParent = nullptr);
~SysChartDeveloperMgt();
public slots:
void refresh(bool iResetPageBol = true);
void preview();
QVariantList selectedItems() const;
QVariantList selectedDataMaps() const;
QString specifiedClass();
void setFileDir(const QString &iDir);
QString lastFileDir();
void exportChart();
void importChart();
private slots:
void onSelectionChanged();
void onDetailChanged();
void onPageChanged();
private:
void initUi();
void initPreviewUi();
void initSpecifiedClass();
TSqlSelectorV2 getSqlSelector(bool iResetPageBol = true);
QStringList extractDir(const QString &iPath);
private:
TSplitter *mBodySplitter = nullptr;
QWidget *mBodyWidget = nullptr;
QWidget *mMgtWidget = nullptr;
QVBoxLayout *mBodyLayout = nullptr;
TSearchEntry *mSearchEntry = nullptr;
TPageTool *mPageTool = nullptr;
TTableView *mTableView = nullptr;
SysChartDeveloper *mDetail = nullptr;
TDialog *mPreviewDlg = nullptr;
SysChartNavigation *mChartNaviWgt = nullptr;
TopClassTableConf mTableConf;
QString mSpecifiedClass;
QString mLastChartNaviId = "";
QString mLastDir;
};
class MultiFileSelect :public QFileDialog
{
Q_OBJECT
public:
explicit MultiFileSelect(QWidget *parent = 0);
signals:
public slots:
void go();
};
#endif // SYSCHARTDEVELOPERMGT_H
HEADERS += \
$$PWD/syschartdeveloper.h \
$$PWD/syschartdevelopermgt.h
SOURCES += \
$$PWD/syschartdeveloper.cpp \
$$PWD/syschartdevelopermgt.cpp
This diff is collapsed.
#ifndef SYSCHARTNAVIGATION_H
#define SYSCHARTNAVIGATION_H
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
#include <topcore/topclassabs.h>
#include <topcore/topclasshelper.h>
#include <QtPrintSupport/QPrinter>
#include <QResizeEvent>
class TComboBox;
class TSplitter;
class QVBoxLayout;
class TChartWidget;
class TScrollArea;
class QScrollArea;
class TAccordion;
class SysChartNavigation : public TopClassAbs
{
Q_OBJECT
public:
explicit SysChartNavigation(const QString &iModuleName = QString(""),
const QVariantMap &iUrlPars = QVariantMap(),
QWidget *iParent = nullptr);
~SysChartNavigation();
public slots:
void onSearch(); // 搜索事件
void onClear(); // 清空输入
void onDoubleClicked(); // 图形控件的双击事件
void onExportPdfClicked(const QString &iFileStr = ""); // 导出PDF事件
void onExportExcelClicked(const QString &iFileStr = ""); // 导出Excel事件 (ExcelXS)
void onExportExcelClickedOld(); // 导出Excel事件 (TExcel)
void graphOnly(int iMode = 0);
void setChartVisibleData(const QVariantMap &iDataMap);
QVariantMap chartVisibleData();
TUiLoader *uiloader();
QString currentNaviName();
protected:
void uidChangeEvent(const QString &iUidStr) override;
void resizeEvent(QResizeEvent *iEvent) override;
private:
void initUi();
void dynamicGenerateChart(const int &pId, const QString &funcJsonData, const QVariantMap &packMap, const QString &wgtType);
void configGenerateChart(const int &pId, const QString &funcJsonData, const QVariantMap &packMap, const QString &wgtType);
void generateUiLoader(const int &pId, const QString &funcJsonData, const QVariantMap &packMap, const QString &wgtType);
QString mapToJson(const QVariantMap &data);
QVariantList listPageType(); //得到导出PDF的纸张类型
QVariantList listOpenType(); //导出PDF是否打开
QPagedPaintDevice::PageSize pageTypeToEnum(const QString &pageSize); //纸张类型转Enum
int calcTreeDepth(const QVariantList &iDataList);
int calcTreeDepth(const QVariantMap &iDataMap);
int calcTreeLeafSize(const QVariantMap &iDataMap);
private:
TComboBox* mSizeComboBox = nullptr;
TComboBox* mOpenComboBox = nullptr;
TUiLoader* mUiLoader = nullptr;
TSplitter* mSplitter = nullptr;
QWidget* mChartListWgt = nullptr;
QVBoxLayout* mUiLoaderLayout = nullptr;
QMap<QString, TChartWidget*> mChartMap;
QMap<QString,QScrollArea*> mChartAreaMap;
QMap<TChartWidget*, QString> mChartParameterRemarkMap; //TChartWidget对应的graphId
QMap<QString, TUiLoader*> mUiLoaderMap;
QMap<TUiLoader*, QString> mUiLoaderParamRemarkMap;
TScrollArea *mScrollArea = nullptr;
TAccordion *mAccordion = nullptr;
QVariantMap mChartVisibleData;
QString mNaviName;
QVariantMap mDataSrcRetCache; // 数据源函数执行结果缓存(图表)
QVariantMap mDataSrcRetCacheUiLoader; // 数据源函数执行结果缓存(UiLoader)
QVariantMap mDataSrcRetStrCache;
};
#endif // SYSCHARTNAVIGATION_H
#include "syschartnavigationmgt.h"
#include <QToolBar>
#include <QVBoxLayout>
#include <QDebug>
#include <topcore/topcore.h>
#include <topcore/topclasssqlthread.h>
#include <topcore/topenummanager.h>
#include <toputil/t.h>
#include <tdatabaseutil/tsqlconnectionpoolv2.h>
#include <tdatabaseutil/tsqlqueryv2.h>
#include <tdatabaseutil/tsqlselectorv2.h>
#include <tbaseutil/ttheme.h>
#include <tbaseutil/tdataparse.h>
#include <tbaseutil/tdataresponse.h>
#include <tbaseutil/tresource.h>
#include <tbaseutil/tenumlist.h>
#include <twidget/tmessagebox.h>
#include <twidget/tsplitter.h>
#include <twidget/ttableviewv2.h>
#include <twidget/ttableview.h>
#include <twidget/ttreemodel.h>
#include <twidget/tpagetool.h>
#include <twidget/tuiloader.h>
#include <twidget/tsearchentry.h>
#include <twidget/tdialog.h>
#include <twidget/tcodeedit.h>
#include <twidget/twidget.h>
#include <tchart/tchartwidget.h>
#include <tchart/tchartstore.h>
#include <tchart/tchartaxisnumeric.h>
#include "syschartnavigation.h"
SysChartNavigationMgt::SysChartNavigationMgt(const QString &iModuleName, const QVariantMap &iUrlPars, QWidget *iParent)
: TopClassAbs(iParent)
{
this->setLicenseKey("sys_common");
initModule(iModuleName, iUrlPars);
initUi();
// initSpecifiedClass();
parseParams(iUrlPars);
refresh();
refreshActionState();
}
SysChartNavigationMgt::~SysChartNavigationMgt()
{
}
void SysChartNavigationMgt::refresh(bool iResetPageBol)
{
if (!this->uid().isEmpty()) {
graphOnly();
return;
}
t::loading(this);
TSqlSelectorV2 selector = getSqlSelector(iResetPageBol);
QVariant data = doThreadWork(new TopClassSqlThread(this), TOPSQLTHREAD_SELECT_ARRAYMAP, QVariant::fromValue(selector));
unloading();
TDataResponse dataRes(data.toMap());
if (dataRes.hasError()) {
alertError(dataRes.errText(), "Error");
return;
}
if (mPageTool != nullptr) {
mPageTool->setRowCount(dataRes.dataCount(), true);
}
QVariantList dataList = dataRes.data().toList();
TopClassHelper::formatTableData(this,&mTableConf,dataList);
mTableView->loadData(dataList);
mDetail->setUid("");
alertOk(ttr("Load data successful!"));
}
QVariantList SysChartNavigationMgt::selectedItems() const
{
return mTableView->selectedPrimaryKeys();
}
QVariantList SysChartNavigationMgt::selectedDataMaps() const
{
return mTableView->selectedRowDataMaps();
}
QString SysChartNavigationMgt::specifiedClass()
{
return mSpecifiedClass;
}
void SysChartNavigationMgt::onSelectionChanged()
{
QVariantList selectedItems = mTableView->selectedPrimaryKeys();
QString uid;
if (!selectedItems.isEmpty()) {
uid = selectedItems.first().toString();
}
if (mDetail->uid() != uid) {
mDetail->setLastUid(uid);
if (!mDetail->isDataModified()) {
mDetail->setUid(uid);
}
}
refreshActionState();
}
void SysChartNavigationMgt::onDetailChanged()
{
refreshActionState();
}
void SysChartNavigationMgt::onPageChanged()
{
refresh(false);
}
void SysChartNavigationMgt::initUi()
{
mBodyWidget = new QWidget(this);
this->setCentralWidget(mBodyWidget);
mBodySplitter = new TSplitter(this);
mBodySplitter->setOrientation(Qt::Horizontal);
mBodyLayout = new QVBoxLayout(mBodyWidget);
mBodyLayout->setContentsMargins(0, 0, 0, 0);
mBodyLayout->setSpacing(0);
mBodyLayout->addWidget(mBodySplitter);
mMgtWidget = new QWidget(this);
QVBoxLayout *mgtLayout = new QVBoxLayout(mMgtWidget);
mgtLayout->setMargin(0);
mgtLayout->setSpacing(0);
// top toolbar
if (QToolBar *toolbar = qobject_cast<QToolBar*>(uim()->getWidget("MAIN_TOOLBAR"))) {
mgtLayout->insertWidget(0, toolbar);
mSearchEntry = qobject_cast<TSearchEntry *>(uim()->getWidget("MAIN_TOOLBAR/SEARCH_ENTRY"));
if (mSearchEntry != nullptr) {
connect(mSearchEntry, SIGNAL(search(QString,QVariant)), this, SLOT(refresh()));
}
}
// tableview
mTableView = new TTableView(this);
TopClassHelper::parseTableConf0(this,"view",&mTableConf);
mTableView->setDataKeyList(mTableConf.dataKeys);
mTableView->setPrimaryKey(mTableConf.primaryKey);
QVariantList headerItems = mTableConf.horizontalHeaders;
headerItems.prepend(QVariant());
mTableView->setHeaderItem(headerItems);
mTableView->horizontalHeader()->setFixedHeight(40);
QMenu *popMenu = qobject_cast<QMenu*>(uim()->getWidget("TABLEVIEW_POPUP"));
if(popMenu) {
mTableView->setContextMenu(popMenu);
}
if (mSearchEntry != nullptr) {
mSearchEntry->setOptionList(TDataParse::headerItem2searchList(mTableView->headerItem()));
mSearchEntry->setPlaceholderText(ttr("Search %1"));
}
mgtLayout->addWidget(mTableView);
connect(mTableView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
this, SLOT(onSelectionChanged()));
mBodySplitter->addWidget(mMgtWidget);
// bottom toolbar
if (QToolBar *toolbar = qobject_cast<QToolBar*>(uim()->getWidget("BOTTOM_TOOLBAR"))) {
mBodyLayout->addWidget(toolbar, 0);
mPageTool = qobject_cast<TPageTool *>(uim()->getWidget("BOTTOM_TOOLBAR/PAGE_TOOL"));
if (mPageTool != nullptr) {
mPageTool->setPageSizeVisible(true);
connect(mPageTool, SIGNAL(pageChanged(int,int)), this, SLOT(onPageChanged()));
}
}
// detail
mDetail = new SysChartNavigation("sys-chart-navigation");
mBodySplitter->addWidget(mDetail);
const QStringList factors = config("view_factors","1:1").toString().split(":");
if(factors.size() == 2) {
const float f0 = factors[0].toFloat();
const float f1 = factors[1].toFloat();
const float total = f0 + f1;
const int w = width();
mBodySplitter->setSizes(QList<int>()
<< static_cast<int>(w*f0/total)
<< static_cast<int>(w*f1/total));
}
connect(mDetail, SIGNAL(windowModifyChanged(bool)),this,SLOT(onDetailChanged()));
}
void SysChartNavigationMgt::initSpecifiedClass()
{
t::loading(this);
TSqlSelectorV2 selector;
selector.setTable("pub_conf");
selector.setField("text_data");
selector.setWhere("path", "navigation_specified_class");
QVariant data = doThreadWork(new TopClassSqlThread(this), TOPSQLTHREAD_SELECT_VALUE, QVariant::fromValue(selector));
unloading();
TDataResponse dataRes(data.toMap());
if (dataRes.hasError()) {
alertError(dataRes.errText(), "Error");
return;
}
mSpecifiedClass = dataRes.data().toString();
qDebug()<<"Specified Class: "<<mSpecifiedClass;
}
TSqlSelectorV2 SysChartNavigationMgt::getSqlSelector(bool iResetPageBol)
{
TSqlSelectorV2 selector;
if(mTableConf.dbTableName.isEmpty()) {
selector.setTable("pub_chart_navigation");
} else {
selector.setTable(mTableConf.dbTableName);
}
selector.setReturnRowCount(true);
selector.setField(mTableConf.queryFields);
int pageNumInt = 1;
int pageSizeInt = -1;
if (mPageTool != nullptr) {
if (iResetPageBol) {
mPageTool->setCurrentPage(1, true);
}
pageNumInt = mPageTool->currentPage();
pageSizeInt = mPageTool->pageSize();
}
if (!mSpecifiedClass.isEmpty()) {
selector.setWhere("class", mSpecifiedClass);
}
if (mSearchEntry != nullptr) {
selector.whereRef().append(mSearchEntry->sqlWhere());
}
selector.setOrder("id", Qt::AscendingOrder);
if (pageNumInt < 1) {
pageNumInt = 1;
}
if (pageSizeInt < 1) {
pageSizeInt = 100;
}
if (mPageTool != nullptr) {
selector.setPage(pageNumInt, pageSizeInt);
}
return selector;
}
void SysChartNavigationMgt::graphOnly()
{
mDetail->setUserData("to_detail_data", this->userData("to_detail_data"));
mDetail->setUid(this->uid());
QWidget *wid = mBodySplitter->widget(0);
wid->setVisible(false);
mDetail->graphOnly(mToolBarMode);
}
void SysChartNavigationMgt::parseParams(const QVariantMap &iParamMap)
{
QString name = iParamMap.value("name").toString();
if (!name.isEmpty()) {
TSqlSelectorV2 selector;
selector.setTable("pub_chart_navigation");
selector.setField("id");
selector.setWhere("name", name);
QVariant data = doThreadWork(new TopClassSqlThread(this), TOPSQLTHREAD_SELECT_VALUE, QVariant::fromValue(selector));
TDataResponse dataRes(data.toMap());
if (dataRes.hasError()) {
alertError(dataRes.errText(), "Error");
return;
}
QString uid = dataRes.data().toString();
this->setUid(uid);
}
mToolBarMode = iParamMap.value("toolbar_mode", 0).toInt();
}
#ifndef SYSCHARTNAVIGATIONMGT_H
#define SYSCHARTNAVIGATIONMGT_H
#include <topcore/topclassabs.h>
#include <topcore/topclasshelper.h>
#include <tdatabaseutil/tsqlselectorv2.h>
class QVBoxLayout;
class TSplitter;
class TTableViewV2;
class TSearchEntry;
class TUiLoader;
class TPageTool;
class TDialog;
class TWidget;
class TSqlSelectorV2;
class TTableView;
class SysChartNavigation;
class SysChartNavigationMgt: public TopClassAbs
{
Q_OBJECT
public:
explicit SysChartNavigationMgt(const QString &iModuleName = QString(""),
const QVariantMap &iUrlPars = QVariantMap(),
QWidget *iParent = nullptr);
~SysChartNavigationMgt();
public slots:
void refresh(bool iResetPageBol = true);
QVariantList selectedItems() const;
QVariantList selectedDataMaps() const;
QString specifiedClass();
private slots:
void onSelectionChanged();
void onDetailChanged();
void onPageChanged();
private:
void initUi();
void initSpecifiedClass();
TSqlSelectorV2 getSqlSelector(bool iResetPageBol = true);
void graphOnly();
void parseParams(const QVariantMap &iParamMap);
private:
TSplitter *mBodySplitter = nullptr;
QWidget *mBodyWidget = nullptr;
QWidget *mMgtWidget = nullptr;
QVBoxLayout *mBodyLayout = nullptr;
TSearchEntry *mSearchEntry = nullptr;
TPageTool *mPageTool = nullptr;
TTableView *mTableView = nullptr;
SysChartNavigation *mDetail = nullptr;
TopClassTableConf mTableConf;
QString mSpecifiedClass;
QString mLastChartNaviId = "";
int mToolBarMode = 0; //0:工具栏只有搜索,1:工具栏还有导出功能
};
#endif // SYSCHARTNAVIGATIONMGT_H
HEADERS += \
$$PWD/syschartnavigation.h \
$$PWD/syschartnavigationmgt.h
SOURCES += \
$$PWD/syschartnavigation.cpp \
$$PWD/syschartnavigationmgt.cpp
This diff is collapsed.
#ifndef SYSCOMMUGROUP_H
#define SYSCOMMUGROUP_H
#include <topcore/topclassabs.h>
class QHBoxLayout;
class TUiLoader;
class TTableView;
class SysCommuGroup : public TopClassAbs
{
Q_OBJECT
public:
explicit SysCommuGroup(const QString &iModuleNameStr = QString(""),
const QVariantMap &iUrlPars = QVariantMap(),
QWidget *iParent = nullptr);
~SysCommuGroup();
public slots:
void reload();
void copy();
void create();
void clearData();
void setData(const QVariantMap &iDataMap);
QVariantMap getData() const;
void saveData();
void setSendMode(const QString &iModeStr);
void showAddContactMail();
QVariantList getAddContactMailList();
void showAddContactWeixin();
QVariantList getAddContactWeixinList();
void showManuallyAddMail();
void showManuallyAddWeixin();
void fillTableData(const QVariantList &iDataLst);
TTableView *getTableView();
QVariantList plantList();
QVariantList departmentList();
QVariantMap departmentMap();
void setWorkcenterId(const QString &iId);
QString workcenterId();
protected:
void uidChangeEvent(const QString &iUidStr) override;
void resizeEvent(QResizeEvent *iEvent) override;
private:
void initSearchEntry();
QVariantMap tableHeaderItem(const QString &iKeyStr, const QString &iDispStr, int iSizeInt = 100, const QString &iTypeStr = QString());
void initPlantList();
private slots:
void onDoSearch(const QString &iSearchStr, const QVariant &iOptions);
private:
TUiLoader *mUiLoader = nullptr;
TTableView *mTableView = nullptr;
QHBoxLayout *mBodyLayout = nullptr;
QStringList mSearchKey;
QVariantList mPlantList;
QVariantList mDepartmentList;
QVariantMap mDepartmentMap;
QString mWorkcenterId;
};
#endif // SYSCOMMUGROUP_H
This diff is collapsed.
#ifndef SYSCOMMUGROUPMGT_H
#define SYSCOMMUGROUPMGT_H
#include <tbaseutil/tdataresponse.h>
#include <tdatabaseutil/tsqlselectorv2.h>
#include <topcore/topclassabs.h>
#include <topcore/topclasshelper.h>
class TTableView;
class TSearchEntry;
class TPageTool;
class TSplitter;
class SysCommuGroup;
class SysCommuGroupMgt : public TopClassAbs
{
Q_OBJECT
public:
explicit SysCommuGroupMgt(const QString &iModuleNameStr = QString(""),
const QVariantMap &iUrlPars = QVariantMap(),
QWidget *iParent = nullptr);
~SysCommuGroupMgt();
public slots:
void refresh(bool iResetPageBol = true);
void deleteItem(const QVariantList &iIdLst);
QVariantList selectedItems();
TopClassAbs *openItem(int iIdInt);
void newItem();
void onClearNavi();
void onNaviDataChanged();
QVariantList plantList();
QVariantList departmentList();
QVariantMap departmentMap();
private slots:
void onPageChanged();
void onSelectionChanged();
void onDetailSaved(const QVariant &iUidStr);
void onDetailChanged();
private:
TSqlSelectorV2 getSqlSelector(bool iResetPageBol = true);
void initTableView();
void initNaviView();
void fillTableData(const TDataResponse &iDataRes);
private:
TTableView *mTableView = nullptr;
TSearchEntry *mSearchEntry= nullptr;
TPageTool *mPageTool= nullptr;
QVariantList mSelectedLst;
SysCommuGroup *mDetailView= nullptr;
TSplitter *mBodySplitter = nullptr;
TSplitter* mBodyWidget = nullptr;
TUiLoader *mNaviView = nullptr;
QString mFixedSqlWhere;
TopClassTableConf mTableConf;
};
#endif // SYSCOMMUGROUPMGT_H
HEADERS += \
$$PWD/syscommugroupmgt.h \
$$PWD/syscommugroup.h \
$$PWD/syscommugroupthread.h \
$$PWD/syscommugroupmgtthread.h
SOURCES += \
$$PWD/syscommugroupmgt.cpp \
$$PWD/syscommugroup.cpp \
$$PWD/syscommugroupthread.cpp \
$$PWD/syscommugroupmgtthread.cpp
<RCC>
<qresource prefix="/sysadmin/sysmailgroupmgt">
</qresource>
</RCC>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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