Parcourir la source

初始化项目

master
suomingxiang il y a 6 mois
révision
afe7568077
100 fichiers modifiés avec 7233 ajouts et 0 suppressions
  1. 16
    0
      .editorconfig
  2. 8
    0
      .eslintignore
  3. 7
    0
      .eslintrc.js
  4. 44
    0
      .gitignore
  5. 22
    0
      .prettierignore
  6. 21
    0
      .prettierrc.js
  7. 46
    0
      CODE_OF_CONDUCT.md
  8. 21
    0
      LICENSE
  9. 85
    0
      README.md
  10. 0
    0
      cc
  11. 187
    0
      config/config.ts
  12. 40
    0
      config/defaultSettings.ts
  13. 0
    0
      config/json.txt
  14. 9
    0
      config/myConfig.js
  15. 593
    0
      config/oneapi.json
  16. 64
    0
      config/proxy.ts
  17. 0
    0
      config/react.min.js
  18. 226
    0
      config/routes.ts
  19. 23
    0
      jest.config.ts
  20. 11
    0
      jsconfig.json
  21. 176
    0
      mock/listTableList.ts
  22. 115
    0
      mock/notices.ts
  23. 324
    0
      mock/requestRecord.mock.js
  24. 1927
    0
      mock/route.ts
  25. 203
    0
      mock/user.ts
  26. 160
    0
      package.json
  27. BIN
      public/TheFile/template.xlsx
  28. BIN
      public/favicon.ico
  29. BIN
      public/icons/icon-128x128.png
  30. BIN
      public/icons/icon-192x192.png
  31. BIN
      public/icons/icon-512x512.png
  32. BIN
      public/icons/menu/gongcheng.png
  33. BIN
      public/icons/menu/jiashi.png
  34. BIN
      public/icons/menu/sheji.png
  35. BIN
      public/icons/menu/zhinenghua.png
  36. BIN
      public/image/1.png
  37. BIN
      public/image/2.png
  38. BIN
      public/image/3.png
  39. BIN
      public/image/4.png
  40. BIN
      public/image/brand_light1.jpg
  41. BIN
      public/image/brand_light2.jpg
  42. BIN
      public/image/brand_light3.jpg
  43. BIN
      public/image/model_banner.jpg
  44. BIN
      public/image/model_hxlb.jpg
  45. BIN
      public/image/model_lsirtpc.jpg
  46. BIN
      public/image/model_ltriTit.jpg
  47. BIN
      public/image/model_oneTpsi.jpg
  48. BIN
      public/image/model_twoTpi.jpg
  49. BIN
      public/image/model_uidi.jpg
  50. BIN
      public/image/model_uitplsiritp.jpg
  51. BIN
      public/image/model_uitplsirtp.jpg
  52. BIN
      public/image/model_upTdi.jpg
  53. BIN
      public/image/model_utidtpci.jpg
  54. BIN
      public/image/model_utpdirpdltpri.jpg
  55. BIN
      public/image/model_utpi.jpg
  56. BIN
      public/image/model_zyc.jpg
  57. BIN
      public/image/subject-1.jpg
  58. BIN
      public/image/subject-2.jpg
  59. BIN
      public/image/subject-3.jpg
  60. BIN
      public/image/xls.png
  61. 40
    0
      public/libs/ueditor/dialogs/anchor/anchor.html
  62. 681
    0
      public/libs/ueditor/dialogs/attachment/attachment.css
  63. 60
    0
      public/libs/ueditor/dialogs/attachment/attachment.html
  64. 760
    0
      public/libs/ueditor/dialogs/attachment/attachment.js
  65. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif
  66. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_default.png
  67. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif
  68. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif
  69. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif
  70. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif
  71. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif
  72. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif
  73. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif
  74. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif
  75. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif
  76. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif
  77. BIN
      public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif
  78. BIN
      public/libs/ueditor/dialogs/attachment/images/alignicon.gif
  79. BIN
      public/libs/ueditor/dialogs/attachment/images/alignicon.png
  80. BIN
      public/libs/ueditor/dialogs/attachment/images/bg.png
  81. BIN
      public/libs/ueditor/dialogs/attachment/images/file-icons.gif
  82. BIN
      public/libs/ueditor/dialogs/attachment/images/file-icons.png
  83. BIN
      public/libs/ueditor/dialogs/attachment/images/icons.gif
  84. BIN
      public/libs/ueditor/dialogs/attachment/images/icons.png
  85. BIN
      public/libs/ueditor/dialogs/attachment/images/image.png
  86. BIN
      public/libs/ueditor/dialogs/attachment/images/progress.png
  87. BIN
      public/libs/ueditor/dialogs/attachment/images/success.gif
  88. BIN
      public/libs/ueditor/dialogs/attachment/images/success.png
  89. 94
    0
      public/libs/ueditor/dialogs/background/background.css
  90. 56
    0
      public/libs/ueditor/dialogs/background/background.html
  91. 376
    0
      public/libs/ueditor/dialogs/background/background.js
  92. BIN
      public/libs/ueditor/dialogs/background/images/bg.png
  93. BIN
      public/libs/ueditor/dialogs/background/images/success.png
  94. 65
    0
      public/libs/ueditor/dialogs/charts/chart.config.js
  95. 165
    0
      public/libs/ueditor/dialogs/charts/charts.css
  96. 89
    0
      public/libs/ueditor/dialogs/charts/charts.html
  97. 519
    0
      public/libs/ueditor/dialogs/charts/charts.js
  98. BIN
      public/libs/ueditor/dialogs/charts/images/charts0.png
  99. BIN
      public/libs/ueditor/dialogs/charts/images/charts1.png
  100. 0
    0
      public/libs/ueditor/dialogs/charts/images/charts2.png

+ 16
- 0
.editorconfig Voir le fichier

@@ -0,0 +1,16 @@
1
+# http://editorconfig.org
2
+root = true
3
+
4
+[*]
5
+indent_style = space
6
+indent_size = 2
7
+end_of_line = lf
8
+charset = utf-8
9
+trim_trailing_whitespace = true
10
+insert_final_newline = true
11
+
12
+[*.md]
13
+trim_trailing_whitespace = false
14
+
15
+[Makefile]
16
+indent_style = tab

+ 8
- 0
.eslintignore Voir le fichier

@@ -0,0 +1,8 @@
1
+/lambda/
2
+/scripts
3
+/config
4
+.history
5
+public
6
+dist
7
+.umi
8
+mock

+ 7
- 0
.eslintrc.js Voir le fichier

@@ -0,0 +1,7 @@
1
+module.exports = {
2
+  extends: [require.resolve('@umijs/lint/dist/config/eslint')],
3
+  globals: {
4
+    page: true,
5
+    REACT_APP_ENV: true,
6
+  },
7
+};

+ 44
- 0
.gitignore Voir le fichier

@@ -0,0 +1,44 @@
1
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+# dependencies
4
+**/node_modules
5
+# roadhog-api-doc ignore
6
+/src/utils/request-temp.js
7
+_roadhog-api-doc
8
+
9
+# production
10
+/dist
11
+
12
+# misc
13
+.DS_Store
14
+npm-debug.log*
15
+yarn-error.log
16
+
17
+/coverage
18
+.idea
19
+yarn.lock
20
+package-lock.json
21
+*bak
22
+.vscode
23
+
24
+
25
+# visual studio code
26
+.history
27
+*.log
28
+functions/*
29
+.temp/**
30
+
31
+# umi
32
+.umi
33
+.umi-production
34
+.umi-test
35
+
36
+# screenshot
37
+screenshot
38
+.firebase
39
+.eslintcache
40
+
41
+build
42
+
43
+pnpm-lock.yaml
44
+node_modules.zip

+ 22
- 0
.prettierignore Voir le fichier

@@ -0,0 +1,22 @@
1
+**/*.svg
2
+.umi
3
+.umi-production
4
+/dist
5
+.dockerignore
6
+.DS_Store
7
+.eslintignore
8
+*.png
9
+*.toml
10
+docker
11
+.editorconfig
12
+Dockerfile*
13
+.gitignore
14
+.prettierignore
15
+LICENSE
16
+.eslintcache
17
+*.lock
18
+yarn-error.log
19
+.history
20
+CNAME
21
+/build
22
+/public

+ 21
- 0
.prettierrc.js Voir le fichier

@@ -0,0 +1,21 @@
1
+module.exports = {
2
+  singleQuote: true,
3
+  trailingComma: 'all',
4
+  printWidth: 100,
5
+  proseWrap: 'never',
6
+  endOfLine: 'lf',
7
+  overrides: [
8
+    {
9
+      files: '.prettierrc',
10
+      options: {
11
+        parser: 'json',
12
+      },
13
+    },
14
+    {
15
+      files: 'document.ejs',
16
+      options: {
17
+        parser: 'html',
18
+      },
19
+    },
20
+  ],
21
+};

+ 46
- 0
CODE_OF_CONDUCT.md Voir le fichier

@@ -0,0 +1,46 @@
1
+# Contributor Covenant Code of Conduct
2
+
3
+## Our Pledge
4
+
5
+In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+## Our Standards
8
+
9
+Examples of behavior that contributes to creating a positive environment include:
10
+
11
+- Using welcoming and inclusive language
12
+- Being respectful of differing viewpoints and experiences
13
+- Gracefully accepting constructive criticism
14
+- Focusing on what is best for the community
15
+- Showing empathy towards other community members
16
+
17
+Examples of unacceptable behavior by participants include:
18
+
19
+- The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+- Trolling, insulting/derogatory comments, and personal or political attacks
21
+- Public or private harassment
22
+- Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+- Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+## Our Responsibilities
26
+
27
+Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+## Scope
32
+
33
+This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+## Enforcement
36
+
37
+Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at afc163@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+## Attribution
42
+
43
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
+
45
+[homepage]: http://contributor-covenant.org
46
+[version]: http://contributor-covenant.org/version/1/4/

+ 21
- 0
LICENSE Voir le fichier

@@ -0,0 +1,21 @@
1
+MIT License
2
+
3
+Copyright (c) 2019-present Alipay.inc
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 85
- 0
README.md Voir le fichier

@@ -0,0 +1,85 @@
1
+## zhongze-admin
2
+
3
+## 中泽官网后台项目
4
+
5
+### 目录结构
6
+
7
+```
8
+.
9
+├── README.md
10
+├── config // 配置文件
11
+│   ├── config //umi配置文件
12
+│   ├── myConfig //个人自定义项目配置文件
13
+│   ├── defaultSettings //antd全局样式设置
14
+│   ├── oneapi.json
15
+│   ├── proxy //dev环境下代理配置
16
+│   ├── routes //默认路由配置
17
+├── mock //mock数据
18
+├── public 
19
+├── build //最终发布目录
20
+├── src //开发目录
21
+│   ├── components //公共组件
22
+│   ├── enums //公共的全局前端枚举;
23
+│   ├── hooks //公共的自定义hook;
24
+│   ├── locales //多语言-本地化;
25
+│   ├── models //dva-全局状态管理;
26
+│   ├── pages //页面目录
27
+│   │   ├─System // 系统管理
28
+│   │   └─Monitor // 系统监控
29
+│   ├── services
30
+│   │   └─session // 路由配置
31
+│   ├── types
32
+│   ├── utils //工具类
33
+│   └── app //入口页面
34
+├── tests
35
+└── types
36
+```
37
+
38
+### 启动项目
39
+
40
+```
41
+yarn
42
+
43
+npm install
44
+npm start
45
+```
46
+
47
+### 打包项目
48
+
49
+```
50
+npm run build
51
+```
52
+
53
+### 框架引用
54
+
55
+[whiteshader / ruoyi-react](https://gitee.com/whiteshader/ruoyi-react)
56
+
57
+### 注意事项
58
+
59
+Node:18以上
60
+
61
+### 相关技术文档
62
+
63
+#### TypeScript
64
+
65
+[https://www.tslang.cn/docs/home.html](https://www.tslang.cn/docs/home.html)
66
+
67
+#### React Js
68
+
69
+[https://react.docschina.org/docs/getting-started.html](https://react.docschina.org/docs/getting-started.html)
70
+
71
+#### Ant Design
72
+
73
+[https://ant.design/components/overview-cn/](https://ant.design/components/overview-cn/)
74
+
75
+#### Ant Design Pro
76
+
77
+[https://pro.ant.design/zh-CN/docs/overview](https://pro.ant.design/zh-CN/docs/overview)
78
+
79
+#### Ant Design Chart
80
+
81
+[https://charts.ant.design/zh](https://charts.ant.design/zh)
82
+
83
+#### Umi Js
84
+
85
+[https://umijs.org/docs/introduce/introduce](https://umijs.org/docs/introduce/introduce)

+ 0
- 0
cc Voir le fichier


+ 187
- 0
config/config.ts Voir le fichier

@@ -0,0 +1,187 @@
1
+// https://umijs.org/config/
2
+import { defineConfig } from '@umijs/max';
3
+import { join } from 'path';
4
+import defaultSettings from './defaultSettings';
5
+import proxy from './proxy';
6
+import routes from './routes';
7
+const { REACT_APP_ENV = 'dev' } = process.env;
8
+
9
+export default defineConfig({
10
+  /**
11
+   * @name 开启 hash 模式
12
+   * @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。
13
+   * @doc https://umijs.org/docs/api/config#hash
14
+   */
15
+  hash: true,
16
+
17
+  /**
18
+   * @name 兼容性设置
19
+   * @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖
20
+   * @doc https://umijs.org/docs/api/config#targets
21
+   */
22
+  // targets: {
23
+  //   ie: 11,
24
+  // },
25
+  /**
26
+   * @name 路由的配置,不在路由中引入的文件不会编译
27
+   * @description 只支持 path,component,routes,redirect,wrappers,title 的配置
28
+   * @doc https://umijs.org/docs/guides/routes
29
+   */
30
+  // umi routes: https://umijs.org/docs/routing
31
+  routes,
32
+  /**
33
+   * @name 主题的配置
34
+   * @description 虽然叫主题,但是其实只是 less 的变量设置
35
+   * @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn
36
+   * @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme
37
+   */
38
+  theme: {
39
+    // 如果不想要 configProvide 动态设置主题需要把这个设置为 default
40
+    // 只有设置为 variable, 才能使用 configProvide 动态设置主色调
41
+    'root-entry-name': 'variable',
42
+  },
43
+
44
+  /**
45
+   * @name dva
46
+   * @description [用于全局状态管理,umi自带的](https://umijs.org/docs/max/dva)
47
+   * @doc [umi自带的配置说明](https://umijs.org/docs/max/dva)
48
+   * @doc [dva官方文档指南](https://dvajs.com/guide/)
49
+   * @doc [dva官方文档API](https://dvajs.com/api/)
50
+   */
51
+  dva: {},
52
+
53
+  /**
54
+   * @name moment 的国际化配置
55
+   * @description 如果对国际化没有要求,打开之后能减少js的包大小
56
+   * @doc https://umijs.org/docs/api/config#ignoremomentlocale
57
+   */
58
+  ignoreMomentLocale: true,
59
+  /**
60
+   * @name 代理配置
61
+   * @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了
62
+   * @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。
63
+   * @doc 代理介绍 https://umijs.org/docs/guides/proxy
64
+   * @doc 代理配置 https://umijs.org/docs/api/config#proxy
65
+  */
66
+  proxy: proxy[REACT_APP_ENV as keyof typeof proxy],
67
+    /**
68
+   * @name 快速热更新配置
69
+   * @description 一个不错的热更新组件,更新时可以保留 state
70
+   */
71
+  fastRefresh: true,
72
+  //============== 以下都是max的插件配置 ===============
73
+  /**
74
+   * @name 数据流插件
75
+   * @@doc https://umijs.org/docs/max/data-flow
76
+   */
77
+  model: {},
78
+  /**
79
+   * 一个全局的初始数据流,可以用它在插件之间共享数据
80
+   * @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。
81
+   * @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81
82
+   */
83
+  initialState: {},
84
+  /**
85
+   * @name layout 插件
86
+   * @doc https://umijs.org/docs/max/layout-menu
87
+   */
88
+  title: '中泽集团官网后台',
89
+  layout: {
90
+    locale: true,
91
+    ...defaultSettings,
92
+  },
93
+  /**
94
+   * @name umi-plugin-keep-alive插件
95
+   * @description 实现react keep alive功能
96
+   * @doc https://github.com/alitajs/umi-plugin-keep-alive
97
+   */
98
+  plugins: ['umi-plugin-keep-alive'],
99
+  // keepalive: [/./],
100
+  // tabsLayout: {},
101
+  /**
102
+   * @name moment2dayjs 插件
103
+   * @description 将项目中的 moment 替换为 dayjs
104
+   * @doc https://umijs.org/docs/max/moment2dayjs
105
+   */
106
+  moment2dayjs: {
107
+    preset: 'antd',
108
+    plugins: ['duration'],
109
+  },
110
+  /**
111
+   * @name 国际化插件
112
+   * @doc https://umijs.org/docs/max/i18n
113
+   */
114
+  locale: {
115
+    // default zh-CN
116
+    enable: true,
117
+    default: 'zh-CN',
118
+    antd: true,
119
+    // default true, when it is true, will use `navigator.language` overwrite default
120
+    baseNavigator: false,
121
+    useLocalStorage: true,
122
+  },
123
+  externals: {
124
+    '@alilc/lowcode-engine': 'var window.AliLowCodeEngine',
125
+    '@alilc/lowcode-engine-ext': 'var window.AliLowCodeEngineExt',
126
+    '@ali/lowcode-engine': 'var window.AliLowCodeEngine',
127
+  },
128
+  /**
129
+   * @name antd 插件
130
+   * @description 内置了 babel import 插件
131
+   * @doc https://umijs.org/docs/max/antd#antd
132
+   */
133
+  antd: {},
134
+  /**
135
+   * @name 网络请求配置
136
+   * @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。
137
+   * @doc https://umijs.org/docs/max/request
138
+   */
139
+  request: {},
140
+  /**
141
+   * @name 权限插件
142
+   * @description 基于 initialState 的权限插件,必须先打开 initialState
143
+   * @doc https://umijs.org/docs/max/access
144
+   */
145
+  access: {},
146
+  /**
147
+   * @name <head> 中额外的 script
148
+   * @description 配置 <head> 中额外的 script
149
+   */
150
+
151
+  // externals: {
152
+  //   'react': 'React',
153
+  //   'react-dom': 'ReactDOM',
154
+  // },
155
+  headScripts: [
156
+    // 解决首次加载时白屏的问题
157
+    { src: '/scripts/loading.js', async: true },
158
+    { src: '/scripts/react.production.min.js' },
159
+    { src: '/scripts/react-dom.production.min.js' },
160
+  ],
161
+  //================ pro 插件配置 =================
162
+  presets: ['umi-presets-pro'],
163
+  /**
164
+   * @name openAPI 插件的配置
165
+   * @description 基于 openapi 的规范生成serve 和mock,能减少很多样板代码
166
+   * @doc https://pro.ant.design/zh-cn/docs/openapi/
167
+   */
168
+  openAPI: [
169
+    {
170
+      requestLibPath: "import { request } from '@umijs/max'",
171
+      // 或者使用在线的版本
172
+      // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
173
+      schemaPath: join(__dirname, 'oneapi.json'),
174
+      mock: false,
175
+    },
176
+    {
177
+      requestLibPath: "import { request } from '@umijs/max'",
178
+      schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
179
+      projectName: 'swagger',
180
+    },
181
+  ],
182
+  mfsu: {
183
+    strategy: 'normal',
184
+  },
185
+  requestRecord: {},
186
+  esbuildMinifyIIFE: true,
187
+});

+ 40
- 0
config/defaultSettings.ts Voir le fichier

@@ -0,0 +1,40 @@
1
+import { ProLayoutProps } from '@ant-design/pro-components';
2
+/**
3
+ * @name
4
+ */
5
+const Settings: ProLayoutProps & {
6
+  pwa?: boolean;
7
+  logo?: string;
8
+} = {
9
+  // navTheme: 'light',
10
+  // // 拂晓蓝
11
+  // colorPrimary: '#1890ff',
12
+  // layout: 'mix',
13
+  // contentWidth: 'Fluid',
14
+  // fixedHeader: false,
15
+  // fixSiderbar: false,
16
+  // splitMenus: true,
17
+  // colorWeak: false,
18
+  // title: 'Ant Design Pro',
19
+  // pwa: true,
20
+  // logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
21
+  // iconfontUrl: '',
22
+  // token: {
23
+  //   // 参见ts声明,demo 见文档,通过token 修改样式
24
+  //   //https://procomponents.ant.design/components/layout#%E9%80%9A%E8%BF%87-token-%E4%BF%AE%E6%94%B9%E6%A0%B7%E5%BC%8F
25
+  // },
26
+
27
+  title: '中泽集团官网后台管理平台',
28
+  navTheme: 'light',
29
+  colorPrimary: '#00D3A1',
30
+  layout: 'side',
31
+  contentWidth: 'Fluid',
32
+  fixedHeader: false,
33
+  fixSiderbar: true,
34
+  splitMenus: false,
35
+  pwa: true,
36
+  logo: '/login/logo.png',
37
+  token: {},
38
+  siderMenuType: 'sub',
39
+};
40
+export default Settings;

+ 0
- 0
config/json.txt Voir le fichier


+ 9
- 0
config/myConfig.js Voir le fichier

@@ -0,0 +1,9 @@
1
+const MyConfig = {
2
+  /**
3
+   * 是否使用tab页标签
4
+   * @description 如果使用tab页标签,可以对页面进行缓存。如果不用,则不缓存页面
5
+   */
6
+  useTabs: true
7
+}
8
+
9
+export default MyConfig;

+ 593
- 0
config/oneapi.json Voir le fichier

@@ -0,0 +1,593 @@
1
+{
2
+  "openapi": "3.0.1",
3
+  "info": {
4
+    "title": "Ant Design Pro",
5
+    "version": "1.0.0"
6
+  },
7
+  "servers": [
8
+    {
9
+      "url": "http://localhost:8000/"
10
+    },
11
+    {
12
+      "url": "https://localhost:8000/"
13
+    }
14
+  ],
15
+  "paths": {
16
+    "/api/currentUser": {
17
+      "get": {
18
+        "tags": ["api"],
19
+        "description": "获取当前的用户",
20
+        "operationId": "currentUser",
21
+        "responses": {
22
+          "200": {
23
+            "description": "Success",
24
+            "content": {
25
+              "application/json": {
26
+                "schema": {
27
+                  "$ref": "#/components/schemas/CurrentUser"
28
+                }
29
+              }
30
+            }
31
+          },
32
+          "401": {
33
+            "description": "Error",
34
+            "content": {
35
+              "application/json": {
36
+                "schema": {
37
+                  "$ref": "#/components/schemas/ErrorResponse"
38
+                }
39
+              }
40
+            }
41
+          }
42
+        }
43
+      },
44
+      "x-swagger-router-controller": "api"
45
+    },
46
+    "/api/login/captcha": {
47
+      "post": {
48
+        "description": "发送验证码",
49
+        "operationId": "getFakeCaptcha",
50
+        "tags": ["login"],
51
+        "parameters": [
52
+          {
53
+            "name": "phone",
54
+            "in": "query",
55
+            "description": "手机号",
56
+            "schema": {
57
+              "type": "string"
58
+            }
59
+          }
60
+        ],
61
+        "responses": {
62
+          "200": {
63
+            "description": "Success",
64
+            "content": {
65
+              "application/json": {
66
+                "schema": {
67
+                  "$ref": "#/components/schemas/FakeCaptcha"
68
+                }
69
+              }
70
+            }
71
+          }
72
+        }
73
+      }
74
+    },
75
+    "/api/login/outLogin": {
76
+      "post": {
77
+        "description": "登录接口",
78
+        "operationId": "outLogin",
79
+        "tags": ["login"],
80
+        "responses": {
81
+          "200": {
82
+            "description": "Success",
83
+            "content": {
84
+              "application/json": {
85
+                "schema": {
86
+                  "type": "object"
87
+                }
88
+              }
89
+            }
90
+          },
91
+          "401": {
92
+            "description": "Error",
93
+            "content": {
94
+              "application/json": {
95
+                "schema": {
96
+                  "$ref": "#/components/schemas/ErrorResponse"
97
+                }
98
+              }
99
+            }
100
+          }
101
+        }
102
+      },
103
+      "x-swagger-router-controller": "api"
104
+    },
105
+    "/api/login/account": {
106
+      "post": {
107
+        "tags": ["login"],
108
+        "description": "登录接口",
109
+        "operationId": "login",
110
+        "requestBody": {
111
+          "description": "登录系统",
112
+          "content": {
113
+            "application/json": {
114
+              "schema": {
115
+                "$ref": "#/components/schemas/LoginParams"
116
+              }
117
+            }
118
+          },
119
+          "required": true
120
+        },
121
+        "responses": {
122
+          "200": {
123
+            "description": "Success",
124
+            "content": {
125
+              "application/json": {
126
+                "schema": {
127
+                  "$ref": "#/components/schemas/LoginResult"
128
+                }
129
+              }
130
+            }
131
+          },
132
+          "401": {
133
+            "description": "Error",
134
+            "content": {
135
+              "application/json": {
136
+                "schema": {
137
+                  "$ref": "#/components/schemas/ErrorResponse"
138
+                }
139
+              }
140
+            }
141
+          }
142
+        },
143
+        "x-codegen-request-body-name": "body"
144
+      },
145
+      "x-swagger-router-controller": "api"
146
+    },
147
+    "/api/notices": {
148
+      "summary": "getNotices",
149
+      "description": "NoticeIconItem",
150
+      "get": {
151
+        "tags": ["api"],
152
+        "operationId": "getNotices",
153
+        "responses": {
154
+          "200": {
155
+            "description": "Success",
156
+            "content": {
157
+              "application/json": {
158
+                "schema": {
159
+                  "$ref": "#/components/schemas/NoticeIconList"
160
+                }
161
+              }
162
+            }
163
+          }
164
+        }
165
+      }
166
+    },
167
+    "/api/rule": {
168
+      "get": {
169
+        "tags": ["rule"],
170
+        "description": "获取规则列表",
171
+        "operationId": "rule",
172
+        "parameters": [
173
+          {
174
+            "name": "current",
175
+            "in": "query",
176
+            "description": "当前的页码",
177
+            "schema": {
178
+              "type": "number"
179
+            }
180
+          },
181
+          {
182
+            "name": "pageSize",
183
+            "in": "query",
184
+            "description": "页面的容量",
185
+            "schema": {
186
+              "type": "number"
187
+            }
188
+          }
189
+        ],
190
+        "responses": {
191
+          "200": {
192
+            "description": "Success",
193
+            "content": {
194
+              "application/json": {
195
+                "schema": {
196
+                  "$ref": "#/components/schemas/RuleList"
197
+                }
198
+              }
199
+            }
200
+          },
201
+          "401": {
202
+            "description": "Error",
203
+            "content": {
204
+              "application/json": {
205
+                "schema": {
206
+                  "$ref": "#/components/schemas/ErrorResponse"
207
+                }
208
+              }
209
+            }
210
+          }
211
+        }
212
+      },
213
+      "post": {
214
+        "tags": ["rule"],
215
+        "description": "新建规则",
216
+        "operationId": "addRule",
217
+        "responses": {
218
+          "200": {
219
+            "description": "Success",
220
+            "content": {
221
+              "application/json": {
222
+                "schema": {
223
+                  "$ref": "#/components/schemas/RuleListItem"
224
+                }
225
+              }
226
+            }
227
+          },
228
+          "401": {
229
+            "description": "Error",
230
+            "content": {
231
+              "application/json": {
232
+                "schema": {
233
+                  "$ref": "#/components/schemas/ErrorResponse"
234
+                }
235
+              }
236
+            }
237
+          }
238
+        }
239
+      },
240
+      "put": {
241
+        "tags": ["rule"],
242
+        "description": "新建规则",
243
+        "operationId": "updateRule",
244
+        "responses": {
245
+          "200": {
246
+            "description": "Success",
247
+            "content": {
248
+              "application/json": {
249
+                "schema": {
250
+                  "$ref": "#/components/schemas/RuleListItem"
251
+                }
252
+              }
253
+            }
254
+          },
255
+          "401": {
256
+            "description": "Error",
257
+            "content": {
258
+              "application/json": {
259
+                "schema": {
260
+                  "$ref": "#/components/schemas/ErrorResponse"
261
+                }
262
+              }
263
+            }
264
+          }
265
+        }
266
+      },
267
+      "delete": {
268
+        "tags": ["rule"],
269
+        "description": "删除规则",
270
+        "operationId": "removeRule",
271
+        "responses": {
272
+          "200": {
273
+            "description": "Success",
274
+            "content": {
275
+              "application/json": {
276
+                "schema": {
277
+                  "type": "object"
278
+                }
279
+              }
280
+            }
281
+          },
282
+          "401": {
283
+            "description": "Error",
284
+            "content": {
285
+              "application/json": {
286
+                "schema": {
287
+                  "$ref": "#/components/schemas/ErrorResponse"
288
+                }
289
+              }
290
+            }
291
+          }
292
+        }
293
+      },
294
+      "x-swagger-router-controller": "api"
295
+    },
296
+    "/swagger": {
297
+      "x-swagger-pipe": "swagger_raw"
298
+    }
299
+  },
300
+  "components": {
301
+    "schemas": {
302
+      "CurrentUser": {
303
+        "type": "object",
304
+        "properties": {
305
+          "name": {
306
+            "type": "string"
307
+          },
308
+          "avatar": {
309
+            "type": "string"
310
+          },
311
+          "userid": {
312
+            "type": "string"
313
+          },
314
+          "email": {
315
+            "type": "string"
316
+          },
317
+          "signature": {
318
+            "type": "string"
319
+          },
320
+          "title": {
321
+            "type": "string"
322
+          },
323
+          "group": {
324
+            "type": "string"
325
+          },
326
+          "tags": {
327
+            "type": "array",
328
+            "items": {
329
+              "type": "object",
330
+              "properties": {
331
+                "key": {
332
+                  "type": "string"
333
+                },
334
+                "label": {
335
+                  "type": "string"
336
+                }
337
+              }
338
+            }
339
+          },
340
+          "notifyCount": {
341
+            "type": "integer",
342
+            "format": "int32"
343
+          },
344
+          "unreadCount": {
345
+            "type": "integer",
346
+            "format": "int32"
347
+          },
348
+          "country": {
349
+            "type": "string"
350
+          },
351
+          "access": {
352
+            "type": "string"
353
+          },
354
+          "geographic": {
355
+            "type": "object",
356
+            "properties": {
357
+              "province": {
358
+                "type": "object",
359
+                "properties": {
360
+                  "label": {
361
+                    "type": "string"
362
+                  },
363
+                  "key": {
364
+                    "type": "string"
365
+                  }
366
+                }
367
+              },
368
+              "city": {
369
+                "type": "object",
370
+                "properties": {
371
+                  "label": {
372
+                    "type": "string"
373
+                  },
374
+                  "key": {
375
+                    "type": "string"
376
+                  }
377
+                }
378
+              }
379
+            }
380
+          },
381
+          "address": {
382
+            "type": "string"
383
+          },
384
+          "phone": {
385
+            "type": "string"
386
+          }
387
+        }
388
+      },
389
+      "LoginResult": {
390
+        "type": "object",
391
+        "properties": {
392
+          "status": {
393
+            "type": "string"
394
+          },
395
+          "type": {
396
+            "type": "string"
397
+          },
398
+          "currentAuthority": {
399
+            "type": "string"
400
+          }
401
+        }
402
+      },
403
+      "PageParams": {
404
+        "type": "object",
405
+        "properties": {
406
+          "current": {
407
+            "type": "number"
408
+          },
409
+          "pageSize": {
410
+            "type": "number"
411
+          }
412
+        }
413
+      },
414
+      "RuleListItem": {
415
+        "type": "object",
416
+        "properties": {
417
+          "key": {
418
+            "type": "integer",
419
+            "format": "int32"
420
+          },
421
+          "disabled": {
422
+            "type": "boolean"
423
+          },
424
+          "href": {
425
+            "type": "string"
426
+          },
427
+          "avatar": {
428
+            "type": "string"
429
+          },
430
+          "name": {
431
+            "type": "string"
432
+          },
433
+          "owner": {
434
+            "type": "string"
435
+          },
436
+          "desc": {
437
+            "type": "string"
438
+          },
439
+          "callNo": {
440
+            "type": "integer",
441
+            "format": "int32"
442
+          },
443
+          "status": {
444
+            "type": "integer",
445
+            "format": "int32"
446
+          },
447
+          "updatedAt": {
448
+            "type": "string",
449
+            "format": "datetime"
450
+          },
451
+          "createdAt": {
452
+            "type": "string",
453
+            "format": "datetime"
454
+          },
455
+          "progress": {
456
+            "type": "integer",
457
+            "format": "int32"
458
+          }
459
+        }
460
+      },
461
+      "RuleList": {
462
+        "type": "object",
463
+        "properties": {
464
+          "data": {
465
+            "type": "array",
466
+            "items": {
467
+              "$ref": "#/components/schemas/RuleListItem"
468
+            }
469
+          },
470
+          "total": {
471
+            "type": "integer",
472
+            "description": "列表的内容总数",
473
+            "format": "int32"
474
+          },
475
+          "success": {
476
+            "type": "boolean"
477
+          }
478
+        }
479
+      },
480
+      "FakeCaptcha": {
481
+        "type": "object",
482
+        "properties": {
483
+          "code": {
484
+            "type": "integer",
485
+            "format": "int32"
486
+          },
487
+          "status": {
488
+            "type": "string"
489
+          }
490
+        }
491
+      },
492
+      "LoginParams": {
493
+        "type": "object",
494
+        "properties": {
495
+          "username": {
496
+            "type": "string"
497
+          },
498
+          "password": {
499
+            "type": "string"
500
+          },
501
+          "autoLogin": {
502
+            "type": "boolean"
503
+          },
504
+          "type": {
505
+            "type": "string"
506
+          }
507
+        }
508
+      },
509
+      "ErrorResponse": {
510
+        "required": ["errorCode"],
511
+        "type": "object",
512
+        "properties": {
513
+          "errorCode": {
514
+            "type": "string",
515
+            "description": "业务约定的错误码"
516
+          },
517
+          "errorMessage": {
518
+            "type": "string",
519
+            "description": "业务上的错误信息"
520
+          },
521
+          "success": {
522
+            "type": "boolean",
523
+            "description": "业务上的请求是否成功"
524
+          }
525
+        }
526
+      },
527
+      "NoticeIconList": {
528
+        "type": "object",
529
+        "properties": {
530
+          "data": {
531
+            "type": "array",
532
+            "items": {
533
+              "$ref": "#/components/schemas/NoticeIconItem"
534
+            }
535
+          },
536
+          "total": {
537
+            "type": "integer",
538
+            "description": "列表的内容总数",
539
+            "format": "int32"
540
+          },
541
+          "success": {
542
+            "type": "boolean"
543
+          }
544
+        }
545
+      },
546
+      "NoticeIconItemType": {
547
+        "title": "NoticeIconItemType",
548
+        "description": "已读未读列表的枚举",
549
+        "type": "string",
550
+        "properties": {},
551
+        "enum": ["notification", "message", "event"]
552
+      },
553
+      "NoticeIconItem": {
554
+        "type": "object",
555
+        "properties": {
556
+          "id": {
557
+            "type": "string"
558
+          },
559
+          "extra": {
560
+            "type": "string",
561
+            "format": "any"
562
+          },
563
+          "key": { "type": "string" },
564
+          "read": {
565
+            "type": "boolean"
566
+          },
567
+          "avatar": {
568
+            "type": "string"
569
+          },
570
+          "title": {
571
+            "type": "string"
572
+          },
573
+          "status": {
574
+            "type": "string"
575
+          },
576
+          "datetime": {
577
+            "type": "string",
578
+            "format": "date"
579
+          },
580
+          "description": {
581
+            "type": "string"
582
+          },
583
+          "type": {
584
+            "extensions": {
585
+              "x-is-enum": true
586
+            },
587
+            "$ref": "#/components/schemas/NoticeIconItemType"
588
+          }
589
+        }
590
+      }
591
+    }
592
+  }
593
+}

+ 64
- 0
config/proxy.ts Voir le fichier

@@ -0,0 +1,64 @@
1
+/**
2
+ * @name 代理的配置
3
+ * @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
4
+ * -------------------------------
5
+ * The agent cannot take effect in the production environment
6
+ * so there is no configuration of the production environment
7
+ * For details, please see
8
+ * https://pro.ant.design/docs/deploy
9
+ *
10
+ * @doc https://umijs.org/docs/guides/proxy
11
+ */
12
+export default {
13
+  // 如果需要自定义本地开发服务器  请取消注释按需调整
14
+  dev: {
15
+    // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
16
+    '/api/': {
17
+      // 要代理的地址
18
+      secure: false,
19
+
20
+      // changeOrigin: true,// 依赖 origin 的功能可能需要这个,比如 cookie;
21
+
22
+      target: 'http://192.168.1.33:9100',//李琦;
23
+      //target: 'http://192.168.1.69:9400',//69测试环境;
24
+      //target: 'http://www.wbvis.com/cpgw-back',//正式环境;
25
+      pathRewrite: { '^/api': '' },
26
+      // target: 'https://192.168.1.84',//李琦不在用以下这两行;
27
+      // pathRewrite: { '^/api': '/api/' },
28
+    },
29
+    '/profile/avatar/': {
30
+      target: 'http://localhost:8080',
31
+      changeOrigin: true,
32
+    },
33
+    '/otherProxy': {
34
+      target: 'http://192.168.1.113:9601', //柳森本地数据;
35
+      changeOrigin: true,
36
+      pathRewrite: { '^/otherProxy': '' },
37
+    },
38
+    '/myPage': {
39
+      target: 'http://localhost:3000', //柳森本地数据;
40
+      changeOrigin: true,
41
+      pathRewrite: { '^/myPage': '' },
42
+    },
43
+
44
+  },
45
+  /**0
46
+   * @name 详细的代理配置
47
+   * @doc https://github.com/chimurai/http-proxy-middleware
48
+   */
49
+  test: {
50
+    // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
51
+    '/api/': {
52
+      target: 'https://proapi.azurewebsites.net',
53
+      changeOrigin: true,
54
+      pathRewrite: { '^': '' },
55
+    },
56
+  },
57
+  pre: {
58
+    '/api/': {
59
+      target: 'your pre url',
60
+      changeOrigin: true,
61
+      pathRewrite: { '^': '' },
62
+    },
63
+  },
64
+};

+ 0
- 0
config/react.min.js Voir le fichier


+ 226
- 0
config/routes.ts Voir le fichier

@@ -0,0 +1,226 @@
1
+/**
2
+ * @name umi 的路由配置
3
+ * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置
4
+ * @param path  path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。
5
+ * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。
6
+ * @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。
7
+ * @param redirect 配置路由跳转
8
+ * @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验
9
+ * @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题
10
+ * @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 <StepBackwardOutlined /> 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 <UserOutlined /> 则取值应为 user 或者 User
11
+ * @doc https://umijs.org/docs/guides/routes
12
+ */
13
+export default [
14
+  {
15
+    path: '/',
16
+    redirect: '/user/login',
17
+  },
18
+  {
19
+    path: '/account',
20
+    routes: [
21
+      {
22
+        name: 'acenter',
23
+        path: '/account/center',
24
+        component: './User/Center',
25
+      },
26
+      {
27
+        name: 'asettings',
28
+        path: '/account/settings',
29
+        component: './User/Settings',
30
+      },
31
+    ],
32
+  },
33
+  {
34
+    name: 'system',
35
+    path: '/system',
36
+    routes: [
37
+      {
38
+        name: '字典数据',
39
+        path: '/system/dict-data/index/:id',
40
+        component: './System/DictData',
41
+      },
42
+      {
43
+        name: '分配用户',
44
+        path: '/system/role-auth/user/:id',
45
+        component: './System/Role/authUser',
46
+      },
47
+    ],
48
+  },
49
+  {
50
+    path: '*',
51
+    layout: false,
52
+    component: './404',
53
+  },
54
+  {
55
+    path: '/user',
56
+    layout: false,
57
+    routes: [
58
+      {
59
+        name: 'login',
60
+        path: '/user/login',
61
+        component: './User/Login',
62
+      },
63
+    ],
64
+  },
65
+  {
66
+    name: 'Home',
67
+    path: '/Home',
68
+    icon: 'smile',
69
+    routes: [
70
+      {
71
+        name: 'banner',
72
+        path: '/Home/banner',
73
+        component: './Home/banner',
74
+      },
75
+    ],
76
+  },
77
+  {
78
+    name: 'GoinZZ',
79
+    path: '/GoinZZ',
80
+    icon: 'smile',
81
+    routes: [
82
+      {
83
+        name: 'structure',
84
+        path: '/GoinZZ/structure',
85
+        component: './GoinZZ/structure',
86
+      },
87
+      {
88
+        name: 'developHistory',
89
+        path: '/GoinZZ/developHistory',
90
+        component: './GoinZZ/developHistory',
91
+      },
92
+      {
93
+        name: 'honor',
94
+        path: '/GoinZZ/honor',
95
+        component: './GoinZZ/honor',
96
+      },
97
+    ],
98
+  },
99
+  {
100
+    name: 'Product',
101
+    path: '/Product',
102
+    icon: 'smile',
103
+    routes: [
104
+      {
105
+        name: 'ProductManage',
106
+        path: '/Product/ProductManage',
107
+        component: './Product/ProductManage',
108
+      },
109
+    ],
110
+  },
111
+  {
112
+    name: 'News',
113
+    path: '/News',
114
+    icon: 'smile',
115
+    routes: [
116
+      {
117
+        name: 'NewsList',
118
+        path: '/News/NewsList',
119
+        component: './News/NewsList',
120
+      },
121
+    ],
122
+  },
123
+  {
124
+    name: 'PartyWork',
125
+    path: '/PartyWork',
126
+    icon: 'smile',
127
+    routes: [
128
+      {
129
+        name: 'partyWork',
130
+        path: '/PartyWork/partyWork',
131
+        component: './PartyWork/partyWork',
132
+      },
133
+    ],
134
+  },
135
+  {
136
+    name: 'SocialRespon',
137
+    path: '/SocialRespon',
138
+    icon: 'smile',
139
+    routes: [
140
+      {
141
+        name: 'socialRespon',
142
+        path: '/SocialRespon/socialRespon',
143
+        component: './SocialRespon/socialRespon',
144
+      },
145
+    ],
146
+  },
147
+  {
148
+    name: 'JoinZZ',
149
+    path: '/JoinZZ',
150
+    icon: 'smile',
151
+    routes: [
152
+      {
153
+        name: 'vacancy',
154
+        path: '/JoinZZ/vacancy',
155
+        component: './JoinZZ/vacancy',
156
+      },
157
+      {
158
+        name: 'biddingDocument',
159
+        path: '/JoinZZ/biddingDocument',
160
+        component: './JoinZZ/biddingDocument',
161
+      },
162
+    ],
163
+  },
164
+  {
165
+    name: 'Other',
166
+    path: '/Other',
167
+    icon: 'smile',
168
+    routes: [
169
+      {
170
+        name: 'seo',
171
+        path: '/Other/seo',
172
+        component: './Other/seo',
173
+      },
174
+      {
175
+        name: 'footer',
176
+        path: '/Other/footer',
177
+        component: './Other/footer',
178
+      },
179
+    ],
180
+  },
181
+  {
182
+    name: 'ContactUs',
183
+    path: '/ContactUs',
184
+    icon: 'smile',
185
+    routes: [
186
+      {
187
+        name: 'LeadInfo',
188
+        path: '/ContactUs/LeadInfo',
189
+        component: './ContactUs/LeadInfo',
190
+      },
191
+      {
192
+        name: 'Appoint',
193
+        path: '/ContactUs/Appoint',
194
+        component: './ContactUs/Appoint',
195
+      },
196
+    ],
197
+  },
198
+  {
199
+    name: 'MapDot',
200
+    path: '/MapDot',
201
+    icon: 'smile',
202
+    routes: [
203
+      {
204
+        name: 'MapDot',
205
+        path: '/MapDot/MapDot',
206
+        component: './MapDot/MapDot',
207
+      },
208
+    ],
209
+  },
210
+  {
211
+    name: 'monitor',
212
+    path: '/monitor',
213
+    routes: [
214
+      {
215
+        name: '任务日志',
216
+        path: '/monitor/job-log/index/:id',
217
+        component: './Monitor/JobLog',
218
+      },
219
+    ],
220
+  },
221
+  {
222
+    name: 'log',
223
+    path: '/log',
224
+    routes: [],
225
+  },
226
+];

+ 23
- 0
jest.config.ts Voir le fichier

@@ -0,0 +1,23 @@
1
+import { configUmiAlias, createConfig } from '@umijs/max/test';
2
+
3
+export default async () => {
4
+  const config = await configUmiAlias({
5
+    ...createConfig({
6
+      target: 'browser',
7
+    }),
8
+  });
9
+
10
+  console.log();
11
+  return {
12
+    ...config,
13
+    testEnvironmentOptions: {
14
+      ...(config?.testEnvironmentOptions || {}),
15
+      url: 'http://localhost:8000',
16
+    },
17
+    setupFiles: [...(config.setupFiles || []), './tests/setupTests.jsx'],
18
+    globals: {
19
+      ...config.globals,
20
+      localStorage: null,
21
+    },
22
+  };
23
+};

+ 11
- 0
jsconfig.json Voir le fichier

@@ -0,0 +1,11 @@
1
+{
2
+  "compilerOptions": {
3
+    "jsx": "react-jsx",
4
+    "emitDecoratorMetadata": true,
5
+    "experimentalDecorators": true,
6
+    "baseUrl": "/product_back_stage/",
7
+    "paths": {
8
+      "@/*": ["./src/*"]
9
+    }
10
+  }
11
+}

+ 176
- 0
mock/listTableList.ts Voir le fichier

@@ -0,0 +1,176 @@
1
+import { Request, Response } from 'express';
2
+import moment from 'moment';
3
+import { parse } from 'url';
4
+
5
+// mock tableListDataSource
6
+const genList = (current: number, pageSize: number) => {
7
+  const tableListDataSource: API.RuleListItem[] = [];
8
+
9
+  for (let i = 0; i < pageSize; i += 1) {
10
+    const index = (current - 1) * 10 + i;
11
+    tableListDataSource.push({
12
+      key: index,
13
+      disabled: i % 6 === 0,
14
+      href: 'https://ant.design',
15
+      avatar: [
16
+        'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
17
+        'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
18
+      ][i % 2],
19
+      name: `TradeCode ${index}`,
20
+      owner: '曲丽丽',
21
+      desc: '这是一段描述',
22
+      callNo: Math.floor(Math.random() * 1000),
23
+      status: Math.floor(Math.random() * 10) % 4,
24
+      updatedAt: moment().format('YYYY-MM-DD'),
25
+      createdAt: moment().format('YYYY-MM-DD'),
26
+      progress: Math.ceil(Math.random() * 100),
27
+    });
28
+  }
29
+  tableListDataSource.reverse();
30
+  return tableListDataSource;
31
+};
32
+
33
+let tableListDataSource = genList(1, 100);
34
+
35
+function getRule(req: Request, res: Response, u: string) {
36
+  let realUrl = u;
37
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
38
+    realUrl = req.url;
39
+  }
40
+  const { current = 1, pageSize = 10 } = req.query;
41
+  const params = parse(realUrl, true).query as unknown as API.PageParams &
42
+    API.RuleListItem & {
43
+      sorter: any;
44
+      filter: any;
45
+    };
46
+
47
+  let dataSource = [...tableListDataSource].slice(
48
+    ((current as number) - 1) * (pageSize as number),
49
+    (current as number) * (pageSize as number),
50
+  );
51
+  if (params.sorter) {
52
+    const sorter = JSON.parse(params.sorter);
53
+    dataSource = dataSource.sort((prev, next) => {
54
+      let sortNumber = 0;
55
+      (Object.keys(sorter) as Array<keyof API.RuleListItem>).forEach((key) => {
56
+        let nextSort = next?.[key] as number;
57
+        let preSort = prev?.[key] as number;
58
+        if (sorter[key] === 'descend') {
59
+          if (preSort - nextSort > 0) {
60
+            sortNumber += -1;
61
+          } else {
62
+            sortNumber += 1;
63
+          }
64
+          return;
65
+        }
66
+        if (preSort - nextSort > 0) {
67
+          sortNumber += 1;
68
+        } else {
69
+          sortNumber += -1;
70
+        }
71
+      });
72
+      return sortNumber;
73
+    });
74
+  }
75
+  if (params.filter) {
76
+    const filter = JSON.parse(params.filter as any) as {
77
+      [key: string]: string[];
78
+    };
79
+    if (Object.keys(filter).length > 0) {
80
+      dataSource = dataSource.filter((item) => {
81
+        return (Object.keys(filter) as Array<keyof API.RuleListItem>).some((key) => {
82
+          if (!filter[key]) {
83
+            return true;
84
+          }
85
+          if (filter[key].includes(`${item[key]}`)) {
86
+            return true;
87
+          }
88
+          return false;
89
+        });
90
+      });
91
+    }
92
+  }
93
+
94
+  if (params.name) {
95
+    dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
96
+  }
97
+  const result = {
98
+    data: dataSource,
99
+    total: tableListDataSource.length,
100
+    success: true,
101
+    pageSize,
102
+    current: parseInt(`${params.current}`, 10) || 1,
103
+  };
104
+
105
+  return res.json(result);
106
+}
107
+
108
+function postRule(req: Request, res: Response, u: string, b: Request) {
109
+  let realUrl = u;
110
+  if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
111
+    realUrl = req.url;
112
+  }
113
+
114
+  const body = (b && b.body) || req.body;
115
+  const { method, name, desc, key } = body;
116
+
117
+  switch (method) {
118
+    /* eslint no-case-declarations:0 */
119
+    case 'delete':
120
+      tableListDataSource = tableListDataSource.filter((item) => key.indexOf(item.key) === -1);
121
+      break;
122
+    case 'post':
123
+      (() => {
124
+        const i = Math.ceil(Math.random() * 10000);
125
+        const newRule: API.RuleListItem = {
126
+          key: tableListDataSource.length,
127
+          href: 'https://ant.design',
128
+          avatar: [
129
+            'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
130
+            'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
131
+          ][i % 2],
132
+          name,
133
+          owner: '曲丽丽',
134
+          desc,
135
+          callNo: Math.floor(Math.random() * 1000),
136
+          status: Math.floor(Math.random() * 10) % 2,
137
+          updatedAt: moment().format('YYYY-MM-DD'),
138
+          createdAt: moment().format('YYYY-MM-DD'),
139
+          progress: Math.ceil(Math.random() * 100),
140
+        };
141
+        tableListDataSource.unshift(newRule);
142
+        return res.json(newRule);
143
+      })();
144
+      return;
145
+
146
+    case 'update':
147
+      (() => {
148
+        let newRule = {};
149
+        tableListDataSource = tableListDataSource.map((item) => {
150
+          if (item.key === key) {
151
+            newRule = { ...item, desc, name };
152
+            return { ...item, desc, name };
153
+          }
154
+          return item;
155
+        });
156
+        return res.json(newRule);
157
+      })();
158
+      return;
159
+    default:
160
+      break;
161
+  }
162
+
163
+  const result = {
164
+    list: tableListDataSource,
165
+    pagination: {
166
+      total: tableListDataSource.length,
167
+    },
168
+  };
169
+
170
+  res.json(result);
171
+}
172
+
173
+export default {
174
+  'GET /api/rule': getRule,
175
+  'POST /api/rule': postRule,
176
+};

+ 115
- 0
mock/notices.ts Voir le fichier

@@ -0,0 +1,115 @@
1
+import { Request, Response } from 'express';
2
+
3
+const getNotices = (req: Request, res: Response) => {
4
+  res.json({
5
+    data: [
6
+      {
7
+        id: '000000001',
8
+        avatar:
9
+          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/MSbDR4FR2MUAAAAAAAAAAAAAFl94AQBr',
10
+        title: '你收到了 14 份新周报',
11
+        datetime: '2017-08-09',
12
+        type: 'notification',
13
+      },
14
+      {
15
+        id: '000000002',
16
+        avatar:
17
+          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/hX-PTavYIq4AAAAAAAAAAAAAFl94AQBr',
18
+        title: '你推荐的 曲妮妮 已通过第三轮面试',
19
+        datetime: '2017-08-08',
20
+        type: 'notification',
21
+      },
22
+      {
23
+        id: '000000003',
24
+        avatar:
25
+          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/jHX5R5l3QjQAAAAAAAAAAAAAFl94AQBr',
26
+        title: '这种模板可以区分多种通知类型',
27
+        datetime: '2017-08-07',
28
+        read: true,
29
+        type: 'notification',
30
+      },
31
+      {
32
+        id: '000000004',
33
+        avatar:
34
+          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Wr4mQqx6jfwAAAAAAAAAAAAAFl94AQBr',
35
+        title: '左侧图标用于区分不同的类型',
36
+        datetime: '2017-08-07',
37
+        type: 'notification',
38
+      },
39
+      {
40
+        id: '000000005',
41
+        avatar:
42
+          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/Mzj_TbcWUj4AAAAAAAAAAAAAFl94AQBr',
43
+        title: '内容不要超过两行字,超出时自动截断',
44
+        datetime: '2017-08-07',
45
+        type: 'notification',
46
+      },
47
+      {
48
+        id: '000000006',
49
+        avatar:
50
+          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/eXLzRbPqQE4AAAAAAAAAAAAAFl94AQBr',
51
+        title: '曲丽丽 评论了你',
52
+        description: '描述信息描述信息描述信息',
53
+        datetime: '2017-08-07',
54
+        type: 'message',
55
+        clickClose: true,
56
+      },
57
+      {
58
+        id: '000000007',
59
+        avatar:
60
+          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/w5mRQY2AmEEAAAAAAAAAAAAAFl94AQBr',
61
+        title: '朱偏右 回复了你',
62
+        description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
63
+        datetime: '2017-08-07',
64
+        type: 'message',
65
+        clickClose: true,
66
+      },
67
+      {
68
+        id: '000000008',
69
+        avatar:
70
+          'https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/wPadR5M9918AAAAAAAAAAAAAFl94AQBr',
71
+        title: '标题',
72
+        description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
73
+        datetime: '2017-08-07',
74
+        type: 'message',
75
+        clickClose: true,
76
+      },
77
+      {
78
+        id: '000000009',
79
+        title: '任务名称',
80
+        description: '任务需要在 2017-01-12 20:00 前启动',
81
+        extra: '未开始',
82
+        status: 'todo',
83
+        type: 'event',
84
+      },
85
+      {
86
+        id: '000000010',
87
+        title: '第三方紧急代码变更',
88
+        description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
89
+        extra: '马上到期',
90
+        status: 'urgent',
91
+        type: 'event',
92
+      },
93
+      {
94
+        id: '000000011',
95
+        title: '信息安全考试',
96
+        description: '指派竹尔于 2017-01-09 前完成更新并发布',
97
+        extra: '已耗时 8 天',
98
+        status: 'doing',
99
+        type: 'event',
100
+      },
101
+      {
102
+        id: '000000012',
103
+        title: 'ABCD 版本发布',
104
+        description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
105
+        extra: '进行中',
106
+        status: 'processing',
107
+        type: 'event',
108
+      },
109
+    ],
110
+  });
111
+};
112
+
113
+export default {
114
+  'GET /api/notices': getNotices,
115
+};

+ 324
- 0
mock/requestRecord.mock.js Voir le fichier

@@ -0,0 +1,324 @@
1
+module.exports = {
2
+  'GET /api/currentUser': {
3
+    data: {
4
+      name: 'Serati Ma',
5
+      avatar: 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png',
6
+      userid: '00000001',
7
+      email: 'antdesign@alipay.com',
8
+      signature: '海纳百川,有容乃大',
9
+      title: '交互专家',
10
+      group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
11
+      tags: [
12
+        { key: '0', label: '很有想法的' },
13
+        { key: '1', label: '专注设计' },
14
+        { key: '2', label: '辣~' },
15
+        { key: '3', label: '大长腿' },
16
+        { key: '4', label: '川妹子' },
17
+        { key: '5', label: '海纳百川' },
18
+      ],
19
+      notifyCount: 12,
20
+      unreadCount: 11,
21
+      country: 'China',
22
+      geographic: {
23
+        province: { label: '浙江省', key: '330000' },
24
+        city: { label: '杭州市', key: '330100' },
25
+      },
26
+      address: '西湖区工专路 77 号',
27
+      phone: '0752-268888888',
28
+    },
29
+  },
30
+  'GET /api/rule': {
31
+    data: [
32
+      {
33
+        key: 99,
34
+        disabled: false,
35
+        href: 'https://ant.design',
36
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
37
+        name: 'TradeCode 99',
38
+        owner: '曲丽丽',
39
+        desc: '这是一段描述',
40
+        callNo: 503,
41
+        status: '0',
42
+        updatedAt: '2022-12-06T05:00:57.040Z',
43
+        createdAt: '2022-12-06T05:00:57.040Z',
44
+        progress: 81,
45
+      },
46
+      {
47
+        key: 98,
48
+        disabled: false,
49
+        href: 'https://ant.design',
50
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
51
+        name: 'TradeCode 98',
52
+        owner: '曲丽丽',
53
+        desc: '这是一段描述',
54
+        callNo: 164,
55
+        status: '0',
56
+        updatedAt: '2022-12-06T05:00:57.040Z',
57
+        createdAt: '2022-12-06T05:00:57.040Z',
58
+        progress: 12,
59
+      },
60
+      {
61
+        key: 97,
62
+        disabled: false,
63
+        href: 'https://ant.design',
64
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
65
+        name: 'TradeCode 97',
66
+        owner: '曲丽丽',
67
+        desc: '这是一段描述',
68
+        callNo: 174,
69
+        status: '1',
70
+        updatedAt: '2022-12-06T05:00:57.040Z',
71
+        createdAt: '2022-12-06T05:00:57.040Z',
72
+        progress: 81,
73
+      },
74
+      {
75
+        key: 96,
76
+        disabled: true,
77
+        href: 'https://ant.design',
78
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
79
+        name: 'TradeCode 96',
80
+        owner: '曲丽丽',
81
+        desc: '这是一段描述',
82
+        callNo: 914,
83
+        status: '0',
84
+        updatedAt: '2022-12-06T05:00:57.040Z',
85
+        createdAt: '2022-12-06T05:00:57.040Z',
86
+        progress: 7,
87
+      },
88
+      {
89
+        key: 95,
90
+        disabled: false,
91
+        href: 'https://ant.design',
92
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
93
+        name: 'TradeCode 95',
94
+        owner: '曲丽丽',
95
+        desc: '这是一段描述',
96
+        callNo: 698,
97
+        status: '2',
98
+        updatedAt: '2022-12-06T05:00:57.040Z',
99
+        createdAt: '2022-12-06T05:00:57.040Z',
100
+        progress: 82,
101
+      },
102
+      {
103
+        key: 94,
104
+        disabled: false,
105
+        href: 'https://ant.design',
106
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
107
+        name: 'TradeCode 94',
108
+        owner: '曲丽丽',
109
+        desc: '这是一段描述',
110
+        callNo: 488,
111
+        status: '1',
112
+        updatedAt: '2022-12-06T05:00:57.040Z',
113
+        createdAt: '2022-12-06T05:00:57.040Z',
114
+        progress: 14,
115
+      },
116
+      {
117
+        key: 93,
118
+        disabled: false,
119
+        href: 'https://ant.design',
120
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
121
+        name: 'TradeCode 93',
122
+        owner: '曲丽丽',
123
+        desc: '这是一段描述',
124
+        callNo: 580,
125
+        status: '2',
126
+        updatedAt: '2022-12-06T05:00:57.040Z',
127
+        createdAt: '2022-12-06T05:00:57.040Z',
128
+        progress: 77,
129
+      },
130
+      {
131
+        key: 92,
132
+        disabled: false,
133
+        href: 'https://ant.design',
134
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
135
+        name: 'TradeCode 92',
136
+        owner: '曲丽丽',
137
+        desc: '这是一段描述',
138
+        callNo: 244,
139
+        status: '3',
140
+        updatedAt: '2022-12-06T05:00:57.040Z',
141
+        createdAt: '2022-12-06T05:00:57.040Z',
142
+        progress: 58,
143
+      },
144
+      {
145
+        key: 91,
146
+        disabled: false,
147
+        href: 'https://ant.design',
148
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
149
+        name: 'TradeCode 91',
150
+        owner: '曲丽丽',
151
+        desc: '这是一段描述',
152
+        callNo: 959,
153
+        status: '0',
154
+        updatedAt: '2022-12-06T05:00:57.040Z',
155
+        createdAt: '2022-12-06T05:00:57.040Z',
156
+        progress: 66,
157
+      },
158
+      {
159
+        key: 90,
160
+        disabled: true,
161
+        href: 'https://ant.design',
162
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
163
+        name: 'TradeCode 90',
164
+        owner: '曲丽丽',
165
+        desc: '这是一段描述',
166
+        callNo: 958,
167
+        status: '0',
168
+        updatedAt: '2022-12-06T05:00:57.040Z',
169
+        createdAt: '2022-12-06T05:00:57.040Z',
170
+        progress: 72,
171
+      },
172
+      {
173
+        key: 89,
174
+        disabled: false,
175
+        href: 'https://ant.design',
176
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
177
+        name: 'TradeCode 89',
178
+        owner: '曲丽丽',
179
+        desc: '这是一段描述',
180
+        callNo: 301,
181
+        status: '2',
182
+        updatedAt: '2022-12-06T05:00:57.040Z',
183
+        createdAt: '2022-12-06T05:00:57.040Z',
184
+        progress: 2,
185
+      },
186
+      {
187
+        key: 88,
188
+        disabled: false,
189
+        href: 'https://ant.design',
190
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
191
+        name: 'TradeCode 88',
192
+        owner: '曲丽丽',
193
+        desc: '这是一段描述',
194
+        callNo: 277,
195
+        status: '1',
196
+        updatedAt: '2022-12-06T05:00:57.040Z',
197
+        createdAt: '2022-12-06T05:00:57.040Z',
198
+        progress: 12,
199
+      },
200
+      {
201
+        key: 87,
202
+        disabled: false,
203
+        href: 'https://ant.design',
204
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
205
+        name: 'TradeCode 87',
206
+        owner: '曲丽丽',
207
+        desc: '这是一段描述',
208
+        callNo: 810,
209
+        status: '1',
210
+        updatedAt: '2022-12-06T05:00:57.040Z',
211
+        createdAt: '2022-12-06T05:00:57.040Z',
212
+        progress: 82,
213
+      },
214
+      {
215
+        key: 86,
216
+        disabled: false,
217
+        href: 'https://ant.design',
218
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
219
+        name: 'TradeCode 86',
220
+        owner: '曲丽丽',
221
+        desc: '这是一段描述',
222
+        callNo: 780,
223
+        status: '3',
224
+        updatedAt: '2022-12-06T05:00:57.040Z',
225
+        createdAt: '2022-12-06T05:00:57.040Z',
226
+        progress: 22,
227
+      },
228
+      {
229
+        key: 85,
230
+        disabled: false,
231
+        href: 'https://ant.design',
232
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
233
+        name: 'TradeCode 85',
234
+        owner: '曲丽丽',
235
+        desc: '这是一段描述',
236
+        callNo: 705,
237
+        status: '3',
238
+        updatedAt: '2022-12-06T05:00:57.040Z',
239
+        createdAt: '2022-12-06T05:00:57.040Z',
240
+        progress: 12,
241
+      },
242
+      {
243
+        key: 84,
244
+        disabled: true,
245
+        href: 'https://ant.design',
246
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
247
+        name: 'TradeCode 84',
248
+        owner: '曲丽丽',
249
+        desc: '这是一段描述',
250
+        callNo: 203,
251
+        status: '0',
252
+        updatedAt: '2022-12-06T05:00:57.040Z',
253
+        createdAt: '2022-12-06T05:00:57.040Z',
254
+        progress: 79,
255
+      },
256
+      {
257
+        key: 83,
258
+        disabled: false,
259
+        href: 'https://ant.design',
260
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
261
+        name: 'TradeCode 83',
262
+        owner: '曲丽丽',
263
+        desc: '这是一段描述',
264
+        callNo: 491,
265
+        status: '2',
266
+        updatedAt: '2022-12-06T05:00:57.040Z',
267
+        createdAt: '2022-12-06T05:00:57.040Z',
268
+        progress: 59,
269
+      },
270
+      {
271
+        key: 82,
272
+        disabled: false,
273
+        href: 'https://ant.design',
274
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
275
+        name: 'TradeCode 82',
276
+        owner: '曲丽丽',
277
+        desc: '这是一段描述',
278
+        callNo: 73,
279
+        status: '0',
280
+        updatedAt: '2022-12-06T05:00:57.040Z',
281
+        createdAt: '2022-12-06T05:00:57.040Z',
282
+        progress: 100,
283
+      },
284
+      {
285
+        key: 81,
286
+        disabled: false,
287
+        href: 'https://ant.design',
288
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
289
+        name: 'TradeCode 81',
290
+        owner: '曲丽丽',
291
+        desc: '这是一段描述',
292
+        callNo: 406,
293
+        status: '3',
294
+        updatedAt: '2022-12-06T05:00:57.040Z',
295
+        createdAt: '2022-12-06T05:00:57.040Z',
296
+        progress: 61,
297
+      },
298
+      {
299
+        key: 80,
300
+        disabled: false,
301
+        href: 'https://ant.design',
302
+        avatar: 'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
303
+        name: 'TradeCode 80',
304
+        owner: '曲丽丽',
305
+        desc: '这是一段描述',
306
+        callNo: 112,
307
+        status: '2',
308
+        updatedAt: '2022-12-06T05:00:57.040Z',
309
+        createdAt: '2022-12-06T05:00:57.040Z',
310
+        progress: 20,
311
+      },
312
+    ],
313
+    total: 100,
314
+    success: true,
315
+    pageSize: 20,
316
+    current: 1,
317
+  },
318
+  'POST /api/login/outLogin': { data: {}, success: true },
319
+  'POST /api/login/account': {
320
+    status: 'ok',
321
+    type: 'account',
322
+    currentAuthority: 'admin',
323
+  },
324
+};

+ 1927
- 0
mock/route.ts
Fichier diff supprimé car celui-ci est trop grand
Voir le fichier


+ 203
- 0
mock/user.ts Voir le fichier

@@ -0,0 +1,203 @@
1
+import { Request, Response } from 'express';
2
+
3
+const waitTime = (time: number = 100) => {
4
+  return new Promise((resolve) => {
5
+    setTimeout(() => {
6
+      resolve(true);
7
+    }, time);
8
+  });
9
+};
10
+
11
+async function getFakeCaptcha(req: Request, res: Response) {
12
+  await waitTime(2000);
13
+  return res.json('captcha-xxx');
14
+}
15
+
16
+const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env;
17
+
18
+/**
19
+ * 当前用户的权限,如果为空代表没登录
20
+ * current user access, if is '', user need login
21
+ * 如果是 pro 的预览,默认是有权限的
22
+ */
23
+let access = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ? 'admin' : '';
24
+
25
+const getAccess = () => {
26
+  return access;
27
+};
28
+
29
+// 代码中会兼容本地 service mock 以及部署站点的静态数据
30
+export default {
31
+  // 支持值为 Object 和 Array
32
+  'GET /api/currentUser': (req: Request, res: Response) => {
33
+    if (!getAccess()) {
34
+      res.status(401).send({
35
+        data: {
36
+          isLogin: false,
37
+        },
38
+        errorCode: '401',
39
+        errorMessage: '请先登录!',
40
+        success: true,
41
+      });
42
+      return;
43
+    }
44
+    res.send({
45
+      success: true,
46
+      data: {
47
+        name: 'Serati Ma',
48
+        avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
49
+        userid: '00000001',
50
+        email: 'antdesign@alipay.com',
51
+        signature: '海纳百川,有容乃大',
52
+        title: '交互专家',
53
+        group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
54
+        tags: [
55
+          {
56
+            key: '0',
57
+            label: '很有想法的',
58
+          },
59
+          {
60
+            key: '1',
61
+            label: '专注设计',
62
+          },
63
+          {
64
+            key: '2',
65
+            label: '辣~',
66
+          },
67
+          {
68
+            key: '3',
69
+            label: '大长腿',
70
+          },
71
+          {
72
+            key: '4',
73
+            label: '川妹子',
74
+          },
75
+          {
76
+            key: '5',
77
+            label: '海纳百川',
78
+          },
79
+        ],
80
+        notifyCount: 12,
81
+        unreadCount: 11,
82
+        country: 'China',
83
+        access: getAccess(),
84
+        geographic: {
85
+          province: {
86
+            label: '浙江省',
87
+            key: '330000',
88
+          },
89
+          city: {
90
+            label: '杭州市',
91
+            key: '330100',
92
+          },
93
+        },
94
+        address: '西湖区工专路 77 号',
95
+        phone: '0752-268888888',
96
+      },
97
+    });
98
+  },
99
+  // GET POST 可省略
100
+  'GET /api/users': [
101
+    {
102
+      key: '1',
103
+      name: 'John Brown',
104
+      age: 32,
105
+      address: 'New York No. 1 Lake Park',
106
+    },
107
+    {
108
+      key: '2',
109
+      name: 'Jim Green',
110
+      age: 42,
111
+      address: 'London No. 1 Lake Park',
112
+    },
113
+    {
114
+      key: '3',
115
+      name: 'Joe Black',
116
+      age: 32,
117
+      address: 'Sidney No. 1 Lake Park',
118
+    },
119
+  ],
120
+  'POST /api/login/account': async (req: Request, res: Response) => {
121
+    const { password, username, type } = req.body;
122
+    await waitTime(2000);
123
+    if (password === 'ant.design' && username === 'admin') {
124
+      res.send({
125
+        status: 'ok',
126
+        type,
127
+        currentAuthority: 'admin',
128
+      });
129
+      access = 'admin';
130
+      return;
131
+    }
132
+    if (password === 'ant.design' && username === 'user') {
133
+      res.send({
134
+        status: 'ok',
135
+        type,
136
+        currentAuthority: 'user',
137
+      });
138
+      access = 'user';
139
+      return;
140
+    }
141
+    if (type === 'mobile') {
142
+      res.send({
143
+        status: 'ok',
144
+        type,
145
+        currentAuthority: 'admin',
146
+      });
147
+      access = 'admin';
148
+      return;
149
+    }
150
+
151
+    res.send({
152
+      status: 'error',
153
+      type,
154
+      currentAuthority: 'guest',
155
+    });
156
+    access = 'guest';
157
+  },
158
+  'POST /api/login/outLogin': (req: Request, res: Response) => {
159
+    access = '';
160
+    res.send({ data: {}, success: true });
161
+  },
162
+  'POST /api/register': (req: Request, res: Response) => {
163
+    res.send({ status: 'ok', currentAuthority: 'user', success: true });
164
+  },
165
+  'GET /api/500': (req: Request, res: Response) => {
166
+    res.status(500).send({
167
+      timestamp: 1513932555104,
168
+      status: 500,
169
+      error: 'error',
170
+      message: 'error',
171
+      path: '/base/category/list',
172
+    });
173
+  },
174
+  'GET /api/404': (req: Request, res: Response) => {
175
+    res.status(404).send({
176
+      timestamp: 1513932643431,
177
+      status: 404,
178
+      error: 'Not Found',
179
+      message: 'No message available',
180
+      path: '/base/category/list/2121212',
181
+    });
182
+  },
183
+  'GET /api/403': (req: Request, res: Response) => {
184
+    res.status(403).send({
185
+      timestamp: 1513932555104,
186
+      status: 403,
187
+      error: 'Forbidden',
188
+      message: 'Forbidden',
189
+      path: '/base/category/list',
190
+    });
191
+  },
192
+  'GET /api/401': (req: Request, res: Response) => {
193
+    res.status(401).send({
194
+      timestamp: 1513932555104,
195
+      status: 401,
196
+      error: 'Unauthorized',
197
+      message: 'Unauthorized',
198
+      path: '/base/category/list',
199
+    });
200
+  },
201
+
202
+  'GET  /api/login/captcha': getFakeCaptcha,
203
+};

+ 160
- 0
package.json Voir le fichier

@@ -0,0 +1,160 @@
1
+{
2
+  "name": "ant-design-pro",
3
+  "version": "6.0.0",
4
+  "private": true,
5
+  "description": "An out-of-box UI solution for enterprise applications",
6
+  "scripts": {
7
+    "analyze": "cross-env ANALYZE=1 max build",
8
+    "build": "max build",
9
+    "deploy": "npm run build && npm run gh-pages",
10
+    "dev": "npm run start:dev",
11
+    "docker-hub:build": "docker build  -f Dockerfile.hub -t  ant-design-pro ./",
12
+    "docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build",
13
+    "docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up",
14
+    "docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build",
15
+    "docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up",
16
+    "docker:push": "npm run docker-hub:build && npm run docker:tag && docker push antdesign/ant-design-pro",
17
+    "docker:tag": "docker tag ant-design-pro antdesign/ant-design-pro",
18
+    "gh-pages": "gh-pages -d dist",
19
+    "i18n-remove": "pro i18n-remove --locale=zh-CN --write",
20
+    "postinstall": "max setup",
21
+    "jest": "jest",
22
+    "lint": "npm run lint:js && npm run lint:prettier && npm run tsc",
23
+    "lint-staged": "lint-staged",
24
+    "lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ",
25
+    "lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ",
26
+    "lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
27
+    "lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto",
28
+    "openapi": "max openapi",
29
+    "prepare": "cd .. && husky install",
30
+    "prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"",
31
+    "preview": "npm run build && max preview --port 8000",
32
+    "record": "cross-env NODE_ENV=development REACT_APP_ENV=test max record --scene=login",
33
+    "serve": "umi-serve",
34
+    "start": "cross-env UMI_ENV=dev max dev",
35
+    "start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev",
36
+    "start:no-mock": "cross-env MOCK=none UMI_ENV=dev max dev",
37
+    "start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev max dev",
38
+    "start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev",
39
+    "test": "jest",
40
+    "test:coverage": "npm run jest -- --coverage",
41
+    "test:update": "npm run jest -- -u",
42
+    "tsc": "tsc --noEmit"
43
+  },
44
+  "lint-staged": {
45
+    "**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
46
+    "**/*.{js,jsx,tsx,ts,less,md,json}": [
47
+      "prettier --write"
48
+    ]
49
+  },
50
+  "browserslist": [
51
+    "> 1%",
52
+    "last 2 versions",
53
+    "not ie <= 10"
54
+  ],
55
+  "dependencies": {
56
+    "@ant-design/icons": "^5.0.0",
57
+    "@ant-design/pro-components": "^2.4.4",
58
+    "@ant-design/use-emotion-css": "1.0.4",
59
+    "@umijs/renderer-react": "^4.0.83",
60
+    "@umijs/route-utils": "^4.0.1",
61
+    "antd": "^5.4.4",
62
+    "camunda-bpmn-moddle": "^4.4.0",
63
+    "classnames": "^2.3.2",
64
+    "crypto-js": "^4.2.0",
65
+    "echarts": "^5.4.3",
66
+    "fabric": "^5.3.0",
67
+    "form-render": "^2.2.8",
68
+    "highlight.js": "^11.7.0",
69
+    "houtaroy-bpmn-js-properties-panel-activiti": "^0.0.1",
70
+    "lodash": "^4.17.21",
71
+    "moment": "^2.29.4",
72
+    "omit.js": "^2.0.2",
73
+    "query-string": "^8.1.0",
74
+    "quill": "^1.3.7",
75
+    "quill-image-resize-module": "^3.0.0",
76
+    "rc-menu": "^9.8.4",
77
+    "rc-util": "^5.30.0",
78
+    "react": "^18.2.0",
79
+    "react-activation": "^0.12.4",
80
+    "react-cropper": "^2.3.3",
81
+    "react-dev-inspector": "^1.8.1",
82
+    "react-dom": "^18.2.0",
83
+    "react-helmet-async": "^1.3.0",
84
+    "react-highlight": "^0.15.0",
85
+    "react-id-swiper": "3",
86
+    "react-pdf": "^7.3.3",
87
+    "react-quill": "^2.0.0",
88
+    "react-router": "^6.15.0",
89
+    "react-router-dom": "^6.15.0",
90
+    "styled-components": "^6.1.12",
91
+    "swiper": "^10.2.0",
92
+    "three": "^0.157.0",
93
+    "umi-plugin-keep-alive": "^0.0.1-beta.35",
94
+    "umi-request": "^1.4.0"
95
+  },
96
+  "devDependencies": {
97
+    "@alib/build-scripts": "^0.1.18",
98
+    "@alilc/lowcode-engine": "^1.1.2",
99
+    "@alilc/lowcode-engine-ext": "^1.0.0",
100
+    "@alilc/lowcode-types": "^1.1.1",
101
+    "@ant-design/pro-cli": "^3.1.0",
102
+    "@testing-library/react": "^14.0.0",
103
+    "@types/antd": "^1.0.0",
104
+    "@types/express": "^4.17.14",
105
+    "@types/jest": "^29.5.1",
106
+    "@types/lodash": "^4.14.194",
107
+    "@types/react": "^18.2.0",
108
+    "@types/react-dom": "^18.2.0",
109
+    "@types/react-helmet": "^6.1.5",
110
+    "@types/react-highlight": "^0.12.5",
111
+    "@umijs/lint": "^4.0.66",
112
+    "@umijs/max": "^4.0.66",
113
+    "cross-env": "^7.0.3",
114
+    "eslint": "^8.39.0",
115
+    "express": "^4.18.2",
116
+    "gh-pages": "^5.0.0",
117
+    "husky": "^8.0.3",
118
+    "jest": "^29.5.0",
119
+    "jest-environment-jsdom": "^29.5.0",
120
+    "lint-staged": "^13.2.0",
121
+    "mockjs": "^1.1.0",
122
+    "prettier": "^2.8.1",
123
+    "swagger-ui-dist": "^4.18.2",
124
+    "ts-node": "^10.9.1",
125
+    "typescript": "^5.0.4",
126
+    "umi-presets-pro": "^2.0.0"
127
+  },
128
+  "engines": {
129
+    "node": ">=12.0.0"
130
+  },
131
+  "create-umi": {
132
+    "ignoreScript": [
133
+      "docker*",
134
+      "functions*",
135
+      "site",
136
+      "generateMock"
137
+    ],
138
+    "ignoreDependencies": [
139
+      "netlify*",
140
+      "serverless"
141
+    ],
142
+    "ignore": [
143
+      ".dockerignore",
144
+      ".git",
145
+      ".github",
146
+      ".gitpod.yml",
147
+      "CODE_OF_CONDUCT.md",
148
+      "Dockerfile",
149
+      "Dockerfile.*",
150
+      "lambda",
151
+      "LICENSE",
152
+      "netlify.toml",
153
+      "README.*.md",
154
+      "azure-pipelines.yml",
155
+      "docker",
156
+      "CNAME",
157
+      "create-umi"
158
+    ]
159
+  }
160
+}

BIN
public/TheFile/template.xlsx Voir le fichier


BIN
public/favicon.ico Voir le fichier


BIN
public/icons/icon-128x128.png Voir le fichier


BIN
public/icons/icon-192x192.png Voir le fichier


BIN
public/icons/icon-512x512.png Voir le fichier


BIN
public/icons/menu/gongcheng.png Voir le fichier


BIN
public/icons/menu/jiashi.png Voir le fichier


BIN
public/icons/menu/sheji.png Voir le fichier


BIN
public/icons/menu/zhinenghua.png Voir le fichier


BIN
public/image/1.png Voir le fichier


BIN
public/image/2.png Voir le fichier


BIN
public/image/3.png Voir le fichier


BIN
public/image/4.png Voir le fichier


BIN
public/image/brand_light1.jpg Voir le fichier


BIN
public/image/brand_light2.jpg Voir le fichier


BIN
public/image/brand_light3.jpg Voir le fichier


BIN
public/image/model_banner.jpg Voir le fichier


BIN
public/image/model_hxlb.jpg Voir le fichier


BIN
public/image/model_lsirtpc.jpg Voir le fichier


BIN
public/image/model_ltriTit.jpg Voir le fichier


BIN
public/image/model_oneTpsi.jpg Voir le fichier


BIN
public/image/model_twoTpi.jpg Voir le fichier


BIN
public/image/model_uidi.jpg Voir le fichier


BIN
public/image/model_uitplsiritp.jpg Voir le fichier


BIN
public/image/model_uitplsirtp.jpg Voir le fichier


BIN
public/image/model_upTdi.jpg Voir le fichier


BIN
public/image/model_utidtpci.jpg Voir le fichier


BIN
public/image/model_utpdirpdltpri.jpg Voir le fichier


BIN
public/image/model_utpi.jpg Voir le fichier


BIN
public/image/model_zyc.jpg Voir le fichier


BIN
public/image/subject-1.jpg Voir le fichier


BIN
public/image/subject-2.jpg Voir le fichier


BIN
public/image/subject-3.jpg Voir le fichier


BIN
public/image/xls.png Voir le fichier


+ 40
- 0
public/libs/ueditor/dialogs/anchor/anchor.html Voir le fichier

@@ -0,0 +1,40 @@
1
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2
+    "http://www.w3.org/TR/html4/loose.dtd">
3
+<html>
4
+    <head>
5
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+        <title></title>
7
+        <style type="text/css">
8
+            *{color: #838383;margin: 0;padding: 0}
9
+            html,body {font-size: 12px;overflow: hidden; }
10
+            .content{padding:5px 0 0 15px;}
11
+            input{width:210px;height:21px;line-height:21px;margin-left: 4px;}
12
+        </style>
13
+    </head>
14
+    <body>
15
+        <div class="content">
16
+            <span><var id="lang_input_anchorName"></var></span><input id="anchorName"  value="" />
17
+        </div>
18
+        <script type="text/javascript" src="../internal.js"></script>
19
+        <script type="text/javascript">
20
+            var anchorInput = $G('anchorName'),
21
+                node = editor.selection.getRange().getClosedNode();
22
+            if(node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))){
23
+                anchorInput.value = node;
24
+            }
25
+            anchorInput.onkeydown = function(evt){
26
+                evt = evt || window.event;
27
+                if(evt.keyCode == 13){
28
+                    editor.execCommand('anchor', anchorInput.value);
29
+                    dialog.close();
30
+                    domUtils.preventDefault(evt)
31
+                }
32
+            };
33
+            dialog.onok = function (){
34
+                editor.execCommand('anchor', anchorInput.value);
35
+                dialog.close();
36
+            };
37
+            $focus(anchorInput);
38
+        </script>
39
+    </body>
40
+</html>

+ 681
- 0
public/libs/ueditor/dialogs/attachment/attachment.css Voir le fichier

@@ -0,0 +1,681 @@
1
+@charset "utf-8";
2
+/* dialog样式 */
3
+.wrapper {
4
+    zoom: 1;
5
+    width: 630px;
6
+    *width: 626px;
7
+    height: 380px;
8
+    margin: 0 auto;
9
+    padding: 10px;
10
+    position: relative;
11
+    font-family: sans-serif;
12
+}
13
+
14
+/*tab样式框大小*/
15
+.tabhead {
16
+    float:left;
17
+}
18
+.tabbody {
19
+    width: 100%;
20
+    height: 346px;
21
+    position: relative;
22
+    clear: both;
23
+}
24
+
25
+.tabbody .panel {
26
+    position: absolute;
27
+    width: 0;
28
+    height: 0;
29
+    background: #fff;
30
+    overflow: hidden;
31
+    display: none;
32
+}
33
+
34
+.tabbody .panel.focus {
35
+    width: 100%;
36
+    height: 346px;
37
+    display: block;
38
+}
39
+
40
+/* 上传附件 */
41
+.tabbody #upload.panel {
42
+    width: 0;
43
+    height: 0;
44
+    overflow: hidden;
45
+    position: absolute !important;
46
+    clip: rect(1px, 1px, 1px, 1px);
47
+    background: #fff;
48
+    display: block;
49
+}
50
+
51
+.tabbody #upload.panel.focus {
52
+    width: 100%;
53
+    height: 346px;
54
+    display: block;
55
+    clip: auto;
56
+}
57
+
58
+#upload .queueList {
59
+    margin: 0;
60
+    width: 100%;
61
+    height: 100%;
62
+    position: absolute;
63
+    overflow: hidden;
64
+}
65
+
66
+#upload p {
67
+    margin: 0;
68
+}
69
+
70
+.element-invisible {
71
+    width: 0 !important;
72
+    height: 0 !important;
73
+    border: 0;
74
+    padding: 0;
75
+    margin: 0;
76
+    overflow: hidden;
77
+    position: absolute !important;
78
+    clip: rect(1px, 1px, 1px, 1px);
79
+}
80
+
81
+#upload .placeholder {
82
+    margin: 10px;
83
+    border: 2px dashed #e6e6e6;
84
+    *border: 0px dashed #e6e6e6;
85
+    height: 172px;
86
+    padding-top: 150px;
87
+    text-align: center;
88
+    background: url(./images/image.png) center 70px no-repeat;
89
+    color: #cccccc;
90
+    font-size: 18px;
91
+    position: relative;
92
+    top:0;
93
+    *top: 10px;
94
+}
95
+
96
+#upload .placeholder .webuploader-pick {
97
+    font-size: 18px;
98
+    background: #00b7ee;
99
+    border-radius: 3px;
100
+    line-height: 44px;
101
+    padding: 0 30px;
102
+    *width: 120px;
103
+    color: #fff;
104
+    display: inline-block;
105
+    margin: 0 auto 20px auto;
106
+    cursor: pointer;
107
+    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
108
+}
109
+
110
+#upload .placeholder .webuploader-pick-hover {
111
+    background: #00a2d4;
112
+}
113
+
114
+
115
+#filePickerContainer {
116
+    text-align: center;
117
+}
118
+
119
+#upload .placeholder .flashTip {
120
+    color: #666666;
121
+    font-size: 12px;
122
+    position: absolute;
123
+    width: 100%;
124
+    text-align: center;
125
+    bottom: 20px;
126
+}
127
+
128
+#upload .placeholder .flashTip a {
129
+    color: #0785d1;
130
+    text-decoration: none;
131
+}
132
+
133
+#upload .placeholder .flashTip a:hover {
134
+    text-decoration: underline;
135
+}
136
+
137
+#upload .placeholder.webuploader-dnd-over {
138
+    border-color: #999999;
139
+}
140
+
141
+#upload .filelist {
142
+    list-style: none;
143
+    margin: 0;
144
+    padding: 0;
145
+    overflow-x: hidden;
146
+    overflow-y: auto;
147
+    position: relative;
148
+    height: 300px;
149
+}
150
+
151
+#upload .filelist:after {
152
+    content: '';
153
+    display: block;
154
+    width: 0;
155
+    height: 0;
156
+    overflow: hidden;
157
+    clear: both;
158
+}
159
+
160
+#upload .filelist li {
161
+    width: 113px;
162
+    height: 113px;
163
+    background: url(./images/bg.png);
164
+    text-align: center;
165
+    margin: 9px 0 0 9px;
166
+    *margin: 6px 0 0 6px;
167
+    position: relative;
168
+    display: block;
169
+    float: left;
170
+    overflow: hidden;
171
+    font-size: 12px;
172
+}
173
+
174
+#upload .filelist li p.log {
175
+    position: relative;
176
+    top: -45px;
177
+}
178
+
179
+#upload .filelist li p.title {
180
+    position: absolute;
181
+    top: 0;
182
+    left: 0;
183
+    width: 100%;
184
+    overflow: hidden;
185
+    white-space: nowrap;
186
+    text-overflow: ellipsis;
187
+    top: 5px;
188
+    text-indent: 5px;
189
+    text-align: left;
190
+}
191
+
192
+#upload .filelist li p.progress {
193
+    position: absolute;
194
+    width: 100%;
195
+    bottom: 0;
196
+    left: 0;
197
+    height: 8px;
198
+    overflow: hidden;
199
+    z-index: 50;
200
+    margin: 0;
201
+    border-radius: 0;
202
+    background: none;
203
+    -webkit-box-shadow: 0 0 0;
204
+}
205
+
206
+#upload .filelist li p.progress span {
207
+    display: none;
208
+    overflow: hidden;
209
+    width: 0;
210
+    height: 100%;
211
+    background: #1483d8 url(./images/progress.png) repeat-x;
212
+
213
+    -webit-transition: width 200ms linear;
214
+    -moz-transition: width 200ms linear;
215
+    -o-transition: width 200ms linear;
216
+    -ms-transition: width 200ms linear;
217
+    transition: width 200ms linear;
218
+
219
+    -webkit-animation: progressmove 2s linear infinite;
220
+    -moz-animation: progressmove 2s linear infinite;
221
+    -o-animation: progressmove 2s linear infinite;
222
+    -ms-animation: progressmove 2s linear infinite;
223
+    animation: progressmove 2s linear infinite;
224
+
225
+    -webkit-transform: translateZ(0);
226
+}
227
+
228
+@-webkit-keyframes progressmove {
229
+    0% {
230
+        background-position: 0 0;
231
+    }
232
+    100% {
233
+        background-position: 17px 0;
234
+    }
235
+}
236
+
237
+@-moz-keyframes progressmove {
238
+    0% {
239
+        background-position: 0 0;
240
+    }
241
+    100% {
242
+        background-position: 17px 0;
243
+    }
244
+}
245
+
246
+@keyframes progressmove {
247
+    0% {
248
+        background-position: 0 0;
249
+    }
250
+    100% {
251
+        background-position: 17px 0;
252
+    }
253
+}
254
+
255
+#upload .filelist li p.imgWrap {
256
+    position: relative;
257
+    z-index: 2;
258
+    line-height: 113px;
259
+    vertical-align: middle;
260
+    overflow: hidden;
261
+    width: 113px;
262
+    height: 113px;
263
+
264
+    -webkit-transform-origin: 50% 50%;
265
+    -moz-transform-origin: 50% 50%;
266
+    -o-transform-origin: 50% 50%;
267
+    -ms-transform-origin: 50% 50%;
268
+    transform-origin: 50% 50%;
269
+
270
+    -webit-transition: 200ms ease-out;
271
+    -moz-transition: 200ms ease-out;
272
+    -o-transition: 200ms ease-out;
273
+    -ms-transition: 200ms ease-out;
274
+    transition: 200ms ease-out;
275
+}
276
+#upload .filelist li p.imgWrap.notimage {
277
+    margin-top: 0;
278
+    width: 111px;
279
+    height: 111px;
280
+    border: 1px #eeeeee solid;
281
+}
282
+#upload .filelist li p.imgWrap.notimage i.file-preview {
283
+    margin-top: 15px;
284
+}
285
+
286
+#upload .filelist li img {
287
+    width: 100%;
288
+}
289
+
290
+#upload .filelist li p.error {
291
+    background: #f43838;
292
+    color: #fff;
293
+    position: absolute;
294
+    bottom: 0;
295
+    left: 0;
296
+    height: 28px;
297
+    line-height: 28px;
298
+    width: 100%;
299
+    z-index: 100;
300
+    display:none;
301
+}
302
+
303
+#upload .filelist li .success {
304
+    display: block;
305
+    position: absolute;
306
+    left: 0;
307
+    bottom: 0;
308
+    height: 40px;
309
+    width: 100%;
310
+    z-index: 200;
311
+    background: url(./images/success.png) no-repeat right bottom;
312
+    background-image: url(./images/success.gif) \9;
313
+}
314
+
315
+#upload .filelist li.filePickerBlock {
316
+    width: 113px;
317
+    height: 113px;
318
+    background: url(./images/image.png) no-repeat center 12px;
319
+    border: 1px solid #eeeeee;
320
+    border-radius: 0;
321
+}
322
+#upload .filelist li.filePickerBlock div.webuploader-pick  {
323
+    width: 100%;
324
+    height: 100%;
325
+    margin: 0;
326
+    padding: 0;
327
+    opacity: 0;
328
+    background: none;
329
+    font-size: 0;
330
+}
331
+
332
+#upload .filelist div.file-panel {
333
+    position: absolute;
334
+    height: 0;
335
+    filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0;
336
+    background: rgba(0, 0, 0, 0.5);
337
+    width: 100%;
338
+    top: 0;
339
+    left: 0;
340
+    overflow: hidden;
341
+    z-index: 300;
342
+}
343
+
344
+#upload .filelist div.file-panel span {
345
+    width: 24px;
346
+    height: 24px;
347
+    display: inline;
348
+    float: right;
349
+    text-indent: -9999px;
350
+    overflow: hidden;
351
+    background: url(./images/icons.png) no-repeat;
352
+    background: url(./images/icons.gif) no-repeat \9;
353
+    margin: 5px 1px 1px;
354
+    cursor: pointer;
355
+    -webkit-tap-highlight-color: rgba(0,0,0,0);
356
+    -webkit-user-select: none;
357
+    -moz-user-select: none;
358
+    -ms-user-select: none;
359
+    user-select: none;
360
+}
361
+
362
+#upload .filelist div.file-panel span.rotateLeft {
363
+    display:none;
364
+    background-position: 0 -24px;
365
+}
366
+
367
+#upload .filelist div.file-panel span.rotateLeft:hover {
368
+    background-position: 0 0;
369
+}
370
+
371
+#upload .filelist div.file-panel span.rotateRight {
372
+    display:none;
373
+    background-position: -24px -24px;
374
+}
375
+
376
+#upload .filelist div.file-panel span.rotateRight:hover {
377
+    background-position: -24px 0;
378
+}
379
+
380
+#upload .filelist div.file-panel span.cancel {
381
+    background-position: -48px -24px;
382
+}
383
+
384
+#upload .filelist div.file-panel span.cancel:hover {
385
+    background-position: -48px 0;
386
+}
387
+
388
+#upload .statusBar {
389
+    height: 45px;
390
+    border-bottom: 1px solid #dadada;
391
+    margin: 0 10px;
392
+    padding: 0;
393
+    line-height: 45px;
394
+    vertical-align: middle;
395
+    position: relative;
396
+}
397
+
398
+#upload .statusBar .progress {
399
+    border: 1px solid #1483d8;
400
+    width: 198px;
401
+    background: #fff;
402
+    height: 18px;
403
+    position: absolute;
404
+    top: 12px;
405
+    display: none;
406
+    text-align: center;
407
+    line-height: 18px;
408
+    color: #6dbfff;
409
+    margin: 0 10px 0 0;
410
+}
411
+#upload .statusBar .progress span.percentage {
412
+    width: 0;
413
+    height: 100%;
414
+    left: 0;
415
+    top: 0;
416
+    background: #1483d8;
417
+    position: absolute;
418
+}
419
+#upload .statusBar .progress span.text {
420
+    position: relative;
421
+    z-index: 10;
422
+}
423
+
424
+#upload .statusBar .info {
425
+    display: inline-block;
426
+    font-size: 14px;
427
+    color: #666666;
428
+}
429
+
430
+#upload .statusBar .btns {
431
+    position: absolute;
432
+    top: 7px;
433
+    right: 0;
434
+    line-height: 30px;
435
+}
436
+
437
+#filePickerBtn {
438
+    display: inline-block;
439
+    float: left;
440
+}
441
+#upload .statusBar .btns .webuploader-pick,
442
+#upload .statusBar .btns .uploadBtn,
443
+#upload .statusBar .btns .uploadBtn.state-uploading,
444
+#upload .statusBar .btns .uploadBtn.state-paused {
445
+    background: #ffffff;
446
+    border: 1px solid #cfcfcf;
447
+    color: #565656;
448
+    padding: 0 18px;
449
+    display: inline-block;
450
+    border-radius: 3px;
451
+    margin-left: 10px;
452
+    cursor: pointer;
453
+    font-size: 14px;
454
+    float: left;
455
+    -webkit-user-select: none;
456
+    -moz-user-select: none;
457
+    -ms-user-select: none;
458
+    user-select: none;
459
+}
460
+#upload .statusBar .btns .webuploader-pick-hover,
461
+#upload .statusBar .btns .uploadBtn:hover,
462
+#upload .statusBar .btns .uploadBtn.state-uploading:hover,
463
+#upload .statusBar .btns .uploadBtn.state-paused:hover {
464
+    background: #f0f0f0;
465
+}
466
+
467
+#upload .statusBar .btns .uploadBtn,
468
+#upload .statusBar .btns .uploadBtn.state-paused{
469
+    background: #00b7ee;
470
+    color: #fff;
471
+    border-color: transparent;
472
+}
473
+#upload .statusBar .btns .uploadBtn:hover,
474
+#upload .statusBar .btns .uploadBtn.state-paused:hover{
475
+    background: #00a2d4;
476
+}
477
+
478
+#upload .statusBar .btns .uploadBtn.disabled {
479
+    pointer-events: none;
480
+    filter:alpha(opacity=60);
481
+    -moz-opacity:0.6;
482
+    -khtml-opacity: 0.6;
483
+    opacity: 0.6;
484
+}
485
+
486
+
487
+
488
+/* 图片管理样式 */
489
+#online {
490
+    width: 100%;
491
+    height: 336px;
492
+    padding: 10px 0 0 0;
493
+}
494
+#online #fileList{
495
+    width: 100%;
496
+    height: 100%;
497
+    overflow-x: hidden;
498
+    overflow-y: auto;
499
+    position: relative;
500
+}
501
+#online ul {
502
+    display: block;
503
+    list-style: none;
504
+    margin: 0;
505
+    padding: 0;
506
+}
507
+#online li {
508
+    float: left;
509
+    display: block;
510
+    list-style: none;
511
+    padding: 0;
512
+    width: 113px;
513
+    height: 113px;
514
+    margin: 0 0 9px 9px;
515
+    *margin: 0 0 6px 6px;
516
+    background-color: #eee;
517
+    overflow: hidden;
518
+    cursor: pointer;
519
+    position: relative;
520
+}
521
+#online li.clearFloat {
522
+    float: none;
523
+    clear: both;
524
+    display: block;
525
+    width:0;
526
+    height:0;
527
+    margin: 0;
528
+    padding: 0;
529
+}
530
+#online li img {
531
+    cursor: pointer;
532
+}
533
+#online li div.file-wrapper {
534
+    cursor: pointer;
535
+    position: absolute;
536
+    display: block;
537
+    width: 111px;
538
+    height: 111px;
539
+    border: 1px solid #eee;
540
+    background: url("./images/bg.png") repeat;
541
+}
542
+#online li div span.file-title{
543
+    display: block;
544
+    padding: 0 3px;
545
+    margin: 3px 0 0 0;
546
+    font-size: 12px;
547
+    height: 15px;
548
+    color: #555555;
549
+    text-align: center;
550
+    width: 107px;
551
+    white-space: nowrap;
552
+    word-break: break-all;
553
+    overflow: hidden;
554
+    text-overflow: ellipsis;
555
+}
556
+#online li .icon {
557
+    cursor: pointer;
558
+    width: 113px;
559
+    height: 113px;
560
+    position: absolute;
561
+    top: 0;
562
+    left: 0;
563
+    z-index: 2;
564
+    border: 0;
565
+    background-repeat: no-repeat;
566
+}
567
+#online li .icon:hover {
568
+    width: 107px;
569
+    height: 107px;
570
+    border: 3px solid #1094fa;
571
+}
572
+#online li.selected .icon {
573
+    background-image: url(images/success.png);
574
+    background-image: url(images/success.gif) \9;
575
+    background-position: 75px 75px;
576
+}
577
+#online li.selected .icon:hover {
578
+    width: 107px;
579
+    height: 107px;
580
+    border: 3px solid #1094fa;
581
+    background-position: 72px 72px;
582
+}
583
+
584
+
585
+/* 在线文件的文件预览图标 */
586
+i.file-preview {
587
+    display: block;
588
+    margin: 10px auto;
589
+    width: 70px;
590
+    height: 70px;
591
+    background-image: url("./images/file-icons.png");
592
+    background-image: url("./images/file-icons.gif") \9;
593
+    background-position: -140px center;
594
+    background-repeat: no-repeat;
595
+}
596
+i.file-preview.file-type-dir{
597
+    background-position: 0 center;
598
+}
599
+i.file-preview.file-type-file{
600
+    background-position: -140px center;
601
+}
602
+i.file-preview.file-type-filelist{
603
+    background-position: -210px center;
604
+}
605
+i.file-preview.file-type-zip,
606
+i.file-preview.file-type-rar,
607
+i.file-preview.file-type-7z,
608
+i.file-preview.file-type-tar,
609
+i.file-preview.file-type-gz,
610
+i.file-preview.file-type-bz2{
611
+    background-position: -280px center;
612
+}
613
+i.file-preview.file-type-xls,
614
+i.file-preview.file-type-xlsx{
615
+    background-position: -350px center;
616
+}
617
+i.file-preview.file-type-doc,
618
+i.file-preview.file-type-docx{
619
+    background-position: -420px center;
620
+}
621
+i.file-preview.file-type-ppt,
622
+i.file-preview.file-type-pptx{
623
+    background-position: -490px center;
624
+}
625
+i.file-preview.file-type-vsd{
626
+    background-position: -560px center;
627
+}
628
+i.file-preview.file-type-pdf{
629
+    background-position: -630px center;
630
+}
631
+i.file-preview.file-type-txt,
632
+i.file-preview.file-type-md,
633
+i.file-preview.file-type-json,
634
+i.file-preview.file-type-htm,
635
+i.file-preview.file-type-xml,
636
+i.file-preview.file-type-html,
637
+i.file-preview.file-type-js,
638
+i.file-preview.file-type-css,
639
+i.file-preview.file-type-php,
640
+i.file-preview.file-type-jsp,
641
+i.file-preview.file-type-asp{
642
+    background-position: -700px center;
643
+}
644
+i.file-preview.file-type-apk{
645
+    background-position: -770px center;
646
+}
647
+i.file-preview.file-type-exe{
648
+    background-position: -840px center;
649
+}
650
+i.file-preview.file-type-ipa{
651
+    background-position: -910px center;
652
+}
653
+i.file-preview.file-type-mp4,
654
+i.file-preview.file-type-swf,
655
+i.file-preview.file-type-mkv,
656
+i.file-preview.file-type-avi,
657
+i.file-preview.file-type-flv,
658
+i.file-preview.file-type-mov,
659
+i.file-preview.file-type-mpg,
660
+i.file-preview.file-type-mpeg,
661
+i.file-preview.file-type-ogv,
662
+i.file-preview.file-type-webm,
663
+i.file-preview.file-type-rm,
664
+i.file-preview.file-type-rmvb{
665
+    background-position: -980px center;
666
+}
667
+i.file-preview.file-type-ogg,
668
+i.file-preview.file-type-wav,
669
+i.file-preview.file-type-wmv,
670
+i.file-preview.file-type-mid,
671
+i.file-preview.file-type-mp3{
672
+    background-position: -1050px center;
673
+}
674
+i.file-preview.file-type-jpg,
675
+i.file-preview.file-type-jpeg,
676
+i.file-preview.file-type-gif,
677
+i.file-preview.file-type-bmp,
678
+i.file-preview.file-type-png,
679
+i.file-preview.file-type-psd{
680
+    background-position: -140px center;
681
+}

+ 60
- 0
public/libs/ueditor/dialogs/attachment/attachment.html Voir le fichier

@@ -0,0 +1,60 @@
1
+<!doctype html>
2
+<html>
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <title>ueditor图片对话框</title>
6
+    <script type="text/javascript" src="../internal.js"></script>
7
+
8
+    <!-- jquery -->
9
+    <script type="text/javascript" src="../../third-party/jquery-1.10.2.min.js"></script>
10
+
11
+    <!-- webuploader -->
12
+    <script src="../../third-party/webuploader/webuploader.min.js"></script>
13
+    <link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css">
14
+
15
+    <!-- attachment dialog -->
16
+    <link rel="stylesheet" href="attachment.css" type="text/css" />
17
+</head>
18
+<body>
19
+
20
+    <div class="wrapper">
21
+        <div id="tabhead" class="tabhead">
22
+            <span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
23
+            <span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
24
+        </div>
25
+        <div id="tabbody" class="tabbody">
26
+            <!-- 上传图片 -->
27
+            <div id="upload" class="panel focus">
28
+                <div id="queueList" class="queueList">
29
+                    <div class="statusBar element-invisible">
30
+                        <div class="progress">
31
+                            <span class="text">0%</span>
32
+                            <span class="percentage"></span>
33
+                        </div><div class="info"></div>
34
+                        <div class="btns">
35
+                            <div id="filePickerBtn"></div>
36
+                            <div class="uploadBtn"><var id="lang_start_upload"></var></div>
37
+                        </div>
38
+                    </div>
39
+                    <div id="dndArea" class="placeholder">
40
+                        <div class="filePickerContainer">
41
+                            <div id="filePickerReady"></div>
42
+                        </div>
43
+                    </div>
44
+                    <ul class="filelist element-invisible">
45
+                        <li id="filePickerBlock" class="filePickerBlock"></li>
46
+                    </ul>
47
+                </div>
48
+            </div>
49
+
50
+            <!-- 在线图片 -->
51
+            <div id="online" class="panel">
52
+                <div id="fileList"><var id="lang_imgLoading"></var></div>
53
+            </div>
54
+
55
+        </div>
56
+    </div>
57
+    <script type="text/javascript" src="attachment.js"></script>
58
+
59
+</body>
60
+</html>

+ 760
- 0
public/libs/ueditor/dialogs/attachment/attachment.js Voir le fichier

@@ -0,0 +1,760 @@
1
+/**
2
+ * User: Jinqn
3
+ * Date: 14-04-08
4
+ * Time: 下午16:34
5
+ * 上传图片对话框逻辑代码,包括tab: 远程图片/上传图片/在线图片/搜索图片
6
+ */
7
+
8
+(function () {
9
+
10
+    var uploadFile,
11
+        onlineFile;
12
+
13
+    window.onload = function () {
14
+        initTabs();
15
+        initButtons();
16
+    };
17
+
18
+    /* 初始化tab标签 */
19
+    function initTabs() {
20
+        var tabs = $G('tabhead').children;
21
+        for (var i = 0; i < tabs.length; i++) {
22
+            domUtils.on(tabs[i], "click", function (e) {
23
+                var target = e.target || e.srcElement;
24
+                setTabFocus(target.getAttribute('data-content-id'));
25
+            });
26
+        }
27
+
28
+        setTabFocus('upload');
29
+    }
30
+
31
+    /* 初始化tabbody */
32
+    function setTabFocus(id) {
33
+        if(!id) return;
34
+        var i, bodyId, tabs = $G('tabhead').children;
35
+        for (i = 0; i < tabs.length; i++) {
36
+            bodyId = tabs[i].getAttribute('data-content-id')
37
+            if (bodyId == id) {
38
+                domUtils.addClass(tabs[i], 'focus');
39
+                domUtils.addClass($G(bodyId), 'focus');
40
+            } else {
41
+                domUtils.removeClasses(tabs[i], 'focus');
42
+                domUtils.removeClasses($G(bodyId), 'focus');
43
+            }
44
+        }
45
+        switch (id) {
46
+            case 'upload':
47
+                uploadFile = uploadFile || new UploadFile('queueList');
48
+                break;
49
+            case 'online':
50
+                onlineFile = onlineFile || new OnlineFile('fileList');
51
+                break;
52
+        }
53
+    }
54
+
55
+    /* 初始化onok事件 */
56
+    function initButtons() {
57
+
58
+        dialog.onok = function () {
59
+            var list = [], id, tabs = $G('tabhead').children;
60
+            for (var i = 0; i < tabs.length; i++) {
61
+                if (domUtils.hasClass(tabs[i], 'focus')) {
62
+                    id = tabs[i].getAttribute('data-content-id');
63
+                    break;
64
+                }
65
+            }
66
+
67
+            switch (id) {
68
+                case 'upload':
69
+                    list = uploadFile.getInsertList();
70
+                    var count = uploadFile.getQueueCount();
71
+                    if (count) {
72
+                        $('.info', '#queueList').html('<span style="color:red;">' + '还有2个未上传文件'.replace(/[\d]/, count) + '</span>');
73
+                        return false;
74
+                    }
75
+                    break;
76
+                case 'online':
77
+                    list = onlineFile.getInsertList();
78
+                    break;
79
+            }
80
+
81
+            editor.execCommand('insertfile', list);
82
+        };
83
+    }
84
+
85
+
86
+    /* 上传附件 */
87
+    function UploadFile(target) {
88
+        this.$wrap = target.constructor == String ? $('#' + target) : $(target);
89
+        this.init();
90
+    }
91
+    UploadFile.prototype = {
92
+        init: function () {
93
+            this.fileList = [];
94
+            this.initContainer();
95
+            this.initUploader();
96
+        },
97
+        initContainer: function () {
98
+            this.$queue = this.$wrap.find('.filelist');
99
+        },
100
+        /* 初始化容器 */
101
+        initUploader: function () {
102
+            var _this = this,
103
+                $ = jQuery,    // just in case. Make sure it's not an other libaray.
104
+                $wrap = _this.$wrap,
105
+            // 图片容器
106
+                $queue = $wrap.find('.filelist'),
107
+            // 状态栏,包括进度和控制按钮
108
+                $statusBar = $wrap.find('.statusBar'),
109
+            // 文件总体选择信息。
110
+                $info = $statusBar.find('.info'),
111
+            // 上传按钮
112
+                $upload = $wrap.find('.uploadBtn'),
113
+            // 上传按钮
114
+                $filePickerBtn = $wrap.find('.filePickerBtn'),
115
+            // 上传按钮
116
+                $filePickerBlock = $wrap.find('.filePickerBlock'),
117
+            // 没选择文件之前的内容。
118
+                $placeHolder = $wrap.find('.placeholder'),
119
+            // 总体进度条
120
+                $progress = $statusBar.find('.progress').hide(),
121
+            // 添加的文件数量
122
+                fileCount = 0,
123
+            // 添加的文件总大小
124
+                fileSize = 0,
125
+            // 优化retina, 在retina下这个值是2
126
+                ratio = window.devicePixelRatio || 1,
127
+            // 缩略图大小
128
+                thumbnailWidth = 113 * ratio,
129
+                thumbnailHeight = 113 * ratio,
130
+            // 可能有pedding, ready, uploading, confirm, done.
131
+                state = '',
132
+            // 所有文件的进度信息,key为file id
133
+                percentages = {},
134
+                supportTransition = (function () {
135
+                    var s = document.createElement('p').style,
136
+                        r = 'transition' in s ||
137
+                            'WebkitTransition' in s ||
138
+                            'MozTransition' in s ||
139
+                            'msTransition' in s ||
140
+                            'OTransition' in s;
141
+                    s = null;
142
+                    return r;
143
+                })(),
144
+            // WebUploader实例
145
+                uploader,
146
+                actionUrl = editor.getActionUrl(editor.getOpt('fileActionName')),
147
+                fileMaxSize = editor.getOpt('fileMaxSize'),
148
+                acceptExtensions = (editor.getOpt('fileAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');;
149
+
150
+            if (!WebUploader.Uploader.support()) {
151
+                $('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
152
+                return;
153
+            } else if (!editor.getOpt('fileActionName')) {
154
+                $('#filePickerReady').after($('<div>').html(lang.errorLoadConfig)).hide();
155
+                return;
156
+            }
157
+
158
+            uploader = _this.uploader = WebUploader.create({
159
+                pick: {
160
+                    id: '#filePickerReady',
161
+                    label: lang.uploadSelectFile
162
+                },
163
+                swf: '../../third-party/webuploader/Uploader.swf',
164
+                server: actionUrl,
165
+                fileVal: editor.getOpt('fileFieldName'),
166
+                duplicate: true,
167
+                fileSingleSizeLimit: fileMaxSize,
168
+                compress: false
169
+            });
170
+            uploader.addButton({
171
+                id: '#filePickerBlock'
172
+            });
173
+            uploader.addButton({
174
+                id: '#filePickerBtn',
175
+                label: lang.uploadAddFile
176
+            });
177
+
178
+            setState('pedding');
179
+
180
+            // 当有文件添加进来时执行,负责view的创建
181
+            function addFile(file) {
182
+                var $li = $('<li id="' + file.id + '">' +
183
+                        '<p class="title">' + file.name + '</p>' +
184
+                        '<p class="imgWrap"></p>' +
185
+                        '<p class="progress"><span></span></p>' +
186
+                        '</li>'),
187
+
188
+                    $btns = $('<div class="file-panel">' +
189
+                        '<span class="cancel">' + lang.uploadDelete + '</span>' +
190
+                        '<span class="rotateRight">' + lang.uploadTurnRight + '</span>' +
191
+                        '<span class="rotateLeft">' + lang.uploadTurnLeft + '</span></div>').appendTo($li),
192
+                    $prgress = $li.find('p.progress span'),
193
+                    $wrap = $li.find('p.imgWrap'),
194
+                    $info = $('<p class="error"></p>').hide().appendTo($li),
195
+
196
+                    showError = function (code) {
197
+                        switch (code) {
198
+                            case 'exceed_size':
199
+                                text = lang.errorExceedSize;
200
+                                break;
201
+                            case 'interrupt':
202
+                                text = lang.errorInterrupt;
203
+                                break;
204
+                            case 'http':
205
+                                text = lang.errorHttp;
206
+                                break;
207
+                            case 'not_allow_type':
208
+                                text = lang.errorFileType;
209
+                                break;
210
+                            default:
211
+                                text = lang.errorUploadRetry;
212
+                                break;
213
+                        }
214
+                        $info.text(text).show();
215
+                    };
216
+
217
+                if (file.getStatus() === 'invalid') {
218
+                    showError(file.statusText);
219
+                } else {
220
+                    $wrap.text(lang.uploadPreview);
221
+                    if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) {
222
+                        $wrap.empty().addClass('notimage').append('<i class="file-preview file-type-' + file.ext.toLowerCase() + '"></i>' +
223
+                        '<span class="file-title" title="' + file.name + '">' + file.name + '</span>');
224
+                    } else {
225
+                        if (browser.ie && browser.version <= 7) {
226
+                            $wrap.text(lang.uploadNoPreview);
227
+                        } else {
228
+                            uploader.makeThumb(file, function (error, src) {
229
+                                if (error || !src) {
230
+                                    $wrap.text(lang.uploadNoPreview);
231
+                                } else {
232
+                                    var $img = $('<img src="' + src + '">');
233
+                                    $wrap.empty().append($img);
234
+                                    $img.on('error', function () {
235
+                                        $wrap.text(lang.uploadNoPreview);
236
+                                    });
237
+                                }
238
+                            }, thumbnailWidth, thumbnailHeight);
239
+                        }
240
+                    }
241
+                    percentages[ file.id ] = [ file.size, 0 ];
242
+                    file.rotation = 0;
243
+
244
+                    /* 检查文件格式 */
245
+                    if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) {
246
+                        showError('not_allow_type');
247
+                        uploader.removeFile(file);
248
+                    }
249
+                }
250
+
251
+                file.on('statuschange', function (cur, prev) {
252
+                    if (prev === 'progress') {
253
+                        $prgress.hide().width(0);
254
+                    } else if (prev === 'queued') {
255
+                        $li.off('mouseenter mouseleave');
256
+                        $btns.remove();
257
+                    }
258
+                    // 成功
259
+                    if (cur === 'error' || cur === 'invalid') {
260
+                        showError(file.statusText);
261
+                        percentages[ file.id ][ 1 ] = 1;
262
+                    } else if (cur === 'interrupt') {
263
+                        showError('interrupt');
264
+                    } else if (cur === 'queued') {
265
+                        percentages[ file.id ][ 1 ] = 0;
266
+                    } else if (cur === 'progress') {
267
+                        $info.hide();
268
+                        $prgress.css('display', 'block');
269
+                    } else if (cur === 'complete') {
270
+                    }
271
+
272
+                    $li.removeClass('state-' + prev).addClass('state-' + cur);
273
+                });
274
+
275
+                $li.on('mouseenter', function () {
276
+                    $btns.stop().animate({height: 30});
277
+                });
278
+                $li.on('mouseleave', function () {
279
+                    $btns.stop().animate({height: 0});
280
+                });
281
+
282
+                $btns.on('click', 'span', function () {
283
+                    var index = $(this).index(),
284
+                        deg;
285
+
286
+                    switch (index) {
287
+                        case 0:
288
+                            uploader.removeFile(file);
289
+                            return;
290
+                        case 1:
291
+                            file.rotation += 90;
292
+                            break;
293
+                        case 2:
294
+                            file.rotation -= 90;
295
+                            break;
296
+                    }
297
+
298
+                    if (supportTransition) {
299
+                        deg = 'rotate(' + file.rotation + 'deg)';
300
+                        $wrap.css({
301
+                            '-webkit-transform': deg,
302
+                            '-mos-transform': deg,
303
+                            '-o-transform': deg,
304
+                            'transform': deg
305
+                        });
306
+                    } else {
307
+                        $wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')');
308
+                    }
309
+
310
+                });
311
+
312
+                $li.insertBefore($filePickerBlock);
313
+            }
314
+
315
+            // 负责view的销毁
316
+            function removeFile(file) {
317
+                var $li = $('#' + file.id);
318
+                delete percentages[ file.id ];
319
+                updateTotalProgress();
320
+                $li.off().find('.file-panel').off().end().remove();
321
+            }
322
+
323
+            function updateTotalProgress() {
324
+                var loaded = 0,
325
+                    total = 0,
326
+                    spans = $progress.children(),
327
+                    percent;
328
+
329
+                $.each(percentages, function (k, v) {
330
+                    total += v[ 0 ];
331
+                    loaded += v[ 0 ] * v[ 1 ];
332
+                });
333
+
334
+                percent = total ? loaded / total : 0;
335
+
336
+                spans.eq(0).text(Math.round(percent * 100) + '%');
337
+                spans.eq(1).css('width', Math.round(percent * 100) + '%');
338
+                updateStatus();
339
+            }
340
+
341
+            function setState(val, files) {
342
+
343
+                if (val != state) {
344
+
345
+                    var stats = uploader.getStats();
346
+
347
+                    $upload.removeClass('state-' + state);
348
+                    $upload.addClass('state-' + val);
349
+
350
+                    switch (val) {
351
+
352
+                        /* 未选择文件 */
353
+                        case 'pedding':
354
+                            $queue.addClass('element-invisible');
355
+                            $statusBar.addClass('element-invisible');
356
+                            $placeHolder.removeClass('element-invisible');
357
+                            $progress.hide(); $info.hide();
358
+                            uploader.refresh();
359
+                            break;
360
+
361
+                        /* 可以开始上传 */
362
+                        case 'ready':
363
+                            $placeHolder.addClass('element-invisible');
364
+                            $queue.removeClass('element-invisible');
365
+                            $statusBar.removeClass('element-invisible');
366
+                            $progress.hide(); $info.show();
367
+                            $upload.text(lang.uploadStart);
368
+                            uploader.refresh();
369
+                            break;
370
+
371
+                        /* 上传中 */
372
+                        case 'uploading':
373
+                            $progress.show(); $info.hide();
374
+                            $upload.text(lang.uploadPause);
375
+                            break;
376
+
377
+                        /* 暂停上传 */
378
+                        case 'paused':
379
+                            $progress.show(); $info.hide();
380
+                            $upload.text(lang.uploadContinue);
381
+                            break;
382
+
383
+                        case 'confirm':
384
+                            $progress.show(); $info.hide();
385
+                            $upload.text(lang.uploadStart);
386
+
387
+                            stats = uploader.getStats();
388
+                            if (stats.successNum && !stats.uploadFailNum) {
389
+                                setState('finish');
390
+                                return;
391
+                            }
392
+                            break;
393
+
394
+                        case 'finish':
395
+                            $progress.hide(); $info.show();
396
+                            if (stats.uploadFailNum) {
397
+                                $upload.text(lang.uploadRetry);
398
+                            } else {
399
+                                $upload.text(lang.uploadStart);
400
+                            }
401
+                            break;
402
+                    }
403
+
404
+                    state = val;
405
+                    updateStatus();
406
+
407
+                }
408
+
409
+                if (!_this.getQueueCount()) {
410
+                    $upload.addClass('disabled')
411
+                } else {
412
+                    $upload.removeClass('disabled')
413
+                }
414
+
415
+            }
416
+
417
+            function updateStatus() {
418
+                var text = '', stats;
419
+
420
+                if (state === 'ready') {
421
+                    text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize));
422
+                } else if (state === 'confirm') {
423
+                    stats = uploader.getStats();
424
+                    if (stats.uploadFailNum) {
425
+                        text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum);
426
+                    }
427
+                } else {
428
+                    stats = uploader.getStats();
429
+                    text = lang.updateStatusFinish.replace('_', fileCount).
430
+                        replace('_KB', WebUploader.formatSize(fileSize)).
431
+                        replace('_', stats.successNum);
432
+
433
+                    if (stats.uploadFailNum) {
434
+                        text += lang.updateStatusError.replace('_', stats.uploadFailNum);
435
+                    }
436
+                }
437
+
438
+                $info.html(text);
439
+            }
440
+
441
+            uploader.on('fileQueued', function (file) {
442
+                if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= fileMaxSize) {
443
+                    fileCount++;
444
+                    fileSize += file.size;
445
+                }
446
+
447
+                if (fileCount === 1) {
448
+                    $placeHolder.addClass('element-invisible');
449
+                    $statusBar.show();
450
+                }
451
+
452
+                addFile(file);
453
+            });
454
+
455
+            uploader.on('fileDequeued', function (file) {
456
+                if (file.ext && acceptExtensions.indexOf(file.ext.toLowerCase()) != -1 && file.size <= fileMaxSize) {
457
+                    fileCount--;
458
+                    fileSize -= file.size;
459
+                }
460
+
461
+                removeFile(file);
462
+                updateTotalProgress();
463
+            });
464
+
465
+            uploader.on('filesQueued', function (file) {
466
+                if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) {
467
+                    setState('ready');
468
+                }
469
+                updateTotalProgress();
470
+            });
471
+
472
+            uploader.on('all', function (type, files) {
473
+                switch (type) {
474
+                    case 'uploadFinished':
475
+                        setState('confirm', files);
476
+                        break;
477
+                    case 'startUpload':
478
+                        /* 添加额外的GET参数 */
479
+                        var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
480
+                            url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params);
481
+                        uploader.option('server', url);
482
+                        setState('uploading', files);
483
+                        break;
484
+                    case 'stopUpload':
485
+                        setState('paused', files);
486
+                        break;
487
+                }
488
+            });
489
+
490
+            uploader.on('uploadBeforeSend', function (file, data, header) {
491
+                //这里可以通过data对象添加POST参数
492
+                if (actionUrl.toLowerCase().indexOf('jsp') != -1) {
493
+                    header['X_Requested_With'] = 'XMLHttpRequest';
494
+                }
495
+            });
496
+
497
+            uploader.on('uploadProgress', function (file, percentage) {
498
+                var $li = $('#' + file.id),
499
+                    $percent = $li.find('.progress span');
500
+
501
+                $percent.css('width', percentage * 100 + '%');
502
+                percentages[ file.id ][ 1 ] = percentage;
503
+                updateTotalProgress();
504
+            });
505
+
506
+            uploader.on('uploadSuccess', function (file, ret) {
507
+                var $file = $('#' + file.id);
508
+                try {
509
+                    var responseText = (ret._raw || ret),
510
+                        json = utils.str2json(responseText);
511
+                    if (json.state == 'SUCCESS') {
512
+                        _this.fileList.push(json);
513
+                        $file.append('<span class="success"></span>');
514
+                    } else {
515
+                        $file.find('.error').text(json.state).show();
516
+                    }
517
+                } catch (e) {
518
+                    $file.find('.error').text(lang.errorServerUpload).show();
519
+                }
520
+            });
521
+
522
+            uploader.on('uploadError', function (file, code) {
523
+            });
524
+            uploader.on('error', function (code, file) {
525
+                if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') {
526
+                    addFile(file);
527
+                }
528
+            });
529
+            uploader.on('uploadComplete', function (file, ret) {
530
+            });
531
+
532
+            $upload.on('click', function () {
533
+                if ($(this).hasClass('disabled')) {
534
+                    return false;
535
+                }
536
+
537
+                if (state === 'ready') {
538
+                    uploader.upload();
539
+                } else if (state === 'paused') {
540
+                    uploader.upload();
541
+                } else if (state === 'uploading') {
542
+                    uploader.stop();
543
+                }
544
+            });
545
+
546
+            $upload.addClass('state-' + state);
547
+            updateTotalProgress();
548
+        },
549
+        getQueueCount: function () {
550
+            var file, i, status, readyFile = 0, files = this.uploader.getFiles();
551
+            for (i = 0; file = files[i++]; ) {
552
+                status = file.getStatus();
553
+                if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
554
+            }
555
+            return readyFile;
556
+        },
557
+        getInsertList: function () {
558
+            var i, link, data, list = [],
559
+                prefix = editor.getOpt('fileUrlPrefix');
560
+            for (i = 0; i < this.fileList.length; i++) {
561
+                data = this.fileList[i];
562
+                link = data.url;
563
+                list.push({
564
+                    title: data.original || link.substr(link.lastIndexOf('/') + 1),
565
+                    url: prefix + link
566
+                });
567
+            }
568
+            return list;
569
+        }
570
+    };
571
+
572
+
573
+    /* 在线附件 */
574
+    function OnlineFile(target) {
575
+        this.container = utils.isString(target) ? document.getElementById(target) : target;
576
+        this.init();
577
+    }
578
+    OnlineFile.prototype = {
579
+        init: function () {
580
+            this.initContainer();
581
+            this.initEvents();
582
+            this.initData();
583
+        },
584
+        /* 初始化容器 */
585
+        initContainer: function () {
586
+            this.container.innerHTML = '';
587
+            this.list = document.createElement('ul');
588
+            this.clearFloat = document.createElement('li');
589
+
590
+            domUtils.addClass(this.list, 'list');
591
+            domUtils.addClass(this.clearFloat, 'clearFloat');
592
+
593
+            this.list.appendChild(this.clearFloat);
594
+            this.container.appendChild(this.list);
595
+        },
596
+        /* 初始化滚动事件,滚动到地步自动拉取数据 */
597
+        initEvents: function () {
598
+            var _this = this;
599
+
600
+            /* 滚动拉取图片 */
601
+            domUtils.on($G('fileList'), 'scroll', function(e){
602
+                var panel = this;
603
+                if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
604
+                    _this.getFileData();
605
+                }
606
+            });
607
+            /* 选中图片 */
608
+            domUtils.on(this.list, 'click', function (e) {
609
+                var target = e.target || e.srcElement,
610
+                    li = target.parentNode;
611
+
612
+                if (li.tagName.toLowerCase() == 'li') {
613
+                    if (domUtils.hasClass(li, 'selected')) {
614
+                        domUtils.removeClasses(li, 'selected');
615
+                    } else {
616
+                        domUtils.addClass(li, 'selected');
617
+                    }
618
+                }
619
+            });
620
+        },
621
+        /* 初始化第一次的数据 */
622
+        initData: function () {
623
+
624
+            /* 拉取数据需要使用的值 */
625
+            this.state = 0;
626
+            this.listSize = editor.getOpt('fileManagerListSize');
627
+            this.listIndex = 0;
628
+            this.listEnd = false;
629
+
630
+            /* 第一次拉取数据 */
631
+            this.getFileData();
632
+        },
633
+        /* 向后台拉取图片列表数据 */
634
+        getFileData: function () {
635
+            var _this = this;
636
+
637
+            if(!_this.listEnd && !this.isLoadingData) {
638
+                this.isLoadingData = true;
639
+                ajax.request(editor.getActionUrl(editor.getOpt('fileManagerActionName')), {
640
+                    timeout: 100000,
641
+                    data: utils.extend({
642
+                            start: this.listIndex,
643
+                            size: this.listSize
644
+                        }, editor.queryCommandValue('serverparam')),
645
+                    method: 'get',
646
+                    onsuccess: function (r) {
647
+                        try {
648
+                            var json = eval('(' + r.responseText + ')');
649
+                            if (json.state == 'SUCCESS') {
650
+                                _this.pushData(json.list);
651
+                                _this.listIndex = parseInt(json.start) + parseInt(json.list.length);
652
+                                if(_this.listIndex >= json.total) {
653
+                                    _this.listEnd = true;
654
+                                }
655
+                                _this.isLoadingData = false;
656
+                            }
657
+                        } catch (e) {
658
+                            if(r.responseText.indexOf('ue_separate_ue') != -1) {
659
+                                var list = r.responseText.split(r.responseText);
660
+                                _this.pushData(list);
661
+                                _this.listIndex = parseInt(list.length);
662
+                                _this.listEnd = true;
663
+                                _this.isLoadingData = false;
664
+                            }
665
+                        }
666
+                    },
667
+                    onerror: function () {
668
+                        _this.isLoadingData = false;
669
+                    }
670
+                });
671
+            }
672
+        },
673
+        /* 添加图片到列表界面上 */
674
+        pushData: function (list) {
675
+            var i, item, img, filetype, preview, icon, _this = this,
676
+                urlPrefix = editor.getOpt('fileManagerUrlPrefix');
677
+            for (i = 0; i < list.length; i++) {
678
+                if(list[i] && list[i].url) {
679
+                    item = document.createElement('li');
680
+                    icon = document.createElement('span');
681
+                    filetype = list[i].url.substr(list[i].url.lastIndexOf('.') + 1);
682
+
683
+                    if ( "png|jpg|jpeg|gif|bmp".indexOf(filetype) != -1 ) {
684
+                        preview = document.createElement('img');
685
+                        domUtils.on(preview, 'load', (function(image){
686
+                            return function(){
687
+                                _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight);
688
+                            };
689
+                        })(preview));
690
+                        preview.width = 113;
691
+                        preview.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
692
+                    } else {
693
+                        var ic = document.createElement('i'),
694
+                            textSpan = document.createElement('span');
695
+                        textSpan.innerHTML = list[i].url.substr(list[i].url.lastIndexOf('/') + 1);
696
+                        preview = document.createElement('div');
697
+                        preview.appendChild(ic);
698
+                        preview.appendChild(textSpan);
699
+                        domUtils.addClass(preview, 'file-wrapper');
700
+                        domUtils.addClass(textSpan, 'file-title');
701
+                        domUtils.addClass(ic, 'file-type-' + filetype);
702
+                        domUtils.addClass(ic, 'file-preview');
703
+                    }
704
+                    domUtils.addClass(icon, 'icon');
705
+                    item.setAttribute('data-url', urlPrefix + list[i].url);
706
+                    if (list[i].original) {
707
+                        item.setAttribute('data-title', list[i].original);
708
+                    }
709
+
710
+                    item.appendChild(preview);
711
+                    item.appendChild(icon);
712
+                    this.list.insertBefore(item, this.clearFloat);
713
+                }
714
+            }
715
+        },
716
+        /* 改变图片大小 */
717
+        scale: function (img, w, h, type) {
718
+            var ow = img.width,
719
+                oh = img.height;
720
+
721
+            if (type == 'justify') {
722
+                if (ow >= oh) {
723
+                    img.width = w;
724
+                    img.height = h * oh / ow;
725
+                    img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
726
+                } else {
727
+                    img.width = w * ow / oh;
728
+                    img.height = h;
729
+                    img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
730
+                }
731
+            } else {
732
+                if (ow >= oh) {
733
+                    img.width = w * ow / oh;
734
+                    img.height = h;
735
+                    img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
736
+                } else {
737
+                    img.width = w;
738
+                    img.height = h * oh / ow;
739
+                    img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
740
+                }
741
+            }
742
+        },
743
+        getInsertList: function () {
744
+            var i, lis = this.list.children, list = [];
745
+            for (i = 0; i < lis.length; i++) {
746
+                if (domUtils.hasClass(lis[i], 'selected')) {
747
+                    var url = lis[i].getAttribute('data-url');
748
+                    var title = lis[i].getAttribute('data-title') || url.substr(url.lastIndexOf('/') + 1);
749
+                    list.push({
750
+                        title: title,
751
+                        url: url
752
+                    });
753
+                }
754
+            }
755
+            return list;
756
+        }
757
+    };
758
+
759
+
760
+})();

BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_chm.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_default.png Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_doc.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_exe.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_jpg.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_mp3.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_mv.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_pdf.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_ppt.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_psd.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_rar.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_txt.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/fileTypeImages/icon_xls.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/alignicon.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/alignicon.png Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/bg.png Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/file-icons.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/file-icons.png Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/icons.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/icons.png Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/image.png Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/progress.png Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/success.gif Voir le fichier


BIN
public/libs/ueditor/dialogs/attachment/images/success.png Voir le fichier


+ 94
- 0
public/libs/ueditor/dialogs/background/background.css Voir le fichier

@@ -0,0 +1,94 @@
1
+.wrapper{ width: 424px;margin: 10px auto; zoom:1;position: relative}
2
+.tabbody{height:225px;}
3
+.tabbody .panel { position: absolute;width:100%; height:100%;background: #fff; display: none;}
4
+.tabbody .focus { display: block;}
5
+
6
+body{font-size: 12px;color: #888;overflow: hidden;}
7
+input,label{vertical-align:middle}
8
+.clear{clear: both;}
9
+.pl{padding-left: 18px;padding-left: 23px\9;}
10
+
11
+#imageList {width: 420px;height: 215px;margin-top: 10px;overflow: hidden;overflow-y: auto;}
12
+#imageList div {float: left;width: 100px;height: 95px;margin: 5px 10px;}
13
+#imageList img {cursor: pointer;border: 2px solid white;}
14
+
15
+.bgarea{margin: 10px;padding: 5px;height: 84%;border: 1px solid #A8A297;}
16
+.content div{margin: 10px 0 10px 5px;}
17
+.content .iptradio{margin: 0px 5px 5px 0px;}
18
+.txt{width:280px;}
19
+
20
+.wrapcolor{height: 19px;}
21
+div.color{float: left;margin: 0;}
22
+#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;margin: 0;float: left;}
23
+div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;}
24
+#custom input{height: 15px;min-height: 15px;width:20px;}
25
+#repeatType{width:100px;}
26
+
27
+
28
+/* 图片管理样式 */
29
+#imgManager {
30
+    width: 100%;
31
+    height: 225px;
32
+}
33
+#imgManager #imageList{
34
+    width: 100%;
35
+    overflow-x: hidden;
36
+    overflow-y: auto;
37
+}
38
+#imgManager ul {
39
+    display: block;
40
+    list-style: none;
41
+    margin: 0;
42
+    padding: 0;
43
+}
44
+#imgManager li {
45
+    float: left;
46
+    display: block;
47
+    list-style: none;
48
+    padding: 0;
49
+    width: 113px;
50
+    height: 113px;
51
+    margin: 9px 0 0 19px;
52
+    background-color: #eee;
53
+    overflow: hidden;
54
+    cursor: pointer;
55
+    position: relative;
56
+}
57
+#imgManager li.clearFloat {
58
+    float: none;
59
+    clear: both;
60
+    display: block;
61
+    width:0;
62
+    height:0;
63
+    margin: 0;
64
+    padding: 0;
65
+}
66
+#imgManager li img {
67
+    cursor: pointer;
68
+}
69
+#imgManager li .icon {
70
+    cursor: pointer;
71
+    width: 113px;
72
+    height: 113px;
73
+    position: absolute;
74
+    top: 0;
75
+    left: 0;
76
+    z-index: 2;
77
+    border: 0;
78
+    background-repeat: no-repeat;
79
+}
80
+#imgManager li .icon:hover {
81
+    width: 107px;
82
+    height: 107px;
83
+    border: 3px solid #1094fa;
84
+}
85
+#imgManager li.selected .icon {
86
+    background-image: url(images/success.png);
87
+    background-position: 75px 75px;
88
+}
89
+#imgManager li.selected .icon:hover {
90
+    width: 107px;
91
+    height: 107px;
92
+    border: 3px solid #1094fa;
93
+    background-position: 72px 72px;
94
+}

+ 56
- 0
public/libs/ueditor/dialogs/background/background.html Voir le fichier

@@ -0,0 +1,56 @@
1
+<!DOCTYPE HTML>
2
+<html>
3
+<head>
4
+    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
5
+    <script type="text/javascript" src="../internal.js"></script>
6
+    <link rel="stylesheet" type="text/css" href="background.css">
7
+</head>
8
+<body>
9
+    <div id="bg_container" class="wrapper">
10
+        <div id="tabHeads" class="tabhead">
11
+            <span class="focus" data-content-id="normal"><var id="lang_background_normal"></var></span>
12
+            <span class="" data-content-id="imgManager"><var id="lang_background_local"></var></span>
13
+        </div>
14
+        <div id="tabBodys" class="tabbody">
15
+            <div id="normal" class="panel focus">
16
+                <fieldset class="bgarea">
17
+                    <legend><var id="lang_background_set"></var></legend>
18
+                    <div class="content">
19
+                        <div>
20
+                            <label><input id="nocolorRadio" class="iptradio" type="radio" name="t" value="none" checked="checked"><var id="lang_background_none"></var></label>
21
+                            <label><input id="coloredRadio" class="iptradio" type="radio" name="t" value="color"><var id="lang_background_colored"></var></label>
22
+                        </div>
23
+                        <div class="wrapcolor pl">
24
+                            <div class="color">
25
+                                <var id="lang_background_color"></var>:
26
+                            </div>
27
+                            <div id="colorPicker"></div>
28
+                            <div class="clear"></div>
29
+                        </div>
30
+                        <div class="wrapcolor pl">
31
+                            <label><var id="lang_background_netimg"></var>:</label><input class="txt" type="text" id="url">
32
+                        </div>
33
+                        <div id="alignment" class="alignment">
34
+                            <var id="lang_background_align"></var>:<select id="repeatType">
35
+                                <option value="center"></option>
36
+                                <option value="repeat-x"></option>
37
+                                <option value="repeat-y"></option>
38
+                                <option value="repeat"></option>
39
+                                <option value="self"></option>
40
+                            </select>
41
+                        </div>
42
+                        <div id="custom" >
43
+                            <var id="lang_background_position"></var>:x:<input type="text" size="1" id="x" maxlength="4" value="0">px&nbsp;&nbsp;y:<input type="text" size="1" id="y" maxlength="4" value="0">px
44
+                        </div>
45
+                    </div>
46
+                </fieldset>
47
+
48
+            </div>
49
+            <div id="imgManager" class="panel">
50
+                <div id="imageList" style=""></div>
51
+            </div>
52
+        </div>
53
+    </div>
54
+    <script type="text/javascript" src="background.js"></script>
55
+</body>
56
+</html>

+ 376
- 0
public/libs/ueditor/dialogs/background/background.js Voir le fichier

@@ -0,0 +1,376 @@
1
+(function () {
2
+
3
+    var onlineImage,
4
+        backupStyle = editor.queryCommandValue('background');
5
+
6
+    window.onload = function () {
7
+        initTabs();
8
+        initColorSelector();
9
+    };
10
+
11
+    /* 初始化tab标签 */
12
+    function initTabs(){
13
+        var tabs = $G('tabHeads').children;
14
+        for (var i = 0; i < tabs.length; i++) {
15
+            domUtils.on(tabs[i], "click", function (e) {
16
+                var target = e.target || e.srcElement;
17
+                for (var j = 0; j < tabs.length; j++) {
18
+                    if(tabs[j] == target){
19
+                        tabs[j].className = "focus";
20
+                        var contentId = tabs[j].getAttribute('data-content-id');
21
+                        $G(contentId).style.display = "block";
22
+                        if(contentId == 'imgManager') {
23
+                            initImagePanel();
24
+                        }
25
+                    }else {
26
+                        tabs[j].className = "";
27
+                        $G(tabs[j].getAttribute('data-content-id')).style.display = "none";
28
+                    }
29
+                }
30
+            });
31
+        }
32
+    }
33
+
34
+    /* 初始化颜色设置 */
35
+    function initColorSelector () {
36
+        var obj = editor.queryCommandValue('background');
37
+        if (obj) {
38
+            var color = obj['background-color'],
39
+                repeat = obj['background-repeat'] || 'repeat',
40
+                image = obj['background-image'] || '',
41
+                position = obj['background-position'] || 'center center',
42
+                pos = position.split(' '),
43
+                x = parseInt(pos[0]) || 0,
44
+                y = parseInt(pos[1]) || 0;
45
+
46
+            if(repeat == 'no-repeat' && (x || y)) repeat = 'self';
47
+
48
+            image = image.match(/url[\s]*\(([^\)]*)\)/);
49
+            image = image ? image[1]:'';
50
+            updateFormState('colored', color, image, repeat, x, y);
51
+        } else {
52
+            updateFormState();
53
+        }
54
+
55
+        var updateHandler = function () {
56
+            updateFormState();
57
+            updateBackground();
58
+        }
59
+        domUtils.on($G('nocolorRadio'), 'click', updateBackground);
60
+        domUtils.on($G('coloredRadio'), 'click', updateHandler);
61
+        domUtils.on($G('url'), 'keyup', function(){
62
+            if($G('url').value && $G('alignment').style.display == "none") {
63
+                utils.each($G('repeatType').children, function(item){
64
+                    item.selected = ('repeat' == item.getAttribute('value') ? 'selected':false);
65
+                });
66
+            }
67
+            updateHandler();
68
+        });
69
+        domUtils.on($G('repeatType'), 'change', updateHandler);
70
+        domUtils.on($G('x'), 'keyup', updateBackground);
71
+        domUtils.on($G('y'), 'keyup', updateBackground);
72
+
73
+        initColorPicker();
74
+    }
75
+
76
+    /* 初始化颜色选择器 */
77
+    function initColorPicker() {
78
+        var me = editor,
79
+            cp = $G("colorPicker");
80
+
81
+        /* 生成颜色选择器ui对象 */
82
+        var popup = new UE.ui.Popup({
83
+            content: new UE.ui.ColorPicker({
84
+                noColorText: me.getLang("clearColor"),
85
+                editor: me,
86
+                onpickcolor: function (t, color) {
87
+                    updateFormState('colored', color);
88
+                    updateBackground();
89
+                    UE.ui.Popup.postHide();
90
+                },
91
+                onpicknocolor: function (t, color) {
92
+                    updateFormState('colored', 'transparent');
93
+                    updateBackground();
94
+                    UE.ui.Popup.postHide();
95
+                }
96
+            }),
97
+            editor: me,
98
+            onhide: function () {
99
+            }
100
+        });
101
+
102
+        /* 设置颜色选择器 */
103
+        domUtils.on(cp, "click", function () {
104
+            popup.showAnchor(this);
105
+        });
106
+        domUtils.on(document, 'mousedown', function (evt) {
107
+            var el = evt.target || evt.srcElement;
108
+            UE.ui.Popup.postHide(el);
109
+        });
110
+        domUtils.on(window, 'scroll', function () {
111
+            UE.ui.Popup.postHide();
112
+        });
113
+    }
114
+
115
+    /* 初始化在线图片列表 */
116
+    function initImagePanel() {
117
+        onlineImage = onlineImage || new OnlineImage('imageList');
118
+    }
119
+
120
+    /* 更新背景色设置面板 */
121
+    function updateFormState (radio, color, url, align, x, y) {
122
+        var nocolorRadio = $G('nocolorRadio'),
123
+            coloredRadio = $G('coloredRadio');
124
+
125
+        if(radio) {
126
+            nocolorRadio.checked = (radio == 'colored' ? false:'checked');
127
+            coloredRadio.checked = (radio == 'colored' ? 'checked':false);
128
+        }
129
+        if(color) {
130
+            domUtils.setStyle($G("colorPicker"), "background-color", color);
131
+        }
132
+
133
+        if(url && /^\//.test(url)) {
134
+            var a = document.createElement('a');
135
+            a.href = url;
136
+            browser.ie && (a.href = a.href);
137
+            url = browser.ie ? a.href:(a.protocol + '//' + a.host + a.pathname + a.search + a.hash);
138
+        }
139
+
140
+        if(url || url === '') {
141
+            $G('url').value = url;
142
+        }
143
+        if(align) {
144
+            utils.each($G('repeatType').children, function(item){
145
+                item.selected = (align == item.getAttribute('value') ? 'selected':false);
146
+            });
147
+        }
148
+        if(x || y) {
149
+            $G('x').value = parseInt(x) || 0;
150
+            $G('y').value = parseInt(y) || 0;
151
+        }
152
+
153
+        $G('alignment').style.display = coloredRadio.checked && $G('url').value ? '':'none';
154
+        $G('custom').style.display = coloredRadio.checked && $G('url').value && $G('repeatType').value == 'self' ? '':'none';
155
+    }
156
+
157
+    /* 更新背景颜色 */
158
+    function updateBackground () {
159
+        if ($G('coloredRadio').checked) {
160
+            var color = domUtils.getStyle($G("colorPicker"), "background-color"),
161
+                bgimg = $G("url").value,
162
+                align = $G("repeatType").value,
163
+                backgroundObj = {
164
+                    "background-repeat": "no-repeat",
165
+                    "background-position": "center center"
166
+                };
167
+
168
+            if (color) backgroundObj["background-color"] = color;
169
+            if (bgimg) backgroundObj["background-image"] = 'url(' + bgimg + ')';
170
+            if (align == 'self') {
171
+                backgroundObj["background-position"] = $G("x").value + "px " + $G("y").value + "px";
172
+            } else if (align == 'repeat-x' || align == 'repeat-y' || align == 'repeat') {
173
+                backgroundObj["background-repeat"] = align;
174
+            }
175
+
176
+            editor.execCommand('background', backgroundObj);
177
+        } else {
178
+            editor.execCommand('background', null);
179
+        }
180
+    }
181
+
182
+
183
+    /* 在线图片 */
184
+    function OnlineImage(target) {
185
+        this.container = utils.isString(target) ? document.getElementById(target) : target;
186
+        this.init();
187
+    }
188
+    OnlineImage.prototype = {
189
+        init: function () {
190
+            this.reset();
191
+            this.initEvents();
192
+        },
193
+        /* 初始化容器 */
194
+        initContainer: function () {
195
+            this.container.innerHTML = '';
196
+            this.list = document.createElement('ul');
197
+            this.clearFloat = document.createElement('li');
198
+
199
+            domUtils.addClass(this.list, 'list');
200
+            domUtils.addClass(this.clearFloat, 'clearFloat');
201
+
202
+            this.list.id = 'imageListUl';
203
+            this.list.appendChild(this.clearFloat);
204
+            this.container.appendChild(this.list);
205
+        },
206
+        /* 初始化滚动事件,滚动到地步自动拉取数据 */
207
+        initEvents: function () {
208
+            var _this = this;
209
+
210
+            /* 滚动拉取图片 */
211
+            domUtils.on($G('imageList'), 'scroll', function(e){
212
+                var panel = this;
213
+                if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
214
+                    _this.getImageData();
215
+                }
216
+            });
217
+            /* 选中图片 */
218
+            domUtils.on(this.container, 'click', function (e) {
219
+                var target = e.target || e.srcElement,
220
+                    li = target.parentNode,
221
+                    nodes = $G('imageListUl').childNodes;
222
+
223
+                if (li.tagName.toLowerCase() == 'li') {
224
+                    updateFormState('nocolor', null, '');
225
+                    for (var i = 0, node; node = nodes[i++];) {
226
+                        if (node == li && !domUtils.hasClass(node, 'selected')) {
227
+                            domUtils.addClass(node, 'selected');
228
+                            updateFormState('colored', null, li.firstChild.getAttribute("_src"), 'repeat');
229
+                        } else {
230
+                            domUtils.removeClasses(node, 'selected');
231
+                        }
232
+                    }
233
+                    updateBackground();
234
+                }
235
+            });
236
+        },
237
+        /* 初始化第一次的数据 */
238
+        initData: function () {
239
+
240
+            /* 拉取数据需要使用的值 */
241
+            this.state = 0;
242
+            this.listSize = editor.getOpt('imageManagerListSize');
243
+            this.listIndex = 0;
244
+            this.listEnd = false;
245
+
246
+            /* 第一次拉取数据 */
247
+            this.getImageData();
248
+        },
249
+        /* 重置界面 */
250
+        reset: function() {
251
+            this.initContainer();
252
+            this.initData();
253
+        },
254
+        /* 向后台拉取图片列表数据 */
255
+        getImageData: function () {
256
+            var _this = this;
257
+
258
+            if(!_this.listEnd && !this.isLoadingData) {
259
+                this.isLoadingData = true;
260
+                var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')),
261
+                    isJsonp = utils.isCrossDomainUrl(url);
262
+                ajax.request(url, {
263
+                    'timeout': 100000,
264
+                    'dataType': isJsonp ? 'jsonp':'',
265
+                    'data': utils.extend({
266
+                            start: this.listIndex,
267
+                            size: this.listSize
268
+                        }, editor.queryCommandValue('serverparam')),
269
+                    'method': 'get',
270
+                    'onsuccess': function (r) {
271
+                        try {
272
+                            var json = isJsonp ? r:eval('(' + r.responseText + ')');
273
+                            if (json.state == 'SUCCESS') {
274
+                                _this.pushData(json.list);
275
+                                _this.listIndex = parseInt(json.start) + parseInt(json.list.length);
276
+                                if(_this.listIndex >= json.total) {
277
+                                    _this.listEnd = true;
278
+                                }
279
+                                _this.isLoadingData = false;
280
+                            }
281
+                        } catch (e) {
282
+                            if(r.responseText.indexOf('ue_separate_ue') != -1) {
283
+                                var list = r.responseText.split(r.responseText);
284
+                                _this.pushData(list);
285
+                                _this.listIndex = parseInt(list.length);
286
+                                _this.listEnd = true;
287
+                                _this.isLoadingData = false;
288
+                            }
289
+                        }
290
+                    },
291
+                    'onerror': function () {
292
+                        _this.isLoadingData = false;
293
+                    }
294
+                });
295
+            }
296
+        },
297
+        /* 添加图片到列表界面上 */
298
+        pushData: function (list) {
299
+            var i, item, img, icon, _this = this,
300
+                urlPrefix = editor.getOpt('imageManagerUrlPrefix');
301
+            for (i = 0; i < list.length; i++) {
302
+                if(list[i] && list[i].url) {
303
+                    item = document.createElement('li');
304
+                    img = document.createElement('img');
305
+                    icon = document.createElement('span');
306
+
307
+                    domUtils.on(img, 'load', (function(image){
308
+                        return function(){
309
+                            _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight);
310
+                        }
311
+                    })(img));
312
+                    img.width = 113;
313
+                    img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
314
+                    img.setAttribute('_src', urlPrefix + list[i].url);
315
+                    domUtils.addClass(icon, 'icon');
316
+
317
+                    item.appendChild(img);
318
+                    item.appendChild(icon);
319
+                    this.list.insertBefore(item, this.clearFloat);
320
+                }
321
+            }
322
+        },
323
+        /* 改变图片大小 */
324
+        scale: function (img, w, h, type) {
325
+            var ow = img.width,
326
+                oh = img.height;
327
+
328
+            if (type == 'justify') {
329
+                if (ow >= oh) {
330
+                    img.width = w;
331
+                    img.height = h * oh / ow;
332
+                    img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
333
+                } else {
334
+                    img.width = w * ow / oh;
335
+                    img.height = h;
336
+                    img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
337
+                }
338
+            } else {
339
+                if (ow >= oh) {
340
+                    img.width = w * ow / oh;
341
+                    img.height = h;
342
+                    img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
343
+                } else {
344
+                    img.width = w;
345
+                    img.height = h * oh / ow;
346
+                    img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
347
+                }
348
+            }
349
+        },
350
+        getInsertList: function () {
351
+            var i, lis = this.list.children, list = [], align = getAlign();
352
+            for (i = 0; i < lis.length; i++) {
353
+                if (domUtils.hasClass(lis[i], 'selected')) {
354
+                    var img = lis[i].firstChild,
355
+                        src = img.getAttribute('_src');
356
+                    list.push({
357
+                        src: src,
358
+                        _src: src,
359
+                        floatStyle: align
360
+                    });
361
+                }
362
+
363
+            }
364
+            return list;
365
+        }
366
+    };
367
+
368
+    dialog.onok = function () {
369
+        updateBackground();
370
+        editor.fireEvent('saveScene');
371
+    };
372
+    dialog.oncancel = function () {
373
+        editor.execCommand('background', backupStyle);
374
+    };
375
+
376
+})();

BIN
public/libs/ueditor/dialogs/background/images/bg.png Voir le fichier


BIN
public/libs/ueditor/dialogs/background/images/success.png Voir le fichier


+ 65
- 0
public/libs/ueditor/dialogs/charts/chart.config.js Voir le fichier

@@ -0,0 +1,65 @@
1
+/*
2
+ * 图表配置文件
3
+ * */
4
+
5
+
6
+//不同类型的配置
7
+var typeConfig = [
8
+    {
9
+        chart: {
10
+            type: 'line'
11
+        },
12
+        plotOptions: {
13
+            line: {
14
+                dataLabels: {
15
+                    enabled: false
16
+                },
17
+                enableMouseTracking: true
18
+            }
19
+        }
20
+    }, {
21
+        chart: {
22
+            type: 'line'
23
+        },
24
+        plotOptions: {
25
+            line: {
26
+                dataLabels: {
27
+                    enabled: true
28
+                },
29
+                enableMouseTracking: false
30
+            }
31
+        }
32
+    }, {
33
+        chart: {
34
+            type: 'area'
35
+        }
36
+    }, {
37
+        chart: {
38
+            type: 'bar'
39
+        }
40
+    }, {
41
+        chart: {
42
+            type: 'column'
43
+        }
44
+    }, {
45
+        chart: {
46
+            plotBackgroundColor: null,
47
+            plotBorderWidth: null,
48
+            plotShadow: false
49
+        },
50
+        plotOptions: {
51
+            pie: {
52
+                allowPointSelect: true,
53
+                cursor: 'pointer',
54
+                dataLabels: {
55
+                    enabled: true,
56
+                    color: '#000000',
57
+                    connectorColor: '#000000',
58
+                    formatter: function() {
59
+                        return '<b>'+ this.point.name +'</b>: '+ ( Math.round( this.point.percentage*100 ) / 100 ) +' %';
60
+                    }
61
+                }
62
+            }
63
+        }
64
+    }
65
+];

+ 165
- 0
public/libs/ueditor/dialogs/charts/charts.css Voir le fichier

@@ -0,0 +1,165 @@
1
+html, body {
2
+    width: 100%;
3
+    height: 100%;
4
+    margin: 0;
5
+    padding: 0;
6
+    overflow-x: hidden;
7
+}
8
+
9
+.main {
10
+    width: 100%;
11
+    overflow: hidden;
12
+}
13
+
14
+.table-view {
15
+    height: 100%;
16
+    float: left;
17
+    margin: 20px;
18
+    width: 40%;
19
+}
20
+
21
+.table-view .table-container {
22
+    width: 100%;
23
+    margin-bottom: 50px;
24
+    overflow: scroll;
25
+}
26
+
27
+.table-view th {
28
+    padding: 5px 10px;
29
+    background-color: #F7F7F7;
30
+}
31
+
32
+.table-view td {
33
+    width: 50px;
34
+    text-align: center;
35
+    padding:0;
36
+}
37
+
38
+.table-container input {
39
+    width: 40px;
40
+    padding: 5px;
41
+    border: none;
42
+    outline: none;
43
+}
44
+
45
+.table-view caption {
46
+    font-size: 18px;
47
+    text-align: left;
48
+}
49
+
50
+.charts-view {
51
+    /*margin-left: 49%!important;*/
52
+    width: 50%;
53
+    margin-left: 49%;
54
+    height: 400px;
55
+}
56
+
57
+.charts-container {
58
+    border-left: 1px solid #c3c3c3;
59
+}
60
+
61
+.charts-format fieldset {
62
+    padding-left: 20px;
63
+    margin-bottom: 50px;
64
+}
65
+
66
+.charts-format legend {
67
+    padding-left: 10px;
68
+    padding-right: 10px;
69
+}
70
+
71
+.format-item-container {
72
+    padding: 20px;
73
+}
74
+
75
+.format-item-container label {
76
+    display: block;
77
+    margin: 10px 0;
78
+}
79
+
80
+.charts-format .data-item {
81
+    border: 1px solid black;
82
+    outline: none;
83
+    padding: 2px 3px;
84
+}
85
+
86
+/* 图表类型 */
87
+
88
+.charts-type {
89
+    margin-top: 50px;
90
+    height: 300px;
91
+}
92
+
93
+.scroll-view {
94
+    border: 1px solid #c3c3c3;
95
+    border-left: none;
96
+    border-right: none;
97
+    overflow: hidden;
98
+}
99
+
100
+.scroll-container {
101
+    margin: 20px;
102
+    width: 100%;
103
+    overflow: hidden;
104
+}
105
+
106
+.scroll-bed {
107
+    width: 10000px;
108
+    _margin-top: 20px;
109
+    -webkit-transition: margin-left .5s ease;
110
+    -moz-transition: margin-left .5s ease;
111
+    transition: margin-left .5s ease;
112
+}
113
+
114
+.view-box {
115
+    display: inline-block;
116
+    *display: inline;
117
+    *zoom: 1;
118
+    margin-right: 20px;
119
+    border: 2px solid white;
120
+    line-height: 0;
121
+    overflow: hidden;
122
+    cursor: pointer;
123
+}
124
+
125
+.view-box img {
126
+    border: 1px solid #cecece;
127
+}
128
+
129
+.view-box.selected {
130
+    border-color: #7274A7;
131
+}
132
+
133
+.button-container {
134
+    margin-bottom: 20px;
135
+    text-align: center;
136
+}
137
+
138
+.button-container a {
139
+    display: inline-block;
140
+    width: 100px;
141
+    height: 25px;
142
+    line-height: 25px;
143
+    border: 1px solid #c2ccd1;
144
+    margin-right: 30px;
145
+    text-decoration: none;
146
+    color: black;
147
+    -webkit-border-radius: 2px;
148
+    -moz-border-radius: 2px;
149
+    border-radius: 2px;
150
+}
151
+
152
+.button-container a:HOVER {
153
+    background: #fcfcfc;
154
+}
155
+
156
+.button-container a:ACTIVE {
157
+    border-top-color: #c2ccd1;
158
+    box-shadow:inset 0 5px 4px -4px rgba(49, 49, 64, 0.1);
159
+}
160
+
161
+.edui-charts-not-data {
162
+    height: 100px;
163
+    line-height: 100px;
164
+    text-align: center;
165
+}

+ 89
- 0
public/libs/ueditor/dialogs/charts/charts.html Voir le fichier

@@ -0,0 +1,89 @@
1
+<!DOCTYPE html>
2
+<html>
3
+    <head>
4
+        <title>chart</title>
5
+        <meta chartset="utf-8">
6
+        <link rel="stylesheet" type="text/css" href="charts.css">
7
+        <script type="text/javascript" src="../internal.js"></script>
8
+    </head>
9
+    <body>
10
+        <div class="main">
11
+            <div class="table-view">
12
+                <h3><var id="lang_data_source"></var></h3>
13
+                <div id="tableContainer" class="table-container"></div>
14
+                <h3><var id="lang_chart_format"></var></h3>
15
+                <form name="data-form">
16
+                    <div class="charts-format">
17
+                        <fieldset>
18
+                            <legend><var id="lang_data_align"></var></legend>
19
+                            <div class="format-item-container">
20
+                                <label>
21
+                                    <input type="radio" class="format-ctrl not-pie-item" name="charts-format" value="1" checked="checked">
22
+                                    <var id="lang_chart_align_same"></var>
23
+                                </label>
24
+                                <label>
25
+                                    <input type="radio" class="format-ctrl not-pie-item" name="charts-format" value="-1">
26
+                                    <var id="lang_chart_align_reverse"></var>
27
+                                </label>
28
+                                <br>
29
+                            </div>
30
+                        </fieldset>
31
+                        <fieldset>
32
+                            <legend><var id="lang_chart_title"></var></legend>
33
+                            <div class="format-item-container">
34
+                                <label>
35
+                                    <var id="lang_chart_main_title"></var><input type="text" name="title" class="data-item">
36
+                                </label>
37
+                                <label>
38
+                                    <var id="lang_chart_sub_title"></var><input type="text" name="sub-title" class="data-item not-pie-item">
39
+                                </label>
40
+                                <label>
41
+                                    <var id="lang_chart_x_title"></var><input type="text" name="x-title" class="data-item not-pie-item">
42
+                                </label>
43
+                                <label>
44
+                                    <var id="lang_chart_y_title"></var><input type="text" name="y-title" class="data-item not-pie-item">
45
+                                </label>
46
+                            </div>
47
+                        </fieldset>
48
+                        <fieldset>
49
+                            <legend><var id="lang_chart_tip"></var></legend>
50
+                            <div class="format-item-container">
51
+                                <label>
52
+                                    <var id="lang_cahrt_tip_prefix"></var>
53
+                                    <input type="text" id="tipInput" name="tip" class="data-item" disabled="disabled">
54
+                                </label>
55
+                                <p><var id="lang_cahrt_tip_description"></var></p>
56
+                            </div>
57
+                        </fieldset>
58
+                        <fieldset>
59
+                            <legend><var id="lang_chart_data_unit"></var></legend>
60
+                            <div class="format-item-container">
61
+                                <label><var id="lang_chart_data_unit_title"></var><input type="text" name="unit" class="data-item"></label>
62
+                                <p><var id="lang_chart_data_unit_description"></var></p>
63
+                            </div>
64
+                        </fieldset>
65
+                    </div>
66
+                </form>
67
+            </div>
68
+            <div class="charts-view">
69
+                <div id="chartsContainer" class="charts-container"></div>
70
+                <div id="chartsType" class="charts-type">
71
+                    <h3><var id="lang_chart_type"></var></h3>
72
+                    <div class="scroll-view">
73
+                        <div class="scroll-container">
74
+                            <div id="scrollBed" class="scroll-bed"></div>
75
+                        </div>
76
+                        <div id="buttonContainer" class="button-container">
77
+                            <a href="#" data-title="prev"><var id="lang_prev_btn"></var></a>
78
+                            <a href="#" data-title="next"><var id="lang_next_btn"></var></a>
79
+                        </div>
80
+                    </div>
81
+                </div>
82
+            </div>
83
+        </div>
84
+        <script src="../../third-party/jquery-1.10.2.min.js"></script>
85
+        <script src="../../third-party/highcharts/highcharts.js"></script>
86
+        <script src="chart.config.js"></script>
87
+        <script src="charts.js"></script>
88
+    </body>
89
+</html>

+ 519
- 0
public/libs/ueditor/dialogs/charts/charts.js Voir le fichier

@@ -0,0 +1,519 @@
1
+/*
2
+ * 图片转换对话框脚本
3
+ **/
4
+
5
+var tableData = [],
6
+    //编辑器页面table
7
+    editorTable = null,
8
+    chartsConfig = window.typeConfig,
9
+    resizeTimer = null,
10
+    //初始默认图表类型
11
+    currentChartType = 0;
12
+
13
+window.onload = function () {
14
+
15
+    editorTable = domUtils.findParentByTagName( editor.selection.getRange().startContainer, 'table', true);
16
+
17
+    //未找到表格, 显示错误页面
18
+    if ( !editorTable ) {
19
+        document.body.innerHTML = "<div class='edui-charts-not-data'>未找到数据</div>";
20
+        return;
21
+    }
22
+
23
+    //初始化图表类型选择
24
+    initChartsTypeView();
25
+    renderTable( editorTable );
26
+    initEvent();
27
+    initUserConfig( editorTable.getAttribute( "data-chart" ) );
28
+    $( "#scrollBed .view-box:eq("+ currentChartType +")" ).trigger( "click" );
29
+    updateViewType( currentChartType );
30
+
31
+    dialog.addListener( "resize", function () {
32
+
33
+        if ( resizeTimer != null ) {
34
+            window.clearTimeout( resizeTimer );
35
+        }
36
+
37
+        resizeTimer = window.setTimeout( function () {
38
+
39
+            resizeTimer = null;
40
+
41
+            renderCharts();
42
+
43
+        }, 500 );
44
+
45
+    } );
46
+
47
+};
48
+
49
+function initChartsTypeView () {
50
+
51
+    var contents = [];
52
+
53
+    for ( var i = 0, len = chartsConfig.length; i<len; i++ ) {
54
+
55
+        contents.push( '<div class="view-box" data-chart-type="'+ i +'"><img width="300" src="images/charts'+ i +'.png"></div>' );
56
+
57
+    }
58
+
59
+    $( "#scrollBed" ).html( contents.join( "" ) );
60
+
61
+}
62
+
63
+//渲染table, 以便用户修改数据
64
+function renderTable ( table ) {
65
+
66
+    var tableHtml = [];
67
+
68
+    //构造数据
69
+    for ( var i = 0, row; row = table.rows[ i ]; i++ ) {
70
+
71
+        tableData[ i ] = [];
72
+        tableHtml[ i ] = [];
73
+
74
+        for ( var j = 0, cell; cell = row.cells[ j ]; j++ ) {
75
+
76
+            var value = getCellValue( cell );
77
+
78
+            if ( i > 0 && j > 0 ) {
79
+                value = +value;
80
+            }
81
+
82
+            if ( i === 0 || j === 0 ) {
83
+                tableHtml[ i ].push( '<th>'+ value +'</th>' );
84
+            } else {
85
+                tableHtml[ i ].push( '<td><input type="text" class="data-item" value="'+ value +'"></td>' );
86
+            }
87
+
88
+            tableData[ i ][ j ] = value;
89
+
90
+        }
91
+
92
+        tableHtml[ i ] = tableHtml[ i ].join( "" );
93
+
94
+    }
95
+
96
+    //draw 表格
97
+    $( "#tableContainer" ).html( '<table id="showTable" border="1"><tbody><tr>'+ tableHtml.join( "</tr><tr>" ) +'</tr></tbody></table>' );
98
+
99
+}
100
+
101
+/*
102
+ * 根据表格已有的图表属性初始化当前图表属性
103
+ */
104
+function initUserConfig ( config ) {
105
+
106
+    var parsedConfig = {};
107
+
108
+    if ( !config ) {
109
+        return;
110
+    }
111
+
112
+    config = config.split( ";" );
113
+
114
+    $.each( config, function ( index, item ) {
115
+
116
+        item = item.split( ":" );
117
+        parsedConfig[ item[ 0 ] ] = item[ 1 ];
118
+
119
+    } );
120
+
121
+    setUserConfig( parsedConfig );
122
+
123
+}
124
+
125
+function initEvent () {
126
+
127
+    var cacheValue = null,
128
+        //图表类型数
129
+        typeViewCount = chartsConfig.length- 1,
130
+        $chartsTypeViewBox = $( '#scrollBed .view-box' );
131
+
132
+    $( ".charts-format" ).delegate( ".format-ctrl", "change", function () {
133
+
134
+        renderCharts();
135
+
136
+    } )
137
+
138
+    $( ".table-view" ).delegate( ".data-item", "focus", function () {
139
+
140
+        cacheValue = this.value;
141
+
142
+    } ).delegate( ".data-item", "blur", function () {
143
+
144
+        if ( this.value !== cacheValue ) {
145
+            renderCharts();
146
+        }
147
+
148
+        cacheValue = null;
149
+
150
+    } );
151
+
152
+    $( "#buttonContainer" ).delegate( "a", "click", function (e) {
153
+
154
+        e.preventDefault();
155
+
156
+        if ( this.getAttribute( "data-title" ) === 'prev' ) {
157
+
158
+            if ( currentChartType > 0 ) {
159
+                currentChartType--;
160
+                updateViewType( currentChartType );
161
+            }
162
+
163
+        } else {
164
+
165
+            if ( currentChartType < typeViewCount ) {
166
+                currentChartType++;
167
+                updateViewType( currentChartType );
168
+            }
169
+
170
+        }
171
+
172
+    } );
173
+
174
+    //图表类型变化
175
+    $( '#scrollBed' ).delegate( ".view-box", "click", function (e) {
176
+
177
+        var index = $( this ).attr( "data-chart-type" );
178
+        $chartsTypeViewBox.removeClass( "selected" );
179
+        $( $chartsTypeViewBox[ index ] ).addClass( "selected" );
180
+
181
+        currentChartType = index | 0;
182
+
183
+        //饼图, 禁用部分配置
184
+        if ( currentChartType === chartsConfig.length - 1 ) {
185
+
186
+            disableNotPieConfig();
187
+
188
+        //启用完整配置
189
+        } else {
190
+
191
+            enableNotPieConfig();
192
+
193
+        }
194
+
195
+        renderCharts();
196
+
197
+    } );
198
+
199
+}
200
+
201
+function renderCharts () {
202
+
203
+    var data = collectData();
204
+
205
+    $('#chartsContainer').highcharts( $.extend( {}, chartsConfig[ currentChartType ], {
206
+
207
+        credits: {
208
+            enabled: false
209
+        },
210
+        exporting: {
211
+            enabled: false
212
+        },
213
+        title: {
214
+            text: data.title,
215
+            x: -20 //center
216
+        },
217
+        subtitle: {
218
+            text: data.subTitle,
219
+            x: -20
220
+        },
221
+        xAxis: {
222
+            title: {
223
+                text: data.xTitle
224
+            },
225
+            categories: data.categories
226
+        },
227
+        yAxis: {
228
+            title: {
229
+                text: data.yTitle
230
+            },
231
+            plotLines: [{
232
+                value: 0,
233
+                width: 1,
234
+                color: '#808080'
235
+            }]
236
+        },
237
+        tooltip: {
238
+            enabled: true,
239
+            valueSuffix: data.suffix
240
+        },
241
+        legend: {
242
+            layout: 'vertical',
243
+            align: 'right',
244
+            verticalAlign: 'middle',
245
+            borderWidth: 1
246
+        },
247
+        series: data.series
248
+
249
+    } ));
250
+
251
+}
252
+
253
+function updateViewType ( index ) {
254
+
255
+    $( "#scrollBed" ).css( 'marginLeft', -index*324+'px' );
256
+
257
+}
258
+
259
+function collectData () {
260
+
261
+    var form = document.forms[ 'data-form' ],
262
+        data = null;
263
+
264
+    if ( currentChartType !== chartsConfig.length - 1 ) {
265
+
266
+        data = getSeriesAndCategories();
267
+        $.extend( data, getUserConfig() );
268
+
269
+    //饼图数据格式
270
+    } else {
271
+        data = getSeriesForPieChart();
272
+        data.title = form[ 'title' ].value;
273
+        data.suffix = form[ 'unit' ].value;
274
+    }
275
+
276
+    return data;
277
+
278
+}
279
+
280
+/**
281
+ * 获取用户配置信息
282
+ */
283
+function getUserConfig () {
284
+
285
+    var form = document.forms[ 'data-form' ],
286
+        info = {
287
+            title: form[ 'title' ].value,
288
+            subTitle: form[ 'sub-title' ].value,
289
+            xTitle: form[ 'x-title' ].value,
290
+            yTitle: form[ 'y-title' ].value,
291
+            suffix: form[ 'unit' ].value,
292
+            //数据对齐方式
293
+            tableDataFormat: getTableDataFormat (),
294
+            //饼图提示文字
295
+            tip: $( "#tipInput" ).val()
296
+        };
297
+
298
+    return info;
299
+
300
+}
301
+
302
+function setUserConfig ( config ) {
303
+
304
+    var form = document.forms[ 'data-form' ];
305
+
306
+    config.title && ( form[ 'title' ].value = config.title );
307
+    config.subTitle && ( form[ 'sub-title' ].value = config.subTitle );
308
+    config.xTitle && ( form[ 'x-title' ].value = config.xTitle );
309
+    config.yTitle && ( form[ 'y-title' ].value = config.yTitle );
310
+    config.suffix && ( form[ 'unit' ].value = config.suffix );
311
+    config.dataFormat == "-1" && ( form[ 'charts-format' ][ 1 ].checked = true );
312
+    config.tip && ( form[ 'tip' ].value = config.tip );
313
+    currentChartType = config.chartType || 0;
314
+
315
+}
316
+
317
+function getSeriesAndCategories () {
318
+
319
+    var form = document.forms[ 'data-form' ],
320
+        series = [],
321
+        categories = [],
322
+        tmp = [],
323
+        tableData = getTableData();
324
+
325
+    //反转数据
326
+    if ( getTableDataFormat() === "-1" ) {
327
+
328
+        for ( var i = 0, len = tableData.length; i < len; i++ ) {
329
+
330
+            for ( var j = 0, jlen = tableData[ i ].length; j < jlen; j++ ) {
331
+
332
+                if ( !tmp[ j ] ) {
333
+                    tmp[ j ] = [];
334
+                }
335
+
336
+                tmp[ j ][ i ] = tableData[ i ][ j ];
337
+
338
+            }
339
+
340
+        }
341
+
342
+        tableData = tmp;
343
+
344
+    }
345
+
346
+    categories = tableData[0].slice( 1 );
347
+
348
+    for ( var i = 1, data; data = tableData[ i ]; i++ ) {
349
+
350
+        series.push( {
351
+            name: data[ 0 ],
352
+            data: data.slice( 1 )
353
+        } );
354
+
355
+    }
356
+
357
+    return {
358
+        series: series,
359
+        categories: categories
360
+    };
361
+
362
+}
363
+
364
+/*
365
+ * 获取数据源数据对齐方式
366
+ */
367
+function getTableDataFormat () {
368
+
369
+    var form = document.forms[ 'data-form' ],
370
+        items = form['charts-format'];
371
+
372
+    return items[ 0 ].checked ? items[ 0 ].value : items[ 1 ].value;
373
+
374
+}
375
+
376
+/*
377
+ * 禁用非饼图类型的配置项
378
+ */
379
+function disableNotPieConfig() {
380
+
381
+    updateConfigItem( 'disable' );
382
+
383
+}
384
+
385
+/*
386
+ * 启用非饼图类型的配置项
387
+ */
388
+function enableNotPieConfig() {
389
+
390
+    updateConfigItem( 'enable' );
391
+
392
+}
393
+
394
+function updateConfigItem ( value ) {
395
+
396
+    var table = $( "#showTable" )[ 0 ],
397
+        isDisable = value === 'disable' ? true : false;
398
+
399
+    //table中的input处理
400
+    for ( var i = 2 , row; row = table.rows[ i ]; i++ ) {
401
+
402
+        for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) {
403
+
404
+            $( "input", cell ).attr( "disabled", isDisable );
405
+
406
+        }
407
+
408
+    }
409
+
410
+    //其他项处理
411
+    $( "input.not-pie-item" ).attr( "disabled", isDisable );
412
+    $( "#tipInput" ).attr( "disabled", !isDisable )
413
+
414
+}
415
+
416
+/*
417
+ * 获取饼图数据
418
+ * 饼图的数据只取第一行的
419
+ **/
420
+function getSeriesForPieChart () {
421
+
422
+    var series = {
423
+            type: 'pie',
424
+            name: $("#tipInput").val(),
425
+            data: []
426
+        },
427
+        tableData = getTableData();
428
+
429
+
430
+    for ( var j = 1, jlen = tableData[ 0 ].length; j < jlen; j++ ) {
431
+
432
+        var title = tableData[ 0 ][ j ],
433
+            val = tableData[ 1 ][ j ];
434
+
435
+        series.data.push( [ title, val ] );
436
+
437
+    }
438
+
439
+    return {
440
+        series: [ series ]
441
+    };
442
+
443
+}
444
+
445
+function getTableData () {
446
+
447
+    var table = document.getElementById( "showTable" ),
448
+        xCount = table.rows[0].cells.length - 1,
449
+        values = getTableInputValue();
450
+
451
+    for ( var i = 0, value; value = values[ i ]; i++ ) {
452
+
453
+        tableData[ Math.floor( i / xCount ) + 1 ][ i % xCount + 1 ] = values[ i ];
454
+
455
+    }
456
+
457
+    return tableData;
458
+
459
+}
460
+
461
+function getTableInputValue () {
462
+
463
+    var table = document.getElementById( "showTable" ),
464
+        inputs = table.getElementsByTagName( "input" ),
465
+        values = [];
466
+
467
+    for ( var i = 0, input; input = inputs[ i ]; i++ ) {
468
+        values.push( input.value | 0 );
469
+    }
470
+
471
+    return values;
472
+
473
+}
474
+
475
+function getCellValue ( cell ) {
476
+
477
+    var value = utils.trim( ( cell.innerText || cell.textContent || '' ) );
478
+
479
+    return value.replace( new RegExp( UE.dom.domUtils.fillChar, 'g' ), '' ).replace( /^\s+|\s+$/g, '' );
480
+
481
+}
482
+
483
+
484
+//dialog确认事件
485
+dialog.onok = function () {
486
+
487
+    //收集信息
488
+    var form = document.forms[ 'data-form' ],
489
+        info = getUserConfig();
490
+
491
+    //添加图表类型
492
+    info.chartType = currentChartType;
493
+
494
+    //同步表格数据到编辑器
495
+    syncTableData();
496
+
497
+    //执行图表命令
498
+    editor.execCommand( 'charts', info );
499
+
500
+};
501
+
502
+/*
503
+ * 同步图表编辑视图的表格数据到编辑器里的原始表格
504
+ */
505
+function syncTableData () {
506
+
507
+    var tableData = getTableData();
508
+
509
+    for ( var i = 1, row; row = editorTable.rows[ i ]; i++ ) {
510
+
511
+        for ( var j = 1, cell; cell = row.cells[ j ]; j++ ) {
512
+
513
+            cell.innerHTML = tableData[ i ] [ j ];
514
+
515
+        }
516
+
517
+    }
518
+
519
+}

BIN
public/libs/ueditor/dialogs/charts/images/charts0.png Voir le fichier


BIN
public/libs/ueditor/dialogs/charts/images/charts1.png Voir le fichier


+ 0
- 0
public/libs/ueditor/dialogs/charts/images/charts2.png Voir le fichier


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff

Chargement…
Annuler
Enregistrer